@dendelion/paper-camp 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/assets/{index-Ddz2TPW1.js → index-CqDZ80wA.js} +3 -3
- package/dist/app/assets/{index-Ddz2TPW1.js.map → index-CqDZ80wA.js.map} +1 -1
- package/dist/app/assets/index-DAhfAB9y.js +3 -0
- package/dist/app/assets/index-DAhfAB9y.js.map +1 -0
- package/dist/app/assets/index-DYGnWiFG.js +2 -0
- package/dist/app/assets/index-DYGnWiFG.js.map +1 -0
- package/dist/app/assets/index-DuhmLhzz.js +2 -0
- package/dist/app/assets/{index-CR8PI9q6.js.map → index-DuhmLhzz.js.map} +1 -1
- package/dist/app/assets/index-HixYRYWW.js +2 -0
- package/dist/app/assets/index-HixYRYWW.js.map +1 -0
- package/dist/app/assets/index-VoRTCwB6.js +2 -0
- package/dist/app/assets/{index-BY8Yo_l0.js.map → index-VoRTCwB6.js.map} +1 -1
- package/dist/app/assets/{index-rxWn42R9.js → index-X5ikcKAy.js} +3 -3
- package/dist/app/assets/{index-rxWn42R9.js.map → index-X5ikcKAy.js.map} +1 -1
- package/dist/app/assets/{index-C1ORGbU3.js → index-sqaNs4DX.js} +2 -2
- package/dist/app/assets/{index-C1ORGbU3.js.map → index-sqaNs4DX.js.map} +1 -1
- package/dist/app/assets/main-BZd2c99C.css +1 -0
- package/dist/app/assets/main-Ceiva0Al.js +425 -0
- package/dist/app/assets/main-Ceiva0Al.js.map +1 -0
- package/dist/app/assets/{sidebar-section-Cqk2bPNP.js → sidebar-section-CW3WaioH.js} +2 -2
- package/dist/app/assets/{sidebar-section-Cqk2bPNP.js.map → sidebar-section-CW3WaioH.js.map} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/app/toolbar.js +1063 -1043
- package/dist/app/toolbar.js.map +1 -1
- package/dist/chunks/dev-port.BHJn90Pm.js +52 -0
- package/dist/chunks/dev-port.BHJn90Pm.js.map +1 -0
- package/dist/chunks/{phase-progress.DvktSTIz.js → machine-registry.DF3kTKHr.js} +1450 -1350
- package/dist/chunks/machine-registry.DF3kTKHr.js.map +1 -0
- package/dist/cli/index.js +7704 -7098
- package/dist/cli/index.js.map +1 -1
- package/dist/core/desk-discovery/evidence.d.ts +21 -0
- package/dist/core/desk-discovery/evidence.d.ts.map +1 -0
- package/dist/core/desk-discovery/evidence.test.d.ts +2 -0
- package/dist/core/desk-discovery/evidence.test.d.ts.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +123 -114
- package/dist/core/machine-registry/index.d.ts +2 -0
- package/dist/core/machine-registry/index.d.ts.map +1 -0
- package/dist/core/machine-registry/machine-registry.d.ts +39 -0
- package/dist/core/machine-registry/machine-registry.d.ts.map +1 -0
- package/dist/core/machine-registry/machine-registry.test.d.ts +2 -0
- package/dist/core/machine-registry/machine-registry.test.d.ts.map +1 -0
- package/dist/core/parse/schemas.d.ts +8 -0
- package/dist/core/parse/schemas.d.ts.map +1 -1
- package/dist/core/rate-limit.d.ts +8 -0
- package/dist/core/rate-limit.d.ts.map +1 -1
- package/dist/core/stats.d.ts +2 -2
- package/dist/core/stats.d.ts.map +1 -1
- package/dist/core/tailnet.d.ts +14 -0
- package/dist/core/tailnet.d.ts.map +1 -0
- package/dist/core/tailnet.test.d.ts +2 -0
- package/dist/core/tailnet.test.d.ts.map +1 -0
- package/dist/types/index.d.ts +24 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +19 -17
- package/dist/types/index.js.map +1 -1
- package/dist/vite/index.js +44 -51
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/proxy.d.ts +2 -1
- package/dist/vite/proxy.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/app/assets/index-B5TCF8_a.js +0 -2
- package/dist/app/assets/index-B5TCF8_a.js.map +0 -1
- package/dist/app/assets/index-BY8Yo_l0.js +0 -2
- package/dist/app/assets/index-BxRIu8zx.js +0 -3
- package/dist/app/assets/index-BxRIu8zx.js.map +0 -1
- package/dist/app/assets/index-C3R9IAt7.js +0 -2
- package/dist/app/assets/index-C3R9IAt7.js.map +0 -1
- package/dist/app/assets/index-CR8PI9q6.js +0 -2
- package/dist/app/assets/main-DkQCGPBX.js +0 -425
- package/dist/app/assets/main-DkQCGPBX.js.map +0 -1
- package/dist/app/assets/main-o2BbWpF4.css +0 -1
- package/dist/chunks/dev-port.DgdJE2bY.js +0 -43
- package/dist/chunks/dev-port.DgdJE2bY.js.map +0 -1
- package/dist/chunks/phase-progress.DvktSTIz.js.map +0 -1
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-sqaNs4DX.js","assets/sidebar-section-CW3WaioH.js","assets/index-HixYRYWW.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 sd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var G1={exports:{}},mf={},Z1={exports:{}},ue={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var Yl=Symbol.for("react.element"),fA=Symbol.for("react.portal"),hA=Symbol.for("react.fragment"),pA=Symbol.for("react.strict_mode"),mA=Symbol.for("react.profiler"),gA=Symbol.for("react.provider"),yA=Symbol.for("react.context"),xA=Symbol.for("react.forward_ref"),vA=Symbol.for("react.suspense"),wA=Symbol.for("react.memo"),bA=Symbol.for("react.lazy"),Qv=Symbol.iterator;function kA(e){return e===null||typeof e!="object"?null:(e=Qv&&e[Qv]||e["@@iterator"],typeof e=="function"?e:null)}var q1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y1=Object.assign,J1={};function Jo(e,t,n){this.props=e,this.context=t,this.refs=J1,this.updater=n||q1}Jo.prototype.isReactComponent={};Jo.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")};Jo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Q1(){}Q1.prototype=Jo.prototype;function hy(e,t,n){this.props=e,this.context=t,this.refs=J1,this.updater=n||q1}var py=hy.prototype=new Q1;py.constructor=hy;Y1(py,Jo.prototype);py.isPureReactComponent=!0;var Xv=Array.isArray,X1=Object.prototype.hasOwnProperty,my={current:null},eS={key:!0,ref:!0,__self:!0,__source:!0};function tS(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)X1.call(t,r)&&!eS.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:Yl,type:e,key:i,ref:o,props:s,_owner:my.current}}function _A(e,t){return{$$typeof:Yl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function gy(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yl}function SA(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var e0=/\/+/g;function vh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?SA(""+e.key):t.toString(36)}function Cu(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 Yl:case fA:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+vh(o,0):r,Xv(s)?(n="",e!=null&&(n=e.replace(e0,"$&/")+"/"),Cu(s,t,n,"",function(c){return c})):s!=null&&(gy(s)&&(s=_A(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(e0,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Xv(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+vh(i,a);o+=Cu(i,t,n,l,s)}else if(l=kA(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+vh(i,a++),o+=Cu(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 Tc(e,t,n){if(e==null)return e;var r=[],s=0;return Cu(e,r,"","",function(i){return t.call(n,i,s++)}),r}function CA(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 $t={current:null},ju={transition:null},jA={ReactCurrentDispatcher:$t,ReactCurrentBatchConfig:ju,ReactCurrentOwner:my};function nS(){throw Error("act(...) is not supported in production builds of React.")}ue.Children={map:Tc,forEach:function(e,t,n){Tc(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Tc(e,function(){t++}),t},toArray:function(e){return Tc(e,function(t){return t})||[]},only:function(e){if(!gy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ue.Component=Jo;ue.Fragment=hA;ue.Profiler=mA;ue.PureComponent=hy;ue.StrictMode=pA;ue.Suspense=vA;ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jA;ue.act=nS;ue.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=Y1({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=my.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)X1.call(t,l)&&!eS.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:Yl,type:e.type,key:s,ref:i,props:r,_owner:o}};ue.createContext=function(e){return e={$$typeof:yA,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:gA,_context:e},e.Consumer=e};ue.createElement=tS;ue.createFactory=function(e){var t=tS.bind(null,e);return t.type=e,t};ue.createRef=function(){return{current:null}};ue.forwardRef=function(e){return{$$typeof:xA,render:e}};ue.isValidElement=gy;ue.lazy=function(e){return{$$typeof:bA,_payload:{_status:-1,_result:e},_init:CA}};ue.memo=function(e,t){return{$$typeof:wA,type:e,compare:t===void 0?null:t}};ue.startTransition=function(e){var t=ju.transition;ju.transition={};try{e()}finally{ju.transition=t}};ue.unstable_act=nS;ue.useCallback=function(e,t){return $t.current.useCallback(e,t)};ue.useContext=function(e){return $t.current.useContext(e)};ue.useDebugValue=function(){};ue.useDeferredValue=function(e){return $t.current.useDeferredValue(e)};ue.useEffect=function(e,t){return $t.current.useEffect(e,t)};ue.useId=function(){return $t.current.useId()};ue.useImperativeHandle=function(e,t,n){return $t.current.useImperativeHandle(e,t,n)};ue.useInsertionEffect=function(e,t){return $t.current.useInsertionEffect(e,t)};ue.useLayoutEffect=function(e,t){return $t.current.useLayoutEffect(e,t)};ue.useMemo=function(e,t){return $t.current.useMemo(e,t)};ue.useReducer=function(e,t,n){return $t.current.useReducer(e,t,n)};ue.useRef=function(e){return $t.current.useRef(e)};ue.useState=function(e){return $t.current.useState(e)};ue.useSyncExternalStore=function(e,t,n){return $t.current.useSyncExternalStore(e,t,n)};ue.useTransition=function(){return $t.current.useTransition()};ue.version="18.3.1";Z1.exports=ue;var b=Z1.exports;const Ro=pf(b);/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var EA=b,PA=Symbol.for("react.element"),TA=Symbol.for("react.fragment"),NA=Object.prototype.hasOwnProperty,IA=EA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,AA={key:!0,ref:!0,__self:!0,__source:!0};function rS(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)NA.call(t,r)&&!AA.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:PA,type:e,key:i,ref:o,props:s,_owner:IA.current}}mf.Fragment=TA;mf.jsx=rS;mf.jsxs=rS;G1.exports=mf;var d=G1.exports,sS={exports:{}},gn={},iS={exports:{}},oS={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/(function(e){function t(O,V){var C=O.length;O.push(V);e:for(;0<C;){var U=C-1>>>1,Q=O[U];if(0<s(Q,V))O[U]=V,O[C]=Q,C=U;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var V=O[0],C=O.pop();if(C!==V){O[0]=C;e:for(var U=0,Q=O.length,A=Q>>>1;U<A;){var ge=2*(U+1)-1,ke=O[ge],ve=ge+1,Xt=O[ve];if(0>s(ke,C))ve<Q&&0>s(Xt,ke)?(O[U]=Xt,O[ve]=C,U=ve):(O[U]=ke,O[ge]=C,U=ge);else if(ve<Q&&0>s(Xt,C))O[U]=Xt,O[ve]=C,U=ve;else break e}}return V}function s(O,V){var C=O.sortIndex-V.sortIndex;return C!==0?C:O.id-V.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,f=null,h=3,p=!1,m=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(O){for(var V=n(c);V!==null;){if(V.callback===null)r(c);else if(V.startTime<=O)r(c),V.sortIndex=V.expirationTime,t(l,V);else break;V=n(c)}}function k(O){if(g=!1,w(O),!m)if(n(l)!==null)m=!0,$(_);else{var V=n(c);V!==null&&D(k,V.startTime-O)}}function _(O,V){m=!1,g&&(g=!1,y(E),E=-1),p=!0;var C=h;try{for(w(V),f=n(l);f!==null&&(!(f.expirationTime>V)||O&&!N());){var U=f.callback;if(typeof U=="function"){f.callback=null,h=f.priorityLevel;var Q=U(f.expirationTime<=V);V=e.unstable_now(),typeof Q=="function"?f.callback=Q:f===n(l)&&r(l),w(V)}else r(l);f=n(l)}if(f!==null)var A=!0;else{var ge=n(c);ge!==null&&D(k,ge.startTime-V),A=!1}return A}finally{f=null,h=C,p=!1}}var S=!1,j=null,E=-1,T=5,P=-1;function N(){return!(e.unstable_now()-P<T)}function R(){if(j!==null){var O=e.unstable_now();P=O;var V=!0;try{V=j(!0,O)}finally{V?L():(S=!1,j=null)}}else S=!1}var L;if(typeof v=="function")L=function(){v(R)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,z=I.port2;I.port1.onmessage=R,L=function(){z.postMessage(null)}}else L=function(){x(R,0)};function $(O){j=O,S||(S=!0,L())}function D(O,V){E=x(function(){O(e.unstable_now())},V)}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(O){O.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,$(_))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(O){switch(h){case 1:case 2:case 3:var V=3;break;default:V=h}var C=h;h=V;try{return O()}finally{h=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,V){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var C=h;h=O;try{return V()}finally{h=C}},e.unstable_scheduleCallback=function(O,V,C){var U=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?U+C:U):C=U,O){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,O={id:u++,callback:V,priorityLevel:O,startTime:C,expirationTime:Q,sortIndex:-1},C>U?(O.sortIndex=C,t(c,O),n(l)===null&&O===n(c)&&(g?(y(E),E=-1):g=!0,D(k,C-U))):(O.sortIndex=Q,t(l,O),m||p||(m=!0,$(_))),O},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(O){var V=h;return function(){var C=h;h=V;try{return O.apply(this,arguments)}finally{h=C}}}})(oS);iS.exports=oS;var RA=iS.exports;/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var LA=b,pn=RA;function K(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 aS=new Set,gl={};function Pi(e,t){Lo(e,t),Lo(e+"Capture",t)}function Lo(e,t){for(gl[e]=t,e=0;e<t.length;e++)aS.add(t[e])}var Fr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rm=Object.prototype.hasOwnProperty,MA=/^[: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]*$/,t0={},n0={};function $A(e){return rm.call(n0,e)?!0:rm.call(t0,e)?!1:MA.test(e)?n0[e]=!0:(t0[e]=!0,!1)}function DA(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 OA(e,t,n,r){if(t===null||typeof t>"u"||DA(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 Dt(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 yt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){yt[e]=new Dt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];yt[t]=new Dt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){yt[e]=new Dt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){yt[e]=new Dt(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){yt[e]=new Dt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){yt[e]=new Dt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){yt[e]=new Dt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){yt[e]=new Dt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){yt[e]=new Dt(e,5,!1,e.toLowerCase(),null,!1,!1)});var yy=/[\-:]([a-z])/g;function xy(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(yy,xy);yt[t]=new Dt(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(yy,xy);yt[t]=new Dt(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(yy,xy);yt[t]=new Dt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){yt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!1,!1)});yt.xlinkHref=new Dt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){yt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!0,!0)});function vy(e,t,n,r){var s=yt.hasOwnProperty(t)?yt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(OA(t,n,s,r)&&(n=null),r||s===null?$A(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 Wr=LA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Nc=Symbol.for("react.element"),Xi=Symbol.for("react.portal"),eo=Symbol.for("react.fragment"),wy=Symbol.for("react.strict_mode"),sm=Symbol.for("react.profiler"),lS=Symbol.for("react.provider"),cS=Symbol.for("react.context"),by=Symbol.for("react.forward_ref"),im=Symbol.for("react.suspense"),om=Symbol.for("react.suspense_list"),ky=Symbol.for("react.memo"),is=Symbol.for("react.lazy"),uS=Symbol.for("react.offscreen"),r0=Symbol.iterator;function va(e){return e===null||typeof e!="object"?null:(e=r0&&e[r0]||e["@@iterator"],typeof e=="function"?e:null)}var ze=Object.assign,wh;function Fa(e){if(wh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);wh=t&&t[1]||""}return`
|
|
35
|
+
`+wh+e}var bh=!1;function kh(e,t){if(!e||bh)return"";bh=!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
|
+
`),i=r.stack.split(`
|
|
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{bh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fa(e):""}function zA(e){switch(e.tag){case 5:return Fa(e.type);case 16:return Fa("Lazy");case 13:return Fa("Suspense");case 19:return Fa("SuspenseList");case 0:case 2:case 15:return e=kh(e.type,!1),e;case 11:return e=kh(e.type.render,!1),e;case 1:return e=kh(e.type,!0),e;default:return""}}function am(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 eo:return"Fragment";case Xi:return"Portal";case sm:return"Profiler";case wy:return"StrictMode";case im:return"Suspense";case om:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case cS:return(e.displayName||"Context")+".Consumer";case lS:return(e._context.displayName||"Context")+".Provider";case by:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ky:return t=e.displayName||null,t!==null?t:am(e.type)||"Memo";case is:t=e._payload,e=e._init;try{return am(e(t))}catch{}}return null}function FA(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 am(t);case 8:return t===wy?"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 Ns(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function BA(e){var t=dS(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 Ic(e){e._valueTracker||(e._valueTracker=BA(e))}function fS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=dS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function id(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 lm(e,t){var n=t.checked;return ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function s0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ns(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 hS(e,t){t=t.checked,t!=null&&vy(e,"checked",t,!1)}function cm(e,t){hS(e,t);var n=Ns(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")?um(e,t.type,n):t.hasOwnProperty("defaultValue")&&um(e,t.type,Ns(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function i0(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 um(e,t,n){(t!=="number"||id(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ba=Array.isArray;function wo(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=""+Ns(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 dm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return ze({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function o0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(K(92));if(Ba(n)){if(1<n.length)throw Error(K(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ns(n)}}function pS(e,t){var n=Ns(t.value),r=Ns(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 a0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function mS(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 fm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?mS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ac,gS=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(Ac=Ac||document.createElement("div"),Ac.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ac.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qa={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},VA=["Webkit","ms","Moz","O"];Object.keys(qa).forEach(function(e){VA.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qa[t]=qa[e]})});function yS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qa.hasOwnProperty(e)&&qa[e]?(""+t).trim():t+"px"}function xS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=yS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var UA=ze({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 hm(e,t){if(t){if(UA[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function pm(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 mm=null;function _y(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gm=null,bo=null,ko=null;function l0(e){if(e=Xl(e)){if(typeof gm!="function")throw Error(K(280));var t=e.stateNode;t&&(t=wf(t),gm(e.stateNode,e.type,t))}}function vS(e){bo?ko?ko.push(e):ko=[e]:bo=e}function wS(){if(bo){var e=bo,t=ko;if(ko=bo=null,l0(e),t)for(e=0;e<t.length;e++)l0(t[e])}}function bS(e,t){return e(t)}function kS(){}var _h=!1;function _S(e,t,n){if(_h)return e(t,n);_h=!0;try{return bS(e,t,n)}finally{_h=!1,(bo!==null||ko!==null)&&(kS(),wS())}}function xl(e,t){var n=e.stateNode;if(n===null)return null;var r=wf(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(K(231,t,typeof n));return n}var ym=!1;if(Fr)try{var wa={};Object.defineProperty(wa,"passive",{get:function(){ym=!0}}),window.addEventListener("test",wa,wa),window.removeEventListener("test",wa,wa)}catch{ym=!1}function WA(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 Ya=!1,od=null,ad=!1,xm=null,KA={onError:function(e){Ya=!0,od=e}};function HA(e,t,n,r,s,i,o,a,l){Ya=!1,od=null,WA.apply(KA,arguments)}function GA(e,t,n,r,s,i,o,a,l){if(HA.apply(this,arguments),Ya){if(Ya){var c=od;Ya=!1,od=null}else throw Error(K(198));ad||(ad=!0,xm=c)}}function Ti(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 SS(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 c0(e){if(Ti(e)!==e)throw Error(K(188))}function ZA(e){var t=e.alternate;if(!t){if(t=Ti(e),t===null)throw Error(K(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 c0(s),e;if(i===r)return c0(s),t;i=i.sibling}throw Error(K(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(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?e:t}function CS(e){return e=ZA(e),e!==null?jS(e):null}function jS(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=jS(e);if(t!==null)return t;e=e.sibling}return null}var ES=pn.unstable_scheduleCallback,u0=pn.unstable_cancelCallback,qA=pn.unstable_shouldYield,YA=pn.unstable_requestPaint,Ke=pn.unstable_now,JA=pn.unstable_getCurrentPriorityLevel,Sy=pn.unstable_ImmediatePriority,PS=pn.unstable_UserBlockingPriority,ld=pn.unstable_NormalPriority,QA=pn.unstable_LowPriority,TS=pn.unstable_IdlePriority,gf=null,xr=null;function XA(e){if(xr&&typeof xr.onCommitFiberRoot=="function")try{xr.onCommitFiberRoot(gf,e,void 0,(e.current.flags&128)===128)}catch{}}var Jn=Math.clz32?Math.clz32:n2,e2=Math.log,t2=Math.LN2;function n2(e){return e>>>=0,e===0?32:31-(e2(e)/t2|0)|0}var Rc=64,Lc=4194304;function Va(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 cd(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=Va(a):(i&=o,i!==0&&(r=Va(i)))}else o=n&~s,o!==0?r=Va(o):i!==0&&(r=Va(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-Jn(t),s=1<<n,r|=e[n],t&=~s;return r}function r2(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 s2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Jn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=r2(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function vm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function NS(){var e=Rc;return Rc<<=1,!(Rc&4194240)&&(Rc=64),e}function Sh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Jl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Jn(t),e[t]=n}function i2(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-Jn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Cy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Jn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var xe=0;function IS(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var AS,jy,RS,LS,MS,wm=!1,Mc=[],xs=null,vs=null,ws=null,vl=new Map,wl=new Map,cs=[],o2="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 d0(e,t){switch(e){case"focusin":case"focusout":xs=null;break;case"dragenter":case"dragleave":vs=null;break;case"mouseover":case"mouseout":ws=null;break;case"pointerover":case"pointerout":vl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(t.pointerId)}}function ba(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=Xl(t),t!==null&&jy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function a2(e,t,n,r,s){switch(t){case"focusin":return xs=ba(xs,e,t,n,r,s),!0;case"dragenter":return vs=ba(vs,e,t,n,r,s),!0;case"mouseover":return ws=ba(ws,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return vl.set(i,ba(vl.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,wl.set(i,ba(wl.get(i)||null,e,t,n,r,s)),!0}return!1}function $S(e){var t=si(e.target);if(t!==null){var n=Ti(t);if(n!==null){if(t=n.tag,t===13){if(t=SS(n),t!==null){e.blockedOn=t,MS(e.priority,function(){RS(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 Eu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mm=r,n.target.dispatchEvent(r),mm=null}else return t=Xl(n),t!==null&&jy(t),e.blockedOn=n,!1;t.shift()}return!0}function f0(e,t,n){Eu(e)&&n.delete(t)}function l2(){wm=!1,xs!==null&&Eu(xs)&&(xs=null),vs!==null&&Eu(vs)&&(vs=null),ws!==null&&Eu(ws)&&(ws=null),vl.forEach(f0),wl.forEach(f0)}function ka(e,t){e.blockedOn===t&&(e.blockedOn=null,wm||(wm=!0,pn.unstable_scheduleCallback(pn.unstable_NormalPriority,l2)))}function bl(e){function t(s){return ka(s,e)}if(0<Mc.length){ka(Mc[0],e);for(var n=1;n<Mc.length;n++){var r=Mc[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xs!==null&&ka(xs,e),vs!==null&&ka(vs,e),ws!==null&&ka(ws,e),vl.forEach(t),wl.forEach(t),n=0;n<cs.length;n++)r=cs[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<cs.length&&(n=cs[0],n.blockedOn===null);)$S(n),n.blockedOn===null&&cs.shift()}var _o=Wr.ReactCurrentBatchConfig,ud=!0;function c2(e,t,n,r){var s=xe,i=_o.transition;_o.transition=null;try{xe=1,Ey(e,t,n,r)}finally{xe=s,_o.transition=i}}function u2(e,t,n,r){var s=xe,i=_o.transition;_o.transition=null;try{xe=4,Ey(e,t,n,r)}finally{xe=s,_o.transition=i}}function Ey(e,t,n,r){if(ud){var s=bm(e,t,n,r);if(s===null)Lh(e,t,r,dd,n),d0(e,r);else if(a2(s,e,t,n,r))r.stopPropagation();else if(d0(e,r),t&4&&-1<o2.indexOf(e)){for(;s!==null;){var i=Xl(s);if(i!==null&&AS(i),i=bm(e,t,n,r),i===null&&Lh(e,t,r,dd,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Lh(e,t,r,null,n)}}var dd=null;function bm(e,t,n,r){if(dd=null,e=_y(r),e=si(e),e!==null)if(t=Ti(e),t===null)e=null;else if(n=t.tag,n===13){if(e=SS(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 dd=e,null}function DS(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(JA()){case Sy:return 1;case PS:return 4;case ld:case QA:return 16;case TS:return 536870912;default:return 16}default:return 16}}var ds=null,Py=null,Pu=null;function OS(){if(Pu)return Pu;var e,t=Py,n=t.length,r,s="value"in ds?ds.value:ds.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 Pu=s.slice(e,1<r?1-r:void 0)}function Tu(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 $c(){return!0}function h0(){return!1}function yn(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)?$c:h0,this.isPropagationStopped=h0,this}return ze(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=$c)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=$c)},persist:function(){},isPersistent:$c}),t}var Qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ty=yn(Qo),Ql=ze({},Qo,{view:0,detail:0}),d2=yn(Ql),Ch,jh,_a,yf=ze({},Ql,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ny,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!==_a&&(_a&&e.type==="mousemove"?(Ch=e.screenX-_a.screenX,jh=e.screenY-_a.screenY):jh=Ch=0,_a=e),Ch)},movementY:function(e){return"movementY"in e?e.movementY:jh}}),p0=yn(yf),f2=ze({},yf,{dataTransfer:0}),h2=yn(f2),p2=ze({},Ql,{relatedTarget:0}),Eh=yn(p2),m2=ze({},Qo,{animationName:0,elapsedTime:0,pseudoElement:0}),g2=yn(m2),y2=ze({},Qo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),x2=yn(y2),v2=ze({},Qo,{data:0}),m0=yn(v2),w2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},b2={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"},k2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=k2[e])?!!t[e]:!1}function Ny(){return _2}var S2=ze({},Ql,{key:function(e){if(e.key){var t=w2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Tu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?b2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ny,charCode:function(e){return e.type==="keypress"?Tu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Tu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),C2=yn(S2),j2=ze({},yf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),g0=yn(j2),E2=ze({},Ql,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ny}),P2=yn(E2),T2=ze({},Qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),N2=yn(T2),I2=ze({},yf,{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}),A2=yn(I2),R2=[9,13,27,32],Iy=Fr&&"CompositionEvent"in window,Ja=null;Fr&&"documentMode"in document&&(Ja=document.documentMode);var L2=Fr&&"TextEvent"in window&&!Ja,zS=Fr&&(!Iy||Ja&&8<Ja&&11>=Ja),y0=" ",x0=!1;function FS(e,t){switch(e){case"keyup":return R2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function BS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var to=!1;function M2(e,t){switch(e){case"compositionend":return BS(t);case"keypress":return t.which!==32?null:(x0=!0,y0);case"textInput":return e=t.data,e===y0&&x0?null:e;default:return null}}function $2(e,t){if(to)return e==="compositionend"||!Iy&&FS(e,t)?(e=OS(),Pu=Py=ds=null,to=!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 zS&&t.locale!=="ko"?null:t.data;default:return null}}var D2={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 v0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!D2[e.type]:t==="textarea"}function VS(e,t,n,r){vS(r),t=fd(t,"onChange"),0<t.length&&(n=new Ty("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Qa=null,kl=null;function O2(e){XS(e,0)}function xf(e){var t=so(e);if(fS(t))return e}function z2(e,t){if(e==="change")return t}var US=!1;if(Fr){var Ph;if(Fr){var Th="oninput"in document;if(!Th){var w0=document.createElement("div");w0.setAttribute("oninput","return;"),Th=typeof w0.oninput=="function"}Ph=Th}else Ph=!1;US=Ph&&(!document.documentMode||9<document.documentMode)}function b0(){Qa&&(Qa.detachEvent("onpropertychange",WS),kl=Qa=null)}function WS(e){if(e.propertyName==="value"&&xf(kl)){var t=[];VS(t,kl,e,_y(e)),_S(O2,t)}}function F2(e,t,n){e==="focusin"?(b0(),Qa=t,kl=n,Qa.attachEvent("onpropertychange",WS)):e==="focusout"&&b0()}function B2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xf(kl)}function V2(e,t){if(e==="click")return xf(t)}function U2(e,t){if(e==="input"||e==="change")return xf(t)}function W2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var er=typeof Object.is=="function"?Object.is:W2;function _l(e,t){if(er(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(!rm.call(t,s)||!er(e[s],t[s]))return!1}return!0}function k0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _0(e,t){var n=k0(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=k0(n)}}function KS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?KS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function HS(){for(var e=window,t=id();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=id(e.document)}return t}function Ay(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 K2(e){var t=HS(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&KS(n.ownerDocument.documentElement,n)){if(r!==null&&Ay(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=_0(n,i);var o=_0(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 H2=Fr&&"documentMode"in document&&11>=document.documentMode,no=null,km=null,Xa=null,_m=!1;function S0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_m||no==null||no!==id(r)||(r=no,"selectionStart"in r&&Ay(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}),Xa&&_l(Xa,r)||(Xa=r,r=fd(km,"onSelect"),0<r.length&&(t=new Ty("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=no)))}function Dc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ro={animationend:Dc("Animation","AnimationEnd"),animationiteration:Dc("Animation","AnimationIteration"),animationstart:Dc("Animation","AnimationStart"),transitionend:Dc("Transition","TransitionEnd")},Nh={},GS={};Fr&&(GS=document.createElement("div").style,"AnimationEvent"in window||(delete ro.animationend.animation,delete ro.animationiteration.animation,delete ro.animationstart.animation),"TransitionEvent"in window||delete ro.transitionend.transition);function vf(e){if(Nh[e])return Nh[e];if(!ro[e])return e;var t=ro[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in GS)return Nh[e]=t[n];return e}var ZS=vf("animationend"),qS=vf("animationiteration"),YS=vf("animationstart"),JS=vf("transitionend"),QS=new Map,C0="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 $s(e,t){QS.set(e,t),Pi(t,[e])}for(var Ih=0;Ih<C0.length;Ih++){var Ah=C0[Ih],G2=Ah.toLowerCase(),Z2=Ah[0].toUpperCase()+Ah.slice(1);$s(G2,"on"+Z2)}$s(ZS,"onAnimationEnd");$s(qS,"onAnimationIteration");$s(YS,"onAnimationStart");$s("dblclick","onDoubleClick");$s("focusin","onFocus");$s("focusout","onBlur");$s(JS,"onTransitionEnd");Lo("onMouseEnter",["mouseout","mouseover"]);Lo("onMouseLeave",["mouseout","mouseover"]);Lo("onPointerEnter",["pointerout","pointerover"]);Lo("onPointerLeave",["pointerout","pointerover"]);Pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Pi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ua="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(" "),q2=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ua));function j0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,GA(r,t,void 0,e),e.currentTarget=null}function XS(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;j0(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;j0(s,a,c),i=l}}}if(ad)throw e=xm,ad=!1,xm=null,e}function Ae(e,t){var n=t[Pm];n===void 0&&(n=t[Pm]=new Set);var r=e+"__bubble";n.has(r)||(eC(t,e,2,!1),n.add(r))}function Rh(e,t,n){var r=0;t&&(r|=4),eC(n,e,r,t)}var Oc="_reactListening"+Math.random().toString(36).slice(2);function Sl(e){if(!e[Oc]){e[Oc]=!0,aS.forEach(function(n){n!=="selectionchange"&&(q2.has(n)||Rh(n,!1,e),Rh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Oc]||(t[Oc]=!0,Rh("selectionchange",!1,t))}}function eC(e,t,n,r){switch(DS(t)){case 1:var s=c2;break;case 4:s=u2;break;default:s=Ey}n=s.bind(null,t,n,e),s=void 0,!ym||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 Lh(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=si(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}_S(function(){var c=i,u=_y(n),f=[];e:{var h=QS.get(e);if(h!==void 0){var p=Ty,m=e;switch(e){case"keypress":if(Tu(n)===0)break e;case"keydown":case"keyup":p=C2;break;case"focusin":m="focus",p=Eh;break;case"focusout":m="blur",p=Eh;break;case"beforeblur":case"afterblur":p=Eh;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=p0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=h2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=P2;break;case ZS:case qS:case YS:p=g2;break;case JS:p=N2;break;case"scroll":p=d2;break;case"wheel":p=A2;break;case"copy":case"cut":case"paste":p=x2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=g0}var g=(t&4)!==0,x=!g&&e==="scroll",y=g?h!==null?h+"Capture":null:h;g=[];for(var v=c,w;v!==null;){w=v;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,y!==null&&(k=xl(v,y),k!=null&&g.push(Cl(v,k,w)))),x)break;v=v.return}0<g.length&&(h=new p(h,m,null,n,u),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==mm&&(m=n.relatedTarget||n.fromElement)&&(si(m)||m[Br]))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?si(m):null,m!==null&&(x=Ti(m),m!==x||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=p0,k="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=g0,k="onPointerLeave",y="onPointerEnter",v="pointer"),x=p==null?h:so(p),w=m==null?h:so(m),h=new g(k,v+"leave",p,n,u),h.target=x,h.relatedTarget=w,k=null,si(u)===c&&(g=new g(y,v+"enter",m,n,u),g.target=w,g.relatedTarget=x,k=g),x=k,p&&m)t:{for(g=p,y=m,v=0,w=g;w;w=Fi(w))v++;for(w=0,k=y;k;k=Fi(k))w++;for(;0<v-w;)g=Fi(g),v--;for(;0<w-v;)y=Fi(y),w--;for(;v--;){if(g===y||y!==null&&g===y.alternate)break t;g=Fi(g),y=Fi(y)}g=null}else g=null;p!==null&&E0(f,h,p,g,!1),m!==null&&x!==null&&E0(f,x,m,g,!0)}}e:{if(h=c?so(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var _=z2;else if(v0(h))if(US)_=U2;else{_=B2;var S=F2}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(_=V2);if(_&&(_=_(e,c))){VS(f,_,n,u);break e}S&&S(e,h,c),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&um(h,"number",h.value)}switch(S=c?so(c):window,e){case"focusin":(v0(S)||S.contentEditable==="true")&&(no=S,km=c,Xa=null);break;case"focusout":Xa=km=no=null;break;case"mousedown":_m=!0;break;case"contextmenu":case"mouseup":case"dragend":_m=!1,S0(f,n,u);break;case"selectionchange":if(H2)break;case"keydown":case"keyup":S0(f,n,u)}var j;if(Iy)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else to?FS(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(zS&&n.locale!=="ko"&&(to||E!=="onCompositionStart"?E==="onCompositionEnd"&&to&&(j=OS()):(ds=u,Py="value"in ds?ds.value:ds.textContent,to=!0)),S=fd(c,E),0<S.length&&(E=new m0(E,e,null,n,u),f.push({event:E,listeners:S}),j?E.data=j:(j=BS(n),j!==null&&(E.data=j)))),(j=L2?M2(e,n):$2(e,n))&&(c=fd(c,"onBeforeInput"),0<c.length&&(u=new m0("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=j))}XS(f,t)})}function Cl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fd(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=xl(e,n),i!=null&&r.unshift(Cl(e,i,s)),i=xl(e,t),i!=null&&r.push(Cl(e,i,s))),e=e.return}return r}function Fi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function E0(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=xl(n,i),l!=null&&o.unshift(Cl(n,l,a))):s||(l=xl(n,i),l!=null&&o.push(Cl(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Y2=/\r\n?/g,J2=/\u0000|\uFFFD/g;function P0(e){return(typeof e=="string"?e:""+e).replace(Y2,`
|
|
39
|
+
`).replace(J2,"")}function zc(e,t,n){if(t=P0(t),P0(e)!==t&&n)throw Error(K(425))}function hd(){}var Sm=null,Cm=null;function jm(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 Em=typeof setTimeout=="function"?setTimeout:void 0,Q2=typeof clearTimeout=="function"?clearTimeout:void 0,T0=typeof Promise=="function"?Promise:void 0,X2=typeof queueMicrotask=="function"?queueMicrotask:typeof T0<"u"?function(e){return T0.resolve(null).then(e).catch(eR)}:Em;function eR(e){setTimeout(function(){throw e})}function Mh(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),bl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);bl(t)}function bs(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 N0(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 Xo=Math.random().toString(36).slice(2),gr="__reactFiber$"+Xo,jl="__reactProps$"+Xo,Br="__reactContainer$"+Xo,Pm="__reactEvents$"+Xo,tR="__reactListeners$"+Xo,nR="__reactHandles$"+Xo;function si(e){var t=e[gr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Br]||n[gr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=N0(e);e!==null;){if(n=e[gr])return n;e=N0(e)}return t}e=n,n=e.parentNode}return null}function Xl(e){return e=e[gr]||e[Br],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function so(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function wf(e){return e[jl]||null}var Tm=[],io=-1;function Ds(e){return{current:e}}function Re(e){0>io||(e.current=Tm[io],Tm[io]=null,io--)}function Pe(e,t){io++,Tm[io]=e.current,e.current=t}var Is={},Ct=Ds(Is),Wt=Ds(!1),wi=Is;function Mo(e,t){var n=e.type.contextTypes;if(!n)return Is;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 Kt(e){return e=e.childContextTypes,e!=null}function pd(){Re(Wt),Re(Ct)}function I0(e,t,n){if(Ct.current!==Is)throw Error(K(168));Pe(Ct,t),Pe(Wt,n)}function tC(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(K(108,FA(e)||"Unknown",s));return ze({},n,r)}function md(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Is,wi=Ct.current,Pe(Ct,e),Pe(Wt,Wt.current),!0}function A0(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=tC(e,t,wi),r.__reactInternalMemoizedMergedChildContext=e,Re(Wt),Re(Ct),Pe(Ct,e)):Re(Wt),Pe(Wt,n)}var Ar=null,bf=!1,$h=!1;function nC(e){Ar===null?Ar=[e]:Ar.push(e)}function rR(e){bf=!0,nC(e)}function Os(){if(!$h&&Ar!==null){$h=!0;var e=0,t=xe;try{var n=Ar;for(xe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ar=null,bf=!1}catch(s){throw Ar!==null&&(Ar=Ar.slice(e+1)),ES(Sy,Os),s}finally{xe=t,$h=!1}}return null}var oo=[],ao=0,gd=null,yd=0,Cn=[],jn=0,bi=null,Lr=1,Mr="";function Qs(e,t){oo[ao++]=yd,oo[ao++]=gd,gd=e,yd=t}function rC(e,t,n){Cn[jn++]=Lr,Cn[jn++]=Mr,Cn[jn++]=bi,bi=e;var r=Lr;e=Mr;var s=32-Jn(r)-1;r&=~(1<<s),n+=1;var i=32-Jn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Lr=1<<32-Jn(t)+s|n<<s|r,Mr=i+e}else Lr=1<<i|n<<s|r,Mr=e}function Ry(e){e.return!==null&&(Qs(e,1),rC(e,1,0))}function Ly(e){for(;e===gd;)gd=oo[--ao],oo[ao]=null,yd=oo[--ao],oo[ao]=null;for(;e===bi;)bi=Cn[--jn],Cn[jn]=null,Mr=Cn[--jn],Cn[jn]=null,Lr=Cn[--jn],Cn[jn]=null}var dn=null,cn=null,Me=!1,Yn=null;function sC(e,t){var n=Tn(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 R0(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,dn=e,cn=bs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dn=e,cn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=bi!==null?{id:Lr,overflow:Mr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Tn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,dn=e,cn=null,!0):!1;default:return!1}}function Nm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Im(e){if(Me){var t=cn;if(t){var n=t;if(!R0(e,t)){if(Nm(e))throw Error(K(418));t=bs(n.nextSibling);var r=dn;t&&R0(e,t)?sC(r,n):(e.flags=e.flags&-4097|2,Me=!1,dn=e)}}else{if(Nm(e))throw Error(K(418));e.flags=e.flags&-4097|2,Me=!1,dn=e}}}function L0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dn=e}function Fc(e){if(e!==dn)return!1;if(!Me)return L0(e),Me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!jm(e.type,e.memoizedProps)),t&&(t=cn)){if(Nm(e))throw iC(),Error(K(418));for(;t;)sC(e,t),t=bs(t.nextSibling)}if(L0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){cn=bs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}cn=null}}else cn=dn?bs(e.stateNode.nextSibling):null;return!0}function iC(){for(var e=cn;e;)e=bs(e.nextSibling)}function $o(){cn=dn=null,Me=!1}function My(e){Yn===null?Yn=[e]:Yn.push(e)}var sR=Wr.ReactCurrentBatchConfig;function Sa(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(K(309));var r=n.stateNode}if(!r)throw Error(K(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(K(284));if(!n._owner)throw Error(K(290,e))}return e}function Bc(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function M0(e){var t=e._init;return t(e._payload)}function oC(e){function t(y,v){if(e){var w=y.deletions;w===null?(y.deletions=[v],y.flags|=16):w.push(v)}}function n(y,v){if(!e)return null;for(;v!==null;)t(y,v),v=v.sibling;return null}function r(y,v){for(y=new Map;v!==null;)v.key!==null?y.set(v.key,v):y.set(v.index,v),v=v.sibling;return y}function s(y,v){return y=Cs(y,v),y.index=0,y.sibling=null,y}function i(y,v,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<v?(y.flags|=2,v):w):(y.flags|=2,v)):(y.flags|=1048576,v)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,v,w,k){return v===null||v.tag!==6?(v=Uh(w,y.mode,k),v.return=y,v):(v=s(v,w),v.return=y,v)}function l(y,v,w,k){var _=w.type;return _===eo?u(y,v,w.props.children,k,w.key):v!==null&&(v.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===is&&M0(_)===v.type)?(k=s(v,w.props),k.ref=Sa(y,v,w),k.return=y,k):(k=$u(w.type,w.key,w.props,null,y.mode,k),k.ref=Sa(y,v,w),k.return=y,k)}function c(y,v,w,k){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=Wh(w,y.mode,k),v.return=y,v):(v=s(v,w.children||[]),v.return=y,v)}function u(y,v,w,k,_){return v===null||v.tag!==7?(v=hi(w,y.mode,k,_),v.return=y,v):(v=s(v,w),v.return=y,v)}function f(y,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Uh(""+v,y.mode,w),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Nc:return w=$u(v.type,v.key,v.props,null,y.mode,w),w.ref=Sa(y,null,v),w.return=y,w;case Xi:return v=Wh(v,y.mode,w),v.return=y,v;case is:var k=v._init;return f(y,k(v._payload),w)}if(Ba(v)||va(v))return v=hi(v,y.mode,w,null),v.return=y,v;Bc(y,v)}return null}function h(y,v,w,k){var _=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return _!==null?null:a(y,v,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Nc:return w.key===_?l(y,v,w,k):null;case Xi:return w.key===_?c(y,v,w,k):null;case is:return _=w._init,h(y,v,_(w._payload),k)}if(Ba(w)||va(w))return _!==null?null:u(y,v,w,k,null);Bc(y,w)}return null}function p(y,v,w,k,_){if(typeof k=="string"&&k!==""||typeof k=="number")return y=y.get(w)||null,a(v,y,""+k,_);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Nc:return y=y.get(k.key===null?w:k.key)||null,l(v,y,k,_);case Xi:return y=y.get(k.key===null?w:k.key)||null,c(v,y,k,_);case is:var S=k._init;return p(y,v,w,S(k._payload),_)}if(Ba(k)||va(k))return y=y.get(w)||null,u(v,y,k,_,null);Bc(v,k)}return null}function m(y,v,w,k){for(var _=null,S=null,j=v,E=v=0,T=null;j!==null&&E<w.length;E++){j.index>E?(T=j,j=null):T=j.sibling;var P=h(y,j,w[E],k);if(P===null){j===null&&(j=T);break}e&&j&&P.alternate===null&&t(y,j),v=i(P,v,E),S===null?_=P:S.sibling=P,S=P,j=T}if(E===w.length)return n(y,j),Me&&Qs(y,E),_;if(j===null){for(;E<w.length;E++)j=f(y,w[E],k),j!==null&&(v=i(j,v,E),S===null?_=j:S.sibling=j,S=j);return Me&&Qs(y,E),_}for(j=r(y,j);E<w.length;E++)T=p(j,y,E,w[E],k),T!==null&&(e&&T.alternate!==null&&j.delete(T.key===null?E:T.key),v=i(T,v,E),S===null?_=T:S.sibling=T,S=T);return e&&j.forEach(function(N){return t(y,N)}),Me&&Qs(y,E),_}function g(y,v,w,k){var _=va(w);if(typeof _!="function")throw Error(K(150));if(w=_.call(w),w==null)throw Error(K(151));for(var S=_=null,j=v,E=v=0,T=null,P=w.next();j!==null&&!P.done;E++,P=w.next()){j.index>E?(T=j,j=null):T=j.sibling;var N=h(y,j,P.value,k);if(N===null){j===null&&(j=T);break}e&&j&&N.alternate===null&&t(y,j),v=i(N,v,E),S===null?_=N:S.sibling=N,S=N,j=T}if(P.done)return n(y,j),Me&&Qs(y,E),_;if(j===null){for(;!P.done;E++,P=w.next())P=f(y,P.value,k),P!==null&&(v=i(P,v,E),S===null?_=P:S.sibling=P,S=P);return Me&&Qs(y,E),_}for(j=r(y,j);!P.done;E++,P=w.next())P=p(j,y,E,P.value,k),P!==null&&(e&&P.alternate!==null&&j.delete(P.key===null?E:P.key),v=i(P,v,E),S===null?_=P:S.sibling=P,S=P);return e&&j.forEach(function(R){return t(y,R)}),Me&&Qs(y,E),_}function x(y,v,w,k){if(typeof w=="object"&&w!==null&&w.type===eo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Nc:e:{for(var _=w.key,S=v;S!==null;){if(S.key===_){if(_=w.type,_===eo){if(S.tag===7){n(y,S.sibling),v=s(S,w.props.children),v.return=y,y=v;break e}}else if(S.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===is&&M0(_)===S.type){n(y,S.sibling),v=s(S,w.props),v.ref=Sa(y,S,w),v.return=y,y=v;break e}n(y,S);break}else t(y,S);S=S.sibling}w.type===eo?(v=hi(w.props.children,y.mode,k,w.key),v.return=y,y=v):(k=$u(w.type,w.key,w.props,null,y.mode,k),k.ref=Sa(y,v,w),k.return=y,y=k)}return o(y);case Xi:e:{for(S=w.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(y,v.sibling),v=s(v,w.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else t(y,v);v=v.sibling}v=Wh(w,y.mode,k),v.return=y,y=v}return o(y);case is:return S=w._init,x(y,v,S(w._payload),k)}if(Ba(w))return m(y,v,w,k);if(va(w))return g(y,v,w,k);Bc(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(y,v.sibling),v=s(v,w),v.return=y,y=v):(n(y,v),v=Uh(w,y.mode,k),v.return=y,y=v),o(y)):n(y,v)}return x}var Do=oC(!0),aC=oC(!1),xd=Ds(null),vd=null,lo=null,$y=null;function Dy(){$y=lo=vd=null}function Oy(e){var t=xd.current;Re(xd),e._currentValue=t}function Am(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 So(e,t){vd=e,$y=lo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Vt=!0),e.firstContext=null)}function Mn(e){var t=e._currentValue;if($y!==e)if(e={context:e,memoizedValue:t,next:null},lo===null){if(vd===null)throw Error(K(308));lo=e,vd.dependencies={lanes:0,firstContext:e}}else lo=lo.next=e;return t}var ii=null;function zy(e){ii===null?ii=[e]:ii.push(e)}function lC(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,zy(t)):(n.next=s.next,s.next=n),t.interleaved=n,Vr(e,r)}function Vr(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 os=!1;function Fy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cC(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 Dr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ks(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,he&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Vr(e,n)}return s=r.interleaved,s===null?(t.next=t,zy(r)):(t.next=s.next,s.next=t),r.interleaved=t,Vr(e,n)}function Nu(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,Cy(e,n)}}function $0(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 wd(e,t,n,r){var s=e.updateQueue;os=!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 f=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,g=a;switch(h=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=ze({},f,h);break e;case 2:os=!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=f):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=f),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);_i|=o,e.lanes=o,e.memoizedState=f}}function D0(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(K(191,s));s.call(r)}}}var ec={},vr=Ds(ec),El=Ds(ec),Pl=Ds(ec);function oi(e){if(e===ec)throw Error(K(174));return e}function By(e,t){switch(Pe(Pl,t),Pe(El,e),Pe(vr,ec),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fm(t,e)}Re(vr),Pe(vr,t)}function Oo(){Re(vr),Re(El),Re(Pl)}function uC(e){oi(Pl.current);var t=oi(vr.current),n=fm(t,e.type);t!==n&&(Pe(El,e),Pe(vr,n))}function Vy(e){El.current===e&&(Re(vr),Re(El))}var De=Ds(0);function bd(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 Dh=[];function Uy(){for(var e=0;e<Dh.length;e++)Dh[e]._workInProgressVersionPrimary=null;Dh.length=0}var Iu=Wr.ReactCurrentDispatcher,Oh=Wr.ReactCurrentBatchConfig,ki=0,Oe=null,ot=null,ut=null,kd=!1,el=!1,Tl=0,iR=0;function vt(){throw Error(K(321))}function Wy(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!er(e[n],t[n]))return!1;return!0}function Ky(e,t,n,r,s,i){if(ki=i,Oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Iu.current=e===null||e.memoizedState===null?cR:uR,e=n(r,s),el){i=0;do{if(el=!1,Tl=0,25<=i)throw Error(K(301));i+=1,ut=ot=null,t.updateQueue=null,Iu.current=dR,e=n(r,s)}while(el)}if(Iu.current=_d,t=ot!==null&&ot.next!==null,ki=0,ut=ot=Oe=null,kd=!1,t)throw Error(K(300));return e}function Hy(){var e=Tl!==0;return Tl=0,e}function ur(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?Oe.memoizedState=ut=e:ut=ut.next=e,ut}function $n(){if(ot===null){var e=Oe.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=ut===null?Oe.memoizedState:ut.next;if(t!==null)ut=t,ot=e;else{if(e===null)throw Error(K(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},ut===null?Oe.memoizedState=ut=e:ut=ut.next=e}return ut}function Nl(e,t){return typeof t=="function"?t(e):t}function zh(e){var t=$n(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=ot,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((ki&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 f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,Oe.lanes|=u,_i|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,er(r,t.memoizedState)||(Vt=!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,Oe.lanes|=i,_i|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fh(e){var t=$n(),n=t.queue;if(n===null)throw Error(K(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);er(i,t.memoizedState)||(Vt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function dC(){}function fC(e,t){var n=Oe,r=$n(),s=t(),i=!er(r.memoizedState,s);if(i&&(r.memoizedState=s,Vt=!0),r=r.queue,Gy(mC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ut!==null&&ut.memoizedState.tag&1){if(n.flags|=2048,Il(9,pC.bind(null,n,r,s,t),void 0,null),dt===null)throw Error(K(349));ki&30||hC(n,t,s)}return s}function hC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Oe.updateQueue,t===null?(t={lastEffect:null,stores:null},Oe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function pC(e,t,n,r){t.value=n,t.getSnapshot=r,gC(t)&&yC(e)}function mC(e,t,n){return n(function(){gC(t)&&yC(e)})}function gC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!er(e,n)}catch{return!0}}function yC(e){var t=Vr(e,1);t!==null&&Qn(t,e,1,-1)}function O0(e){var t=ur();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Nl,lastRenderedState:e},t.queue=e,e=e.dispatch=lR.bind(null,Oe,e),[t.memoizedState,e]}function Il(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Oe.updateQueue,t===null?(t={lastEffect:null,stores:null},Oe.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 xC(){return $n().memoizedState}function Au(e,t,n,r){var s=ur();Oe.flags|=e,s.memoizedState=Il(1|t,n,void 0,r===void 0?null:r)}function kf(e,t,n,r){var s=$n();r=r===void 0?null:r;var i=void 0;if(ot!==null){var o=ot.memoizedState;if(i=o.destroy,r!==null&&Wy(r,o.deps)){s.memoizedState=Il(t,n,i,r);return}}Oe.flags|=e,s.memoizedState=Il(1|t,n,i,r)}function z0(e,t){return Au(8390656,8,e,t)}function Gy(e,t){return kf(2048,8,e,t)}function vC(e,t){return kf(4,2,e,t)}function wC(e,t){return kf(4,4,e,t)}function bC(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 kC(e,t,n){return n=n!=null?n.concat([e]):null,kf(4,4,bC.bind(null,t,e),n)}function Zy(){}function _C(e,t){var n=$n();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wy(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function SC(e,t){var n=$n();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wy(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function CC(e,t,n){return ki&21?(er(n,t)||(n=NS(),Oe.lanes|=n,_i|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Vt=!0),e.memoizedState=n)}function oR(e,t){var n=xe;xe=n!==0&&4>n?n:4,e(!0);var r=Oh.transition;Oh.transition={};try{e(!1),t()}finally{xe=n,Oh.transition=r}}function jC(){return $n().memoizedState}function aR(e,t,n){var r=Ss(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},EC(e))PC(t,n);else if(n=lC(e,t,n,r),n!==null){var s=Lt();Qn(n,e,r,s),TC(n,t,r)}}function lR(e,t,n){var r=Ss(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(EC(e))PC(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,er(a,o)){var l=t.interleaved;l===null?(s.next=s,zy(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=lC(e,t,s,r),n!==null&&(s=Lt(),Qn(n,e,r,s),TC(n,t,r))}}function EC(e){var t=e.alternate;return e===Oe||t!==null&&t===Oe}function PC(e,t){el=kd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function TC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cy(e,n)}}var _d={readContext:Mn,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useInsertionEffect:vt,useLayoutEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useMutableSource:vt,useSyncExternalStore:vt,useId:vt,unstable_isNewReconciler:!1},cR={readContext:Mn,useCallback:function(e,t){return ur().memoizedState=[e,t===void 0?null:t],e},useContext:Mn,useEffect:z0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Au(4194308,4,bC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Au(4194308,4,e,t)},useInsertionEffect:function(e,t){return Au(4,2,e,t)},useMemo:function(e,t){var n=ur();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ur();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=aR.bind(null,Oe,e),[r.memoizedState,e]},useRef:function(e){var t=ur();return e={current:e},t.memoizedState=e},useState:O0,useDebugValue:Zy,useDeferredValue:function(e){return ur().memoizedState=e},useTransition:function(){var e=O0(!1),t=e[0];return e=oR.bind(null,e[1]),ur().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Oe,s=ur();if(Me){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),dt===null)throw Error(K(349));ki&30||hC(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,z0(mC.bind(null,r,i,e),[e]),r.flags|=2048,Il(9,pC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ur(),t=dt.identifierPrefix;if(Me){var n=Mr,r=Lr;n=(r&~(1<<32-Jn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Tl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=iR++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},uR={readContext:Mn,useCallback:_C,useContext:Mn,useEffect:Gy,useImperativeHandle:kC,useInsertionEffect:vC,useLayoutEffect:wC,useMemo:SC,useReducer:zh,useRef:xC,useState:function(){return zh(Nl)},useDebugValue:Zy,useDeferredValue:function(e){var t=$n();return CC(t,ot.memoizedState,e)},useTransition:function(){var e=zh(Nl)[0],t=$n().memoizedState;return[e,t]},useMutableSource:dC,useSyncExternalStore:fC,useId:jC,unstable_isNewReconciler:!1},dR={readContext:Mn,useCallback:_C,useContext:Mn,useEffect:Gy,useImperativeHandle:kC,useInsertionEffect:vC,useLayoutEffect:wC,useMemo:SC,useReducer:Fh,useRef:xC,useState:function(){return Fh(Nl)},useDebugValue:Zy,useDeferredValue:function(e){var t=$n();return ot===null?t.memoizedState=e:CC(t,ot.memoizedState,e)},useTransition:function(){var e=Fh(Nl)[0],t=$n().memoizedState;return[e,t]},useMutableSource:dC,useSyncExternalStore:fC,useId:jC,unstable_isNewReconciler:!1};function Zn(e,t){if(e&&e.defaultProps){t=ze({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Rm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ze({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _f={isMounted:function(e){return(e=e._reactInternals)?Ti(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Lt(),s=Ss(e),i=Dr(r,s);i.payload=t,n!=null&&(i.callback=n),t=ks(e,i,s),t!==null&&(Qn(t,e,s,r),Nu(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Lt(),s=Ss(e),i=Dr(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ks(e,i,s),t!==null&&(Qn(t,e,s,r),Nu(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Lt(),r=Ss(e),s=Dr(n,r);s.tag=2,t!=null&&(s.callback=t),t=ks(e,s,r),t!==null&&(Qn(t,e,r,n),Nu(t,e,r))}};function F0(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?!_l(n,r)||!_l(s,i):!0}function NC(e,t,n){var r=!1,s=Is,i=t.contextType;return typeof i=="object"&&i!==null?i=Mn(i):(s=Kt(t)?wi:Ct.current,r=t.contextTypes,i=(r=r!=null)?Mo(e,s):Is),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=_f,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function B0(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&&_f.enqueueReplaceState(t,t.state,null)}function Lm(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Fy(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Mn(i):(i=Kt(t)?wi:Ct.current,s.context=Mo(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Rm(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&&_f.enqueueReplaceState(s,s.state,null),wd(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function zo(e,t){try{var n="",r=t;do n+=zA(r),r=r.return;while(r);var s=n}catch(i){s=`
|
|
40
|
+
Error generating stack: `+i.message+`
|
|
41
|
+
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function Bh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Mm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var fR=typeof WeakMap=="function"?WeakMap:Map;function IC(e,t,n){n=Dr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Cd||(Cd=!0,Km=r),Mm(e,t)},n}function AC(e,t,n){n=Dr(-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(){Mm(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Mm(e,t),typeof r!="function"&&(_s===null?_s=new Set([this]):_s.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function V0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new fR;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=jR.bind(null,e,t,n),t.then(e,e))}function U0(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 W0(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=Dr(-1,1),t.tag=2,ks(n,t,1))),n.lanes|=1),e)}var hR=Wr.ReactCurrentOwner,Vt=!1;function Tt(e,t,n,r){t.child=e===null?aC(t,null,n,r):Do(t,e.child,n,r)}function K0(e,t,n,r,s){n=n.render;var i=t.ref;return So(t,s),r=Ky(e,t,n,r,i,s),n=Hy(),e!==null&&!Vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ur(e,t,s)):(Me&&n&&Ry(t),t.flags|=1,Tt(e,t,r,s),t.child)}function H0(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!nx(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,RC(e,t,i,r,s)):(e=$u(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:_l,n(o,r)&&e.ref===t.ref)return Ur(e,t,s)}return t.flags|=1,e=Cs(i,r),e.ref=t.ref,e.return=t,t.child=e}function RC(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(_l(i,r)&&e.ref===t.ref)if(Vt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Vt=!0);else return t.lanes=e.lanes,Ur(e,t,s)}return $m(e,t,n,r,s)}function LC(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},Pe(uo,on),on|=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,Pe(uo,on),on|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Pe(uo,on),on|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Pe(uo,on),on|=r;return Tt(e,t,s,n),t.child}function MC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $m(e,t,n,r,s){var i=Kt(n)?wi:Ct.current;return i=Mo(t,i),So(t,s),n=Ky(e,t,n,r,i,s),r=Hy(),e!==null&&!Vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ur(e,t,s)):(Me&&r&&Ry(t),t.flags|=1,Tt(e,t,n,s),t.child)}function G0(e,t,n,r,s){if(Kt(n)){var i=!0;md(t)}else i=!1;if(So(t,s),t.stateNode===null)Ru(e,t),NC(t,n,r),Lm(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=Mn(c):(c=Kt(n)?wi:Ct.current,c=Mo(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&B0(t,o,r,c),os=!1;var h=t.memoizedState;o.state=h,wd(t,r,o,s),l=t.memoizedState,a!==r||h!==l||Wt.current||os?(typeof u=="function"&&(Rm(t,n,u,r),l=t.memoizedState),(a=os||F0(t,n,a,r,h,l,c))?(f||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,cC(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Zn(t.type,a),o.props=c,f=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Mn(l):(l=Kt(n)?wi:Ct.current,l=Mo(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==l)&&B0(t,o,r,l),os=!1,h=t.memoizedState,o.state=h,wd(t,r,o,s);var m=t.memoizedState;a!==f||h!==m||Wt.current||os?(typeof p=="function"&&(Rm(t,n,p,r),m=t.memoizedState),(c=os||F0(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 Dm(e,t,n,r,i,s)}function Dm(e,t,n,r,s,i){MC(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&A0(t,n,!1),Ur(e,t,i);r=t.stateNode,hR.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Do(t,e.child,null,i),t.child=Do(t,null,a,i)):Tt(e,t,a,i),t.memoizedState=r.state,s&&A0(t,n,!0),t.child}function $C(e){var t=e.stateNode;t.pendingContext?I0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&I0(e,t.context,!1),By(e,t.containerInfo)}function Z0(e,t,n,r,s){return $o(),My(s),t.flags|=256,Tt(e,t,n,r),t.child}var Om={dehydrated:null,treeContext:null,retryLane:0};function zm(e){return{baseLanes:e,cachePool:null,transitions:null}}function DC(e,t,n){var r=t.pendingProps,s=De.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),Pe(De,s&1),e===null)return Im(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=jf(o,r,0,null),e=hi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=zm(n),t.memoizedState=Om,e):qy(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return pR(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=Cs(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Cs(a,i):(i=hi(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?zm(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Om,r}return i=e.child,e=i.sibling,r=Cs(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 qy(e,t){return t=jf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Vc(e,t,n,r){return r!==null&&My(r),Do(t,e.child,null,n),e=qy(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pR(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Bh(Error(K(422))),Vc(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=jf({mode:"visible",children:r.children},s,0,null),i=hi(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Do(t,e.child,null,o),t.child.memoizedState=zm(o),t.memoizedState=Om,i);if(!(t.mode&1))return Vc(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(K(419)),r=Bh(i,r,void 0),Vc(e,t,o,r)}if(a=(o&e.childLanes)!==0,Vt||a){if(r=dt,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,Vr(e,s),Qn(r,e,s,-1))}return tx(),r=Bh(Error(K(421))),Vc(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=ER.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,cn=bs(s.nextSibling),dn=t,Me=!0,Yn=null,e!==null&&(Cn[jn++]=Lr,Cn[jn++]=Mr,Cn[jn++]=bi,Lr=e.id,Mr=e.overflow,bi=t),t=qy(t,r.children),t.flags|=4096,t)}function q0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Am(e.return,t,n)}function Vh(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 OC(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Tt(e,t,r.children,n),r=De.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&&q0(e,n,t);else if(e.tag===19)q0(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(Pe(De,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&&bd(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Vh(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&&bd(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Vh(t,!0,n,null,i);break;case"together":Vh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ru(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ur(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),_i|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,n=Cs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Cs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function mR(e,t,n){switch(t.tag){case 3:$C(t),$o();break;case 5:uC(t);break;case 1:Kt(t.type)&&md(t);break;case 4:By(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Pe(xd,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Pe(De,De.current&1),t.flags|=128,null):n&t.child.childLanes?DC(e,t,n):(Pe(De,De.current&1),e=Ur(e,t,n),e!==null?e.sibling:null);Pe(De,De.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return OC(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Pe(De,De.current),r)break;return null;case 22:case 23:return t.lanes=0,LC(e,t,n)}return Ur(e,t,n)}var zC,Fm,FC,BC;zC=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}};Fm=function(){};FC=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,oi(vr.current);var i=null;switch(n){case"input":s=lm(e,s),r=lm(e,r),i=[];break;case"select":s=ze({},s,{value:void 0}),r=ze({},r,{value:void 0}),i=[];break;case"textarea":s=dm(e,s),r=dm(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=hd)}hm(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"&&(gl.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"&&(gl.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ae("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)}};BC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ca(e,t){if(!Me)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 wt(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 gR(e,t,n){var r=t.pendingProps;switch(Ly(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(t),null;case 1:return Kt(t.type)&&pd(),wt(t),null;case 3:return r=t.stateNode,Oo(),Re(Wt),Re(Ct),Uy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Fc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Yn!==null&&(Zm(Yn),Yn=null))),Fm(e,t),wt(t),null;case 5:Vy(t);var s=oi(Pl.current);if(n=t.type,e!==null&&t.stateNode!=null)FC(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(K(166));return wt(t),null}if(e=oi(vr.current),Fc(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[gr]=t,r[jl]=i,e=(t.mode&1)!==0,n){case"dialog":Ae("cancel",r),Ae("close",r);break;case"iframe":case"object":case"embed":Ae("load",r);break;case"video":case"audio":for(s=0;s<Ua.length;s++)Ae(Ua[s],r);break;case"source":Ae("error",r);break;case"img":case"image":case"link":Ae("error",r),Ae("load",r);break;case"details":Ae("toggle",r);break;case"input":s0(r,i),Ae("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ae("invalid",r);break;case"textarea":o0(r,i),Ae("invalid",r)}hm(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&&zc(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&zc(r.textContent,a,e),s=["children",""+a]):gl.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Ae("scroll",r)}switch(n){case"input":Ic(r),i0(r,i,!0);break;case"textarea":Ic(r),a0(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=hd)}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=mS(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[gr]=t,e[jl]=r,zC(e,t,!1,!1),t.stateNode=e;e:{switch(o=pm(n,r),n){case"dialog":Ae("cancel",e),Ae("close",e),s=r;break;case"iframe":case"object":case"embed":Ae("load",e),s=r;break;case"video":case"audio":for(s=0;s<Ua.length;s++)Ae(Ua[s],e);s=r;break;case"source":Ae("error",e),s=r;break;case"img":case"image":case"link":Ae("error",e),Ae("load",e),s=r;break;case"details":Ae("toggle",e),s=r;break;case"input":s0(e,r),s=lm(e,r),Ae("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=ze({},r,{value:void 0}),Ae("invalid",e);break;case"textarea":o0(e,r),s=dm(e,r),Ae("invalid",e);break;default:s=r}hm(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?xS(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&gS(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&yl(e,l):typeof l=="number"&&yl(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(gl.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ae("scroll",e):l!=null&&vy(e,i,l,o))}switch(n){case"input":Ic(e),i0(e,r,!1);break;case"textarea":Ic(e),a0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ns(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?wo(e,!!r.multiple,i,!1):r.defaultValue!=null&&wo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=hd)}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 wt(t),null;case 6:if(e&&t.stateNode!=null)BC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=oi(Pl.current),oi(vr.current),Fc(t)){if(r=t.stateNode,n=t.memoizedProps,r[gr]=t,(i=r.nodeValue!==n)&&(e=dn,e!==null))switch(e.tag){case 3:zc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&zc(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[gr]=t,t.stateNode=r}return wt(t),null;case 13:if(Re(De),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Me&&cn!==null&&t.mode&1&&!(t.flags&128))iC(),$o(),t.flags|=98560,i=!1;else if(i=Fc(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(K(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(K(317));i[gr]=t}else $o(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wt(t),i=!1}else Yn!==null&&(Zm(Yn),Yn=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||De.current&1?at===0&&(at=3):tx())),t.updateQueue!==null&&(t.flags|=4),wt(t),null);case 4:return Oo(),Fm(e,t),e===null&&Sl(t.stateNode.containerInfo),wt(t),null;case 10:return Oy(t.type._context),wt(t),null;case 17:return Kt(t.type)&&pd(),wt(t),null;case 19:if(Re(De),i=t.memoizedState,i===null)return wt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)Ca(i,!1);else{if(at!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=bd(e),o!==null){for(t.flags|=128,Ca(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 Pe(De,De.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ke()>Fo&&(t.flags|=128,r=!0,Ca(i,!1),t.lanes=4194304)}else{if(!r)if(e=bd(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ca(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Me)return wt(t),null}else 2*Ke()-i.renderingStartTime>Fo&&n!==1073741824&&(t.flags|=128,r=!0,Ca(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=Ke(),t.sibling=null,n=De.current,Pe(De,r?n&1|2:n&1),t):(wt(t),null);case 22:case 23:return ex(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?on&1073741824&&(wt(t),t.subtreeFlags&6&&(t.flags|=8192)):wt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function yR(e,t){switch(Ly(t),t.tag){case 1:return Kt(t.type)&&pd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Oo(),Re(Wt),Re(Ct),Uy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Vy(t),null;case 13:if(Re(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));$o()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Re(De),null;case 4:return Oo(),null;case 10:return Oy(t.type._context),null;case 22:case 23:return ex(),null;case 24:return null;default:return null}}var Uc=!1,kt=!1,xR=typeof WeakSet=="function"?WeakSet:Set,Z=null;function co(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ue(e,t,r)}else n.current=null}function Bm(e,t,n){try{n()}catch(r){Ue(e,t,r)}}var Y0=!1;function vR(e,t){if(Sm=ud,e=HS(),Ay(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,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===s&&(a=o),h===i&&++u===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cm={focusedElem:e,selectionRange:n},ud=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;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 g=m.memoizedProps,x=m.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Zn(t.type,g),x);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(k){Ue(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return m=Y0,Y0=!1,m}function tl(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&&Bm(t,n,i)}s=s.next}while(s!==r)}}function Sf(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 Vm(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 VC(e){var t=e.alternate;t!==null&&(e.alternate=null,VC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[gr],delete t[jl],delete t[Pm],delete t[tR],delete t[nR])),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 UC(e){return e.tag===5||e.tag===3||e.tag===4}function J0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||UC(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 Um(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=hd));else if(r!==4&&(e=e.child,e!==null))for(Um(e,t,n),e=e.sibling;e!==null;)Um(e,t,n),e=e.sibling}function Wm(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(Wm(e,t,n),e=e.sibling;e!==null;)Wm(e,t,n),e=e.sibling}var ft=null,qn=!1;function Gr(e,t,n){for(n=n.child;n!==null;)WC(e,t,n),n=n.sibling}function WC(e,t,n){if(xr&&typeof xr.onCommitFiberUnmount=="function")try{xr.onCommitFiberUnmount(gf,n)}catch{}switch(n.tag){case 5:kt||co(n,t);case 6:var r=ft,s=qn;ft=null,Gr(e,t,n),ft=r,qn=s,ft!==null&&(qn?(e=ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ft.removeChild(n.stateNode));break;case 18:ft!==null&&(qn?(e=ft,n=n.stateNode,e.nodeType===8?Mh(e.parentNode,n):e.nodeType===1&&Mh(e,n),bl(e)):Mh(ft,n.stateNode));break;case 4:r=ft,s=qn,ft=n.stateNode.containerInfo,qn=!0,Gr(e,t,n),ft=r,qn=s;break;case 0:case 11:case 14:case 15:if(!kt&&(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)&&Bm(n,t,o),s=s.next}while(s!==r)}Gr(e,t,n);break;case 1:if(!kt&&(co(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ue(n,t,a)}Gr(e,t,n);break;case 21:Gr(e,t,n);break;case 22:n.mode&1?(kt=(r=kt)||n.memoizedState!==null,Gr(e,t,n),kt=r):Gr(e,t,n);break;default:Gr(e,t,n)}}function Q0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new xR),t.forEach(function(r){var s=PR.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Bn(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:ft=a.stateNode,qn=!1;break e;case 3:ft=a.stateNode.containerInfo,qn=!0;break e;case 4:ft=a.stateNode.containerInfo,qn=!0;break e}a=a.return}if(ft===null)throw Error(K(160));WC(i,o,s),ft=null,qn=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Ue(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)KC(t,e),t=t.sibling}function KC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Bn(t,e),or(e),r&4){try{tl(3,e,e.return),Sf(3,e)}catch(g){Ue(e,e.return,g)}try{tl(5,e,e.return)}catch(g){Ue(e,e.return,g)}}break;case 1:Bn(t,e),or(e),r&512&&n!==null&&co(n,n.return);break;case 5:if(Bn(t,e),or(e),r&512&&n!==null&&co(n,n.return),e.flags&32){var s=e.stateNode;try{yl(s,"")}catch(g){Ue(e,e.return,g)}}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&&hS(s,i),pm(a,o);var c=pm(a,i);for(o=0;o<l.length;o+=2){var u=l[o],f=l[o+1];u==="style"?xS(s,f):u==="dangerouslySetInnerHTML"?gS(s,f):u==="children"?yl(s,f):vy(s,u,f,c)}switch(a){case"input":cm(s,i);break;case"textarea":pS(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?wo(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?wo(s,!!i.multiple,i.defaultValue,!0):wo(s,!!i.multiple,i.multiple?[]:"",!1))}s[jl]=i}catch(g){Ue(e,e.return,g)}}break;case 6:if(Bn(t,e),or(e),r&4){if(e.stateNode===null)throw Error(K(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(g){Ue(e,e.return,g)}}break;case 3:if(Bn(t,e),or(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{bl(t.containerInfo)}catch(g){Ue(e,e.return,g)}break;case 4:Bn(t,e),or(e);break;case 13:Bn(t,e),or(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Qy=Ke())),r&4&&Q0(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(kt=(c=kt)||u,Bn(t,e),kt=c):Bn(t,e),or(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(Z=e,u=e.child;u!==null;){for(f=Z=u;Z!==null;){switch(h=Z,p=h.child,h.tag){case 0:case 11:case 14:case 15:tl(4,h,h.return);break;case 1:co(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(g){Ue(r,n,g)}}break;case 5:co(h,h.return);break;case 22:if(h.memoizedState!==null){ew(f);continue}}p!==null?(p.return=h,Z=p):ew(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=yS("display",o))}catch(g){Ue(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){Ue(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Bn(t,e),or(e),r&4&&Q0(e);break;case 21:break;default:Bn(t,e),or(e)}}function or(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(UC(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(yl(s,""),r.flags&=-33);var i=J0(e);Wm(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=J0(e);Um(e,a,o);break;default:throw Error(K(161))}}catch(l){Ue(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wR(e,t,n){Z=e,HC(e)}function HC(e,t,n){for(var r=(e.mode&1)!==0;Z!==null;){var s=Z,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Uc;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||kt;a=Uc;var c=kt;if(Uc=o,(kt=l)&&!c)for(Z=s;Z!==null;)o=Z,l=o.child,o.tag===22&&o.memoizedState!==null?tw(s):l!==null?(l.return=o,Z=l):tw(s);for(;i!==null;)Z=i,HC(i),i=i.sibling;Z=s,Uc=a,kt=c}X0(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Z=i):X0(e)}}function X0(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:kt||Sf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!kt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Zn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&D0(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}D0(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 f=u.dehydrated;f!==null&&bl(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}kt||t.flags&512&&Vm(t)}catch(h){Ue(t,t.return,h)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function ew(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function tw(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Sf(4,t)}catch(l){Ue(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){Ue(t,s,l)}}var i=t.return;try{Vm(t)}catch(l){Ue(t,i,l)}break;case 5:var o=t.return;try{Vm(t)}catch(l){Ue(t,o,l)}}}catch(l){Ue(t,t.return,l)}if(t===e){Z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Z=a;break}Z=t.return}}var bR=Math.ceil,Sd=Wr.ReactCurrentDispatcher,Yy=Wr.ReactCurrentOwner,An=Wr.ReactCurrentBatchConfig,he=0,dt=null,st=null,gt=0,on=0,uo=Ds(0),at=0,Al=null,_i=0,Cf=0,Jy=0,nl=null,Bt=null,Qy=0,Fo=1/0,Ir=null,Cd=!1,Km=null,_s=null,Wc=!1,fs=null,jd=0,rl=0,Hm=null,Lu=-1,Mu=0;function Lt(){return he&6?Ke():Lu!==-1?Lu:Lu=Ke()}function Ss(e){return e.mode&1?he&2&>!==0?gt&-gt:sR.transition!==null?(Mu===0&&(Mu=NS()),Mu):(e=xe,e!==0||(e=window.event,e=e===void 0?16:DS(e.type)),e):1}function Qn(e,t,n,r){if(50<rl)throw rl=0,Hm=null,Error(K(185));Jl(e,n,r),(!(he&2)||e!==dt)&&(e===dt&&(!(he&2)&&(Cf|=n),at===4&&us(e,gt)),Ht(e,r),n===1&&he===0&&!(t.mode&1)&&(Fo=Ke()+500,bf&&Os()))}function Ht(e,t){var n=e.callbackNode;s2(e,t);var r=cd(e,e===dt?gt:0);if(r===0)n!==null&&u0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&u0(n),t===1)e.tag===0?rR(nw.bind(null,e)):nC(nw.bind(null,e)),X2(function(){!(he&6)&&Os()}),n=null;else{switch(IS(r)){case 1:n=Sy;break;case 4:n=PS;break;case 16:n=ld;break;case 536870912:n=TS;break;default:n=ld}n=ej(n,GC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function GC(e,t){if(Lu=-1,Mu=0,he&6)throw Error(K(327));var n=e.callbackNode;if(Co()&&e.callbackNode!==n)return null;var r=cd(e,e===dt?gt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ed(e,r);else{t=r;var s=he;he|=2;var i=qC();(dt!==e||gt!==t)&&(Ir=null,Fo=Ke()+500,fi(e,t));do try{SR();break}catch(a){ZC(e,a)}while(!0);Dy(),Sd.current=i,he=s,st!==null?t=0:(dt=null,gt=0,t=at)}if(t!==0){if(t===2&&(s=vm(e),s!==0&&(r=s,t=Gm(e,s))),t===1)throw n=Al,fi(e,0),us(e,r),Ht(e,Ke()),n;if(t===6)us(e,r);else{if(s=e.current.alternate,!(r&30)&&!kR(s)&&(t=Ed(e,r),t===2&&(i=vm(e),i!==0&&(r=i,t=Gm(e,i))),t===1))throw n=Al,fi(e,0),us(e,r),Ht(e,Ke()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(K(345));case 2:Xs(e,Bt,Ir);break;case 3:if(us(e,r),(r&130023424)===r&&(t=Qy+500-Ke(),10<t)){if(cd(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Lt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Em(Xs.bind(null,e,Bt,Ir),t);break}Xs(e,Bt,Ir);break;case 4:if(us(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-Jn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=Ke()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bR(r/1960))-r,10<r){e.timeoutHandle=Em(Xs.bind(null,e,Bt,Ir),r);break}Xs(e,Bt,Ir);break;case 5:Xs(e,Bt,Ir);break;default:throw Error(K(329))}}}return Ht(e,Ke()),e.callbackNode===n?GC.bind(null,e):null}function Gm(e,t){var n=nl;return e.current.memoizedState.isDehydrated&&(fi(e,t).flags|=256),e=Ed(e,t),e!==2&&(t=Bt,Bt=n,t!==null&&Zm(t)),e}function Zm(e){Bt===null?Bt=e:Bt.push.apply(Bt,e)}function kR(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(!er(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 us(e,t){for(t&=~Jy,t&=~Cf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Jn(t),r=1<<n;e[n]=-1,t&=~r}}function nw(e){if(he&6)throw Error(K(327));Co();var t=cd(e,0);if(!(t&1))return Ht(e,Ke()),null;var n=Ed(e,t);if(e.tag!==0&&n===2){var r=vm(e);r!==0&&(t=r,n=Gm(e,r))}if(n===1)throw n=Al,fi(e,0),us(e,t),Ht(e,Ke()),n;if(n===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Xs(e,Bt,Ir),Ht(e,Ke()),null}function Xy(e,t){var n=he;he|=1;try{return e(t)}finally{he=n,he===0&&(Fo=Ke()+500,bf&&Os())}}function Si(e){fs!==null&&fs.tag===0&&!(he&6)&&Co();var t=he;he|=1;var n=An.transition,r=xe;try{if(An.transition=null,xe=1,e)return e()}finally{xe=r,An.transition=n,he=t,!(he&6)&&Os()}}function ex(){on=uo.current,Re(uo)}function fi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Q2(n)),st!==null)for(n=st.return;n!==null;){var r=n;switch(Ly(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pd();break;case 3:Oo(),Re(Wt),Re(Ct),Uy();break;case 5:Vy(r);break;case 4:Oo();break;case 13:Re(De);break;case 19:Re(De);break;case 10:Oy(r.type._context);break;case 22:case 23:ex()}n=n.return}if(dt=e,st=e=Cs(e.current,null),gt=on=t,at=0,Al=null,Jy=Cf=_i=0,Bt=nl=null,ii!==null){for(t=0;t<ii.length;t++)if(n=ii[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}ii=null}return e}function ZC(e,t){do{var n=st;try{if(Dy(),Iu.current=_d,kd){for(var r=Oe.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}kd=!1}if(ki=0,ut=ot=Oe=null,el=!1,Tl=0,Yy.current=null,n===null||n.return===null){at=1,Al=t,st=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=gt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===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=U0(o);if(p!==null){p.flags&=-257,W0(p,o,a,i,t),p.mode&1&&V0(i,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){V0(i,c,t),tx();break e}l=Error(K(426))}}else if(Me&&a.mode&1){var x=U0(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),W0(x,o,a,i,t),My(zo(l,a));break e}}i=l=zo(l,a),at!==4&&(at=2),nl===null?nl=[i]:nl.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=IC(i,l,t);$0(i,y);break e;case 1:a=l;var v=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(_s===null||!_s.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=AC(i,a,t);$0(i,k);break e}}i=i.return}while(i!==null)}JC(n)}catch(_){t=_,st===n&&n!==null&&(st=n=n.return);continue}break}while(!0)}function qC(){var e=Sd.current;return Sd.current=_d,e===null?_d:e}function tx(){(at===0||at===3||at===2)&&(at=4),dt===null||!(_i&268435455)&&!(Cf&268435455)||us(dt,gt)}function Ed(e,t){var n=he;he|=2;var r=qC();(dt!==e||gt!==t)&&(Ir=null,fi(e,t));do try{_R();break}catch(s){ZC(e,s)}while(!0);if(Dy(),he=n,Sd.current=r,st!==null)throw Error(K(261));return dt=null,gt=0,at}function _R(){for(;st!==null;)YC(st)}function SR(){for(;st!==null&&!qA();)YC(st)}function YC(e){var t=XC(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?JC(e):st=t,Yy.current=null}function JC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=yR(n,t),n!==null){n.flags&=32767,st=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{at=6,st=null;return}}else if(n=gR(n,t,on),n!==null){st=n;return}if(t=t.sibling,t!==null){st=t;return}st=t=e}while(t!==null);at===0&&(at=5)}function Xs(e,t,n){var r=xe,s=An.transition;try{An.transition=null,xe=1,CR(e,t,n,r)}finally{An.transition=s,xe=r}return null}function CR(e,t,n,r){do Co();while(fs!==null);if(he&6)throw Error(K(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(K(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(i2(e,i),e===dt&&(st=dt=null,gt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Wc||(Wc=!0,ej(ld,function(){return Co(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=An.transition,An.transition=null;var o=xe;xe=1;var a=he;he|=4,Yy.current=null,vR(e,n),KC(n,e),K2(Cm),ud=!!Sm,Cm=Sm=null,e.current=n,wR(n),YA(),he=a,xe=o,An.transition=i}else e.current=n;if(Wc&&(Wc=!1,fs=e,jd=s),i=e.pendingLanes,i===0&&(_s=null),XA(n.stateNode),Ht(e,Ke()),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(Cd)throw Cd=!1,e=Km,Km=null,e;return jd&1&&e.tag!==0&&Co(),i=e.pendingLanes,i&1?e===Hm?rl++:(rl=0,Hm=e):rl=0,Os(),null}function Co(){if(fs!==null){var e=IS(jd),t=An.transition,n=xe;try{if(An.transition=null,xe=16>e?16:e,fs===null)var r=!1;else{if(e=fs,fs=null,jd=0,he&6)throw Error(K(331));var s=he;for(he|=4,Z=e.current;Z!==null;){var i=Z,o=i.child;if(Z.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Z=c;Z!==null;){var u=Z;switch(u.tag){case 0:case 11:case 15:tl(8,u,i)}var f=u.child;if(f!==null)f.return=u,Z=f;else for(;Z!==null;){u=Z;var h=u.sibling,p=u.return;if(VC(u),u===c){Z=null;break}if(h!==null){h.return=p,Z=h;break}Z=p}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}Z=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Z=o;else e:for(;Z!==null;){if(i=Z,i.flags&2048)switch(i.tag){case 0:case 11:case 15:tl(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,Z=y;break e}Z=i.return}}var v=e.current;for(Z=v;Z!==null;){o=Z;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,Z=w;else e:for(o=v;Z!==null;){if(a=Z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Sf(9,a)}}catch(_){Ue(a,a.return,_)}if(a===o){Z=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,Z=k;break e}Z=a.return}}if(he=s,Os(),xr&&typeof xr.onPostCommitFiberRoot=="function")try{xr.onPostCommitFiberRoot(gf,e)}catch{}r=!0}return r}finally{xe=n,An.transition=t}}return!1}function rw(e,t,n){t=zo(n,t),t=IC(e,t,1),e=ks(e,t,1),t=Lt(),e!==null&&(Jl(e,1,t),Ht(e,t))}function Ue(e,t,n){if(e.tag===3)rw(e,e,n);else for(;t!==null;){if(t.tag===3){rw(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(_s===null||!_s.has(r))){e=zo(n,e),e=AC(t,e,1),t=ks(t,e,1),e=Lt(),t!==null&&(Jl(t,1,e),Ht(t,e));break}}t=t.return}}function jR(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Lt(),e.pingedLanes|=e.suspendedLanes&n,dt===e&&(gt&n)===n&&(at===4||at===3&&(gt&130023424)===gt&&500>Ke()-Qy?fi(e,0):Jy|=n),Ht(e,t)}function QC(e,t){t===0&&(e.mode&1?(t=Lc,Lc<<=1,!(Lc&130023424)&&(Lc=4194304)):t=1);var n=Lt();e=Vr(e,t),e!==null&&(Jl(e,t,n),Ht(e,n))}function ER(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),QC(e,n)}function PR(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(K(314))}r!==null&&r.delete(t),QC(e,n)}var XC;XC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Wt.current)Vt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Vt=!1,mR(e,t,n);Vt=!!(e.flags&131072)}else Vt=!1,Me&&t.flags&1048576&&rC(t,yd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ru(e,t),e=t.pendingProps;var s=Mo(t,Ct.current);So(t,n),s=Ky(null,t,r,e,s,n);var i=Hy();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,Kt(r)?(i=!0,md(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Fy(t),s.updater=_f,t.stateNode=s,s._reactInternals=t,Lm(t,r,e,n),t=Dm(null,t,r,!0,i,n)):(t.tag=0,Me&&i&&Ry(t),Tt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ru(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=NR(r),e=Zn(r,e),s){case 0:t=$m(null,t,r,e,n);break e;case 1:t=G0(null,t,r,e,n);break e;case 11:t=K0(null,t,r,e,n);break e;case 14:t=H0(null,t,r,Zn(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Zn(r,s),$m(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Zn(r,s),G0(e,t,r,s,n);case 3:e:{if($C(t),e===null)throw Error(K(387));r=t.pendingProps,i=t.memoizedState,s=i.element,cC(e,t),wd(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=zo(Error(K(423)),t),t=Z0(e,t,r,n,s);break e}else if(r!==s){s=zo(Error(K(424)),t),t=Z0(e,t,r,n,s);break e}else for(cn=bs(t.stateNode.containerInfo.firstChild),dn=t,Me=!0,Yn=null,n=aC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($o(),r===s){t=Ur(e,t,n);break e}Tt(e,t,r,n)}t=t.child}return t;case 5:return uC(t),e===null&&Im(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,jm(r,s)?o=null:i!==null&&jm(r,i)&&(t.flags|=32),MC(e,t),Tt(e,t,o,n),t.child;case 6:return e===null&&Im(t),null;case 13:return DC(e,t,n);case 4:return By(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Do(t,null,r,n):Tt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Zn(r,s),K0(e,t,r,s,n);case 7:return Tt(e,t,t.pendingProps,n),t.child;case 8:return Tt(e,t,t.pendingProps.children,n),t.child;case 12:return Tt(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,Pe(xd,r._currentValue),r._currentValue=o,i!==null)if(er(i.value,o)){if(i.children===s.children&&!Wt.current){t=Ur(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=Dr(-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),Am(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(K(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Am(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}Tt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,So(t,n),s=Mn(s),r=r(s),t.flags|=1,Tt(e,t,r,n),t.child;case 14:return r=t.type,s=Zn(r,t.pendingProps),s=Zn(r.type,s),H0(e,t,r,s,n);case 15:return RC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Zn(r,s),Ru(e,t),t.tag=1,Kt(r)?(e=!0,md(t)):e=!1,So(t,n),NC(t,r,s),Lm(t,r,s,n),Dm(null,t,r,!0,e,n);case 19:return OC(e,t,n);case 22:return LC(e,t,n)}throw Error(K(156,t.tag))};function ej(e,t){return ES(e,t)}function TR(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 Tn(e,t,n,r){return new TR(e,t,n,r)}function nx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function NR(e){if(typeof e=="function")return nx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===by)return 11;if(e===ky)return 14}return 2}function Cs(e,t){var n=e.alternate;return n===null?(n=Tn(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 $u(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")nx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case eo:return hi(n.children,s,i,t);case wy:o=8,s|=8;break;case sm:return e=Tn(12,n,t,s|2),e.elementType=sm,e.lanes=i,e;case im:return e=Tn(13,n,t,s),e.elementType=im,e.lanes=i,e;case om:return e=Tn(19,n,t,s),e.elementType=om,e.lanes=i,e;case uS:return jf(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case lS:o=10;break e;case cS:o=9;break e;case by:o=11;break e;case ky:o=14;break e;case is:o=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Tn(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function hi(e,t,n,r){return e=Tn(7,e,r,t),e.lanes=n,e}function jf(e,t,n,r){return e=Tn(22,e,r,t),e.elementType=uS,e.lanes=n,e.stateNode={isHidden:!1},e}function Uh(e,t,n){return e=Tn(6,e,null,t),e.lanes=n,e}function Wh(e,t,n){return t=Tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function IR(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=Sh(0),this.expirationTimes=Sh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sh(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function rx(e,t,n,r,s,i,o,a,l){return e=new IR(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Tn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fy(i),e}function AR(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xi,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function tj(e){if(!e)return Is;e=e._reactInternals;e:{if(Ti(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var n=e.type;if(Kt(n))return tC(e,n,t)}return t}function nj(e,t,n,r,s,i,o,a,l){return e=rx(n,r,!0,e,s,i,o,a,l),e.context=tj(null),n=e.current,r=Lt(),s=Ss(n),i=Dr(r,s),i.callback=t??null,ks(n,i,s),e.current.lanes=s,Jl(e,s,r),Ht(e,r),e}function Ef(e,t,n,r){var s=t.current,i=Lt(),o=Ss(s);return n=tj(n),t.context===null?t.context=n:t.pendingContext=n,t=Dr(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ks(s,t,o),e!==null&&(Qn(e,s,o,i),Nu(e,s,o)),o}function Pd(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 sw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sx(e,t){sw(e,t),(e=e.alternate)&&sw(e,t)}function RR(){return null}var rj=typeof reportError=="function"?reportError:function(e){console.error(e)};function ix(e){this._internalRoot=e}Pf.prototype.render=ix.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));Ef(e,t,null,null)};Pf.prototype.unmount=ix.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Si(function(){Ef(null,e,null,null)}),t[Br]=null}};function Pf(e){this._internalRoot=e}Pf.prototype.unstable_scheduleHydration=function(e){if(e){var t=LS();e={blockedOn:null,target:e,priority:t};for(var n=0;n<cs.length&&t!==0&&t<cs[n].priority;n++);cs.splice(n,0,e),n===0&&$S(e)}};function ox(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Tf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function iw(){}function LR(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=Pd(o);i.call(c)}}var o=nj(t,r,e,0,null,!1,!1,"",iw);return e._reactRootContainer=o,e[Br]=o.current,Sl(e.nodeType===8?e.parentNode:e),Si(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Pd(l);a.call(c)}}var l=rx(e,0,!1,null,null,!1,!1,"",iw);return e._reactRootContainer=l,e[Br]=l.current,Sl(e.nodeType===8?e.parentNode:e),Si(function(){Ef(t,l,n,r)}),l}function Nf(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=Pd(o);a.call(l)}}Ef(t,o,e,s)}else o=LR(n,t,e,s,r);return Pd(o)}AS=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Va(t.pendingLanes);n!==0&&(Cy(t,n|1),Ht(t,Ke()),!(he&6)&&(Fo=Ke()+500,Os()))}break;case 13:Si(function(){var r=Vr(e,1);if(r!==null){var s=Lt();Qn(r,e,1,s)}}),sx(e,1)}};jy=function(e){if(e.tag===13){var t=Vr(e,134217728);if(t!==null){var n=Lt();Qn(t,e,134217728,n)}sx(e,134217728)}};RS=function(e){if(e.tag===13){var t=Ss(e),n=Vr(e,t);if(n!==null){var r=Lt();Qn(n,e,t,r)}sx(e,t)}};LS=function(){return xe};MS=function(e,t){var n=xe;try{return xe=e,t()}finally{xe=n}};gm=function(e,t,n){switch(t){case"input":if(cm(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=wf(r);if(!s)throw Error(K(90));fS(r),cm(r,s)}}}break;case"textarea":pS(e,n);break;case"select":t=n.value,t!=null&&wo(e,!!n.multiple,t,!1)}};bS=Xy;kS=Si;var MR={usingClientEntryPoint:!1,Events:[Xl,so,wf,vS,wS,Xy]},ja={findFiberByHostInstance:si,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$R={bundleType:ja.bundleType,version:ja.version,rendererPackageName:ja.rendererPackageName,rendererConfig:ja.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Wr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=CS(e),e===null?null:e.stateNode},findFiberByHostInstance:ja.findFiberByHostInstance||RR,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 Kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kc.isDisabled&&Kc.supportsFiber)try{gf=Kc.inject($R),xr=Kc}catch{}}gn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=MR;gn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ox(t))throw Error(K(200));return AR(e,t,null,n)};gn.createRoot=function(e,t){if(!ox(e))throw Error(K(299));var n=!1,r="",s=rj;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=rx(e,1,!1,null,null,n,!1,r,s),e[Br]=t.current,Sl(e.nodeType===8?e.parentNode:e),new ix(t)};gn.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(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=CS(t),e=e===null?null:e.stateNode,e};gn.flushSync=function(e){return Si(e)};gn.hydrate=function(e,t,n){if(!Tf(t))throw Error(K(200));return Nf(null,e,t,!0,n)};gn.hydrateRoot=function(e,t,n){if(!ox(e))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=rj;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=nj(t,null,e,1,n??null,s,!1,i,o),e[Br]=t.current,Sl(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 Pf(t)};gn.render=function(e,t,n){if(!Tf(t))throw Error(K(200));return Nf(null,e,t,!1,n)};gn.unmountComponentAtNode=function(e){if(!Tf(e))throw Error(K(40));return e._reactRootContainer?(Si(function(){Nf(null,null,e,!1,function(){e._reactRootContainer=null,e[Br]=null})}),!0):!1};gn.unstable_batchedUpdates=Xy;gn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Tf(n))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return Nf(e,t,n,!1,r)};gn.version="18.3.1-next-f1338f8080-20240426";function sj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sj)}catch(e){console.error(e)}}sj(),sS.exports=gn;var Ni=sS.exports,ij,ow=Ni;ij=ow.createRoot,ow.hydrateRoot;var Wa=typeof window<"u"?b.useLayoutEffect:b.useEffect;function Kh(e){const t=b.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function DR(e,t,n={},r={}){b.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 OR(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}const oj=!1;function Rl(e){return e[e.length-1]}function zR(e){return typeof e=="function"}function hs(e,t){return zR(e)?e(t):e}const FR=Object.prototype.hasOwnProperty,aw=Object.prototype.propertyIsEnumerable,BR=()=>Object.create(null),Hs=(e,t)=>ps(e,t,BR);function ps(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=uw(e)&&uw(s);if(!i&&!(Bo(e)&&Bo(s)))return s;const o=i?e:lw(e);if(!o)return s;const a=i?s:lw(s);if(!a)return s;const l=o.length,c=a.length,u=i?new Array(c):n();let f=0;for(let h=0;h<c;h++){const p=i?h:a[h],m=e[p],g=s[p];if(m===g){u[p]=m,(i?h<l:FR.call(e,p))&&f++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){u[p]=g;continue}const x=ps(m,g,n,r+1);u[p]=x,x===m&&f++}return l===c&&f===l?e:u}function lw(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!aw.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(!aw.call(e,s))return!1;r.push(s)}return r}function Bo(e){if(!cw(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!cw(n)||!n.hasOwnProperty("isPrototypeOf"))}function cw(e){return Object.prototype.toString.call(e)==="[object Object]"}function uw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pi(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(!pi(e[r],t[r],n))return!1;return!0}if(Bo(e)&&Bo(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)&&!pi(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||!pi(e[o],t[o],n)))return!1;return s===i}return!1}function Vo(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 Ll(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function VR(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function dw(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 VR(t)}const UR=["http:","https:","mailto:","tel:"];function Td(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ea(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+=dw(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+dw(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function WR(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function KR(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 Or(){throw new Error("Invariant failed")}function Ml(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 ms=4,aj=5;function HR(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 ax(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=HR(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,f=l;if(u<f)return n[0]=3,n[1]=t+a,n[2]=t+u,n[3]=t+f,n[4]=t+l+1,n[5]=s,n}}else if(c===36){const u=a+1,f=a+2;return f===l?(n[0]=2,n[1]=t+a,n[2]=t+u,n[3]=t+f,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+f,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 If(e,t,n,r,s,i,o){var l,c,u,f,h,p,m,g,x,y,v,w,k;o==null||o(n);let a=r;{const _=n.fullPath??n.from,S=_.length,j=((l=n.options)==null?void 0:l.caseSensitive)??e,E=!!((u=(c=n.options)==null?void 0:c.params)!=null&&u.parse&&((h=(f=n.options)==null?void 0:f.skipRouteOnParseError)!=null&&h.params));for(;a<S;){const P=ax(_,a,t);let N;const R=a,L=P[5];switch(a=L+1,i++,P[0]){case 0:{const I=_.substring(P[2],P[3]);if(j){const z=(p=s.static)==null?void 0:p.get(I);if(z)N=z;else{s.static??(s.static=new Map);const $=ai(n.fullPath??n.from);$.parent=s,$.depth=i,N=$,s.static.set(I,$)}}else{const z=I.toLowerCase(),$=(m=s.staticInsensitive)==null?void 0:m.get(z);if($)N=$;else{s.staticInsensitive??(s.staticInsensitive=new Map);const D=ai(n.fullPath??n.from);D.parent=s,D.depth=i,N=D,s.staticInsensitive.set(z,D)}}break}case 1:{const I=_.substring(R,P[1]),z=_.substring(P[4],L),$=j&&!!(I||z),D=I?$?I:I.toLowerCase():void 0,O=z?$?z:z.toLowerCase():void 0,V=!E&&((g=s.dynamic)==null?void 0:g.find(C=>!C.skipOnParamError&&C.caseSensitive===$&&C.prefix===D&&C.suffix===O));if(V)N=V;else{const C=Gh(1,n.fullPath??n.from,$,D,O);N=C,C.depth=i,C.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(C)}break}case 3:{const I=_.substring(R,P[1]),z=_.substring(P[4],L),$=j&&!!(I||z),D=I?$?I:I.toLowerCase():void 0,O=z?$?z:z.toLowerCase():void 0,V=!E&&((x=s.optional)==null?void 0:x.find(C=>!C.skipOnParamError&&C.caseSensitive===$&&C.prefix===D&&C.suffix===O));if(V)N=V;else{const C=Gh(3,n.fullPath??n.from,$,D,O);N=C,C.parent=s,C.depth=i,s.optional??(s.optional=[]),s.optional.push(C)}break}case 2:{const I=_.substring(R,P[1]),z=_.substring(P[4],L),$=j&&!!(I||z),D=I?$?I:I.toLowerCase():void 0,O=z?$?z:z.toLowerCase():void 0,V=Gh(2,n.fullPath??n.from,$,D,O);N=V,V.parent=s,V.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push(V)}}s=N}if(E&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const P=ai(n.fullPath??n.from);P.kind=aj,P.parent=s,i++,P.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(P),s=P}const T=(n.path||!n.children)&&!n.isRoot;if(T&&_.endsWith("/")){const P=ai(n.fullPath??n.from);P.kind=ms,P.parent=s,i++,P.depth=i,s.index=P,s=P}s.parse=((v=(y=n.options)==null?void 0:y.params)==null?void 0:v.parse)??null,s.skipOnParamError=E,s.parsingPriority=((k=(w=n.options)==null?void 0:w.skipRouteOnParseError)==null?void 0:k.priority)??0,T&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const _ of n.children)If(e,t,_,a,s,i,o)}function Hh(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 as(e){var t,n,r;if(e.pathless)for(const s of e.pathless)as(s);if(e.static)for(const s of e.static.values())as(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())as(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Hh);for(const s of e.dynamic)as(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(Hh);for(const s of e.optional)as(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(Hh);for(const s of e.wildcard)as(s)}}function ai(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 Gh(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 GR(e,t){const n=ai("/"),r=new Uint16Array(6);for(const s of e)If(!1,r,s,1,n,0);as(n),t.masksTree=n,t.flatCache=Ml(1e3)}function ZR(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=lx(e,t.masksTree);return t.flatCache.set(e,r),r}function qR(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=ai("/"),If(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),lx(r,o,n)}function YR(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=lx(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=XR(i.route)),t.matchCache.set(r,i),i}function JR(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function QR(e,t=!1,n){const r=ai(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return If(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&Or(),i[l.id]=l,a!==0&&l.path){const c=JR(l.fullPath);(!o[c]||l.fullPath.endsWith("/"))&&(o[c]=l)}a++}),as(r),{processedTree:{segmentTree:r,singleCache:Ml(1e3),matchCache:Ml(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function lx(e,t,n=!1){const r=e.split("/"),s=tL(e,r,t,n);if(!s)return null;const[i]=lj(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function lj(e,t,n){var u,f,h,p,m,g,x,y,v,w;const r=eL(n.node);let s=null;const i=Object.create(null);let o=((u=n.extract)==null?void 0:u.part)??0,a=((f=n.extract)==null?void 0:f.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 k=r[a];if(k.kind===ms)break;if(k.kind===aj){c--,o--,l--;continue}const _=t[o],S=l;if(_&&(l+=_.length),k.kind===1){s??(s=n.node.fullPath.split("/"));const j=s[c],E=((m=k.prefix)==null?void 0:m.length)??0;if(j.charCodeAt(E)===123){const T=((g=k.suffix)==null?void 0:g.length)??0,P=j.substring(E+2,j.length-T-1),N=_.substring(E,_.length-T);i[P]=decodeURIComponent(N)}else{const T=j.substring(1);i[T]=decodeURIComponent(_)}}else if(k.kind===3){if(n.skipped&1<<a){o--,l=S-1;continue}s??(s=n.node.fullPath.split("/"));const j=s[c],E=((x=k.prefix)==null?void 0:x.length)??0,T=((y=k.suffix)==null?void 0:y.length)??0,P=j.substring(E+3,j.length-T-1),N=k.suffix||k.prefix?_.substring(E,_.length-T):_;N&&(i[P]=decodeURIComponent(N))}else if(k.kind===2){const j=k,E=e.substring(S+(((v=j.prefix)==null?void 0:v.length)??0),e.length-(((w=j.suffix)==null?void 0:w.length)??0)),T=decodeURIComponent(E);i["*"]=T,i._splat=T;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:c}]}function XR(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function eL(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function tL(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Rl(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:f,index:h,skipped:p,depth:m,statics:g,dynamics:x,optionals:y}=u;let{extract:v,rawParams:w,parsedParams:k}=u;if(f.kind===2&&f.route&&!Gc(c,u))continue;if(f.skipOnParamError){if(!fw(e,t,u))continue;w=u.rawParams,v=u.extract,k=u.parsedParams}r&&f.route&&f.kind!==ms&&Gc(l,u)&&(l=u);const _=h===o;if(_&&(f.route&&(!i||f.kind===ms||f.kind===2)&&Gc(c,u)&&(c=u),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const S=_?void 0:t[h];let j;if(_&&f.index){const E={node:f.index,index:h,skipped:p,depth:m+1,statics:g,dynamics:x,optionals:y,extract:v,rawParams:w,parsedParams:k};let T=!0;if(f.index.skipOnParamError&&(fw(e,t,E)||(T=!1)),T){if(!x&&!y&&!p&&nL(g,o))return E;Gc(c,E)&&(c=E)}}if(f.wildcard)for(let E=f.wildcard.length-1;E>=0;E--){const T=f.wildcard[E],{prefix:P,suffix:N}=T;if(!(P&&(_||!(T.caseSensitive?S:j??(j=S.toLowerCase())).startsWith(P)))){if(N){if(_)continue;const R=t.slice(h).join("/").slice(-N.length);if((T.caseSensitive?R:R.toLowerCase())!==N)continue}a.push({node:T,index:o,skipped:p,depth:m+1,statics:g,dynamics:x,optionals:y,extract:v,rawParams:w,parsedParams:k})}}if(f.optional){const E=p|1<<m,T=m+1;for(let P=f.optional.length-1;P>=0;P--){const N=f.optional[P];a.push({node:N,index:h,skipped:E,depth:T,statics:g,dynamics:x,optionals:y,extract:v,rawParams:w,parsedParams:k})}if(!_)for(let P=f.optional.length-1;P>=0;P--){const N=f.optional[P],{prefix:R,suffix:L}=N;if(R||L){const I=N.caseSensitive?S:j??(j=S.toLowerCase());if(R&&!I.startsWith(R)||L&&!I.endsWith(L))continue}a.push({node:N,index:h+1,skipped:p,depth:T,statics:g,dynamics:x,optionals:y+Hc(o,h),extract:v,rawParams:w,parsedParams:k})}}if(!_&&f.dynamic&&S)for(let E=f.dynamic.length-1;E>=0;E--){const T=f.dynamic[E],{prefix:P,suffix:N}=T;if(P||N){const R=T.caseSensitive?S:j??(j=S.toLowerCase());if(P&&!R.startsWith(P)||N&&!R.endsWith(N))continue}a.push({node:T,index:h+1,skipped:p,depth:m+1,statics:g,dynamics:x+Hc(o,h),optionals:y,extract:v,rawParams:w,parsedParams:k})}if(!_&&f.staticInsensitive){const E=f.staticInsensitive.get(j??(j=S.toLowerCase()));E&&a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:g+Hc(o,h),dynamics:x,optionals:y,extract:v,rawParams:w,parsedParams:k})}if(!_&&f.static){const E=f.static.get(S);E&&a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:g+Hc(o,h),dynamics:x,optionals:y,extract:v,rawParams:w,parsedParams:k})}if(f.pathless){const E=m+1;for(let T=f.pathless.length-1;T>=0;T--){const P=f.pathless[T];a.push({node:P,index:h,skipped:p,depth:E,statics:g,dynamics:x,optionals:y,extract:v,rawParams:w,parsedParams:k})}}}if(c)return c;if(r&&l){let u=l.index;for(let h=0;h<l.index;h++)u+=t[h].length;const f=u===e.length?"/":e.slice(u);return l.rawParams??(l.rawParams=Object.create(null)),l.rawParams["**"]=decodeURIComponent(f),l}return null}function Hc(e,t){return 2**(e-t-1)}function nL(e,t){return e===2**(t-1)-1}function fw(e,t,n){try{const[r,s]=lj(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 Gc(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===ms)>(e.node.kind===ms)||t.node.kind===ms==(e.node.kind===ms)&&t.depth>e.depth))):!0}function Du(e){return cx(e.filter(t=>t!==void 0).join("/"))}function cx(e){return e.replace(/\/{2,}/g,"/")}function cj(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function js(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function uj(e){return js(cj(e))}function Nd(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function rL(e,t,n){return Nd(e,n)===Nd(t,n)}function sL({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 f=r.get(o);if(f)return f}let a;if(i)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&Rl(a)==="";)a.pop();const f=t.split("/");for(let h=0,p=f.length;h<p;h++){const m=f[h];m===""?h?h===p-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(Rl(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,c="";for(let f=0;f<a.length;f++){f>0&&(c+="/");const h=a[f];if(!h)continue;l=ax(h,0,l);const p=l[0];if(p===0){c+=h;continue}const m=l[5],g=h.substring(0,l[1]),x=h.substring(l[4],m),y=h.substring(l[2],l[3]);p===1?c+=g||x?`${g}{$${y}}${x}`:`$${y}`:p===2?c+=g||x?`${g}{$}${x}`:"$":c+=`${g}{-$${y}}${x}`}c=cx(c);const u=c||"/";return o&&r&&r.set(o,u),u}function iL(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 Zh(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=>pw(s,n)).join("/"):pw(r,n)}function hw({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=ax(e,u,l);const f=l[5];if(a=f+1,u===f)continue;const h=l[0];if(h===0){c+="/"+e.substring(u,f);continue}if(h===2){const p=t._splat;i._splat=p,i["*"]=p;const m=e.substring(u,l[1]),g=e.substring(l[4],f);if(!p){s=!0,(m||g)&&(c+="/"+m+g);continue}const x=Zh("_splat",t,n);c+="/"+m+x+g;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]),g=e.substring(l[4],f),x=Zh(p,t,n)??"undefined";c+="/"+m+x+g;continue}if(h===3){const p=e.substring(l[2],l[3]),m=t[p];if(m==null)continue;i[p]=m;const g=e.substring(u,l[1]),x=e.substring(l[4],f),y=Zh(p,t,n)??"";c+="/"+g+y+x;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:i,interpolatedPath:c||"/",isMissingParams:s}}function pw(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 oL(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const aL="tsr-scroll-restoration-v1_3";function lL(){const e=oL();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Bo(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=hs(r,t)||t},persist:()=>{try{e.setItem(aL,JSON.stringify(t))}catch{}}}}const mw=lL(),cL=e=>e.state.__TSR_key||e.href;function uL(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 Zc=!1;const Pa="window",gw="data-scroll-restoration-id";function dL(e,t){if(!mw)return;const n=mw;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,Zc=!1;const r=e.options.getScrollRestorationKey||cL,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(Zc||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(Pa,{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,f]of s){let h;if(u===Pa)h=Pa;else if(u.isConnected){const p=u.getAttribute(gw);h=p?`[${gw}="${p}"]`:uL(u)}h&&(l[h]=f)}};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 f;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}))){Zc=!0;try{const h=e.isScrollRestoring?n.state[l]:void 0;let p=!1;if(h)for(const m in h){const g=h[m];if(!Bo(g))continue;const{scrollX:x,scrollY:y}=g;if(!(!Number.isFinite(x)||!Number.isFinite(y))){if(m===Pa)window.scrollTo({top:y,left:x,behavior:c}),p=!0;else if(m){let v;try{v=document.querySelector(m)}catch{continue}v&&(v.scrollLeft=x,v.scrollTop=y,p=!0)}}}if(!p){const m=e.history.location.hash.slice(1);if(m){const g=((f=window.history.state)==null?void 0:f.__hashScrollIntoViewOptions)??!0;if(g){const x=document.getElementById(m);x&&x.scrollIntoView(g)}}else{const g={top:0,left:0,behavior:c};if(window.scrollTo(g),u)for(const x of u){if(x===Pa)continue;const y=typeof x=="function"?x():document.querySelector(x);y&&y.scrollTo(g)}}}}finally{Zc=!1}e.isScrollRestoring&&n.set(h=>(h[l]||(h[l]={}),h))}})}function fL(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 qh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function hL(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]=qh(s):Array.isArray(i)?i.push(qh(s)):n[r]=[i,qh(s)]}return n}const pL=gL(JSON.parse),mL=yL(JSON.stringify,JSON.parse);function gL(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=hL(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function yL(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=fL(s,r);return i?`?${i}`:""}}const mi="__root__";function dj(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 Ut(e){return e instanceof Response&&!!e.options}function xL(e){return{input:({url:t})=>{for(const n of e)t=qm(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=fj(e[n],t);return t}}}function vL(e){const t=uj(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=Du(["/",t,o.pathname]),o)}}function qm(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 fj(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 wL(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),f=n(e.isLoading),h=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),g=n(e.statusCode),x=n(e.redirect),y=n([]),v=n([]),w=n([]),k=r(()=>Yh(o,y.get())),_=r(()=>Yh(a,v.get())),S=r(()=>Yh(l,w.get())),j=r(()=>y.get()[0]),E=r(()=>y.get().some(D=>{var O;return((O=o.get(D))==null?void 0:O.get().status)==="pending"})),T=r(()=>{var D;return{locationHref:p.get().href,resolvedLocationHref:(D=m.get())==null?void 0:D.href,status:c.get()}}),P=r(()=>({status:c.get(),loadedAt:u.get(),isLoading:f.get(),isTransitioning:h.get(),matches:k.get(),location:p.get(),resolvedLocation:m.get(),statusCode:g.get(),redirect:x.get()})),N=Ml(64);function R(D){let O=N.get(D);return O||(O=r(()=>{const V=y.get();for(const C of V){const U=o.get(C);if(U&&U.routeId===D)return U.get()}}),N.set(D,O)),O}const L={status:c,loadedAt:u,isLoading:f,isTransitioning:h,location:p,resolvedLocation:m,statusCode:g,redirect:x,matchesId:y,pendingIds:v,cachedIds:w,matches:k,pendingMatches:_,cachedMatches:S,firstId:j,hasPending:E,matchRouteDeps:T,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:P,getRouteMatchStore:R,setMatches:I,setPending:z,setCached:$};I(e.matches),i==null||i(L);function I(D){Jh(D,o,y,n,s)}function z(D){Jh(D,a,v,n,s)}function $(D){Jh(D,l,w,n,s)}return L}function Yh(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function Jh(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)}KR(n.get(),i)||n.set(i)})}const Ym=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},bL=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),Af=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),gi=(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},yw=(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},gs=(e,t,n)=>{var r,s,i;if(!(!Ut(n)&&!St(n)))throw Ut(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:Ut(n)?"redirected":St(n)?"notFound":o.status==="pending"?"success":o.status,context:gi(e,t.index),isFetching:!1,error:n})),St(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),Ut(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},hj=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},xw=(e,t,n)=>{const r=gi(e,n);e.updateMatch(t,s=>({...s,context:r}))},Ta=(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),gs(e,e.router.getMatch(s),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(c){n=c,gs(e,e.router.getMatch(s),n)}e.updateMatch(s,c=>{var u,f;return(u=c._nonReactive.beforeLoadPromise)==null||u.resolve(),c._nonReactive.beforeLoadPromise=void 0,(f=c._nonReactive.loadPromise)==null||f.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!Ut(n)&&!St(n)&&(e.serialError??(e.serialError=n))},pj=(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&&!Af(e,t)&&(n.options.loader||n.options.beforeLoad||gj(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{Ym(e)},s);r._nonReactive.pendingTimeout=o}},kL=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;pj(e,t,n,r);const s=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&gs(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},_L=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Vo(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&Ta(e,n,o,"PARSE_PARAMS"),a&&Ta(e,n,a,"VALIDATE_SEARCH"),pj(e,t,r,s);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,k=>({...k,isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:l})))},f=()=>{var k;(k=s._nonReactive.beforeLoadPromise)==null||k.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),f()});return}s._nonReactive.beforeLoadPromise=Vo();const h={...gi(e,n,!1),...s.__routeContext},{search:p,params:m,cause:g}=s,x=Af(e,t),y={search:p,abortController:l,params:m,preload:x,context:h,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:x?"preload":g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=k=>{if(k===void 0){e.router.batch(()=>{u(),f()});return}(Ut(k)||St(k))&&(u(),Ta(e,n,k,"BEFORE_LOAD")),e.router.batch(()=>{u(),e.updateMatch(t,_=>({..._,__beforeLoadContext:k})),f()})};let w;try{if(w=r.options.beforeLoad(y),Ll(w))return u(),w.catch(k=>{Ta(e,n,k,"BEFORE_LOAD")}).then(v)}catch(k){u(),Ta(e,n,k,"BEFORE_LOAD")}v(w)},SL=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>_L(e,n,t,s),a=()=>{if(hj(e,n))return;const l=kL(e,n,s);return Ll(l)?l.then(o):o()};return i()},CL=(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(([f,h,p])=>({meta:f==null?void 0:f.meta,links:f==null?void 0:f.links,headScripts:f==null?void 0:f.scripts,headers:p,scripts:h,styles:f==null?void 0:f.styles}))},mj=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:c}=e.router.getMatch(n),u=gi(e,r),f=Af(e,n);return{params:o,deps:a,preload:!!f,parentMatchPromise:i,abortController:l,context:u,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:f?"preload":c,route:s,...e.router.options.additionalContext}},vw=async(e,t,n,r,s)=>{var i,o,a,l,c;try{const u=e.router.getMatch(n);try{(!(oj??e.router.isServer)||u.ssr===!0)&&$l(s);const f=s.options.loader,h=typeof f=="function"?f:f==null?void 0:f.handler,p=h==null?void 0:h(mj(e,t,n,r,s)),m=!!h&&Ll(p);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,x=>({...x,isFetching:"loader"})),h){const x=m?await p:p;gs(e,e.router.getMatch(n),x),x!==void 0&&e.updateMatch(n,y=>({...y,loaderData:x}))}s._lazyPromise&&await s._lazyPromise;const g=u._nonReactive.minPendingPromise;g&&await g,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,x=>({...x,error:void 0,context:gi(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(f){let h=f;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:gi(e,r)}));return}const p=u._nonReactive.minPendingPromise;p&&await p,St(f)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),gs(e,e.router.getMatch(n),f);try{(c=(l=s.options).onError)==null||c.call(l,f)}catch(m){h=m,gs(e,e.router.getMatch(n),m)}!Ut(h)&&!St(h)&&await $l(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:h,context:gi(e,r),status:"error",isFetching:!1}))}}catch(u){const f=e.router.getMatch(n);f&&(f._nonReactive.loaderPromise=void 0),gs(e,f,u)}},jL=async(e,t,n)=>{var p,m,g,x;async function r(y,v,w,k,_){const S=Date.now()-v.updatedAt,j=y?_.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:_.options.staleTime??e.router.options.defaultStaleTime??0,E=_.options.shouldReload,T=typeof E=="function"?E(mj(e,t,s,n,_)):E,{status:P,invalid:N}=k,R=S>=j&&(!!e.forceStaleReload||k.cause==="enter"||w!==void 0&&w!==k.id);o=P==="success"&&(N||(T??R)),y&&_.options.preload===!1||(o&&!e.sync&&u?(a=!0,(async()=>{var L,I;try{await vw(e,t,s,n,_);const z=e.router.getMatch(s);(L=z._nonReactive.loaderPromise)==null||L.resolve(),(I=z._nonReactive.loadPromise)==null||I.resolve(),z._nonReactive.loaderPromise=void 0,z._nonReactive.loadPromise=void 0}catch(z){Ut(z)&&await e.router.navigate(z.options)}})()):P!=="success"||o?await vw(e,t,s,n,_):xw(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(hj(e,s)){if(!e.router.getMatch(s))return e.matches[n];xw(e,s,n)}else{const y=e.router.getMatch(s),v=e.router.stores.matchesId.get()[n],w=((p=v&&e.router.stores.matchStores.get(v)||null)==null?void 0:p.routeId)===i?v:(m=e.router.stores.matches.get().find(_=>_.routeId===i))==null?void 0:m.id,k=Af(e,s);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload&&u)return y;await y._nonReactive.loaderPromise;const _=e.router.getMatch(s),S=_._nonReactive.error||_.error;S&&gs(e,_,S),_.status==="pending"&&await r(k,y,w,_,l)}else{const _=k&&!e.router.stores.matchStores.has(s),S=e.router.getMatch(s);S._nonReactive.loaderPromise=Vo(),_!==S.preload&&e.updateMatch(s,j=>({...j,preload:_})),await r(k,y,w,S,l)}}const f=e.router.getMatch(s);a||((g=f._nonReactive.loaderPromise)==null||g.resolve(),(x=f._nonReactive.loadPromise)==null||x.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,a||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const h=a?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(e.updateMatch(s,y=>({...y,isFetching:h,invalid:!1})),e.router.getMatch(s)):f};async function ww(e){var h,p;const t=e,n=[];bL(t.router)&&Ym(t);let r;for(let m=0;m<t.matches.length;m++){try{const g=SL(t,m);Ll(g)&&await g}catch(g){if(Ut(g))throw g;if(St(g))r=g;else if(!t.preload)throw g;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,i=r&&!t.preload?yw(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(jL(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const g of m){if(g.status!=="rejected")continue;const x=g.reason;if(Ut(x))throw x;St(x)?a??(a=x):l??(l=x)}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=yw(t,c);m===void 0&&Or();const g=t.matches[m],x=t.router.looseRoutesById[g.routeId],y=(h=t.router.options)==null?void 0:h.defaultNotFoundComponent;!x.options.notFoundComponent&&y&&(x.options.notFoundComponent=y),c.routeId=g.routeId;const v=g.routeId===t.router.routeTree.id;t.updateMatch(g.id,w=>({...w,...v?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=m,await $l(x,["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,g=>({...g,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await $l(m,["errorComponent"])}for(let m=0;m<=u;m++){const{id:g,routeId:x}=t.matches[m],y=t.router.looseRoutesById[x];try{const v=CL(t,g,y);if(v){const w=await v;t.updateMatch(g,k=>({...k,...w}))}}catch(v){console.error(`Error executing head for route ${x}:`,v)}}const f=Ym(t);if(Ll(f)&&await f,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function bw(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 $l(e,t=Ou){!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===Ou?(()=>{if(e._componentsPromise===void 0){const r=bw(e,Ou);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():bw(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function gj(e){var t;for(const n of Ou)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Ou=["component","errorComponent","pendingComponent","notFoundComponent"];var Es="__TSR_index",kw="popstate",_w="beforeunload";function EL(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 f,h;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const c=((f=e.getBlockers)==null?void 0:f.call(e))??[],u=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&c.length&&u)for(const p of c){const m=Id(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[Es];a=Sw(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[Es];a=Sw(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[Es]!==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,f;const c=((u=e.getBlockers)==null?void 0:u.call(e))??[];(f=e.setBlockers)==null||f.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 Sw(e,t){t||(t={});const n=ux();return{...t,key:n,__TSR_key:n,[Es]:e}}function PL(e){var E,T;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,o=P=>s=P,a=P=>P,l=()=>Id(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((E=t.history.state)!=null&&E.__TSR_key)&&!((T=t.history.state)!=null&&T.key)){const P=ux();t.history.replaceState({[Es]:0,key:P,__TSR_key:P},"")}let c=l(),u,f=!1,h=!1,p=!1,m=!1;const g=()=>c;let x,y;const v=()=>{x&&(j._ignoreSubscribers=!0,(x.isPush?t.history.pushState:t.history.replaceState)(x.state,"",x.href),j._ignoreSubscribers=!1,x=void 0,y=void 0,u=void 0)},w=(P,N,R)=>{const L=a(N);y||(u=c),c=Id(N,R),x={href:L,state:R,isPush:(x==null?void 0:x.isPush)||P==="push"},y||(y=Promise.resolve().then(()=>v()))},k=P=>{c=l(),j.notify({type:P})},_=async()=>{if(h){h=!1;return}const P=l(),N=P.state[Es]-c.state[Es],R=N===1,L=N===-1,I=!R&&!L||f;f=!1;const z=I?"GO":L?"BACK":"FORWARD",$=I?{type:"GO",index:N}:{type:L?"BACK":"FORWARD"};if(p)p=!1;else{const D=i();if(typeof document<"u"&&D.length){for(const O of D)if(await O.blockerFn({currentLocation:c,nextLocation:P,action:z})){h=!0,t.history.go(1),j.notify($);return}}}c=l(),j.notify($)},S=P=>{if(m){m=!1;return}let N=!1;const R=i();if(typeof document<"u"&&R.length)for(const L of R){const I=L.enableBeforeUnload??!0;if(I===!0){N=!0;break}if(typeof I=="function"&&I()===!0){N=!0;break}}if(N)return P.preventDefault(),P.returnValue=""},j=EL({getLocation:g,getLength:()=>t.history.length,pushState:(P,N)=>w("push",P,N),replaceState:(P,N)=>w("replace",P,N),back:P=>(P&&(p=!0),m=!0,t.history.back()),forward:P=>{P&&(p=!0),m=!0,t.history.forward()},go:P=>{f=!0,t.history.go(P)},createHref:P=>a(P),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(_w,S,{capture:!0}),t.removeEventListener(kw,_)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(_w,S,{capture:!0}),t.addEventListener(kw,_),t.history.pushState=function(...P){const N=n.apply(t.history,P);return j._ignoreSubscribers||k("PUSH"),N},t.history.replaceState=function(...P){const N=r.apply(t.history,P);return j._ignoreSubscribers||k("REPLACE"),N},j}function TL(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Id(e,t){const n=TL(e),r=n.indexOf("#"),s=n.indexOf("?"),i=ux();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||{[Es]:0,key:i,__TSR_key:i}}}function ux(){return(Math.random()+1).toString(36).substring(7)}function jo(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 NL=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=iL(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=PL()),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 f;this.resolvePathCache=Ml(1e3),f=this.buildRouteTree(),this.setRoutes(f)}if(!this.stores&&this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=wL(AL(this.latestLocation),f),dL(this)}let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==l||o!==c){this.basepath=l;const f=[],h=uj(l);h&&h!=="/"&&f.push(vL({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:xL(f),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=QR(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&GR(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:f,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const y=this.options.parseSearch(c),v=this.options.stringifySearch(y);return{href:l+v+u,publicHref:l+v+u,pathname:Ea(l).path,external:!1,searchStr:v,search:Hs(r==null?void 0:r.search,y),hash:Ea(u.slice(1)).path,state:ps(r==null?void 0:r.state,h)}}const p=new URL(f,this.origin),m=qm(this.rewrite,p),g=this.options.parseSearch(m.search),x=this.options.stringifySearch(g);return m.search=x,{href:m.href.replace(m.origin,""),publicHref:f,pathname:Ea(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:x,search:Hs(r==null?void 0:r.search,g),hash:Ea(m.hash.slice(1)).path,state:ps(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)=>sL({base:n,to:cx(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=>RL({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 P,N;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,f=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?f:Object.assign(f,hs(i.params,f)),m=this.getMatchedRoutes(h);let g=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]),Object.keys(p).length>0)for(const R of g){const L=((P=R.options.params)==null?void 0:P.stringify)??R.options.stringifyParams;if(L)try{Object.assign(p,L(p))}catch{}}const x=n.leaveParams?h:Ea(hw({path:h,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let y=u;if(n._includeValidateSearch&&((N=this.options.search)!=null&&N.strict)){const R={};g.forEach(L=>{if(L.options.validateSearch)try{Object.assign(R,zu(L.options.validateSearch,{...R,...y}))}catch{}}),y=R}y=LL({search:y,dest:i,destRoutes:g,_includeValidateSearch:n._includeValidateSearch}),y=Hs(u,y);const v=this.options.stringifySearch(y),w=i.hash===!0?o.hash:i.hash?hs(i.hash,o.hash):void 0,k=w?`#${w}`:"";let _=i.state===!0?o.state:i.state?hs(i.state,o.state):{};_=ps(o.state,_);const S=`${x}${v}${k}`;let j,E,T=!1;if(this.rewrite){const R=new URL(S,this.origin),L=fj(this.rewrite,R);j=R.href.replace(R.origin,""),L.origin!==this.origin?(E=L.href,T=!0):E=L.pathname+L.search+L.hash}else j=WR(S),E=j;return{publicHref:E,href:j,pathname:x,search:y,searchStr:v,state:_,hash:w??"",external:T,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=ZR(a.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:f,params:h,...p}=u.route,m=h===!1||h===null?Object.create(null):(h??!0)===!0?c:Object.assign(c,hs(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=pi(s.state,this.latestLocation.state);return l.forEach(u=>{delete s.state[u]}),c},o=js(this.latestLocation.href)===js(s.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Vo(()=>{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 f=this.history.location.state.__TSR_index,h=Id(a,{__TSR_index:n?f:f+1}),p=new URL(h.pathname,this.origin);l.to=qm(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 f=this.buildLocation({to:n,...o});s=s??f.publicHref,i=i??f.publicHref}const u=!a&&i?i:s;if(Td(u,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const f=((c=(l=this.history).getBlockers)==null?void 0:c.call(l))??[];for(const h of f)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,f=jo(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...f}),this.emit({type:"onBeforeLoad",...f}),await ww({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 x,y;let h=null,p=null,m=null,g=null;this.batch(()=>{const v=this.stores.pendingMatches.get(),w=v.length,k=this.stores.matches.get();h=w?k.filter(j=>!this.stores.pendingMatchStores.has(j.id)):null;const _=new Set;for(const j of this.stores.pendingMatchStores.values())j.routeId&&_.add(j.routeId);const S=new Set;for(const j of this.stores.matchStores.values())j.routeId&&S.add(j.routeId);p=w?k.filter(j=>!_.has(j.routeId)):null,m=w?v.filter(j=>!S.has(j.routeId)):null,g=w?v.filter(j=>S.has(j.routeId)):k,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),w&&(this.stores.setMatches(v),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(j=>j.status!=="error"&&j.status!=="notFound"&&j.status!=="redirected")]),this.clearExpiredCache())});for(const[v,w]of[[p,"onLeave"],[m,"onEnter"],[g,"onStay"]])if(v)for(const k of v)(y=(x=this.looseRoutesById[k.routeId].options)[w])==null||y.call(x,k)})})}})}catch(u){Ut(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):St(u)&&(s=u);const f=r?r.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(f),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(jo(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&&Td(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=$l,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 ww({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(Ut(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=qR(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!pi(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?pi(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??mL,parseSearch:e.parseSearch??pL,protocolAllowlist:e.protocolAllowlist??UR}),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 f,h;const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s,parsedParams:i}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:js(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?$L(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],g=c[p-1];let x,y,v;{const z=(g==null?void 0:g.search)??e.search,$=(g==null?void 0:g._strictSearch)??void 0;try{const D=zu(m.options.validateSearch,{...z})??void 0;x={...z,...D},y={...$,...D},v=void 0}catch(D){let O=D;if(D instanceof Ad||(O=new Ad(D.message,{cause:D})),t!=null&&t.throwOnError)throw O;x=z,y={},v=O}}const w=((h=(f=m.options).loaderDeps)==null?void 0:h.call(f,{search:x}))??"",k=w?JSON.stringify(w):"",{interpolatedPath:_,usedParams:S}=hw({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),j=m.id+_+k,E=this.getMatch(j),T=u.get(m.id),P=(E==null?void 0:E._strictParams)??S;let N;if(!E)try{Cw(m,S,i,P)}catch(z){if(St(z)||Ut(z)?N=z:N=new IL(z.message,{cause:z}),t!=null&&t.throwOnError)throw N}Object.assign(s,P);const R=T?"stay":"enter";let L;if(E)L={...E,cause:R,params:(T==null?void 0:T.params)??s,_strictParams:P,search:Hs(T?T.search:E.search,x),_strictSearch:y};else{const z=m.options.loader||m.options.beforeLoad||m.lazyFn||gj(m)?"pending":"success";L={id:j,ssr:m.options.ssr,index:p,routeId:m.id,params:(T==null?void 0:T.params)??s,_strictParams:P,pathname:_,updatedAt:Date.now(),search:T?Hs(T.search,x):x,_strictSearch:y,searchError:void 0,status:z,isFetching:!1,error:void 0,paramsError:N,__routeContext:void 0,_nonReactive:{loadPromise:Vo()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:R,loaderDeps:T?ps(T.loaderDeps,w):w,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||(L.globalNotFound=l===m.id),L.searchError=v;const I=this.getParentContext(g);L.context={...I,...L.__routeContext,...L.__beforeLoadContext},c[p]=L}for(let p=0;p<c.length;p++){const m=c[p],g=this.looseRoutesById[m.routeId],x=this.getMatch(m.id),y=u.get(m.routeId);if(m.params=y?Hs(y.params,s):s,!x){const v=c[p-1],w=this.getParentContext(v);if(g.options.context){const k={deps:m.loaderDeps,params:m.params,context:w??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:c,routeId:g.id};m.__routeContext=g.options.context(k)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return c}matchRoutesLightweight(e){var u;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=Rl(t),i={...e.search};for(const f of t)try{Object.assign(i,zu(f.options.validateSearch,i))}catch{}const o=Rl(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 f=Object.assign(Object.create(null),n);for(const h of t)try{Cw(h,n,r??{},f)}catch{}c=f}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:c}}},Ad=class extends Error{},IL=class extends Error{};function AL(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function zu(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ad("Async validation not supported");if(n.issues)throw new Ad(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 RL({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=js(e);let i,o;const a=YR(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 LL({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ML(n)(e,t,r??!1)}function ML(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((f,h)=>h(f),a));const u=l(c);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((f,h)=>h(f),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,...zu(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:hs(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 $L(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 mi}function Cw(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 DL="Error preloading route! ☝️";var yj=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=mi:this.parentRoute||Or();let s=r?mi:n==null?void 0:n.path;s&&s!=="/"&&(s=cj(s));const i=(n==null?void 0:n.id)||s;let o=r?mi:Du([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=Du(["/",o]));const a=o==="__root__"?"/":Du([this.parentRoute.fullPath,s]);this._path=s,this._id=o,this._fullPath=a,this._to=js(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=>dj({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.")}},OL=class extends yj{constructor(e){super(e)}};function zL(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 dx(e){const t=e.errorComponent??fx;return d.jsx(FL,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}var FL=class extends b.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 fx({error:e}){const[t,n]=b.useState(!1);return d.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[d.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),d.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"})]}),d.jsx("div",{style:{height:".25rem"}}),t?d.jsx("div",{children:d.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?d.jsx("code",{children:e.message}):null})}):null]})}function BL({children:e,fallback:t=null}){return xj()?d.jsx(Ro.Fragment,{children:e}):d.jsx(Ro.Fragment,{children:t})}function xj(){return Ro.useSyncExternalStore(VL,()=>!0,()=>!1)}function VL(){return()=>{}}var vj=b.createContext(null);function xn(e){return b.useContext(vj)}var Rf=b.createContext(void 0),UL=b.createContext(void 0),Le=(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))(Le||{});function WL({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:o,shallowPropagate:a};function r(c,u,f){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=f,u.depsTail=p;return}const m=c.subsTail;if(m!==void 0&&m.version===f&&m.sub===u)return;const g=u.depsTail=c.subsTail={version:f,dep:c,sub:u,prevDep:h,nextDep:p,prevSub:m,nextSub:void 0};p!==void 0&&(p.prevDep=g),h!==void 0?h.nextDep=g:u.deps=g,m!==void 0?m.nextSub=g:c.subs=g}function s(c,u=c.sub){const f=c.dep,h=c.prevDep,p=c.nextDep,m=c.nextSub,g=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=g:f.subsTail=g,g!==void 0?g.nextSub=m:(f.subs=m)===void 0&&n(f),p}function i(c){let u=c.nextSub,f;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 g=(c=m).nextSub;g!==void 0&&(f={value:u,prev:f},u=g);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;f!==void 0;)if(c=f.value,f=f.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function o(c,u){let f,h=0,p=!1;e:do{const m=c.dep,g=m.flags;if(u.flags&16)p=!0;else if((g&17)===17){if(e(m)){const x=m.subs;x.nextSub!==void 0&&a(x),p=!0}}else if((g&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(f={value:c,prev:f}),c=m.deps,u=m,++h;continue}if(!p){const x=c.nextDep;if(x!==void 0){c=x;continue}}for(;h--;){const x=u.subs,y=x.nextSub!==void 0;if(y?(c=f.value,f=f.prev):c=x,p){if(e(u)){y&&a(x),u=c.sub;continue}p=!1}else u.flags&=-33;u=c.sub;const v=c.nextDep;if(v!==void 0){c=v;continue e}}return p}while(!0)}function a(c){do{const u=c.sub,f=u.flags;(f&48)===32&&(u.flags=f|16,(f&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let f=u.depsTail;for(;f!==void 0;){if(f===c)return!0;f=f.prevDep}return!1}}function KL(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 Jm=[];let Fu=0;const{link:jw,unlink:HL,propagate:GL,checkDirty:wj,shallowPropagate:Ew}=WL({update(e){return e._update()},notify(e){Jm[Qm++]=e,e.flags&=~Le.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Le.Mutable|Le.Dirty,Rd(e))}});let qc=0,Qm=0,pr,Xm=0;function bj(e){try{++Xm,e()}finally{--Xm||kj()}}function Rd(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=HL(n,e)}function kj(){if(!(Xm>0)){for(;qc<Qm;){const e=Jm[qc];Jm[qc++]=void 0,e.notify()}qc=0,Qm=0}}function Pw(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?Le.None:Le.Mutable,get(){return pr!==void 0&&jw(s,pr,Fu),s._snapshot},subscribe(i){const o=KL(i),a={current:!1},l=ZL(()=>{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=pr,a=(t==null?void 0:t.compare)??Object.is;if(n)pr=s,++Fu,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=Le.Mutable|Le.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{pr=o,n&&(s.flags&=~Le.RecursedCheck),Rd(s)}}};return n?(s.flags=Le.Mutable|Le.Dirty,s.get=function(){const i=s.flags;if(i&Le.Dirty||i&Le.Pending&&wj(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&Ew(o)}}else i&Le.Pending&&(s.flags=i&~Le.Pending);return pr!==void 0&&jw(s,pr,Fu),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(GL(o),Ew(o),kj())}},s}function ZL(e){const t=()=>{const r=pr;pr=n,++Fu,n.depsTail=void 0,n.flags=Le.Watching|Le.RecursedCheck;try{return e()}finally{pr=r,n.flags&=~Le.RecursedCheck,Rd(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Le.Watching|Le.RecursedCheck,notify(){const r=this.flags;r&Le.Dirty||r&Le.Pending&&wj(this.deps,this)?t():this.flags=Le.Watching},stop(){this.flags=Le.None,this.depsTail=void 0,Rd(this)}};return t(),n}var _j={exports:{}},Sj={},Cj={exports:{}},jj={};/**
|
|
42
|
+
* @license React
|
|
43
|
+
* use-sync-external-store-shim.production.js
|
|
44
|
+
*
|
|
45
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the MIT license found in the
|
|
48
|
+
* LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/var Uo=b;function qL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var YL=typeof Object.is=="function"?Object.is:qL,JL=Uo.useState,QL=Uo.useEffect,XL=Uo.useLayoutEffect,eM=Uo.useDebugValue;function tM(e,t){var n=t(),r=JL({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return XL(function(){s.value=n,s.getSnapshot=t,Qh(s)&&i({inst:s})},[e,n,t]),QL(function(){return Qh(s)&&i({inst:s}),e(function(){Qh(s)&&i({inst:s})})},[e]),eM(n),n}function Qh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!YL(e,n)}catch{return!0}}function nM(e,t){return t()}var rM=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?nM:tM;jj.useSyncExternalStore=Uo.useSyncExternalStore!==void 0?Uo.useSyncExternalStore:rM;Cj.exports=jj;var sM=Cj.exports;/**
|
|
50
|
+
* @license React
|
|
51
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/var Lf=b,iM=sM;function oM(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aM=typeof Object.is=="function"?Object.is:oM,lM=iM.useSyncExternalStore,cM=Lf.useRef,uM=Lf.useEffect,dM=Lf.useMemo,fM=Lf.useDebugValue;Sj.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=cM(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=dM(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 f=m}return f=p}if(m=f,aM(u,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(u=p,m):(u=p,f=g)}var c=!1,u,f,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=lM(e,i[0],i[1]);return uM(function(){o.hasValue=!0,o.value=a},[a]),fM(a),a};_j.exports=Sj;var Ej=_j.exports;const hM=pf(Ej);function pM(e,t){return e===t}function Zt(e,t,n=pM){const r=b.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(o);return a},[e]),s=b.useCallback(()=>e==null?void 0:e.get(),[e]);return Ej.useSyncExternalStoreWithSelector(r,s,s,t,n)}var mM={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Ii(e){const t=xn(),n=b.useContext(e.from?UL:Rf),r=e.from??n,s=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,i=b.useRef(void 0);return Zt(s??mM,o=>{if((e.shouldThrow??!0)&&!o&&Or(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=ps(i.current,a);return i.current=l,l}return a})}function Pj(e){return Ii({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Tj(e){const{select:t,...n}=e;return Ii({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Ai(e){return Ii({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 hx(e){return Ii({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function lt(e){const t=xn();return b.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function Nj(e){return Ii({...e,select:t=>e.select?e.select(t.context):t.context})}function gM(e,t){const n=xn(),r=OR(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:c,preloadIntentProximity:u,hashScrollIntoView:f,replace:h,startTransition:p,resetScroll:m,viewTransition:g,children:x,target:y,disabled:v,style:w,className:k,onClick:_,onBlur:S,onFocus:j,onMouseEnter:E,onMouseLeave:T,onTouchStart:P,ignoreBlocker:N,params:R,search:L,hash:I,state:z,mask:$,reloadDocument:D,unsafeRelative:O,from:V,_fromLocation:C,...U}=e,Q=xj(),A=b.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ge=Zt(n.stores.location,we=>we,(we,F)=>we.href===F.href),ke=b.useMemo(()=>{const we={_fromLocation:ge,...A};return n.buildLocation(we)},[n,ge,A]),ve=ke.maskedLocation?ke.maskedLocation.publicHref:ke.publicHref,Xt=ke.maskedLocation?ke.maskedLocation.external:ke.external,ct=b.useMemo(()=>kM(ve,Xt,n.history,v),[v,Xt,ve,n.history]),bn=b.useMemo(()=>{if(ct!=null&&ct.external)return Td(ct.href,n.protocolAllowlist)?void 0:ct.href;if(!_M(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Td(a,n.protocolAllowlist)?void 0:a}catch{}},[a,ct,n.protocolAllowlist]),sr=b.useMemo(()=>{if(bn)return!1;if(o!=null&&o.exact){if(!rL(ge.pathname,ke.pathname,n.basepath))return!1}else{const we=Nd(ge.pathname,n.basepath),F=Nd(ke.pathname,n.basepath);if(!(we.startsWith(F)&&(we.length===F.length||we[F.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!pi(ge.search,ke.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?Q&&ge.hash===ke.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,ge,bn,Q,ke.hash,ke.pathname,ke.search,n.basepath]),Sr=sr?hs(s,{})??yM:Xh,Di=sr?Xh:hs(i,{})??Xh,Sc=[k,Sr.className,Di.className].filter(Boolean).join(" "),Cc=(w||Sr.style||Di.style)&&{...w,...Sr.style,...Di.style},[jc,ma]=b.useState(!1),ga=b.useRef(!1),Hr=e.reloadDocument||bn?!1:l??n.options.defaultPreload,Oi=c??n.options.defaultPreloadDelay??0,ir=b.useCallback(()=>{n.preloadRoute({...A,_builtLocation:ke}).catch(we=>{console.warn(we),console.warn(DL)})},[n,A,ke]);DR(r,b.useCallback(we=>{we!=null&&we.isIntersecting&&ir()},[ir]),bM,{disabled:!!v||Hr!=="viewport"}),b.useEffect(()=>{ga.current||!v&&Hr==="render"&&(ir(),ga.current=!0)},[v,ir,Hr]);const yh=we=>{const F=we.currentTarget.getAttribute("target"),G=y!==void 0?y:F;if(!v&&!SM(we)&&!we.defaultPrevented&&(!G||G==="_self")&&we.button===0){we.preventDefault(),Ni.flushSync(()=>{ma(!0)});const ie=n.subscribe("onResolved",()=>{ie(),ma(!1)});n.navigate({...A,replace:h,resetScroll:m,hashScrollIntoView:f,startTransition:p,viewTransition:g,ignoreBlocker:N})}};if(bn)return{...U,ref:r,href:bn,...x&&{children:x},...y&&{target:y},...v&&{disabled:v},...w&&{style:w},...k&&{className:k},..._&&{onClick:_},...S&&{onBlur:S},...j&&{onFocus:j},...E&&{onMouseEnter:E},...T&&{onMouseLeave:T},...P&&{onTouchStart:P}};const Ec=we=>{if(v||Hr!=="intent")return;if(!Oi){ir();return}const F=we.currentTarget;if(Na.has(F))return;const G=setTimeout(()=>{Na.delete(F),ir()},Oi);Na.set(F,G)},xh=we=>{v||Hr!=="intent"||ir()},Pc=we=>{if(v||!Hr||!Oi)return;const F=we.currentTarget,G=Na.get(F);G&&(clearTimeout(G),Na.delete(F))};return{...U,...Sr,...Di,href:ct==null?void 0:ct.href,ref:r,onClick:Bi([_,yh]),onBlur:Bi([S,Pc]),onFocus:Bi([j,Ec]),onMouseEnter:Bi([E,Ec]),onMouseLeave:Bi([T,Pc]),onTouchStart:Bi([P,xh]),disabled:!!v,target:y,...Cc&&{style:Cc},...Sc&&{className:Sc},...v&&xM,...sr&&vM,...Q&&jc&&wM}}var Xh={},yM={className:"active"},xM={role:"link","aria-disabled":!0},vM={"data-status":"active","aria-current":"page"},wM={"data-transitioning":"transitioning"},Na=new WeakMap,bM={rootMargin:"100px"},Bi=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function kM(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function _M(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Ij=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=gM(r,t),o=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=i;return b.createElement("a",l,o)}return b.createElement(n,i,o)});function SM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var CM=class extends yj{constructor(e){super(e),this.useMatch=t=>Ii({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Nj({...t,from:this.id}),this.useSearch=t=>hx({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Ai({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Tj({...t,from:this.id}),this.useLoaderData=t=>Pj({...t,from:this.id}),this.useNavigate=()=>lt({from:this.fullPath}),this.Link=Ro.forwardRef((t,n)=>d.jsx(Ij,{ref:n,from:this.fullPath,...t}))}};function Ot(e){return new CM(e)}var jM=class extends OL{constructor(e){super(e),this.useMatch=t=>Ii({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Nj({...t,from:this.id}),this.useSearch=t=>hx({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Ai({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Tj({...t,from:this.id}),this.useLoaderData=t=>Pj({...t,from:this.id}),this.useNavigate=()=>lt({from:this.fullPath}),this.Link=Ro.forwardRef((t,n)=>d.jsx(Ij,{ref:n,from:this.fullPath,...t}))}};function EM(e){return new jM(e)}function PM(e){const t=xn(),n=`not-found-${Zt(t.stores.location,r=>r.pathname)}-${Zt(t.stores.status,r=>r)}`;return d.jsx(dx,{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 TM(){return d.jsx("p",{children:"Not Found"})}function qi(e){return d.jsx(d.Fragment,{children:e.children})}function Aj(e,t,n){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?d.jsx(e.options.defaultNotFoundComponent,{...n}):d.jsx(TM,{})}function NM(e){return null}function IM(){return NM(xn()),null}var Rj=b.memo(function({matchId:t}){const n=xn(),r=n.stores.matchStores.get(t);r||Or();const s=Zt(n.stores.loadedAt,o=>o),i=Zt(r,o=>o);return d.jsx(AM,{router:n,matchId:t,resetKey:s,matchState:b.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 AM({router:e,matchId:t,resetKey:n,matchState:r}){var m,g;const s=e.routesById[r.routeId],i=s.options.pendingComponent??e.options.defaultPendingComponent,o=i?d.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",f=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??i??(((g=s.options.errorComponent)==null?void 0:g.preload)||u))?b.Suspense:qi,h=a?dx:qi,p=c?PM:qi;return d.jsxs(s.isRoot?s.options.shellComponent??qi:qi,{children:[d.jsx(Rf.Provider,{value:t,children:d.jsx(f,{fallback:o,children:d.jsx(h,{getResetKey:()=>n,errorComponent:a||fx,onCatch:(x,y)=>{if(St(x))throw x.routeId??(x.routeId=r.routeId),x;l==null||l(x,y)},children:d.jsx(p,{fallback:x=>{if(x.routeId??(x.routeId=r.routeId),!c||x.routeId&&x.routeId!==r.routeId||!x.routeId&&!s.isRoot)throw x;return b.createElement(c,x)},children:u||r._displayPending?d.jsx(BL,{fallback:o,children:d.jsx(Tw,{matchId:t})}):d.jsx(Tw,{matchId:t})})})})}),r.parentRouteId===mi?d.jsxs(d.Fragment,{children:[d.jsx(RM,{resetKey:n}),e.options.scrollRestoration&&oj?d.jsx(IM,{}):null]}):null]})}function RM({resetKey:e}){const t=xn(),n=b.useRef(void 0);return Wa(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...jo(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var Tw=b.memo(function({matchId:t}){const n=xn(),r=(u,f)=>{var h;return((h=n.getMatch(u.id))==null?void 0:h._nonReactive[f])??u._nonReactive[f]},s=n.stores.matchStores.get(t);s||Or();const i=Zt(s,u=>u),o=i.routeId,a=n.routesById[o],l=b.useMemo(()=>{var f;const u=(f=n.routesById[o].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:f({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=b.useMemo(()=>{const u=a.options.component??n.options.defaultComponent;return u?d.jsx(u,{},l):d.jsx(eg,{})},[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 f=n.getMatch(i.id);if(f&&!f._nonReactive.minPendingPromise){const h=Vo();f._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),f._nonReactive.minPendingPromise=void 0},u)}}throw r(i,"loadPromise")}if(i.status==="notFound")return St(i.error)||Or(),Aj(n,a,i.error);if(i.status==="redirected")throw Ut(i.error)||Or(),r(i,"loadPromise");if(i.status==="error")throw i.error;return c}),eg=b.memo(function(){const t=xn(),n=b.useContext(Rf);let r,s=!1,i;{const c=n?t.stores.matchStores.get(n):void 0;[r,s]=Zt(c,u=>[u==null?void 0:u.routeId,(u==null?void 0:u.globalNotFound)??!1]),i=Zt(t.stores.matchesId,u=>u[u.findIndex(f=>f===n)+1])}const o=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?d.jsx(t.options.defaultPendingComponent,{}):null;if(s)return o||Or(),Aj(t,o,void 0);if(!i)return null;const l=d.jsx(Rj,{matchId:i});return r===mi?d.jsx(b.Suspense,{fallback:a,children:l}):l});function LM(){const e=xn(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),s=Zt(e.stores.isLoading,f=>f),i=Zt(e.stores.hasPending,f=>f),o=Kh(s),a=s||n||i,l=Kh(a),c=s||i,u=Kh(c);return e.startTransition=f=>{r(!0),b.startTransition(()=>{f(),r(!1)})},b.useEffect(()=>{const f=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return js(e.latestLocation.publicHref)!==js(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{f()}},[e,e.history]),Wa(()=>{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]),Wa(()=>{o&&!s&&e.emit({type:"onLoad",...jo(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),Wa(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...jo(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,u,e]),Wa(()=>{if(l&&!a){const f=jo(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...f}),bj(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),f.hrefChanged&&zL(e)}},[a,l,e]),null}function MM(){const e=xn(),t=e.routesById[mi].options.pendingComponent??e.options.defaultPendingComponent,n=t?d.jsx(t,{}):null,r=d.jsxs(typeof document<"u"&&e.ssr?qi:b.Suspense,{fallback:n,children:[d.jsx(LM,{}),d.jsx($M,{})]});return e.options.InnerWrap?d.jsx(e.options.InnerWrap,{children:r}):r}function $M(){const e=xn(),t=Zt(e.stores.firstId,s=>s),n=Zt(e.stores.loadedAt,s=>s),r=t?d.jsx(Rj,{matchId:t}):null;return d.jsx(Rf.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:d.jsx(dx,{getResetKey:()=>n,errorComponent:fx,onCatch:void 0,children:r})})}var DM=e=>({createMutableStore:Pw,createReadonlyStore:Pw,batch:bj}),OM=e=>new zM(e),zM=class extends NL{constructor(e){super(e,DM)}};function FM({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=d.jsx(vj.Provider,{value:e,children:t});return e.options.Wrap?d.jsx(e.options.Wrap,{children:r}):r}function BM({router:e,...t}){return d.jsx(FM,{router:e,...t,children:d.jsx(MM,{})})}function Nw(e){const t=xn({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=b.useRef(void 0);return Zt(n.stores.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=ps(r.current,e.select(s));return r.current=i,i}return e.select(s)}return s})}const VM="modulepreload",UM=function(e){return"/"+e},Iw={},On=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=UM(l),l in Iw)return;Iw[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":VM,c||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}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 Lj(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=Lj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function WM(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Lj(e))&&(r&&(r+=" "),r+=t);return r}const px="-",KM=e=>{const t=GM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(px);return a[0]===""&&a.length!==1&&a.shift(),Mj(a,t)||HM(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Mj=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Mj(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(px);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Aw=/^\[(.+)\]$/,HM=e=>{if(Aw.test(e)){const t=Aw.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},GM=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return qM(Object.entries(e.classGroups),n).forEach(([i,o])=>{tg(o,r,i,t)}),r},tg=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Rw(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(ZM(s)){tg(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{tg(o,Rw(t,i),n,r)})})},Rw=(e,t)=>{let n=e;return t.split(px).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ZM=e=>e.isThemeGetter,qM=(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,YM=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)}}},$j="!",JM=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,f;for(let x=0;x<a.length;x++){let y=a[x];if(c===0){if(y===s&&(r||a.slice(x,x+i)===t)){l.push(a.slice(u,x)),u=x+i;continue}if(y==="/"){f=x;continue}}y==="["?c++:y==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith($j),m=p?h.substring(1):h,g=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:o}):o},QM=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},XM=e=>({cache:YM(e.cacheSize),parseClassName:JM(e),...KM(e)}),e$=/\s+/,t$=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(e$);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let m=!!p,g=r(m?h.substring(0,p):h);if(!g){if(!m){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}m=!1}const x=QM(u).join(":"),y=f?x+$j:x,v=y+g;if(i.includes(v))continue;i.push(v);const w=s(g,m);for(let k=0;k<w.length;++k){const _=w[k];i.push(y+_)}a=c+(a.length>0?" "+a:a)}return a};function n$(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Dj(t))&&(r&&(r+=" "),r+=n);return r}const Dj=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Dj(e[r]))&&(n&&(n+=" "),n+=t);return n};function r$(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,f)=>f(u),e());return n=XM(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=t$(l,n);return s(l,u),u}return function(){return i(n$.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Oj=/^\[(?:([a-z-]+):)?(.+)\]$/i,s$=/^\d+\/\d+$/,i$=new Set(["px","full","screen"]),o$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,a$=/\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$/,l$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,c$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,u$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Er=e=>Eo(e)||i$.has(e)||s$.test(e),Zr=e=>ea(e,"length",x$),Eo=e=>!!e&&!Number.isNaN(Number(e)),ep=e=>ea(e,"number",Eo),Ia=e=>!!e&&Number.isInteger(Number(e)),d$=e=>e.endsWith("%")&&Eo(e.slice(0,-1)),le=e=>Oj.test(e),qr=e=>o$.test(e),f$=new Set(["length","size","percentage"]),h$=e=>ea(e,f$,zj),p$=e=>ea(e,"position",zj),m$=new Set(["image","url"]),g$=e=>ea(e,m$,w$),y$=e=>ea(e,"",v$),Aa=()=>!0,ea=(e,t,n)=>{const r=Oj.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},x$=e=>a$.test(e)&&!l$.test(e),zj=()=>!1,v$=e=>c$.test(e),w$=e=>u$.test(e),b$=()=>{const e=Ie("colors"),t=Ie("spacing"),n=Ie("blur"),r=Ie("brightness"),s=Ie("borderColor"),i=Ie("borderRadius"),o=Ie("borderSpacing"),a=Ie("borderWidth"),l=Ie("contrast"),c=Ie("grayscale"),u=Ie("hueRotate"),f=Ie("invert"),h=Ie("gap"),p=Ie("gradientColorStops"),m=Ie("gradientColorStopPositions"),g=Ie("inset"),x=Ie("margin"),y=Ie("opacity"),v=Ie("padding"),w=Ie("saturate"),k=Ie("scale"),_=Ie("sepia"),S=Ie("skew"),j=Ie("space"),E=Ie("translate"),T=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",le,t],R=()=>[le,t],L=()=>["",Er,Zr],I=()=>["auto",Eo,le],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",le],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[Eo,le];return{cacheSize:500,separator:":",theme:{colors:[Aa],spacing:[Er,Zr],blur:["none","",qr,le],brightness:U(),borderColor:[e],borderRadius:["none","","full",qr,le],borderSpacing:R(),borderWidth:L(),contrast:U(),grayscale:V(),hueRotate:U(),invert:V(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[d$,Zr],inset:N(),margin:N(),opacity:U(),padding:R(),saturate:U(),scale:U(),sepia:V(),skew:U(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[qr]}],"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:[...z(),le]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ia,le]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",Ia,le]}],"grid-cols":[{"grid-cols":[Aa]}],"col-start-end":[{col:["auto",{span:["full",Ia,le]},le]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Aa]}],"row-start-end":[{row:["auto",{span:[Ia,le]},le]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,t]}],"min-w":[{"min-w":[le,t,"min","max","fit"]}],"max-w":[{"max-w":[le,t,"none","full","min","max","fit","prose",{screen:[qr]},qr]}],h:[{h:[le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qr,Zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ep]}],"font-family":[{font:[Aa]}],"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",le]}],"line-clamp":[{"line-clamp":["none",Eo,ep]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Er,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Er,Zr]}],"underline-offset":[{"underline-offset":["auto",Er,le]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],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",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),p$]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",h$]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},g$]}],"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":[y]}],"border-style":[{border:[...$(),"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":[y]}],"divide-style":[{divide:$()}],"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:["",...$()]}],"outline-offset":[{"outline-offset":[Er,le]}],"outline-w":[{outline:[Er,Zr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Er,Zr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qr,y$]}],"shadow-color":[{shadow:[Aa]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",qr,le]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[_]}],"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":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"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",le]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Ia,le]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],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",le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Er,Zr,ep]}],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"]}}},k$=r$(b$);function tp(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 _$(e,t){return e[0]===t[0]&&e[1]===t[1]}function S$(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)tp(c,a,s);const l=function(c,u,f){const h=[];for(const v of c){const w=[...v];_$(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&h.push(w)}const p=[];u=Math.max(u,.1);const m=[];for(const v of h)for(let w=0;w<v.length-1;w++){const k=v[w],_=v[w+1];if(k[1]!==_[1]){const S=Math.min(k[1],_[1]);m.push({ymin:S,ymax:Math.max(k[1],_[1]),x:S===k[1]?k[0]:_[0],islope:(_[0]-k[0])/(_[1]-k[1])})}}if(m.sort((v,w)=>v.ymin<w.ymin?-1:v.ymin>w.ymin?1:v.x<w.x?-1:v.x>w.x?1:v.ymax===w.ymax?0:(v.ymax-w.ymax)/Math.abs(v.ymax-w.ymax)),!m.length)return p;let g=[],x=m[0].ymin,y=0;for(;g.length||m.length;){if(m.length){let v=-1;for(let w=0;w<m.length&&!(m[w].ymin>x);w++)v=w;m.splice(0,v+1).forEach(w=>{g.push({s:x,edge:w})})}if(g=g.filter(v=>!(v.edge.ymax<=x)),g.sort((v,w)=>v.edge.x===w.edge.x?0:(v.edge.x-w.edge.x)/Math.abs(v.edge.x-w.edge.x)),(f!==1||y%u==0)&&g.length>1)for(let v=0;v<g.length;v+=2){const w=v+1;if(w>=g.length)break;const k=g[v].edge,_=g[w].edge;p.push([[Math.round(k.x),x],[Math.round(_.x),x]])}x+=f,g.forEach(v=>{v.edge.x=v.edge.x+f*v.edge.islope}),y++}return p}(o,i,r);if(s){for(const c of o)tp(c,a,-s);(function(c,u,f){const h=[];c.forEach(p=>h.push(...p)),tp(h,u,f)})(l,a,-s)}return l}function tc(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),S$(e,s,r,i||1)}class mx{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=tc(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 Mf(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 C$ extends mx{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const s=tc(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)Mf([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 j$ extends mx{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 E${constructor(t){this.helper=t}fillPolygons(t,n){const r=tc(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=Mf(a),c=l/s,u=Math.ceil(c)-1,f=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 g=p+f+m*s,x=h-o+2*Math.random()*o,y=g-o+2*Math.random()*o,v=this.helper.ellipse(x,y,i,i,n);r.push(...v.ops)}}return{type:"fillSketch",ops:r}}}class P${constructor(t){this.helper=t}fillPolygons(t,n){const r=tc(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=Mf(o),l=Math.floor(a/(r+s)),c=(a+s-l*(r+s))/2;let u=o[0],f=o[1];u[0]>f[0]&&(u=o[1],f=o[0]);const h=Math.atan((f[1]-u[1])/(f[0]-u[0]));for(let p=0;p<l;p++){const m=p*(r+s),g=m+r,x=[u[0]+m*Math.cos(h)+c*Math.cos(h),u[1]+m*Math.sin(h)+c*Math.sin(h)],y=[u[0]+g*Math.cos(h)+c*Math.cos(h),u[1]+g*Math.sin(h)+c*Math.sin(h)];i.push(...this.helper.doubleLineOps(x[0],x[1],y[0],y[1],n))}}),i}}class T${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=tc(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=Mf(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 f=0;f<a;f++){const h=2*f*n,p=2*(f+1)*n,m=Math.sqrt(2*Math.pow(n,2)),g=[l[0]+h*Math.cos(u),l[1]+h*Math.sin(u)],x=[l[0]+p*Math.cos(u),l[1]+p*Math.sin(u)],y=[g[0]+m*Math.cos(u+Math.PI/4),g[1]+m*Math.sin(u+Math.PI/4)];s.push(...this.helper.doubleLineOps(g[0],g[1],y[0],y[1],r),...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}}),s}}const zt={};class N${constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const I$=0,np=1,Lw=2,Yc={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 rp(e,t){return e.type===t}function gx(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:I$,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:np,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:Lw,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!rp(i,Lw);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return gx("M0,0"+e);s++,o=Yc[i.text],r=i.text}else rp(i,np)?o=Yc[r]:(s++,o=Yc[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(!rp(c,np))throw new Error("Param not a number: "+r+","+c.text);a[a.length]=+c.text}if(typeof Yc[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 Fj(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 Bj(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 f=0,h=0;n==="C"||n==="S"?(f=r+(r-a),h=s+(s-l)):(f=r,h=s),t.push({key:"C",data:[f,h,...u]}),a=u[0],l=u[1],r=u[2],s=u[3];break}case"T":{const[f,h]=u;let p=0,m=0;n==="Q"||n==="T"?(p=r+(r-a),m=s+(s-l)):(p=r,m=s);const g=r+2*(p-r)/3,x=s+2*(m-s)/3,y=f+2*(p-f)/3,v=h+2*(m-h)/3;t.push({key:"C",data:[g,x,y,v,f,h]}),a=p,l=m,r=f,s=h;break}case"Q":{const[f,h,p,m]=u,g=r+2*(f-r)/3,x=s+2*(h-s)/3,y=p+2*(f-p)/3,v=m+2*(h-m)/3;t.push({key:"C",data:[g,x,y,v,p,m]}),a=f,l=h,r=p,s=m;break}case"A":{const f=Math.abs(u[0]),h=Math.abs(u[1]),p=u[2],m=u[3],g=u[4],x=u[5],y=u[6];f===0||h===0?(t.push({key:"C",data:[r,s,x,y,x,y]}),r=x,s=y):(r!==x||s!==y)&&(Vj(r,s,x,y,f,h,p,m,g).forEach(function(v){t.push({key:"C",data:v})}),r=x,s=y);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=c}return t}function Ra(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Vj(e,t,n,r,s,i,o,a,l,c){const u=(f=o,Math.PI*f/180);var f;let h=[],p=0,m=0,g=0,x=0;if(c)[p,m,g,x]=c;else{[e,t]=Ra(e,t,-u),[n,r]=Ra(n,r,-u);const L=(e-n)/2,I=(t-r)/2;let z=L*L/(s*s)+I*I/(i*i);z>1&&(z=Math.sqrt(z),s*=z,i*=z);const $=s*s,D=i*i,O=$*D-$*I*I-D*L*L,V=$*I*I+D*L*L,C=(a===l?-1:1)*Math.sqrt(Math.abs(O/V));g=C*s*I/i+(e+n)/2,x=C*-i*L/s+(t+r)/2,p=Math.asin(parseFloat(((t-x)/i).toFixed(9))),m=Math.asin(parseFloat(((r-x)/i).toFixed(9))),e<g&&(p=Math.PI-p),n<g&&(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 y=m-p;if(Math.abs(y)>120*Math.PI/180){const L=m,I=n,z=r;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=Vj(n=g+s*Math.cos(m),r=x+i*Math.sin(m),I,z,s,i,o,0,l,[m,L,g,x])}y=m-p;const v=Math.cos(p),w=Math.sin(p),k=Math.cos(m),_=Math.sin(m),S=Math.tan(y/4),j=4/3*s*S,E=4/3*i*S,T=[e,t],P=[e+j*w,t-E*v],N=[n+j*_,r-E*k],R=[n,r];if(P[0]=2*T[0]-P[0],P[1]=2*T[1]-P[1],c)return[P,N,R].concat(h);{h=[P,N,R].concat(h);const L=[];for(let I=0;I<h.length;I+=3){const z=Ra(h[I][0],h[I][1],u),$=Ra(h[I+1][0],h[I+1][1],u),D=Ra(h[I+2][0],h[I+2][1],u);L.push([z[0],z[1],$[0],$[1],D[0],D[1]])}return L}}const A$={randOffset:function(e,t){return te(e,t)},randOffsetWithRange:function(e,t,n){return Ld(e,t,n)},ellipse:function(e,t,n,r,s){const i=Wj(n,r,s);return ng(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return As(e,t,n,r,s,!0)}};function Uj(e,t,n,r,s){return{type:"path",ops:As(e,t,n,r,s)}}function Bu(e,t,n){const r=(e||[]).length;if(r>2){const s=[];for(let i=0;i<r-1;i++)s.push(...As(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&s.push(...As(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:s}}return r===2?Uj(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function R$(e,t,n,r,s){return function(i,o){return Bu(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function Mw(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=Jc(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:Jc(n[0],1.5*(1+.22*t.roughness),Ow(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=Jc(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Jc(o,1.5*(1+.22*t.roughness),Ow(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 Wj(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+=te(o*l,n),a+=te(a*l,n),{increment:i,rx:o,ry:a}}function ng(e,t,n,r){const[s,i]=zw(r.increment,e,t,r.rx,r.ry,1,r.increment*Ld(.1,Ld(.4,1,n),n),n);let o=Md(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=zw(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Md(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function $w(e,t,n,r,s,i,o,a,l){const c=e,u=t;let f=Math.abs(n/2),h=Math.abs(r/2);f+=te(.01*f,l),h+=te(.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 g=2*Math.PI/l.curveStepCount,x=Math.min(g/2,(m-p)/2),y=Fw(x,c,u,f,h,p,m,1,l);if(!l.disableMultiStroke){const v=Fw(x,c,u,f,h,p,m,1.5,l);y.push(...v)}return o&&(a?y.push(...As(c,u,c+f*Math.cos(p),u+h*Math.sin(p),l),...As(c,u,c+f*Math.cos(m),u+h*Math.sin(m),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+f*Math.cos(p),u+h*Math.sin(p)]})),{type:"path",ops:y}}function Dw(e,t){const n=Bj(Fj(gx(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(...As(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[l,c,u,f,h,p]=a;r.push(...L$(l,c,u,f,h,p,i,t)),i=[h,p];break}case"Z":r.push(...As(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]]}return{type:"path",ops:r}}function sp(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]+te(s,t),r[0][1]+te(s,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+te(s,t),r[o][1]+te(s,t)]})}}return{type:"fillPath",ops:n}}function Vi(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!zt[s])switch(s){case"zigzag":zt[s]||(zt[s]=new C$(r));break;case"cross-hatch":zt[s]||(zt[s]=new j$(r));break;case"dots":zt[s]||(zt[s]=new E$(r));break;case"dashed":zt[s]||(zt[s]=new P$(r));break;case"zigzag-line":zt[s]||(zt[s]=new T$(r));break;default:s="hachure",zt[s]||(zt[s]=new mx(r))}return zt[s]}(t,A$).fillPolygons(e,t)}function Ow(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Kj(e){return e.randomizer||(e.randomizer=new N$(e.seed||0)),e.randomizer.next()}function Ld(e,t,n,r=1){return n.roughness*r*(Kj(n)*(t-e)+e)}function te(e,t,n=1){return Ld(-e,e,t,n)}function As(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=rg(e,t,n,r,s,!0,!1);if(o)return a;const l=rg(e,t,n,r,s,!0,!0);return a.concat(l)}function rg(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 f=u/2,h=.2+.2*Kj(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;p=te(p,s,c),m=te(m,s,c);const g=[],x=()=>te(f,s,c),y=()=>te(u,s,c),v=s.preserveVertices;return o?g.push({op:"move",data:[e+(v?0:x()),t+(v?0:x())]}):g.push({op:"move",data:[e+(v?0:te(u,s,c)),t+(v?0:te(u,s,c))]}),o?g.push({op:"bcurveTo",data:[p+e+(n-e)*h+x(),m+t+(r-t)*h+x(),p+e+2*(n-e)*h+x(),m+t+2*(r-t)*h+x(),n+(v?0:x()),r+(v?0:x())]}):g.push({op:"bcurveTo",data:[p+e+(n-e)*h+y(),m+t+(r-t)*h+y(),p+e+2*(n-e)*h+y(),m+t+2*(r-t)*h+y(),n+(v?0:y()),r+(v?0:y())]}),g}function Jc(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+te(t,n),e[0][1]+te(t,n)]),r.push([e[0][0]+te(t,n),e[0][1]+te(t,n)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+te(t,n),e[s][1]+te(t,n)]),s===e.length-1&&r.push([e[s][0]+te(t,n),e[s][1]+te(t,n)]);return Md(r,null,n)}function Md(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(...rg(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function zw(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 f=[t+r*Math.cos(u),n+s*Math.sin(u)];l.push(f),c.push(f)}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=te(.5,a)-Math.PI/2;c.push([te(i,a)+t+.9*r*Math.cos(u-e),te(i,a)+n+.9*s*Math.sin(u-e)]);const f=2*Math.PI+u-.01;for(let h=u;h<f;h+=e){const p=[te(i,a)+t+r*Math.cos(h),te(i,a)+n+s*Math.sin(h)];l.push(p),c.push(p)}c.push([te(i,a)+t+r*Math.cos(u+2*Math.PI+.5*o),te(i,a)+n+s*Math.sin(u+2*Math.PI+.5*o)]),c.push([te(i,a)+t+.98*r*Math.cos(u+o),te(i,a)+n+.98*s*Math.sin(u+o)]),c.push([te(i,a)+t+.9*r*Math.cos(u+.5*o),te(i,a)+n+.9*s*Math.sin(u+.5*o)])}return[c,l]}function Fw(e,t,n,r,s,i,o,a,l){const c=i+te(.1,l),u=[];u.push([te(a,l)+t+.9*r*Math.cos(c-e),te(a,l)+n+.9*s*Math.sin(c-e)]);for(let f=c;f<=o;f+=e)u.push([te(a,l)+t+r*Math.cos(f),te(a,l)+n+s*Math.sin(f)]);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)]),Md(u,null,l)}function L$(e,t,n,r,s,i,o,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const f=a.disableMultiStroke?1:2,h=a.preserveVertices;for(let p=0;p<f;p++)p===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(h?0:te(c[0],a)),o[1]+(h?0:te(c[0],a))]}),u=h?[s,i]:[s+te(c[p],a),i+te(c[p],a)],l.push({op:"bcurveTo",data:[e+te(c[p],a),t+te(c[p],a),n+te(c[p],a),r+te(c[p],a),u[0],u[1]]});return l}function La(e){return[...e]}function Bw(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(La(e[0]),La(e[1]),La(e[2]),La(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(La(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 Vu(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function M$(e,t,n){const r=Vu(t,n);if(r===0)return Vu(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)),Vu(e,ei(t,n,s))}function ei(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function sg(e,t,n,r){const s=r||[];if(function(a,l){const c=a[l+0],u=a[l+1],f=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 g=3*f[0]-2*h[0]-c[0];g*=g;let x=3*f[1]-2*h[1]-c[1];return x*=x,p<g&&(p=g),m<x&&(m=x),p+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Vu(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],f=e[t+3],h=ei(l,c,.5),p=ei(c,u,.5),m=ei(u,f,.5),g=ei(h,p,.5),x=ei(p,m,.5),y=ei(g,x,.5);sg([l,h,g,y],0,n,s),sg([y,x,m,f],0,n,s)}var i,o;return s}function $$(e,t){return $d(e,0,e.length,t)}function $d(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 f=M$(e[u],o,a);f>l&&(l=f,c=u)}return Math.sqrt(l)>r?($d(e,t,c+1,r,i),$d(e,c,n,r,i)):(i.length||i.push(o),i.push(a)),i}function ip(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)sg(e,3*i,t,r);return n&&n>0?$d(r,0,r.length,n):r}const tn="none";let Dd=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",[Uj(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=R$(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(sp([c],o)):a.push(Vi([c],o))}return o.stroke!==tn&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=Wj(r,s,o),c=ng(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const u=ng(t,n,o,l).opset;u.type="fillPath",a.push(u)}else a.push(Vi([c.estimatedPoints],o));return o.stroke!==tn&&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",[Bu(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const c=this._o(l),u=[],f=$w(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=$w(t,n,r,s,i,o,!0,!1,h);p.type="fillPath",u.push(p)}else u.push(function(h,p,m,g,x,y,v){const w=h,k=p;let _=Math.abs(m/2),S=Math.abs(g/2);_+=te(.01*_,v),S+=te(.01*S,v);let j=x,E=y;for(;j<0;)j+=2*Math.PI,E+=2*Math.PI;E-j>2*Math.PI&&(j=0,E=2*Math.PI);const T=(E-j)/v.curveStepCount,P=[];for(let N=j;N<=E;N+=T)P.push([w+_*Math.cos(N),k+S*Math.sin(N)]);return P.push([w+_*Math.cos(E),k+S*Math.sin(E)]),P.push([w,k]),Vi([P],v)}(t,n,r,s,i,o,c));return c.stroke!==tn&&u.push(f),this._d("arc",u,c)}curve(t,n){const r=this._o(n),s=[],i=Mw(t,r);if(r.fill&&r.fill!==tn)if(r.fillStyle==="solid"){const o=Mw(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(...ip(Bw([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):o.push(...ip(Bw(c),10,(1+r.roughness)/2))}o.length&&s.push(Vi([o],r))}return r.stroke!==tn&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=Bu(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(sp([t],r)):s.push(Vi([t],r))),r.stroke!==tn&&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!==tn,o=r.stroke!==tn,a=!!(r.simplification&&r.simplification<1),l=function(u,f,h){const p=Bj(Fj(gx(u))),m=[];let g=[],x=[0,0],y=[];const v=()=>{y.length>=4&&g.push(...ip(y,f)),y=[]},w=()=>{v(),g.length&&(m.push(g),g=[])};for(const{key:_,data:S}of p)switch(_){case"M":w(),x=[S[0],S[1]],g.push(x);break;case"L":v(),g.push([S[0],S[1]]);break;case"C":if(!y.length){const j=g.length?g[g.length-1]:x;y.push([j[0],j[1]])}y.push([S[0],S[1]]),y.push([S[2],S[3]]),y.push([S[4],S[5]]);break;case"Z":v(),g.push([x[0],x[1]])}if(w(),!h)return m;const k=[];for(const _ of m){const S=$$(_,h);S.length&&k.push(S)}return k}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),c=Dw(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const u=Dw(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(sp(l,r));else s.push(Vi(l,r));return o&&(a?l.forEach(u=>{s.push(Bu(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:tn};break;case"fillPath":o={d:this.opsToPath(i),stroke:tn,strokeWidth:0,fill:r.fill||tn};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||tn,strokeWidth:r,fill:tn}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},D$=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Dd(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 Qc="http://www.w3.org/2000/svg";class O${constructor(t,n){this.svg=t,this.gen=new Dd(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(Qc,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(Qc,"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(Qc,"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(Qc,"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 z$={canvas:(e,t)=>new D$(e,t),svg:(e,t)=>new O$(e,t),generator:e=>new Dd(e),newSeed:()=>Dd.newSeed()};const yx=b.createContext({});function xx(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const F$=typeof window<"u",Hj=F$?b.useLayoutEffect:b.useEffect,$f=b.createContext(null);function vx(e,t){e.indexOf(t)===-1&&e.push(t)}function Od(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const br=(e,t,n)=>n>t?t:n<e?e:n;let wx=()=>{};const Rs={},Gj=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Zj=e=>typeof e=="object"&&e!==null,qj=e=>/^0[^.\s]+$/u.test(e);function Yj(e){let t;return()=>(t===void 0&&(t=e()),t)}const Rn=e=>e,nc=(...e)=>e.reduce((t,n)=>r=>n(t(r))),Dl=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class bx{constructor(){this.subscriptions=[]}add(t){return vx(this.subscriptions,t),()=>Od(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 fn=e=>e*1e3,Nn=e=>e/1e3,Jj=(e,t)=>t?e*(1e3/t):0,Qj=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,B$=1e-7,V$=12;function U$(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Qj(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>B$&&++a<V$);return o}function rc(e,t,n,r){if(e===t&&n===r)return Rn;const s=i=>U$(i,0,1,e,n);return i=>i===0||i===1?i:Qj(s(i),t,r)}const Xj=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,eE=e=>t=>1-e(1-t),tE=rc(.33,1.53,.69,.99),kx=eE(tE),nE=Xj(kx),rE=e=>e>=1?1:(e*=2)<1?.5*kx(e):.5*(2-Math.pow(2,-10*(e-1))),_x=e=>1-Math.sin(Math.acos(e)),sE=eE(_x),iE=Xj(_x),W$=rc(.42,0,1,1),K$=rc(0,0,.58,1),oE=rc(.42,0,.58,1),H$=e=>Array.isArray(e)&&typeof e[0]!="number",aE=e=>Array.isArray(e)&&typeof e[0]=="number",G$={linear:Rn,easeIn:W$,easeInOut:oE,easeOut:K$,circIn:_x,circInOut:iE,circOut:sE,backIn:kx,backInOut:nE,backOut:tE,anticipate:rE},Z$=e=>typeof e=="string",Vw=e=>{if(aE(e)){wx(e.length===4);const[t,n,r,s]=e;return rc(t,n,r,s)}else if(Z$(e))return G$[e];return e},Xc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function q$(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,f=!1,h=!1)=>{const m=h&&s?n:r;return f&&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 f=n;n=r,r=f,n.forEach(l),n.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const Y$=40;function lE(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Xc.reduce((w,k)=>(w[k]=q$(i),w),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:h,render:p,postRender:m}=o,g=()=>{const w=Rs.useManualTiming,k=w?s.timestamp:performance.now();n=!1,w||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,Y$),1)),s.timestamp=k,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),h.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},x=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:Xc.reduce((w,k)=>{const _=o[k];return w[k]=(S,j=!1,E=!1)=>(n||x(),_.schedule(S,j,E)),w},{}),cancel:w=>{for(let k=0;k<Xc.length;k++)o[Xc[k]].cancel(w)},state:s,steps:o}}const{schedule:je,cancel:Ls,state:ht,steps:op}=lE(typeof requestAnimationFrame<"u"?requestAnimationFrame:Rn,!0);let Uu;function J$(){Uu=void 0}const At={now:()=>(Uu===void 0&&At.set(ht.isProcessing||Rs.useManualTiming?ht.timestamp:performance.now()),Uu),set:e=>{Uu=e,queueMicrotask(J$)}},cE=e=>t=>typeof t=="string"&&t.startsWith(e),uE=cE("--"),Q$=cE("var(--"),Sx=e=>Q$(e)?X$.test(e.split("/*")[0].trim()):!1,X$=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Uw(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ta={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ol={...ta,transform:e=>br(0,1,e)},eu={...ta,default:1},sl=e=>Math.round(e*1e5)/1e5,Cx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function eD(e){return e==null}const tD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jx=(e,t)=>n=>!!(typeof n=="string"&&tD.test(n)&&n.startsWith(e)||t&&!eD(n)&&Object.prototype.hasOwnProperty.call(n,t)),dE=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Cx);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},nD=e=>br(0,255,e),ap={...ta,transform:e=>Math.round(nD(e))},li={test:jx("rgb","red"),parse:dE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ap.transform(e)+", "+ap.transform(t)+", "+ap.transform(n)+", "+sl(Ol.transform(r))+")"};function rD(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 ig={test:jx("#"),parse:rD,transform:li.transform},sc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Nr=sc("deg"),wr=sc("%"),q=sc("px"),sD=sc("vh"),iD=sc("vw"),Ww={...wr,parse:e=>wr.parse(e)/100,transform:e=>wr.transform(e*100)},fo={test:jx("hsl","hue"),parse:dE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+wr.transform(sl(t))+", "+wr.transform(sl(n))+", "+sl(Ol.transform(r))+")"},nt={test:e=>li.test(e)||ig.test(e)||fo.test(e),parse:e=>li.test(e)?li.parse(e):fo.test(e)?fo.parse(e):ig.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?li.transform(e):fo.transform(e),getAnimatableNone:e=>{const t=nt.parse(e);return t.alpha=0,nt.transform(t)}},oD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function aD(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Cx))==null?void 0:t.length)||0)+(((n=e.match(oD))==null?void 0:n.length)||0)>0}const fE="number",hE="color",lD="var",cD="var(",Kw="${}",uD=/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 Wo(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(uD,l=>(nt.test(l)?(r.color.push(i),s.push(hE),n.push(nt.parse(l))):l.startsWith(cD)?(r.var.push(i),s.push(lD),n.push(l)):(r.number.push(i),s.push(fE),n.push(parseFloat(l))),++i,Kw)).split(Kw);return{values:n,split:a,indexes:r,types:s}}function dD(e){return Wo(e).values}function pE({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===fE?s+=sl(r[i]):o===hE?s+=nt.transform(r[i]):s+=r[i]}return s}}function fD(e){return pE(Wo(e))}const hD=e=>typeof e=="number"?0:nt.test(e)?nt.getAnimatableNone(e):e,pD=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:hD(e);function mD(e){const t=Wo(e);return pE(t)(t.values.map((r,s)=>pD(r,t.split[s])))}const Xn={test:aD,parse:dD,createTransformer:fD,getAnimatableNone:mD};function lp(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 gD({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=lp(l,a,e+1/3),i=lp(l,a,e),o=lp(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function zd(e,t){return n=>n>0?t:e}const Ce=(e,t,n)=>e+(t-e)*n,cp=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},yD=[ig,li,fo],xD=e=>yD.find(t=>t.test(e));function Hw(e){const t=xD(e);if(!t)return!1;let n=t.parse(e);return t===fo&&(n=gD(n)),n}const Gw=(e,t)=>{const n=Hw(e),r=Hw(t);if(!n||!r)return zd(e,t);const s={...n};return i=>(s.red=cp(n.red,r.red,i),s.green=cp(n.green,r.green,i),s.blue=cp(n.blue,r.blue,i),s.alpha=Ce(n.alpha,r.alpha,i),li.transform(s))},og=new Set(["none","hidden"]);function vD(e,t){return og.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wD(e,t){return n=>Ce(e,t,n)}function Ex(e){return typeof e=="number"?wD:typeof e=="string"?Sx(e)?zd:nt.test(e)?Gw:_D:Array.isArray(e)?mE:typeof e=="object"?nt.test(e)?Gw:bD:zd}function mE(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Ex(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function bD(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Ex(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function kD(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 _D=(e,t)=>{const n=Xn.createTransformer(t),r=Wo(e),s=Wo(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?og.has(e)&&!s.values.length||og.has(t)&&!r.values.length?vD(e,t):nc(mE(kD(r,s),s.values),n):zd(e,t)};function gE(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ce(e,t,n):Ex(e)(e,t)}const SD=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>je.update(t,n),stop:()=>Ls(t),now:()=>ht.isProcessing?ht.timestamp:At.now()}},yE=(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)})`},Fd=2e4;function Px(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Fd;)t+=n,r=e.next(t);return t>=Fd?1/0:t}function CD(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Px(r),Fd);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Nn(s)}}const Ve={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 ag(e,t){return e*Math.sqrt(1-t*t)}const jD=12;function ED(e,t,n){let r=n;for(let s=1;s<jD;s++)r=r-e(r)/t(r);return r}const up=.001;function PD({duration:e=Ve.duration,bounce:t=Ve.bounce,velocity:n=Ve.velocity,mass:r=Ve.mass}){let s,i,o=1-t;o=br(Ve.minDamping,Ve.maxDamping,o),e=br(Ve.minDuration,Ve.maxDuration,Nn(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,p=ag(c,o),m=Math.exp(-f);return up-h/p*m},i=c=>{const f=c*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-f),g=ag(Math.pow(c,2),o);return(-s(c)+up>0?-1:1)*((h-p)*m)/g}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-up+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=ED(s,i,a);if(e=fn(e),isNaN(l))return{stiffness:Ve.stiffness,damping:Ve.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const TD=["duration","bounce"],ND=["stiffness","damping","mass"];function Zw(e,t){return t.some(n=>e[n]!==void 0)}function ID(e){let t={velocity:Ve.velocity,stiffness:Ve.stiffness,damping:Ve.damping,mass:Ve.mass,isResolvedFromDuration:!1,...e};if(!Zw(e,ND)&&Zw(e,TD))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*br(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ve.mass,stiffness:s,damping:i}}else{const n=PD({...e,velocity:0});t={...t,...n,mass:Ve.mass},t.isResolvedFromDuration=!0}return t}function Bd(e=Ve.visualDuration,t=Ve.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:f,velocity:h,isResolvedFromDuration:p}=ID({...n,velocity:-Nn(n.velocity||0)}),m=h||0,g=c/(2*Math.sqrt(l*u)),x=o-i,y=Nn(Math.sqrt(l/u)),v=Math.abs(x)<5;r||(r=v?Ve.restSpeed.granular:Ve.restSpeed.default),s||(s=v?Ve.restDelta.granular:Ve.restDelta.default);let w,k,_,S,j,E;if(g<1)_=ag(y,g),S=(m+g*y*x)/_,w=P=>{const N=Math.exp(-g*y*P);return o-N*(S*Math.sin(_*P)+x*Math.cos(_*P))},j=g*y*S+x*_,E=g*y*x-S*_,k=P=>Math.exp(-g*y*P)*(j*Math.sin(_*P)+E*Math.cos(_*P));else if(g===1){w=N=>o-Math.exp(-y*N)*(x+(m+y*x)*N);const P=m+y*x;k=N=>Math.exp(-y*N)*(y*P*N-m)}else{const P=y*Math.sqrt(g*g-1);w=I=>{const z=Math.exp(-g*y*I),$=Math.min(P*I,300);return o-z*((m+g*y*x)*Math.sinh($)+P*x*Math.cosh($))/P};const N=(m+g*y*x)/P,R=g*y*N-x*P,L=g*y*x-N*P;k=I=>{const z=Math.exp(-g*y*I),$=Math.min(P*I,300);return z*(R*Math.sinh($)+L*Math.cosh($))}}const T={calculatedDuration:p&&f||null,velocity:P=>fn(k(P)),next:P=>{if(!p&&g<1){const R=Math.exp(-g*y*P),L=Math.sin(_*P),I=Math.cos(_*P),z=o-R*(S*L+x*I),$=fn(R*(j*L+E*I));return a.done=Math.abs($)<=r&&Math.abs(o-z)<=s,a.value=a.done?o:z,a}const N=w(P);if(p)a.done=P>=f;else{const R=fn(k(P));a.done=Math.abs(R)<=r&&Math.abs(o-N)<=s}return a.value=a.done?o:N,a},toString:()=>{const P=Math.min(Px(T),Fd),N=yE(R=>T.next(P*R).value,P,30);return P+"ms "+N},toTransition:()=>{}};return T}Bd.applyToOptions=e=>{const t=CD(e,100,Bd);return e.ease=t.ease,e.duration=fn(t.duration),e.type="keyframes",e};const AD=5;function xE(e,t,n){const r=Math.max(t-AD,0);return Jj(n-e(r),t-r)}function lg({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 f=e[0],h={done:!1,value:f},p=E=>a!==void 0&&E<a||l!==void 0&&E>l,m=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let g=n*t;const x=f+g,y=o===void 0?x:o(x);y!==x&&(g=y-f);const v=E=>-g*Math.exp(-E/r),w=E=>y+v(E),k=E=>{const T=v(E),P=w(E);h.done=Math.abs(T)<=c,h.value=h.done?y:P};let _,S;const j=E=>{p(h.value)&&(_=E,S=Bd({keyframes:[h.value,m(h.value)],velocity:xE(w,E,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return j(0),{calculatedDuration:null,next:E=>{let T=!1;return!S&&_===void 0&&(T=!0,k(E),j(E)),_!==void 0&&E>=_?S.next(E-_):(!T&&k(E),h)}}}function RD(e,t,n){const r=[],s=n||Rs.mix||gE,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]||Rn:t;a=nc(l,a)}r.push(a)}return r}function LD(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(wx(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=RD(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=Dl(e[f],e[f+1],u);return a[f](h)};return n?u=>c(br(e[0],e[i-1],u)):c}function MD(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Dl(0,t,r);e.push(Ce(n,1,s))}}function $D(e){const t=[0];return MD(t,e.length-1),t}function DD(e,t){return e.map(n=>n*t)}function OD(e,t){return e.map(()=>t||oE).splice(0,e.length-1)}function il({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=H$(r)?r.map(Vw):Vw(r),i={done:!1,value:t[0]},o=DD(n&&n.length===t.length?n:$D(t),e),a=LD(o,t,{ease:Array.isArray(s)?s:OD(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const zD=e=>e!==null;function Df(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(zD),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const FD={decay:lg,inertia:lg,tween:il,keyframes:il,spring:Bd};function vE(e){typeof e.type=="string"&&(e.type=FD[e.type])}class Tx{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 BD=e=>e/100;class Vd extends Tx{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!==At.now()&&this.tick(At.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;vE(t);const{type:n=il,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||il;l!==il&&typeof a[0]!="number"&&(this.mixKeyframes=nc(BD,gE(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=Px(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:f,repeatType:h,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:x}=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 y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let w=this.currentTime,k=r;if(f){const E=Math.min(this.currentTime,s)/a;let T=Math.floor(E),P=E%1;!P&&E>=1&&(P=1),P===1&&T--,T=Math.min(T,f+1),!!(T%2)&&(h==="reverse"?(P=1-P,p&&(P-=p/a)):h==="mirror"&&(k=o)),w=br(0,1,P)*a}let _;v?(this.delayState.value=u[0],_=this.delayState):_=k.next(w),i&&!v&&(_.value=i(_.value));let{done:S}=_;!v&&l!==null&&(S=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return j&&m!==lg&&(_.value=Df(u,this.options,x,this.speed)),g&&g(_.value),j&&this.finish(),_}then(t,n){return this.finished.then(t,n)}get duration(){return Nn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Nn(t)}get time(){return Nn(this.currentTime)}set time(t){t=fn(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 xE(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(At.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Nn(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=SD,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(At.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 VD(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ci=e=>e*180/Math.PI,cg=e=>{const t=ci(Math.atan2(e[1],e[0]));return ug(t)},UD={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:cg,rotateZ:cg,skewX:e=>ci(Math.atan(e[1])),skewY:e=>ci(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ug=e=>(e=e%360,e<0&&(e+=360),e),qw=cg,Yw=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Jw=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),WD={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yw,scaleY:Jw,scale:e=>(Yw(e)+Jw(e))/2,rotateX:e=>ug(ci(Math.atan2(e[6],e[5]))),rotateY:e=>ug(ci(Math.atan2(-e[2],e[0]))),rotateZ:qw,rotate:qw,skewX:e=>ci(Math.atan(e[4])),skewY:e=>ci(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function dg(e){return e.includes("scale")?1:0}function fg(e,t){if(!e||e==="none")return dg(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=WD,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=UD,s=a}if(!s)return dg(t);const i=r[t],o=s[1].split(",").map(HD);return typeof i=="function"?i(o):o[i]}const KD=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return fg(n,t)};function HD(e){return parseFloat(e.trim())}const na=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ra=new Set([...na,"pathRotation"]),Qw=e=>e===ta||e===q,GD=new Set(["x","y","z"]),ZD=na.filter(e=>!GD.has(e));function qD(e){const t=[];return ZD.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ys={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})=>fg(t,"x"),y:(e,{transform:t})=>fg(t,"y")};ys.translateX=ys.x;ys.translateY=ys.y;const yi=new Set;let hg=!1,pg=!1,mg=!1;function wE(){if(pg){const e=Array.from(yi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=qD(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)})}pg=!1,hg=!1,yi.forEach(e=>e.complete(mg)),yi.clear()}function bE(){yi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(pg=!0)})}function YD(){mg=!0,bE(),wE(),mg=!1}class Nx{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?(yi.add(this),hg||(hg=!0,je.read(bE),je.resolveKeyframes(wE))):(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])}VD(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),yi.delete(this)}cancel(){this.state==="scheduled"&&(yi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const JD=e=>e.startsWith("--");function kE(e,t,n){JD(t)?e.style.setProperty(t,n):e.style[t]=n}const QD={};function _E(e,t){const n=Yj(e);return()=>QD[t]??n()}const XD=_E(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),SE=_E(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ka=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Xw={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ka([0,.65,.55,1]),circOut:Ka([.55,0,1,.45]),backIn:Ka([.31,.01,.66,-.59]),backOut:Ka([.33,1.53,.69,.99])};function CE(e,t){if(e)return typeof e=="function"?SE()?yE(e,t):"ease-out":aE(e)?Ka(e):Array.isArray(e)?e.map(n=>CE(n,t)||Xw.easeOut):Xw[e]}function eO(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 f=CE(a,s);Array.isArray(f)&&(u.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(u,h)}function jE(e){return typeof e=="function"&&"applyToOptions"in e}function tO({type:e,...t}){return jE(e)&&SE()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class EE extends Tx{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,wx(typeof t.type!="string");const c=tO(t);this.animation=eO(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Df(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),kE(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 Nn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Nn(t)}get time(){return Nn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=fn(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&&XD()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Rn):s(this)}}const PE={anticipate:rE,backInOut:nE,circInOut:iE};function nO(e){return e in PE}function rO(e){typeof e.ease=="string"&&nO(e.ease)&&(e.ease=PE[e.ease])}const dp=10;class sO extends EE{constructor(t){rO(t),vE(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 Vd({...o,autoplay:!1}),l=Math.max(dp,At.now()-this.startTime),c=br(0,dp,l-dp),u=a.sample(l).value,{name:f}=this.options;i&&f&&kE(i,f,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const eb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Xn.test(e)||e==="0")&&!e.startsWith("url("));function iO(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 oO(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=eb(s,t),a=eb(i,t);return!o||!a?!1:iO(e)||(n==="spring"||jE(n))&&r}function gg(e){e.duration=0,e.type="keyframes"}const TE=new Set(["opacity","clipPath","filter","transform"]),aO=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function lO(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&aO.test(e[t]))return!0;return!1}const cO=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),uO=Yj(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function dO(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return uO()&&n&&(TE.has(n)||cO.has(n)&&lO(a))&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const fO=40;class hO extends Tx{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,...f}){var m;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=At.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:c,element:u,...f},p=(u==null?void 0:u.KeyframeResolver)||Nx;this.keyframeResolver=new p(a,(g,x,y)=>this.onKeyframesResolved(g,x,h,!y),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var y,v;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=At.now();let f=!0;oO(t,i,o,a)||(f=!1,(Rs.instantAnimations||!l)&&(u==null||u(Df(t,r,n))),t[0]=t[t.length-1],gg(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>fO?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=f&&!c&&dO(p),g=(v=(y=p.motionValue)==null?void 0:y.owner)==null?void 0:v.current;let x;if(m)try{x=new sO({...p,element:g})}catch{x=new Vd(p)}else x=new Vd(p);x.finished.then(()=>{this.notifyFinished()}).catch(Rn),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}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(),YD()),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 NE(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 tb=30,pO=e=>!isNaN(parseFloat(e));class mO{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=At.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=At.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=pO(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 bx);const r=this.events[t].add(n);return t==="change"?()=>{r(),je.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=At.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>tb)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,tb);return Jj(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 Ko(e,t){return new mO(e,t)}function IE(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Ix(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?IE(n,e):n}const gO={type:"spring",stiffness:500,damping:25,restSpeed:10},yO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xO={type:"keyframes",duration:.8},vO={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wO=(e,{keyframes:t})=>t.length>2?xO:ra.has(e)?e.startsWith("scale")?yO(t[1]):gO:vO,bO=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function kO(e){for(const t in e)if(!bO.has(t))return!0;return!1}const Ax=(e,t,n,r={},s,i)=>o=>{const a=Ix(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-fn(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};kO(a)||Object.assign(u,wO(e,u)),u.duration&&(u.duration=fn(u.duration)),u.repeatDelay&&(u.repeatDelay=fn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(gg(u),u.delay===0&&(f=!0)),(Rs.instantAnimations||Rs.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(f=!0,gg(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const h=Df(u.keyframes,a);if(h!==void 0){je.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new Vd(u):new hO(u)},_O=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function SO(e){const t=_O.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function AE(e,t,n=1){const[r,s]=SO(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Gj(o)?parseFloat(o):o}return Sx(s)?AE(s,t,n+1):s}function nb(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Rx(e,t,n,r){if(typeof t=="function"){const[s,i]=nb(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]=nb(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function xi(e,t,n){const r=e.getProps();return Rx(r,t,n!==void 0?n:r.custom,e)}const RE=new Set(["width","height","top","left","right","bottom",...na]),yg=e=>Array.isArray(e);function CO(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ko(n))}function jO(e){return yg(e)?e[e.length-1]||0:e}function EO(e,t){const n=xi(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=jO(i[o]);CO(e,o,a)}}const pt=e=>!!(e&&e.getVelocity);function PO(e){return!!(pt(e)&&e.add)}function xg(e,t){const n=e.getValue("willChange");if(PO(n))return n.add(t);if(!n&&Rs.WillChange){const r=new Rs.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Lx(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const TO="framerAppearId",LE="data-"+Lx(TO);function ME(e){return e.props[LE]}function NO({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function $E(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?IE(i,l):l;const c=i==null?void 0:i.reduceMotion,u=i==null?void 0:i.skipAnimations;r&&(i=r);const f=[],h=s&&e.animationState&&e.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(e,a,i,n,f);for(const m in a){const g=e.getValue(m,e.latestValues[m]??null),x=a[m];if(x===void 0||h&&NO(h,m))continue;const y={delay:n,...Ix(i||{},m)};u&&(y.skipAnimations=!0);const v=g.get();if(v!==void 0&&!g.isAnimating()&&!Array.isArray(x)&&x===v&&!y.velocity){je.update(()=>g.set(x));continue}let w=!1;if(window.MotionHandoffAnimation){const S=ME(e);if(S){const j=window.MotionHandoffAnimation(S,m,je);j!==null&&(y.startTime=j,w=!0)}}xg(e,m);const k=c??e.shouldReduceMotion;g.start(Ax(m,g,x,k&&RE.has(m)?{type:!1}:y,e,w));const _=g.animation;_&&f.push(_)}if(o){const m=()=>je.update(()=>{o&&EO(e,o)});f.length?Promise.all(f).then(m):m()}return f}function vg(e,t,n={}){var l;const r=xi(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($E(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return IO(e,t,c,u,f,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 IO(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(vg(l,t,{...o,delay:n+(typeof r=="function"?0:r)+NE(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function AO(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>vg(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=vg(e,t,n);else{const s=typeof t=="function"?xi(e,t,n.custom):t;r=Promise.all($E(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const RO={test:e=>e==="auto",parse:e=>e},DE=e=>t=>t.test(e),OE=[ta,q,wr,Nr,iD,sD,RO],rb=e=>OE.find(DE(e));function LO(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||qj(e):!0}const MO=new Set(["brightness","contrast","saturate","opacity"]);function $O(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Cx)||[];if(!r)return e;const s=n.replace(r,"");let i=MO.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const DO=/\b([a-z-]*)\(.*?\)/gu,wg={...Xn,getAnimatableNone:e=>{const t=e.match(DO);return t?t.map($O).join(" "):e}},bg={...Xn,getAnimatableNone:e=>{const t=Xn.parse(e);return Xn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},sb={...ta,transform:Math.round},OO={rotate:Nr,pathRotation:Nr,rotateX:Nr,rotateY:Nr,rotateZ:Nr,scale:eu,scaleX:eu,scaleY:eu,scaleZ:eu,skew:Nr,skewX:Nr,skewY:Nr,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:Ol,originX:Ww,originY:Ww,originZ:q},Ud={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,...OO,zIndex:sb,fillOpacity:Ol,strokeOpacity:Ol,numOctaves:sb},zO={...Ud,color:nt,backgroundColor:nt,outlineColor:nt,fill:nt,stroke:nt,borderColor:nt,borderTopColor:nt,borderRightColor:nt,borderBottomColor:nt,borderLeftColor:nt,filter:wg,WebkitFilter:wg,mask:bg,WebkitMask:bg},zE=e=>zO[e],FO=new Set([wg,bg]);function FE(e,t){let n=zE(e);return FO.has(n)||(n=Xn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const BO=new Set(["auto","none","0"]);function VO(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!BO.has(i)&&Wo(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=FE(n,s)}class UO extends Nx{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 f=t[u];if(typeof f=="string"&&(f=f.trim(),Sx(f))){const h=AE(f,n.current);h!==void 0&&(t[u]=h),u===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!RE.has(r)||t.length!==2)return;const[s,i]=t,o=rb(s),a=rb(i),l=Uw(s),c=Uw(i);if(l!==c&&ys[r]){this.needsMeasurement=!0;return}if(o!==a)if(Qw(o)&&Qw(a))for(let u=0;u<t.length;u++){const f=t[u];typeof f=="string"&&(t[u]=parseFloat(f))}else ys[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||LO(t[s]))&&r.push(s);r.length&&VO(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=ys[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]=ys[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 BE(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 kg=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Wu(e){return Zj(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Mx}=lE(queueMicrotask,!1),Gn={x:!1,y:!1};function VE(){return Gn.x||Gn.y}function WO(e){return e==="x"||e==="y"?Gn[e]?null:(Gn[e]=!0,()=>{Gn[e]=!1}):Gn.x||Gn.y?null:(Gn.x=Gn.y=!0,()=>{Gn.x=Gn.y=!1})}function UE(e,t){const n=BE(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function KO(e){return!(e.pointerType==="touch"||VE())}function HO(e,t,n={}){const[r,s,i]=UE(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},f=x=>{c&&(c(x),c=void 0),u()},h=x=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,f(x))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=x=>{if(x.pointerType!=="touch"){if(a){l=!0;return}f(x)}},g=x=>{if(!KO(x))return;l=!1;const y=t(o,x);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",g,s),o.addEventListener("pointerdown",p,s)}),i}const WE=(e,t)=>t?e===t?!0:WE(e,t.parentElement):!1,$x=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,GO=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ZO(e){return GO.has(e.tagName)||e.isContentEditable===!0}const qO=new Set(["INPUT","SELECT","TEXTAREA"]);function YO(e){return qO.has(e.tagName)||e.isContentEditable===!0}const Ku=new WeakSet;function ib(e){return t=>{t.key==="Enter"&&e(t)}}function fp(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const JO=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ib(()=>{if(Ku.has(n))return;fp(n,"down");const s=ib(()=>{fp(n,"up")}),i=()=>fp(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 ob(e){return $x(e)&&!VE()}const ab=new WeakSet;function QO(e,t,n={}){const[r,s,i]=UE(e,n),o=a=>{const l=a.currentTarget;if(!ob(a)||ab.has(a))return;Ku.add(l),n.stopPropagation&&ab.add(a);const c=t(l,a),u=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Ku.has(l)&&Ku.delete(l),ob(p)&&typeof c=="function"&&c(p,{success:m})},f=p=>{u(p,l===window||l===document||n.useGlobalTarget||WE(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Wu(a)&&(a.addEventListener("focus",c=>JO(c,s)),!ZO(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Dx(e){return Zj(e)&&"ownerSVGElement"in e}const Hu=new WeakMap;let rs;const KE=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Dx(r)&&"getBBox"in r?r.getBBox()[t]:r[n],XO=KE("inline","width","offsetWidth"),ez=KE("block","height","offsetHeight");function tz({target:e,borderBoxSize:t}){var n;(n=Hu.get(e))==null||n.forEach(r=>{r(e,{get width(){return XO(e,t)},get height(){return ez(e,t)}})})}function nz(e){e.forEach(tz)}function rz(){typeof ResizeObserver>"u"||(rs=new ResizeObserver(nz))}function sz(e,t){rs||rz();const n=BE(e);return n.forEach(r=>{let s=Hu.get(r);s||(s=new Set,Hu.set(r,s)),s.add(t),rs==null||rs.observe(r)}),()=>{n.forEach(r=>{const s=Hu.get(r);s==null||s.delete(t),s!=null&&s.size||rs==null||rs.unobserve(r)})}}const Gu=new Set;let ho;function iz(){ho=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Gu.forEach(t=>t(e))},window.addEventListener("resize",ho)}function oz(e){return Gu.add(e),ho||iz(),()=>{Gu.delete(e),!Gu.size&&typeof ho=="function"&&(window.removeEventListener("resize",ho),ho=void 0)}}function lb(e,t){return typeof e=="function"?oz(e):sz(e,t)}function az(e){return Dx(e)&&e.tagName==="svg"}const lz=[...OE,nt,Xn],cz=e=>lz.find(DE(e)),cb=()=>({translate:0,scale:1,origin:0,originPoint:0}),po=()=>({x:cb(),y:cb()}),ub=()=>({min:0,max:0}),it=()=>({x:ub(),y:ub()}),uz=new WeakMap;function Of(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function zl(e){return typeof e=="string"||Array.isArray(e)}const Ox=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],zx=["initial",...Ox];function zf(e){return Of(e.animate)||zx.some(t=>zl(e[t]))}function HE(e){return!!(zf(e)||e.variants)}function dz(e,t,n){for(const r in t){const s=t[r],i=n[r];if(pt(s))e.addValue(r,s);else if(pt(i))e.addValue(r,Ko(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,Ko(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Wd={current:null},Fx={current:!1},fz=typeof window<"u";function GE(){if(Fx.current=!0,!!fz)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Wd.current=e.matches;e.addEventListener("change",t),t()}else Wd.current=!1}const db=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Kd={};function ZE(e){Kd=e}function hz(){return Kd}class pz{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=Nx,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=At.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,je.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=zf(n),this.isVariantNode=HE(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];c[p]!==void 0&&pt(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,uz.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:(Fx.current||GE(),this.shouldReduceMotion=Wd.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(),Ls(this.notifyUpdate),Ls(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&&TE.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,f=new EE({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:fn(u)}),h=o(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=ra.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&je.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 Kd){const n=Kd[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):it()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<db.length;r++){const s=db[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=dz(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=Ko(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"&&(Gj(r)||qj(r))?r=parseFloat(r):!cz(r)&&Xn.test(n)&&(r=FE(t,n)),this.setBaseTarget(t,pt(r)?r.get():r)),pt(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=Rx(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&&!pt(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 bx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Mx.render(this.render)}}class qE extends pz{constructor(){super(...arguments),this.KeyframeResolver=UO}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;pt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class zs{constructor(t){this.isMounted=!1,this.node=t}update(){}}function YE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function mz({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function gz(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 hp(e){return e===void 0||e===1}function _g({scale:e,scaleX:t,scaleY:n}){return!hp(e)||!hp(t)||!hp(n)}function ti(e){return _g(e)||JE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function JE(e){return fb(e.x)||fb(e.y)}function fb(e){return e&&e!=="0%"}function Hd(e,t,n){const r=e-n,s=t*r;return n+s}function hb(e,t,n,r,s){return s!==void 0&&(e=Hd(e,s,r)),Hd(e,n,r)+t}function Sg(e,t=0,n=1,r,s){e.min=hb(e.min,t,n,r,s),e.max=hb(e.max,t,n,r,s)}function QE(e,{x:t,y:n}){Sg(e.x,t.translate,t.scale,t.originPoint),Sg(e.y,n.translate,n.scale,n.originPoint)}const pb=.999999999999,mb=1.0000000000001;function yz(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&&(mr(e.x,-i.scroll.offset.x),mr(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,QE(e,o)),r&&ti(i.latestValues)&&Zu(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<mb&&t.x>pb&&(t.x=1),t.y<mb&&t.y>pb&&(t.y=1)}function mr(e,t){e.min+=t,e.max+=t}function gb(e,t,n,r,s=.5){const i=Ce(e.min,e.max,s);Sg(e,t,n,i,r)}function yb(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Zu(e,t,n){const r=n??e;gb(e.x,yb(t.x,r.x),t.scaleX,t.scale,t.originX),gb(e.y,yb(t.y,r.y),t.scaleY,t.scale,t.originY)}function XE(e,t){return YE(gz(e.getBoundingClientRect(),t))}function xz(e,t,n){const r=XE(e,n),{scroll:s}=t;return s&&(mr(r.x,s.offset.x),mr(r.y,s.offset.y)),r}const vz={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wz=na.length;function bz(e,t,n){let r="",s=!0;for(let o=0;o<wz;o++){const a=na[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=kg(l,Ud[a]);if(!c){s=!1;const f=vz[a]||a;r+=`${f}(${u}) `}n&&(t[a]=u)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${kg(i,Ud.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Bx(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(ra.has(l)){o=!0;continue}else if(uE(l)){s[l]=c;continue}else{const u=kg(c,Ud[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=bz(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 eP(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 xb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ma={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=xb(e,t.target.x),r=xb(e,t.target.y);return`${n}% ${r}%`}},kz={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Xn.parse(e);if(s.length>5)return r;const i=Xn.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=Ce(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}},Cg={borderRadius:{...Ma,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ma,borderTopRightRadius:Ma,borderBottomLeftRadius:Ma,borderBottomRightRadius:Ma,boxShadow:kz};function tP(e,{layout:t,layoutId:n}){return ra.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cg[e]||e==="opacity")}function Vx(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)(pt(r[a])||s&&pt(s[a])||tP(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function _z(e){return window.getComputedStyle(e)}class Sz extends qE{constructor(){super(...arguments),this.type="html",this.renderInstance=eP}readValueFromInstance(t,n){var r;if(ra.has(n))return(r=this.projection)!=null&&r.isProjecting?dg(n):KD(t,n);{const s=_z(t),i=(uE(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return XE(t,n)}build(t,n,r){Bx(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Vx(t,n,r)}}const Cz={offset:"stroke-dashoffset",array:"stroke-dasharray"},jz={offset:"strokeDashoffset",array:"strokeDasharray"};function Ez(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Cz:jz;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const Pz=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function nP(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(Bx(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete f.transformBox);for(const p of Pz)f[p]!==void 0&&(h[p]=f[p],delete f[p]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&Ez(f,s,i,o,!1)}const rP=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"]),sP=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Tz(e,t,n,r){eP(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(rP.has(s)?s:Lx(s),t.attrs[s])}function iP(e,t,n){const r=Vx(e,t,n);for(const s in e)if(pt(e[s])||pt(t[s])){const i=na.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class Nz extends qE{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=it}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ra.has(n)){const r=zE(n);return r&&r.default||0}return n=rP.has(n)?n:Lx(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iP(t,n,r)}build(t,n,r){nP(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Tz(t,n,r,s)}mount(t){this.isSVGTag=sP(t.tagName),super.mount(t)}}const Iz=zx.length;function oP(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?oP(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Iz;n++){const r=zx[n],s=e.props[r];(zl(s)||s===!1)&&(t[r]=s)}return t}function aP(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 Az=[...Ox].reverse(),Rz=Ox.length;function Lz(e){return t=>Promise.all(t.map(({animation:n,options:r})=>AO(e,n,r)))}function Mz(e){let t=Lz(e),n=vb(),r=!0,s=!1;const i=c=>(u,f)=>{var p;const h=xi(e,f,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:g,...x}=h;u={...u,...x,...g}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,f=oP(e.parent)||{},h=[],p=new Set;let m={},g=1/0;for(let y=0;y<Rz;y++){const v=Az[y],w=n[v],k=u[v]!==void 0?u[v]:f[v],_=zl(k),S=v===c?w.isActive:null;S===!1&&(g=y);let j=k===f[v]&&k!==u[v]&&_;if(j&&(r||s)&&e.manuallyAnimateOnMount&&(j=!1),w.protectedKeys={...m},!w.isActive&&S===null||!k&&!w.prevProp||Of(k)||typeof k=="boolean")continue;if(v==="exit"&&w.isActive&&S!==!0){w.prevResolvedValues&&(m={...m,...w.prevResolvedValues});continue}const E=$z(w.prevProp,k);let T=E||v===c&&w.isActive&&!j&&_||y>g&&_,P=!1;const N=Array.isArray(k)?k:[k];let R=N.reduce(i(v),{});S===!1&&(R={});const{prevResolvedValues:L={}}=w,I={...L,...R},z=O=>{T=!0,p.has(O)&&(P=!0,p.delete(O)),w.needsAnimating[O]=!0;const V=e.getValue(O);V&&(V.liveStyle=!1)};for(const O in I){const V=R[O],C=L[O];if(m.hasOwnProperty(O))continue;let U=!1;yg(V)&&yg(C)?U=!aP(V,C)||E:U=V!==C,U?V!=null?z(O):p.add(O):V!==void 0&&p.has(O)?z(O):w.protectedKeys[O]=!0}w.prevProp=k,w.prevResolvedValues=R,w.isActive&&(m={...m,...R}),(r||s)&&e.blockInitialAnimation&&(T=!1);const $=j&&E;T&&(!$||P)&&h.push(...N.map(O=>{const V={type:v};if(typeof O=="string"&&(r||s)&&!$&&e.manuallyAnimateOnMount&&e.parent){const{parent:C}=e,U=xi(C,O);if(C.enteringChildren&&U){const{delayChildren:Q}=U.transition||{};V.delay=NE(C.enteringChildren,e,Q)}}return{animation:O,options:V}}))}if(p.size){const y={};if(typeof u.initial!="boolean"){const v=xi(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(y.transition=v.transition)}p.forEach(v=>{const w=e.getBaseTarget(v),k=e.getValue(v);k&&(k.liveStyle=!0),y[v]=w??null}),h.push({animation:y})}let x=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?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 f=a(c);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=vb(),s=!0}}}function $z(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!aP(t,e):!1}function Gs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vb(){return{animate:Gs(!0),whileInView:Gs(),whileHover:Gs(),whileTap:Gs(),whileDrag:Gs(),whileFocus:Gs(),exit:Gs()}}function jg(e,t){e.min=t.min,e.max=t.max}function Vn(e,t){jg(e.x,t.x),jg(e.y,t.y)}function wb(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const lP=1e-4,Dz=1-lP,Oz=1+lP,cP=.01,zz=0-cP,Fz=0+cP;function Rt(e){return e.max-e.min}function Bz(e,t,n){return Math.abs(e-t)<=n}function bb(e,t,n,r=.5){e.origin=r,e.originPoint=Ce(t.min,t.max,e.origin),e.scale=Rt(n)/Rt(t),e.translate=Ce(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Dz&&e.scale<=Oz||isNaN(e.scale))&&(e.scale=1),(e.translate>=zz&&e.translate<=Fz||isNaN(e.translate))&&(e.translate=0)}function ol(e,t,n,r){bb(e.x,t.x,n.x,r?r.originX:void 0),bb(e.y,t.y,n.y,r?r.originY:void 0)}function kb(e,t,n,r=0){const s=r?Ce(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+Rt(t)}function Vz(e,t,n,r){kb(e.x,t.x,n.x,r==null?void 0:r.x),kb(e.y,t.y,n.y,r==null?void 0:r.y)}function _b(e,t,n,r=0){const s=r?Ce(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+Rt(t)}function Gd(e,t,n,r){_b(e.x,t.x,n.x,r==null?void 0:r.x),_b(e.y,t.y,n.y,r==null?void 0:r.y)}function Sb(e,t,n,r,s){return e-=t,e=Hd(e,1/n,r),s!==void 0&&(e=Hd(e,1/s,r)),e}function Uz(e,t=0,n=1,r=.5,s,i=e,o=e){if(wr.test(t)&&(t=parseFloat(t),t=Ce(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Ce(i.min,i.max,r);e===i&&(a-=t),e.min=Sb(e.min,t,n,a,s),e.max=Sb(e.max,t,n,a,s)}function Cb(e,t,[n,r,s],i,o){Uz(e,t[n],t[r],t[s],t.scale,i,o)}const Wz=["x","scaleX","originX"],Kz=["y","scaleY","originY"];function jb(e,t,n,r){Cb(e.x,t,Wz,n?n.x:void 0,r?r.x:void 0),Cb(e.y,t,Kz,n?n.y:void 0,r?r.y:void 0)}function Eb(e){return e.translate===0&&e.scale===1}function uP(e){return Eb(e.x)&&Eb(e.y)}function Pb(e,t){return e.min===t.min&&e.max===t.max}function Hz(e,t){return Pb(e.x,t.x)&&Pb(e.y,t.y)}function Tb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function dP(e,t){return Tb(e.x,t.x)&&Tb(e.y,t.y)}function Nb(e){return Rt(e.x)/Rt(e.y)}function Ib(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function dr(e){return[e("x"),e("y")]}function Gz(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:f,rotateX:h,rotateY:p,skewX:m,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}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 fP=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Zz=fP.length,Ab=e=>typeof e=="string"?parseFloat(e):e,Rb=e=>typeof e=="number"||q.test(e);function qz(e,t,n,r,s,i){s?(e.opacity=Ce(0,n.opacity??1,Yz(r)),e.opacityExit=Ce(t.opacity??1,0,Jz(r))):i&&(e.opacity=Ce(t.opacity??1,n.opacity??1,r));for(let o=0;o<Zz;o++){const a=fP[o];let l=Lb(t,a),c=Lb(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Rb(l)===Rb(c)?(e[a]=Math.max(Ce(Ab(l),Ab(c),r),0),(wr.test(c)||wr.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Ce(t.rotate||0,n.rotate||0,r))}function Lb(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Yz=hP(0,.5,sE),Jz=hP(.5,.95,Rn);function hP(e,t,n){return r=>r<e?0:r>t?1:n(Dl(e,t,r))}function Qz(e,t,n){const r=pt(e)?e:Ko(e);return r.start(Ax("",r,t,n)),r.animation}function Fl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Xz=(e,t)=>e.depth-t.depth;class eF{constructor(){this.children=[],this.isDirty=!1}add(t){vx(this.children,t),this.isDirty=!0}remove(t){Od(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Xz),this.isDirty=!1,this.children.forEach(t)}}function tF(e,t){const n=At.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ls(r),e(i-t))};return je.setup(r,!0),()=>Ls(r)}function qu(e){return pt(e)?e.get():e}class nF{constructor(){this.members=[]}add(t){vx(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&&(Od(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Od(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 Yu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},pp=["","X","Y","Z"],rF=1e3;let sF=0;function mp(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function pP(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ME(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",je,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&pP(r)}function mP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=sF++,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(aF),this.nodes.forEach(hF),this.nodes.forEach(pF),this.nodes.forEach(lF)},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 eF)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new bx),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=Dx(o)&&!az(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,f=0;const h=()=>this.root.updateBlockedByResize=!1;je.read(()=>{f=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,u&&u(),u=tF(h,250),Yu.hasAnimatedSinceResize&&(Yu.hasAnimatedSinceResize=!1,this.nodes.forEach(Db)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||vF,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=c.getProps(),y=!this.targetLayout||!dP(this.targetLayout,p),v=!f&&h;if(this.options.layoutRoot||this.resumeFrom||v||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...Ix(m,"layout"),onPlay:g,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,v,w.path)}else f||Db(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(),Ls(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(mF),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&&pP(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.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(uF),this.nodes.forEach(Mb);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach($b);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(dF),this.nodes.forEach(fF),this.nodes.forEach(iF),this.nodes.forEach(oF)):this.nodes.forEach($b),this.clearAllSnapshots();const a=At.now();ht.delta=br(0,1e3/60,a-ht.timestamp),ht.timestamp=a,ht.isProcessing=!0,op.update.process(ht),op.preRender.process(ht),op.render.process(ht),ht.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Mx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(cF),this.sharedNodes.forEach(gF)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,je.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){je.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Rt(this.snapshot.measuredBox.x)&&!Rt(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=it()),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&&!uP(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||ti(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)),wF(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return it();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(bF))){const{scroll:u}=this.root;u&&(mr(a.x,u.offset.x),mr(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=it();if(Vn(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:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Vn(a,o),mr(a.x,f.offset.x),mr(a.y,f.offset.y))}return a}applyTransform(o,a=!1,l){var u,f;const c=l||it();Vn(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&&(mr(c.x,-p.scroll.offset.x),mr(c.y,-p.scroll.offset.y)),ti(p.latestValues)&&Zu(c,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return ti(this.latestValues)&&Zu(c,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),c}removeTransform(o){var l;const a=it();Vn(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ti(u.latestValues))continue;let f;u.instance&&(_g(u.latestValues)&&u.updateSnapshot(),f=it(),Vn(f,u.measurePageBox())),jb(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,f)}return ti(this.latestValues)&&jb(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!==ht.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:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=ht.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=it(),this.targetWithTransforms=it()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Vz(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Vn(this.target,this.layout.layoutBox),QE(this.target,this.targetDelta)):Vn(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||_g(this.parent.latestValues)||JE(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=it(),this.relativeTargetOrigin=it(),Gd(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),Vn(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===ht.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;Vn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;yz(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=it());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(wb(this.prevProjectionDelta.x,this.projectionDelta.x),wb(this.prevProjectionDelta.y,this.projectionDelta.y)),ol(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Ib(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ib(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=po(),this.projectionDelta=po(),this.projectionDeltaWithTransform=po()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},f={...this.latestValues},h=po();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=it(),m=c?c.source:void 0,g=this.layout?this.layout.source:void 0,x=m!==g,y=this.getStack(),v=!y||y.members.length<=1,w=!!(x&&!v&&this.options.crossfade===!0&&!this.path.some(xF));this.animationProgress=0;let k;const _=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=S=>{const j=S/1e3,E=_==null?void 0:_(j);E?(h.x.translate=E.x,h.x.scale=Ce(o.x.scale,1,j),h.x.origin=o.x.origin,h.x.originPoint=o.x.originPoint,h.y.translate=E.y,h.y.scale=Ce(o.y.scale,1,j),h.y.origin=o.y.origin,h.y.originPoint=o.y.originPoint):(Ob(h.x,o.x,j),Ob(h.y,o.y,j)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gd(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),yF(this.relativeTarget,this.relativeTargetOrigin,p,j),k&&Hz(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=it()),Vn(k,this.relativeTarget)),x&&(this.animationValues=f,qz(f,u,this.latestValues,j,w,v)),E&&E.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=E.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},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&&(Ls(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=je.update(()=>{Yu.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ko(0)),this.motionValue.jump(0,!1),this.currentAnimation=Qz(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(rF),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&&gP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||it();const f=Rt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=Rt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Vn(a,l),Zu(a,u),ol(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new nF),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&&mp("z",o,c,this.animationValues);for(let u=0;u<pp.length;u++)mp(`rotate${pp[u]}`,o,c,this.animationValues),mp(`skew${pp[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=qu(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=qu(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ti(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=Gz(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),o.transform=f;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 Cg){if(u[m]===void 0)continue;const{correct:g,applyTo:x,isCSSVariable:y}=Cg[m],v=f==="none"?u[m]:g(u[m],c);if(x){const w=x.length;for(let k=0;k<w;k++)o[x[k]]=v}else y?this.options.visualElement.renderState.vars[m]=v:o[m]=v}this.options.layoutId&&(o.pointerEvents=c===this?qu(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(Mb),this.root.sharedNodes.clear()}}}function iF(e){e.updateLayout()}function oF(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")dr(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=Rt(h);h.min=r[f].min,h.max=h.min+p});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";jg(o?t.measuredBox[f]:t.layoutBox[f],r[f])}else gP(i,t.layoutBox,r)&&dr(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=Rt(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=po();ol(a,r,t.layoutBox);const l=po();o?ol(l,e.applyTransform(s,!0),t.measuredBox):ol(l,r,t.layoutBox);const c=!uP(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=e.options.layoutAnchor||void 0,g=it();Gd(g,t.layoutBox,h.layoutBox,m);const x=it();Gd(x,r,p.layoutBox,m),dP(g,x)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=f)}}}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 aF(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 lF(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function cF(e){e.clearSnapshot()}function Mb(e){e.clearMeasurements()}function uF(e){e.isLayoutDirty=!0,e.updateLayout()}function $b(e){e.isLayoutDirty=!1}function dF(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function fF(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Db(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hF(e){e.resolveTargetDelta()}function pF(e){e.calcProjection()}function mF(e){e.resetSkewAndRotation()}function gF(e){e.removeLeadSnapshot()}function Ob(e,t,n){e.translate=Ce(t.translate,0,n),e.scale=Ce(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function zb(e,t,n,r){e.min=Ce(t.min,n.min,r),e.max=Ce(t.max,n.max,r)}function yF(e,t,n,r){zb(e.x,t.x,n.x,r),zb(e.y,t.y,n.y,r)}function xF(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vF={duration:.45,ease:[.4,0,.1,1]},Fb=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Bb=Fb("applewebkit/")&&!Fb("chrome/")?Math.round:Rn;function Vb(e){e.min=Bb(e.min),e.max=Bb(e.max)}function wF(e){Vb(e.x),Vb(e.y)}function gP(e,t,n){return e==="position"||e==="preserve-aspect"&&!Bz(Nb(t),Nb(n),.2)}function bF(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const kF=mP({attachResizeListener:(e,t)=>Fl(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}),gp={current:void 0},yP=mP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gp.current){const e=new kF({});e.mount(window),e.setOptions({layoutScroll:!0}),gp.current=e}return gp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ux=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Ub(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _F(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Ub(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():Ub(e[s],null)}}}}function SF(...e){return b.useCallback(_F(...e),e)}class CF extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Wu(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Wu(r)&&r.offsetWidth||0,i=Wu(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 jF({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var h;const o=b.useId(),a=b.useRef(null),l=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=b.useContext(Ux),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),f=SF(a,u);return b.useInsertionEffect(()=>{const{width:p,height:m,top:g,left:x,right:y,bottom:v,direction:w}=l.current;if(t||i===!1||!a.current||!p||!m)return;const k=w==="rtl",_=n==="left"?k?`right: ${y}`:`left: ${x}`:k?`left: ${x}`:`right: ${y}`,S=r==="bottom"?`bottom: ${v}`:`top: ${g}`;a.current.dataset.motionPopId=o;const j=document.createElement("style");c&&(j.nonce=c);const E=s??document.head;return E.appendChild(j),j.sheet&&j.sheet.insertRule(`
|
|
58
|
+
[data-motion-pop-id="${o}"] {
|
|
59
|
+
position: absolute !important;
|
|
60
|
+
width: ${p}px !important;
|
|
61
|
+
height: ${m}px !important;
|
|
62
|
+
${_}px !important;
|
|
63
|
+
${S}px !important;
|
|
64
|
+
}
|
|
65
|
+
`),()=>{var T;(T=a.current)==null||T.removeAttribute("data-motion-pop-id"),E.contains(j)&&E.removeChild(j)}},[t]),d.jsx(CF,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:b.cloneElement(e,{ref:f})})}const EF=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=xx(PF),f=b.useId();let h=!0,p=b.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:m=>{u.set(m,!0);for(const g of u.values())if(!g)return;r&&r()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,r]);return i&&h&&(p={...p}),b.useMemo(()=>{u.forEach((m,g)=>u.set(g,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=d.jsx(jF,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),d.jsx($f.Provider,{value:p,children:e})};function PF(){return new Map}function xP(e=!0){const t=b.useContext($f);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=b.useId();b.useEffect(()=>{if(e)return s(i)},[e]);const o=b.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const tu=e=>e.key||"";function Wb(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const TF=({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,f]=xP(o),h=b.useMemo(()=>Wb(e),[e]),p=o&&!u?[]:h.map(tu),m=b.useRef(!0),g=b.useRef(h),x=xx(()=>new Map),y=b.useRef(new Set),[v,w]=b.useState(h),[k,_]=b.useState(h);Hj(()=>{m.current=!1,g.current=h;for(let E=0;E<k.length;E++){const T=tu(k[E]);p.includes(T)?(x.delete(T),y.current.delete(T)):x.get(T)!==!0&&x.set(T,!1)}},[k,p.length,p.join("-")]);const S=[];if(h!==v){let E=[...h];for(let T=0;T<k.length;T++){const P=k[T],N=tu(P);p.includes(N)||(E.splice(T,0,P),S.push(P))}return i==="wait"&&S.length&&(E=S),_(Wb(E)),w(h),null}const{forceRender:j}=b.useContext(yx);return d.jsx(d.Fragment,{children:k.map(E=>{const T=tu(E),P=o&&!u?!1:h===k||p.includes(T),N=()=>{if(y.current.has(T))return;if(x.has(T))y.current.add(T),x.set(T,!0);else return;let R=!0;x.forEach(L=>{L||(R=!1)}),R&&(j==null||j(),_(g.current),o&&(f==null||f()),r&&r())};return d.jsx(EF,{isPresent:P,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:P?void 0:N,anchorX:a,anchorY:l,children:E},T)})})},vP=b.createContext({strict:!1}),Kb={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 Hb=!1;function NF(){if(Hb)return;const e={};for(const t in Kb)e[t]={isEnabled:n=>Kb[t].some(r=>!!n[r])};ZE(e),Hb=!0}function wP(){return NF(),hz()}function IF(e){const t=wP();for(const n in e)t[n]={...t[n],...e[n]};ZE(t)}const AF=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 Zd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||AF.has(e)}let bP=e=>!Zd(e);function RF(e){typeof e=="function"&&(bP=t=>t.startsWith("on")?!Zd(t):e(t))}try{RF(require("@emotion/is-prop-valid").default)}catch{}function LF(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||pt(e[s])||(bP(s)||n===!0&&Zd(s)||!t&&!Zd(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Ff=b.createContext({});function MF(e,t){if(zf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||zl(n)?n:void 0,animate:zl(r)?r:void 0}}return e.inherit!==!1?t:{}}function $F(e){const{initial:t,animate:n}=MF(e,b.useContext(Ff));return b.useMemo(()=>({initial:t,animate:n}),[Gb(t),Gb(n)])}function Gb(e){return Array.isArray(e)?e.join(" "):e}const Wx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function kP(e,t,n){for(const r in t)!pt(t[r])&&!tP(r,n)&&(e[r]=t[r])}function DF({transformTemplate:e},t){return b.useMemo(()=>{const n=Wx();return Bx(n,t,e),Object.assign({},n.vars,n.style)},[t])}function OF(e,t){const n=e.style||{},r={};return kP(r,n,e),Object.assign(r,DF(e,t)),r}function zF(e,t){const n={},r=OF(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 _P=()=>({...Wx(),attrs:{}});function FF(e,t,n,r){const s=b.useMemo(()=>{const i=_P();return nP(i,t,sP(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};kP(i,e.style,e),s.style={...i,...s.style}}return s}const BF=["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 Kx(e){return typeof e!="string"||e.includes("-")?!1:!!(BF.indexOf(e)>-1||/[A-Z]/u.test(e))}function VF(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??Kx(e)?FF:zF)(t,r,s,e),c=LF(t,typeof e=="string",i),u=e!==b.Fragment?{...c,...l,ref:n}:{},{children:f}=t,h=b.useMemo(()=>pt(f)?f.get():f,[f]);return b.createElement(e,{...u,children:h})}function UF({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:WF(n,r,s,e),renderState:t()}}function WF(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=qu(i[h]);let{initial:o,animate:a}=e;const l=zf(e),c=HE(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 f=u?a:o;if(f&&typeof f!="boolean"&&!Of(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const m=Rx(e,h[p]);if(m){const{transitionEnd:g,transition:x,...y}=m;for(const v in y){let w=y[v];if(Array.isArray(w)){const k=u?w.length-1:0;w=w[k]}w!==null&&(s[v]=w)}for(const v in g)s[v]=g[v]}}}return s}const SP=e=>(t,n)=>{const r=b.useContext(Ff),s=b.useContext($f),i=()=>UF(e,t,r,s);return n?i():xx(i)},KF=SP({scrapeMotionValuesFromProps:Vx,createRenderState:Wx}),HF=SP({scrapeMotionValuesFromProps:iP,createRenderState:_P}),GF=Symbol.for("motionComponentSymbol");function ZF(e,t,n){const r=b.useRef(n);b.useInsertionEffect(()=>{r.current=n});const s=b.useRef(null);return b.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 CP=b.createContext({});function Yi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function qF(e,t,n,r,s,i){var w,k;const{visualElement:o}=b.useContext(Ff),a=b.useContext(vP),l=b.useContext($f),c=b.useContext(Ux),u=c.reducedMotion,f=c.skipAnimations,h=b.useRef(null),p=b.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:f,isSVG:i}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,g=b.useContext(CP);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&YF(h.current,n,s,g);const x=b.useRef(!1);b.useInsertionEffect(()=>{m&&x.current&&m.update(n,l)});const y=n[LE],v=b.useRef(!!y&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,y))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,y)));return Hj(()=>{p.current=!0,m&&(x.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),b.useEffect(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var _;(_=window.MotionHandoffMarkAsComplete)==null||_.call(window,y)}),v.current=!1),m.enteringChildren=void 0)}),m}function YF(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:jP(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Yi(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function jP(e){if(e)return e.options.allowProjection!==!1?e.projection:jP(e.parent)}function yp(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&IF(r);const i=n?n==="svg":Kx(e),o=i?HF:KF;function a(c,u){let f;const h={...b.useContext(Ux),...c,layoutId:JF(c)},{isStatic:p}=h,m=$F(c),g=o(c,p);if(!p&&typeof window<"u"){QF();const x=XF(h);f=x.MeasureLayout,m.visualElement=qF(e,g,h,s,x.ProjectionNode,i)}return d.jsxs(Ff.Provider,{value:m,children:[f&&m.visualElement?d.jsx(f,{visualElement:m.visualElement,...h}):null,VF(e,c,ZF(g,m.visualElement,u),g,p,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=b.forwardRef(a);return l[GF]=e,l}function JF({layoutId:e}){const t=b.useContext(yx).id;return t&&e!==void 0?t+"-"+e:e}function QF(e,t){b.useContext(vP).strict}function XF(e){const t=wP(),{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 e3(e,t){if(typeof Proxy>"u")return yp;const n=new Map,r=(i,o)=>yp(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,yp(o,void 0,e,t)),n.get(o))})}const t3=(e,t)=>t.isSVG??Kx(e)?new Nz(t):new Sz(t,{allowProjection:e!==b.Fragment});class n3 extends zs{constructor(t){super(t),t.animationState||(t.animationState=Mz(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Of(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 r3=0;class s3 extends zs{constructor(){super(...arguments),this.id=r3++,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=xi(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...f}=l;for(const h in f)(i=this.node.getValue(h))==null||i.jump(f[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 i3={animation:{Feature:n3},exit:{Feature:s3}};function ic(e){return{point:{x:e.pageX,y:e.pageY}}}const o3=e=>t=>$x(t)&&e(t,ic(t));function al(e,t,n,r){return Fl(e,t,o3(n),r)}const EP=({current:e})=>e?e.ownerDocument.defaultView:null,Zb=(e,t)=>Math.abs(e-t);function a3(e,t){const n=Zb(e.x,t.x),r=Zb(e.y,t.y);return Math.sqrt(n**2+r**2)}const qb=new Set(["auto","scroll"]);class PP{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=nu(this.lastRawMoveEventInfo,this.transformPagePoint));const p=xp(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=a3(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:x}=p,{timestamp:y}=ht;this.history.push({...x,timestamp:y});const{onStart:v,onMove:w}=this.handlers;m||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=nu(m,this.transformPagePoint),je.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:g,onSessionEnd:x,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=xp(p.type==="pointercancel"?this.lastMoveEventInfo:nu(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,v),x&&x(p,v)},!$x(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=ic(t),c=nu(l,this.transformPagePoint),{point:u}=c,{timestamp:f}=ht;this.history=[{...u,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,xp(c,this.history)),this.removeListeners=nc(al(this.contextWindow,"pointermove",this.handlePointerMove),al(this.contextWindow,"pointerup",this.handlePointerUp),al(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(qb.has(r.overflowX)||qb.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),je.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ls(this.updatePoint)}}function nu(e,t){return t?{point:t(e.point)}:e}function Yb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xp({point:e},t){return{point:e,delta:Yb(e,TP(t)),offset:Yb(e,l3(t)),velocity:c3(t,.1)}}function l3(e){return e[0]}function TP(e){return e[e.length-1]}function c3(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=TP(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>fn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>fn(t)*2&&(r=e[1]);const i=Nn(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 u3(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ce(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ce(n,e,r.max):Math.min(e,n)),e}function Jb(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 d3(e,{top:t,left:n,bottom:r,right:s}){return{x:Jb(e.x,n,s),y:Jb(e.y,t,r)}}function Qb(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 f3(e,t){return{x:Qb(e.x,t.x),y:Qb(e.y,t.y)}}function h3(e,t){let n=.5;const r=Rt(e),s=Rt(t);return s>r?n=Dl(t.min,t.max-r,e.min):r>s&&(n=Dl(e.min,e.max-s,t.min)),br(0,1,n)}function p3(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 Eg=.35;function m3(e=Eg){return e===!1?e=0:e===!0&&(e=Eg),{x:Xb(e,"left","right"),y:Xb(e,"top","bottom")}}function Xb(e,t,n){return{min:ek(e,t),max:ek(e,n)}}function ek(e,t){return typeof e=="number"?e:e[t]||0}const g3=new WeakMap;class y3{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=it(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=f=>{n&&this.snapToCursor(ic(f).point),this.stopAnimation()},o=(f,h)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=WO(p),!this.openDragLock))return;this.latestPointerEvent=f,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),dr(y=>{let v=this.getAxisMotionValue(y).get()||0;if(wr.test(v)){const{projection:w}=this.visualElement;if(w&&w.layout){const k=w.layout.layoutBox[y];k&&(v=Rt(k)*(parseFloat(v)/100))}}this.originPoint[y]=v}),g&&je.update(()=>g(f,h),!1,!0),xg(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=h;if(m&&this.currentDirection===null){this.currentDirection=v3(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),x&&je.update(()=>x(f,h),!1,!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new PP(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:EP(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&&je.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||!ru(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=u3(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&&Yi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=d3(r.layoutBox,t):this.constraints=!1,this.elastic=m3(n),s!==this.constraints&&!Yi(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&dr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=p3(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Yi(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=xz(r,s.root,this.visualElement.getTransformPagePoint());let o=f3(s.layout.layoutBox,i);if(n){const a=n(mz(o));this.hasMutatedConstraints=!!a,a&&(o=YE(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=dr(u=>{if(!ru(u,n,this.currentDirection))return;let f=l&&l[u]||{};(o===!0||o===u)&&(f={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,...f};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return xg(this.visualElement,t),r.start(Ax(t,r,0,n,this.visualElement,!1))}stopAnimation(){dr(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){dr(n=>{const{drag:r}=this.getProps();if(!ru(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]-Ce(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Yi(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};dr(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=h3({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(),dr(o=>{if(!ru(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Ce(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;g3.set(this.visualElement,this);const t=this.visualElement.current,n=al(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps(),h=c.target,p=h!==t&&YO(h);u&&f&&!p&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Yi(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=x3(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),je.read(s);const a=Fl(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(dr(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=c[f].translate,h.set(h.get()+c[f].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=Eg,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function tk(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function x3(e,t,n){const r=lb(e,tk(n)),s=lb(t,tk(n));return()=>{r(),s()}}function ru(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function v3(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class w3 extends zs{constructor(t){super(t),this.removeGroupControls=Rn,this.removeListeners=Rn,this.controls=new y3(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rn}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 vp=e=>(t,n)=>{e&&je.update(()=>e(t,n),!1,!0)};class b3 extends zs{constructor(){super(...arguments),this.removePointerDownListener=Rn}onPointerDown(t){this.session=new PP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:EP(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:vp(t),onStart:vp(n),onMove:vp(r),onEnd:(i,o)=>{delete this.session,s&&je.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=al(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 wp=!1;class k3 extends b.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),wp&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Yu.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}),wp=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||je.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(),Mx.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;wp=!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 NP(e){const[t,n]=xP(),r=b.useContext(yx);return d.jsx(k3,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(CP),isPresent:t,safeToRemove:n})}const _3={pan:{Feature:b3},drag:{Feature:w3,ProjectionNode:yP,MeasureLayout:NP}};function nk(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&&je.postRender(()=>i(t,ic(t)))}class S3 extends zs{mount(){const{current:t}=this.node;t&&(this.unmount=HO(t,(n,r)=>(nk(this.node,r,"Start"),s=>nk(this.node,s,"End"))))}unmount(){}}class C3 extends zs{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=nc(Fl(this.node.current,"focus",()=>this.onFocus()),Fl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function rk(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&&je.postRender(()=>i(t,ic(t)))}class j3 extends zs{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=QO(t,(s,i)=>(rk(this.node,i,"Start"),(o,{success:a})=>rk(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Pg=new WeakMap,bp=new WeakMap,E3=e=>{const t=Pg.get(e.target);t&&t(e)},P3=e=>{e.forEach(E3)};function T3({root:e,...t}){const n=e||document;bp.has(n)||bp.set(n,{});const r=bp.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(P3,{root:e,...t})),r[s]}function N3(e,t,n){const r=T3(t);return Pg.set(e,n),r.observe(e),()=>{Pg.delete(e),r.unobserve(e)}}const I3={some:0,all:1};class A3 extends zs{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:I3[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:f,onViewportLeave:h}=this.node.getProps(),p=u?f:h;p&&p(c)};this.stopObserver=N3(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(R3(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function R3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const L3={inView:{Feature:A3},tap:{Feature:j3},focus:{Feature:C3},hover:{Feature:S3}},M3={layout:{ProjectionNode:yP,MeasureLayout:NP}},$3={...i3,...L3,..._3,...M3},sk=e3($3,t3);function D3(){!Fx.current&&GE();const[e]=b.useState(Wd.current);return e}function Bf(e,t){const n=b.useRef(t);n.current=t,b.useEffect(()=>{if(!e)return;const r=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}const kp={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem"},re={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 bt(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 O3={4:"1rem"};function X(...e){return k$(WM(e))}const z3={height:32,lineHeight:"32px",padding:"0 16px"},F3={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")`},B3={white:re.bgBase,paper:re.bgSurface,speckle:re.bgSurface,parchment:re.bgElevated,canvas:re.canvasBase,kraft:re.canvas300,chalkboard:re.chalkboardBg},ik={white:re.bgElevated,paper:re.bgElevated,speckle:re.bgElevated,parchment:re.canvasBase,canvas:re.canvas300,kraft:re.canvasDark,chalkboard:re.chalkboardBg},V3={base:re.bgBase,surface:re.bgSurface,elevated:re.bgElevated,canvas:re.canvasBase,canvasDark:re.canvasDark,blue:re.washBlue,green:re.washGreen,amber:re.washAmber,rose:re.washRose,slate:re.washSlate},U3={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function Hx(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=F3[n],o=t.fill?V3[t.fill]:t.shade?ik[n]:B3[n],a=U3[s],l={"--pui-texture-shade":ik[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 Ho(e){return Hx(e)}function sa(e,t="paper"){if(e!==!1)return Ho(e===!0?t:e)}function W3(e){const t=Uf((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,f=o+(t()-.5)*a*2;l.push({x:s+Math.cos(u)*f,y:i+Math.sin(u)*f})}return Vf(l)}function K3(e,t){const n=Uf(`${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 f=u/s*Math.PI*2+(n()-.5)*.15*r,h=a+(n()-.5)*l*2;c.push({x:i+Math.cos(f)*h,y:o+Math.sin(f)*h})}return Vf(c)}function H3(e){const t=Uf((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,f=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,g=Math.sqrt(p*p+m*m)||1,x=-m/g,y=p/g,v=(t()-.5)*i*2;o.push({x:f+x*v,y:h+y*v})}return Vf(o)}function G3(e,t){const n=Uf(`${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 f=(u+.5)/s,h=c.ax+(c.bx-c.ax)*f,p=c.ay+(c.by-c.ay)*f,m=c.bx-c.ax,g=c.by-c.ay,x=Math.sqrt(m*m+g*g)||1,y=-g/x,v=m/x,w=(n()-.5)*o*2;a.push({x:h+y*w,y:p+v*w})}return Vf(a)}function Vf(e){const t=e.length;if(t<3)return"";let n=`M ${Yr(e[0].x)} ${Yr(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,f=o.y-(a.y-i.y)/6;n+=` C ${Yr(l)} ${Yr(c)}, ${Yr(u)} ${Yr(f)}, ${Yr(o.x)} ${Yr(o.y)}`}return n+=" Z",n}function Yr(e){return e.toFixed(2)}function Uf(e){let t=typeof e=="string"?Z3(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function Z3(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 Wf(){const e=b.useId();return b.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 ia(e){const t=Wf();return b.useMemo(()=>({blob:W3({seed:t,wobble:e}),ring:K3(t,e)}),[t,e])}const q3="button-module__button___Z331g",Y3="button-module__blobBg___QQFzf",J3="button-module__blobFill___XwLjV",Q3="button-module__blobRing___567UW",X3="button-module__isActive___FXNSJ",eB="button-module__primary___ppbyq",tB="button-module__secondary___esy5L",nB="button-module__ghost___NisA0",rB="button-module__danger___Wnvuq",sB="button-module__chalkboard___d3Nqb",iB="button-module__tiny___8ZZ7A",oB="button-module__small___u7y8a",aB="button-module__medium___HBIAj",lB="button-module__large___RPzNy",cB="button-module__fullWidth___H0P0F",uB="button-module__iconLeft___s60SZ",dB="button-module__iconRight___75eFu",fB="button-module__label___pXAyM",kn={button:q3,blobBg:Y3,blobFill:J3,blobRing:Q3,isActive:X3,primary:eB,secondary:tB,ghost:nB,danger:rB,chalkboard:sB,tiny:iB,small:oB,medium:aB,large:lB,fullWidth:cB,iconLeft:uB,iconRight:dB,label:fB},ee=b.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},f){const h=ia(o);return d.jsxs("button",{ref:f,type:"button",className:X(kn.button,kn[e],kn[n],t==="chalkboard"&&kn.chalkboard,a&&kn.isActive,i&&kn.fullWidth,c),...u,children:[d.jsxs("svg",{className:kn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:h.blob,className:kn.blobFill}),d.jsx("path",{d:h.ring,className:kn.blobRing})]}),r&&d.jsx("span",{className:kn.iconLeft,children:r}),d.jsx("span",{className:kn.label,children:l}),s&&d.jsx("span",{className:kn.iconRight,children:s})]})});function Gx(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const tt=z$.generator(),hB="sketch-border-module__svg___whV4x",pB="sketch-border-module__behind___lgdYV",mB="sketch-border-module__stroke___vAm-v",gB="sketch-border-module__fill___zlpd6",su={svg:hB,behind:pB,stroke:mB,fill:gB},yB=1.2,xB=.7;function qt({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:f}){const[h]=b.useState(Math.random),p=b.useRef(null),[m,g]=b.useState(null);b.useEffect(()=>{var v;const w=(v=p.current)==null?void 0:v.parentElement;if(!w)return;const k=new ResizeObserver(()=>{const _=w.offsetWidth,S=w.offsetHeight;g(j=>j&&j.width===_&&j.height===S?j:{width:_,height:S})});return k.observe(w),()=>k.disconnect()},[]);const{parts:x,clipPath:y}=b.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const v=Math.max(1,Math.round(h*1e6)),w=v,k=v*2654435761%2147483647,_=T=>tt.toPaths(tt.path(T,{seed:w,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(P=>!P.fill||P.fill==="none").map(P=>({d:P.d,filled:!1}));if(l){const T={seed:w,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},P=R=>tt.toPaths(R).filter(L=>!L.fill||L.fill==="none").map(L=>({d:L.d,filled:!1}));if(a){const R=iu(e,m,i,t,Zs(k),n*1.1),L=u?ok(s,n):0,I=L?iu(e,m,i+L,t,Zs(k),n*1.1):R;return{parts:P(tt.path(I,{...T,preserveVertices:!0})),clipPath:R}}const N=e==="circle"?tt.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,T):tt.path(_p(m,i,t,Zs(w)),{...T,preserveVertices:!0});return{parts:P(N),clipPath:null}}if(a){if(c){const R=_p(m,i,t,Zs(k)),L=tt.toPaths(tt.path(R,{seed:w,roughness:yB,bowing:xB,preserveVertices:!0,strokeWidth:s})).filter(I=>!I.fill||I.fill==="none").map(I=>({d:I.d,filled:!1}));return{parts:L.length?L:[{d:R,filled:!1}],clipPath:R}}const T=iu(e,m,i,t,Zs(k),n*1.1),P=u?ok(s,n):0,N=P?iu(e,m,i+P,t,Zs(k),n*1.1):T;return{parts:_(N),clipPath:T}}const S=(T,P)=>{const N=P?{fill:"#000",fillStyle:"solid"}:{},R=e==="circle"?tt.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:T,roughness:n,bowing:r,strokeWidth:s,...N}):tt.path(_p(m,i,t,Zs(T)),{seed:T,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...N});return tt.toPaths(R)},j=o?S(k,!0).filter(T=>!!T.fill&&T.fill!=="none").map(T=>({d:T.d,filled:!0})):[],E=S(w,!1).filter(T=>!T.fill||T.fill==="none").map(T=>({d:T.d,filled:!1}));return{parts:[...j,...E],clipPath:null}},[m,h,a,l,c,e,t,n,r,s,i,o,u]);return b.useEffect(()=>{var v;const w=(v=p.current)==null?void 0:v.parentElement;if(w)return y?w.style.setProperty("--sketch-clip",`path("${y}")`):w.style.removeProperty("--sketch-clip"),()=>{w.style.removeProperty("--sketch-clip")}},[y]),d.jsx("svg",{ref:p,className:X(su.svg,o&&su.behind,f),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:x==null?void 0:x.map((v,w)=>v.filled?d.jsx("path",{className:su.fill,d:v.d},`f-${w}`):d.jsx("path",{className:su.stroke,d:v.d,strokeWidth:s},`s-${w}`))})}function ok(e,t){return e/2+t*1.5}function Zs(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function iu(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,f=[];if(e==="circle")for(let h=0;h<16;h++){const p=h/16*Math.PI*2;f.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,g=(v,w,k)=>{for(const _ of[0,45,90]){const S=(k+_)*Math.PI/180;f.push({x:v+Math.cos(S)*h+u(),y:w+Math.sin(S)*h+u()})}},x=(v,w,k,_)=>{const S=Math.hypot(k-v,_-w),j=Math.min(12,Math.max(1,Math.round(S/160)));for(let E=1;E<=j;E++){const T=E/(j+1);f.push({x:v+(k-v)*T+u(),y:w+(_-w)*T+u()})}};g(p+h,m+h,180),x(p+h,m,p+o-h,m),g(p+o-h,m+h,270),x(p+o,m+h,p+o,m+a-h),g(p+o-h,m+a-h,0),x(p+o-h,m+a,p+h,m+a),g(p+h,m+a-h,90),x(p,m+a-h,p,m+h);const y=3;return ak([...f.slice(y),...f.slice(0,y)])}return ak(f)}function ak(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),f=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)/f-(l.x-o.x)/(u+f)),g=a.y-o.y+u*((l.y-a.y)/f-(l.y-o.y)/(u+f)),x=o.x+h/3,y=o.y+p/3,v=a.x-m/3,w=a.y-g/3;r+=` C ${x.toFixed(2)} ${y.toFixed(2)}, ${v.toFixed(2)} ${w.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function _p(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return vB(t,t,e.width-t*2,e.height-t*2,s)}function vB(e,t,n,r,s){const i=u=>Math.min(u,n/2,r/2),[o,a,l,c]=s.map(i);return[`M ${Ee(e+o)} ${Ee(t)}`,`L ${Ee(e+n-a)} ${Ee(t)}`,`Q ${Ee(e+n)} ${Ee(t)} ${Ee(e+n)} ${Ee(t+a)}`,`L ${Ee(e+n)} ${Ee(t+r-l)}`,`Q ${Ee(e+n)} ${Ee(t+r)} ${Ee(e+n-l)} ${Ee(t+r)}`,`L ${Ee(e+c)} ${Ee(t+r)}`,`Q ${Ee(e)} ${Ee(t+r)} ${Ee(e)} ${Ee(t+r-c)}`,`L ${Ee(e)} ${Ee(t+o)}`,`Q ${Ee(e)} ${Ee(t)} ${Ee(e+o)} ${Ee(t)}`,"Z"].join(" ")}function Ee(e){return e.toFixed(2)}const Yt={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}},wB="page-module__page___-uHnG",bB="page-module__outlined___Wwtyg",kB="page-module__surface___sWfI6",_B="page-module__flat___HlOaY",SB="page-module__withAccent___lsv-m",CB="page-module__accentBlue___XxbMV",jB="page-module__accentGreen___Ne6Q8",EB="page-module__accentAmber___kLAwa",PB="page-module__accentRose___O9ZbZ",TB="page-module__accentSlate___xCB66",Ji={page:wB,outlined:bB,surface:kB,flat:_B,withAccent:SB,accentBlue:CB,accentGreen:jB,accentAmber:EB,accentRose:PB,accentSlate:TB},NB=Gx(Ji),IB={all:14,top:14,none:2};function Zx({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=sa(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return d.jsxs("div",{className:X(Ji.page,a&&Ji.outlined,s&&Ji.withAccent,s&&NB[i],!l&&Ji.flat,t),style:n,children:[d.jsx(qt,{clip:!0,...Yt.surface,radius:IB[o],straight:!l}),d.jsx("div",{className:Ji.surface,style:c,children:e})]})}const AB="layout-module__layout___O1aWi",RB="layout-module__header___I-kxe",LB="layout-module__headerLeft___JChJQ",MB="layout-module__headerTitles___aqSUG",$B="layout-module__headerTitle___wvr39",DB="layout-module__headerSubtitle___6f5BD",OB="layout-module__headerActions___adC12",zB="layout-module__mobileToggle___4WpVG",FB="layout-module__body___tywNf",BB="layout-module__mobileOverlay___tzbBC",VB="layout-module__sidebar___8VKGq",UB="layout-module__sidebarOpen___47rtr",WB="layout-module__sidebarInner___tq2X6",KB="layout-module__logoArea___RLnC0",HB="layout-module__logoText___pAmfV",GB="layout-module__nav___FxcrZ",ZB="layout-module__main___9z7bu",qB="layout-module__navIslandFixed___H4TwP",YB="layout-module__content___jL-VB",JB="layout-module__contentWithPage___vVdfN",QB="layout-module__footer___LyakU",XB="layout-module__footerText___8BYxc",Be={layout:AB,header:RB,headerLeft:LB,headerTitles:MB,headerTitle:$B,headerSubtitle:DB,headerActions:OB,mobileToggle:zB,body:FB,mobileOverlay:BB,sidebar:VB,sidebarOpen:UB,sidebarInner:WB,logoArea:KB,logoText:HB,nav:GB,main:ZB,navIslandFixed:qB,content:YB,contentWithPage:JB,footer:QB,footerText:XB};function e4(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"}:Ho(e)}function IP({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:f=[],activeItemId:h,onNavigate:p,logo:m,footerContent:g,navigationIsland:x,style:y,bleedBottom:v=!0,routeKey:w,stackOpen:k}){const[_,S]=b.useState(!1),j=D3();Bf(_,()=>S(!1));const E=e4(i),T=r&&f.length>0,P=c!==void 0||u!==void 0?{...u!==void 0?Ho(u):{},...c!==void 0?{height:typeof c=="number"?`${c}px`:c}:{}}:void 0;return d.jsxs("div",{className:Be.layout,style:{...E,...y},children:[t&&d.jsxs("header",{className:Be.header,style:P,children:[d.jsxs("div",{className:Be.headerLeft,children:[T&&d.jsx("button",{type:"button",className:Be.mobileToggle,onClick:()=>S(!0),"aria-label":"Open navigation",children:d.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})})}),d.jsxs("div",{className:Be.headerTitles,children:[o&&d.jsx("h1",{className:Be.headerTitle,children:o}),a&&d.jsx("span",{className:Be.headerSubtitle,children:a})]})]}),l&&d.jsx("div",{className:Be.headerActions,children:l})]}),d.jsxs("div",{className:Be.body,children:[_&&d.jsx("button",{type:"button",className:Be.mobileOverlay,onClick:()=>S(!1),"aria-label":"Close navigation",tabIndex:-1}),T&&d.jsx("aside",{className:X(Be.sidebar,_&&Be.sidebarOpen),children:d.jsxs("div",{className:Be.sidebarInner,children:[d.jsx("div",{className:Be.logoArea,children:m||d.jsx("span",{className:Be.logoText,children:"Paper UI"})}),d.jsx("nav",{className:Be.nav,"aria-label":"Main navigation",children:f.map(N=>{const R=N.id===h;return d.jsx(ee,{variant:"ghost",size:"small",isActive:R,onClick:()=>{p==null||p(N),S(!1)},"aria-current":R?"page":void 0,icon:N.icon,style:z3,children:N.label},N.id)})})]})}),d.jsx("div",{className:Be.main,children:d.jsx("main",{className:s?Be.contentWithPage:Be.content,style:v?{paddingBottom:0}:void 0,children:(()=>{const N=w!==void 0?d.jsx(TF,{mode:"wait",children:d.jsx(sk.div,{initial:j?void 0:{opacity:0,y:8},animate:{opacity:1,y:0},exit:j?void 0:{opacity:0,y:-8},transition:{duration:.2,ease:"easeOut"},style:{height:"100%"},children:e},w)}):e;return s?d.jsx(Zx,{rounded:v?"top":"all",style:v&&x?{paddingBottom:`calc(${kp.navIslandBottom} + ${kp.navIslandHeight} + ${O3[4]})`}:void 0,children:N}):N})()})})]}),x&&d.jsx("div",{className:Be.navIslandFixed,children:k!==void 0?d.jsx(sk.div,{animate:{x:k?`-${kp.stackPanelWidth/2}px`:0},transition:{duration:j?0:.3,ease:[.4,0,.2,1]},children:x}):x}),n&&d.jsx("footer",{className:Be.footer,children:g||d.jsx("p",{className:Be.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const t4="checkbox-module__wrapper___uLYMI",n4="checkbox-module__blobFill___mPJSR",r4="checkbox-module__input___Ptgt7",s4="checkbox-module__blobBg___bw3sn",i4="checkbox-module__labelLeft___-vAmH",o4="checkbox-module__box___yAh-r",a4="checkbox-module__checkmark___tTyBz",l4="checkbox-module__indeterminateLine___IosI-",c4="checkbox-module__boxWrapper___byjoS",u4="checkbox-module__icon___RO-yn",d4="checkbox-module__labelText___bAnLr",f4="checkbox-module__chalkboard___sv6SL",nn={wrapper:t4,blobFill:n4,input:r4,blobBg:s4,labelLeft:i4,box:o4,checkmark:a4,indeterminateLine:l4,boxWrapper:c4,icon:u4,labelText:d4,chalkboard:f4},AP=b.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 f=b.useId(),h=l??f,p=ia(r),m=b.useRef(null);return b.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),d.jsxs("label",{className:X(nn.wrapper,t==="left"&&nn.labelLeft,s==="chalkboard"&&nn.chalkboard,i),htmlFor:h,children:[d.jsxs("span",{className:nn.boxWrapper,children:[d.jsx("input",{ref:g=>{m.current=g,typeof u=="function"?u(g):u&&(u.current=g)},id:h,type:"checkbox",className:nn.input,checked:o,onChange:a,...c}),d.jsx("svg",{className:nn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:p.blob,className:nn.blobFill})}),d.jsxs("span",{className:nn.box,"aria-hidden":"true",children:[d.jsx(qt,{smooth:!0,...Yt.control}),n?d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:nn.icon,children:d.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:nn.indeterminateLine})}):d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:nn.icon,children:d.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:nn.checkmark})})]})]}),e&&d.jsx("span",{className:nn.labelText,children:e})]})}),h4="icon-button-module__iconButton___avg6i",p4="icon-button-module__blobBg___466Vy",m4="icon-button-module__blobFill___FTN1g",g4="icon-button-module__blobRing___hRdQb",y4="icon-button-module__isActive___XlvtM",x4="icon-button-module__icon___h204x",v4="icon-button-module__ghost___Wbxog",w4="icon-button-module__danger___p0Xz5",b4="icon-button-module__tiny___4WYvA",k4="icon-button-module__small___bPnCU",_4="icon-button-module__medium___nOxPf",S4="icon-button-module__large___UBU5z",C4="icon-button-module__chalkboard___mi0sQ",Pr={iconButton:h4,blobBg:p4,blobFill:m4,blobRing:g4,isActive:y4,icon:x4,default:"icon-button-module__default___9frNR",ghost:v4,danger:w4,tiny:b4,small:k4,medium:_4,large:S4,chalkboard:C4},qe=b.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=ia(i);return d.jsxs("button",{ref:c,type:"button",className:X(Pr.iconButton,Pr[t],n==="chalkboard"&&Pr.chalkboard,Pr[r],o&&Pr.isActive,a),"aria-label":s,title:s,...l,children:[d.jsxs("svg",{className:Pr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:u.blob,className:Pr.blobFill}),d.jsx("path",{d:u.ring,className:Pr.blobRing})]}),d.jsx("span",{className:Pr.icon,children:e})]})}),j4="stamp-module__stamp___5qaNY",E4="stamp-module__small___BBlBg",P4="stamp-module__medium___HG2YD",T4="stamp-module__large___aUT0I",N4="stamp-module__blobBg___Mdrdd",I4="stamp-module__blobFill___QyCeB",A4="stamp-module__blobRing___EUDx7",R4="stamp-module__dot___qZyCR",L4="stamp-module__label___T89iH",M4="stamp-module__chalkboard___syI4T",Jr={stamp:j4,small:E4,medium:P4,large:T4,blobBg:N4,blobFill:I4,blobRing:A4,dot:R4,label:L4,chalkboard:M4},Sp={neutral:{fill:bt(re.accentSlate,.14),text:re.accentSlateDark,ring:bt(re.accentSlateDark,.35)},info:{fill:bt(re.accentBlue,.14),text:re.accentBlueDark,ring:bt(re.accentBlueDark,.35)},success:{fill:bt(re.accentGreen,.16),text:re.accentGreenDark,ring:bt(re.accentGreenDark,.35)},warning:{fill:bt(re.accentAmber,.16),text:re.accentAmberDark,ring:bt(re.accentAmberDark,.4)},error:{fill:bt(re.accentRose,.16),text:re.accentRoseDark,ring:bt(re.accentRoseDark,.35)}},lk={fill:bt(re.chalkboardBorderBase,.1),ring:bt(re.chalkboardBorderBase,.35)};function ne({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:s,textColor:i,wobble:o=.3,surface:a="paper",className:l}){const c=ia(o),u=a==="chalkboard",f=n?u?lk.ring:Sp[n].ring:void 0,h=s??(n?u?lk.fill:Sp[n].fill:"transparent"),p=i??(n&&!u?Sp[n].text:void 0);return d.jsxs("span",{className:X(Jr.stamp,Jr[t],u&&Jr.chalkboard,l),style:p?{color:p}:void 0,children:[d.jsxs("svg",{className:Jr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:Jr.blobFill,style:{fill:h}}),f&&d.jsx("path",{d:c.ring,className:Jr.blobRing,style:{stroke:f}})]}),r&&d.jsx("span",{className:Jr.dot,"aria-hidden":"true"}),d.jsx("span",{className:Jr.label,children:e})]})}const $4="copy-button-module__copyButton___-hTo4",D4="copy-button-module__dark___O45N-",O4="copy-button-module__chalkboard___hW4aw",z4="copy-button-module__copied___XlHFr",ou={copyButton:$4,dark:D4,chalkboard:O4,copied:z4};function qd({text:e,variant:t="light",surface:n="paper",className:r,...s}){const[i,o]=b.useState(!1),a=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch(l){console.error("Failed to copy:",l)}},[e]);return d.jsx("button",{type:"button",onClick:a,className:X(ou.copyButton,t==="dark"&&ou.dark,n==="chalkboard"&&ou.chalkboard,i&&ou.copied,r),...s,children:i?"Copied!":"Copy"})}const F4="code-block-module__codeBlock___dq28o",B4="code-block-module__header___42Fek",V4="code-block-module__relative___oO-zy",U4="code-block-module__copyOverlay___PjAuq",W4="code-block-module__pre___zXzLZ",K4="code-block-module__chalkboard___bdo9J",H4="code-block-module__chalkboardHeader___3RiVd",G4="code-block-module__chalkboardPre___iRBFR",Qr={codeBlock:F4,header:B4,relative:V4,copyOverlay:U4,pre:W4,chalkboard:K4,chalkboardHeader:H4,chalkboardPre:G4};function Lae({code:e,filename:t,surface:n="paper"}){return d.jsxs("div",{className:X(Qr.codeBlock,n==="chalkboard"&&Qr.chalkboard),children:[t&&d.jsxs("div",{className:X(Qr.header,n==="chalkboard"&&Qr.chalkboardHeader),children:[d.jsx("span",{children:t}),d.jsx(qd,{text:e,variant:"light",surface:n})]}),!t&&d.jsx("div",{className:Qr.relative,children:d.jsx("div",{className:Qr.copyOverlay,children:d.jsx(qd,{text:e,variant:"dark",surface:n})})}),d.jsx("pre",{className:X(Qr.pre,n==="chalkboard"&&Qr.chalkboardPre),children:d.jsx("code",{children:e})})]})}function Go({size:e=16}){return d.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:[d.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function RP({size:e=16}){return d.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:[d.jsx("path",{d:"M9 18h6"}),d.jsx("path",{d:"M10 22h4"}),d.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 LP({size:e=16}){return d.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:d.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Z4({size:e=16}){return d.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:d.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 MP({size:e=16}){return d.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:[d.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),d.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function $P({size:e=16}){return d.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:d.jsx("polyline",{points:"9 18 15 12 9 6"})})}const q4="table-module__tableFrame___KP-90",Y4="table-module__tableWrapper___gc3Y3",J4="table-module__toolbar___zhCel",Q4="table-module__toolbarTitle___D8oH-",X4="table-module__panelFooter___lCCKo",e5="table-module__compact___mG-2Y",t5="table-module__toolbarActions___EX6qS",n5="table-module__search___zIBk2",r5="table-module__searchIcon___ayhK8",s5="table-module__searchInput___PqsEG",i5="table-module__tableScroll___1gvc4",o5="table-module__table___tdU5g",a5="table-module__th___GQbKk",l5="table-module__td___WktB5",c5="table-module__footerCell___bM-jv",u5="table-module__tr___xeZno",d5="table-module__expandTh___uxkR4",f5="table-module__expandTd___VoBRC",h5="table-module__expandIcon___8V45X",p5="table-module__expandable___R7o2l",m5="table-module__footerRow___ik1DH",g5="table-module__expandedRow___1TbTQ",y5="table-module__expandedCell___sKAaD",x5="table-module__boardScroll___Y1yqm",v5="table-module__board___kFAI-",w5="table-module__boardColumn___-W9bP",b5="table-module__boardColumnHeader___kY3Fj",k5="table-module__accentBlue___PEJ1V",_5="table-module__accentGreen___wJ53r",S5="table-module__accentAmber___Iezjv",C5="table-module__accentRose___W8zxc",j5="table-module__accentSlate___oUZCX",E5="table-module__boardColumnLabel___JBEed",P5="table-module__boardColumnCount___Pkpiq",T5="table-module__boardColumnBody___uAgRF",N5="table-module__boardRow___C1P60",I5="table-module__boardEmpty___IKv2W",A5="table-module__chalkboardFrame___xB3N5",R5="table-module__chalkboardWrapper___KjY5r",L5="table-module__chalkboard___v0m3A",ce={tableFrame:q4,tableWrapper:Y4,toolbar:J4,toolbarTitle:Q4,panelFooter:X4,compact:e5,toolbarActions:t5,search:n5,searchIcon:r5,searchInput:s5,tableScroll:i5,table:o5,th:a5,td:l5,footerCell:c5,tr:u5,expandTh:d5,expandTd:f5,expandIcon:h5,expandable:p5,footerRow:m5,expandedRow:g5,expandedCell:y5,boardScroll:x5,board:v5,boardColumn:w5,boardColumnHeader:b5,accentBlue:k5,accentGreen:_5,accentAmber:S5,accentRose:C5,accentSlate:j5,boardColumnLabel:E5,boardColumnCount:P5,boardColumnBody:T5,boardRow:N5,boardEmpty:I5,chalkboardFrame:A5,chalkboardWrapper:R5,chalkboard:L5},M5=Gx(ce);function $5({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,rowFooter:f,hideHeader:h=!1,density:p="comfortable",panelFooter:m,className:g}){const x=sa(s,r==="chalkboard"?"chalkboard":"paper"),y=!!i,[v,w]=b.useState(new Set),k=j=>{w(E=>{const T=new Set(E);return T.has(j)?T.delete(j):T.add(j),T})},_=!!(o&&a),S=_?t.length+1:t.length;return d.jsxs("div",{className:X(ce.tableFrame,r==="chalkboard"&&ce.chalkboardFrame,g),children:[d.jsx(qt,{clip:!0,...Yt.surface}),d.jsxs("div",{className:X(ce.tableWrapper,r==="chalkboard"&&ce.chalkboardWrapper,p==="compact"&&ce.compact),style:x,children:[y&&d.jsxs("div",{className:ce.toolbar,children:[i.title&&d.jsx("div",{className:ce.toolbarTitle,children:i.title}),i.search&&d.jsxs("div",{className:ce.search,children:[d.jsx(D5,{className:ce.searchIcon}),d.jsx("input",{type:"text",className:ce.searchInput,placeholder:i.search.placeholder??"Search...","aria-label":i.search.placeholder??"Search",value:i.search.value,onChange:j=>{var E,T;return(T=(E=i.search)==null?void 0:E.onChange)==null?void 0:T.call(E,j.target.value)}}),d.jsx(qt,{fill:!0,...Yt.field})]}),i.actions&&d.jsx("div",{className:ce.toolbarActions,children:typeof i.actions=="function"?i.actions(r):i.actions})]}),n?d.jsx("div",{className:ce.boardScroll,children:d.jsx("div",{className:ce.board,children:n.map(j=>d.jsxs("div",{className:ce.boardColumn,children:[d.jsxs("div",{className:X(ce.boardColumnHeader,r==="chalkboard"&&ce.chalkboard,j.accent&&M5[j.accent]),children:[d.jsx("span",{className:ce.boardColumnLabel,children:j.label}),d.jsx("span",{className:ce.boardColumnCount,children:j.items.length})]}),d.jsx("div",{className:ce.boardColumnBody,children:j.items.length===0?d.jsx("div",{className:ce.boardEmpty,children:j.emptyLabel??"empty"}):j.items.map((E,T)=>d.jsx("div",{className:X(ce.boardRow,r==="chalkboard"&&ce.chalkboard),children:j.renderItem(E,T,r)},j.getKey?j.getKey(E,T):T))})]},j.key))})}):d.jsx("div",{className:ce.tableScroll,children:d.jsxs("table",{className:X(ce.table,r==="chalkboard"&&ce.chalkboard,p==="compact"&&ce.compact),children:[d.jsxs("colgroup",{children:[_&&d.jsx("col",{style:{width:"48px"}}),t.map(j=>d.jsx("col",{style:j.width?{width:`${j.width*32}px`}:void 0},j.key))]}),!h&&d.jsx("thead",{children:d.jsxs("tr",{children:[_&&d.jsx("th",{className:X(ce.th,ce.expandTh),"aria-label":"Expand"}),t.map(j=>d.jsx("th",{className:ce.th,style:j.align?{textAlign:j.align}:void 0,children:j.header},j.key))]})}),d.jsx("tbody",{children:e.map((j,E)=>{const T=l?l(j,E):E,P=o==null?void 0:o.render(j,E,r),N=f==null?void 0:f(j,E,r),R=!!P,L=R&&v.has(T),I=u==null?void 0:u(j,E);return d.jsxs(b.Fragment,{children:[d.jsxs("tr",{className:X(ce.tr,R&&ce.expandable,c==null?void 0:c(j,E)),style:I?Ho(I):void 0,onClick:()=>R&&k(T),children:[_&&d.jsx("td",{className:X(ce.td,ce.expandTd),children:R&&d.jsx("button",{type:"button",className:ce.expandIcon,"aria-expanded":L,"aria-label":L?"Collapse row":"Expand row",onClick:z=>{z.stopPropagation(),k(T)},children:d.jsx($P,{size:14})})}),t.map(z=>d.jsx("td",{className:ce.td,style:z.align?{textAlign:z.align}:void 0,children:z.cell(j,E,r)},z.key))]}),N&&d.jsx("tr",{className:ce.footerRow,style:I?Ho(I):void 0,children:d.jsx("td",{colSpan:S,className:ce.footerCell,children:N})}),L&&d.jsx("tr",{className:ce.expandedRow,children:d.jsx("td",{colSpan:S,className:ce.expandedCell,children:P})})]},T)})})]})}),m&&d.jsx("div",{className:ce.panelFooter,children:m})]})]})}function D5({className:e}){return d.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:[d.jsx("circle",{cx:"11",cy:"11",r:"8"}),d.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}const O5="card-module__borderLayer___WSpJq",z5="card-module__elevated___uhWj9",F5="card-module__textureLayer___Kcofz",B5="card-module__flat___KnG5z",V5="card-module__small___HXUTr",U5="card-module__withAccent___2t7bV",W5="card-module__accentBlue___a1KIq",K5="card-module__accentGreen___RNWoA",H5="card-module__accentAmber___uMhom",G5="card-module__accentRose___VPI3t",Z5="card-module__accentSlate___-l4jE",q5="card-module__chalkboard___bQ48O",ss={borderLayer:O5,default:"card-module__default___glPy-",elevated:z5,textureLayer:F5,flat:B5,small:V5,withAccent:U5,accentBlue:W5,accentGreen:K5,accentAmber:H5,accentRose:G5,accentSlate:Z5,chalkboard:q5},Y5=Gx(ss);function me({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 f=n==="chalkboard"||s===!1?void 0:Hx({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return d.jsxs("div",{className:X(ss.borderLayer,ss[t],n==="chalkboard"&&ss.chalkboard,ss[r],a&&ss.withAccent,a&&Y5[l],!c&&ss.flat,u),children:[d.jsx(qt,{clip:!0,...Yt.surface,straight:!c}),d.jsx("div",{className:ss.textureLayer,style:f,children:e})]})}const J5="input-module__wrapper___xaEw6",Q5="input-module__label___lu7R1",X5="input-module__field___khFpX",eV="input-module__input___h7K-F",tV="input-module__small___SkByh",nV="input-module__medium___0QPuV",rV="input-module__large___zGwRu",sV="input-module__error___QDqga",iV="input-module__disabled___K-5hi",oV="input-module__helperText___njeLH",aV="input-module__helperError___qDBpD",lV="input-module__chalkboard___Xh-5s",ar={wrapper:J5,label:Q5,field:X5,input:eV,small:tV,medium:nV,large:rV,error:sV,disabled:iV,helperText:oV,helperError:aV,chalkboard:lV},rt=b.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=b.useId(),u=o??c;return d.jsxs("div",{className:X(ar.wrapper,s==="chalkboard"&&ar.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:ar.label,children:e}),d.jsxs("span",{className:X(ar.field,ar[r],n&&ar.error,a.disabled&&ar.disabled),children:[d.jsx("input",{ref:l,id:u,className:ar.input,...a}),d.jsx(qt,{fill:!0,...Yt.field})]}),t&&d.jsx("span",{className:X(ar.helperText,n&&ar.helperError),children:t})]})}),cV="select-module__wrapper___Hc5F3",uV="select-module__label___ay-3s",dV="select-module__nativeSelect___UA2d-",fV="select-module__trigger___xMYHi",hV="select-module__open___w3mbZ",pV="select-module__triggerLabel___ihpER",mV="select-module__placeholder___0VOFP",gV="select-module__small___iU9W9",yV="select-module__chevron___0dCTg",xV="select-module__medium___B-XBN",vV="select-module__large___iII2c",wV="select-module__chevronOpen___cFOYe",bV="select-module__error___P5RBk",kV="select-module__dropdown___Q-uK3",_V="select-module__slideDown___sT374",SV="select-module__options___HmrQ0",CV="select-module__option___vNnue",jV="select-module__optionDisabled___ex2zq",EV="select-module__optionSelected___tAFjn",PV="select-module__optionHighlighted___zYQLq",TV="select-module__helperText___r5gyn",NV="select-module__helperError___ydSPT",IV="select-module__chalkboard___sXBw8",We={wrapper:cV,label:uV,nativeSelect:dV,trigger:fV,open:hV,triggerLabel:pV,placeholder:mV,small:gV,chevron:yV,medium:xV,large:vV,chevronOpen:wV,error:bV,dropdown:kV,slideDown:_V,options:SV,option:CV,optionDisabled:jV,optionSelected:EV,optionHighlighted:PV,helperText:TV,helperError:NV,chalkboard:IV};function AV({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:f=!1,width:h,texture:p=!1,className:m}){const g=b.useId(),[x,y]=b.useState(!1),[v,w]=b.useState(-1),[k,_]=b.useState(l??""),[S,j]=b.useState(null),E=b.useRef(null),T=b.useRef(null),P=a!==void 0,N=P?a:k,R=i.find(C=>C.value===N),L=(R==null?void 0:R.label)??o??"Select...",I=b.useCallback(()=>{if(f)return;y(!0);const C=i.findIndex(U=>U.value===N);w(C>=0?C:0)},[f,i,N]),z=b.useCallback(()=>{y(!1),w(-1)},[]),$=b.useCallback(C=>{var U;C.disabled||(P||_(C.value),c==null||c(C.value),z(),(U=E.current)==null||U.focus())},[P,c,z]),D=b.useCallback(C=>{if(!f)switch(C.key){case"Enter":case" ":C.preventDefault(),x&&v>=0?$(i[v]):I();break;case"Escape":C.preventDefault(),x&&z();break;case"ArrowDown":C.preventDefault(),x?w(U=>{let Q=U+1;for(;Q<i.length&&i[Q].disabled;)Q++;return Q<i.length?Q:U}):I();break;case"ArrowUp":C.preventDefault(),x?w(U=>{let Q=U-1;for(;Q>=0&&i[Q].disabled;)Q--;return Q>=0?Q:U}):I();break;case"Home":if(C.preventDefault(),x){let U=0;for(;U<i.length&&i[U].disabled;)U++;U<i.length&&w(U)}break;case"End":if(C.preventDefault(),x){let U=i.length-1;for(;U>=0&&i[U].disabled;)U--;U>=0&&w(U)}break;case"Tab":x&&z();break}},[f,x,v,i,I,z,$]);b.useEffect(()=>{if(!x)return;const C=U=>{var Q,A;const ge=U.target;(Q=E.current)!=null&&Q.contains(ge)||(A=T.current)!=null&&A.contains(ge)||z()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[x,z]),b.useEffect(()=>{if(!x||v<0||!T.current)return;const C=T.current.querySelector(`[data-option-index="${v}"]`);C==null||C.scrollIntoView({block:"nearest"})},[x,v]),b.useEffect(()=>{if(!x){j(null);return}const C=()=>{if(!E.current)return;const U=E.current.getBoundingClientRect();if(U.bottom<0||U.top>window.innerHeight){z();return}j(U)};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)}},[x,z]);const O=sa(p),V=O?{"--sketch-fill":O.backgroundColor}:void 0;return d.jsxs("div",{className:X(We.wrapper,s==="chalkboard"&&We.chalkboard,m),style:h?{width:typeof h=="number"?`${h}px`:h}:void 0,children:[e&&d.jsx("label",{htmlFor:g,className:We.label,children:e}),d.jsxs("select",{id:g,name:u,className:We.nativeSelect,value:N,onChange:C=>c==null?void 0:c(C.target.value),disabled:f,"aria-hidden":"true",tabIndex:-1,children:[o&&d.jsx("option",{value:"",children:o}),i.map(C=>d.jsx("option",{value:C.value,disabled:C.disabled,children:C.label},C.value))]}),d.jsxs("button",{ref:E,type:"button",role:"combobox","aria-expanded":x,"aria-haspopup":"listbox","aria-controls":x?`${g}-listbox`:void 0,"aria-activedescendant":x&&v>=0?`${g}-option-${v}`:void 0,className:X(We.trigger,We[r],n&&We.error,x&&We.open,f&&We.disabled),onClick:()=>x?z():I(),onKeyDown:D,disabled:f,children:[d.jsx("span",{className:X(We.triggerLabel,!R&&We.placeholder),children:L}),d.jsx(RV,{className:X(We.chevron,x&&We.chevronOpen)}),d.jsx(qt,{fill:!0,...Yt.field})]}),x&&S&&Ni.createPortal(d.jsxs("div",{ref:T,id:`${g}-listbox`,role:"listbox",tabIndex:-1,className:We.dropdown,style:{...V,position:"fixed",top:S.bottom+6,left:S.left,width:S.width},onKeyDown:C=>{var U;C.key==="Escape"&&(C.preventDefault(),z(),(U=E.current)==null||U.focus())},children:[d.jsx(qt,{fill:!0,...Yt.surface}),d.jsx("div",{className:We.options,children:i.map((C,U)=>d.jsx("div",{id:`${g}-option-${U}`,role:"option","aria-selected":C.value===N,tabIndex:-1,"data-option-index":U,className:X(We.option,C.value===N&&We.optionSelected,U===v&&We.optionHighlighted,C.disabled&&We.optionDisabled),onClick:Q=>{Q.stopPropagation(),$(C)},onMouseEnter:()=>w(U),children:C.label},C.value))})]}),document.body),t&&d.jsx("span",{className:X(We.helperText,n&&We.helperError),children:t})]})}function RV({className:e}){return d.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:d.jsx("polyline",{points:"6 9 12 15 18 9"})})}function DP({variant:e}){switch(e){case"info":return d.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:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),d.jsx("circle",{cx:"12",cy:"8",r:"0.5",fill:"currentColor"})]});case"success":return d.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:[d.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),d.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]});case"warning":return d.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:[d.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"}),d.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),d.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});case"error":return d.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:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),d.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}}const LV="alert-module__alert___j7ZRS",MV="alert-module__surface___IaVgU",$V="alert-module__iconWrapper___kLoxT",DV="alert-module__message___klR2U",OV="alert-module__dismiss___f2uoG",zV="alert-module__info___PBo1l",FV="alert-module__success___AVBKS",BV="alert-module__warning___zkMaJ",VV="alert-module__error___cxg96",UV="alert-module__chalkboard___7pgWk",qs={alert:LV,surface:MV,iconWrapper:$V,message:DV,dismiss:OV,info:zV,success:FV,warning:BV,error:VV,chalkboard:UV};function OP({children:e,variant:t="info",surface:n="paper",texture:r="kraft",dismissible:s=!1,onDismiss:i,className:o}){const a=n==="chalkboard";return d.jsxs("div",{className:X(qs.alert,qs[t],a&&qs.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[d.jsx(qt,{clip:!0,...Yt.surface}),d.jsx("div",{className:qs.surface,style:a?void 0:sa(r)}),d.jsx("span",{className:qs.iconWrapper,children:d.jsx(DP,{variant:t})}),d.jsx("div",{className:qs.message,children:e}),s&&d.jsx("button",{type:"button",className:qs.dismiss,onClick:i,"aria-label":"Dismiss alert",children:d.jsx(Go,{size:16})})]})}const WV="modal-module__overlay___a52Ni",KV="modal-module__fadeIn___5OWd5",HV="modal-module__backdrop___RS4yj",GV="modal-module__modal___ZioOV",ZV="modal-module__slideUp___vfFrm",qV="modal-module__small___hcxwF",YV="modal-module__medium___mjbM5",JV="modal-module__large___1dzyf",QV="modal-module__header___iP09B",XV="modal-module__title___nj06m",e6="modal-module__close___gQou9",t6="modal-module__body___Y-EdA",n6="modal-module__chalkboard___qY8qo",Tr={overlay:WV,fadeIn:KV,backdrop:HV,modal:GV,slideUp:ZV,small:qV,medium:YV,large:JV,header:QV,title:XV,close:e6,body:t6,chalkboard:n6},r6='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Fs({open:e,onClose:t,title:n,children:r,size:s="medium",surface:i="paper",texture:o=!1,className:a}){const l=b.useId(),c=b.useRef(null),u=b.useRef(null);if(Bf(e,t),b.useEffect(()=>{var h;if(!e)return;u.current=document.activeElement,(h=c.current)==null||h.focus();const p=g=>{var x;if(g.key!=="Tab")return;const y=(x=c.current)==null?void 0:x.querySelectorAll(r6);if(!y||y.length===0){g.preventDefault();return}const v=y[0],w=y[y.length-1];g.shiftKey&&document.activeElement===v?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),v.focus())};document.addEventListener("keydown",p);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var g,x;document.removeEventListener("keydown",p),document.body.style.overflow=m,(x=(g=u.current)==null?void 0:g.focus)==null||x.call(g)}},[e]),!e||typeof document>"u")return null;const f=sa(o);return Ni.createPortal(d.jsxs("div",{className:Tr.overlay,children:[d.jsx("button",{type:"button",className:Tr.backdrop,"aria-label":"Close modal",onClick:t}),d.jsxs("div",{ref:c,className:X(Tr.modal,Tr[s],i==="chalkboard"&&Tr.chalkboard,a),style:f,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[d.jsxs("div",{className:Tr.header,children:[n&&d.jsx("h2",{id:l,className:Tr.title,children:n}),d.jsx("button",{type:"button",className:Tr.close,onClick:t,"aria-label":"Close modal",children:d.jsx(Go,{size:18})})]}),d.jsx("div",{className:Tr.body,children:r})]})]}),document.body)}const s6="textarea-module__wrapper___NbiNO",i6="textarea-module__label___ejhyZ",o6="textarea-module__field___KluQf",a6="textarea-module__textarea___0y-7v",l6="textarea-module__resizeGrip___lONlE",c6="textarea-module__small___yPyr8",u6="textarea-module__medium___ezQxA",d6="textarea-module__large___xfeKi",f6="textarea-module__error___EkXKJ",h6="textarea-module__disabled___9CKbb",p6="textarea-module__helperText___l1sPh",m6="textarea-module__helperError___VfTLy",g6="textarea-module__chalkboard___zZ0X0",Un={wrapper:s6,label:i6,field:o6,textarea:a6,resizeGrip:l6,small:c6,medium:u6,large:d6,error:f6,disabled:h6,helperText:p6,helperError:m6,chalkboard:g6},y6=48,qx=b.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=b.useId(),u=o??c,f=b.useRef(null),h=b.useCallback(m=>{f.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),p=b.useCallback(m=>{const g=f.current;if(!g)return;m.preventDefault();const x=m.clientY,y=g.offsetHeight,v=k=>{g.style.height=`${Math.max(y6,y+k.clientY-x)}px`},w=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",w)};window.addEventListener("pointermove",v),window.addEventListener("pointerup",w)},[]);return d.jsxs("div",{className:X(Un.wrapper,s==="chalkboard"&&Un.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:Un.label,children:e}),d.jsxs("span",{className:X(Un.field,Un[r],n&&Un.error,a.disabled&&Un.disabled),children:[d.jsx("textarea",{ref:h,id:u,className:Un.textarea,...a}),d.jsx(qt,{fill:!0,...Yt.field}),!a.disabled&&d.jsx("span",{className:Un.resizeGrip,onPointerDown:p,"aria-hidden":"true",title:"Drag to resize",children:d.jsxs("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[d.jsx("path",{d:"M11 4.5 L4.5 11"}),d.jsx("path",{d:"M11 8.5 L8.5 11"})]})})]}),t&&d.jsx("span",{className:X(Un.helperText,n&&Un.helperError),children:t})]})}),x6="progress-module__track___a5BMO",v6="progress-module__svg___3U0-E",ck={track:x6,svg:v6},Cp=300,Xr=1;function zP({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(Wf()*1e6)),c=a?bt(re.chalkboardBorderBase,.16):bt(re.textPrimary,.12),u=n??(a?re.chalkboardChalk:re.textSecondary),f=b.useMemo(()=>tt.toPaths(tt.rectangle(Xr,Xr,Cp-Xr*2,r-Xr*2,{seed:l,roughness:2.2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1.5})),[l,c,r]),h=Math.max(o/100*(Cp-Xr*2),0),p=b.useMemo(()=>h>0?tt.toPaths(tt.rectangle(Xr,Xr,h,r-Xr*2,{seed:l+1,roughness:2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1})):[],[l,u,h,r]);return d.jsx("div",{className:X(ck.track,i),style:{height:r,borderRadius:r/2},children:d.jsxs("svg",{className:ck.svg,viewBox:`0 0 ${Cp} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[f.map((m,g)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},g)),p.map((m,g)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},g))]})})}function w6(e){const t=Wf();return b.useMemo(()=>({blob:H3({seed:t,wobble:e}),ring:G3(t,e)}),[t,e])}const b6="list-item-module__listItem___-tw9O",k6="list-item-module__clickable___GLJmd",_6="list-item-module__blobBg___O3Mzh",S6="list-item-module__blobFill___dXHk1",C6="list-item-module__blobRing___S9mas",j6="list-item-module__active___UsL8O",E6="list-item-module__small___9dphK",P6="list-item-module__medium___yGZCr",T6="list-item-module__icon___2b4wU",N6="list-item-module__label___SIzJ4",I6="list-item-module__action___qGh0-",A6="list-item-module__chalkboard___qpWuM",_n={listItem:b6,static:"list-item-module__static___qtEX6",clickable:k6,blobBg:_6,blobFill:S6,blobRing:C6,active:j6,small:E6,medium:P6,icon:T6,label:N6,action:I6,chalkboard:A6};function It({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const c=w6(s),u=!!l.onClick;return d.jsxs("button",{type:"button",className:X(_n.listItem,_n[r],u&&_n.clickable,!u&&!e&&_n.static,e&&_n.active,i==="chalkboard"&&_n.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[d.jsxs("svg",{className:_n.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:_n.blobFill}),d.jsx("path",{d:c.ring,className:_n.blobRing})]}),t&&d.jsx("span",{className:_n.icon,children:t}),d.jsx("span",{className:_n.label,children:o}),n&&d.jsx("span",{className:_n.action,children:n})]})}const R6="accordion-module__accordion___mqGl-",L6="accordion-module__header___mLfbd",M6="accordion-module__icon___Z90NR",$6="accordion-module__title___HusgG",D6="accordion-module__content___1K0td",O6="accordion-module__chalkboard___am8r4",z6="accordion-module__expanded___836xG",Ys={accordion:R6,header:L6,icon:M6,title:$6,content:D6,chalkboard:O6,expanded:z6};function Mae({title:e,children:t,expanded:n=!1,onToggle:r,surface:s="paper",className:i}){return d.jsxs("div",{className:X(Ys.accordion,n&&Ys.expanded,s==="chalkboard"&&Ys.chalkboard,i),children:[d.jsxs("button",{type:"button",className:Ys.header,onClick:r,"aria-expanded":n,children:[d.jsx("span",{className:Ys.icon,"aria-hidden":"true",children:d.jsx($P,{size:14})}),d.jsx("span",{className:Ys.title,children:e})]}),n&&d.jsx("div",{className:Ys.content,children:t})]})}const F6="icon-module__icon___2vrJz",B6="icon-module__blobBg___ENPYJ",V6="icon-module__blobFill___IPbwQ",U6="icon-module__blobRing___1awqV",W6="icon-module__content___TaZR6",K6="icon-module__small___Xp--F",H6="icon-module__medium___tCjMB",G6="icon-module__large___vBtP7",Ui={icon:F6,blobBg:B6,blobFill:V6,blobRing:U6,content:W6,small:K6,medium:H6,large:G6},Z6={small:20,medium:24,large:28};function q6({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=ia(n),o=Z6[t];return d.jsxs("span",{className:X(Ui.icon,Ui[t],s),children:[d.jsxs("svg",{className:Ui.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:i.blob,className:Ui.blobFill,style:r?{fill:r}:void 0}),d.jsx("path",{d:i.ring,className:Ui.blobRing})]}),d.jsx("span",{className:Ui.content,style:{width:o,height:o},children:e})]})}const Y6="radio-module__wrapper___BB05E",J6="radio-module__blobFill___p5BX4",Q6="radio-module__labelLeft___ijB93",X6="radio-module__input___M2nFJ",eU="radio-module__box___H7ofS",tU="radio-module__dot___jVJ-d",nU="radio-module__boxWrapper___Y3qis",rU="radio-module__blobBg___IR-M5",sU="radio-module__labelText___I-nu3",iU="radio-module__chalkboard___IIBqI",lr={wrapper:Y6,blobFill:J6,labelLeft:Q6,input:X6,box:eU,dot:tU,boxWrapper:nU,blobBg:rU,labelText:sU,chalkboard:iU};b.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=b.useId(),f=a??u,h=ia(n);return d.jsxs("label",{className:X(lr.wrapper,t==="left"&&lr.labelLeft,r==="chalkboard"&&lr.chalkboard,s),htmlFor:f,children:[d.jsxs("span",{className:lr.boxWrapper,children:[d.jsx("input",{ref:c,id:f,type:"radio",className:lr.input,checked:i,onChange:o,...l}),d.jsx("svg",{className:lr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:h.blob,className:lr.blobFill})}),d.jsxs("span",{className:lr.box,"aria-hidden":"true",children:[d.jsx(qt,{smooth:!0,shape:"circle",...Yt.control}),d.jsx("span",{className:lr.dot})]})]}),e&&d.jsx("span",{className:lr.labelText,children:e})]})});const oU="switch-module__wrapper___5-2P1",aU="switch-module__labelLeft___WlT-N",lU="switch-module__input___YKZRj",cU="switch-module__track___QNvnO",uU="switch-module__thumb___cunvF",dU="switch-module__small___WPIxc",fU="switch-module__medium___yPulW",hU="switch-module__large___VlKV1",pU="switch-module__labelText___9Qg39",mU="switch-module__chalkboard___qKTMz",es={wrapper:oU,labelLeft:aU,input:lU,track:cU,thumb:uU,small:dU,medium:fU,large:hU,labelText:pU,chalkboard:mU},Yd=b.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=b.useId(),f=a??u;return d.jsxs("label",{className:X(es.wrapper,es[n],t==="left"&&es.labelLeft,r==="chalkboard"&&es.chalkboard,s),htmlFor:f,children:[d.jsx("input",{ref:c,id:f,type:"checkbox",className:es.input,checked:i,onChange:o,...l}),d.jsxs("span",{className:es.track,"aria-hidden":"true",children:[d.jsx(qt,{...Yt.pill}),d.jsx("span",{className:es.thumb})]}),e&&d.jsx("span",{className:es.labelText,children:e})]})}),gU="spinner-module__spinner___FDTk2",yU="spinner-module__chalkboard___DLE1z",xU="spinner-module__svg___JnCWN",vU="spinner-module__track___xbnbo",wU="spinner-module__head___j5dWe",$a={spinner:gU,chalkboard:yU,svg:xU,track:vU,head:wU},bU={small:18,medium:28,large:40},uk=25,kU=18,dk=tt.toPaths(tt.circle(uk,uk,kU*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function tr({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:s}){const i=bU[e];return d.jsx("span",{className:X($a.spinner,r==="chalkboard"&&$a.chalkboard,s),role:"status","aria-label":n,children:d.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:$a.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[d.jsx("path",{className:$a.track,d:dk,fill:"none",pathLength:100,strokeLinecap:"round"}),d.jsx("path",{className:$a.head,d:dk,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const _U="skeleton-module__skeleton___HCSvg",SU="skeleton-module__pulse___6eCq1",CU="skeleton-module__svg___OzxGp",jU="skeleton-module__text___v17Nv",EU="skeleton-module__rect___wqIJy",PU="skeleton-module__circle___RCmyR",jp={skeleton:_U,pulse:SU,svg:CU,text:jU,rect:EU,circle:PU},fk={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},Wi=2;function sn({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(Wf()*1e6)),l=o?bt(re.chalkboardBorderBase,.16):bt(re.textPrimary,.09),c=b.useMemo(()=>{const[,,u,f]=fk[e],h=e==="circle"?tt.ellipse(u/2,f/2,u-Wi*2,f-Wi*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):tt.rectangle(Wi,Wi,u-Wi*2,f-Wi*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return tt.toPaths(h)},[e,a,l]);return d.jsx("span",{className:X(jp.skeleton,jp[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:d.jsx("svg",{className:jp.svg,viewBox:fk[e].join(" "),preserveAspectRatio:"none","aria-hidden":"true",children:c.map((u,f)=>d.jsx("path",{d:u.d,stroke:u.stroke,strokeWidth:u.strokeWidth,fill:u.fill},f))})})}const TU="divider-module__horizontal___tP3rG",NU="divider-module__line___KnBes",IU="divider-module__label___WiUwZ",AU="divider-module__vertical___wBSrT",RU="divider-module__chalkboard___gXTde",Ki={horizontal:TU,line:NU,label:IU,vertical:AU,chalkboard:RU};function Bl({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Ki.chalkboard;return e==="vertical"?d.jsx("span",{className:X(Ki.vertical,s,r),role:"separator","aria-orientation":"vertical"}):d.jsxs("div",{className:X(Ki.horizontal,s,r),role:"separator",children:[d.jsx("span",{className:Ki.line}),t!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Ki.label,children:t}),d.jsx("span",{className:Ki.line})]})]})}const LU="tooltip-module__wrapper___XeVNe",MU="tooltip-module__tooltip___e-rkz",$U="tooltip-module__tooltipIn___CZbRw",DU="tooltip-module__top___78WWU",OU="tooltip-module__bottom___Irl3O",zU="tooltip-module__left___C1Ec4",FU="tooltip-module__right___oUA-Z",BU="tooltip-module__chalkboard___Um6dx",au={wrapper:LU,tooltip:MU,tooltipIn:$U,top:DU,bottom:OU,left:zU,right:FU,chalkboard:BU},lu=8,cu=8,VU=typeof window>"u"?b.useEffect:b.useLayoutEffect;function UU(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+lu,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-lu-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+lu;break;default:r=e.top-lu-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,cu),window.innerWidth-n.width-cu),r=Math.min(Math.max(r,cu),window.innerHeight-n.height-cu),{top:r,left:s}}function ye({content:e,children:t,placement:n="top",delay:r=300,disabled:s=!1,surface:i="paper"}){const o=b.useId(),[a,l]=b.useState(!1),[c,u]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(null),[g,x]=b.useState(null),y=b.useRef(null),v=b.useRef(null),w=b.useRef(),k=!s&&!!e&&!f&&(a||c),_=()=>{clearTimeout(w.current),w.current=setTimeout(()=>l(!0),r)},S=()=>{clearTimeout(w.current),l(!1),h(!1)},j=()=>{h(!1),u(!0)},E=()=>{u(!1),h(!1)};Bf(k,()=>h(!0)),b.useEffect(()=>{if(!k){m(null);return}const P=()=>{y.current&&m(y.current.getBoundingClientRect())};return P(),window.addEventListener("scroll",P,{capture:!0,passive:!0}),window.addEventListener("resize",P,{passive:!0}),()=>{window.removeEventListener("scroll",P,{capture:!0}),window.removeEventListener("resize",P)}},[k]),VU(()=>{if(!k){x(null);return}const P=v.current;P&&x({width:P.offsetWidth,height:P.offsetHeight})},[k,e,n]),b.useEffect(()=>()=>clearTimeout(w.current),[]);const T=t.props;return d.jsxs("span",{ref:y,className:au.wrapper,onMouseEnter:_,onMouseLeave:S,onFocus:j,onBlur:E,children:[b.cloneElement(t,{"aria-describedby":k?o:T["aria-describedby"]}),k&&p&&typeof document<"u"&&Ni.createPortal(d.jsx("span",{ref:v,id:o,role:"tooltip",className:X(au.tooltip,au[n],i==="chalkboard"&&au.chalkboard),style:g?{position:"fixed",...UU(p,n,g)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const WU="toast-module__stack___hDi0s",KU="toast-module__topLeft___Luw-F",HU="toast-module__topCenter___N1DwF",GU="toast-module__topRight___Dtgau",ZU="toast-module__bottomLeft___Eb2lo",qU="toast-module__bottomCenter___gs-Yb",YU="toast-module__bottomRight___-0e2j",JU="toast-module__item___RFjtm",QU="toast-module__toastIn___9m9iN",XU="toast-module__card___ZCvJS",e8="toast-module__surface___mfMl0",t8="toast-module__iconWrapper___lnjcC",n8="toast-module__content___AlliM",r8="toast-module__title___1Oqh8",s8="toast-module__description___eiUSB",i8="toast-module__dismiss___tUGx4",o8="toast-module__info___Nh8S9",a8="toast-module__success___hlKLc",l8="toast-module__warning___XUMJt",c8="toast-module__error___pSFFC",u8="toast-module__chalkboard___c49gt",Sn={stack:WU,topLeft:KU,topCenter:HU,topRight:GU,bottomLeft:ZU,bottomCenter:qU,bottomRight:YU,item:JU,toastIn:QU,card:XU,surface:e8,iconWrapper:t8,content:n8,title:r8,description:s8,dismiss:i8,info:o8,success:a8,warning:l8,error:c8,chalkboard:u8};function d8({record:e,surface:t="paper",onDismiss:n}){const r=b.useRef(e.duration),s=b.useRef(0),i=b.useRef(),o=b.useCallback(f=>{clearTimeout(i.current),!(f<=0)&&(s.current=Date.now(),i.current=setTimeout(()=>n(e.id),f))},[n,e.id]);b.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 d.jsx("div",{className:Sn.item,onMouseEnter:a,onMouseLeave:l,children:d.jsxs("div",{className:X(Sn.card,Sn[e.variant],c&&Sn.chalkboard),role:u,children:[d.jsx(qt,{clip:!0,...Yt.surface}),d.jsx("div",{className:Sn.surface,style:c?void 0:sa("kraft")}),d.jsx("span",{className:Sn.iconWrapper,children:d.jsx(DP,{variant:e.variant})}),d.jsxs("div",{className:Sn.content,children:[e.title&&d.jsx("div",{className:Sn.title,children:e.title}),d.jsx("div",{className:Sn.description,children:e.description})]}),d.jsx("button",{type:"button",className:Sn.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:d.jsx(Go,{size:16})})]})})}const FP=b.createContext(null);function f8(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function hk({children:e,position:t="bottom-right",surface:n="paper",defaultDuration:r=5e3}){const[s,i]=b.useState([]),o=b.useRef(0),a=b.useCallback(u=>{i(f=>f.filter(h=>h.id!==u))},[]),l=b.useCallback(u=>{o.current+=1;const f=`toast-${o.current}`;return i(h=>[...h,{id:f,title:u.title,description:u.description,variant:u.variant??"info",duration:u.duration??r}]),f},[r]),c=t.startsWith("top")?[...s].reverse():s;return d.jsxs(FP.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&Ni.createPortal(d.jsx("div",{className:X(Sn.stack,Sn[f8(t)]),role:"region","aria-label":"Notifications",children:c.map(u=>d.jsx(d8,{record:u,surface:n,onDismiss:a},u.id))}),document.body)]})}function Je(){const e=b.useContext(FP);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const h8="breadcrumb-module__breadcrumb___r-ILp",p8="breadcrumb-module__list___V3YFy",m8="breadcrumb-module__item___dDwYf",g8="breadcrumb-module__link___CHC9k",y8="breadcrumb-module__linkButton___XoMW-",x8="breadcrumb-module__current___dprI9",v8="breadcrumb-module__separator___uLhtn",w8="breadcrumb-module__chalkboard___COJpw",cr={breadcrumb:h8,list:p8,item:m8,link:g8,linkButton:y8,current:x8,static:"breadcrumb-module__static___affaf",separator:v8,chalkboard:w8};function b8({items:e,surface:t="paper",className:n}){return d.jsx("nav",{"aria-label":"Breadcrumb",className:X(cr.breadcrumb,t==="chalkboard"&&cr.chalkboard,n),children:d.jsx("ol",{className:cr.list,children:e.map((r,s)=>{const i=s===e.length-1;return d.jsxs("li",{className:cr.item,children:[i?d.jsx("span",{className:cr.current,"aria-current":"page",children:r.label}):r.href?d.jsx("a",{href:r.href,className:cr.link,onClick:r.onClick,children:r.label}):r.onClick?d.jsx("button",{type:"button",className:X(cr.link,cr.linkButton),onClick:r.onClick,children:r.label}):d.jsx("span",{className:cr.static,children:r.label}),!i&&d.jsx(k8,{className:cr.separator})]},r.id)})})})}function k8({className:e}){return d.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:d.jsx("polyline",{points:"9 18 15 12 9 6"})})}const _8="menu-module__wrapper___WCtoy",S8="menu-module__menu___i40Wj",C8="menu-module__surface___SJbaB",j8="menu-module__list___YjCfD",E8="menu-module__item___aqcgg",P8="menu-module__icon___1qUvA",T8="menu-module__label___MtQMh",N8="menu-module__danger___p9oZo",I8="menu-module__itemDisabled___HByLP",A8="menu-module__separator___g2uay",R8="menu-module__chalkboard___5jIwI",Wn={wrapper:_8,menu:S8,surface:C8,list:j8,item:E8,icon:P8,label:T8,danger:N8,itemDisabled:I8,separator:A8,chalkboard:R8},L8=6;function M8(e){return"type"in e&&e.type==="separator"}function Yx({trigger:e,items:t,align:n="start",surface:r="paper",className:s}){const i=b.useId(),[o,a]=b.useState(!1),[l,c]=b.useState(null),u=b.useRef(null),f=b.useRef(null),h=b.useCallback(()=>{var y,v;(v=(y=u.current)==null?void 0:y.querySelector("button, a, [tabindex]"))==null||v.focus()},[]),p=b.useCallback(()=>a(!1),[]);Bf(o,()=>{p(),h()}),b.useEffect(()=>{if(!o)return;const y=v=>{var w,k;const _=v.target;(w=u.current)!=null&&w.contains(_)||(k=f.current)!=null&&k.contains(_)||p()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o,p]),b.useEffect(()=>{if(!o){c(null);return}const y=()=>{u.current&&c(u.current.getBoundingClientRect())};return y(),document.addEventListener("scroll",y,{capture:!0,passive:!0}),window.addEventListener("resize",y,{passive:!0}),()=>{document.removeEventListener("scroll",y,{capture:!0}),window.removeEventListener("resize",y)}},[o]),b.useEffect(()=>{var y,v;!o||!l||(v=(y=f.current)==null?void 0:y.querySelector('[role="menuitem"]:not(:disabled)'))==null||v.focus()},[o,l]);const m=y=>{var v,w,k,_,S;const j=Array.from(((v=f.current)==null?void 0:v.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(j.length===0)return;const E=j.indexOf(document.activeElement);switch(y.key){case"ArrowDown":y.preventDefault(),(w=j[(E+1)%j.length])==null||w.focus();break;case"ArrowUp":y.preventDefault(),(k=j[(E-1+j.length)%j.length])==null||k.focus();break;case"Home":y.preventDefault(),(_=j[0])==null||_.focus();break;case"End":y.preventDefault(),(S=j[j.length-1])==null||S.focus();break;case"Tab":p();break}},g=y=>{var v;y.disabled||(p(),h(),(v=y.onSelect)==null||v.call(y))},x=e.props;return d.jsxs("span",{ref:u,className:Wn.wrapper,children:[b.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:y=>{var v;(v=x.onClick)==null||v.call(x,y),a(w=>!w)}}),o&&l&&typeof document<"u"&&Ni.createPortal(d.jsxs("div",{ref:f,id:i,role:"menu",className:X(Wn.menu,r==="chalkboard"&&Wn.chalkboard,s),style:{position:"fixed",top:l.bottom+L8,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[d.jsx(qt,{clip:!0,...Yt.surface}),d.jsx("div",{className:Wn.surface}),d.jsx("div",{className:Wn.list,children:t.map(y=>M8(y)?d.jsx("div",{role:"separator",className:Wn.separator},y.id):d.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:y.disabled,className:X(Wn.item,y.danger&&Wn.danger,y.disabled&&Wn.itemDisabled),onClick:()=>g(y),children:[y.icon&&d.jsx("span",{className:Wn.icon,children:y.icon}),d.jsx("span",{className:Wn.label,children:y.label})]},y.id))})]}),document.body)]})}const BP=({size:e=16})=>d.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:[d.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"}),d.jsx("path",{d:"M19 3v3"}),d.jsx("path",{d:"M20.5 4.5h-3"})]}),$8=({size:e=16})=>d.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:[d.jsx("path",{d:"M12 19V5"}),d.jsx("path",{d:"m5 12 7-7 7 7"})]}),D8=({size:e=16})=>d.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:[d.jsx("path",{d:"M12 5v14"}),d.jsx("path",{d:"m5 12 7 7 7-7"})]}),VP=({size:e=16})=>d.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:[d.jsx("circle",{cx:"18",cy:"18",r:"3"}),d.jsx("circle",{cx:"6",cy:"6",r:"3"}),d.jsx("path",{d:"M6 9v5c0 .667 3 1 6 1s6-.333 6-1V9"}),d.jsx("path",{d:"M12 17v2"})]}),Jx=({size:e=16})=>d.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:[d.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),d.jsx("polyline",{points:"21 3 21 9 15 9"})]}),UP=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[d.jsx("circle",{cx:"5",cy:"12",r:"2"}),d.jsx("circle",{cx:"12",cy:"12",r:"2"}),d.jsx("circle",{cx:"19",cy:"12",r:"2"})]}),O8=({size:e=16})=>d.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:[d.jsx("path",{d:"m18 4 3 3-3 3"}),d.jsx("path",{d:"M3 7h5.5a3 3 0 0 1 2.5 1.35L15 16.65A3 3 0 0 0 17.5 18H21"}),d.jsx("path",{d:"m18 20 3-3-3-3"}),d.jsx("path",{d:"M3 17h5.5a3 3 0 0 0 2.5-1.35"}),d.jsx("path",{d:"M13 8.35A3 3 0 0 1 15.5 7H21"})]}),z8=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:d.jsx("path",{d:"M6 4l11 6-11 6z"})}),F8=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:d.jsx("rect",{x:"5",y:"5",width:"10",height:"10",rx:"1.5"})}),B8=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"m7 4 6 6-6 6"})}),V8=({size:e=16})=>d.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:[d.jsx("path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"}),d.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),pk=({size:e=16})=>d.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:[d.jsx("path",{d:"M6 3v12"}),d.jsx("circle",{cx:"18",cy:"6",r:"3"}),d.jsx("circle",{cx:"6",cy:"18",r:"3"}),d.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),U8=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:d.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"})}),WP=({size:e=14})=>d.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:[d.jsx("title",{children:"Idea"}),d.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"})]}),Qx=({size:e=14})=>d.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:[d.jsx("title",{children:"Note"}),d.jsx("path",{d:"M15 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z"}),d.jsx("path",{d:"M15 3v6h6"})]}),$ae=({size:e=14})=>d.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:[d.jsx("path",{d:"m3 12 4 4 7-8"}),d.jsx("path",{d:"m11 15 2 2 8-9"})]}),W8=({state:e,filesEmpty:t})=>d.jsxs("div",{className:"flex flex-col gap-2",children:[e.suggestError&&d.jsx(OP,{dismissible:!0,onDismiss:()=>e.setSuggestError(null),children:e.suggestError}),d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("div",{className:"flex-1 min-w-[140px]",children:d.jsx(rt,{size:"small",placeholder:"Commit title",value:e.commitTitle,onChange:n=>e.setCommitTitle(n.currentTarget.value)})}),d.jsx(qe,{icon:d.jsx(BP,{size:16}),size:"small",label:"Suggest title and message from the diff",disabled:t||e.suggesting,onClick:e.handleSuggestFromChanges,wobble:e.suggesting?1:0})]})]}),K8="x-pairing-token",H8=["idea","planned","in-progress","review","done","dropped"],oc=["claude-code","opencode"],G8={"claude-code":"Claude Code",opencode:"OpenCode"},Dae={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},Oae={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"},feedback:{agent:"claude-code",model:"sonnet",effort:"medium"},codeReview:{agent:"claude-code",model:"opus",effort:"high"},deskDiscovery:{agent:"claude-code"}};function zae(e,t){return e.agent===t.agent&&(e.model??"")===(t.model??"")}const Z8="/api/machine/projects";let KP="",Tg=null;function q8(e){KP=e}function Y8(e){Tg=e}function W(e){return`${KP}${e}`}function J(e,t={}){if(!Tg)return fetch(e,t);const n=new Headers(t.headers);return n.set(K8,Tg),fetch(e,{...t,headers:n})}const vn=45e3;async function nr(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const J8=async()=>{const e=await J(W("/api/git/status"),{signal:AbortSignal.timeout(vn)});return await nr(e,"Failed to load git status"),e.json()},Q8=async()=>{const e=await J(W("/api/git/diff"),{signal:AbortSignal.timeout(vn)});return await nr(e,"Failed to load diff"),(await e.json()).files},X8=async e=>{const t=await J(W(`/api/git/stash-diff?index=${e}`),{signal:AbortSignal.timeout(vn)});return await nr(t,"Failed to load stash diff"),(await t.json()).patch},Ng=async(e,t,n)=>{const r=await J(W("/api/git/commit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e,title:t,message:n}),signal:AbortSignal.timeout(vn)});await nr(r,"Commit failed")},e9=async e=>{const t=await J(W("/api/git/stage"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:AbortSignal.timeout(vn)});await nr(t,"Stage failed")},Fae=async e=>{const t=await J(W("/api/git/unstage"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:AbortSignal.timeout(vn)});await nr(t,"Unstage failed")},t9=async()=>{const e=await J(W("/api/git/push"),{method:"POST",signal:AbortSignal.timeout(vn)});await nr(e,"Push failed")},HP=async e=>{const t=await J(W("/api/git/suggest-commit-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});return await nr(t,"Failed to suggest a commit message"),t.json()},n9=async()=>{const e=await J(W("/api/git/sync"),{method:"POST",signal:AbortSignal.timeout(vn)});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 nr(e,"Sync failed"),{ok:!0}},r9=async()=>{const e=await J(W("/api/git/pull"),{method:"POST",signal:AbortSignal.timeout(vn)});await nr(e,"Pull failed")},s9=async()=>{const e=await J(W("/api/git/fix-divergence"),{method:"POST",signal:AbortSignal.timeout(vn)});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 nr(e,"Fix failed"),{ok:!0}},i9=async e=>{const t=await J(W("/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})`}}},o9=async e=>{const t=await J(W("/api/git/complete-idea"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e}),signal:AbortSignal.timeout(vn)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to complete idea");return{branch:n.branch,remoteDeleted:n.remoteDeleted,needsAttention:n.needsAttention}},a9=async e=>{const t=await J(W("/api/git/verify-direct-completion"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e}),signal:AbortSignal.timeout(vn)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to verify completion");return{ready:n.ready,missing:n.missing}},l9=async e=>{const t=await J(W("/api/git/branch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e}),signal:AbortSignal.timeout(vn)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create branch");return{branch:n.branch,warning:n.warning}},c9={},mk=e=>{let t;const n=new Set,r=(u,f)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const p=t;t=f??(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:()=>{(c9?"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},u9=e=>e?mk(e):mk,GP={},{useDebugValue:d9}=Ro,{useSyncExternalStoreWithSelector:f9}=hM;let gk=!1;const h9=e=>e;function p9(e,t=h9,n){(GP?"production":void 0)!=="production"&&n&&!gk&&(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"),gk=!0);const r=f9(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return d9(r),r}const m9=e=>{(GP?"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"?u9(e):e,n=(r,s)=>p9(t,r,s);return Object.assign(n,t),n},g9=e=>m9,ZP=async()=>{const e=await fetch(W("/api/capabilities"));return e.ok?(await e.json()).capabilities:null},y9=async e=>{try{const t=await fetch(`${e}/api/capabilities`);return t.ok?(await t.json()).version??null:null}catch{return null}},x9=async()=>{const e=await fetch(W("/api/agent/auth-status"));return e.ok?await e.json():null},Bae=async()=>{try{const e=await fetch(W("/api/connections"));return e.ok?(await e.json()).connections:null}catch{return null}},v9=async(e=!1)=>{try{const t=await fetch(W(`/api/tailnet/peers${e?"?refresh=1":""}`));return t.ok?(await t.json()).peers:null}catch{return null}},w9=async e=>{try{const t=await fetch(`${e}${Z8}`);return t.ok?(await t.json()).projects:null}catch{return null}},Vae=async e=>{try{const t=await fetch(W(`/api/connections/connect?id=${encodeURIComponent(e)}`),{method:"POST"});return t.ok?(await t.json()).connection:null}catch{return null}},Jd=async()=>{try{const e=await fetch(W("/api/config"));return e.ok?e.json():null}catch{return null}},b9=async e=>{try{const t=await fetch(W("/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}}},k9=async()=>{try{const e=await fetch(W("/api/desk/discover"),{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}),t=await e.json().catch(()=>null);return e.ok?{ok:!0,proposal:t==null?void 0:t.proposal}:{ok:!1,error:t==null?void 0:t.error}}catch(e){return{ok:!1,error:e.message}}},_9=async()=>{try{const e=await fetch(W("/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}},Uae=async e=>{try{return(await fetch(W("/api/icon"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUri:e})})).ok}catch{return!1}},qP=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),S9=async e=>{try{const t=await fetch(`${e}/api/package-name`);return t.ok?t.json():null}catch{return null}},C9=async()=>{try{const e=await fetch(W("/api/package-name"));return e.ok?e.json():null}catch{return null}},wn=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},j9=async()=>(await J(W("/api/agent/status"))).json(),E9=async()=>(await J(W("/api/agent/reconcile-queue"))).json(),P9=async(e,t)=>{const n=await J(W("/api/agent/launch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,phaseIndex:t})});await wn(n)},T9=async(e,t)=>{const n=await J(W("/api/agent/launch-audit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await wn(n)},N9=async(e,t)=>{const n=await J(W("/api/agent/launch-reconcile"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await wn(n)},I9=async(e,t)=>{const n=await J(W("/api/agent/launch-draft"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await wn(n)},A9=async(e,t)=>{const n=await J(W("/api/agent/launch-extend"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await wn(n)},R9=async e=>{const t=await J(W("/api/agent/launch-suggest"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await wn(t)},L9=async()=>{const e=await J(W("/api/agent/launch-reconcile-all"),{method:"POST"});await wn(e)},M9=async e=>{const t=await J(W("/api/agent/launch-draft-all"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})});await wn(t)},$9=async e=>{const t=await J(W("/api/agent/launch-run-all"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await wn(t)},D9=async e=>{const t=await J(W("/api/agent/launch-fix-review"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await wn(t)},O9=async e=>{const t=await J(W("/api/agent/launch-pr-review"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await wn(t)},z9=async(e,t,n,r)=>{const s=await J(W("/api/agent/issue-fix"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issueId:e,title:t,reason:n,output:r})});await wn(s)},Wae=async e=>{const t=await J(W("/api/agent/promote-issue"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issue:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)??`Failed to promote issue (${t.status})`);return n},F9=async e=>{try{const t=await fetch(W(`/api/agent/pr-review-status?planId=${encodeURIComponent(e)}`));return t.ok?t.json():null}catch{return null}},B9=async(e,t,n)=>{const r=await J(W("/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},yk=async(e,t,n,r)=>{const s=await J(W("/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})`)}},V9=async e=>{const t=await J(W("/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},U9=async(e,t)=>{const n=await J(W("/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},W9=async e=>{const t=await J(W("/api/agent/stop"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await wn(t,"Stop failed")},K9=async()=>(await J(W("/api/agent/login-relay/start"),{method:"POST"})).json(),H9=async()=>(await J(W("/api/agent/login-relay/status"))).json(),G9=async()=>{await J(W("/api/agent/login-relay/cancel"),{method:"POST"})},Z9=async()=>{const e=await J(W("/api/checks"));return e.ok?(await e.json()).checks??[]:[]},YP=async e=>{const t=await J(W(`/api/checks/run?name=${encodeURIComponent(e)}`),{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to run check"}));throw new Error(n.error??"Failed to run check")}};function _t(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 Kn(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let q9=0;const xk=()=>`preview-${++q9}`;function Y9(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:_t(e,x9,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await j9(),r=t().agentStatus;if(e({agentStatus:n}),n.some(u=>{if(u.taskKind!=="issue-fix"||u.status!=="done"&&u.status!=="error")return!1;const f=r.find(h=>h.id===u.id);return f&&f.status!=="done"&&f.status!=="error"})&&t().loadTaskLog(),n.find(u=>{var h;if(u.status!=="done"||u.taskKind!=="run-all"&&u.taskKind!=="phase")return!1;const f=r.find(p=>p.id===u.id);if(!f||f.status==="done"||f.status==="error")return!1;if(u.taskKind==="phase"){const p=(h=t().plans)==null?void 0:h.entries.find(m=>m.id===u.planId);if(!p||u.phaseIndex!==p.phases.length-1)return!1}return!0})){t().runConsistencyCheck();for(const u of["lint","test"])YP(u).catch(()=>{})}const o=t().pendingReconcile,a=o?n.find(u=>u.taskKind==="reconcile"&&u.planId===o.planId):void 0;o&&a&&(a.status==="done"?(await t().loadPlans(),e(u=>({reconcileQueue:[...u.reconcileQueue,{...o,previewId:xk()}],pendingReconcile:null}))):a.status==="error"&&e({pendingReconcile:null}));const l=n.find(u=>u.taskKind==="batch-reconcile"||u.taskKind==="batch-draft"),c=(l==null?void 0:l.taskKind)==="batch-draft"?l.status==="done"||l.status==="error":(l==null?void 0:l.status)==="done";if(l&&c&&!t().batchReconcileConsumed){if(l.taskKind==="batch-reconcile"){const u=await E9();u&&u.length>0&&(await t().loadPlans(),e(f=>({reconcileQueue:[...f.reconcileQueue,...u.map(h=>({planId:h.planId,before:h.before,previewId:xk()}))]})))}else await t().loadPlans();e({batchReconcileConsumed:!0})}}catch{}},launchAgent:Kn(t,P9),launchPlanAudit:Kn(t,T9),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 N9(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:Kn(t,I9),launchIdeaExtend:Kn(t,A9),launchBatchReconcile:Kn(t,async()=>{e({batchReconcileConsumed:!1}),await L9()}),launchBatchDraft:Kn(t,async n=>{e({batchReconcileConsumed:!1}),await M9(n)}),launchSuggestIdeas:Kn(t,R9),launchRunAll:Kn(t,$9),launchFixReview:Kn(t,D9),launchPrReview:Kn(t,O9),launchIssueFix:Kn(t,z9),stopAgent:async n=>{try{await W9(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await K9();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:_t(e,H9,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await G9()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}const J9=3e4,Q9=async()=>{const e=await fetch(W("/api/capacity/refresh"),{method:"POST",signal:AbortSignal.timeout(J9)});if(!e.ok)return null;const t=await e.json();return t.snapshot&&t.capturedAt?{snapshot:t.snapshot,capturedAt:t.capturedAt}:null};function X9(e){return{probedCapacity:null,refreshCapacity:async()=>{const t=await Q9().catch(()=>null);t&&e({probedCapacity:t})}}}function eW(e,t){return{diffFiles:null,diffLoadFailed:!1,loadDiffFiles:_t(e,Q8,n=>({diffFiles:n,diffLoadFailed:!1}),()=>({diffLoadFailed:!0})),activeDiffPath:null,setActiveDiffPath:n=>{t().activeDiffPath!==n&&e({activeDiffPath:n})},manuallyExpandedDiffPaths:new Set,manuallyCollapsedDiffPaths:new Set,setDiffCollapsed:(n,r)=>{e(s=>{const i=new Set(s.manuallyExpandedDiffPaths),o=new Set(s.manuallyCollapsedDiffPaths);return r?(o.add(n),i.delete(n)):(i.add(n),o.delete(n)),{manuallyExpandedDiffPaths:i,manuallyCollapsedDiffPaths:o}})},expandDiffPath:n=>t().setDiffCollapsed(n,!1)}}const tW=async()=>(await fetch(W("/api/tasks"))).json(),Kae=async e=>{const t=await fetch(W(`/api/tasks/output?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error(`Failed to fetch task log: ${t.status}`);return t.json()},nW=async()=>(await fetch(W("/api/suggestions"))).json(),rW=async e=>{const t=await fetch(W("/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()},sW=async e=>{const t=await fetch(W("/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)}},iW=async()=>(await fetch(W("/api/docs"))).json(),JP=async()=>{const e=await fetch(W("/api/roadmap"));if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},oW=async(e,t,n,r)=>{const s=await fetch(W("/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()},Hae=async(e,t,n)=>{const r=await fetch(W("/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)}},Gae=async(e,t,n)=>{const r=await fetch(W("/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)}},aW=async()=>(await fetch(W("/api/consistency"))).json(),lW=async()=>(await fetch(W("/api/doctor"))).json(),cW=45e3,QP=async()=>(await fetch(W("/api/ideas"),{signal:AbortSignal.timeout(cW)})).json(),uW=async()=>(await fetch(W("/api/archivable-ideas"))).json(),dW=async e=>{const t=await fetch(W("/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},XP=async e=>{const t=await fetch(W("/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},fW=async e=>{const t=await fetch(W("/api/tickets"),{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 ticket");return n.id},hW=async(e,t)=>{const n=await fetch(W("/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},pW=async()=>{const e=await fetch(W("/api/ideas/prioritise"),{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error??"Failed to prioritise queue");return t},mW=async()=>{const e=await fetch(W("/api/notifications"));if(!e.ok)throw new Error(`Failed to fetch notifications: ${e.status}`);return e.json()},gW=async e=>{const t=await fetch(W("/api/notifications/mark-read"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})});if(!t.ok)throw new Error(`Failed to mark notification read: ${t.status}`)},yW=async()=>{const e=await fetch(W("/api/parked-questions"));if(!e.ok)throw new Error(`Failed to fetch parked questions: ${e.status}`);return e.json()},xW=45e3,eT=async()=>(await fetch(W("/api/plans"),{signal:AbortSignal.timeout(xW)})).json(),vW=async(e,t)=>{const n=await fetch(W(`/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})`)}},wW=async()=>{const e=await J(W("/api/releases"));if(!e.ok)throw new Error("Failed to load releases");const{versions:t}=await e.json();return t},Zae=async e=>{const t=await J(W(`/api/release-notes?version=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load release notes");return t.json()};function bW(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await iW();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 wW();e({releaseVersions:n,releaseVersionsLoading:!1})}catch{e({releaseVersions:[],releaseVersionsLoading:!1})}},activeReleaseVersion:null,setActiveReleaseVersion:n=>e({activeReleaseVersion:n})}}const Xx="papercamp:github-corpus";function tT(){try{const e=localStorage.getItem(Xx);if(!e)return null;const t=JSON.parse(e);return!t.token||!t.owner||!t.repo?null:{token:t.token,owner:t.owner,repo:t.repo}}catch{return null}}function nT(e){try{localStorage.setItem(Xx,JSON.stringify(e))}catch{}}function kW(){try{localStorage.removeItem(Xx)}catch{}}function _W(e){return{githubConfig:tT(),setGithubConfig:t=>{nT(t),e({githubConfig:t})},clearGithubConfig:()=>{kW(),e({githubConfig:null})}}}function SW(e){return e.archived===!0||e.status==="done"}function CW(e){const t=e.phases.length>0&&e.phases.every(r=>r.done),n=(e.fixes??[]).every(r=>r.done);return t&&n}function jW(e,t,n,r=!1){return e.kind==="note"||e.status==="dropped"?e.status:e.archived?"done":n?e.status==="review"||e.status==="done"?e.status:r&&e.phases.length>0?CW(e)?"review":"in-progress":e.phases.length>0?"planned":"idea":e.status??(e.phases.length>0?"planned":"idea")}function EW(e,t,n){return e.kind==="note"||e.kind==="board"||e.status==="dropped"||e.archived?!1:!n}function PW(e=[],t=[],n=[],r=[]){const s=[...e.map(o=>({kind:"log",date:o.date,text:o.text})),...t.map(o=>({kind:"clarification",date:o.date,text:o.text})),...r.map(o=>({kind:"review",date:o.date,text:o.text}))].sort((o,a)=>o.date.localeCompare(a.date)),i=n.map(o=>({kind:o.kind??"note",text:o.anchor.kind==="phase"?`[phase ${o.anchor.index}] ${o.prose}`:o.prose,state:o.state}));return[...s,...i]}function ev(e,t){return e.filter(n=>n.kind===t).map(n=>({date:n.date??"",text:n.text}))}function rT(e=[]){return ev(e,"log")}function TW(e=[]){return ev(e,"clarification")}function NW(e=[]){return ev(e,"review")}function IW(e=[]){return e.filter(t=>t.kind==="note"||t.kind==="decision"||t.kind==="question").map(t=>({anchor:{kind:"body"},prose:t.text,state:t.state??"open",kind:t.kind}))}function AW(e,t,n){return[...(e??[]).filter(r=>!t.includes(r.kind)),...n]}function sT(e,t,n=!1,r=!1){return{title:e.title,status:jW(e,t,n,r),statusFallback:EW(e,t,n),kind:e.type,entityKind:e.kind==="note"?void 0:e.kind,id:e.id,idea:e.idea,agent:e.agent,created:e.created,updated:e.updated,audited:e.audited,auditedHash:e.auditedHash,released:e.released,tags:e.tags,subject:e.subject,order:e.order,issueSource:e.issueSource,body:e.body,phases:e.phases,fixes:e.fixes,log:rT(e.thread),clarifications:TW(e.thread),notes:IW(e.thread),review:NW(e.thread),thread:e.thread,archived:e.archived,pr:t}}function RW(e){return{id:e.id,title:e.title,body:e.body,kind:"note",status:e.status,subject:e.subject,order:e.order,created:e.created,log:rT(e.thread)}}const tv=Symbol.for("yaml.alias"),Ig=Symbol.for("yaml.document"),Ps=Symbol.for("yaml.map"),iT=Symbol.for("yaml.pair"),kr=Symbol.for("yaml.scalar"),oa=Symbol.for("yaml.seq"),Dn=Symbol.for("yaml.node.type"),aa=e=>!!e&&typeof e=="object"&&e[Dn]===tv,ac=e=>!!e&&typeof e=="object"&&e[Dn]===Ig,lc=e=>!!e&&typeof e=="object"&&e[Dn]===Ps,Ye=e=>!!e&&typeof e=="object"&&e[Dn]===iT,Ne=e=>!!e&&typeof e=="object"&&e[Dn]===kr,cc=e=>!!e&&typeof e=="object"&&e[Dn]===oa;function He(e){if(e&&typeof e=="object")switch(e[Dn]){case Ps:case oa:return!0}return!1}function Ze(e){if(e&&typeof e=="object")switch(e[Dn]){case tv:case Ps:case kr:case oa:return!0}return!1}const oT=e=>(Ne(e)||He(e))&&!!e.anchor,ni=Symbol("break visit"),LW=Symbol("skip children"),ll=Symbol("remove node");function la(e,t){const n=MW(t);ac(e)?mo(null,e.contents,n,Object.freeze([e]))===ll&&(e.contents=null):mo(null,e,n,Object.freeze([]))}la.BREAK=ni;la.SKIP=LW;la.REMOVE=ll;function mo(e,t,n,r){const s=$W(e,t,n,r);if(Ze(s)||Ye(s))return DW(e,r,s),mo(e,s,n,r);if(typeof s!="symbol"){if(He(t)){r=Object.freeze(r.concat(t));for(let i=0;i<t.items.length;++i){const o=mo(i,t.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===ni)return ni;o===ll&&(t.items.splice(i,1),i-=1)}}}else if(Ye(t)){r=Object.freeze(r.concat(t));const i=mo("key",t.key,n,r);if(i===ni)return ni;i===ll&&(t.key=null);const o=mo("value",t.value,n,r);if(o===ni)return ni;o===ll&&(t.value=null)}}return s}function MW(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function $W(e,t,n,r){var s,i,o,a,l;if(typeof n=="function")return n(e,t,r);if(lc(t))return(s=n.Map)==null?void 0:s.call(n,e,t,r);if(cc(t))return(i=n.Seq)==null?void 0:i.call(n,e,t,r);if(Ye(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,r);if(Ne(t))return(a=n.Scalar)==null?void 0:a.call(n,e,t,r);if(aa(t))return(l=n.Alias)==null?void 0:l.call(n,e,t,r)}function DW(e,t,n){const r=t[t.length-1];if(He(r))r.items[e]=n;else if(Ye(r))e==="key"?r.key=n:r.value=n;else if(ac(r))r.contents=n;else{const s=aa(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const OW={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},zW=e=>e.replace(/[!,[\]{}]/g,t=>OW[t]);class Nt{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Nt.defaultYaml,t),this.tags=Object.assign({},Nt.defaultTags,n)}clone(){const t=new Nt(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Nt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Nt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Nt.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Nt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Nt.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return n(String(o)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+zW(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&Ze(t.contents)){const i={};la(t.contents,(o,a)=>{Ze(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!t||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
|
|
66
|
+
`)}}Nt.defaultYaml={explicit:!1,version:"1.2"};Nt.defaultTags={"!!":"tag:yaml.org,2002:"};function aT(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function lT(e){const t=new Set;return la(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function cT(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function FW(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=lT(e));const o=cT(t,s);return s.add(o),o},setAnchors:()=>{for(const i of n){const o=r.get(i);if(typeof o=="object"&&o.anchor&&(Ne(o.node)||He(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}function go(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){const o=r[s],a=go(e,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const i=r.get(s),o=go(e,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(const s of Array.from(r)){const i=go(e,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(const[s,i]of Object.entries(r)){const o=go(e,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return e.call(t,n,r)}function Ln(e,t,n){if(Array.isArray(e))return e.map((r,s)=>Ln(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!oT(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class nv{constructor(t){Object.defineProperty(this,Dn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!ac(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Ln(this,"",o);if(typeof s=="function")for(const{count:l,res:c}of o.anchors.values())s(c,l);return typeof i=="function"?go(i,{"":a},"",a):a}}class rv extends nv{constructor(t){super(tv),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],la(t,{Node:(i,o)=>{(aa(o)||oT(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,o=this.resolve(s,n);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(o);if(a||(Ln(o,null,n),a=r.get(o)),(a==null?void 0:a.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ju(s,o,r)),a.count*a.aliasCount>i)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(aT(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}}function Ju(e,t,n){if(aa(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(He(t)){let r=0;for(const s of t.items){const i=Ju(e,s,n);i>r&&(r=i)}return r}else if(Ye(t)){const r=Ju(e,t.key,n),s=Ju(e,t.value,n);return Math.max(r,s)}return 1}const uT=e=>!e||typeof e!="function"&&typeof e!="object";class ae extends nv{constructor(t){super(kr),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Ln(this.value,t,n)}toString(){return String(this.value)}}ae.BLOCK_FOLDED="BLOCK_FOLDED";ae.BLOCK_LITERAL="BLOCK_LITERAL";ae.PLAIN="PLAIN";ae.QUOTE_DOUBLE="QUOTE_DOUBLE";ae.QUOTE_SINGLE="QUOTE_SINGLE";const BW="tag:yaml.org,2002:";function VW(e,t,n){if(t){const r=n.filter(i=>i.tag===t),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function Vl(e,t,n){var f,h,p;if(ac(e)&&(e=e.contents),Ze(e))return e;if(Ye(e)){const m=(h=(f=n.schema[Ps]).createNode)==null?void 0:h.call(f,n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n;let l;if(r&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=s(e)),new rv(l.anchor);l={anchor:null,node:null},a.set(e,l)}t!=null&&t.startsWith("!!")&&(t=BW+t.slice(2));let c=VW(e,t,o.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new ae(e);return l&&(l.node=m),m}c=e instanceof Map?o[Ps]:Symbol.iterator in Object(e)?o[oa]:o[Ps]}i&&(i(c),delete n.onTagObj);const u=c!=null&&c.createNode?c.createNode(n.schema,e,n):typeof((p=c==null?void 0:c.nodeClass)==null?void 0:p.from)=="function"?c.nodeClass.from(n.schema,e,n):new ae(e);return t?u.tag=t:c.default||(u.tag=c.tag),l&&(l.node=u),u}function Qd(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return Vl(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Ha=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class dT extends nv{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>Ze(r)||Ye(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Ha(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(He(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Qd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(He(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,i=this.get(r,!0);return s.length===0?!n&&Ne(i)?i.value:i:He(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ye(n))return!1;const r=n.value;return r==null||t&&Ne(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return He(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(He(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Qd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const UW=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function $r(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ui=(e,t,n)=>e.endsWith(`
|
|
67
|
+
`)?$r(n,t):n.includes(`
|
|
68
|
+
`)?`
|
|
69
|
+
`+$r(n,t):(e.endsWith(" ")?"":" ")+n,fT="flow",Ag="block",Qu="quoted";function Kf(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return e;s<i&&(i=0);const l=Math.max(1+i,1+s-t.length);if(e.length<=l)return e;const c=[],u={};let f=s-t.length;typeof r=="number"&&(r>s-Math.max(2,i)?c.push(0):f=s-r);let h,p,m=!1,g=-1,x=-1,y=-1;n===Ag&&(g=vk(e,g,t.length),g!==-1&&(f=g+l));for(let w;w=e[g+=1];){if(n===Qu&&w==="\\"){switch(x=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(w===`
|
|
70
|
+
`)n===Ag&&(g=vk(e,g,t.length)),f=g+t.length+l,h=void 0;else{if(w===" "&&p&&p!==" "&&p!==`
|
|
71
|
+
`&&p!==" "){const k=e[g+1];k&&k!==" "&&k!==`
|
|
72
|
+
`&&k!==" "&&(h=g)}if(g>=f)if(h)c.push(h),f=h+l,h=void 0;else if(n===Qu){for(;p===" "||p===" ";)p=w,w=e[g+=1],m=!0;const k=g>y+1?g-2:x-1;if(u[k])return e;c.push(k),u[k]=!0,f=k+l,h=void 0}else m=!0}p=w}if(m&&a&&a(),c.length===0)return e;o&&o();let v=e.slice(0,c[0]);for(let w=0;w<c.length;++w){const k=c[w],_=c[w+1]||e.length;k===0?v=`
|
|
73
|
+
${t}${e.slice(0,_)}`:(n===Qu&&u[k]&&(v+=`${e[k]}\\`),v+=`
|
|
74
|
+
${t}${e.slice(k+1,_)}`)}return v}function vk(e,t,n){let r=t,s=t+1,i=e[s];for(;i===" "||i===" ";)if(t<s+n)i=e[++t];else{do i=e[++t];while(i&&i!==`
|
|
75
|
+
`);r=t,s=t+1,i=e[s]}return r}const Hf=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Gf=e=>/^(%|---|\.\.\.)/m.test(e);function WW(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(e[i]===`
|
|
76
|
+
`){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function cl(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(Gf(e)?" ":"");let o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);const u=n.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||n[l+2]==='"'||n.length<s)l+=1;else{for(o+=n.slice(a,l)+`
|
|
77
|
+
|
|
78
|
+
`;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=`
|
|
79
|
+
`,l+=2;o+=i,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,r?o:Kf(o,i,Qu,Hf(t,!1))}function Rg(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
80
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return cl(e,t);const n=t.indent||(Gf(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
81
|
+
${n}`)+"'";return t.implicitKey?r:Kf(r,n,fT,Hf(t,!1))}function yo(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=cl;else{const s=e.includes('"'),i=e.includes("'");s&&!i?r=Rg:i&&!s?r=cl:r=n?Rg:cl}return r(e,t)}let Lg;try{Lg=new RegExp(`(^|(?<!
|
|
82
|
+
))
|
|
83
|
+
+(?!
|
|
84
|
+
|$)`,"g")}catch{Lg=/\n+(?!\n|$)/g}function Xu({comment:e,type:t,value:n},r,s,i){const{blockQuote:o,commentString:a,lineWidth:l}=r.options;if(!o||/\n[\t ]+$/.test(n))return yo(n,r);const c=r.indent||(r.forceBlockIndent||Gf(n)?" ":""),u=o==="literal"?!0:o==="folded"||t===ae.BLOCK_FOLDED?!1:t===ae.BLOCK_LITERAL?!0:!WW(n,l,c.length);if(!n)return u?`|
|
|
85
|
+
`:`>
|
|
86
|
+
`;let f,h;for(h=n.length;h>0;--h){const _=n[h-1];if(_!==`
|
|
87
|
+
`&&_!==" "&&_!==" ")break}let p=n.substring(h);const m=p.indexOf(`
|
|
88
|
+
`);m===-1?f="-":n===p||m!==p.length-1?(f="+",i&&i()):f="",p&&(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
89
|
+
`&&(p=p.slice(0,-1)),p=p.replace(Lg,`$&${c}`));let g=!1,x,y=-1;for(x=0;x<n.length;++x){const _=n[x];if(_===" ")g=!0;else if(_===`
|
|
90
|
+
`)y=x;else break}let v=n.substring(0,y<x?y+1:x);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${c}`));let k=(g?c?"2":"1":"")+f;if(e&&(k+=" "+a(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){const _=n.replace(/\n+/g,`
|
|
91
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let S=!1;const j=Hf(r,!0);o!=="folded"&&t!==ae.BLOCK_FOLDED&&(j.onOverflow=()=>{S=!0});const E=Kf(`${v}${_}${p}`,c,Ag,j);if(!S)return`>${k}
|
|
92
|
+
${c}${E}`}return n=n.replace(/\n+/g,`$&${c}`),`|${k}
|
|
93
|
+
${c}${v}${n}${p}`}function KW(e,t,n,r){const{type:s,value:i}=e,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=t;if(a&&i.includes(`
|
|
94
|
+
`)||u&&/[[\]{},]/.test(i))return yo(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
|
|
95
|
+
`)?yo(i,t):Xu(e,t,n,r);if(!a&&!u&&s!==ae.PLAIN&&i.includes(`
|
|
96
|
+
`))return Xu(e,t,n,r);if(Gf(i)){if(l==="")return t.forceBlockIndent=!0,Xu(e,t,n,r);if(a&&l===c)return yo(i,t)}const f=i.replace(/\n+/g,`$&
|
|
97
|
+
${l}`);if(o){const h=g=>{var x;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((x=g.test)==null?void 0:x.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return yo(i,t)}return a?f:Kf(f,l,fT,Hf(t,!1))}function sv(e,t,n,r){const{implicitKey:s,inFlow:i}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ae.QUOTE_DOUBLE);const l=u=>{switch(u){case ae.BLOCK_FOLDED:case ae.BLOCK_LITERAL:return s||i?yo(o.value,t):Xu(o,t,n,r);case ae.QUOTE_DOUBLE:return cl(o.value,t);case ae.QUOTE_SINGLE:return Rg(o.value,t);case ae.PLAIN:return KW(o,t,n,r);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:u,defaultStringType:f}=t.options,h=s&&u||f;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function hT(e,t){const n=Object.assign({blockQuote:!0,commentString:UW,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function HW(e,t){var s;if(t.tag){const i=e.filter(o=>o.tag===t.tag);if(i.length>0)return i.find(o=>o.format===t.format)??i[0]}let n,r;if(Ne(t)){r=t.value;let i=e.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,r)});if(i.length>1){const o=i.filter(a=>a.test);o.length>0&&(i=o)}n=i.find(o=>o.format===t.format)??i.find(o=>!o.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function GW(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(Ne(e)||He(e))&&e.anchor;i&&aT(i)&&(n.add(i),s.push(`&${i}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}function Zo(e,t,n,r){var l;if(Ye(e))return e.toString(t,n,r);if(aa(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=Ze(e)?e:t.doc.createNode(e,{onTagObj:c=>s=c});s??(s=HW(t.doc.schema.tags,i));const o=GW(i,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof s.stringify=="function"?s.stringify(i,t,n,r):Ne(i)?sv(i,t,n,r):i.toString(t,n,r);return o?Ne(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
98
|
+
${t.indent}${a}`:a}function ZW({key:e,value:t},n,r,s){const{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n;let h=Ze(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(He(e)||!Ze(e)&&typeof e=="object"){const j="With simple keys, collection cannot be used as a key value";throw new Error(j)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||He(e)||(Ne(e)?e.type===ae.BLOCK_FOLDED||e.type===ae.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:a+l});let m=!1,g=!1,x=Zo(e,n,()=>m=!0,()=>g=!0);if(!p&&!n.inFlow&&x.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),x===""?"?":p?`? ${x}`:x}else if(i&&!f||t==null&&p)return x=`? ${x}`,h&&!m?x+=ui(x,n.indent,c(h)):g&&s&&s(),x;m&&(h=null),p?(h&&(x+=ui(x,n.indent,c(h))),x=`? ${x}
|
|
99
|
+
${a}:`):(x=`${x}:`,h&&(x+=ui(x,n.indent,c(h))));let y,v,w;Ze(t)?(y=!!t.spaceBefore,v=t.commentBefore,w=t.comment):(y=!1,v=null,w=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!h&&Ne(t)&&(n.indentAtStart=x.length+1),g=!1,!u&&l.length>=2&&!n.inFlow&&!p&&cc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let k=!1;const _=Zo(t,n,()=>k=!0,()=>g=!0);let S=" ";if(h||y||v){if(S=y?`
|
|
100
|
+
`:"",v){const j=c(v);S+=`
|
|
101
|
+
${$r(j,n.indent)}`}_===""&&!n.inFlow?S===`
|
|
102
|
+
`&&w&&(S=`
|
|
103
|
+
|
|
104
|
+
`):S+=`
|
|
105
|
+
${n.indent}`}else if(!p&&He(t)){const j=_[0],E=_.indexOf(`
|
|
106
|
+
`),T=E!==-1,P=n.inFlow??t.flow??t.items.length===0;if(T||!P){let N=!1;if(T&&(j==="&"||j==="!")){let R=_.indexOf(" ");j==="&"&&R!==-1&&R<E&&_[R+1]==="!"&&(R=_.indexOf(" ",R+1)),(R===-1||E<R)&&(N=!0)}N||(S=`
|
|
107
|
+
${n.indent}`)}}else(_===""||_[0]===`
|
|
108
|
+
`)&&(S="");return x+=S+_,n.inFlow?k&&r&&r():w&&!k?x+=ui(x,n.indent,c(w)):g&&s&&s(),x}function pT(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const uu="<<",zr={identify:e=>e===uu||typeof e=="symbol"&&e.description===uu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ae(Symbol(uu)),{addToJSMap:mT}),stringify:()=>uu},qW=(e,t)=>(zr.identify(t)||Ne(t)&&(!t.type||t.type===ae.PLAIN)&&zr.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===zr.tag&&n.default));function mT(e,t,n){const r=gT(e,n);if(cc(r))for(const s of r.items)Ep(e,t,s);else if(Array.isArray(r))for(const s of r)Ep(e,t,s);else Ep(e,t,r)}function Ep(e,t,n){const r=gT(e,n);if(!lc(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[i,o]of s)t instanceof Map?t.has(i)||t.set(i,o):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function gT(e,t){return e&&aa(t)?t.resolve(e.doc,e):t}function yT(e,t,{key:n,value:r}){if(Ze(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(qW(e,n))mT(e,t,r);else{const s=Ln(n,"",e);if(t instanceof Map)t.set(s,Ln(r,s,e));else if(t instanceof Set)t.add(s);else{const i=YW(n,s,e),o=Ln(r,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}function YW(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ze(e)&&(n!=null&&n.doc)){const r=hT(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),pT(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function iv(e,t,n){const r=Vl(e,void 0,n),s=Vl(t,void 0,n);return new Mt(r,s)}class Mt{constructor(t,n=null){Object.defineProperty(this,Dn,{value:iT}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Ze(n)&&(n=n.clone(t)),Ze(r)&&(r=r.clone(t)),new Mt(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return yT(n,r,this)}toString(t,n,r){return t!=null&&t.doc?ZW(this,t,n,r):JSON.stringify(this)}}function xT(e,t,n){return(t.inFlow??e.flow?QW:JW)(e,t,n)}function JW({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;m<t.length;++m){const g=t[m];let x=null;if(Ze(g))!f&&g.spaceBefore&&h.push(""),Xd(n,h,g.commentBefore,f),g.comment&&(x=g.comment);else if(Ye(g)){const v=Ze(g.key)?g.key:null;v&&(!f&&v.spaceBefore&&h.push(""),Xd(n,h,v.commentBefore,f))}f=!1;let y=Zo(g,u,()=>x=null,()=>f=!0);x&&(y+=ui(y,i,c(x))),f&&x&&(f=!1),h.push(r+y)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;m<h.length;++m){const g=h[m];p+=g?`
|
|
109
|
+
${l}${g}`:`
|
|
110
|
+
`}}return e?(p+=`
|
|
111
|
+
`+$r(c(e),l),a&&a()):f&&o&&o(),p}function QW({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=t;r+=i;const l=Object.assign({},t,{indent:r,inFlow:!0,type:null});let c=!1,u=0;const f=[];for(let m=0;m<e.length;++m){const g=e[m];let x=null;if(Ze(g))g.spaceBefore&&f.push(""),Xd(t,f,g.commentBefore,!1),g.comment&&(x=g.comment);else if(Ye(g)){const v=Ze(g.key)?g.key:null;v&&(v.spaceBefore&&f.push(""),Xd(t,f,v.commentBefore,!1),v.comment&&(c=!0));const w=Ze(g.value)?g.value:null;w?(w.comment&&(x=w.comment),w.commentBefore&&(c=!0)):g.value==null&&(v!=null&&v.comment)&&(x=v.comment)}x&&(c=!0);let y=Zo(g,l,()=>x=null);c||(c=f.length>u||y.includes(`
|
|
112
|
+
`)),m<e.length-1?y+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=f.reduce((v,w)=>v+w.length+2,2)+(y.length+2)>t.options.lineWidth)),c&&(y+=",")),x&&(y+=ui(y,r,a(x))),f.push(y),u=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!c){const m=f.reduce((g,x)=>g+x.length+2,2);c=t.options.lineWidth>0&&m>t.options.lineWidth}if(c){let m=h;for(const g of f)m+=g?`
|
|
113
|
+
${i}${s}${g}`:`
|
|
114
|
+
`;return`${m}
|
|
115
|
+
${s}${p}`}else return`${h}${o}${f.join(" ")}${o}${p}`}function Xd({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=$r(t(r),e);n.push(i.trimStart())}}function di(e,t){const n=Ne(t)?t.value:t;for(const r of e)if(Ye(r)&&(r.key===t||r.key===n||Ne(r.key)&&r.key.value===n))return r}class Pn extends dT{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ps,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,o=new this(t),a=(l,c)=>{if(typeof i=="function")c=i.call(n,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||s)&&o.items.push(iv(l,c,r))};if(n instanceof Map)for(const[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let r;Ye(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Mt(t,t==null?void 0:t.value):r=new Mt(t.key,t.value);const s=di(this.items,r.key),i=(o=this.schema)==null?void 0:o.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Ne(s.value)&&uT(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const a=this.items.findIndex(l=>i(r,l)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(t){const n=di(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=di(this.items,t),s=r==null?void 0:r.value;return(!n&&Ne(s)?s.value:s)??void 0}has(t){return!!di(this.items,t)}set(t,n){this.add(new Mt(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items)yT(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!Ye(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),xT(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const ca={collection:"map",default:!0,nodeClass:Pn,tag:"tag:yaml.org,2002:map",resolve(e,t){return lc(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Pn.from(e,t,n)};class Ci extends dT{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(oa,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=du(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=du(t);if(typeof r!="number")return;const s=this.items[r];return!n&&Ne(s)?s.value:s}has(t){const n=du(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=du(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];Ne(s)&&uT(n)?s.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let s=0;for(const i of this.items)r.push(Ln(i,String(s++),n));return r}toString(t,n,r){return t?xT(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){const l=n instanceof Set?a:String(o++);a=s.call(n,l,a)}i.items.push(Vl(a,void 0,r))}}return i}}function du(e){let t=Ne(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const ua={collection:"seq",default:!0,nodeClass:Ci,tag:"tag:yaml.org,2002:seq",resolve(e,t){return cc(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ci.from(e,t,n)},Zf={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),sv(e,t,n,r)}},qf={identify:e=>e==null,createNode:()=>new ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ae(null),stringify:({source:e},t)=>typeof e=="string"&&qf.test.test(e)?e:t.options.nullStr},ov={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&ov.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function rr({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=t-(i.length-o-1);for(;a-- >0;)i+="0"}return i}const vT={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:rr},wT={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():rr(e)}},bT={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new ae(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:rr},Yf=e=>typeof e=="bigint"||Number.isInteger(e),av=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function kT(e,t,n){const{value:r}=e;return Yf(r)&&r>=0?n+r.toString(t):rr(e)}const _T={identify:e=>Yf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>av(e,2,8,n),stringify:e=>kT(e,8,"0o")},ST={identify:Yf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>av(e,0,10,n),stringify:rr},CT={identify:e=>Yf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>av(e,2,16,n),stringify:e=>kT(e,16,"0x")},XW=[ca,ua,Zf,qf,ov,_T,ST,CT,vT,wT,bT];function wk(e){return typeof e=="bigint"||Number.isInteger(e)}const fu=({value:e})=>JSON.stringify(e),eK=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:fu},{identify:e=>e==null,createNode:()=>new ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:fu},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:fu},{identify:wk,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>wk(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:fu}],tK={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},nK=[ca,ua].concat(eK,tK),lv={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,s,i){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=ae.BLOCK_LITERAL),t!==ae.QUOTE_DOUBLE){const l=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,h=0;f<c;++f,h+=l)u[f]=a.substr(h,l);a=u.join(t===ae.BLOCK_LITERAL?`
|
|
116
|
+
`:" ")}return sv({comment:e,type:t,value:a},r,s,i)}};function jT(e,t){if(cc(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Ye(r)){if(lc(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new Mt(new ae(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
|
|
117
|
+
${s.key.commentBefore}`:r.commentBefore),r.comment){const i=s.value??s.key;i.comment=i.comment?`${r.comment}
|
|
118
|
+
${i.comment}`:r.comment}r=s}e.items[n]=Ye(r)?r:new Mt(r)}}else t("Expected a sequence for this tag");return e}function ET(e,t,n){const{replacer:r}=n,s=new Ci(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(i++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;s.items.push(iv(a,l,n))}return s}const cv={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:jT,createNode:ET};class Po extends Ci{constructor(){super(),this.add=Pn.prototype.add.bind(this),this.delete=Pn.prototype.delete.bind(this),this.get=Pn.prototype.get.bind(this),this.has=Pn.prototype.has.bind(this),this.set=Pn.prototype.set.bind(this),this.tag=Po.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let i,o;if(Ye(s)?(i=Ln(s.key,"",n),o=Ln(s.value,i,n)):i=Ln(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(t,n,r){const s=ET(t,n,r),i=new this;return i.items=s.items,i}}Po.tag="tag:yaml.org,2002:omap";const uv={collection:"seq",identify:e=>e instanceof Map,nodeClass:Po,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=jT(e,t),r=[];for(const{key:s}of n.items)Ne(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Po,n)},createNode:(e,t,n)=>Po.from(e,t,n)};function PT({value:e,source:t},n){return t&&(e?TT:NT).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const TT={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ae(!0),stringify:PT},NT={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ae(!1),stringify:PT},rK={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:rr},sK={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():rr(e)}},iK={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new ae(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:rr},uc=e=>typeof e=="bigint"||Number.isInteger(e);function Jf(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return s==="-"?BigInt(-1)*o:o}const i=parseInt(e,n);return s==="-"?-1*i:i}function dv(e,t,n){const{value:r}=e;if(uc(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return rr(e)}const oK={identify:uc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Jf(e,2,2,n),stringify:e=>dv(e,2,"0b")},aK={identify:uc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Jf(e,1,8,n),stringify:e=>dv(e,8,"0")},lK={identify:uc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Jf(e,0,10,n),stringify:rr},cK={identify:uc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Jf(e,2,16,n),stringify:e=>dv(e,16,"0x")};class To extends Pn{constructor(t){super(t),this.tag=To.tag}add(t){let n;Ye(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Mt(t.key,null):n=new Mt(t,null),di(this.items,n.key)||this.items.push(n)}get(t,n){const r=di(this.items,t);return!n&&Ye(r)?Ne(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=di(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Mt(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(iv(o,null,r));return i}}To.tag="tag:yaml.org,2002:set";const fv={collection:"map",identify:e=>e instanceof Set,nodeClass:To,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>To.from(e,t,n),resolve(e,t){if(lc(e)){if(e.hasAllNullValues(!0))return Object.assign(new To,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function hv(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=o=>t?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*i:i}function IT(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return rr(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const AT={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>hv(e,n),stringify:IT},RT={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>hv(e,!1),stringify:IT},Qf={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Qf.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,r-1,s,i||0,o||0,a||0,l);const u=t[8];if(u&&u!=="Z"){let f=hv(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},bk=[ca,ua,Zf,qf,TT,NT,oK,aK,lK,cK,rK,sK,iK,lv,zr,uv,cv,fv,AT,RT,Qf],kk=new Map([["core",XW],["failsafe",[ca,ua,Zf]],["json",nK],["yaml11",bk],["yaml-1.1",bk]]),_k={binary:lv,bool:ov,float:bT,floatExp:wT,floatNaN:vT,floatTime:RT,int:ST,intHex:CT,intOct:_T,intTime:AT,map:ca,merge:zr,null:qf,omap:uv,pairs:cv,seq:ua,set:fv,timestamp:Qf},uK={"tag:yaml.org,2002:binary":lv,"tag:yaml.org,2002:merge":zr,"tag:yaml.org,2002:omap":uv,"tag:yaml.org,2002:pairs":cv,"tag:yaml.org,2002:set":fv,"tag:yaml.org,2002:timestamp":Qf};function Pp(e,t,n){const r=kk.get(t);if(r&&!e)return n&&!r.includes(zr)?r.concat(zr):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(kk.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(zr)),s.reduce((i,o)=>{const a=typeof o=="string"?_k[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(_k).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}const dK=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;let fK=class LT{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Pp(t,"compat"):t?Pp(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?uK:{},this.tags=Pp(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Ps,{value:ca}),Object.defineProperty(this,kr,{value:Zf}),Object.defineProperty(this,oa,{value:ua}),this.sortMapEntries=typeof o=="function"?o:o===!0?dK:null}clone(){const t=Object.create(LT.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function hK(e,t){var l;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=hT(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const c=i(e.commentBefore);n.unshift($r(c,""))}let o=!1,a=null;if(e.contents){if(Ze(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push($r(f,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const c=a?void 0:()=>o=!0;let u=Zo(e.contents,s,()=>a=null,c);a&&(u+=ui(u,"",i(a))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}else n.push(Zo(e.contents,s));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const c=i(e.comment);c.includes(`
|
|
119
|
+
`)?(n.push("..."),n.push($r(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push($r(i(c),"")))}return n.join(`
|
|
120
|
+
`)+`
|
|
121
|
+
`}class dc{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Dn,{value:Ig});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Nt({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(dc.prototype,{[Dn]:{value:Ig}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ze(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Hi(this.contents)&&this.contents.add(t)}addIn(t,n){Hi(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=lT(this);t.anchor=!n||r.has(n)?cT(n||"a",r):n}return new rv(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const x=v=>typeof v=="number"||v instanceof String||v instanceof Number,y=n.filter(x).map(String);y.length>0&&(n=n.concat(y)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=FW(this,o||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:s,schema:this.schema,sourceObjects:p},g=Vl(t,u,m);return a&&He(g)&&(g.flow=!0),h(),g}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new Mt(s,i)}delete(t){return Hi(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ha(t)?this.contents==null?!1:(this.contents=null,!0):Hi(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return He(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ha(t)?!n&&Ne(this.contents)?this.contents.value:this.contents:He(this.contents)?this.contents.getIn(t,n):void 0}has(t){return He(this.contents)?this.contents.has(t):!1}hasIn(t){return Ha(t)?this.contents!==void 0:He(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Qd(this.schema,[t],n):Hi(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ha(t)?this.contents=n:this.contents==null?this.contents=Qd(this.schema,Array.from(t),n):Hi(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Nt({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Nt({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new fK(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=Ln(this.contents,n??"",a);if(typeof i=="function")for(const{count:c,res:u}of a.anchors.values())i(u,c);return typeof o=="function"?go(o,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return hK(this,t)}}function Hi(e){if(He(e))return!0;throw new Error("Expected a YAML collection as document contents")}class MT extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Ga extends MT{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class pK extends MT{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const Sk=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const a=Math.min(i-39,o.length-79);o="…"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,i))){let a=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
122
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=n.linePos[1];(l==null?void 0:l.line)===r&&l.col>s&&(a=Math.max(1,Math.min(l.col-s,80-i)));const c=" ".repeat(i)+"^".repeat(a);n.message+=`:
|
|
123
|
+
|
|
124
|
+
${o}
|
|
125
|
+
${c}
|
|
126
|
+
`}};function qo(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,f="",h="",p=!1,m=!1,g=null,x=null,y=null,v=null,w=null,k=null,_=null;for(const E of e)switch(m&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&i(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(c&&E.type!=="comment"&&E.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),E.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&E.source.includes(" ")&&(g=E),u=!0;break;case"comment":{u||i(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const T=E.source.substring(1)||" ";f?f+=h+T:f=T,h="",c=!1;break}case"newline":c?f?f+=E.source:(!k||n!=="seq-item-ind")&&(l=!0):h+=E.source,c=!0,p=!0,(x||y)&&(v=E),u=!0;break;case"anchor":x&&i(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&i(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),x=E,_??(_=E.offset),c=!1,u=!1,m=!0;break;case"tag":{y&&i(E,"MULTIPLE_TAGS","A node can have at most one tag"),y=E,_??(_=E.offset),c=!1,u=!1,m=!0;break}case n:(x||y)&&i(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),k&&i(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),k=E,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){w&&i(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=E,c=!1,u=!1;break}default:i(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),c=!1,u=!1}const S=e[e.length-1],j=S?S.offset+S.source.length:s;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(c&&g.indent<=o||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:k,spaceBefore:l,comment:f,hasNewline:p,anchor:x,tag:y,newlineAfterProp:v,end:j,start:_??j}}function Ul(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
127
|
+
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Ul(t.key)||Ul(t.value))return!0}return!1;default:return!0}}function Mg(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Ul(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function $T(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,o)=>i===o||Ne(i)&&Ne(o)&&i.value===o.value;return t.some(i=>s(i.key,n))}const Ck="All mapping items must start at the same column";function mK({composeNode:e,composeEmptyNode:t},n,r,s,i){var u;const o=(i==null?void 0:i.nodeClass)??Pn,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,c=null;for(const f of r.items){const{start:h,key:p,sep:m,value:g}=f,x=qo(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0}),y=!x.found;if(y){if(p&&(p.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&s(l,"BAD_INDENT",Ck)),!x.anchor&&!x.tag&&!m){c=x.end,x.comment&&(a.comment?a.comment+=`
|
|
128
|
+
`+x.comment:a.comment=x.comment);continue}(x.newlineAfterProp||Ul(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((u=x.found)==null?void 0:u.indent)!==r.indent&&s(l,"BAD_INDENT",Ck);n.atKey=!0;const v=x.end,w=p?e(n,p,x,s):t(n,v,h,null,x,s);n.schema.compat&&Mg(r.indent,p,s),n.atKey=!1,$T(n,a.items,w)&&s(v,"DUPLICATE_KEY","Map keys must be unique");const k=qo(m??[],{indicator:"map-value-ind",next:g,offset:w.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=k.end,k.found){y&&((g==null?void 0:g.type)==="block-map"&&!k.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&x.start<k.found.offset-1024&&s(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const _=g?e(n,g,k,s):t(n,l,m,null,k,s);n.schema.compat&&Mg(r.indent,g,s),l=_.range[2];const S=new Mt(w,_);n.options.keepSourceTokens&&(S.srcToken=f),a.items.push(S)}else{y&&s(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(w.comment?w.comment+=`
|
|
129
|
+
`+k.comment:w.comment=k.comment);const _=new Mt(w);n.options.keepSourceTokens&&(_.srcToken=f),a.items.push(_)}}return c&&c<l&&s(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,l,c??l],a}function gK({composeNode:e,composeEmptyNode:t},n,r,s,i){const o=(i==null?void 0:i.nodeClass)??Ci,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=r.offset,c=null;for(const{start:u,value:f}of r.items){const h=qo(u,{indicator:"seq-item-ind",next:f,offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)(f==null?void 0:f.type)==="block-seq"?s(h.end,"BAD_INDENT","All sequence items must start at the same column"):s(l,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(a.comment=h.comment);continue}const p=f?e(n,f,h,s):t(n,h.end,u,null,h,s);n.schema.compat&&Mg(r.indent,f,s),l=p.range[2],a.items.push(p)}return a.range=[r.offset,l,c??l],a}function fc(e,t,n,r){let s="";if(e){let i=!1,o="";for(const a of e){const{source:l,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const u=l.substring(1)||" ";s?s+=o+u:s=u,o="";break}case"newline":s&&(o+=l),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:s,offset:t}}const Tp="Block collections are not allowed within flow collections",Np=e=>e&&(e.type==="block-map"||e.type==="block-seq");function yK({composeNode:e,composeEmptyNode:t},n,r,s,i){var x;const o=r.start.source==="{",a=o?"flow map":"flow sequence",l=(i==null?void 0:i.nodeClass)??(o?Pn:Ci),c=new l(n.schema);c.flow=!0;const u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let y=0;y<r.items.length;++y){const v=r.items[y],{start:w,key:k,sep:_,value:S}=v,j=qo(w,{flow:a,indicator:"explicit-key-ind",next:k??(_==null?void 0:_[0]),offset:f,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!j.found){if(!j.anchor&&!j.tag&&!_&&!S){y===0&&j.comma?s(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):y<r.items.length-1&&s(j.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),j.comment&&(c.comment?c.comment+=`
|
|
130
|
+
`+j.comment:c.comment=j.comment),f=j.end;continue}!o&&n.options.strict&&Ul(k)&&s(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0)j.comma&&s(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(j.comma||s(j.start,"MISSING_CHAR",`Missing , between ${a} items`),j.comment){let E="";e:for(const T of w)switch(T.type){case"comma":case"space":break;case"comment":E=T.source.substring(1);break e;default:break e}if(E){let T=c.items[c.items.length-1];Ye(T)&&(T=T.value??T.key),T.comment?T.comment+=`
|
|
131
|
+
`+E:T.comment=E,j.comment=j.comment.substring(E.length+1)}}if(!o&&!_&&!j.found){const E=S?e(n,S,j,s):t(n,j.end,_,null,j,s);c.items.push(E),f=E.range[2],Np(S)&&s(E.range,"BLOCK_IN_FLOW",Tp)}else{n.atKey=!0;const E=j.end,T=k?e(n,k,j,s):t(n,E,w,null,j,s);Np(k)&&s(T.range,"BLOCK_IN_FLOW",Tp),n.atKey=!1;const P=qo(_??[],{flow:a,indicator:"map-value-ind",next:S,offset:T.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(P.found){if(!o&&!j.found&&n.options.strict){if(_)for(const L of _){if(L===P.found)break;if(L.type==="newline"){s(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}j.start<P.found.offset-1024&&s(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&((x=S.source)==null?void 0:x[0])===":"?s(S,"MISSING_CHAR",`Missing space after : in ${a}`):s(P.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const N=S?e(n,S,P,s):P.found?t(n,P.end,_,null,P,s):null;N?Np(S)&&s(N.range,"BLOCK_IN_FLOW",Tp):P.comment&&(T.comment?T.comment+=`
|
|
132
|
+
`+P.comment:T.comment=P.comment);const R=new Mt(T,N);if(n.options.keepSourceTokens&&(R.srcToken=v),o){const L=c;$T(n,L.items,T)&&s(E,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(R)}else{const L=new Pn(n.schema);L.flow=!0,L.items.push(R);const I=(N??T).range;L.range=[T.range[0],I[1],I[2]],c.items.push(L)}f=N?N.range[2]:P.end}}const h=o?"}":"]",[p,...m]=r.end;let g=f;if((p==null?void 0:p.source)===h)g=p.offset+p.source.length;else{const y=a[0].toUpperCase()+a.substring(1),v=u?`${y} must end with a ${h}`:`${y} in block collection must be sufficiently indented and end with a ${h}`;s(f,u?"MISSING_CHAR":"BAD_INDENT",v),p&&p.source.length!==1&&m.unshift(p)}if(m.length>0){const y=fc(m,g,n.options.strict,s);y.comment&&(c.comment?c.comment+=`
|
|
133
|
+
`+y.comment:c.comment=y.comment),c.range=[r.offset,g,y.offset]}else c.range=[r.offset,g,g];return c}function Ip(e,t,n,r,s,i){const o=n.type==="block-map"?mK(e,t,n,r,i):n.type==="block-seq"?gK(e,t,n,r,i):yK(e,t,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function xK(e,t,n,r,s){var h;const i=r.tag,o=i?t.directives.tagName(i.source,p=>s(i,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){const{anchor:p,newlineAfterProp:m}=r,g=p&&i?p.offset>i.offset?p:i:p??i;g&&(!m||m.offset<g.offset)&&s(g,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===Pn.tagName&&a==="map"||o===Ci.tagName&&a==="seq")return Ip(e,t,n,s,o);let l=t.schema.tags.find(p=>p.tag===o&&p.collection===a);if(!l){const p=t.schema.knownTags[o];if((p==null?void 0:p.collection)===a)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ip(e,t,n,s,o)}const c=Ip(e,t,n,s,o,l),u=((h=l.resolve)==null?void 0:h.call(l,c,p=>s(i,"TAG_RESOLVE_FAILED",p),t.options))??c,f=Ze(u)?u:new ae(u);return f.range=c.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}function vK(e,t,n){const r=t.offset,s=wK(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?ae.BLOCK_FOLDED:ae.BLOCK_LITERAL,o=t.source?bK(t.source):[];let a=o.length;for(let g=o.length-1;g>=0;--g){const x=o[g][1];if(x===""||x==="\r")a=g;else break}if(a===0){const g=s.chomp==="+"&&o.length>0?`
|
|
134
|
+
`.repeat(Math.max(1,o.length-1)):"";let x=r+s.length;return t.source&&(x+=t.source.length),{value:g,type:i,comment:s.comment,range:[r,x,x]}}let l=t.indent+s.indent,c=t.offset+s.length,u=0;for(let g=0;g<a;++g){const[x,y]=o[g];if(y===""||y==="\r")s.indent===0&&x.length>l&&(l=x.length);else{x.length<l&&n(c+x.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(l=x.length),u=g,l===0&&!e.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=x.length+y.length+1}for(let g=o.length-1;g>=a;--g)o[g][0].length>l&&(a=g+1);let f="",h="",p=!1;for(let g=0;g<u;++g)f+=o[g][0].slice(l)+`
|
|
135
|
+
`;for(let g=u;g<a;++g){let[x,y]=o[g];c+=x.length+y.length+1;const v=y[y.length-1]==="\r";if(v&&(y=y.slice(0,-1)),y&&x.length<l){const k=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(c-y.length-(v?2:1),"BAD_INDENT",k),x=""}i===ae.BLOCK_LITERAL?(f+=h+x.slice(l)+y,h=`
|
|
136
|
+
`):x.length>l||y[0]===" "?(h===" "?h=`
|
|
137
|
+
`:!p&&h===`
|
|
138
|
+
`&&(h=`
|
|
139
|
+
|
|
140
|
+
`),f+=h+x.slice(l)+y,h=`
|
|
141
|
+
`,p=!0):y===""?h===`
|
|
142
|
+
`?f+=`
|
|
143
|
+
`:h=`
|
|
144
|
+
`:(f+=h+y,h=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)f+=`
|
|
145
|
+
`+o[g][0].slice(l);f[f.length-1]!==`
|
|
146
|
+
`&&(f+=`
|
|
147
|
+
`);break;default:f+=`
|
|
148
|
+
`}const m=r+s.length+t.source.length;return{value:f,type:i,comment:s.comment,range:[r,m,m]}}function wK({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],i=s[0];let o=0,a="",l=-1;for(let h=1;h<s.length;++h){const p=s[h];if(!a&&(p==="-"||p==="+"))a=p;else{const m=Number(p);!o&&m?o=m:l===-1&&(l=e+h)}}l!==-1&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let c=!1,u="",f=s.length;for(let h=1;h<t.length;++h){const p=t[h];switch(p.type){case"space":c=!0;case"newline":f+=p.source.length;break;case"comment":n&&!c&&r(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,u=p.source.substring(1);break;case"error":r(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{const m=`Unexpected token in block scalar header: ${p.type}`;r(p,"UNEXPECTED_TOKEN",m);const g=p.source;g&&typeof g=="string"&&(f+=g.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:f}}function bK(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r!=null&&r[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)i.push([t[o],t[o+1]]);return i}function kK(e,t,n){const{offset:r,type:s,source:i,end:o}=e;let a,l;const c=(h,p,m)=>n(r+h,p,m);switch(s){case"scalar":a=ae.PLAIN,l=_K(i,c);break;case"single-quoted-scalar":a=ae.QUOTE_SINGLE,l=SK(i,c);break;case"double-quoted-scalar":a=ae.QUOTE_DOUBLE,l=CK(i,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const u=r+i.length,f=fc(o,u,t,n);return{value:l,type:a,comment:f.comment,range:[r,u,f.offset]}}function _K(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),DT(e)}function SK(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),DT(e.slice(1,-1)).replace(/''/g,"'")}function DT(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
149
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
150
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let s=r[1],i=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===""?i===`
|
|
151
|
+
`?s+=i:i=`
|
|
152
|
+
`:(s+=i+r[1],i=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(e),s+i+((r==null?void 0:r[1])??"")}function CK(e,t){let n="";for(let r=1;r<e.length-1;++r){const s=e[r];if(!(s==="\r"&&e[r+1]===`
|
|
153
|
+
`))if(s===`
|
|
154
|
+
`){const{fold:i,offset:o}=jK(e,r);n+=i,r=o}else if(s==="\\"){let i=e[++r];const o=EK[i];if(o)n+=o;else if(i===`
|
|
155
|
+
`)for(i=e[r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="\r"&&e[r+1]===`
|
|
156
|
+
`)for(i=e[++r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="x"||i==="u"||i==="U"){const a=i==="x"?2:i==="u"?4:8;n+=PK(e,r+1,a,t),r+=a}else{const a=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(s===" "||s===" "){const i=r;let o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
|
|
157
|
+
`&&!(o==="\r"&&e[r+2]===`
|
|
158
|
+
`)&&(n+=r>i?e.slice(i,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function jK(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
159
|
+
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
160
|
+
`);)r===`
|
|
161
|
+
`&&(n+=`
|
|
162
|
+
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const EK={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
163
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function PK(e,t,n,r){const s=e.substr(t,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{const a=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function OT(e,t,n,r){const{value:s,type:i,comment:o,range:a}=t.type==="block-scalar"?vK(e,t,r):kK(t,e.options.strict,r),l=n?e.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null;let c;e.options.stringKeys&&e.atKey?c=e.schema[kr]:l?c=TK(e.schema,s,l,n,r):t.type==="scalar"?c=NK(e,s,t,r):c=e.schema[kr];let u;try{const f=c.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);u=Ne(f)?f:new ae(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),u=new ae(s)}return u.range=a,u.source=s,i&&(u.type=i),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function TK(e,t,n,r,s){var a;if(n==="!")return e[kr];const i=[];for(const l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)i.push(l);else return l;for(const l of i)if((a=l.test)!=null&&a.test(t))return l;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[kr])}function NK({atKey:e,directives:t,schema:n},r,s,i){const o=n.tags.find(a=>{var l;return(a.default===!0||e&&a.default==="key")&&((l=a.test)==null?void 0:l.test(r))})||n[kr];if(n.compat){const a=n.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(r))})??n[kr];if(o.tag!==a.tag){const l=t.tagString(o.tag),c=t.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;i(s,"TAG_RESOLVE_FAILED",u,!0)}}return o}function IK(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const AK={composeNode:zT,composeEmptyNode:pv};function zT(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:o,anchor:a,tag:l}=n;let c,u=!0;switch(t.type){case"alias":c=RK(e,t,r),(a||l)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=OT(e,t,l,r),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=xK(AK,e,t,n,r),a&&(c.anchor=a.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);r(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=pv(e,t.offset,void 0,null,n,r)),a&&c.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!Ne(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&r(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(c.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?c.comment=o:c.commentBefore=o),e.options.keepSourceTokens&&u&&(c.srcToken=t),c}function pv(e,t,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:l},c){const u={type:"scalar",offset:IK(t,n,r),indent:-1,source:""},f=OT(e,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=l),f}function RK({options:e},{offset:t,source:n,end:r},s){const i=new rv(n.substring(1));i.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,a=fc(r,o,e.strict,s);return i.range=[t,o,a.offset],a.comment&&(i.comment=a.comment),i}function LK(e,t,{offset:n,start:r,value:s,end:i},o){const a=Object.assign({_directives:t},e),l=new dc(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=qo(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?zT(c,s,u,o):pv(c,u.end,r,null,u,o);const f=l.contents.range[2],h=fc(i,f,!1,o);return h.comment&&(l.comment=h.comment),l.range=[n,f,h.offset],l}function Da(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function jk(e){var s;let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const o=e[i];switch(o[0]){case"#":t+=(t===""?"":r?`
|
|
164
|
+
|
|
165
|
+
`:`
|
|
166
|
+
`)+(o.substring(1)||" "),n=!0,r=!1;break;case"%":((s=e[i+1])==null?void 0:s[0])!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class MK{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const o=Da(n);i?this.warnings.push(new pK(o,r,s)):this.errors.push(new Ga(o,r,s))},this.directives=new Nt({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=jk(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
167
|
+
${r}`:r;else if(s||t.directives.docStart||!i)t.commentBefore=r;else if(He(i)&&!i.flow&&i.items.length>0){let o=i.items[0];Ye(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${r}
|
|
168
|
+
${a}`:r}else{const o=i.commentBefore;i.commentBefore=o?`${r}
|
|
169
|
+
${o}`:r}}if(n){for(let i=0;i<this.errors.length;++i)t.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)t.warnings.push(this.warnings[i])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:jk(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const s of t)yield*this.next(s);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,s)=>{const i=Da(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=LK(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new Ga(Da(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Ga(Da(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=fc(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
170
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Ga(Da(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new dc(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const FT="\uFEFF",BT="",VT="",$g="";function $K(e){switch(e){case FT:return"byte-order-mark";case BT:return"doc-mode";case VT:return"flow-error-end";case $g:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
171
|
+
`:case`\r
|
|
172
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Hn(e){switch(e){case void 0:case" ":case`
|
|
173
|
+
`:case"\r":case" ":return!0;default:return!1}}const Ek=new Set("0123456789ABCDEFabcdef"),DK=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),hu=new Set(",[]{}"),OK=new Set(` ,[]{}
|
|
174
|
+
\r `),Ap=e=>!e||OK.has(e);class zK{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
175
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
176
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const s=this.buffer[r+t+1];if(s===`
|
|
177
|
+
`||!s&&!this.atEnd)return t+r+1}return n===`
|
|
178
|
+
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Hn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
179
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===FT&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const i=t[r-1];if(i===" "||i===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const i=t[n-1];if(i===" "||i===" ")n-=1;else break}const s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield BT,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&Hn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Hn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Hn(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Ap),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&Hn(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield VT,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Ap),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Hn(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let s=r.indexOf(`
|
|
180
|
+
`,this.pos);if(s!==-1){for(;s!==-1;){const i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
|
|
181
|
+
`,i)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Hn(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case`
|
|
182
|
+
`:t=i,n=0;break;case"\r":{const o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
183
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(`
|
|
184
|
+
`,i)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
185
|
+
`;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let i=t-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);const a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
|
|
186
|
+
`&&i>=this.pos&&i+1+n>a)t=i;else break}while(!0);return yield $g,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(Hn(i)||t&&hu.has(i))break;n=r}else if(Hn(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
|
|
187
|
+
`?(r+=1,s=`
|
|
188
|
+
`,i=this.buffer[r+1]):n=r),i==="#"||t&&hu.has(i))break;if(s===`
|
|
189
|
+
`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&hu.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield $g,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Ap),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(Hn(r)||n&&hu.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Hn(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(DK.has(n))n=this.buffer[++t];else if(n==="%"&&Ek.has(this.buffer[t+1])&&Ek.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
190
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
191
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class FK{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const i=n+r>>1;this.lineStarts[i]<t?n=i+1:r=i}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const s=this.lineStarts[n-1];return{line:n,col:t-s+1}}}}function ls(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Pk(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function UT(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function pu(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Gi(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function ef(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Tk(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!ls(t.start,"explicit-key-ind")&&!ls(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,UT(t.value)?t.value.end?ef(t.value.end,t.sep):t.value.end=t.sep:ef(t.start,t.sep),delete t.sep)}class BK{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new zK,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=$K(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Tk(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Pk(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Pk(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=pu(this.peek(2)),r=Gi(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
192
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
193
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){ef(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,i=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(i&&n.sep&&!n.value){const a=[];for(let l=0;l<n.sep.length;++l){const c=n.sep[l];switch(c.type){case"newline":a.push(l);break;case"space":break;case"comment":c.indent>t.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ls(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(UT(n.key)&&!ls(n.sep,"newline")){const a=Gi(n.start),l=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(ls(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const a=Gi(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:o,key:null,sep:[this.sourceToken]}):ls(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);i||n.value?(t.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(t);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ls(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){ef(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ls(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=pu(r),i=Gi(s);Tk(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
194
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
195
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=pu(t),r=Gi(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=pu(t),r=Gi(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function VK(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new FK||null,prettyErrors:t}}function UK(e,t={}){const{lineCounter:n,prettyErrors:r}=VK(t),s=new BK(n==null?void 0:n.addNewLine),i=new MK(t);let o=null;for(const a of i.compose(s.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Ga(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Sk(e,n)),o.warnings.forEach(Sk(e,n))),o}function WK(e,t,n){let r;const s=UK(e,n);if(!s)return null;if(s.warnings.forEach(i=>pT(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function KK(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return ac(e)&&!r?e.toString(n):new dc(e,r,n).toString(n)}function Nk(e,t){return e.toFixed(t).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function Xf(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 HK(e){const t=e.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(!t||!t[1]&&!t[2]&&!t[3])return null;const n=Number(t[1]??0),r=Number(t[2]??0),s=Number(t[3]??0);return(n*3600+r*60+s)*1e3}function Rr(e){return e>=1e6?`${Nk(e/1e6,1)}M`:e>=1e3?`${Nk(e/1e3,1)}k`:`${Math.round(e)}`}function Ik(e){const t=e.match(/^([\d.]+)([kM]?)$/);if(!t)return 0;const n=Number(t[1]);return Number.isFinite(n)?t[2]==="M"?Math.round(n*1e6):t[2]==="k"?Math.round(n*1e3):Math.round(n):0}function GK(e){return`${Rr(e.inputTokens+e.outputTokens)} tokens · ${Xf(e.durationMs)}${e.attempts>1?` ×${e.attempts}`:""}${e.model?` · ${e.model}`:""}`}function ZK(e){const t=[Xf(e.durationMs),`${Rr(e.inputTokens)} in`,`${Rr(e.outputTokens)} out`];return e.model&&t.push(e.model),e.attempts>1&&t.push(`×${e.attempts}`),t.join(" · ")}function qK(e){const t=e.split("·").map(s=>s.trim()).filter(Boolean);if(t.length===0)return;const n=HK(t[0]);if(n===null)return;const r={durationMs:n,inputTokens:0,outputTokens:0,attempts:1};for(const s of t.slice(1)){const i=s.match(/^(.+)\s+in$/),o=s.match(/^(.+)\s+out$/),a=s.match(/^×(\d+)$/);i?r.inputTokens=Ik(i[1]):o?r.outputTokens=Ik(o[1]):a?r.attempts=Number(a[1]):r.model=s}return r}function YK(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 WT=/^#{2,3}\s+/,tf=/^[-*]\s+\[([ xX])\]\s+(.*)$/,JK=/^\[(review|manual|issue)\]\s+(.*)$/,QK=/^run:\s*(.+)$/,Ak=/^-\s+(\d{4}-\d{2}-\d{2}):\s*(.*)$/,XK=/^\[(?:phase:(\d+)|body)\]\s+(?:\[(decision|question)\]\s+)?(.*)$/,Rk=/^-\s+\[([ xX])\]\s+(?:(\d{4}-\d{2}-\d{2})\s+)?\[(log|clarification|review|note|decision|question|chat)\]\s+(\[agent\]\s+)?(.*)$/,eH=["note","decision","question"];function mv(e,t,n,r){const s=[];let i=t;for(;i<n;){const o=e[i];if(o.trim()===""||!/^\s/.test(o))break;const a=o.trimStart();if(r.test(a)||WT.test(a))break;s.push(a),i++}return{text:s.join(" "),next:i}}function gv(e,t){return t?`${e.trim()} ${t}`:e.trim()}function KT(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(tf);if(i){const o=i[1].toLowerCase()==="x",a=i[2].trim(),l=a.match(JK),c=l?l[2].trim():a,u=l?l[1]:void 0,f=[];let h;for(s++;s<n;){const p=e[s];if(p.trim()===""||tf.test(p)||WT.test(p))break;if(/^\s/.test(p)){const m=p.trimStart(),g=m.match(QK),x=g?qK(g[1]):void 0;x?h=x:f.push(m),s++}else break}r.push({done:o,text:c,description:f.length>0?f.join(`
|
|
196
|
+
`):void 0,source:u,run:h})}else s++}return r}function yv(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(Ak);if(!i){s++;continue}const o=mv(e,s+1,n,Ak);r.push({date:i[1],text:gv(i[2],o.text)}),s=o.next}return r}function HT(e,t){const n=[e];for(const r of t){const s=r.source?`[${r.source}] ${r.text}`:r.text;if(n.push(`- [${r.done?"x":" "}] ${s}`),r.description)for(const i of r.description.split(`
|
|
197
|
+
`))n.push(` ${i}`);r.run&&n.push(` run: ${ZK(r.run)}`)}return n}function xv(e,t){return[e,...t.map(n=>`- ${n.date}: ${n.text}`)]}function tH(e){return e.kind==="phase"?`[phase:${e.index}]`:"[body]"}function nH(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(tf),o=i?i[2].trim().match(XK):null;if(!i||!o){s++;continue}const a=o[1]?{kind:"phase",index:Number(o[1])}:{kind:"body"},l=o[2],c=mv(e,s+1,n,tf);r.push({anchor:a,prose:gv(o[3],c.text),state:i[1].toLowerCase()==="x"?"resolved":"open",...l?{kind:l}:{}}),s=c.next}return r}function rH(e){const t=["### Notes"];for(const n of e){const r=n.kind&&n.kind!=="note"?`[${n.kind}] `:"";t.push(`- [${n.state==="resolved"?"x":" "}] ${tH(n.anchor)} ${r}${n.prose}`)}return t}const GT={headingRe:/^#{2,3}\s+Phases\s*$/i,parseEntries:KT,formatLines:e=>HT("### Phases",e)},ZT={headingRe:/^#{2,3}\s+Fixes\s*$/i,parseEntries:KT,formatLines:e=>HT("### Fixes",e)},sH={headingRe:/^#{2,3}\s+Log\s*$/i,parseEntries:yv,formatLines:e=>xv("### Log",e)},iH={headingRe:/^#{2,3}\s+Clarifications\s*$/i,parseEntries:yv,formatLines:e=>xv("### Clarifications",e)},oH={headingRe:/^#{2,3}\s+Notes\s*$/i,parseEntries:nH,formatLines:rH},aH={headingRe:/^#{2,3}\s+Review\s*$/i,parseEntries:yv,formatLines:e=>xv("### Review",e)};function lH(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(Rk);if(!i){s++;continue}const o=i[3],a=mv(e,s+1,n,Rk),l={kind:o,text:gv(i[5],a.text)};i[2]&&(l.date=i[2]),i[4]&&(l.from="agent"),eH.includes(o)&&(l.state=i[1].toLowerCase()==="x"?"resolved":"open"),r.push(l),s=a.next}return r}function cH(e){const t=["### Thread"];for(const n of e){const r=n.state?n.state==="resolved":!0,s=n.date?`${n.date} `:"",i=n.from==="agent"?"[agent] ":"";t.push(`- [${r?"x":" "}] ${s}[${n.kind}] ${i}${n.text}`)}return t}const qT={headingRe:/^#{2,3}\s+Thread\s*$/i,parseEntries:lH,formatLines:cH};var Lk;function B(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=o.prototype,u=Object.keys(c);for(let f=0;f<u.length;f++){const h=u[f];h in a||(a[h]=c[h].bind(a))}}const s=(n==null?void 0:n.Parent)??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function o(a){var l;const c=n!=null&&n.Parent?new i:this;r(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>{var l,c;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(c=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:c.has(e)}}),Object.defineProperty(o,"name",{value:e}),o}class No extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class YT extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Lk=globalThis).__zod_globalConfig??(Lk.__zod_globalConfig={});const vv=globalThis.__zod_globalConfig;function ji(e){return vv}function JT(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function Dg(e,t){return typeof t=="bigint"?t.toString():t}function wv(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function bv(e){return e==null}function kv(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function uH(e,t){const n=e/t,r=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}const Mk=Symbol("evaluating");function be(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Mk)return r===void 0&&(r=Mk,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Ri(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Bs(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function $k(e){return JSON.stringify(e)}function dH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const QT="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function nf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const fH=wv(()=>{var e;if(vv.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Wl(e){if(nf(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(nf(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function XT(e){return Wl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const hH=new Set(["string","number","symbol"]);function eh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function Y(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function pH(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const mH={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function gH(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=Bs(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return Ri(this,"shape",o),o},checks:[]});return Vs(e,i)}function yH(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Bs(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return Ri(this,"shape",o),o},checks:[]});return Vs(e,i)}function xH(e,t){if(!Wl(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(i,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Bs(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Ri(this,"shape",i),i}});return Vs(e,s)}function vH(e,t){if(!Wl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Bs(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Ri(this,"shape",r),r}});return Vs(e,n)}function wH(e,t){var r;if((r=e._zod.def.checks)!=null&&r.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Bs(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return Ri(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Vs(e,n)}function bH(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Bs(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return Ri(this,"shape",l),l},checks:[]});return Vs(t,o)}function kH(e,t,n){const r=Bs(t._zod.def,{get shape(){const s=t._zod.def.shape,i={...s};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)i[o]=new e({type:"nonoptional",innerType:s[o]});return Ri(this,"shape",i),i}});return Vs(t,r)}function xo(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function _H(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function eN(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function mu(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ei(e,t,n){var l,c,u,f,h,p;const r=e.message?e.message:mu((u=(c=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:c.error)==null?void 0:u.call(c,e))??mu((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??mu((h=n.customError)==null?void 0:h.call(n,e))??mu((p=n.localeError)==null?void 0:p.call(n,e))??"Invalid input",{inst:s,continue:i,input:o,...a}=e;return a.path??(a.path=[]),a.message=r,t!=null&&t.reportInput&&(a.input=o),a}function _v(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Kl(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const tN=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Dg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},nN=B("$ZodError",tN),rN=B("$ZodError",tN,{Parent:Error});function SH(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function CH(e,t=n=>n.message){const n={_errors:[]},r=(s,i=[])=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a},[...i,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...i,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...i,...o.path]);else{const a=[...i,...o.path];if(a.length===0)n._errors.push(t(o));else{let l=n,c=0;for(;c<a.length;){const u=a[c];c===a.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(t(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}}};return r(e),n}const Sv=e=>(t,n,r,s)=>{const i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new No;if(o.issues.length){const a=new((s==null?void 0:s.Err)??e)(o.issues.map(l=>Ei(l,i,ji())));throw QT(a,s==null?void 0:s.callee),a}return o.value},Cv=e=>async(t,n,r,s)=>{const i=r?{...r,async:!0}:{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new((s==null?void 0:s.Err)??e)(o.issues.map(l=>Ei(l,i,ji())));throw QT(a,s==null?void 0:s.callee),a}return o.value},th=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new No;return i.issues.length?{success:!1,error:new(e??nN)(i.issues.map(o=>Ei(o,s,ji())))}:{success:!0,data:i.value}},jH=th(rN),nh=e=>async(t,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(o=>Ei(o,s,ji())))}:{success:!0,data:i.value}},EH=nh(rN),PH=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Sv(e)(t,n,s)},TH=e=>(t,n,r)=>Sv(e)(t,n,r),NH=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Cv(e)(t,n,s)},IH=e=>async(t,n,r)=>Cv(e)(t,n,r),AH=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return th(e)(t,n,s)},RH=e=>(t,n,r)=>th(e)(t,n,r),LH=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return nh(e)(t,n,s)},MH=e=>async(t,n,r)=>nh(e)(t,n,r),$H=/^[cC][0-9a-z]{6,}$/,DH=/^[0-9a-z]+$/,OH=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zH=/^[0-9a-vA-V]{20}$/,FH=/^[A-Za-z0-9]{27}$/,BH=/^[a-zA-Z0-9_-]{21}$/,VH=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,UH=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Dk=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,WH=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,KH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function HH(){return new RegExp(KH,"u")}const GH=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ZH=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,qH=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,YH=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,JH=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sN=/^[A-Za-z0-9_-]*$/,QH=/^https?$/,XH=/^\+[1-9]\d{6,14}$/,iN="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",eG=new RegExp(`^${iN}$`);function oN(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tG(e){return new RegExp(`^${oN(e)}$`)}function nG(e){const t=oN({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${iN}T(?:${r})$`)}const rG=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},sG=/^-?\d+$/,iG=/^-?\d+(?:\.\d+)?$/,oG=/^(?:true|false)$/i,aG=/^[^A-Z]*$/,lG=/^[^a-z]*$/,Jt=B("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),aN={number:"number",bigint:"bigint",object:"date"},lN=B("$ZodCheckLessThan",(e,t)=>{Jt.init(e,t);const n=aN[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cN=B("$ZodCheckGreaterThan",(e,t)=>{Jt.init(e,t);const n=aN[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cG=B("$ZodCheckMultipleOf",(e,t)=>{Jt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):uH(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),uG=B("$ZodCheckNumberFormat",(e,t)=>{var o;Jt.init(e,t),t.format=t.format||"float64";const n=(o=t.format)==null?void 0:o.includes("int"),r=n?"int":"number",[s,i]=mH[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=s,l.maximum=i,n&&(l.pattern=sG)}),e._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}l<s&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),l>i&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),dG=B("$ZodCheckMaxLength",(e,t)=>{var n;Jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!bv(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const o=_v(s);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),fG=B("$ZodCheckMinLength",(e,t)=>{var n;Jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!bv(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const o=_v(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),hG=B("$ZodCheckLengthEquals",(e,t)=>{var n;Jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!bv(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,i=s.length;if(i===t.length)return;const o=_v(s),a=i>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),rh=B("$ZodCheckStringFormat",(e,t)=>{var n,r;Jt.init(e,t),e._zod.onattach.push(s=>{const i=s._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),pG=B("$ZodCheckRegex",(e,t)=>{rh.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),mG=B("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=aG),rh.init(e,t)}),gG=B("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=lG),rh.init(e,t)}),yG=B("$ZodCheckIncludes",(e,t)=>{Jt.init(e,t);const n=eh(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),xG=B("$ZodCheckStartsWith",(e,t)=>{Jt.init(e,t);const n=new RegExp(`^${eh(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),vG=B("$ZodCheckEndsWith",(e,t)=>{Jt.init(e,t);const n=new RegExp(`.*${eh(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),wG=B("$ZodCheckOverwrite",(e,t)=>{Jt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class bG{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
198
|
+
`).filter(o=>o),s=Math.min(...r.map(o=>o.length-o.trimStart().length)),i=r.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of i)this.content.push(o)}compile(){const t=Function,n=this==null?void 0:this.args,s=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new t(...n,s.join(`
|
|
199
|
+
`))}}const kG={major:4,minor:4,patch:3},Qe=B("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=kG;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const o of i._zod.onattach)o(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const i=(a,l,c)=>{let u=xo(a),f;for(const h of l){if(h._zod.def.when){if(_H(a)||!h._zod.def.when(a))continue}else if(u)continue;const p=a.issues.length,m=h._zod.check(a);if(m instanceof Promise&&(c==null?void 0:c.async)===!1)throw new No;if(f||m instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await m,a.issues.length!==p&&(u||(u=xo(a,p)))});else{if(a.issues.length===p)continue;u||(u=xo(a,p))}}return f?f.then(()=>a):a},o=(a,l,c)=>{if(xo(a))return a.aborted=!0,a;const u=i(l,r,c);if(u instanceof Promise){if(c.async===!1)throw new No;return u.then(f=>e._zod.parse(f,c))}return e._zod.parse(u,c)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){const u=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(f=>o(f,a,l)):o(u,a,l)}const c=e._zod.parse(a,l);if(c instanceof Promise){if(l.async===!1)throw new No;return c.then(u=>i(u,r,l))}return i(c,r,l)}}be(e,"~standard",()=>({validate:i=>{var o;try{const a=jH(e,i);return a.success?{value:a.data}:{issues:(o=a.error)==null?void 0:o.issues}}catch{return EH(e,i).then(l=>{var c;return l.success?{value:l.data}:{issues:(c=l.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}))}),jv=B("$ZodString",(e,t)=>{var n;Qe.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??rG(e._zod.bag),e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),$e=B("$ZodStringFormat",(e,t)=>{rh.init(e,t),jv.init(e,t)}),_G=B("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=UH),$e.init(e,t)}),SG=B("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Dk(r))}else t.pattern??(t.pattern=Dk());$e.init(e,t)}),CG=B("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=WH),$e.init(e,t)}),jG=B("$ZodURL",(e,t)=>{$e.init(e,t),e._zod.check=n=>{var r;try{const s=n.value.trim();if(!t.normalize&&((r=t.protocol)==null?void 0:r.source)===QH.source&&!/^https?:\/\//i.test(s)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const i=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),EG=B("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=HH()),$e.init(e,t)}),PG=B("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=BH),$e.init(e,t)}),TG=B("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$H),$e.init(e,t)}),NG=B("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=DH),$e.init(e,t)}),IG=B("$ZodULID",(e,t)=>{t.pattern??(t.pattern=OH),$e.init(e,t)}),AG=B("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zH),$e.init(e,t)}),RG=B("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=FH),$e.init(e,t)}),LG=B("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=nG(t)),$e.init(e,t)}),MG=B("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=eG),$e.init(e,t)}),$G=B("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=tG(t)),$e.init(e,t)}),DG=B("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=VH),$e.init(e,t)}),OG=B("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=GH),$e.init(e,t),e._zod.bag.format="ipv4"}),zG=B("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ZH),$e.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),FG=B("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=qH),$e.init(e,t)}),BG=B("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=YH),$e.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,i]=r;if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function uN(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const VG=B("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=JH),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{uN(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function UG(e){if(!sN.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return uN(n)}const WG=B("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sN),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{UG(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),KG=B("$ZodE164",(e,t)=>{t.pattern??(t.pattern=XH),$e.init(e,t)});function HG(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const GG=B("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=n=>{HG(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),dN=B("$ZodNumber",(e,t)=>{Qe.init(e,t),e._zod.pattern=e._zod.bag.pattern??iG,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),ZG=B("$ZodNumberFormat",(e,t)=>{uG.init(e,t),dN.init(e,t)}),qG=B("$ZodBoolean",(e,t)=>{Qe.init(e,t),e._zod.pattern=oG,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),YG=B("$ZodUnknown",(e,t)=>{Qe.init(e,t),e._zod.parse=n=>n}),JG=B("$ZodNever",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Ok(e,t,n){e.issues.length&&t.issues.push(...eN(n,e.issues)),t.value[n]=e.value}const QG=B("$ZodArray",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let o=0;o<s.length;o++){const a=s[o],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(c=>Ok(c,n,o))):Ok(l,n,o)}return i.length?Promise.all(i).then(()=>n):n}});function rf(e,t,n,r,s,i){const o=n in r;if(e.issues.length){if(s&&i&&!o)return;t.issues.push(...eN(n,e.issues))}if(!o&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function fN(e){var r,s,i,o;const t=Object.keys(e.shape);for(const a of t)if(!((o=(i=(s=(r=e.shape)==null?void 0:r[a])==null?void 0:s._zod)==null?void 0:i.traits)!=null&&o.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=pH(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function hN(e,t,n,r,s,i){const o=[],a=s.keySet,l=s.catchall._zod,c=l.def.type,u=l.optin==="optional",f=l.optout==="optional";for(const h in t){if(h==="__proto__"||a.has(h))continue;if(c==="never"){o.push(h);continue}const p=l.run({value:t[h],issues:[]},r);p instanceof Promise?e.push(p.then(m=>rf(m,n,h,t,u,f))):rf(p,n,h,t,u,f)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const XG=B("$ZodObject",(e,t)=>{Qe.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const r=wv(()=>fN(t));be(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const u=a[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const f of u.values)l[c].add(f)}}return l});const s=nf,i=t.catchall;let o;e._zod.parse=(a,l)=>{o??(o=r.value);const c=a.value;if(!s(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const u=[],f=o.shape;for(const h of o.keys){const p=f[h],m=p._zod.optin==="optional",g=p._zod.optout==="optional",x=p._zod.run({value:c[h],issues:[]},l);x instanceof Promise?u.push(x.then(y=>rf(y,a,h,c,m,g))):rf(x,a,h,c,m,g)}return i?hN(u,c,a,l,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),e7=B("$ZodObjectJIT",(e,t)=>{XG.init(e,t);const n=e._zod.parse,r=wv(()=>fN(t)),s=h=>{var w,k;const p=new bG(["shape","payload","ctx"]),m=r.value,g=_=>{const S=$k(_);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");const x=Object.create(null);let y=0;for(const _ of m.keys)x[_]=`key_${y++}`;p.write("const newResult = {};");for(const _ of m.keys){const S=x[_],j=$k(_),E=h[_],T=((w=E==null?void 0:E._zod)==null?void 0:w.optin)==="optional",P=((k=E==null?void 0:E._zod)==null?void 0:k.optout)==="optional";p.write(`const ${S} = ${g(_)};`),T&&P?p.write(`
|
|
200
|
+
if (${S}.issues.length) {
|
|
201
|
+
if (${j} in input) {
|
|
202
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
203
|
+
...iss,
|
|
204
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
205
|
+
})));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (${S}.value === undefined) {
|
|
210
|
+
if (${j} in input) {
|
|
211
|
+
newResult[${j}] = undefined;
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
newResult[${j}] = ${S}.value;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
`):T?p.write(`
|
|
218
|
+
if (${S}.issues.length) {
|
|
219
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
220
|
+
...iss,
|
|
221
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
222
|
+
})));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (${S}.value === undefined) {
|
|
226
|
+
if (${j} in input) {
|
|
227
|
+
newResult[${j}] = undefined;
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
230
|
+
newResult[${j}] = ${S}.value;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
`):p.write(`
|
|
234
|
+
const ${S}_present = ${j} in input;
|
|
235
|
+
if (${S}.issues.length) {
|
|
236
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
237
|
+
...iss,
|
|
238
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
239
|
+
})));
|
|
240
|
+
}
|
|
241
|
+
if (!${S}_present && !${S}.issues.length) {
|
|
242
|
+
payload.issues.push({
|
|
243
|
+
code: "invalid_type",
|
|
244
|
+
expected: "nonoptional",
|
|
245
|
+
input: undefined,
|
|
246
|
+
path: [${j}]
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (${S}_present) {
|
|
251
|
+
if (${S}.value === undefined) {
|
|
252
|
+
newResult[${j}] = undefined;
|
|
253
|
+
} else {
|
|
254
|
+
newResult[${j}] = ${S}.value;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");const v=p.compile();return(_,S)=>v(h,_,S)};let i;const o=nf,a=!vv.jitless,c=a&&fH.value,u=t.catchall;let f;e._zod.parse=(h,p)=>{f??(f=r.value);const m=h.value;return o(m)?a&&c&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(i||(i=s(t.shape)),h=i(h,p),u?hN([],m,h,p,f,e):h):n(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h)}});function zk(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!xo(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>Ei(o,r,ji())))}),t)}const t7=B("$ZodUnion",(e,t)=>{Qe.init(e,t),be(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),be(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),be(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),be(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>kv(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const o=[];for(const a of t.options){const l=a._zod.run({value:r.value,issues:[]},s);if(l instanceof Promise)o.push(l),i=!0;else{if(l.issues.length===0)return l;o.push(l)}}return i?Promise.all(o).then(a=>zk(a,r,e,s)):zk(o,r,e,s)}}),n7=B("$ZodIntersection",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),o=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([l,c])=>Fk(n,l,c)):Fk(n,i,o)}});function Og(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Wl(e)&&Wl(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};for(const i of r){const o=Og(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],o=Og(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Fk(e,t,n){const r=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&s&&e.issues.push({...s,keys:i}),xo(e))return e;const o=Og(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const r7=B("$ZodEnum",(e,t)=>{Qe.init(e,t);const n=JT(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>hH.has(typeof s)).map(s=>typeof s=="string"?eh(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),s7=B("$ZodTransform",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new YT(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n.fallback=!0,n));if(s instanceof Promise)throw new No;return n.value=s,n.fallback=!0,n}});function Bk(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const pN=B("$ZodOptional",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),be(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${kv(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>Bk(o,s)):Bk(i,s)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),i7=B("$ZodExactOptional",(e,t)=>{pN.init(e,t),be(e._zod,"values",()=>t.innerType._zod.values),be(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),o7=B("$ZodNullable",(e,t)=>{Qe.init(e,t),be(e._zod,"optin",()=>t.innerType._zod.optin),be(e._zod,"optout",()=>t.innerType._zod.optout),be(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${kv(n.source)}|null)$`):void 0}),be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),a7=B("$ZodDefault",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Vk(i,t)):Vk(s,t)}});function Vk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const l7=B("$ZodPrefault",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),c7=B("$ZodNonOptional",(e,t)=>{Qe.init(e,t),be(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Uk(i,e)):Uk(s,e)}});function Uk(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const u7=B("$ZodCatch",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",be(e._zod,"optout",()=>t.innerType._zod.optout),be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>Ei(o,r,ji()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>Ei(i,r,ji()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),mN=B("$ZodPipe",(e,t)=>{Qe.init(e,t),be(e._zod,"values",()=>t.in._zod.values),be(e._zod,"optin",()=>t.in._zod.optin),be(e._zod,"optout",()=>t.out._zod.optout),be(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>gu(o,t.in,r)):gu(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>gu(i,t.out,r)):gu(s,t.out,r)}});function gu(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const d7=B("$ZodPreprocess",(e,t)=>{mN.init(e,t)}),f7=B("$ZodReadonly",(e,t)=>{Qe.init(e,t),be(e._zod,"propValues",()=>t.innerType._zod.propValues),be(e._zod,"values",()=>t.innerType._zod.values),be(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),be(e._zod,"optout",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(Wk):Wk(s)}});function Wk(e){return e.value=Object.freeze(e.value),e}const h7=B("$ZodCustom",(e,t)=>{Jt.init(e,t),Qe.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>Kk(i,n,r,e));Kk(s,n,r,e)}});function Kk(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(Kl(s))}}var Hk;class p7{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function m7(){return new p7}(Hk=globalThis).__zod_globalRegistry??(Hk.__zod_globalRegistry=m7());const Za=globalThis.__zod_globalRegistry;function g7(e,t){return new e({type:"string",...Y(t)})}function y7(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Y(t)})}function Gk(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Y(t)})}function x7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Y(t)})}function v7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Y(t)})}function w7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Y(t)})}function b7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Y(t)})}function k7(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Y(t)})}function _7(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Y(t)})}function S7(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Y(t)})}function C7(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Y(t)})}function j7(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Y(t)})}function E7(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Y(t)})}function P7(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Y(t)})}function T7(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Y(t)})}function N7(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Y(t)})}function I7(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Y(t)})}function A7(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Y(t)})}function R7(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Y(t)})}function L7(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Y(t)})}function M7(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Y(t)})}function $7(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Y(t)})}function D7(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Y(t)})}function O7(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Y(t)})}function z7(e,t){return new e({type:"string",format:"date",check:"string_format",...Y(t)})}function F7(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Y(t)})}function B7(e,t){return new e({type:"string",format:"duration",check:"string_format",...Y(t)})}function V7(e,t){return new e({type:"number",checks:[],...Y(t)})}function U7(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Y(t)})}function W7(e,t){return new e({type:"boolean",...Y(t)})}function K7(e){return new e({type:"unknown"})}function H7(e,t){return new e({type:"never",...Y(t)})}function Zk(e,t){return new lN({check:"less_than",...Y(t),value:e,inclusive:!1})}function Rp(e,t){return new lN({check:"less_than",...Y(t),value:e,inclusive:!0})}function qk(e,t){return new cN({check:"greater_than",...Y(t),value:e,inclusive:!1})}function Lp(e,t){return new cN({check:"greater_than",...Y(t),value:e,inclusive:!0})}function Yk(e,t){return new cG({check:"multiple_of",...Y(t),value:e})}function gN(e,t){return new dG({check:"max_length",...Y(t),maximum:e})}function sf(e,t){return new fG({check:"min_length",...Y(t),minimum:e})}function yN(e,t){return new hG({check:"length_equals",...Y(t),length:e})}function G7(e,t){return new pG({check:"string_format",format:"regex",...Y(t),pattern:e})}function Z7(e){return new mG({check:"string_format",format:"lowercase",...Y(e)})}function q7(e){return new gG({check:"string_format",format:"uppercase",...Y(e)})}function Y7(e,t){return new yG({check:"string_format",format:"includes",...Y(t),includes:e})}function J7(e,t){return new xG({check:"string_format",format:"starts_with",...Y(t),prefix:e})}function Q7(e,t){return new vG({check:"string_format",format:"ends_with",...Y(t),suffix:e})}function da(e){return new wG({check:"overwrite",tx:e})}function X7(e){return da(t=>t.normalize(e))}function eZ(){return da(e=>e.trim())}function tZ(){return da(e=>e.toLowerCase())}function nZ(){return da(e=>e.toUpperCase())}function rZ(){return da(e=>dH(e))}function sZ(e,t,n){return new e({type:"array",element:t,...Y(n)})}function iZ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Y(n)})}function oZ(e,t){const n=aZ(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(Kl(s,r.value,n._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(Kl(i))}},e(r.value,r)),t);return n}function aZ(e,t){const n=new Jt({check:"custom",...Y(t)});return n._zod.check=e,n}function xN(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Za,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function xt(e,t,n={path:[],schemaPath:[]}){var u,f;var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=(f=(u=e._zod).toJSONSchema)==null?void 0:f.call(u);if(a)o.schema=a;else{const h={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,h);else{const m=o.schema,g=t.processors[s.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);g(e,t,m,h)}const p=e._zod.parent;p&&(o.ref||(o.ref=p),xt(p,t,h),t.seen.get(p).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),t.io==="input"&&Pt(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function vN(e,t){var o,a,l,c;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const u of e.seen.entries()){const f=(o=e.metadataRegistry.get(u[0]))==null?void 0:o.id;if(f){const h=r.get(f);if(h&&h!==u[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(f,u[0])}}const s=u=>{var g;const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const x=(g=e.external.registry.get(u[0]))==null?void 0:g.id,y=e.external.uri??(w=>w);if(x)return{ref:y(x)};const v=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=v,{defId:v,ref:`${y("__shared")}#/${f}/${v}`}}if(u[1]===n)return{ref:"#"};const p=`#/${f}/`,m=u[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:p+m}},i=u=>{if(u[1].schema.$ref)return;const f=u[1],{ref:h,defId:p}=s(u);f.def={...f.schema},p&&(f.defId=p);const m=f.schema;for(const g in m)delete m[g];m.$ref=h};if(e.cycles==="throw")for(const u of e.seen.entries()){const f=u[1];if(f.cycle)throw new Error(`Cycle detected: #/${(a=f.cycle)==null?void 0:a.join("/")}/<root>
|
|
259
|
+
|
|
260
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const f=u[1];if(t===u[0]){i(u);continue}if(e.external){const p=(l=e.external.registry.get(u[0]))==null?void 0:l.id;if(t!==u[0]&&p){i(u);continue}}if((c=e.metadataRegistry.get(u[0]))==null?void 0:c.id){i(u);continue}if(f.cycle){i(u);continue}if(f.count>1&&e.reused==="ref"){i(u);continue}}}function wN(e,t){var a,l,c,u;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=f=>{const h=e.seen.get(f);if(h.ref===null)return;const p=h.def??h.schema,m={...p},g=h.ref;if(h.ref=null,g){r(g);const y=e.seen.get(g),v=y.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(v)):Object.assign(p,v),Object.assign(p,m),f._zod.parent===g)for(const k in p)k==="$ref"||k==="allOf"||k in m||delete p[k];if(v.$ref&&y.def)for(const k in p)k==="$ref"||k==="allOf"||k in y.def&&JSON.stringify(p[k])===JSON.stringify(y.def[k])&&delete p[k]}const x=f._zod.parent;if(x&&x!==g){r(x);const y=e.seen.get(x);if(y!=null&&y.schema.$ref&&(p.$ref=y.schema.$ref,y.def))for(const v in p)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(p[v])===JSON.stringify(y.def[v])&&delete p[v]}e.override({zodSchema:f,jsonSchema:p,path:h.path??[]})};for(const f of[...e.seen.entries()].reverse())r(f[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const f=(l=e.external.registry.get(t))==null?void 0:l.id;if(!f)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(f)}Object.assign(s,n.def??n.schema);const i=(c=e.metadataRegistry.get(t))==null?void 0:c.id;i!==void 0&&s.id===i&&delete s.id;const o=((u=e.external)==null?void 0:u.defs)??{};for(const f of e.seen.entries()){const h=f[1];h.def&&h.defId&&(h.def.id===h.defId&&delete h.def.id,o[h.defId]=h.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const f=JSON.parse(JSON.stringify(s));return Object.defineProperty(f,"~standard",{value:{...t["~standard"],jsonSchema:{input:of(t,"input",e.processors),output:of(t,"output",e.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function Pt(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Pt(r.element,n);if(r.type==="set")return Pt(r.valueType,n);if(r.type==="lazy")return Pt(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Pt(r.innerType,n);if(r.type==="intersection")return Pt(r.left,n)||Pt(r.right,n);if(r.type==="record"||r.type==="map")return Pt(r.keyType,n)||Pt(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Pt(r.in,n)||Pt(r.out,n);if(r.type==="object"){for(const s in r.shape)if(Pt(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(Pt(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(Pt(s,n))return!0;return!!(r.rest&&Pt(r.rest,n))}return!1}const lZ=(e,t={})=>n=>{const r=xN({...n,processors:t});return xt(e,r),vN(r,e),wN(r,e)},of=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=xN({...s??{},target:i,io:t,processors:n});return xt(e,o),vN(o,e),wN(o,e)},cZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},uZ=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),a&&(s.format=cZ[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),c&&(s.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?s.pattern=u[0].source:u.length>1&&(s.allOf=[...u.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},dZ=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number";const f=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),h=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";f?p?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u:typeof i=="number"&&(s.minimum=i),h?p?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof o=="number"&&(s.maximum=o),typeof l=="number"&&(s.multipleOf=l)},fZ=(e,t,n,r)=>{n.type="boolean"},hZ=(e,t,n,r)=>{n.not={}},pZ=(e,t,n,r)=>{},mZ=(e,t,n,r)=>{const s=e._zod.def,i=JT(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},gZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},yZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},xZ=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=xt(i.element,t,{...r,path:[...r.path,"items"]})},vZ=(e,t,n,r)=>{var c;const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const u in o)s.properties[u]=xt(o[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(o)),l=new Set([...a].filter(u=>{const f=i.shape[u]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));l.size>0&&(s.required=Array.from(l)),((c=i.catchall)==null?void 0:c._zod.def.type)==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=xt(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},wZ=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((a,l)=>xt(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=o:n.anyOf=o},bZ=(e,t,n,r)=>{const s=e._zod.def,i=xt(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=xt(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=l},kZ=(e,t,n,r)=>{const s=e._zod.def,i=xt(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},_Z=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},SZ=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},CZ=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},jZ=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},EZ=(e,t,n,r)=>{const s=e._zod.def,i=s.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?i?s.out:s.in:s.out;xt(o,t,r);const a=t.seen.get(e);a.ref=o},PZ=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},bN=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},TZ=B("ZodISODateTime",(e,t)=>{LG.init(e,t),Fe.init(e,t)});function NZ(e){return O7(TZ,e)}const IZ=B("ZodISODate",(e,t)=>{MG.init(e,t),Fe.init(e,t)});function AZ(e){return z7(IZ,e)}const RZ=B("ZodISOTime",(e,t)=>{$G.init(e,t),Fe.init(e,t)});function LZ(e){return F7(RZ,e)}const MZ=B("ZodISODuration",(e,t)=>{DG.init(e,t),Fe.init(e,t)});function $Z(e){return B7(MZ,e)}const DZ=(e,t)=>{nN.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>CH(e,n)},flatten:{value:n=>SH(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Dg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Dg,2)}},isEmpty:{get(){return e.issues.length===0}}})},zn=B("ZodError",DZ,{Parent:Error}),OZ=Sv(zn),zZ=Cv(zn),FZ=th(zn),BZ=nh(zn),VZ=PH(zn),UZ=TH(zn),WZ=NH(zn),KZ=IH(zn),HZ=AH(zn),GZ=RH(zn),ZZ=LH(zn),qZ=MH(zn),Jk=new WeakMap;function hc(e,t,n){const r=Object.getPrototypeOf(e);let s=Jk.get(r);if(s||(s=new Set,Jk.set(r,s)),!s.has(t)){s.add(t);for(const i in n){const o=n[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!1,get(){const a=o.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const Xe=B("ZodType",(e,t)=>(Qe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:of(e,"input"),output:of(e,"output")}}),e.toJSONSchema=lZ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>OZ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>FZ(e,n,r),e.parseAsync=async(n,r)=>zZ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>BZ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>VZ(e,n,r),e.decode=(n,r)=>UZ(e,n,r),e.encodeAsync=async(n,r)=>WZ(e,n,r),e.decodeAsync=async(n,r)=>KZ(e,n,r),e.safeEncode=(n,r)=>HZ(e,n,r),e.safeDecode=(n,r)=>GZ(e,n,r),e.safeEncodeAsync=async(n,r)=>ZZ(e,n,r),e.safeDecodeAsync=async(n,r)=>qZ(e,n,r),hc(e,"ZodType",{check(...n){const r=this.def;return this.clone(Bs(r,{checks:[...r.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Vs(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(Fq(n,r))},superRefine(n,r){return this.check(Bq(n,r))},overwrite(n){return this.check(da(n))},optional(){return t_(this)},exactOptional(){return Eq(this)},nullable(){return n_(this)},nullish(){return t_(n_(this))},nonoptional(n){return Rq(this,n)},array(){return Hl(this)},or(n){return kq([this,n])},and(n){return Sq(this,n)},transform(n){return r_(this,CN(n))},default(n){return Nq(this,n)},prefault(n){return Aq(this,n)},catch(n){return Mq(this,n)},pipe(n){return r_(this,n)},readonly(){return Oq(this)},describe(n){const r=this.clone();return Za.add(r,{description:n}),r},meta(...n){if(n.length===0)return Za.get(this);const r=this.clone();return Za.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){var n;return(n=Za.get(e))==null?void 0:n.description},configurable:!0}),e)),kN=B("_ZodString",(e,t)=>{jv.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(r,s,i)=>uZ(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,hc(e,"_ZodString",{regex(...r){return this.check(G7(...r))},includes(...r){return this.check(Y7(...r))},startsWith(...r){return this.check(J7(...r))},endsWith(...r){return this.check(Q7(...r))},min(...r){return this.check(sf(...r))},max(...r){return this.check(gN(...r))},length(...r){return this.check(yN(...r))},nonempty(...r){return this.check(sf(1,...r))},lowercase(r){return this.check(Z7(r))},uppercase(r){return this.check(q7(r))},trim(){return this.check(eZ())},normalize(...r){return this.check(X7(...r))},toLowerCase(){return this.check(tZ())},toUpperCase(){return this.check(nZ())},slugify(){return this.check(rZ())}})}),YZ=B("ZodString",(e,t)=>{jv.init(e,t),kN.init(e,t),e.email=n=>e.check(y7(JZ,n)),e.url=n=>e.check(k7(QZ,n)),e.jwt=n=>e.check(D7(hq,n)),e.emoji=n=>e.check(_7(XZ,n)),e.guid=n=>e.check(Gk(Qk,n)),e.uuid=n=>e.check(x7(yu,n)),e.uuidv4=n=>e.check(v7(yu,n)),e.uuidv6=n=>e.check(w7(yu,n)),e.uuidv7=n=>e.check(b7(yu,n)),e.nanoid=n=>e.check(S7(eq,n)),e.guid=n=>e.check(Gk(Qk,n)),e.cuid=n=>e.check(C7(tq,n)),e.cuid2=n=>e.check(j7(nq,n)),e.ulid=n=>e.check(E7(rq,n)),e.base64=n=>e.check(L7(uq,n)),e.base64url=n=>e.check(M7(dq,n)),e.xid=n=>e.check(P7(sq,n)),e.ksuid=n=>e.check(T7(iq,n)),e.ipv4=n=>e.check(N7(oq,n)),e.ipv6=n=>e.check(I7(aq,n)),e.cidrv4=n=>e.check(A7(lq,n)),e.cidrv6=n=>e.check(R7(cq,n)),e.e164=n=>e.check($7(fq,n)),e.datetime=n=>e.check(NZ(n)),e.date=n=>e.check(AZ(n)),e.time=n=>e.check(LZ(n)),e.duration=n=>e.check($Z(n))});function fe(e){return g7(YZ,e)}const Fe=B("ZodStringFormat",(e,t)=>{$e.init(e,t),kN.init(e,t)}),JZ=B("ZodEmail",(e,t)=>{CG.init(e,t),Fe.init(e,t)}),Qk=B("ZodGUID",(e,t)=>{_G.init(e,t),Fe.init(e,t)}),yu=B("ZodUUID",(e,t)=>{SG.init(e,t),Fe.init(e,t)}),QZ=B("ZodURL",(e,t)=>{jG.init(e,t),Fe.init(e,t)}),XZ=B("ZodEmoji",(e,t)=>{EG.init(e,t),Fe.init(e,t)}),eq=B("ZodNanoID",(e,t)=>{PG.init(e,t),Fe.init(e,t)}),tq=B("ZodCUID",(e,t)=>{TG.init(e,t),Fe.init(e,t)}),nq=B("ZodCUID2",(e,t)=>{NG.init(e,t),Fe.init(e,t)}),rq=B("ZodULID",(e,t)=>{IG.init(e,t),Fe.init(e,t)}),sq=B("ZodXID",(e,t)=>{AG.init(e,t),Fe.init(e,t)}),iq=B("ZodKSUID",(e,t)=>{RG.init(e,t),Fe.init(e,t)}),oq=B("ZodIPv4",(e,t)=>{OG.init(e,t),Fe.init(e,t)}),aq=B("ZodIPv6",(e,t)=>{zG.init(e,t),Fe.init(e,t)}),lq=B("ZodCIDRv4",(e,t)=>{FG.init(e,t),Fe.init(e,t)}),cq=B("ZodCIDRv6",(e,t)=>{BG.init(e,t),Fe.init(e,t)}),uq=B("ZodBase64",(e,t)=>{VG.init(e,t),Fe.init(e,t)}),dq=B("ZodBase64URL",(e,t)=>{WG.init(e,t),Fe.init(e,t)}),fq=B("ZodE164",(e,t)=>{KG.init(e,t),Fe.init(e,t)}),hq=B("ZodJWT",(e,t)=>{GG.init(e,t),Fe.init(e,t)}),_N=B("ZodNumber",(e,t)=>{dN.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(r,s,i)=>dZ(e,r,s),hc(e,"ZodNumber",{gt(r,s){return this.check(qk(r,s))},gte(r,s){return this.check(Lp(r,s))},min(r,s){return this.check(Lp(r,s))},lt(r,s){return this.check(Zk(r,s))},lte(r,s){return this.check(Rp(r,s))},max(r,s){return this.check(Rp(r,s))},int(r){return this.check(Xk(r))},safe(r){return this.check(Xk(r))},positive(r){return this.check(qk(0,r))},nonnegative(r){return this.check(Lp(0,r))},negative(r){return this.check(Zk(0,r))},nonpositive(r){return this.check(Rp(0,r))},multipleOf(r,s){return this.check(Yk(r,s))},step(r,s){return this.check(Yk(r,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function fr(e){return V7(_N,e)}const pq=B("ZodNumberFormat",(e,t)=>{ZG.init(e,t),_N.init(e,t)});function Xk(e){return U7(pq,e)}const mq=B("ZodBoolean",(e,t)=>{qG.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>fZ(e,n,r)});function SN(e){return W7(mq,e)}const gq=B("ZodUnknown",(e,t)=>{YG.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>pZ()});function e_(){return K7(gq)}const yq=B("ZodNever",(e,t)=>{JG.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>hZ(e,n,r)});function xq(e){return H7(yq,e)}const vq=B("ZodArray",(e,t)=>{QG.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>xZ(e,n,r,s),e.element=t.element,hc(e,"ZodArray",{min(n,r){return this.check(sf(n,r))},nonempty(n){return this.check(sf(1,n))},max(n,r){return this.check(gN(n,r))},length(n,r){return this.check(yN(n,r))},unwrap(){return this.element}})});function Hl(e,t){return sZ(vq,e,t)}const wq=B("ZodObject",(e,t)=>{e7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>vZ(e,n,r,s),be(e,"shape",()=>t.shape),hc(e,"ZodObject",{keyof(){return mt(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:e_()})},loose(){return this.clone({...this._zod.def,catchall:e_()})},strict(){return this.clone({...this._zod.def,catchall:xq()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return xH(this,n)},safeExtend(n){return vH(this,n)},merge(n){return wH(this,n)},pick(n){return gH(this,n)},omit(n){return yH(this,n)},partial(...n){return bH(jN,this,n[0])},required(...n){return kH(EN,this,n[0])}})});function hn(e,t){const n={type:"object",shape:e??{},...Y(t)};return new wq(n)}const bq=B("ZodUnion",(e,t)=>{t7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>wZ(e,n,r,s),e.options=t.options});function kq(e,t){return new bq({type:"union",options:e,...Y(t)})}const _q=B("ZodIntersection",(e,t)=>{n7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bZ(e,n,r,s)});function Sq(e,t){return new _q({type:"intersection",left:e,right:t})}const zg=B("ZodEnum",(e,t)=>{r7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(r,s,i)=>mZ(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new zg({...t,checks:[],...Y(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new zg({...t,checks:[],...Y(s),entries:i})}});function mt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new zg({type:"enum",entries:n,...Y(t)})}const Cq=B("ZodTransform",(e,t)=>{s7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yZ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new YT(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Kl(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Kl(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function CN(e){return new Cq({type:"transform",transform:e})}const jN=B("ZodOptional",(e,t)=>{pN.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bN(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function t_(e){return new jN({type:"optional",innerType:e})}const jq=B("ZodExactOptional",(e,t)=>{i7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bN(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Eq(e){return new jq({type:"optional",innerType:e})}const Pq=B("ZodNullable",(e,t)=>{o7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>kZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function n_(e){return new Pq({type:"nullable",innerType:e})}const Tq=B("ZodDefault",(e,t)=>{a7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>SZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Nq(e,t){return new Tq({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():XT(t)}})}const Iq=B("ZodPrefault",(e,t)=>{l7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>CZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Aq(e,t){return new Iq({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():XT(t)}})}const EN=B("ZodNonOptional",(e,t)=>{c7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>_Z(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Rq(e,t){return new EN({type:"nonoptional",innerType:e,...Y(t)})}const Lq=B("ZodCatch",(e,t)=>{u7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>jZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Mq(e,t){return new Lq({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const PN=B("ZodPipe",(e,t)=>{mN.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>EZ(e,n,r,s),e.in=t.in,e.out=t.out});function r_(e,t){return new PN({type:"pipe",in:e,out:t})}const $q=B("ZodPreprocess",(e,t)=>{PN.init(e,t),d7.init(e,t)}),Dq=B("ZodReadonly",(e,t)=>{f7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>PZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Oq(e){return new Dq({type:"readonly",innerType:e})}const zq=B("ZodCustom",(e,t)=>{h7.init(e,t),Xe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>gZ(e,n)});function Fq(e,t={}){return iZ(zq,e,t)}function Bq(e,t){return oZ(e,t)}function Vq(e,t){return new $q({type:"pipe",in:CN(e),out:t})}const Js=Vq(e=>typeof e=="string"?{agent:e}:e,hn({agent:mt(oc),model:fe().optional(),effort:fe().optional()})),Ts=fe().regex(/^\d{4}-\d{2}-\d{2}$/,"expected YYYY-MM-DD");hn({status:mt(["idea","planned","in-progress","review","done","dropped"]),kind:mt(["feat","fix","chore","docs","refactor"]).optional(),id:fe().optional(),idea:fe().optional(),agent:mt(oc).optional(),created:Ts,updated:Ts.optional(),tags:fe().optional()});hn({id:fe().describe("Permanent plan ID, e.g. FEAT-24"),title:fe().describe('Human-readable plan name, e.g. "Plan storage architecture"'),kind:mt(["feat","fix","chore","docs","refactor"]).describe("Plan kind matching Conventional Commits types"),status:mt(["idea","planned","in-progress","review","done","dropped"]).describe("Current lifecycle status"),idea:fe().optional().describe("IDEA-N backlink if this plan grew out of an idea"),agent:mt(oc).optional().describe("Per-plan agent override"),created:Ts.describe("Creation date (YYYY-MM-DD)"),updated:Ts.optional().describe("Last significant update date (YYYY-MM-DD)"),audited:Ts.optional().describe("Date of last successful convergence audit (YYYY-MM-DD)"),"audited-hash":fe().optional().describe("Content hash of the plan at last audit, used to detect edits regardless of mtime"),tags:Hl(fe()).optional().describe("Tagging categories")}).passthrough();hn({id:fe().describe("Permanent idea ID, e.g. IDEA-20"),title:fe().describe("Short idea headline (3-6 words)"),kind:mt(["idea","note"]).optional().describe('"note" for ideas that never need a plan; omitted means a plan-bearing idea'),status:mt(["open","done","dropped"]).optional().describe("Manual lifecycle, valid only on notes — plan-bearing ideas carry no status")}).passthrough().refine(e=>e.status===void 0||e.kind==="note",{message:"status is only valid on ideas with kind: note",path:["status"]});const TN=hn({id:fe().describe("Permanent lifetime entity ID, e.g. IDEA-45 — never changes"),title:fe().describe("Human-readable entity name"),type:mt(["feat","fix","chore","docs","refactor"]).optional().describe("Work classification (Conventional Commits values) driving commit types and branch prefixes; usually set once a plan is drafted"),kind:mt(["note","fix","board","ticket"]).optional().describe('"note" marks an entity that never grows phases; "fix" is a follow-up entity linked to a done/archived parent via `idea`; "board" decomposes into "ticket" children instead of phases; "ticket" is a full entity linked back to its board via `idea`; omitted for normal ideas'),status:mt(["idea","planned","in-progress","review","done","dropped","open"]).optional().describe("Stored override, no longer the source of truth: most lifecycle states derive from phases/branch/PR. Only dropped, a planless idea/note being closed, or the offline fallback need this set."),agent:mt(oc).optional().describe("Per-entity agent override"),created:Ts.describe("Creation date (YYYY-MM-DD)"),updated:Ts.optional().describe("Last significant update date (YYYY-MM-DD)"),audited:Ts.optional().describe("Date of last successful convergence audit (YYYY-MM-DD)"),"audited-hash":fe().optional().describe("Content hash of the entity at last audit, used to detect edits regardless of mtime"),released:fe().optional().describe("Version tag (e.g. v0.13.1) that first shipped this idea, stamped from the release train"),tags:Hl(fe()).optional().describe("Tagging categories"),idea:fe().optional().describe("IDEA-N backlink to the parent this fix addresses; required when kind: fix"),subject:fe().optional().describe('Subject group name; absent renders as the virtual "No subject" group'),order:fr().int().optional().describe("Run order; absent means unordered, sorting after ordered entries"),issueSource:fe().optional().describe("sourceKind:sourceKey of the Issue (IDEA-192) this entity was promoted from, if any")}).passthrough(),Uq=new Set(Object.keys(TN.shape)),Wq=TN.refine(e=>e.kind!=="note"||e.status===void 0||["open","done","dropped"].includes(e.status),{message:"a note entity must use status open, done, or dropped",path:["status"]}).refine(e=>e.kind==="note"||e.status!=="open",{message:"status open is only valid on entities with kind: note",path:["status"]}).refine(e=>e.kind!=="fix"||e.idea!==void 0,{message:"a kind: fix entity requires an idea: link to its parent",path:["idea"]}).refine(e=>e.kind!=="ticket"||e.idea!==void 0,{message:"a kind: ticket entity requires an idea: link to its board",path:["idea"]}),Kq=hn({name:fe(),cmd:fe(),port:fr().int().positive().optional(),healthcheck:fe().optional()}),Hq=hn({name:fe(),cmd:fe()}),Gq=hn({repo:fe(),branch:fe().optional(),releasePlease:SN().optional()}),Zq=hn({services:Hl(Kq).optional(),checks:Hl(Hq).optional(),ci:Gq.optional()});hn({version:fr().int().describe("Corpus format version (see CORPUS_FORMAT_VERSION), not the package version"),projectName:fe(),initializedAt:fe(),nextId:hn({idea:fr().optional(),ticket:fr().optional(),feat:fr().optional(),fix:fr().optional(),chore:fr().optional(),docs:fr().optional(),refactor:fr().optional()}).optional(),defaultAgent:mt(oc).optional(),defaultAgents:hn({phase:Js,planDraft:Js,ideaExtend:Js,commitSuggest:Js,feedback:Js,codeReview:Js,deskDiscovery:Js}).optional(),desk:Zq.optional()});hn({id:fe(),kind:mt(["completed","reply"]),entityId:fe(),entityTitle:fe(),text:fe(),date:fe(),read:SN(),outcome:mt(["done","error"]).optional()});const qq=/^#{2,3}\s+/;function Fg(e,t){const n=e.split(`
|
|
261
|
+
`),r=n.findIndex(a=>t.headingRe.test(a));if(r===-1)return{body:e,entries:[]};let s=n.length;for(let a=r+1;a<n.length;a++)if(qq.test(n[a])){s=a;break}const i=t.parseEntries(n,r+1,s);return{body:[...n.slice(0,r),...n.slice(s)].join(`
|
|
262
|
+
`).trim(),entries:i}}const s_={phases:GT,log:sH,clarifications:iH,notes:oH,review:aH};function Yq(e){const t={phases:[],log:[],clarifications:[],notes:[],review:[]};let n=e;for(const r of Object.keys(s_)){const s=Fg(n,s_[r]);n=s.body,t[r]=s.entries}return{body:n,...t}}const Jq=/^---\s*\r?\n([\s\S]*?)\r?\n---\s*(?:\r?\n)?/;function Qq(e,t){const n=[],r=e.match(Jq);if(!r)return{data:null,body:e.trim(),warnings:n};const s=r[1],i=e.slice(r[0].length).trim();let o;try{o=WK(s)}catch(l){return n.push({title:"(frontmatter)",message:`Invalid YAML frontmatter: ${l.message}`}),{data:null,body:i,warnings:n}}if(typeof o!="object"||o===null||Array.isArray(o))return n.push({title:"(frontmatter)",message:"YAML frontmatter did not produce an object"}),{data:null,body:i,warnings:n};const a=t.safeParse(o);if(!a.success){const l=o.id;return n.push({title:l??"(frontmatter)",message:a.error.issues.map(c=>c.message).join("; ")}),{data:null,body:i,warnings:n}}return{data:a.data,body:i,warnings:n}}function Xq(e,t){const n=Object.fromEntries(Object.entries(e).filter(([r])=>!t.has(r)));return Object.keys(n).length>0?n:void 0}function eY(e){const t=[],{data:n,body:r,warnings:s}=Qq(e,Wq);if(t.push(...s),!n)return{entries:[],warnings:t};const{body:i,phases:o,log:a,clarifications:l,notes:c,review:u}=Yq(r),{body:f,entries:h}=Fg(i,ZT),{body:p,entries:m}=Fg(f,qT),g=[...m,...PW(a,l,c,u)];n.kind==="note"&&o.length>0&&t.push({title:n.title,message:"note entities must not carry a Phases section — kept, but fix the file"});const x=Xq(n,Uq);return{entries:[{id:n.id,title:n.title,type:n.type,kind:n.kind,status:n.status,idea:n.idea,agent:n.agent,created:n.created,updated:n.updated,audited:n.audited,auditedHash:n["audited-hash"],released:n.released,tags:n.tags??[],subject:n.subject,order:n.order,issueSource:n.issueSource,body:p,phases:o,...h.length>0&&{fixes:h},...g.length>0&&{thread:g},...x&&{unknownFrontmatter:x}}],warnings:t}}const tY=new Set(["planned","in-progress","review"]);function i_(e){return tY.has(e.status??"")}function nY(e,t,n){const r=new Map(t.filter(s=>s.id!==void 0).map(s=>[s.id,s.status]));return e.filter(s=>s.kind!=="note"&&s.kind!=="board").map(s=>{const i=n==null?void 0:n(s.id);return{id:s.id,title:s.title,created:s.created,status:i?i.value:r.get(s.id)??s.status}})}function rY(e,t,n){const r=new Map(t.map(l=>[l.id,l])),s=new Set,i=[];for(const l of e){if(s.has(l.id))continue;const c=r.get(l.id);c===void 0||!i_(c)||(s.add(c.id),i.push(c))}const o=t.filter(l=>i_(l)&&!s.has(l.id)).sort((l,c)=>l.created.localeCompare(c.created)),a=[...i,...o];if(n){const l=a.findIndex(c=>c.id===n.id);if(l!==-1){const[c]=a.splice(l,1),u=Math.min(Math.max(Math.round(n.order),1),a.length+1);a.splice(u-1,0,c)}}return a.map(l=>({id:l.id,title:l.title}))}const Bg=" — ";function NN(e){return e.split(`
|
|
263
|
+
`).map(t=>t.trim()).filter(t=>t.length>0).map(t=>{const n=t.indexOf(Bg);return n===-1?{id:t,title:""}:{id:t.slice(0,n).trim(),title:t.slice(n+Bg.length).trim()}})}function sY(e){return e.length===0?"":`${e.map(t=>`${t.id}${Bg}${t.title}`).join(`
|
|
264
|
+
`)}
|
|
265
|
+
`}function iY(e,t){for(const{entries:n,section:r}of t)n&&n.length>0&&e.push(r.formatLines(n).join(`
|
|
266
|
+
`))}function Vg(){return new Date().toISOString().slice(0,10)}function oY(e){return`---
|
|
267
|
+
${KK(e).trimEnd()}
|
|
268
|
+
---`}function IN(e){const t={id:e.id,title:e.title};e.type&&(t.type=e.type),e.kind&&(t.kind=e.kind),e.status&&(t.status=e.status),e.idea&&(t.idea=e.idea),t.created=e.created,e.agent&&(t.agent=e.agent),e.updated&&(t.updated=e.updated),e.audited&&(t.audited=e.audited),e.auditedHash&&(t["audited-hash"]=e.auditedHash),e.released&&(t.released=e.released),e.tags&&e.tags.length>0&&(t.tags=e.tags),e.subject&&(t.subject=e.subject),e.order!==void 0&&(t.order=e.order),e.issueSource&&(t.issueSource=e.issueSource);for(const r of Object.keys(e.unknownFrontmatter??{}).sort())t[r]=e.unknownFrontmatter[r];const n=[oY(t)];return e.body&&n.push(e.body),iY(n,[{entries:e.phases,section:GT},{entries:e.fixes,section:ZT},{entries:e.thread,section:qT}]),n.join(`
|
|
269
|
+
|
|
270
|
+
`).trimEnd()}const aY="https://api.github.com";class Ev extends Error{constructor(t,n){super(t),this.status=n,this.name="GithubApiError"}}function lY(e){const t=new TextEncoder().encode(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n)}function cY(e){const t=atob(e.replace(/\s/g,"")),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new TextDecoder().decode(n)}async function sh(e,t,n){const r=await fetch(`${aY}/repos/${e.owner}/${e.repo}${t}`,{...n,headers:{Authorization:`Bearer ${e.token}`,Accept:"application/vnd.github+json",...n!=null&&n.body?{"Content-Type":"application/json"}:{},...n==null?void 0:n.headers}});if(r.status===404)return null;if(!r.ok){const s=await r.json().catch(()=>null);throw new Ev((s==null?void 0:s.message)??`GitHub API error (${r.status})`,r.status)}return r.json()}const ih=e=>`/contents/${e.split("/").map(encodeURIComponent).join("/")}`;async function pc(e,t){const n=await sh(e,ih(t));return!n||Array.isArray(n)?null:{content:cY(n.content),sha:n.sha}}async function uY(e,t){const n=await sh(e,ih(t));return Array.isArray(n)?n.map(r=>({name:r.name,type:r.type})):[]}async function Gl(e,t,n,r,s){return{sha:(await sh(e,ih(t),{method:"PUT",body:JSON.stringify({message:r,content:lY(n),...s&&{sha:s}})})).content.sha}}async function dY(e,t,n,r){await sh(e,ih(t),{method:"DELETE",body:JSON.stringify({message:r,sha:n})})}const af="papercamp/ideas",AN="papercamp/config.json",Ug="papercamp/run-order.md";async function o_(e,t,n){const r=(await uY(e,t)).filter(i=>i.type==="file"&&i.name.endsWith(".md")&&i.name!=="index.md");return(await Promise.all(r.map(async i=>{const o=`${t}/${i.name}`,a=await pc(e,o);if(!a)return null;const l=eY(a.content).entries[0];return l?{entry:{...l,archived:n},path:o,sha:a.sha}:null}))).filter(i=>i!==null)}async function fY(e){const t=await pc(e,Ug);return new Map(NN((t==null?void 0:t.content)??"").map((n,r)=>[n.id,r+1]))}async function Pv(e){const[t,n,r]=await Promise.all([o_(e,af,!1),o_(e,`${af}/archive`,!0),fY(e)]);return[...t,...n].map(s=>({...s,entry:{...s.entry,storedOrder:s.entry.order,order:r.get(s.entry.id)??s.entry.order}}))}async function hY(e){return{entries:(await Pv(e)).filter(n=>n.entry.kind==="note").map(n=>RW(n.entry)),warnings:[]}}async function pY(e){return{entries:(await Pv(e)).filter(n=>n.entry.kind!=="note").map(n=>sT(n.entry,void 0,!1,!1)),warnings:[],resolved:!1}}async function mY(e){const t=await pc(e,AN);if(!t)throw new Error("papercamp/config.json not found in this repo");return{file:JSON.parse(t.content),sha:t.sha}}let a_=Promise.resolve();async function gY(e,t){const n=a_.then(async()=>{var u;const{file:r,sha:s}=await mY(e),i=r.nextId??{},o=i.idea??1,a=`IDEA-${o}`;await Gl(e,AN,JSON.stringify({...r,nextId:{...i,idea:o+1}},null,2),`chore(papercamp): mint ${a}`,s);const l=t.kind==="note",c=IN({id:a,title:t.title.trim(),kind:l?"note":t.kind==="board"?"board":void 0,status:l?"open":"idea",created:Vg(),body:(u=t.content)==null?void 0:u.trim()});return await Gl(e,`${af}/${a}.md`,`${c}
|
|
271
|
+
`,`feat(papercamp): draft ${a}`),a});return a_=n.catch(()=>{}),n}function yY(e,t,n){return e.find(r=>r.entry.title===t||r.entry.id===t)}async function l_(e,t,n,r){const s=IN({id:n.id,title:n.title,type:n.type,kind:n.kind,status:n.status,idea:n.idea,agent:n.agent,created:n.created,updated:n.updated,audited:n.audited,auditedHash:n.auditedHash,released:n.released,tags:n.tags,subject:n.subject,order:n.storedOrder??n.order,issueSource:n.issueSource,body:n.body,phases:n.phases,fixes:n.fixes,thread:n.thread,unknownFrontmatter:n.unknownFrontmatter});await Gl(e,t.path,`${s}
|
|
272
|
+
`,r,t.sha)}async function xY(e,t,n,r){const s=nY(t.map(l=>l.entry),t.filter(l=>l.entry.kind!=="note").map(l=>sT(l.entry,void 0,!1,!1))),i=await pc(e,Ug),o=NN((i==null?void 0:i.content)??""),a=sY(rY(o,s,r));await Gl(e,Ug,a,`chore(papercamp): reorder queue after ${n}`,i==null?void 0:i.sha)}async function vY(e,t,n){var a,l,c;const r=await Pv(e),s=yY(r,t);if(!s)throw new Error("entity not found");if(SW(s.entry)){const u=(((a=n.phases)==null?void 0:a.length)??0)>s.entry.phases.length,f=(((l=n.fixes)==null?void 0:l.length)??0)>(((c=s.entry.fixes)==null?void 0:c.length)??0),h=n.status!==void 0&&n.status!==null&&n.status!=="done"&&n.status!=="dropped";if(u||f||h||n.body!==void 0)throw new Error("a done/archived entity is read-only — new work spawns its own fix entity")}let i=s.entry.thread;n.thread!==void 0&&(i=n.thread),n.log!==void 0&&(i=AW(i,["log"],n.log.map(u=>({kind:"log",date:u.date,text:u.text}))));const o={...s.entry,...n.body!==void 0&&{body:n.body},...n.status!==void 0&&{status:n.status??void 0},...n.phases!==void 0&&{phases:n.phases},...n.fixes!==void 0&&{fixes:n.fixes},...i!==s.entry.thread&&{thread:i},...n.agent!==void 0&&{agent:n.agent??void 0},...n.subject!==void 0&&{subject:n.subject??void 0},order:s.entry.kind==="note"?n.order!==void 0?n.order??void 0:s.entry.order:void 0,updated:Vg()};if(n.status==="in-progress")for(const u of r)u.entry.id!==s.entry.id&&u.entry.kind!=="note"&&u.entry.status==="in-progress"&&await l_(e,u,{...u.entry,status:"planned",updated:Vg()},`chore(papercamp): demote ${u.entry.id}`);if(await l_(e,s,o,`chore(papercamp): update ${s.entry.id}`),s.entry.kind!=="note"&&(n.order!==void 0||n.status!==void 0)){const u=typeof n.order=="number"?{id:s.entry.id,order:n.order}:void 0,f=r.map(h=>h.entry.id===s.entry.id?{...h,entry:o}:h);await xY(e,f,s.entry.id,u)}if(n.status==="dropped"){const u=await pc(e,s.path);u&&(await Gl(e,`${af}/archive/${s.entry.id}.md`,u.content,`chore(papercamp): archive ${s.entry.id}`),await dY(e,s.path,u.sha,`chore(papercamp): archive ${s.entry.id}`))}}function wY(e,t){return{ideaEntries:[],loadIdeas:_t(e,()=>{const{runtimeReachable:n,githubConfig:r}=t();return!n&&r?hY(r):QP()},n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:_t(e,uW,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await dW(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}function bY(e,t){return{notifications:null,notificationsLoading:!1,notificationsError:null,loadNotifications:_t(e,mW,n=>({notifications:n,notificationsError:null}),n=>({notificationsError:String(n)}),"notificationsLoading"),markRead:async n=>{const r=t().notifications;if(r){e({notifications:r.map(s=>s.kind!=="question"&&s.id===n?{...s,read:!0}:s)});try{await gW(n)}catch(s){e({notifications:r,notificationsError:String(s)})}}}}}function kY(e){return{parkedQuestions:null,parkedQuestionsLoading:!1,parkedQuestionsError:null,loadParkedQuestions:_t(e,yW,t=>({parkedQuestions:t,parkedQuestionsError:null}),t=>({parkedQuestionsError:String(t)}),"parkedQuestionsLoading")}}const oh=(e,t)=>e.kind==="phase"&&!e.item.done&&(t==null?void 0:t.index)===e.index,Wg=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`},_Y=e=>{const t=new Date(e),n=new Date,r=t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate(),s=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return r?`as of ${s}`:`as of ${t.toLocaleDateString()} ${s}`},RN=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)}},LN=e=>RN(e.phases),c_=e=>{var t;return((t=LN(e))==null?void 0:t.pct)??null},SY=e=>RN([...e.phases,...e.fixes??[]]),CY=(e,t)=>{const n=SY(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}},ah=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,jY=(e,t)=>e?t.find(n=>n.planId===e&&n.taskKind==="pr-review"&&n.status!=="done"&&n.status!=="error"):void 0,EY=e=>{var t;return(t=[...e??[]].reverse().find(n=>n.kind==="review"))==null?void 0:t.text},lh=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:ah(e.id,t)?"in-progress":e.status,PY=e=>!e.pr&&e.status!=="done"&&e.status!=="dropped"&&(e.entityKind==="board"?e.status==="review":e.phases.length>0&&e.phases.every(t=>t.done))&&(e.fixes??[]).every(t=>t.done),TY=e=>e.phases.some(t=>t.done),NY=(e,t)=>{const n=[];return e.phases.length>0&&e.phases.every(r=>r.done)||n.push("open phases"),(e.fixes??[]).every(r=>r.done)||n.push("open fixes"),e.pr?e.pr.reviewDecision==="changes-requested"&&n.push("requested changes"):n.push("an open PR"),t!==!0&&n.push("CI"),{ready:n.length===0,missing:n}};function Mp(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 f=i-1;f>=0;f--)o[u][f]=n[u]===r[f]?o[u+1][f+1]+1:Math.max(o[u+1][f],o[u][f+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 IY(a)}function IY(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 AY=["in-progress","review","planned","idea"],RY=["open"],Tv={statuses:AY,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:RY,subject:null,groupBySubject:!0},u_={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},xu=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},d_=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},f_=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},$p=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},h_=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),ed=(e,t)=>t===null||e===t,p_=e=>e.status==="in-progress"||e.status==="review"?0:1,MN=(e,t,n,r="asc")=>{const s=p_(e)-p_(t);if(s!==0)return s;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:d_(e)-d_(t);const i=(()=>{switch(n){case"status":{const o=u_[e.status]-u_[t.status];return o!==0?o:xu(t)-xu(e)}case"updated":return xu(t)-xu(e);case"title":return e.title.localeCompare(t.title);case"id":return f_(e)-f_(t);case"progress":return(c_(t)??-1)-(c_(e)??-1);default:return 0}})();return r==="desc"?-i:i},Kg=(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=Tv)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=Kg(e.filter(a=>h_(a,n)&&$p(a,t.search)&&ed(a.subject,t.subject)),a=>[a.status]);for(const a of H8)s[a]??(s[a]=0);const i=Kg(e.filter(a=>r.has(a.status)&&$p(a,t.search)&&ed(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&h_(a,n)&&$p(a,t.search)&&ed(a.subject,t.subject)).sort((a,l)=>MN(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},LY=["open","done","dropped"],MY={open:"idea",done:"done",dropped:"dropped"},m_=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},$Y=e=>e.type==="plan"?e.plan.subject:e.type==="fix"?e.fix.subject:e.idea.subject,DY=e=>e.type==="plan"?e.plan.order:e.type==="fix"?e.fix.order:e.idea.order,OY=e=>{const t=e.type==="plan"?e.plan.updated??e.plan.created:e.type==="fix"?e.fix.updated??e.fix.created:e.idea.created,n=new Date(t??"").getTime();return Number.isNaN(n)?0:n},g_=(e,t)=>e.reduce((n,r)=>{const s=DY(r);return s===void 0?n:n===void 0?s:t==="desc"?Math.max(n,s):Math.min(n,s)},void 0),y_=e=>e.reduce((t,n)=>Math.max(t,OY(n)),0),zY=(e,t="asc",n)=>{var a;const r=new Map,s=[];for(const l of e){const c=$Y(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=g_(l.rows,t),f=g_(c.rows,t);return u!==void 0&&f!==void 0?i*(u-f):u!==void 0?-1:f!==void 0?1:y_(c.rows)-y_(l.rows)});return s.length>0&&o.push({subject:null,rows:s}),o},x_=e=>e.type==="plan"?e.plan:e.type==="fix"?e.fix:{title:e.idea.title,id:e.idea.id??void 0,status:MY[e.idea.status??"open"],created:e.idea.created??"",tags:[],body:e.idea.body,phases:[],order:e.idea.order},FY=(e,t,n=Tv)=>{const r=e.filter(m=>m.entityKind!=="ticket"),s=new Map(r.map(m=>[m.id,m.subject])),i=r.map(m=>m.entityKind==="fix"?{...m,subject:m.idea&&s.get(m.idea)||void 0}:m),o=i.filter(m=>m.entityKind==="fix"),a=i.filter(m=>m.entityKind!=="fix"),{statusCounts:l,tagCounts:c}=ul(i,n),u=t.filter(m=>m.kind==="note"),f=new Set(n.noteStatuses),h=Kg(u.filter(m=>m_(m,n.search)),m=>[m.status??"open"]);for(const m of LY)h[m]??(h[m]=0);const p=ul(a,n).rows.map(m=>({type:"plan",plan:m}));p.push(...ul(o,n).rows.map(m=>({type:"fix",fix:m})));for(const m of u)f.has(m.status??"open")&&m_(m,n.search)&&ed(m.subject,n.subject)&&p.push({type:"note",idea:m});return p.sort((m,g)=>MN(x_(m),x_(g),n.sortKey,n.sortDirection)),{rows:p,statusCounts:l,tagCounts:c,noteStatusCounts:h}},BY=.2,VY=5,$N=3,DN=2,ON=1,UY=$N+DN+ON,WY=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"]),vu=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!WY.has(n));return new Set(t)},Dp=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function KY(e,t,n={}){const{threshold:r=BY,limit:s=VY}=n,i=vu(e);if(i.size===0)return[];const o=[];for(const a of t){const l=vu(a.title),c=vu(a.body),u=vu((a.tags??[]).join(" ")),h=(Dp(i,l)*$N+Dp(i,u)*DN+Dp(i,c)*ON)/(i.size*UY);h>=r&&o.push({candidate:a,score:h})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const HY=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}`},GY=(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=[HY(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},ZY=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)=>GY(r,s))},qY=e=>`Fix the failing "${e}" check`,YY=({cmd:e,output:t})=>`The command was \`${e}\`.
|
|
273
|
+
|
|
274
|
+
Output from the last run:
|
|
275
|
+
|
|
276
|
+
${t||"(no output captured)"}`,JY=(e,t)=>{const n=i=>t.find(o=>o.name===i),r=n("lint"),s=n("test");return[{name:"Quality",results:r?[r]:[]},{name:"Tests",results:s?[s]:[]},{name:"Consistency",results:[e.consistency]}]},QY=(e,t)=>JY(e,t).flatMap(({name:n,results:r})=>{const s=r.filter(o=>o.status==="fail");if(s.length===0)return[];const i=s.map(YY).join(`
|
|
277
|
+
|
|
278
|
+
`);return[{done:!1,text:qY(n),description:`Fix the failing "${n}" check in this repo.
|
|
279
|
+
|
|
280
|
+
${i}`}]}),XY=(e,t,n)=>{const r=new Map(QY(t,n).map(i=>[i.text,i]));return[...e.map(i=>{const o=r.get(i.text);return o?(r.delete(i.text),o):i}),...r.values()]},eJ=/^[a-z]+\([a-z-]+\):\s+/,tJ=e=>e.replace(eJ,""),nJ=(e,t)=>[...e,{done:!0,text:tJ(t),source:"manual"}],zN="papercamp/",rJ=e=>e.length>0&&e.every(t=>t.startsWith(zN)),sJ=e=>`${zN}ideas/${e}.md`,iJ=14*24*60*60*1e3;function mc(e){try{const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);return Date.now()-n.storedAt>iJ?(localStorage.removeItem(e),null):n.value}catch{return null}}function gc(e,t){try{const n={value:t,storedAt:Date.now()};localStorage.setItem(e,JSON.stringify(n))}catch{}}function Nv(e){try{localStorage.removeItem(e)}catch{}}function oJ(e){return`feedback-draft:${e.id??e.title}`}const FN="plan-filters",BN="detail-view";function aJ(){return mc(FN)??Tv}function lJ(){return mc(BN)??"details"}function ts(e){return gc(FN,e),e}function cJ(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:_t(e,()=>{const{runtimeReachable:n,githubConfig:r}=t();return!n&&r?pY(r):eT()},n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:aJ(),togglePlanStatus:n=>e(r=>({planFilters:ts({...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(s=>s!==n):[...r.planFilters.statuses,n]})})),togglePlanTag:n=>e(r=>({planFilters:ts({...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(s=>s!==n):[...r.planFilters.tags,n]})})),toggleNoteStatus:n=>e(r=>({planFilters:ts({...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(s=>s!==n):[...r.planFilters.noteStatuses,n]})})),setPlanSearch:n=>e(r=>({planFilters:ts({...r.planFilters,search:n})})),setSubjectFilter:n=>e(r=>({planFilters:ts({...r.planFilters,subject:n})})),setPlanSortKey:n=>e(r=>({planFilters:ts({...r.planFilters,sortKey:n,groupBySubject:!1})})),togglePlanSortDirection:()=>e(n=>({planFilters:ts({...n.planFilters,sortDirection:n.planFilters.sortDirection==="asc"?"desc":"asc",groupBySubject:!1})})),toggleGroupBySubject:()=>e(n=>({planFilters:ts({...n.planFilters,groupBySubject:!n.planFilters.groupBySubject})})),detailView:lJ(),setDetailView:n=>{gc(BN,n),e({detailView:n})}}}const uJ={horizons:[],statuses:[]},dJ=e=>[...new Set(e.links.map(t=>t.status))],VN=(e,t)=>t.length===0||e.links.some(n=>t.includes(n.status)),UN=(e,t)=>t.length===0||t.includes(e),qae=(e,t)=>e.horizons.filter(n=>UN(n.title,t.horizons)).map(n=>({...n,items:n.items.filter(r=>VN(r,t.statuses))})),Yae=(e,t)=>Object.fromEntries(e.horizons.map(n=>[n.title,n.items.filter(r=>VN(r,t.statuses)).length])),Jae=(e,t)=>{const n={};for(const r of e.horizons)if(UN(r.title,t.horizons))for(const s of r.items)for(const i of dJ(s))n[i]=(n[i]??0)+1;return n};function fJ(e,t){return{roadmap:null,roadmapLoading:!1,roadmapError:null,loadRoadmap:_t(e,JP,n=>({roadmap:n,roadmapError:null}),n=>({roadmapError:String(n)}),"roadmapLoading"),roadmapFilters:uJ,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]}}))}}const hJ="data-paper-camp-mount";function pJ(e){return(e==null?void 0:e.getAttribute(hJ))??""}const Li=typeof document>"u"?"":pJ(document.getElementById("root")),lf="paper-camp.projects",Zl="paper-camp.activeProjectId",mJ="paper-camp.runtimes",gJ="paper-camp.activeRuntimeUrl",yJ="paper-camp.hubRepos";function Ms(e){return e.kind==="runtime"?e.runtimeUrl:`${e.owner}/${e.repo}`}function Hg(e){if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}function WN(e){const t=e.indexOf("/");return t===-1?[e,""]:[e.slice(0,t),e.slice(t+1)]}function KN(e){if(e.getItem(lf)!==null)return;const t=Hg(e.getItem(mJ)),n=Hg(e.getItem(yJ));if(t.length===0&&n.length===0)return;const r=[...t.map(i=>({kind:"runtime",runtimeUrl:i.runtimeUrl,pairingToken:i.pairingToken,label:i.label})),...n.map(i=>{const[o,a]=WN(i);return{kind:"github",owner:o,repo:a}})];e.setItem(lf,JSON.stringify(r));const s=e.getItem(gJ);s&&e.setItem(Zl,s)}function fa(e){return e?(KN(e),Hg(e.getItem(lf))):[]}function ch(e,t){e==null||e.setItem(lf,JSON.stringify(t))}function Gg(e){return fa(e)}function xJ(e){return e?(KN(e),e.getItem(Zl)):null}function vJ(e,t){var o;const n=fa(t),r=(o=n.find(a=>a.kind==="runtime"&&a.runtimeUrl===e.runtimeUrl))==null?void 0:o.label,s={kind:"runtime",runtimeUrl:e.runtimeUrl,pairingToken:e.pairingToken,label:r},i=n.filter(a=>!(a.kind==="runtime"&&a.runtimeUrl===e.runtimeUrl));return i.push(s),ch(t,i),s}function wJ(e,t){const[n,r]=WN(e),s=fa(t),i=s.find(a=>a.kind==="github"&&a.owner===n&&a.repo===r);if(i)return i;const o={kind:"github",owner:n,repo:r};return ch(t,[...s,o]),o}function bJ(e,t){const n=fa(t).filter(r=>Ms(r)!==e);ch(t,n),(t==null?void 0:t.getItem(Zl))===e&&t.removeItem(Zl)}function kJ(e,t,n){const r=fa(n),s=r.findIndex(a=>Ms(a)===e);if(s===-1)return null;const i=t.trim(),o={...r[s],label:i===""?void 0:i};return r[s]=o,ch(n,r),o}function HN(e,t){const n=fa(t).find(r=>Ms(r)===e);return n?(t==null||t.setItem(Zl,e),n):null}const _J="runtime",SJ="token";function v_(e){return e.kind==="runtime"}function CJ(e){return{runtimeUrl:e.runtimeUrl,pairingToken:e.pairingToken,label:e.label}}function jJ(e){const t=new URLSearchParams((e==null?void 0:e.search)??"");return{runtimeUrl:t.get(_J)??"",pairingToken:t.get(SJ)}}function EJ(e,t){vJ(t,e),HN(t.runtimeUrl,e)}function PJ(e,t){const n=jJ(e);if(n.runtimeUrl)return EJ(t,n),n;const r=xJ(t),s=r?Gg(t).find(i=>v_(i)&&i.runtimeUrl===r):null;return s&&v_(s)?CJ(s):{runtimeUrl:"",pairingToken:null}}const GN=PJ(typeof window>"u"?null:window.location,typeof window>"u"?null:window.localStorage),w_=!!Li,b_=!!GN.runtimeUrl,TJ=15e3,k_=2,NJ=1500,IJ=e=>new Promise(t=>setTimeout(t,e));async function AJ(){for(let e=0;e<=k_;e++){try{if((await fetch(W("/api/package-name"),{signal:AbortSignal.timeout(TJ)})).ok)return!0}catch{}e<k_&&await IJ(NJ)}return!1}function RJ(e){return{runtimeReachable:w_,runtimeChecking:b_,checkRuntimeReachable:_t(e,async()=>w_?!0:b_?AJ():!1,t=>({runtimeReachable:t}),()=>({runtimeReachable:!1}),"runtimeChecking")}}const LJ=async()=>(await J(W("/api/status"))).json(),MJ=async()=>{await J(W("/api/status/check?name=consistency"),{method:"POST"})},$J=async()=>{const e=await J(W("/api/refresh"),{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function DJ(e,t){return{status:null,refreshing:!1,loadStatus:_t(e,LJ,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await $J().catch(()=>{}),await Promise.all([t().loadPlans(),t().loadIdeas(),t().loadArchivableIdeas(),t().loadSuggestions(),t().loadStatus(),t().loadConsistency(),t().loadDoctor(),t().loadGitStatus(),t().loadAgentStatus(),t().loadAgentAuthStatus()]);const n=t().plansError;return n?{ok:!1,error:n}:{ok:!0}}finally{e({refreshing:!1})}},runConsistencyCheck:async()=>{try{await MJ()}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 HP(i);return await Ng(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:_t(e,aW,n=>({consistency:n})),doctor:{findings:[],errorCount:0,warningCount:0},loadDoctor:_t(e,lW,n=>({doctor:n})),gitStatus:null,gitBranch:null,gitAhead:0,gitBehind:0,gitDiverged:!1,gitBranchHygiene:null,gitStashes:[],loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:s,behind:i,diverged:o,branchHygiene:a,stashes:l}=await J8();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a,gitStashes:l}),!0}catch{return!1}},capabilities:[],loadCapabilities:_t(e,ZP,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function OJ(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:_t(e,nW,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await rW(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await sW(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await oW(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await pW();return await t().refreshAll(),n}}}function zJ(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:_t(e,tW,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const M=g9()((e,t)=>({...X9(e),...cJ(e,t),...fJ(e),...wY(e,t),...OJ(e,t),...zJ(e),...bW(e,t),...DJ(e,t),...Y9(e,t),...eW(e,t),...kY(e),...bY(e,t),...RJ(e),..._W(e)})),uh=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),Kr=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),ZN=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},FJ=e=>e.capabilities.filter(t=>t.status!=="ok").length,BJ=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1},VJ=e=>{var t;return((t=e.agentStatus.find(n=>n.rateLimit))==null?void 0:t.rateLimit)??null},UJ=({children:e,onClick:t})=>d.jsx("button",{type:"button",onClick:t,className:"bg-transparent border-none p-0 text-watercolor-amber-dark cursor-pointer underline [font:inherit]",children:e}),WJ=e=>e<=0?"today":e===1?"1 day ago":`${e} days ago`,KJ="A sync pop failed and left work parked here. Recover with `git restore --source=origin/main --staged --worktree .` then `git merge --ff-only`.",HJ=({entry:e})=>{const[t,n]=b.useState(null),[r,s]=b.useState(!1),[i,o]=b.useState(null),[a,l]=b.useState(!1),c=async()=>{if(a){l(!1);return}if(l(!0),!(t!==null||r)){s(!0),o(null);try{n(await X8(e.index))}catch(u){o(u.message)}finally{s(!1)}}};return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs(UJ,{onClick:c,children:[e.branch,": ",e.message," · ",WJ(e.ageDays)]}),a&&d.jsx("pre",{className:"m-0 max-h-64 overflow-auto whitespace-pre-wrap font-mono text-2xs opacity-80",children:r?"Loading…":i??t})]})},GJ=()=>{const e=M(s=>s.gitStashes),[t,n]=b.useState(!1);if(e.length===0)return null;const r=e.some(s=>s.own);return d.jsxs("div",{children:[d.jsx("button",{type:"button",onClick:()=>n(s=>!s),className:"inline-flex bg-none bg-transparent border-none p-0 cursor-pointer","aria-expanded":t,children:d.jsxs(ne,{size:"small",variant:r?"warning":"neutral",children:[e.length," stash",e.length===1?"":"es"]})}),t&&d.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[r&&d.jsx("p",{className:"m-0 text-2xs opacity-80",children:KJ}),e.map(s=>d.jsx(HJ,{entry:s},s.index))]})]})};function Ge(e){const t=e.split(`
|
|
281
|
+
`).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}function wu(e,t){const{toast:n}=Je(),r=M(o=>o.activeGitAction),s=M(o=>o.setActiveGitAction),i=b.useCallback(async o=>{if(!M.getState().activeGitAction){s(e);try{await o()}catch(a){n({title:t,description:Ge(a.message),variant:"error"})}finally{s(null)}}},[n,t,e,s]);return[r===e,i]}function ZJ(){const e=M(_=>_.loadGitStatus),t=M(_=>_.loadPlans),n=M(_=>_.loadIdeas),r=M(_=>_.loadDiffFiles),s=M(_=>_.activeGitAction!==null),{toast:i,dismiss:o}=Je(),a=()=>Promise.all([e(),t(),n(),r()]),[l,c]=wu("push","Push failed"),[u,f]=wu("sync","Sync failed"),[h,p]=wu("pull","Pull failed"),[m,g]=wu("fix-divergence","Fix failed"),x=b.useCallback((_,S)=>{if(S.recovering)return i({title:`${_} needs help`,description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),!0;if("conflictPrompt"in S){const{conflictPrompt:j,message:E}=S,T=i({title:`${_} hit a conflict`,description:d.jsxs("div",{className:"flex flex-col items-start gap-2",children:[d.jsx("span",{children:Ge(E)}),d.jsx(ee,{size:"small",onClick:async()=>{const P=await i9(j).catch(N=>({ok:!1,error:Ge(N.message)}));P.ok&&o(T),i({title:P.ok?"Resolving conflict":"Could not start the agent",description:P.ok?"Handed off to the agent — see Stack for progress":P.error??"The agent did not start.",variant:P.ok?"warning":"error"})},children:"Ask the agent to resolve"})]}),variant:"error",duration:0});return!0}return!1},[i,o]);return{pushing:l,syncing:u,pulling:h,fixingDivergence:m,gitActionBusy:s,handlePush:()=>c(async()=>{await t9(),await Promise.all([e(),r()])}),handleSync:()=>f(async()=>{const _=await n9();if(!_.ok){if(x("Sync",_)){await e();return}throw new Error(_.message)}await a()}),handlePull:()=>p(async()=>{await r9(),await a()}),handleFixDivergence:()=>g(async()=>{const _=await s9();if(!_.ok){if(x("Fix",_)){await e();return}throw new Error(_.message)}await a()})}}const qJ=()=>{const e=M(c=>c.gitAhead),t=M(c=>c.gitBranchHygiene),{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=ZJ();return d.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[d.jsx(ye,{content:t==="clean-on-main"?"Already on clean main":void 0,children:d.jsx(ee,{size:"small",className:"whitespace-nowrap",variant:"secondary",icon:d.jsx(VP,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),d.jsx(ee,{size:"small",className:"whitespace-nowrap",icon:d.jsx($8,{size:14}),disabled:i||e===0,onClick:o,children:n?"Pushing…":e>0?`Push (${e})`:"Push"}),d.jsx(ee,{size:"small",className:"whitespace-nowrap",variant:"secondary",icon:d.jsx(D8,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})};function YJ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const JJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XJ={};function __(e,t){return(XJ.jsx?QJ:JJ).test(e)}const eQ=/[ \t\n\f\r]/g;function tQ(e){return typeof e=="object"?e.type==="text"?S_(e.value):!1:S_(e)}function S_(e){return e.replace(eQ,"")===""}class yc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yc.prototype.normal={};yc.prototype.property={};yc.prototype.space=void 0;function qN(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new yc(n,r,t)}function Zg(e){return e.toLowerCase()}class Qt{constructor(t,n){this.attribute=n,this.property=t}}Qt.prototype.attribute="";Qt.prototype.booleanish=!1;Qt.prototype.boolean=!1;Qt.prototype.commaOrSpaceSeparated=!1;Qt.prototype.commaSeparated=!1;Qt.prototype.defined=!1;Qt.prototype.mustUseProperty=!1;Qt.prototype.number=!1;Qt.prototype.overloadedBoolean=!1;Qt.prototype.property="";Qt.prototype.spaceSeparated=!1;Qt.prototype.space=void 0;let nQ=0;const oe=Mi(),et=Mi(),qg=Mi(),H=Mi(),Se=Mi(),vi=Mi(),rn=Mi();function Mi(){return 2**++nQ}const Yg=Object.freeze(Object.defineProperty({__proto__:null,boolean:oe,booleanish:et,commaOrSpaceSeparated:rn,commaSeparated:vi,number:H,overloadedBoolean:qg,spaceSeparated:Se},Symbol.toStringTag,{value:"Module"})),Op=Object.keys(Yg);class Iv extends Qt{constructor(t,n,r,s){let i=-1;if(super(t,n),C_(this,"space",s),typeof r=="number")for(;++i<Op.length;){const o=Op[i];C_(this,Op[i],(r&Yg[o])===Yg[o])}}}Iv.prototype.defined=!0;function C_(e,t,n){n&&(e[t]=n)}function ha(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new Iv(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Zg(r)]=r,n[Zg(i.attribute)]=r}return new yc(t,n,e.space)}const YN=ha({properties:{ariaActiveDescendant:null,ariaAtomic:et,ariaAutoComplete:null,ariaBusy:et,ariaChecked:et,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:Se,ariaCurrent:null,ariaDescribedBy:Se,ariaDetails:null,ariaDisabled:et,ariaDropEffect:Se,ariaErrorMessage:null,ariaExpanded:et,ariaFlowTo:Se,ariaGrabbed:et,ariaHasPopup:null,ariaHidden:et,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Se,ariaLevel:H,ariaLive:null,ariaModal:et,ariaMultiLine:et,ariaMultiSelectable:et,ariaOrientation:null,ariaOwns:Se,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:et,ariaReadOnly:et,ariaRelevant:null,ariaRequired:et,ariaRoleDescription:Se,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:et,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function JN(e,t){return t in e?e[t]:t}function QN(e,t){return JN(e,t.toLowerCase())}const rQ=ha({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:vi,acceptCharset:Se,accessKey:Se,action:null,allow:null,allowFullScreen:oe,allowPaymentRequest:oe,allowUserMedia:oe,alpha:oe,alt:null,as:null,async:oe,autoCapitalize:null,autoComplete:Se,autoFocus:oe,autoPlay:oe,blocking:Se,capture:null,charSet:null,checked:oe,cite:null,className:Se,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:et,controls:oe,controlsList:Se,coords:H|vi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:oe,defer:oe,dir:null,dirName:null,disabled:oe,download:qg,draggable:et,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:oe,formTarget:null,headers:Se,height:H,hidden:qg,high:H,href:null,hrefLang:null,htmlFor:Se,httpEquiv:Se,id:null,imageSizes:null,imageSrcSet:null,inert:oe,inputMode:null,integrity:null,is:null,isMap:oe,itemId:null,itemProp:Se,itemRef:Se,itemScope:oe,itemType:Se,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:oe,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:oe,muted:oe,name:null,nonce:null,noModule:oe,noValidate:oe,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:oe,optimum:H,pattern:null,ping:Se,placeholder:null,playsInline:oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:oe,referrerPolicy:null,rel:Se,required:oe,reversed:oe,rows:H,rowSpan:H,sandbox:Se,scope:null,scoped:oe,seamless:oe,selected:oe,shadowRootClonable:oe,shadowRootCustomElementRegistry:oe,shadowRootDelegatesFocus:oe,shadowRootMode:null,shadowRootSerializable:oe,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:et,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:oe,useMap:null,value:et,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Se,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:oe,declare:oe,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:oe,noHref:oe,noShade:oe,noWrap:oe,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:et,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:oe,disablePictureInPicture:oe,disableRemotePlayback:oe,exportParts:vi,part:Se,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:QN}),sQ=ha({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:rn,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:Se,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:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,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:vi,g2:vi,glyphName:vi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:rn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,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:H,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:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Se,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rn,rev:rn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rn,requiredFeatures:rn,requiredFonts:rn,requiredFormats:rn,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:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:rn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rn,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:JN}),XN=ha({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()}}),eI=ha({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:QN}),tI=ha({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),iQ={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"},oQ=/[A-Z]/g,j_=/-[a-z]/g,aQ=/^data[-\w.:]+$/i;function lQ(e,t){const n=Zg(t);let r=t,s=Qt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&aQ.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(j_,uQ);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!j_.test(i)){let o=i.replace(oQ,cQ);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Iv}return new s(r,t)}function cQ(e){return"-"+e.toLowerCase()}function uQ(e){return e.charAt(1).toUpperCase()}const dQ=qN([YN,rQ,XN,eI,tI],"html"),Av=qN([YN,sQ,XN,eI,tI],"svg");function fQ(e){return e.join(" ").trim()}var Rv={},E_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,hQ=/\n/g,pQ=/^\s*/,mQ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,gQ=/^:\s*/,yQ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,xQ=/^[;\s]*/,vQ=/^\s+|\s+$/g,wQ=`
|
|
282
|
+
`,P_="/",T_="*",ri="",bQ="comment",kQ="declaration";function _Q(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 g=m.match(hQ);g&&(n+=g.length);var x=m.lastIndexOf(wQ);r=~x?m.length-x:r+m.length}function i(){var m={line:n,column:r};return function(g){return g.position=new o(m),c(),g}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(m){var g=m.exec(e);if(g){var x=g[0];return s(x),e=e.slice(x.length),g}}function c(){l(pQ)}function u(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=i();if(!(P_!=e.charAt(0)||T_!=e.charAt(1))){for(var g=2;ri!=e.charAt(g)&&(T_!=e.charAt(g)||P_!=e.charAt(g+1));)++g;if(g+=2,ri===e.charAt(g-1))return a("End of comment missing");var x=e.slice(2,g-2);return r+=2,s(x),e=e.slice(g),r+=2,m({type:bQ,comment:x})}}function h(){var m=i(),g=l(mQ);if(g){if(f(),!l(gQ))return a("property missing ':'");var x=l(yQ),y=m({type:kQ,property:N_(g[0].replace(E_,ri)),value:x?N_(x[0].replace(E_,ri)):ri});return l(xQ),y}}function p(){var m=[];u(m);for(var g;g=h();)g!==!1&&(m.push(g),u(m));return m}return c(),p()}function N_(e){return e?e.replace(vQ,ri):ri}var SQ=_Q,CQ=sd&&sd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rv,"__esModule",{value:!0});Rv.default=EQ;const jQ=CQ(SQ);function EQ(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,jQ.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 dh={};Object.defineProperty(dh,"__esModule",{value:!0});dh.camelCase=void 0;var PQ=/^--[a-zA-Z0-9_-]+$/,TQ=/-([a-z])/g,NQ=/^[^-]+$/,IQ=/^-(webkit|moz|ms|o|khtml)-/,AQ=/^-(ms)-/,RQ=function(e){return!e||NQ.test(e)||PQ.test(e)},LQ=function(e,t){return t.toUpperCase()},I_=function(e,t){return"".concat(t,"-")},MQ=function(e,t){return t===void 0&&(t={}),RQ(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(AQ,I_):e=e.replace(IQ,I_),e.replace(TQ,LQ))};dh.camelCase=MQ;var $Q=sd&&sd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},DQ=$Q(Rv),OQ=dh;function Jg(e,t){var n={};return!e||typeof e!="string"||(0,DQ.default)(e,function(r,s){r&&s&&(n[(0,OQ.camelCase)(r,t)]=s)}),n}Jg.default=Jg;var zQ=Jg;const FQ=pf(zQ),nI=rI("end"),Lv=rI("start");function rI(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 BQ(e){const t=Lv(e),n=nI(e);if(t&&n)return{start:t,end:n}}function dl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?A_(e.position):"start"in e||"end"in e?A_(e):"line"in e||"column"in e?Qg(e):""}function Qg(e){return R_(e&&e.line)+":"+R_(e&&e.column)}function A_(e){return Qg(e&&e.start)+"-"+Qg(e&&e.end)}function R_(e){return e&&typeof e=="number"?e:1}class jt 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=dl(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}}jt.prototype.file="";jt.prototype.name="";jt.prototype.reason="";jt.prototype.message="";jt.prototype.stack="";jt.prototype.column=void 0;jt.prototype.line=void 0;jt.prototype.ancestors=void 0;jt.prototype.cause=void 0;jt.prototype.fatal=void 0;jt.prototype.place=void 0;jt.prototype.ruleId=void 0;jt.prototype.source=void 0;const Mv={}.hasOwnProperty,VQ=new Map,UQ=/[A-Z]/g,WQ=new Set(["table","tbody","thead","tfoot","tr"]),KQ=new Set(["td","th"]),sI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function HQ(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=eX(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=XQ(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"?Av:dQ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=iI(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function iI(e,t,n){if(t.type==="element")return GQ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ZQ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return YQ(e,t,n);if(t.type==="mdxjsEsm")return qQ(e,t);if(t.type==="root")return JQ(e,t,n);if(t.type==="text")return QQ(e,t)}function GQ(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Av,e.schema=s),e.ancestors.push(t);const i=aI(e,t.tagName,!1),o=tX(e,t);let a=Dv(e,t);return WQ.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!tQ(l):!0})),oI(e,o,i,t),$v(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function ZQ(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)}ql(e,t.position)}function qQ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ql(e,t.position)}function YQ(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Av,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:aI(e,t.name,!0),o=nX(e,t),a=Dv(e,t);return oI(e,o,i,t),$v(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function JQ(e,t,n){const r={};return $v(r,Dv(e,t)),e.create(t,e.Fragment,r,n)}function QQ(e,t){return t.value}function oI(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $v(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function XQ(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 eX(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=Lv(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 tX(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Mv.call(t.properties,s)){const i=rX(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&KQ.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 nX(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 ql(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 ql(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Dv(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:VQ;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=iI(e,i,o);a!==void 0&&n.push(a)}return n}function rX(e,t,n){const r=lQ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?YJ(n):fQ(n)),r.property==="style"){let s=typeof n=="object"?n:sX(e,String(n));return e.stylePropertyNameCase==="css"&&(s=iX(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?iQ[r.property]||r.property:r.attribute,n]}}function sX(e,t){try{return FQ(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new jt("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=sI+"#cannot-parse-style-attribute",s}}function aI(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=__(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=__(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return Mv.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);ql(e)}function ql(e,t){const n=new jt("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=sI+"#cannot-handle-mdx-estrees-without-createevaluater",n}function iX(e){const t={};let n;for(n in e)Mv.call(e,n)&&(t[oX(n)]=e[n]);return t}function oX(e){let t=e.replace(UQ,aX);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function aX(e){return"-"+e.toLowerCase()}const zp={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"]},lX={};function cX(e,t){const n=lX,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return lI(e,r,s)}function lI(e,t,n){if(uX(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 L_(e.children,t,n)}return Array.isArray(e)?L_(e,t,n):""}function L_(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=lI(e[s],t,n);return r.join("")}function uX(e){return!!(e&&typeof e=="object")}const M_=document.createElement("i");function Ov(e){const t="&"+e+";";M_.innerHTML=t;const n=M_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _r(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 En(e,t){return e.length>0?(_r(e,e.length,0,t),e):t}const $_={}.hasOwnProperty;function dX(e){const t={};let n=-1;for(;++n<e.length;)fX(t,e[n]);return t}function fX(e,t){let n;for(n in t){const s=($_.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){$_.call(s,o)||(s[o]=[]);const a=i[o];hX(s[o],Array.isArray(a)?a:a?[a]:[])}}}function hX(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_r(e,0,0,r)}function cI(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 Io(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yr=Us(/[A-Za-z]/),un=Us(/[\dA-Za-z]/),pX=Us(/[#-'*+\--9=?A-Z^-~]/);function Xg(e){return e!==null&&(e<32||e===127)}const ey=Us(/\d/),mX=Us(/[\dA-Fa-f]/),gX=Us(/[!-/:-@[-`{-~]/);function se(e){return e!==null&&e<-2}function Gt(e){return e!==null&&(e<0||e===32)}function pe(e){return e===-2||e===-1||e===32}const yX=Us(new RegExp("\\p{P}|\\p{S}","u")),xX=Us(/\s/);function Us(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function pa(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&un(e.charCodeAt(n+1))&&un(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 Te(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return pe(l)?(e.enter(n),a(l)):t(l)}function a(l){return pe(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const vX={tokenize:wX};function wX(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"),Te(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 se(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const bX={tokenize:kX},D_={tokenize:_X};function kX(e){const t=this,n=[];let r=0,s,i,o;return a;function a(w){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&v();const k=t.events.length;let _=k,S;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){S=t.events[_][1].end;break}y(r);let j=k;for(;j<t.events.length;)t.events[j][1].end={...S},j++;return _r(t.events,_+1,0,t.events.slice(k)),t.events.length=j,c(w)}return a(w)}function c(w){if(r===n.length){if(!s)return h(w);if(s.currentConstruct&&s.currentConstruct.concrete)return m(w);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(D_,u,f)(w)}function u(w){return s&&v(),y(r),h(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(D_,p,m)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){s&&v(),y(0),e.consume(w);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),g(w)}function g(w){if(w===null){x(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return se(w)?(e.consume(w),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),g)}function x(w,k){const _=t.sliceStream(w);if(k&&_.push(null),w.previous=i,i&&(i.next=w),i=w,s.defineSkip(w.start),s.write(_),t.parser.lazy[w.start.line]){let S=s.events.length;for(;S--;)if(s.events[S][1].start.offset<o&&(!s.events[S][1].end||s.events[S][1].end.offset>o))return;const j=t.events.length;let E=j,T,P;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(T){P=t.events[E][1].end;break}T=!0}for(y(r),S=j;S<t.events.length;)t.events[S][1].end={...P},S++;_r(t.events,E+1,0,t.events.slice(j)),t.events.length=S}}function y(w){let k=n.length;for(;k-- >w;){const _=n[k];t.containerState=_[1],_[0].exit.call(t,e)}n.length=w}function v(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function _X(e,t,n){return Te(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function O_(e){if(e===null||Gt(e)||xX(e))return 1;if(yX(e))return 2}function zv(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 ty={name:"attention",resolveAll:SX,tokenize:CX};function SX(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 f={...e[r][1].end},h={...e[n][1].start};z_(f,-l),z_(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,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=En(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=En(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),c=En(c,zv(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=En(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=En(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,_r(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 CX(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=O_(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=O_(l),f=!u||u===2&&s||n.includes(l),h=!s||s===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(s||!h)),c._close=!!(i===42?h:h&&(u||!f)),t(l)}}function z_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jX={name:"autolink",tokenize:EX};function EX(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 yr(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||un(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||un(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||Xg(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):pX(p)?(e.consume(p),c):n(p)}function u(p){return un(p)?f(p):n(p)}function f(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||un(p))&&r++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const fh={partial:!0,tokenize:PX};function PX(e,t,n){return r;function r(i){return pe(i)?Te(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||se(i)?t(i):n(i)}}const uI={continuation:{tokenize:NX},exit:IX,name:"blockQuote",tokenize:TX};function TX(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 pe(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function NX(e,t,n){const r=this;return s;function s(o){return pe(o)?Te(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(uI,t,n)(o)}}function IX(e){e.exit("blockQuote")}const dI={name:"characterEscape",tokenize:AX};function AX(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 gX(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const fI={name:"characterReference",tokenize:RX};function RX(e,t,n){const r=this;let s=0,i,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,o=un,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=mX,u):(e.enter("characterReferenceValue"),i=7,o=ey,u(f))}function u(f){if(f===59&&s){const h=e.exit("characterReferenceValue");return o===un&&!Ov(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&s++<i?(e.consume(f),u):n(f)}}const F_={partial:!0,tokenize:MX},B_={concrete:!0,name:"codeFenced",tokenize:LX};function LX(e,t,n){const r=this,s={partial:!0,tokenize:_};let i=0,o=0,a;return l;function l(S){return c(S)}function c(S){const j=r.events[r.events.length-1];return i=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,a=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===a?(o++,e.consume(S),u):o<3?n(S):(e.exit("codeFencedFenceSequence"),pe(S)?Te(e,f,"whitespace")(S):f(S))}function f(S){return S===null||se(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(F_,g,k)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||se(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(S)):pe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Te(e,p,"whitespace")(S)):S===96&&S===a?n(S):(e.consume(S),h)}function p(S){return S===null||se(S)?f(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||se(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?n(S):(e.consume(S),m)}function g(S){return e.attempt(s,k,x)(S)}function x(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return i>0&&pe(S)?Te(e,v,"linePrefix",i+1)(S):v(S)}function v(S){return S===null||se(S)?e.check(F_,g,k)(S):(e.enter("codeFlowValue"),w(S))}function w(S){return S===null||se(S)?(e.exit("codeFlowValue"),v(S)):(e.consume(S),w)}function k(S){return e.exit("codeFenced"),t(S)}function _(S,j,E){let T=0;return P;function P(z){return S.enter("lineEnding"),S.consume(z),S.exit("lineEnding"),N}function N(z){return S.enter("codeFencedFence"),pe(z)?Te(S,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):R(z)}function R(z){return z===a?(S.enter("codeFencedFenceSequence"),L(z)):E(z)}function L(z){return z===a?(T++,S.consume(z),L):T>=o?(S.exit("codeFencedFenceSequence"),pe(z)?Te(S,I,"whitespace")(z):I(z)):E(z)}function I(z){return z===null||se(z)?(S.exit("codeFencedFence"),j(z)):E(z)}}}function MX(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 Fp={name:"codeIndented",tokenize:DX},$X={partial:!0,tokenize:OX};function DX(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),Te(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):se(c)?e.attempt($X,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||se(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function OX(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Te(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):se(o)?s(o):n(o)}}const zX={name:"codeText",previous:BX,resolve:FX,tokenize:VX};function FX(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 BX(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function VX(e,t,n){let r=0,s,i;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),s=0,u(f)):se(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||se(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),s++,u):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}class UX{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&&Oa(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),Oa(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Oa(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);Oa(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Oa(this.left,n.reverse())}}}function Oa(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 hI(e){const t={};let n=-1,r,s,i,o,a,l,c;const u=new UX(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,WX(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 _r(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function WX(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,f,h=-1,p=n,m=0,g=0;const x=[g];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=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&&(g=h+1,x.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),h=x.length;h--;){const y=a.slice(x[h],x[h+1]),v=i.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}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 KX={resolve:GX,tokenize:ZX},HX={partial:!0,tokenize:qX};function GX(e){return hI(e),e}function ZX(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):se(a)?e.check(HX,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 qX(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Te(e,i,"linePrefix")}function i(o){if(o===null||se(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 pI(e,t,n,r,s,i,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||Xg(y)?n(y):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||se(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!u&&(y===null||y===41||Gt(y))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,g):y===41?(e.consume(y),u--,g):y===null||y===32||y===40||Xg(y)?n(y):(e.consume(y),y===92?x:g)}function x(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function mI(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):se(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||se(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!pe(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function gI(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):se(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Te(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||se(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:u)}function f(h){return h===o||h===92?(e.consume(h),u):u(h)}}function fl(e,t){let n;return r;function r(s){return se(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):pe(s)?Te(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const YX={name:"definition",tokenize:QX},JX={partial:!0,tokenize:XX};function QX(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return mI.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return s=Io(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 Gt(p)?fl(e,c)(p):c(p)}function c(p){return pI(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(JX,f,f)(p)}function f(p){return pe(p)?Te(e,h,"whitespace")(p):h(p)}function h(p){return p===null||se(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function XX(e,t,n){return r;function r(a){return Gt(a)?fl(e,s)(a):n(a)}function s(a){return gI(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return pe(a)?Te(e,o,"whitespace")(a):o(a)}function o(a){return a===null||se(a)?t(a):n(a)}}const eee={name:"hardBreakEscape",tokenize:tee};function tee(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return se(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const nee={name:"headingAtx",resolve:ree,tokenize:see};function ree(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"},_r(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function see(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||Gt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||se(u)?(e.exit("atxHeading"),t(u)):pe(u)?Te(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||Gt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const iee=["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"],V_=["pre","script","style","textarea"],oee={concrete:!0,name:"htmlFlow",resolveTo:cee,tokenize:uee},aee={partial:!0,tokenize:fee},lee={partial:!0,tokenize:dee};function cee(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 uee(e,t,n){const r=this;let s,i,o,a,l;return c;function c(A){return u(A)}function u(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),i=!0,g):A===63?(e.consume(A),s=3,r.interrupt?t:C):yr(A)?(e.consume(A),o=String.fromCharCode(A),x):n(A)}function h(A){return A===45?(e.consume(A),s=2,p):A===91?(e.consume(A),s=5,a=0,m):yr(A)?(e.consume(A),s=4,r.interrupt?t:C):n(A)}function p(A){return A===45?(e.consume(A),r.interrupt?t:C):n(A)}function m(A){const ge="CDATA[";return A===ge.charCodeAt(a++)?(e.consume(A),a===ge.length?r.interrupt?t:R:m):n(A)}function g(A){return yr(A)?(e.consume(A),o=String.fromCharCode(A),x):n(A)}function x(A){if(A===null||A===47||A===62||Gt(A)){const ge=A===47,ke=o.toLowerCase();return!ge&&!i&&V_.includes(ke)?(s=1,r.interrupt?t(A):R(A)):iee.includes(o.toLowerCase())?(s=6,ge?(e.consume(A),y):r.interrupt?t(A):R(A)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):i?v(A):w(A))}return A===45||un(A)?(e.consume(A),o+=String.fromCharCode(A),x):n(A)}function y(A){return A===62?(e.consume(A),r.interrupt?t:R):n(A)}function v(A){return pe(A)?(e.consume(A),v):P(A)}function w(A){return A===47?(e.consume(A),P):A===58||A===95||yr(A)?(e.consume(A),k):pe(A)?(e.consume(A),w):P(A)}function k(A){return A===45||A===46||A===58||A===95||un(A)?(e.consume(A),k):_(A)}function _(A){return A===61?(e.consume(A),S):pe(A)?(e.consume(A),_):w(A)}function S(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,j):pe(A)?(e.consume(A),S):E(A)}function j(A){return A===l?(e.consume(A),l=null,T):A===null||se(A)?n(A):(e.consume(A),j)}function E(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Gt(A)?_(A):(e.consume(A),E)}function T(A){return A===47||A===62||pe(A)?w(A):n(A)}function P(A){return A===62?(e.consume(A),N):n(A)}function N(A){return A===null||se(A)?R(A):pe(A)?(e.consume(A),N):n(A)}function R(A){return A===45&&s===2?(e.consume(A),$):A===60&&s===1?(e.consume(A),D):A===62&&s===4?(e.consume(A),U):A===63&&s===3?(e.consume(A),C):A===93&&s===5?(e.consume(A),V):se(A)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(aee,Q,L)(A)):A===null||se(A)?(e.exit("htmlFlowData"),L(A)):(e.consume(A),R)}function L(A){return e.check(lee,I,Q)(A)}function I(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),z}function z(A){return A===null||se(A)?L(A):(e.enter("htmlFlowData"),R(A))}function $(A){return A===45?(e.consume(A),C):R(A)}function D(A){return A===47?(e.consume(A),o="",O):R(A)}function O(A){if(A===62){const ge=o.toLowerCase();return V_.includes(ge)?(e.consume(A),U):R(A)}return yr(A)&&o.length<8?(e.consume(A),o+=String.fromCharCode(A),O):R(A)}function V(A){return A===93?(e.consume(A),C):R(A)}function C(A){return A===62?(e.consume(A),U):A===45&&s===2?(e.consume(A),C):R(A)}function U(A){return A===null||se(A)?(e.exit("htmlFlowData"),Q(A)):(e.consume(A),U)}function Q(A){return e.exit("htmlFlow"),t(A)}}function dee(e,t,n){const r=this;return s;function s(o){return se(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 fee(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(fh,t,n)}}const hee={name:"htmlText",tokenize:pee};function pee(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),_):C===63?(e.consume(C),w):yr(C)?(e.consume(C),E):n(C)}function c(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),i=0,m):yr(C)?(e.consume(C),v):n(C)}function u(C){return C===45?(e.consume(C),p):n(C)}function f(C){return C===null?n(C):C===45?(e.consume(C),h):se(C)?(o=f,D(C)):(e.consume(C),f)}function h(C){return C===45?(e.consume(C),p):f(C)}function p(C){return C===62?$(C):C===45?h(C):f(C)}function m(C){const U="CDATA[";return C===U.charCodeAt(i++)?(e.consume(C),i===U.length?g:m):n(C)}function g(C){return C===null?n(C):C===93?(e.consume(C),x):se(C)?(o=g,D(C)):(e.consume(C),g)}function x(C){return C===93?(e.consume(C),y):g(C)}function y(C){return C===62?$(C):C===93?(e.consume(C),y):g(C)}function v(C){return C===null||C===62?$(C):se(C)?(o=v,D(C)):(e.consume(C),v)}function w(C){return C===null?n(C):C===63?(e.consume(C),k):se(C)?(o=w,D(C)):(e.consume(C),w)}function k(C){return C===62?$(C):w(C)}function _(C){return yr(C)?(e.consume(C),S):n(C)}function S(C){return C===45||un(C)?(e.consume(C),S):j(C)}function j(C){return se(C)?(o=j,D(C)):pe(C)?(e.consume(C),j):$(C)}function E(C){return C===45||un(C)?(e.consume(C),E):C===47||C===62||Gt(C)?T(C):n(C)}function T(C){return C===47?(e.consume(C),$):C===58||C===95||yr(C)?(e.consume(C),P):se(C)?(o=T,D(C)):pe(C)?(e.consume(C),T):$(C)}function P(C){return C===45||C===46||C===58||C===95||un(C)?(e.consume(C),P):N(C)}function N(C){return C===61?(e.consume(C),R):se(C)?(o=N,D(C)):pe(C)?(e.consume(C),N):T(C)}function R(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,L):se(C)?(o=R,D(C)):pe(C)?(e.consume(C),R):(e.consume(C),I)}function L(C){return C===s?(e.consume(C),s=void 0,z):C===null?n(C):se(C)?(o=L,D(C)):(e.consume(C),L)}function I(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||Gt(C)?T(C):(e.consume(C),I)}function z(C){return C===47||C===62||Gt(C)?T(C):n(C)}function $(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function D(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),O}function O(C){return pe(C)?Te(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):V(C)}function V(C){return e.enter("htmlTextData"),o(C)}}const Fv={name:"labelEnd",resolveAll:xee,resolveTo:vee,tokenize:wee},mee={tokenize:bee},gee={tokenize:kee},yee={tokenize:_ee};function xee(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&&_r(e,0,e.length,n),e}function vee(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=En(a,e.slice(i+1,i+r+3)),a=En(a,[["enter",u,t]]),a=En(a,zv(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),a=En(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=En(a,e.slice(o+1)),a=En(a,[["exit",l,t]]),_r(e,i,e.length,a),e}function wee(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?f(h):(o=r.parser.defined.includes(Io(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(mee,u,o?u:f)(h):h===91?e.attempt(gee,u,o?c:f)(h):o?u(h):f(h)}function c(h){return e.attempt(yee,u,f)(h)}function u(h){return t(h)}function f(h){return i._balanced=!0,n(h)}}function bee(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),s}function s(f){return Gt(f)?fl(e,i)(f):i(f)}function i(f){return f===41?u(f):pI(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return Gt(f)?fl(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?gI(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Gt(f)?fl(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function kee(e,t,n){const r=this;return s;function s(a){return mI.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Io(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function _ee(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 See={name:"labelStartImage",resolveAll:Fv.resolveAll,tokenize:Cee};function Cee(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 jee={name:"labelStartLink",resolveAll:Fv.resolveAll,tokenize:Eee};function Eee(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 Bp={name:"lineEnding",tokenize:Pee};function Pee(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Te(e,t,"linePrefix")}}const td={name:"thematicBreak",tokenize:Tee};function Tee(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||se(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),pe(c)?Te(e,a,"whitespace")(c):a(c))}}const Ft={continuation:{tokenize:Ree},exit:Mee,name:"list",tokenize:Aee},Nee={partial:!0,tokenize:$ee},Iee={partial:!0,tokenize:Lee};function Aee(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:ey(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(td,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 ey(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(fh,r.interrupt?n:u,e.attempt(Nee,h,f))}function u(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return pe(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 Ree(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(fh,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Te(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!pe(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(Iee,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Te(e,e.attempt(Ft,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Lee(e,t,n){const r=this;return Te(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 Mee(e){e.exit(this.containerState.type)}function $ee(e,t,n){const r=this;return Te(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!pe(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const U_={name:"setextUnderline",resolveTo:Dee,tokenize:Oee};function Dee(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 Oee(e,t,n){const r=this;let s;return i;function i(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(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"),pe(c)?Te(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||se(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const zee={tokenize:Fee};function Fee(e){const t=this,n=e.attempt(fh,r,e.attempt(this.parser.constructs.flowInitial,s,Te(e,e.attempt(this.parser.constructs.flow,s,e.attempt(KX,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 Bee={resolveAll:xI()},Vee=yI("string"),Uee=yI("text");function yI(e){return{resolveAll:xI(e==="text"?Wee: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 f=s[u];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function xI(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 Wee(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 Kee={42:Ft,43:Ft,45:Ft,48:Ft,49:Ft,50:Ft,51:Ft,52:Ft,53:Ft,54:Ft,55:Ft,56:Ft,57:Ft,62:uI},Hee={91:YX},Gee={[-2]:Fp,[-1]:Fp,32:Fp},Zee={35:nee,42:td,45:[U_,td],60:oee,61:U_,95:td,96:B_,126:B_},qee={38:fI,92:dI},Yee={[-5]:Bp,[-4]:Bp,[-3]:Bp,33:See,38:fI,42:ty,60:[jX,hee],91:jee,92:[eee,dI],93:Fv,95:ty,96:zX},Jee={null:[ty,Bee]},Qee={null:[42,95]},Xee={null:[]},ete=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Qee,contentInitial:Hee,disable:Xee,document:Kee,flow:Zee,flowInitial:Gee,insideSpan:Jee,string:qee,text:Yee},Symbol.toStringTag,{value:"Module"}));function tte(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:j(_),check:j(S),consume:v,enter:w,exit:k,interrupt:j(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(N){return o=En(o,N),x(),o[o.length-1]!==null?[]:(E(t,0),c.events=zv(i,c.events,c),c.events)}function h(N,R){return rte(p(N),R)}function p(N){return nte(o,N)}function m(){const{_bufferIndex:N,_index:R,line:L,column:I,offset:z}=r;return{_bufferIndex:N,_index:R,line:L,column:I,offset:z}}function g(N){s[N.line]=N.column,P()}function x(){let N;for(;r._index<o.length;){const R=o[r._index];if(typeof R=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<R.length;)y(R.charCodeAt(r._bufferIndex));else y(R)}}function y(N){u=u(N)}function v(N){se(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,P()):N!==-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=N}function w(N,R){const L=R||{};return L.type=N,L.start=m(),c.events.push(["enter",L,c]),a.push(L),L}function k(N){const R=a.pop();return R.end=m(),c.events.push(["exit",R,c]),R}function _(N,R){E(N,R.from)}function S(N,R){R.restore()}function j(N,R){return L;function L(I,z,$){let D,O,V,C;return Array.isArray(I)?Q(I):"tokenize"in I?Q([I]):U(I);function U(ve){return Xt;function Xt(ct){const bn=ct!==null&&ve[ct],sr=ct!==null&&ve.null,Sr=[...Array.isArray(bn)?bn:bn?[bn]:[],...Array.isArray(sr)?sr:sr?[sr]:[]];return Q(Sr)(ct)}}function Q(ve){return D=ve,O=0,ve.length===0?$:A(ve[O])}function A(ve){return Xt;function Xt(ct){return C=T(),V=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?ke():ve.tokenize.call(R?Object.assign(Object.create(c),R):c,l,ge,ke)(ct)}}function ge(ve){return N(V,C),z}function ke(ve){return C.restore(),++O<D.length?A(D[O]):$}}}function E(N,R){N.resolveAll&&!i.includes(N)&&i.push(N),N.resolve&&_r(c.events,R,c.events.length-R,N.resolve(c.events.slice(R),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function T(){const N=m(),R=c.previous,L=c.currentConstruct,I=c.events.length,z=Array.from(a);return{from:I,restore:$};function $(){r=N,c.previous=R,c.currentConstruct=L,c.events.length=I,a=z,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function nte(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 rte(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=`
|
|
283
|
+
`;break}case-3:{o=`\r
|
|
284
|
+
`;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 ste(e){const r={constructs:dX([ete,...(e||{}).extensions||[]]),content:s(vX),defined:[],document:s(bX),flow:s(zee),lazy:{},string:s(Vee),text:s(Uee)};return r;function s(i){return o;function o(a){return tte(r,i,a)}}}function ite(e){for(;!hI(e););return e}const W_=/[\0\t\n\r]/g;function ote(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const l=[];let c,u,f,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(W_.lastIndex=f,c=W_.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){t=i.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(i.slice(f,h)),e+=h-f),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}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const ate=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lte(e){return e.replace(ate,cte)}function cte(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return cI(n.slice(i?2:1),i?16:10)}return Ov(n)||e}const vI={}.hasOwnProperty;function ute(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),dte(n)(ite(ste(n).document().write(ote()(e,t,!0))))}function dte(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Oi),autolinkProtocol:T,autolinkEmail:T,atxHeading:i(jc),blockQuote:i(sr),characterEscape:T,characterReference:T,codeFenced:i(Sr),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(Sr,o),codeText:i(Di,o),codeTextData:T,data:T,codeFlowValue:T,definition:i(Sc),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Cc),hardBreakEscape:i(ma),hardBreakTrailing:i(ma),htmlFlow:i(ga,o),htmlFlowData:T,htmlText:i(ga,o),htmlTextData:T,image:i(Hr),label:o,link:i(Oi),listItem:i(yh),listItemValue:h,listOrdered:i(ir,f),listUnordered:i(ir),paragraph:i(Ec),reference:A,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(jc),strong:i(xh),thematicBreak:i(we)},exit:{atxHeading:l(),atxHeadingSequence:_,autolink:l(),autolinkEmail:bn,autolinkProtocol:ct,blockQuote:l(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:ve,characterReference:Xt,codeFenced:l(x),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:P,codeIndented:l(y),codeText:l(z),codeTextData:P,data:P,definition:l(),definitionDestinationString:k,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(R),hardBreakTrailing:l(R),htmlFlow:l(L),htmlFlowData:P,htmlText:l(I),htmlTextData:P,image:l(D),label:V,labelText:O,lineEnding:N,link:l($),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ge,resourceDestinationString:C,resourceTitleString:U,resource:Q,setextHeading:l(E),setextHeadingLineSequence:j,setextHeadingText:S,strong:l(),thematicBreak:l()}};wI(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(F){let G={type:"root",children:[]};const ie={stack:[G],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},de=[];let _e=-1;for(;++_e<F.length;)if(F[_e][1].type==="listOrdered"||F[_e][1].type==="listUnordered")if(F[_e][0]==="enter")de.push(_e);else{const Fn=de.pop();_e=s(F,Fn,_e)}for(_e=-1;++_e<F.length;){const Fn=t[F[_e][0]];vI.call(Fn,F[_e][1].type)&&Fn[F[_e][1].type].call(Object.assign({sliceSerialize:F[_e][2].sliceSerialize},ie),F[_e][1])}if(ie.tokenStack.length>0){const Fn=ie.tokenStack[ie.tokenStack.length-1];(Fn[1]||K_).call(ie,void 0,Fn[0])}for(G.position={start:ns(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:ns(F.length>0?F[F.length-2][1].end:{line:1,column:1,offset:0})},_e=-1;++_e<t.transforms.length;)G=t.transforms[_e](G)||G;return G}function s(F,G,ie){let de=G-1,_e=-1,Fn=!1,Ks,Cr,ya,xa;for(;++de<=ie;){const en=F[de];switch(en[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{en[0]==="enter"?_e++:_e--,xa=void 0;break}case"lineEndingBlank":{en[0]==="enter"&&(Ks&&!xa&&!_e&&!ya&&(ya=de),xa=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xa=void 0}if(!_e&&en[0]==="enter"&&en[1].type==="listItemPrefix"||_e===-1&&en[0]==="exit"&&(en[1].type==="listUnordered"||en[1].type==="listOrdered")){if(Ks){let zi=de;for(Cr=void 0;zi--;){const jr=F[zi];if(jr[1].type==="lineEnding"||jr[1].type==="lineEndingBlank"){if(jr[0]==="exit")continue;Cr&&(F[Cr][1].type="lineEndingBlank",Fn=!0),jr[1].type="lineEnding",Cr=zi}else if(!(jr[1].type==="linePrefix"||jr[1].type==="blockQuotePrefix"||jr[1].type==="blockQuotePrefixWhitespace"||jr[1].type==="blockQuoteMarker"||jr[1].type==="listItemIndent"))break}ya&&(!Cr||ya<Cr)&&(Ks._spread=!0),Ks.end=Object.assign({},Cr?F[Cr][1].start:en[1].end),F.splice(Cr||de,0,["exit",Ks,en[2]]),de++,ie++}if(en[1].type==="listItemPrefix"){const zi={type:"listItem",_spread:!1,start:Object.assign({},en[1].start),end:void 0};Ks=zi,F.splice(de,0,["enter",zi,en[2]]),de++,ie++,ya=void 0,xa=!0}}}return F[G][1]._spread=Fn,ie}function i(F,G){return ie;function ie(de){a.call(this,F(de),de),G&&G.call(this,de)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(F,G,ie){this.stack[this.stack.length-1].children.push(F),this.stack.push(F),this.tokenStack.push([G,ie||void 0]),F.position={start:ns(G.start),end:void 0}}function l(F){return G;function G(ie){F&&F.call(this,ie),c.call(this,ie)}}function c(F,G){const ie=this.stack.pop(),de=this.tokenStack.pop();if(de)de[0].type!==F.type&&(G?G.call(this,F,de[0]):(de[1]||K_).call(this,F,de[0]));else throw new Error("Cannot close `"+F.type+"` ("+dl({start:F.start,end:F.end})+"): it’s not open");ie.position.end=ns(F.end)}function u(){return cX(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(F){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(F),10),this.data.expectingFirstListItemValue=void 0}}function p(){const F=this.resume(),G=this.stack[this.stack.length-1];G.lang=F}function m(){const F=this.resume(),G=this.stack[this.stack.length-1];G.meta=F}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const F=this.resume(),G=this.stack[this.stack.length-1];G.value=F.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const F=this.resume(),G=this.stack[this.stack.length-1];G.value=F.replace(/(\r?\n|\r)$/g,"")}function v(F){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.label=G,ie.identifier=Io(this.sliceSerialize(F)).toLowerCase()}function w(){const F=this.resume(),G=this.stack[this.stack.length-1];G.title=F}function k(){const F=this.resume(),G=this.stack[this.stack.length-1];G.url=F}function _(F){const G=this.stack[this.stack.length-1];if(!G.depth){const ie=this.sliceSerialize(F).length;G.depth=ie}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function j(F){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function T(F){const ie=this.stack[this.stack.length-1].children;let de=ie[ie.length-1];(!de||de.type!=="text")&&(de=Pc(),de.position={start:ns(F.start),end:void 0},ie.push(de)),this.stack.push(de)}function P(F){const G=this.stack.pop();G.value+=this.sliceSerialize(F),G.position.end=ns(F.end)}function N(F){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ie=G.children[G.children.length-1];ie.position.end=ns(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(T.call(this,F),P.call(this,F))}function R(){this.data.atHardBreak=!0}function L(){const F=this.resume(),G=this.stack[this.stack.length-1];G.value=F}function I(){const F=this.resume(),G=this.stack[this.stack.length-1];G.value=F}function z(){const F=this.resume(),G=this.stack[this.stack.length-1];G.value=F}function $(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=G,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function D(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=G,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function O(F){const G=this.sliceSerialize(F),ie=this.stack[this.stack.length-2];ie.label=lte(G),ie.identifier=Io(G).toLowerCase()}function V(){const F=this.stack[this.stack.length-1],G=this.resume(),ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,ie.type==="link"){const de=F.children;ie.children=de}else ie.alt=G}function C(){const F=this.resume(),G=this.stack[this.stack.length-1];G.url=F}function U(){const F=this.resume(),G=this.stack[this.stack.length-1];G.title=F}function Q(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ge(F){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.label=G,ie.identifier=Io(this.sliceSerialize(F)).toLowerCase(),this.data.referenceType="full"}function ke(F){this.data.characterReferenceType=F.type}function ve(F){const G=this.sliceSerialize(F),ie=this.data.characterReferenceType;let de;ie?(de=cI(G,ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):de=Ov(G);const _e=this.stack[this.stack.length-1];_e.value+=de}function Xt(F){const G=this.stack.pop();G.position.end=ns(F.end)}function ct(F){P.call(this,F);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(F)}function bn(F){P.call(this,F);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(F)}function sr(){return{type:"blockquote",children:[]}}function Sr(){return{type:"code",lang:null,meta:null,value:""}}function Di(){return{type:"inlineCode",value:""}}function Sc(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Cc(){return{type:"emphasis",children:[]}}function jc(){return{type:"heading",depth:0,children:[]}}function ma(){return{type:"break"}}function ga(){return{type:"html",value:""}}function Hr(){return{type:"image",title:null,url:"",alt:null}}function Oi(){return{type:"link",title:null,url:"",children:[]}}function ir(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function yh(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function Ec(){return{type:"paragraph",children:[]}}function xh(){return{type:"strong",children:[]}}function Pc(){return{type:"text",value:""}}function we(){return{type:"thematicBreak"}}}function ns(e){return{line:e.line,column:e.column,offset:e.offset}}function wI(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?wI(e,r):fte(e,r)}}function fte(e,t){let n;for(n in t)if(vI.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 K_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+dl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+dl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+dl({start:t.start,end:t.end})+") is still open")}function hte(e){const t=this;t.parser=n;function n(r){return ute(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function pte(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 mte(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
285
|
+
`}]}function gte(e,t){const n=t.value?t.value+`
|
|
286
|
+
`:"",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 yte(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xte(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vte(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=pa(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 wte(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 bte(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function bI(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 kte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bI(e,t);const s={src:pa(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 _te(e,t){const n={src:pa(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 Ste(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 Cte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bI(e,t);const s={href:pa(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 jte(e,t){const n={href:pa(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 Ete(e,t,n){const r=e.all(t),s=n?Pte(n):kI(t),i={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.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:`
|
|
287
|
+
`}),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:`
|
|
288
|
+
`});const c={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,c),e.applyData(t,c)}function Pte(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=kI(n[r])}return t}function kI(e){const t=e.spread;return t??e.children.length>1}function Tte(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function Nte(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ite(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ate(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rte(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Lv(t.children[1]),l=nI(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),s.push(o)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function Lte(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],h={},p=o?o[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function Mte(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const H_=9,G_=32;function $te(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(Z_(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(Z_(t.slice(s),s>0,!1)),i.join("")}function Z_(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===H_||i===G_;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===H_||i===G_;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Dte(e,t){const n={type:"text",value:$te(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ote(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zte={blockquote:pte,break:mte,code:gte,delete:yte,emphasis:xte,footnoteReference:vte,heading:wte,html:bte,imageReference:kte,image:_te,inlineCode:Ste,linkReference:Cte,link:jte,listItem:Ete,list:Tte,paragraph:Nte,root:Ite,strong:Ate,table:Rte,tableCell:Mte,tableRow:Lte,text:Dte,thematicBreak:Ote,toml:bu,yaml:bu,definition:bu,footnoteDefinition:bu};function bu(){}const _I=-1,hh=0,hl=1,cf=2,Bv=3,Vv=4,Uv=5,Wv=6,SI=7,CI=8,Fte=typeof self=="object"?self:globalThis,q_=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Fte[e](t)},Bte=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,o]=t[s];switch(i){case hh:case _I:return n(o,s);case hl:{const a=n([],s);for(const l of o)a.push(r(l));return a}case cf:{const a=n({},s);for(const[l,c]of o)a[r(l)]=r(c);return a}case Bv:return n(new Date(o),s);case Vv:{const{source:a,flags:l}=o;return n(new RegExp(a,l),s)}case Uv:{const a=n(new Map,s);for(const[l,c]of o)a.set(r(l),r(c));return a}case Wv:{const a=n(new Set,s);for(const l of o)a.add(r(l));return a}case SI:{const{name:a,message:l}=o;return n(q_(a,l),s)}case CI:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(q_(i,o),s)};return r},Y_=e=>Bte(new Map,e)(0),Zi="",{toString:Vte}={},{keys:Ute}=Object,za=e=>{const t=typeof e;if(t!=="object"||!e)return[hh,t];const n=Vte.call(e).slice(8,-1);switch(n){case"Array":return[hl,Zi];case"Object":return[cf,Zi];case"Date":return[Bv,Zi];case"RegExp":return[Vv,Zi];case"Map":return[Uv,Zi];case"Set":return[Wv,Zi];case"DataView":return[hl,n]}return n.includes("Array")?[hl,n]:n.includes("Error")?[SI,n]:[cf,n]},ku=([e,t])=>e===hh&&(t==="function"||t==="symbol"),Wte=(e,t,n,r)=>{const s=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},i=o=>{if(n.has(o))return n.get(o);let[a,l]=za(o);switch(a){case hh:{let u=o;switch(l){case"bigint":a=CI,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return s([_I],o)}return s([a,u],o)}case hl:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),s([l,[...h]],o)}const u=[],f=s([a,u],o);for(const h of o)u.push(i(h));return f}case cf:{if(l)switch(l){case"BigInt":return s([l,o.toString()],o);case"Boolean":case"Number":case"String":return s([l,o.valueOf()],o)}if(t&&"toJSON"in o)return i(o.toJSON());const u=[],f=s([a,u],o);for(const h of Ute(o))(e||!ku(za(o[h])))&&u.push([i(h),i(o[h])]);return f}case Bv:return s([a,o.toISOString()],o);case Vv:{const{source:u,flags:f}=o;return s([a,{source:u,flags:f}],o)}case Uv:{const u=[],f=s([a,u],o);for(const[h,p]of o)(e||!(ku(za(h))||ku(za(p))))&&u.push([i(h),i(p)]);return f}case Wv:{const u=[],f=s([a,u],o);for(const h of o)(e||!ku(za(h)))&&u.push(i(h));return f}}const{message:c}=o;return s([a,{name:l,message:c}],o)};return i},J_=(e,{json:t,lossy:n}={})=>{const r=[];return Wte(!(t||n),!!t,new Map,r)(e),r},uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Y_(J_(e,t)):structuredClone(e):(e,t)=>Y_(J_(e,t));function Kte(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Hte(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Gte(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Kte,r=e.options.footnoteBackLabel||Hte,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),h=pa(f.toLowerCase());let p=0;const m=[],g=e.footnoteCounts.get(f);for(;g!==void 0&&++p<=g;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,p);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...m)}else u.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...uf(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
289
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
290
|
+
`}]}}const jI=function(e){if(e==null)return Jte;if(typeof e=="function")return ph(e);if(typeof e=="object")return Array.isArray(e)?Zte(e):qte(e);if(typeof e=="string")return Yte(e);throw new Error("Expected function, string, or object as test")};function Zte(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=jI(e[n]);return ph(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function qte(e){const t=e;return ph(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function Yte(e){return ph(t);function t(n){return n&&n.type===e}}function ph(e){return t;function t(n,r,s){return!!(Qte(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function Jte(){return!0}function Qte(e){return e!==null&&typeof e=="object"&&"type"in e}const EI=[],Xte=!0,Q_=!1,ene="skip";function tne(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=jI(s),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=EI,m,g,x;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=nne(n(l,u)),p[0]===Q_))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==ene)for(g=(r?y.children.length:-1)+o,x=u.concat(y);g>-1&&g<y.children.length;){const v=y.children[g];if(m=a(v,g,x)(),m[0]===Q_)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function nne(e){return Array.isArray(e)?e:typeof e=="number"?[Xte,e]:e==null?EI:[e]}function PI(e,t,n,r){let s,i,o;typeof t=="function"&&typeof n!="function"?(i=void 0,o=t,s=n):(i=t,o=n,s=r),tne(e,i,a,s);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return o(l,f,u)}}const ny={}.hasOwnProperty,rne={};function sne(e,t){const n=t||rne,r=new Map,s=new Map,i=new Map,o={...zte,...n.handlers},a={all:c,applyData:one,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:l,options:n,patch:ine,wrap:lne};return PI(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:s,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),a;function l(u,f){const h=u.type,p=a.handlers[h];if(ny.call(a.handlers,h)&&p)return p(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:g,...x}=u,y=uf(x);return y.children=a.all(u),y}return uf(u)}return(a.options.unknownHandler||ane)(a,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const m=a.one(h[p],u);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=X_(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=X_(g.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function ine(e,t){e.position&&(t.position=BQ(e))}function one(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&i&&Object.assign(n.properties,uf(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function ane(e,t){const n=t.data||{},r="value"in t&&!(ny.call(n,"hProperties")||ny.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lne(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
291
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
292
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
293
|
+
`}),n}function X_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function e1(e,t){const n=sne(e,t),r=n.one(e,void 0),s=Gte(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
|
294
|
+
`},s),i}function cne(e,t){return e&&"run"in e?async function(n,r){const s=e1(n,{file:r,...t});await e.run(s,r)}:function(n,r){return e1(n,{file:r,...e||t})}}function t1(e){if(e)throw e}var nd=Object.prototype.hasOwnProperty,TI=Object.prototype.toString,n1=Object.defineProperty,r1=Object.getOwnPropertyDescriptor,s1=function(t){return typeof Array.isArray=="function"?Array.isArray(t):TI.call(t)==="[object Array]"},i1=function(t){if(!t||TI.call(t)!=="[object Object]")return!1;var n=nd.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&nd.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||nd.call(t,s)},o1=function(t,n){n1&&n.name==="__proto__"?n1(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},a1=function(t,n){if(n==="__proto__")if(nd.call(t,n)){if(r1)return r1(t,n).value}else return;return t[n]},une=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=a1(a,n),s=a1(t,n),a!==s&&(u&&s&&(i1(s)||(i=s1(s)))?(i?(i=!1,o=r&&s1(r)?r:[]):o=r&&i1(r)?r:{},o1(a,{name:n,newValue:e(u,o,s)})):typeof s<"u"&&o1(a,{name:n,newValue:s}));return a};const Vp=pf(une);function ry(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 dne(){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 f=-1;if(l){o(l);return}for(;++f<s.length;)(c[f]===null||c[f]===void 0)&&(c[f]=s[f]);s=c,u?fne(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 fne(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 hr={basename:hne,dirname:pne,extname:mne,join:gne,sep:"/"};function hne(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xc(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 pne(e){if(xc(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 mne(e){xc(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 gne(...e){let t=-1,n;for(;++t<e.length;)xc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":yne(n)}function yne(e){xc(e);const t=e.codePointAt(0)===47;let n=xne(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function xne(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 xc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vne={cwd:wne};function wne(){return"/"}function sy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bne(e){if(typeof e=="string")e=new URL(e);else if(!sy(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 kne(e)}function kne(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 Up=["history","path","basename","stem","extname","dirname"];class NI{constructor(t){let n;t?sy(t)?n={path:t}:typeof t=="string"||_ne(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":vne.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Up.length;){const i=Up[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)Up.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?hr.basename(this.path):void 0}set basename(t){Kp(t,"basename"),Wp(t,"basename"),this.path=hr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?hr.dirname(this.path):void 0}set dirname(t){l1(this.basename,"dirname"),this.path=hr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?hr.extname(this.path):void 0}set extname(t){if(Wp(t,"extname"),l1(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=hr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sy(t)&&(t=bne(t)),Kp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?hr.basename(this.path,this.extname):void 0}set stem(t){Kp(t,"stem"),Wp(t,"stem"),this.path=hr.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 jt(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 Wp(e,t){if(e&&e.includes(hr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+hr.sep+"`")}function Kp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function l1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _ne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Sne=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},Cne={}.hasOwnProperty;class Kv extends Sne{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=dne()}copy(){const t=new Kv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Vp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Zp("data",this.frozen),this.namespace[t]=n,this):Cne.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Zp("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=_u(t),r=this.parser||this.Parser;return Hp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Hp("process",this.parser||this.Parser),Gp("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=_u(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const p=f,m=r.stringify(p,h);Pne(m)?h.value=m:h.result=m,c(u,h)});function c(u,f){u||!f?o(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Hp("processSync",this.parser||this.Parser),Gp("processSync",this.compiler||this.Compiler),this.process(t,s),u1("processSync","process",n),r;function s(i,o){n=!0,t1(i),r=o}}run(t,n,r){c1(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=_u(n);s.run(t,l,c);function c(u,f,h){const p=f||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),u1("runSync","run",r),s;function i(o,a){t1(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=_u(n),s=this.compiler||this.Compiler;return Gp("stringify",s),c1(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Zp("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,...f]=c;l(u,f)}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=Vp(!0,s.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...m]=u;const g=r[h][1];ry(g)&&ry(p)&&(p=Vp(!0,g,p)),r[h]=[c,p,...m]}}}}const jne=new Kv().freeze();function Hp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Zp(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 c1(e){if(!ry(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function u1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _u(e){return Ene(e)?e:new NI(e)}function Ene(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Pne(e){return typeof e=="string"||Tne(e)}function Tne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Nne="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",d1=[],f1={allowDangerousHtml:!0},Ine=/^(https?|ircs?|mailto|xmpp)$/i,Ane=[{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 Rne(e){const t=Lne(e),n=Mne(e);return $ne(t.runSync(t.parse(n),n),e)}function Lne(e){const t=e.rehypePlugins||d1,n=e.remarkPlugins||d1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...f1}:f1;return jne().use(hte).use(n).use(cne,r).use(t)}function Mne(e){const t=e.children||"",n=new NI;return typeof t=="string"&&(n.value=t),n}function $ne(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||Dne;for(const u of Ane)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+Nne+u.id,void 0);return PI(e,c),HQ(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,f,h){if(u.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let p;for(p in zp)if(Object.hasOwn(zp,p)&&Object.hasOwn(u.properties,p)){const m=u.properties[p],g=zp[p];(g===null||g.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 f=="number"&&(p=!r(u,f,h)),p&&h&&typeof f=="number")return a&&u.children?h.children.splice(f,1,...u.children):h.children.splice(f,1),f}}}function Dne(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||Ine.test(e.slice(0,t))?e:""}const qp=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,One={p:({children:e})=>d.jsx("p",{className:"mb-4",children:e}),strong:({children:e})=>d.jsx("strong",{className:"font-bold",children:e}),h1:({children:e})=>d.jsx("h1",{className:qp("text-lg"),children:e}),h2:({children:e})=>d.jsx("h2",{className:qp("text-[1.3rem]"),children:e}),h3:({children:e})=>d.jsx("h3",{className:qp("text-[1.1rem]"),children:e}),a:({children:e,href:t})=>d.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-watercolor-amber-dark",children:e}),code:({children:e})=>d.jsx("code",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-[3px] py-[0.1em] px-[0.35em]",children:e}),pre:({children:e})=>d.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})=>d.jsx("ul",{className:"list-disc mb-4 pl-[1.4rem]",children:e}),ol:({children:e})=>d.jsx("ol",{className:"list-decimal mb-4 pl-[1.4rem]",children:e}),li:({children:e})=>d.jsx("li",{className:"mb-[0.4rem]",children:e}),blockquote:({children:e})=>d.jsx("blockquote",{className:"mb-4 pl-4 border-l-[3px] border-solid border-black/[15%] opacity-[0.85]",children:e})},II=({children:e})=>d.jsx(Rne,{components:One,children:e}),Hv=1e3,zne=3e4;let In=null,vo=null,pl=Hv;const ml=new Set;function Fne(e){let t;try{t=JSON.parse(e.data)}catch{return}for(const n of ml)n(t)}function Bne(){pl=Hv}function Vne(){In==null||In.close(),In=null,ml.size!==0&&(vo=setTimeout(()=>{vo=null,AI()},pl),pl=Math.min(pl*2,zne))}function AI(){In=new EventSource(W("/api/activity/stream")),In.onmessage=Fne,In.onopen=Bne,In.onerror=Vne}function vc(e){return ml.add(e),!In&&!vo&&AI(),()=>{ml.delete(e),!(ml.size>0)&&(vo&&(clearTimeout(vo),vo=null),In&&(In.close(),In=null),pl=Hv)}}function wc(){const[e,t]=b.useState([]),n=b.useCallback(async()=>{try{t(await Z9())}catch{}},[]);b.useEffect(()=>{n()},[n]),b.useEffect(()=>{let s;const i=()=>{s&&clearTimeout(s),s=setTimeout(n,80)},o=vc(a=>{(a.type==="check"||a.message==="changed")&&i()});return()=>{s&&clearTimeout(s),o()}},[n]);const r=b.useCallback(async s=>{await YP(s),await n()},[n]);return{checks:e,run:r}}function Une(e,t,n){const r=b.useRef(null);b.useEffect(()=>{r.current&&(r.current.inert=!e)},[e]),b.useEffect(()=>{if(!e||t)return;const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e,t,n]);const s=M(f=>f.consistency),i=M(f=>f.doctor),o=M(f=>f.agentStatus);b.useEffect(()=>{const{loadStatus:f,loadConsistency:h,loadDoctor:p,loadGitStatus:m,loadAgentStatus:g,loadArchivableIdeas:x,loadTaskLog:y}=M.getState();f(),h(),p(),m(),g(),x(),y()},[]),b.useEffect(()=>{const f=()=>{M.getState().loadPlans(),M.getState().loadGitStatus()};return window.addEventListener("focus",f),()=>window.removeEventListener("focus",f)},[]),b.useEffect(()=>{const f={},h=(m,g,x)=>{f[m]&&clearTimeout(f[m]),f[m]=setTimeout(g,x)},p=vc(m=>{if(m.type==="status"){h("status",()=>M.getState().loadStatus(),80);return}if(m.type==="agent"){h("agent",()=>M.getState().loadAgentStatus(),120);return}m.message==="changed"&&h("activity",()=>{const{loadPlans:g,loadSuggestions:x,loadStatus:y,loadConsistency:v,loadDoctor:w,loadGitStatus:k,loadAgentStatus:_,loadArchivableIdeas:S,loadTaskLog:j}=M.getState();g(),x(),y(),v(),w(),k(),_(),S(),j()},250)});return()=>{for(const m of Object.values(f))m&&clearTimeout(m);p()}},[]);const{checks:a}=wc(),l=s.length>0,c=a.some(f=>f.status==="fail")||l||i.errorCount>0,u=o.some(f=>f.status==="running"||f.status==="starting"||f.status==="stopping");return{panelRef:r,anyChecksFailing:c,agentActive:u}}function rd(e){return e==="allowed"?"allowed":/reject|block|exceed|denied/i.test(e)?"rejected":"warning"}function Gv(e){return e<1e12?e*1e3:e}function Wne(e){let t=null,n=Number.NEGATIVE_INFINITY;for(const r of e){if(!r.rateLimit||r.rateLimit.resetsAt!==void 0&&Gv(r.rateLimit.resetsAt)<=Date.now())continue;const s=Date.parse(r.endedAt);Number.isNaN(s)||s>=n&&(n=s,t={snapshot:r.rateLimit,capturedAt:r.endedAt})}return t}function Kne(e,t){return e?{snapshot:e,capturedAt:null}:t?{snapshot:t.snapshot,capturedAt:t.capturedAt}:null}const Ao={accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",chalkPass:"#2d5a3b",chalkPassText:"#b5d6b5",chalkFail:"#5a2d2d",chalkFailText:"#d6a0a0",chalkRunning:"#5a4a2d",chalkRunningText:"#d6c4a0"},bc="font-handwritten text-sm tracking-wide text-desk-text-muted mb-2",an={pass:Ao.chalkPass,fail:Ao.chalkFail,running:Ao.chalkRunning},ln={pass:Ao.chalkPassText,fail:Ao.chalkFailText,running:Ao.chalkRunningText},iy=({tooltip:e,onClick:t,disabled:n,disabledCursor:r="not-allowed",ariaExpanded:s,fillColor:i,textColor:o,variant:a,children:l})=>d.jsx(ye,{content:e,surface:"chalkboard",children:d.jsx("button",{type:"button",className:`inline-flex border-none bg-transparent bg-none p-0 ${n?r==="default"?"cursor-default":"cursor-not-allowed":"cursor-pointer enabled:hover:-translate-y-px enabled:hover:brightness-[1.15]"}`,onClick:t,disabled:n,"aria-expanded":s,children:d.jsx(ne,{surface:"chalkboard",size:"small",fillColor:i,textColor:o,variant:a,children:l})})}),Hne=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),RI=e=>{if(!e)return"";const t=new Date(e),n=t.toLocaleTimeString();return Hne(t,new Date)?n:`${t.toLocaleDateString()} ${n}`},Gne={allowed:an.pass,warning:an.running,rejected:an.fail},h1={allowed:ln.pass,warning:ln.running,rejected:ln.fail};function Zne(e){const t=Math.max(0,Math.round(e/6e4));if(t<60)return`${t}m`;const n=Math.floor(t/60);return n<24?t%60?`${n}h ${t%60}m`:`${n}h`:`${Math.floor(n/24)}d`}const qne=({heightClassName:e=""})=>{var y,v;const t=M(w=>w.taskLog),n=M(w=>w.agentStatus),r=M(w=>w.refreshCapacity),s=M(w=>w.probedCapacity),[i,o]=b.useState(!1),[a,l]=b.useState(()=>Date.now());b.useEffect(()=>{const w=setInterval(()=>l(Date.now()),3e4);return()=>clearInterval(w)},[]);const c=((y=n.find(w=>w.rateLimit))==null?void 0:y.rateLimit)??null,u=b.useMemo(()=>Wne(t),[t]),f=Kne(c,s??u),h=b.useCallback(()=>{o(!0),r().finally(()=>o(!1))},[r]);b.useEffect(()=>{s===null&&h()},[s,h]);const p=(f==null?void 0:f.snapshot)??null,m=rd((p==null?void 0:p.status)??"allowed"),g=(v=p==null?void 0:p.unifiedWindows)==null?void 0:v.five_hour,x=g?Math.round(g.utilization*100):0;return d.jsx(me,{surface:"chalkboard",size:"small",className:e,children:d.jsxs("div",{className:"flex h-full flex-col justify-between gap-1",children:[d.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[d.jsx("span",{className:"min-w-0 truncate font-handwritten text-sm leading-tight text-desk-chalk",children:(g==null?void 0:g.resetsAt)===void 0?"Capacity":`Resets in ${Zne(Gv(g.resetsAt)-a)}`}),i?d.jsx("span",{className:"inline-flex shrink-0",children:d.jsx(tr,{size:"small",surface:"chalkboard",label:"Checking capacity"})}):d.jsx(qe,{icon:d.jsx("span",{className:"inline-flex",children:d.jsx(Jx,{size:14})}),label:"Refresh capacity",size:"small",variant:"ghost",surface:"chalkboard",onClick:h,className:"h-auto min-h-0 w-auto shrink-0 p-0"})]}),d.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[d.jsx(zP,{className:"min-w-0 flex-1",value:x,max:100,color:h1[m],surface:"chalkboard"}),d.jsxs("span",{className:"flex shrink-0 items-center gap-2",children:[(p==null?void 0:p.overage)&&d.jsx(ne,{surface:"chalkboard",size:"small",fillColor:an.running,textColor:ln.running,children:"overage"}),d.jsx(ne,{surface:"chalkboard",size:"small",fillColor:Gne[m],textColor:h1[m],className:"leading-none",children:g?`${x}%`:(p==null?void 0:p.status)??"no report"})]})]})]})})},Yne=1,oy="h-[4.625rem]",Jne="min-h-[4.625rem]",Qne={phase:"Phase","run-all":"Phases","commit-suggest":"Commit","fix-review":"Fix","pr-review":"Review","batch-reconcile":"Reconcile",reconcile:"Reconcile","batch-draft":"Draft",draft:"Draft",extend:"Extend",audit:"Audit","overlap-check":"Overlap",sync:"Sync","resolve-conflict":"Conflict"},Xne=e=>{const t=Qne[e.taskKind];if(!t)return e.planId??e.planTitle;const n=e.taskKind==="phase"&&e.phaseIndex!==void 0?`${t} ${e.phaseIndex+1}`:t;return e.planId?`${n}: ${e.planId}`:n},p1={starting:an.running,running:an.running,stopping:an.running,done:an.pass,error:an.fail,superseded:an.running},m1={starting:ln.running,running:ln.running,stopping:ln.running,done:ln.pass,error:ln.fail,superseded:ln.running},ere=({task:e,onStop:t})=>{const n=lt(),{toast:r}=Je(),s=()=>n({to:"/tasks",search:{taskId:e.id}}),i=async o=>{o.stopPropagation();try{await t(e.id)}catch(a){r({title:"Failed to stop agent",description:Ge(a.message),variant:"error"})}};return d.jsx(me,{surface:"chalkboard",size:"small",className:oy,children:d.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:o=>{o.target===o.currentTarget&&(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),s())},className:"flex h-full min-w-0 cursor-pointer flex-col justify-between gap-1 rounded-[10px]",children:[d.jsx("span",{className:"min-w-0 truncate font-handwritten text-sm leading-tight text-desk-chalk",children:Xne(e)}),d.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[d.jsxs("span",{className:"min-w-0 shrink-0 whitespace-nowrap font-handwritten text-xs text-desk-text-muted",children:[G8[e.agentId]," · ",RI(e.startedAt)]}),d.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?d.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),n({to:"/settings/$section",params:{section:"setup"}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:d.jsx(ne,{surface:"chalkboard",size:"small",fillColor:p1.error,textColor:m1.error,className:"leading-none",children:"stopped — agent signed out"})}):d.jsx(ne,{surface:"chalkboard",size:"small",fillColor:p1[e.status],textColor:m1[e.status],className:"leading-none",children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&d.jsx(qe,{icon:d.jsx(Go,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping",className:"h-auto min-h-0 w-auto shrink-0 p-0"})]})]})]})})},tre=()=>{const e=M(i=>i.agentStatus),t=M(i=>i.stopAgent),n=lt(),r=e.slice(0,Yne),s=e.length-r.length;return d.jsxs("div",{className:"flex min-h-0 flex-none flex-col p-[var(--pc-stack-pad)]",children:[d.jsxs("div",{className:"mb-2 flex items-baseline justify-between gap-2",children:[d.jsx("h3",{className:`${bc} m-0`,children:"Agent"}),s>0&&d.jsx("button",{type:"button",onClick:()=>n({to:"/tasks"}),className:"cursor-pointer border-none bg-transparent p-0 font-handwritten text-xs text-desk-text-muted underline",children:"more"})]}),d.jsx("div",{className:`flex shrink-0 flex-col justify-start gap-2 overflow-y-auto ${Jne}`,children:r.length>0?r.map(i=>d.jsx(ere,{task:i,onStop:t},i.id)):d.jsx(me,{surface:"chalkboard",size:"small",className:`flex items-center ${oy}`,children:d.jsx("p",{className:"m-0 text-xs opacity-50",children:"No agent running."})})}),d.jsx("div",{className:"mt-2 shrink-0",children:d.jsx(qne,{heightClassName:oy})})]})},g1=e=>`${e.cmd}`,y1=e=>`${e.cmd}`,x1=e=>`${e.repo}|${e.branch??""}|${e.releasePlease?"1":"0"}`,nre=(e,t)=>e.name===t.name&&e.cmd===t.cmd&&(e.port??null)===(t.port??null)&&(e.healthcheck??null)===(t.healthcheck??null),rre=(e,t)=>e.name===t.name&&e.cmd===t.cmd;function sre(e,t){const n=(e==null?void 0:e.services)??[],r=t.services??[],s=(e==null?void 0:e.checks)??[],i=t.checks??[],o=e==null?void 0:e.ci,a=t.ci,l=[],c=new Map(r.map(g=>[g1(g),g])),u=new Map(n.map(g=>[g1(g),g]));for(const[g,x]of c){const y=u.get(g);y?nre(y,x)||l.push({kind:"changed",before:y,after:x}):l.push({kind:"added",service:x})}for(const[g,x]of u)c.has(g)||l.push({kind:"removed",service:x});const f=[],h=new Map(i.map(g=>[y1(g),g])),p=new Map(s.map(g=>[y1(g),g]));for(const[g,x]of h){const y=p.get(g);y?rre(y,x)||f.push({kind:"changed",before:y,after:x}):f.push({kind:"added",check:x})}for(const[g,x]of p)h.has(g)||f.push({kind:"removed",check:x});let m=null;return o&&a?x1(o)!==x1(a)&&(m={kind:"changed",before:o,after:a}):o&&!a?m={kind:"removed",ci:o}:!o&&a&&(m={kind:"added",ci:a}),{services:l,checks:f,ci:m}}const ire=()=>{const[e,t]=b.useState(null),[n,r]=b.useState(null),[s,i]=b.useState(!1),[o,a]=b.useState(!1),{toast:l}=Je(),c=b.useCallback(async()=>{const m=await Jd();t((m==null?void 0:m.desk)??null),a(!0)},[]);b.useEffect(()=>{c()},[c]);const u=async()=>{i(!0);try{const m=await k9();if(!m.ok||!m.proposal){l({title:"Discovery failed",description:m.error??"No proposal returned.",variant:"error"});return}o||await c(),r(m.proposal)}finally{i(!1)}},f=()=>r(null),h=async m=>{const{ok:g,error:x}=await b9({desk:m});if(!g)throw l({title:"Failed to save",description:x,variant:"error"}),new Error(x??"failed to save desk config");const y=await Jd();t((y==null?void 0:y.desk)??null),a(!0),r(null),l({title:"Desk config applied",variant:"success"})},p=n?sre(e??null,n):null;return{configLoaded:o,current:e,proposal:n,diff:p,discovering:s,startDiscovery:u,cancelProposal:f,applyProposal:h,reloadCurrent:c}},ore=["repo-docs","release-notes"],are=["subjects","setup","merge-policy","desk"];function df(e){var t;return((t=e==null?void 0:e.match(/\d+$/))==null?void 0:t[0])??null}const lre=/^\d+$/;function ay(e,t,n="IDEA"){if(lre.test(t)){const s=e.find(i=>{var o;return((o=i.id)==null?void 0:o.toUpperCase())===`${n}-${t}`.toUpperCase()});if(s)return s}const r=t.toUpperCase();return e.find(s=>{var i;return((i=s.id)==null?void 0:i.toUpperCase())===r})??e.find(s=>!s.id&&s.title===t)??null}function LI(e,t){return df(e)??encodeURIComponent(t)}function $i(e){var r;const t=(r=e.id)!=null&&r.startsWith("TICKET-")?df(e.id):null,n=df(e.idea);return e.entityKind==="ticket"&&t&&n?{to:"/ideas/$ideaId/tickets/$ticketId",params:{ideaId:n,ticketId:t}}:{to:"/ideas/$ideaId",params:{ideaId:LI(e.id,e.title)}}}function mh(){const{planId:e,ideaId:t,ticketId:n}=Ai({strict:!1}),r=M(i=>i.plans);if(!r)return null;if(typeof n=="string")return ay(r.entries,decodeURIComponent(n),"TICKET");const s=typeof t=="string"?t:e;return typeof s!="string"?null:ay(r.entries,decodeURIComponent(s))}function MI(){const{ideaId:e}=Ai({strict:!1}),t=M(n=>n.ideaEntries);return typeof e!="string"?null:ay(t,decodeURIComponent(e))}function cre(){const{section:e}=Ai({strict:!1});return ore.includes(e)?e:null}function Qae(){const{section:e}=Ai({strict:!1});return are.includes(e)?e:null}function ure(){const e=cre(),t=M(r=>r.activeDocTitle),n=M(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}function $I(){const e=lt(),t=M(n=>n.plans);return(n,r)=>{const s=((t==null?void 0:t.entries)??[]).find(i=>n?i.id===n:i.title===r);e($i(s??{id:n,title:r}))}}const dre=()=>{const[e,t]=b.useState(null),[n,r]=b.useState(null),[s,i]=b.useState(!0);return b.useEffect(()=>{let o=!1;return i(!0),Promise.all([C9().then(a=>{!o&&a&&t(qP(a))}),_9().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},fre=250;function hre(e,t,n={}){const{debounceMs:r=fre,...s}=n,[i,o]=b.useState(e);b.useEffect(()=>{const c=setTimeout(()=>o(e),r);return()=>clearTimeout(c)},[e,r]);const{threshold:a,limit:l}=s;return b.useMemo(()=>KY(i,t,{threshold:a,limit:l}),[i,t,a,l])}const DI=()=>{const[e,t]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(!0);return b.useEffect(()=>{let o=!1;return Jd().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},OI="Checks",pre={...an,stale:void 0},mre={...ln,stale:void 0},v1=e=>e.errorCount>0?"fail":e.warningCount>0?"running":"pass",gre=e=>`Fix the failing "${e.name}" check in this repo. The command was \`${e.cmd}\`.
|
|
295
|
+
|
|
296
|
+
Output from the last run:
|
|
297
|
+
|
|
298
|
+
${e.output||"(no output captured)"}`,yre=({check:e,onRun:t})=>{const n=e.status==="running",r=RI(e.lastRun);return d.jsxs(iy,{tooltip:r?`${e.cmd} — last run ${r}. Click to run.`:`${e.cmd} — click to run.`,onClick:()=>t(e.name),disabled:n,fillColor:pre[e.status],textColor:mre[e.status],variant:e.status==="stale"?"neutral":void 0,children:[e.name,d.jsx("span",{className:n?"visible":"invisible",children:"…"})]})},xre=({finding:e})=>d.jsxs("div",{className:"font-mono text-2xs opacity-70",children:[e.file,":",e.line," — ",e.message]}),vre=({issue:e,linkedPlan:t,onNavigate:n})=>d.jsx("div",{className:"font-mono text-2xs opacity-70",children:t?d.jsx("button",{type:"button",onClick:n,className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-left",children:e.message}):d.jsx("span",{className:"text-left",children:e.message})}),wre=()=>{const{checks:e,run:t}=wc(),n=M(x=>x.doctor),r=M(x=>x.consistency),s=M(x=>x.plans),i=lt(),o=e.find(x=>x.status==="fail"),[a,l]=b.useState(!1),[c,u]=b.useState(!1),[f,h]=b.useState(!1),p=n.findings.length>0,m=r.length>0,g=b.useCallback(x=>x.planId?s==null?void 0:s.entries.find(y=>y.id===x.planId):void 0,[s==null?void 0:s.entries]);return d.jsxs("div",{children:[d.jsx("h4",{className:`${bc} m-0`,children:OI}),d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.map(x=>d.jsx(yre,{check:x,onRun:t},x.name)),d.jsx(iy,{tooltip:p?`${n.errorCount} error(s), ${n.warningCount} warning(s) — click to show.`:"Corpus doctor — no findings.",onClick:()=>u(x=>!x),disabled:!p,disabledCursor:"default",ariaExpanded:p?c:void 0,fillColor:an[v1(n)],textColor:ln[v1(n)],children:"doctor"}),d.jsx(iy,{tooltip:m?"Plan/idea doc findings — orphan subjects & title style. Click to show.":"Plan/idea docs — no findings.",onClick:()=>h(x=>!x),disabled:!m,disabledCursor:"default",ariaExpanded:m?f:void 0,fillColor:an[m?"fail":"pass"],textColor:ln[m?"fail":"pass"],children:"docs"})]}),o&&d.jsxs("div",{className:"flex flex-col gap-1 text-center font-handwritten text-sm",children:[d.jsxs("span",{className:"text-desk-text-muted",children:["The ",o.name," check failed."]}),d.jsxs("span",{className:"text-desk-chalk",children:["Suggested fix: ",d.jsx(qd,{text:gre(o),surface:"chalkboard"}),o.output&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("button",{type:"button",onClick:()=>l(x=>!x),className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-desk-chalk","aria-expanded":a,children:a?"Hide output":"Show output"})]})]}),a&&o.output&&d.jsx("pre",{className:"mt-1 max-h-48 overflow-auto whitespace-pre-wrap text-left font-mono text-2xs opacity-70",children:o.output})]}),c&&p&&d.jsx("div",{className:"flex flex-col gap-1",children:n.findings.map(x=>d.jsx(xre,{finding:x},`${x.file}:${x.line}:${x.rule}`))}),f&&m&&d.jsx("div",{className:"flex flex-col gap-1",children:r.map((x,y)=>{const v=g(x);return d.jsx(vre,{issue:x,linkedPlan:v,onNavigate:()=>v&&i($i(v))},`${x.kind}-${x.title}-${y}`)})})]})]})},bre=async()=>{try{const e=await J(W("/api/ci"));return e.ok?e.json():null}catch{return null}};function kre(){const[e,t]=b.useState(null),[n,r]=b.useState(!0),s=b.useCallback(async()=>{try{t(await bre())}finally{r(!1)}},[]);return b.useEffect(()=>{s()},[s]),{ci:e,loading:n,refresh:s}}const zI="CI & release",_re={success:"bg-chalk-pass-text",failure:"bg-chalk-fail-text",in_progress:"bg-chalk-running-text",queued:"bg-chalk-running-text",cancelled:"bg-desk-text-muted",unknown:"bg-desk-text-muted"},Yp="text-desk-chalk underline decoration-desk-border hover:decoration-desk-chalk",Sre=({run:e})=>{const t=d.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d.jsx("span",{"aria-hidden":"true",className:`h-2 w-2 shrink-0 rounded-full ${_re[e.status]}`}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-desk-chalk",children:e.workflow}),d.jsx("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:e.status})]});return e.url?d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"no-underline",children:t}):t},Cre=()=>{const{ci:e,loading:t,refresh:n}=kre(),r=M(o=>o.refreshing),s=b.useRef(!1);b.useEffect(()=>{s.current&&!r&&n(),s.current=r},[r,n]);const i=()=>{var a;if(!e)return d.jsx(me,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:t?"Checking CI…":"No CI source declared."})});const o=`https://github.com/${e.repo}/actions`;return e.available?d.jsx(me,{surface:"chalkboard",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[e.runs.length>0?e.runs.map(l=>d.jsx(Sre,{run:l},l.workflow)):d.jsxs("span",{className:"text-xs text-desk-text-muted opacity-70",children:["No recent runs on ",e.branch,"."]}),d.jsxs("div",{className:"font-mono text-2xs text-desk-text-muted",children:["Released ",e.releasedVersion??"—"," · Queued ",((a=e.releasePr)==null?void 0:a.version)??"none"]}),d.jsxs("div",{className:"flex flex-wrap gap-x-3 text-2xs",children:[e.releasePr&&d.jsxs("a",{href:e.releasePr.url,target:"_blank",rel:"noreferrer",className:Yp,children:["Release PR ",d.jsxs("span",{className:"font-mono",children:["#",e.releasePr.number]})]}),d.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:Yp,children:"Open Actions"})]})]})}):d.jsx(me,{surface:"chalkboard",size:"small",children:d.jsxs("p",{className:"m-0 text-center text-xs opacity-70",children:["CI status unavailable —"," ",d.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:Yp,children:"open Actions"})]})})};return d.jsxs("div",{children:[d.jsx("h4",{className:`${bc} m-0`,children:zI}),i()]})},w1=e=>e==="added"?{variant:"success",label:"new"}:e==="changed"?{variant:"info",label:"changed"}:e==="removed"?{variant:"error",label:"will remove"}:{variant:"neutral",label:"kept"};function jre(e,t){const n=(e==null?void 0:e.services)??[],r=t.services??[],s=new Set(r.map(o=>o.cmd)),i=[];for(const o of r){const a=n.find(c=>c.cmd===o.cmd),l=a?JSON.stringify(a)===JSON.stringify(o)?"kept":"changed":"added";i.push({...o,rowKey:crypto.randomUUID(),status:l})}for(const o of n)s.has(o.cmd)||i.push({...o,rowKey:crypto.randomUUID(),status:"removed"});return{rows:i}}function Ere(e,t){const n=(e==null?void 0:e.checks)??[],r=t.checks??[],s=new Set(r.map(o=>o.cmd)),i=[];for(const o of r){const a=n.find(c=>c.cmd===o.cmd),l=a?JSON.stringify(a)===JSON.stringify(o)?"kept":"changed":"added";i.push({...o,rowKey:crypto.randomUUID(),status:l})}for(const o of n)s.has(o.cmd)||i.push({...o,rowKey:crypto.randomUUID(),status:"removed"});return{rows:i}}const Pre=({current:e,proposal:t,diff:n,onApply:r,onCancel:s})=>{var R,L;const[i,o]=b.useState(()=>jre(e,t).rows),[a,l]=b.useState(()=>Ere(e,t).rows),[c,u]=b.useState(t.ci),[f,h]=b.useState(!1),[p,m]=b.useState(),g=(I,z)=>o($=>$.map(D=>D.rowKey===I?{...D,...z}:D)),x=I=>o(z=>z.filter($=>$.rowKey!==I)),y=I=>o(z=>z.map($=>$.rowKey===I?{...$,status:"kept"}:$)),v=()=>o(I=>[...I,{rowKey:crypto.randomUUID(),name:"",cmd:"",status:"added"}]),w=(I,z)=>l($=>$.map(D=>D.rowKey===I?{...D,...z}:D)),k=I=>l(z=>z.filter($=>$.rowKey!==I)),_=I=>l(z=>z.map($=>$.rowKey===I?{...$,status:"kept"}:$)),S=()=>{e!=null&&e.ci&&u(e.ci)},j=()=>l(I=>[...I,{rowKey:crypto.randomUUID(),name:"",cmd:"",status:"added"}]),E=i.filter(I=>I.status!=="removed"&&I.name.trim()!==""&&I.cmd.trim()!=="").map(({rowKey:I,status:z,...$})=>$),T=a.filter(I=>I.status!=="removed"&&I.name.trim()!==""&&I.cmd.trim()!=="").map(({rowKey:I,status:z,...$})=>$),P=async()=>{h(!0),m(void 0);try{await r({services:E.length>0?E:void 0,checks:T.length>0?T:void 0,ci:c!=null&&c.repo.trim()?c:void 0})}catch(I){m(I.message),h(!1)}},N=(((R=e==null?void 0:e.services)==null?void 0:R.length)??0)>0||(((L=e==null?void 0:e.checks)==null?void 0:L.length)??0)>0;return d.jsx(Fs,{open:!0,onClose:f?()=>{}:s,size:"large",title:N?"Re-scan proposal":"Desk discovery proposal",children:d.jsxs("div",{className:"flex flex-col gap-5",children:[d.jsx("p",{className:"text-sm m-0 opacity-70",children:N?"The discovery agent produced the proposal below against your current desk config. Edit anything you want to keep, then apply — removals happen only when you leave them in the list and apply.":"The discovery agent scanned the project and produced the desk block below. Edit anything you want to keep, then apply."}),d.jsxs(b1,{title:"Services",summary:d.jsxs(d.Fragment,{children:[n.services.filter(I=>I.kind==="added").length>0&&d.jsxs(ne,{size:"small",variant:"success",children:["+",n.services.filter(I=>I.kind==="added").length," new"]}),n.services.filter(I=>I.kind==="changed").length>0&&d.jsxs(ne,{size:"small",variant:"info",children:["~",n.services.filter(I=>I.kind==="changed").length," changed"]}),n.services.filter(I=>I.kind==="removed").length>0&&d.jsxs(ne,{size:"small",variant:"error",children:["-",n.services.filter(I=>I.kind==="removed").length," to remove"]})]}),onAdd:v,children:[i.length===0&&d.jsx("p",{className:"opacity-[0.45] text-sm m-0",children:"No services in the proposal."}),i.map((I,z)=>{const $=w1(I.status);return d.jsxs("div",{className:I.status==="removed"?"opacity-60":"",children:[d.jsxs("div",{className:"flex items-end gap-3 pb-2 pt-2",children:[d.jsx(ne,{size:"small",variant:$.variant,children:$.label}),d.jsx(rt,{size:"small",label:"Name",value:I.name,onChange:D=>g(I.rowKey,{name:D.target.value})}),d.jsx(rt,{size:"small",label:"Command",value:I.cmd,onChange:D=>g(I.rowKey,{cmd:D.target.value})}),d.jsx(rt,{size:"small",type:"number",label:"Port",className:"w-[100px]",value:I.port??"",onChange:D=>g(I.rowKey,{port:D.target.value?Number(D.target.value):void 0})}),d.jsx(rt,{size:"small",label:"Healthcheck URL",value:I.healthcheck??"",onChange:D=>g(I.rowKey,{healthcheck:D.target.value||void 0})}),d.jsx(qe,{icon:I.status==="removed"?d.jsx(k1,{size:16}):d.jsx(Go,{size:16}),variant:I.status==="removed"?"default":"danger",size:"small",onClick:()=>I.status==="removed"?y(I.rowKey):x(I.rowKey),label:I.status==="removed"?`Keep ${I.name||"service"}`:`Remove ${I.name||"service"}`})]}),z<i.length-1&&d.jsx(Bl,{})]},I.rowKey)})]}),d.jsxs(b1,{title:"Checks",summary:d.jsxs(d.Fragment,{children:[n.checks.filter(I=>I.kind==="added").length>0&&d.jsxs(ne,{size:"small",variant:"success",children:["+",n.checks.filter(I=>I.kind==="added").length," new"]}),n.checks.filter(I=>I.kind==="changed").length>0&&d.jsxs(ne,{size:"small",variant:"info",children:["~",n.checks.filter(I=>I.kind==="changed").length," changed"]}),n.checks.filter(I=>I.kind==="removed").length>0&&d.jsxs(ne,{size:"small",variant:"error",children:["-",n.checks.filter(I=>I.kind==="removed").length," to remove"]})]}),onAdd:j,children:[a.length===0&&d.jsx("p",{className:"opacity-[0.45] text-sm m-0",children:"No checks in the proposal."}),a.map((I,z)=>{const $=w1(I.status);return d.jsxs("div",{className:I.status==="removed"?"opacity-60":"",children:[d.jsxs("div",{className:"flex items-end gap-3 pb-2 pt-2",children:[d.jsx(ne,{size:"small",variant:$.variant,children:$.label}),d.jsx(rt,{size:"small",label:"Name",value:I.name,onChange:D=>w(I.rowKey,{name:D.target.value})}),d.jsx(rt,{size:"small",label:"Command",value:I.cmd,onChange:D=>w(I.rowKey,{cmd:D.target.value})}),d.jsx(qe,{icon:I.status==="removed"?d.jsx(k1,{size:16}):d.jsx(Go,{size:16}),variant:I.status==="removed"?"default":"danger",size:"small",onClick:()=>I.status==="removed"?_(I.rowKey):k(I.rowKey),label:I.status==="removed"?`Keep ${I.name||"check"}`:`Remove ${I.name||"check"}`})]}),z<a.length-1&&d.jsx(Bl,{})]},I.rowKey)})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h3",{className:"m-0 text-sm font-semibold",children:"CI"}),n.ci&&d.jsx(ne,{size:"small",variant:n.ci.kind==="added"?"success":n.ci.kind==="changed"?"info":"error",children:n.ci.kind==="added"?"new":n.ci.kind==="changed"?"changed":"to remove"})]}),!c&&d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("p",{className:"opacity-[0.45] text-sm m-0",children:"No CI in the proposal."}),(e==null?void 0:e.ci)&&d.jsx(ee,{size:"small",variant:"ghost",onClick:S,children:"Keep current CI"})]}),c&&d.jsxs("div",{className:"flex flex-col gap-3 pb-2 pt-2",children:[d.jsxs("div",{className:"flex items-end gap-3",children:[d.jsx(rt,{size:"small",label:"Repo (owner/name)",value:c.repo,onChange:I=>u({...c,repo:I.target.value})}),d.jsx(rt,{size:"small",label:"Branch",value:c.branch??"",onChange:I=>u({...c,branch:I.target.value||void 0})})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm",children:"Release Please"}),d.jsx(Yd,{checked:c.releasePlease??!1,onChange:I=>u({...c,releasePlease:I.target.checked})})]})]})]}),p&&d.jsxs("p",{className:"text-sm m-0 opacity-80",children:["Failed to apply: ",p]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{variant:"secondary",size:"small",onClick:s,disabled:f,children:"Cancel"}),d.jsx(ee,{size:"small",onClick:P,disabled:f,children:f?"Applying…":"Apply"})]})]})})},b1=({title:e,summary:t,onAdd:n,children:r})=>d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h3",{className:"m-0 text-sm font-semibold",children:e}),d.jsx("div",{className:"flex items-center gap-1",children:t})]}),d.jsx(ee,{size:"small",variant:"ghost",onClick:n,children:"+ Add"})]}),r]}),k1=({size:e=16})=>d.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:[d.jsx("path",{d:"M3 7v6h6"}),d.jsx("path",{d:"M21 17a9 9 0 0 0-15-6.7L3 13"})]}),FI=async(e,t)=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error??t)}},Tre=async()=>{const e=await J(W("/api/services"));return e.ok?(await e.json()).services??[]:[]},Nre=async e=>{const t=await J(W(`/api/services/start?name=${encodeURIComponent(e)}`),{method:"POST"});await FI(t,"Failed to start service")},Ire=async e=>{const t=await J(W(`/api/services/stop?name=${encodeURIComponent(e)}`),{method:"POST"});await FI(t,"Failed to stop service")},Are=async e=>{const t=await J(W(`/api/services/logs?name=${encodeURIComponent(e)}`));return t.ok?(await t.json()).log??"":""};function Rre(){const[e,t]=b.useState([]),[n,r]=b.useState(!0),s=b.useCallback(async()=>{try{t(await Tre())}catch{}finally{r(!1)}},[]);b.useEffect(()=>{s()},[s]),b.useEffect(()=>{let a;const l=()=>{a&&clearTimeout(a),a=setTimeout(s,80)},c=vc(u=>{(u.type==="service"||u.message==="changed")&&l()});return()=>{a&&clearTimeout(a),c()}},[s]);const i=b.useCallback(async a=>{await Nre(a),await s()},[s]),o=b.useCallback(async a=>{await Ire(a),await s()},[s]);return{services:e,loading:n,start:i,stop:o,refresh:s}}const Lre=1500,BI="Services",Mre=e=>e.status==="crashed"?"bg-chalk-fail-text":e.status==="running"?e.health==="up"?"bg-chalk-pass-text":"bg-chalk-running-text":e.status==="stopping"?"bg-chalk-running-text":"bg-desk-text-muted",$re=({service:e})=>{const t=e.status==="running"?`running · ${e.health}`:e.status;return d.jsx("span",{role:"img","aria-label":t,className:`h-2 w-2 shrink-0 rounded-full ${Mre(e)}`,title:t})},Dre=({name:e,running:t})=>{const[n,r]=b.useState(""),s=b.useRef(null);return b.useEffect(()=>{let i=!1;const o=async()=>{const l=await Are(e);i||r(l)};o();const a=t?setInterval(o,Lre):void 0;return()=>{i=!0,a&&clearInterval(a)}},[e,t]),b.useEffect(()=>{const i=s.current;i&&n&&(i.scrollTop=i.scrollHeight)},[n]),d.jsx("pre",{ref:s,className:"m-0 mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-[8px] bg-desk-bg/60 p-2 font-mono text-2xs leading-relaxed text-desk-text-muted",children:n||"No output yet."})},Ore=({service:e,onStart:t,onStop:n})=>{const{toast:r}=Je(),[s,i]=b.useState(!1),[o,a]=b.useState(!1),l=e.status==="running"||e.status==="stopping",c=e.pid!==null,u=async()=>{if(!s){i(!0);try{await(l?n:t)(e.name)}catch(f){r({title:l?"Failed to stop service":"Failed to start service",description:f.message,variant:"error"})}finally{i(!1)}}};return d.jsxs(me,{surface:"chalkboard",size:"small",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("button",{type:"button",onClick:()=>a(f=>!f),"aria-expanded":o,className:"flex min-w-0 cursor-pointer items-center gap-2 border-none bg-transparent p-0 text-left",children:[d.jsx("span",{className:`shrink-0 text-desk-text-muted transition-transform ${o?"rotate-90":""}`,children:d.jsx(B8,{})}),d.jsx($re,{service:e}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:e.name}),e.port&&d.jsxs("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:[":",e.port]})]}),d.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s?d.jsx(tr,{size:"small",surface:"chalkboard",label:"Working"}):!l||c?d.jsx(qe,{icon:l?d.jsx(F8,{}):d.jsx(z8,{}),surface:"chalkboard",size:"small",variant:"ghost",label:l?`Stop ${e.name}`:`Start ${e.name}`,onClick:u}):null})]}),o&&d.jsx(Dre,{name:e.name,running:l})]})},zre=()=>{const{services:e,start:t,stop:n}=Rre(),r=b.useCallback(i=>t(i),[t]),s=b.useCallback(i=>n(i),[n]);return d.jsxs("div",{children:[d.jsx("h4",{className:`${bc} m-0`,children:BI}),d.jsx("div",{className:"flex flex-col gap-2",children:e.length>0?e.map(i=>d.jsx(Ore,{service:i,onStart:r,onStop:s},i.name)):d.jsx(me,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No services declared."})})})]})},Fre=[BI,OI,zI],Bre=()=>d.jsx("div",{className:"flex flex-col gap-4","aria-hidden":"true",children:Fre.map(e=>d.jsxs("div",{children:[d.jsx("div",{className:bc,children:e}),d.jsx(sn,{variant:"rect",width:"100%",height:28,surface:"chalkboard"})]},e))}),Vre=({discovering:e,onDiscover:t})=>d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3",children:[d.jsx("p",{className:"m-0 text-center text-xs text-desk-text-muted",children:"Desk isn't configured — scan the project for one-click checks and long-running services."}),d.jsx(ee,{size:"small",surface:"chalkboard",onClick:t,disabled:e,children:e?d.jsxs(d.Fragment,{children:[d.jsx(tr,{size:"small",surface:"chalkboard",label:"Discovering"})," Discovering…"]}):"Discover from project"})]}),Ure=()=>{const{configLoaded:e,current:t,proposal:n,diff:r,discovering:s,startDiscovery:i,cancelProposal:o,applyProposal:a}=ire();return d.jsxs(d.Fragment,{children:[d.jsx(Bl,{surface:"chalkboard"}),d.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden p-[var(--pc-stack-pad)]",children:e?t?d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx(zre,{}),d.jsx(wre,{}),d.jsx(Cre,{})]}):d.jsx(Vre,{discovering:s,onDiscover:i}):d.jsx(Bre,{})}),n&&r&&d.jsx(Pre,{current:t,proposal:n,diff:r,onApply:a,onCancel:o})]})},Wre=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,{panelRef:s,anyChecksFailing:i,agentActive:o}=Une(r,n,t);return d.jsxs(d.Fragment,{children:[!r&&d.jsx("div",{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:d.jsx(qe,{icon:o?d.jsx(tr,{size:"small",surface:"chalkboard",label:"Agent running"}):i?d.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)]"}):d.jsx("span",{className:"text-2xs",children:"S"}),surface:"chalkboard",size:"small",label:o?"Open stack panel — agent running":i?"Open stack panel — checks failing":"Open stack panel",onClick:t,className:`w-7 h-[64px] rounded-l-md ${o?"shadow-[inset_0_0_0_1px_rgba(214,196,160,0.6)]":i?"shadow-[inset_0_0_0_1px_rgba(214,160,160,0.6)]":""}`})}),d.jsxs("aside",{ref:s,"aria-label":"Stack",className:"fixed inset-y-0 right-0 z-[300] flex w-[min(var(--pc-stack-width),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]",style:{transform:r?"translateX(0)":"translateX(100%)"},children:[!n&&d.jsx("div",{className:"flex h-10 shrink-0 items-center justify-end px-[var(--pc-stack-pad)]",children:d.jsx(qe,{icon:d.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"})}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[d.jsx(tre,{}),d.jsx(Ure,{})]})]})]})},_1=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=dre();return d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n?d.jsx("img",{src:n,alt:"",className:`object-contain shrink-0 ${e==="sm"?"w-[18px] h-[18px]":"w-[20px] h-[20px]"}`}):d.jsx(q6,{icon:d.jsx(Z4,{}),size:"small"}),d.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"})]})},Kre=()=>{const e=lt();return Li!==""?d.jsx(_1,{size:"sm"}):d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx(_1,{size:"sm"}),d.jsx(ee,{variant:"ghost",size:"small",className:"font-handwritten !text-sm opacity-70",onClick:()=>e({to:"/projects"}),children:"Back to projects"})]})},Hre=()=>{const e=M(l=>l.setGithubConfig),[t,n]=b.useState(""),[r,s]=b.useState(""),[i,o]=b.useState(""),a=t.trim()!==""&&r.trim()!==""&&i.trim()!=="";return d.jsxs(me,{size:"small",texture:"kraft",className:"mt-4 w-full max-w-sm text-left",children:[d.jsxs("p",{className:"m-0 mb-3 text-sm opacity-[0.65]",children:["No runtime reachable — paste a"," ",d.jsx("a",{href:"https://github.com/settings/personal-access-tokens/new",target:"_blank",rel:"noopener noreferrer",children:"fine-grained token"})," ","scoped to this repo to read and write the corpus directly."]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(rt,{size:"small",label:"Owner",value:t,onChange:l=>n(l.target.value)}),d.jsx(rt,{size:"small",label:"Repo",value:r,onChange:l=>s(l.target.value)}),d.jsx(rt,{size:"small",type:"password",label:"Token",value:i,onChange:l=>o(l.target.value)})]}),d.jsx(ee,{size:"small",className:"mt-3",disabled:!a,onClick:()=>e({owner:t.trim(),repo:r.trim(),token:i.trim()}),children:"Save"})]})},Gre=({layer:e})=>d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 py-24 text-center",children:[d.jsx("p",{className:"font-handwritten text-lg",children:e==="corpus"?"This needs the runtime or a GitHub token":"This needs the runtime"}),d.jsx("p",{className:"max-w-sm text-sm opacity-60",children:e==="corpus"?"Connect the project's runtime, or go plan-only below.":"Connect the project's runtime to use this — it owns the filesystem, git and the agent."}),e==="corpus"&&d.jsx(Hre,{})]}),Zre=()=>{const[e,t]=b.useState(null);return b.useEffect(()=>{},[]),e?d.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},qre=({routeKey:e,children:t,mobileOpen:n,onMobileClose:r})=>{const s=b.useRef(null);return b.useEffect(()=>{if(!n)return;const i=o=>{o.key==="Escape"&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n,r]),b.useEffect(()=>{var o;if(!n)return;const i=document.activeElement;return(o=s.current)==null||o.focus(),()=>{var a;return(a=i==null?void 0:i.focus)==null?void 0:a.call(i)}},[n]),d.jsxs(d.Fragment,{children:[n&&d.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}),d.jsxs("aside",{ref:s,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 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:[d.jsx("div",{className:"shrink-0 h-8"}),d.jsx("div",{className:"flex-1 overflow-y-auto relative",children:d.jsx("div",{children:t},e)})]})]})},VI=({label:e="Refresh data",refreshingLabel:t="Refreshing…",surface:n,withText:r=!1}={})=>{const s=M(l=>l.refreshAll),i=M(l=>l.refreshing),{toast:o}=Je(),a=async()=>{if(i)return;const l=await s();l.ok?o({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):o({title:"Couldn't refresh",description:l.error??"The read failed — is the dev server running?",variant:"error"})};return r?d.jsx(ee,{size:"small",variant:"ghost",surface:n,disabled:i,onClick:a,className:"font-handwritten text-xs",children:i?t:e}):d.jsx("span",{className:"inline-flex items-center gap-2",children:d.jsx(qe,{icon:d.jsx("span",{className:"inline-flex",children:d.jsx(Jx,{size:16})}),label:i?t:e,size:"small",variant:"ghost",surface:n,disabled:i,onClick:a})})};function Yre(){const e=M(u=>u.agentStatus),t=M(u=>u.gitStatus),n=M(u=>u.gitBranch),r=M(u=>u.gitAhead),s=M(FJ),i=M(BJ),o=M(VJ),a=M(u=>{var f;return((f=u.notifications)==null?void 0:f.filter(h=>h.kind==="question"||!h.read).length)??0}),l=lt(),c=e.find(u=>u.status==="running"||u.status==="starting"||u.status==="stopping");return{gitBranch:n,gitAhead:r,changedFileCount:(t==null?void 0:t.length)??0,agentActive:c!==void 0,activeTaskStatus:c==null?void 0:c.status,agentNotSignedIn:i,capabilityGapCount:s,rateLimit:o,unreadNotificationCount:a,onOpenSetup:()=>l({to:"/settings/$section",params:{section:"setup"}}),onOpenGit:()=>l({to:"/git"}),onOpenNotifications:()=>l({to:"/inbox"})}}function Jre(e){const t=[`Claude usage: ${e.status}`];return e.rateLimitType&&t.push(e.rateLimitType),e.resetsAt!==void 0&&t.push(`resets ${new Date(Gv(e.resetsAt)).toLocaleTimeString()}`),e.overage&&t.push("overage on"),t.join(" · ")}const Qre="flex items-center gap-3 h-8 px-4 border-b border-black/[0.08] text-xs shrink-0 box-border overflow-x-auto overflow-y-hidden whitespace-nowrap",Xre="flex items-center gap-3 shrink-0",ese="flex items-center gap-1",tse="opacity-50",nse="text-[var(--pui-text-primary)]",S1="opacity-60",rse="flex-1",C1="flex items-center gap-2 shrink-0",j1="bg-transparent border-none p-0 cursor-pointer",sse="relative inline-flex",ise="absolute -top-1 -right-1 pointer-events-none",ose=({gitBranch:e,gitAhead:t,changedFileCount:n,agentActive:r,activeTaskStatus:s,agentNotSignedIn:i,capabilityGapCount:o,rateLimit:a,unreadNotificationCount:l,onOpenSetup:c,onOpenGit:u,onOpenNotifications:f,trailing:h})=>d.jsxs("div",{className:Qre,style:Ho("kraft"),children:[d.jsxs("div",{className:Xre,children:[d.jsxs("span",{className:ese,children:[d.jsx("span",{className:tse,children:d.jsx(pk,{size:12})}),d.jsx("code",{className:nse,children:e??"no branch"})]}),t>0&&d.jsxs("span",{className:S1,children:["↑",t]}),d.jsx("span",{className:S1,children:n>0?`${n} changed`:"clean"}),r&&d.jsx(tr,{size:"small",label:`Agent ${s}…`}),i&&d.jsx(ye,{content:"Sign in from Settings → Connections so agent tasks can run",children:d.jsx("button",{type:"button",onClick:c,className:j1,children:d.jsx(ne,{size:"small",variant:"warning",children:"Agent not signed in"})})}),o>0&&d.jsx(ye,{content:"Some features are disabled — open Setup to fix",children:d.jsx("button",{type:"button",onClick:c,className:j1,children:d.jsxs(ne,{size:"small",variant:"warning",children:["Setup (",o,")"]})})}),a&&rd(a.status)!=="allowed"&&d.jsx(ye,{content:Jre(a),children:d.jsx(ne,{size:"small",variant:rd(a.status)==="rejected"?"error":"warning",children:rd(a.status)==="rejected"?"Claude limit reached":"Claude usage warning"})})]}),d.jsx("div",{className:rse}),h&&d.jsx("div",{className:C1,children:h}),d.jsxs("div",{className:C1,children:[d.jsx(ye,{content:"Git",children:d.jsx(qe,{variant:"ghost",size:"small",icon:d.jsx(pk,{}),label:"Git",onClick:u})}),d.jsx(ye,{content:"Notifications",children:d.jsxs("span",{className:sse,children:[d.jsx(qe,{variant:"ghost",size:"small",icon:d.jsx(V8,{}),label:"Notifications",onClick:f}),l>0&&d.jsx("span",{className:ise,children:d.jsx(ne,{size:"small",variant:"warning",children:l})})]})})]})]}),ase=()=>{const e=Yre();return d.jsx(ose,{...e,trailing:d.jsx(VI,{withText:!0})})},lse=()=>{const e=lt(),t=mh(),n=MI(),r=M(l=>l.plans),s=ure(),i=M(l=>l.activeDocTitle),o=M(l=>l.activeReleaseVersion),a=(()=>{if(t){const c=t.entityKind==="ticket"&&t.idea?((r==null?void 0:r.entries)??[]).find(u=>u.id===t.idea):void 0;return[{id:"plans",label:"Plans",onClick:()=>e({to:"/"})},...c?[{id:"board",label:c.title,onClick:()=>e($i(c))}]:[],{id:"plan",label:t.title}]}if(n)return[{id:"plans",label:"Plans",onClick:()=>e({to:"/"})},{id:"idea",label:n.title}];const l=s==="repo-docs"?i:s==="release-notes"?o:null;return l?[{id:"docs",label:"Docs",onClick:()=>e({to:"/docs"})},{id:"doc",label:l}]:null})();return a?d.jsx("div",{className:"-mt-6 mb-3",children:d.jsx(b8,{className:"font-handwritten !text-xs min-w-0",items:a})}):null},UI=({children:e,className:t=""})=>d.jsx("h1",{className:`text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1] ${t}`,children:e}),cse=({children:e})=>d.jsx(IP,{background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!1,showSidebar:!1,showPage:!1,bleedBottom:!0,children:d.jsx("div",{className:"h-full overflow-y-auto px-6 py-16",children:d.jsxs(Zx,{texture:{texture:"parchment"},className:"m-auto w-full max-w-3xl",children:[d.jsx(UI,{children:"Paper Camp"}),e]})})});function use(e,t,n){return e!==""||t!==""||n}async function dse(e,t){if(e!=="")return!1;try{const n=await t("/api/capabilities");return n.ok?(await n.json(),!0):!1}catch{return!1}}function WI(e,t){return`${e}?runtime=${encodeURIComponent(t)}`}function fse(e){try{return new URL(e).host}catch{return e}}function hse(e,t){return`${e}/p/${t}`}function pse(e,t){const n=new Set(t);return e.filter(r=>!n.has(r.runtimeUrl))}async function mse(){const e=await J(W("/api/github/device-code"),{method:"POST"});if(!e.ok)throw new Error("Could not reach GitHub.");return e.json()}async function gse(e){return(await J(W("/api/github/device-token"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:e})})).json()}const Zv="papercamp:github-hub-token";function KI(){try{return localStorage.getItem(Zv)}catch{return null}}function E1(e){try{localStorage.setItem(Zv,e)}catch{}}function P1(){try{localStorage.removeItem(Zv)}catch{}}const yse="https://api.github.com";async function HI(e,t){const n=await fetch(`${yse}${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/vnd.github+json"}});if(!n.ok){const r=await n.json().catch(()=>null);throw new Ev((r==null?void 0:r.message)??`GitHub API error (${n.status})`,n.status)}return n.json()}async function xse(e){const t=await HI(e,"/user");return{login:t.login,avatarUrl:t.avatar_url}}async function vse(e){const t=[];for(let n=1;;n++){const r=await HI(e,`/user/repos?per_page=100&affiliation=owner,collaborator&page=${n}`);if(!Array.isArray(r)||r.length===0||(t.push(...r.map(s=>s.full_name)),r.length<100))break}return t}async function Jp(e){const[t,n]=await Promise.all([xse(e),vse(e)]);return{identity:t,repoNames:n}}function T1(e){return e instanceof Ev?e.message:"Could not reach GitHub."}function wse(){const[e,t]=b.useState(""),[n,r]=b.useState(null),[s,i]=b.useState(!1),[o,a]=b.useState(null),[l,c]=b.useState(null),[u,f]=b.useState(!1),h=b.useRef(null);b.useEffect(()=>{const v=KI();v&&(i(!0),Jp(v).then(w=>r(w)).catch(()=>{P1(),a("That token no longer works — reconnect below.")}).finally(()=>i(!1)))},[]);const p=()=>{const v=e.trim();v!==""&&(i(!0),a(null),Jp(v).then(w=>{E1(v),r(w),t(""),c(null)}).catch(w=>a(T1(w))).finally(()=>i(!1)))},m=()=>{P1(),r(null),a(null)},g=async(v,w)=>{if(await new Promise(_=>setTimeout(_,w*1e3)),h.current!==v)return;const k=await gse(v);if(h.current===v){if(k.access_token){h.current=null,E1(k.access_token);try{r(await Jp(k.access_token))}catch(_){a(T1(_))}c(null);return}if(k.error==="authorization_pending"){await g(v,w);return}if(k.error==="slow_down"){await g(v,k.interval??w+5);return}h.current=null,c(null),a(k.error_description??"GitHub sign-in did not complete.")}};return{connection:n,loading:s,error:o,deviceFlow:l,deviceFlowLoading:u,token:e,setToken:t,connectWithToken:p,disconnect:m,signIn:()=>{f(!0),a(null),mse().then(v=>{h.current=v.device_code,window.open(v.verification_uri,"_blank","noopener,noreferrer"),c({userCode:v.user_code,deviceCode:v.device_code,verificationUri:v.verification_uri}),g(v.device_code,v.interval)}).catch(()=>a("Could not reach GitHub.")).finally(()=>f(!1))},cancelDeviceFlow:()=>{h.current=null,c(null),a(null)}}}function bse(e){return e.trim().replace(/\/+$/,"")}function kse(){const[e,t]=b.useState(""),[n,r]=b.useState(""),[s,i]=b.useState(null),[o,a]=b.useState(!1),[l,c]=b.useState(null);return{machineUrl:e,setMachineUrl:h=>{t(h),i(null),c(null)},connectedUrl:n,projects:s,loading:o,error:l,connect:()=>{const h=bse(e);h!==""&&(a(!0),c(null),w9(h).then(p=>{if(!p||p.length===0){c("No projects found there — is paper-camp daemon running on that address?");return}r(h),i(p)}).finally(()=>a(!1)))}}}const Qi=typeof window>"u"?null:window.localStorage;function _se(e){if(HN(Ms(e),Qi),e.kind==="github"){const t=KI();t&&nT({token:t,owner:e.owner,repo:e.repo})}window.location.assign(Li||"/")}function Sse(){const[e,t]=b.useState(()=>Gg(Qi)),n=()=>t(Gg(Qi));return{projects:e,addGithubEntry:r=>{wJ(r,Qi),n()},renameEntry:(r,s)=>{kJ(r,s,Qi),n()},removeEntry:r=>{bJ(r,Qi),n()},openEntry:r=>{const s=e.find(i=>Ms(i)===r);s&&_se(s)}}}const Cse="0.26.0",GI=Cse,jse={name:null,reachable:!1,remoteVersion:null,versionSkew:!1};function Ese(e){const[t,n]=b.useState({}),r=e.map(s=>s.runtimeUrl).join(`
|
|
299
|
+
`);return b.useEffect(()=>{let s=!1;const i=r===""?[]:r.split(`
|
|
300
|
+
`);return Promise.all(i.map(async o=>{const[a,l]=await Promise.all([S9(o),y9(o)]),c=l===null?jse:{name:a?qP(a):null,reachable:!0,remoteVersion:l,versionSkew:l!==GI};return[o,c]})).then(o=>{s||n(Object.fromEntries(o))}),()=>{s=!0}},[r]),t}function Pse(){const[e,t]=b.useState([]),[n,r]=b.useState(!0),s=b.useCallback(i=>{r(!0),v9(i).then(o=>t(o??[])).finally(()=>r(!1))},[]);return b.useEffect(()=>{s(!1)},[s]),{peers:e,loading:n,refresh:()=>s(!0)}}function Tse(e,t){window.location.assign(WI(window.location.pathname,hse(e,t)))}const Nse=()=>{const{machineUrl:e,setMachineUrl:t,connectedUrl:n,projects:r,loading:s,error:i,connect:o}=kse();return d.jsxs(me,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Connect to a machine"}),d.jsxs("p",{className:"m-0 text-sm opacity-70",children:["Paste the address of a machine running ",d.jsx("code",{children:"paper-camp daemon"})," this browser can reach — its LAN or tailnet address from another machine. ",d.jsx("code",{children:"localhost"})," only works on the machine running it."]}),d.jsx(rt,{size:"small",label:"Machine URL",placeholder:"http://localhost:4333",value:e,onChange:a=>t(a.target.value)}),r?d.jsx("div",{className:"flex max-h-[160px] flex-col gap-1 overflow-y-auto",children:r.map(a=>d.jsx(It,{size:"small",className:"min-w-0",onClick:()=>Tse(n,a.slug),children:d.jsx("span",{className:"truncate",children:a.name})},a.slug))}):d.jsxs(d.Fragment,{children:[i&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:i}),d.jsx(ee,{size:"small",disabled:e.trim()===""||s,onClick:o,children:s?"Connecting…":"Connect"})]})]})},Ise="https://github.com/settings/personal-access-tokens/new",Ase=({token:e,onTokenChange:t,loading:n,onConnect:r})=>d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"m-0 text-sm opacity-70",children:["Mint a"," ",d.jsx("a",{href:Ise,target:"_blank",rel:"noopener noreferrer",children:"fine-grained token"})," ","scoped to the repositories you want, then paste it in."]}),d.jsx(rt,{size:"small",type:"password",label:"Token",value:e,onChange:s=>t(s.target.value)}),d.jsx(ee,{size:"small",variant:"secondary",disabled:e.trim()===""||n,onClick:r,children:n?"Connecting…":"Connect"})]}),Rse=({state:e,error:t,onCancel:n,token:r,onTokenChange:s,tokenLoading:i,onTokenConnect:o})=>{const[a,l]=b.useState(!1);return d.jsxs(me,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Sign in with GitHub"}),d.jsx("p",{className:"m-0 text-sm opacity-70",children:"Enter this code on the GitHub tab that just opened:"}),d.jsxs("p",{className:"m-0 flex items-center gap-2 text-lg font-semibold tracking-widest",children:[e.userCode,d.jsx(qd,{text:e.userCode})]}),t&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:t}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(ee,{size:"small",variant:"secondary",onClick:n,children:"Cancel"}),!a&&d.jsx(ee,{size:"small",variant:"ghost",onClick:()=>l(!0),children:"Paste a token instead"})]}),a&&d.jsx(Ase,{token:r,onTokenChange:s,loading:i,onConnect:o})]})};function Lse({repoName:e}){const t=e.indexOf("/");return t===-1?d.jsx("span",{className:"block truncate",title:e,children:e}):d.jsxs("span",{className:"flex min-w-0 items-center",title:e,children:[d.jsx("span",{className:"min-w-0 truncate",children:e.slice(0,t)}),d.jsx("span",{className:"shrink-0",children:e.slice(t)})]})}const Mse=({connection:e,chosenRepoNames:t,onDisconnect:n,onAddRepo:r})=>{const[s,i]=b.useState(""),o=new Set(t),a=s.trim().toLowerCase(),l=e.repoNames.filter(c=>!o.has(c)&&c.toLowerCase().includes(a));return d.jsxs(me,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("p",{className:"m-0 min-w-0 truncate font-semibold",title:`Connected as ${e.identity.login}`,children:["Connected as ",e.identity.login]}),d.jsx(ee,{size:"small",variant:"secondary",className:"shrink-0",onClick:n,children:"Disconnect"})]}),d.jsx(rt,{type:"search",size:"small",placeholder:"Search repositories…","aria-label":"Search repositories",value:s,onChange:c=>i(c.target.value)}),d.jsx("div",{className:"flex max-h-[160px] flex-col gap-1 overflow-y-auto",children:l.length===0?d.jsx("p",{className:"m-0 text-sm opacity-70",children:e.repoNames.length===0?"This token reaches no repositories yet.":"No matching repositories."}):l.map(c=>d.jsx(It,{size:"small",className:"min-w-0",onClick:()=>r(c),children:d.jsx(Lse,{repoName:c})},c))})]})},$se=({chosenRepoNames:e,onAddRepo:t})=>{const{connection:n,loading:r,error:s,deviceFlow:i,deviceFlowLoading:o,token:a,setToken:l,connectWithToken:c,disconnect:u,signIn:f,cancelDeviceFlow:h}=wse();return n?d.jsx(Mse,{connection:n,chosenRepoNames:e,onDisconnect:u,onAddRepo:t}):i?d.jsx(Rse,{state:i,error:s,onCancel:h,token:a,onTokenChange:l,tokenLoading:r,onTokenConnect:c}):d.jsxs(me,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Connect GitHub"}),d.jsx("p",{className:"m-0 text-sm opacity-70",children:"Sign in to browse and plan against your repositories."}),d.jsx(ee,{size:"small",disabled:o,onClick:f,children:o?"Starting…":"Sign in with GitHub"}),s&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:s})]})};function Dse(e){window.location.assign(WI(window.location.pathname,e.runtimeUrl))}const Ose=({chosenRuntimeUrls:e})=>{const{peers:t,loading:n,refresh:r}=Pse();if(t.length===0)return null;const s=pse(t,e);return d.jsxs(me,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Tailnet"}),d.jsx(qe,{icon:d.jsx(Jx,{size:16}),label:n?"Refreshing…":"Refresh",size:"small",variant:"ghost",disabled:n,onClick:r})]}),s.length===0?d.jsx("p",{className:"m-0 text-sm opacity-70",children:"Every discovered runtime is already added."}):d.jsx("div",{className:"flex max-h-[160px] flex-col gap-1 overflow-y-auto",children:s.map(i=>d.jsx(It,{size:"small",className:"min-w-0",onClick:()=>Dse(i),children:d.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5 text-left",children:[d.jsx("span",{className:"truncate",children:i.dnsName}),i.version&&d.jsxs("span",{className:"font-handwritten text-2xs opacity-60",children:["v",i.version]})]})},i.runtimeUrl))})]})},zse=({projects:e,onAddRepo:t})=>d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Add a project"}),d.jsx($se,{chosenRepoNames:e.filter(n=>n.kind==="github").map(Ms),onAddRepo:t}),d.jsx(Ose,{chosenRuntimeUrls:e.filter(n=>n.kind==="runtime").map(Ms)}),d.jsx(Nse,{})]}),Fse=({open:e,currentLabel:t,onClose:n,onSubmit:r})=>{const[s,i]=b.useState(t);return d.jsx(Fs,{open:e,onClose:()=>{n(),i(t)},title:"Rename project",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx(rt,{label:"Name",value:s,onChange:o=>i(o.target.value),placeholder:"Project name",autoFocus:!0}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:n,children:"Cancel"}),d.jsx(ee,{type:"button",variant:"primary",onClick:()=>r(s),children:"Save"})]})]})})},Bse=({projectName:e,currentLabel:t,onRename:n,onRemove:r})=>{const[s,i]=b.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(Yx,{align:"end",trigger:d.jsx(qe,{variant:"ghost",size:"small",className:"shrink-0",label:`${e} actions`,icon:d.jsx("span",{"aria-hidden":"true",children:"···"}),onClick:o=>o.stopPropagation()}),items:[{id:"rename",label:"Rename",onSelect:()=>i(!0)},{id:"remove",label:"Remove",danger:!0,onSelect:r}]}),d.jsx(Fse,{open:s,currentLabel:t,onClose:()=>i(!1),onSubmit:o=>{n(o),i(!1)}})]})};function Vse(e){return e.kind==="runtime"?fse(e.runtimeUrl):`${e.owner}/${e.repo}`}function Use(e,t){return e.label?e.label:e.kind==="runtime"?t:e.repo}function Wse({entry:e,status:t}){return e.kind==="github"?d.jsx(ne,{size:"small",variant:"info",children:"Plan-only"}):t?t.reachable?t.versionSkew?d.jsx(ye,{content:`Runtime is on ${t.remoteVersion}, this client is on ${GI}`,children:d.jsx(ne,{size:"small",variant:"warning",children:"Version mismatch"})}):d.jsx(ne,{size:"small",variant:"success",children:"Can execute"}):d.jsx(ne,{size:"small",variant:"info",children:"Plan-only"}):d.jsx(ne,{size:"small",variant:"neutral",children:"Checking…"})}const Kse=({entry:e,status:t,onOpen:n,onRename:r,onRemove:s})=>{const i=Vse(e),o=Use(e,(t==null?void 0:t.name)??null);return d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(It,{size:"medium",className:"min-w-0 flex-1",onClick:n,action:d.jsx(Wse,{entry:e,status:t}),children:o?d.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5 text-left",children:[d.jsx("span",{className:"break-words",children:o}),d.jsx("span",{className:"break-words font-handwritten text-2xs opacity-60",children:i})]}):d.jsx("span",{className:"block break-words text-left",children:i})}),d.jsx(Bse,{projectName:o??i,currentLabel:e.label??"",onRename:r,onRemove:s})]})};function Hse(e){return e.kind==="runtime"}const Gse=({projects:e,onOpen:t,onRename:n,onRemove:r})=>{const s=Ese(e.filter(Hse));return d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Projects"}),e.length===0?d.jsx("p",{className:"m-0 text-sm opacity-70",children:"Nothing here yet — add a project from the right."}):d.jsx("div",{className:"flex flex-col gap-1",children:e.map(i=>{const o=Ms(i);return d.jsx(Kse,{entry:i,status:i.kind==="runtime"?s[i.runtimeUrl]:void 0,onOpen:()=>t(o),onRename:a=>n(o,a),onRemove:()=>r(o)},o)})})]})},Zse=()=>{const{projects:e,addGithubEntry:t,renameEntry:n,removeEntry:r,openEntry:s}=Sse();return d.jsxs("div",{className:"flex flex-col gap-6 md:flex-row md:items-stretch",children:[d.jsx("div",{className:"min-w-0 md:flex-1",children:d.jsx(Gse,{projects:e,onOpen:s,onRename:n,onRemove:r})}),d.jsx(Bl,{orientation:"horizontal",className:"md:hidden"}),d.jsx(Bl,{orientation:"vertical",className:"hidden md:block"}),d.jsx("div",{className:"min-w-0 md:flex-1",children:d.jsx(zse,{projects:e,onAddRepo:t})})]})},N1=(e,t)=>{var n;return((n=e.find(r=>r.name===t))==null?void 0:n.status)??"stale"};function ZI(e,t){var n;return{qualityStatus:N1(t,"lint"),testStatus:N1(t,"test"),consistencyStatus:((n=e==null?void 0:e.consistency)==null?void 0:n.status)??"stale"}}const qse=()=>{const e=M(g=>g.status),t=M(g=>g.runConsistencyCheck),{checks:n,run:r}=wc(),s=M(g=>g.consistency),i=M(g=>g.plans),o=lt(),[a,l]=b.useState(!1),{qualityStatus:c,testStatus:u,consistencyStatus:f}=b.useMemo(()=>ZI(e,n),[e,n]),h=c==="running"||u==="running"||f==="running",p=s.length>0,m=b.useCallback(g=>g.planId?i==null?void 0:i.entries.find(x=>x.id===g.planId):void 0,[i==null?void 0:i.entries]);return{qualityStatus:c,testStatus:u,consistencyStatus:f,anyRunning:h,hasDocIssues:p,consistency:s,docsExpanded:a,setDocsExpanded:l,navigate:o,runDeskCheck:r,runConsistencyCheck:t,linkedPlanFor:m}},Qp=new Map,I1=new Map,Yse=e=>`commit-draft:${e}`;function Jse(e,t){const{formKey:n,suggestedTitle:r,matchesSuggestionTask:s,beforeCommit:i}=t,o=M(N=>N.agentStatus),a=M(N=>N.loadGitStatus),l=M(N=>N.loadDiffFiles),c=M(N=>N.commitInFlight),u=M(N=>N.setCommitInFlight),{toast:f}=Je(),[h,p]=b.useState(""),[m,g]=b.useState(""),[x,y]=b.useState(!1),[v,w]=b.useState(!1),[k,_]=b.useState(null),S=b.useMemo(()=>e.map(N=>N.path),[e]),j=b.useMemo(()=>e.filter(N=>N.staged).length,[e]);b.useEffect(()=>{r&&!h&&p(r)},[r,h]);const E=Yse(n);b.useEffect(()=>{const N=mc(E);p((N==null?void 0:N.title)??""),g((N==null?void 0:N.message)??"")},[E]),b.useEffect(()=>{!h&&!m||gc(E,{title:h,message:m})},[E,h,m]),b.useEffect(()=>{const N=Qp.get(n)??Date.now();Qp.set(n,N);const R=I1.get(n)??new Set,L=o.find(I=>s(I)&&I.suggestedCommit&&!R.has(I.id)&&(I.lastStreamAt??0)>N);L!=null&&L.suggestedCommit&&(R.add(L.id),I1.set(n,R),p(L.suggestedCommit.title),g(L.suggestedCommit.message))},[o,n,s]);const T=b.useCallback(async()=>{if(!h.trim()||c)return;y(!0),u(!0);let N;try{const R=i?await i(h.trim()):void 0;N=R==null?void 0:R.onFailure;const L=R==null?void 0:R.extraPath;if(j>0)L&&await e9(L),await Ng([],h.trim(),m.trim()||void 0);else{const I=L&&!S.includes(L)?[...S,L]:S;await Ng(I,h.trim(),m.trim()||void 0)}p(""),g(""),Qp.set(n,Date.now()),Nv(E),await Promise.all([a(),l()])}catch(R){N&&await N(),f({title:"Commit failed",description:Ge(R.message),variant:"error"}),await Promise.all([a(),l()])}finally{y(!1),u(!1)}},[h,m,S,j,a,l,c,u,f,n,E,i]),P=b.useCallback(async()=>{if(S.length!==0){w(!0),_(null);try{const N=await HP(S);p(N.title),g(N.message)}catch(N){_(N.message)}finally{w(!1)}}},[S]);return{commitTitle:h,setCommitTitle:p,commitMessage:m,setCommitMessage:g,committing:x,commitInFlight:c,stagedCount:j,suggesting:v,suggestError:k,setSuggestError:_,handleCommit:T,handleSuggestFromChanges:P}}const kc=()=>{const e=M(a=>a.loadPlans),t=M(a=>a.runtimeReachable),n=M(a=>a.githubConfig),{toast:r}=Je(),[s,i]=b.useState(!1);return{patch:async(a,l,c)=>{i(!0);try{return!t&&n?await vY(n,a,l):await vW(a,l),await e(),!0}catch(u){return r({title:(c==null?void 0:c.errorTitle)??"Update failed",description:u.message,variant:"error"}),!1}finally{i(!1)}},updating:s}},Qse=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function Xse(e){var r;if(e.phases.length>0&&e.phases.every(s=>s.done))return{title:""};const t=((r=e.tags)==null?void 0:r.find(s=>Qse.includes(s)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const eie=(e,t)=>{const n=M(x=>x.status),{checks:r}=wc(),s=M(uh),i=M(x=>x.launchRunAll),{patch:o}=kc(),[a,l]=b.useState(!1),{title:c}=b.useMemo(()=>Xse(e),[e]),u=b.useMemo(()=>t.map(x=>x.path),[t]),f=b.useCallback(async x=>{if(!e.id||rJ(u))return{};const y=e.id;return await o(e.title,{phases:nJ(e.phases,x)})?{extraPath:sJ(y),onFailure:async()=>{await o(e.title,{phases:e.phases})}}:{}},[e,u,o]),h=b.useCallback(x=>x.planId===e.id,[e.id]),p=Jse(t,{formKey:e.id??"__plan-draft__",suggestedTitle:c,matchesSuggestionTask:h,beforeCommit:f}),m=!!e.id&&!s,g=b.useCallback(async()=>{if(!e.id||!n||a||s)return;const x=e.id;l(!0);try{const y=XY(e.fixes??[],n,r);await o(e.title,{fixes:y})&&await i(x)}finally{l(!1)}},[e,a,s,n,r,o,i]);return{...p,canFix:m,fixing:a,handleFix:g}},tie=3*6e4,nie=(e,t)=>{const n=M(o=>o.loadPlans),r=e.thread??[],s=r[r.length-1],i=e.id;b.useEffect(()=>{if(!i||!s||s.kind!=="chat")return;const o=setTimeout(()=>{V9(i).then(a=>{if(!a.skipped)return n()}).catch(()=>{})},tie);return()=>clearTimeout(o)},[t,i,s,n])},rie=e=>{const t=M(a=>a.loadPlans),{toast:n}=Je(),[r,s]=b.useState(null);return{promotingIndex:r,promoteToDurable:async(a,l)=>{if(!(!e.id||r!==null)){s(a);try{await yk(e.id,a,l),await t()}catch(c){n({title:"Promote failed",description:Ge(c.message),variant:"error"})}finally{s(null)}}},promoteToIdea:async(a,l)=>{if(!e.id||r!==null)return!1;s(a);try{const c=await XP(l);return await yk(e.id,a,"log",`Captured as ${c}: ${l.title}`).catch(()=>{}),await t(),!0}catch(c){return n({title:"Promote failed",description:Ge(c.message),variant:"error"}),!1}finally{s(null)}}}};function sie(e,t){const[n,r]=b.useState(""),[s,i]=b.useState(null),[o,a]=b.useState(null),l=e.thread??[],{promotingIndex:c,promoteToDurable:u,promoteToIdea:f}=rie(e);nie(e,!0);const h=oJ(e);return b.useEffect(()=>{r(mc(h)??"")},[h]),b.useEffect(()=>{n&&gc(h,n)},[h,n]),{thread:l,input:n,setInput:r,pending:s,promotingIndex:c,ideaPromptIndex:o,handleSend:async()=>{const y=n.trim();y&&(i(y),r(""),await t(y)?Nv(h):r(v=>v||y),i(null))},handlePromote:(y,v)=>{v==="idea"?a(y):u(y,v)},handlePromoteToIdea:async y=>{o!==null&&await f(o,y)&&a(null)},closeIdeaPrompt:()=>a(null)}}const iie=()=>{const e=M(T=>T.plans),t=M(T=>T.plansError),n=M(T=>T.ideaEntries),r=M(T=>T.suggestions),s=M(T=>T.setDetailView),i=M(T=>T.planFilters),o=M(T=>T.setSubjectFilter),a=M(T=>T.dismissSuggestion),l=mh(),c=MI(),{planId:u,ideaId:f}=Ai({strict:!1}),h=lt(),p=$I(),{toast:m}=Je(),{subject:g}=hx({strict:!1});b.useEffect(()=>{o(g??null)},[g,o]);const x=u??f,y=b.useRef(x);b.useEffect(()=>{y.current!==x&&s("details"),y.current=x},[x,s]);const v=()=>{h({to:"/"})},w=T=>{var N;const P=(N=e==null?void 0:e.entries.find(R=>R.title===T))==null?void 0:N.id;p(P,T)},k=T=>{var N;const P=(N=n.find(R=>R.title===T))==null?void 0:N.id;h({to:"/ideas/$ideaId",params:{ideaId:LI(P,T)}})},_=T=>{p(T.id,T.title)},[S,j]=b.useState(null);return{plans:e,plansError:t,ideaEntries:n,suggestions:r,planFilters:i,activePlan:l,activeIdea:c,planId:u,ideaId:f,openSuggestion:S,setOpenSuggestion:j,handleBack:v,handleOpenPlan:w,handleOpenIdea:k,handleOpenArchivable:_,handleDismissSuggestion:async T=>{try{await a(T)}catch(P){m({title:"Failed to dismiss suggestion",description:P.message,variant:"error"})}}}},ly=.95,oie=3e4,cy={implement:{from:0,to:.6},verify:{from:.6,to:.9},checkbox:{from:.95,to:.95}};function aie(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 lie(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=aie(t),r={};for(const s of["implement","verify"]){const i=cy[s].to-cy[s].from;r[s]=n*i/ly}return r}function cie({anchor:e,anchorEnteredAt:t,lastStreamAt:n,now:r,medians:s}){if(!e)return 0;const i=cy[e],o=Math.min(i.from,ly),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+oie),c=Math.min(1,Math.max(0,l-t)/a);return Math.min(i.from+c*(i.to-i.from),ly)}const uie=new Set(["starting","running","stopping"]),die=1e3;function fie(e,t){const n=e!==void 0&&e.phaseIndex!==void 0&&uie.has(e.status),[r,s]=b.useState(()=>Date.now());return b.useEffect(()=>{if(!n)return;const i=setInterval(()=>s(Date.now()),die);return()=>clearInterval(i)},[n]),!n||(e==null?void 0:e.phaseIndex)===void 0?null:{index:e.phaseIndex,fraction:cie({anchor:e.phaseAnchor,anchorEnteredAt:e.anchorEnteredAt,lastStreamAt:e.lastStreamAt,now:r,medians:lie(t)})}}const hie=(e,{reload:t,notify:n})=>{const[r,s]=b.useState(!1),[i,o]=b.useState(!1),[a,l]=b.useState(null);return b.useEffect(()=>{l(null)},[e.id]),{sending:r,send:async f=>{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 B9(e.id,f,h);return await t(),m&&l(m),p&&n({title:"Agent did not reply",description:Ge(p),variant:"error"}),!0}catch(h){return n({title:"Message failed to send",description:Ge(h.message),variant:"error"}),!1}finally{s(!1)}},undo:a,undoing:i,undoEdit:async()=>{if(!(!e.id||!a)){o(!0);try{const{error:f}=await U9(e.id,a.commitSha);if(f){n({title:"Undo failed",description:Ge(f),variant:"error"});return}l(null),await t()}catch(f){n({title:"Undo failed",description:Ge(f.message),variant:"error"})}finally{o(!1)}}}}},pie=async e=>{const t=await J(W(`/api/trail?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load the provenance trail");return t.json()},mie=e=>{const[t,n]=b.useState(null);return b.useEffect(()=>{if(n(null),!e)return;let r=!1;return pie(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t},gie=()=>{const[e,t]=b.useState(new Set);return b.useEffect(()=>{let n=!1;return JP().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},qv="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.",qI="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 yie(e){const t=e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
|
|
301
|
+
`),n=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
302
|
+
`):"(none)",r=e.clarifications&&e.clarifications.length>0?e.clarifications.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
303
|
+
`):"(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.
|
|
304
|
+
|
|
305
|
+
Plan body: ${e.body}
|
|
306
|
+
|
|
307
|
+
Current phases:
|
|
308
|
+
${t}
|
|
309
|
+
|
|
310
|
+
Log entries (issues, bugs, and review notes recorded so far):
|
|
311
|
+
${n}
|
|
312
|
+
|
|
313
|
+
Clarifications (answered scope/design questions):
|
|
314
|
+
${r}
|
|
315
|
+
|
|
316
|
+
${qv}
|
|
317
|
+
|
|
318
|
+
Task:
|
|
319
|
+
1. Read the plan above, then inspect the relevant code in this repo.
|
|
320
|
+
2. Identify work that is clearly required to fulfil this plan but is covered by no existing phase. The Log entries are the best source — they often record bugs or gaps that were never turned into phases.
|
|
321
|
+
3. If you found missing work: append one \`- [ ] <short phase title>\` line per item at the end of the \`### Phases\` list. You may add detail below a checkbox line as continuation lines indented with 6 spaces. Then append exactly one line to the \`### Log\` section, formatted \`- YYYY-MM-DD: <what was found and appended>\`, creating that section after the Phases list if it does not exist.
|
|
322
|
+
4. If nothing is missing: make no edits at all — no Log line, no empty heading, no "nothing found" note. This audit re-runs regularly and must leave no trace when there is nothing to add.
|
|
323
|
+
|
|
324
|
+
Rules:
|
|
325
|
+
- Never modify, reorder, check, uncheck, or delete any existing line, even if it looks stale, wrong, or redundant.
|
|
326
|
+
- Never touch the YAML frontmatter.
|
|
327
|
+
- Append only: new unchecked phases at the end of the list, plus the single Log line.`}function xie(e){const t=e.phases.length>0,n=t?"plan":"idea",r=t?e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
|
|
328
|
+
`):"(none — this is a backlog idea with no phases yet)";return`You are reconciling the ${n} "${e.title}" (${e.id??"no id"}), stored as 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.
|
|
329
|
+
|
|
330
|
+
${t?"Plan":"Idea"} body: ${e.body}
|
|
331
|
+
|
|
332
|
+
Current phases:
|
|
333
|
+
${r}
|
|
334
|
+
|
|
335
|
+
Task: this ${n} has drifted from the codebase — some ${t?"phase descriptions and body prose":"body prose"} may reference file paths that moved, code symbols that were renamed or removed, or approaches that were superseded during implementation. Find and fix only that drift.
|
|
336
|
+
|
|
337
|
+
1. Read the ${n} above, then inspect the relevant code in this repo to find what has actually changed since the prose was written.
|
|
338
|
+
2. Reword only the sentences or phrases that are now stale: fix references and superseded approaches. Leave everything else byte-identical.
|
|
339
|
+
3. Do not summarize, restructure, or "improve" prose that is still accurate — an unnecessary rewrite is a failure of this task, not a bonus.
|
|
340
|
+
|
|
341
|
+
Hard guardrails, never violate these:
|
|
342
|
+
- Never touch the YAML frontmatter (id, title, kind, status, created, idea, tags, or any other field).
|
|
343
|
+
- Never un-check, check, delete, or reorder any phase line, checked or unchecked.
|
|
344
|
+
- Never add or remove phases.
|
|
345
|
+
- Never touch the Log or Clarifications sections.
|
|
346
|
+
- If nothing is stale, make no edits at all.`}function vie(){return{done:!1,text:"Style pass",description:"Scope yourself to only the files this plan has changed — compare against the base branch (e.g. `git diff main...HEAD --name-only`), never the wider codebase. Read docs/CODE_STYLE.md in full and apply it to those files:\n\n- Delete any comment that fails §7 — the cap is two lines and the default count is zero.\n- Move complex logic out of components into hooks/, leaving components rendering what a hook returns.\n- Sort files into the by-role folders of §4, and split a file holding more than one component.\n- Replace a literal with its design token (§2) and a hand-rolled element with its paper-ui component (§1).\n- Extract anything now written three times (§3) — into the feature's helpers/ if it is feature logic, into @/app/utils or @/app/hooks if it is not.\n- Apply §5's naming rules: every component's props are a named `{Component}Props` interface, duplicate import statements from one module merge into one, and table/list column definitions live outside the JSX.\n\nBehaviour may not change. Finish with `pnpm check-types`, `pnpm lint` and `npx vitest run` all green, and do not edit any test to accommodate a change — a test that has to change means this pass altered behaviour and went too far."}}function Yv(e,t,n,r){return`You are ${t} the idea ${e.id??"no id"} ("${e.title}"), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md. Edit only that file, and within it only the \`### Log\` section.
|
|
347
|
+
|
|
348
|
+
${n}
|
|
349
|
+
|
|
350
|
+
${qv}
|
|
351
|
+
|
|
352
|
+
Task:
|
|
353
|
+
1. Explore this codebase and find what is relevant to the idea: the files it would touch, existing helpers or patterns it should build on, and constraints visible in the code.
|
|
354
|
+
2. Write up what you found as a single dated entry — name specific files and symbols, describe a workable approach, and include the architectural context you found. Sharpen the idea's original intent, do not redirect it.
|
|
355
|
+
3. Append exactly one line to the \`### Log\` section, formatted \`- YYYY-MM-DD: <what you found>\`, creating that section at the end of the file if it does not exist. Use today's date, and keep the entry to that single physical line (no literal line breaks).
|
|
356
|
+
|
|
357
|
+
Keep unchanged:
|
|
358
|
+
${r}
|
|
359
|
+
|
|
360
|
+
Append only — never rewrite or delete the idea's existing body or prior Log lines.`}function wie(e){const t=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
361
|
+
`):"(none)",n=`Current idea body, in full (do not modify this):
|
|
362
|
+
${e.body}
|
|
363
|
+
|
|
364
|
+
Prior Log entries:
|
|
365
|
+
${t}`,r=`- the YAML frontmatter (id, title)
|
|
366
|
+
- the \`## ${e.id??"IDEA-N"}: ${e.title}\` heading line and the original body prose beneath it`;return Yv(e,"expanding",n,r)}const YI=`- the YAML frontmatter (id, title, status)
|
|
367
|
+
- the original body prose beneath the frontmatter`;function bie(e){const t=`This idea was just promoted from an AI-generated one-liner suggestion — its current body is only that one-liner, with no deeper context yet:
|
|
368
|
+
${e.body}`;return Yv(e,"fleshing out",t,YI)}function Xae(e,t){const n=`This idea was just promoted from a roadmap item under "${t}" in ROADMAP.md — its current body is only that item's one-line description plus a provenance note, with no deeper context yet:
|
|
369
|
+
${e.body}`;return Yv(e,"fleshing out",n,YI)}function kie(e,t){const n=t.filter(s=>s.status!=="done"),r=n.length?n.map(s=>`${s.id??"no id"}: ${s.title} (${s.phases.length} phases)`).join(`
|
|
370
|
+
`):"(no other open plans exist yet)";return`You are drafting a plan for the idea ${e.id??"no id"} ("${e.title}"), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md. The idea and its plan are ONE file: you draft the plan by editing that existing file in place — never create a new file.
|
|
371
|
+
|
|
372
|
+
Idea body, in full:
|
|
373
|
+
${e.body}
|
|
374
|
+
|
|
375
|
+
## What drafting adds to the file (see papercamp/about.md)
|
|
376
|
+
|
|
377
|
+
The file already has YAML frontmatter (id, title, status, created, …) and the prose body above. Drafting means:
|
|
378
|
+
|
|
379
|
+
1. Add a \`type\` field to the frontmatter: the Conventional Commits type that best fits (\`feat | fix | chore | docs | refactor\` — most are \`feat\`).
|
|
380
|
+
2. Add 1-4 short subsystem \`tags\` to the frontmatter if it has none.
|
|
381
|
+
3. Append a \`### Phases\` checklist at the end of the file (after any \`### Log\` section move it below the phases — Phases, then Log):
|
|
382
|
+
|
|
383
|
+
\`\`\`
|
|
384
|
+
### Phases
|
|
385
|
+
- [ ] Short phase title
|
|
386
|
+
Optional description of the phase, indented with 6 spaces.
|
|
387
|
+
\`\`\`
|
|
388
|
+
|
|
389
|
+
${qv}
|
|
390
|
+
|
|
391
|
+
Hard rules:
|
|
392
|
+
- Never change the \`id\`, \`title\`, \`status\`, or \`created\` fields — \`status\` stays exactly \`idea\`; a human promotes it after reviewing your draft. (${qI} Leave the existing title as-is even if it breaks this; never expand it into a symptom-sentence.)
|
|
393
|
+
- Never rewrite or delete the existing prose body or \`### Log\` entries — the idea's history stays intact.
|
|
394
|
+
- Phases: actionable steps a future agent or human could pick up one at a time, not one giant phase.
|
|
395
|
+
|
|
396
|
+
## Every other open (non-done) plan, for scope context
|
|
397
|
+
|
|
398
|
+
${r}
|
|
399
|
+
|
|
400
|
+
Use the open entities above only to avoid duplicating in-flight scope and to match phase granularity. Edit only papercamp/ideas/${e.id??"<ID>"}.md — never create, edit, move, or rename any other file.`}function _ie(e,t){const n=e.length?e.map(s=>s.status==="done"||s.status==="dropped"?`- ${s.id??"no id"}: ${s.title} (status: ${s.status})`:`### ${s.id??"no id"}: ${s.title}
|
|
401
|
+
${s.body}`).join(`
|
|
402
|
+
|
|
403
|
+
`):"(no ideas yet)",r=t.length?t.map(s=>`- ${s.date}: ${s.title} — ${s.description}`).join(`
|
|
404
|
+
`):"(none yet)";return`You are scanning this repository for ideas worth suggesting, to append to papercamp/suggestions.md — a lightweight holding pen. Edit only that one file.
|
|
405
|
+
|
|
406
|
+
Existing ideas (do not repeat anything already covered here):
|
|
407
|
+
${n}
|
|
408
|
+
|
|
409
|
+
Existing suggestions already in the holding pen (do not repeat these either):
|
|
410
|
+
${r}
|
|
411
|
+
|
|
412
|
+
Task:
|
|
413
|
+
1. Explore this codebase for gaps, rough edges, or "you might want to do X" hunches that aren't already an idea or an existing suggestion above — things like missing error handling, an obvious follow-up to recent work, a TODO left in code, or a UX gap you notice while reading the app.
|
|
414
|
+
2. For each genuinely new one you find (0 to a handful — do not force a quota), append one line to papercamp/suggestions.md formatted exactly \`- YYYY-MM-DD: Title — one-line description\`, using today's date. ${qI} Keep the description to a single physical line (no literal line breaks).
|
|
415
|
+
3. If you find nothing worth suggesting, make no edits at all — no empty line, no placeholder.
|
|
416
|
+
|
|
417
|
+
Rules:
|
|
418
|
+
- Append only — never modify, reorder, or delete any existing line in suggestions.md.
|
|
419
|
+
- Never create papercamp/ideas/ files — a suggestion is not an idea until a human promotes it.
|
|
420
|
+
- Never touch any other file in the repo.`}const JI={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},_c={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},mn={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"}},QI={open:"Open",done:"Done",dropped:"Dropped"},ff={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"}},Sie={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},A1={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"}},Cie={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},R1={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"}},L1=({pr:e,reviewing:t})=>{const n=M(s=>{var i;return((i=s.status)==null?void 0:i.prFetchedAt)??null}),r=d.jsx(ne,{size:"small",fillColor:A1[e.state].fill,textColor:A1[e.state].text,children:d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(U8,{}),"#",e.number," ",Sie[e.state]]})});return d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"no-underline inline-flex",children:n!=null?d.jsx(ye,{content:`Fetched from GitHub ${_Y(n)}`,children:r}):r}),t&&d.jsx(tr,{size:"small",label:`Reviewing PR #${e.number}`})]})},jie=e=>{const{subjects:t,loading:n,available:r}=DI(),s=gie(),i=lt(),o=M(g=>g.planFilters.sortKey),a=M(g=>g.planFilters.sortDirection),l=M(g=>g.planFilters.groupBySubject),c=M(g=>g.setPlanSortKey),u=M(g=>g.togglePlanSortDirection),f=g=>{g===o?u():c(g)},h=zY(e,a,n||!r?void 0:t),p=l&&h.length>1;return{roadmapItemNames:s,navigate:i,sortKey:o,sortDirection:a,handleSort:f,groups:h,showSubjectHeaders:p,sortReflectsRows:!p}};function XI(){const[e,t]=b.useState("idle"),[n,r]=b.useState(null),s=b.useRef(null),i=b.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=b.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 eA=({idea:e,otherPlans:t,className:n=""})=>{const r=M(h=>h.launchPlanDraft),s=M(Kr),{state:i,errorMessage:o,run:a}=XI(),{toast:l}=Je(),c=()=>{const h=e.id;h&&a(async()=>{try{await r(h,kie(e,t))}catch(p){throw l({title:"Draft failed",description:Ge(p.message),variant:"error"}),p}})},u=i==="loading"?"Drafting…":i==="success"?"Draft sent!":i==="error"?"Draft failed":"Draft plan",f=i==="error"?o??"Draft failed":e.id?s?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return d.jsx(ye,{content:f,children:d.jsx(ee,{variant:"ghost",size:"small",onClick:c,disabled:i==="loading"||!e.id||!s,className:`${i==="error"?"text-watercolor-rose-dark":"text-ink-500"} ${n}`,children:u})})},Eie=({children:e,collapsedLines:t=3,resetKey:n})=>{const r=b.useRef(null),[s,i]=b.useState(!1),[o,a]=b.useState(!1);return b.useLayoutEffect(()=>i(!1),[n]),b.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]),d.jsxs("div",{children:[d.jsx("div",{ref:r,className:s?void 0:`line-clamp-[${t}]`,children:e}),o&&d.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"})]})},Pie=({count:e})=>{const t=lt();return d.jsxs("button",{type:"button",onClick:()=>t({to:"/git"}),className:"bg-none bg-transparent border-none p-0 font-handwritten text-xs opacity-[0.6] underline cursor-pointer",children:[e," file",e===1?"":"s"," changed"]})},Tie={pass:"success",fail:"error",running:"warning",stale:"neutral"},Xp=({label:e,status:t,title:n,anyRunning:r,onClick:s})=>d.jsx(ye,{content:n,children:d.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] ${r?"cursor-not-allowed":"cursor-pointer"} ${r&&t!=="running"?"opacity-50":"opacity-100"}`,onClick:()=>{r||s()},disabled:r,children:d.jsxs(ne,{size:"small",variant:Tie[t],children:[e,d.jsx("span",{className:t==="running"?"visible":"invisible",children:"…"})]})})}),Nie=()=>{const{qualityStatus:e,testStatus:t,consistencyStatus:n,anyRunning:r,hasDocIssues:s,consistency:i,docsExpanded:o,setDocsExpanded:a,navigate:l,runDeskCheck:c,runConsistencyCheck:u,linkedPlanFor:f}=qse();return d.jsx("div",{className:"flex flex-col items-center gap-2",children:d.jsxs("div",{className:"flex flex-wrap items-start justify-center gap-2",children:[d.jsx(Xp,{label:"Quality",status:e,title:"Code style & formatting (Biome lint + format). Click to run.",anyRunning:r,onClick:()=>c("lint")}),d.jsx(Xp,{label:"Tests",status:t,title:"Unit tests (Vitest). Click to run.",anyRunning:r,onClick:()=>c("test")}),d.jsx(Xp,{label:"Consistency",status:n,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",anyRunning:r,onClick:()=>u()}),d.jsxs("div",{children:[d.jsx(ye,{content:s?"Plan/idea doc findings — orphan subjects, title style & stale references. Click to show.":"Plan/idea docs — no findings (orphan subjects, title style, stale references).",children:d.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 ${s?"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:!s,"aria-expanded":s?o:void 0,"aria-controls":"deliver-doc-findings",onClick:()=>{s&&a(h=>!h)},children:d.jsx(ne,{size:"small",variant:s?"error":"success",children:"Docs"})})}),o&&s&&d.jsx("div",{id:"deliver-doc-findings",className:"mt-2 flex flex-col gap-2",children:i.map((h,p)=>{const m=f(h);return d.jsx("div",{className:"font-mono text-2xs opacity-70",children:m?d.jsx("button",{type:"button",onClick:()=>l($i(m)),className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-left",children:h.message}):d.jsx("span",{className:"text-left",children:h.message})},`${h.kind}-${h.title}-${p}`)})})]}),d.jsx(GJ,{})]})})},M1=({label:e,disabled:t,onClick:n})=>d.jsx(ee,{size:"small",disabled:t,onClick:n,children:e}),Iie=({state:e,filesEmpty:t})=>{const n=M(u=>u.status),{checks:r}=wc(),{qualityStatus:s,testStatus:i,consistencyStatus:o}=b.useMemo(()=>ZI(n,r),[n,r]);if(s==="fail"||i==="fail"||o==="fail"){const u=e.fixing?"Fixing…":"Fix";return d.jsx(M1,{label:u,disabled:!e.canFix||e.fixing,onClick:e.handleFix})}const l=e.committing||e.commitInFlight,c=l?"Committing…":e.stagedCount>0?`Commit ${e.stagedCount} staged`:"Commit";return d.jsx(M1,{label:c,disabled:t||!e.commitTitle.trim()||l,onClick:e.handleCommit})},Aie=()=>{const e=M(t=>t.gitAhead);return d.jsxs("div",{className:"flex flex-col items-center gap-3",children:[d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:e>0?`All changes committed — ${e} commit${e===1?"":"s"} ready to push.`:"No changed files."}),d.jsx(qJ,{})]})},Rie={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},Lie=({messages:e,undo:t,undoing:n,onUndo:r,onPromote:s,promotingIndex:i})=>d.jsx(d.Fragment,{children:e.map((o,a)=>{const l=Rie[o.kind],c=o.from==="agent",u=a===e.length-1,f=[{id:"decision",label:"Promote to decision",icon:d.jsx(LP,{size:16}),onSelect:()=>s==null?void 0:s(a,"decision")},{id:"log",label:"Promote to log",icon:d.jsx(Qx,{size:16}),onSelect:()=>s==null?void 0:s(a,"log")},{id:"idea",label:"Promote to idea",icon:d.jsx(RP,{size:16}),onSelect:()=>s==null?void 0:s(a,"idea")}];return d.jsxs("div",{className:`flex flex-col gap-1 ${c?"items-start":"items-end"}`,children:[d.jsx("div",{className:"max-w-[85%]",children:d.jsx(me,{size:"small",surface:"paper",texture:c?"kraft":l?"canvas":"parchment",shade:c,accent:!c,accentColor:l?"rose":"blue",children:d.jsx(Eie,{collapsedLines:o.kind==="chat"?1:3,resetKey:`${o.kind}-${o.date??""}-${a}`,children:o.text})})}),d.jsxs("div",{className:"flex items-center gap-2",children:[c&&d.jsx(ne,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),c&&u&&t&&d.jsx(ye,{content:"Revert this run's plan edit",children:d.jsx(ee,{size:"small",variant:"ghost",onClick:r,disabled:n,children:n?"Undoing…":"Undo"})}),o.date&&d.jsx("span",{className:"text-sm font-semibold opacity-[0.45]",children:o.date}),l&&d.jsx(ne,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:l}),s&&o.kind==="chat"&&(i===a?d.jsx(tr,{size:"small",label:"Promoting…"}):d.jsx(Yx,{align:"end",trigger:d.jsx(qe,{icon:d.jsx(UP,{size:14}),label:"Promote this message",size:"small",variant:"ghost"}),items:f}))]})]},`${o.kind}-${o.date??""}-${a}`)})}),Mie=({planId:e,phaseIndex:t,disabled:n})=>{const r=M(u=>u.launchAgent),s=M(Kr),{toast:i}=Je(),[o,a]=b.useState(!1),l=async u=>{if(u.stopPropagation(),!!e){a(!0);try{await r(e,t)}catch(f){i({title:"Failed to start agent",description:Ge(f.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 d.jsx(qe,{icon:d.jsx("span",{className:"text-xs leading-none",children:"▶"}),variant:"ghost",size:"small",label:c,onClick:l,disabled:n||o||!e||!s,className:"text-ink-500"})},$ie=({row:e,runningFill:t,updating:n,onTogglePhase:r,onToggleFix:s})=>oh(e,t)?d.jsx(tr,{size:"small"}):d.jsx(AP,{checked:e.item.done,onChange:()=>e.kind==="phase"?r(e.index):s(e.index),disabled:n}),Die=({row:e,runningFill:t})=>d.jsxs("span",{className:`inline-flex min-w-0 max-w-full items-center gap-2 ${e.item.done?"line-through opacity-[0.45]":"no-underline"}`,children:[d.jsx("span",{title:e.item.text,className:"overflow-hidden text-ellipsis whitespace-nowrap font-handwritten text-base leading-tight",children:e.item.text}),oh(e,t)&&d.jsxs("span",{className:"text-xs opacity-[0.55]",children:[Math.round(((t==null?void 0:t.fraction)??0)*100),"%"]}),e.kind==="phase"&&e.item.source==="review"&&d.jsx(ne,{size:"small",fillColor:mn.review.fill,textColor:mn.review.text,children:"review"}),e.kind==="phase"&&e.item.source==="manual"&&d.jsx(ne,{size:"small",variant:"neutral",children:"manual"}),e.kind==="fix"&&d.jsx(ne,{size:"small",variant:"warning",children:"fix"})]}),Oie=({row:e,runningFill:t,agentBusy:n,planId:r})=>{if(oh(e,t))return null;if(e.item.done){const s=e.item.run;return s?d.jsx("div",{className:"flex w-full justify-end [container-type:inline-size]",children:d.jsx(ne,{size:"small",fillColor:"var(--pui-texture-shade)",textColor:"inherit",children:d.jsxs("span",{className:"whitespace-nowrap font-mono text-3xs font-normal opacity-[0.7]",children:[d.jsxs("span",{children:[Rr(s.inputTokens+s.outputTokens)," tokens"]}),d.jsxs("span",{className:"run-meta-full",children:[" ","· ",Xf(s.durationMs),s.attempts>1&&` ×${s.attempts}`,s.model&&` · ${s.model}`]})]})})}):null}return e.kind!=="phase"?null:d.jsx("div",{className:"flex justify-end",children:d.jsx(Mie,{planId:r,phaseIndex:e.index,disabled:n})})},Ws=({id:e})=>e?d.jsx(ne,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,tA=({pct:e,color:t,height:n=6})=>d.jsx(zP,{value:e,color:t,height:n}),$1=({pr:e})=>{const{reviewDecision:t,unresolvedThreadCount:n,hasNewCommentsSincePush:r}=e;return!t&&!n?null:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[t&&d.jsx(ne,{size:"small",fillColor:R1[t].fill,textColor:R1[t].text,children:Cie[t]}),!!n&&d.jsxs(ne,{size:"small",fillColor:mn["in-progress"].fill,textColor:mn["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},D1={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},O1={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},Su=({reached:e,label:t,tooltip:n,href:r})=>{const s=d.jsx(ne,{size:"small",fillColor:e?D1.fill:O1.fill,textColor:e?D1.text:O1.text,children:t}),i=r?d.jsx("a",{href:r,target:"_blank",rel:"noreferrer",onClick:o=>o.stopPropagation(),className:"no-underline inline-flex",children:s}):s;return n?d.jsx(ye,{content:n,children:i}):i},em=()=>d.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),z1=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function zie(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const Fie=({trail:e,released:t,reviewing:n,reviewNote:r})=>{var u,f;const{taskRuns:s,commits:i,pr:o,releaseLine:a}=e,l=a.data?zie(a.data):void 0,c=t?`Released ${t}`:l?`Released ${l.hash}`:"Release";return d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(Su,{reached:s.reached,label:s.data?z1(s.data.length,"task run"):"Tasks",tooltip:(u=s.data)==null?void 0:u.map(h=>h.taskKind).join(", ")}),d.jsx(em,{}),d.jsx(Su,{reached:i.reached,label:i.data?z1(i.data.length,"commit"):"Commits",tooltip:(f=i.data)==null?void 0:f.join(`
|
|
421
|
+
`)}),d.jsx(em,{}),o.data?r&&!n?d.jsx(ye,{content:r,children:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[d.jsx(L1,{pr:o.data,reviewing:n}),d.jsx($1,{pr:o.data})]})}):d.jsxs(d.Fragment,{children:[d.jsx(L1,{pr:o.data,reviewing:n}),!n&&d.jsx($1,{pr:o.data})]}):d.jsx(Su,{reached:!1,label:"PR"}),d.jsx(em,{}),d.jsx(Su,{reached:a.reached||!!t,label:c,tooltip:a.data,href:l==null?void 0:l.url})]})},nA=({open:e,onClose:t,onAdd:n,initialContent:r})=>{const[s,i]=b.useState(""),[o,a]=b.useState(""),[l,c]=b.useState(!1),[u,f]=b.useState(!1),[h,p]=b.useState(!1),[m,g]=b.useState(null),[x,y]=b.useState(null),[v,w]=b.useState(!1),[k,_]=b.useState(null),[S,j]=b.useState(null),E=M(D=>{var O;return((O=D.plans)==null?void 0:O.entries)??[]}),{patch:T}=kc();lt();const P=$I(),N=hre(s,E.map(D=>({id:D.id,title:D.title,body:D.body,tags:D.tags,log:D.log})));b.useEffect(()=>{e&&(i(""),a(r??""),c(!1),f(!1),p(!1),g(null),w(!1),_(null),j(null))},[e,r]);const R=(D,O)=>{t(),P(D,O)},L=async()=>{const D=`${s.trim()}${o.trim()?`
|
|
422
|
+
|
|
423
|
+
${o.trim()}`:""}`;if(D){w(!0),j(null),_(null);try{const O=E.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));_(await hW(D,O))}catch(O){j(O.message)}finally{w(!1)}}},I=D=>{const O=E.find(V=>V.id===D);O&&R(O.id,O.title)},z=async(D,O,V)=>{y(D);const U={date:new Date().toISOString().slice(0,10),text:s.trim()},Q=await T(O,{log:[...V??[],U]},{errorTitle:"Extend failed"});y(null),Q&&t()},$=async D=>{if(D.preventDefault(),!(!s.trim()||h)){g(null),p(!0);try{await n({title:s.trim(),content:o.trim()||void 0,kind:l?"note":u?"board":void 0}),t()}catch(O){g(O.message)}finally{p(!1)}}};return d.jsx(Fs,{open:e,onClose:t,title:"New idea",size:"small",children:d.jsxs("form",{onSubmit:$,className:"flex flex-col gap-4",children:[d.jsx(rt,{label:"Title",value:s,onChange:D=>i(D.target.value),placeholder:"Idea title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:h,autoFocus:!0,required:!0}),N.length>0&&d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),N.map(({candidate:D})=>{const O={id:D.id??null,title:D.title,body:D.body,log:D.log},V=E.filter(C=>C.id!==D.id);return d.jsx(me,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(Ws,{id:D.id}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:D.title})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",size:"small",onClick:()=>R(D.id,D.title),children:"Open it"}),d.jsx(ee,{type:"button",variant:"ghost",size:"small",disabled:!D.id||!s.trim()||x!==null,onClick:()=>D.id&&z(D.id,D.title,D.log),children:x===D.id?"Extending…":"Extend it instead"}),d.jsx(eA,{idea:O,otherPlans:V})]})]})},D.id??D.title)})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("div",{children:d.jsx(ee,{type:"button",variant:"ghost",size:"small",disabled:!s.trim()||v,onClick:L,children:v?"Checking overlap…":"Check overlap"})}),S&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:S}),k&&d.jsx(me,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"font-semibold",children:k.verdict==="new"?"Looks genuinely new":k.verdict==="extend"?`Extends ${k.targetId??"an existing idea"}`:`Belongs inside ${k.targetId??"an existing idea"}`}),d.jsx("span",{className:"text-sm opacity-80",children:k.reasoning}),k.targetId&&d.jsx("div",{className:"flex justify-end",children:d.jsx(ee,{type:"button",variant:"ghost",size:"small",onClick:()=>I(k.targetId),children:"Open it"})})]})})]}),d.jsx(qx,{label:"Description",value:o,onChange:D=>a(D.target.value),placeholder:"Optional details…",disabled:h,rows:4}),d.jsx(Yd,{label:"Just a note (no plan needed)",checked:l,onChange:D=>{c(D.target.checked),D.target.checked&&f(!1)},disabled:h}),d.jsx(Yd,{label:"Board (decomposes into tickets instead of phases)",checked:u,onChange:D=>{f(D.target.checked),D.target.checked&&c(!1)},disabled:h}),m&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:m}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:t,disabled:h,children:"Cancel"}),d.jsx(ee,{type:"submit",variant:"primary",disabled:!s.trim()||h,children:"Add"})]})]})})},Bie=({open:e,onClose:t,onConfirm:n})=>{const r=M(m=>{var g;return((g=m.plans)==null?void 0:g.entries)??[]}),[s,i]=b.useState([]),[o,a]=b.useState(new Set),[l,c]=b.useState(!1),[u,f]=b.useState(null);b.useEffect(()=>{if(e){const m=r.filter(g=>!!g.id&&g.phases.length===0&&g.status==="idea");i(m),a(new Set(m.map(g=>g.id))),c(!1),f(null)}},[e]);const h=m=>{a(g=>{const x=new Set(g);return x.has(m)?x.delete(m):x.add(m),x})},p=async()=>{c(!0),f(null);try{await n([...o]),t()}catch(m){f(m.message)}finally{c(!1)}};return d.jsx(Fs,{open:e,onClose:t,title:"Draft all",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("p",{className:"m-0 opacity-80",children:[s.length," undrafted idea",s.length===1?"":"s"," will be turned into a plan."]}),s.length>0&&d.jsx("div",{className:"flex max-h-[16rem] flex-col gap-2 overflow-y-auto",children:s.map(m=>d.jsx(AP,{label:m.title,checked:o.has(m.id),onChange:()=>h(m.id)},m.id))}),u&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:u}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:t,disabled:l,children:"Cancel"}),d.jsx(ee,{type:"button",variant:"primary",onClick:p,disabled:l||o.size===0,children:l?"Starting…":`Draft ${o.size}`})]})]})})},Vie=({suggestion:e,onClose:t})=>{const n=M(u=>u.promoteSuggestion),r=M(u=>u.launchIdeaExtend),[s,i]=b.useState(!1),[o,a]=b.useState(null),{toast:l}=Je();b.useEffect(()=>{e&&(i(!1),a(null))},[e]);const c=async()=>{if(e){i(!0),a(null);try{const u=await n(e),f=M.getState().ideaEntries.find(h=>h.id===u);if(f)try{await r(u,bie(f))}catch(h){l({title:"Idea created, but the refine agent failed to launch",description:Ge(h.message),variant:"error"})}t()}catch(u){a(u.message)}finally{i(!1)}}};return d.jsx(Fs,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx("p",{className:"m-0 opacity-80",children:e==null?void 0:e.description}),o&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:o}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:t,disabled:s,children:"Cancel"}),d.jsx(ee,{type:"button",variant:"primary",onClick:c,disabled:s,children:s?"Moving…":"Move to ideas"})]})]})})},tm=({tokens:e})=>d.jsx(d.Fragment,{children:e.map((t,n)=>{if(t.type==="same")return d.jsx("span",{children:t.text},`${t.type}-${n}`);const r=t.type==="added";return d.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}`)})}),F1=e=>d.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),Uie=({plan:e,before:t,onApprove:n,onDiscard:r,queuePosition:s})=>{const[i,o]=b.useState(!1),[a,l]=b.useState(!1),c=e.body!==t.body,u=e.phases.map((m,g)=>({phase:m,before:t.phases[g],index:g})).filter(({phase:m,before:g})=>g!==void 0&&(m.text!==g.text||(m.description??"")!==(g.description??""))),f=i||a,h=async()=>{if(!f){o(!0);try{await r()}finally{o(!1)}}},p=async()=>{l(!0);try{await n()}finally{l(!1)}};return d.jsx(Fs,{open:!0,title:s?`Review reconcile changes (${s.index} of ${s.total})`:"Review reconcile changes",size:"large",onClose:f?()=>{}:h,children:d.jsxs("div",{className:"flex flex-col gap-5",children:[d.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&&d.jsx("p",{className:"text-sm m-0 opacity-60",children:"No wording changed."}),c&&d.jsxs("div",{children:[F1("Body"),d.jsx("p",{className:"text-base m-0 leading-normal",children:d.jsx(tm,{tokens:Mp(t.body,e.body)})})]}),u.length>0&&d.jsxs("div",{children:[F1("Phases"),d.jsx("div",{className:"flex flex-col gap-3",children:u.map(({phase:m,before:g,index:x})=>d.jsxs("div",{className:"text-sm leading-normal",children:[d.jsx(tm,{tokens:Mp(g.text,m.text)}),(m.description||g.description)&&d.jsx("div",{className:"opacity-[0.85] mt-1",children:d.jsx(tm,{tokens:Mp(g.description??"",m.description??"")})})]},x))})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{variant:"danger",size:"small",onClick:h,disabled:f,children:"Discard"}),d.jsx(ee,{variant:"primary",size:"small",onClick:p,disabled:f,children:"Approve"})]})]})})},gh=({order:e,done:t,running:n,status:r,fallback:s})=>d.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:n?d.jsx(tr,{size:"small",label:"Agent running"}):t?d.jsx("span",{"aria-label":"Done",className:"text-watercolor-green-dark text-sm",children:"✓"}):e!==void 0?s?d.jsx(ye,{content:"Queue position based on a status guess — GitHub's PR state couldn't be resolved",children:d.jsx(ne,{size:"small",variant:"warning",dot:!0,children:d.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})})}):d.jsx(ne,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:d.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})}):r==="idea"?d.jsx("span",{"aria-label":"Backlog — not planned yet",className:"inline-flex text-ink-300",children:d.jsx(WP,{size:14})}):null}),Yo="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",rA=({plans:e,activePlanTitle:t,onOpen:n})=>{const r=Yo,s=M(i=>i.agentStatus);return d.jsx("div",{className:"flex flex-col gap-1",children:e.map(i=>{var l;const o=LN(i),a=lh(i,s);return d.jsxs("div",{className:"flex items-center",children:[d.jsx(gh,{order:i.order,done:i.status==="done",status:i.status,running:!!ah(i.id,s),fallback:i.statusFallback}),d.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(i.title):void 0,onKeyDown:n?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),n(i.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${i.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:d.jsx(me,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:r,children:[d.jsx(Ws,{id:i.id}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:i.title}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45] whitespace-nowrap",children:i.updated?Wg(i.updated):Wg(i.created)}),o?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(tA,{pct:o.pct,color:JI[a]})}),d.jsxs("span",{className:"text-sm opacity-50 shrink-0",children:[o.done,"/",o.total]})]}):d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(ne,{size:"small",fillColor:mn[a].fill,textColor:mn[a].text,children:_c[a]}),i.statusFallback&&d.jsx(ye,{content:"GitHub's PR state couldn't be resolved — this status is a guess from local data",children:d.jsx(ne,{size:"small",variant:"warning",dot:!0,children:"Guess"})}),((l=i.pr)==null?void 0:l.state)==="merged"&&d.jsx(ye,{content:`Merged in #${i.pr.number}`,children:d.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:d.jsx(VP,{size:14})})})]})]})})})]},i.title)})})},Wie=({onOpen:e})=>{const t=M(m=>m.archivableIdeas),n=M(m=>m.archiveIdeas),r=M(m=>m.planFilters.search),[s,i]=b.useState(null),[o,a]=b.useState(!1),{toast:l}=Je(),c=r.trim().toLowerCase(),u=c?t.filter(m=>m.title.toLowerCase().includes(c)):t,f=b.useCallback(async m=>{try{await n(m)}catch(g){l({title:"Archive failed",description:g.message,variant:"error"})}},[n,l]),h=b.useCallback(async m=>{i(m.id);try{await f([m.id])}finally{i(null)}},[f]),p=b.useCallback(async()=>{a(!0);try{await f(u.map(m=>m.id))}finally{a(!1)}},[f,u]);return u.length===0?null:d.jsxs("div",{className:"mt-5",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[d.jsxs("h2",{className:"text-sm m-0 opacity-60",children:["Ready to archive (",u.length,")"]}),d.jsx(ee,{variant:"ghost",size:"small",disabled:o||s!==null,onClick:p,children:o?"Archiving…":"Archive all"})]}),d.jsx("div",{className:"flex flex-col gap-1",children:u.map(m=>d.jsxs("div",{className:"flex items-center",children:[d.jsx(gh,{done:!0}),d.jsx("div",{role:e?"button":void 0,tabIndex:e?0:void 0,onClick:e?()=>e(m):void 0,onKeyDown:e?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),e(m))}:void 0,className:`${e?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0`,children:d.jsx(me,{size:"small",texture:"canvas",shade:!0,className:"plan-row-card",children:d.jsxs("div",{className:Yo,children:[d.jsx(Ws,{id:m.id}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:m.title}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-30",children:"—"}),d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsx(ee,{variant:"ghost",size:"small",className:"archive-row-action",disabled:s===m.id||o,onClick:g=>{g.stopPropagation(),h(m)},onKeyDown:g=>g.stopPropagation(),children:s===m.id?"Archiving…":"Archive"})]})})})]},m.id))})]})},Kie="font-display-luminari text-sm font-semibold opacity-[0.65]",Hie=({clarifications:e})=>e.length===0?null:d.jsxs("div",{className:"mb-5",children:[d.jsx("h3",{className:`${Kie} mb-3`,children:"Clarifications"}),d.jsx("div",{className:"flex flex-col gap-2 mb-3",children:e.map((t,n)=>d.jsx("div",{className:"text-sm flex items-start justify-between gap-3 opacity-75",children:d.jsxs("span",{children:[d.jsx("span",{className:"font-semibold mr-2",children:t.date}),t.text]})},`clar-${t.date}-${n}`))})]}),Gie=({plan:e})=>{const t=M(i=>i.gitStatus),n=b.useMemo(()=>(t==null?void 0:t.map(i=>({path:i.path,staged:i.staged})))??[],[t]),r=eie(e,n),s=n.length>0;return d.jsxs("div",{className:"flex min-h-[7rem] flex-col items-center justify-center gap-3",children:[d.jsx(Nie,{}),s?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"w-full max-w-md",children:d.jsx(W8,{state:r,filesEmpty:!1})}),d.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[d.jsx(Pie,{count:n.length}),d.jsx(Iie,{state:r,filesEmpty:!1})]})]}):d.jsx(Aie,{})]})},Zie="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]",qie=({onAdd:e,disabled:t,entityId:n})=>{const[r,s]=b.useState(!1),[i,o]=b.useState(""),[a,l]=b.useState(null),[c,u]=b.useState(!1),f=`review-phases-draft:${n}`;b.useEffect(()=>{o(mc(f)??"")},[f]),b.useEffect(()=>{i&&gc(f,i)},[f,i]);const h=()=>{s(!1),o(""),l(null),Nv(f)},p=async()=>{let m;try{m=ZY(i)}catch(g){l(g instanceof Error?g.message:"Could not parse findings");return}u(!0),l(null);try{await e(m),h()}finally{u(!1)}};return d.jsxs(d.Fragment,{children:[d.jsx(ye,{content:"Add code-review findings as phases",children:d.jsx(qe,{variant:"ghost",size:"small",onClick:()=>s(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:d.jsx(MP,{size:16})})}),d.jsx(Fs,{open:r,onClose:h,title:"Add code-review findings",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("p",{className:"text-sm m-0 opacity-70",children:["Paste the JSON findings from a ",d.jsx("code",{children:"/code-review"})," run. Each finding becomes a new, unchecked phase on this plan."]}),d.jsx(qx,{value:i,onChange:m=>o(m.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:c}),a&&d.jsxs(OP,{variant:"warning",children:["Could not add phases — ",a]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:h,disabled:c,children:"Cancel"}),d.jsx(ee,{type:"button",variant:"primary",onClick:p,disabled:c||!i.trim(),children:"Add phases"})]})]})})]})},Yie=({onAdd:e,disabled:t})=>{const[n,r]=b.useState(!1),[s,i]=b.useState(""),[o,a]=b.useState(!1),[l,c]=b.useState(null),u=()=>{r(!1),i(""),c(null)},f=async()=>{if(s.trim()){a(!0),c(null);try{await e(s.trim()),u()}catch(h){c(h.message)}finally{a(!1)}}};return d.jsxs(d.Fragment,{children:[d.jsx(ye,{content:"Add a ticket to this board",children:d.jsx(qe,{variant:"ghost",size:"small",onClick:()=>r(!0),disabled:t,"aria-label":"Add a ticket to this board",icon:d.jsx(MP,{size:16})})}),d.jsx(Fs,{open:n,onClose:u,title:"Add ticket",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx(rt,{label:"Title",value:s,onChange:h=>i(h.target.value),placeholder:"Ticket title…",disabled:o,autoFocus:!0,required:!0}),l&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:l}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:u,disabled:o,children:"Cancel"}),d.jsx(ee,{type:"button",variant:"primary",onClick:f,disabled:o||!s.trim(),children:"Add"})]})]})})]})},Jie=({plan:e,disabled:t})=>{const n=M(l=>l.launchPlanAudit),r=M(Kr),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,yie(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 d.jsx(ye,{content:a,children:d.jsx(ee,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})};function sA(e){const[t,n]=b.useState(null),r=b.useCallback(async()=>{n(e?await F9(e):null)},[e]);return b.useEffect(()=>{r()},[r]),b.useEffect(()=>{let s;const i=vc(o=>{o.message==="changed"&&(s&&clearTimeout(s),s=setTimeout(r,250))});return()=>{s&&clearTimeout(s),i()}},[r]),t}const Qie=({plan:e,disabled:t})=>{const n=M(u=>u.refreshAll),[r,s]=b.useState(!1),{toast:i}=Je(),o=sA(e.id),a=NY(e,o==null?void 0:o.ciGreen),l=async()=>{if(e.id){s(!0);try{const u=await o9(e.id);u.needsAttention?i({title:"Merged — main needs manual sync",description:Ge(u.needsAttention),variant:"error"}):i({title:"Idea complete",description:`${e.id} merged — main is up to date`,variant:"success"}),await n()}catch(u){i({title:"Complete failed",description:Ge(u.message),variant:"error"})}finally{s(!1)}}},c=t||r||!e.id||!a.ready;return d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(It,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:l,disabled:c,className:`pc-row text-xs ${c?"opacity-50":""}`,children:r?"Completing…":"Complete idea"}),!a.ready&&a.missing.length>0&&d.jsxs("div",{className:"text-2xs text-ink-300 px-2",children:["Waiting on ",a.missing.join(", ")]})]})},Xie=({plan:e,disabled:t})=>{const n=M(c=>c.gitBranch),r=M(c=>c.loadGitStatus),[s,i]=b.useState(!1),{toast:o}=Je(),a=async()=>{if(e.id){i(!0);try{const{branch:c,warning:u}=await l9(e.id);o({title:"Branch ready",description:`Now on ${c}`,variant:"success"}),u&&o({title:"Stale fork",description:u,variant:"warning"}),await r()}catch(c){o({title:"Branch failed",description:Ge(c.message),variant:"error"})}finally{i(!1)}}},l=t||s||!e.id;return d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(ye,{content:e.id?`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`:void 0,children:d.jsx(It,{size:"small",icon:d.jsx("span",{className:"text-ink-500",children:"⎇"}),onClick:a,disabled:l,className:`pc-row text-xs ${l?"opacity-50":""}`,children:s?"Switching…":"Create branch"})}),d.jsxs("div",{className:"text-2xs text-ink-300 px-2",children:[d.jsx("code",{children:n??"unknown"})," — not this plan's branch"]})]})},iA=({idea:e,compact:t})=>{const n=M(h=>h.launchIdeaExtend),r=M(Kr),{state:s,errorMessage:i,run:o}=XI(),{toast:a}=Je(),l=e.id,c=()=>{l&&o(async()=>{const h=M.getState().ideaEntries.find(p=>p.id===l);if(!h)throw new Error(`Idea ${l} not found`);try{await n(l,wie(h))}catch(p){throw a({title:"Extension failed",description:Ge(p.message),variant:"error"}),p}})},u=s==="loading"?"Extending…":s==="success"?t?"Sent!":"Extension sent!":s==="error"?"Extension failed":t?"Extend":"Extend with AI",f=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 d.jsx(ye,{content:f,children:d.jsx(ee,{variant:"ghost",size:"small",onClick:c,disabled:s==="loading"||!l||!r,className:s==="error"?"text-watercolor-rose-dark":void 0,children:u})})},eoe=({plan:e,disabled:t})=>{const n=M(u=>u.launchFixReview),r=M(Kr),s=M(ZN),[i,o]=b.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 d.jsx(ye,{content:c,children:d.jsx(It,{size:"small",icon:d.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"})})},toe=()=>{const e=M(o=>o.loadIdeas),t=M(o=>o.runtimeReachable),n=M(o=>o.githubConfig),[r,s]=b.useState(!1),i=async o=>{!t&&n?await gY(n,o):await XP(o),await e(),s(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(ee,{icon:d.jsx(RP,{size:16}),size:"small",onClick:()=>s(!0),children:"New idea"}),d.jsx(nA,{open:r,onClose:()=>s(!1),onAdd:i})]})},noe=({plan:e,disabled:t})=>{const n=M(m=>m.launchPrReview),r=M(Kr),s=M(ZN),[i,o]=b.useState(!1),a=sA(e.id),l=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(m){alert(m.message)}finally{o(!1)}}},c=t||i||!e.id||!r||!s,u=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",f=!!(a!=null&&a.lastReviewedSha&&a.headSha&&a.lastReviewedSha===a.headSha),h=i?"Starting…":f?`Review again — last reviewed at ${((a==null?void 0:a.lastReviewedSha)??"").slice(0,7)}`:"Review PR",p=[a&&!a.ready&&"draft",(a==null?void 0:a.ciGreen)===!1&&"CI not green"].filter(Boolean);return d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(ye,{content:u,children:d.jsx(It,{size:"small",icon:d.jsx("span",{className:"text-watercolor-blue-dark",children:"◎"}),onClick:l,disabled:c,className:`text-xs leading-4 py-2 ${c?"opacity-50":""}`,children:h})}),p.length>0&&d.jsx("div",{className:"text-2xs text-ink-300 px-2",children:p.join(" · ")})]})},roe=({plan:e,disabled:t})=>{const n=M(l=>l.launchPlanReconcile),r=M(Kr),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,xie(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 d.jsx(ye,{content:a,children:d.jsx(ee,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},soe=({plan:e,disabled:t})=>{const n=M(c=>c.launchRunAll),r=M(Kr),[s,i]=b.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 d.jsx(ye,{content:l,children:d.jsx(It,{size:"small",icon:d.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"})})},ioe=({plan:e,onAdd:t,disabled:n})=>{const[r,s]=b.useState(!1),i=async()=>{s(!0);try{await t([vie()])}finally{s(!1)}};return d.jsx(ye,{content:"Append a style pass against docs/CODE_STYLE.md as a phase",children:d.jsx(ee,{variant:"ghost",size:"small",onClick:i,disabled:n||r||!TY(e),children:"Style pass"})})},ooe=()=>{const e=M(k=>k.launchSuggestIdeas),t=M(k=>k.launchBatchReconcile),n=M(k=>k.launchBatchDraft),r=M(k=>k.launchPrioritise),s=M(k=>k.refreshAll),i=M(k=>k.ideaEntries),o=M(k=>k.suggestions),a=M(uh),l=M(Kr),{toast:c}=Je(),[u,f]=b.useState(null),[h,p]=b.useState(!1),m=async()=>{f("suggest");try{await e(_ie(i,o))}catch(k){c({title:"Failed to launch",description:Ge(k.message),variant:"error"})}finally{f(null)}},g=async()=>{f("reconcile");try{await t()}catch(k){c({title:"Failed to launch",description:Ge(k.message),variant:"error"})}finally{f(null)}},x=async k=>{f("draft-all");try{await n(k)}finally{f(null)}},y=async()=>{f("prioritise");try{const k=await r(),_=k.moved.length-k.annotated.length;c({title:k.moved.length>0?"Queue reordered":"Already in order",description:_>0?`${_} of ${k.moved.length} ideas could not be annotated`:k.why.join(`
|
|
424
|
+
`)||void 0,variant:_>0?"warning":"success"})}catch(k){c({title:"Failed to prioritise",description:Ge(k.message),variant:"error"}),await s()}finally{f(null)}},v=u!==null||a,w=[{id:"suggest-ideas",label:u==="suggest"?"Starting…":"Suggest ideas",icon:d.jsx(BP,{size:16}),disabled:v||!l,onSelect:m},{id:"reconcile-all",label:u==="reconcile"?"Starting…":"Reconcile all",icon:d.jsx(LP,{size:16}),disabled:v||!l,onSelect:g},{id:"draft-all",label:"Draft all",icon:d.jsx(Qx,{size:16}),disabled:v||!l,onSelect:()=>p(!0)},{id:"prioritise",label:u==="prioritise"?"Prioritising…":"Prioritise queue",icon:d.jsx(O8,{size:16}),disabled:v||!l,onSelect:y}];return d.jsxs(d.Fragment,{children:[d.jsx(Yx,{align:"end",trigger:d.jsx(qe,{icon:d.jsx(UP,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:w}),d.jsx(Bie,{open:h,onClose:()=>p(!1),onConfirm:x})]})},aoe="font-display-luminari text-sm font-semibold opacity-[0.65]",loe=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{var x;const{thread:o,input:a,setInput:l,pending:c,promotingIndex:u,ideaPromptIndex:f,handleSend:h,handlePromote:p,handlePromoteToIdea:m,closeIdeaPrompt:g}=sie(e,n);return d.jsxs("div",{className:"mb-8",children:[d.jsx("h3",{className:`${aoe} mb-3`,children:"Feedback"}),d.jsxs(me,{size:"small",accent:!0,accentColor:"slate",texture:"kraft",children:[d.jsx("div",{className:"flex flex-col gap-3 mb-4",children:o.length>0||c?d.jsxs(d.Fragment,{children:[d.jsx(Lie,{messages:o,undo:r,undoing:s,onUndo:i,onPromote:p,promotingIndex:u}),c&&d.jsx("div",{className:"flex flex-col gap-1 items-end",children:d.jsx("div",{className:"max-w-[85%]",children:d.jsx(me,{size:"small",surface:"paper",texture:"parchment",accent:!0,accentColor:"blue",children:c})})}),t&&d.jsx("div",{className:"flex flex-col gap-1 items-start",children:d.jsx(me,{size:"small",surface:"paper",texture:"kraft",shade:!0,children:d.jsx(tr,{size:"small",label:"Agent thinking…"})})})]}):d.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."})}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(qx,{value:a,onChange:y=>l(y.target.value),"aria-label":"Feedback message",placeholder:"Write a message…",rows:3}),d.jsx("div",{className:"flex justify-end items-center gap-3",children:d.jsx(ee,{size:"small",onClick:h,disabled:t||!a.trim(),children:"Send"})})]})]}),d.jsx(nA,{open:f!==null,onClose:g,onAdd:m,initialContent:f!==null?(x=o[f])==null?void 0:x.text:void 0})]})},coe="font-display-luminari text-sm font-semibold opacity-[0.65]",uoe=({plan:e,otherPlans:t})=>{const n=lt(),r=t.filter(s=>s.entityKind==="fix"&&s.idea===e.id);return r.length===0?null:d.jsxs("div",{className:"mb-5",children:[d.jsx("h3",{className:`${coe} mb-3`,children:"Fixes"}),d.jsx("div",{className:"flex flex-col gap-2 mb-3",children:r.map(s=>d.jsxs("button",{type:"button",onClick:()=>n($i(s)),className:"flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left text-sm",children:[d.jsx(Ws,{id:s.id}),d.jsx("span",{className:"flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:s.title}),d.jsx(ne,{size:"small",fillColor:mn[s.status].fill,textColor:mn[s.status].text,children:_c[s.status]})]},s.title))})]})},doe=({plan:e,otherPlans:t})=>{const n=lt(),r=e.entityKind==="ticket";if(!r&&e.entityKind!=="fix"||!e.idea)return null;const s=e.idea,i=t.find(o=>o.id===s);return d.jsx("div",{className:"mb-3",children:d.jsxs("button",{type:"button",onClick:()=>n($i(i??{id:s,title:s})),className:"flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left",children:[d.jsx(ne,{size:"small",variant:r?"info":"warning",children:r?"ticket":"fix"}),d.jsxs("span",{className:"text-sm opacity-70",children:[r?"On board":"Fixes"," ",d.jsx("span",{className:"font-mono",children:s}),i&&` — ${i.title}`]})]})})},foe="font-display-luminari text-sm font-semibold opacity-[0.65]",hoe=({plan:e,auditRunning:t,agentBusy:n,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o,onAddPhases:a,ideaView:l,otherPlans:c,deliverPanel:u})=>{const f=M(g=>g.launchRunAll),h=e.fixes??[],p=h.some(g=>!g.done),m=[...e.phases.map((g,x)=>({kind:"phase",item:g,index:x})),...h.map((g,x)=>({kind:"fix",item:g,index:x}))];return d.jsx("div",{className:"mb-8",style:r?{"--phase-fill":`${r.fraction*100}%`}:void 0,children:d.jsx($5,{data:m,toolbar:{title:d.jsx("h3",{className:`${foe} m-0`,children:"Phases"}),actions:d.jsxs(d.Fragment,{children:[t&&d.jsx(tr,{size:"small",label:"Audit running…"}),m.length===0&&d.jsx(iA,{idea:l}),m.length>0&&(e.status==="review"||e.status==="done")&&d.jsx(Jie,{plan:e}),m.length>0&&e.status!=="done"&&d.jsx(roe,{plan:e}),m.length>0&&d.jsx(qie,{onAdd:a,disabled:s,entityId:e.id??e.title}),m.length>0&&d.jsx(ioe,{plan:e,onAdd:a,disabled:s}),e.id&&p&&d.jsx(ye,{content:"Run the open fixes with an agent",children:d.jsx(ee,{size:"small",onClick:()=>e.id&&f(e.id),disabled:n,children:n?"Running…":"Run fixes"})})]})},panelFooter:m.length===0?d.jsx("div",{className:"flex justify-center py-6",children:d.jsx(eA,{idea:l,otherPlans:c,className:"font-handwritten !text-base underline"})}):u,columns:[{key:"checkbox",header:"",cell:g=>d.jsx($ie,{row:g,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o}),width:1},{key:"title",header:"Title",cell:g=>d.jsx(Die,{row:g,runningFill:r})},{key:"actions",header:"",align:"end",width:6,cell:g=>d.jsx(Oie,{row:g,runningFill:r,agentBusy:n,planId:e.id})}],expandable:{render:g=>{const x=g.item.run?GK(g.item.run):null;return!g.item.description&&!x?null:d.jsxs("div",{className:"flex flex-col gap-1",children:[g.item.description&&d.jsx("span",{children:g.item.description}),x&&d.jsx("span",{className:"font-mono text-3xs opacity-[0.7]",children:x})]})}},hideHeader:!0,density:"compact",showExpandColumn:!1,rowTexture:g=>{if(g.kind==="fix")return"kraft";if(g.kind==="phase"&&g.item.done)return"canvas"},rowClassName:g=>{if(oh(g,r))return"phase-running-row";if(g.kind==="phase"&&g.item.source==="review")return"bg-[rgba(155,122,181,0.08)]"},className:"phase-table-phone"})})},poe="font-display-luminari text-sm font-semibold opacity-[0.65]",moe=({plan:e})=>e.body?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:`${poe} mb-2`,children:"Description"}),d.jsx("div",{className:"opacity-[0.85]",children:d.jsx(II,{children:e.body})})]}):null,goe=({rollup:e})=>e.runs===0?null:d.jsx("span",{className:"shrink-0",children:d.jsx(ye,{content:`${Rr(e.inputTokens)} in · ${Rr(e.outputTokens)} out · cache ${Rr(e.cacheCreationTokens)} write · ${Rr(e.cacheReadTokens)} read`,children:d.jsx(ne,{size:"small",fillColor:"var(--pui-texture-shade)",textColor:"inherit",children:d.jsxs("span",{className:"whitespace-nowrap font-mono text-3xs font-normal opacity-[0.7]",children:[Rr(e.inputTokens+e.outputTokens)," tokens ·"," ",Xf(e.durationMs)," · ",e.runs," ",e.runs===1?"run":"runs"]})})})}),yoe=({progress:e,color:t,rollup:n})=>e===null&&n.runs===0?null:d.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-min",children:[e!==null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 min-w-16",children:d.jsx(tA,{pct:e.pct,color:t})}),d.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0 font-handwritten",children:[Math.round(e.pct),"%"]})]}),d.jsx(goe,{rollup:n})]}),xoe="font-display-luminari text-sm font-semibold opacity-[0.65]",voe=({plan:e,otherPlans:t})=>{const n=lt(),r=M(a=>a.loadPlans),s=t.filter(a=>a.entityKind==="ticket"&&a.idea===e.id).sort((a,l)=>(a.order??Number.POSITIVE_INFINITY)-(l.order??Number.POSITIVE_INFINITY)),i=a=>{const l=s.find(c=>c.title===a);l&&n($i(l))},o=async a=>{e.id&&(await fW({boardId:e.id,title:a}),await r())};return d.jsxs("div",{className:"mb-8",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("h3",{className:`${xoe} m-0`,children:"Tickets"}),d.jsx(Yie,{onAdd:o,disabled:!e.id})]}),s.length>0?d.jsx(rA,{plans:s,onOpen:i}):d.jsx("p",{className:"text-sm m-0 opacity-50",children:"No tickets yet — add one to start the decomposition."})]})},woe=({planId:e,released:t,reviewing:n,reviewNote:r})=>{const s=mie(e);return e?d.jsx("div",{className:"text-xs opacity-80 shrink-0",children:s?d.jsx(Fie,{trail:s,released:t,reviewing:n,reviewNote:r}):d.jsx("div",{className:"max-w-xs","aria-hidden":"true",children:d.jsx(sn,{variant:"text",height:32})})}):null},boe=({plan:e})=>{const t=M(L=>L.plans),n=M(L=>L.loadPlans),{toast:r}=Je(),{patch:s,updating:i}=kc(),o=M(L=>L.agentStatus),a=M(uh),l=M(L=>L.detailView),c=M(L=>L.taskLog),u=M(L=>L.loadTaskLog),f=ah(e.id,o),h=!!jY(e.id,o),p=EY(e.thread),m=fie(f,c),g=b.useMemo(()=>YK(c,e.id),[c,e.id]),x=(f==null?void 0:f.taskKind)==="audit",y=CY(e,(m==null?void 0:m.fraction)??0);e.phases.length>0;const v=l==="feedback",w={id:e.id??null,title:e.title,body:e.body,log:e.log},k=((t==null?void 0:t.entries)??[]).filter(L=>L.id!==e.id);b.useEffect(()=>{u()},[u]);const _=async L=>{const I=e.phases.map(($,D)=>D===L?{...$,done:!$.done}:$);I.every($=>$.done)&&e.status==="in-progress"?await s(e.title,{phases:I,status:"review"}):await s(e.title,{phases:I})},S=async L=>{await s(e.title,{phases:[...e.phases,...L]})},j=async L=>{const I=(e.fixes??[]).map(($,D)=>D===L?{...$,done:!$.done}:$);I.every($=>$.done)&&e.status==="in-progress"?await s(e.title,{fixes:I,status:"review"}):await s(e.title,{fixes:I})},{sending:E,send:T,undo:P,undoing:N,undoEdit:R}=hie(e,{reload:n,notify:r});return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-2",children:[d.jsxs("h2",{className:`${Zie} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[d.jsx(Ws,{id:e.id}),e.title]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 font-handwritten",children:[d.jsxs("span",{className:"text-sm opacity-[0.45] whitespace-nowrap",children:[d.jsx("span",{className:"max-[480px]:hidden",children:e.updated?"updated ":"created "}),Wg(e.updated??e.created)]}),d.jsx(VI,{})]})]}),d.jsx(doe,{plan:e,otherPlans:k}),d.jsxs("div",{className:"flex items-center gap-x-4 gap-y-1 flex-wrap mb-3",children:[d.jsx(woe,{planId:e.id,released:e.released,reviewing:h,reviewNote:p}),!v&&d.jsx(yoe,{progress:y,color:JI[lh(e,o)],rollup:g})]}),v?d.jsx(loe,{plan:e,updating:E,onSend:T,undo:P,undoing:N,onUndo:R}):d.jsxs(d.Fragment,{children:[e.entityKind==="board"?d.jsx(voe,{plan:e,otherPlans:k}):d.jsx(hoe,{plan:e,auditRunning:x,agentBusy:a,runningFill:m,updating:i,onTogglePhase:_,onToggleFix:j,onAddPhases:S,ideaView:w,otherPlans:k,deliverPanel:d.jsx(Gie,{plan:e})}),d.jsx(uoe,{plan:e,otherPlans:k}),d.jsx(Hie,{clarifications:e.clarifications??[]}),d.jsx(moe,{plan:e})]})]})},koe="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",B1="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",_oe="font-handwritten text-xs font-semibold opacity-55 leading-none",V1=`${koe} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,Soe=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],oA="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",aA="overflow-hidden text-ellipsis whitespace-nowrap",Coe=()=>{const e=M(n=>n.planFilters.groupBySubject),t=M(n=>n.toggleGroupBySubject);return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:_oe,children:"Group by subject"}),d.jsx(Yd,{size:"small",checked:e,onChange:t,"aria-label":"Group by subject"})]})},joe=({rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r})=>{const s=Yo,{roadmapItemNames:i,navigate:o,sortKey:a,sortDirection:l,handleSort:c,groups:u,showSubjectHeaders:f,sortReflectsRows:h}=jie(e),p=m=>m.type==="plan"?d.jsx(rA,{plans:[m.plan],activePlanTitle:t,onOpen:n},m.plan.title):m.type==="note"?d.jsx(Eoe,{row:m,onOpen:r},m.idea.title):d.jsx(Toe,{row:m,activePlanTitle:t,onOpen:n},m.fix.title);return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{role:"columnheader",className:"flex-[0_0_36px] flex justify-center","aria-sort":h&&a==="order"?l==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:V1,"aria-label":"Sort by run order",onClick:()=>c("order"),children:["#",a==="order"&&(l==="asc"?"▲":"▼")]})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(me,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsx("div",{className:s,children:Soe.map(({key:m,label:g})=>{const x=m===a;return d.jsx("span",{role:"columnheader",className:m==="updated"?"max-lg:hidden":void 0,"aria-sort":h&&x?l==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:V1,onClick:()=>c(m),children:[g,x&&(l==="asc"?" ▲":" ▼")]})},m)})})})})]}),f?u.map(m=>{const g=m.subject;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("div",{className:"flex items-baseline gap-2",children:g&&i.has(g)?d.jsx("button",{type:"button",className:`${B1} bg-none bg-transparent border-none cursor-pointer text-left hover:underline`,title:"View in roadmap",onClick:()=>o({to:"/roadmap",search:{item:g}}),children:g}):d.jsx("div",{className:B1,children:g??"No subject"})}),m.rows.map(x=>p(x))]},g??"__no-subject__")}):e.map(m=>p(m))]})},Eoe=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return d.jsxs("div",{className:"flex items-center",children:[d.jsx(gh,{order:n.order,done:r==="done",status:r}),d.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:d.jsx(me,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:Yo,children:[n.id?d.jsx(Ws,{id:n.id}):d.jsx("span",{}),d.jsxs("span",{className:`${oA} [cursor:inherit]`,children:[d.jsx(Qx,{}),d.jsx("span",{className:aA,children:n.title})]}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsx(ne,{size:"small",fillColor:ff[r].fill,textColor:ff[r].text,children:QI[r]})]})})})]})},Poe="grid grid-cols-[76px_minmax(0,1fr)_112px] gap-2.5 items-center max-[480px]:grid-cols-1 max-[480px]:gap-1",Toe=({row:e,activePlanTitle:t,onOpen:n})=>{const r=M(o=>o.agentStatus),s=e.fix,i=lh(s,r);return d.jsxs("div",{className:"flex items-center",children:[d.jsx(gh,{order:s.order,done:s.status==="done",status:s.status,running:!!ah(s.id,r),fallback:s.statusFallback}),d.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(s.title):void 0,onKeyDown:n?o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(s.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${s.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:d.jsx(me,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:Poe,children:[d.jsx(Ws,{id:s.id}),d.jsxs("span",{className:`${oA} [cursor:inherit]`,children:[d.jsx(ne,{size:"small",variant:"warning",children:"fix"}),d.jsx("span",{className:aA,children:s.title}),s.idea&&d.jsxs("span",{className:"text-xs opacity-45 whitespace-nowrap font-mono",children:["→ ",s.idea]})]}),d.jsx(ne,{size:"small",fillColor:mn[i].fill,textColor:mn[i].text,children:_c[i]})]})})})]})},Noe=({rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r})=>{const s=b.useRef(null);return b.useEffect(()=>{var o;if(!t)return;const i=(o=s.current)==null?void 0:o.querySelector(".plan-row-highlighted");i==null||i.scrollIntoView({behavior:"smooth",block:"center"})},[t]),d.jsx("div",{ref:s,children:e.length>0?d.jsx(joe,{rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r}):d.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."})})},Ioe=({idea:e})=>d.jsxs("div",{className:"text-base leading-[1.7] text-ink-900",children:[d.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:[d.jsx(Ws,{id:e.id??void 0}),e.title,e.status&&d.jsx(ne,{size:"small",fillColor:ff[e.status].fill,textColor:ff[e.status].text,children:QI[e.status]})]}),d.jsx(II,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),d.jsx("div",{className:"mt-6",children:d.jsx(iA,{idea:e})})]}),Aoe=e=>{const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null},nm="__no-subject__",U1="pc-row-label font-handwritten text-xs font-semibold opacity-[0.45]",Roe=()=>{var O,V;const e=mh(),t=M(uh),n=M(C=>C.agentStatus),r=M(C=>C.gitBranch),{patch:s,updating:i}=kc(),{subjects:o,available:a}=DI(),l=M(C=>C.detailView),c=M(C=>C.setDetailView),u=M(C=>C.archiveIdeas),{toast:f}=Je(),[h,p]=b.useState(""),[m,g]=b.useState(!1);if(b.useEffect(()=>{p((e==null?void 0:e.order)!==void 0?String(e==null?void 0:e.order):"")},[e==null?void 0:e.order]),!e)return null;const x=lh(e,n),y=e.status==="in-progress",v=e.status==="review",w=e.status==="dropped",k=e.status==="done",_=e.phases.some(C=>!C.done),S=(e.status==="planned"||y)&&_,j=PY(e),E=e.id!==void 0&&Aoe(r)===e.id,T=e.entityKind!=="board"&&(e.status==="planned"||y||v)&&!E,P=!!(e.pr&&(e.pr.state==="open"||e.pr.state==="draft")&&e.pr.unresolvedThreadCount),N=((O=e.pr)==null?void 0:O.state)==="open"||((V=e.pr)==null?void 0:V.state)==="draft",R=a&&e.subject&&!o.includes(e.subject)?e.subject:void 0,L=C=>s(e.title,C),I=async()=>{if(e.id){g(!0);try{await u([e.id])}catch(C){f({title:"Archive failed",description:C.message,variant:"error"})}finally{g(!1)}}},z=async()=>{if(e.id){g(!0);try{if(e.entityKind!=="board"){const C=await a9(e.id);if(!C.ready){f({title:"Not ready to complete idea",description:`Waiting on ${C.missing.join(", ")}`,variant:"error"});return}}await u([e.id])}catch(C){f({title:"Archive failed",description:C.message,variant:"error"})}finally{g(!1)}}},$=y||v||e.status==="planned",D=async()=>{const C=h.trim(),U=Number(C);if(C===""||!Number.isInteger(U)||U<1){p(e.order!==void 0?String(e.order):"");return}U!==e.order&&await L({order:U})};return d.jsxs("div",{className:"flex flex-col",children:[d.jsx("div",{children:d.jsxs("div",{className:"flex flex-col",children:[d.jsx(It,{size:"small",active:l==="details",onClick:()=>c("details"),className:"pc-row text-xs",children:"Details"}),d.jsx(It,{size:"small",active:l==="feedback",onClick:()=>c("feedback"),className:"pc-row text-xs",children:"Feedback"})]})}),d.jsx("div",{className:"h-[64px] flex items-center",children:d.jsx(ne,{size:"small",fillColor:mn[x].fill,textColor:mn[x].text,children:_c[x]})}),d.jsxs("div",{children:[d.jsx("div",{className:U1,children:"Subject"}),d.jsx("div",{className:"h-[32px] flex items-center",children:d.jsx(AV,{className:"w-full",size:"small",value:e.subject??nm,onChange:C=>L({subject:C===nm?null:C}),disabled:i||!a,options:[{value:nm,label:"No subject"},...R?[{value:R,label:`${R} (orphan)`}]:[],...!a&&e.subject&&!R?[{value:e.subject,label:e.subject}]:[],...o.map(C=>({value:C,label:C}))]})})]}),$&&d.jsxs("div",{className:"flex items-center justify-between h-[64px]",children:[d.jsx("div",{className:U1,children:"Order"}),d.jsx(rt,{type:"number",size:"small","aria-label":"Run order",min:1,value:h,onChange:C=>p(C.target.value),onBlur:D,disabled:i,className:"w-20"})]}),d.jsx(me,{size:"small",texture:"kraft",children:d.jsxs("div",{className:"flex flex-col",children:[T&&d.jsx(Xie,{plan:e,disabled:t||i}),S&&d.jsx(soe,{plan:e,disabled:t||i}),P&&d.jsx(eoe,{plan:e,disabled:t||i}),N&&d.jsx(noe,{plan:e,disabled:t||i}),v&&e.pr&&d.jsx(Qie,{plan:e,disabled:t||i}),k&&d.jsx(It,{size:"small",icon:d.jsx("span",{className:"text-ink-300",children:"▣"}),onClick:I,disabled:m||!e.id,className:`pc-row text-xs ${m||!e.id?"opacity-50":""}`,children:m?"Archiving…":"Archive"}),j&&d.jsx(It,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:z,disabled:m||!e.id,className:`pc-row text-xs ${m||!e.id?"opacity-50":""}`,children:m?"Completing…":"Complete idea"}),!k&&d.jsx(It,{size:"small",icon:d.jsx("span",{className:w?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:w?"↺":"⊘"}),onClick:()=>L({status:w?null:"dropped"}),disabled:i,className:`pc-row text-xs ${i?"opacity-50":""}`,children:w?"Reopen plan":"Mark dropped"})]})})]})},Loe=["in-progress","review","planned","idea","done","dropped"],Moe=()=>{const e=M(h=>h.plans),t=mh(),n=M(h=>h.planFilters),r=M(h=>h.togglePlanStatus),s=M(h=>h.setPlanSearch),i=M(h=>h.setSubjectFilter),o=lt();if(!e||t)return null;const{statusCounts:a}=ul(e.entries,n),{statusCounts:l}=ul(e.entries),c=new Set(n.statuses),u=Loe.filter(h=>l[h]>0);return d.jsxs("div",{className:"flex flex-col",children:[d.jsx("div",{className:"h-[64px] flex items-center",children:d.jsx(rt,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:h=>s(h.target.value)})}),n.subject!==null&&d.jsxs("div",{className:"flex items-center gap-2 h-[32px]","data-testid":"subject-filter-chip",children:[d.jsxs("span",{className:"text-2xs opacity-70",children:["Subject: ",n.subject]}),d.jsx("button",{type:"button",onClick:()=>{i(null),o({to:"/",search:{}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer opacity-70 underline text-2xs",children:"Clear"})]}),d.jsx("div",{children:d.jsx("div",{className:"flex flex-col",children:u.map(h=>{const p=c.has(h);return d.jsx(It,{size:"small",active:p,onClick:()=>r(h),className:"pc-row text-xs",icon:d.jsx("span",{className:"w-[9px] h-[9px] rounded-full shrink-0",style:{background:mn[h].text}}),action:d.jsx("span",{className:"text-2xs text-ink-500",children:a[h]}),children:_c[h]},h)})})})]})},W1=({showGroupingToggle:e=!1})=>d.jsxs("div",{className:"flex items-center gap-3 mb-6 flex-wrap",children:[d.jsx("h1",{className:"text-4xl flex-1 font-display-luminari font-semibold text-ink-900 m-0 leading-[1.1]",children:"Plans"}),e&&d.jsx(Coe,{}),d.jsx(toe,{}),d.jsx(ooe,{})]}),$oe=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],Doe=()=>d.jsxs("div",{className:"flex flex-col gap-1","aria-hidden":"true",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"flex-[0_0_36px]"}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(me,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:Yo,children:[d.jsx(sn,{variant:"text",width:28}),d.jsx(sn,{variant:"text",width:44}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(sn,{variant:"text",width:56})}),d.jsx(sn,{variant:"text",width:64}),d.jsx(sn,{variant:"text",width:48})]})})})]}),$oe.map(e=>d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:d.jsx(sn,{variant:"text",width:16})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(me,{size:"small",className:"plan-row-card",children:d.jsxs("div",{className:Yo,children:[d.jsx(sn,{variant:"rect",width:44,height:18}),d.jsx(sn,{variant:"text",width:e.title}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(sn,{variant:"text",width:52})}),d.jsx(sn,{variant:"rect",width:80,height:8}),d.jsx(sn,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),Ooe=()=>{const e=M(u=>u.reconcileQueue),t=M(u=>u.removeFromReconcileQueue),n=M(u=>u.plans),{patch:r}=kc(),{toast:s}=Je(),i=b.useRef(0),o=e[0]??null,a=o?(n==null?void 0:n.entries.find(u=>u.id===o.planId))??null:null;if(b.useEffect(()=>{o&&!a&&t(o.previewId)},[o,a,t]),b.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 d.jsx(Uie,{plan:a,before:o.before,onApprove:l,onDiscard:c,queuePosition:{index:i.current+1,total:i.current+e.length}})},zoe=({suggestions:e,onOpen:t,onDismiss:n})=>e.length===0?null:d.jsxs("div",{className:"mt-5",children:[d.jsx("h2",{className:"text-sm mb-2 opacity-60",children:"Suggested from AI"}),d.jsx("div",{className:"flex flex-col gap-1",children:e.map(r=>d.jsx("div",{className:"rounded-[10px]",children:d.jsx(me,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.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:[d.jsx(WP,{}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:r.title})]}),d.jsx(qe,{icon:d.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",className:"w-[28px] h-[28px]",onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),Jv=()=>{const{plans:e,plansError:t,ideaEntries:n,suggestions:r,planFilters:s,activePlan:i,activeIdea:o,planId:a,ideaId:l,openSuggestion:c,setOpenSuggestion:u,handleOpenPlan:f,handleOpenIdea:h,handleOpenArchivable:p,handleDismissSuggestion:m}=iie();if(t)return d.jsxs("div",{children:[d.jsx(UI,{children:"Plans"}),d.jsxs(me,{size:"small",accent:!0,accentColor:"rose",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Couldn't load plans.md"}),d.jsx("p",{className:"m-0 opacity-75",children:t})]})]});if(!e)return a||l?d.jsxs("div",{children:[d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading…"}),d.jsx("p",{className:"opacity-50",children:"Loading…"})]}):d.jsxs("div",{children:[d.jsx(W1,{}),d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),d.jsx(Doe,{})]});const{rows:g}=FY(e.entries,n,s);return d.jsxs(d.Fragment,{children:[d.jsx(Ooe,{}),i?d.jsx("div",{children:d.jsx(boe,{plan:i})}):o?d.jsx("div",{children:d.jsx(Ioe,{idea:o})}):d.jsxs("div",{children:[d.jsx(W1,{showGroupingToggle:e.entries.length>0}),e.warnings.length>0&&d.jsxs(me,{size:"small",accent:!0,accentColor:"amber",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Some entries couldn't be parsed"}),d.jsx("ul",{className:"m-0 pl-5",children:e.warnings.map(x=>d.jsxs("li",{children:[x.title,": ",x.message]},x.title))})]}),e.entries.length===0?d.jsxs("p",{className:"opacity-50",children:["No ideas yet — capture one with ",d.jsx("strong",{children:"New idea"})," above, or click"," ",d.jsx("strong",{children:"Suggest ideas"})," to have an agent propose some."]}):d.jsx(Noe,{rows:g,activePlanTitle:null,onOpenPlan:f,onOpenIdea:h}),d.jsx(Wie,{onOpen:p}),d.jsx(zoe,{suggestions:r,onOpen:u,onDismiss:m}),d.jsx(Vie,{suggestion:c,onClose:()=>u(null)})]})]})},uy="/projects",Foe=[uy],dy=[{id:"plans",label:"Plans",path:"/"},{id:"roadmap",label:"Roadmap",path:"/roadmap"},{id:"docs",label:"Docs",path:"/docs"},{id:"issues",label:"Issues",path:"/issues"},{id:"stats",label:"Stats",path:"/stats"},{id:"settings",label:"Settings",path:"/settings"}],K1=({item:e})=>d.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.label}),H1=()=>d.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:d.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})}),Boe=224,Voe=480,Uoe=495,Woe=Boe+Uoe+Voe,Koe=`(min-width: ${Woe}px)`;function Hoe(e,t,n={githubConfigured:!1}){return e===void 0||e==="client"||e==="corpus"&&n.githubConfigured?"ready":t.checking?"checking":t.reachable?"ready":"unreachable"}function Goe(e){const[t,n]=b.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return b.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}function Zoe(e){return e.filter(t=>t.kind!=="question")}function qoe(e,t){return t?e.filter(n=>!t.has(n.id)):[]}function Yoe(){const e=M(r=>r.notifications),t=M(r=>r.loadNotifications),n=b.useRef(null);b.useEffect(()=>{typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},[]),b.useEffect(()=>{if(!e)return;const r=Zoe(e),s=qoe(r,n.current);if(n.current=new Set(r.map(i=>i.id)),s.length!==0&&!(typeof Notification>"u"||Notification.permission!=="granted")&&!document.hasFocus())for(const i of s)new Notification(i.entityTitle,{body:i.text})},[e]),b.useEffect(()=>{let r;const s=vc(i=>{i.message==="changed"&&(r&&clearTimeout(r),r=setTimeout(t,250))});return()=>{r&&clearTimeout(r),s()}},[t])}const lA="stack-open";function Joe(){try{return localStorage.getItem(lA)==="true"}catch{return!1}}function Qoe(e){try{localStorage.setItem(lA,String(e))}catch{}}function Xoe(){var z;const e=lt(),t=Nw({select:$=>$.location.pathname}),n=M($=>$.loadPlans),r=M($=>$.loadIdeas),s=M($=>$.loadSuggestions),i=M($=>$.loadCapabilities),o=M($=>$.loadAgentAuthStatus),a=M($=>$.loadParkedQuestions),l=M($=>$.loadNotifications),c=M($=>$.setActiveDocTitle),u=M($=>$.checkRuntimeReachable),f=M($=>$.runtimeReachable),h=M($=>$.runtimeChecking),p=M($=>$.githubConfig),m=Nw({select:$=>{var D;return(D=$.matches.at(-1))==null?void 0:D.staticData.layer}}),g=Hoe(m,{reachable:f,checking:h},{githubConfigured:p!==null}),x=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),y=t==="/docs"||t.startsWith("/docs/"),v=t==="/settings"||t.startsWith("/settings/"),w=t==="/roadmap",k=t==="/git",_=x?"plans":y?"docs":v?"settings":(z=dy.find($=>$.path===t))==null?void 0:z.id,S=x||y||v||w||k,j=x?"plans":y?"docs":v?"settings":w?"roadmap":"git",[E,T]=b.useState(Joe),[P,N]=b.useState(!1),R=Goe(Koe),L=b.useRef(!1);Yoe(),b.useEffect(()=>{s(),i(),o(),a(),l(),u()},[s,i,o,a,l,u]),b.useEffect(()=>{h||(n(),r())},[h,n,r]),b.useEffect(()=>{L.current||t!=="/"||(L.current=!0,Promise.all([Jd(),ZP()]).then(([$,D])=>{if(!($!=null&&$.setupDismissed)&&D!==null&&!D.every(O=>O.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([QP(),eT()]).then(([O,V])=>{O.entries.length>1||V.entries.length>0||(c("USAGE.md"),e({to:"/docs"}))})}))},[t,e,c]),b.useEffect(()=>{N(!1)},[t]);const I=()=>{const $=!E;Qoe($),T($)};return{navigate:e,pathname:t,activeLayer:m,readiness:g,activeId:_,hasSidebar:S,sidebarAreaKey:j,isPlansArea:x,isDocsArea:y,isSettingsArea:v,isRoadmapArea:w,isGitArea:k,isInHub:Foe.includes(t),stackOpen:E,toggleStack:I,isLarge:R,mobileSidebarOpen:P,openMobileSidebar:()=>N(!0),closeMobileSidebar:()=>N(!1)}}const eae=b.lazy(()=>On(()=>import("./index-sqaNs4DX.js"),__vite__mapDeps([0,1])).then(e=>({default:e.DocsSidebar}))),tae=b.lazy(()=>On(()=>import("./index-HixYRYWW.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SettingsSidebar}))),nae=b.lazy(()=>On(()=>import("./index-X5ikcKAy.js"),[]).then(e=>({default:e.RoadmapSidebar}))),rae=b.lazy(()=>On(()=>import("./index-CqDZ80wA.js"),[]).then(e=>({default:e.GitFileList}))),sae=()=>{const{navigate:e,activeLayer:t,readiness:n,activeId:r,hasSidebar:s,sidebarAreaKey:i,isPlansArea:o,isDocsArea:a,isSettingsArea:l,isRoadmapArea:c,isGitArea:u,isInHub:f,stackOpen:h,toggleStack:p,isLarge:m,mobileSidebarOpen:g,openMobileSidebar:x,closeMobileSidebar:y}=Xoe();return f?d.jsx(hk,{position:"bottom-left",children:d.jsx(cse,{children:d.jsx(eg,{})})}):d.jsxs(hk,{position:"bottom-left",children:[d.jsxs("div",{className:"h-screen box-border flex flex-col",children:[d.jsxs("div",{className:"shrink-0 min-[1199px]:pr-[var(--pc-stack-width)]",children:[d.jsx(Zre,{}),d.jsxs("header",{className:"pc-app-header flex items-center gap-3 h-[var(--pc-header-h)] max-[480px]:hidden",style:Hx({texture:"parchment",shade:!0}),children:[s&&d.jsx(qe,{variant:"ghost",size:"small",className:"lg:hidden",label:"Open sidebar",onClick:x,icon:d.jsx(H1,{})}),d.jsx(Kre,{}),d.jsx("nav",{"aria-label":"Main navigation",className:"flex items-center gap-1 ml-auto",children:dy.map(v=>d.jsx(ee,{variant:"ghost",size:"small",isActive:v.id===r,onClick:()=>e({to:v.path}),"aria-current":v.id===r?"page":void 0,children:d.jsx(K1,{item:v})},v.id))})]}),d.jsx(ase,{})]}),d.jsx(IP,{style:{flex:"1 1 0%",minHeight:0,height:"auto"},background:{texture:"paper"},showHeader:!1,showSidebar:!1,showPage:!1,bleedBottom:!0,children:d.jsx("div",{className:"flex flex-col h-full min-h-0",children:d.jsx("div",{className:"flex flex-1 min-h-0 justify-center items-start box-border overflow-y-auto [scrollbar-gutter:stable] -mt-8 -ml-8 -mr-8 pt-0 pl-8 pr-8 pb-[var(--pc-content-pad-bottom)]",children:d.jsxs("div",{className:"flex min-w-0 justify-center lg:[--pc-sidebar-h:calc(100vh-160px)] gap-6 w-full min-h-full",children:[s&&d.jsxs(qre,{routeKey:i,mobileOpen:g,onMobileClose:y,children:[o&&d.jsxs(d.Fragment,{children:[d.jsx(Moe,{}),d.jsx(Roe,{})]}),a&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(eae,{})}),l&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(tae,{})}),c&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(nae,{})}),u&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(rae,{})})]}),d.jsx("div",{className:"relative flex flex-col min-w-0 flex-[1_1_0%]",children:d.jsx("div",{className:"flex flex-col flex-1 min-w-0",children:d.jsx(Zx,{texture:{texture:"paper",shade:!0},rounded:"none",className:"pc-page w-full max-w-none",children:n==="unreachable"?d.jsx(Gre,{layer:t}):n==="checking"?null:d.jsxs(b.Suspense,{fallback:null,children:[d.jsx(lse,{}),d.jsx(eg,{})]})})})})]})})})})]}),d.jsx(Wre,{open:h,pinned:m,onToggle:p}),d.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:[s&&d.jsx(qe,{variant:"ghost",size:"small",label:"Open sidebar",onClick:x,icon:d.jsx(H1,{}),className:"min-h-11"}),dy.map(v=>d.jsx(ee,{variant:"ghost",size:"small",isActive:v.id===r,onClick:()=>e({to:v.path}),"aria-current":v.id===r?"page":void 0,className:"min-h-11",children:d.jsx(K1,{item:v})},v.id))]})]})},cA=b.lazy(()=>On(()=>import("./index-sqaNs4DX.js"),__vite__mapDeps([0,1])).then(e=>({default:e.DocsPage}))),uA=b.lazy(()=>On(()=>import("./index-HixYRYWW.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SettingsPage}))),iae=b.lazy(()=>On(()=>import("./index-DAhfAB9y.js"),[]).then(e=>({default:e.TasksPage}))),oae=b.lazy(()=>On(()=>import("./index-X5ikcKAy.js"),[]).then(e=>({default:e.RoadmapPage}))),aae=b.lazy(()=>On(()=>import("./index-DYGnWiFG.js"),[]).then(e=>({default:e.StatsPage}))),lae=b.lazy(()=>On(()=>import("./index-CqDZ80wA.js"),[]).then(e=>({default:e.GitPage}))),cae=b.lazy(()=>On(()=>import("./index-DuhmLhzz.js"),[]).then(e=>({default:e.InboxPage}))),uae=b.lazy(()=>On(()=>import("./index-VoRTCwB6.js"),[]).then(e=>({default:e.IssuesPage}))),Et=EM({component:sae}),dae=Ot({getParentRoute:()=>Et,path:"/projects",component:Zse,staticData:{layer:"client"}}),fae=Ot({getParentRoute:()=>Et,path:"/",component:Jv,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0}),staticData:{layer:"corpus"}}),hae=Ot({getParentRoute:()=>Et,path:"/plans/$planId",beforeLoad:({params:e})=>{throw dj({to:"/ideas/$ideaId",params:{ideaId:df(e.planId)??e.planId}})}}),pae=Ot({getParentRoute:()=>Et,path:"/ideas/$ideaId",component:Jv,staticData:{layer:"corpus"}}),mae=Ot({getParentRoute:()=>Et,path:"/ideas/$ideaId/tickets/$ticketId",component:Jv,staticData:{layer:"corpus"}}),gae=Ot({getParentRoute:()=>Et,path:"/docs",component:cA,staticData:{layer:"runtime"}}),yae=Ot({getParentRoute:()=>Et,path:"/docs/$section",component:cA,staticData:{layer:"runtime"}}),xae=Ot({getParentRoute:()=>Et,path:"/settings",component:uA,staticData:{layer:"runtime"}}),vae=Ot({getParentRoute:()=>Et,path:"/settings/$section",component:uA,staticData:{layer:"runtime"}}),wae=Ot({getParentRoute:()=>Et,path:"/roadmap",component:oae,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0}),staticData:{layer:"runtime"}}),bae=Ot({getParentRoute:()=>Et,path:"/inbox",component:cae,staticData:{layer:"runtime"}}),kae=Ot({getParentRoute:()=>Et,path:"/stats",component:aae,staticData:{layer:"runtime"}}),_ae=Ot({getParentRoute:()=>Et,path:"/git",component:lae,staticData:{layer:"runtime"}}),Sae=Ot({getParentRoute:()=>Et,path:"/tasks",component:iae,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0}),staticData:{layer:"runtime"}}),Cae=Ot({getParentRoute:()=>Et,path:"/issues",component:uae,staticData:{layer:"runtime"}}),jae=Et.addChildren([fae,dae,hae,pae,mae,gae,yae,xae,vae,Sae,Cae,wae,kae,bae,_ae]),Eae=OM({routeTree:jae,basepath:Li||"/"}),{runtimeUrl:hf,pairingToken:fy}=GN;q8(hf||Li);Y8(fy);const Pae=15e3;async function Tae(){!hf||!fy||await fetch(W("/api/pair"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:fy}),signal:AbortSignal.timeout(Pae)}).catch(()=>{})}const dA=document.getElementById("root");if(!dA)throw new Error("#root element not found");async function Nae(){return use(Li,hf,tT()!==null)?!0:dse(hf,e=>J(W(e)))}Tae().then(Nae).catch(()=>!1).then(e=>{!e&&!window.location.pathname.startsWith(uy)&&window.history.replaceState(null,"",`${Li}${uy}`),ij(dA).render(d.jsx(b.StrictMode,{children:d.jsx(BM,{router:Eae})}))});export{ye as $,Dae as A,qe as B,Je as C,Oae as D,Go as E,Yd as F,tr as G,MP as H,Pre as I,ee as J,Ao as K,Qae as L,II as M,hx as N,Kae as O,UI as P,$I as Q,me as R,qae as S,Gae as T,Yae as U,Jae as V,Fs as W,Hae as X,Xae as Y,Ge as Z,L1 as _,lt as a,_c as a0,mn as a1,gie as a2,H8 as a3,rd as a4,Gv as a5,Xf as a6,zP as a7,Rr as a8,wc as a9,ZI as aa,Jse as ab,e9 as ac,Fae as ad,vc as ae,Mae as af,$ae as ag,AP as ah,W8 as ai,qJ as aj,GJ as ak,Ws as al,hie as am,mc as an,gc as ao,Lie as ap,qx as aq,Nv as ar,SW as as,Wae as at,ure as b,W as c,Zie as d,OP as e,Zae as f,ne as g,ire as h,rt as i,d as j,Jd as k,dre as l,Uae as m,zae as n,Bae as o,It as p,Vae as q,b as r,b9 as s,Lae as t,M as u,DI as v,Bl as w,AV as x,oc as y,G8 as z};
|
|
425
|
+
//# sourceMappingURL=main-Ceiva0Al.js.map
|