@quixomatic/rpf 0.3.2 → 0.3.3
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/CHANGELOG.md +190 -0
- package/README.md +4 -2
- package/assets/dev-host/kit-manifest.json +1 -1
- package/assets/forge-app/app/assets/{_forge-shiki-langs-nxHsAEiY.js → _forge-shiki-langs-Bm9NaYXm.js} +1 -1
- package/assets/forge-app/app/assets/{appendItems-CLsiMCGq.js → appendItems-DrlkyU0a.js} +1 -1
- package/assets/forge-app/app/assets/{core-DEkUYqk0.js → core-8OhGxroQ.js} +1 -1
- package/assets/forge-app/app/assets/{diff-view-ctlXj2p5.js → diff-view-rgZLuZMg.js} +4 -4
- package/assets/forge-app/app/assets/file-panel-CpPZ9DXB.js +1199 -0
- package/assets/forge-app/app/assets/{highlights-CEbVTJAm.js → highlights-C-SEG213.js} +1 -1
- package/assets/forge-app/app/assets/index-DWGc27yI.css +1 -0
- package/assets/forge-app/app/assets/index-DXDXX5UZ.js +298 -0
- package/assets/forge-app/app/assets/{loader-V5V4Ad0d.js → loader-Du5I86pW.js} +1 -1
- package/assets/forge-app/app/assets/{shiki-B5GY8Ub_.js → shiki-Bf12fWbJ.js} +2 -2
- package/assets/forge-app/app/assets/{stream-tokenizer-CZZoarTM.js → stream-tokenizer-DdzFthqp.js} +1 -1
- package/assets/forge-app/app/assets/{terminal-view-BR9EXBM5.js → terminal-view-Co0jXSWF.js} +1 -1
- package/assets/forge-app/app/assets/{themes-BMbfM7BC.js → themes-BrkVmSlQ.js} +2 -2
- package/assets/forge-app/app/assets/{useNextRenderData-ICppXFTX.js → useNextRenderData-BKv-kpPs.js} +3 -3
- package/assets/forge-app/app/index.html +2 -2
- package/assets/forge-app/server.mjs +2445 -8770
- package/dist/cli.mjs +11908 -6997
- package/examples/component-workspace/README.md +23 -0
- package/examples/component-workspace/components/@example/greeting/component.json +8 -0
- package/examples/component-workspace/components/@example/greeting/main.tsx +22 -0
- package/examples/component-workspace/components/@example/greeting/options.schema.json +6 -0
- package/examples/component-workspace/forge.workspace.json +7 -0
- package/examples/component-workspace/stage.json +11 -0
- package/examples/header-slot-widget/README.md +30 -0
- package/examples/header-slot-widget/components/@example/page-actions/component.json +8 -0
- package/examples/header-slot-widget/components/@example/page-actions/main.tsx +37 -0
- package/examples/header-slot-widget/components/@example/page-actions/options.schema.json +9 -0
- package/examples/index.json +159 -0
- package/examples/layout-regions/README.md +41 -0
- package/examples/layout-regions/components/@example/workspace-shell/component.json +21 -0
- package/examples/layout-regions/components/@example/workspace-shell/main.tsx +61 -0
- package/examples/layout-regions/components/@example/workspace-shell/options.schema.json +29 -0
- package/examples/layout-regions/components/@example/workspace-shell/styles.css +95 -0
- package/examples/portal-list-page/README.md +22 -0
- package/examples/portal-list-page/portal.mjs +40 -0
- package/examples/portal-record-page/README.md +23 -0
- package/examples/portal-record-page/portal.mjs +62 -0
- package/examples/primitive-and-utility/README.md +19 -0
- package/examples/primitive-and-utility/components/@example/number-format/component.json +6 -0
- package/examples/primitive-and-utility/components/@example/number-format/main.tsx +30 -0
- package/examples/primitive-and-utility/components/@example/stat-tile/component.json +6 -0
- package/examples/primitive-and-utility/components/@example/stat-tile/main.tsx +45 -0
- package/examples/primitive-and-utility/components/@example/work-summary/component.json +9 -0
- package/examples/primitive-and-utility/components/@example/work-summary/main.tsx +31 -0
- package/examples/primitive-and-utility/components/@example/work-summary/options.schema.json +6 -0
- package/examples/primitive-and-utility/components/@example/work-summary/server.js +27 -0
- package/examples/side-panel/README.md +18 -0
- package/examples/side-panel/components/@example/help-button/component.json +8 -0
- package/examples/side-panel/components/@example/help-button/main.tsx +26 -0
- package/examples/side-panel/components/@example/help-button/options.schema.json +7 -0
- package/examples/side-panel/portal.mjs +46 -0
- package/examples/theme/README.md +16 -0
- package/examples/theme/themes/teal-harbor/theme.css +11 -0
- package/examples/theme/themes/teal-harbor/theme.json +8 -0
- package/examples/theme/themes/teal-harbor/tokens.json +72 -0
- package/examples/widget-options/README.md +25 -0
- package/examples/widget-options/components/@example/notice-banner/component.json +14 -0
- package/examples/widget-options/components/@example/notice-banner/main.tsx +60 -0
- package/examples/widget-options/components/@example/notice-banner/options.schema.json +24 -0
- package/examples/widget-server-user/README.md +21 -0
- package/examples/widget-server-user/components/@example/user-card/component.json +9 -0
- package/examples/widget-server-user/components/@example/user-card/main.tsx +51 -0
- package/examples/widget-server-user/components/@example/user-card/options.schema.json +6 -0
- package/examples/widget-server-user/components/@example/user-card/server.js +27 -0
- package/package.json +7 -3
- package/skills/react-portal/SKILL.md +23 -1
- package/skills/react-portal/references/cli.md +11 -0
- package/skills/react-portal/references/components.md +40 -2
- package/assets/forge-app/app/assets/file-panel-BnUdO2N6.js +0 -1199
- package/assets/forge-app/app/assets/index-DYFQser1.js +0 -291
- package/assets/forge-app/app/assets/index-Ddi87x2p.css +0 -1
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-8OhGxroQ.js","assets/lib-BOh9Tw1y.js","assets/highlights-C-SEG213.js","assets/appendItems-DrlkyU0a.js","assets/stream-tokenizer-DdzFthqp.js","assets/formatCSSVariablePrefix-KRh9vnZf.js","assets/shiki-Bf12fWbJ.js","assets/utils-C9Glzetk.js","assets/diff-view-rgZLuZMg.js","assets/useNextRenderData-BKv-kpPs.js","assets/terminal-view-Co0jXSWF.js","assets/terminal-view-BrP-ENHg.css","assets/file-panel-CpPZ9DXB.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r=Object.setPrototypeOf({},null);for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n&1||t(r,Symbol.toStringTag,{value:`Module`}),n&2?r:Object.preventExtensions(r)},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(let c of r(i))!a.call(e,c)&&c!==o&&(s=n(i,c),t(e,c,{get:s&&s.get&&!s.configurable?s.get:()=>i[c],enumerable:!s||s.enumerable}));return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=(0,e._result)();t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n,t.status===void 0&&(t.status=`fulfilled`,t.value=n))},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n,t.status===void 0&&(t.status=`rejected`,t.reason=n))}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=B,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;for(e.push(t);0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{e:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{t:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break t}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break e}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=0x3fffffff;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),B=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),V=Symbol.for(`react.legacy_hidden`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.for(`react.view_transition`),re=Symbol.for(`react.recoverable`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case ee:return`Activity`;case ne:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case z:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case B:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var H=Array.isArray,ce=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),ye=pe(null);function be(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gp(t),e=_p(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function xe(){me(ge),me(_e),me(ve)}function Se(e){var t=e.memoizedState;t!==null&&(ph._currentValue=t.memoizedState,he(ye,e)),t=ge.current;var n=_p(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function Ce(e){_e.current===e&&(me(ge),me(_e)),ye.current===e&&(me(ye),ph._currentValue=ue)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+we+e+Te}var De=!1;function Oe(e,t){if(!e||De)return``;De=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ee(n):``}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee(`Lazy`);case 13:return e.child!==t&&t!==null?Ee(`Suspense Fallback`):Ee(`Suspense`);case 19:return Ee(`SuspenseList`);case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return Ee(`Activity`);case 30:return Ee(`ViewTransition`);default:return``}}function Ae(e){try{var t=``,n=null;do t+=ke(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var je=Object.prototype.hasOwnProperty,Me=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,Pe=t.unstable_shouldYield,Fe=t.unstable_requestPaint,Ie=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Re=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,Be=t.unstable_NormalPriority,Ve=t.unstable_LowPriority,He=t.unstable_IdlePriority,Ue=t.log,We=t.unstable_setDisableYieldValue,Ge=null,Ke=null;function qe(e){if(typeof Ue==`function`&&We(e),Ke&&typeof Ke.setStrictMode==`function`)try{Ke.setStrictMode(Ge,e)}catch{}}var Je=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 0x8000000:return 0x8000000;case 268435456:return 268435456;case 536870912:return 536870912;case 0x40000000:return 0;default:return e}}function nt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&0x7ffffff;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function U(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Je(n),i=1<<r;t|=e[r],n&=~i}return t}function it(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function W(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function at(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ot(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function st(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ct(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ct(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|0x40000000|n&261930}function lt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ut(e,t){var n=t&-t;return n=n&42?1:dt(n),(n&(e.suspendedLanes|t))===0?n:0}function dt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=0x8000000;break;default:e=0}return e}function ft(e){return e&=-e,2<e?8<e?e&0x7ffffff?32:268435456:8:2}function pt(){var e=le.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function mt(e,t){var n=le.p;try{return le.p=e,t()}finally{le.p=n}}var ht=Math.random().toString(36).slice(2),gt=`__reactFiber$`+ht,_t=`__reactProps$`+ht,vt=`__reactContainer$`+ht,yt=`__reactEvents$`+ht,bt=`__reactListeners$`+ht,xt=`__reactHandles$`+ht,St=`__reactResources$`+ht,Ct=`__reactMarker$`+ht,wt=`__reactLoad$`+ht;function Tt(e){delete e[gt],delete e[_t],delete e[bt],delete e[xt]}function Et(e){var t;if(t=e[gt])return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[gt])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[gt]||e[vt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[St];return t||=e[St]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[Ct]=!0}function jt(e){e[wt]=void 0}var Mt=new Set,Nt={};function Pt(e,t){Ft(e,t),Ft(e+`Capture`,t)}function Ft(e,t){for(Nt[e]=t,e=0;e<t.length;e++)Mt.add(t[e])}var It=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Lt={},Rt={};function zt(e){return je.call(Rt,e)?!0:je.call(Lt,e)?!1:It.test(e)?Rt[e]=!0:(Lt[e]=!0,!1)}var Bt=!1;function Vt(){var e=Bt;return Bt=!1,e}function Ht(e,t,n){if(zt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Ut(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Wt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Gt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:case`object`:return e;default:return``}}function Kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function qt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jt(e){if(!e._valueTracker){var t=Kt(e)?`checked`:`value`;e._valueTracker=qt(e,t,``+e[t])}}function Yt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Kt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Xt=/[\n"\\]/g;function Zt(e){return e.replace(Xt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Qt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Gt(t)):e.value!==``+Gt(t)&&(e.value=``+Gt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):en(e,Gt(n)):o===`number`&&e.value==t?en(e,Gt(e.value)):en(e,Gt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Gt(s):e.removeAttribute(`name`)}function $t(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Jt(e);return}n=n==null?``:``+Gt(n),t=t==null?n:``+Gt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Jt(e)}function en(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function tn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Gt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function nn(e,t,n){t!=null&&(t=``+Gt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Gt(n)}function rn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(H(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Gt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Jt(e)}function an(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var on=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function sn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||on.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function cn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Bt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(sn(e,a,r),Bt=!0)}else for(var o in t)t.hasOwnProperty(o)&&sn(e,o,t[o])}function ln(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var un=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),dn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function fn(e){return dn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function pn(){}var mn=null;function hn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gn=null,_n=null;function vn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[_t]||null;switch(e=t.stateNode,t.type){case`input`:if(Qt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[_t]||null;if(!a)throw Error(i(90));Qt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Yt(r)}break;case`textarea`:nn(e,n.value,n.defaultValue);break;case`select`:t=n.value,t!=null&&tn(e,!!n.multiple,t,!1)}}}var yn=!1;function bn(e,t,n){if(yn)return e(t,n);yn=!0;try{return e(t)}finally{if(yn=!1,(gn!==null||_n!==null)&&(Hd(),gn&&(t=gn,e=_n,_n=gn=null,vn(t),e)))for(t=0;t<e.length;t++)vn(e[t])}}function xn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[_t]||null;if(r===null)return null;switch(n=r[t],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;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Sn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Cn=!1;if(Sn)try{var wn={};Object.defineProperty(wn,"passive",{get:function(){Cn=!0}}),window.addEventListener(`test`,wn,wn),window.removeEventListener(`test`,wn,wn)}catch{Cn=!1}var Tn=null,En=null,Dn=null;function On(){if(Dn)return Dn;var e,t=En,n=t.length,r,i=`value`in Tn?Tn.value:Tn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Dn=i.slice(e,1<r?1-r:void 0)}function kn(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 An(){return!0}function jn(){return!1}function Mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?An:jn,this.isPropagationStopped=jn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=An)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=An)},persist:function(){},isPersistent:An}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=Mn(Nn),Fn=D({},Nn,{view:0,detail:0}),In=Mn(Fn),Ln,Rn,zn,Bn=D({},Fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,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!==zn&&(zn&&e.type===`mousemove`?(Ln=e.screenX-zn.screenX,Rn=e.screenY-zn.screenY):Rn=Ln=0,zn=e),Ln)},movementY:function(e){return`movementY`in e?e.movementY:Rn}}),Vn=Mn(Bn),Hn=Mn(D({},Bn,{dataTransfer:0})),Un=Mn(D({},Fn,{relatedTarget:0})),Wn=Mn(D({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0})),Gn=Mn(D({},Nn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Kn=Mn(D({},Nn,{data:0})),qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Jn={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`},Yn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yn[e])?!!t[e]:!1}function Zn(){return Xn}var Qn=Mn(D({},Fn,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=kn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?kn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?kn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),$n=Mn(D({},Bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Mn(D({},Nn,{submitter:0})),tr=Mn(D({},Fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),nr=Mn(D({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0})),rr=Mn(D({},Bn,{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})),ir=Mn(D({},Nn,{newState:0,oldState:0,source:0})),ar=[9,13,27,32],or=Sn&&`CompositionEvent`in window,sr=null;Sn&&`documentMode`in document&&(sr=document.documentMode);var cr=Sn&&`TextEvent`in window&&!sr,lr=Sn&&(!or||sr&&8<sr&&11>=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return ar.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!or&&fr(e,t)?(e=On(),Dn=En=Tn=null,mr=!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 lr&&t.locale!==`ko`?null:t.data;default:return null}}var _r={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 vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!_r[e.type]:t===`textarea`}function yr(e,t,n,r){gn?_n?_n.push(r):_n=[r]:gn=r,t=$f(t,`onChange`),0<t.length&&(n=new Pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var br=null,xr=null;function Sr(e){Gf(e,0)}function Cr(e){if(Yt(Ot(e)))return e}function wr(e,t){if(e===`change`)return t}var Tr=!1;if(Sn){var Er;if(Sn){var Dr=`oninput`in document;if(!Dr){var Or=document.createElement(`div`);Or.setAttribute(`oninput`,`return;`),Dr=typeof Or.oninput==`function`}Er=Dr}else Er=!1;Tr=Er&&(!document.documentMode||9<document.documentMode)}function kr(){br&&(br.detachEvent(`onpropertychange`,Ar),xr=br=null)}function Ar(e){if(e.propertyName===`value`&&Cr(xr)){var t=[];yr(t,xr,e,hn(e)),bn(Sr,t)}}function jr(e,t,n){e===`focusin`?(kr(),br=t,xr=n,br.attachEvent(`onpropertychange`,Ar)):e===`focusout`&&kr()}function Mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Cr(xr)}function Nr(e,t){if(e===`click`)return Cr(t)}function Pr(e,t){if(e===`input`||e===`change`)return Cr(t)}function Fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ir=typeof Object.is==`function`?Object.is:Fr;function Lr(e,t){if(Ir(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!je.call(t,i)||!Ir(e[i],t[i]))return!1}return!0}function Rr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Br(e,t){var n=zr(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=zr(n)}}function Vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rr(e.document)}return t}function Ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Wr=Sn&&`documentMode`in document&&11>=document.documentMode,Gr=null,Kr=null,qr=null,Jr=!1;function Yr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jr||Gr==null||Gr!==Rr(r)||(r=Gr,`selectionStart`in r&&Ur(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}),qr&&Lr(qr,r)||(qr=r,r=$f(Kr,`onSelect`),0<r.length&&(t=new Pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Gr)))}function Xr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Zr={animationend:Xr(`Animation`,`AnimationEnd`),animationiteration:Xr(`Animation`,`AnimationIteration`),animationstart:Xr(`Animation`,`AnimationStart`),transitionrun:Xr(`Transition`,`TransitionRun`),transitionstart:Xr(`Transition`,`TransitionStart`),transitioncancel:Xr(`Transition`,`TransitionCancel`),transitionend:Xr(`Transition`,`TransitionEnd`)},Qr={},$r={};Sn&&($r=document.createElement(`div`).style,`AnimationEvent`in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),`TransitionEvent`in window||delete Zr.transitionend.transition);function ei(e){if(Qr[e])return Qr[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $r)return Qr[e]=t[n];return e}var ti=ei(`animationend`),ni=ei(`animationiteration`),ri=ei(`animationstart`),ii=ei(`transitionrun`),ai=ei(`transitionstart`),oi=ei(`transitioncancel`),si=ei(`transitionend`),ci=new Map,li=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);li.push(`scrollEnd`);function ui(e,t){ci.set(e,t),Pt(t,[e])}var di=0;function fi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Cd.identifierPrefix;var n=di++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function pi(e){if(e==null||typeof e==`string`)return e;var t=null,n=jd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function mi(e,t){return e=pi(e),t=pi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var hi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},gi=[],_i=0,vi=0;function yi(){for(var e=_i,t=vi=_i=0;t<e;){var n=gi[t];gi[t++]=null;var r=gi[t];gi[t++]=null;var i=gi[t];gi[t++]=null;var a=gi[t];if(gi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ci(n,i,a)}}function bi(e,t,n,r){gi[_i++]=e,gi[_i++]=t,gi[_i++]=n,gi[_i++]=r,vi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function xi(e,t,n,r){return bi(e,t,n,r),wi(e)}function Si(e,t){return bi(e,null,null,t),wi(e)}function Ci(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function wi(e){if(50<Md)throw Md=0,Nd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ti={};function Ei(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(e,t,n,r){return new Ei(e,t,n,r)}function Oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ki(e,t){var n=e.alternate;return n===null?(n=Di(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&0x47f00000,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ai(e,t){e.flags&=0x47f00002;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ji(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Oi(r)&&(s=1);else if(typeof r==`string`)s=$m(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else e:switch(r){case ee:return e=Di(31,n,t,a),e.elementType=ee,e.lanes=o,e;case j:return Mi(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Di(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Di(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Di(19,n,t,a),e.elementType=R,e.lanes=o,e;case V:case ne:return e=a|32,e=Di(30,n,t,e),e.elementType=ne,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break e;case P:s=9;break e;case I:s=11;break e;case z:s=14;break e;case B:s=16,r=null;break e}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Mi(e,t,n,r){return e=Di(7,e,r,t),e.lanes=n,e}function Ni(e,t,n){return e=Di(6,e,null,t),e.lanes=n,e}function Pi(e){var t=Di(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=Di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ii=new WeakMap;function Li(e,t){if(typeof e==`object`&&e){var n=Ii.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},Ii.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var Ri=[],zi=0,Bi=null,Vi=0,Hi=[],Ui=0,Wi=null,Gi=1,Ki=``;function qi(e,t){Ri[zi++]=Vi,Ri[zi++]=Bi,Bi=e,Vi=t}function Ji(e,t,n){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Wi=e;var r=Gi;e=Ki;var i=32-Je(r)-1;r&=~(1<<i),n+=1;var a=32-Je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Gi=1<<32-Je(t)+i|n<<i|r,Ki=a+e}else Gi=1<<a|n<<i|r,Ki=e}function Yi(e){e.return!==null&&(qi(e,1),Ji(e,1,0))}function Xi(e){for(;e===Bi;)Bi=Ri[--zi],Ri[zi]=null,Vi=Ri[--zi],Ri[zi]=null;for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Ki=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null}function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Gi=t.id,Ki=t.overflow,Wi=e}var Qi=null,$i=null,ea=!1,ta=null,na=!1,ra=Error(i(519));function ia(e){throw ua(Li(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[gt]=e,t[_t]=r,n){case`dialog`:Kf(`cancel`,t),Kf(`close`,t);break;case`iframe`:case`object`:case`embed`:Kf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Uf.length;n++)Kf(Uf[n],t);break;case`source`:Kf(`error`,t);break;case`img`:case`image`:case`link`:Kf(`error`,t),Kf(`load`,t);break;case`details`:Kf(`toggle`,t);break;case`input`:Kf(`invalid`,t),$t(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Kf(`invalid`,t);break;case`textarea`:Kf(`invalid`,t),rn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ap(t.textContent,n)?(r.popover!=null&&(Kf(`beforetoggle`,t),Kf(`toggle`,t)),r.onScroll!=null&&Kf(`scroll`,t),r.onScrollEnd!=null&&Kf(`scrollend`,t),r.onClick!=null&&(t.onclick=pn),t=!0):t=!1,t||ia(e,!0)}function oa(e){for(Qi=e.return;Qi;)switch(Qi.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:Qi=Qi.return}}function sa(e){if(e!==Qi)return!1;if(!ea)return oa(e),ea=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||yp(e.type,e.memoizedProps)),n=!n),n&&$i&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=_m(e)}else t===27?(t=$i,Op(e.type)?(e=gm,gm=null,$i=e):$i=t):$i=Qi?hm(e.stateNode.nextSibling):null;return!0}function ca(){$i=Qi=null,ea=!1}function la(){var e=ta;return e!==null&&(hd===null?hd=e:hd.push.apply(hd,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=pe(null),fa=null,pa=null;function ma(e,t,n){he(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,me(da)}function ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function _a(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;e:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ga(o.return,n,e),r||(s=null);break e}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ga(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ga(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function va(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Ir(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ye.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ph]:e.push(ph))}a=a.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Ir(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(i(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ta=t.unstable_scheduleCallback,Ea=t.unstable_NormalPriority,Da={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=Rf(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ba=ce.S;ce.S=function(e,t){if(vd=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=wf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=wf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=pe(null);function Ha(){var e=Va.current;return e===null?ed.pooledCache:e}function Ua(e,t){t===null?he(Va,Va.current):he(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(i(460)),Ka=Error(i(474)),qa=Error(i(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(pn,pn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(pn,pn);else{if(e=ed,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e}throw Qa=t,Ga}}function Za(e){try{return(0,e._init)(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(i(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(i(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function oo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ki(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=0x8000002,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=0x8000002),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ni(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===B&&Za(i)===t.type)?(t=a(t,n.props),io(t,n),t.return=e,t):(t=ji(n.type,n.key,n.props,null,e.mode,r),io(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Fi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ni(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=ji(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case A:return t=Fi(t,e.mode,n),t.return=e,t;case B:return t=Za(t),f(e,t,n)}if(H(t)||ae(t))return t=Mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===F)return f(e,Sa(e,t),n);ao(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case B:return n=Za(n),p(e,t,n,r)}if(H(n)||ae(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===F)return p(e,t,Sa(e,n),r);ao(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case B:return r=Za(r),m(e,t,n,r,i)}if(H(r)||ae(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===F)return m(e,t,n,Sa(t,r),i);ao(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ea&&qi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ea&&qi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ea&&qi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ea&&qi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ea&&qi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ea&&qi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:e:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),io(c,o),c.return=e,e=c;break e}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===B&&Za(l)===r.type){n(e,r.sibling),c=a(r,o.props),io(c,o),c.return=e,e=c;break e}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Mi(o.props.children,e.mode,c,o.key),io(c,o),c.return=e,e=c):(c=ji(o.type,o.key,o.props,null,e.mode,c),io(c,o),c.return=e,e=c)}return s(e);case A:e:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break e}n(e,r);break}t(e,r),r=r.sibling}c=Fi(o,e.mode,c),c.return=e,e=c}return s(e);case B:return o=Za(o),_(e,r,o,c)}if(H(o))return h(e,r,o,c);if(ae(o)){if(l=ae(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,ro(o),c);if(o.$$typeof===F)return _(e,r,Sa(e,o),c);ao(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ni(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=Di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$u&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=wi(e),Ci(e,null,n),t}return bi(e,r,t,n),wi(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}function go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var _o=!1;function vo(){if(_o){var e=Ia;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(nd&f)===f:(r&f)===f){f!==0&&f===Fa&&(_o=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break e;d=D({},d,f);break e;case 2:lo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),q|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function xo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var So=pe(null),Co=pe(0);function wo(e,t){e=cd,he(Co,e),he(So,t),cd=e|t.baseLanes}function To(){he(Co,cd),he(So,So.current)}function Eo(){cd=Co.current,me(So),me(Co)}var Do=pe(null),Oo=null;function ko(e){var t=e.alternate;he(Po,Po.current&1),he(Do,e),Oo===null&&(t===null||So.current!==null||t.memoizedState!==null)&&(Oo=e)}function Ao(e){he(Po,Po.current),he(Do,e),Oo===null&&(Oo=e)}function jo(e){e.tag===22?(he(Po,Po.current),he(Do,e),Oo===null&&(Oo=e)):Mo()}function Mo(){he(Po,Po.current),he(Do,Do.current)}function No(e){me(Do),Oo===e&&(Oo=null),me(Po)}var Po=pe(0);function Fo(e,t){he(Do,Do.current),he(Po,t)}function Io(e){me(Po),me(Do),Oo===e&&(Oo=null)}function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fm(n)||pm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Ro=0,zo=null,Bo=null,Vo=null,Ho=!1,Uo=!1,Wo=!1,Go=0,Ko=0,qo=null,Jo=0;function Yo(){throw Error(i(321))}function Xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ir(e[n],t[n]))return!1;return!0}function Zo(e,t,n,r,i,a){return Ro=a,zo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ce.H=e===null||e.memoizedState===null?mc:hc,Wo=!1,a=n(r,i),Wo=!1,Uo&&(a=$o(t,n,r,i)),Qo(e),a}function Qo(e){ce.H=pc;var t=Bo!==null&&Bo.next!==null;if(Ro=0,Vo=Bo=zo=null,Ho=!1,Ko=0,qo=null,t)throw Error(i(300));e===null||Mc||(e=e.dependencies,e!==null&&ya(e)&&(Mc=!0))}function $o(e,t,n,r){zo=e;var a=0;do{if(Uo&&(qo=null),Ko=0,Uo=!1,25<=a)throw Error(i(301));if(a+=1,Vo=Bo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ce.H=gc,o=t(n,r)}while(Uo);return o}function es(){var e=ce.H,t=e.useState()[0];return t=typeof t.then==`function`?ss(t):t,e=e.useState()[0],(Bo===null?null:Bo.memoizedState)!==e&&(zo.flags|=1024),t}function ts(){var e=Go!==0;return Go=0,e}function ns(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rs(e){if(Ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ho=!1}Ro=0,Vo=Bo=zo=null,Uo=!1,Ko=Go=0,qo=null}function is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vo===null?zo.memoizedState=Vo=e:Vo=Vo.next=e,Vo}function as(){if(Bo===null){var e=zo.alternate;e=e===null?null:e.memoizedState}else e=Bo.next;var t=Vo===null?zo.memoizedState:Vo.next;if(t!==null)Vo=t,Bo=e;else{if(e===null)throw zo.alternate===null?Error(i(467)):Error(i(310));Bo=e,e={memoizedState:Bo.memoizedState,baseState:Bo.baseState,baseQueue:Bo.baseQueue,queue:Bo.queue,next:null},Vo===null?zo.memoizedState=Vo=e:Vo=Vo.next=e}return Vo}function os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ss(e){var t=Ko;return Ko+=1,qo===null&&(qo=[]),e=Xa(qo,e,t),t=zo,(Vo===null?t.memoizedState:Vo.next)===null&&(t=t.alternate,ce.H=t===null||t.memoizedState===null?mc:hc),e}function cs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ss(e);if(e.$$typeof===re)return;if(e.$$typeof===F)return xa(e)}throw Error(i(438,String(e)))}function ls(e){var t=null,n=zo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=zo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=os(),zo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=te;return t.index++,n}function us(e,t){return typeof t==`function`?t(e):t}function ds(e){return fs(as(),Bo,e)}function fs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ro&f)===f:(nd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Fa&&(d=!0);else if((Ro&p)===p){u=u.next,p===Fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,zo.lanes|=p,q|=p;f=u.action,Wo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,zo.lanes|=f,q|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ir(o,e.memoizedState)&&(Mc=!0,d&&(n=Ia,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ps(e){var t=as(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Ir(o,t.memoizedState)||(Mc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ms(e,t,n){var r=zo,a=as(),o=ea;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ir((Bo||a).memoizedState,n);if(s&&(a.memoizedState=n,Mc=!0),a=a.queue,zs(_s.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Vo!==null&&!!(Vo.memoizedState.tag&1),Ps(e?9:8,{destroy:void 0},gs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ed===null)throw Error(i(349));o||Ro&127||hs(r,t,n)}return n}function hs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=zo.updateQueue,t===null?(t=os(),zo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gs(e,t,n,r){t.value=n,t.getSnapshot=r,vs(t)&&ys(e)}function _s(e,t,n){return n(function(){vs(t)&&ys(e)})}function vs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ir(e,n)}catch{return!0}}function ys(e){var t=Si(e,2);t!==null&&Ld(t,e,2)}function bs(e){var t=is();if(typeof e==`function`){var n=e;if(e=n(),Wo){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:e},t}function xs(e,t,n,r){return e.baseState=n,fs(e,Bo,typeof r==`function`?r:us)}function Ss(e,t,n,r,a){if(uc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};ce.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Cs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Cs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=ce.T,o={};o.types=a===null?null:a.types,ce.T=o;try{var s=n(i,r),c=ce.S;c!==null&&c(o,s),ws(e,t,s)}catch(n){Es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),ce.T=a}}else try{a=n(i,r),ws(e,t,a)}catch(n){Es(e,t,n)}}function ws(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ts(e,t,n)},function(n){return Es(e,t,n)}):Ts(e,t,n)}function Ts(e,t,n){t.status=`fulfilled`,t.value=n,Ds(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Cs(e,n)))}function Es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ds(t),t=t.next;while(t!==r)}e.action=null}function Ds(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Os(e,t){return t}function ks(e,t){if(ea){var n=ed.formState;if(n!==null){e:{var r=zo;if(ea){if($i){t:{for(var i=$i,a=na;i.nodeType!==8;)if(!a||(i=hm(i.nextSibling),i===null)){i=null;break t}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){$i=hm(i.nextSibling),r=i.data===`F!`;break e}}ia(r)}r=!1}r&&(t=n[0])}}return n=is(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:t},n.queue=r,n=sc.bind(null,zo,r),r.dispatch=n,r=bs(!1),a=lc.bind(null,zo,!1,r.queue),r=is(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ss.bind(null,zo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function As(e){return js(as(),Bo,e)}function js(e,t,n){if(t=fs(e,t,Os)[0],e=ds(us)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ss(t)}catch(e){throw e===Ga?qa:e}else r=t;t=as();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(zo.flags|=2048,Ps(9,{destroy:void 0},Ms.bind(null,i,n),null)),[r,a,e]}function Ms(e,t){e.action=t}function Ns(e){var t=as(),n=Bo;if(n!==null)return js(t,n,e);as(),t=t.memoizedState,n=as();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ps(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=zo.updateQueue,t===null&&(t=os(),zo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Fs(){return as().memoizedState}function Is(e,t,n,r){var i=is();zo.flags|=e,i.memoizedState=Ps(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ls(e,t,n,r){var i=as();r=r===void 0?null:r;var a=i.memoizedState.inst;Bo!==null&&r!==null&&Xo(r,Bo.memoizedState.deps)?i.memoizedState=Ps(t,a,n,r):(zo.flags|=e,i.memoizedState=Ps(1|t,a,n,r))}function Rs(e,t){Is(8390656,8,e,t)}function zs(e,t){Ls(2048,8,e,t)}function Bs(e){zo.flags|=4;var t=zo.updateQueue;if(t===null)t=os(),zo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Vs(e){var t=as().memoizedState;return Bs({ref:t,nextImpl:e}),function(){if($u&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Hs(e,t){return Ls(4,2,e,t)}function Us(e,t){return Ls(4,4,e,t)}function Ws(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Gs(e,t,n){n=n==null?null:n.concat([e]),Ls(4,4,Ws.bind(null,t,e),n)}function Ks(){}function qs(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Js(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Xo(t,r[1]))return r[0];if(r=e(),Wo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Ys(e,t,n){return n===void 0||Ro&0x40000000&&!(nd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Fd(),zo.lanes|=e,q|=e,n)}function Xs(e,t,n,r){return Ir(n,t)?n:So.current===null?!(Ro&106)||Ro&0x40000000&&!(nd&261930)?(Mc=!0,e.memoizedState=n):(e=Fd(),zo.lanes|=e,q|=e,t):(e=Ys(e,n,r),Ir(e,t)||(Mc=!0),e)}function Zs(e,t,n,r,i){var a=le.p;le.p=a!==0&&8>a?a:8;var o=ce.T,s={};s.types=o===null?null:o.types,ce.T=s,lc(e,!1,t,n);try{var c=i(),l=ce.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?cc(e,t,za(c,r),Pd(e)):cc(e,t,r,Pd(e))}catch(n){cc(e,t,{then:function(){},status:`rejected`,reason:n},Pd())}finally{le.p=a,o!==null&&s.types!==null&&(o.types=s.types),ce.T=o}}function Qs(){}function $s(e,t,n,r){if(e.tag!==5)throw Error(i(476));Zs(e,ec(e).queue,t,ue,n===null?Qs:function(){return tc(e),n(r)})}function ec(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tc(e){var t=ec(e);t.next===null&&(t=e.alternate.memoizedState),cc(e,t.next.queue,{},Pd())}function nc(){return xa(ph)}function rc(){return as().memoizedState}function ic(){return as().memoizedState}function ac(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Pd();e=po(n);var r=mo(t,e,n);r!==null&&(Ld(r,t,n),ho(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function oc(e,t,n){var r=Pd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)?dc(t,n):(n=xi(e,t,n,r),n!==null&&(Ld(n,e,r),fc(n,t,r)))}function sc(e,t,n){cc(e,t,n,Pd())}function cc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(uc(e))dc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ir(s,o))return bi(e,t,i,0),ed===null&&yi(),!1}catch{}if(n=xi(e,t,i,r),n!==null)return Ld(n,e,r),fc(n,t,r),!0}return!1}function lc(e,t,n,r){if(r={lane:2,revertLane:Rf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},uc(e)){if(t)throw Error(i(479))}else t=xi(e,n,r,2),t!==null&&Ld(t,e,2)}function uc(e){var t=e.alternate;return e===zo||t!==null&&t===zo}function dc(e,t){Uo=Ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}var pc={readContext:xa,use:cs,useCallback:Yo,useContext:Yo,useEffect:Yo,useImperativeHandle:Yo,useLayoutEffect:Yo,useInsertionEffect:Yo,useMemo:Yo,useReducer:Yo,useRef:Yo,useState:Yo,useDebugValue:Yo,useDeferredValue:Yo,useTransition:Yo,useSyncExternalStore:Yo,useId:Yo,useHostTransitionStatus:Yo,useFormState:Yo,useActionState:Yo,useOptimistic:Yo,useMemoCache:Yo,useCacheRefresh:Yo,useEffectEvent:Yo},mc={readContext:xa,use:cs,useCallback:function(e,t){return is().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Is(4194308,4,Ws.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Is(4194308,4,e,t)},useInsertionEffect:function(e,t){Is(4,2,e,t)},useMemo:function(e,t){var n=is();t=t===void 0?null:t;var r=e();if(Wo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=is();if(n!==void 0){var i=n(t);if(Wo){qe(!0);try{n(t)}finally{qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=oc.bind(null,zo,e),[r.memoizedState,e]},useRef:function(e){var t=is();return e={current:e},t.memoizedState=e},useState:function(e){e=bs(e);var t=e.queue,n=sc.bind(null,zo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ks,useDeferredValue:function(e,t){return Ys(is(),e,t)},useTransition:function(){var e=bs(!1);return e=Zs.bind(null,zo,e.queue,!0,!1),is().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=zo,a=is();if(ea){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ed===null)throw Error(i(349));nd&127||hs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Rs(_s.bind(null,r,o,e),[e]),r.flags|=2048,Ps(9,{destroy:void 0},gs.bind(null,r,o,n,t),null),n},useId:function(){var e=is(),t=ed.identifierPrefix;if(ea){var n=Ki,r=Gi;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Jo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:nc,useFormState:ks,useActionState:ks,useOptimistic:function(e){var t=is();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=lc.bind(null,zo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ls,useCacheRefresh:function(){return is().memoizedState=ac.bind(null,zo)},useEffectEvent:function(e){var t=is(),n={impl:e};return t.memoizedState=n,function(){if($u&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},hc={readContext:xa,use:cs,useCallback:qs,useContext:xa,useEffect:zs,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:Us,useMemo:Js,useReducer:ds,useRef:Fs,useState:function(){return ds(us)},useDebugValue:Ks,useDeferredValue:function(e,t){return Xs(as(),Bo.memoizedState,e,t)},useTransition:function(){var e=ds(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:rc,useHostTransitionStatus:nc,useFormState:As,useActionState:As,useOptimistic:function(e,t){return xs(as(),Bo,e,t)},useMemoCache:ls,useCacheRefresh:ic,useEffectEvent:Vs},gc={readContext:xa,use:cs,useCallback:qs,useContext:xa,useEffect:zs,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:Us,useMemo:Js,useReducer:ps,useRef:Fs,useState:function(){return ps(us)},useDebugValue:Ks,useDeferredValue:function(e,t){var n=as();return Bo===null?Ys(n,e,t):Xs(n,Bo.memoizedState,e,t)},useTransition:function(){var e=ps(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:rc,useHostTransitionStatus:nc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){var n=as();return Bo===null?(n.baseState=e,[e,n.queue.dispatch]):xs(n,Bo,e,t)},useMemoCache:ls,useCacheRefresh:ic,useEffectEvent:Vs};function _c(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Pd(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Ld(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Pd(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Ld(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pd(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Ld(t,e,n),ho(t,e,n))}};function yc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Lr(n,r)||!Lr(i,a):!0}function bc(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&&vc.enqueueReplaceState(t,t.state,null)}function xc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Sc(e){hi(e)}function Cc(e){console.error(e)}function wc(e){hi(e)}function Tc(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ec(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Dc(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){Tc(e,t)},n}function Oc(e){return e=po(e),e.tag=3,e}function kc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ec(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ec(t,n,r),typeof i!=`function`&&(xd===null?xd=new Set([this]):xd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ac(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,a,!0),n=Do.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Oo===null?Yd():n.alternate===null&&ld===0&&(ld=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),vf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),vf(e,r,a)),!1}throw Error(i(435,n.tag))}return vf(e,r,a),Yd(),!1}if(ea)return t=Do.current,t===null?(r!==ra&&(t=Error(i(423),{cause:r}),ua(Li(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Li(r,n),a=Dc(e.stateNode,r,a),go(e,a),ld!==4&&(ld=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ra&&(e=Error(i(422),{cause:r}),ua(Li(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Li(o,n),md===null?md=[o]:md.push(o),ld!==4&&(ld=2),t===null)return!0;r=Li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Dc(n.stateNode,r,e),go(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(xd===null||!xd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Oc(a),kc(a,e,n,r),go(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var jc=Error(i(461)),Mc=!1;function Nc(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function Pc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ba(t),r=Zo(e,t,n,o,a,i),s=ts(),e!==null&&!Mc?(ns(e,t,i),cl(e,t,i)):(ea&&s&&Yi(t),t.flags|=1,Nc(e,t,r,i),t.child)}function Fc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ic(e,t,a,r,i)):(e=ji(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ll(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Lr:n,n(o,r)&&e.ref===t.ref)return cl(e,t,i)}return t.flags|=1,e=ki(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Lr(a,r)&&e.ref===t.ref){if(Mc=!1,t.pendingProps=r=a,ll(e,i))e.flags&131072&&(Mc=!0);else return t.lanes=e.lanes,cl(e,t,i)}}return Wc(e,t,n,r,i)}function Lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return zc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?To():wo(t,a),jo(t);else return r=t.lanes=536870912,zc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),To(),Mo()):(Ua(t,a.cachePool),wo(t,a),Mo(),t.memoizedState=null);return Nc(e,t,i,n),t.child}function Rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function zc(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),To(),jo(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function Bc(e,t){return t=$c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Vc(e,t,n){return so(t,e.child,null,n),e=Bc(t,t.pendingProps),e.flags|=2,No(t),t.memoizedState=null,e}function Hc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ea){if(r.mode===`hidden`)return e=Bc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Rc(null,e);if(Ao(t),(e=$i)?(e=dm(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return Bc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ao(t),a){if(t.flags&256)t.flags&=-257,t=Vc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Mc||va(e,t,n,!1),a=(n&e.childLanes)!==0,Mc||a){if(So.current===null){if(r=ed,r!==null&&(s=ut(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Si(e,s),Ld(r,e,s),jc;Yd()}t=Vc(e,t,n)}else e=o.treeContext,$i=hm(s.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=Bc(t,r),t.flags|=0x8001000;return t}return e=ki(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Wc(e,t,n,r,i){return ba(t),n=Zo(e,t,n,r,void 0,i),r=ts(),e!==null&&!Mc?(ns(e,t,i),cl(e,t,i)):(ea&&r&&Yi(t),t.flags|=1,Nc(e,t,n,i),t.child)}function Gc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=$o(t,r,n,i),Qo(e),r=ts(),e!==null&&!Mc?(ns(e,t,a),cl(e,t,a)):(ea&&r&&Yi(t),t.flags|=1,Nc(e,t,n,a),t.child)}function Kc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Ti,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=vc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(_c(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&vc.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=xc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ti,typeof u==`object`&&u&&(o=xa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&bc(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(_c(t,n,d,r),l=t.memoizedState),(c=lo||yc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,fo(e,t),o=t.memoizedProps,u=xc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ti,typeof l==`object`&&l&&(c=xa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&bc(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(_c(t,n,s,r),p=t.memoizedState),(u=lo||yc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Uc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=so(t,e.child,null,i),t.child=so(t,null,n,i)):Nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=cl(e,t,i),e}function qc(e,t,n,r){return ca(),t.flags|=256,Nc(e,t,n,r),t.child}var Jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yc(e){return{baseLanes:e,cachePool:Wa()}}function Xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=fd),e}function Zc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Po.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ea){if(i?ko(t):Mo(),(e=$i)?(e=dm(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Mo(),i=t.mode,a=$c({mode:`hidden`,children:a},i),r=Mi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Yc(n),r.childLanes=Xc(e,o,n),t.memoizedState=Jc,Rc(null,r)):(ko(t),Qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return tl(e,t,a,o,r,c,s,n)}return i?(Mo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ki(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&0x47f00000,c===null?(i=Mi(i,a,n,null),i.flags|=2):i=ki(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Rc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Yc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Xc(e,o,n),t.memoizedState=Jc,Rc(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=ki(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Qc(e,t){return t=$c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function $c(e,t){return e=Di(22,e,null,t),e.lanes=0,e}function el(e,t,n){return so(t,e.child,null,n),e=Qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(ko(t),t.flags&=-257,el(e,t,c)):t.memoizedState===null?(Mo(),o=a.fallback,s=t.mode,a=$c({mode:`visible`,children:a.children},s),o=Mi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,so(t,e.child,null,c),a=t.child,a.memoizedState=Yc(c),a.childLanes=Xc(e,r,c),t.memoizedState=Jc,Rc(null,a)):(Mo(),t.child=e.child,t.flags|=128,null);if(ko(t),pm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ua({value:a,source:null,stack:null})),el(e,t,c)}if(Mc||va(e,t,c,!1),r=(c&e.childLanes)!==0,Mc||r){if(So.current!==null)return el(e,t,c);if(r=ed,r!==null&&(a=ut(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Si(e,a),Ld(r,e,a),jc;return fm(o)||Yd(),el(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,$i=hm(o.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=Qc(t,a.children),t.flags|=0x8001000,t)}function nl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function rl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Lo(n)===null&&(t=e),e=e.sibling}return t}function il(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function al(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ol(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Po.current;if(t.flags&128)return Fo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Fo(t,o),i===`backwards`&&e!==null?(al(e),Nc(e,t,r,n),al(e)):Nc(e,t,r,n),r=ea?Vi:0,!s&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nl(e,n,t);else if(e.tag===19)nl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=rl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,al(t)),il(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}il(t,!0,n,null,a,r);break;case`together`:il(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=rl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),il(t,!1,i,n,a,r)}return t.child}function sl(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Nc(e,t,r.children,n),t.child}function cl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),q|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ki(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ki(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ll(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function ul(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ko(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Zc(e,t,n):(ko(t),e=cl(e,t,n),e===null?null:e.sibling)}ko(t);break;case 19:if(t.flags&128)return ol(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ol(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Fo(t,Po.current),r)break;return null;case 22:return t.lanes=0,Lc(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return cl(e,t,n)}function dl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Mc=!0;else{if(!ll(e,n)&&!(t.flags&128))return Mc=!1,ul(e,t,n);Mc=!!(e.flags&131072)}}else Mc=!1,ea&&t.flags&1048576&&Ji(t,Vi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)Oi(e)?(r=xc(e,r),t.tag=1,t=Kc(null,t,e,r,n)):(t.tag=0,t=Wc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Pc(null,t,e,r,n);break e}if(a===z){t.tag=14,t=Fc(null,t,e,r,n);break e}if(a===F){t.tag=10,t.type=e,t=sl(null,t,n);break e}}throw t=se(e)||e,Error(i(306,t,``))}}return t;case 0:return Wc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=xc(r,t.pendingProps),Kc(e,t,r,a,n);case 3:e:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,fo(e,t),yo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==o.cache&&_a(t,[Da],n,!0),vo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=qc(e,t,r,n);break e}if(r!==a){a=Li(Error(i(424)),t),ua(a),t=qc(e,t,r,n);break e}for(e=t.stateNode.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,$i=hm(e.firstChild),Qi=t,ea=!0,ta=null,na=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|0x8001000,n=n.sibling}else{if(ca(),r===a){t=cl(e,t,n);break e}Nc(e,t,r,n)}t=t.child}return t;case 26:return Uc(e,t),e===null?(n=zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ea||(t.stateNode=vp(t.type,t.pendingProps,ve.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&ea&&(r=t.stateNode=xm(t.type,t.pendingProps,ve.current),Qi=t,na=!0,a=$i,Op(t.type)?(gm=a,$i=hm(r.firstChild)):$i=a),Nc(e,t,t.pendingProps.children,n),Uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ea&&((a=r=$i)&&(r=lm(r,t.type,t.pendingProps,na),r===null?a=!1:(t.stateNode=r,Qi=t,$i=hm(r.firstChild),na=!1,a=!0)),a||ia(t)),Se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,yp(a,o)?r=null:s!==null&&yp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Zo(e,t,es,null,null,n),ph._currentValue=a),Uc(e,t),Nc(e,t,r,n),t.child;case 6:return e===null&&ea&&((e=n=$i)&&(n=um(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,Qi=t,$i=null,e=!0)),e||ia(t)),null;case 13:return Zc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Nc(e,t,r,n),t.child;case 11:return Pc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Uc(e,t),Nc(e,t,r,n),t.child;case 8:case 12:return Nc(e,t,t.pendingProps.children,n),t.child;case 10:return sl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ba(t),a=xa(a),r=r(a),t.flags|=1,Nc(e,t,r,n),t.child;case 14:return Fc(e,t,t.type,t.pendingProps,n);case 15:return Ic(e,t,t.type,t.pendingProps,n);case 19:return ol(e,t,n);case 31:return Hc(e,t,n);case 22:return Lc(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(a=Ha(),a===null&&(a=ed,o=Oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},uo(t),ma(t,Da,a)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ma(t,Da,r))),Nc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:ea&&Yi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Uc(e,t),Nc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function fl(e){e.flags|=4}function pl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?eh(t,r):eh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Kd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function ml(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(Kd())e.flags|=8192;else throw Qa=Ja,Ka}}function hl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:W(),e.lanes|=t,pd|=t)}function gl(e,t){if(!ea)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function _l(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&0x47f00000,r|=i.flags&0x47f00000,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vl(e,t,n){var r=t.pendingProps;switch(Xi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return _l(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?fl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),_l(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(fl(t),o===null?(_l(t),pl(t,a,null,r,n)):(_l(t),ml(t,o))):o?o===e.memoizedState?(_l(t),t.flags&=-16777217):(fl(t),_l(t),ml(t,o)):(e=e.memoizedProps,e!==r&&fl(t),_l(t),pl(t,a,e,r,n)),null;case 27:if(Ce(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return _l(t),t.subtreeFlags&=-33554433,null}e=ge.current,sa(t)?aa(t,e):(e=xm(a,r,n),t.stateNode=e,fl(t))}return _l(t),t.subtreeFlags&=-33554433,null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return _l(t),t.subtreeFlags&=-33554433,null}if(o=ge.current,sa(t))aa(t,o);else{var s=hp(ve.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[gt]=t,o[_t]=r;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(t.stateNode=o,cp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break;case`img`:r=!0;break;default:r=!1}r&&fl(t)}}return _l(t),t.subtreeFlags&=-33554433,pl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Qi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[gt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ap(e.nodeValue,n)),e||ia(t,!0)}else e=hp(e).createTextNode(r),e[gt]=t,t.stateNode=e}return _l(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[gt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_l(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(No(t),t):(No(t),null);if(t.flags&128)throw Error(i(558))}return _l(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=sa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[gt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_l(t),a=!1}else a=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(No(t),t):(No(t),null)}return No(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),hl(t,t.updateQueue),_l(t),null);case 4:return xe(),e===null&&Yf(t.stateNode.containerInfo),t.flags|=67108864,_l(t),null;case 10:return ha(t.type),_l(t),null;case 19:if(Io(t),r=t.memoizedState,r===null)return _l(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)gl(r,!1);else{if(ld!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Lo(e),o!==null){for(t.flags|=128,gl(r,!1),e=o.updateQueue,t.updateQueue=e,hl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ai(n,e),n=n.sibling;return Fo(t,Po.current&1|2),ea&&qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>yd&&(t.flags|=128,a=!0,gl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,hl(t,e),gl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ea)return _l(t),null}else 2*Ie()-r.renderingStartTime>yd&&n!==536870912&&(t.flags|=128,a=!0,gl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,o=Po.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ea?Fo(t,o):(n=o,he(Do,t),he(Po,n),Oo===null&&(Oo=t)),ea&&qi(t,r.treeForkCount),e}return _l(t),null;case 22:case 23:return No(t),Eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(_l(t),t.subtreeFlags&6&&(t.flags|=8192)):_l(t),n=t.updateQueue,n!==null&&hl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&me(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),_l(t),null;case 25:return null;case 30:return t.flags|=33554432,_l(t),null}throw Error(i(156,t.tag))}function yl(e,t){switch(Xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(No(t),t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(No(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return xe(),null;case 10:return ha(t.type),null;case 22:case 23:return No(t),Eo(),e!==null&&me(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;default:return null}}function bl(e,t){switch(Xi(t),t.tag){case 3:ha(Da),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&No(t);break;case 13:No(t);break;case 19:Io(t);break;case 10:ha(t.type);break;case 22:case 23:No(t),Eo(),e!==null&&me(Va);break;case 24:ha(Da)}}function xl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){_f(t,t.return,e)}}function Sl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){_f(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){_f(t,t.return,e)}}function Cl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xo(t,n)}catch(t){_f(e,e.return,t)}}}function wl(e,t,n){n.props=xc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){_f(e,t,n)}}function Tl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=fi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Bp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Vp(e);m(e.child,!1,im,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){_f(e,t,n)}}function El(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){_f(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){_f(e,t,n)}else n.current=null}}function Dl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)om(e.stateNode,t[n])}function Ol(e){for(var t=e.return;t!==null&&(jl(t)&&om(e.stateNode,t.stateNode),!Al(t));)t=t.return}function kl(e){for(var t=e.return;t!==null&&(jl(t)&&sm(e.stateNode,t.stateNode),!Al(t));)t=t.return}function Al(e){return e.tag===5||e.tag===3||e.tag===27}function jl(e){return e&&e.tag===7&&e.stateNode!==null}function Ml(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){_f(e,e.return,t)}}function Nl(e,t,n){try{var r=e.stateNode;up(r,e.type,n,t),r[_t]=t}catch(t){_f(e,e.return,t)}}function Pl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Op(e.type)||e.tag===4}function Fl(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Pl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Op(e.type)||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 Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pn)),Dl(e,r),Bt=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,Op(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Dl(e,r),Bt=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,Op(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);cp(t,r,n),t[gt]=e,t[_t]=n}catch(t){_f(e,e.return,t)}}var zl=!1,Bl=null;function Vl(e){(e.tag===30||e.subtreeFlags&33554432)&&(zl=!0)}var G=null;function Hl(){var e=G;return G=null,e}var Ul=0;function Wl(e,t,n,r,i){return Ul=0,Gl(e.child,t,n,r,i)}function Gl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Pp(o);r.push(s),s.view&&(a=!0)}else a||Pp(o).view&&(a=!0);zl=!0,jp(o,Ul===0?t:t+`_`+Ul,n),Ul++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Gl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Kl(e,t){for(;e!==null;)e.tag===5?Mp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Kl(e.child,t),e=e.sibling}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ql(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=mi(t.default,t.share),t!==`none`&&(Wl(e,n,t,null,!1)||Kl(e.child,!1))}e=e.sibling}}function Jl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=fi(r,n),a=mi(r.default,n.paired?r.share:r.enter);a===`none`?ql(e):Wl(e,i,a,null,!1)?(ql(e),n.paired||t||Id(e,r.onEnter)):Kl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e,t),e=e.sibling;else ql(e)}function Yl(e){if(Bl!==null&&Bl.size!==0){var t=Bl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=mi(n.default,n.share);if(a!==`none`&&(Wl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Id(e,n.onShare)):Kl(e.child,!1)),t.delete(r),t.size===0)break}}}Yl(e)}e=e.sibling}}}function Xl(e){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode),r=Bl===null?void 0:Bl.get(n),i=mi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Wl(e,n,i,null,!1)?r===void 0?Id(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Bl.delete(n),Id(e,t.onShare)):Kl(e.child,!1)),Bl!==null&&Yl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else Bl!==null&&Yl(e)}function Zl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode);t=mi(t.default,t.update),e.flags&=-5,t!==`none`&&Wl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Zl(e);e=e.sibling}}function Ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Kl(e.child,!1))}Ql(e)}e=e.sibling}}function $l(e){if(e.tag===30)e.stateNode.paired=null,Kl(e.child,!1),Ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Ql(e)}function eu(e){for(e=e.child;e!==null;)e.tag===30?Kl(e.child,!1):e.subtreeFlags&33554432&&eu(e),e=e.sibling}function tu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ul<a.length){var l=a[Ul],u=Pp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&jp(c,Ul===0?n:n+`_`+Ul,i),s&&e.flags&4||(G===null&&(G=[]),G.push(c,Ul===0?r:r+`_`+Ul,t.memoizedProps)),Ul++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:tu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function nu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=fi(n,r),a=mi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Fp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ul=0,i=tu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Id(e,n.onUpdate))}else e.subtreeFlags&33554432&&nu(e,t);e=e.sibling}}var ru=!1,iu=!1,au=!1,ou=!1,su=typeof WeakSet==`function`?WeakSet:Set,cu=null,lu=!1,uu=!1,du=!1,fu=!1;function pu(e,t,n){if(e=e.containerInfo,pp=Sh,e=Hr(e),Ur(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(mp={focusedElem:e,selectionRange:r},Sh=!1,n=(n&335544064)===n,cu=t,t=n?9270:1024;cu!==null;){if(e=cu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Xl(r[a]);if(e.alternate===null&&e.flags&2)n&&Vl(e),mu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Xl(r),mu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Vl(e),mu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,cu=r):(n&&Zl(e),mu(n))}}Bl=null}function mu(e){for(;cu!==null;){var t=cu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=xc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){_f(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)cm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:cm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=fi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=mi(a.default,a.update),a!==`none`&&Wl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,cu=r;break}cu=t.return}}function hu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pu(e,n),r&4&&xl(5,n);break;case 1:if(Pu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){_f(n,n.return,e)}else{var i=xc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){_f(n,n.return,e)}}}r&64&&Cl(n),r&512&&Tl(n,n.return);break;case 3:if(Pu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{xo(e,t)}catch(e){_f(n,n.return,e)}}break;case 27:t===null&&r&4&&Rl(n);case 26:case 5:Pu(e,n),t===null&&r&4&&Ml(n),r&512&&Tl(n,n.return);break;case 12:Pu(e,n);break;case 31:Pu(e,n),r&4&&Cu(e,n);break;case 13:Pu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=xf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||ru,!r){var a=t!==null&&t.memoizedState!==null||iu;t=ru,i=iu,ru=r,(iu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Iu(e,n,r)):Pu(e,n),ru=t,iu=i}break;case 30:Pu(e,n),r&512&&Tl(n,n.return);break;case 7:r&512&&Tl(n,n.return);default:Pu(e,n)}}function gu(e,t){for(e=e.child;e!==null;)K(e,t),e=e.sibling}function K(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){_f(e,e.return,t)}_u(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Bt=!0}catch(t){_f(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ap(s,!0):Ap(e.stateNode,!1)}catch(t){_f(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&gu(e,t);break;default:gu(e,t)}}function _u(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,r=t;switch(n.tag){case 4:K(n,r);break e;case 22:n.memoizedState===null&&_u(n,r);break e;default:_u(n,r)}}e=e.sibling}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var yu=null,bu=!1;function xu(e,t,n){for(n=n.child;n!==null;)Su(e,t,n),n=n.sibling}function Su(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:iu||El(n,t),xu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!iu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:iu||El(n,t),kl(n);var r=yu,i=bu;Op(n.type)&&(yu=n.stateNode,bu=!1),xu(e,t,n),Sm(n.stateNode,n.type,n.memoizedProps),yu=r,bu=i;break;case 5:iu||El(n,t),kl(n);case 6:if(n.tag===6&&kl(n),r=yu,i=bu,yu=null,xu(e,t,n),yu=r,bu=i,yu!==null){if(bu)try{(yu.nodeType===9?yu.body:yu.nodeName===`HTML`?yu.ownerDocument.body:yu).removeChild(n.stateNode),Bt=!0}catch(e){_f(n,t,e)}else try{yu.removeChild(n.stateNode),Bt=!0}catch(e){_f(n,t,e)}}break;case 18:yu!==null&&(bu?(e=yu,kp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),qh(e)):kp(yu,n.stateNode));break;case 4:r=yu,i=bu,yu=n.stateNode.containerInfo,bu=!0,xu(e,t,n),yu=r,bu=i;break;case 0:case 11:case 14:case 15:Sl(2,n,t),iu||Sl(4,n,t),xu(e,t,n);break;case 1:iu||(El(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&wl(n,t,r)),xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:iu=(r=iu)||n.memoizedState!==null,xu(e,t,n),iu=r;break;case 30:El(n,t),xu(e,t,n);break;case 7:iu||El(n,t),xu(e,t,n);break;default:xu(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qh(e)}catch(e){_f(t,t.return,e)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qh(e)}catch(e){_f(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new su),t;default:throw Error(i(435,e.tag))}}function Eu(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Sf.bind(null,e,t);t.then(r,r)}})}function Du(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;e:for(;l!==null;){switch(l.tag){case 27:if(Op(l.type)){yu=l.stateNode,bu=!1;break e}break;case 5:yu=l.stateNode,bu=!1;break e;case 3:case 4:yu=l.stateNode.containerInfo,bu=!0;break e}l=l.return}if(yu===null)throw Error(i(160));Su(s,c,o),yu=null,bu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ku(t,e,n),t=t.sibling}var Ou=null;function ku(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Du(t,e,n),Au(e),a&4&&(Sl(3,e,e.return),xl(3,e),Sl(5,e,e.return));break;case 1:Du(t,e,n),Au(e),a&512&&(iu||r===null||El(r,r.return)),a&64&&ru&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Ou,Du(t,e,n),Au(e),a&512&&(iu||r===null||El(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ru)e.stateNode=vp(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;t:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Ct]||r[gt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),cp(r,t,n),r[gt]=e,At(r),t=r;break e;case`link`:if(o=Zm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break t}}r=a.createElement(t),cp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Zm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break t}}r=a.createElement(t),cp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[gt]=e,At(r),t=r}e.stateNode=t}}else ru||Qm(o,e.type,e.stateNode)}else e.stateNode=Km(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Nl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||iu||t.parentNode.removeChild(t)):a.count--,n===null?ru||Qm(o,e.type,e.stateNode):Km(o,n,e.memoizedProps))}break;case 27:Du(t,e,n),Au(e),a&512&&(iu||r===null||El(r,r.return)),r!==null&&a&4&&Nl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=au,au=!1,Du(t,e,n),au=o,Au(e),a&512&&(iu||r===null||El(r,r.return)),e.flags&32){t=e.stateNode;try{an(t,``),Bt=!0}catch(t){_f(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Nl(e,t,r===null?t:r.memoizedProps)),a&1024&&(ou=!0);break;case 6:if(Du(t,e,n),Au(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Bt=!0}catch(t){_f(e,e.return,t)}}break;case 3:if(Bt=!1,Xm=null,o=Ou,Ou=Em(t.containerInfo),Du(t,e,n),Ou=o,Au(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{qh(t.containerInfo)}catch(t){_f(e,e.return,t)}ou&&(ou=!1,ju(e)),Bt=!1;break;case 4:a=au,au=ru,r=Vt(),o=Ou,Ou=Em(e.stateNode.containerInfo),Du(t,e,n),Au(e),Ou=o,Bt&&uu&&(du=!0),Bt=r,au=a;break;case 12:Du(t,e,n),Au(e);break;case 31:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 13:Du(t,e,n),Au(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(_d=Ie()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ru,l=iu,u=au;ru=c||o,au=u||o,iu=l||s,Du(t,e,n),iu=l,au=u,ru=c,Au(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ru||iu||(t=s||iu,n=ru,r=iu,ru=o||ru,iu=t,Fu(e,2),ru=n,iu=r),!o&&au||gu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Eu(e,n))));break;case 19:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 30:a&512&&(iu||r===null||El(r,r.return)),a=Vt(),o=uu,s=(n&335544064)===n,c=e.memoizedProps,uu=s&&mi(c.default,c.update)!==`none`,Du(t,e,n),Au(e),s&&r!==null&&Bt&&(e.flags|=4),uu=o,Bt=a;break;case 21:break;case 7:a&512&&(iu||r===null||El(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Du(t,e,n),Au(e)}}function Au(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Pl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(jl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Al(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ll(e,Fl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(an(l,``),n.flags&=-33),Ll(e,Fl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Il(e,Fl(e),u,s);break;default:throw Error(i(161))}}catch(t){_f(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ju(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ju(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sh=!0,t.reset(),Sh=!1),e=e.sibling}}function Mu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Nu(t,e),t=t.sibling;else nu(t,!1)}function Nu(e,t){var n=e.alternate;if(n===null)Jl(e,!1);else switch(e.tag){case 3:if(fu=lu=!1,Hl(),Mu(t,e),!lu&&!du){if(e=G,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Mp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),fu=!0}G=null;break;case 5:Mu(t,e);break;case 4:r=lu,lu=!1,Mu(t,e),lu&&(du=!0),lu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Mu(t,e):Jl(e,!1));break;case 30:r=lu,i=Hl(),lu=!1,Mu(t,e),lu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=fi(a,o),o=fi(n.memoizedProps,o);var s=mi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ul=0,t=tu(e,n,t,o,s,a,!0),Ul!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Id(e,e.memoizedProps.onUpdate),G=i):i!==null&&(i.push.apply(i,G),G=i),lu=e.flags&32?!0:r;break;default:Mu(t,e)}}function Pu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hu(e,t.alternate,t),t=t.sibling}function Fu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Sl(4,n,n.return),Fu(n,r);break;case 1:El(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&wl(n,n.return,i),Fu(n,r);break;case 27:r&2&&Sm(n.stateNode,n.type,n.memoizedProps);case 5:El(n,n.return),n.tag!==5&&n.tag!==27||kl(n),Fu(n,r);break;case 6:kl(n);break;case 26:El(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||iu||i.parentNode.removeChild(i),Fu(n,r);break;case 22:n.memoizedState===null&&Fu(n,r);break;case 30:El(n,n.return),Fu(n,r);break;case 7:El(n,n.return);default:Fu(n,r)}e=e.sibling}}function Iu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Iu(i,a,n),xl(4,a);break;case 1:if(Iu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){_f(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)bo(l[i],c)}catch(e){_f(r,r.return,e)}}s&&o&64&&Cl(a),Tl(a,a.return);break;case 27:n&2&&Rl(a);case 5:a.tag!==5&&a.tag!==27||Ol(a),Iu(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 6:Ol(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ru||Qm(Em(c.ownerDocument),a.type,c),Iu(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 12:Iu(i,a,n);break;case 31:Iu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Iu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Iu(i,a,n),Tl(a,a.return);break;case 30:Iu(i,a,n),Tl(a,a.return);break;case 7:Tl(a,a.return);default:Iu(i,a,n)}t=t.sibling}}function Lu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ka(n))}function Ru(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Bu(e,t,n,r),t=t.sibling;else i&&eu(t)}function Bu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&$l(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:zu(e,t,n,r),a&2048&&xl(9,t);break;case 1:zu(e,t,n,r);break;case 3:zu(e,t,n,r),i&&fu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ka(a)));break;case 12:if(a&2048){zu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){_f(t,t.return,e)}}else zu(e,t,n,r);break;case 31:case 13:zu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&$l(t),o._visibility&2?zu(e,t,n,r):(o._visibility|=2,Vu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&$l(s),o._visibility&2?zu(e,t,n,r):Hu(e,t)),a&2048&&Lu(s,t);break;case 24:zu(e,t,n,r),a&2048&&Ru(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Kl(a.child,!0),Kl(t.child,!0))),zu(e,t,n,r);break;default:zu(e,t,n,r)}}function Vu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Vu(a,o,s,c,i),xl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vu(a,o,s,c,i)):u._visibility&2?Vu(a,o,s,c,i):Hu(a,o),i&&l&2048&&Lu(o.alternate,o);break;case 24:Vu(a,o,s,c,i),i&&l&2048&&Ru(o.alternate,o);break;default:Vu(a,o,s,c,i)}t=t.sibling}}function Hu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Hu(n,r),i&2048&&Lu(r.alternate,r);break;case 24:Hu(n,r),i&2048&&Ru(r.alternate,r);break;default:Hu(n,r)}t=t.sibling}}var Uu=8192;function Wu(e,t,n){if(e.subtreeFlags&Uu)for(e=e.child;e!==null;)Gu(e,t,n),e=e.sibling}function Gu(e,t,n){switch(e.tag){case 26:Wu(e,t,n),e.flags&Uu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,Ou,e.memoizedState,e.memoizedProps));break;case 5:Wu(e,t,n),e.flags&Uu&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=Ou;Ou=Em(e.stateNode.containerInfo),Wu(e,t,n),Ou=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Uu,Uu=16777216,Wu(e,t,n),Uu=r):Wu(e,t,n));break;case 30:if((e.flags&Uu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Bl===null&&(Bl=new Map),Bl.set(r,i)}Wu(e,t,n);break;default:Wu(e,t,n)}}function Ku(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Xu(r,e)}Ku(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ju(e),e=e.sibling}function Ju(e){switch(e.tag){case 0:case 11:case 15:qu(e),e.flags&2048&&Sl(9,e,e.return);break;case 3:case 12:qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):qu(e);break;default:qu(e)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Xu(r,e)}Ku(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Sl(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function Xu(e,t){for(;cu!==null;){var n=cu;switch(n.tag){case 0:case 11:case 15:Sl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cu=r;else for(n=e;cu!==null;){r=cu;var i=r.sibling,a=r.return;if(vu(r),r===n){cu=null;break}if(i!==null){i.return=a,cu=i;break}cu=a}}}var Zu={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},Qu=typeof WeakMap==`function`?WeakMap:Map,$u=0,ed=null,td=null,nd=0,rd=0,id=null,ad=!1,od=!1,sd=!1,cd=0,ld=0,q=0,ud=0,dd=0,fd=0,pd=0,md=null,hd=null,gd=!1,_d=0,vd=0,yd=1/0,bd=null,xd=null,Sd=0,Cd=null,wd=null,Td=0,Ed=0,Dd=null,Od=null,kd=null,Ad=null,jd=null,Md=0,Nd=null;function Pd(){return $u&2&&nd!==0?nd&-nd:ce.T===null?pt():Rf()}function Fd(){if(fd===0){if(!(nd&536870912)||ea){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),fd=e}else fd=536870912}return e=Do.current,e!==null&&(e.flags|=32),fd}function Id(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(fi(e.memoizedProps,n))),Ad===null&&(Ad=[]),Ad.push(t.bind(null,r))}}function Ld(e,t,n){(e===ed&&(rd===2||rd===9)||e.cancelPendingCommit!==null)&&(Wd(e,0),Vd(e,nd,fd,!1)),ot(e,n),$u&2&&e===ed||(e===ed&&(!($u&2)&&(ud|=n),ld===4&&Vd(e,nd,fd,!1)),Af(e))}function Rd(e,t,n){if($u&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||U(e,t),a=r?Qd(e,t):Xd(e,t,!0),o=r;do{if(a===0){od&&!r&&Vd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Bd(n))a=Xd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;e:{var c=e;a=md;var l=c.current.memoizedState.isDehydrated;if(l&&(Wd(c,s).flags|=256),s=Xd(c,s,!1),s!==2&&s!==6){if(sd&&!l){c.errorRecoveryDisabledLanes|=o,ud|=o,a=4;break e}o=hd,hd=a,o!==null&&(hd===null?hd=o:hd.push.apply(hd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Wd(e,0),Vd(e,t,0,!0);break}e:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Vd(r,t,fd,!ad);break e;case 2:hd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=_d+300-Ie(),10<a)){if(Vd(r,t,fd,!ad),nt(r,0,!0)!==0)break e;Td=t,r.timeoutHandle=Sp(zd.bind(null,r,n,hd,bd,gd,t,fd,ud,pd,ad,o,`Throttled`,-0,0),a);break e}zd(r,n,hd,bd,gd,t,fd,ud,pd,ad,o,null,-0,0)}break}}while(1);Af(e)}function zd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pn},Bl=null,Gu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ch.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?_d-Ie():(a&4194048)===a?vd-Ie():0,m=oh(d,m),m!==null)?(Td=a,e.cancelPendingCommit=m(of.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Vd(e,a,o,!l)):of(e,t,a,n,r,i,o,s,c,l,u,d)}function Bd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ir(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Vd(e,t,n,r){t=rt(e,t),t&=~dd,t&=~ud,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ct(e,n,t)}function Hd(){return $u&6?!0:(jf(0,!1),!1)}function Ud(){if(td!==null){if(rd===0)var e=td.return;else e=td,pa=fa=null,rs(e),to=null,no=0,e=td;for(;e!==null;)bl(e.alternate,e),e=e.return;td=null}}function Wd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Cp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Td=0,Ud(),ed=e,td=n=ki(e.current,null),nd=t,rd=0,id=null,ad=!1,od=U(e,t),sd=!1,pd=fd=dd=ud=q=ld=0,hd=md=null,gd=!1,cd=rt(e,t),yi(),n}function Gd(e,t){zo=null,ce.H=pc,t===Ga||t===qa?(t=$a(),rd=3):t===Ka?(t=$a(),rd=4):rd=t===jc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,id=t,td===null&&(ld=1,Tc(e,Li(t,e.current)))}function Kd(){var e=Do.current;return e===null?!0:(nd&4194048)===nd?Oo===null:(nd&62914560)===nd||nd&536870912?e===Oo:!1}function qd(){var e=ce.H;return ce.H=pc,e===null?pc:e}function Jd(){var e=ce.A;return ce.A=Zu,e}function Yd(){ld=4,ad||(nd&4194048)!==nd&&Do.current!==null||(od=!0),!(q&0x7ffffff)&&!(ud&0x7ffffff)||ed===null||Vd(ed,nd,fd,!1)}function Xd(e,t,n){var r=$u;$u|=2;var i=qd(),a=Jd();(ed!==e||nd!==t)&&(bd=null,Wd(e,t)),t=!1;var o=ld;e:do try{if(rd!==0&&td!==null){var s=td,c=id;switch(rd){case 8:Ud(),o=6;break e;case 3:case 2:case 9:case 6:Do.current===null&&(t=!0);var l=rd;if(rd=0,id=null,nf(e,s,c,l),n&&od){o=0;break e}break;default:l=rd,rd=0,id=null,nf(e,s,c,l)}}Zd(),o=ld;break}catch(t){Gd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,$u=r,ce.H=i,ce.A=a,td===null&&(ed=null,nd=0,yi()),o}function Zd(){for(;td!==null;)ef(td)}function Qd(e,t){var n=$u;$u|=2;var r=qd(),a=Jd();ed!==e||nd!==t?(bd=null,yd=Ie()+500,Wd(e,t)):od=U(e,t);e:do try{if(rd!==0&&td!==null){t=td;var o=id;t:switch(rd){case 1:rd=0,id=null,nf(e,t,o,1);break;case 2:case 9:if(Ya(o)){rd=0,id=null,tf(t);break}t=function(){rd!==2&&rd!==9||ed!==e||(rd=7),Af(e)},o.then(t,t);break e;case 3:rd=7;break e;case 4:rd=5;break e;case 7:Ya(o)?(rd=0,id=null,tf(t)):(rd=0,id=null,nf(e,t,o,7));break;case 5:var s=null;switch(td.tag){case 26:s=td.memoizedState;case 5:case 27:var c=td;if(s?th(s):c.stateNode.complete){rd=0,id=null;var l=c.sibling;if(l!==null)td=l;else{var u=c.return;u===null?td=null:(td=u,rf(u))}break t}}rd=0,id=null,nf(e,t,o,5);break;case 6:rd=0,id=null,nf(e,t,o,6);break;case 8:Ud(),ld=6;break e;default:throw Error(i(462))}}$d();break}catch(t){Gd(e,t)}while(1);return pa=fa=null,ce.H=r,ce.A=a,$u=n,td===null?(ed=null,nd=0,yi(),ld):0}function $d(){for(;td!==null&&!Pe();)ef(td)}function ef(e){var t=dl(e.alternate,e,cd);e.memoizedProps=e.pendingProps,t===null?rf(e):td=t}function tf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Gc(n,t,t.pendingProps,t.type,void 0,nd);break;case 11:t=Gc(n,t,t.pendingProps,t.type.render,t.ref,nd);break;case 5:rs(t);var r=t;r===Qi&&(ea?(oa(r),r.tag===5&&r.stateNode!=null&&($i=r.stateNode)):(oa(r),ea=!0));default:bl(n,t),t=td=Ai(t,cd),t=dl(n,t,cd)}e.memoizedProps=e.pendingProps,t===null?rf(e):td=t}function nf(e,t,n,r){pa=fa=null,rs(t),to=null,no=0;var i=t.return;try{if(Ac(e,i,t,n,nd)){ld=1,Tc(e,Li(n,e.current)),td=null;return}}catch(t){if(i!==null)throw td=i,t;ld=1,Tc(e,Li(n,e.current)),td=null;return}t.flags&32768?(ea||r===1?e=!0:od||nd&536870912?e=!1:(ad=e=!0,(r===2||r===9||r===3||r===6)&&(r=Do.current,r!==null&&r.tag===13&&(r.flags|=16384))),af(t,e)):rf(t)}function rf(e){var t=e;do{if(t.flags&32768){af(t,ad);return}e=t.return;var n=vl(t.alternate,t,cd);if(n!==null){td=n;return}if(t=t.sibling,t!==null){td=t;return}td=t=e}while(t!==null);ld===0&&(ld=5)}function af(e,t){do{var n=yl(e.alternate,e);if(n!==null){n.flags&=32767,td=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){td=e;return}td=e=n}while(e!==null);ld=6,td=null}function of(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do mf();while(Sd!==0);if($u&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ed&&(td=ed=null,nd=0),wd=t,Cd=e,Td=n,Dd=a,Od=r,sf(e,t,n,s,c,l,f)}}function sf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ed=s,s|=vi,st(e,n,s,r,i,a),Ad=null,(n&335544064)===n?(jd=Ma(e),r=10262):(jd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Cf(Be,function(){return hf(),null})):(e.callbackNode=null,e.callbackPriority=0),zl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=ce.T,ce.T=null,i=le.p,le.p=2,a=$u,$u|=4;try{pu(e,t,n)}finally{$u=a,le.p=i,ce.T=r}}Sd=1,zl?kd=Rp(o,e.containerInfo,jd,uf,df,lf,ff,hf,cf,null,null):(uf(),df(),ff())}function cf(e){Sd!==0&&(0,Cd.onRecoverableError)(e,{componentStack:null})}function lf(){Sd===3&&(Sd=0,Nu(wd,Cd),Sd=4)}function uf(){if(Sd===1){Sd=0;var e=Cd,t=wd,n=Td,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=ce.T,ce.T=null;var i=le.p;le.p=2;var a=$u;$u|=4;try{uu=du=!1,ku(t,e,n),n=mp;var o=Hr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Vr(s.ownerDocument.documentElement,s)){if(c!==null&&Ur(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Br(s,h),v=Br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Sh=!!pp,mp=pp=null}finally{$u=a,le.p=i,ce.T=r}}e.current=t,Sd=2}}function df(){if(Sd===2){Sd=0;var e=Cd,t=wd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=ce.T,ce.T=null;var r=le.p;le.p=2;var i=$u;$u|=4;try{hu(e,t.alternate,t)}finally{$u=i,le.p=r,ce.T=n}}Sd=3}}function ff(){if(Sd===4||Sd===3){Sd=0;var e=kd;kd=null,Fe();var t=Cd,n=wd,r=Td,i=Od,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Sd=5:(Sd=0,wd=Cd=null,pf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(xd=null),ft(r),n=n.stateNode,Ke&&typeof Ke.onCommitFiberRoot==`function`)try{Ke.onCommitFiberRoot(Ge,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=ce.T,a=le.p,le.p=2,ce.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{ce.T=n,le.p=a}}if(i=Ad,o=jd,jd=null,i!==null&&(Ad=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Td&3&&mf(),Af(t),a=t.pendingLanes,r&261930&&a&42?t===Nd?Md++:(Md=0,Nd=t):(Md=0,Nd=null),jf(0,!1)}}function pf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function mf(){return kd!==null&&(kd.skipTransition(),kd=null),uf(),df(),ff(),hf()}function hf(){if(Sd!==5)return!1;var e=Cd,t=Ed;Ed=0;var n=ft(Td),r=ce.T,a=le.p;try{le.p=32>n?32:n,ce.T=null,n=Dd,Dd=null;var o=Cd,s=Td;if(Sd=0,wd=Cd=null,Td=0,$u&6)throw Error(i(331));var c=$u;if($u|=4,Ju(o.current),Bu(o,o.current,s,n),$u=c,jf(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{le.p=a,ce.T=r,pf(e,t)}}function gf(e,t,n){t=Li(n,t),t=Dc(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(ot(e,2),Af(e))}function _f(e,t,n){if(e.tag===3)gf(e,e,n);else for(;t!==null;){if(t.tag===3){gf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(xd===null||!xd.has(r))){e=Li(n,e),n=Oc(2),r=mo(t,n,2),r!==null&&(kc(n,r,t,e),ot(r,2),Af(r));break}}t=t.return}}function vf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(sd=!0,i.add(n),e=yf.bind(null,e,t,n),t.then(e,e))}function yf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ed===e&&(nd&n)===n&&(ld===4||ld===3&&(nd&62914560)===nd&&300>Ie()-_d?$u&2?dd|=n:Wd(e,0):dd|=n,pd===nd&&(pd=0)),Af(e)}function bf(e,t){t===0&&(t=W()),e=Si(e,t),e!==null&&(ot(e,t),Af(e))}function xf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bf(e,n)}function Sf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),bf(e,n)}function Cf(e,t){return Me(e,t)}var wf=null,Tf=null,Ef=!1,Df=!1,Of=!1,kf=0;function Af(e){e!==Tf&&e.next===null&&(Tf===null?wf=Tf=e:Tf=Tf.next=e),Df=!0,Ef||(Ef=!0,Lf())}function jf(e,t){if(!Of&&Df){Of=!0;do for(var n=!1,r=wf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Je(42|e)+1)-1,a&=i&~(o&~s),a=a&0xc000095?a&0xc000095|1:a?a|2:0}a!==0&&(n=!0,If(r,a))}else a=nd,a=nt(r,r===ed?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||U(r,a)||(n=!0,If(r,a))}r=r.next}while(n);Of=!1}}function Mf(){Nf()}function Nf(){Df=Ef=!1;var e=0;kf!==0&&xp()&&(e=kf);for(var t=Ie(),n=null,r=wf;r!==null;){var i=r.next,a=Pf(r,t);a===0?(r.next=null,n===null?wf=i:n.next=i,i===null&&(Tf=n)):(n=r,(e!==0||a&3)&&(Df=!0)),r=i}Sd!==0&&Sd!==5||jf(e,!1),kf!==0&&(kf=0)}function Pf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ed,n=nd,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(rd===2||rd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ne(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||U(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ne(r),ft(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=Ff.bind(null,e),n=Me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ne(r),e.callbackPriority=2,e.callbackNode=null,2}function Ff(e,t){if(Sd!==0&&Sd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(mf()&&e.callbackNode!==n)return null;var r=nd;return r=nt(e,e===ed?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Rd(e,r,t),Pf(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?Ff.bind(null,e):null)}function If(e,t){if(mf())return null;Rd(e,t,!0)}function Lf(){Ep(function(){$u&6?Me(Re,Mf):Nf()})}function Rf(){if(kf===0){var e=Fa;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),kf=e}return kf}function zf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:fn(e)}function Bf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=zf((i[_t]||null).action),o=r.submitter;o&&(t=(t=o[_t]||null)?zf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Pn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(kf!==0){var e=new FormData(i,o);$s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),$s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Vf=0;Vf<li.length;Vf++){var Hf=li[Vf];ui(Hf.toLowerCase(),`on`+(Hf[0].toUpperCase()+Hf.slice(1)))}ui(ti,`onAnimationEnd`),ui(ni,`onAnimationIteration`),ui(ri,`onAnimationStart`),ui(`dblclick`,`onDoubleClick`),ui(`focusin`,`onFocus`),ui(`focusout`,`onBlur`),ui(ii,`onTransitionRun`),ui(ai,`onTransitionStart`),ui(oi,`onTransitionCancel`),ui(si,`onTransitionEnd`),Ft(`onMouseEnter`,[`mouseout`,`mouseover`]),Ft(`onMouseLeave`,[`mouseout`,`mouseover`]),Ft(`onPointerEnter`,[`pointerout`,`pointerover`]),Ft(`onPointerLeave`,[`pointerout`,`pointerover`]),Pt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Pt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Pt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Pt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Uf=`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(` `),Wf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Uf));function Gf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=l;try{a(i)}catch(e){hi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=l;try{a(i)}catch(e){hi(e)}i.currentTarget=null,a=c}}}}function Kf(e,t){var n=t[yt];n===void 0&&(n=t[yt]=new Set);var r=e+`__bubble`;n.has(r)||(Xf(t,e,2,!1),n.add(r))}function qf(e,t,n){var r=0;t&&(r|=4),Xf(n,e,r,t)}var Jf=`_reactListening`+Math.random().toString(36).slice(2);function Yf(e){if(!e[Jf]){e[Jf]=!0,Mt.forEach(function(t){t!==`selectionchange`&&(Wf.has(t)||qf(t,!1,e),qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jf]||(t[Jf]=!0,qf(`selectionchange`,!1,t))}}function Xf(e,t,n,r){switch(kh(t)){case 2:var i=Ch;break;case 8:i=wh;break;default:i=Th}n=i.bind(null,t,n,e),i=void 0,!Cn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Zf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Et(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue e}c=c.parentNode}}r=r.return}bn(function(){var r=a,i=hn(n),s=[];e:{var c=ci.get(e);if(c!==void 0){var l=Pn,u=e;switch(e){case`keypress`:if(kn(n)===0)break e;case`keydown`:case`keyup`:l=Qn;break;case`focusin`:u=`focus`,l=Un;break;case`focusout`:u=`blur`,l=Un;break;case`beforeblur`:case`afterblur`:l=Un;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`:l=Vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=tr;break;case ti:case ni:case ri:l=Wn;break;case si:l=nr;break;case`scroll`:case`scrollend`:l=In;break;case`wheel`:l=rr;break;case`copy`:case`cut`:case`paste`:l=Gn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=$n;break;case`submit`:l=er;break;case`toggle`:case`beforetoggle`:l=ir}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=xn(m,p),g!=null&&d.push(Qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){e:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==mn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[vt]))break e;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Et(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Vn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=$n,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ot(c),h=l==null?u:Ot(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,ep):null,c!==null&&tp(s,u,c,d,!1),l!==null&&f!==null&&tp(s,f,l,d,!0)))}e:{if(c=r?Ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=wr;else if(vr(c)){if(Tr)_=Pr;else{_=Mr;var v=jr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&ln(r.elementType)&&(_=wr):_=Nr;if(_&&=_(e,r)){yr(s,_,n,i);break e}v&&v(e,c,r)}switch(v=r?Ot(r):window,e){case`focusin`:(vr(v)||v.contentEditable===`true`)&&(Gr=v,Kr=r,qr=null);break;case`focusout`:qr=Kr=Gr=null;break;case`mousedown`:Jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Jr=!1,Yr(s,n,i);break;case`selectionchange`:if(Wr)break;case`keydown`:case`keyup`:Yr(s,n,i)}var y;if(or)e:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break e;case`compositionend`:b=`onCompositionEnd`;break e;case`compositionupdate`:b=`onCompositionUpdate`;break e}b=void 0}else mr?fr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(lr&&n.locale!==`ko`&&(mr||b!==`onCompositionStart`?b===`onCompositionEnd`&&mr&&(y=On()):(Tn=i,En=`value`in Tn?Tn.value:Tn.textContent,mr=!0)),v=$f(r,b),0<v.length&&(b=new Kn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=pr(n),y!==null&&(b.data=y)))),(y=cr?hr(e,n):gr(e,n))&&(b=$f(r,`onBeforeInput`),0<b.length&&(v=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Bf(s,e,r,n,i)}Gf(s,t)})}function Qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $f(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=xn(e,n),i!=null&&r.unshift(Qf(e,i,a)),i=xn(e,t),i!=null&&r.push(Qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ep(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=xn(n,a),l!=null&&o.unshift(Qf(n,l,c))):i||(l=xn(n,a),l!=null&&o.push(Qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var np=/\r\n?/g,rp=/\u0000|\uFFFD/g;function ip(e){return(typeof e==`string`?e:``+e).replace(np,`
|
|
10
|
+
`).replace(rp,``)}function ap(e,t){return t=ip(t),ip(e)===t}function op(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||an(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&an(e,``+r);else return;break;case`className`:Ut(e,`class`,r);break;case`tabIndex`:Ut(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ut(e,n,r);break;case`style`:cn(e,r,o);return;case`data`:if(t!==`object`){Ut(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&op(e,t,`name`,a.name,a,null),op(e,t,`formEncType`,a.formEncType,a,null),op(e,t,`formMethod`,a.formMethod,a,null),op(e,t,`formTarget`,a.formTarget,a,null)):(op(e,t,`encType`,a.encType,a,null),op(e,t,`method`,a.method,a,null),op(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=pn);return;case`onScroll`:r!=null&&Kf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Kf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=fn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Kf(`beforetoggle`,e),Kf(`toggle`,e),Ht(e,`popover`,r);break;case`xlinkActuate`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ht(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=un.get(n)||n,Ht(e,n,r);else return}Bt=!0}function sp(e,t,n,r,a,o){switch(n){case`style`:cn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)an(e,r);else if(typeof r==`number`||typeof r==`bigint`)an(e,``+r);else return;break;case`onScroll`:r!=null&&Kf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Kf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=pn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:case`innerText`:case`textContent`:return;default:if(!Nt.hasOwnProperty(n))e:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[_t]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break e}Bt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ht(e,n,r)}return}Bt=!0}function cp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Kf(`error`,e),Kf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:op(e,t,o,s,n,null)}}a&&op(e,t,`srcSet`,n.srcSet,n,null),r&&op(e,t,`src`,n.src,n,null);return;case`input`:Kf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:op(e,t,r,d,n,null)}}$t(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Kf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:op(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&tn(e,!!r,n,!0):tn(e,!!r,t,!1);return;case`textarea`:for(s in Kf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:op(e,t,s,c,n,null)}rn(e,r,a,o);return;case`option`:for(l in n)n.hasOwnProperty(l)&&(r=n[l],r!=null)&&(l===`selected`?e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`:op(e,t,l,r,n,null));return;case`dialog`:Kf(`beforetoggle`,e),Kf(`toggle`,e),Kf(`cancel`,e),Kf(`close`,e);break;case`iframe`:case`object`:Kf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Uf.length;r++)Kf(Uf[r],e);break;case`image`:Kf(`error`,e),Kf(`load`,e);break;case`details`:Kf(`toggle`,e);break;case`embed`:case`source`:case`link`:Kf(`error`,e),Kf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:op(e,t,u,r,n,null)}return;default:if(ln(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&sp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&op(e,t,c,r,n,null))}var lp={};function up(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||op(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Bt=!0),o=m;break;case`name`:m!==f&&(Bt=!0),a=m;break;case`checked`:m!==f&&(Bt=!0),u=m;break;case`defaultChecked`:m!==f&&(Bt=!0),d=m;break;case`value`:m!==f&&(Bt=!0),s=m;break;case`defaultValue`:m!==f&&(Bt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&op(e,t,p,m,r,f)}}Qt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||op(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Bt=!0),p=o;break;case`defaultValue`:o!==l&&(Bt=!0),c=o;break;case`multiple`:o!==l&&(Bt=!0),s=o;default:o!==l&&op(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?tn(e,!!n,n?[]:``,!1):tn(e,!!n,t,!0)):tn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:case`children`:break;default:op(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Bt=!0),p=a;break;case`defaultValue`:a!==o&&(Bt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&op(e,t,s,a,r,o)}nn(e,p,m);return;case`option`:for(var h in n)p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h)&&(h===`selected`?e.selected=!1:op(e,t,h,null,r,p));for(l in r)p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null)&&(l===`selected`?(p!==m&&(Bt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`):op(e,t,l,p,r,m));return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&op(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:op(e,t,u,p,r,m)}return;default:if(ln(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&sp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||sp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&op(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||op(e,t,f,p,r,m)}function dp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function fp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&dp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&dp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var pp=null,mp=null;function hp(e){return e.nodeType===9?e:e.ownerDocument}function gp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function _p(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function vp(e,t,n,r){return n=hp(n).createElement(e),n[gt]=r,n[_t]=t,cp(n,e,t),At(n),n}function yp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bp=null;function xp(){var e=window.event;return e&&e.type===`popstate`?e!==bp&&(bp=e,!0):(bp=null,!1)}var Sp=typeof setTimeout==`function`?setTimeout:void 0,Cp=typeof clearTimeout==`function`?clearTimeout:void 0,wp=typeof Promise==`function`?Promise:void 0,Tp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Sp,Ep=typeof queueMicrotask==`function`?queueMicrotask:wp===void 0?Sp:function(e){return wp.resolve(null).then(e).catch(Dp)};function Dp(e){setTimeout(function(){throw e})}function Op(e){return e===`head`}function kp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cm(e.ownerDocument.body)}n=i}while(n);qh(t)}function Ap(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function jp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Mp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Np(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Pp(e){return Np(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Np(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ip(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=nh(f),u>ah){s.length=o;break}f=new Promise(Lp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Kp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=b(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=hp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,bm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Vp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Jp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=Et(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)e:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break e}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;e:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break e}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function rm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Jp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),rm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),rm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=b(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cm(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ym(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function bm(e){Tp(function(){Tp(function(t){return e(t)})})}function xm(e,t,n){switch(t=hp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&op(e,t,r,null,lp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===pn&&(e.onclick=null),Tt(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var wm=new Map,Tm=new Set;function Em(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Dm=le.d;le.d={f:Om,r:km,D:Mm,C:Nm,L:Pm,m:Fm,X:Lm,S:Im,M:Rm};function Om(){var e=Dm.f(),t=Hd();return e||t}function km(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?tc(t):Dm.r(e)}var Am=typeof document>`u`?null:document;function jm(e,t,n){var r=Am;if(r&&typeof t==`string`&&t){var i=Zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tm.has(i)||(Tm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),cp(t,`link`,e),At(t),r.head.appendChild(t)))}}function Mm(e){Dm.D(e),jm(`dns-prefetch`,e,null)}function Nm(e,t){Dm.C(e,t),jm(`preconnect`,e,t)}function Pm(e,t,n){Dm.L(e,t,n);var r=Am;if(r&&e&&t){var i=`link[rel="preload"][as="`+Zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Zt(n.imageSizes)+`"]`)):i+=`[href="`+Zt(e)+`"]`;var a=i;switch(t){case`style`:a=Bm(e);break;case`script`:a=Wm(e)}if(!(wm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vm(a))||t===`script`&&r.querySelector(Gm(a))))){var o=r.createElement(`link`);cp(o,`link`,e),t===`style`&&(o[wt]=!0,o.onload=o.onerror=function(){jt(o)}),At(o),r.head.appendChild(o)}}}function Fm(e,t){Dm.m(e,t);var n=Am;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Zt(r)+`"][href="`+Zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wm(e)}if(!wm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),wm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gm(a)))return}r=n.createElement(`link`),cp(r,`link`,e),At(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=kt(r).hoistableStyles,a=Bm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wm.get(a))&&Jm(e,n);var c=o=r.createElement(`link`);At(c),cp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lm(e,t){Dm.X(e,t);var n=Am;if(n&&e){var r=kt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=D({src:e,async:!0},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),At(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t){Dm.M(e,t);var n=Am;if(n&&e){var r=kt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),At(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t,n,r){var a=(a=ve.current)?Em(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Bm(n.href),t=kt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bm(n.href);var o=kt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=wm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wm.set(e,o)),Um(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Wm(n),t=kt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bm(e){return`href="`+Zt(e)+`"`}function Vm(e){return`link[rel="stylesheet"][`+e+`]`}function Hm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Um(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[wt]){r.loading=1;return}}else t=e.createElement(`link`),t[wt]=!0,t.onload=t.onerror=jt.bind(null,t),cp(t,`link`,n),At(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Wm(e){return`[src="`+Zt(e)+`"]`}function Gm(e){return`script[async]`+e}function Km(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Zt(n.href)+`"]`);if(r)return t.instance=r,At(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),At(r),cp(r,`style`,a),qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bm(n.href);var o=e.querySelector(Vm(a));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Hm(n),(a=wm.get(a))&&Jm(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),cp(o,`link`,r),t.state.loading|=4,qm(o,n.precedence,e),t.instance=o;case`script`:return o=Wm(n.src),(a=e.querySelector(Gm(o)))?(t.instance=a,At(a),a):(r=n,(a=wm.get(o))&&(r=D({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),cp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qm(r,n.precedence,e));return t.instance}function qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xm=null;function Zm(e,t,n){if(Xm===null){var r=new Map,i=Xm=new Map;i.set(n,r)}else i=Xm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ct]||a[gt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $m(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;return t.rel!==`stylesheet`||(e=t.disabled,typeof t.precedence==`string`&&e==null);case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function eh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function th(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function nh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function rh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=nh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ih(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bm(r.href),a=t.querySelector(Vm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),cp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ch.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ah=0;function oh(e,t){return e.stylesheets&&e.count===0&&dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ah===0&&(ah=62500*fp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ch(){this.count--,sh(this)}function lh(){this.imgCount--,sh(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=new Map,t.forEach(fh,e),uh=null,ch.call(e))}function fh(e,t){if(!(t.state.loading&4)){var n=uh.get(e);if(n)var r=n.get(null);else{n=new Map,uh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ch.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ph={$$typeof:F,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function mh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function hh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new mh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Di(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function gh(e){return e?(e=Ti,e):Ti}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Ld(n,e,t),ho(n,e,t))}function vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yh(e,t){vh(e,t),(e=e.alternate)&&vh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Si(e,67108864);t!==null&&Ld(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Pd();t=dt(t);var n=Si(e,t);n!==null&&Ld(n,e,t),yh(e,t)}}var Sh=!0;function Ch(e,t,n,r){var i=ce.T;ce.T=null;var a=le.p;try{le.p=2,Th(e,t,n,r)}finally{le.p=a,ce.T=i}}function wh(e,t,n,r){var i=ce.T;ce.T=null;var a=le.p;try{le.p=8,Th(e,t,n,r)}finally{le.p=a,ce.T=i}}function Th(e,t,n,r){if(Sh){var i=Eh(r);if(i===null)Zf(e,t,r,Dh,n),Lh(e,r);else if(zh(i,e,t,n,r))r.stopPropagation();else if(Lh(e,r),t&4&&-1<Ih.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}Af(a),!($u&6)&&(yd=Ie()+500,jf(0,!1))}}break;case 31:case 13:s=Si(a,2),s!==null&&Ld(s,a,2),Hd(),yh(a,2)}if(a=Eh(r),a===null&&Zf(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Zf(e,t,r,null,n)}}function Eh(e){return e=hn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=Et(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dh=e,null}function kh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,J=null,Mh=null,Nh=new Map,Ph=new Map,Fh=[],Ih=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Lh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:J=null;break;case`mouseover`:case`mouseout`:Mh=null;break;case`pointerover`:case`pointerout`:Nh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ph.delete(t.pointerId)}}function Rh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Dt(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zh(e,t,n,r,i){switch(t){case`focusin`:return jh=Rh(jh,e,t,n,r,i),!0;case`dragenter`:return J=Rh(J,e,t,n,r,i),!0;case`mouseover`:return Mh=Rh(Mh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Nh.set(a,Rh(Nh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ph.set(a,Rh(Ph.get(a)||null,e,t,n,r,i)),!0}return!1}function Bh(e){var t=Et(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,mt(e.priority,function(){xh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,mt(e.priority,function(){xh(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 Vh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mn=r,n.target.dispatchEvent(r),mn=null}else return t=Dt(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Hh(e,t,n){Vh(e)&&n.delete(t)}function Uh(){Ah=!1,jh!==null&&Vh(jh)&&(jh=null),J!==null&&Vh(J)&&(J=null),Mh!==null&&Vh(Mh)&&(Mh=null),Nh.forEach(Hh),Ph.forEach(Hh)}function Wh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Uh)))}var Gh=null;function Kh(e){Gh!==e&&(Gh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gh===e&&(Gh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Oh(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,$s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qh(e){function t(t){return Wh(t,e)}jh!==null&&Wh(jh,e),J!==null&&Wh(J,e),Mh!==null&&Wh(Mh,e),Nh.forEach(t),Ph.forEach(t);for(var n=0;n<Fh.length;n++){var r=Fh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fh.length&&(n=Fh[0],n.blockedOn===null);)Bh(n),n.blockedOn===null&&Fh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[_t]||null;if(typeof a==`function`)o||Kh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kh(n)}}}function Jh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Yh(e){this._internalRoot=e}Xh.prototype.render=Yh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));_h(t.current,Pd(),e,t,null,null)},Xh.prototype.unmount=Yh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Hd(),t[vt]=null}};function Xh(e){this._internalRoot=e}Xh.prototype.unstable_scheduleHydration=function(e){if(e){var t=pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fh.length&&t!==0&&t<Fh[n].priority;n++);Fh.splice(n,0,e),n===0&&Bh(e)}};var Zh=n.version;if(Zh!==`19.3.1`)throw Error(i(527,Zh,`19.3.1`));le.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:ce,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$h.isDisabled&&$h.supportsFiber)try{Ge=$h.inject(Qh),Ke=$h}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Sc,s=Cc,c=wc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=hh(e,1,!1,null,null,n,r,null,o,s,c,Jh),e[vt]=t.current,Yf(e),new Yh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),y=o(((e,t)=>{t.exports=v()})),b=l(d(),1),x=y(),S=b.createContext(void 0),C=e=>{let t=b.useContext(S);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},w=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,x.jsx)(S.Provider,{value:e,children:t})),T={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},E=new class{#e=T;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function D(e){setTimeout(e,0)}var O=typeof window>`u`||`Deno`in globalThis;function k(){}function A(e,t){return typeof e==`function`?e(t):e}function j(e){return typeof e==`number`&&e>=0&&e!==1/0}function M(e,t){return Math.max(e+(t||0)-Date.now(),0)}function N(e,t){return typeof e==`function`?e(t):e}function P(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==I(o,t.options))return!1}else if(!R(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function F(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(L(t.options.mutationKey)!==L(a))return!1}else if(!R(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function I(e,t){return(t?.queryKeyHashFn||L)(e)}function L(e){return JSON.stringify(e,(e,t)=>te(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function R(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!R(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!R(e[r],t[r]))return!1;return!0}return!1}var z=Object.prototype.hasOwnProperty;function B(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=V(e)&&V(t);if(!r&&!(te(e)&&te(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:z.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=B(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ee(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!z.call(t,n)||e[n]!==t[n])return!1;return!0}function V(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function te(e){if(!ne(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!ne(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function ne(e){return Object.prototype.toString.call(e)===`[object Object]`}function re(e){return new Promise(t=>{E.setTimeout(t,e)})}function ie(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:B(e,t)}function ae(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function oe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var se=Symbol();function H(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===se?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ce(e,t){return typeof e==`function`?e(...t):!!e}var le=Symbol();function ue(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[le]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var de=()=>O,fe=()=>de(),pe=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},me=new class extends pe{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},he=D;function ge(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=he,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var _e=ge(),ve=new class extends pe{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ye(e){return Math.min(1e3*2**e,3e4)}function be(e){return(e??`online`)!==`online`||ve.isOnline()}var xe=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Se(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(k);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new xe(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>me.isFocused()&&(e.networkMode===`always`||ve.isOnline())&&e.canRun(),p=()=>be(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(fe()?0:3),a=e.retryDelay??ye,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),re(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}function Ce(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{ue(e,()=>t.signal,()=>n=!0,l[le])},d=H(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options,c=i?oe:ae;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Te:we,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:we(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function we(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Te(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ee=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),j(this.gcTime)&&(this.#e=E.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fe()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(E.clearTimeout(this.#e),this.#e=void 0)}},De=class extends Ee{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ae(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ae(this.options);e.data!==void 0&&(this.setState(ke(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ie(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(k).catch(k):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>N(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===se||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>N(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!M(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[le]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=H(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ce(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Se({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof xe&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof xe){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Oe(t.data,this.options),fetchMeta:e.meta??null};case`success`:{let n={...t,...ke(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n}case`error`:{let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:`idle`,status:`error`,isInvalidated:!0}}case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),_e.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Oe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:be(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ke(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ae(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var je=class extends pe{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ne(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Pe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Pe(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof N(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ee(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Fe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||N(this.options.enabled,this.#t)!==N(t.enabled,this.#t)||N(this.options.staleTime,this.#t)!==N(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||N(this.options.enabled,this.#t)!==N(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ee(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(k)),t}#h(e){return!fe()&&N(this.options.enabled,this.#t)!==!1&&j(e)}#g(){this.#b();let e=N(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=M(this.#r.dataUpdatedAt,e)+1;this.#u=E.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return N(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=E.setInterval(()=>{(this.options.refetchIntervalInBackground||me.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(E.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(E.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ne(e,t),o=i&&Fe(e,n,t,r);(a||o)&&(l={...l,...Oe(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ie(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ie(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=i?.error===f?i.errorUpdatedAt:Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ie(e,t),refetch:this.refetch,isEnabled:N(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),ee(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();_e.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Me(e,t){return N(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||N(t.retryOnMount,e)!==!1)}function Ne(e,t){return Me(e,t)||e.state.data!==void 0&&Pe(e,t,t.refetchOnMount)}function Pe(e,t,n){if(N(t.enabled,e)!==!1&&N(t.staleTime,e)!==`static`){let r=N(n,e);return r===`always`||r!==!1&&Ie(e,t)}return!1}function Fe(e,t,n,r){return(e!==t||N(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ie(e,n)}function Ie(e,t){return N(t.enabled,e)!==!1&&e.isStaleByTime(N(t.staleTime,e))}var Le=class extends Ee{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Re(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Se({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),_e.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Re(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ze=class extends pe{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Le({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Be(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Be(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Be(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Be(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_e.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>F(t,e))}findAll(e={}){return this.getAll().filter(t=>F(e,t))}notify(e){_e.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _e.batch(()=>Promise.all(e.map(e=>e.continue().catch(k))))}};function Be(e){return e.options.scope?.id}var Ve=class extends pe{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ee(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&L(t.mutationKey)!==L(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Re();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){_e.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},He=class extends pe{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??I(r,t),a=this.get(i);return a||(a=new De({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){_e.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>P(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>P(e,t)):t}notify(e){_e.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_e.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_e.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ue=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new He,this.#t=e.mutationCache||new ze,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=me.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ve.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(N(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=A(t,this.#e.get(r.queryHash)?.state.data);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return _e.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;_e.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _e.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=_e.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(k).catch(k)}invalidateQueries(e,t={}){return _e.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=_e.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(k)),r?Promise.resolve():t}));return Promise.all(r).then(k)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(N(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(N(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(k).catch(k)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(k).catch(k)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ve.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(L(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{R(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(L(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{R(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=I(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===se&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function We({streamFn:e,refetchMode:t=`reset`,reducer:n=(e,t)=>ae(e,t),initialValue:r=[]}){return async i=>{let a=i[le];if(a?.aborted)return r;let o=i.client.getQueryCache().find({queryKey:i.queryKey,exact:!0}),s=!!o&&o.isFetched();s&&t===`reset`&&o.setState({...o.resetState,fetchStatus:`fetching`});let c=r,l=!1,u=ue({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>l=!0,a),d=()=>l||a?.aborted===!0,f=await e(u),p=s&&t===`replace`;for await(let e of f){if(d())break;p?c=n(c,e):i.client.setQueryData(i.queryKey,t=>n(t===void 0?r:t,e))}p&&!d()&&i.client.setQueryData(i.queryKey,c);let m=i.client.getQueryData(i.queryKey);return m===void 0?r:m}}var Ge=b.createContext(!1),Ke=()=>b.useContext(Ge);Ge.Provider;function qe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Je=b.createContext(qe()),Ye=()=>b.useContext(Je),Xe=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?ce(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ze=e=>{b.useEffect(()=>{e.clearReset()},[e])},Qe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ce(n,[e.error,r])),$e=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},et=(e,t)=>e?.suspense&&t.isPending,tt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function nt(e,t,n){let r=Ke(),i=Ye(),a=C(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,$e(o),Xe(o,i,s),Ze(i);let[l]=b.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);b.useEffect(()=>{l.setOptions(o)},[o,l]);let d=!r&&c;if(b.useSyncExternalStore(b.useCallback(e=>{let t=d?l.subscribe(_e.batchCalls(e)):k;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),et(o,u))throw tt(o,l,i);if(Qe({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function U(e,t){return nt(e,je,t)}function rt(e){return e}function it(e){return e}function W(e,t){let n=C(t),[r]=b.useState(()=>new Ve(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);let i=b.useSyncExternalStore(b.useCallback(e=>r.subscribe(_e.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=b.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(k)},[r]);if(i.error&&ce(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var at=b.useLayoutEffect;function ot(e){return e[e.length-1]}function st(e,t){return typeof e==`function`?e(t):e}var ct=Object.prototype.hasOwnProperty;function lt(e){for(let t in e)if(ct.call(e,t))return!0;return!1}var ut=()=>Object.create(null),dt=(e,t)=>ft(e,t,!0);function ft(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(pt(e)&&pt(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&ot(a)!==`${o-1}`||c&&ot(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?ft(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?ft(d,o,n,r):o,i&&=u===d&&(a[l]===f||ct.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?ut():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?ft(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function pt(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function mt(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!mt(a,o,n,r))return!1}return!0}if(pt(e)&&pt(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!mt(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!mt(e[a],t[a],n,r)))return!1;return i===0}return!1}var ht=/[\x00-\x1f\x7f"<>`{}]/g;function gt(e){return e.replace(ht,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function _t(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return gt(t)}var vt=[`http:`,`https:`,`mailto:`,`tel:`];function yt(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var bt=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function xt(e,t){if(!e)return!1;if(bt.test(e))return!0;let n=yt(e);return n?!t.has(n):!1}function St(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=_t(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=_t(r?e.slice(r):e)}return t}function Ct(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function wt(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 Tt(){throw Error(`Invariant failed`)}function Et(e){return e.replace(/\/{2,}/g,`/`)}function Dt(e){return e===`/`?e:e.replace(/^\/+/,``)}function Ot(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function kt(e){return Ot(Dt(e))}function At(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function jt(e,t,n=`never`,r){if(t.includes(`//`)&&(t=Et(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=Et(e)),o=e.split(`/`);o.length>1&&ot(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(ot(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Et(s):s)||`/`;return a&&r&&r.set(a,c),c}function Mt(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function Nt(e){return e==null||e===``}function Pt(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function Ft(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&Nt(f)){if(c===`/`&&!d)continue;f=``}o+=c+Pt(s,f,r)+(d||``)}}return o+a||`/`}function It(e){return e?.isNotFound===!0}function Lt(){try{return sessionStorage}catch{return}}var Rt=`tsr-scroll-restoration-v1_3`,zt=Lt();function Bt(){try{return JSON.parse(zt?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var Vt=Bt(),Ht=`data-scroll-restoration-id`,Ut=e=>e.state.__TSR_key||e.href;function Wt(e){let t=e.getAttribute(Ht);if(t)return`[${Ht}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Gt=!1,Kt=`window`;function qt(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Jt(e){let t=new Set;for(let n of e){if(n===Kt)continue;let e=qt(n);e&&t.add(e)}return t}function Yt(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Ut,a=new Set,o=e=>{let t=Vt[e]||={};for(let e of a)e===document?t[Kt]={scrollX,scrollY}:e.isConnected&&(t[Wt(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Gt=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Gt||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{zt?.setItem(Rt,JSON.stringify(Vt))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),r.r||(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=Vt[d];if(e){let t=Vt[u];for(let n in e){if(n===Kt){if(s)continue}else{let e=qt(n);if(!e||s&&o&&(l??=Jt(o),l.has(e)))continue}t||=Vt[u]={},t[n]??=e[n]}}}Gt=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Jt(o));let t=e&&i&&c,s=r.e?Vt[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Kt){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=qt(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Gt=!1}}))}function Xt(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function Zt(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Qt(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Zt(r):Array.isArray(t)?t.push(Zt(r)):n[e]=[t,Zt(r)]}return n}var $t=/^(?:\s|["[{\d-]|fa|nu|tr)/,en=nn(JSON.parse),tn=rn(JSON.stringify,JSON.parse);function nn(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=Qt(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!$t.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function rn(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!$t.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Xt(e,r);return t?`?${t}`:``}}var an=`__root__`;function on(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function sn(e){return e instanceof Response&&!!e.options}function cn(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var ln=4,un=5;function dn(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function fn(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function pn(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,m=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=ot(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],m=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=fn(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=hn(r);c=n,t.set(e,n)}}else{let t=a[0],h=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&m<n&&(m<e-1&&p.push(s.slice(m,e-1)),a[2]=`/`+h,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),m=n),!r)continue;let _=d&&!!(h||g);d||(h=h.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=hn(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m<u&&p.push(s.slice(m,u));let h=p?.slice();if(!r)return h;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=hn(r,un);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=hn(r,ln);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=h,g&&(r.route=t)),[r,o,h]}function mn(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;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 hn(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function gn(e,t){let n=hn(),r=[];function i(e,t,n,a){let[o,s,c]=pn(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(mn);t.masksTree=n,t.flatCache=cn(1e3)}function _n(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=xn(e,t.masksTree);return t.flatCache.set(e,r),r}function vn(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=hn(),pn(t,{from:e},1,o),i.singleCache.set(a,o)),xn(r,o,n)}function yn(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=xn(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Cn(a.route)),t.matchCache.set(r,a),a}function bn(e,t=!1){let n=hn(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&Tt(),i[e.id]=e,o!==0&&e.path){let t=Ot(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=pn(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(mn);return{processedTree:{segmentTree:n,singleCache:cn(1e3),matchCache:cn(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function xn(e,t,n=!1){let r=e.split(`/`),i=Tn(e,r,t,n);if(!i)return null;let[a]=Sn(e,r,i);return{route:i.node.route,rawParams:a}}function Sn(e,t,n){let r=wn(n.node),i=n.node.data&&dn(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===ln)break;if(u.kind===un){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function Cn(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function wn(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Tn(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!ot(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!kn(l,n))continue;if(i.parse){if(!On(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==ln&&kn(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===ln||i.kind===2)&&kn(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(On(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Dn(f,o))return n;kn(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+En(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+En(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+En(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+En(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function En(e,t){return 2**(e-t-1)}function Dn(e,t){return e===2**(t-1)-1}function On(e,t,n){let r,i;try{[r,i]=Sn(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function kn(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===ln)>(e.node.kind===ln)||t.node.kind===ln==(e.node.kind===ln)&&t.node.depth>e.node.depth)))}function An(e,t,n){let r=kt(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=Et(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>jn(n,s.input({url:e})),output:({url:e})=>s.output({url:Mn(n,e)})}:s}function jn(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Mn(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Nn(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{wt(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var Pn=`__TSR_index`,Fn=`popstate`,In=`beforeunload`,Ln=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function Rn(e){let t=Ln.exec(e);return t?`/`+e.slice(t[0].length):e}function zn(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
11
|
+
\r`.includes(e)?``:encodeURIComponent(e))),Rn(e)}function Bn(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=Un(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{i=Vn(t.state[Pn]+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{i=Vn(t.state[Pn],i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Pn]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function Vn(e,t){let n=Wn();return{...t,key:n,__TSR_key:n,[Pn]:e}}function Hn(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>zn(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>Un(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Wn();t.history.replaceState({[Pn]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=Un(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[Pn]-l.state[Pn],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Bn({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(In,x,{capture:!0}),t.removeEventListener(Fn,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(In,x,{capture:!0}),t.addEventListener(Fn,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function Un(e,t){let n=zn(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=Wn();t={[Pn]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function Wn(){return(Math.random()+1).toString(36).slice(7)}function Gn(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function Kn(e){return e.pathname+e.search+e.hash}function qn(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Jn(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Yn({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Xn(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Zn(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Qn=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Hn()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&kt(n)?An(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Nn(this.latestLocation,e),Yt(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=bn(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&gn(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:cn(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:St(e),external:!1,searchStr:o,search:dt(t?.search,i),hash:St(r.slice(1)),state:ft(t?.state,a)}}let o=jn(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:St(Rn(o.pathname)),external:!!this.rewrite&&Gn(o,this.origin),searchStr:c,search:dt(t?.search,s),hash:St(o.hash.slice(1)),state:ft(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=yn(Ot(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=Un(n.href,{});n={...n,to:jn(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),s=n.to?`${n.to}`:`.`,c=jt(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[Ot(c)],u=c.includes(`$`),d;if(l)d=l._branch??=Cn(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??pn(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=rr(n.params,e),!lt(p))break;p===e&&(p=Object.assign(ut(),p));try{Object.assign(p,t(p))}catch{}}}p??=rr(n.params,ir(n.params,f)?o()[3]:ar);let m=e.leaveParams?c:Rn(St(f?Ft(c,f,p,this.pathParamsDecoder):c)),h=or(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,nr(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?sr(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||ar,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,x=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:ar,S=`${m}${v}${b}`,C,w,T=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=Mn(this.rewrite,e);C=Kn(e),Gn(n,t)?(w=n.href,T=!0):w=Rn(Kn(n))}else C=Ct(S),w=C;return{publicHref:w,href:C,pathname:m,search:_,searchStr:v,state:x,hash:y??``,external:T,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=_n(r.pathname,this.processedTree);if(t){let i=Object.assign(ut(),t.rawParams),{from:a,params:o,...s}=t.route,c=rr(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return $n(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=Ot(this.latestLocation.href)===Ot(n.href)&&mt(Yn(n.state),Yn(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?yt(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return $n(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await ei(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Jn(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&qn(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(bt.test(n)||(r=yt(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:Gn(e,this.origin)||(n=Kn(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=fr,this.preloadRoute=e=>ti(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?jt(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=vn(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!mt(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?mt(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=Mt(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??tn,parseSearch:e.parseSearch??en,protocolAllowlist:e.protocolAllowlist??vt}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=pn(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:Ot(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?cr(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=nr(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof er||(r=new er(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=ut(),_=i._interpolation?Ft(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,v=i.id+_+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(g,d);let x;if(!b)try{lr(i,d)}catch(e){if(x=It(e)||sn(e)?e:new tr(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:dt(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=qn(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:y?dt(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?ft(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?dt(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=ot(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=ot(a),c={...e.search};for(let e of a)try{Object.assign(c,nr(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{lr(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function $n(e,t,{replace:n,ignoreBlocker:r}){if(!xt(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var er=class extends Error{},tr=class extends Error{};function nr(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new er(`Async validation not supported`);if(n.issues)throw new er(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 rr(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function ir(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!ct.call(e,t[1]))}var ar=Object.freeze({});function or(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=nr(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function sr(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=st(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function cr(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return an}function lr(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function ur(e,t){return e.options[t]?.preload?.()}function dr(e,t){let n=ur(e,`component`),r=ur(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function fr(e,t,n){let r=()=>t===!1?void 0:t?ur(e,t):dr(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function pr(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function mr(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var hr=0,gr=1,_r=2,vr=3,yr=[4];function br(e){return typeof e[0]==`number`}function xr(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function Sr(e,t){return e.routesById[t.routeId]}function Cr(e,t,n){return sn(e)?[vr,e]:It(e)?(e.routeId||=n,[_r,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[gr,e]):[hr,e]}function wr(e,t){let n=Cr(t,!0,e.id);if(n[0]!==gr)return n;try{e.options.onError?.(n[1])}catch(t){n=Cr(t,!0,e.id)}return n}function Tr(e,t,n,r,i){return i[0].signal.aborted?yr:Vr(e,t,n,wr(n,r),i)}async function Er(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=Sr(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return Or(e,r),[i,Tr(e,t,u,a,n)]}if(c.aborted)return[i,yr];let p=r.paramsError??r.searchError;if(p!==void 0)return Or(e,r),[i,Tr(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{jr(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?xr(a,c):a);if(c.aborted)return[i,yr];let s=Vr(e,t,u,Cr(o,!1,u.id),n);if(s[0]!==hr)return Or(e,r),[i,s];r.context={...r.context,...o}}catch(a){return Or(e,r),[i,Tr(e,t,u,a,n)]}finally{r.status=h,jr(e,r,!1,n[0])}}i()}function Dr(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function Or(e,t){let n=t._flight;t._flight=void 0,Dr(e,t,n)?.abort()}function kr(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Dr(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Ar(e){for(let t of e){let e=t._flight;e&&e[2]++}}function jr(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Mr(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Nr(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return yr;if(!i)return[hr,void 0];let l=n._flight;jr(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Mr(e,t,n,r,s,a,!!o[3]))).then(e=>Cr(e,!1,r.id),e=>Cr(e,!0,r.id)).then(t=>(t[0]!==hr&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===gr&&l[2]?wr(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Vr(e,t,r,await xr(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return Or(e,n),yr}finally{jr(e,n,!1,s)}}function Pr(e,t,n){t[0]!==vr&&(e.status=`success`,e.error=void 0,t[0]===hr?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function Fr(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&Or(e,r)}function Ir(e,t){return t[0]===gr||t[0]===_r?{...e,status:t[0]===gr?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Lr(e,t,n,r,i,a,o){let s=t[1][n],c=Sr(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Mr(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=yr)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,Or(e,s),p=Tr(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,Dr(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?Nr(e,t,s,c,g,i,a).then(t=>(Pr(s,t,l),t[0]===hr&&(m&&!a[0].signal.aborted&&Fr(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[hr,s.loaderData]),T=(async()=>{try{let e=fr(c,void 0,C);e&&await xr(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,Tr(e,t,c,r,a)]}let r=await w;x&&r[0]===hr&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>Ir(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=Nr(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,Pr(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>Ir(E,e))}async function Rr(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=Sr(e,t[n]);try{let e=fr(i,!1);e&&await xr(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function zr(e,t){t[2]&&=(kr(e,t[2].map(e=>e[3])),void 0)}async function Br(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=vr)throw[a,t];!i&&t[0]!==hr&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===vr)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Vr(e,t,n,r,i,a){for(;r[0]===vr;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[vr,t]:[vr,t,a]}return[vr,o,n]}catch(e){r=a?[gr,e]:wr(n,e),a=!0}}return r}async function Hr(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===_r?Rr(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=vr)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==hr&&t[0]<vr&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=vr){let n=s[1];if(n[0]!==vr||n[1].options.reloadDocument||n[2])return zr(e,t),n;c=!0,s=[0,[gr,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===gr?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=Sr(e,u);try{await xr(i?Promise.resolve().then(()=>fr(m,l===gr?`errorComponent`:`notFoundComponent`)):Promise.all([fr(m),fr(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return zr(e,t),yr}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),zr(e,t),kr(e,o),p()):u.status=`success`}return t}async function Ur(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=Sr(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await xr(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Wr(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Rr(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Lr(e,i,t,u,f,r,l)},m=await Er(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===_r){let t=await Rr(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=vr&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Hr(e,i,u,r[0],Br(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Br(i[2],void 0,void 0,h.then(e=>br(e)?0:pr(n).length,()=>0))),o=await h}catch(t){if(zr(e,i),t===a&&a.aborted)return yr;throw t}return br(o)?o:Ur(e,o,a,r[6]===n.length?r[6]:0)}function Gr(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=Sr(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Gr(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Kr(e,t){let n=e._pending;e._tx!==t&&e._tx?.[3].some(e=>e.id===n?.[1])||(clearTimeout(n?.[3]),e._pending=void 0)}async function qr(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!pr(t[3]).some(e=>e.id===n[1]))return;let i;try{await xr(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Jr(e,t){e._committed=t,e.stores.setMatches(t)}function Yr(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=pr(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=Sr(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Xn(n);Jr(e,n),kr(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Zn(e,i,n,a,l,t)}async function Xr(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Zr(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Qr(e,t,n,r,i){let a=n.map(e=>({...e}));Ar(a);for(let t of r)Or(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Hr(e,o,r,t[0],i)}catch(t){throw kr(e,a),t}if(br(s))kr(e,a),s[0]===vr&&e._tx===t&&e._committed===n&&await Zr(e,t,s);else if(await Ur(e,s,t[0].signal),e._tx!==t||e._committed!==n)kr(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),Or(e,n))}Jr(e,a),kr(e,n,a)}}async function $r(e,t,n,r,i,a){let o=await Wr(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(br(o)){let n=o[0]===vr&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Kr(e,t),kr(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Kr(e,t);return}await Zr(e,t,o);return}let s=o[1];if(e._tx===t&&await qr(e,t),e._tx!==t){Kr(e,t),kr(e,s),zr(e,o);return}let c=t[2],l=Jn(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await qr(e,t),e._tx!==t){Kr(e,t),kr(e,s),zr(e,o);return}let n=await e.startTransition(()=>{Kr(e,t),Yr(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&Qr(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):zr(e,o)})}async function ei(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Jn(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Xr(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Ar(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){kr(e,m),await Xr(e,n);return}e._preflight=void 0;let g,_=()=>$r(e,y,f,()=>Gr(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>Xr(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&jr(e,t,!1)}n[0].abort(),kr(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Gr(e,y),g?.(_()),await y[5]):(kr(e,y[3]),y[3]=[],g?.(),await Xr(e,y))}async function ti(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Ar(a),o=(e._preloads??=new Map).set(i,a),s=await Wr(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),kr(e,a)),i.abort()}if(!br(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){It(e)||console.error(e);return}}}var ni=`Error preloading route! ☝️`,ri=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=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=an:this.parentRoute||Tt();let r=n?an:t?.path;r&&r!==`/`&&(r=Dt(r));let i=t?.id||r,a=n?an:Et((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:Et(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=Ot(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>on({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ii=class extends ri{constructor(e){super(e)}},ai=class extends b.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?b.createElement(this.props.errorComponent??oi,{error:e[0],reset:this.reset}):this.props.children}};function oi({error:e}){let[t,n]=b.useState(!1);return(0,x.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,x.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,x.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,x.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,x.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,x.jsx)(`div`,{children:(0,x.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,x.jsx)(`code`,{children:e.message}):null})}):null]})}var si=()=>!0,ci=()=>!1;function li({children:e,fallback:t=null}){return(0,x.jsx)(b.Fragment,{children:ui()?e:t})}function ui(e=!0){return b.useSyncExternalStore(di,si,e?ci:si)}function di(){return()=>{}}var fi=b.createContext(null);function pi(e){return b.useContext(fi)}function mi(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{mr(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var hi=b.createContext(void 0),gi=b.createContext(void 0);function _i({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;e:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue e}break}}while(1)}function o(t,n){let r,i=0,a=!1;e:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue e}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function vi(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var yi=[],bi=0,{link:xi,unlink:Si,propagate:Ci,checkDirty:wi,shallowPropagate:Ti}=_i({update(e){return e._update()},notify(e){yi[Di++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ji(e))}}),Ei=0,Di=0,Oi,ki=0;function Ai(e){try{++ki,e()}finally{--ki||Mi()}}function ji(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Si(n,e)}function Mi(){if(!(ki>0)){for(;Ei<Di;){let e=yi[Ei];yi[Ei++]=void 0,e.notify()}Ei=0,Di=0}}function Ni(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return Oi!==void 0&&xi(i,Oi,bi),i._snapshot},subscribe(e){let t=vi(e),n={current:!1},r=Pi(()=>{i.get(),n.current?(Oi=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Oi,o=t?.compare??Object.is;if(n)Oi=i,++bi,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Oi=a,n&&(i.flags&=-5),ji(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&wi(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Ti(e)}}else e&32&&(i.flags=e&-33);return Oi!==void 0&&xi(i,Oi,bi),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ci(e),Ti(e),Mi())}},i}function Pi(e){let t=()=>{let t=Oi;Oi=n,++bi,n.depsTail=void 0,n.flags=6;try{return e()}finally{Oi=t,n.flags&=-5,ji(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&wi(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,ji(this)}};return t(),n}var Fi=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Ii=o(((e,t)=>{t.exports=Fi()})),Li=o((e=>{var t=d(),n=Ii();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ri=o(((e,t)=>{t.exports=Li()}))();function zi(e,t){return e===t}function Bi(e,t=e=>e,n){let r=n?.compare??zi,i=(0,b.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,b.useCallback)(()=>e.get(),[e]);return(0,Ri.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var Vi={};function Hi(e,t){let n=b.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=ft(n.current,i):i}}function Ui(e){let t=pi(),n=b.useContext(e.from?gi:hi),r=e.from??n,i=t.stores.getMatchStore(r),a=Hi(e,t),o=Bi(i,e=>e?a(e):Vi);if(o!==Vi)return o;(e.shouldThrow??!0)&&Tt()}function Wi(e){return Ui({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Gi(e){let{select:t,...n}=e;return Ui({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Ki(e){return Ui({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function qi(e){return Ui({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ji(e){let t=pi();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Yi(e){return Ui({...e,select:t=>e.select?e.select(t.context):t.context})}function Xi(...e){let t=b.useRef(e),n=t.current;return e.forEach((e,t)=>{mt(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Zi(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(ni)})}function Qi(e,t){let n=typeof e==`string`&&yt(e);if(n)return t.has(n)?e:null}function $i(e,t,n,r){let i=At(e.pathname,r),a=At(t.pathname,r);return(n?.exact?i!==a:!i.startsWith(a)||i.length!==a.length&&i[a.length]!==`/`)||(n?.includeSearch??!0)&&!mt(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||e.hash===t.hash}function ea(e,t,n){let r=pi(),i=b.useRef(null),a=b.useCallback(e=>{if(i.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:o,to:s,preload:c,preloadDelay:l,disabled:u,target:d,onClick:f,onBlur:p,onFocus:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:_}=e,[v,y,x]=Xi(e.search,e.params,o),S=b.useContext(hi),C=(r.stores._linkScopes??={})[S]??=mi(r,S),[w,T,E]=b.useMemo(()=>{let t=Qi(s,r.protocolAllowlist);if(t!==void 0){let n=[t??void 0];return[e,()=>n]}let n={...e},i,a,o,c=()=>{let e=C[0]();if(e!==i){n._fromLocation=e;let t=r.buildLocation(n),o=ca(t,r,u),s=u||o&&!yt(o)?$i(e,t,x,r.basepath):void 0;a&&a[0]===o&&a[1]===s||(a=[o,s]),i=e}return a};return[n,c,x?.includeHash&&(()=>{let e=c();return e[1]?o??=[e[0],!1]:e})]},[r,C,e.from,e.hash,e.href,s,v,y,e.state,e.mask,e.unsafeRelative,x,u]),[D,O]=b.useSyncExternalStore(C[1],T,E||T),k=O===void 0&&D,A=u||D===void 0,j=b.useRef(!1),M=e.reloadDocument||k||A?!1:c??r.options.defaultPreload,N=l??r.options.defaultPreloadDelay??0,P=b.useCallback(e=>{let t=e?.isIntersecting;t??M===`intent`?N?i.t??=setTimeout(()=>{i.t=void 0,Zi(r,w)},N):Zi(r,w):t===!1&&oa(i)},[r,w,i,M,N]);b.useEffect(()=>{if(!M)return;M===`render`&&!j.current&&(j.current=!0,Zi(r,w));let e=!0,t;return M===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&P(t.pop())},{rootMargin:`100px`}),t.observe(i.current)),()=>{e=!1,t?.disconnect(),oa(i)}},[r,w,M,P,i]);let F=ia(e,n);if(F.ref=t?a:i,k)return F.href=k,F;let I=t=>{let n=d??t.currentTarget.getAttribute(`target`);A||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||n&&n!==`_self`||t.button!==0||(t.preventDefault(),oa(i),r.navigate({...e,_fromLocation:w._fromLocation}))},L=()=>{M===`intent`&&Zi(r,w)},R=()=>{M===`intent`&&oa(i)};return F.onClick=sa(f,I),F.onBlur=sa(p,R),F.onFocus=sa(m,P),F.onMouseEnter=sa(h,P),F.onMouseLeave=sa(g,R),F.onTouchStart=sa(_,L),aa(F,e,O,D,A,n)}var ta={},na={className:`active`},ra=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function ia(e,t){let n={};for(let r in e)ra.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function aa(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=st(n?o:s,{})??(n?na:ta);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var oa=e=>{clearTimeout(e.t),e.t=void 0},sa=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function ca(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!xt(i,t.protocolAllowlist))return i}var la=b.memo(b.forwardRef((e,t)=>{let n=e._asChild||`a`,r=ea(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return b.createElement(n,r,i)}),ua);function ua(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!ra.has(r)||!mt(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}var da=class extends ri{constructor(e){super(e),this.useMatch=e=>Ui({...e,from:this.id}),this.useRouteContext=e=>Yi({...e,from:this.id}),this.useSearch=e=>qi({...e,from:this.id}),this.useParams=e=>Ki({...e,from:this.id}),this.useLoaderDeps=e=>Gi({...e,from:this.id}),this.useLoaderData=e=>Wi({...e,from:this.id}),this.useNavigate=()=>Ji({from:this.fullPath}),this.Link=b.forwardRef((e,t)=>(0,x.jsx)(la,{ref:t,from:this.fullPath,...e}))}};function fa(e){return new da(e)}var pa=class extends ii{constructor(e){super(e),this.useMatch=e=>Ui({...e,from:this.id}),this.useRouteContext=e=>Yi({...e,from:this.id}),this.useSearch=e=>qi({...e,from:this.id}),this.useParams=e=>Ki({...e,from:this.id}),this.useLoaderDeps=e=>Gi({...e,from:this.id}),this.useLoaderData=e=>Wi({...e,from:this.id}),this.useNavigate=()=>Ji({from:this.fullPath}),this.Link=b.forwardRef((e,t)=>(0,x.jsx)(la,{ref:t,from:this.fullPath,...e}))}};function ma(e){return new pa(e)}function ha(e){let t=pi(),n=`not-found-${Bi(t.stores.location,e=>e.pathname)}-${Bi(t.stores.status)}`;return(0,x.jsx)(ai,{getResetKey:()=>n,onCatch:(t,n)=>{if(It(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(It(t))return e.fallback?.(t);throw t},children:e.children})}function ga(){return(0,x.jsx)(`p`,{children:`Not Found`})}function _a(e,t,n){return t.options.notFoundComponent?(0,x.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,x.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,x.jsx)(ga,{})}function va(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,x.jsx)(n,{}):null}var ya=(e,t)=>e[0]===t[0]&&e[1]===t[1],ba=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,xa=b.memo(function({routeId:e}){let t=pi();return Sa(t,Bi(t.stores.getMatchStore(e)))});function Sa(e,t){let n=e.routesById[t.routeId],r=va(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=ba(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,x.jsx)(Ca,{match:t});s&&(l=(0,x.jsx)(li,{fallback:r,children:l})),o&&(l=(0,x.jsx)(ha,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return b.createElement(o,e)},children:l})),i&&(l=(0,x.jsx)(ai,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(It(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,x.jsx)(b.Suspense,{fallback:r,children:l}));let u=n.isRoot&&n.options.shellComponent;return u?(0,x.jsx)(hi.Provider,{value:t.routeId,children:(0,x.jsxs)(u,{children:[l,null]})}):(0,x.jsxs)(hi.Provider,{value:t.routeId,children:[l,null]})}var Ca=b.memo(function({match:e}){let t=pi(),n=e.routeId,r=t.routesById[n],i=b.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=b.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,x.jsx)(e,{},i):(0,x.jsx)(wa,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!ba(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return va(t,r)}if(e.status===`notFound`)return _a(t,r,e.error);if(e.status===`error`)throw e.error;return a}),wa=b.memo(function(){let e=pi(),t=b.useContext(hi),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Bi(a,e=>[!!e._notFound,e.error],{compare:ya}),i=Bi(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return _a(e,e.routesById[t],r);if(!i)return null;let a=(0,x.jsx)(xa,{routeId:i});return t===`__root__`?(0,x.jsx)(b.Suspense,{fallback:va(e),children:a}):a});function Ta(e,t){let n=e[1];e.length=0,n?.(t)}function Ea({t:e}){let t=pi(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Ta(n,!1),n.push(i,a),e(t),b.startTransition(r)}),at(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Ot(r.publicHref)!==Ot(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Jn(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Da(){let e=pi(),t=va(e,e.routesById[an]),n=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Ea,{t:b.useState()[1]}),e.ssr?(0,x.jsx)(Oa,{}):(0,x.jsx)(b.Suspense,{fallback:t,children:(0,x.jsx)(Oa,{})})]});return e.options.InnerWrap?(0,x.jsx)(e.options.InnerWrap,{children:n}):n}function Oa(){let e=pi(),t=e._rendered,n=Bi(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;at(()=>{t[0]===n&&Ta(t,!0)},[t,n]);let a=i?(0,x.jsx)(xa,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,x.jsx)(ai,{getResetKey:()=>r,onCatch:void 0,children:a})}var ka=e=>({createMutableStore:Ni,createReadonlyStore:Ni,batch:Ai}),Aa=e=>new ja(e),ja=class extends Qn{constructor(e){super(e,ka)}};function Ma({router:e,children:t,...n}){lt(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,x.jsx)(fi.Provider,{value:e,children:t});return e.options.Wrap?(0,x.jsx)(e.options.Wrap,{children:r}):r}function Na({router:e,...t}){return(0,x.jsx)(Ma,{router:e,...t,children:(0,x.jsx)(Da,{})})}function Pa(e){let t=pi({warn:e?.router===void 0}),n=e?.router||t;return Bi(n.stores.__store,Hi(e,n))}var Fa=_(),Ia=`forge.chunk-reloaded`;function La(){return document.querySelector(`script[type="module"][src]`)?.src||`dev`}function Ra(){try{let e=La();if(sessionStorage.getItem(Ia)===e)return!1;sessionStorage.setItem(Ia,e)}catch{return!1}return window.location.reload(),!0}var za=[`Failed to fetch dynamically imported module`,`error loading dynamically imported module`,`Importing a module script failed`];function Ba(e){let t=e instanceof Error?e.message:``;return za.some(e=>t.startsWith(e))}function Va(){window.addEventListener(`vite:preloadError`,e=>{Ra()&&e.preventDefault()}),window.addEventListener(`unhandledrejection`,e=>{Ba(e.reason)&&Ra()&&e.preventDefault()})}function Ha(e){let t={subscribe(t){let n=null,r=!1,i=!1,a=!1,o=!0,s=null;function c(e){try{e()}catch(e){if(!o)throw e;s??={cause:e}}finally{l()}}function l(){n===null?a=!0:i||(i=!0,typeof n==`function`?n():n&&n.unsubscribe())}if(n=e({next(e){var n;r||(n=t.next)==null||n.call(t,e)},error(e){r||(r=!0,c(()=>t.error?.call(t,e)))},complete(){r||(r=!0,c(()=>t.complete?.call(t)))}}),o=!1,a&&l(),s)throw s.cause;return{unsubscribe:l}},pipe(...e){return e.reduce(Ua,t)}};return t}function Ua(e,t){return t(e)}function Wa(e){let t=new AbortController;return new Promise((n,r)=>{let i=!1;function a(){i||(i=!0,o.unsubscribe())}t.signal.addEventListener(`abort`,()=>{r(t.signal.reason)});let o=e.subscribe({next(e){i=!0,n(e),a()},error(e){r(e)},complete(){t.abort(),a()}})})}function Ga(e,t){let n=[],r=[],i=null,a=!1,o=null;function s(){if(a)return null;a=!0,t.removeEventListener(`abort`,u);try{return o?.unsubscribe(),null}catch(e){return{cause:e}}}function c(){let e=i?r.shift():void 0;if(i&&e){let{cause:t}=i;i=null,e.reject(t)}for(let e of r.splice(0))e.resolve({value:void 0,done:!0})}function l(){let e=s();if(c(),e)throw e.cause}function u(){let e=s();e&&(i=e),c()}o=e.subscribe({next(e){if(a)return;let t=r.shift();t?t.resolve({value:e,done:!1}):n.push(e)},error(e){a||(i={cause:e},l())},complete:l}),a?o.unsubscribe():t.aborted?u():t.addEventListener(`abort`,u,{once:!0});let d={[Symbol.asyncIterator](){return d},async next(){if(n.length>0)return{value:n.shift(),done:!1};if(i){let{cause:e}=i;throw i=null,e}return a?{value:void 0,done:!0}:new Promise((e,t)=>{r.push({resolve:e,reject:t})})},async return(){return n.length=0,i=null,l(),{value:void 0,done:!0}}};return d}function Ka(e){return e=>{let t=0,n=null,r=!1,i=new Set;function a(){if(n||r)return;r=!0;let t=!1,a;try{a=e.subscribe({next(e){o(i,t=>t.next?.call(t,e))},error(e){t=!0,s(t=>t.error?.call(t,e))},complete(){t=!0,s(e=>e.complete?.call(e))}})}finally{r=!1}t?a.unsubscribe():n=a}function o(e,t){for(let n of[...e])e.has(n)&&t(n)}function s(e){let t=n,a=i;n=null,i=new Set,r=!1;try{o(a,e)}finally{t?.unsubscribe()}}function c(){let e=n;n=null,e?.unsubscribe()}function l(){t===0&&n&&c()}return Ha(e=>{t++;let n=i;return n.add(e),a(),{unsubscribe(){t--,l(),n.delete(e)}}})}}function qa(e){try{e()}catch(e){setTimeout(()=>{throw e})}}function Ja(e){let t=e,n=new Set,r=e=>{t!==void 0&&e.next(t),n.add(e)},i=e=>{n.delete(e)},a=Ha(e=>(r(e),()=>{i(e)}));return a.next=e=>{if(t!==e){t=e;for(let t of[...n])n.has(t)&&qa(()=>t.next(e))}},a.get=()=>t,a}function Ya(e){return Ha(t=>{function n(t=0,r=e.op){let i=e.links[t];if(!i)throw Error(`No more links to execute - did you forget to add an ending link?`);return i({op:r,next(e){return n(t+1,e)}})}return n().subscribe(t)})}function Xa(e){return Array.isArray(e)?e:[e]}function Za(e){return t=>{let n=Xa(e.true).map(e=>e(t)),r=Xa(e.false).map(e=>e(t));return t=>Ha(i=>{let a=e.condition(t.op)?n:r;return Ya({op:t.op,links:a}).subscribe(i)})}}function Qa(e){"@babel/helpers - typeof";return Qa=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Qa(e)}function $a(e,t){if(Qa(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(Qa(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function eo(e){var t=$a(e,`string`);return Qa(t)==`symbol`?t:t+``}function to(e,t,n){return(t=eo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function no(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ro(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?no(Object(n),!0).forEach(function(t){to(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):no(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function io(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function ao(e){return typeof e==`function`}function oo(){return Object.create(null)}var so=typeof Symbol==`function`&&!!Symbol.asyncIterator;function co(e){return so&&io(e)&&Symbol.asyncIterator in e}var lo=e=>e();function uo(){}var fo={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099},po=[fo.BAD_GATEWAY,fo.SERVICE_UNAVAILABLE,fo.GATEWAY_TIMEOUT,fo.INTERNAL_SERVER_ERROR],mo=()=>{},ho=e=>{Object.freeze&&Object.freeze(e)};function go(e,t,n){let r=t.join(`.`);return n[r]??(n[r]=new Proxy(mo,{get(r,i){if(typeof i==`string`&&i!==`then`)return go(e,[...t,i],n)},apply(n,r,i){let a=t[t.length-1];if(a===`valueOf`||a===`toString`||a===`toJSON`)return`tRPC.proxy(${t.slice(0,-1).join(`.`)})`;let o={args:i,path:t};return a===`call`?o={args:i.length>=2?[i[1]]:[],path:t.slice(0,-1)}:a===`apply`&&(o={args:i.length>=2?i[1]:[],path:t.slice(0,-1)}),ho(o.args),ho(o.path),e(o)}})),n[r]}var _o=e=>go(e,[],oo()),vo=e=>new Proxy(mo,{get(t,n){if(n!==`then`)return e(n)}});function yo(e){"@babel/helpers - typeof";return yo=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},yo(e)}function bo(e,t){if(yo(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(yo(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xo(e){var t=bo(e,`string`);return yo(t)==`symbol`?t:t+``}function So(e,t,n){return(t=xo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Co(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Co(Object(n),!0).forEach(function(t){So(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Co(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var To=class extends Error{constructor(e){super(Eo(e)),Object.assign(this,e),Do(e)&&(typeof e.name==`string`&&(this.name=e.name),typeof e.stack==`string`&&(this.stack=e.stack))}};function Eo(e){if(`message`in e)return String(e.message)}function Do(e){return e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`}function Oo(e){if(e instanceof Error)return e;let t=typeof e;if(t!==`undefined`&&t!==`function`&&e!==null){if(t!==`object`)return Error(String(e));if(io(e))return new To(e)}}var ko=class extends Error{constructor(e){let t=Oo(e.cause),n=e.message??t?.message??e.code;super(n,{cause:t}),So(this,`cause`,void 0),So(this,`code`,void 0),this.code=e.code,this.name=`TRPCError`,this.cause??=t}};function Ao(e,t){if(`error`in e){let n=t.deserialize(e.error);return{ok:!1,error:wo(wo({},e),{},{error:n})}}return{ok:!0,result:wo(wo({},e.result),(!e.result.type||e.result.type===`data`)&&{type:`data`,data:t.deserialize(e.result.data)})}}var jo=class extends Error{constructor(){super(`Unable to transform response from server`)}};function Mo(e,t){let n;try{n=Ao(e,t)}catch{throw new jo}if(!n.ok&&(!io(n.error.error)||typeof n.error.error.code!=`number`)||n.ok&&!io(n.result))throw new jo;return n}function No(e){return typeof e==`function`}async function Po(e,t){let{_def:n}=e,r=n.procedures[t];for(;!r;){let e=Object.keys(n.lazy).find(e=>t===e||t.startsWith(e+`.`));if(!e)return null;await n.lazy[e].load(),r=n.procedures[t]}return r}async function Fo(e){let{type:t,path:n}=e,r=await Po(e.router,n);if(!r||!No(r)||r._def.type!==t&&!e.allowMethodOverride)throw new ko({code:`NOT_FOUND`,message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type===`subscription`)throw new ko({code:`METHOD_NOT_SUPPORTED`,message:`Method override is not supported for subscriptions`});return r(e)}function Io(e){return e??`.`}function Lo(e,t){return t===`.`?e:e.split(`.`).join(t)}function Ro(e,t){this.v=e,this.k=t}function zo(e){return function(){return new Bo(e.apply(this,arguments))}}function Bo(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Ro;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}Bo.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},Bo.prototype.next=function(e){return this._invoke(`next`,e)},Bo.prototype.throw=function(e){return this._invoke(`throw`,e)},Bo.prototype.return=function(e){return this._invoke(`return`,e)};function Vo(e){return Object.prototype.toString.call(e)===`[object Object]`}function Ho(e){var t,n;return Vo(e)!==!1&&(t=e.constructor,t===void 0||!(t===null||(n=t.prototype,Vo(n)===!1)||n.hasOwnProperty(`isPrototypeOf`)===!1))}var Uo,Wo=new WeakMap,Go=()=>{};Uo=Symbol.toStringTag;var Ko=class e{constructor(e){So(this,`promise`,void 0),So(this,`subscribers`,[]),So(this,`settlement`,null),So(this,Uo,`Unpromise`),this.promise=typeof e==`function`?new Promise(e):e;let t=this.promise.then(e=>{let{subscribers:t}=this;this.subscribers=null,this.settlement={status:`fulfilled`,value:e},t?.forEach(({resolve:t})=>{t(e)})});`catch`in t&&t.catch(e=>{let{subscribers:t}=this;this.subscribers=null,this.settlement={status:`rejected`,reason:e},t?.forEach(({reject:t})=>{t(e)})})}subscribe(){let e,t,{settlement:n}=this;if(n===null){if(this.subscribers===null)throw Error(`Unpromise settled but still has subscribers`);let n=Jo();this.subscribers=Yo(this.subscribers,n),e=n.promise,t=()=>{this.subscribers!==null&&(this.subscribers=Zo(this.subscribers,n))}}else{let{status:r}=n;e=r===`fulfilled`?Promise.resolve(n.value):Promise.reject(n.reason),t=Go}return Object.assign(e,{unsubscribe:t})}then(e,t){let n=this.subscribe(),{unsubscribe:r}=n;return Object.assign(n.then(e,t),{unsubscribe:r})}catch(e){let t=this.subscribe(),{unsubscribe:n}=t;return Object.assign(t.catch(e),{unsubscribe:n})}finally(e){let t=this.subscribe(),{unsubscribe:n}=t;return Object.assign(t.finally(e),{unsubscribe:n})}static proxy(t){let n=e.getSubscribablePromise(t);return n===void 0?e.createSubscribablePromise(t):n}static createSubscribablePromise(t){let n=new e(t);return Wo.set(t,n),Wo.set(n,n),n}static getSubscribablePromise(e){return Wo.get(e)}static resolve(t){let n=typeof t==`object`&&t&&`then`in t&&typeof t.then==`function`?t:Promise.resolve(t);return e.proxy(n).subscribe()}static async any(t){let n=(Array.isArray(t)?t:[...t]).map(e.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:e})=>{e()})}}static async race(t){let n=(Array.isArray(t)?t:[...t]).map(e.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:e})=>{e()})}}static async raceReferences(e){let t=e.map(qo);try{return await Promise.race(t)}finally{for(let e of t)e.unsubscribe()}}};function qo(e){return Ko.proxy(e).then(()=>[e])}function Jo(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Yo(e,t){return[...e,t]}function Xo(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Zo(e,t){let n=e.indexOf(t);return n===-1?e:Xo(e,n)}var Qo,$o;(Qo=Symbol).dispose??(Qo.dispose=Symbol()),($o=Symbol).asyncDispose??($o.asyncDispose=Symbol());function es(e,t){let n=e,r=n[Symbol.dispose];return n[Symbol.dispose]=()=>{t(),r?.call(n)},n}function ts(e,t){let n=e,r=n[Symbol.asyncDispose];return n[Symbol.asyncDispose]=async()=>{await t(),await r?.call(n)},n}var ns=Symbol();function rs(e){let t=null;return es({start(){if(t)throw Error(`Timer already started`);return new Promise(n=>{t=setTimeout(()=>n(ns),e)})}},()=>{t&&clearTimeout(t)})}function is(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}function as(e){return new Ro(e,0)}var os=`ping`,ss=`serialized-error`,cs=`connected`,ls=`return`;async function us(e){try{var t=is();let n=t.u(rs(e.timeoutMs)),r=await Ko.race([e.promise,n.start()]);return r===ns?await e.onTimeout():r}catch(e){t.e=e}finally{t.d()}}function ds(e){let{deserialize:t=e=>e}=e,n=oo(),r=e.signal,i=null,a=()=>{let a=uo;return{stream:new ReadableStream({async start(o){let[s,c]=await Promise.all([e.url(),e.init()]),l=i=new e.EventSource(s,c);o.enqueue({type:`connecting`,eventSource:i,event:null});let u=(e,t)=>{l.addEventListener(e,e=>{try{t(e)}catch(e){l.close(),o.error(e)}})};u(cs,e=>{let t=JSON.parse(e.data);n=t,o.enqueue({type:`connected`,options:t,eventSource:l})}),u(ss,e=>{o.enqueue({type:`serialized-error`,error:t(JSON.parse(e.data)),eventSource:l})}),l.addEventListener(os,()=>{o.enqueue({type:`ping`,eventSource:l})}),l.addEventListener(ls,()=>{l.close(),o.close(),i=null}),l.addEventListener(`error`,e=>{l.readyState===l.CLOSED?o.error(e):o.enqueue({type:`connecting`,eventSource:l,event:e})}),u(`message`,e=>{let n={data:e.data===``?void 0:t(JSON.parse(e.data))};e.lastEventId&&(n.id=e.lastEventId),o.enqueue({type:`data`,data:n,eventSource:l})});let d=()=>{try{l.close(),o.close()}catch{}};r.aborted?d():(r.addEventListener(`abort`,d),a=()=>r.removeEventListener(`abort`,d))},cancel(){i?.close(),a()}}),removeAbortListener:()=>a()}},o=()=>{let{stream:e,removeAbortListener:t}=a(),n=e.getReader();async function r(){t(),await n.cancel().catch(()=>{}),i=null}return ts({read(){return n.read()},async recreate(){await r(),{stream:e,removeAbortListener:t}=a(),n=e.getReader()}},r)};return lo(zo(function*(){try{var e=is();let t=e.a(o());for(;;){let e=t.read(),r=n.reconnectAfterInactivityMs;r&&(e=us({promise:e,timeoutMs:r,onTimeout:async()=>{let e={value:{type:`timeout`,ms:r,eventSource:i},done:!1};return await t.recreate(),e}}));let a=yield as(e);if(a.done)return a.value;yield a.value}}catch(t){e.e=t}finally{yield as(e.d())}}))}fo.INTERNAL_SERVER_ERROR;function fs(e){return e instanceof hs}function ps(e){return io(e)&&io(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function ms(e,t){return typeof e==`string`?e:io(e)&&typeof e.message==`string`?e.message:t}var hs=class e extends Error{constructor(t,n){var r,i;let a=n?.cause;super(t,{cause:a}),to(this,`cause`,void 0),to(this,`shape`,void 0),to(this,`data`,void 0),to(this,`meta`,void 0),this.meta=n?.meta,this.cause=a,this.shape=n==null||(r=n.result)==null?void 0:r.error,this.data=n==null||(i=n.result)==null?void 0:i.error.data,this.name=`TRPCClientError`,Object.setPrototypeOf(this,e.prototype)}static from(t,n={}){let r=t;return fs(r)?(n.meta&&(r.meta=ro(ro({},r.meta),n.meta)),r):ps(r)?new e(r.error.message,ro(ro({},n),{},{result:r,cause:n.cause})):new e(ms(r,`Unknown error`),ro(ro({},n),{},{cause:r}))}};function gs(e){let t=e;return t?`input`in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}var _s=e=>typeof e==`function`;function vs(e){if(e)return e;if(typeof window<`u`&&_s(window.fetch))return window.fetch.bind(window);if(typeof globalThis<`u`&&_s(globalThis.fetch))return globalThis.fetch;throw Error(`No fetch implementation found`)}function ys(...e){let t=new AbortController,n=e.length,r=0,i=()=>{++r===n&&t.abort()};for(let t of e)t?.aborted?i():t?.addEventListener(`abort`,i,{once:!0});return t.signal}function bs(...e){return xs(...e).signal}function xs(...e){let t=new AbortController,n=()=>{for(let t of e)t?.removeEventListener(`abort`,r)},r=()=>{n(),t.abort()};for(let t of e){if(t?.aborted){r();break}t?.addEventListener(`abort`,r,{once:!0})}return{signal:t.signal,cleanup:n}}var Ss=class extends Error{constructor(){let e=`AbortError`;super(e),this.name=e,this.message=e}},Cs=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<`u`?new DOMException(`AbortError`,`AbortError`):new Ss};function ws(e){return{url:e.url.toString(),fetch:e.fetch,transformer:gs(e.transformer),methodOverride:e.methodOverride,pathSeparator:Io(e.pathSeparator)}}function Ts(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];t[n]=r}return t}var Es={query:`GET`,mutation:`POST`,subscription:`PATCH`};function Ds(e){return`input`in e?e.transformer.input.serialize(e.input):Ts(e.inputs.map(t=>e.transformer.input.serialize(t)))}var Os=e=>{let t=e.url.split(`?`),n=t[0].replace(/\/$/,``)+`/`+Lo(e.path,e.pathSeparator),r=[];if(t[1]&&r.push(t[1]),`inputs`in e&&r.push(`batch=1`),(e.type===`query`||e.type===`subscription`)&&e.methodOverride!==`POST`){let t=Ds(e);t!==void 0&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+=`?`+r.join(`&`)),n},ks=e=>{if(e.type===`query`&&e.methodOverride!==`POST`)return;let t=Ds(e);return t===void 0?void 0:JSON.stringify(t)},As=e=>Ms(ro(ro({},e),{},{contentTypeHeader:`application/json`,getUrl:Os,getBody:ks}));async function js(e){Cs(e.signal);let t=e.getUrl(e),n=e.getBody(e),r=e.methodOverride??Es[e.type],i=await(async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a=Object.keys(i).some(e=>e.toLowerCase()===`content-type`),o=ro(ro(ro({},e.contentTypeHeader&&r!==`GET`&&!a?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[e.trpcAcceptHeaderKey??`trpc-accept`]:e.trpcAcceptHeader}:void 0),i);return vs(e.fetch)(t,{method:r,signal:e.signal,body:n,headers:o})}async function Ms(e){let t={},n=await js(e);t.response=n;let r=await n.json();return t.responseJSON=r,{json:r,meta:t}}var Ns=()=>{throw Error(`Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new`)};function Ps(e){let t=null,n=null,r=()=>{clearTimeout(n),n=null,t=null};function i(t){let n=[[]],r=0;for(;;){let s=t[r];if(!s)break;let c=n[n.length-1];if(s.aborted){var i;(i=s.reject)==null||i.call(s,Error(`Aborted`)),r++;continue}let l;try{l=e.validate(c.concat(s).map(e=>e.key))}catch(e){var a;(a=s.reject)==null||a.call(s,e),r++;continue}if(l)c.push(s),r++;else if(c.length===0){var o;(o=s.reject)==null||o.call(s,Error(`Input is too big for a single dispatch`)),r++}else n.push([])}return n}function a(){let n=i(t);r();for(let t of n){if(!t.length)continue;let n={items:t};for(let e of t)e.batch=n;e.fetch(n.items.map(e=>e.key)).then(async e=>{await Promise.all(e.map(async(e,t)=>{let r=n.items[t];try{var i;let t=await Promise.resolve(e);(i=r.resolve)==null||i.call(r,t)}catch(e){var a;(a=r.reject)==null||a.call(r,e)}r.batch=null,r.reject=null,r.resolve=null}));for(let e of n.items){var t;(t=e.reject)==null||t.call(e,Error(`Missing result`)),e.batch=null}}).catch(e=>{for(let r of n.items){var t;(t=r.reject)==null||t.call(r,e),r.batch=null}})}}function o(e){let r={aborted:!1,key:e,batch:null,resolve:Ns,reject:Ns},i=new Promise((e,n)=>{r.reject=n,r.resolve=e,t??=[],t.push(r)});return n??=setTimeout(a),i}return{load:o}}function Fs(e){let t=ws(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{let i=i=>({validate(e){if(n===1/0&&r===1/0)return!0;if(e.length>r)return!1;let a=e.map(e=>e.path).join(`,`),o=e.map(e=>e.input);return Os(ro(ro({},t),{},{type:i,path:a,inputs:o,signal:null})).length<=n},async fetch(n){let r=n.map(e=>e.path).join(`,`),a=n.map(e=>e.input),o=ys(...n.map(e=>e.signal)),s=await As(ro(ro({},t),{},{path:r,inputs:a,type:i,headers(){return e.headers?typeof e.headers==`function`?e.headers({opList:n}):e.headers:{}},signal:o}));return(Array.isArray(s.json)?s.json:n.map(()=>s.json)).map(e=>({meta:s.meta,json:e}))}}),a={query:Ps(i(`query`)),mutation:Ps(i(`mutation`))};return({op:e})=>Ha(n=>{if(e.type===`subscription`)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let r=new AbortController,{signal:i,cleanup:o}=xs(e.signal,r.signal),s=a[e.type].load(ro(ro({},e),{},{signal:i})),c=!1,l;return s.then(e=>{c=!0,l=e;let r=Mo(e.json,t.transformer.output);r.ok?(n.next({context:e.meta,result:r.result}),n.complete()):n.error(hs.from(r.error,{meta:e.meta}))}).catch(e=>{c=!0,n.error(hs.from(e,{meta:l?.meta}))}),()=>{c||r.abort(),o()}})}}var Is=(e,...t)=>typeof e==`function`?e(...t):e,Ls=class e extends Error{constructor(t){super(t.message,{cause:t.cause}),this.name=`TRPCWebSocketClosedError`,Object.setPrototypeOf(this,e.prototype)}};function Rs(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function zs(e){let t=await Is(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function Bs(e,t){let n={method:`connectionParams`,data:await Is(e)};return t.encode(n)}function Vs(e){let{promise:t,resolve:n,reject:r}=Rs();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}var Hs=new WeakMap;function Us(e,t){let n=Hs.get(e);if(!n){let t=[];n=t,Hs.set(e,t),e.addEventListener(`message`,({data:e})=>{var n;e===`PONG`&&((n=t.shift())==null||n())})}n.push(t),e.send(`PING`)}function Ws(e,{intervalMs:t,pongTimeoutMs:n},r){let i,a;function o(){i=setTimeout(()=>{Us(e,null),a=setTimeout(()=>{e.readyState===e.OPEN&&(e.close(),r())},n)},t)}function s(){clearTimeout(i),o()}function c(){clearTimeout(a),s()}e.addEventListener(`open`,o),e.addEventListener(`message`,({data:e})=>{clearTimeout(i),o(),e===`PONG`&&c()}),e.addEventListener(`close`,()=>{clearTimeout(i),clearTimeout(a)})}to(class e{constructor(t){if(to(this,`id`,++e.connectCount),to(this,`WebSocketPonyfill`,void 0),to(this,`urlOptions`,void 0),to(this,`keepAliveOpts`,void 0),to(this,`encoder`,void 0),to(this,`onPongTimeout`,void 0),to(this,`wsObservable`,Ja(null)),to(this,`openPromise`,null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder,this.onPongTimeout=t.onPongTimeout}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++e.connectCount;let t=zs(this.urlOptions).then(e=>new this.WebSocketPonyfill(e)).then(async e=>{this.ws=e,e.binaryType=`arraybuffer`,e.addEventListener(`message`,function({data:e}){e===`PING`&&this.send(`PONG`)});let n=Rs();this.keepAliveOpts.enabled&&Ws(e,this.keepAliveOpts,()=>{this.openPromise===t&&n.reject(new Ls({message:`Pong timeout before connectionParams were sent`})),this.onPongTimeout(e)}),e.addEventListener(`close`,()=>{this.ws===e&&(this.ws=null)}),await Vs(e),this.urlOptions.connectionParams&&e.send(await Promise.race([Bs(this.urlOptions.connectionParams,this.encoder),n.promise]))});this.openPromise=t;try{await t}finally{this.openPromise===t&&(this.openPromise=null)}}async close(){try{await this.openPromise}finally{var e;(e=this.ws)==null||e.close()}}},`connectCount`,0);var Gs=[`onStarted`,`onData`,`onError`,`onStopped`,`onComplete`,`onConnectionStateChange`],Ks=class{constructor(e){to(this,`links`,void 0),to(this,`runtime`,void 0),to(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return Ya({links:this.links,op:ro(ro({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(Ka())}async requestAsPromise(e){try{return(await Wa(this.$request(e))).result.data}catch(e){throw hs.from(e)}}query(e,t,n){return this.requestAsPromise({type:`query`,path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:`mutation`,path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n={}){let r=Gs.some(e=>typeof n[e]==`function`),i=this.$request({type:`subscription`,path:e,input:t,context:n.context,signal:n.signal});if(!r){let e=Ga(Ha(e=>i.subscribe({next(t){(t.result.type===`data`||t.result.type===void 0)&&e.next(t.result.data)},error:t=>e.error(t),complete:()=>e.complete()})),n.signal??new AbortController().signal),t=!1;return e[Symbol.asyncIterator]=()=>{if(t)throw Error(`A subscription can only be iterated once. Call subscribe() again for another loop.`);return t=!0,e},e}return i.subscribe({next(e){switch(e.result.type){case`state`:var t;(t=n.onConnectionStateChange)==null||t.call(n,e.result);break;case`started`:var r;(r=n.onStarted)==null||r.call(n,{context:e.context});break;case`stopped`:var i;(i=n.onStopped)==null||i.call(n);break;case`data`:case void 0:var a;(a=n.onData)==null||a.call(n,e.result.data)}},error(e){var t;(t=n.onError)==null||t.call(n,e)},complete(){var e;(e=n.onComplete)==null||e.call(n)}})}},qs=Symbol.for(`trpc_untypedClient`),Js={query:`query`,mutate:`mutation`,subscribe:`subscription`},Ys=e=>Js[e];function Xs(e){let t=_o(({path:t,args:n})=>{let r=[...t],i=Ys(r.pop()),a=r.join(`.`);return e[i](a,...n)});return vo(n=>n===qs?e:t[n])}function Zs(e){return Xs(new Ks(e))}function Qs(e){return e[qs]}function $s(e,t){return!t||e!=null&&!Ho(e)?e:ro(ro({},e??{}),{},{lastEventId:t})}function ec(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new tc(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function tc(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return tc=function(e){this.s=e,this.n=e.next},tc.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.throw;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new tc(e)}async function nc(e){let t=await Is(e.url);if(e.connectionParams){let n=await Is(e.connectionParams),r=t.includes(`?`)?`&`:`?`;t+=r+`connectionParams=`+encodeURIComponent(JSON.stringify(n))}return t}function rc(e){let t=gs(e.transformer),n=Io(e.pathSeparator);return()=>({op:r})=>Ha(i=>{let{type:a,path:o,input:s}=r;if(a!==`subscription`)throw Error(`httpSubscriptionLink only supports subscriptions`);let c,l=new AbortController,u=ds({url:async()=>Os({transformer:t,url:await nc(e),input:$s(s,c),path:o,pathSeparator:n,type:a,signal:null}),init:()=>Is(e.eventSourceOptions,{op:r}),signal:bs(r.signal,l.signal),deserialize:e=>t.output.deserialize(e),EventSource:e.EventSource??globalThis.EventSource}),d=Ja({type:`state`,state:`connecting`,error:null}),f=d.subscribe({next(e){i.next({result:e})}});return lo(async()=>{var e=!1,t=!1,n;try{for(var r=ec(u),a;e=!(a=await r.next()).done;e=!1){let e=a.value;switch(e.type){case`ping`:break;case`data`:let t=e.data,n;t.id?(c=t.id,n={id:t.id,data:t}):n={data:t.data},i.next({result:n,context:{eventSource:e.eventSource}});break;case`connected`:i.next({result:{type:`started`},context:{eventSource:e.eventSource}}),d.next({type:`state`,state:`pending`,error:null});break;case`serialized-error`:{let t=hs.from({error:e.error});if(po.includes(e.error.code)){d.next({type:`state`,state:`connecting`,error:t});break}throw t}case`connecting`:{let t=d.get(),n=e.event&&hs.from(e.event);if(!n&&t.state===`connecting`)break;d.next({type:`state`,state:`connecting`,error:n});break}case`timeout`:d.next({type:`state`,state:`connecting`,error:new hs(`Timeout of ${e.ms}ms reached while waiting for a response`)})}}}catch(e){t=!0,n=e}finally{try{e&&r.return!=null&&await r.return()}finally{if(t)throw n}}i.next({result:{type:`stopped`}}),d.next({type:`state`,state:`idle`,error:null}),i.complete()}).catch(e=>{i.error(hs.from(e))}),()=>{i.complete(),l.abort(),f.unsubscribe()}})}function ic(e,t){this.v=e,this.k=t}function ac(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof ic;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}ac.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},ac.prototype.next=function(e){return this._invoke(`next`,e)},ac.prototype.throw=function(e){return this._invoke(`throw`,e)},ac.prototype.return=function(e){return this._invoke(`return`,e)};function oc(e){"@babel/helpers - typeof";return oc=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},oc(e)}function sc(e,t){if(oc(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(oc(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function cc(e){var t=sc(e,`string`);return oc(t)==`symbol`?t:t+``}function lc(e,t,n){return(t=cc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uc(Object(n),!0).forEach(function(t){lc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fc(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new pc(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function pc(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return pc=function(e){this.s=e,this.n=e.next},pc.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.throw;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new pc(e)}function mc(e,t){this.v=e,this.k=t}function hc(e){var t={},n=!1;function r(t,r){return n=!0,r=new Promise(function(n){n(e[t](r))}),{done:!1,value:new mc(r,1)}}return t[typeof Symbol<`u`&&Symbol.iterator||`@@iterator`]=function(){return this},t.next=function(e){return n?(n=!1,e):r(`next`,e)},typeof e.throw==`function`&&(t.throw=function(e){if(n)throw n=!1,e;return r(`throw`,e)}),typeof e.return==`function`&&(t.return=function(e){return n?(n=!1,e):r(`return`,e)}),t}function gc(e){return function(){return new _c(e.apply(this,arguments))}}function _c(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof mc;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}_c.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},_c.prototype.next=function(e){return this._invoke(`next`,e)},_c.prototype.throw=function(e){return this._invoke(`throw`,e)},_c.prototype.return=function(e){return this._invoke(`return`,e)};function vc(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function yc(e,t){if(e==null)return{};var n,r,i=vc(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var bc=[`cursor`,`direction`];function xc(e){return{path:e.path.join(`.`)}}function Sc(e){return e.length>=3}function Cc(e){return Sc(e)?{type:`prefixed`,prefix:e[0],path:e[1],args:e[2]}:{type:`unprefixed`,prefix:void 0,path:e[0],args:e[1]}}function wc(e,t,n){let r=Cc(e),i=r.args?.input;return n&&(i=dc(dc(dc({},r.args?.input??{}),n.pageParam===void 0?{}:{cursor:n.pageParam}),{},{direction:n.direction})),[r.path.join(`.`),i,t?.trpc]}async function Tc(e){let t=e.context.client?e.context:dc(dc({},e.context),{},{client:e.queryClient}),n=!1,{iterable:r}=e;function i(){return a.apply(this,arguments)}function a(){return a=gc(function*(){yield*hc(fc(r)),n=!0}),a.apply(this,arguments)}try{return await We({streamFn:i})(t)}finally{n||e.abortController.abort()}}function Ec(e){let t=lo(()=>{let{input:t,type:n}=e,r=e.path.flatMap(e=>e.split(`.`));if(t===void 0&&n===`any`)return r.length?[r]:[];if(n===`infinite`&&io(t)&&(`direction`in t||`cursor`in t)){let{cursor:e,direction:n}=t;return[r,{input:yc(t,bc),type:`infinite`}]}return[r,dc(dc({},t!==void 0&&t!==se&&{input:t}),n&&n!==`any`&&{type:n})]});return e.prefix&&t.unshift([e.prefix]),t}function Dc(e){let t=[e.path.flatMap(e=>e.split(`.`))];return e.prefix&&t.unshift([e.prefix]),t}function Oc(e){return ao(e)?e():e}function kc(e){let{input:t,query:n,path:r,queryKey:i,opts:a}=e,o=t===se;return Object.assign(it(dc(dc({},a??{}),{},{queryKey:i,queryFn:o?se:async e=>{var t;let r=dc(dc({},a),{},{trpc:dc(dc({},a?.trpc),a!=null&&(t=a.trpc)!=null&&t.abortOnUnmount?{signal:e.signal}:{signal:null})});return await n(...wc(i,r,{direction:e.direction,pageParam:e.pageParam}))},initialPageParam:a?.initialCursor??t?.cursor})),{trpc:xc({path:r})})}function Ac(e){let{mutate:t,path:n,prefix:r,opts:i,overrides:a}=e,o=Oc(e.queryClient),s=Dc({path:n,prefix:i?.keyPrefix??r}),c=o.defaultMutationOptions(o.getMutationDefaults(s)),l=a?.onSuccess??(e=>e.originalFn());return dc(dc({},i),{},{mutationKey:s,mutationFn:async e=>await t(...wc([...s,{input:e}],i)),onSuccess(...e){return l({originalFn:()=>{var t,n;return(i==null||(t=i.onSuccess)==null?void 0:t.call(i,...e))??(c==null||(n=c.onSuccess)==null?void 0:n.call(c,...e))},queryClient:o,meta:i?.meta??c?.meta??{}})},trpc:xc({path:n})})}function jc(e){let{input:t,query:n,path:r,queryKey:i,opts:a}=e,o=Oc(e.queryClient),s=t===se;return Object.assign(rt(dc(dc({},a),{},{queryKey:i,queryFn:s?se:async e=>{var t;let r=new AbortController,i=dc(dc({},a),{},{trpc:dc(dc({},a?.trpc),a!=null&&(t=a.trpc)!=null&&t.abortOnUnmount?{signal:e.signal}:{signal:r.signal})}),s=e.queryKey,c=await n(...wc(s,i));return co(c)?Tc({iterable:c,context:e,queryClient:o,abortController:r}):c}})),{trpc:xc({path:r})})}var Mc=e=>{let{subscribe:t,path:n,queryKey:r,input:i,opts:a={}}=e,o=`enabled`in a?!!a.enabled:i!==se;return dc(dc({},a),{},{enabled:o,subscribe:e=>t(n.join(`.`),i===se?void 0:i,dc(dc({},e),{},{onComplete:()=>e.onComplete?.call(e)})),queryKey:r,trpc:xc({path:n})})};function Nc(e){let t=e.keyPrefix,n=t=>(n,r,i)=>`router`in e?Promise.resolve(Oc(e.ctx)).then(i=>Fo({router:e.router,path:n,getRawInput:async()=>r,ctx:i,type:t,signal:void 0,batchIndex:0})):(e.client instanceof Ks?e.client:Qs(e.client))[t](n,r,i);return _o(({args:r,path:i})=>{let a=[...i],o=a.pop(),[s,c]=r;return{"~types":void 0,"~queryClient":()=>Oc(e.queryClient),pathKey:()=>Ec({path:a,type:`any`,prefix:t}),pathFilter:()=>dc(dc({},s),{},{queryKey:Ec({path:a,type:`any`,prefix:t})}),queryOptions:()=>jc({input:s,opts:c,path:a,queryClient:e.queryClient,queryKey:Ec({path:a,input:s,type:`query`,prefix:t}),query:n(`query`)}),queryKey:()=>Ec({path:a,input:s,type:`query`,prefix:t}),queryFilter:()=>dc(dc({},c),{},{queryKey:Ec({path:a,input:s,type:`query`,prefix:t})}),infiniteQueryOptions:()=>kc({input:s,opts:c,path:a,queryClient:e.queryClient,queryKey:Ec({path:a,input:s,type:`infinite`,prefix:t}),query:n(`query`)}),infiniteQueryKey:()=>Ec({path:a,input:s,type:`infinite`,prefix:t}),infiniteQueryFilter:()=>dc(dc({},c),{},{queryKey:Ec({path:a,input:s,type:`infinite`,prefix:t})}),mutationOptions:()=>Ac({opts:s,path:a,prefix:t,queryClient:e.queryClient,mutate:n(`mutation`),overrides:e.overrides?.mutations}),mutationKey:()=>Dc({path:a,prefix:t}),subscriptionOptions:()=>Mc({opts:c,path:a,input:s,queryKey:Ec({path:a,input:s,type:`any`,prefix:t}),subscribe:n(`subscription`)})}[o]()})}function Pc(){let e=b.createContext(null),t=b.createContext(null),n=n=>{let r=b.useMemo(()=>Nc({client:n.trpcClient,queryClient:n.queryClient,keyPrefix:n.keyPrefix}),[n.trpcClient,n.queryClient,n.keyPrefix]);return b.createElement(e.Provider,{value:n.trpcClient},b.createElement(t.Provider,{value:r},n.children))};n.displayName=`TRPCProvider`;function r(){let e=b.useContext(t);if(!e)throw Error(`useTRPC() can only be used inside of a <TRPCProvider>`);return e}function i(){let t=b.useContext(e);if(!t)throw Error(`useTRPCClient() can only be used inside of a <TRPCProvider>`);return t}return{TRPCProvider:n,useTRPC:r,useTRPCClient:i}}function Fc(e){let t=b.useRef(e);t.current=e;let n=b.useRef(new Set([])),r=b.useCallback(e=>{n.current.add(e)},[]),i=b.useRef(()=>{}),a=b.useCallback(()=>{var n;if((n=i.current)==null||n.call(i),u(o),!e.enabled)return;let r=!1,a=!1,s=()=>{a||(a=!0,u(e=>dc(dc({},e),{},{status:`idle`,data:void 0,error:null})))},c=e.subscribe({onStarted:()=>{var e,n;(e=(n=t.current).onStarted)==null||e.call(n),u(e=>dc(dc({},e),{},{status:`pending`,error:null}))},onData:e=>{var n,r;(n=(r=t.current).onData)==null||n.call(r,e),u(t=>dc(dc({},t),{},{status:`pending`,data:e,error:null}))},onError:e=>{var n,r;(n=(r=t.current).onError)==null||n.call(r,e),u(t=>dc(dc({},t),{},{status:`error`,error:e}))},onStopped:()=>{var e,n;r||(s(),(e=(n=t.current).onStopped)==null||e.call(n))},onComplete:()=>{var e,n;r||(s(),(e=(n=t.current).onComplete)==null||e.call(n))},onConnectionStateChange:e=>{var n,r;(n=(r=t.current).onConnectionStateChange)==null||n.call(r,e),u(t=>{switch(e.state){case`connecting`:return dc(dc({},t),{},{status:`connecting`,error:e.error});case`pending`:return t;case`idle`:return dc(dc({},t),{},{status:`idle`,data:void 0,error:null})}})}});i.current=()=>{r=!0,c.unsubscribe()}},[L(e.queryKey),e.enabled]),o=b.useCallback(()=>e.enabled?{data:void 0,error:null,status:`connecting`,reset:a}:{data:void 0,error:null,status:`idle`,reset:a},[e.enabled,a]),s=b.useRef(o()),[c,l]=b.useState(Ic(s,r));c.reset=a;let u=b.useCallback(e=>{let t=s.current,i=s.current=e(t),a=!1;for(let e of n.current)if(t[e]!==i[e]){a=!0;break}a&&l(Ic(s,r))},[r]);return b.useEffect(()=>{if(e.enabled)return a(),()=>{var e;(e=i.current)==null||e.call(i)}},[a,e.enabled]),c}function Ic(e,t){return new Proxy(e.current,{get(n,r){return t(r),e.current[r]}})}function Lc(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Lc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Rc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Lc(e))&&(r&&(r+=` `),r+=t);return r}var zc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Bc=(e,t)=>({classGroupId:e,validator:t}),Vc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Hc=`-`,Uc=[],Wc=`arbitrary..`,Gc=e=>{let t=Jc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return qc(e);let n=e.split(Hc);return Kc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?zc(i,t):t:i||Uc}return n[e]||Uc}}},Kc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Kc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Hc):e.slice(t).join(Hc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},qc=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Wc+r:void 0})(),Jc=e=>{let{theme:t,classGroups:n}=e;return Yc(n,t)},Yc=(e,t)=>{let n=Vc();for(let r in e)Xc(e[r],n,r,t);return n},Xc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++)Zc(e[a],t,n,r)},Zc=(e,t,n,r)=>{typeof e==`string`?Qc(e,t,n):typeof e==`function`?$c(e,t,n,r):el(e,t,n,r)},Qc=(e,t,n)=>{let r=e===``?t:tl(t,e);r.classGroupId=n},$c=(e,t,n,r)=>{nl(e)?Xc(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(Bc(n,e)))},el=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Xc(o,tl(t,a),n,r)}},tl=(e,t)=>{let n=e,r=t.split(Hc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Vc(),n.nextPart.set(t,i)),n=i}return n},nl=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,rl=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},il=`!`,al=`:`,ol=[],sl=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),cl=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let c=e[s];if(n===0&&r===0){if(c===al){t.push(e.slice(i,s)),i=s+1;continue}if(c===`/`){a=s;continue}}if(c===`[`)n++;else if(c===`]`)n--;else if(c===`(`)r++;else if(c===`)`)r--;else if(c===`\\`)s++;else if(c===`"`||c===`'`)for(;++s<o;){let t=e[s];if(t===`\\`)s++;else if(t===c)break}}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(il)?(c=s.slice(0,-1),l=!0):s.startsWith(il)&&(c=s.slice(1),l=!0);let u=l&&s.startsWith(il)?1:0,d=a&&a>i?a-i-u:void 0;return sl(t,l,c,d)};if(t){let e=t+al,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):sl(ol,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ll=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ul=e=>({cache:rl(e.cacheSize),parseClassName:cl(e),sortModifiers:ll(e),postfixLookupClassGroupIds:dl(e),...Gc(e)}),dl=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},fl=/\s+/,pl=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(fl),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+il:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},ml=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=hl(n))&&(i&&(i+=` `),i+=r);return i},hl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=hl(e[r]))&&(n&&(n+=` `),n+=t);return n},gl=(e,...t)=>{let n,r,i,a,o=o=>(n=ul(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=pl(e,n);return i(e,a),a};return a=o,(...e)=>a(ml(...e))},_l=[],vl=e=>{let t=t=>t[e]||_l;return t.isThemeGetter=!0,t.themeKey=e,t},yl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xl=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Sl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|Q|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^--spacing\(.+\)|^0$/,wl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark|contrast-color|device-cmyk|--alpha)\(.+\)$/i,Tl=/^(?:_*[+-]?(?:\d|\.\d)|[\w-]+\(|_*(?:inherit|initial|revert(?:-layer)?|unset)_*$)/i,El=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ol=e=>xl.test(e),kl=e=>!!e&&!Number.isNaN(Number(e)),Al=e=>!!e&&Number.isInteger(Number(e)),jl=e=>e.endsWith(`%`)&&kl(e.slice(0,-1)),Ml=e=>Sl.test(e),Nl=()=>!0,Pl=e=>Cl.test(e)&&!wl.test(e),Fl=e=>Tl.test(e)&&!wl.test(e),Il=()=>!1,Ll=e=>El.test(e),Rl=e=>Dl.test(e),zl=e=>!G(e)&&!Xl(e),Bl=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Vl=e=>au(e,lu,Il),G=e=>yl.test(e),Hl=e=>au(e,uu,Pl),Ul=e=>au(e,du,Fl),Wl=e=>au(e,fu,kl),Gl=e=>au(e,mu,Nl),Kl=e=>au(e,pu,Il),ql=e=>au(e,su,Il),Jl=e=>au(e,cu,Rl),Yl=e=>au(e,hu,Ll),Xl=e=>bl.test(e),Zl=e=>ou(e,uu),Ql=e=>ou(e,du,!0),$l=e=>ou(e,pu),eu=e=>ou(e,su),tu=e=>ou(e,lu),nu=e=>ou(e,cu),ru=e=>ou(e,hu,!0),iu=e=>ou(e,mu,!0),au=(e,t,n)=>{let r=yl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ou=(e,t,n=!1)=>{let r=bl.exec(e);return r?r[1]?t(r[1]):n:!1},su=e=>e===`position`||e===`percentage`,cu=e=>e===`image`||e===`url`,lu=e=>e===`length`||e===`size`||e===`bg-size`,uu=e=>e===`length`,du=e=>e!==`color`,fu=e=>e===`number`,pu=e=>e===`family-name`,mu=e=>e===`number`||e===`weight`,hu=e=>e===`shadow`,gu=gl(()=>{let e=vl(`color`),t=vl(`font`),n=vl(`text`),r=vl(`font-weight`),i=vl(`tracking`),a=vl(`leading`),o=vl(`breakpoint`),s=vl(`container`),c=vl(`spacing`),l=vl(`radius`),u=vl(`shadow`),d=vl(`inset-shadow`),f=vl(`text-shadow`),p=vl(`drop-shadow`),m=vl(`blur`),h=vl(`perspective`),g=vl(`aspect`),_=vl(`ease`),v=vl(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Xl,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Xl,G,c],T=()=>[Ol,`full`,`auto`,...w()],E=()=>[Al,`none`,`subgrid`,Xl,G],D=()=>[`auto`,{span:[`full`,Al,Xl,G]},Al,Xl,G],O=()=>[Al,`auto`,Xl,G],k=()=>[`auto`,`min`,`max`,`fr`,Xl,G],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Ol,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,Ol,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Ol,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Xl,G],L=()=>[...b(),eu,ql,{position:[Xl,G]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,tu,Vl,{size:[Xl,G]}],B=()=>[jl,Zl,Hl],ee=()=>[``,`none`,`full`,l,Xl,G],V=()=>[``,kl,Zl,Hl],te=()=>[`solid`,`dashed`,`dotted`,`double`],ne=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],re=()=>[kl,jl,Ql,Ul],ie=()=>[``,`none`,m,Xl,G],ae=()=>[`none`,kl,Xl,G],oe=()=>[`none`,kl,Xl,G],se=()=>[kl,Xl,G],H=()=>[Ol,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ml],breakpoint:[Ml],color:[Nl],container:[Ml],"drop-shadow":[Ml],ease:[`in`,`out`,`in-out`],font:[zl],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ml],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ml],shadow:[Ml],spacing:[`px`,kl],text:[Ml],"text-shadow":[Ml],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ol,G,Xl,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Xl,G]}],"container-named":[Bl],columns:[{columns:[kl,`auto`,G,Xl,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`],"not-sr":[`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Al,`auto`,Xl,G]}],basis:[{basis:[Ol,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[kl,Ol,`auto`,`initial`,`none`,Xl,G]}],grow:[{grow:[``,kl,Xl,G]}],shrink:[{shrink:[``,kl,Xl,G]}],order:[{order:[Al,`first`,`last`,`none`,Xl,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,Zl,Hl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,iu,Gl]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,jl,G]}],"font-family":[{font:[$l,Kl,t]}],"font-features":[{"font-features":[G]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Xl,G]}],"line-clamp":[{"line-clamp":[kl,`none`,Xl,G]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Xl,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Xl,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...te(),`wavy`]}],"text-decoration-thickness":[{decoration:[kl,`from-font`,`auto`,Zl,eu,Hl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[kl,`auto`,Xl,G]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Al,Xl,G]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Xl,G]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Xl,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Al,Xl,G],radial:[``,Xl,G],conic:[``,Al,Xl,G]},nu,Jl]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...te(),`hidden`,`none`]}],"divide-style":[{divide:[...te(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...te(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[kl,Xl,G]}],"outline-w":[{outline:[``,kl,Zl,Hl]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,ru,Yl]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,ru,Yl]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[kl,Hl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,ru,Yl]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[kl,Xl,G]}],"mix-blend":[{"mix-blend":[...ne(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[kl]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Xl,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{mask:[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[kl]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Xl,G]}],filter:[{filter:[``,`none`,Xl,G]}],blur:[{blur:ie()}],brightness:[{brightness:[kl,Xl,G]}],contrast:[{contrast:[kl,Xl,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ru,Yl]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,kl,Xl,G]}],"hue-rotate":[{"hue-rotate":[kl,Xl,G]}],invert:[{invert:[``,kl,Xl,G]}],saturate:[{saturate:[kl,Xl,G]}],sepia:[{sepia:[``,kl,Xl,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Xl,G]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[kl,Xl,G]}],"backdrop-contrast":[{"backdrop-contrast":[kl,Xl,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,kl,Xl,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[kl,Xl,G]}],"backdrop-invert":[{"backdrop-invert":[``,kl,Xl,G]}],"backdrop-opacity":[{"backdrop-opacity":[kl,Xl,G]}],"backdrop-saturate":[{"backdrop-saturate":[kl,Xl,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,kl,Xl,G]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Xl,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[kl,`initial`,Xl,G]}],ease:[{ease:[`linear`,`initial`,_,Xl,G]}],delay:[{delay:[kl,Xl,G]}],animate:[{animate:[`none`,v,Xl,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Xl,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":[`scale-3d`],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[Xl,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":[`translate-none`],zoom:[{zoom:[Al,Xl,G]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Xl,G]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Xl,G]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[kl,Zl,Hl,Wl]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],"place-content":[`align-content`,`justify-content`],"place-items":[`align-items`,`justify-items`],"place-self":[`align-self`,`justify-self`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"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`],sr:`not-sr.position.size.w.h.p.px.py.ps.pe.pbs.pbe.pt.pr.pb.pl.m.mx.my.ms.me.mbs.mbe.mt.mr.mb.ml.overflow.overflow-x.overflow-y.whitespace`.split(`.`),"not-sr":[`sr`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],"mask-image-x-from-pos":[`mask-image-r-from-pos`,`mask-image-l-from-pos`],"mask-image-x-to-pos":[`mask-image-r-to-pos`,`mask-image-l-to-pos`],"mask-image-x-from-color":[`mask-image-r-from-color`,`mask-image-l-from-color`],"mask-image-x-to-color":[`mask-image-r-to-color`,`mask-image-l-to-color`],"mask-image-y-from-pos":[`mask-image-t-from-pos`,`mask-image-b-from-pos`],"mask-image-y-to-pos":[`mask-image-t-to-pos`,`mask-image-b-to-pos`],"mask-image-y-from-color":[`mask-image-t-from-color`,`mask-image-b-from-color`],"mask-image-y-to-color":[`mask-image-t-to-color`,`mask-image-b-to-color`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function K(...e){return gu(Rc(e))}function _u(){let e=/(?:^|;\s*)forge_csrf=([^;]*)/.exec(document.cookie);return e?decodeURIComponent(e[1]):``}function vu(e,t=Date.now()){if(!e)return``;let n=Math.max(0,(t-Date.parse(e))/1e3);return n<45?`now`:n<3600?`${Math.round(n/60)}m`:n<86400?`${Math.round(n/3600)}h`:n<604800?`${Math.round(n/86400)}d`:new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function yu(e,t=Date.now()){let n=vu(e,t);return n===`now`?`just now`:/\d[mhd]$/.test(n)?`${n} ago`:n}function bu(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,hour12:!1}):``}function xu(e){return Math.floor(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())/864e5)}function Su(e,t=Date.now()){if(!e)return``;let n=new Date(e);if(Number.isNaN(n.getTime()))return``;let r=bu(e),i=new Date(t),a=xu(i)-xu(n);return a<=0?r:a===1?`yesterday at ${r}`:`${n.toLocaleDateString(void 0,{month:`numeric`,day:`numeric`,...n.getFullYear()===i.getFullYear()?{}:{year:`numeric`}})} ${r}`}function Cu(e){return e%100>=11&&e%100<=13?`th`:[`th`,`st`,`nd`,`rd`][e%10]||`th`}function wu(e){if(!e)return``;let t=new Date(e);if(Number.isNaN(t.getTime()))return``;let n=t.toLocaleDateString(`en-US`,{month:`long`});return`${bu(e)}, ${t.getDate()}${Cu(t.getDate())} ${n} ${t.getFullYear()}`}function Tu(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}var Eu=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform),Du=Zs({links:[Za({condition:e=>e.type===`subscription`,true:rc({url:`/api/trpc`}),false:Fs({url:`/api/trpc`,headers:()=>({"x-forge-token":_u()})})})]}),{TRPCProvider:Ou,useTRPC:ku}=Pc(),Au=[{id:`commandPalette.toggle`,label:`Command palette`,group:`General`,key:`mod+k`,inFields:!0},{id:`settings.open`,label:`Open settings`,group:`General`,key:`mod+,`,inFields:!0},{id:`usage.open`,label:`Open usage`,group:`General`,key:`mod+u`},{id:`navigation.back`,label:`Go back`,group:`General`,key:`mod+[`},{id:`navigation.forward`,label:`Go forward`,group:`General`,key:`mod+]`},{id:`sidebar.toggle`,label:`Toggle sidebar`,group:`Panels`,key:`mod+b`,inFields:!0},{id:`rightPanel.toggle`,label:`Toggle right panel`,group:`Panels`,key:`mod+j`,inFields:!0},{id:`terminal.toggle`,label:`Toggle terminal`,group:`Panels`,key:"mod+`",inFields:!0},{id:`preview.toggle`,label:`Show preview`,group:`Panels`,key:`mod+shift+j`,inFields:!0},{id:`diff.toggle`,label:`Show diff`,group:`Panels`,key:`mod+d`},{id:`chat.new`,label:`New chat`,group:`Chat`,key:`mod+shift+o`,inFields:!0}];function ju(e,t){let n=t.find(t=>t.command===e.id);return n?n.key:e.key}var Mu={Backquote:"`",Comma:`,`,Period:`.`,Slash:`/`,BracketLeft:`[`,BracketRight:`]`,Minus:`-`,Equal:`=`,Semicolon:`;`,Quote:`'`,Backslash:`\\`};function Nu(e){if([`Control`,`Meta`,`Shift`,`Alt`].includes(e.key))return``;let t=[];(Eu?e.metaKey:e.ctrlKey)&&t.push(`mod`),Eu&&e.ctrlKey&&t.push(`ctrl`),!Eu&&e.metaKey&&t.push(`meta`),e.altKey&&t.push(`alt`),e.shiftKey&&t.push(`shift`);let n=``;return n=/^Key[A-Z]$/.test(e.code)?e.code.slice(3).toLowerCase():/^Digit\d$/.test(e.code)?e.code.slice(5):Mu[e.code]?Mu[e.code]:(e.key.length,e.key.toLowerCase()),n===` `&&(n=`space`),t.push(n),t.join(`+`)}function Pu(e){if(!e)return[];let t=Eu?{mod:`⌘`,ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`}:{mod:`Ctrl`,ctrl:`Ctrl`,alt:`Alt`,shift:`Shift`,meta:`Win`};return e.split(`+`).map((e,n,r)=>n<r.length-1?t[e]||e:e===`space`?`Space`:e.startsWith(`arrow`)?{arrowup:`↑`,arrowdown:`↓`,arrowleft:`←`,arrowright:`→`}[e]||e:e.length===1?e.toUpperCase():e[0].toUpperCase()+e.slice(1))}function Fu(e){return Pu(e).join(Eu?``:`+`)}function Iu(e){let t=new Map;for(let n of Au){let r=ju(n,e);r&&t.set(r,[...t.get(r)||[],n.id])}for(let[e,n]of t)n.length<2&&t.delete(e);return t}function Lu(){let e=ku(),t=C();Fc(e.events.subscriptionOptions(void 0,{onData:({data:n})=>{let r=n.event;switch(r.type){case`projects`:t.invalidateQueries({queryKey:e.projects.list.queryKey()}),t.invalidateQueries({queryKey:e.projects.get.pathKey()});break;case`chats`:case`run`:t.invalidateQueries({queryKey:e.chats.list.queryKey({projectId:r.projectId})}),t.invalidateQueries({queryKey:e.projects.list.queryKey()}),t.invalidateQueries({queryKey:e.chats.get.pathKey()}),t.invalidateQueries({queryKey:e.chats.recent.pathKey()}),t.invalidateQueries({queryKey:e.chats.usage.pathKey()}),t.invalidateQueries({queryKey:e.chats.overlaps.pathKey()}),t.invalidateQueries({queryKey:e.usage.report.pathKey()}),t.invalidateQueries({queryKey:e.plans.list.pathKey()});break;case`dev`:t.invalidateQueries({queryKey:e.dev.status.queryKey({projectId:r.projectId})}),t.invalidateQueries({queryKey:e.projects.info.queryKey({id:r.projectId})}),t.invalidateQueries({queryKey:e.projects.list.queryKey()});break;case`browserWrite`:t.invalidateQueries({queryKey:e.agent.writes.queryKey({chatId:r.chatId})});break;case`terminals`:t.invalidateQueries({queryKey:e.terminals.list.queryKey({projectId:r.projectId})});break;case`files`:t.invalidateQueries({queryKey:e.chats.overlaps.pathKey()}),t.invalidateQueries({queryKey:e.diffs.files.pathKey()}),t.invalidateQueries({queryKey:e.diffs.file.pathKey()}),t.invalidateQueries({queryKey:e.files.tree.pathKey()}),t.invalidateQueries({queryKey:e.refs.list.pathKey()}),t.invalidateQueries({queryKey:e.edits.undone.queryKey({projectId:r.projectId})}),t.invalidateQueries({queryKey:e.projects.info.queryKey({id:r.projectId})}),t.invalidateQueries({queryKey:e.plans.list.pathKey()});break;case`refs`:t.invalidateQueries({queryKey:e.refs.list.queryKey({projectId:r.projectId})});break;case`push`:t.invalidateQueries({queryKey:e.push.state.queryKey({projectId:r.projectId})});break;case`agent`:t.invalidateQueries({queryKey:e.agent.info.queryKey({projectId:r.projectId})});break;case`settings`:t.invalidateQueries({queryKey:e.settings.get.queryKey()}),t.invalidateQueries({queryKey:e.settings.prices.queryKey()}),t.invalidateQueries({queryKey:e.models.queryKey()}),t.invalidateQueries({queryKey:e.meta.queryKey()});break;case`create`:t.invalidateQueries({queryKey:e.wizard.job.queryKey({id:r.id})});break;case`update`:r.state?t.setQueryData(e.about.update.queryKey(),r.state):r.line||t.invalidateQueries({queryKey:e.about.update.queryKey()}),(r.line!==void 0||r.done)&&window.dispatchEvent(new CustomEvent(`forge:update`,{detail:r}));break;case`profiles`:t.invalidateQueries({queryKey:e.profiles.list.queryKey()}),t.invalidateQueries({queryKey:e.projects.info.pathKey()}),r.login&&window.dispatchEvent(new CustomEvent(`forge:login`,{detail:r.login}));break;case`claude`:t.invalidateQueries({queryKey:e.claude.status.queryKey()}),t.invalidateQueries({queryKey:e.models.queryKey()})}}}))}var Ru={sidebarOpen:!0,sidebarWidth:256,panelOpen:!0,panelWidth:540,panelTab:`preview`,closedTabs:[],drawerOpen:!1,drawerHeight:280,activeTerminal:``,diffScope:`session`,diffSplit:!1,diffPath:``,openFile:``,openFiles:[],fileReveal:null,pushOpen:!1,newProject:``,theme:`system`,sidebarView:`projects`},zu=`forge.ui`;function Bu(){try{let e=JSON.parse(localStorage.getItem(zu)||`{}`);return e.panelTab===`file`&&(e.openFiles=e.openFile?[e.openFile]:[],e.panelTab=e.openFile?`file:${e.openFile}`:`files`),{...Ru,...e,fileReveal:null,pushOpen:!1,newProject:``,theme:localStorage.getItem(`forge.theme`)||Ru.theme}}catch{return Ru}}var Vu=Bu(),Hu=new Set;function Uu(e){Vu={...Vu,...e};let{theme:t,...n}=Vu;localStorage.setItem(zu,JSON.stringify(n)),localStorage.setItem(`forge.theme`,t),`theme`in e&&Gu(t);for(let e of Hu)e()}function Wu(){return(0,b.useSyncExternalStore)(e=>(Hu.add(e),()=>Hu.delete(e)),()=>Vu)}function Gu(e){let t=e===`dark`||e===`system`&&matchMedia(`(prefers-color-scheme: dark)`).matches;if(document.documentElement.classList.toggle(`dark`,t),t!==Ku){Ku=t;for(let e of Hu)e()}}var Ku=document.documentElement.classList.contains(`dark`);function qu(){return(0,b.useSyncExternalStore)(e=>(Hu.add(e),()=>Hu.delete(e)),()=>Ku)}matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{Vu.theme===`system`&&Gu(`system`)});var Ju=0;function Yu(e,t=null){let n=e.replace(/\\/g,`/`).replace(/\/+$/,``);if(!n)return;let r=Vu.openFiles.includes(n)?Vu.openFiles:[...Vu.openFiles,n],i=Vu.closedTabs.includes(`files`)?Vu.closedTabs:[...Vu.closedTabs,`files`];Ju+=1,Uu({openFiles:r,openFile:n,panelTab:`file:${n}`,panelOpen:!0,closedTabs:i,fileReveal:{path:n,line:t,id:Ju}})}function Xu(e){return e.startsWith(`file:`)?e.slice(5):null}var Zu=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Qu(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Zu(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var $u=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},ed=e=>{let t=$u(e);return t.charAt(0).toUpperCase()+t.slice(1)},td=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),nd={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function rd(e){return e!=null}function id(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??nd.width,a=e.size??e.height??nd.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?td(...c):td(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??nd[`stroke-width`])*Number(e.size??e.width??nd.width)/Number(t.size??t.width??nd.width):t.strokeWidth??nd[`stroke-width`];return[`svg`,{...Object.entries(nd).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&rd(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&rd(t.width)&&{[r(`width`)]:t.width},...`height`in t&&rd(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function ad(e,t={}){return id(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var od=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},sd=(0,b.createContext)({}),cd=()=>(0,b.useContext)(sd),ld=(0,b.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=cd()??{},y=!!c||od(d),[x,S,C=[]]=ad(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:td(v,s),hasA11yProp:y,attributes:d});return(0,b.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function q(e,t=[],n=[]){let r=typeof e==`string`?Qu(e,t,n):e,i=(0,b.forwardRef)(({className:e,...t},n)=>(0,b.createElement)(ld,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=ed(r.name)),i}var ud={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};ud.node;var dd=q(ud),fd={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};fd.node;var pd=q(fd),md={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};md.node;var hd=q(md),gd={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};gd.node;var _d=q(gd),vd={name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]};vd.node;var yd=q(vd),bd={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};bd.node;var xd=q(bd),Sd={name:`bookmark-check`,size:24,node:[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}],[`path`,{d:`m9 10 2 2 4-4`,key:`1gnqz4`}]]};Sd.node;var Cd=q(Sd),wd={name:`bookmark-plus`,size:24,node:[[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M15 10H9`,key:`o6yqo3`}],[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]};wd.node;var Td=q(wd),Ed={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Ed.node;var Dd=q(Ed),Od={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};Od.node;var kd=q(Od),Ad={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};Ad.node;var jd=q(Ad),Md={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};Md.node;var Nd=q(Md),Pd={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};Pd.node;var Fd=q(Pd),Id={name:`chart-no-axes-column`,size:24,node:[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V3`,key:`1lcnhd`}],[`path`,{d:`M19 21V9`,key:`unv183`}]],aliases:[`bar-chart-2`]};Id.node;var Ld=q(Id),Rd={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Rd.node;var zd=q(Rd),Bd={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Bd.node;var Vd=q(Bd),Hd={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Hd.node;var Ud=q(Hd),Wd={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Wd.node;var Gd=q(Wd),Kd={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Kd.node;var qd=q(Kd),Jd={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Jd.node;var Yd=q(Jd),Xd={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};Xd.node;var Zd=q(Xd),Qd={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};Qd.node;var $d=q(Qd),ef={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};ef.node;var tf=q(ef),nf={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};nf.node;var rf=q(nf),af={name:`cloud-download`,size:24,node:[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]],aliases:[`download-cloud`]};af.node;var of=q(af),sf={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};sf.node;var cf=q(sf),lf={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};lf.node;var uf=q(lf),df={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};df.node;var ff=q(df),pf={name:`diamond`,size:24,node:[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]};pf.node;var mf=q(pf),hf={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};hf.node;var gf=q(hf),_f={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};_f.node;var vf=q(_f),yf={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};yf.node;var bf=q(yf),xf={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};xf.node;var Sf=q(xf),Cf={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Cf.node;var wf=q(Cf),Tf={name:`file-diff`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]};Tf.node;var Ef=q(Tf),Df={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Df.node;var Of=q(Df),kf={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};kf.node;var Af=q(kf),jf={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};jf.node;var Mf=q(jf),Nf={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Nf.node;var Pf=q(Nf),Ff={name:`folder-symlink`,size:24,node:[[`path`,{d:`M2 9.35V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7`,key:`y8kt7d`}],[`path`,{d:`m8 16 3-3-3-3`,key:`rlqrt1`}]]};Ff.node;var If=q(Ff),Lf={name:`folder-tree`,size:24,node:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]};Lf.node;var Rf=q(Lf),zf={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};zf.node;var Bf=q(zf),Vf={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};Vf.node;var Hf=q(Vf),Uf={name:`git-compare`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]};Uf.node;var Wf=q(Uf),Gf={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Gf.node;var Kf=q(Gf),qf={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};qf.node;var Jf=q(qf),Yf={name:`hammer`,size:24,node:[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]};Yf.node;var Xf=q(Yf),Zf={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};Zf.node;var Qf=q(Zf),$f={name:`hourglass`,size:24,node:[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]};$f.node;var ep=q($f),tp={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};tp.node;var np=q(tp),rp={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};rp.node;var ip=q(rp),ap={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};ap.node;var op=q(ap),sp={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};sp.node;var cp=q(sp),lp={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};lp.node;var up=q(lp),dp={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};dp.node;var fp=q(dp),pp={name:`library-big`,size:24,node:[[`rect`,{width:`8`,height:`18`,x:`3`,y:`3`,rx:`1`,key:`oynpb5`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z`,key:`1qboyk`}]]};pp.node;var mp=q(pp),hp={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};hp.node;var gp=q(hp),_p={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};_p.node;var vp=q(_p),yp={name:`list-todo`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]};yp.node;var bp=q(yp),xp={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};xp.node;var Sp=q(xp),Cp={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]};Cp.node;var wp=q(Cp),Tp={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Tp.node;var Ep=q(Tp),Dp={name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]};Dp.node;var Op=q(Dp),kp={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};kp.node;var Ap=q(kp),jp={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]};jp.node;var Mp=q(jp),Np={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};Np.node;var Pp=q(Np),Fp={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Fp.node;var Ip=q(Fp),Lp={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};Lp.node;var Rp=q(Lp),zp={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};zp.node;var Bp=q(zp),Vp={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Vp.node;var Hp=q(Vp),Up={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};Up.node;var Wp=q(Up),Gp={name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]};Gp.node;var Kp=q(Gp),qp={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};qp.node;var Jp=q(qp),Yp={name:`package-search`,size:24,node:[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M20.27 18.27 22 20`,key:`er2am`}],[`path`,{d:`M21 10.498V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l.98-.559`,key:`tok1h1`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}],[`circle`,{cx:`18.5`,cy:`16.5`,r:`2.5`,key:`ke13xx`}]]};Yp.node;var Xp=q(Yp),Zp={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};Zp.node;var Qp=q(Zp),$p={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};$p.node;var em=q($p),tm={name:`panel-bottom`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};tm.node;var nm=q(tm),rm={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};rm.node;var im=q(rm),am={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};am.node;var om=q(am),sm={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};sm.node;var cm=q(sm),lm={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};lm.node;var um=q(lm),dm={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};dm.node;var fm=q(dm),pm={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};pm.node;var mm=q(pm),hm={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};hm.node;var gm=q(hm),_m={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};_m.node;var vm=q(_m),ym={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};ym.node;var bm=q(ym),xm={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};xm.node;var Sm=q(xm),Cm={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Cm.node;var wm=q(Cm),Tm={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};Tm.node;var Em=q(Tm),Dm={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Dm.node;var Om=q(Dm),km={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};km.node;var Am=q(km),jm={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};jm.node;var Mm=q(jm),Nm={name:`scale`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]};Nm.node;var Pm=q(Nm),Fm={name:`scan-search`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]};Fm.node;var Im=q(Fm),Lm={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Lm.node;var Rm=q(Lm),zm={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};zm.node;var Bm=q(zm),Vm={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Vm.node;var Hm=q(Vm),Um={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Um.node;var Wm=q(Um),Gm={name:`shield-exclamation-point`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]],aliases:[`shield-alert`]};Gm.node;var Km=q(Gm),qm={name:`shield-question-mark`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 01-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 011-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 011.52 0C14.51 3.81 17 5 19 5a1 1 0 011 1z`,key:`1buusj`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`shield-question`]};qm.node;var Jm=q(qm),Ym={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};Ym.node;var Xm=q(Ym),Zm={name:`sigma`,size:24,node:[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]};Zm.node;var Qm=q(Zm),$m={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};$m.node;var eh=q($m),th={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};th.node;var nh=q(th),rh={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};rh.node;var ih=q(rh),ah={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};ah.node;var oh=q(ah),sh={name:`stethoscope`,size:24,node:[[`path`,{d:`M11 2v2`,key:`1539x4`}],[`path`,{d:`M5 2v2`,key:`1yf1q8`}],[`path`,{d:`M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1`,key:`rb5t3r`}],[`path`,{d:`M8 15a6 6 0 0 0 12 0v-3`,key:`x18d4x`}],[`circle`,{cx:`20`,cy:`10`,r:`2`,key:`ts1r5v`}]]};sh.node;var ch=q(sh),lh={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};lh.node;var uh=q(lh),dh={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};dh.node;var fh=q(dh),ph={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};ph.node;var mh=q(ph),hh={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};hh.node;var gh=q(hh),_h={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};_h.node;var vh=q(_h),yh={name:`triangle-exclamation-point`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`,`triangle-alert`]};yh.node;var bh=q(yh),xh={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};xh.node;var Sh=q(xh),Ch={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};Ch.node;var wh=q(Ch),Th={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Th.node;var Eh=q(Th),Dh={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Dh.node;var Oh=q(Dh),kh=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ah=Rc,jh=((e,t)=>n=>{if(t?.variants==null)return Ah(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=kh(t)||kh(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ah(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-[var(--control-radius)] border border-transparent text-sm font-medium outline-none transition-[background-color,color,box-shadow,transform] select-none active:scale-[0.97] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-64 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow-[0_1px_2px_color-mix(in_oklab,var(--primary)_24%,transparent),inset_0_1px_rgb(255_255_255/16%)] hover:bg-primary/90`,outline:`border-input bg-popover shadow-xs/5 hover:bg-accent/50 dark:bg-input/32 dark:hover:bg-input/48`,ghost:`hover:bg-accent [&_svg]:text-icon-muted hover:[&_svg]:text-foreground`,"ghost-muted":`text-muted-foreground hover:bg-accent hover:text-foreground`,secondary:`bg-secondary text-foreground hover:bg-accent`,destructive:`bg-destructive text-white hover:bg-destructive/90`,"destructive-outline":`border-input bg-popover text-destructive-foreground hover:border-destructive/40 hover:bg-destructive/8`,link:`h-auto border-0 px-0 text-foreground underline-offset-4 hover:underline active:scale-100`},size:{xs:`h-6 px-[7px] text-xs [&_svg:not([class*=size-])]:size-3.5`,sm:`h-7 px-[9px]`,default:`h-8 px-[11px]`,lg:`h-9 px-3`,icon:`size-8`,"icon-sm":`size-7`,"icon-xs":`size-6 [&_svg:not([class*=size-])]:size-3.5`}},defaultVariants:{variant:`default`,size:`default`}});function J({className:e,variant:t,size:n,type:r=`button`,...i}){return(0,x.jsx)(`button`,{type:r,className:K(jh({variant:t,size:n}),e),...i})}function Mh(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Nh=Mh(`https://base-ui.com/production-error`,`Base UI`),Ph=b.createContext(void 0);function Fh(e){let t=b.useContext(Ph);if(t===void 0&&!e)throw Error(Nh(33));return t}var Ih=b.createContext(void 0);function Lh(e){let t=b.useContext(Ih);if(t===void 0&&!e)throw Error(Nh(36));return t}var Rh={};function zh(e,t){let n=b.useRef(Rh);return n.current===Rh&&(n.current=e(t)),n}function Bh(e,t,n,r){let i=zh(Hh).current;return Uh(i,e,t,n,r)&&Gh(i,[e,t,n,r]),i.callback}function Vh(e){let t=zh(Hh).current;return Wh(t,e)&&Gh(t,e),t.callback}function Hh(){return{callback:null,cleanup:null,refs:[]}}function Uh(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Wh(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Gh(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var Kh=19;function qh(e){return Kh>=e}function Jh(e){if(!b.isValidElement(e))return null;let t=e,n=t.props;return(qh(19)?n?.ref:t.ref)??null}function Yh(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Xh(){}var Zh=Object.freeze([]),Qh=Object.freeze({});function $h(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function eg(e,t){return typeof e==`function`?e(t):e}function tg(e,t){return typeof e==`function`?e(t):e}var ng={};function rg(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ag(t);let a=ag(e);return t&&(a=og(a,t)),n&&(a=og(a,n)),r&&(a=og(a,r)),i&&(a=og(a,i)),a}function ig(e){if(e.length===0)return ng;if(e.length===1)return ag(e[0]);let t=ag(e[0]);for(let n=1;n<e.length;n+=1)t=og(t,e[n]);return t}function ag(e){return ug(e)?{...e(ng)}:sg(e)}function og(e,t){return ug(t)?t(e):cg(e,t)}function sg(e){let t={...e};for(let e in t){let n=t[e];lg(e,n)&&(t[e]=fg(n))}return t}function cg(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Yh(e.style,r);break;case`className`:e[n]=mg(e.className,r);break;default:e[n]=lg(n,r)?dg(e[n],r):r}}return e}function lg(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function ug(e){return typeof e==`function`}function dg(e,t){return t?e?(...n)=>{let r=n[0];if(hg(r)){let i=r;pg(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:fg(t):e}function fg(e){return e&&((...t)=>{let n=t[0];return hg(n)&&pg(n),e(...t)})}function pg(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function mg(e,t){return t?e?t+` `+e:t:e}function hg(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function gg(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=bg(r));let i=_g(t,n,r);if(n.enabled===!1)return null;let a=n.state??Qh;return xg(e,r,i,a)}function _g(e,t,n){let{className:r,style:i}=e,{state:a=Qh,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?eg(r,a):void 0,d=l?tg(i,a):void 0,f=l?$h(a,c):Qh,p=l&&s?vg(s):void 0,m=l?Yh(f,p)??{}:Qh;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Vh([m.ref,Jh(n),...o]):Bh(m.ref,Jh(n),o):Bh(null,null)),l?(u!==void 0&&(m.className=mg(m.className,u)),d!==void 0&&(m.style=Yh(m.style,d)),m):Qh}function vg(e){return Array.isArray(e)?ig(e):rg(void 0,e)}var yg=Symbol.for(`react.lazy`);function bg(e){if(e?.$$typeof!==yg)return e;let t=b.Children.toArray(e)[0];return b.isValidElement(t)?t:e}function xg(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=rg(n,t.props);return e.ref=n.ref,b.cloneElement(t,e)}return Sg(e,n)}function Sg(e,t){return e===`button`?(0,b.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,b.createElement)(`img`,{alt:``,...t,key:t.key}):b.createElement(e,t)}var Cg=`data-starting-style`,wg=`data-ending-style`,Tg={[Cg]:``},Eg={[wg]:``},Dg={transitionStatus(e){return e===`starting`?Tg:e===`ending`?Eg:null}},eee=`data-open`,Og=`data-closed`,kg=`data-anchor-hidden`,Ag=`data-popup-open`,jg=`data-pressed`,Mg={[Ag]:``},Ng={[Ag]:``,[jg]:``},Pg={[eee]:``},Fg={[Og]:``},Ig={[kg]:``},Lg={open(e){return e?Mg:null}},Rg={open(e){return e?Ng:null}},zg={open(e){return e?Pg:Fg},anchorHidden(e){return e?Ig:null}},Bg={...zg,...Dg},Vg=b.createContext(void 0);function Hg(e=!0){let t=b.useContext(Vg);if(t===void 0&&!e)throw Error(Nh(25));return t}var Ug=`none`,Wg=`trigger-press`,Gg=`trigger-hover`,Kg=`trigger-focus`,qg=`outside-press`,Jg=`item-press`,Yg=`close-press`,Xg=`focus-out`,Zg=`escape-key`,Qg=`list-navigation`,$g=`keyboard`,e_=`pointer`,t_=`cancel-open`,n_=`sibling-open`,r_=`disabled`,i_=`imperative-action`,a_=`window-resize`;function o_({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=b.useRef(e!==void 0),[a,o]=b.useState(()=>t);return[i&&e!==void 0?e:a,b.useCallback(e=>{i||o(e)},[])]}var s_=b.createContext(null);function c_(e=`root`){let t=b.useContext(s_),n=b.useContext(Ih);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var l_={visible:!0,ref:null};function u_(){return l_}function d_(e,t,n=`root`){let r=c_(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??u_)({label:e.label,children:e.children,render:e.render}),a=Bh(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function f_(){return typeof window<`u`}function p_(e){return g_(e)?(e.nodeName||``).toLowerCase():`#document`}function m_(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function h_(e){return((g_(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function g_(e){return f_()?e instanceof Node||e instanceof m_(e).Node:!1}function __(e){return f_()?e instanceof Element||e instanceof m_(e).Element:!1}function v_(e){return f_()?e instanceof HTMLElement||e instanceof m_(e).HTMLElement:!1}function y_(e){return!f_()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof m_(e).ShadowRoot}function b_(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=j_(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function x_(e){return/^(table|td|th)$/.test(p_(e))}function S_(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var C_=/transform|translate|scale|rotate|perspective|filter/,w_=/paint|layout|strict|content/,T_=e=>!!e&&e!==`none`,E_;function D_(e){let t=__(e)?j_(e):e;return T_(t.transform)||T_(t.translate)||T_(t.scale)||T_(t.rotate)||T_(t.perspective)||!k_()&&(T_(t.backdropFilter)||T_(t.filter))||C_.test(t.willChange||``)||w_.test(t.contain||``)}function O_(e){let t=N_(e);for(;v_(t)&&!A_(t);){if(D_(t))return t;if(S_(t))return null;t=N_(t)}return null}function k_(){return E_??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),E_}function A_(e){return/^(html|body|#document)$/.test(p_(e))}function j_(e){return m_(e).getComputedStyle(e)}function M_(e){return __(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function N_(e){if(p_(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||y_(e)&&e.host||h_(e);return y_(t)?t.host:t}function P_(e){let t=N_(e);return A_(t)?(e.ownerDocument||e).body:v_(t)&&b_(t)?t:P_(t)}function F_(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=P_(e),i=r===e.ownerDocument?.body,a=m_(r);if(i){let e=I_(a);return t.concat(a,a.visualViewport||[],b_(r)?r:[],e&&n?F_(e):[])}return t.concat(r,F_(r,[],n))}function I_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var L_={...b},R_=L_.useInsertionEffect,z_=R_&&R_!==L_.useLayoutEffect?R_:e=>e();function B_(e){let t=zh(V_).current;return t.next=e,z_(t.effect),t.trampoline}function V_(){let e={next:void 0,callback:H_,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function H_(){}var Y=typeof document<`u`?b.useLayoutEffect:()=>{},U_=b.createContext(void 0);function W_(e=!1){let t=b.useContext(U_);if(t===void 0&&!e)throw Error(Nh(16));return t}function G_(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:b.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function K_(e){return e?.ownerDocument||document}function q_(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(m_(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function J_(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=b.useRef(null),s=W_(!0),c=a??s!==void 0,{props:l}=G_({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=b.useCallback(()=>{let e=o.current;Y_(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Y(u,[u]),{getButtonProps:b.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return rg({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(pg(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Y_(r),s=!i&&X_(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),q_(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),q_(r,e)))},onKeyUp(e){t||(pg(e),a?.(e),e.target===e.currentTarget&&i&&c&&Y_(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),q_(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:B_(e=>{o.current=e,u()})}}function Y_(e){return v_(e)&&e.tagName===`BUTTON`}function X_(e){return v_(e)&&e.tagName===`A`&&!!e.href}function Z_(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Q_,platform:$_,maxTouchPoints:e1}=Z_(),t1=Q_.toLowerCase(),n1=$_.toLowerCase(),r1=/^i(os$|p)/.test(n1)||n1===`macintel`&&e1>1,i1=`android`,a1=n1===i1||t1.includes(i1),o1=!r1&&n1.startsWith(`mac`);n1.startsWith(`win`),!a1&&/^(linux|chrome os)/.test(n1);var s1=o1||r1,c1=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!c1&&t1.includes(`firefox`),!c1&&t1.includes(`chrom`);var l1=s1,u1=/jsdom|happydom/.test(t1);function d1(e){e.preventDefault()}function f1(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=Lh(),u=Hg(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return b.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?d1:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Jg})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!o1&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&q_(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var p1={type:`regular-item`};function m1(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=b.useRef(null),{getButtonProps:d,buttonRef:f}=J_({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=f1({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=b.useCallback(e=>rg(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=Bh(u,f);return b.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var h1=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function g1(){return b.useContext(h1)}function _1(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=g1(),u=b.useRef(-1),[d,f]=b.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=b.useRef(null),h=b.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function v1(){let[,e]=b.useState({});return b.useCallback(()=>{e({})},[])}var y1=0;function b1(e,t=`mui`){let n=b.useRef(void 0),r=v1(),i=e??n.current;return b.useEffect(()=>{n.current??(y1+=1,n.current=`${t}-${y1}`,e??r())},[e,t,r]),i}var x1=L_.useId;function S1(e,t){if(x1!==void 0){let n=x1();return e??(t?`${t}-${n}`:n)}return b1(e,t)}function C1(e){return S1(e,`base-ui`)}function w1(e,t,n,r){let i=!1,a=!1,o=r??Qh;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function T1(e,t,n){let r=n??Qh;return{reason:e,event:t??new Event(`base-ui`),...r}}function E1(e){b.useEffect(e,Zh)}var D1=null;globalThis.requestAnimationFrame;var O1=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},k1=class e{static create(){return new e}static request(e){return O1.request(e)}static cancel(e){return O1.cancel(e)}currentId=D1;request(e){this.cancel(),this.currentId=O1.request(()=>{this.currentId=D1,e()})}cancel=()=>{this.currentId!==D1&&(O1.cancel(this.currentId),this.currentId=D1)};disposeEffect=()=>this.cancel};function A1(){let e=zh(k1.create).current;return E1(e.disposeEffect),e}function j1(e,t=!1,n=!1,r=!1){let[i,a]=b.useState(e&&t?`idle`:void 0),[o,s]=b.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Y(()=>{if(!e&&o&&i!==`ending`&&n){let e=k1.request(()=>{a(`ending`)});return()=>{k1.cancel(e)}}},[e,o,i,n]),Y(()=>{if(!e||t||i===void 0)return;let n=k1.request(()=>{a(void 0)});return()=>{k1.cancel(n)}},[t,e,i]),Y(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=k1.request(()=>{a(`idle`)});return()=>{k1.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function M1(e){return e==null?e:`current`in e?e.current:e}function N1(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var P1=l(h(),1),F1=null;function I1(e){if(!F1){let e=[];F1=e,queueMicrotask(()=>{F1=null,P1.flushSync(()=>{for(let t of e)t()})})}F1.push(e)}function L1(e,t=!1,n=!1){let r=A1();return B_((i,a=null)=>{r.cancel();let o=M1(e);if(o==null)return;let s=o,c=()=>{n?I1(()=>{a?.aborted||i()}):P1.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(N1(s).map(e=>e.finished.then(Xh))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(N1(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Cg;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function R1(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=B_(a),s=L1(r,n,i);b.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var z1=b.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=Lh(),f=_1({guess:!0,label:a}),p=C1(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=m1({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:p1});return gg(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),B1=b.forwardRef(function(e,t){let n=d_(e,t);return n.visible?(0,x.jsx)(z1,{...e,ref:n.ref}):null}),V1=0,H1=class e{static create(){return new e}currentId=V1;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=V1,t()},e)}isStarted(){return this.currentId!==V1}clear=()=>{this.currentId!==V1&&(clearTimeout(this.currentId),this.currentId=V1)};disposeEffect=()=>this.clear};function U1(){let e=zh(H1.create).current;return E1(e.disposeEffect),e}function W1(e){e.preventDefault(),e.stopPropagation()}function G1(e){return`nativeEvent`in e}function K1(e){return e.pointerType===``&&e.isTrusted?!0:a1&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function q1(e){return u1?!1:!a1&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(a1||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function J1(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Y1(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function X1(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z1(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&y_(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Q1(e,t){let n=e;for(;n;){if(__(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(y_(n)?n.host:null)}return null}function $1(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var e0=`data-base-ui-focusable`,t0=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,n0=`ArrowLeft`,r0=`ArrowRight`,i0=`ArrowUp`,a0=`ArrowDown`,o0=`data-trigger-disabled`;function s0(e,t){if(!__(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(o0);for(let[,e]of t.entries())if(Z1(e,n))return!e.hasAttribute(o0);return!1}function c0(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function l0(e){return e.matches(`html,body`)}function u0(e){return v_(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function d0(e){return Q1(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${t0}`)!=null}function f0(e){return e?e.getAttribute(`role`)===`combobox`&&u0(e):!1}function p0(e){if(!e||u1)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function m0(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function h0(e,t){return t!=null&&!J1(t)?0:typeof e==`function`?e():e}function g0(e,t,n){let r=h0(e,n);return typeof r==`number`?r:r?.[t]}function _0(e){return typeof e==`function`?e():e}function v0(e,t){return t||e===`click`||e===`mousedown`}function y0(e){return e?.includes(`mouse`)&&e!==`mousedown`}var b0=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new H1,currentIdRef:{current:null},currentContextRef:{current:null}});function x0(e,t){e.current=t.current}function S0(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=b.useRef(n),a=b.useRef(n),o=b.useRef(null),s=b.useRef(null),c=U1();return Y(()=>{a.current=n,o.current?i.current={open:g0(i.current,`open`),close:g0(n,`close`)}:i.current=n},[n,o,i,a]),(0,x.jsx)(b0.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function C0(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=b.useContext(b0),[d,f]=b.useState(!1),p=b.useRef(n);return Y(()=>{p.current=n},[n]),Y(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),Y(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:g0(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,w1(Ug))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),Y(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,x0(a,s),u.clear()}},[c,i,a,r,s,u]),b.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function w0(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function T0(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function E0(e){let t=zh(D0,e).current;return t.next=e,Y(t.effect),t}function D0(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var O0={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},k0={...O0,position:`fixed`,margin:0,top:0,left:0},A0={...O0,position:`absolute`},j0=b.forwardRef(function(e,t){let[n,r]=b.useState();Y(()=>{l1&&c1&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,x.jsx)(`span`,{...e,ref:t,style:k0,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),M0=Math.min,N0=Math.max,P0=Math.round,F0=Math.floor,I0=e=>({x:e,y:e}),L0={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function R0(e,t,n){return N0(e,M0(t,n))}function z0(e,t){return typeof e==`function`?e(t):e}function B0(e){return e.split(`-`)[0]}function V0(e){return e.split(`-`)[1]}function H0(e){return e===`x`?`y`:`x`}function U0(e){return e===`y`?`height`:`width`}function W0(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function G0(e){return H0(W0(e))}function K0(e,t,n){n===void 0&&(n=!1);let r=V0(e),i=G0(e),a=U0(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=tv(o)),[o,tv(o)]}function q0(e){let t=tv(e);return[J0(e),t,J0(t)]}function J0(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Y0=[`left`,`right`],X0=[`right`,`left`],Z0=[`top`,`bottom`],Q0=[`bottom`,`top`];function $0(e,t,n){switch(e){case`top`:case`bottom`:return n?t?X0:Y0:t?Y0:X0;case`left`:case`right`:return t?Z0:Q0;default:return[]}}function ev(e,t,n,r){let i=V0(e),a=$0(B0(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(J0)))),a}function tv(e){let t=B0(e);return L0[t]+e.slice(t.length)}function nv(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function rv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:nv(e)}function iv(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function av(e,t){return t<0||t>=e.length}function ov(e,t){return cv(e.current,{disabledIndices:t})}function sv(e,t){return cv(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function tee(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>cv(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:av(e,u)?-1:u,wrapped:d}}function cv(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&lv(e,a,r));return a}function lv(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!dv(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function uv(e){return e.visibility===`hidden`||e.visibility===`collapse`}function dv(e,t=e?j_(e):null){return!e||!e.isConnected||!t||uv(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var fv=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function pv(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return y_(n)?n.host:null}function mv(e){for(let t of Array.from(e.children))if(p_(t)===`summary`)return t;return null}function hv(e,t){let n=mv(t);return!!n&&(e===n||Z1(n,e))}function gv(e){let t=e?p_(e):``;return e!=null&&e.matches(fv)&&(t!==`summary`||e.parentElement!=null&&p_(e.parentElement)===`details`&&mv(e.parentElement)===e)&&(t!==`details`||mv(e)==null)&&(t!==`input`||e.type!==`hidden`)}function _v(e){if(!gv(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=pv(t)){let n=t!==e,r=p_(t)===`slot`;if(t.hasAttribute(`inert`)||n&&p_(t)===`details`&&!t.open&&!hv(e,t)||t.hasAttribute(`hidden`)||!r&&!vv(t,n))return!1}return!0}function vv(e,t){let n=j_(e);return t?n.display!==`none`:dv(e,n)}function yv(e){let t=e.tabIndex;if(t<0){let t=p_(e);if(t===`details`||t===`audio`||t===`video`||v_(e)&&e.isContentEditable)return 0}return t}function bv(e){if(p_(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function xv(e,t){let n=bv(e);if(!n)return!0;let r=t.find(e=>{let t=bv(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=bv(e);return t?.name===n.name&&t.form===n.form})===n}function Sv(e){if(v_(e)&&p_(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return v_(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Cv(e,t){Sv(e).forEach(e=>{gv(e)&&t.push(e),Cv(e,t)})}function wv(e,t,n){Sv(e).forEach(e=>{v_(e)&&e.matches(t)&&n.push(e),wv(e,t,n)})}function Tv(e){return _v(e)&&yv(e)>=0}function Ev(e){let t=[];return Cv(e,t),t.filter(_v)}function Dv(e){let t=Ev(e);return t.filter(e=>yv(e)>=0&&xv(e,t))}function Ov(e,t){let n=Dv(e),r=n.length;if(r===0)return;let i=X1(K_(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function kv(e){return Ov(K_(e).body,1)||e}function Av(e){return Ov(K_(e).body,-1)||e}function jv(e,t,n){if(!e)return null;let r=[];Cv(K_(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(_v);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Z1(n,o)&&Tv(o)&&xv(o,a))return o}return r[i]}function Mv(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z1(n,r)}function Nv(e){Dv(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Pv(e){let t=[];wv(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Fv(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Fv(e,t.id,n)])}function Iv(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Lv(e){return`data-base-ui-${e}`}var Rv=0;function zv(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Rv);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Xh;let o=requestAnimationFrame(a);return Rv=o,()=>{Rv===o&&(cancelAnimationFrame(o),Rv=0)}}var Bv=`data-base-ui-inert`,Vv=new WeakMap,Hv=new WeakSet,Uv=new WeakMap,Wv=0;function Gv(e){return e?y_(e)?e.host:Gv(e.parentNode):null}var Kv=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Gv(t);return e.contains(n)?n:null}).filter(e=>e!=null),qv=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Jv=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{p_(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Yv(e,t,n,{mark:r=!0}){let i=Kv(t,e),a=r?Jv(t,qv(i),new Set(i)):[],o=[],s=[];if(n){let e=Kv(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Jv(t,qv(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Vv.get(e)||0)+1;Vv.set(e,r),o.push(e),r===1&&n&&Hv.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Uv.get(e)||0)+1;Uv.set(e,t),s.push(e),t===1&&e.setAttribute(Bv,``)}),Wv+=1,()=>{o.forEach(e=>{let t=(Vv.get(e)||0)-1;Vv.set(e,t),t||(Hv.has(e)||e.removeAttribute(`aria-hidden`),Hv.delete(e))}),r&&s.forEach(e=>{let t=(Uv.get(e)||0)-1;Uv.set(e,t),t||e.removeAttribute(Bv)}),--Wv,Wv||(Vv=new WeakMap,Hv=new WeakSet,Uv=new WeakMap)}}function Xv(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t;return Yv(e,K_(e[0]).body,n,{mark:r})}var Zv={style:{transition:`none`}},Qv=`data-base-ui-click-trigger`,$v={fallbackAxisSide:`none`},ey={fallbackAxisSide:`end`},ty={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},ny=b.createContext(null),ry=()=>b.useContext(ny),iy=Lv(`portal`);function ay(e={}){let{ref:t,container:n,componentProps:r=Qh,elementProps:i}=e,a=S1(),o=ry()?.portalNode,[s,c]=b.useState(null),[l,u]=b.useState(null),d=B_(e=>{e!==null&&u(e)}),f=b.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(g_(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=gg(`div`,r,{ref:[t,d],props:[{id:a,[iy]:``},i]}),m=s&&p?P1.createPortal(p,s):null;return{node:l,nodeId:b.isValidElement(p)?p.props.id:void 0,subtree:m}}var oy=b.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ay({container:o,ref:t,componentProps:e,elementProps:c}),f=b.useRef(null),p=b.useRef(null),m=b.useRef(null),h=b.useRef(null),[g,_]=b.useState(null),v=b.useRef(!1),y=g?.modal,S=g?.open,C=!!g&&!g.modal&&g.open&&!!l;b.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Mv(e)&&(e.type===`focusin`?v.current&&=(Pv(l),!1):(Nv(l),v.current=!0))}return T0(w0(l,`focusin`,e,!0),w0(l,`focusout`,e,!0))},[l,y]),Y(()=>{l&&S===!0&&v.current&&(Pv(l),v.current=!1)},[S,l]);let w=b.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,x.jsxs)(b.Fragment,{children:[d,(0,x.jsxs)(ny.Provider,{value:w,children:[C&&l&&(0,x.jsx)(j0,{"data-type":`outside`,ref:f,onFocus:e=>{Mv(e,l)?m.current?.focus():Av(g?g.domReference:null)?.focus()}}),C&&l&&(0,x.jsx)(`span`,{role:s,"aria-owns":u,style:ty}),l&&P1.createPortal(a,l),C&&l&&(0,x.jsx)(j0,{"data-type":`outside`,ref:p,onFocus:e=>{Mv(e,l)?h.current?.focus():(kv(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,w1(`focus-out`,e.nativeEvent)))}})]})]})});function sy(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var cy=class{nodesRef={current:[]};events=sy();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},ly=b.createContext(null),uy=b.createContext(null),dy=()=>b.useContext(ly)?.id||null,fy=e=>{let t=b.useContext(uy);return e??t};function py(e){let t=S1(),n=fy(e),r=dy();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function my(e){let{children:t,id:n}=e,r=dy();return(0,x.jsx)(ly.Provider,{value:b.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function hy(e){let{children:t,externalTree:n}=e,r=zh(()=>n??new cy).current;return(0,x.jsx)(uy.Provider,{value:r,children:t})}function gy(e,t){let n=m_($1(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(K1(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var _y=20,vy=[];function yy(){vy=vy.filter(e=>e.deref()?.isConnected)}function by(e){yy(),e&&p_(e)!==`body`&&(vy.push(new WeakRef(e)),vy.length>_y&&(vy=vy.slice(-20)))}function xy(){return yy(),vy[vy.length-1]?.deref()}function Sy(e){return e?Tv(e)?e:Dv(e)[0]||e:null}function Cy(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Ev(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Tv(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function wy(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:S}=t.context,C=B_(()=>S.current.floatingContext?.nodeId),w=i===!1,T=f0(_)&&w,E=E0(i),D=E0(a),O=E0(o),k=E0(u),A=E0(g),j=fy(m),M=ry(),N=b.useRef(!1),P=b.useRef(!1),F=b.useRef(!1),I=b.useRef(null),L=b.useRef(``),R=b.useRef(``),z=b.useRef(null),B=b.useRef(null),ee=Bh(z,p,M?.beforeInsideRef),V=Bh(B,M?.afterInsideRef),te=U1(),ne=U1(),re=A1(),ie=M!=null,ae=m0(v),oe=B_((e=ae)=>e?Dv(e):[]),se=B_(()=>h?.().filter(e=>e!=null)??[]);b.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Z1(ae,X1(K_(ae)))&&oe().length===0&&!T&&W1(e)}return w0(K_(ae),`keydown`,e)},[r,ae,c,T,oe]),b.useEffect(()=>{if(r||!g)return;let e=K_(ae);function t(){F.current=!1}function n(e){let t=$1(e),n=se(),r=Z1(v,t)||Z1(_,t)||Z1(M?.portalNode,t)||n.some(e=>e===t||Z1(e,t));F.current=!r,R.current=e.pointerType||`keyboard`,Q1(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,ne.start(0,()=>{P.current=!1}))}function i(){R.current=`keyboard`}return T0(w0(e,`pointerdown`,n,!0),w0(e,`pointerup`,t,!0),w0(e,`pointercancel`,t,!0),w0(e,`keydown`,i,!0),t)},[r,v,_,ae,g,M,ne,se]),b.useEffect(()=>{if(r||!l)return;let e=K_(ae);function n(){P.current=!0,ne.start(0,()=>{P.current=!1})}function i(e){let t=$1(e);Tv(t)&&(I.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=$1(n);c&&r==null&&a!=null&&Z1(v,a)&&by(a),queueMicrotask(()=>{let o=C(),l=t.context.triggerElements,u=se(),p=r?.hasAttribute(Lv(`focus-guard`))&&[z.current,B.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,M1(f),M1(d)].includes(r),m=!(Z1(_,r)||Z1(v,r)||Z1(r,v)||Z1(M?.portalNode,r)||u.some(e=>e===r||Z1(e,r))||l.hasMatchingElement(e=>Z1(e,r))||p||j&&(Fv(j.nodesRef.current,o).find(e=>Z1(e.context?.elements.floating,r)||Z1(e.context?.elements.domReference,r))||Iv(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,m0(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&ae&&Cy(ae),s&&i!==_&&!dv(a)&&X1(e)===e.body){if(v_(ae)&&(ae.focus(),s===`popup`)){re.request(()=>{ae.focus()});return}let e=oe(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||ae;v_(n)&&n.focus()}S.current.insideReactTree?S.current.insideReactTree=!1:(T||!c)&&r&&m&&!P.current&&(T||r!==xy())&&(N.current=!0,t.setOpen(!1,w1(Xg,n)))})}function o(){F.current||(S.current.insideReactTree=!0,te.start(0,()=>{S.current.insideReactTree=!1}))}let u=v_(_)?_:null;if(v||u)return T0(u&&w0(u,`focusout`,a),u&&w0(u,`pointerdown`,n),v&&w0(v,`focusin`,i),v&&w0(v,`focusout`,a),v&&M&&w0(v,`focusout`,o,!0))},[r,_,v,ae,c,j,M,t,l,s,oe,T,C,S,te,ne,re,d,f,se]),b.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${Lv(`portal`)}]`)||[]),t=(j?Iv(j.nodesRef.current,C()):[]).find(e=>f0(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Xv([v,...e,z.current,B.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...se(),t,M1(f),M1(d),T?_:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),i=Xv([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,M,T,j,C,d,f,se]),Y(()=>{if(!g||r||!v_(ae))return;L.current=``,R.current=``;let e=K_(ae),t=X1(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||Z1(ae,t))return;let i=null,a=()=>(i??=oe(ae),i[0]||ae),o;o=r===!0||r===null?a():M1(r),o||=a();let s=Z1(ae,X1(e)),c=S.current.openEvent,l=c?.type===`mousedown`&&K1(c);zv(o,{sync:l,preventScroll:o===ae,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=X1(e);return!(t!==o&&Z1(ae,t))}})})},[r,g,ae,oe,E,k,A,S]);let H=b.useRef(null);Y(()=>{if(r||!ae){H.current=null;return}H.current&&=(H.current.cancelled=!0,null);let e=K_(ae),t=X1(e),n=k.current==null;by(t);function i(e){if(e.open||(L.current=gy(e.nativeEvent,R.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Lv(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(K1(e.nativeEvent)||q1(e.nativeEvent))N.current=!1;else{let e=!1;K_(ae).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}y.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&p_(t)!==`body`?t:null,s=n?o||a:a||o;return s||=xy()||null,typeof i==`boolean`?s:M1(i)||s||null}return()=>{y.off(`openchange`,i);let t=X1(e),n=se(),r=Z1(v,t)||n.some(e=>e===t||Z1(e,t))||j&&Fv(j.nodesRef.current,C(),!1).some(e=>Z1(e.context?.elements.floating,t)),o=D.current,s=L.current,c=a(s),l={cancelled:!1};H.current=l,queueMicrotask(()=>{H.current===l&&(H.current=null);let n=Sy(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&v_(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,v,ae,D,O,k,y,j,_,C,se]),Y(()=>{if(!c1||g||!v)return;let e=X1(K_(v));v_(e)&&u0(e)&&Z1(v,e)&&e.blur()},[g,v]),Y(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{M.setFocusManagerState(null)}},[r,M,c,g,t,l,_]),Y(()=>{if(!r&&ae)return Cy(ae),()=>{queueMicrotask(yy)}},[r,ae]);let ce=!r&&(!c||!T)&&(ie||c);return(0,x.jsxs)(b.Fragment,{children:[ce&&(0,x.jsx)(j0,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c){let e=oe();zv(e[e.length-1])}else M?.portalNode&&(N.current=!1,Mv(e,M.portalNode)?kv(_)?.focus():M1(f??M.beforeOutsideRef)?.focus())}}),n,ce&&(0,x.jsx)(j0,{"data-type":`inside`,ref:V,onFocus:e=>{c?zv(oe()[0]):M?.portalNode&&(l&&(N.current=!0),Mv(e,M.portalNode)?Av(_)?.focus():M1(d??M.afterOutsideRef)?.focus())}})]})}function Ty(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Wg}=t,l=e.context.dataRef,u=b.useRef(void 0),d=A1(),f=U1(),p=b.useMemo(()=>{function t(t,n,r,i){let a=w1(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=J1(e.pointerType,!0)&&q1(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||J1(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=$1(s),p=u0(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:J1(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return b.useMemo(()=>n?{reference:p}:Qh,[n,p])}function Ey(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Dy(e){return e!=null&&e.clientX!=null}function Oy(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=b.useRef(!1),l=b.useRef(null),[u,d]=b.useState(),[f,p]=b.useState([]),m=B_(t=>{e.set(`positionReference`,t)}),h=B_((t,n,i)=>{c.current||(!s.current.openEvent||Dy(s.current.openEvent))&&e.set(`positionReference`,Ey(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=B_(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=J1(u)?a:i;b.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=m_(a);function r(t){let n=$1(t);Z1(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||Dy(s.current.openEvent)?l.current=w0(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),b.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),b.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),b.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=b.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return b.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function ky(){return!1}function Ay(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function jy(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ky,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=fy(c),m=B_(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=B_(()=>a),{escapeKey:v,outsidePress:y}=Ay(s),x=b.useRef(!1),S=b.useRef(!1),C=b.useRef(!1),w=b.useRef(!1),T=b.useRef(!1),E=b.useRef(``),D=b.useRef(null),O=U1(),k=U1(),A=U1(),j=B_(()=>{k.clear(),d.current.insideReactTree=!1}),M=B_(e=>{let t=d.current.floatingContext?.nodeId;return(p?Fv(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=B_(t=>c0(t,e.select(`floatingElement`))||c0(t,e.select(`domReferenceElement`))),P=B_(t=>{o()&&e.setOpen(!1,w1(Wg,t.nativeEvent))}),F=B_(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=G1(t)?t.nativeEvent:t;if(T.current||i.isComposing||!v&&M(`__escapeKeyBubbles`))return;let a=w1(Zg,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),I=B_(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=B_(t=>{if(!l||!n||t.button!==0)return;let r=$1(t.nativeEvent);Z1(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=B_(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});b.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),b.useEffect(()=>j,[j]),b.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new H1,i=K_(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(c1?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function b(e){let t=d.current.floatingContext?.nodeId,n=p&&Fv(p.nodesRef.current,t).some(t=>c0(e,t.context?.elements.floating));return N(e)||n}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=$1(n),i=`[${Lv(`inert`)}]`,a=__(r)?r.getRootNode():null,o=Array.from((y_(a)?a:K_(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Z1(e,r))))return;let c=__(r)?r:null;for(;c&&!A_(c);){let e=N_(c);if(A_(e)||!__(e))break;c=e}if(!(o.length&&__(r)&&!l0(r)&&!Z1(r,e.select(`floatingElement`))&&o.every(e=>!Z1(c,e)))){if(v_(r)&&!(`touches`in n)){let e=A_(r),t=j_(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!b(n)){if(f()===`intentional`){if(n.detail!==0&&!K1(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof h==`function`&&!h(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,w1(qg,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=$1(e);if(!n)return;let r=w0(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():b(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,j())))}function ee(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function V(e){L(e,ee)}function te(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ne(e){L(e,te)}let re=T0(r&&T0(w0(i,`keydown`,F),w0(i,`compositionstart`,a),w0(i,`compositionend`,o)),g&&T0(w0(i,`click`,z,!0),w0(i,`pointerdown`,z,!0),w0(i,`pointerup`,B,!0),w0(i,`pointercancel`,B,!0),w0(i,`mousedown`,z,!0),w0(i,`mouseup`,B,!0),w0(i,`touchstart`,R,{capture:!0,passive:!0}),w0(i,`touchmove`,V,{capture:!0,passive:!0}),w0(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{re(),t.clear(),c(),C.current=!1}},[d,u,r,g,h,l,n,v,y,F,j,_,M,N,p,e,O,A]);let z=b.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=b.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return b.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}function My(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};__(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Ny(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=B_(i),{mounted:c,setMounted:l,transitionStatus:u}=j1(t,!1,!1,o),d=!t&&r;Y(()=>{t&&s(!1)},[t,s]);let f=b.useRef(c),p=b.useRef(!1),m=v1(),h=()=>{f.current=!1,l(!1),a()};Y(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=B_(()=>{f.current&&(t?(p.current=!0,m()):h())});return R1({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var Py={tabIndex:-1,[e0]:``};function Fy(e){return t=>t!==`touch`||e.current}function Iy(e,t=!1){let n=S1(),r=dy()!=null,i=zh(()=>e(n,r)).current;return My({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ly({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function Ry(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function zy(e,t){let n=b.useRef(null);return B_(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Ry(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Ry(t))})}function By(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function Vy(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Hy(e,t,n,r={}){let i=n.reason,a=i===Gg,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Vy(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=By(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?P1.flushSync(l):l()}function Uy(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=zy(e,n),o=B_(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=B_(e=>{a(e),e&&o(e)});return Y(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Y(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Wy(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=b.useRef(null),i=e.useState(`open`);Y(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=w1(Ug);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Gy(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Ny({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return zh(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Ky(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:Qh,inactiveTriggerProps:Qh,popupProps:Qh})},[e])}function qy(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Jy=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Yy=[],Xy=void 0;function Zy(){return Xy}function Qy(e){Yy.push(e)}function $y(e){let t=(t,n)=>{let r=zh(t2).current,i;try{Xy=r;for(let e of Yy)e.before(r);i=e(t,n);for(let e of Yy)e.after(r);r.didInitialize=!0}finally{Xy=void 0}return i};return t.displayName=e.displayName||e.name,t}function e2(e){return b.forwardRef($y(e))}function t2(){return{didInitialize:!1}}var n2=Ii(),nee=qh(19)?iee:aee;function r2(e,t,n,r,i){return nee(e,t,n,r,i)}function ree(e,t,n,r,i){let a=b.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,n2.useSyncExternalStore)(e.subscribe,a,a)}Qy({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,n2.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function iee(e,t,n,r,i){let a=Zy();if(!a)return ree(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function aee(e,t,n,r,i){return(0,Ri.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var oee=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return r2(this,e,t,n,r)}},i2=class extends oee{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){b.useDebugValue(e);let n=this;Y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Y(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){b.useDebugValue(e);let n=this,r=t!==void 0;Y(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){return(0,this.selectors[e])(this.state,t,n,r)}useState(e,t,n,r){return b.useDebugValue(e),r2(this,this.selectors[e],t,n,r)}useContextCallback(e,t){b.useDebugValue(e);let n=B_(t??Xh);this.context[e]=n}useStateSetter(e){let t=b.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},see={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},a2=class extends i2{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:sy(),nested:n,triggerElements:i},see),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Y1(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function o2(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new a2({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Qh,inactiveTriggerProps:Qh,popupProps:Qh}}var s2=e=>e.triggerIdProp??e.activeTriggerId,c2=e=>e.openProp??e.open,l2=e=>(e.popupElement?.id??e.floatingId)||void 0;function u2(e,t){return t!==void 0&&c2(e)&&s2(e)===t}function d2(e,t){return u2(e,t)?!0:t!==void 0&&c2(e)&&s2(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var f2={open:c2,mounted:e=>e.mounted,transitionStatus:e=>c2(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:s2,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:l2,isTriggerActive:(e,t)=>t!==void 0&&s2(e)===t,isOpenedByTrigger:(e,t)=>u2(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&s2(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>d2(e,t)?l2(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function p2(e){let t=b.useCallback(t=>e===void 0?Xh:e.subscribeStore(t),[e]),n=b.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,n2.useSyncExternalStore)(t,n,()=>e?.serverStore)}function m2(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=S1(),a=dy()!=null,o=zh(()=>new a2({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Jy,floatingId:i,syncOnly:!1,nested:a})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=__(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var h2=o1&&c1;function g2(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=b.useRef(!1),s=b.useRef(null),c=b.useRef(!0),l=U1();b.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=m_(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&v_(t)&&t===X1(K_(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return T0(w0(r,`blur`,i),h2&&w0(r,`keydown`,a,!0),h2&&w0(r,`pointerdown`,l,!0))},[e,n]),b.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);__(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=b.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=$1(n.nativeEvent);if(__(a)){if(h2&&!n.relatedTarget){if(!c.current&&!u0(a))return}else if(!p0(a))return}let u=s0(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,w1(Kg,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,w1(Kg,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=__(r)&&r.hasAttribute(Lv(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=X1(K_(t));!r&&n===t||Z1(a.current.floatingContext?.refs.floating.current,n)||Z1(t,n)||o||s0(r??n,e.context.triggerElements)||e.setOpen(!1,w1(Kg,i))})}}},[a,r,e,l]);return b.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var _2=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new H1;restTimeout=new H1;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},v2=new WeakMap;function y2(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&v2.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),v2.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function b2(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=v2.get(n);a&&a!==e&&y2(a),y2(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,v2.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function x2(e){let t=e.context.dataRef.current,n=zh(()=>t.hoverInteractionState??_2.create()).current;return t.hoverInteractionState||=n,E1(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function S2(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=fy(),u=dy(),d=x2(e),f=U1(),p=B_(()=>v0(c.current.openEvent?.type,d.interactedInside)),m=B_(()=>y0(c.current.openEvent?.type)),h=B_(()=>{y2(d)});Y(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),b.useEffect(()=>h,[h]),Y(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&__(s)&&o){let e=s,t=o,n=K_(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??Q1(e,`[data-rootownerid]`)??n.body;return b2(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),b.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Fv(l.nodesRef.current,u).length>0)}function a(t){let n=g0(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,w1(Gg,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=$1(e);d0(t)?d.interactedInside=Q1(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(s0(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&__(o)&&Fv(l.nodesRef.current,r,!1).some(e=>Z1(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,w1(Gg,n)),l.events.emit(`floating.closed`,n)})}let y=o;return T0(y&&w0(y,`mouseenter`,g),y&&w0(y,`mouseleave`,_),y&&w0(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var C2={current:null};function w2(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=C2,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=fy(l),v=x2(e),y=b.useRef(!1),x=E0(i),S=E0(r),C=E0(o),w=E0(n),T=E0(p),E=E0(f),D=B_(()=>v0(h.current.openEvent?.type,v.interactedInside)),O=B_(()=>T.current?.()!==!1),k=B_((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Z1(t,n);if(!__(r))return!1;let a=r;return i.hasMatchingElement(e=>Z1(e,a))&&(!t||!Z1(t,a))}),A=B_(()=>{v.handler&&=(K_(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),j=B_(()=>{y2(v)});return u&&(v.handleCloseOptions=i?.__options),b.useEffect(()=>A,[A]),b.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===Gg,A(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,A]),b.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=g0(S.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,w1(Gg,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,w1(Gg,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!__(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!J1(v.pointerType))return;let n=_0(C.current),r=g0(S.current,`open`,v.pointerType),i=$1(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(__(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Z1(t,i)){c=t;break}}__(o)&&__(s)&&!e.context.triggerElements.hasElement(o)&&Z1(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&__(c)&&__(s)&&Z1(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,w1(Gg,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,w1(Gg,t,c))}):g&&O()&&e.setOpen(!0,w1(Gg,t,c)))}function o(n){if(D()){j();return}A();let r=K_(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!s0(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=x.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else v.pointerType===`touch`&&Z1(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){Z1(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?w0(r,`mouseout`,l):void 0;return s?T0(w0(r,`mousemove`,i,{once:!0}),w0(r,`mouseenter`,i),w0(r,`mouseleave`,o),f):T0(w0(r,`mouseenter`,i),w0(r,`mouseleave`,o),f)},[A,j,h,S,e,n,x,v,u,k,D,a,s,C,c,_,w,d,E,O,m]),b.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!J1(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;b2(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=_0(C.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,D())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,w1(Gg,n,r))}v.pointerType===`touch`?P1.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,D,k,a,e,C,O])}function T2(e){return c1&&e.movementX===0&&e.movementY===0}function E2(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function D2(e,t){return E2(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function O2(e,t,n){return E2(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function k2(e,t,n){return E2(t,n?e===n0:e===r0,e===a0)}function A2(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:E2(t,n?e===r0:e===n0,e===i0)}function j2(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=m0(D),j=f0(O),M=E0(A),N=dy(),P=fy(S),F=b.useRef(f),I=b.useRef(o??-1),L=b.useRef(null),R=b.useRef(!0),z=B_(e=>{i(I.current===-1?null:I.current,e)}),B=b.useRef(!!D),ee=b.useRef(E),V=b.useRef(!1),te=b.useRef(!1),ne=b.useRef(null),re=E0(h),ie=E0(E),ae=E0(o),oe=E0(x),se=A1(),H=A1(),ce=B_(()=>{se.cancel();function e(e){d||(ne.current=zv(e,{sync:V.current,preventScroll:!0}))}let t=n.current[I.current],r=te.current;t&&e(t),(V.current?e=>e():e=>se.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),me&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{k.current.orientation=g},[k,g]),Y(()=>{E||(L.current=null),E&&f===`auto`||(F.current=f)},[E,f]),Y(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(te.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),Y(()=>{if(a){if(!E)V.current=!1;else if(D){if(r==null){if(V.current=!1,ae.current!=null)return;if(B.current&&(I.current=-1,ce()),(!ee.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>H.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||O2(L.current,_,u)||l?ov(n):sv(n),L.current=null,z())};t()}}else av(n.current,r)||(I.current=r,ce(),te.current=!1)}}},[a,E,D,r,ae,l,n,_,u,z,ce,H]),Y(()=>{if(!a||D||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=X1(K_(O??t??null)),r=e.some(e=>e.context&&Z1(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),Y(()=>{ee.current=E,B.current=!!D});let le=r!=null,ue=B_(e=>{if(!ie.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),de=B_(()=>v??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),fe=B_(()=>ov(n,re.current)),pe=B_(t=>{if(R.current=!1,V.current=!0,t.which===229||!ie.current&&t.currentTarget===M.current)return;if(l&&A2(t.key,g,u,T)){D2(t.key,de())||W1(t),e.setOpen(!1,w1(Qg,t.nativeEvent));let n=C?.current??O;v_(n)&&n.focus();return}r!=null&&r!==I.current&&!av(n.current,r)&&(I.current=r);let i=I.current,a=ov(n,h),o=sv(n,h);if(j||(t.key===`Home`&&(W1(t),I.current=a,z(t)),t.key===`End`&&(W1(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,g,c,u,h,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),g===`both`)return}if(D2(t.key,g)){W1(t);let e=X1(t.currentTarget.ownerDocument);if(E&&!d&&Z1(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Z1(t,e))){I.current=O2(t.key,g,u)?a:o,z(t),r===I.current&&ce();return}let{index:l,wrapped:f}=tee(n.current,i,{decrement:!O2(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(V.current=!1),I.current=l,z(t)}}),me=b.useMemo(()=>({onFocus(e){V.current=!0,ue(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){T2(e)||(V.current=!0,te.current=!1,p&&ue(e))},onPointerLeave(e){if(!ie.current||!R.current||e.pointerType===`touch`)return;V.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&oe.current&&(ne.current?.(),ne.current=null,I.current=-1,z(e),!d)){let e=M.current,t=X1(K_(e));e&&Z1(e,t)&&e.focus({preventScroll:!0})}}}),[ue,ie,M,p,n,z,oe,d]),he=b.useMemo(()=>d&&E&&le&&{"aria-activedescendant":`${y}-${r}`},[d,E,le,y,r]),ge=b.useMemo(()=>({...j?{}:he,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=$1(t.nativeEvent);if(n&&!Z1(M.current,n))return;W1(t);let r=w1(Xg,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&v_(i)&&i.focus()}else pe(t)},onPointerMove(e){T2(e)||(R.current=!0)}}),[he,pe,M,j,e,E,d,O,C]),_e=b.useMemo(()=>{function t(t){e.setOpen(!0,w1(Qg,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&K1(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&q1(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=k2(n.key,de(),u),o=D2(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||u0(n.currentTarget)))return pe(n);if(r||m||!i){if(s){let e=D2(n.key,de());L.current=l&&e?null:n.key}l?a&&(W1(n),r?(I.current=fe(),z(n),d&&M.current?.focus()):t(n)):o&&(ae.current!=null&&(I.current=ae.current),W1(n),!r&&m?t(n):pe(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[pe,f,fe,l,z,e,m,g,_,de,u,ae,d,M]),ve=b.useMemo(()=>({...he,..._e}),[he,_e]);return b.useMemo(()=>a?{reference:ve,floating:ge,item:me,trigger:_e}:{},[a,ve,ge,_e,me])}function M2(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=B_(s),f=e.useState(`open`),p=U1(),m=b.useRef(``),h=b.useRef(u??i??-1),g=b.useRef(null),_=B_(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!dv(n)||n?.matches(`:disabled`)?!1:o==null||!lv(Zh,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(W1(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(W1(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=B_(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Z1(r,n)||Z1(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});Y(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=b.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return b.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var N2=.1,P2=N2*N2,F2=.5;function I2(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function L2(e,t,n,r,i,a,o,s,c,l){let u=!1;return I2(e,t,n,r,i,a)&&(u=!u),I2(e,t,i,a,o,s)&&(u=!u),I2(e,t,o,s,c,l)&&(u=!u),I2(e,t,c,l,n,r)&&(u=!u),u}function R2(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function z2(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function B2(e={}){let{blockPointerEvents:t=!1}=e,n=new H1,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*P2;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=$1(r),g=r.type===`mouseleave`,_=Z1(u,h),v=Z1(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&__(r.relatedTarget)&&Z1(u,r.relatedTarget))return;function y(){return!!(s&&Fv(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=z2(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=z2(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=z2(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=z2(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!R2(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?F2/2:F2*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+F2+1,o=C||T?S.bottom-F2:S.top,s=C?T?S.bottom-F2:S.top:S.bottom-F2;M=L2(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?F2/2:F2*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-F2,o=C||T?S.top+F2:S.bottom,s=C?T?S.top+F2:S.bottom:S.top+F2;M=L2(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?F2/2:F2*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+F2+1,o=w||E?S.right-F2:S.left,s=w?E?S.right-F2:S.left:S.right-F2;M=L2(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?F2/2:F2*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-F2,o=w||E?S.left+F2:S.right,s=w?E?S.left+F2:S.right:S.left+F2;M=L2(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function V2(e,t,n){let{reference:r,floating:i}=e,a=W0(t),o=G0(t),s=U0(o),c=B0(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=V0(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function H2(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=z0(t,e),p=rv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=iv(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=iv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var U2=50,W2=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:H2},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=V2(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<U2&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=V2(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},G2=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=z0(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=B0(r),_=W0(o),v=B0(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[tv(o)]:q0(o)),x=p!==`none`;!d&&x&&b.push(...ev(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=K0(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===W0(t)||T.every(e=>W0(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=W0(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},K2=new Set([`left`,`top`]);async function q2(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=B0(n),s=V0(n),c=W0(n)===`y`,l=K2.has(o)?-1:1,u=a&&c?-1:1,d=z0(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var J2=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await q2(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Y2=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=z0(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=W0(i),p=H0(f),m=u[p],h=u[f],g=(e,t)=>R0(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},X2=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=z0(e,t),u={x:n,y:r},d=W0(i),f=H0(d),p=u[f],m=u[d],h=z0(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=K2.has(B0(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Z2=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=z0(e,t),c=await i.detectOverflow(t,s),l=B0(n),u=V0(n),d=W0(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=M0(p-c[m],g),y=M0(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*N0(c.left,c.right):S=p-2*N0(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Q2(e){let t=j_(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=v_(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=P0(n)!==a||P0(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $2(e){return __(e)?e:e.contextElement}function e4(e){let t=$2(e);if(!v_(t))return I0(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Q2(t),o=(a?P0(n.width):n.width)/r,s=(a?P0(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var t4=I0(0);function n4(e){let t=m_(e);return!k_()||!t.visualViewport?t4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function r4(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===m_(e)}function i4(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$2(e),o=I0(1);t&&(r?__(r)&&(o=e4(r)):o=e4(e));let s=r4(a,n,r)?n4(a):I0(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=m_(a),t=__(r)?m_(r):r,n=e,i=I_(n);for(;i&&t!==n;){let e=e4(i),t=i.getBoundingClientRect(),r=j_(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=m_(i),i=I_(n)}}return iv({width:u,height:d,x:c,y:l})}function a4(e,t){let n=M_(e).scrollLeft;return t?t.left+n:i4(h_(e)).left+n}function o4(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-a4(e,n),y:n.top+t.scrollTop}}function s4(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=h_(r),s=t?S_(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=I0(1),u=I0(0),d=v_(r);if((d||!a)&&((p_(r)!==`body`||b_(o))&&(c=M_(r)),d)){let e=i4(r);l=e4(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?o4(o,c):I0(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function c4(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function l4(e){let t=M_(e),n=e.ownerDocument.body,r=N0(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=N0(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+a4(e),o=-t.scrollTop;return j_(n).direction===`rtl`&&(a+=N0(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var u4=25;function d4(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=m_(e),a=h_(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!k_()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(a4(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=u4&&(s-=o)}return{width:s,height:c,x:l,y:u}}function f4(e,t){let n=i4(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=e4(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function p4(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=d4(e,n,t);else if(t===`document`)r=l4(h_(e));else if(__(t))r=f4(t,n);else{let n=n4(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return iv(r)}function m4(e,t){let n=t.get(e);if(n)return n;let r=F_(e,[],!1).filter(e=>__(e)&&p_(e)!==`body`),i=null,a=j_(e).position===`fixed`,o=a?N_(e):e;for(;__(o)&&!A_(o);){let e=j_(o),t=D_(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=N_(o)}return t.set(e,r),r}function h4(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?S_(t)?[]:m4(t,this._c):[].concat(n),r],o=p4(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=p4(t,a[e],i);s=N0(n.top,s),c=M0(n.right,c),l=M0(n.bottom,l),u=N0(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function g4(e){let{width:t,height:n}=Q2(e);return{width:t,height:n}}function _4(e,t,n){let r=v_(t),i=h_(t),a=n===`fixed`,o=i4(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=I0(0);if((r||!a)&&((p_(t)!==`body`||b_(i))&&(s=M_(t)),r)){let e=i4(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=a4(i));let l=i&&!r&&!a?o4(i,s):I0(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function v4(e){return j_(e).position===`static`}function y4(e,t){if(!v_(e)||j_(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return h_(e)===n&&(n=n.ownerDocument.body),n}function b4(e,t){let n=m_(e);if(S_(e))return n;if(!v_(e)){let t=N_(e);for(;t&&!A_(t);){if(__(t)&&!v4(t))return t;t=N_(t)}return n}let r=y4(e,t);for(;r&&x_(r)&&v4(r);)r=y4(r,t);return r&&A_(r)&&v4(r)&&!D_(r)?n:r||O_(e)||n}var x4=async function(e){let t=this.getOffsetParent||b4,n=await(0,this.getDimensions)(e.floating);return{reference:_4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function S4(e){return j_(e).direction===`rtl`}var C4={convertOffsetParentRelativeRectToViewportRelativeRect:s4,getDocumentElement:h_,getClippingRect:h4,getOffsetParent:b4,getElementRects:x4,getClientRects:c4,getDimensions:g4,getScale:e4,isElement:__,isRTL:S4};function w4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function T4(e,t,n){let r=null,i,a=h_(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=F0(d),h=F0(a.clientWidth-(u+f)),g=F0(a.clientHeight-(d+p)),_=F0(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:N0(0,M0(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!w4(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=m_(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function E4(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=$2(e),u=i||a?[...l?F_(l):[],...t?F_(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?T4(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?i4(e):null;c&&g();function g(){let t=i4(e);h&&!w4(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var D4=J2,O4=Y2,k4=G2,A4=Z2,j4=X2,M4=(e,t,n)=>{let r=new Map,i=n??{},a={...C4,...i.platform,_c:r};return W2(e,t,{...i,platform:a})},N4=typeof document<`u`?b.useLayoutEffect:function(){};function P4(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!P4(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!P4(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function F4(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function I4(e,t){let n=F4(e);return Math.round(t*n)/n}function L4(e){let t=b.useRef(e);return N4(()=>{t.current=e}),t}function R4(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);P4(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=L4(c),O=L4(i),k=L4(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),M4(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!P4(T.current,t)&&(T.current=t,P1.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);N4(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=b.useRef(!1);N4(()=>(j.current=!0,()=>{j.current=!1}),[]),N4(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=I4(N.floating,u.x),r=I4(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...F4(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var z4=(e,t)=>{let n=D4(e);return{name:n.name,fn:n.fn,options:[e,t]}},B4=(e,t)=>{let n=O4(e);return{name:n.name,fn:n.fn,options:[e,t]}},V4=(e,t)=>({fn:j4(e).fn,options:[e,t]}),H4=(e,t)=>{let n=k4(e);return{name:n.name,fn:n.fn,options:[e,t]}},U4=(e,t)=>{let n=A4(e);return{name:n.name,fn:n.fn,options:[e,t]}},W4=b.createContext(void 0);function G4(e){let t=b.useContext(W4);if(t===void 0&&!e)throw Error(Nh(69));return t}var K4=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function q4(e){return e===`starting`?Zv:Qh}var J4=b.createContext(void 0);function Y4(){return b.useContext(J4)}function X4(e,t){let n=bg(e.render);if(b.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function Z4(e,t,n){let r=X4(e,t),i=r===t?void 0:r;return[r,b.useCallback(e=>n?.(e?i:void 0),[i,n])]}function Q4(e,t,n){let r=bg(e.render),i=b.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var $4=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=Lh(),m=Y4(),{side:h,align:g}=Fh(),_=G4(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),S=l.useState(`popupProps`),C=l.useState(`mounted`),w=l.useState(`instantType`),T=l.useState(`activeTriggerElement`),E=l.useState(`parent`),D=l.useState(`lastOpenChangeReason`),O=l.useState(`rootId`),k=l.useState(`floatingRootContext`),A=l.useState(`floatingTreeRoot`),j=l.useState(`closeDelay`),M=l.useState(`hoverEnabled`),N=l.useState(`disabled`),P=l.useState(`openMethod`),F=l.useState(`activeTriggerId`),I=l.useState(`listElement`),[L,R]=Z4(e,u,d),z=Q4(e,T,F),B=E.type===`menu`?m:void 0,ee=E.type===`context-menu`,V=s??E.type!==`menu`;s===void 0&&I&&E.type!==`menu`&&(V=()=>l.state.activeIndex===null&&I),R1({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),b.useEffect(()=>{function e(e){l.setOpen(!1,w1(e.reason,e.domEvent))}return A.events.on(`close`,e),()=>{A.events.off(`close`,e)}},[A.events,l]),S2(k,{enabled:M&&!N&&!ee&&E.type!==`menubar`,closeDelay:j});let te=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:ne,handleFocus:re}=(b.useContext(s_)?.useParentHandoff??t3)(l,E,v,f),ie=gg(`div`,e,{state:{transitionStatus:y,side:h,align:g,open:v,nested:E.type===`menu`,instant:w},ref:[t,l.context.popupRef,te,R],stateAttributesMapping:Bg,props:[S,{id:L,...I?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":z},onKeyDown(e){B?.onPopupKeyDown?.(e),_&&K4.has(e.key)&&e.stopPropagation()},onFocus:re},q4(y),c,{"data-rootownerid":O}]}),ae=E.type===void 0||ee;(T||E.type===`menubar`&&D!==`outside-press`)&&(ae=!0);let oe=B?.getReturnElement??ne;return(0,x.jsx)(wy,{context:k,openInteractionType:P,modal:ee,disabled:!C,returnFocus:a??oe??ae,explicitReturnFocus:a===void 0&&oe?!1:void 0,initialFocus:V,restoreFocus:!0,getInsideElements:E.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:E.type===`menubar`?void 0:A,previousFocusableElement:T,nextFocusableElement:E.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:ie})}),e3={parentVirtualFocusRef:void 0,handleFocus:void 0};function t3(){return e3}var n3=b.forwardRef(function(e,t){let n=c_()?.Popup??$4;return(0,x.jsx)(n,{...e,ref:t})}),r3=b.createContext(void 0);function i3(){let e=b.useContext(r3);if(e===void 0)throw Error(Nh(32));return e}var a3=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Lh();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,x.jsx)(r3.Provider,{value:n,children:(0,x.jsx)(oy,{ref:t,...r,portalOwnerRole:o})})});function o3(e){return qh(19)?e:e?`true`:void 0}function s3(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=b.useState(null),d=b.useRef(null),f=fy(n),p=b.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=R4({...e,elements:{...p,...l&&{reference:l}}}),h=b.useCallback(e=>{let t=__(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=b.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=b.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=b.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return Y(()=>{o&&(d.current=o)},[o]),Y(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),b.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var c3=b.createContext(void 0);function l3(){return b.useContext(c3)?.direction??`ltr`}var u3=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=z0(e,t)||{};if(l==null)return{};let d=rv(u),f={x:n,y:r},p=G0(i),m=U0(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=R0(D,k,O),j=!c.arrow&&V0(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),d3=(e,t)=>{let{name:n,fn:r}=u3(e);return{name:n,fn:r,options:[e,t]}},f3={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},p3={sideX:`left`,sideY:`top`},m3=`--available-width`,h3=`--available-height`,g3=`--anchor-width`,_3=`--anchor-height`,v3=`--transform-origin`,y3=m3,b3=h3;function x3(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function S3(e,t,n){let{rects:r,placement:i}=e;return{side:x3(t,B0(i),n),align:V0(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function C3(e){return w3(e,s3)}function w3(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=_.side||`flip`,T=_.align||`flip`,E=_.fallbackAxisSide||`end`,D=v?.crossAxis??!1,O=v?.rootBoundary,k=typeof n==`function`?n:void 0,A=B_(k),j=k?A:n,M=E0(n),N=E0(g),P=l3()===`rtl`,[F,I]=b.useState(null);!g&&F!==null&&I(null);let L=S===`placement`,R=F?B0(F):null,z=F&&L?V0(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],ee=z||o,V=ee===`center`?B:`${B}-${ee}`,te=l;typeof te==`number`?te={top:te,right:te,bottom:te,left:te}:te&&={top:te.top||0,right:te.right||0,bottom:te.bottom||0,left:te.left||0};let ne=+(i===`bottom`),re=+(i===`top`),ie=+(i===`right`),ae=+(i===`left`),oe={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:te},se=b.useRef(null),H=E0(a),ce=E0(s),le=typeof a==`function`?0:a,ue=typeof s==`function`?0:s,de=[];p&&de.push(p),de.push(z4(e=>{let t=S3(e,i,P),n=typeof H.current==`function`?H.current(t):H.current,r=typeof ce.current==`function`?ce.current(t):ce.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[le,ue,P,i]));let fe=T===`none`&&w!==`shift`,pe=!fe&&(u||D||w===`shift`),me=w===`none`?null:H4({...oe,padding:{top:te.top+1+ne,right:te.right+1+ae,bottom:te.bottom+1+re,left:te.left+1+ie},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),he=fe?null:B4({...oe,rootBoundary:O,mainAxis:T!==`none`,crossAxis:pe,limiter:u||D?void 0:V4(e=>{if(!se.current)return{};let{width:t,height:n}=se.current.getBoundingClientRect(),r=W0(B0(e.placement)),i=r===`y`?t:n,a=r===`y`?te.left+te.right:te.top+te.bottom;return{offset:i/2+a/2}})},[oe,u,D,O,te,T]);w===`shift`||T===`shift`||ee===`center`?de.push(he,me):de.push(me,he),de.push(U4({...oe,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(y3,`${t}px`),i.setProperty(b3,`${n}px`);let a=m_(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(g3,`${u}px`),i.setProperty(_3,`${d}px`)}}),d3(e=>({element:se.current||K_(e.elements.floating).createElement(`div`),padding:se.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=B0(r),u=V0(r),d=W0(l)===`y`,f=se.current,p=typeof a==`function`?a(S3(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return pe&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(v3,d?`${m} ${h}`:`${h} ${m}`),{}}},f3,x),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let ge=b.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:_e,elements:ve,x:ye,y:be,middlewareData:xe,update:Se,placement:Ce,context:we,isPositioned:Te,floatingStyles:Ee}=t({rootContext:h,open:m?g:void 0,placement:V,middleware:de,strategy:r,whileElementsMounted:m?void 0:(...e)=>E4(...e,ge),nodeId:y,externalTree:C}),{sideX:De,sideY:Oe}=xe.adaptiveOrigin||p3,ke=Te?r:`fixed`,Ae=b.useMemo(()=>{let e;return e=Te?x?{position:ke,[De]:ye,[Oe]:be}:{...Ee,position:ke}:{position:ke,top:0,left:0},e[y3]=`100vw`,e[b3]=`100vh`,Te||(e.opacity=0),e},[x,ke,De,ye,Oe,be,Ee,Te]),je=b.useRef(null);Y(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(T3(t)?t.current:t)||null;n!==je.current&&(_e.setPositionReference(n),je.current=n)},[g,_e,j,M]),b.useEffect(()=>{if(!g)return;let e=M.current;typeof e!=`function`&&T3(e)&&e.current!==je.current&&(_e.setPositionReference(e.current),je.current=e.current)},[g,_e,j,M]),b.useEffect(()=>{if(m&&g&&ve.reference&&ve.floating)return E4(ve.reference,ve.floating,Se,ge)},[m,g,ve,Se,ge]);let Me=B0(Ce),Ne=x3(i,Me,P),Pe=V0(Ce)||`center`,Fe=!!xe.hide?.referenceHidden;Y(()=>{S&&g&&Te&&(Me!==B||L&&Pe!==ee)&&I(Ce)},[S,L,g,Te,Ce,Me,Pe,B,ee]);let Ie=b.useMemo(()=>({position:`absolute`,top:xe.arrow?.y,left:xe.arrow?.x}),[xe.arrow]),Le=xe.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:Ae,arrowStyles:Ie,arrowRef:se,arrowUncentered:Le,side:Ne,align:Pe,physicalSide:Me,anchorHidden:Fe,refs:_e,context:we,isPositioned:Te,update:Se}),[Ae,Ie,se,Le,Ne,Pe,Me,Fe,_e,we,Te,Se])}function T3(e){return e!=null&&`current`in e}function E3(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=B_(i),[,o]=b.useState(0),s=zh(O3).current,c=zh(D3).current,l=b.useRef(0),u=b.useRef(!0),d=b.useRef(null),f=b.useRef(null),p=B_(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=B_((e,t)=>{c.set(e,t),p()}),h=B_(e=>{c.delete(e),p()}),g=B_(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!j3(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&M3(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=A3(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=B_(()=>{let[e,t]=k3(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Y(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Y(()=>{u.current&&v()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=B_(e=>(s.add(e),()=>{s.delete(e)})),S=b.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,x.jsx)(h1.Provider,{value:S,children:t})}function D3(){return new Map}function O3(){return new Set}function k3(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>M3(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function A3(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function j3(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function M3(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var N3=b.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,x.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function P3(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=b.useRef(null),o=b.useRef(null),s=L1(r);Y(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),Y(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function F3(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),gg(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},q4(r),i],stateAttributesMapping:zg})}var I3={},L3={},R3=``;function z3(e,t){return b_(e)?e:t}function B3(e,t,n){return/hidden|clip/.test(e.getComputedStyle(z3(t,n)).overflowY)}function V3(e){if(typeof document>`u`)return!1;let t=K_(e);return m_(t).innerWidth-t.documentElement.clientWidth>0}function H3(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=K_(e),n=t.documentElement,r=z3(n,t.body),i=r.style.overflowY,a=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,r.style.overflowY=`scroll`;let o=r.offsetWidth;r.style.overflowY=`hidden`;let s=r.offsetWidth;return r.style.overflowY=i,n.style.scrollbarGutter=a,o===s}function U3(e){let t=K_(e),n=z3(t.documentElement,t.body),r={overflowY:n.style.overflowY,overflowX:n.style.overflowX};return Object.assign(n.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(n.style,r)}}function W3(e){let t=K_(e),n=t.documentElement,r=t.body,i=m_(n),a=0,o=0,s=!1,c=k1.create();if(c1&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,I3={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},R3=n.style.scrollBehavior,L3={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=z3(n,r);s=H3(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,I3),Object.assign(r.style,L3),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=R3)}function d(){u(),c.request(l)}l();let f=w0(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var G3=new class{lockCount=0;restore=null;timeoutLock=H1.create();timeoutUnlock=H1.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=K_(e),n=t.documentElement,r=t.body,i=m_(n);if(B3(i,n,r)){let t=new i.MutationObserver(()=>{B3(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=r1||!V3(e);this.restore=a?U3(e):W3(e)}};function K3(e=!0,t=null){Y(()=>{if(e)return G3.acquire(t)},[e,t])}var q3=20;function J3(e,t,n,r){let[i,a]=b.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=K_(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-q3)},[e,t,n]),K3(e&&(!t||i),r)}var Y3=b.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=$v,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:S}=Lh(),C=i3(),w=Hg(!0),T=v.useState(`parent`),E=v.useState(`floatingRootContext`),D=v.useState(`floatingTreeRoot`),O=v.useState(`mounted`),k=v.useState(`open`),A=v.useState(`modal`),j=v.useState(`openMethod`),M=v.useState(`activeTriggerElement`),N=v.useState(`transitionStatus`),P=v.useState(`positionerElement`),F=v.useState(`instantType`),I=v.useState(`adaptiveOrigin`),L=v.useState(`lastOpenChangeReason`),R=v.useState(`floatingNodeId`),z=v.useState(`floatingParentNodeId`),B=E.useState(`domReferenceElement`),ee=n,V=c,te=l,ne=s,re=h;T.type===`context-menu`&&(ee=n??T.context?.anchor,ne??=`start`,!o&&ne!==`center`&&(te=e.alignOffset??2,V=e.sideOffset??-5));let ie=o,ae=ne;T.type===`menu`?(ie??=`inline-end`,ae??=`start`,re=e.collisionAvoidance??ey):T.type===`menubar`&&(ie??=T.context.orientation===`vertical`?`inline-end`:`bottom`,ae??=`start`);let oe=T.type===`context-menu`,se=C3({anchor:ee,floatingRootContext:E,positionMethod:w?`fixed`:r,mounted:O,side:ie,sideOffset:V,align:ae,alignOffset:te,arrowPadding:oe?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:R,keepMounted:C,disableAnchorTracking:m,collisionAvoidance:re,shift:oe?{crossAxis:!(`side`in re&&re.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:D,adaptiveOrigin:I,lazyFlip:y?`placement`:!1});b.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===R&&v.set(`hoverEnabled`,!1),e.nodeId!==R&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,w1(n_)))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[v,D.events,R]),b.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,w1(t))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[D.events,v]);let H=U1();b.useEffect(()=>{k||H.clear()},[k,H]),b.useEffect(()=>{function e(e){if(k&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&M&&M!==e.target){let e=v.select(`closeDelay`);e>0?H.isStarted()||H.start(e,()=>{v.setOpen(!1,w1(n_))}):v.setOpen(!1,w1(n_))}else H.clear()}}return D.events.on(`itemhover`,e),()=>{D.events.off(`itemhover`,e)}},[D.events,k,M,v,H]),b.useEffect(()=>{let e={open:k,nodeId:R,parentNodeId:z,reason:v.select(`lastOpenChangeReason`)};D.events.emit(`menuopenchange`,e)},[D.events,k,v,R,z]),P3({store:v,domReference:B,positionerElement:P,open:k});let ce={open:k,side:se.side,align:se.align,anchorHidden:se.anchorHidden,nested:T.type===`menu`,instant:F},le=T.type===`menubar`&&T.context.modal;J3(k&&(le||A&&L!==`trigger-hover`),j===`touch`,P,M);let ue=F3(e,ce,{styles:se.positionerStyles,transitionStatus:N,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!O,inert:!k}),de=O&&T.type!==`menu`&&(T.type!==`menubar`&&A&&L!==`trigger-hover`||T.type===`menubar`&&T.context.modal),fe=null;return T.type===`menubar`?fe=T.context.contentElement:T.type===void 0&&(fe=M),(0,x.jsxs)(Ph.Provider,{value:se,children:[de&&(0,x.jsx)(N3,{ref:T.type===`context-menu`||T.type===`nested-context-menu`?T.context.internalBackdropRef:null,inert:o3(!k),cutout:fe}),(0,x.jsx)(my,{id:R,children:(0,x.jsx)(E3,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:S,children:ue})})]})}),X3=b.createContext(null);function Z3(e){let t=b.useContext(X3);if(t===null&&!e)throw Error(Nh(5));return t}function Q3(e){let t=b.useRef(``),n=b.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:b.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function $3(e,t){let n=b.useRef(e),r=B_(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function e6(e,t){let{onClick:n,onPointerDown:r}=Q3(B_((n,r)=>{(typeof e==`function`?e():e)||t(r||(r1?`touch`:``))}));return b.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function t6(e){let[t,n]=b.useState(null),r=e6(e,n);return $3(e,t=>{t&&!e&&n(null)}),b.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function n6(e){return e==null?Ug:e.type.startsWith(`key`)?$g:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?e_:Ug}var r6={...f2,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=f2.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>c1&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!f2.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},i6=class extends i2{constructor(e,t,n=!1){let r=new Jy,i=o6(r,t,n,e);super(i,a6(r),r6),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function a6(e){return{positionerRef:b.createRef(),popupRef:b.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:b.createRef(),beforeTriggerFocusGuardRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function o6(e,t,n=!1,r){return{...o2(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Qh,inputProps:Qh,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new cy,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Qh,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var s6=b.createContext(null);function c6(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function l6(e,t){return e===`list-navigation`||c6(e,t)}var u6=$y(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:S=!0,resetOnPointerLeave:C=!0}=e,w=Hg(!0),T=Lh(!0),E=Z3(!0),D=T?.store,O=T?.virtualFocus??!1,k=b.useMemo(()=>_&&D?{type:`menu`,store:D}:E?{type:`menubar`,context:E}:w&&!D?{type:`context-menu`,context:w}:{type:void 0},[w,D,E,_]),A=C1(),j=C1(),[M,N]=b.useState(void 0),P=(M??j)||void 0,F=dy(),I=k.type===`menu`?k.store:void 0,L=(n??o)&&I?.state.transitionStatus===`starting`,R=zh(()=>L?I?.state.instantType:void 0).current,z=zh(()=>{let e=new i6({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:k,disabled:s,highlightItemOnHover:g,modal:k.type===void 0?c:void 0,rootId:A,instantType:R},P,F!=null);return e.context.virtualFocusRef=y,e}).current;z.useControlledProp(`openProp`,n),z.useControlledProp(`triggerIdProp`,m),z.useContextCallback(`onOpenChangeComplete`,i);let B=z.useState(`floatingTreeRoot`),ee=py(B),V=z.useState(`open`),te=z.useState(`activeTriggerElement`),ne=z.useState(`positionerElement`),re=z.useState(`hoverEnabled`),ie=z.useState(`disabled`),ae=z.useState(`lastOpenChangeReason`),oe=z.useState(`parent`),se=z.useState(`activeIndex`),H=z.useState(`keyboardOpen`),ce=z.useState(`payload`),le=z.useState(`floatingParentNodeId`),ue=b.useRef(null),de=b.useRef(oe.type!==`context-menu`),fe=U1(),pe=b.useRef(!0),me=U1(),he=le!=null,{openMethod:ge,triggerProps:_e}=t6(V);z.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:oe.type===void 0?c:void 0,openMethod:ge,rootId:A}),Wy(z);let{forceUnmount:ve,transitionStatus:ye}=Gy(V,z,()=>{z.set(`allowMouseEnter`,!1)},L),be=L1(z.context.popupRef);b.useEffect(()=>{if(R===void 0)return;let e=()=>{z.state.instantType===R&&z.set(`instantType`,void 0)};if(!V){e();return}if(ye!==void 0)return;if(z.context.popupRef.current==null){e();return}let t=new AbortController;return be(e,t.signal),()=>{t.abort()}},[R,V,ye,be,z]),Y(()=>{w&&!T?z.update({parent:{type:`context-menu`,context:w},floatingNodeId:ee,floatingParentNodeId:F}):(T||!z.select(`activeTriggerElement`))&&z.update({floatingNodeId:ee,floatingParentNodeId:F})},[w,T,ee,F,te,z]),b.useEffect(()=>{V||(ue.current=null),oe.type===`context-menu`&&(V?fe.start(500,()=>{de.current=!0}):(fe.clear(),de.current=!1))},[fe,V,oe.type]),Y(()=>{!V&&!re&&z.set(`hoverEnabled`,!0)},[V,re,z]);let xe=B_((e,t)=>{let n=t.reason;if(!e&&!z.select(`open`)||V===e&&t.trigger===te&&ae===n)return;let i=Vy(t);if(!e&&t.trigger==null&&(t.trigger=te??void 0),r?.(e,t),t.isCanceled)return;z.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!pe.current)return;e&&n===`trigger-focus`?(pe.current=!1,me.start(300,()=>{pe.current=!0})):(pe.current=!0,me.clear());let o=!e&&(n===`escape-key`||n==null);ue.current=t.event;let s=By(z.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&l6(n,a),s.instantType=oe.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:c6(n,a)?`click`:o?`dismiss`:void 0,z.update(s)}),Se=My({popupStore:z,floatingRootContext:z.state.floatingRootContext,floatingId:P,nested:F!=null,onOpenChange:xe}),Ce=Se.context.events;Y(()=>{let e=({open:e,eventDetails:t})=>xe(e,t);return Ce.on(`setOpen`,e),()=>{Ce?.off(`setOpen`,e)}},[Ce,xe]),Y(()=>z.subscribeToParentMenu(),[z]);let we=b.useCallback(()=>{z.setOpen(!1,w1(i_))},[z]);b.useImperativeHandle(d,()=>({unmount:ve,close:we}),[ve,we]);let Te;oe.type===`context-menu`&&(Te=oe.context),b.useImperativeHandle(Te?.positionerRef,()=>ne,[ne]),b.useImperativeHandle(Te?.actionsRef,()=>({setOpen:xe}),[xe]);let Ee=jy(Se,{enabled:!ie,bubbles:{escapeKey:f&&oe.type===`menu`},outsidePress(){return oe.type!==`context-menu`||ue.current?.type===`contextmenu`||de.current},externalTree:he?B:void 0}),De=l3(),Oe=j2(Se,{enabled:!ie,listRef:z.context.itemDomElements,activeIndex:se,virtual:v,nested:oe.type===`menubar`||!v&&oe.type!==void 0,parentOrientation:oe.type===`menubar`?oe.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?H:void 0,allowEscape:v&&l&&S,orientation:u,triggerOrientation:v?`vertical`:u,rtl:De===`rtl`,disabledIndices:Zh,onNavigate(e,t){z.setActiveIndex(e,n6(t),t?.nativeEvent)},openOnArrowKeyDown:oe.type!==`context-menu`&&!(v&&_),externalTree:!v&&he?B:void 0,nestedReturnFocusRef:I?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:C}),ke=b.useCallback(e=>{z.context.typingRef.current=e},[z]),Ae=M2(Se,{enabled:!ie&&!v,listRef:z.context.itemLabels,elementsRef:z.context.itemDomElements,activeIndex:se,resetMs:500,onMatch:(e,t)=>{V&&e!==se&&z.setActiveIndex(e,$g,t.nativeEvent)},onTyping:ke}),je=B_(a),Me=b.useRef(-1),Ne=B_(()=>{let e=z.state.activeIndex,t=e===null?void 0:z.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Me.current===n&&z.context.reportedItem===t)return;Me.current=n,z.context.reportedItem=t,v&&z.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=z.context;z.context.highlightReason=Ug,z.context.highlightEvent=void 0,a&&je(t,T1(r,i,{label:t===void 0?void 0:z.context.itemLabels.current[n]??void 0}))});Y(()=>{Ne()},[se,Ne]);let Pe=b.useMemo(()=>{if(!v)return Oe.reference;if(!Oe.trigger)return Qh;let{onFocus:e,...t}=Oe.trigger;return t},[v,Oe.reference,Oe.trigger]);z.useSyncedValue(`inputProps`,v?Oe.reference??Qh:Qh);let Fe=b.useMemo(()=>{let e=rg(Ae.reference,Pe,Ee.reference,{onMouseMove(){z.set(`allowMouseEnter`,!0)}},_e);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=V,e},[z,Ae.reference,Pe,Ee.reference,_e,V]),Ie=b.useMemo(()=>{let e=rg(Oe.trigger,Ee.trigger,_e);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Oe.trigger,Ee.trigger,_e]);zh(()=>(z.update({inactiveTriggerProps:Ie}),null)),Ky(z,{floatingRootContext:Se,activeTriggerProps:Fe,inactiveTriggerProps:Ie,popupProps:b.useMemo(()=>rg(Py,{onMouseMove(){z.set(`allowMouseEnter`,!0),oe.type===`menu`&&z.set(`hoverEnabled`,!1)},onClick(){z.select(`hoverEnabled`)&&z.set(`hoverEnabled`,!1)},onKeyDown(e){let t=z.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ae.floating,Oe.floating,Ee.floating),[oe.type,z,Ae.floating,Oe.floating,Ee.floating]),itemProps:Oe.item??Qh});let Le=b.useMemo(()=>({store:z,parent:k,orientation:u,loopFocus:l,allowEscape:S,defaultFloatingId:j,setRenderedFloatingId:N,virtualFocus:v,parentVirtualFocus:O,syncHighlightedItem:Ne}),[z,k,u,l,S,j,v,O,Ne]),Re=typeof t==`function`?t({payload:ce}):t,ze=(0,x.jsxs)(Ih.Provider,{value:Le,children:[p&&(0,x.jsx)(Ly,{handle:p,store:z}),Re]});return(oe.type===void 0||oe.type===`context-menu`)&&(ze=(0,x.jsx)(hy,{externalTree:B,children:ze})),ze});function d6(e){let t=b.useContext(s6);if(t===null)return(0,x.jsx)(u6,{...e});let n=t.Root;return(0,x.jsx)(s6.Provider,{value:null,children:(0,x.jsx)(n,{...t.options,...e})})}var f6=5;function p6(e,t){let n=m6(t);return e.clientX>=n.left-f6&&e.clientX<=n.right+f6&&e.clientY>=n.top-f6&&e.clientY<=n.bottom+f6}function m6(e){let t=e.getBoundingClientRect(),n=m_(e);if(u1)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function h6(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=W_(),{ref:i,index:a}=_1(e),o=n===a,s=b.useRef(null),c=Bh(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function g6(e){let{render:t,className:n,style:r,state:i=Qh,props:a=Zh,refs:o=Zh,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=h6({metadata:s});return gg(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function _6(e){if(v_(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!A_(e))return _6(N_(e))}function v6(e,t){function n(n,r,i){let a=n.currentTarget;P1.flushSync(()=>{e.setOpen(!1,w1(Xg,n.nativeEvent,a))}),jv(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&Mv(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function y6(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=b.useRef(!1);return b.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,K_(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Qh,[t,n,r])}var b6=e2(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=Lh(!0),h=p2(d)??m?.store;if(!h)throw Error(Nh(85));let g=C1(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),S=h.useState(`triggerControlsId`,g),C=b.useRef(null),w=S6(),T=W_(!0),E=fy(),D=b.useMemo(()=>E??new cy,[E]),{registerTrigger:O,isMountedByThisTrigger:k}=Uy(g,C,h,{payload:f,closeDelay:u,parent:w,floatingTreeRoot:D,floatingNodeId:py(D),floatingParentNodeId:dy(),keyboardEventRelay:T?.relayKeyboardEvent}),A=w.type===`menubar`,j=h.useState(`disabled`),M=a||j||A&&w.context.disabled,{getButtonProps:N,buttonRef:P}=J_({disabled:M,native:o});b.useEffect(()=>{!y&&w.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,w.type]);let F=b.useRef(null),I=U1(),L=B_(e=>{if(!F.current)return;I.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Z1(F.current,t)||Z1(h.select(`positionerElement`),t)||t===F.current||t!=null&&_6(t)===h.select(`rootId`)||p6(e,F.current)||D.events.emit(`close`,{domEvent:e,reason:t_})});b.useEffect(()=>{let e=K_(F.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,L,{once:!0}),()=>{e.removeEventListener(`mouseup`,L)}},[y,L,h]);let R=A&&w.context.hasSubmenuOpen,z=w2(v,{enabled:(c??R)&&!M&&(!A||R&&!k),handleClose:B2({blockPointerEvents:!A}),mouseOnly:!0,move:!1,restMs:w.type===void 0?l:void 0,delay:{close:u},triggerElementRef:C,externalTree:D,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),B=x6(y,h.select(`lastOpenChangeReason`)),ee=Ty(v,{enabled:!M,event:y&&A?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0&&B}),V=g2(v,{enabled:!M&&R}),te=y6({open:y,enabled:A,mouseDownAction:`open`}),ne=b.useMemo(()=>rg(V.reference,ee.reference),[V.reference,ee.reference]),re=h.useState(`triggerProps`,k),ie=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:ae,handleFocusTargetFocus:oe}=v6(h,C),se={disabled:M,open:y},H=[F,t,P,O,C],ce=[ne,z??Qh,re,{"aria-haspopup":`menu`,"aria-controls":S,id:g,onMouseDown:e=>{h.select(`open`)||(I.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),K_(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},ie,A?{role:`menuitem`}:{},te,p,N],le=gg(`button`,e,{enabled:!A,stateAttributesMapping:Rg,state:se,ref:H,props:ce});return A?(0,x.jsx)(g6,{tag:`button`,render:n,className:r,style:i,state:se,refs:H,props:ce,stateAttributesMapping:Rg}):y?(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(j0,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:ae},`${g}-pre-focus-guard`),(0,x.jsx)(b.Fragment,{children:le},g),(0,x.jsx)(j0,{ref:h.context.triggerFocusTargetRef,onFocus:oe},`${g}-post-focus-guard`)]}):(0,x.jsx)(b.Fragment,{children:le},g)});function x6(e,t){let n=U1(),[r,i]=b.useState(!1);return Y(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function S6(){let e=Z3(!0);return b.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function C6(e){let[t,n]=b.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var w6=b.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return gg(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function T6(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function E6(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function D6(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function O6(e){return D6(e?.[0])}function k6(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(O6(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function A6(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return E6(e)}function j6(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?E6(e.value):E6(e)}var M6=b.createContext(void 0);function N6(e){let t=b.useContext(M6);if(t===void 0&&!e)throw Error(Nh(72));return t}var P6={...f2,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},F6=class extends i2{constructor(e,t,n){let r=new Jy;super(I6(e,r,t,n),L6(r),P6)}setOpen=(e,t)=>{Hy(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,w1(Wg,e))}};function I6(e,t,n,r=!1){return{...o2(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function L6(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var R6=$y(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Iy((e,t)=>new F6({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Wy(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:S}=Gy(h,p),C=p.useState(`isInstantPhase`),w=p.useState(`instantType`),T=p.useState(`lastOpenChangeReason`),E=b.useRef(null);Y(()=>{m&&t&&p.setOpen(!1,w1(r_))},[m,t,p]),Y(()=>{S===`ending`&&T===`none`||S!==`ending`&&C?(w!==`delay`&&(E.current=w),p.set(`instantType`,`delay`)):E.current!==null&&(p.set(`instantType`,E.current),E.current=null)},[S,C,T,w,p]),Y(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),b.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,w1(i_))}),[y,p]);let D=h||_||!t&&a!==`none`;return(0,x.jsxs)(M6.Provider,{value:p,children:[l&&(0,x.jsx)(Ly,{handle:l,store:p}),D&&(0,x.jsx)(z6,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function z6({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=jy(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Oy(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=b.useMemo(()=>rg(a.reference,i.reference),[a.reference,i.reference]);return Ky(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??Qh}),null}var B6=b.createContext(void 0);function V6(){return b.useContext(B6)}var H6=`data-base-ui-tooltip-trigger`;function U6(e){let t=$1(e);return __(t)?t:null}var W6=e2(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=N6(!0),m=p2(a)??p;if(!m)throw Error(Nh(82));let h=C1(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=b.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Uy(h,y,m,{payload:o,closeOnClick:l,closeDelay:x}),w=V6(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=C0(v,{open:_}),k=x2(v);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=E0(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=b.useRef(!1),I=U1(),L=b.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=y.current;if(!t||!e)return!1;let n=Q1(e,`[${H6}]`);return n!==null&&n!==t&&Z1(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let ee=w2(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?B2():null,restMs:R,delay(){return u==null&&O?{close:g0(E.current,`close`)}:{close:x}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),V=g2(v,{enabled:!j}).reference,te=e=>{let t=F.current,n=U6(e),r=B(n),i=y.current,a=i&&n&&Z1(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,w1(Gg,e));else if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&J1(L.current)){let t=()=>{F.current||M.current||m.select(`open`)||m.setOpen(!0,w1(Gg,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ne=m.useState(`appliedTriggerProps`,C||N!==`none`);return gg(`button`,e,{state:{open:_},ref:[t,S,y],props:[ee,V,ne,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){z(U6(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[o0]:j?``:void 0,[H6]:j?void 0:``},f],stateAttributesMapping:Lg})}),G6=b.createContext(void 0);function K6(){let e=b.useContext(G6);if(e===void 0)throw Error(Nh(70));return e}var q6=b.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=ay({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,x.jsxs)(b.Fragment,{children:[l,c&&P1.createPortal(n,c)]})}),J6=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return N6().useState(`mounted`)||n?(0,x.jsx)(G6.Provider,{value:n,children:(0,x.jsx)(q6,{ref:t,...r})}):null}),Y6=b.createContext(void 0);function X6(){let e=b.useContext(Y6);if(e===void 0)throw Error(Nh(71));return e}var Z6=b.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=ey,style:g,..._}=e,v=N6(),y=K6(),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`trackCursorAxis`),T=v.useState(`disableHoverablePopup`),E=v.useState(`floatingRootContext`),D=v.useState(`instantType`),O=v.useState(`transitionStatus`),k=C3({anchor:i,positionMethod:a,floatingRootContext:E,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),A=F3(e,b.useMemo(()=>({open:S,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w===`none`?D:`tracking-cursor`}),[S,k.side,k.align,k.anchorHidden,w,D]),{styles:k.positionerStyles,transitionStatus:O,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!C,inert:!S||w===`both`||T});return(0,x.jsx)(Y6.Provider,{value:k,children:A})}),Q6=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=N6(),{side:s,align:c}=X6(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);R1({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),S2(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return gg(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Py,f,q4(d),a],stateAttributesMapping:Bg})}),$6=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=b.useMemo(()=>({open:t,close:n}),[t,n]);return(0,x.jsx)(B6.Provider,{value:t,children:(0,x.jsx)(S0,{delay:i,timeoutMs:r,children:e.children})})},eb=b.createContext(void 0);function tb(e){let t=b.useContext(eb);if(!e&&t===void 0)throw Error(Nh(27));return t}var nb=b.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=tb(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return gg(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Bg,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),rb=b.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=tb(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=J_({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,w1(Yg,e.nativeEvent))}return gg(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),ib=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=tb(),c=C1(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),gg(`p`,e,{ref:t,props:[{id:c},o]})}),ab=b.createContext(void 0);function ob(){let e=b.useContext(ab);if(e===void 0)throw Error(Nh(26));return e}var cee=`--nested-dialogs`,lee=`data-nested-dialog-open`,sb={...zg,...Dg,nestedDialogOpen(e){return e?{[lee]:``}:null}},cb=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=tb(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),S=c.useState(`role`),C=d.useState(`floatingId`);ob(),R1({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let w=o===void 0?Fy(c.context.popupRef):o,T=g>0,E=c.useStateSetter(`popupElement`),D=gg(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:T},props:[f,{id:C,"aria-labelledby":y,"aria-describedby":l,role:S,...Py,hidden:!m,onKeyDown(e){K4.has(e.key)&&e.stopPropagation()},style:{[cee]:g}},s],ref:[t,c.context.popupRef,E],stateAttributesMapping:sb});return(0,x.jsx)(wy,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:w,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:D})}),lb=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=tb(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,x.jsx)(ab.Provider,{value:n,children:(0,x.jsxs)(oy,{ref:t,...r,children:[a&&o===!0&&(0,x.jsx)(N3,{ref:i.context.internalBackdropRef,inert:o3(!s)}),e.children]})}):null});function uee({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=b.useState(0),[d,f]=b.useState(0),p=l===0,m=jy(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=$1(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Z1(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return K3(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),Y(()=>{!r&&!i&&(u(0),f(0))},[r,i]),Y(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),Ky(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var dee={...f2,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},fee=class extends i2{constructor(e,t,n){let r=new Jy,i=pee(e,r,t,n);super(i,mee(r),dee)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(By(this.state,e,t.trigger)))}};function pee(e,t,n,r=!1){return{...o2(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function mee(e){return{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function hee(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=tb(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},S=Iy((e,t)=>new fee({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);S.useControlledProp(`openProp`,r),S.useControlledProp(`triggerIdProp`,d),S.useSyncedValues(y),S.useContextCallback(`onOpenChange`,a),S.useContextCallback(`onOpenChangeComplete`,o);let C=S.useState(`open`),w=S.useState(`mounted`),T=S.useState(`payload`);qy(S,C),Wy(S);let{forceUnmount:E}=Gy(C,S);b.useImperativeHandle(l,()=>({unmount:E,close:()=>S.setOpen(!1,w1(i_))}),[E,S]);let D=C||w||u!=null;return(0,x.jsxs)(eb.Provider,{value:S,children:[u&&(0,x.jsx)(Ly,{handle:u,store:S}),D&&(0,x.jsx)(uee,{store:S,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:T}):n]})}var ub=$y(function(e){return hee(`dialog`,e)}),gee=b.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=ob(),c=tb(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return gg(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:sb,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),db=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=tb(),c=C1(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),gg(`h2`,e,{ref:t,props:[{id:c},o]})}),fb=b.createContext(void 0);function pb(e){let t=b.useContext(fb);if(t===void 0&&!e)throw Error(Nh(47));return t}var mb={...f2,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!f2.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&f2.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>f2.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},hb=class extends i2{constructor(e,t,n){let r=new Jy;super(gb(e,r,t,n),_b(r),mb)}setOpen=(e,t)=>{let n=t.reason===Gg,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Vy(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=By(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),P1.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function gb(e,t,n,r=!1){let i={...o2(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function _b(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeTriggerFocusGuardRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new H1,stickIfOpen:!0,triggerElements:e}}var vb=$y(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=bb(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),qy(u,d),Wy(u);let{forceUnmount:m}=Gy(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),b.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),b.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,w1(i_))}),[m,u]);let h=d||f||s!=null;return(0,x.jsxs)(fb.Provider,{value:u,children:[s&&(0,x.jsx)(Ly,{handle:s,store:u}),h&&(0,x.jsx)(xb,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function yb(e){return pb(!0)?(0,x.jsx)(vb,{props:e}):(0,x.jsx)(hy,{children:(0,x.jsx)(vb,{props:e})})}function bb(e,t){let n=Iy((e,n)=>new hb(t,e,n));return b.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function xb({store:e,modal:t}){let n=jy(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference;return Ky(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:n.floating}),null}var Sb=e2(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=pb(!0),h=p2(s)??m;if(!h)throw Error(Nh(74));let g=C1(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),S=h.useState(`triggerPopupId`,g),C=b.useRef(null),{registerTrigger:w,isMountedByThisTrigger:T}=Uy(g,C,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),E=h.useState(`isPressOpenedByTrigger`,g),D=h.useState(`isTouchPressOpen`,l),O=h.useState(`hasTriggerFocusGuards`,g),k=w2(v,{enabled:!a&&l&&!D,mouseOnly:!0,move:!1,handleClose:B2(),restMs:u,delay:{close:d},triggerElementRef:C,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=Ty(v,{stickIfOpen:B_(()=>h.context.stickIfOpen)}),j=e6(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,T),{getButtonProps:N,buttonRef:P}=J_({disabled:a,native:o}),F={open(e){return E?Rg.open(e):Lg.open(e)}},{handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=v6(h,C),R=gg(`button`,e,{state:{disabled:a,open:y},ref:[P,t,w,C],props:[A.reference,k,M,j,{[Qv]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":S},p,N],stateAttributesMapping:F}),z=(0,x.jsx)(b.Fragment,{children:R},g);return O?(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(j0,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:I}),z,(0,x.jsx)(j0,{ref:h.context.triggerFocusTargetRef,onFocus:L})]}):z}),Cb=b.createContext(void 0);function wb(){let e=b.useContext(Cb);if(e===void 0)throw Error(Nh(45));return e}var Tb=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return pb().useState(`mounted`)||n?(0,x.jsx)(Cb.Provider,{value:n,children:(0,x.jsx)(oy,{ref:t,...r})}):null}),Eb=b.createContext(void 0);function Db(){let e=b.useContext(Eb);if(!e)throw Error(Nh(46));return e}var Ob=b.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=ey,..._}=e,v=pb(),y=wb(),b=py(),S=v.useState(`floatingRootContext`),C=v.useState(`mounted`),w=v.useState(`open`),T=v.useState(`openChangeReason`),E=v.useState(`activeTriggerElement`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=C3({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});P3({store:v,domReference:S.useState(`domReferenceElement`),positionerElement:k,open:w});let N=D===!0&&T!==`trigger-hover`;J3(w&&N,O===`touch`,k,E);let P=v.useStateSetter(`positionerElement`),F=F3(e,{open:w,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:A},{styles:M.positionerStyles,transitionStatus:j,props:_,refs:[t,P],hidden:!C,inert:!w});return(0,x.jsxs)(Eb.Provider,{value:M,children:[C&&N&&(0,x.jsx)(N3,{inert:o3(!w),cutout:E}),(0,x.jsx)(my,{id:b,children:F})]})}),kb=b.createContext(void 0);function Ab(){let[e,t]=b.useState(0),n=B_(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:b.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function jb(){let e=b.useContext(kb);Y(()=>e?.register(),[e])}var Mb=b.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=pb(),l=Db(),u=G4(!0)!=null,{context:d,hasClosePart:f}=Ab(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);R1({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),S2(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?Fy(c.context.popupRef):a,j=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N=gg(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,M],props:[_,{id:E,role:`dialog`,...Py,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&K4.has(e.key)&&e.stopPropagation()}},q4(g),s],stateAttributesMapping:Bg});return(0,x.jsx)(wy,{context:T,openInteractionType:m,modal:j,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:v_(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,x.jsx)(kb.Provider,{value:d,children:N})})}),Nb=b.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{buttonRef:c,getButtonProps:l}=J_({disabled:a,focusableWhenDisabled:!1,native:o}),u=pb();return jb(),gg(`button`,e,{ref:[t,c],props:[{onClick(e){u.setOpen(!1,w1(Yg,e.nativeEvent))}},s,l]})}),Pb=d6,Fb=b6;function Ib({className:e,align:t=`start`,side:n=`bottom`,sideOffset:r=6,children:i}){return(0,x.jsx)(a3,{children:(0,x.jsx)(Y3,{align:t,side:n,sideOffset:r,className:`z-50 outline-none`,children:(0,x.jsx)(n3,{className:K(`glass min-w-40 origin-[var(--transform-origin)] rounded-lg p-1 text-sm outline-none transition-[opacity,scale] duration-150 data-[ending-style]:scale-98 data-[ending-style]:opacity-0 data-[starting-style]:scale-98 data-[starting-style]:opacity-0`,e),children:i})})})}function Lb({className:e,...t}){return(0,x.jsx)(B1,{className:K(`flex min-h-7 cursor-default items-center gap-2 rounded-sm px-2 py-1 outline-none select-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent [&_svg]:size-4 [&_svg]:text-icon-muted`,e),...t})}function Rb({className:e,...t}){return(0,x.jsx)(`div`,{className:K(`px-2 py-1.5 text-xs font-medium text-muted-foreground`,e),...t})}function zb(){return(0,x.jsx)(w6,{className:`my-1 h-px bg-border`})}var Bb=yb,Vb=Sb,Hb=Nb;function Ub({className:e,align:t=`start`,side:n=`bottom`,sideOffset:r=6,children:i}){return(0,x.jsx)(Tb,{children:(0,x.jsx)(Ob,{align:t,side:n,sideOffset:r,className:`z-50 outline-none`,children:(0,x.jsx)(Mb,{className:K(`glass origin-[var(--transform-origin)] overflow-hidden rounded-lg text-sm outline-none transition-[opacity,scale] duration-150 data-[ending-style]:scale-98 data-[ending-style]:opacity-0 data-[starting-style]:scale-98 data-[starting-style]:opacity-0`,e),children:i})})})}var Wb=$6;function Gb({label:e,side:t=`bottom`,children:n}){return(0,x.jsxs)(R6,{children:[(0,x.jsx)(W6,{render:n}),(0,x.jsx)(J6,{children:(0,x.jsx)(Z6,{side:t,sideOffset:6,className:`z-50`,children:(0,x.jsx)(Q6,{className:`max-w-80 rounded-md border bg-popover px-2 py-1 text-xs leading-snug shadow-md/5 transition-opacity data-[ending-style]:opacity-0 data-[starting-style]:opacity-0`,children:e})})})]})}var Kb=ub,qb=rb;function Jb({className:e,title:t,description:n,footer:r,children:i}){return(0,x.jsxs)(lb,{children:[(0,x.jsx)(nb,{className:`fixed inset-0 z-50 bg-background/60 backdrop-blur-[4px] transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0`}),(0,x.jsxs)(cb,{className:K(`glass fixed top-1/2 left-1/2 z-50 flex max-h-[85vh] w-[calc(100vw-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl shadow-[0_24px_64px_-24px_rgb(0_0_0/65%)] transition-[opacity,scale] duration-200 data-[ending-style]:scale-98 data-[ending-style]:opacity-0 data-[starting-style]:scale-98 data-[starting-style]:opacity-0`,e),children:[(0,x.jsxs)(`div`,{className:`p-6 pb-4`,children:[(0,x.jsx)(db,{className:`text-xl leading-snug font-semibold`,children:t}),n&&(0,x.jsx)(ib,{className:`mt-1 text-sm text-muted-foreground`,children:n})]}),(0,x.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-6 pb-6`,children:i}),r&&(0,x.jsx)(`div`,{className:`flex justify-end gap-2 border-t bg-muted/72 px-6 py-4`,children:r}),(0,x.jsx)(rb,{className:`absolute end-2 top-2 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,children:(0,x.jsx)(Oh,{className:`size-4`})})]})]})}var Yb={default:`bg-foreground/8 text-foreground`,info:`bg-info/8 text-info-foreground dark:bg-info/16`,success:`bg-success/8 text-success-foreground dark:bg-success/16`,warning:`bg-warning/8 text-warning-foreground dark:bg-warning/16`,error:`bg-destructive/8 text-destructive-foreground dark:bg-destructive/16`,outline:`border border-input bg-background text-muted-foreground`};function Xb({variant:e=`default`,className:t,...n}){return(0,x.jsx)(`span`,{className:K(`inline-flex h-[18px] items-center gap-1 rounded-sm px-1.5 text-xs font-medium whitespace-nowrap`,Yb[e],t),...n})}function Zb({className:e,...t}){return(0,x.jsx)(`kbd`,{className:K(`inline-flex h-5 min-w-5 items-center justify-center rounded bg-foreground/[0.07] px-1 font-sans text-xs font-medium text-muted-foreground`,e),...t})}var Qb={primary:`#2563eb`,secondary:`#102a43`,wordmark:`#102a43`},$b={primary:`#2563eb`,secondary:`#ffffff`,wordmark:`#ffffff`},e8=`128.48 84.48 994.04 1119.04`,t8=`94.49 112.11 1995.48 518.12`,n8=`translate(35 73) scale(0.463)`,r8=`M 199 365 L 790 117 Q 815 106 838 119 L 1054 243 C 1086 261 1101 283 1101 316 L 1101 627 C 1101 669 1083 696 1043 714 L 629 883 L 629 716 Q 629 699 650 690 L 895 585 Q 914 577 914 556 L 914 406 Q 914 398 903 392 L 835 357 Q 818 348 799 356 L 383 531 Q 358 542 358 572 L 358 1149 Q 358 1168 344 1176 Q 335 1182 321 1176 L 179 1122 Q 150 1111 150 1076 L 150 445 Q 150 390 199 365 Z`,i8=`M 496 563 L 902 395 Q 914 390 914 406 L 914 556 Q 914 577 895 585 L 650 690 Q 629 699 629 716 L 629 1086 Q 629 1105 616 1111 Q 607 1116 595 1109 L 483 1052 Q 463 1042 463 1022 L 463 611 Q 463 577 496 563 Z`,a8=`M 1595.00 460.88 C 1578.08 458.36 1564.53 451.45 1552.28 439.12 C 1538.09 424.82 1531.56 408.71 1531.56 388.00 C 1531.57 337.43 1580.54 303.78 1631.14 319.57 C 1654.29 326.80 1671.81 344.27 1679.22 367.50 C 1683.83 381.95 1682.41 403.44 1675.90 417.85 C 1662.57 447.37 1627.94 465.79 1595.00 460.88 Z M 1620.28 421.03 C 1627.32 417.68 1634.48 410.75 1637.70 404.20 C 1641.48 396.50 1641.79 381.29 1638.32 373.78 C 1635.27 367.17 1627.76 359.52 1621.12 356.26 C 1612.95 352.25 1598.95 352.22 1591.39 356.20 C 1567.37 368.85 1565.90 404.95 1588.82 419.19 C 1597.45 424.55 1611.21 425.35 1620.28 421.03 Z M 850.33 458.09 C 817.23 449.95 796.00 422.52 796.00 387.87 C 796.00 337.47 843.10 304.62 892.50 320.56 C 914.66 327.72 930.61 344.54 937.20 367.71 C 939.49 375.78 940.51 397.83 938.67 399.67 C 938.21 400.13 915.37 400.64 887.92 400.81 C 850.14 401.04 838.00 401.41 838.01 402.31 C 838.01 402.96 839.39 405.89 841.06 408.81 C 851.36 426.77 881.01 429.18 897.12 413.37 L 901.74 408.83 L 907.12 411.54 C 914.10 415.05 933.00 426.06 933.00 426.61 C 933.00 429.29 924.52 438.59 916.50 444.70 C 898.97 458.06 872.23 463.47 850.33 458.09 Z M 897.46 371.75 C 893.63 358.89 881.34 351.35 865.63 352.21 C 856.25 352.72 851.46 354.77 845.86 360.67 C 842.76 363.92 838.00 371.68 838.00 373.46 C 838.00 373.76 851.53 374.00 868.07 374.00 L 898.13 374.00 L 897.46 371.75 Z M 999.12 457.96 C 976.15 451.94 957.37 432.57 950.81 408.14 C 947.79 396.86 947.77 378.23 950.79 367.70 C 957.78 343.29 975.14 325.40 997.99 319.07 C 1017.95 313.54 1041.64 318.62 1053.46 330.96 C 1057.63 335.31 1058.00 334.91 1058.00 326.00 L 1058.00 318.00 L 1077.94 318.00 L 1097.88 318.00 L 1098.42 322.25 C 1098.72 324.59 1098.86 355.98 1098.73 392.00 L 1098.50 457.50 L 1078.25 457.77 L 1058.00 458.04 L 1058.00 450.52 C 1058.00 446.38 1057.77 443.00 1057.49 443.00 C 1057.20 443.00 1054.48 445.03 1051.44 447.51 C 1037.07 459.21 1018.26 462.97 999.12 457.96 Z M 1038.76 420.04 C 1051.36 414.54 1059.99 399.50 1058.67 385.35 C 1057.03 367.78 1043.69 355.11 1025.87 354.21 C 1012.34 353.52 1002.39 358.18 995.62 368.38 C 986.58 382.01 987.19 397.51 997.30 411.19 C 1005.27 421.98 1024.80 426.15 1038.76 420.04 Z M 1162.50 458.52 C 1140.77 452.65 1125.16 440.29 1115.74 421.50 C 1104.29 398.67 1105.65 369.80 1119.17 348.85 C 1138.85 318.37 1178.24 307.90 1213.29 323.84 C 1219.58 326.70 1234.72 338.11 1235.73 340.75 C 1236.27 342.15 1215.63 363.96 1211.69 366.13 C 1210.25 366.93 1209.10 366.42 1205.98 363.60 C 1196.34 354.89 1183.28 351.86 1171.35 355.57 C 1163.30 358.07 1154.29 366.93 1151.07 375.50 C 1148.17 383.19 1148.48 395.91 1151.73 403.18 C 1160.92 423.70 1189.70 429.14 1205.51 413.33 L 1210.05 408.80 L 1213.27 411.27 C 1218.54 415.32 1237.48 432.03 1237.79 432.92 C 1237.95 433.36 1234.63 436.95 1230.42 440.88 C 1221.44 449.27 1208.45 456.22 1197.50 458.50 C 1188.79 460.32 1169.21 460.33 1162.50 458.52 Z M 1292.28 458.53 C 1275.00 453.66 1263.54 442.99 1258.40 427.00 C 1256.89 422.29 1256.58 416.48 1256.24 386.80 L 1255.84 352.10 L 1250.17 351.80 L 1244.50 351.50 L 1244.50 335.00 L 1244.50 318.50 L 1250.23 318.20 L 1255.96 317.90 L 1256.23 298.20 L 1256.50 278.50 L 1277.00 278.50 L 1297.50 278.50 L 1297.77 298.25 L 1298.04 318.00 L 1315.52 318.00 L 1333.00 318.00 L 1333.00 335.00 L 1333.00 352.00 L 1315.50 352.00 L 1298.00 352.00 L 1298.00 381.18 C 1298.00 408.81 1298.11 410.60 1300.11 414.72 C 1303.37 421.46 1308.02 423.39 1319.46 422.74 C 1324.43 422.45 1329.29 421.90 1330.25 421.50 C 1331.87 420.84 1332.01 422.00 1332.15 437.39 C 1332.23 446.53 1332.35 454.53 1332.40 455.18 C 1332.70 458.78 1302.20 461.32 1292.28 458.53 Z M 1833.00 459.31 C 1819.86 457.11 1805.16 447.64 1800.05 438.09 C 1794.84 428.35 1794.61 426.49 1794.04 388.50 L 1793.50 352.50 L 1788.00 352.00 L 1782.50 351.50 L 1782.20 338.00 C 1781.77 318.48 1781.87 318.17 1788.29 317.80 L 1793.50 317.50 L 1793.77 297.73 L 1794.04 277.96 L 1814.27 278.23 L 1834.50 278.50 L 1834.70 295.50 C 1834.80 304.85 1834.92 313.73 1834.95 315.23 L 1835.00 317.95 L 1852.25 318.23 L 1869.50 318.50 L 1869.50 335.00 L 1869.50 351.50 L 1852.25 351.77 L 1835.00 352.05 L 1834.75 370.27 C 1834.30 403.19 1834.58 410.31 1836.48 414.31 C 1840.37 422.52 1853.00 425.49 1866.75 421.43 L 1869.00 420.77 L 1869.00 438.73 L 1869.00 456.69 L 1861.47 458.35 C 1854.54 459.87 1839.40 460.38 1833.00 459.31 Z M 1926.00 457.63 C 1914.35 454.12 1906.29 449.48 1898.21 441.65 C 1888.49 432.23 1884.72 426.27 1880.28 413.33 C 1876.73 402.96 1876.57 401.93 1876.54 389.00 C 1876.51 373.39 1878.51 364.53 1884.80 352.55 C 1891.90 339.02 1907.92 325.16 1922.57 319.88 C 1932.66 316.24 1951.27 316.04 1961.50 319.46 C 1970.25 322.38 1976.94 326.24 1981.46 330.96 C 1985.57 335.25 1985.88 334.94 1986.21 326.25 L 1986.50 318.50 L 2006.75 318.23 L 2027.00 317.96 L 2027.00 387.98 L 2027.00 458.00 L 2006.50 458.00 L 1986.00 458.00 L 1986.00 450.50 C 1986.00 446.38 1985.72 443.00 1985.37 443.00 C 1985.03 443.00 1983.06 444.52 1981.01 446.38 C 1967.20 458.85 1945.06 463.38 1926.00 457.63 Z M 1964.15 420.94 C 1976.61 416.03 1983.80 407.15 1985.90 394.11 C 1987.77 382.54 1985.01 373.45 1976.96 364.64 C 1970.10 357.14 1964.56 354.68 1953.50 354.20 C 1941.60 353.68 1935.10 356.00 1927.83 363.33 C 1901.02 390.38 1929.02 434.79 1964.15 420.94 Z M 1390.00 360.94 L 1390.00 263.89 L 1434.75 264.26 C 1485.11 264.68 1484.09 264.55 1500.73 272.57 C 1521.69 282.68 1533.22 301.43 1533.28 325.50 C 1533.33 343.95 1527.74 358.24 1515.92 369.87 C 1500.80 384.76 1483.48 389.87 1447.89 389.97 L 1435.28 390.00 L 1434.71 395.47 C 1434.40 398.48 1434.40 413.78 1434.71 429.47 L 1435.26 458.00 L 1412.63 458.00 L 1390.00 458.00 L 1390.00 360.94 Z M 1475.50 349.92 C 1491.57 341.72 1494.77 318.20 1481.34 307.12 C 1474.83 301.76 1470.32 300.73 1451.25 300.24 L 1434.00 299.80 L 1434.00 326.50 L 1434.00 353.19 L 1452.25 352.83 C 1469.48 352.49 1470.78 352.33 1475.50 349.92 Z M 1692.45 456.73 C 1692.18 456.02 1692.07 424.84 1692.22 387.46 L 1692.50 319.50 L 1711.75 319.23 L 1731.00 318.96 L 1731.07 324.73 C 1731.18 334.12 1731.91 334.80 1736.25 329.60 C 1742.01 322.71 1755.99 317.00 1767.11 317.00 L 1771.79 317.00 L 1772.15 329.25 C 1772.34 335.99 1772.35 344.48 1772.17 348.11 L 1771.84 354.73 L 1764.11 355.26 C 1750.58 356.18 1741.74 361.77 1736.80 372.50 C 1734.55 377.39 1734.49 378.41 1734.00 417.50 L 1733.50 457.50 L 1713.23 457.77 C 1697.26 457.98 1692.85 457.76 1692.45 456.73 Z M 2039.00 359.00 L 2039.00 260.00 L 2059.50 260.00 L 2080.00 260.00 L 2080.00 359.00 L 2080.00 458.00 L 2059.50 458.00 L 2039.00 458.00 L 2039.00 359.00 Z M 634.37 405.77 C 634.72 378.12 635.29 335.36 635.64 310.75 L 636.27 266.00 L 684.39 266.02 C 733.74 266.04 741.75 266.52 753.00 270.10 C 779.40 278.49 792.40 294.77 793.68 321.00 C 794.58 339.37 789.51 354.57 778.38 366.87 C 771.76 374.18 759.96 382.28 752.49 384.64 C 749.47 385.59 747.00 386.85 747.01 387.43 C 747.01 388.02 755.35 398.40 765.54 410.50 C 786.39 435.25 801.34 453.60 801.83 455.04 C 802.04 455.64 791.91 456.00 774.76 456.00 L 747.35 456.00 L 741.92 449.27 C 738.94 445.58 733.33 438.71 729.46 434.02 C 725.59 429.34 718.91 421.23 714.62 416.00 C 710.34 410.77 704.10 403.24 700.76 399.25 L 694.68 392.00 L 688.35 392.00 L 682.03 392.00 L 681.76 423.75 L 681.50 455.50 L 657.61 455.77 L 633.73 456.04 L 634.37 405.77 Z M 727.00 352.98 C 750.05 344.45 752.14 312.56 730.23 303.85 C 724.92 301.74 722.95 301.57 703.50 301.54 L 682.50 301.50 L 682.23 326.98 C 682.09 341.00 682.20 353.09 682.50 353.85 C 683.21 355.70 721.68 354.95 727.00 352.98 Z`;function o8(e){if(typeof e==`string`&&e)return/^--[\w-]+$/.test(e)?`var(`+e+`)`:e}function s8({variant:e,colors:t,primary:n,secondary:r,wordmark:i}){let a=e===`mono`?{primary:`currentColor`,secondary:`currentColor`,wordmark:`currentColor`}:e===`on-dark`?$b:Qb,o=t||{};return{primary:o8(n)||o8(o.primary)||a.primary,secondary:o8(r)||o8(o.secondary)||a.secondary,wordmark:o8(i)||o8(o.wordmark)||a.wordmark}}function c8({viewBox:e,title:t=`React Portal`,decorative:n=!1,height:r,className:i,style:a,children:o,...s}){let c=b.useId(),l=n?{"aria-hidden":!0,focusable:`false`}:{role:`img`,"aria-labelledby":c};return(0,x.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:e,className:K(`inline-block h-6 w-auto shrink-0`,i),style:r==null?a:{height:r,...a},...l,...s,children:[n?null:(0,x.jsx)(`title`,{id:c,children:t}),o]})}function l8({fills:e}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{style:{fill:e.primary},d:r8}),(0,x.jsx)(`path`,{style:{fill:e.secondary},d:i8})]})}function u8({variant:e=`color`,colors:t,primary:n,secondary:r,...i}){let a=s8({variant:e,colors:t,primary:n,secondary:r});return(0,x.jsx)(c8,{"data-slot":`logomark`,viewBox:e8,...i,children:(0,x.jsx)(l8,{fills:a})})}function d8({variant:e=`color`,colors:t,primary:n,secondary:r,wordmark:i,...a}){let o=s8({variant:e,colors:t,primary:n,secondary:r,wordmark:i});return(0,x.jsxs)(c8,{"data-slot":`lockup`,viewBox:t8,...a,children:[(0,x.jsx)(`g`,{transform:n8,children:(0,x.jsx)(l8,{fills:o})}),(0,x.jsx)(`path`,{style:{fill:o.wordmark},fillRule:`evenodd`,d:a8})]})}function f8(e){let t=qu();return(0,x.jsx)(u8,{variant:t?`on-dark`:`color`,decorative:!0,...e})}function p8(e){let t=qu();return(0,x.jsx)(d8,{variant:t?`on-dark`:`color`,...e})}function m8({children:e,className:t}){return(0,x.jsx)(`span`,{"aria-hidden":!0,className:`live-activity-focus`,children:(0,x.jsx)(`span`,{className:`live-activity-focus-counter`,children:(0,x.jsx)(`span`,{className:K(`live-activity-focus-aligned text-foreground`,t),children:e})})})}var h8={xs:`size-3`,sm:`size-3.5`,md:`size-4`,lg:`size-5`};function g8({size:e,muted:t,className:n}){return(0,x.jsx)(Sp,{role:`status`,"aria-label":`Loading`,className:K(`motion-safe:animate-spin`,e&&h8[e],t&&`text-muted-foreground`,n)})}function _8(e){let t=e.normalize(`NFKC`).trim().match(/[\p{L}\p{N}]+/gu)||[],n=t[0];if(!n)return`PR`;let r=Array.from(n),i=r.slice(1).find(e=>/\p{N}/u.test(e))??(t.length>1?Array.from(t.at(-1)||``)[0]:r.at(-1))??r[0];return Array.from(`${r[0]}${i}`.toUpperCase()).slice(0,2).join(``)}var v8=[`text-gray-600 dark:text-gray-400`,`text-red-600 dark:text-red-400`,`text-orange-600 dark:text-orange-400`,`text-amber-600 dark:text-amber-400`,`text-yellow-600 dark:text-yellow-400`,`text-lime-600 dark:text-lime-400`,`text-green-600 dark:text-green-400`,`text-emerald-600 dark:text-emerald-400`,`text-teal-600 dark:text-teal-400`,`text-cyan-600 dark:text-cyan-400`,`text-sky-600 dark:text-sky-400`,`text-blue-600 dark:text-blue-400`,`text-indigo-600 dark:text-indigo-400`,`text-violet-600 dark:text-violet-400`,`text-purple-600 dark:text-purple-400`,`text-fuchsia-600 dark:text-fuchsia-400`,`text-pink-600 dark:text-pink-400`,`text-rose-600 dark:text-rose-400`];function y8(e){let t=0;for(let n of e.normalize(`NFKC`).trim().toLowerCase()||`project`)t=(t*31+(n.codePointAt(0)||0))%v8.length;return v8[t]}function b8({name:e,projectId:t,className:n}){let[r,i]=b.useState(!1);if(t&&!r)return(0,x.jsx)(`img`,{alt:``,"aria-hidden":!0,src:`/api/projects/${encodeURIComponent(t)}/favicon`,onError:()=>i(!0),className:K(`size-4 shrink-0 rounded-[3px] object-contain`,n)});let a=_8(e);return(0,x.jsx)(`span`,{"aria-hidden":!0,className:K(`inline-flex size-4 shrink-0 items-center justify-center`,n),children:(0,x.jsx)(`svg`,{viewBox:`0 0 16 16`,className:K(`size-full overflow-hidden rounded-[25%] font-mono select-none`,y8(e)),style:{backgroundColor:`color-mix(in srgb, currentColor 14%, transparent)`},children:(0,x.jsx)(`text`,{x:`8`,y:`10.8`,textAnchor:`middle`,fill:`currentColor`,fontSize:`8.25`,fontWeight:`700`,textLength:Array.from(a).length===1?6:12,lengthAdjust:`spacingAndGlyphs`,children:a})})})}var x8={working:{label:`Working`,icon:Yd,tone:`text-info-foreground`},approval:{label:`Approval`,icon:Jm,tone:`text-warning-foreground`},input:{label:`Input`,icon:Ap,tone:`text-indigo-600 dark:text-indigo-300`},failed:{label:`Failed`,icon:Zd,tone:`text-destructive-foreground`},plan:{label:`Plan Ready`,icon:gp,tone:`text-violet-600 dark:text-violet-300/90`},done:{label:`Done`,icon:qd,tone:`text-success-foreground`}};function S8(e,t){let n=t=>!!e.visitedAt&&!!t&&t<=e.visitedAt,r=!!e.finishedAt&&!!e.visitedAt&&e.finishedAt>e.visitedAt,i=null;return e.waiting===`approval`?i=`approval`:e.waiting===`input`?i=`input`:e.running?i=`working`:e.waiting===`failed`&&!n(e.updatedAt)?i=`failed`:e.planReady?i=`plan`:r&&(i=`done`),{status:i,recede:!t&&i!==`input`&&i!==`plan`&&(i===`working`||(i===null||i===`approval`)&&!r)}}function C8({status:e,iconClass:t}){let n=x8[e],r=n.icon;return(0,x.jsxs)(`span`,{className:K(`inline-flex items-center gap-1 font-medium`,n.tone),children:[(0,x.jsx)(r,{"aria-hidden":!0,className:t}),n.label]})}function w8({chat:e,active:t,showProject:n,onPin:r}){let{status:i,recede:a}=S8(e,t),o=(e,t)=>{e.preventDefault(),e.stopPropagation(),r?.(t)},s=e.pinned?(0,x.jsxs)(`button`,{type:`button`,"aria-label":`Unpin chat`,title:`Unpin chat`,onClick:e=>o(e,!1),className:`group/unpin inline-flex shrink-0 cursor-pointer items-center rounded-sm text-muted-foreground/65 outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,x.jsx)(vm,{"aria-hidden":!0,className:`size-3 group-hover/unpin:hidden`}),(0,x.jsx)(gm,{"aria-hidden":!0,className:`hidden size-3 group-hover/unpin:block`})]}):null,c=(0,x.jsxs)(`span`,{className:`relative ml-auto flex h-5 min-w-8 shrink-0 items-stretch justify-end text-xs`,children:[(0,x.jsx)(`span`,{className:`pointer-events-none flex items-center self-center text-secondary-label tabular-nums group-hover/sidebar-row:absolute group-hover/sidebar-row:right-0 group-hover/sidebar-row:opacity-0 group-has-[:focus-visible]/sidebar-row:absolute group-has-[:focus-visible]/sidebar-row:opacity-0`,children:i?(0,x.jsx)(C8,{status:i,iconClass:n?`size-4`:`size-3`}):vu(e.updatedAt)}),r&&!e.pinned&&(0,x.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 right-0 flex items-stretch opacity-0 group-hover/sidebar-row:pointer-events-auto group-hover/sidebar-row:static group-hover/sidebar-row:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:static has-[:focus-visible]:opacity-100`,children:(0,x.jsxs)(`button`,{type:`button`,"aria-label":`Pin chat`,title:`Pin chat`,onClick:e=>o(e,!0),className:`-mr-1 inline-flex cursor-pointer items-center gap-1 rounded-md bg-transparent px-1.5 text-xs text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,x.jsx)(vm,{className:`size-3.5`}),`Pin`]})})]}),l=(0,x.jsxs)(`span`,{className:`relative min-w-0 flex-1 overflow-hidden`,children:[(0,x.jsx)(`span`,{className:K(`block min-w-0 truncate text-sm transition-opacity motion-reduce:transition-none`,a?`font-normal text-foreground/75 group-hover/sidebar-row:text-foreground`:`font-medium text-foreground`,e.running&&`text-muted-foreground`),children:e.title}),e.running&&(0,x.jsx)(m8,{className:`truncate text-sm`,children:e.title})]});return(0,x.jsx)(la,{to:`/p/$projectId/c/$chatId`,params:{projectId:e.projectId,chatId:e.id},"aria-label":i?`${e.title}, ${x8[i].label}`:e.title,"aria-current":t?`page`:void 0,className:K(`group/sidebar-row relative block overflow-hidden rounded-md px-2.5 outline-none select-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,n?`py-2`:`flex h-9 items-center gap-2.5`,n&&e.modelName?`h-[4.875rem]`:n?`h-auto`:``,t?`bg-sidebar-row-active text-sidebar-foreground ring-1 ring-sidebar-border/70 ring-inset dark:ring-0`:a?`text-sidebar-muted-foreground/75 hover:bg-sidebar-row-hover hover:text-sidebar-foreground`:`text-sidebar-foreground hover:bg-sidebar-row-hover`,a&&i===`working`&&`opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100 motion-reduce:transition-none`),children:n?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`flex h-5 min-w-0 items-center gap-1.5`,children:[e.projectName&&(0,x.jsx)(b8,{name:e.projectName,projectId:e.projectId}),s,(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-normal text-secondary-label`,children:e.projectName}),c]}),(0,x.jsx)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:l}),e.modelName&&(0,x.jsxs)(`div`,{className:`mt-0.5 flex h-5 min-w-0 items-center gap-1.5 text-xs text-secondary-label`,children:[(0,x.jsx)(Dd,{className:`size-3.5 shrink-0 text-icon-muted`}),(0,x.jsx)(`span`,{className:`truncate`,children:e.modelName})]})]}):(0,x.jsxs)(x.Fragment,{children:[l,s,c]})})}function T8(){let e=Ji();return b.useCallback(t=>e({to:`.`,search:e=>{let n={...e};return t?n.settings=t:delete n.settings,n},replace:!1}),[e])}function E8({section:e,className:t,children:n,...r}){return(0,x.jsx)(la,{to:`.`,search:(t=>({...t,settings:e})),className:t,...r,children:n})}function D8(e){let t=ku(),n=U({...t.dev.status.queryOptions({projectId:e}),refetchInterval:!1}),r=W(t.dev.ensure.mutationOptions()),i=W(t.dev.touch.mutationOptions()),a=W(t.dev.restart.mutationOptions());return b.useEffect(()=>{r.mutate({projectId:e});let t=setInterval(()=>i.mutate({projectId:e}),6e4);return()=>clearInterval(t)},[e]),{status:n.data,restart:()=>a.mutate({projectId:e})}}function O8(e){switch(e){case`running`:case`attached`:return`bg-success`;case`starting`:return`bg-info animate-pulse`;case`failed`:return`bg-destructive`;default:return`border border-icon-muted`}}function k8({icon:e,label:t,tip:n}){return(0,x.jsx)(Gb,{label:n,children:(0,x.jsxs)(`span`,{className:`inline-flex h-6 max-w-44 items-center gap-1 rounded-md px-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-foreground`,children:[(0,x.jsx)(e,{className:`size-3.5 shrink-0 text-icon-muted`}),(0,x.jsx)(`span`,{className:`truncate`,children:t})]})})}function A8({projectId:e}){let t=ku(),n=U(t.projects.info.queryOptions({id:e})),r=U(t.dev.status.queryOptions({projectId:e})),i=n.data?.facts,a=n.data?.git,o=a?Object.keys(a.changes).length:0;return(0,x.jsxs)(`div`,{className:`flex h-6 min-w-0 flex-wrap items-center gap-0.5 overflow-hidden`,children:[i&&(0,x.jsx)(k8,{icon:Bm,label:[n.data?.profile,i.host].filter(Boolean).join(` · `),tip:n.data?.profile?`Profile ${n.data.profile} · ${i.instance}`:`${i.instance} (no profile)`}),i?.scope&&(0,x.jsx)(k8,{icon:Qp,label:i.scope,tip:`App ${i.appName||i.scope}`}),i?.updateSet&&(0,x.jsx)(k8,{icon:up,label:i.updateSet,tip:`Update set: ${i.updateSet}`}),a?.repo&&(0,x.jsx)(k8,{icon:Hf,label:(0,x.jsxs)(x.Fragment,{children:[a.branch,o>0&&(0,x.jsxs)(`span`,{className:`ml-1 text-warning-foreground`,children:[`✎`,o]}),a.ahead?(0,x.jsxs)(`span`,{className:`ml-1`,children:[`↑`,a.ahead]}):null]}),tip:`${o} changed file${o===1?``:`s`}`}),r.data&&r.data.state!==`idle`&&(0,x.jsx)(Gb,{label:r.data.error||r.data.url||r.data.state,children:(0,x.jsxs)(`span`,{className:`inline-flex h-6 items-center gap-1.5 rounded-md px-1.5 text-xs text-muted-foreground hover:bg-accent`,children:[(0,x.jsx)(`span`,{className:K(`size-1.5 rounded-full`,O8(r.data.state))}),`dev`,r.data.url?` :${new URL(r.data.url).port}`:``]})})]})}function j8(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var M8=e=>{switch(e){case`success`:return F8;case`info`:return L8;case`warning`:return I8;case`error`:return R8;default:return null}},N8=Array(12).fill(0),P8=({visible:e,className:t})=>b.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},b.createElement(`div`,{className:`sonner-spinner`},N8.map((e,t)=>b.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),F8=b.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},b.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),I8=b.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},b.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),L8=b.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},b.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),R8=b.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},b.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),z8=b.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},b.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),b.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),B8=()=>{let[e,t]=b.useState(document.hidden);return b.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},V8=1,H8=100,U8=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:V8++,W8=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-H8;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=U8(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],b.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(K8(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!b.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!b.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!b.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!b.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=U8(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},G8=(e,t)=>W8.message(e,t),K8=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,q8=Object.assign(G8,{success:W8.success,info:W8.info,warning:W8.warning,error:W8.error,custom:W8.custom,message:W8.message,promise:W8.promise,dismiss:W8.dismiss,loading:W8.loading},{getHistory:()=>W8.toasts,getToasts:()=>W8.getActiveToasts()});j8(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function J8(e){return e.label!==void 0}var Y8=3,X8=`24px`,Z8=`16px`,Q8=4e3,$8=356,ex=14,tx=45,nx=200;function rx(...e){return e.filter(Boolean).join(` `)}function ix(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var ax=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=b.useState(null),[k,A]=b.useState(null),[j,M]=b.useState(!1),[N,P]=b.useState(!1),[F,I]=b.useState(!1),[L,R]=b.useState(!1),[z,B]=b.useState(!1),[ee,V]=b.useState(0),[te,ne]=b.useState(0),re=b.useRef(n.duration||y||Q8),ie=b.useRef(null),ae=b.useRef(null),oe=c===0,se=c+1<=o,H=n.type,ce=H??`default`,le=n.dismissible!==!1,ue=n.className||``,de=n.descriptionClassName||``,fe=b.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),pe=b.useMemo(()=>n.closeButton??p,[n.closeButton,p]),me=b.useMemo(()=>n.duration||y||Q8,[n.duration,y]),he=b.useRef(0),ge=b.useRef(0),_e=b.useRef(0),ve=b.useRef(null),[ye,be]=x.split(`-`),xe=b.useMemo(()=>s.reduce((e,t,n)=>n>=fe?e:e+t.height,0),[s,fe]),Se=B8(),Ce=b.useMemo(()=>e.swipeDirections??ix(x),[e.swipeDirections,x]),we=n.invert||t,Te=H===`loading`;ge.current=b.useMemo(()=>fe*S+xe,[fe,xe]),b.useEffect(()=>{re.current=me},[me]),b.useEffect(()=>{M(!0)},[]),b.useEffect(()=>{let e=ae.current;if(e){let t=e.getBoundingClientRect().height;return ne(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),b.useLayoutEffect(()=>{if(!j)return;let e=ae.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ne(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ee=b.useCallback(()=>{P(!0),V(ge.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},nx)},[n,d,a,ge]);b.useEffect(()=>{if(n.promise&&H===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Se?(()=>{if(_e.current<he.current){let e=new Date().getTime()-he.current;re.current-=e}_e.current=new Date().getTime()})():re.current!==1/0&&(he.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ee()},re.current)),()=>clearTimeout(e)},[u,i,n,H,Se,Ee]),b.useEffect(()=>{n.delete&&(Ee(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ee,n.delete]);function De(){return T?.loading?b.createElement(`div`,{className:rx(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":H===`loading`},T.loading):b.createElement(P8,{className:rx(w?.loader,n?.classNames?.loader),visible:H===`loading`})}let Oe=n.icon||T?.[H]||M8(H);return b.createElement(`li`,{tabIndex:0,ref:ae,className:rx(_,ue,w?.toast,n?.classNames?.toast,w?.[ce],n?.classNames?.[ce]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":z,"data-removed":N,"data-visible":se,"data-y-position":ye,"data-x-position":be,"data-index":c,"data-front":oe,"data-swiping":F,"data-dismissible":le,"data-type":H,"data-invert":we,"data-swipe-out":L,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?ee:ge.current}px`,"--initial-height":C?`auto`:`${te}px`,...m,...n.style},onDragEnd:()=>{I(!1),O(null),ve.current=null},onPointerDown:e=>{e.button!==2&&!Te&&le&&(ie.current=new Date,V(ge.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),ve.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(L||!le)return;ve.current=null;let e=Number(ae.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ae.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ie.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?Ce.includes(e>0?`right`:`left`):Ce.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=tx||a>.11))V(ge.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ee(),R(!0);else{var o,s;(o=ae.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ae.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),B(!1),I(!1),O(null)}},onPointerMove:e=>{var t,n;if(!ve.current||!le||window.getSelection()?.toString().length>0)return;let r=e.clientY-ve.current.y,i=e.clientX-ve.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&O(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(Ce.includes(`top`)||Ce.includes(`bottom`)){if(Ce.includes(`top`)&&r<0||Ce.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(Ce.includes(`left`)||Ce.includes(`right`))){if(Ce.includes(`left`)&&i<0||Ce.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&B(!0),(t=ae.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ae.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},pe&&!n.jsx&&H!==`loading`?b.createElement(`button`,{"aria-label":E,"data-disabled":Te,"data-close-button":!0,onClick:Te||!le?()=>{}:()=>{Ee(),n.onDismiss==null||n.onDismiss.call(n,n)},className:rx(w?.closeButton,n?.classNames?.closeButton)},T?.close??z8):null,(H||n.icon||n.promise)&&n.icon!==null&&(T?.[H]!==null||n.icon)?b.createElement(`div`,{"data-icon":``,className:rx(w?.icon,n?.classNames?.icon)},H===`loading`?n.icon||De():n.promise?De():null,H===`loading`?null:Oe):null,b.createElement(`div`,{"data-content":``,className:rx(w?.content,n?.classNames?.content)},b.createElement(`div`,{"data-title":``,className:rx(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?b.createElement(`div`,{"data-description":``,className:rx(v,de,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),b.isValidElement(n.cancel)?n.cancel:n.cancel&&J8(n.cancel)?b.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{J8(n.cancel)&&le&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ee())},className:rx(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,b.isValidElement(n.action)?n.action:n.action&&J8(n.action)?b.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{J8(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),e.defaultPrevented||Ee())},className:rx(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function ox(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function sx(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Z8:X8;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var cx=b.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Y8,toastOptions:g,dir:_=ox(),gap:v=ex,icons:y,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=b.useState([]),T=b.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=b.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=b.useState([]),[k,A]=b.useState(!1),[j,M]=b.useState(!1),[N,P]=b.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),F=b.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=b.useRef(null),R=b.useRef(!1),z=b.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||W8.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return b.useEffect(()=>W8.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{P1.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),b.useEffect(()=>{if(d!==`system`){P(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),b.useEffect(()=>{C.length<=1&&A(!1)},[C]),b.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),b.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),b.createElement(`section`,{ref:t,"aria-label":x??`${S} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?b.createElement(`ol`,{key:t,dir:_===`auto`?ox():_,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${$8}px`,"--gap":`${v}px`,...m,...sx(l,u)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>b.createElement(ax,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:j,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:z,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:v,expanded:k,swipeDirections:e.swipeDirections}))):null}))});function lx(e,t){let n=e?.status??`disabled`,r=e?.installedVersion??e?.latest??``,i=n===`available`?`install`:n===`installed`?`restart`:`check`,a=i!==`check`||n===`installing`||n===`restarting`,o=t?`checking`:n===`installing`?`installing`:n===`installed`||n===`restarting`?`installed`:n===`available`?`available`:`idle`,s=`Check for updates`,c=``;a?s=n===`available`?e?.errorContext===`install`?`Install failed for ${r}. Click to retry.`:`Update ${r} ready to install`:n===`installing`?`Installing update`:n===`restarting`?`Restarting Forge…`:e?.errorContext===`restart`?`Restart failed for ${r}. Click to retry.`:`Update ${r} installed. Click to restart Forge.`:t?s=`Checking for updates…`:n===`disabled`&&(s=`Updates unavailable`,c=e?.message||`Update checks are off.`);let l=!!e?.enabled&&![`checking`,`installing`,`restarting`,`disabled`].includes(n),u=t?!0:a?n===`installing`||n===`restarting`:!l,d=a&&!t;return{icon:o,action:i,title:s,detail:c,disabled:u,filled:d,dimmed:u&&!d}}function ux(e,t){return e&&!t}var dx=14,fx=2*Math.PI*dx;function px(){let e=`(prefers-reduced-motion: reduce)`,[t,n]=b.useState(()=>window.matchMedia(e).matches);return b.useEffect(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[]),t}function mx({icon:e,spinning:t,onTurn:n}){return e===`available`?(0,x.jsxs)(`span`,{className:`relative grid size-4 place-items-center`,children:[(0,x.jsx)(gf,{className:`size-4`}),(0,x.jsx)(`span`,{"aria-hidden":!0,className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full bg-current ring-2 ring-sidebar-control`})]}):e===`installing`?(0,x.jsxs)(`span`,{className:`relative grid size-8 place-items-center`,children:[(0,x.jsxs)(`svg`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 size-full`,viewBox:`0 0 32 32`,children:[(0,x.jsx)(`circle`,{cx:`16`,cy:`16`,r:dx,fill:`none`,className:`stroke-current/22`,strokeWidth:`1.5`}),(0,x.jsx)(`circle`,{cx:`16`,cy:`16`,r:dx,fill:`none`,stroke:`currentColor`,strokeDasharray:`${fx/4} ${fx}`,strokeLinecap:`round`,strokeWidth:`1.5`,className:`origin-center motion-safe:animate-spin`})]}),(0,x.jsx)(gf,{className:`size-4`})]}):e===`installed`?(0,x.jsxs)(`span`,{className:`relative grid size-4 place-items-center`,children:[(0,x.jsx)(Mm,{className:`size-4`}),(0,x.jsx)(`span`,{className:`absolute -right-1 -bottom-1 grid size-2.5 place-items-center rounded-full bg-foreground text-background ring-2 ring-background`,children:(0,x.jsx)(zd,{className:`size-2`,strokeWidth:3})})]}):(0,x.jsx)(Om,{"aria-hidden":!0,className:K(`size-4`,t&&`motion-safe:animate-spin`),onAnimationIteration:n})}async function hx(e,t){let n=!1,r=Date.now()+6e4;for(;Date.now()<r;){await new Promise(e=>setTimeout(e,750));try{let t=await Du.meta.query();if(n||t.version!==e){window.location.reload();return}}catch{n=!0}}q8.error(`Forge didn't come back`,{description:t})}function gx(){let e=ku(),t=U(e.about.update.queryOptions()),n=U(e.meta.queryOptions()),r=W(e.about.checkUpdate.mutationOptions()),i=W(e.about.runUpdate.mutationOptions()),a=W(e.about.restart.mutationOptions()),o=px(),[s,c]=b.useState(!1),l=t.data??null,u=l?.status,[d,f]=b.useState(!1),[p,m]=b.useState({status:u,reduced:o});(p.status!==u||p.reduced!==o)&&(m({status:u,reduced:o}),o?f(!1):u===`checking`&&f(!0));let h=u===`checking`||d&&!o,g=lx(l,h),_=r.isPending||i.isPending||a.isPending,v=g.disabled||_,y=async()=>{c(!1);try{let e=await a.mutateAsync();e.restarted?hx(n.data?.version||``,e.message):e.message&&q8.info(`Restart Forge to finish updating`,{description:e.message})}catch(e){q8.error(`Could not restart Forge`,{description:e.message})}},S=async()=>{if(!v&&l){if(g.action===`install`)try{let e=await i.mutateAsync();if(!e.accepted)return;e.code===0?q8.success(`Update installed`,{description:`Restart Forge from the update button to run it.`}):q8.error(`Could not install update`,{description:e.state.message})}catch(e){q8.error(`Could not install update`,{description:e.message})}else if(g.action===`restart`)l.canRestart?c(!0):y();else{o||f(!0);try{let e=await r.mutateAsync();e.checked||q8.error(`Could not check for updates`,{description:e.message||`Updates are not available here.`})}catch(e){q8.error(`Could not check for updates`,{description:e.message})}}}};if(!l)return null;let C=g.detail?`${g.title}: ${g.detail}`:g.title;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Gb,{side:`top`,label:g.detail?(0,x.jsxs)(`div`,{className:`text-left`,children:[(0,x.jsx)(`div`,{className:`font-medium`,children:g.title}),(0,x.jsx)(`div`,{className:`text-muted-foreground`,children:g.detail})]}):(0,x.jsx)(`span`,{className:`whitespace-pre-line`,children:g.title}),children:(0,x.jsx)(`button`,{type:`button`,"data-update-status":u,"aria-label":C,"aria-disabled":v||void 0,onClick:()=>void S(),className:K(`ml-auto inline-flex size-8 shrink-0 items-center justify-center rounded-full outline-hidden ring-ring transition-colors focus-visible:ring-2 focus-visible:ring-inset`,v?`cursor-not-allowed`:`cursor-pointer`,g.filled?K(`bg-sidebar-control text-sidebar-foreground`,!v&&`hover:bg-sidebar-row-hover`):K(`text-sidebar-icon`,!v&&`hover:bg-sidebar-row-hover hover:text-sidebar-foreground`),g.dimmed&&`opacity-60`),children:(0,x.jsx)(mx,{icon:g.icon,spinning:h&&!o,onTurn:()=>f(ux(u===`checking`,o))})})}),(0,x.jsx)(Kb,{open:s,onOpenChange:e=>!e&&c(!1),children:(0,x.jsx)(Jb,{title:`Restart Forge to run rpf ${l.installedVersion??l.latest??``}?`,description:`Any running tasks will be interrupted. Make sure you're ready before continuing.`,footer:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(qb,{render:(0,x.jsx)(J,{variant:`outline`,children:`Cancel`})}),(0,x.jsx)(J,{autoFocus:!0,onClick:()=>void y(),children:`Restart`})]})})})]})}function _x(){let e=Wu(),t=U(ku().projects.list.queryOptions()),[n,r]=b.useState(``),[i,a]=b.useState(!1),o=Ki({strict:!1}),s=(t.data||[]).filter(e=>!n||e.name.toLowerCase().includes(n.toLowerCase()));return(0,x.jsxs)(`aside`,{"data-app-sidebar":!0,className:`relative flex h-full shrink-0 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground`,style:{width:e.sidebarWidth},children:[(0,x.jsxs)(`div`,{className:`flex h-[var(--topbar-h)] shrink-0 items-center gap-2 px-2`,children:[(0,x.jsx)(Gb,{label:(0,x.jsxs)(`span`,{children:[`Hide sidebar `,(0,x.jsxs)(Zb,{className:`ml-1`,children:[Eu?`⌘`:`Ctrl`,` B`]})]}),children:(0,x.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:()=>Uu({sidebarOpen:!1}),className:`text-sidebar-icon`,children:(0,x.jsx)(im,{})})}),(0,x.jsx)(f8,{className:`h-[1.15em] w-auto`}),(0,x.jsx)(`span`,{className:`-ms-1 text-sm font-medium tracking-tight`,children:`Forge`})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1 px-2`,children:[i?(0,x.jsx)(`input`,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),onBlur:()=>!n&&a(!1),onKeyDown:e=>e.key===`Escape`&&(r(``),a(!1)),placeholder:`Search`,className:`h-8 min-w-0 flex-1 rounded-md bg-sidebar-control px-2 text-sm outline-none placeholder:text-sidebar-muted-foreground`}):(0,x.jsxs)(`button`,{onClick:()=>window.dispatchEvent(new CustomEvent(`forge:command`,{detail:`commandPalette.toggle`})),className:`flex h-8 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover`,children:[(0,x.jsx)(Rm,{className:`size-4 text-sidebar-icon`}),`Search`,(0,x.jsxs)(Zb,{className:`ml-auto`,children:[Eu?`⌘`:`Ctrl`,` K`]})]}),(0,x.jsxs)(Pb,{children:[(0,x.jsx)(Gb,{label:`View`,children:(0,x.jsx)(Fb,{"aria-label":`Sidebar view`,className:`inline-flex size-7 items-center justify-center rounded-md text-sidebar-icon outline-none hover:bg-sidebar-row-hover hover:text-sidebar-foreground data-[popup-open]:bg-sidebar-row-hover`,children:(0,x.jsx)(vp,{className:`size-4`})})}),(0,x.jsxs)(Ib,{align:`start`,className:`w-48`,children:[(0,x.jsx)(Rb,{children:`Show chats`}),(0,x.jsxs)(Lb,{onClick:()=>Uu({sidebarView:`recent`}),children:[(0,x.jsx)(rf,{}),` `,(0,x.jsx)(`span`,{className:`flex-1`,children:`By recency`}),e.sidebarView===`recent`&&(0,x.jsx)(zd,{className:`!text-foreground`})]}),(0,x.jsxs)(Lb,{onClick:()=>Uu({sidebarView:`projects`}),children:[(0,x.jsx)(Bf,{}),` `,(0,x.jsx)(`span`,{className:`flex-1`,children:`By project`}),e.sidebarView===`projects`&&(0,x.jsx)(zd,{className:`!text-foreground`})]})]})]}),(0,x.jsx)(Gb,{label:`New project`,children:(0,x.jsx)(`button`,{type:`button`,"aria-label":`New project`,onClick:()=>Uu({newProject:`choose`}),className:`inline-flex size-7 items-center justify-center rounded-md text-sidebar-icon hover:bg-sidebar-row-hover hover:text-sidebar-foreground`,children:(0,x.jsx)(Pf,{className:`size-4`})})}),(0,x.jsx)(vx,{projectId:o.projectId})]}),(0,x.jsx)(`nav`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:e.sidebarView===`recent`?(0,x.jsx)(Tx,{filter:n,activeChat:o.chatId}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(yx,{label:`Projects`,count:t.data?.length}),t.isLoading&&(0,x.jsx)(xx,{}),t.data&&t.data.length===0&&(0,x.jsxs)(`div`,{className:`py-6 text-center text-xs text-muted-foreground/60`,children:[`No projects yet`,(0,x.jsx)(`div`,{className:`mt-2`,children:(0,x.jsxs)(`button`,{type:`button`,onClick:()=>Uu({newProject:`choose`}),className:`inline-flex items-center gap-1 rounded-md border border-sidebar-border px-2 py-1 text-2xs text-sidebar-muted-foreground hover:text-sidebar-foreground`,children:[(0,x.jsx)(Pf,{className:`size-3`}),` New project`]})})]}),s.map(e=>(0,x.jsx)(bx,{project:e,activeProject:o.projectId,activeChat:o.chatId},e.id))]})}),(0,x.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 pt-1 pb-2`,children:[(0,x.jsx)(Gb,{label:`Settings`,children:(0,x.jsx)(E8,{section:`general`,className:`inline-flex size-8 items-center justify-center rounded-md text-sidebar-muted-foreground/80 hover:bg-sidebar-row-hover hover:text-sidebar-foreground`,children:(0,x.jsx)(Wm,{className:`size-4`})})}),(0,x.jsx)(Gb,{label:`Usage`,children:(0,x.jsx)(E8,{section:`usage`,className:`inline-flex size-8 items-center justify-center rounded-md text-sidebar-muted-foreground/80 hover:bg-sidebar-row-hover hover:text-sidebar-foreground`,children:(0,x.jsx)(Ld,{className:`size-4`})})}),(0,x.jsx)(Gb,{label:`All projects`,children:(0,x.jsx)(la,{to:`/`,className:`inline-flex size-8 items-center justify-center rounded-md text-sidebar-muted-foreground/80 hover:bg-sidebar-row-hover hover:text-sidebar-foreground`,children:(0,x.jsx)(Mf,{className:`size-4`})})}),(0,x.jsx)(gx,{})]}),(0,x.jsx)(Sx,{})]})}function vx({projectId:e}){let t=ku(),n=Ji(),r=U(t.projects.list.queryOptions()),i=e||r.data?.[0]?.id;return(0,x.jsx)(Gb,{label:(0,x.jsxs)(`span`,{children:[`New chat `,i?``:`(open a project first)`]}),children:(0,x.jsx)(J,{variant:`ghost`,size:`icon-sm`,disabled:!i,onClick:()=>i&&n({to:`/p/$projectId`,params:{projectId:i}}),className:`text-sidebar-icon`,children:(0,x.jsx)(nh,{})})})}function yx({label:e,count:t}){return(0,x.jsxs)(`div`,{className:`flex h-8 items-center gap-2 px-2 text-xs font-medium text-sidebar-muted-foreground`,children:[e,(0,x.jsx)(`span`,{className:`h-px flex-1 bg-sidebar-border/50`}),t?(0,x.jsx)(`span`,{className:`tabular-nums`,children:t}):null]})}function bx({project:e,activeProject:t,activeChat:n}){let r=ku(),i=Ji(),[a,o]=b.useState(e.id===t||!t);b.useEffect(()=>{e.id===t&&o(!0)},[t,e.id]);let s=U({...r.chats.list.queryOptions({projectId:e.id}),enabled:a}),c=wx(),l=Ex(),u=e.running.length>0,d=[...s.data||[]].sort((e,t)=>Number(t.pinned)-Number(e.pinned));return(0,x.jsxs)(`div`,{className:`mt-1 first:mt-0`,children:[(0,x.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:()=>o(!a),onKeyDown:e=>e.key===`Enter`&&o(!a),className:K(`group flex h-8 cursor-default items-center gap-2.5 rounded-[var(--control-radius)] px-2.5 select-none hover:bg-sidebar-row-hover`,e.missing&&`opacity-60`),title:e.path,children:[(0,x.jsx)(Bf,{className:`size-4 text-sidebar-icon`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-sidebar-foreground/90`,children:e.name}),u&&(0,x.jsx)(`span`,{className:`size-1.5 rounded-full bg-info`,title:`A chat is running`}),e.dev!==`idle`&&(0,x.jsx)(`span`,{className:K(`size-1.5 rounded-full`,O8(e.dev)),title:`Dev server: ${e.dev}`}),!a&&s.data?.length?(0,x.jsx)(`span`,{className:`text-xs text-sidebar-muted-foreground tabular-nums group-hover:hidden`,children:s.data.length}):null,(0,x.jsx)(`button`,{title:`New chat in ${e.name}`,onClick:t=>{t.stopPropagation(),i({to:`/p/$projectId`,params:{projectId:e.id}})},className:`hidden size-6 items-center justify-center rounded-md text-muted-foreground group-hover:inline-flex hover:bg-sidebar-row-active hover:text-foreground`,children:(0,x.jsx)(nh,{className:`size-3.5`})}),(0,x.jsx)(Vd,{className:K(`size-3 text-sidebar-icon transition-transform`,!a&&`-rotate-90`)})]}),a&&(0,x.jsxs)(`div`,{className:`mt-0.5 flex flex-col gap-px`,children:[d.map(t=>(0,x.jsx)(`div`,{className:`ps-3.5`,children:(0,x.jsx)(w8,{chat:{...t,projectId:e.id,modelName:c(t.model)},active:t.id===n,showProject:!1,onPin:n=>l(e.id,t.id,n)})},t.id)),s.data&&s.data.length===0&&(0,x.jsx)(`div`,{className:`h-8 ps-9 text-xs leading-8 text-sidebar-muted-foreground/70`,children:`No chats yet`})]})]})}function xx(){return(0,x.jsx)(`div`,{className:`flex flex-col gap-1 px-2.5 py-1`,children:[70,55,62].map(e=>(0,x.jsx)(`div`,{className:`h-4 animate-pulse rounded bg-sidebar-row-active`,style:{width:`${e}%`}},e))})}function Sx(){return(0,x.jsx)(`div`,{onPointerDown:e=>{e.preventDefault();let t=e=>{let t=Math.max(208,window.innerWidth-640);e.clientX<156?Uu({sidebarOpen:!1}):Uu({sidebarOpen:!0,sidebarWidth:Math.min(t,Math.max(208,e.clientX))})},n=()=>{window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerup`,n),document.body.style.cursor=``};document.body.style.cursor=`col-resize`,window.addEventListener(`pointermove`,t),window.addEventListener(`pointerup`,n)},onDoubleClick:()=>Uu({sidebarWidth:256}),className:`group absolute top-0 -right-2 z-10 flex h-full w-4 cursor-col-resize justify-center`,children:(0,x.jsx)(`div`,{className:`h-full w-0.5 transition-colors group-hover:bg-sidebar-border`})})}function Cx(){let e=ku(),t=Ji(),n=C();return W(e.projects.open.mutationOptions({onSuccess:r=>{n.invalidateQueries({queryKey:e.projects.list.queryKey()}),t({to:`/p/$projectId`,params:{projectId:r.id}})}}))}function wx(){let e=U(ku().models.queryOptions());return t=>t?(e.data?.find(e=>e.connectionId===t.connectionId))?.models.find(e=>e.id===t.model)?.name||t.model:``}function Tx({filter:e,activeChat:t}){let n=U(ku().chats.recent.queryOptions({limit:60})),r=Ex(),i=(n.data||[]).slice().sort((e,t)=>Number(t.pinned)-Number(e.pinned)).filter(t=>!e||t.title.toLowerCase().includes(e.toLowerCase())||t.projectName.toLowerCase().includes(e.toLowerCase()));return n.isLoading?(0,x.jsx)(xx,{}):i.length?(0,x.jsx)(`div`,{className:`flex flex-col gap-px`,children:i.map(e=>(0,x.jsx)(w8,{chat:e,active:e.id===t,showProject:!0,onPin:t=>r(e.projectId,e.id,t)},e.id))}):(0,x.jsx)(`div`,{className:`py-6 text-center text-xs text-muted-foreground/60`,children:e?`No matching chats`:`No chats yet`})}function Ex(){let e=W(ku().chats.setPinned.mutationOptions());return(t,n,r)=>e.mutate({projectId:t,chatId:n,pinned:r})}function Dx({icon:e,title:t,children:n,actions:r,className:i}){return(0,x.jsxs)(`div`,{className:K(`flex h-full flex-col items-center justify-center gap-2 px-8 text-center`,i),children:[(0,x.jsx)(`div`,{className:`mb-1 flex size-10 items-center justify-center rounded-xl border bg-card shadow-xs/5`,children:(0,x.jsx)(e,{className:`size-5 text-icon-muted`})}),(0,x.jsx)(`div`,{className:`text-sm font-medium`,children:t}),n&&(0,x.jsx)(`div`,{className:`max-w-80 text-xs leading-normal text-muted-foreground`,children:n}),r&&(0,x.jsx)(`div`,{className:`mt-2 flex gap-2`,children:r})]})}function Ox(){let e=ku(),t=C(),n=U(e.projects.list.queryOptions()),r=Cx(),i=W(e.projects.remove.mutationOptions({onSuccess:()=>t.invalidateQueries({queryKey:e.projects.list.queryKey()})})),[a,o]=b.useState(``);return(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,x.jsx)(`header`,{className:`flex h-[var(--topbar-h)] shrink-0 items-center gap-3 px-5`,children:(0,x.jsx)(`h1`,{className:`text-sm font-medium`,children:`Projects`})}),(0,x.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,x.jsxs)(`div`,{className:`mx-auto flex max-w-4xl flex-col gap-6 px-6 pt-4 pb-12`,children:[(0,x.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a.trim()&&r.mutate({path:a.trim()})},className:`flex items-center gap-2`,children:[(0,x.jsxs)(`div`,{className:`flex h-8 flex-1 items-center gap-2 rounded-[var(--control-radius)] border border-input bg-popover px-2.5 shadow-xs/5 focus-within:ring-2 focus-within:ring-ring/40 dark:bg-input/32`,children:[(0,x.jsx)(Mf,{className:`size-4 text-icon-muted`}),(0,x.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:`Open a folder: paste its path, e.g. C:\\Users\\you\\rpf-projects\\my-portal`,className:`min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,x.jsx)(J,{type:`submit`,disabled:!a.trim()||r.isPending,children:`Open folder`}),(0,x.jsxs)(J,{variant:`outline`,onClick:()=>Uu({newProject:`choose`}),children:[(0,x.jsx)(Pf,{}),` New`]})]}),r.error&&(0,x.jsx)(`div`,{className:`text-sm text-destructive-foreground`,children:r.error.message}),n.data&&n.data.length===0?(0,x.jsx)(`div`,{className:`h-72 rounded-xl border border-dashed`,children:(0,x.jsxs)(Dx,{icon:Bf,title:`Create your first project`,children:[`Start a new portal, pull an existing one, or copy one, all from the New button. A folder with forge.workspace.json opens with Open folder, or run`,` `,(0,x.jsx)(`code`,{className:`font-mono`,children:`rpf forge`}),` inside it.`,(0,x.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[(0,x.jsx)(J,{size:`sm`,onClick:()=>Uu({newProject:`new`}),children:`New portal`}),(0,x.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>Uu({newProject:`pull`}),children:`Pull a portal`}),(0,x.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>Uu({newProject:`copy`}),children:`Copy a portal`})]})]})}):(0,x.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/60 bg-card/40 shadow-xs/5`,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-[minmax(10rem,1.4fr)_1fr_0.8fr_1fr_1.2fr_5rem_6rem_1.5rem] items-center gap-3 border-b border-border/50 px-4 py-2 text-xs font-medium whitespace-nowrap text-muted-foreground`,children:[(0,x.jsx)(`span`,{children:`Project`}),(0,x.jsx)(`span`,{children:`Instance · profile`}),(0,x.jsx)(`span`,{children:`Portal`}),(0,x.jsx)(`span`,{children:`App`}),(0,x.jsx)(`span`,{children:`Update set`}),(0,x.jsx)(`span`,{children:`Active`}),(0,x.jsx)(`span`,{children:`Git`}),(0,x.jsx)(`span`,{})]}),n.data?.map((e,t)=>(0,x.jsx)(kx,{project:e,first:t===0,onRemove:()=>i.mutate({id:e.id})},e.id))]})]})})]})}function kx({project:e,first:t,onRemove:n}){let r=U({...ku().projects.info.queryOptions({id:e.id}),enabled:!e.missing}),i=r.data?.facts,a=r.data?.git,o=a?Object.keys(a.changes).length:0,s=`min-w-0 truncate text-xs text-muted-foreground`;return(0,x.jsxs)(`div`,{className:K(`group grid grid-cols-[minmax(10rem,1.4fr)_1fr_0.8fr_1fr_1.2fr_5rem_6rem_1.5rem] items-center gap-3 px-4 py-2.5 hover:bg-accent/40`,!t&&`border-t border-border/50`),children:[(0,x.jsxs)(la,{to:`/p/$projectId`,params:{projectId:e.id},disabled:e.missing,className:`flex min-w-0 items-center gap-2.5`,children:[(0,x.jsx)(`span`,{className:K(`size-1.5 shrink-0 rounded-full`,O8(r.data?.dev))}),(0,x.jsxs)(`span`,{className:`min-w-0`,children:[(0,x.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,x.jsx)(`span`,{className:`block truncate font-mono text-2xs text-muted-foreground`,title:e.path,children:e.path})]})]}),e.missing?(0,x.jsx)(`span`,{className:`col-span-5`,children:(0,x.jsx)(Xb,{variant:`warning`,children:`folder missing`})}):i?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:s,title:i.instance,children:[i.host,r.data?.profile?` · ${r.data.profile}`:(0,x.jsx)(`span`,{className:`text-warning-foreground`,children:` · no profile`})]}),(0,x.jsx)(`span`,{className:s,children:i.portal||`—`}),(0,x.jsx)(`span`,{className:s,title:i.appName,children:i.scope||`—`}),(0,x.jsx)(`span`,{className:s,children:i.updateSet||`—`})]}):(0,x.jsx)(`span`,{className:K(s,`col-span-4`),children:r.isLoading?`…`:`not a workspace (no forge.workspace.json)`}),!e.missing&&!i&&(0,x.jsx)(`span`,{}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:vu(r.data?.lastActivity||e.lastOpened)}),(0,x.jsx)(`span`,{className:s,children:a?.repo?(0,x.jsxs)(x.Fragment,{children:[a.branch,` `,o?(0,x.jsxs)(`span`,{className:`text-warning-foreground`,children:[`✎`,o]}):`✓`,a.ahead?` ↑${a.ahead}`:``]}):r.data?`no git`:``}),(0,x.jsx)(J,{variant:`ghost-muted`,size:`icon-xs`,title:`Remove from the list (files are not touched)`,onClick:n,className:`opacity-0 group-hover:opacity-100`,children:(0,x.jsx)(Oh,{})})]})}function Ax(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var jx=`data-valid`,Mx=`data-invalid`,Nx={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Px={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Fx={valid(e){return e===null?null:e?{[jx]:``}:{[Mx]:``}}},Ix=`data-checked`,Lx=`data-unchecked`;function Rx(e){return{checked(t){return e.indeterminate?{}:t?{[Ix]:``}:{[Lx]:``}},...Fx}}var zx={invalid:void 0,name:void 0,validityData:{state:Nx,errors:[],error:``,value:``,initialValue:null},setValidityData:Xh,disabled:void 0,setTouched:Xh,setDirty:Xh,setFilled:Xh,setFocused:Xh,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Px,registerFieldControl:Xh,validation:{getValidationProps:(e,t=Qh)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Xh,getInputControl:()=>null,commit:async()=>{},change:Xh}},Bx=b.createContext(zx);function Vx(e=!0){let t=b.useContext(Bx);if(t.setValidityData===Xh&&!e)throw Error(Nh(28));return t}function Hx(e,t,n){let{setFocused:r,focusOwnerRef:i}=Vx(),a=B_(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return Y(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function Ux(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Vx(),s=zh(()=>Symbol());Y(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),Y(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var Wx=b.createContext({disabled:!1});function Gx(){return b.useContext(Wx)}var Kx=b.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Xh,validationMode:`onSubmit`,submitCountRef:{current:0}});function qx(){return b.useContext(Kx)}var Jx=b.createContext({controlId:void 0,registerControlId:Xh,resetControlId:Xh,labelId:void 0,setLabelId:Xh,messageIds:[],setMessageIds:Xh,getDescriptionProps:e=>e});function Yx(){return b.useContext(Jx)}function Xx(e,t,n,r=!0,i,a){let[o,s]=b.useState(),c=C1(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return Y(()=>{let i=e||t||l||!r?void 0:Zx(n.current,c);o!==i&&s(i)}),u}function Zx(e,t){let n=Qx(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Qx(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function $x(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Yx(),o=C1(),s=zh(()=>Symbol()),c=b.useRef(!1),l=b.useRef(!1),u=B_(()=>{c.current&&i!==Xh&&(c.current=!1,i(s.current,void 0))});return Y(()=>{if(!n||i===Xh){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),Y(()=>u,[u]),(n?r:void 0)??t??o}var e5=b.createContext(void 0);function t5(){return b.useContext(e5)}var n5=b.createContext(void 0);function r5(){let e=b.useContext(n5);if(e===void 0)throw Error(Nh(14));return e}var i5=`data-parent`,a5=b.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:y=!1,style:S,...C}=e,{clearErrors:w}=qx(),{disabled:T,name:E,setDirty:D,setFilled:O,setTouched:k,state:A,validationMode:j,validityData:M,validation:N}=Vx(),P=Gx(),{labelId:F,registerControlId:I,getDescriptionProps:L}=Yx(),R=t5(),z=R?.allValues===void 0?void 0:R.parent,B=z!==void 0,ee=T||P.disabled||R?.disabled||o,V=E??d,te=v??V,ne=C1(),re=R?.registerControlId!==I,ie=$x({id:c||void 0,enabled:re}),ae=y?ie:ne,oe={};B&&(p?oe=z.getParentProps():te!==void 0&&(oe=z.getChildProps(te)));let{checked:se=n,indeterminate:H=l,onCheckedChange:ce,...le}=oe,ue=R?.value,de=b.useRef(null),fe=Hx(ee,de),{getButtonProps:pe,buttonRef:me}=J_({disabled:ee,native:y}),he=R?.validation??N,[ge,_e]=o_({controlled:te!==void 0&&ue!==void 0&&!p?ue.includes(te):se,default:i,name:`Checkbox`,state:`checked`}),ve=B?!!se:ge,ye=B&&H||l;Ux(de,ne,ge,void 0,!R&&!ee,d);let be=z?.registerChildId,xe=b.useRef(null),Se=he.registerInput,Ce=R?te:void 0,we=b.useCallback(e=>Se(e,{controlRef:de,value:Ce}),[Se,Ce]),Te=Bh(u,xe,p?void 0:we),Ee=Xx(a,F,xe,!y,ie,C[`aria-label`]);Y(()=>{xe.current&&(xe.current.indeterminate=ye),R||O(ge)},[ge,ye,R,O]),$3(ge,()=>{R||(w(V),D(ge!==M.initialValue),he.change(ge))});let De=rg({checked:ge,disabled:ee,form:s,name:p?void 0:V,id:y?void 0:ie,required:g,ref:Te,style:V?A0:k0,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=w1(Ug,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(ce?.(t,n),!n.isCanceled&&(_e(t),te!==void 0&&R!==void 0&&!p&&!B))){let e=t?[...R.value,te]:R.value.filter(e=>e!==te);R.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){de.current?.focus()}},v===void 0?Qh:{value:(R?ge&&v:v)||``},L,e=>he.getValidationProps(ee,e));b.useEffect(()=>{if(!z||te===void 0)return;let e=z.disabledStatesRef.current;return e.set(te,ee),()=>{e.delete(te)}},[z,ee,te]);let Oe=b.useMemo(()=>({...A,checked:ve,disabled:ee,readOnly:m,required:g,indeterminate:ye}),[A,ve,ee,m,g,ye]),ke=Rx(Oe),Ae=gg(`span`,e,{state:Oe,ref:[me,de,t],props:[{id:ae,role:`checkbox`,"aria-checked":ye?`mixed`:ve,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Ee,[i5]:p?``:void 0,onFocus(){fe(!0)},onBlur(){let e=xe.current;e&&(k(!0),fe(!1),j===`onBlur`&&he.commit(R?ue:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=xe.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),m_(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||Ax(t)?.click()})},onClick(e){if(m||ee)return;e.preventDefault();let t=xe.current;t&&q_(t,e)}},C,le,pe,L,e=>he.getValidationProps(ee,e)],stateAttributesMapping:ke}),je=Ae.props.id;return Y(()=>{if(be&&!p&&te!==void 0&&je!==void 0)return be(te,je)},[be,p,te,je]),(0,x.jsxs)(n5.Provider,{value:Oe,children:[Ae,!ge&&!R&&V&&!p&&_!==void 0&&(0,x.jsx)(`input`,{type:`hidden`,form:s,name:V,value:_,disabled:ee}),(0,x.jsx)(`input`,{...De,suppressHydrationWarning:!0})]})}),o5=b.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=r5(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=j1(c),f=b.useRef(null),p={...s,transitionStatus:u};R1({batch:!0,enabled:!c,open:c,ref:f,onComplete(){c||d(!1)}});let m={...Rx(s),...Dg},h=a||l,g=gg(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null}),s5=b.createContext(void 0);function c5(){let e=b.useContext(s5);if(e===void 0)throw Error(Nh(63));return e}var l5=`data-checked`,u5=`data-unchecked`,d5={...Fx,checked(e){return e?{[l5]:``}:{[u5]:``}}},f5=b.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:S}=qx(),{state:C,setTouched:w,setDirty:T,validityData:E,setFilled:D,validationMode:O,disabled:k,name:A,validation:j}=Vx(),{labelId:M}=Yx(),N=k||m,P=A??l,F=b.useRef(null),I=Bh(F,c,j.inputRef),L=b.useRef(null),R=Hx(N,L),z=C1(),B=$x({id:s}),ee=u?void 0:B,[V,te]=o_({controlled:n,default:!!i,name:`Switch`,state:`checked`});Ux(L,z,V,void 0,!N,l),Y(()=>{D(V)},[V,D]),$3(V,()=>{S(P),T(V!==E.initialValue),j.change(V)});let{getButtonProps:ne,buttonRef:re}=J_({disabled:N,native:u}),ie=Xx(a,M,F,!u,ee,y[`aria-label`]),ae={id:u?B:z,role:`switch`,"aria-checked":V,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":ie,onFocus(){R(!0)},onBlur(){let e=F.current;e&&!N&&(w(!0),R(!1),O===`onBlur`&&j.commit(e.checked))},onClick(e){if(f||N)return;e.preventDefault();let t=F.current;t&&q_(t,e)}},oe={...j.getValidationProps(N),checked:V,disabled:N,form:o,id:ee,name:P,required:p,style:P?A0:k0,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:I,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=w1(Ug,e.nativeEvent);d?.(t,n),n.isCanceled||te(t)},onClick(e){e.stopPropagation()},onFocus(){L.current?.focus()},..._===void 0?Qh:{value:_}},se=b.useMemo(()=>({...C,checked:V,disabled:N,readOnly:f,required:p}),[C,V,N,f,p]),H=gg(`span`,e,{state:se,ref:[t,L,re],props:[ae,y,ne,e=>j.getValidationProps(N,e)],stateAttributesMapping:d5});return(0,x.jsxs)(s5.Provider,{value:se,children:[H,!V&&P&&g!==void 0&&(0,x.jsx)(`input`,{type:`hidden`,form:o,name:P,value:g,disabled:N}),(0,x.jsx)(`input`,{...oe,suppressHydrationWarning:!0})]})}),p5=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return gg(`span`,e,{state:c5(),ref:t,stateAttributesMapping:d5,props:a})});function m5(e){let t=b.useRef(!0);t.current&&(t.current=!1,e())}var h5=b.createContext(void 0),g5=b.createContext(void 0);function _5(){let e=b.useContext(h5);if(e===void 0)throw Error(Nh(60));return e}function v5(){let e=b.useContext(g5);if(e===void 0)throw Error(Nh(61));return e}function y5(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var b5=(e,t)=>Object.is(e,t);function x5(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function S5(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!y5(e,t,(e,t)=>x5(e,t,n)):e!==t}function C5(e,t,n){return e?e.some(e=>e!==void 0&&x5(t,e,n)):!1}function w5(e,t,n){return e?e.findIndex(e=>e!==void 0&&x5(e,t,n)):-1}function T5(e,t){if(t!==b5)return n=>C5(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function E5(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(T5(t,n)):w5(e,t,n);return i===-1?null:i}function D5(e,t,n,r,i,a){return C5(r,t,i)?a!=null&&e>a&&C5(r,n[a],i)?a:e:e===a?E5(n,r,i,!0):a}function O5(e,t,n){return e.filter(e=>!x5(t,e,n))}var k5={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:j6(t,r)!==``},hasNullItemLabel:(e,t)=>t?k6(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>x5(t,e,n)):x5(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function A5(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function j5(e,t){return Math.max(0,e-t)}function M5(e,t){if(t<=0)return 0;let n=A5(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function N5(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w=b5,highlightItemOnHover:T=!0,children:E}=e,{clearErrors:D}=qx(),{setDirty:O,setTouched:k,setFocused:A,validityData:j,setFilled:M,name:N,disabled:P,validation:F,validationMode:I}=Vx(),L=$x({id:t}),R=P||d,z=N??c,[B,ee]=o_({controlled:n,default:y?r??Zh:r,name:`Select`,state:`value`}),[V,te]=o_({controlled:a,default:o,name:`Select`,state:`open`}),ne=b.useRef([]),re=b.useRef([]),ie=b.useRef(null),ae=b.useRef(null),oe=b.useRef(0),se=b.useRef(null),H=b.useRef([]),ce=b.useRef(!1),le=b.useRef(null),ue=b.useRef(null),de=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),fe=b.useRef(!1),pe=b.useRef(B),{openMethod:me,triggerProps:he}=t6(V),ge=zh(()=>new i2({id:L,labelId:void 0,modal:m,multiple:y,disabled:R,readOnly:f,required:p,highlightItemOnHover:T,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,value:B,open:V,mounted:V,transitionStatus:void 0,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Qh,triggerProps:Qh,itemRoot:{props:Qh,multiple:y,disabled:R,readOnly:f,isItemEqualToValue:w},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:Xh,setOpen:Xh,handleScrollArrowVisibility:Xh,onOpenChangeComplete:Xh,listRef:ne,popupRef:ie,scrollHandlerRef:ae,scrollArrowsMountedCountRef:oe,valueRef:se,valuesRef:H,labelsRef:re,typingRef:ce,selectionRef:de,firstItemTextRef:le,selectedItemTextRef:ue,alignItemWithTriggerActiveRef:fe,initialValueRef:pe},k5)).current,[_e,ve]=b.useState(!1),{mounted:ye,transitionStatus:be,forceUnmount:xe}=Ny({open:V,ref:ie,preventUnmountOnClose:_e,setPreventUnmountOnClose:ve,onUnmount(){ge.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)}}),Se=ge.useState(`activeIndex`),Ce=ge.useState(`selectedIndex`),we=ge.useState(`triggerElement`),Te=ge.useState(`positionerElement`),Ee=C6(me),De=me??Ee,Oe=b.useMemo(()=>y?``:j6(B,C),[y,B,C]),ke=b.useMemo(()=>y&&Array.isArray(B)?B.map(e=>j6(e,C)):j6(B,C),[y,B,C]);Ux(E0(we),L,B,B_(()=>ke),!R,c);let Ae=y?Array.isArray(B)&&B.length>0:B!=null&&Oe!==``;Y(()=>{M(Ae)},[Ae,M]),Y(function(){let e=E5(H.current,B,w,y);e===null&&(ue.current=null),V||ge.set(`selectedIndex`,e)},[y,V,B,w,ge]),$3(B,()=>{D(z),O(S5(B,j.initialValue,w)),F.change(B)});let je=B_((e,t)=>{let n=t,r=Vy(n);s?.(e,n),t.isCanceled||(e||ve(r()),te(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(k(!0),A(!1),I===`onBlur`&&F.commit(B)))});b.useImperativeHandle(h,()=>({unmount:xe,close:()=>{ge.state.open&&je(!1,w1(i_))}}),[xe,je,ge]);let Me=B_((e,t)=>{i?.(e,t),t.isCanceled||ee(e)}),Ne=B_(e=>{let t=j5(e.scrollHeight,e.clientHeight),n=M5(e.scrollTop,t),r=n>0,i=n<t;ge.set(`scrollUpArrowVisible`,r),ge.set(`scrollDownArrowVisible`,i)}),Pe=m2({open:V,onOpenChange:je,elements:{reference:we,floating:Te}}),Fe=Ty(Pe,{enabled:!R,event:`mousedown`}),Ie=jy(Pe),Le=j2(Pe,{enabled:!R,listRef:ne,activeIndex:Se,selectedIndex:Ce,disabledIndices:Zh,onNavigate(e){(e!==null||V)&&ge.set(`activeIndex`,e)},focusItemOnHover:T}),Re=M2(Pe,{enabled:!R&&(V||!f&&!y),listRef:re,activeIndex:Se,selectedIndex:Ce,disabledIndices:e=>T6(ne.current[e]),onMatch(e){V?ge.set(`activeIndex`,e):Me(H.current[e],w1(Ug))},onTyping(e){ce.current=e}}),ze=b.useMemo(()=>rg(Re.reference,Le.reference,Ie.reference,Fe.reference,he),[Fe.reference,Re.reference,Le.reference,Ie.reference,he]),Be=b.useMemo(()=>rg(Py,Re.floating,Le.floating,Ie.floating),[Re.floating,Le.floating,Ie.floating]),Ve=Le.item??Qh,He=b.useMemo(()=>({props:Ve,multiple:y,disabled:R,readOnly:f,isItemEqualToValue:w}),[Ve,y,R,f,w]);ge.useContextCallback(`setValue`,Me),ge.useContextCallback(`setOpen`,je),ge.useContextCallback(`handleScrollArrowVisibility`,Ne),ge.useContextCallback(`onOpenChangeComplete`,_),m5(()=>{ge.update({popupProps:Be,triggerProps:ze,itemRoot:He})}),ge.useSyncedValues({id:L,modal:m,multiple:y,disabled:R,readOnly:f,required:p,highlightItemOnHover:T,value:B,open:V,mounted:ye,transitionStatus:be,popupProps:Be,triggerProps:ze,itemRoot:He,items:v,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,openMethod:De});let Ue=Bh(g,F.inputRef),We=y?void 0:z,Ge=b.useMemo(()=>!y||!Array.isArray(B)||!z?null:B.map(e=>{let t=j6(e,C);return(0,x.jsx)(`input`,{type:`hidden`,form:l,name:z,value:t,disabled:R},t)}),[y,B,l,z,C,R]);return(0,x.jsxs)(h5.Provider,{value:ge,children:[(0,x.jsx)(g5.Provider,{value:Pe,children:E}),(0,x.jsx)(`input`,{...F.getValidationProps(R,{onFocus(){ge.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||R||f)return;let t=e.currentTarget.value,n=w1(Ug,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=H.current.findIndex(t=>j6(t,C).toLowerCase()===e||A6(t,S).toLowerCase()===e);r===-1&&(r=H.current.findIndex((t,n)=>{let r=re.current[n];return r!=null&&r.toLowerCase()===e}));let i=H.current[r];i!=null&&Me(i,n)}ge.set(`forceMount`,!0),queueMicrotask(r)}}),id:L&&We==null?`${L}-hidden-input`:void 0,form:l,name:We,autoComplete:u,value:Oe,disabled:R,required:p&&!(y&&Ae),readOnly:f,ref:Ue,style:z?A0:k0,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ge]})}function P5(e,t){return e??t}var F5=`data-popup-side`,I5=400,L5={...Rg,...Fx,popupSide:e=>e?{[F5]:e}:null,value:()=>null},R5=b.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,validationMode:u,validation:d,state:f,disabled:p}=Vx(),{labelId:m}=Yx(),h=_5(),g=h.useState(`readOnly`),_=h.useState(`required`),v=h.useState(`disabled`),y=p||v||a,x=h.useState(`open`),S=h.useState(`mounted`),C=h.useState(`value`),w=h.useState(`triggerProps`),T=h.useState(`positionerElement`),E=h.useState(`listElement`),D=h.useState(`popupSide`),O=h.useState(`id`),k=h.useState(`labelId`),A=h.useState(`hasSelectedValue`),j=S&&T?D:null,M=i??O,N=P5(m,k);$x({id:i});let P=E0(T),F=b.useRef(null),I=Hx(y,F),{getButtonProps:L,buttonRef:R}=J_({disabled:y,native:o}),z=h.useStateSetter(`triggerElement`),B=U1(),ee=U1(),V=U1();b.useEffect(()=>{if(x)return V.start(I5,()=>{h.context.selectionRef.current.allowUnselectedMouseUp=!0,h.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{V.clear()};h.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},ee.clear()},[x,h,ee,V]);let te=rg(w,{id:M,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?E?.id??m0(T)?.id:void 0,"aria-labelledby":N,"aria-readonly":g||void 0,"aria-required":_||void 0,tabIndex:y?-1:0,onFocus(e){I(!0),x&&h.context.alignItemWithTriggerActiveRef.current&&h.context.setOpen(!1,w1(Ug,e.nativeEvent)),B.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){Z1(T,e.relatedTarget)||(l(!0),I(!1),u===`onBlur`&&d.commit(C))},onMouseDown(e){if(x)return;let t=K_(e.currentTarget);function n(e){if(!F.current)return;let t=e.target;Z1(F.current,t)||Z1(P.current,t)||p6(e,F.current)||h.context.setOpen(!1,w1(t_,e))}ee.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,L),ne=d.getValidationProps(y,te);ne.role=`combobox`;let re={...f,open:x,disabled:y,value:C,readOnly:g,popupSide:j,placeholder:!A};return gg(`button`,e,{ref:[t,F,R,z],state:re,stateAttributesMapping:L5,props:ne})}),z5=b.forwardRef(function(e,t){let n=_5(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,x.jsx)(oy,{ref:t,...e}):null}),B5=b.createContext(void 0);function V5(){let e=b.useContext(B5);if(!e)throw Error(Nh(59));return e}function H5(e,t){e&&Object.assign(e.style,t)}var U5={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},W5={position:`fixed`},G5=b.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=$v,style:_,...v}=e,y=_5(),S=v5(),C=y.useState(`open`),w=y.useState(`mounted`),T=y.useState(`modal`),E=y.useState(`value`),D=y.useState(`openMethod`),O=y.useState(`positionerElement`),k=y.useState(`triggerElement`),A=y.useState(`isItemEqualToValue`),j=y.useState(`transitionStatus`),M=b.useRef(null),N=b.useRef(null),[P,F]=b.useState(h),I=w&&P&&D!==`touch`;!w&&P!==h&&F(h),b.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>I),J3((I||T)&&C,D===`touch`,O,k);let L=C3({anchor:n,floatingRootContext:S,positionMethod:a,mounted:w,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??I,collisionAvoidance:g,keepMounted:!0}),R=I?`none`:L.side,z=I?W5:L.positionerStyles,B={open:C,side:R,align:L.align,anchorHidden:L.anchorHidden};Y(()=>{y.set(`popupSide`,L.side)},[y,L.side]);let ee=F3(e,B,{styles:z,transitionStatus:j,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!w,inert:!C}),V=b.useRef(0),te=B_(e=>{if(y.context.valuesRef.current.length===0)return;let t=V.current;V.current=e.size;let n=w1(Ug);if(t!==0&&!y.state.multiple&&E!==null&&w5(y.context.valuesRef.current,E,A)===-1){let e=y.context.initialValueRef.current,t=e!=null&&w5(y.context.valuesRef.current,e,A)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(E)){let e=E.filter(e=>w5(y.context.valuesRef.current,e,A)!==-1);e.length!==E.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(C&&I){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};H5(O,e),H5(y.context.popupRef.current,e)}}),ne=b.useMemo(()=>({...L,side:R,alignItemWithTriggerActive:I,setControlledAlignItemWithTrigger:F,scrollUpArrowRef:M,scrollDownArrowRef:N}),[L,R,I,F]);return(0,x.jsx)(E3,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:te,children:(0,x.jsxs)(B5.Provider,{value:ne,children:[w&&T&&(0,x.jsx)(N3,{inert:o3(!C),cutout:k}),ee]})})}),K5=`base-ui-disable-scrollbar`,q5={className:K5,getElement(e){return(0,x.jsx)(`style`,{nonce:e,href:K5,precedence:`base-ui:low`,children:`.${K5}{scrollbar-width:none}.${K5}::-webkit-scrollbar{display:none}`})}},J5=b.createContext(void 0),Y5={disableStyleElements:!1};function X5(){return b.useContext(J5)??Y5}var Z5=`--transform-origin`,Q5={...zg,...Dg},$5=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=_5(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=v5(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=V5(),_=G4(!0)!=null,v=l3(),{nonce:y,disableStyleElements:S}=X5(),C=s.useState(`id`),w=s.useState(`open`),T=s.useState(`openMethod`),E=s.useState(`mounted`),D=s.useState(`popupProps`),O=s.useState(`transitionStatus`),k=s.useState(`triggerElement`),A=s.useState(`positionerElement`),j=s.useState(`listElement`),M=b.useRef(!1),N=b.useRef(!1),P=b.useRef({}),F=A1(),I=B_(e=>{if(!A||!s.context.popupRef.current||!N.current)return;let t=A.style.top===`0px`,n=A.style.bottom===`0px`;if(M.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=n7(A),i=r7(A.getBoundingClientRect().height,`y`,r),a=K_(A),o=m_(A),c=o.getComputedStyle(A),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=e7(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=t7(e),g=null,_=e=>{A.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=A5(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(M.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=A5(g,0,t7(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(M.current=!0),s.context.handleScrollArrowVisibility(e)});b.useImperativeHandle(s.context.scrollHandlerRef,()=>I,[I]),R1({open:w,ref:s.context.popupRef,onComplete(){w&&s.context.onOpenChangeComplete(!0)}});let L={open:w,transitionStatus:O,side:f,align:p};Y(()=>{A&&s.context.popupRef.current&&!Object.keys(P.current).length&&(P.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[s,A]),Y(()=>{w||m||(N.current=!1,M.current=!1,H5(A,P.current))},[w,m,A]),Y(()=>{let e=s.context.popupRef.current;if(!w||!k||!A||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(N.current=!0,e.style.removeProperty(Z5),!m){F.request(()=>s.context.handleScrollArrowVisibility(j||e));return}let t=o7(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=m_(A),i=r.getComputedStyle(A),a=r.getComputedStyle(e),o=K_(k),c=n7(k),l=i7(k.getBoundingClientRect(),c),d=i7(A.getBoundingClientRect(),c),f=l.height,p=j||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=e7(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,D=0;if(t&&n){let e=i7(n.getBoundingClientRect(),c);T=i7(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-d.top+T.height/2-r}let O=w+D+y+h,N=Math.min(S,O),F=S-_-y,I=O-N,L=C-5;A.style.left=`${A5(E,5,L-d.width)}px`,A.style.height=`${N}px`,A.style.maxHeight=`none`,A.style.marginTop=`${_}px`,A.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=t7(p),z=I>=R-1;z&&(N=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(N)+1<Math.min(m,b),ee=(r.visualViewport?.scale??1)!==1&&c1;if(B||ee){H5(A,P.current),g(!1);return}let V=Math.max(b,N);if(z){let e=Math.max(0,S-O);A.style.top=d.height>=F?`0`:`${e}px`,A.style.height=`${N}px`,p.scrollTop=t7(p)}else A.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=A5(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(Z5,`50% ${i}%`)}(V===S||N>=x)&&(M.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,w,A,k,m,g,F,j,u,v,h]),b.useEffect(()=>{if(!m||!A||!w)return;let e=m_(A);function t(e){s.context.setOpen(!1,w1(a_,e))}return w0(e,`resize`,t)},[s,m,A,w]);let R={...j?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${C}-list`},onKeyDown(e){_&&K4.has(e.key)&&e.stopPropagation()},onScroll(e){j||I(e.currentTarget)},...m&&{style:j?{height:`100%`}:U5},className:!j&&m?q5.className:void 0},z=gg(`div`,e,{ref:[t,s.context.popupRef],state:L,stateAttributesMapping:Q5,props:[D,R,q4(O),o]});return(0,x.jsxs)(b.Fragment,{children:[!S&&q5.getElement(y),(0,x.jsx)(wy,{context:d,modal:!1,disabled:!E,openInteractionType:T,returnFocus:a,restoreFocus:!0,children:z})]})});function e7(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function t7(e){return j5(e.scrollHeight,e.clientHeight)}function n7(e){return C4.getScale(e)}function r7(e,t,n){return e/n[t]}function i7(e,t){return iv({x:r7(e.x,`x`,t),y:r7(e.y,`y`,t),width:r7(e.width,`x`,t),height:r7(e.height,`y`,t)})}var a7=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function o7(e){let{style:t}=e,n={};for(let[e,r]of a7)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of a7){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var s7=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=_5(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=V5(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:U5},className:u&&d!==`touch`?q5.className:void 0};return gg(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),c7=b.createContext(void 0);function l7(){let e=b.useContext(c7);if(!e)throw Error(Nh(57));return e}var u7=b.memo(b.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=b.useRef(null),d=_1({guess:!0,label:o,textRef:u}),f=_5(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),v=h||s,y=f.useState(`isActive`,d.index),S=f.useState(`open`),C=f.useState(`isSelected`,a),w=f.useState(`isSelectedByFocus`,d.index),T=d.index,E=b.useRef(null);Y(()=>{let e=f.context.valuesRef.current;return e[T]=a,()=>{delete e[T]}},[T,a,f]),Y(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=D5(T,a,f.context.valuesRef.current,e,_,t),r=n===T,T===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&x5(a,e,_),r&&(n=T)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[T,m,_,f,a]);let D=b.useRef(`mouse`),O=b.useRef(!1),{getButtonProps:k,buttonRef:A}=J_({disabled:v,focusableWhenDisabled:!0,native:c,composite:!0}),j={disabled:v,selected:C,highlighted:y};function M(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=C?O5(n,a,_):[...n,a];f.context.setValue(r,w1(Jg,e))}else f.context.setValue(a,w1(Jg,e)),f.context.setOpen(!1,w1(Jg,e))}function N(){f.context.selectionRef.current.dragY=0}let P={role:`option`,"aria-selected":C,tabIndex:S&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,T),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=D.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&K1(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!O.current;O.current=!1,v||i||M(e.nativeEvent)},onPointerEnter(e){D.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){D.current=e.pointerType,O.current=!0,N()},onMouseUp(){if(N(),v||D.current===`touch`||O.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&C,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!C;e||t||(O.current=!0,E.current?.click(),O.current=!1)}},F=gg(`div`,e,{ref:[A,t,d.ref,E],state:j,props:[p,P,l,k]}),I=b.useMemo(()=>({selected:C,index:T,textRef:u,selectedByFocus:w}),[C,T,u,w]);return(0,x.jsx)(c7.Provider,{value:I,children:F})})),d7=b.memo(b.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=l7(),a=_5(),{render:o,className:s,style:c,...l}=e;return gg(`div`,e,{ref:[b.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),f7=`relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-sm text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_rgb(0_0_0/4%)] has-focus-visible:border-ring has-focus-visible:ring-[3px] has-focus-visible:ring-inset has-focus-visible:before:shadow-none has-disabled:opacity-64 has-aria-invalid:border-destructive/36 dark:bg-input/32 dark:before:shadow-[0_-1px_rgb(255_255_255/6%)]`;function p7({className:e,size:t=`default`,mono:n,...r}){return(0,x.jsx)(`span`,{"data-slot":`input-control`,className:K(f7,t===`compact`&&`rounded-md before:rounded-[calc(var(--radius-md)-1px)]`,n&&`font-mono tabular-nums`,e),children:(0,x.jsx)(`input`,{className:K(`h-7.5 w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] leading-7.5 outline-none placeholder:text-muted-foreground/72`,t===`compact`&&`h-7 px-[calc(--spacing(2.5)-1px)] text-xs leading-7`,t===`sm`&&`h-6.5 px-[calc(--spacing(2.5)-1px)] leading-6.5`),...r})})}function m7({className:e,...t}){return(0,x.jsx)(`span`,{"data-slot":`textarea-control`,className:K(f7,e),children:(0,x.jsx)(`textarea`,{className:`field-sizing-content max-h-64 min-h-16 w-full resize-none rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none wrap-anywhere placeholder:text-muted-foreground/72`,...t})})}function h7({className:e,...t}){return(0,x.jsx)(a5,{"data-slot":`checkbox`,className:K(`relative inline-flex size-4 shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background bg-clip-padding shadow-xs/5 outline-none transition-shadow focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring data-checked:border-primary data-disabled:opacity-64 dark:not-data-checked:bg-input/32`,e),...t,children:(0,x.jsx)(o5,{className:`absolute -inset-px flex items-center justify-center rounded-[.25rem] bg-primary text-primary-foreground data-unchecked:hidden`,children:(0,x.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-3`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,x.jsx)(`path`,{d:`M5.25 12.7 10.2 18.6 18.75 5.4`})})})})}function g7({className:e,...t}){return(0,x.jsx)(f5,{"data-slot":`switch`,className:K(`inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 cursor-pointer items-center rounded-full p-[2px] outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(3.5)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-64`,e),...t,children:(0,x.jsx)(p5,{className:`pointer-events-none block size-[calc(var(--thumb-size)-2px)] origin-left rounded-full bg-background shadow-sm/5 [transition:translate_.15s,scale_.1s_.1s] in-[[role=switch]:active]:scale-x-110 data-checked:origin-right data-checked:translate-x-[calc(var(--thumb-size)-4px)] dark:data-unchecked:bg-muted-foreground`})})}function _7({label:e,description:t,children:n,className:r}){return(0,x.jsxs)(`label`,{className:K(`grid content-start gap-1.5`,r),children:[(0,x.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e}),n,t&&(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})}function v7({value:e,onChange:t,options:n,placeholder:r,disabled:i,size:a=`default`,className:o,"aria-label":s}){let c=n.find(t=>t.value===e);return(0,x.jsxs)(N5,{value:e,onValueChange:e=>t(String(e??``)),disabled:i,items:n,children:[(0,x.jsxs)(R5,{"aria-label":s,className:K(`relative inline-flex w-full min-w-36 cursor-pointer items-center justify-between gap-2 rounded-lg border border-input bg-background text-left text-sm text-foreground shadow-xs/5 ring-ring/24 outline-none select-none not-dark:bg-clip-padding focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-inset data-[disabled]:pointer-events-none data-[disabled]:opacity-64 dark:bg-input/32 [&_svg]:pointer-events-none [&_svg]:shrink-0`,a===`xs`?`h-7 gap-1 rounded-md px-[7px] text-sm sm:h-6 sm:text-xs [&_svg]:size-3.5`:`min-h-9 px-[11px] sm:min-h-8 [&_svg]:size-4`,o),children:[(0,x.jsx)(`span`,{className:K(`min-w-0 flex-1 truncate`,!c&&`text-muted-foreground`),children:c?c.label:r}),(0,x.jsx)(Vd,{"aria-hidden":!0,className:`-me-1 !size-3.5 opacity-70`})]}),(0,x.jsx)(z5,{children:(0,x.jsx)(G5,{className:`z-[130] select-none`,side:`bottom`,sideOffset:4,align:`start`,alignItemWithTrigger:!0,children:(0,x.jsx)($5,{className:`origin-(--transform-origin) rounded-lg text-foreground outline-none`,children:(0,x.jsx)(`div`,{className:`glass relative h-full min-w-(--anchor-width) rounded-lg`,children:(0,x.jsx)(s7,{className:`max-h-(--available-height) overflow-y-auto p-1`,children:n.map(e=>(0,x.jsx)(u7,{value:e.value,className:`flex min-h-8 cursor-pointer items-center rounded-sm px-2 py-1 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[selected]:bg-foreground/[0.08] sm:min-h-7`,children:(0,x.jsx)(d7,{className:`min-w-0 flex-1`,children:e.label})},e.value))})})})})})]})}var y7=`relative inline-flex size-4.5 shrink-0 cursor-pointer appearance-none items-center justify-center rounded-full border border-input bg-background shadow-xs/5 outline-none transition-shadow not-dark:bg-clip-padding checked:border-primary checked:bg-[radial-gradient(circle,var(--primary-foreground)_0_3px,var(--primary)_3.5px)] checked:shadow-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:opacity-64 sm:size-4 dark:not-checked:bg-input/32`,b7=e=>!!e&&/\s/.test(e);function x7(e,t,n){let r=n;for(;r<e.length&&!b7(e[r]);)r++;return/[/\\]/.test(e.slice(t+1,r))}function S7(e){return/^\.?[0-9][0-9,._]*(?:[kKmMbBtT]|[eE][0-9]+)?[.,;:!?)]*$/.test(e)}function C7(e,t){let n=Math.max(0,Math.min(e.length,Math.floor(t))),r=n-1;for(;r>=0&&!b7(e[r]);)r--;let i=r+1,a=e.slice(i,n);if(a.startsWith(`/`))return x7(e,i,n)?null:{kind:`slash-command`,query:a.slice(1),rangeStart:i,rangeEnd:n};let o=/^\p{Sc}/u.exec(a);if(o){let e=a.slice(o[0].length);return S7(e)?null:{kind:`skill`,query:e,rangeStart:i,rangeEnd:n}}return a.startsWith(`@`)?{kind:`path`,query:a.slice(1),rangeStart:i,rangeEnd:n}:null}function w7(e,t){return!!e&&!!t&&e.kind===t.kind&&e.rangeStart===t.rangeStart}function T7(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>=0?e.slice(t+1):e}function E7(e){return e.replace(/[\\[\]*_~&]/g,e=>e===`[`?`[`:e===`]`?`]`:`\\${e}`)}function D7(e){return encodeURI(e).replaceAll(`(`,`%28`).replaceAll(`)`,`%29`).replaceAll(`&`,`%26`).replaceAll(`#`,`%23`).replaceAll(`?`,`%3F`).replaceAll(`\\`,`%5C`)}function O7(e){let t=D7(e),n=/^[a-z][a-z\d+.-]*:/i.test(e)&&!/^[a-z]:[\\/]/i.test(e);return`[${E7(T7(e))}](${n?`./${t}`:t})`}var k7=/(^|\s)\[((?:\\.|	[13];|&(?!#9[13];)|[^[\]\\&]){0,512})\]\(([^)\s]+)\)(?=\s|$)/g,A7=/(^|\s)@ref:([a-z0-9][a-z0-9-]{0,63})(?=\s)/g,j7=/(^|\s)@(?:"((?:\\.|[^"\\])*)"|([^\s@"]+))(?=\s)/g,M7=/(^|\s)\p{Sc}(?![0-9][0-9_]*(?:[kKmMbBtT]|[eE][0-9]+)?(?:\s|$))(?=[a-zA-Z0-9:_-]*[a-zA-Z])([a-zA-Z0-9][a-zA-Z0-9:_-]*)(?=\s)/gu,N7=/^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*(?:\/[^\s@"]+)*$/,P7=/^[\p{ID_Start}_$][\p{ID_Continue}.$]*\(/u;function F7(e,t){let n=[];for(let t of e.matchAll(k7)){let r=t[1]||``,i=(t[2]||``).replace(/\\(.)|	(1|3);/g,(e,t,n)=>t===void 0?n===`1`?`[`:`]`:t),a=t[3]||``;try{a=decodeURIComponent(a)}catch{}let o=/^[a-z][a-z\d+.-]*:/i.test(a)&&!/^[a-z]:[\\/]/i.test(a);if(a.startsWith(`./`)&&/^[a-z][a-z\d+.-]*:/i.test(a.slice(2))&&(a=a.slice(2)),!a||o||(t[3]||``).startsWith(`//`)||i!==T7(a))continue;let s=(t.index??0)+r.length,c=(t.index??0)+t[0].length;n.push({start:s,end:c,seg:{type:`mention`,path:a,source:e.slice(s,c)}})}for(let t of e.matchAll(A7)){let r=(t.index??0)+(t[1]?.length??0),i=(t.index??0)+t[0].length;n.push({start:r,end:i,seg:{type:`reference`,id:t[2],source:e.slice(r,i)}})}for(let t of e.matchAll(j7)){let r=t[1]||``,i=t[2],a=i===void 0?t[3]||``:i.replace(/\\(["\\])/g,`$1`);if(!a||i===void 0&&(N7.test(a)||P7.test(a)))continue;let o=(t.index??0)+r.length,s=(t.index??0)+t[0].length;n.push({start:o,end:s,seg:{type:`mention`,path:a,source:e.slice(o,s)}})}for(let r of e.matchAll(M7)){let i=r[2]||``;if(t&&!t.has(i))continue;let a=(r.index??0)+(r[1]?.length??0),o=(r.index??0)+r[0].length;n.push({start:a,end:o,seg:{type:`skill`,name:i,source:e.slice(a,o)}})}n.sort((e,t)=>e.start-t.start);let r=[],i=-1;for(let e of n)e.start<i||(r.push(e),i=e.end);return r}function I7(e,t){let n=[],r=0;for(let i of F7(e,t))i.start>r&&n.push({type:`text`,text:e.slice(r,i.start)}),n.push(i.seg),r=i.end;return r<e.length&&n.push({type:`text`,text:e.slice(r)}),n}function L7(e,t,n,r){let i=Math.max(0,Math.min(e.length,t)),a=Math.max(i,Math.min(e.length,n));return r.endsWith(` `)&&e[a]===` `&&a++,{text:e.slice(0,i)+r+e.slice(a),cursor:i+r.length}}function R7(e,t){if(!t)return 0;let n=0,r=-1,i=-1,a=0;for(let o=0;o<e.length;o++)if(e[o]===t[n]&&(r===-1&&(r=o),i!==-1&&(a+=o-i-1),i=o,n++,n===t.length)){let n=o-r+1-t.length;return r*2+a*3+n+Math.min(64,e.length-t.length)}return null}function z7(e,t,n,r=[` `,`-`,`_`,`/`]){if(!e||!t)return null;let i=Math.min(64,Math.max(0,e.length-t.length));if(e===t)return n.exact;if(n.prefix!==void 0&&e.startsWith(t))return n.prefix+i;if(n.boundary!==void 0){let a=null;for(let n of r){let r=e.indexOf(n+t);r!==-1&&(a===null||r+n.length<a)&&(a=r+n.length)}if(a!==null)return n.boundary+a*2+i}if(n.includes!==void 0){let r=e.indexOf(t);if(r!==-1)return n.includes+r*2+i}if(n.fuzzy!==void 0){let r=R7(e,t);if(r!==null)return n.fuzzy+r}return null}function B7(e,t,n,r){let i=t.trim().toLowerCase();if(!i)return[...e];let a=[];for(let t of e){let e=n(t,i);e!==null&&a.push({item:t,score:e,key:r(t)})}return a.sort((e,t)=>e.score-t.score||e.key.localeCompare(t.key)),a.map(e=>e.item)}function V7(e,t){let n=[z7(e.name.toLowerCase(),t,{exact:0,prefix:2,boundary:4,includes:6,fuzzy:100},[`-`,`_`,`/`]),z7(e.description.toLowerCase(),t,{exact:30,prefix:32,boundary:34,includes:36}),z7(e.source.toLowerCase(),t,{exact:40,prefix:42})].filter(e=>e!==null);return n.length?Math.min(...n):null}function H7(e,t){let n=t.replace(/^\/+/,``);if(!n)return 0;let r=[z7(e.name.toLowerCase(),n,{exact:0,prefix:2,boundary:4,includes:6,fuzzy:100},[`-`,`_`,`/`,`:`]),z7(e.description.toLowerCase(),n,{exact:20,prefix:22,boundary:24,includes:26})].filter(e=>e!==null);return r.length?Math.min(...r):null}function U7(e){let t={};for(let n of e.matchAll(/([a-zA-Z][\w-]*)="([^"]*)"/g))t[n[1]]=n[2].replace(/"/g,`"`).replace(/</g,`<`).replace(/&/g,`&`);return t}function W7(e){let t=[],n=/<review_comment\b([^>]*)>/g,r=0;for(let i=n.exec(e);i;i=n.exec(e)){let a=n.lastIndex,o=/^(`{3,})([^\n]*)$|<\/review_comment>/gm;o.lastIndex=a;let s=0,c=-1;for(let t=o.exec(e);t;t=o.exec(e))if(t[1])s===0?s=t[1].length:t[1].length>=s&&!t[2]?.trim()&&(s=0);else if(s===0){c=t.index,o.lastIndex=t.index+t[0].length;break}if(c<0)break;let l=U7(i[1]||``),u=e.slice(a,c).replace(/^\n/,``).split(/^`{3,}/m)[0].trim(),d=e.slice(r,i.index);(t[t.length-1]?.type!==`review`||d.trim())&&t.push({type:`text`,text:d}),t.push({type:`review`,filePath:l.filePath||``,rangeLabel:l.rangeLabel||``,comment:u}),r=o.lastIndex,n.lastIndex=r}let i=e.slice(r);return i&&(t[t.length-1]?.type!==`review`||i.trim())&&t.push({type:`text`,text:i}),t.map((e,n)=>e.type===`text`&&t[n+1]?.type===`review`?{...e,text:e.text.replace(/\s+$/,`
|
|
12
|
+
`)}:e).filter(e=>e.type!==`text`||e.text!==``||t.length===1)}var G7=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
13
|
+
<symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
|
|
14
|
+
<path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
|
|
15
|
+
</symbol>
|
|
16
|
+
<symbol id="file-tree-icon-dot" viewBox="0 0 6 6">
|
|
17
|
+
<circle cx="3" cy="3" r="3" />
|
|
18
|
+
</symbol>
|
|
19
|
+
<symbol id="file-tree-icon-file" viewBox="0 0 16 16">
|
|
20
|
+
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".5"/>
|
|
21
|
+
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
22
|
+
</symbol>
|
|
23
|
+
<symbol id="file-tree-icon-lock" viewBox="0 0 16 16">
|
|
24
|
+
<path fill="currentcolor" d="M4 5.336V4a4 4 0 1 1 8 0v1.336c1.586.54 2 1.843 2 4.664v1c0 4.118-.883 5-5 5H7c-4.117 0-5-.883-5-5v-1c0-2.821.414-4.124 2-4.664M5.5 4v1.054Q6.166 4.998 7 5h2q.834-.002 1.5.054V4a2.5 2.5 0 0 0-5 0m-2 6v1c0 .995.055 1.692.167 2.193.107.483.246.686.35.79s.307.243.79.35c.5.112 1.198.167 2.193.167h2c.995 0 1.692-.055 2.193-.166.483-.108.686-.247.79-.35.104-.105.243-.308.35-.791.112-.5.167-1.198.167-2.193v-1c0-.995-.055-1.692-.166-2.193-.108-.483-.247-.686-.35-.79-.105-.104-.308-.243-.791-.35C10.693 6.555 9.995 6.5 9 6.5H7c-.995 0-1.692.055-2.193.167-.483.107-.686.246-.79.35s-.243.307-.35.79C3.555 8.307 3.5 9.005 3.5 10" />
|
|
25
|
+
</symbol>
|
|
26
|
+
<symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
|
|
27
|
+
<path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
|
|
28
|
+
</symbol>
|
|
29
|
+
</svg>`,K7=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
|
|
30
|
+
<path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
|
|
31
|
+
<path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
|
|
32
|
+
</symbol>`,q7=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
|
|
33
|
+
<path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
|
|
34
|
+
</symbol>`,J7=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
|
|
35
|
+
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
36
|
+
<path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
|
|
37
|
+
</symbol>`,Y7=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
|
|
38
|
+
<path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
|
|
39
|
+
</symbol>`,X7=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
|
|
40
|
+
<path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
|
|
41
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
|
|
42
|
+
</symbol>`,Z7=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
|
|
43
|
+
<path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
|
|
44
|
+
<path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
|
|
45
|
+
<path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
|
|
46
|
+
</symbol>`,Q7=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
|
|
47
|
+
<path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
|
|
48
|
+
</symbol>`,$7=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
|
|
49
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
|
|
50
|
+
</symbol>`,e9=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
|
|
51
|
+
<path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
|
|
52
|
+
</symbol>`,t9=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
|
|
53
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
|
|
54
|
+
</symbol>`,n9=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
|
|
55
|
+
<path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
|
|
56
|
+
<path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
|
|
57
|
+
</symbol>`,r9=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
|
|
58
|
+
<path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
|
|
59
|
+
<path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
|
|
60
|
+
<path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
|
|
61
|
+
</symbol>`,i9=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
|
|
62
|
+
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
|
|
63
|
+
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
64
|
+
</symbol>`,a9=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
|
|
65
|
+
<path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
|
|
66
|
+
<path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
|
|
67
|
+
</symbol>`,o9=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
|
|
68
|
+
<path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
|
|
69
|
+
<path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
|
|
70
|
+
</symbol>`,s9=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
|
|
71
|
+
<path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
|
|
72
|
+
</symbol>`,c9=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
|
|
73
|
+
<path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
|
|
74
|
+
</symbol>`,l9=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
|
|
75
|
+
<path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
|
|
76
|
+
</symbol>`,u9=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
|
|
77
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
|
|
78
|
+
</symbol>`,d9=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
|
|
79
|
+
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
80
|
+
<path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
|
|
81
|
+
</symbol>`,f9=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
|
|
82
|
+
<path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
|
|
83
|
+
<path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
|
|
84
|
+
</symbol>`,p9=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
|
|
85
|
+
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
86
|
+
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
|
|
87
|
+
</symbol>`,m9=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
|
|
88
|
+
<path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
|
|
89
|
+
</symbol>`,h9=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
|
|
90
|
+
<path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
|
|
91
|
+
</symbol>`,g9=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
|
|
92
|
+
<path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
|
|
93
|
+
<path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
|
|
94
|
+
</symbol>`,_9=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
|
|
95
|
+
<defs>
|
|
96
|
+
<linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
|
|
97
|
+
<stop stop-color="currentColor"/>
|
|
98
|
+
<stop offset="1" stop-color="currentColor" stop-opacity="0"/>
|
|
99
|
+
</linearGradient>
|
|
100
|
+
</defs>
|
|
101
|
+
<path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
|
|
102
|
+
<path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
|
|
103
|
+
<path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
|
|
104
|
+
</symbol>`,v9=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
|
|
105
|
+
<path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
|
|
106
|
+
<path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
|
|
107
|
+
</symbol>`,y9=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
|
|
108
|
+
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
|
|
109
|
+
</symbol>`,b9=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
|
|
110
|
+
<path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
|
|
111
|
+
</symbol>`,x9=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
|
|
112
|
+
<path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
|
|
113
|
+
<path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
|
|
114
|
+
<path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
|
|
115
|
+
<path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
|
|
116
|
+
</symbol>`,S9=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
|
|
117
|
+
<path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
|
|
118
|
+
<path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
|
|
119
|
+
</symbol>`,C9=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
|
|
120
|
+
<path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
|
|
121
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
|
|
122
|
+
</symbol>`,w9=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
|
|
123
|
+
<path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
|
|
124
|
+
</symbol>`,T9=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
|
|
125
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
|
|
126
|
+
</symbol>`,E9=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
|
|
127
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
|
|
128
|
+
</symbol>`,D9=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
|
|
129
|
+
<path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
|
|
130
|
+
<path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
|
|
131
|
+
</symbol>`,O9=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
|
|
132
|
+
<path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
|
|
133
|
+
</symbol>`,k9=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
|
|
134
|
+
<path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
|
|
135
|
+
<path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
|
|
136
|
+
</symbol>`,A9=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
|
|
137
|
+
<path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
|
|
138
|
+
<path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
|
|
139
|
+
</symbol>`,j9=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
|
|
140
|
+
<path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
|
|
141
|
+
</symbol>`,M9=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
|
|
142
|
+
<path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
|
|
143
|
+
<path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
144
|
+
</symbol>`,N9=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
|
|
145
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
|
|
146
|
+
</symbol>`,P9=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
|
|
147
|
+
<path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
|
|
148
|
+
</symbol>`,F9=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
|
|
149
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
|
|
150
|
+
<path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
|
|
151
|
+
</symbol>`,I9=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
|
|
152
|
+
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
153
|
+
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
|
|
154
|
+
</symbol>`,L9=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
|
|
155
|
+
<path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
|
|
156
|
+
</symbol>`,R9=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
|
|
157
|
+
<path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
|
|
158
|
+
<path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
|
|
159
|
+
<path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
|
|
160
|
+
</symbol>`,z9=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
|
|
161
|
+
<path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
|
|
162
|
+
<path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
|
|
163
|
+
</symbol>`,B9=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
|
|
164
|
+
<path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
|
|
165
|
+
<path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
|
|
166
|
+
<path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
|
|
167
|
+
</symbol>`,V9=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
|
|
168
|
+
<path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
|
|
169
|
+
<path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
|
|
170
|
+
</symbol>`,H9=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
|
|
171
|
+
<path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
|
|
172
|
+
</symbol>`,U9=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
|
|
173
|
+
<path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
|
|
174
|
+
<path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
|
|
175
|
+
</symbol>`,W9=[J7,$7,t9,n9,r9,i9,s9,c9,l9,d9,f9,p9,m9,h9,g9,S9,w9,T9,j9,M9,F9,I9,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
|
|
176
|
+
<path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
|
|
177
|
+
<path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
|
|
178
|
+
</symbol>`],G9=[K7,q7,Y7,X7,Z7,Q7,e9,a9,o9,u9,_9,v9,y9,b9,x9,C9,E9,D9,O9,k9,A9,N9,P9,L9,R9,z9,B9,V9,H9,U9];function K9(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
|
|
179
|
+
`)}\n</svg>`)}var q9=K9(G7,W9),J9={minimal:G7,standard:q9,complete:K9(q9,G9)},Y9={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},X9={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},Z9={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},Q9=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),$9=new Set([`complete`]);function eS(e){return J9[e===`none`?`minimal`:e]}function tS(e){return`file-tree-builtin-${e}`}function nS(e){return e!==`none`&&$9.has(e)}function rS(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=Y9[t.toLowerCase()];if(i!=null&&(r||Q9.has(i)))return i;for(let e of n){if(r){let t=Z9[e];if(t!=null)return t}let t=X9[e];if(t!=null&&(r||Q9.has(t)))return t}return`default`}function iS(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function aS(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(iS(e)?`none`:`complete`),colored:e.colored??!0}}var oS=e=>e.trim().toLowerCase(),sS=e=>e.split(`/`).at(-1)??e,cS=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function lS(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function uS(e){let t=aS(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(oS(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=sS(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return lS(l,e);for(let[t,n]of a)if(c.includes(t))return lS(n,e);let u=cS(s);for(let t of u){let n=i.get(t);if(n!=null)return lS(n,e)}let d=rS(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return lS(t,e)}return{name:tS(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:lS(s,e)}}}var dS={set:`complete`,colored:!0},fS=uS(dS),pS={gray:[`#84848a`,`#adadb1`],red:[`#d52c36`,`#ff6762`],vermilion:[`#ff8c5b`,`#d5512f`],orange:[`#d47628`,`#ffa359`],yellow:[`#d5a910`,`#ffd452`],green:[`#199f43`,`#5ecc71`],teal:[`#17a5af`,`#64d1db`],cyan:[`#1ca1c7`,`#68cdf2`],blue:[`#1a85d4`,`#69b1ff`],indigo:[`#693acf`,`#9d6afb`],purple:[`#a631be`,`#d568ea`],pink:[`#d32a61`,`#ff678d`],mauve:[`#594c5b`,`#79697b`]},mS={astro:`purple`,babel:`yellow`,bash:`green`,biome:`blue`,bootstrap:`indigo`,browserslist:`yellow`,bun:`mauve`,c:`blue`,cpp:`blue`,claude:`orange`,css:`indigo`,database:`purple`,docker:`blue`,eslint:`indigo`,git:`vermilion`,go:`cyan`,graphql:`pink`,html:`orange`,image:`pink`,javascript:`yellow`,json:`orange`,markdown:`green`,mcp:`teal`,npm:`red`,oxc:`cyan`,postcss:`red`,prettier:`teal`,python:`blue`,react:`cyan`,ruby:`red`,rust:`orange`,sass:`pink`,svg:`orange`,svelte:`red`,svgo:`green`,swift:`orange`,table:`teal`,tailwind:`cyan`,terraform:`indigo`,typescript:`blue`,vite:`purple`,vscode:`blue`,vue:`green`,wasm:`indigo`,webpack:`blue`,yml:`red`,zig:`orange`,zip:`orange`},hS=`forge-file-icon-sprite`;function gS(){if(typeof document>`u`||!document.body||document.getElementById(hS))return;let e=document.createElement(`div`);e.id=hS,e.setAttribute(`aria-hidden`,`true`),e.style.cssText=`position:absolute;width:0;height:0;overflow:hidden;pointer-events:none`,e.innerHTML=eS(`complete`),document.body.prepend(e)}function _S(e){let t=fS.resolveIcon(`file-tree-icon-file`,e);return t?{name:t.name,token:t.token??(t.name===`file-tree-builtin-image`?`image`:`default`),viewBox:t.viewBox??`0 0 16 16`}:null}var vS=b.memo(function({path:e,kind:t=`file`,className:n}){let r=qu();if(gS(),t===`directory`)return(0,x.jsx)(Bf,{className:K(`size-4 shrink-0 text-icon-muted`,n)});let i=_S(e);if(!i)return(0,x.jsx)(Af,{className:K(`size-4 shrink-0 text-icon-muted`,n)});let a=pS[mS[i.token]||`gray`];return(0,x.jsx)(`svg`,{"aria-hidden":`true`,"data-file-icon":i.name,className:K(`size-4 shrink-0`,n),style:{color:a[+!!r]},viewBox:i.viewBox,children:(0,x.jsx)(`use`,{href:`#${i.name}`})})});function yS(){return(0,x.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.85`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,x.jsx)(`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`}),(0,x.jsx)(`path`,{d:`m3.3 7 8.7 5 8.7-5`}),(0,x.jsx)(`path`,{d:`M12 22V12`})]})}var bS=new Set;function xS(e){bS.add(e)}function SS({seg:e,skillInfo:t}){if(e.type===`reference`)return(0,x.jsx)(CS,{id:e.id});let n=e.type===`mention`?T7(e.path)||e.path:e.name,r=e.type===`mention`&&(/[\\/]$/.test(e.path)||bS.has(e.path));return(0,x.jsx)(Gb,{label:e.type===`mention`?e.path:t||`Skill ${e.name}`,children:(0,x.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-[0.2em] align-baseline leading-[normal] font-medium text-foreground [&_svg]:block [&_svg]:size-[1em] [&_svg]:shrink-0 [&_svg]:self-center`,"aria-label":e.type===`mention`?`File ${e.path}`:`Skill ${e.name}`,children:[e.type===`mention`?(0,x.jsx)(vS,{path:e.path,kind:r?`directory`:`file`,className:`size-[1em]`}):(0,x.jsx)(yS,{}),(0,x.jsx)(`span`,{className:`block min-w-0 truncate`,children:n})]})})}function CS({id:e}){let t=wS.get(e);return(0,x.jsx)(Gb,{label:t?`Reference: ${t}`:`Reference ${e}`,children:(0,x.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-[0.2em] align-baseline leading-[normal] font-medium text-[oklch(0.58_0.16_292)] dark:text-[oklch(0.74_0.13_292)] [&_svg]:block [&_svg]:size-[1em] [&_svg]:shrink-0 [&_svg]:self-center`,"aria-label":`Reference ${e}`,children:[(0,x.jsx)(mp,{}),(0,x.jsx)(`span`,{className:`block min-w-0 truncate`,children:e})]})})}var wS=new Map;function TS(e){let t=``;return e.childNodes.forEach(e=>{e.nodeType===Node.TEXT_NODE?t+=e.data:e instanceof HTMLElement&&(e.dataset.source===void 0?e.tagName===`BR`?t+=`
|
|
180
|
+
`:((e.tagName===`DIV`||e.tagName===`P`)&&t&&!t.endsWith(`
|
|
181
|
+
`)&&(t+=`
|
|
182
|
+
`),t+=TS(e)):t+=e.dataset.source)}),t}var ES=b.forwardRef(function(e,t){let{value:n,onChange:r,onCaret:i,skills:a}=e,o=b.useRef(null),[s,c]=b.useState([]),l=b.useRef(null),u=b.useMemo(()=>a?new Set(a.keys()):void 0,[a]),d=b.useRef(``),f=b.useCallback(()=>{let e=o.current,t=window.getSelection();if(!e||!t||!t.rangeCount||!e.contains(t.anchorNode))return TS(e||document.body).length;let n=document.createRange();return n.setStart(e,0),n.setEnd(t.anchorNode,t.anchorOffset),TS(n.cloneContents()).length},[]),p=b.useCallback(e=>{let t=o.current;if(!t)return;let n=window.getSelection();if(!n)return;let r=document.createRange(),i=0,a=!1;for(let n of Array.from(t.childNodes))if(n.nodeType===Node.TEXT_NODE){let t=n.data.length;if(e<=i+t){r.setStart(n,e-i),a=!0;break}i+=t}else if(n instanceof HTMLElement&&n.dataset.source!==void 0){if(e<=i){r.setStartBefore(n),a=!0;break}if(i+=n.dataset.source.length,e<=i){r.setStartAfter(n),a=!0;break}}a?r.collapse(!0):(r.selectNodeContents(t),r.collapse(!1)),n.removeAllRanges(),n.addRange(r)},[]),m=b.useCallback(e=>{let t=o.current;if(!t)return;let n=I7(e,u),r=[],i=document.createDocumentFragment();for(let e of n)if(e.type===`text`)i.appendChild(document.createTextNode(e.text));else{let t=document.createElement(`span`);t.contentEditable=`false`,t.dataset.source=e.source,t.dataset.chip=e.type,t.className=`inline-block max-w-full align-baseline select-none`,i.appendChild(t),r.push({el:t,seg:e})}t.replaceChildren(i),l.current=e,d.current=r.map(e=>e.seg.source).join(`\0`),c(r)},[u]);return b.useLayoutEffect(()=>{if(l.current===n)return;let e=document.activeElement===o.current;m(n),e&&p(n.length)},[n,m,p]),b.useLayoutEffect(()=>{if(l.current===null||I7(l.current,u).filter(e=>e.type!==`text`).map(e=>e.source).join(`\0`)===d.current)return;let e=document.activeElement===o.current,t=e?f():0;m(l.current),e&&p(t)},[u,m,p,f]),b.useImperativeHandle(t,()=>({focus:()=>{o.current?.focus(),l.current!==null&&!o.current?.contains(window.getSelection()?.anchorNode||null)&&p(l.current.length)},caret:f,setText:(e,t)=>{m(e),o.current?.focus(),p(t??e.length),r(e,t??e.length)},element:()=>o.current}),[f,p,m,r]),b.useEffect(()=>{e.autoFocus&&(o.current?.focus(),p(l.current?.length??0))},[]),b.useEffect(()=>{let e=()=>{document.activeElement===o.current&&i?.(f())};return document.addEventListener(`selectionchange`,e),()=>document.removeEventListener(`selectionchange`,e)},[i,f]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{ref:o,role:`combobox`,"aria-multiline":`true`,"aria-autocomplete":`list`,"aria-expanded":!!e.menuOpen,"aria-controls":e.menuOpen?e.ariaControls:void 0,"aria-activedescendant":e.ariaActiveDescendant,"aria-label":`Message`,contentEditable:`plaintext-only`,suppressContentEditableWarning:!0,spellCheck:!0,"data-placeholder":e.placeholder,"data-empty":n?void 0:``,onInput:()=>{let e=o.current;if(!e)return;let t=TS(e),n=f();I7(t,u).filter(e=>e.type!==`text`).map(e=>e.source).join(`\0`)===Array.from(e.querySelectorAll(`[data-source]`)).map(e=>e.dataset.source).join(`\0`)?(l.current=t,!t&&e.childNodes.length&&e.replaceChildren()):(m(t),p(n)),r(t,n)},onKeyDown:e.onKeyDown,onBlur:e.onBlur,onPaste:t=>{t.preventDefault();let n=t.clipboardData.getData(`text/plain`);e.onPasteIntake?.(t.clipboardData,n)||document.execCommand(`insertText`,!1,n)},onDrop:e=>e.preventDefault(),className:e.className}),s.map((e,t)=>(0,P1.createPortal)((0,x.jsx)(SS,{seg:e.seg,skillInfo:e.seg.type===`skill`?a?.get(e.seg.name):void 0}),e.el,`${t}:${e.seg.source}`))]})});function DS({part:e}){let t=`${T7(e.filePath)} ${e.rangeLabel}`.trim();return(0,x.jsx)(Gb,{side:`top`,label:(0,x.jsxs)(`span`,{className:`block max-w-72 space-y-1.5 py-0.5`,children:[(0,x.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.filePath}),(0,x.jsx)(`span`,{className:`block text-muted-foreground`,children:e.rangeLabel}),(0,x.jsx)(`span`,{className:`block whitespace-pre-wrap text-foreground`,children:e.comment})]}),children:(0,x.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-[0.2em] align-baseline leading-[normal] font-medium text-[oklch(0.62_0.16_292)] [&_svg]:size-[1em] [&_svg]:shrink-0`,"aria-label":`Review comment, ${t}`,children:[(0,x.jsx)(Mp,{"aria-hidden":`true`}),(0,x.jsx)(`span`,{className:`truncate`,children:t})]})})}function OS({text:e,names:t,skills:n}){let r=b.useMemo(()=>{let n=I7(`${e} `,t),r=n[n.length-1];return r?.type===`text`&&(r.text===` `?n.pop():n[n.length-1]={type:`text`,text:r.text.slice(0,-1)}),n},[e,t]);return(0,x.jsx)(x.Fragment,{children:r.map((e,t)=>e.type===`text`?(0,x.jsx)(b.Fragment,{children:e.text},t):(0,x.jsx)(`span`,{className:`inline-block max-w-full align-baseline`,children:(0,x.jsx)(SS,{seg:e,skillInfo:e.type===`skill`?n?.get(e.name):void 0})},t))})}function kS({text:e,skills:t}){let n=b.useMemo(()=>t?new Set(t.keys()):void 0,[t]),r=b.useMemo(()=>W7(e),[e]);return(0,x.jsx)(x.Fragment,{children:r.map((e,r)=>e.type===`text`?(0,x.jsx)(OS,{text:e.text,names:n,skills:t},r):(0,x.jsx)(`span`,{className:`me-3 inline-block max-w-full align-baseline`,children:(0,x.jsx)(DS,{part:e})},r))})}var AS=[`image/gif`,`image/jpeg`,`image/png`,`image/webp`],jS=`forge-attachment:`,MS=/^att-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function NS(e){return AS.includes(String(e).toLowerCase())}function PS(e){let t=String(e||``);if(!t.startsWith(`forge-attachment:`))return null;let n=t.slice(17);return MS.test(n)?n:null}function FS(e){if(e.length>100)return`You can attach up to 100 files per message.`;if(e.reduce((e,t)=>e+(t.type===`image`||NS(t.mimeType)?t.sizeBytes:0),0)>83886080)return`Images can total up to 80 MiB per message. Use smaller images or send fewer at once.`}function IS(e,t=!1){return e.length?t||e.length>=32768||new TextEncoder().encode(e).byteLength>=32768:!1}function LS(e){let t=new Set(e.map(e=>e.toLowerCase()));if(!t.has(`pasted-text.txt`))return`pasted-text.txt`;for(let e=2;;e++)if(!t.has(`pasted-text-${e}.txt`))return`pasted-text-${e}.txt`}function RS(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(+(e<10240))} KB`:`${(e/1024/1024).toFixed(1)} MB`}function zS({projectId:e,ids:t,title:n,className:r,variant:i=`overlay`}){let a=ku(),o=C(),s=W(a.refs.fromAttachments.mutationOptions()),[c,l]=b.useState(null),u=c?`Saved as reference ${c} (open References)`:s.error?s.error.message:`Save to references`;return(0,x.jsx)(Gb,{label:u,children:(0,x.jsx)(`button`,{type:`button`,"aria-label":u,disabled:!t.length||s.isPending,onPointerDown:e=>e.preventDefault(),onClick:()=>{if(c)return Uu({panelOpen:!0,panelTab:`refs`});s.mutate({projectId:e,attachmentIds:t,...n?{title:n}:{}},{onSuccess:e=>{l(e.id),o.invalidateQueries({queryKey:a.refs.list.pathKey()})}})},className:K(`flex size-5 cursor-pointer items-center justify-center rounded-md transition-colors disabled:opacity-60 [&_svg]:size-3`,i===`overlay`?`bg-background/85 text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-accent hover:text-foreground`,s.error&&`text-destructive-foreground`,r),children:c?(0,x.jsx)(Cd,{}):s.error?(0,x.jsx)(Zd,{}):(0,x.jsx)(Td,{})})})}function BS({items:e,projectId:t,onRemove:n,error:r}){let i=e.filter(e=>e.type===`image`),a=e.filter(e=>e.type===`file`);return!e.length&&!r?null:(0,x.jsxs)(`div`,{className:`px-4 pt-3`,children:[i.length>0&&(0,x.jsx)(`div`,{className:`mb-3 flex max-w-full flex-wrap gap-2`,children:i.map(e=>(0,x.jsxs)(`div`,{className:`group/attachment relative h-16 w-16 shrink-0 overflow-hidden rounded-lg border border-border/80 bg-background`,title:e.error||e.name,children:[e.previewUrl?(0,x.jsx)(`img`,{src:e.previewUrl,alt:e.name,className:`h-full w-full object-cover`}):(0,x.jsx)(`span`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:(0,x.jsx)(ip,{className:`size-4`})}),e.status===`uploading`&&(0,x.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 bottom-0 bg-background/85 px-1 text-center text-3xs text-foreground`,children:`Preparing`}),e.status===`failed`&&(0,x.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center bg-background/70 text-destructive-foreground`,children:(0,x.jsx)(Zd,{className:`size-4`})}),t&&e.status===`ready`&&e.id&&(0,x.jsx)(zS,{projectId:t,ids:[e.id],className:`absolute bottom-1 left-1 opacity-0 transition-opacity group-hover/attachment:opacity-100 focus-visible:opacity-100`}),(0,x.jsx)(`span`,{className:`absolute top-1 right-1 flex`,children:(0,x.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,onPointerDown:e=>e.preventDefault(),onClick:()=>n(e.key),className:`flex size-5 cursor-pointer items-center justify-center rounded-md bg-background/85 text-foreground shadow-xs hover:bg-background [&_svg]:size-3`,children:(0,x.jsx)(Oh,{})})})]},e.key))}),a.length>0&&(0,x.jsx)(`div`,{className:`mb-3 flex flex-col gap-1`,children:a.map(e=>(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 py-1 text-sm text-foreground`,children:[(0,x.jsx)(vS,{path:e.name,className:`size-4`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.error||e.name,children:e.name}),(0,x.jsx)(`span`,{className:K(`shrink-0 text-xs tabular-nums`,e.status===`failed`?`text-destructive-foreground`:`text-muted-foreground`),children:e.status===`uploading`?`Preparing`:e.status===`failed`?`Failed`:e.source===`pasted-text`?`Pasted text · ${RS(e.sizeBytes)}`:RS(e.sizeBytes)}),t&&e.status===`ready`&&e.id&&(0,x.jsx)(zS,{projectId:t,ids:[e.id],variant:`ghost`,className:`size-6`}),(0,x.jsx)(J,{variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${e.name}`,onPointerDown:e=>e.preventDefault(),onClick:()=>n(e.key),children:(0,x.jsx)(Oh,{})})]},e.key))}),r&&(0,x.jsx)(`div`,{className:`mb-2 text-xs text-destructive-foreground`,children:r})]})}function VS(e,t){return`/api/attachments/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}function HS(e){return PS(e.url)}async function US(e,t,n){let r=await fetch(`/api/attachments/${encodeURIComponent(e)}`,{method:`POST`,headers:{"x-forge-token":_u(),"content-type":t.type||`application/octet-stream`,"x-forge-name":encodeURIComponent(t.name||`file`),...n?{"x-forge-source":n}:{}},body:t}),i=await r.json().catch(()=>({}));if(!r.ok)throw Error(i.message||`Upload failed (${r.status})`);return i}var WS=0;function GS(e){let[t,n]=b.useState([]),[r,i]=b.useState(null),a=b.useRef(t);a.current=t;let o=(e,t)=>n(n=>{let r=n.map(n=>n.key===e?{...n,...t}:n);return a.current=r,r});return{list:t,error:r,add:(t,r)=>{if(!e||!t.length)return!1;let s=a.current.length,c=null,l=[];for(let n of t){let t=NS(n.type);if(s>=100){c=`You can attach up to 100 files per message.`;continue}if(/^image\//i.test(n.type)&&!t){c=`'${n.name}' is not a supported image type. Attach GIF, JPEG, PNG, or WebP images.`;continue}if(n.size<=0){c=`'${n.name}' is empty or could not be read.`;continue}if(n.size>(t?0xa00000:52428800)){c=`'${n.name}' is too large to attach (${t?`images up to 10 MB`:`files up to 50 MB`}).`;continue}let i={key:`a${Date.now()}-${++WS}`,type:t?`image`:`file`,name:n.name||(t?`image.png`:`file`),mimeType:n.type||`application/octet-stream`,sizeBytes:n.size,status:`uploading`,...t?{previewUrl:URL.createObjectURL(n)}:{},...r?{source:r}:{}},u=FS([...a.current,...l,i]);u?(c=u,i.previewUrl&&URL.revokeObjectURL(i.previewUrl)):(l.push(i),s++,US(e,n,r).then(e=>o(i.key,{status:`ready`,id:e.id,name:e.name}),e=>o(i.key,{status:`failed`,error:String(e.message||e)})))}return i(c),l.length&&n(e=>{let t=[...e,...l];return a.current=t,t}),l.length>0},remove:e=>n(t=>{let n=t.find(t=>t.key===e);n?.previewUrl&&URL.revokeObjectURL(n.previewUrl);let r=t.filter(t=>t.key!==e);return a.current=r,r}),take:()=>{let e=a.current.filter(e=>e.status===`ready`&&e.id).map(e=>({type:`file`,mediaType:e.mimeType,filename:e.name,url:`${jS}${e.id}`}));for(let e of a.current)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);return a.current=[],n([]),i(null),e},uploading:t.some(e=>e.status===`uploading`),ready:t.filter(e=>e.status===`ready`).length,clearError:()=>i(null)}}var KS=[{command:`model`,description:`Switch response model for this chat`},{command:`plan`,description:`Toggle plan mode: investigate read-only, then propose a plan`,startOnly:!0},{command:`clear`,description:`Start a new chat; this one stays in the sidebar`,startOnly:!0},{command:`compact`,description:`Compact the history now; the newest four turns stay`,startOnly:!0},{command:`push`,description:`Plan a push: dry run, then review`,startOnly:!0},{command:`usage`,description:`Show usage and spend`,startOnly:!0}],qS=new Set([`clear`,`compact`,`model`,`plan`,`login`,`logout`,`exit`,`quit`,`config`]),JS=80;function YS(e,t){let[n,r]=b.useState(e);return b.useEffect(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function XS(e){return U({...ku().composer.skills.queryOptions({projectId:e}),staleTime:3e4})}function ZS(e){let t=ku(),n=e.trigger?.kind??null,r=n===`path`?e.trigger.query:``,i=YS(r,120),a=n===`path`&&!!e.projectId,o=U({...t.files.search.queryOptions({projectId:e.projectId||``,query:i.trim()}),enabled:a&&!!i.trim(),staleTime:5e3}),s=U({...t.files.tree.queryOptions({projectId:e.projectId||``,path:``}),enabled:a&&!r.trim(),staleTime:5e3}),c=U({...t.refs.list.queryOptions({projectId:e.projectId||``}),enabled:a,staleTime:5e3}),l=U({...t.composer.claudeCommands.queryOptions(),enabled:e.claude&&n===`slash-command`});return{items:(()=>{if(!e.trigger)return[];if(e.trigger.kind===`path`){let e=r.trim()?i===r?(o.data?.entries||[]).slice(0,JS):[]:(s.data||[]).map(e=>({path:e.path,kind:e.type===`dir`?`directory`:`file`})),t=r.trim().toLowerCase().replace(/^ref:/,``);return[...(c.data?.refs||[]).filter(e=>!t||e.id.includes(t)||e.title.toLowerCase().includes(t)).slice(0,5).map(e=>({id:`ref:${e.id}`,type:`reference`,refId:e.id,label:`ref:${e.id}`,description:`${e.title} · ${e.kind}`})),...e.map(e=>({id:`path:${e.kind}:${e.path}`,type:`path`,path:e.path,kind:e.kind,label:T7(e.path),description:e.path.slice(0,Math.max(0,e.path.lastIndexOf(`/`)))}))]}if(e.trigger.kind===`skill`)return B7(e.skills||[],e.trigger.query,V7,e=>e.name).map(e=>({id:`skill:${e.name}`,type:`skill`,skill:e,label:e.name,description:e.description}));let t=e.trigger.rangeStart===0,n=KS.filter(n=>(t||!n.startOnly)&&(n.command!==`compact`||e.canCompact)&&(n.command!==`push`||e.canPush)).map(e=>({id:`slash:${e.command}`,type:`command`,command:e.command,label:`/${e.command}`,description:e.description})),a=e.claude&&t?(l.data||[]).filter(t=>!qS.has(t)&&!(e.skills||[]).some(e=>e.name===t)).map(e=>({id:`provider-slash-command:${e}`,type:`provider-command`,name:e,label:`/${e}`,description:`Claude Code command`})):[],u=(e.skills||[]).map(e=>({id:`skill:${e.name}`,type:`skill`,skill:e,label:`/skill:${e.name}`,description:e.description,viaSlash:!0})),d=e.trigger.query.trim().toLowerCase();if(!d)return[...n,...a,...u];let f=[];for(let e of[...n,...a,...u]){let t;if(e.type===`skill`){let n=d.startsWith(`skill:`)?d.slice(6):d;t=d===`skill`?0:n?V7(e.skill,n):0,t===null&&`skill`.startsWith(d)&&(t=2**53-1)}else t=H7({name:e.type===`command`?e.command:e.label.slice(1),description:e.description},d);if(t===null)continue;let n=e.type===`command`?0:e.type===`provider-command`?1:2;f.push({item:e,score:t,key:`${n}\u0000${e.label}`})}return f.sort((e,t)=>e.score-t.score||e.key.localeCompare(t.key)),f.map(e=>e.item)})(),isLoading:n===`path`&&(r.trim()?i!==r||o.isPending:s.isPending)||(n===`skill`||n===`slash-command`)&&e.skillsLoading,emptyText:n===`skill`?`No skills found. Try / to browse commands.`:n===`path`?`No matching files or folders.`:`No matching command.`}}var QS={model:Dd,plan:gp,clear:nh,compact:Rp,push:Sh,usage:Fd},$S={project:{icon:Bf,label:`Project`,skillLabel:`Project Skill`},personal:{icon:wh,label:`Personal`,skillLabel:`Personal Skill`},rpf:{icon:Qp,label:`rpf`,skillLabel:`rpf Skill`}},eC={path:`Files and folders`,"slash-command":`Commands`,skill:`Skills`};function tC(e,t){return`${e}-${encodeURIComponent(t)}`}function nC(e){let t=b.useRef(null);return b.useLayoutEffect(()=>{e.activeId&&t.current&&t.current.querySelector(`[data-item-id="${CSS.escape(e.activeId)}"]`)?.scrollIntoView({block:`nearest`})},[e.activeId]),(0,x.jsx)(`div`,{className:`composer-menu-surface absolute inset-x-[1.375rem] bottom-[calc(100%-1rem-1px)] z-0 flex max-h-[min(22rem,50vh)] flex-col overflow-hidden rounded-t-2xl pb-[calc(1rem+1px)]`,"data-composer-menu":``,children:e.items.length>0?(0,x.jsx)(`div`,{ref:t,id:e.listId,role:`listbox`,"aria-label":e.triggerKind?eC[e.triggerKind]:void 0,className:`max-h-72 min-h-0 scroll-py-1 overflow-y-auto p-1`,children:e.items.map(t=>(0,x.jsx)(rC,{id:tC(e.listId,t.id),item:t,triggerKind:e.triggerKind,active:e.activeId===t.id,onHighlight:e.onHighlight,onSelect:e.onSelect},t.id))}):(0,x.jsx)(`div`,{className:`px-5 pt-3.5 pb-4`,children:(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.isLoading?e.triggerKind===`path`?`Searching workspace files...`:`Searching workspace skills...`:e.emptyText})})})}function rC({id:e,item:t,triggerKind:n,active:r,onHighlight:i,onSelect:a}){let o=b.useRef(null),[s,c]=b.useState(!1);b.useLayoutEffect(()=>{let e=o.current;c(r&&!!e&&e.scrollWidth>e.clientWidth)},[r]);let l=t.type===`command`?QS[t.command]:t.type===`provider-command`?mh:null,u=t.type===`skill`?$S[t.skill.source]:null,d=(0,x.jsx)(`span`,{ref:o,className:`min-w-0 flex-1 truncate text-left text-xs text-muted-foreground`,children:t.description});return(0,x.jsxs)(`div`,{id:e,role:`option`,"aria-selected":r,"data-item-id":t.id,"data-active":r||void 0,className:K(`flex min-h-8 cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none select-none sm:min-h-7`,r&&`bg-accent text-accent-foreground`),onMouseMove:()=>{r||i(t.id)},onMouseDown:e=>e.preventDefault(),onClick:()=>a(t),children:[t.type===`path`?(0,x.jsx)(vS,{path:t.path,kind:t.kind}):null,t.type===`reference`?(0,x.jsx)(mp,{"aria-hidden":`true`,className:`size-4 shrink-0 text-[oklch(0.62_0.16_292)]`}):null,l?(0,x.jsx)(l,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}):null,(0,x.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`max-w-[45%] min-w-0 shrink-0 truncate font-sans text-xs font-medium`,children:t.type===`skill`&&t.viaSlash?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`/skill:`}),t.skill.name]}):t.label}),s?(0,x.jsx)(Gb,{label:(0,x.jsx)(`span`,{className:`block max-w-80`,children:t.description}),side:`top`,children:d}):d,u?(0,x.jsxs)(`span`,{className:`ms-auto inline-flex h-[18px] shrink-0 items-center gap-1 rounded-sm bg-secondary px-1 text-xs font-medium whitespace-nowrap text-secondary-foreground [&_svg]:size-3 [&_svg]:opacity-80`,children:[(0,x.jsx)(u.icon,{"aria-hidden":`true`}),n===`skill`?u.skillLabel:u.label]}):null]})]})}var iC=new Map,aC=new Set,oC=[];function sC(){for(let e of aC)e()}var cC=0;function lC(){return cC+=1,`file-comment-${Date.now()}-${cC}`}function uC(e,t){let n=iC.get(e)||[],r=n.findIndex(e=>e.id===t.id);iC.set(e,r<0?[...n,t]:n.map((e,n)=>n===r?t:e)),sC()}function dC(e,t){let n=iC.get(e);n?.some(e=>e.id===t)&&(iC.set(e,n.filter(e=>e.id!==t)),sC())}function fC(e){let t=iC.get(e)||oC;return t.length&&(iC.delete(e),sC()),t}function pC(e){return(0,b.useSyncExternalStore)(e=>(aC.add(e),()=>aC.delete(e)),()=>e&&iC.get(e)||oC)}var mC=null;function hC(e){return mC=e,()=>{mC===e&&(mC=null)}}function gC(e){return mC?mC(e):!1}function _C(e,t){return e===t?`L${e}`:`L${e} to L${t}`}function vC(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase(),n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1):t.startsWith(`.`)&&t.length>1?t.slice(1):`text`}function yC(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`)}function bC(e){let t=Math.max(0,...Array.from(e.lines.matchAll(/`+/g),e=>e[0].length)),n="`".repeat(Math.max(3,t+1));return[`<review_comment sectionId="${yC(`file:${e.filePath}`)}" sectionTitle="File comment" filePath="${yC(e.filePath)}" startIndex="${e.startLine-1}" endIndex="${e.endLine-1}" rangeLabel="${yC(_C(e.startLine,e.endLine))}">`,e.text.trim(),`${n}${vC(e.filePath)}`,e.lines.trimEnd(),n,`</review_comment>`].join(`
|
|
183
|
+
`)}function xC(e,t){return t.length?[e.trim(),...t.map(bC)].filter(Boolean).join(`
|
|
184
|
+
|
|
185
|
+
`):e}function SC({className:e}){let t=Array.from({length:12},(e,t)=>{let n=t*30*Math.PI/180,r=t%2==0?11:9,i=1.55,a=Math.cos(n),o=Math.sin(n),s=-o*i,c=a*i,l=2.2;return`M${(12+a*l+s).toFixed(2)} ${(12+o*l+c).toFixed(2)}L${(12+a*r).toFixed(2)} ${(12+o*r).toFixed(2)}L${(12+a*l-s).toFixed(2)} ${(12+o*l-c).toFixed(2)}Z`}).join(``);return(0,x.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":!0,className:K(`text-[#d97757]`,e),children:[(0,x.jsx)(`path`,{d:t,fill:`currentColor`,strokeLinejoin:`round`,stroke:`currentColor`,strokeWidth:`0.6`}),(0,x.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2.6`,fill:`currentColor`})]})}function CC({className:e}){return(0,x.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":!0,className:K(`text-foreground`,e),children:[(0,x.jsx)(`path`,{d:`M3 20 8.6 4h2.8L17 20h-3l-1.25-3.7H7.25L6 20Zm5.1-6.3h3.8L10 8.1Z`,fill:`currentColor`}),(0,x.jsx)(`path`,{d:`M14.6 4h2.8L23 20h-3Z`,fill:`currentColor`})]})}function wC({className:e}){let t=Array.from({length:6},(e,t)=>(0,x.jsx)(`rect`,{x:`9.6`,y:`2.6`,width:`4.8`,height:`10.4`,rx:`2.4`,transform:`rotate(${t*60} 12 12)`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`},t));return(0,x.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":!0,className:K(`text-foreground`,e),children:t})}function TC({className:e}){let t=b.useId();return(0,x.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":!0,className:e,children:[(0,x.jsx)(`defs`,{children:(0,x.jsxs)(`linearGradient`,{id:t,x1:`4`,y1:`20`,x2:`20`,y2:`4`,gradientUnits:`userSpaceOnUse`,children:[(0,x.jsx)(`stop`,{offset:`0`,stopColor:`#4285f4`}),(0,x.jsx)(`stop`,{offset:`1`,stopColor:`#9b72cb`})]})}),(0,x.jsx)(`path`,{d:`M12 1.5C12.9 7 17 11.1 22.5 12 17 12.9 12.9 17 12 22.5 11.1 17 7 12.9 1.5 12 7 11.1 11.1 7 12 1.5Z`,fill:`url(#${t})`})]})}function EC({className:e}){return(0,x.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":!0,className:K(`text-foreground`,e),children:[(0,x.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`20`,rx:`5`,fill:`currentColor`}),(0,x.jsx)(`path`,{d:`M7.5 7.5h9v2.1l-6 5.1h6v1.8h-9v-2.1l6-5.1h-6Z`,className:`fill-background`})]})}var DC={"claude-subscription":SC,anthropic:CC,openai:wC,google:TC,zai:EC};function OC(e){let t=e.replace(/[^\p{L}\p{N}'’\s]+/gu,` `).split(/\s+/).map(e=>e.replace(/^['’]+|['’]+$/g,``)).filter(Boolean);return t.length===1&&(t=t[0].replace(/(\p{Ll})(\p{Lu})/gu,`$1 $2`).split(` `)),t.length?t.length===1?Array.from(t[0]).slice(0,2).join(``).toUpperCase():t.slice(0,2).map(e=>(Array.from(e)[0]||``).toUpperCase()).join(``):``}function kC(e){let t=e?.trim();return t&&/^#[0-9a-fA-F]{6}$/.test(t)?t:void 0}function AC(e){let t=t=>{let n=parseInt(e.slice(t,t+2),16)/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4},n=.2126*t(1)+.7152*t(3)+.0722*t(5);return(n+.05)/.05>=1.05/(n+.05)?`#000000`:`#ffffff`}function jC({kind:e,className:t,name:n,accent:r,badge:i}){let a=DC[e||``],o=a?(0,x.jsx)(a,{className:K(`size-4 shrink-0`,t)}):e===`mock`?(0,x.jsx)(bm,{className:K(`size-4 shrink-0 text-muted-foreground`,t)}):(0,x.jsx)(Sm,{className:K(`size-4 shrink-0 text-muted-foreground`,t)}),s=kC(r);return!i||!n?o:(0,x.jsxs)(`span`,{className:`relative inline-flex shrink-0 items-center justify-center`,"data-provider-accent":s,children:[o,(0,x.jsx)(`span`,{"aria-hidden":!0,className:K(`pointer-events-none absolute -right-1 -bottom-1 flex h-3 min-w-3 items-center justify-center rounded-full border border-card px-0.5 text-[0.5rem] leading-none font-semibold shadow-sm`,!s&&`bg-card text-muted-foreground`),style:s?{backgroundColor:s,color:AC(s)}:void 0,children:OC(n)})]})}var MC=`inline-flex h-6 items-center gap-1 rounded-[var(--control-radius)] px-[7px] text-xs font-normal text-foreground/70 outline-none hover:bg-accent hover:text-foreground data-[popup-open]:bg-accent dark:text-muted-foreground [&_svg]:size-3.5`;function NC({kind:e,name:t,accent:n,badge:r}){return(0,x.jsx)(jC,{kind:e,name:t,accent:n,badge:r})}var PC=(e,t)=>e.find(e=>e.id===t)?.label||``;function FC({value:e,onChange:t,open:n,onOpenChange:r}){let i=U(ku().models.queryOptions()),a=i.data?.find(t=>t.connectionId===e?.connectionId),o=a?.models.find(t=>t.id===e?.model),s=a?.efforts||[],c=o?.defaultEffort||``,l=e?.effort||c;return i.data&&i.data.length===0?(0,x.jsxs)(E8,{section:`providers`,className:MC,children:[(0,x.jsx)(Dd,{}),` Connect a provider`]}):(0,x.jsxs)(Pb,{...n===void 0?{}:{open:n,onOpenChange:e=>r?.(e)},children:[(0,x.jsxs)(Fb,{className:K(MC,`max-w-48 sm:max-w-56`),children:[a?(0,x.jsx)(NC,{kind:a.kind,name:a.name,accent:a.accentColor,badge:a.badge}):(0,x.jsx)(Dd,{}),(0,x.jsx)(`span`,{className:`min-w-0 truncate`,children:o?.name||e?.model||`Choose a model`}),s.length>0&&l&&(0,x.jsx)(`span`,{className:`shrink-0 text-muted-foreground/80`,children:PC(s,l)}),(0,x.jsx)(Vd,{className:`!size-3 opacity-60`})]}),(0,x.jsx)(Ib,{side:`top`,align:`end`,className:K(`min-w-56`,s.length>0&&`p-0`),children:(0,x.jsxs)(`div`,{className:K(s.length>0&&`flex max-h-86.5`),children:[(0,x.jsx)(`div`,{className:K(s.length>0&&`min-w-56 overflow-y-auto p-1`),children:i.data?.map((n,r)=>(0,x.jsxs)(b.Fragment,{children:[r>0&&(0,x.jsx)(zb,{}),(0,x.jsxs)(Rb,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(NC,{kind:n.kind,name:n.name,accent:n.accentColor,badge:n.badge}),n.name,!n.ready&&(0,x.jsxs)(`span`,{className:`ml-1 text-warning-foreground`,children:[`· `,n.kind===`claude-subscription`?`not signed in`:`no key`]})]}),n.models.map(r=>{let i=e?.connectionId===n.connectionId&&e.model===r.id;return(0,x.jsxs)(Lb,{disabled:!n.ready,closeOnClick:!n.efforts?.length,onClick:()=>t({connectionId:n.connectionId,model:r.id,...i&&e?.effort?{effort:e.effort}:{}}),children:[(0,x.jsx)(`span`,{className:`flex-1`,children:r.name||r.id}),i&&(0,x.jsx)(zd,{className:`!text-foreground`})]},r.id)})]},n.connectionId))}),s.length>0&&e&&(0,x.jsxs)(`div`,{className:`flex w-48 shrink-0 flex-col border-l border-border/70 bg-muted/40 p-1`,children:[(0,x.jsxs)(`div`,{className:`flex h-8.25 items-center gap-2 border-b border-border/70 px-2 pb-1.5 text-sm`,children:[(0,x.jsx)(`span`,{className:`font-medium`,children:`Reasoning`}),(0,x.jsx)(`span`,{className:`ms-auto truncate text-xs text-muted-foreground`,children:o?.name||e.model})]}),(0,x.jsx)(`div`,{className:`flex flex-col pt-1`,children:s.map(n=>{let r=l===n.id;return(0,x.jsxs)(Lb,{onClick:()=>t({...e,effort:n.id===c?void 0:n.id}),className:`h-8 rounded-sm hover:bg-foreground/[0.09]`,title:n.description,children:[(0,x.jsx)(`span`,{className:`flex-1`,children:n.label}),n.id===c&&(0,x.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:`Default`}),r&&(0,x.jsx)(zd,{className:`!text-foreground`})]},n.id)})})]})]})})]})}function IC({value:e,onChange:t}){let n=e||{remoteWrites:!1,browserWrites:!1},r=n.remoteWrites||n.browserWrites?`Writes on`:`Safe`;return(0,x.jsxs)(Pb,{children:[(0,x.jsxs)(Fb,{className:MC,children:[n.remoteWrites||n.browserWrites?(0,x.jsx)(Km,{className:`!text-warning-foreground`}):(0,x.jsx)(Ep,{}),r,(0,x.jsx)(Vd,{className:`!size-3 opacity-60`})]}),(0,x.jsxs)(Ib,{side:`top`,align:`end`,className:`w-80`,children:[(0,x.jsx)(Rb,{children:`Safety for this chat`}),(0,x.jsx)(`div`,{className:`px-2 pb-2 text-xs leading-normal text-muted-foreground`,children:`File edits in the project run and can be undone. Deletes, commands outside the read-only list and every instance change wait for your approval.`}),(0,x.jsx)(zb,{}),(0,x.jsxs)(Lb,{disabled:!t,closeOnClick:!1,onClick:()=>t?.({...n,remoteWrites:!n.remoteWrites}),children:[(0,x.jsx)(Xm,{}),(0,x.jsxs)(`span`,{className:`flex-1`,children:[`Remote writes`,(0,x.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`Instance write tools, each approved after its dry run`})]}),(0,x.jsx)(RC,{on:n.remoteWrites})]}),(0,x.jsxs)(Lb,{disabled:!t,closeOnClick:!1,onClick:()=>t?.({...n,browserWrites:!n.browserWrites}),children:[(0,x.jsx)(Xm,{}),(0,x.jsxs)(`span`,{className:`flex-1`,children:[`Browser writes`,(0,x.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`The agent's browser may save, each write approved`})]}),(0,x.jsx)(RC,{on:n.browserWrites})]}),!t&&(0,x.jsx)(`div`,{className:`px-2 pt-1 pb-1.5 text-xs text-muted-foreground`,children:`Send a first message to change these for the chat.`})]})]})}function LC({value:e,onChange:t}){let n=e===`plan`;return(0,x.jsx)(Gb,{label:n?`Plan mode: the agent investigates read-only and ends with a plan for you to approve. Click for Build mode.`:`Build mode: the agent edits files (bigger requests start with a plan file). Click for Plan mode, or type /plan.`,children:(0,x.jsxs)(`button`,{type:`button`,disabled:!t,"aria-pressed":n,"aria-label":n?`Plan mode (switch to Build)`:`Build mode (switch to Plan)`,onClick:()=>t?.(n?`build`:`plan`),className:K(MC,n&&`!text-violet-600 dark:!text-violet-300/90`,`disabled:opacity-60`),children:[n?(0,x.jsx)(gp,{}):(0,x.jsx)(Xf,{}),n?`Plan`:`Build`]})})}function RC({on:e}){return(0,x.jsx)(`span`,{"aria-hidden":!0,className:K(`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors`,e?`bg-primary`:`bg-foreground/15`),children:(0,x.jsx)(`span`,{className:K(`absolute size-3 rounded-full bg-white shadow-xs transition-transform`,e?`translate-x-3.5`:`translate-x-0.5`)})})}function zC({onSend:e,onStop:t,running:n,model:r,onModel:i,pending:a,onAnswer:o,cost:s,costTip:c,context:l,onCompact:u,compacting:d,autoFocus:f,placeholder:p=`Ask anything. @ files, / commands`,initialText:m=``,banner:h,safety:g,onSafety:_,mode:v=`build`,onMode:y}){let[S,C]=b.useState(m),w=b.useRef(null),{projectId:T}=Ki({strict:!1}),E=pC(T),D=GS(T),O=b.useRef(null),k=b.useRef(!1),[A,j]=b.useState(!1);b.useEffect(()=>hC(e=>(C(t=>t&&!/\s$/.test(t)?`${t} ${e}`:t+e),w.current?.focus(),!0)),[]);let M=ku(),N=Ji(),P=T8(),F=U(M.models.queryOptions()),I=U({...M.refs.list.queryOptions({projectId:T||``}),enabled:!!T});for(let e of I.data?.refs||[])wS.set(e.id,e.title);let L=F.data?.find(e=>e.connectionId===r?.connectionId)?.kind===`claude-subscription`,R=XS(T),z=b.useMemo(()=>new Map((R.data||[]).map(e=>[e.name,e.description])),[R.data]),B=BC(),[ee,V]=b.useState({id:null,key:null}),[te,ne]=b.useState(!1),re=b.useId(),ie=ZS({trigger:B.trigger,projectId:T,claude:L,canCompact:!!u&&!!l,canPush:!!T,skills:R.data,skillsLoading:R.isPending}),ae=B.trigger?`${B.trigger.kind}:${B.trigger.query}`:null,oe=ie.items.length===0?null:ee.key===ae&&ee.id&&ie.items.some(e=>e.id===ee.id)?ee.id:ie.items[0].id,se=!!B.trigger&&!a,H=e=>{let t=B.trigger;if(!t)return;let n=L7(S,t.rangeStart,t.rangeEnd,e);B.reset(null),w.current?.setText(n.text,n.cursor)},ce=e=>{if(e.type===`path`)return e.kind===`directory`&&xS(e.path),H(`${O7(e.path)} `);if(e.type===`reference`)return H(`@ref:${e.refId} `);if(e.type===`skill`)return H(`$${e.skill.name} `);if(e.type===`provider-command`)return H(`/${e.name} `);if(e.command===`compact`)return H(`/compact `);H(``),e.command===`model`?ne(!0):e.command===`plan`?y?.(v===`plan`?`build`:`plan`):e.command===`clear`&&T?N({to:`/p/$projectId`,params:{projectId:T}}):e.command===`push`?Uu({pushOpen:!0}):e.command===`usage`&&P(`usage`)},le=()=>{let t=S.trim();!t&&!E.length&&!D.ready||n||D.uploading||(/^\/plan$/i.test(t)&&y?(y(v===`plan`?`build`:`plan`),C(``),B.reset(null)):/^\/compact$/i.test(t)&&u?(u(),C(``),B.reset(null)):(e(T?xC(t,fC(T)):t,D.take()),C(``),B.reset(null)))};return(0,x.jsxs)(`div`,{className:`mx-auto w-full max-w-[var(--chat-max)]`,children:[h&&(0,x.jsx)(`div`,{className:`mx-[1.375rem] rounded-t-lg border border-b-0 border-warning/30 bg-warning/8 px-3 py-1.5 text-xs text-warning-foreground dark:bg-warning/16`,children:h}),(0,x.jsxs)(`div`,{className:`relative`,children:[se&&(0,x.jsx)(nC,{listId:re,items:ie.items,triggerKind:B.trigger?.kind??null,isLoading:ie.isLoading,emptyText:ie.emptyText,activeId:oe,onHighlight:e=>V({id:e,key:ae}),onSelect:ce}),(0,x.jsxs)(`div`,{className:K(`composer-surface relative isolate z-10 rounded-2xl shadow-[var(--shadow-composer)]`,A&&`ring-2 ring-primary/40`),onDragOver:e=>{T&&e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),j(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||j(!1)},onDrop:e=>{j(!1),T&&e.dataTransfer.files.length&&(e.preventDefault(),D.add(Array.from(e.dataTransfer.files)),w.current?.focus())},children:[(0,x.jsx)(BS,{items:D.list,projectId:T,onRemove:D.remove,error:D.error}),E.length>0&&T&&(0,x.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 px-4 pt-3`,children:E.map(e=>(0,x.jsx)(VC,{comment:e,onRemove:()=>dC(T,e.id)},e.id))}),(0,x.jsx)(`div`,{className:`px-4 pt-3.5 pb-2`,children:(0,x.jsx)(ES,{ref:w,autoFocus:f,value:S,skills:z,onChange:(e,t)=>{C(e),B.edited(C7(e,t))},onCaret:e=>B.caretMoved(C7(S,e)),onBlur:()=>B.reset(null),onKeyDown:e=>{if(!e.nativeEvent.isComposing){if(k.current=e.key.toLowerCase()===`v`&&e.shiftKey&&(e.ctrlKey||e.metaKey)&&!e.altKey,se&&ie.items.length>0){let t=Math.max(0,ie.items.findIndex(e=>e.id===oe));if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let n=ie.items.length,r=ie.items[(t+(e.key===`ArrowDown`?1:n-1))%n];V({id:r.id,key:ae});return}if(e.key===`Enter`&&!e.shiftKey||e.key===`Tab`){e.preventDefault(),ce(ie.items[t]);return}}se&&e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),B.dismiss(B.trigger)):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),le())}},menuOpen:se,ariaControls:re,ariaActiveDescendant:se&&oe?tC(re,oe):void 0,onPasteIntake:(e,t)=>{let n=k.current;if(k.current=!1,!T)return!1;let r=Array.from(e.files||[]);if(r.length)return D.add(r)||!0;if(n||!IS(t,S.length+t.length>12e4))return!1;let i=LS(D.list.map(e=>e.name));return D.add([new File([t],i,{type:`text/plain`})],`pasted-text`),!0},placeholder:a?`Answer the approval first, or type to send after it`:p,className:`block max-h-52 min-h-[2lh] w-full overflow-y-auto bg-transparent text-sm leading-relaxed break-words whitespace-pre-wrap text-foreground outline-none data-[empty]:before:pointer-events-none data-[empty]:before:text-muted-foreground data-[empty]:before:content-[attr(data-placeholder)]`})}),a?(0,x.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pb-2.5`,children:[(0,x.jsx)(Xm,{className:`size-3.5 text-warning-foreground`}),(0,x.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-xs`,children:[(0,x.jsx)(`span`,{className:`text-warning-foreground`,children:`Waiting for approval`}),(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,a.summary]})]}),(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>o?.(!1),children:`Decline`}),(0,x.jsx)(J,{size:`xs`,onClick:()=>o?.(!0),children:`Approve`}),(0,x.jsxs)(Pb,{children:[(0,x.jsx)(Fb,{render:(0,x.jsx)(J,{size:`icon-xs`,variant:`outline`,"aria-label":`More approval options`,title:`More approval options`}),children:(0,x.jsx)(vf,{})}),(0,x.jsxs)(Ib,{side:`top`,align:`end`,children:[a.always&&(0,x.jsx)(Lb,{onClick:()=>o?.(!0,!0),children:`Always allow this session`}),(0,x.jsx)(Lb,{onClick:()=>t?.(),children:`Cancel (stop the turn)`})]})]})]}):(0,x.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 pb-2`,children:[(0,x.jsx)(Gb,{label:`Attach files`,children:(0,x.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`Attach files`,disabled:!T,onPointerDown:e=>e.preventDefault(),onClick:()=>O.current?.click(),children:(0,x.jsx)(cm,{className:`translate-y-px`})})}),(0,x.jsx)(`input`,{ref:O,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{let t=Array.from(e.currentTarget.files??[]);e.currentTarget.value=``,D.add(t),w.current?.focus()}}),l&&(0,x.jsx)(Gb,{label:d?`Compacting the history…`:`Compact ${l} tokens of history now (or type /compact). The newest four turns stay.`,children:(0,x.jsxs)(`button`,{type:`button`,onClick:u,disabled:!u||d||n,"aria-label":`Compact ${l} tokens of history`,className:`flex h-7 shrink-0 cursor-pointer items-center gap-1.5 rounded-[var(--control-radius)] px-2 text-sm text-foreground/80 tabular-nums transition-colors hover:bg-accent disabled:cursor-default disabled:hover:bg-transparent sm:h-6 sm:text-xs [&_svg]:size-3.5 [&_svg]:text-muted-foreground`,children:[(0,x.jsx)(Rp,{className:K(d&&`animate-pulse`)}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:l})]})}),(0,x.jsx)(`span`,{className:`ml-auto`}),s&&(0,x.jsx)(Gb,{label:c||`This chat so far`,children:(0,x.jsx)(`span`,{className:`flex h-7 shrink-0 items-center px-1.5 text-xs text-muted-foreground tabular-nums sm:h-6`,children:s})}),(0,x.jsx)(LC,{value:v,onChange:y}),(0,x.jsx)(IC,{value:g,onChange:_}),(0,x.jsx)(FC,{value:r,onChange:i,open:te,onOpenChange:ne}),(0,x.jsx)(`span`,{className:`w-1`}),n?(0,x.jsx)(Gb,{label:`Interrupt`,children:(0,x.jsx)(`button`,{onClick:t,"aria-label":`Stop generation`,className:`flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full bg-destructive/90 text-white shadow-xs shadow-destructive/24 inset-shadow-[0_1px_rgb(255_255_255/16%)] transition-colors duration-150 hover:bg-destructive active:shadow-none active:inset-shadow-[0_1px_rgb(0_0_0/8%)]`,children:(0,x.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`currentColor`,"aria-hidden":`true`,children:(0,x.jsx)(`rect`,{x:`2`,y:`2`,width:`8`,height:`8`,rx:`1.5`})})})}):(0,x.jsx)(`button`,{onClick:le,disabled:!S.trim()&&!E.length&&!D.ready||!r||D.uploading,"aria-label":`Send`,title:D.uploading?`Waiting for attachments to upload`:`Send (Enter)`,className:`relative isolate flex size-9 items-center justify-center overflow-hidden rounded-full bg-primary text-primary-foreground shadow-xs transition-all duration-150 enabled:cursor-pointer enabled:shadow-primary/24 enabled:inset-shadow-[0_1px_rgb(255_255_255/16%)] hover:scale-105 hover:bg-[color-mix(in_srgb,var(--primary)_90%,var(--background))] active:shadow-none active:inset-shadow-[0_1px_rgb(0_0_0/8%)] disabled:pointer-events-none disabled:bg-foreground/12 disabled:text-muted-foreground disabled:shadow-none sm:size-8`,children:(0,x.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,children:(0,x.jsx)(`path`,{d:`M7 11.5V2.5M7 2.5L3 6.5M7 2.5L11 6.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]})]})]})]})}function BC(){let[e,t]=b.useState(null),n=b.useRef(null),r=b.useRef(null),i=e=>{n.current=e,t(e)};return{trigger:e,edited(e){if(w7(r.current,e))return i(null);r.current=null,i(e)},caretMoved(e){w7(r.current,e)||(r.current=null),i(w7(n.current,e)?e:null)},dismiss(e){r.current=e,i(null)},reset(e){r.current=null,i(e)}}}function VC({comment:e,onRemove:t}){let n=`${e.filePath.slice(e.filePath.lastIndexOf(`/`)+1)} ${_C(e.startLine,e.endLine)}`;return(0,x.jsxs)(`span`,{className:`group/chip inline-flex max-w-full items-center gap-[0.2em] text-sm font-medium text-[oklch(0.62_0.16_292)]`,children:[(0,x.jsx)(Gb,{side:`top`,label:(0,x.jsxs)(`span`,{className:`block max-w-72 space-y-1.5 py-0.5`,children:[(0,x.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.filePath}),(0,x.jsx)(`span`,{className:`block text-muted-foreground`,children:_C(e.startLine,e.endLine)}),(0,x.jsx)(`span`,{className:`block whitespace-pre-wrap text-foreground`,children:e.text})]}),children:(0,x.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-[0.2em]`,"aria-label":`Review comment, ${n}`,children:[(0,x.jsx)(Mp,{className:`size-[1em] shrink-0`}),(0,x.jsx)(`span`,{className:`truncate`,children:n})]})}),(0,x.jsx)(`button`,{type:`button`,"aria-label":`Remove ${n}`,onClick:t,className:`flex size-4 cursor-pointer items-center justify-center rounded-sm text-muted-foreground opacity-0 group-hover/chip:opacity-100 hover:bg-accent hover:text-foreground focus-visible:opacity-100`,children:(0,x.jsx)(Oh,{className:`size-3`})})]})}var HC=`#2563eb`;function UC(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=i-Math.min(t,n,r),o=0;return a&&(o=i===t?(n-r)/a%6:i===n?(r-t)/a+2:(t-n)/a+4,o=(o*60+360)%360),{h:o,s:i?a/i:0,v:i}}function WC({h:e,s:t,v:n}){let r=r=>{let i=(r+e/60)%6;return n-n*t*Math.max(0,Math.min(i,4-i,1))};return`#`+[r(5),r(3),r(1)].map(e=>Math.round(e*255).toString(16).padStart(2,`0`)).join(``)}var GC=e=>Math.min(1,Math.max(0,e));function KC(e,t){return n=>{if(n.button!==0)return;let r=n.currentTarget;r.setPointerCapture(n.pointerId);let i=t=>{let n=r.getBoundingClientRect();e(GC((t.clientX-n.left)/n.width),GC((t.clientY-n.top)/n.height))};i(n);let a=e=>i(e),o=()=>{r.removeEventListener(`pointermove`,a),r.removeEventListener(`pointerup`,o),r.removeEventListener(`pointercancel`,o),t()};r.addEventListener(`pointermove`,a),r.addEventListener(`pointerup`,o),r.addEventListener(`pointercancel`,o)}}function qC({value:e,onPreview:t,onCommit:n,showAdd:r}){let[i,a]=b.useState(()=>UC(e)),[o,s]=b.useState(null),c=WC(i),l=b.useRef(null),u=(e,r)=>{a(e);let i=WC(e);if(!r)return n(i);l.current=i,t(i)},d=()=>{let e=l.current;l.current=null,e&&n(e)},f=KC((e,t)=>u({...i,s:e,v:1-t},!0),d),p=KC(e=>u({...i,h:e*360},!0),d),m=(e,t)=>{let n=e.shiftKey?.1:.01,r=e.key;if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(r)){if(e.preventDefault(),t===`hue`){let e=(r===`ArrowLeft`||r===`ArrowDown`?-1:1)*n*360;u({...i,h:(i.h+e+360)%360},!1)}else u(r===`ArrowLeft`||r===`ArrowRight`?{...i,s:GC(i.s+(r===`ArrowLeft`?-n:n))}:{...i,v:GC(i.v+(r===`ArrowDown`?-n:n))},!1)}};return(0,x.jsxs)(`div`,{className:`w-56`,children:[(0,x.jsx)(`div`,{role:`slider`,tabIndex:0,"aria-label":`Accent color`,"aria-valuetext":c,onPointerDown:f,onKeyDown:e=>m(e,`plane`),className:`relative h-36 cursor-crosshair outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,style:{backgroundColor:`hsl(${i.h} 100% 50%)`,backgroundImage:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent)`},children:(0,x.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute size-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/30%)]`,style:{left:`${i.s*100}%`,top:`${(1-i.v)*100}%`,backgroundColor:c}})}),(0,x.jsxs)(`div`,{className:`grid gap-3 p-3`,children:[(0,x.jsx)(`div`,{role:`slider`,tabIndex:0,"aria-label":`Accent color hue`,"aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":Math.round(i.h),onPointerDown:p,onKeyDown:e=>m(e,`hue`),className:`relative h-3 cursor-pointer rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring`,style:{background:`linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)`},children:(0,x.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 size-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/30%)]`,style:{left:`${i.h/360*100}%`,backgroundColor:`hsl(${i.h} 100% 50%)`}})}),(0,x.jsx)(p7,{size:`compact`,mono:!0,spellCheck:!1,"aria-label":`Custom hex accent color`,value:o??c,onChange:e=>{let t=e.target.value;s(t),/^#[\da-f]{6}$/i.test(t)&&(a(UC(t)),n(t.toLowerCase()))},onBlur:()=>s(null)}),r&&(0,x.jsx)(Hb,{render:(0,x.jsx)(J,{size:`sm`,onClick:()=>n(c),children:`Add color`})})]})]})}function JC({name:e,value:t,onCommit:n}){let r=t&&/^#[0-9a-f]{6}$/i.test(t)?t:``,[i,a]=b.useState(null);i&&i.base!==r&&a(null);let o=i?i.color:r,s=e=>{a({color:e,base:r,previewing:!1}),n(e)};return(0,x.jsxs)(Bb,{onOpenChange:e=>{!e&&i?.previewing&&s(i.color)},children:[(0,x.jsx)(Vb,{render:(0,x.jsx)(J,{size:`icon-sm`,variant:`ghost-muted`,className:K(o&&`border border-border/60`),style:o?{backgroundColor:o}:void 0,"aria-label":o?`Change accent color for ${e}`:`Add accent color for ${e}`,title:`Accent color`}),children:o?(0,x.jsx)(`span`,{className:`sr-only`,children:`Change accent color`}):(0,x.jsx)(wm,{"aria-hidden":!0})}),(0,x.jsxs)(Ub,{children:[(0,x.jsx)(qC,{value:o||HC,onPreview:e=>a({color:e,base:r,previewing:!0}),onCommit:s,showAdd:!r}),r&&(0,x.jsx)(`div`,{className:`border-t border-border/60 p-1`,children:(0,x.jsx)(Hb,{render:(0,x.jsxs)(J,{size:`sm`,variant:`ghost-muted`,className:`w-full justify-start`,onClick:()=>s(``),children:[(0,x.jsx)(Oh,{"aria-hidden":!0}),` Clear color`]})})})]})]})}function YC(e){return`setting-${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)}`}var XC=(e,t,n)=>({id:`${e}:${t}`,title:t,section:e,target:YC(t),terms:n}),ZC=(e,t,n)=>({id:`${e}:${t}`,title:t,section:e,terms:n}),QC=[XC(`general`,`rpf home`,`RPFORGE_HOME folder data profiles keys chats location`),XC(`general`,`Key store`,`encryption credentials keychain secrets`),XC(`general`,`Version`,`rpf version`),XC(`appearance`,`Theme`,`dark light system mode color scheme`),ZC(`providers`,`Add provider`,`connect api key anthropic openai google z.ai glm claude subscription`),ZC(`providers`,`API key`,`key token secret provider`),ZC(`providers`,`Models`,`model list favorite custom refresh reasoning`),ZC(`providers`,`Claude sign-in`,`claude subscription login binary path CLAUDE_CONFIG_DIR`),ZC(`usage`,`Usage and spend`,`cost tokens price money chats models`),ZC(`instances`,`Instances`,`servicenow profile sign in credentials instance url oauth`),XC(`projects`,`Projects folder`,`new projects location default folder`),ZC(`projects`,`Remove project`,`delete forget project`),XC(`doctor`,`Check this computer and an instance`,`doctor diagnose health fix problems`),ZC(`skills`,`Skills`,`claude skills install update react portal`),ZC(`keybindings`,`Keyboard shortcuts`,`keybindings hotkeys keys`),XC(`diffs`,`Diff layout`,`split unified side by side`),XC(`diffs`,`Hide whitespace changes`,`whitespace spaces ignore`),XC(`diffs`,`Diff colors`,`red green blue orange colorblind`),XC(`about`,`Welcome page`,`onboarding first run`),XC(`about`,`Open-source licenses`,`legal notices`),ZC(`about`,`Check for updates`,`update upgrade new version`),ZC(`licenses`,`Third-party notices`,`licenses legal open source`)];function $C(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()}function ew(e,t,n){return e===t?5:e.startsWith(t)?4:e.includes(t)?3:n.every(t=>e.includes(t))?2:0}function tw(e,t,n=QC){let r=$C(e);if(!r)return[];let i=r.split(` `);return n.flatMap((e,n)=>{let a=$C(e.title),o=[a,$C(t[e.section]||``),$C(e.terms||``)];return i.every(e=>o.some(t=>t.includes(e)))?[{item:e,index:n,rank:Math.max(ew(a,r,i),+!!o.some(e=>e.includes(r)))}]:[]}).sort((e,t)=>t.rank-e.rank||e.index-t.index).map(e=>e.item)}function nw(e){let t=document.getElementById(e);if(!t)return!1;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;return t.scrollIntoView({behavior:n?`auto`:`smooth`,block:`center`}),t.hasAttribute(`tabindex`)||(t.tabIndex=-1),t.focus({preventScroll:!0}),t.classList.remove(`settings-search-target-pulse`),n||(t.offsetWidth,t.classList.add(`settings-search-target-pulse`),t.addEventListener(`blur`,()=>t.classList.remove(`settings-search-target-pulse`),{once:!0})),!0}var rw=[{kind:`claude-subscription`,label:`Claude`,description:`Your Claude plan through Claude Code (Agent SDK)`},{kind:`anthropic`,label:`Anthropic API`,description:`Claude models with an API key`},{kind:`openai`,label:`OpenAI`,description:`GPT models with an API key`},{kind:`google`,label:`Google`,description:`Gemini models with an API key`},{kind:`zai`,label:`z.ai`,description:`GLM 5.3 and GLM 5.3 Flash`},{kind:`openai-compatible`,label:`OpenAI-compatible`,description:`Any endpoint that speaks the OpenAI API`}],iw=Object.fromEntries(rw.map(e=>[e.kind,e.label]));iw.mock=`Replay (development)`;var aw={general:`https://api.z.ai/api/paas/v4`,coding:`https://api.z.ai/api/coding/paas/v4`};function ow({title:e,action:t,children:n,plain:r}){return(0,x.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,x.jsxs)(`div`,{className:`flex min-h-7 items-center gap-2 px-3 sm:px-4`,children:[(0,x.jsx)(`h2`,{className:`text-base font-semibold`,children:e}),(0,x.jsx)(`div`,{className:`ml-auto flex items-center gap-1`,children:t})]}),r?n:(0,x.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border/60 bg-card/40 shadow-xs/5 *:not-first:border-t *:not-first:border-border/50`,children:n})]})}function sw({title:e,description:t,children:n}){return(0,x.jsxs)(`div`,{id:typeof e==`string`?YC(e):void 0,className:`grid items-center gap-x-8 gap-y-2 px-3 py-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:px-4`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e}),t&&(0,x.jsx)(`div`,{className:`mt-0.5 max-w-2xl text-xs leading-normal text-muted-foreground`,children:t})]}),n!==void 0&&(0,x.jsx)(`div`,{className:`flex max-w-[28rem] min-w-0 justify-end gap-2`,children:n})]})}function cw(e,t){if(!e.enabled)return{dot:`bg-muted-foreground/50`,headline:`Disabled`};if(e.kind===`claude-subscription`){let e=t?.status;return{dot:e===`ready`?`bg-success`:e===`error`?`bg-destructive`:`bg-warning`,headline:t?.headline||`Checking provider status`,detail:t?.message}}return e.kind===`mock`?{dot:`bg-success`,headline:`Available`}:e.needsKey&&!e.key.set?{dot:`bg-destructive`,headline:`Not authenticated · API key`,detail:`Add a key`}:e.status===`error`?{dot:`bg-destructive`,headline:`Needs attention`,detail:e.message}:{dot:`bg-success`,headline:`Authenticated · API key ••••${e.key.last4}`,detail:e.status===`ready`?e.message:void 0}}function lw(){let e=Pa({select:e=>e.location.pathname});return/^\/p\/([^/]+)/.exec(e)?.[1]||``}function uw({at:e}){return e?vu(e)===`now`?(0,x.jsx)(x.Fragment,{children:`Checked just now`}):(0,x.jsxs)(x.Fragment,{children:[`Checked `,(0,x.jsx)(`span`,{className:`font-mono tabular-nums`,children:vu(e)}),` ago`]}):(0,x.jsx)(x.Fragment,{children:`Not checked yet`})}function dw(){let e=ku(),t=C(),n=U(e.settings.get.queryOptions()),r=U(e.meta.queryOptions()),i=n.data?.connections||[],a=i.some(e=>e.kind===`claude-subscription`),o=U({...e.claude.status.queryOptions(),enabled:a}),s=W(e.claude.refresh.mutationOptions()),c=W(e.settings.saveConnection.mutationOptions({onSuccess:()=>t.invalidateQueries({queryKey:e.settings.get.queryKey()})})),[l,u]=b.useState(``),[d,f]=b.useState(!1),p=i.find(e=>e.id===l)||i[0];b.useEffect(()=>{a&&o.data?.status===`unknown`&&!s.isPending&&s.mutate()},[a,o.data?.status]);let m=[o.data?.checkedAt,...i.map(e=>e.checkedAt)].filter(Boolean).sort().at(-1);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ow,{title:`Providers and models`,plain:!0,action:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(J,{size:`xs`,variant:`ghost-muted`,"aria-label":`Refresh provider status`,onClick:()=>a&&s.mutate(),children:[(0,x.jsx)(Om,{className:K(s.isPending&&`animate-spin`)}),s.isPending?`Refreshing providers`:(0,x.jsx)(uw,{at:m})]}),(0,x.jsx)(J,{size:`icon-xs`,variant:`ghost`,"aria-label":`Add provider`,title:`Add provider`,onClick:()=>f(!0),children:(0,x.jsx)(wm,{})})]}),children:(0,x.jsx)(`div`,{className:`@container/providers`,children:(0,x.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/60 bg-card/40 shadow-xs/5 @min-[48rem]/providers:grid @min-[48rem]/providers:min-h-[32rem] @min-[48rem]/providers:grid-cols-[17rem_minmax(0,1fr)]`,children:[(0,x.jsx)(`div`,{className:`border-b border-border/60 bg-muted/10 @min-[48rem]/providers:border-e @min-[48rem]/providers:border-b-0`,children:(0,x.jsxs)(`div`,{className:`divide-y divide-border/50`,children:[i.map(e=>{let t=cw(e,o.data),n=p?.id===e.id;return(0,x.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:()=>u(e.id),onKeyDown:t=>t.key===`Enter`&&u(e.id),className:K(`group relative flex min-h-18 cursor-default items-center gap-3 px-3 py-3 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset sm:px-4`,n?`bg-foreground/[0.06]`:`hover:bg-muted/25`,!e.enabled&&`opacity-60`),children:[(0,x.jsx)(`span`,{className:`flex size-5 items-center justify-center`,children:(0,x.jsx)(NC,{kind:e.kind,name:e.name,accent:e.accentColor,badge:pw(e,i)})}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),e.kind===`claude-subscription`&&o.data?.version&&(0,x.jsxs)(`code`,{className:`max-w-24 truncate text-xs text-muted-foreground`,children:[`v`,o.data.version]})]}),(0,x.jsxs)(`div`,{className:`mt-0.5 flex items-start gap-1.5 text-xs text-muted-foreground/80`,children:[t.dot!==`bg-success`&&(0,x.jsx)(`span`,{className:K(`mt-1.5 size-1.5 shrink-0 rounded-full`,t.dot)}),(0,x.jsx)(`span`,{className:`line-clamp-2`,children:t.headline})]})]}),(0,x.jsx)(`span`,{onClick:e=>e.stopPropagation(),children:(0,x.jsx)(g7,{checked:e.enabled,"aria-label":`Turn ${e.name} ${e.enabled?`off`:`on`}`,onCheckedChange:t=>c.mutate({connection:fw({...e,enabled:t})})})})]},e.id)}),(0,x.jsxs)(`button`,{type:`button`,onClick:()=>f(!0),className:`flex w-full items-center gap-3 px-3 py-3 text-sm text-muted-foreground outline-none hover:bg-muted/25 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset sm:px-4`,children:[(0,x.jsx)(`span`,{className:`flex size-5 items-center justify-center`,children:(0,x.jsx)(wm,{className:`size-4`})}),`Add provider`]})]})}),(0,x.jsx)(`div`,{className:`min-w-0 space-y-6 py-4`,children:p?(0,x.jsx)(mw,{c:p,claude:o.data,badge:pw(p,i),onRemoved:()=>u(``)},p.id):(0,x.jsxs)(`div`,{className:`px-6 py-16 text-center`,children:[(0,x.jsx)(`p`,{className:`text-sm font-medium`,children:`No providers yet`}),(0,x.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Add an API key, or use your Claude plan through Claude Code.`}),(0,x.jsxs)(J,{size:`sm`,className:`mt-4`,onClick:()=>f(!0),children:[(0,x.jsx)(wm,{}),` Add provider`]})]})})]})})}),(0,x.jsx)(xw,{conns:i}),(0,x.jsx)(Sw,{}),(0,x.jsx)(ww,{open:d,onOpenChange:f,existing:i.map(e=>e.id),devMock:!!r.data?.devMock,onAdded:e=>u(e)})]})}function fw(e){let{key:t,needsKey:n,...r}=e;return r.environment&&=r.environment.map(({set:e,...t})=>t.sensitive&&t.value===void 0?{name:t.name,sensitive:!0}:t),r}function pw(e,t){return!!e.accentColor||t.filter(t=>t.kind===e.kind&&(t.enabled||!e.enabled)).length>1}function mw({c:e,claude:t,badge:n,onRemoved:r}){let i=ku(),a=C(),o=()=>a.invalidateQueries({queryKey:i.settings.get.queryKey()}),s=W(i.settings.saveConnection.mutationOptions({onSuccess:o})),c=W(i.settings.removeConnection.mutationOptions({onSuccess:o})),l=W(i.settings.testConnection.mutationOptions({onSuccess:o})),u=W(i.claude.refresh.mutationOptions()),[d,f]=b.useState(e.name),[p,m]=b.useState(``),[h,g]=b.useState(!e.key.set),[_,v]=b.useState(e.baseURL||``),[y,S]=b.useState(e.binaryPath||``),[w,T]=b.useState(e.homePath||``),[E,D]=b.useState(!1),O=cw(e,t),k=(t,n)=>s.mutate({connection:fw({...e,...t}),...n===void 0?{}:{apiKey:n}});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`flex min-h-7 items-center gap-2 px-3 sm:px-4`,children:[(0,x.jsx)(NC,{kind:e.kind,name:e.name,accent:e.accentColor,badge:n}),(0,x.jsx)(`h3`,{className:`text-base font-semibold`,children:e.name}),(0,x.jsx)(Xb,{variant:`outline`,children:iw[e.kind]||e.kind}),e.kind===`claude-subscription`&&t?.version&&(0,x.jsxs)(`code`,{className:`text-xs text-muted-foreground`,children:[`v`,t.version]}),(0,x.jsx)(`div`,{className:`ml-auto flex items-center gap-1`,children:E?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Remove `,e.name,` and its key?`]}),(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,onClick:()=>D(!1),children:`Cancel`}),(0,x.jsx)(J,{size:`xs`,variant:`destructive`,onClick:()=>c.mutate({id:e.id},{onSuccess:r}),children:`Remove`})]}):(0,x.jsx)(J,{size:`icon-xs`,variant:`ghost`,"aria-label":`Remove ${e.name}`,title:`Remove`,onClick:()=>D(!0),children:(0,x.jsx)(vh,{})})})]}),(0,x.jsx)(ow,{title:`Connection`,plain:!0,children:(0,x.jsxs)(`div`,{className:`mx-3 overflow-hidden rounded-xl border border-border/60 bg-card/40 shadow-xs/5 *:not-first:border-t *:not-first:border-border/50 sm:mx-4`,children:[(0,x.jsx)(sw,{title:`Status`,description:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:K(`size-1.5 rounded-full`,O.dot)}),O.headline]}),O.detail&&(0,x.jsx)(`span`,{className:`block`,children:O.detail}),e.kind===`claude-subscription`&&t?.advisory&&(0,x.jsx)(`span`,{className:`block text-warning-foreground`,children:t.advisory}),l.data&&(0,x.jsx)(`span`,{className:K(`block`,l.data.ok?`text-success-foreground`:`text-destructive-foreground`),children:l.data.ok?`Test passed: ${l.data.model} replied in ${l.data.latencyMs} ms${l.data.models===void 0?``:` · ${l.data.models} models available`}`:`Test failed: ${l.data.message}`})]}),children:(0,x.jsx)(J,{size:`xs`,variant:`outline`,disabled:l.isPending||u.isPending,onClick:()=>e.kind===`claude-subscription`?u.mutate():l.mutate({id:e.id}),children:l.isPending||u.isPending?`Checking…`:e.kind===`claude-subscription`?`Refresh`:`Test`})}),(0,x.jsxs)(sw,{title:`Display name`,description:`Shown in the provider list and the model picker. The accent color badges its mark.`,children:[(0,x.jsx)(JC,{name:e.name,value:e.accentColor,onCommit:e=>k({accentColor:e||void 0})}),(0,x.jsx)(p7,{size:`compact`,className:`w-56`,value:d,onChange:e=>f(e.target.value),onBlur:()=>d.trim()&&d!==e.name&&k({name:d.trim()})})]}),e.needsKey&&(0,x.jsx)(sw,{title:`API key`,description:`Kept encrypted in rpf's credential store. Forge never shows it again or sends it to the browser.`,children:h?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(p7,{size:`compact`,type:`password`,className:`w-56`,autoComplete:`off`,placeholder:`Paste the key`,value:p,onChange:e=>m(e.target.value)}),(0,x.jsx)(J,{size:`xs`,disabled:!p.trim(),onClick:()=>{k({},p.trim()),m(``),g(!1)},children:`Save`})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`self-center font-mono text-xs text-muted-foreground`,children:[`set · ••••`,e.key.last4]}),(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>g(!0),children:`Replace`})]})}),e.kind===`zai`&&(0,x.jsx)(sw,{title:`Endpoint`,description:`The general API, or the GLM Coding Plan's endpoint.`,children:(0,x.jsx)(`div`,{className:`inline-flex rounded-[var(--control-radius)] border border-input p-0.5`,children:[`general`,`coding`].map(t=>(0,x.jsx)(`button`,{type:`button`,onClick:()=>k({baseURL:aw[t]}),className:K(`h-6 rounded-md px-2.5 text-xs`,(e.baseURL||aw.general)===aw[t]?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`),children:t===`general`?`General API`:`Coding Plan`},t))})}),(e.kind===`openai-compatible`||e.kind===`openai`)&&(0,x.jsx)(sw,{title:`Base URL`,description:e.kind===`openai`?`Leave empty for api.openai.com.`:`The endpoint that serves /chat/completions and /models.`,children:(0,x.jsx)(p7,{size:`compact`,mono:!0,className:`w-72`,placeholder:e.kind===`openai`?`https://api.openai.com/v1`:`https://…/v1`,value:_,onChange:e=>v(e.target.value),onBlur:()=>_!==(e.baseURL||``)&&k({baseURL:_.trim()||void 0})})}),e.kind===`claude-subscription`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(sw,{title:`Sign-in`,description:`Claude Code keeps its own sign-in; Forge never reads it. Sign in once in a terminal, then Refresh.`,children:(0,x.jsx)(`code`,{className:`self-center rounded-md bg-muted px-2 py-1 text-xs`,children:`claude auth login`})}),(0,x.jsx)(sw,{title:`Binary path`,description:`Leave empty for the Claude Code build that comes with rpf.`,children:(0,x.jsx)(p7,{size:`compact`,mono:!0,className:`w-56`,placeholder:`claude`,value:y,onChange:e=>S(e.target.value),onBlur:()=>y!==(e.binaryPath||``)&&k({binaryPath:y.trim()||void 0})})}),(0,x.jsx)(sw,{title:`CLAUDE_CONFIG_DIR path`,description:`Another Claude Code profile (its sign-in and history).`,children:(0,x.jsx)(p7,{size:`compact`,mono:!0,className:`w-56`,placeholder:`~/.claude`,value:w,onChange:e=>T(e.target.value),onBlur:()=>w!==(e.homePath||``)&&k({homePath:w.trim()||void 0})})})]})]})}),e.kind===`claude-subscription`&&(0,x.jsx)(gw,{c:e,onSave:e=>k({environment:e})}),(0,x.jsx)(yw,{c:e,onSave:(e,t)=>k({models:e,defaultModel:t})})]})}var hw=0;function gw({c:e,onSave:t}){let[n,r]=b.useState(()=>(e.environment||[]).map(e=>({...e,id:hw++}))),i=e=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(e),a=e=>{r(e);let n=e.map(e=>e.name.trim());n.some((e,t)=>e&&n.indexOf(e)!==t)||(t(e.filter(e=>i(e.name.trim())).map(e=>({name:e.name.trim(),sensitive:e.sensitive,value:e.value,set:e.set}))),r(e.map(e=>e.sensitive?{...e,value:void 0}:e)))},o=(e,t)=>a(n.map(n=>n.id===e?{...n,...t}:n));return(0,x.jsx)(ow,{title:`Environment`,plain:!0,children:(0,x.jsxs)(`div`,{className:`mx-3 overflow-hidden rounded-xl border border-border/60 bg-card/40 shadow-xs/5 sm:mx-4`,children:[(0,x.jsx)(sw,{title:`Variables`,description:`API keys, base URLs and other settings Claude Code reads from its environment.`,children:(0,x.jsxs)(J,{size:`xs`,variant:`outline`,onClick:()=>r([...n,{id:hw++,name:``,sensitive:!0}]),children:[(0,x.jsx)(wm,{}),` Add variable`]})}),n.length>0&&(0,x.jsx)(`div`,{className:`space-y-2 px-3 pb-3 sm:px-4`,children:n.map((e,t)=>(0,x.jsx)(_w,{row:e,index:t,invalid:!!e.name.trim()&&!i(e.name.trim()),onPatch:t=>o(e.id,t),onRemove:()=>a(n.filter(t=>t.id!==e.id))},e.id))})]})})}function _w({row:e,index:t,invalid:n,onPatch:r,onRemove:i}){let[a,o]=b.useState(e.name),[s,c]=b.useState(e.sensitive?``:e.value||``),l=e.name||`variable ${t+1}`;return(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,x.jsx)(p7,{size:`compact`,mono:!0,className:`min-w-0 flex-1 sm:w-44 sm:flex-none`,placeholder:`VARIABLE_NAME`,spellCheck:!1,"aria-label":`Environment variable name ${t+1}`,"aria-invalid":n||void 0,value:a,onChange:e=>o(e.target.value),onBlur:()=>a!==e.name&&r({name:a.trim()})}),(0,x.jsx)(p7,{size:`compact`,mono:!0,className:`min-w-0 flex-[2]`,type:e.sensitive?`password`:`text`,autoComplete:`off`,placeholder:e.sensitive&&e.set?`set · type to replace`:`value`,"aria-label":`Value of ${l}`,value:s,onChange:e=>c(e.target.value),onBlur:()=>{if(e.sensitive){if(!s)return;r({value:s,set:!0}),c(``)}else s!==(e.value||``)&&r({value:s})}}),(0,x.jsx)(J,{size:`icon-xs`,variant:`ghost-muted`,"aria-pressed":e.sensitive,"aria-label":`Mark ${l} as ${e.sensitive?`not sensitive`:`sensitive`}`,title:e.sensitive?`Sensitive: kept encrypted, never shown again`:`Not sensitive: kept in forge.json`,onClick:()=>r(e.sensitive?{sensitive:!1,value:``,set:!1}:{sensitive:!0,value:s||void 0,set:!!s}),children:e.sensitive?(0,x.jsx)(Ep,{}):(0,x.jsx)(wp,{})}),(0,x.jsx)(J,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Remove environment variable ${l}`,onClick:i,children:(0,x.jsx)(Oh,{})}),n&&(0,x.jsx)(`span`,{className:`basis-full text-xs text-destructive-foreground`,children:`Names use letters, digits and underscores, and don't start with a digit.`})]})}function vw(e,t){let n=[];return e.context&&n.push(`${e.context>=1e6?`${e.context/1e6}M`:`${Math.round(e.context/1e3)}k`} context`),(!e.custom||e.visionSet)&&e.vision===!1&&n.push(`No images`),e.custom&&e.visionSet&&e.vision&&n.push(`Images`),!e.custom&&e.reasoning===!1&&t.some(e=>e.reasoning)&&n.push(`No reasoning`),n}function yw({c:e,onSave:t}){let n=W(ku().settings.fetchModels.mutationOptions()),[r,i]=b.useState(``),[a,o]=b.useState(``),[s,c]=b.useState(``),l=e.models.filter(e=>!r||`${e.id} ${e.name||``}`.toLowerCase().includes(r.toLowerCase())),u=e.models.filter(e=>!e.hidden).length,d=e.defaultModel||e.models.find(e=>!e.hidden)?.id,f=async()=>{c(``);try{let r=await n.mutateAsync({id:e.id}),i=new Map(e.models.map(e=>[e.id,e]));t(r.map(t=>({...t,hidden:i.has(t.id)?i.get(t.id).hidden:e.models.length>0})),e.defaultModel)}catch(e){c(e.message)}},p=()=>{let n=a.trim();if(!n)return c(`Enter a model slug.`);if(n.length>128)return c(`Model slugs must be 128 characters or less.`);if(e.models.some(e=>e.id===n))return c(`That model is already in the list.`);t([...e.models,{id:n,name:n,custom:!0}],e.defaultModel),o(``),c(``)},m=(n,r)=>{let i=[...e.models],[a]=i.splice(n,1);i.splice(n+r,0,a),t(i,e.defaultModel)};return(0,x.jsx)(ow,{title:`Models`,plain:!0,action:e.kind!==`mock`&&e.kind!==`claude-subscription`&&(0,x.jsxs)(J,{size:`xs`,variant:`ghost-muted`,disabled:n.isPending,onClick:f,children:[(0,x.jsx)(Om,{className:K(n.isPending&&`animate-spin`)}),` Refresh models`]}),children:(0,x.jsxs)(`div`,{className:`mx-3 space-y-2 sm:mx-4`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsx)(p7,{size:`compact`,className:`w-56`,placeholder:`Filter models`,value:r,onChange:e=>i(e.target.value)}),(0,x.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.models.length,` models · `,u,` in the picker · `,e.models.length-u,` hidden`]}),(0,x.jsxs)(`div`,{className:`ml-auto flex gap-1`,children:[(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,onClick:()=>t(e.models.map(e=>({...e,hidden:!1})),e.defaultModel),children:`Show all`}),(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,onClick:()=>t(e.models.map(e=>({...e,hidden:e.id!==d})),e.defaultModel),children:`Hide all`})]})]}),(0,x.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card/40 p-1 shadow-xs/5`,children:[l.length===0&&(0,x.jsx)(`p`,{className:`px-2 py-3 text-xs text-muted-foreground`,children:`No models match.`}),l.map(n=>{let r=e.models.indexOf(n),i=d===n.id;return(0,x.jsxs)(`div`,{className:K(`group grid h-7 grid-cols-[1.5rem_minmax(0,1fr)_auto_auto_auto] items-center gap-2 rounded-md px-2 hover:bg-muted/30`,n.hidden&&`opacity-50`),children:[(0,x.jsx)(`button`,{type:`button`,"aria-label":i?`The provider default`:`Make this the provider default`,title:i?`The provider default`:`Make this the provider default`,onClick:()=>t(e.models.map(e=>e.id===n.id?{...e,hidden:!1}:e),n.id),className:`inline-flex size-5 items-center justify-center rounded text-muted-foreground hover:text-foreground`,children:(0,x.jsx)(oh,{className:K(`size-3.5`,i&&`fill-current text-warning`)})}),(0,x.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate text-sm`,children:n.name||n.id}),(n.name||n.id)!==n.id&&(0,x.jsx)(`span`,{className:`truncate font-mono text-2xs text-muted-foreground/70`,children:n.id}),n.custom&&(0,x.jsx)(`span`,{className:`shrink-0 text-2xs text-muted-foreground/70`,children:`custom`})]}),(0,x.jsx)(`span`,{className:`hidden text-2xs text-muted-foreground/70 sm:inline`,children:vw(n,e.models).join(` · `)}),(0,x.jsxs)(`span`,{className:`flex gap-0.5 opacity-0 group-hover:opacity-100`,children:[(0,x.jsx)(J,{size:`xs`,variant:n.vision?`secondary`:`ghost-muted`,"aria-pressed":!!n.vision,"aria-label":`${n.id} accepts images`,title:n.vision?`Accepts images (click to turn off)`:`No images (click to turn on)`,onClick:()=>t(e.models.map(e=>e.id===n.id?{...e,vision:!n.vision,visionSet:!0}:e),e.defaultModel),children:n.vision?(0,x.jsx)(ip,{}):(0,x.jsx)(np,{})}),(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,disabled:r===0,onClick:()=>m(r,-1),"aria-label":`Move up`,children:`↑`}),(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,disabled:r===e.models.length-1,onClick:()=>m(r,1),"aria-label":`Move down`,children:`↓`}),(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,"aria-label":`Remove ${n.id}`,onClick:()=>t(e.models.filter(e=>e.id!==n.id),i?void 0:e.defaultModel),children:(0,x.jsx)(Oh,{})})]}),(0,x.jsx)(g7,{checked:!n.hidden,"aria-label":`Show ${n.id} in the picker`,onCheckedChange:r=>t(e.models.map(e=>e.id===n.id?{...e,hidden:!r}:e),e.defaultModel)})]},n.id)})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(p7,{size:`compact`,mono:!0,className:`w-64`,placeholder:e.kind===`claude-subscription`?`claude-sonnet-5`:`model-slug`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>e.key===`Enter`&&p()}),(0,x.jsxs)(J,{size:`xs`,variant:`outline`,onClick:p,children:[(0,x.jsx)(wm,{}),` Add custom model`]}),s&&(0,x.jsx)(`span`,{className:`text-xs text-destructive-foreground`,children:s})]})]})})}function bw({value:e,onChange:t,none:n}){let r=U(ku().models.queryOptions()),i=r.data?.find(t=>t.connectionId===e?.connectionId),a=i?.models.find(t=>t.id===e?.model);return(0,x.jsxs)(Pb,{children:[(0,x.jsxs)(Fb,{className:`inline-flex h-7 min-w-56 items-center gap-2 rounded-md border border-input bg-popover px-2.5 text-xs shadow-xs/5 outline-none hover:bg-accent/50 dark:bg-input/32`,children:[i&&(0,x.jsx)(NC,{kind:i.kind}),(0,x.jsx)(`span`,{className:`flex-1 truncate text-left`,children:e?`${i?.name||e.connectionId} · ${a?.name||e.model}`:n||`Choose a model`}),(0,x.jsx)(Vd,{className:`size-3 opacity-60`})]}),(0,x.jsxs)(Ib,{align:`end`,className:`min-w-64`,children:[n&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(Lb,{onClick:()=>t(null),children:[(0,x.jsx)(`span`,{className:`flex-1`,children:n}),!e&&(0,x.jsx)(zd,{})]}),(0,x.jsx)(zb,{})]}),r.data?.map(n=>(0,x.jsxs)(b.Fragment,{children:[(0,x.jsxs)(Rb,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(NC,{kind:n.kind}),` `,n.name]}),n.models.map(r=>(0,x.jsxs)(Lb,{onClick:()=>t({connectionId:n.connectionId,model:r.id}),children:[(0,x.jsx)(`span`,{className:`flex-1`,children:r.name||r.id}),e?.connectionId===n.connectionId&&e.model===r.id&&(0,x.jsx)(zd,{})]},r.id))]},n.connectionId))]})]})}function xw({conns:e}){let t=ku(),n=C(),r=U(t.settings.get.queryOptions()),i=lw(),a=U({...t.projects.get.queryOptions({id:i}),enabled:!!i}),o=()=>{n.invalidateQueries({queryKey:t.settings.get.queryKey()}),n.invalidateQueries({queryKey:t.models.queryKey()})},s=W(t.settings.setDefault.mutationOptions({onSuccess:o})),c=W(t.settings.setProjectDefault.mutationOptions({onSuccess:o}));if(!e.length)return null;let l=i&&r.data?.projects?.[i]||{};return(0,x.jsxs)(ow,{title:`Defaults`,children:[(0,x.jsx)(sw,{title:`Chat model`,description:`New chats start with it. Yours to set; each chat keeps its own picker.`,children:(0,x.jsx)(bw,{value:r.data?.defaults.chat,onChange:e=>s.mutate({which:`chat`,model:e})})}),(0,x.jsx)(sw,{title:`Helper model`,description:`Chat titles and compaction summaries.`,children:(0,x.jsx)(bw,{value:r.data?.defaults.helper,none:`Same as chat model`,onChange:e=>s.mutate({which:`helper`,model:e})})}),i&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(sw,{title:(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[`Chat model for `,a.data?.name||`this project`,l.chat&&(0,x.jsx)(Xb,{variant:`info`,children:`Overridden for this project`})]}),description:`Replaces the chat model above for new chats in this project.`,children:(0,x.jsx)(bw,{value:l.chat,none:`Use default`,onChange:e=>c.mutate({projectId:i,which:`chat`,model:e})})}),(0,x.jsx)(sw,{title:(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[`Helper model for `,a.data?.name||`this project`,l.helper&&(0,x.jsx)(Xb,{variant:`info`,children:`Overridden for this project`})]}),children:(0,x.jsx)(bw,{value:l.helper,none:`Use default`,onChange:e=>c.mutate({projectId:i,which:`helper`,model:e})})})]})]})}function Sw(){let e=ku(),t=C(),n=U(e.settings.prices.queryOptions()),r=W(e.settings.setPrice.mutationOptions({onSuccess:()=>t.invalidateQueries({queryKey:e.settings.prices.queryKey()})}));return n.data?.length?(0,x.jsxs)(ow,{title:`Prices`,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_5rem_5rem_5rem_6rem] items-center gap-2 px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:[(0,x.jsx)(`span`,{children:`Model (USD per million tokens)`}),(0,x.jsx)(`span`,{children:`Input`}),(0,x.jsx)(`span`,{children:`Cached`}),(0,x.jsx)(`span`,{children:`Output`}),(0,x.jsx)(`span`,{children:`Source`})]}),n.data.map(e=>(0,x.jsx)(Cw,{row:e,onSave:t=>r.mutate({key:e.key,price:t})},e.key))]}):null}function Cw({row:e,onSave:t}){let n=e.price,[r,i]=b.useState({input:n?.input?.toString()??``,cached:n?.cached?.toString()??``,output:n?.output?.toString()??``}),a=()=>{if(!r.input&&!r.output&&!r.cached)return t(null);let e=e=>e.trim()===``?void 0:Number(e),i=e(r.input),a=e(r.output);if(i===void 0||a===void 0||Number.isNaN(i)||Number.isNaN(a))return;let o=e(r.cached);(i!==n?.input||a!==n?.output||o!==n?.cached)&&t({input:i,output:a,...o!==void 0&&!Number.isNaN(o)?{cached:o}:{}})},o=t=>(0,x.jsx)(p7,{size:`compact`,mono:!0,inputMode:`decimal`,"aria-label":`${e.name} ${t} price`,value:r[t],placeholder:`—`,onChange:e=>i({...r,[t]:e.target.value}),onBlur:a});return(0,x.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_5rem_5rem_5rem_6rem] items-center gap-2 px-3 py-2 sm:px-4`,children:[(0,x.jsxs)(`span`,{className:`min-w-0 truncate text-sm`,children:[e.name,` `,(0,x.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`· `,e.connection]})]}),o(`input`),o(`cached`),o(`output`),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n?n.source||`bundled`:`set a price`})]})}function ww({open:e,onOpenChange:t,existing:n,devMock:r,onAdded:i}){let a=ku(),o=C(),s=W(a.settings.saveConnection.mutationOptions()),[c,l]=b.useState(0),[u,d]=b.useState(``),[f,p]=b.useState(``),[m,h]=b.useState(``),[g,_]=b.useState(!1),[v,y]=b.useState(``),[S,w]=b.useState(``),[T,E]=b.useState(``);b.useEffect(()=>{e||(l(0),d(``),p(``),h(``),_(!1),y(``),w(``),E(``))},[e]);let D=r?[...rw,{kind:`mock`,label:`Replay (development)`,description:`Scripted streams, no network`}]:rw,O=m?m.length>64?`Instance ID must be 64 characters or fewer.`:/^[A-Za-z][A-Za-z0-9_-]*$/.test(m)?n.includes(m)?`An instance named '${m}' already exists.`:``:`Instance ID must start with a letter and use only letters, digits, '-', or '_'.`:`Instance ID is required.`,k=u!==`claude-subscription`&&u!==`mock`,A=[`Provider`,`Identity`,k?`Config`:`Check`],j=e=>{d(e);let t=D.find(t=>t.kind===e)?.label||e;p(t);let r=e===`claude-subscription`?`claude`:e.replace(/[^a-z0-9]+/g,`-`).replace(/-+$/,``),i=2,a=r;for(;n.includes(r);)r=`${a}-${i++}`;h(r),l(1)};return(0,x.jsx)(Kb,{open:e,onOpenChange:t,children:(0,x.jsxs)(Jb,{className:`max-w-xl`,title:`Add provider`,description:`Add an API key, or use your Claude plan through Claude Code.`,footer:(0,x.jsxs)(x.Fragment,{children:[T&&(0,x.jsx)(`span`,{className:`me-auto self-center text-xs text-destructive-foreground`,children:T}),(0,x.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>c===0?t(!1):l(c-1),children:c===0?`Cancel`:`Back`}),c===1&&(0,x.jsx)(J,{size:`sm`,disabled:!!O,onClick:()=>l(2),children:`Next`}),c===2&&(0,x.jsx)(J,{size:`sm`,disabled:s.isPending||k&&!v.trim()||u===`openai-compatible`&&!S.trim(),onClick:async()=>{E(``);try{await s.mutateAsync({connection:{id:m,kind:u,name:f.trim()||m,enabled:!0,models:[],...S.trim()?{baseURL:S.trim()}:u===`zai`?{baseURL:aw.general}:{}},...k&&v.trim()?{apiKey:v.trim()}:{}}),o.invalidateQueries({queryKey:a.settings.get.queryKey()}),o.invalidateQueries({queryKey:a.models.queryKey()}),i(m),t(!1)}catch(e){E(`Could not add the provider: ${e.message}`)}},children:s.isPending?`Adding...`:`Add provider`})]}),children:[(0,x.jsx)(`ol`,{className:`mb-4 flex items-center gap-2 text-xs`,children:A.map((e,t)=>(0,x.jsxs)(`li`,{className:K(`flex items-center gap-2`,t===c?`font-medium text-foreground`:`text-muted-foreground`),children:[(0,x.jsx)(`span`,{className:K(`inline-flex size-5 items-center justify-center rounded-full border text-2xs`,t<c&&`border-primary bg-primary text-primary-foreground`,t===c&&`border-foreground`),children:t<c?(0,x.jsx)(zd,{className:`size-3`}):t+1}),e,t<A.length-1&&(0,x.jsx)(`span`,{className:`h-px w-6 bg-border`})]},e))}),c===0&&(0,x.jsx)(`div`,{className:`grid gap-1.5`,children:D.map(e=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>j(e.kind),className:`flex items-center gap-3 rounded-lg border border-border/60 px-3 py-2.5 text-left outline-none hover:bg-muted/30 focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,x.jsx)(NC,{kind:e.kind}),(0,x.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),(0,x.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.description})]})]},e.kind))}),c===1&&(0,x.jsxs)(`div`,{className:`grid gap-4`,children:[(0,x.jsx)(_7,{label:`Label`,description:`Shown in the provider list.`,children:(0,x.jsx)(p7,{autoFocus:!0,placeholder:`e.g. Work`,value:f,onChange:e=>{p(e.target.value),g||h(e.target.value.toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``))}})}),(0,x.jsx)(_7,{label:`Instance ID`,description:`Letters, digits, '-', or '_'.`,children:(0,x.jsx)(p7,{mono:!0,value:m,onChange:e=>{h(e.target.value),_(!0)}})}),O&&m!==``&&(0,x.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:O})]}),c===2&&(0,x.jsxs)(`div`,{className:`grid gap-4`,children:[u===`openai-compatible`&&(0,x.jsx)(_7,{label:`Base URL`,description:`The endpoint that serves /chat/completions and /models.`,children:(0,x.jsx)(p7,{mono:!0,placeholder:`https://…/v1`,value:S,onChange:e=>w(e.target.value)})}),u===`zai`&&(0,x.jsx)(_7,{label:`Endpoint`,children:(0,x.jsx)(`div`,{className:`inline-flex w-fit rounded-[var(--control-radius)] border border-input p-0.5`,children:[`general`,`coding`].map(e=>(0,x.jsx)(`button`,{type:`button`,onClick:()=>w(aw[e]),className:K(`h-6 rounded-md px-2.5 text-xs`,(S||aw.general)===aw[e]?`bg-accent font-medium`:`text-muted-foreground`),children:e===`general`?`General API`:`Coding Plan`},e))})}),k&&(0,x.jsx)(_7,{label:`API key`,description:`Kept encrypted in rpf's credential store; never shown again.`,children:(0,x.jsx)(p7,{type:`password`,autoComplete:`off`,autoFocus:!0,value:v,onChange:e=>y(e.target.value)})}),u===`claude-subscription`&&(0,x.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Forge runs turns through Claude Code with your Claude plan. Claude Code keeps its own sign-in: if it isn't signed in yet, run`,` `,(0,x.jsx)(`code`,{className:`rounded bg-muted px-1`,children:`claude auth login`}),` in a terminal, then use Refresh on the provider. Usage counts against your plan's limits.`]}),u===`mock`&&(0,x.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The replay model plays scripted turns (development only).`})]})]})})}var Tw={"oauth-code":`Browser (OAuth, SSO and MFA work)`,basic:`Password`,apikey:`API key`,mtls:`Certificate`,"oauth-client":`Client credentials`,"oauth-password":`OAuth with password`,bearer:`Bearer token`},Ew=[`oauth-code`,`basic`,`apikey`,`mtls`,`oauth-client`,`oauth-password`,`bearer`],Dw={password:`Password`,clientSecret:`OAuth client secret`,token:`Access token`,apiKey:`API key`,keyPassphrase:`Client key passphrase`};function Ow(){let e=U({...ku().profiles.list.queryOptions(),retry:!1}),[t,n]=b.useState(null);if(e.error)return(0,x.jsx)(ow,{title:`Instances`,children:(0,x.jsx)(`div`,{className:`px-4 py-6 text-sm text-muted-foreground`,children:e.error.message})});let r=e.data,i=r?.store;return(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(ow,{title:`Instances`,plain:!0,action:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,title:i?.file,children:`same store as the CLI (~/.rpforge)`}),(0,x.jsxs)(J,{size:`xs`,variant:`outline`,disabled:i?.state===`unreadable`,onClick:()=>n(`new`),children:[(0,x.jsx)(wm,{}),` Add instance`]})]}),children:[i&&(i.state===`unavailable`||i.state===`unreadable`)&&(0,x.jsxs)(`div`,{className:`mx-3 mb-3 flex gap-2 rounded-lg border border-warning/30 bg-warning/8 px-3 py-2.5 text-xs sm:mx-4 dark:bg-warning/16`,children:[(0,x.jsx)(Km,{className:`mt-0.5 size-4 shrink-0 text-warning-foreground`}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`font-medium text-warning-foreground`,children:i.state===`unavailable`?`The OS keyring is not available`:`The credential store can't be read`}),(0,x.jsxs)(`div`,{className:`mt-0.5 text-muted-foreground`,children:[i.message,` `,i.state===`unavailable`?`Profiles without secrets (browser sign-in, certificates) still work. To store secrets, set RPFORGE_KEY_SOURCE=env and RPFORGE_ENCRYPTION_KEY, then restart Forge.`:`Forge never resets it. Run rpf doctor in a terminal to see why; profiles are read-only until it decrypts.`]})]})]}),t===`new`&&(0,x.jsx)(Mw,{kinds:r?.kinds||Ew,kindSecrets:r?.kindSecrets||{},taken:(r?.profiles||[]).map(e=>e.name),onDone:()=>n(null)}),(0,x.jsx)(`div`,{className:`@container`,children:(0,x.jsx)(`div`,{className:`grid gap-3 px-3 sm:px-4 @min-[44rem]:grid-cols-2`,children:(r?.profiles||[]).map(e=>t!==`new`&&t?.name===e.name?(0,x.jsx)(`div`,{className:`@min-[44rem]:col-span-2`,children:(0,x.jsx)(Mw,{profile:e,kinds:r?.kinds||Ew,kindSecrets:r?.kindSecrets||{},taken:(r?.profiles||[]).map(e=>e.name).filter(t=>t!==e.name),onDone:()=>n(null)})},e.name):(0,x.jsx)(kw,{p:e,login:(r?.logins||[]).find(t=>t.profile===e.name),readOnly:i?.state===`unreadable`,onEdit:()=>n(e)},e.name))})}),r&&!r.profiles.length&&t!==`new`&&(0,x.jsxs)(`div`,{className:`px-6 py-14 text-center`,children:[(0,x.jsx)(`p`,{className:`text-sm font-medium`,children:`No instances yet`}),(0,x.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Add the ServiceNow instance your portals live on. The CLI (rpf) sees it too.`}),(0,x.jsxs)(J,{size:`sm`,className:`mt-4`,onClick:()=>n(`new`),children:[(0,x.jsx)(wm,{}),` Add instance`]})]})]})})}function kw({p:e,login:t,readOnly:n,onEdit:r}){let i=ku(),a=C(),o=()=>a.invalidateQueries({queryKey:i.profiles.list.queryKey()}),s=W(i.profiles.verify.mutationOptions({onSettled:o})),c=W(i.profiles.setDefault.mutationOptions({onSuccess:o})),l=W(i.profiles.remove.mutationOptions({onSuccess:o})),u=W(i.profiles.logout.mutationOptions({onSuccess:o})),[d,f]=b.useState(!1),p=e.instance.replace(/^https?:\/\//,``).replace(/\/$/,``),m=e.kind.startsWith(`oauth-`),h=s.data;return(0,x.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card/40 p-4 shadow-xs/5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),e.default&&(0,x.jsxs)(Xb,{variant:`info`,children:[(0,x.jsx)(oh,{className:`size-3 fill-current`}),` default`]}),(0,x.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:Tw[e.kind]?.split(` (`)[0]||e.kind})]}),(0,x.jsx)(`div`,{className:`mt-1 truncate font-mono text-xs text-muted-foreground`,children:p}),(0,x.jsxs)(`dl`,{className:`mt-3 grid grid-cols-[6rem_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs`,children:[(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Sign-in`}),(0,x.jsx)(`dd`,{className:`truncate`,children:e.signIn}),m&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Token`}),(0,x.jsx)(`dd`,{className:K(/expired|none/.test(e.token)&&`text-warning-foreground`),children:e.token===`none`?`not signed in`:e.token})]}),e.secrets&&e.secrets.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Secrets`}),(0,x.jsxs)(`dd`,{children:[e.secrets.map(e=>Dw[e]||e).join(`, `),` · set`]})]}),(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Verified`}),(0,x.jsx)(`dd`,{children:s.isPending?(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,x.jsx)(g8,{size:`xs`}),` checking…`]}):s.error?(0,x.jsx)(`span`,{className:`text-destructive-foreground`,children:s.error.message}):h?h.enabled?(0,x.jsxs)(x.Fragment,{children:[`Forge runs as `,h.user,` · just now`]}):(0,x.jsxs)(`span`,{className:`text-warning-foreground`,children:[`Signed in; Forge is off on this instance (`,h.property,`)`]}):e.verifiedAt?(0,x.jsxs)(x.Fragment,{children:[`as `,e.verifiedAs,` ·`,` `,vu(e.verifiedAt)===`now`?`just now`:`${vu(e.verifiedAt)} ago`]}):(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`not yet`})}),e.projects.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Projects`}),(0,x.jsx)(`dd`,{className:`truncate`,children:e.projects.join(`, `)})]})]}),t?(0,x.jsx)(jw,{login:t}):d?(0,x.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[(0,x.jsxs)(`span`,{className:`me-auto text-xs text-muted-foreground`,children:[`Remove `,e.name,` and its secrets?`]}),(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,onClick:()=>f(!1),children:`Cancel`}),(0,x.jsx)(J,{size:`xs`,variant:`destructive`,onClick:()=>l.mutate({name:e.name}),children:`Remove`})]}):(0,x.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[(0,x.jsx)(J,{size:`xs`,variant:`outline`,disabled:s.isPending,onClick:()=>s.mutate({name:e.name}),children:`Verify`}),m&&(0,x.jsx)(Aw,{name:e.name,again:e.token!==`none`}),(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,disabled:n,onClick:r,children:`Edit`}),(0,x.jsxs)(Pb,{children:[(0,x.jsx)(Fb,{render:(0,x.jsx)(J,{size:`icon-xs`,variant:`ghost-muted`,className:`ms-auto`,"aria-label":`More actions for ${e.name}`}),children:(0,x.jsx)(vf,{})}),(0,x.jsxs)(Ib,{align:`end`,children:[!e.default&&(0,x.jsx)(Lb,{onClick:()=>c.mutate({name:e.name}),children:`Make default`}),m&&e.token!==`none`&&(0,x.jsx)(Lb,{onClick:()=>u.mutate({name:e.name}),children:`Sign out`}),(0,x.jsx)(Lb,{disabled:n,onClick:()=>f(!0),children:`Remove…`})]})]})]})]})}function Aw({name:e,again:t,label:n}){let r=ku(),i=C(),a=W(r.profiles.login.mutationOptions({onSuccess:()=>i.invalidateQueries({queryKey:r.profiles.list.queryKey()})}));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(J,{size:`xs`,variant:t?`ghost-muted`:`default`,disabled:a.isPending,onClick:()=>a.mutate({name:e,openBrowser:!0}),children:n||(t?`Sign in again`:`Sign in with browser`)}),a.error&&(0,x.jsx)(`span`,{className:`text-xs text-destructive-foreground`,children:a.error.message})]})}function jw({login:e}){let t=ku(),n=C(),r=W(t.profiles.loginPaste.mutationOptions()),i=W(t.profiles.loginCancel.mutationOptions({onSuccess:()=>n.invalidateQueries({queryKey:t.profiles.list.queryKey()})})),[a,o]=b.useState(``),[s,c]=b.useState(!1),[l,u]=b.useState(null);return b.useEffect(()=>{let t=t=>{let n=t.detail;n?.id===e.id&&u(n)};return window.addEventListener(`forge:login`,t),()=>window.removeEventListener(`forge:login`,t)},[e.id]),l?(0,x.jsx)(`p`,{className:K(`mt-3 text-xs`,l.ok?`text-success-foreground`:`text-destructive-foreground`),children:l.ok?`Signed in${l.user?`; Forge runs as ${l.user}`:``}.`:l.error}):e.url?(0,x.jsxs)(`div`,{className:`mt-3 space-y-2 rounded-lg border border-border/60 bg-muted/30 p-3`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,x.jsx)(g8,{size:`xs`}),(0,x.jsx)(`span`,{children:`Waiting for the sign-in in your browser…`}),(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,className:`ml-auto`,onClick:()=>i.mutate({id:e.id}),children:`Cancel`})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,x.jsxs)(J,{size:`xs`,variant:`outline`,onClick:()=>{navigator.clipboard.writeText(e.url),c(!0)},children:[(0,x.jsx)(uf,{}),` `,s?`Copied`:`Copy sign-in link`]}),(0,x.jsxs)(J,{size:`xs`,variant:`outline`,onClick:()=>window.open(e.url,`_blank`,`noopener`),children:[(0,x.jsx)(bf,{}),` Open browser again`]})]}),(0,x.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,x.jsx)(p7,{size:`compact`,className:`flex-1`,placeholder:`Page didn't load? Paste the address it ended on`,value:a,onChange:e=>o(e.target.value)}),(0,x.jsx)(J,{size:`xs`,disabled:!a.trim()||r.isPending,onClick:()=>r.mutate({id:e.id,value:a.trim()}),children:`Continue`})]}),r.error&&(0,x.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:r.error.message})]}):(0,x.jsxs)(`p`,{className:`mt-3 inline-flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,x.jsx)(g8,{size:`xs`}),` Signing in…`]})}function Mw({profile:e,kinds:t,kindSecrets:n,taken:r,onDone:i}){let a=ku(),o=C(),s=W(a.profiles.save.mutationOptions()),c=W(a.profiles.login.mutationOptions()),[l,u]=b.useState({name:e?.name||``,instance:e?.instance.replace(/^https?:\/\//,``).replace(/\.service-now\.com\/?$/,``)||``,kind:e?.kind||`oauth-code`,user:e?.user||``,clientId:e?.clientId||``,scope:e?.scope||``,redirectUri:e?.redirectUri||``,apiKeyHeader:e?.apiKeyHeader||``,cert:e?.cert||``,key:e?.key||``,ca:e?.ca||``}),[d,f]=b.useState({}),[p,m]=b.useState({}),[h,g]=b.useState(!1),[_,v]=b.useState(!0),[y,S]=b.useState(!!(e?.scope||e?.redirectUri||e?.cert)),w=e=>t=>u({...l,[e]:t.target.value}),T=n[l.kind]||{required:[],optional:[]},E=[...T.required,...T.optional,...l.key?[`keyPassphrase`]:[]].filter((e,t,n)=>n.indexOf(e)===t),D=new Set(e?.kind===l.kind&&e?.secrets||[]),O=l.name?/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(l.name)?r.includes(l.name)?`A profile named ${l.name} exists`:``:`Letters, digits, . _ - (up to 64)`:``,k=T.required.filter(e=>!d[e]&&!D.has(e)),A=l.kind===`basic`||l.kind===`oauth-password`,j=l.kind===`oauth-password`||l.kind===`oauth-client`,M=l.name&&l.instance&&!O&&!k.length&&(!A||l.user)&&(!j||l.clientId)&&(l.kind!==`mtls`||l.cert&&l.key);return(0,x.jsxs)(`div`,{className:`mx-3 mb-3 rounded-xl border border-border/60 bg-card/40 p-4 shadow-xs/5 sm:mx-4`,children:[(0,x.jsx)(`div`,{className:`mb-3 text-sm font-semibold`,children:e?`Edit ${e.name}`:`Add instance`}),(0,x.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,x.jsx)(_7,{label:`Name`,description:O||`How the CLI and Forge refer to it (dev, test…).`,children:(0,x.jsx)(p7,{autoFocus:!e,placeholder:`dev`,value:l.name,onChange:w(`name`)})}),(0,x.jsx)(_7,{label:`Instance`,description:`Its name or URL.`,children:(0,x.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(p7,{mono:!0,className:`flex-1`,placeholder:`acme-dev`,value:l.instance,onChange:w(`instance`)}),!/[./:]/.test(l.instance)&&(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`.service-now.com`})]})})]}),(0,x.jsxs)(`fieldset`,{className:`mt-4`,children:[(0,x.jsx)(`legend`,{className:`mb-1.5 text-xs font-medium`,children:`Sign in`}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,role:`radiogroup`,children:Ew.filter(e=>t.includes(e)).map(e=>(0,x.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":l.kind===e,onClick:()=>u({...l,kind:e}),className:K(`h-7 rounded-md border px-2.5 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring`,l.kind===e?`border-primary/50 bg-primary/8 font-medium text-foreground`:`border-input text-muted-foreground hover:text-foreground`),children:Tw[e]},e))})]}),(0,x.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[A&&(0,x.jsx)(_7,{label:`User name`,children:(0,x.jsx)(p7,{value:l.user,onChange:w(`user`),autoComplete:`off`})}),(j||l.kind===`oauth-code`)&&(0,x.jsx)(_7,{label:`OAuth client ID`,description:l.kind===`oauth-code`?`Empty: React Portal's Forge MCP client.`:`From the Application Registry.`,children:(0,x.jsx)(p7,{mono:!0,value:l.clientId,onChange:w(`clientId`)})}),l.kind===`apikey`&&(0,x.jsx)(_7,{label:`API key header`,description:`Default x-sn-apikey.`,children:(0,x.jsx)(p7,{mono:!0,placeholder:`x-sn-apikey`,value:l.apiKeyHeader,onChange:w(`apiKeyHeader`)})}),E.map(e=>(0,x.jsx)(_7,{label:`${Dw[e]||e}${T.required.includes(e)?``:` (optional)`}`,children:D.has(e)&&!p[e]?(0,x.jsxs)(`span`,{className:`flex h-7.5 items-center gap-2 text-xs text-muted-foreground`,children:[`set ·`,(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>m({...p,[e]:!0}),children:`Replace`})]}):(0,x.jsx)(p7,{type:`password`,autoComplete:`new-password`,value:d[e]||``,onChange:t=>f({...d,[e]:t.target.value})})},e)),(l.kind===`mtls`||y)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(_7,{label:`Client certificate${l.kind===`mtls`?``:` (optional)`}`,description:`Path to the PEM file.`,children:(0,x.jsx)(p7,{mono:!0,placeholder:`C:\\certs\\client.pem`,value:l.cert,onChange:w(`cert`)})}),(0,x.jsx)(_7,{label:`Client key${l.kind===`mtls`?``:` (optional)`}`,description:`Path to the PEM file.`,children:(0,x.jsx)(p7,{mono:!0,placeholder:`C:\\certs\\client.key`,value:l.key,onChange:w(`key`)})}),(0,x.jsx)(_7,{label:`Private CA (optional)`,description:`Path to the PEM file of a private server CA.`,children:(0,x.jsx)(p7,{mono:!0,value:l.ca,onChange:w(`ca`)})})]}),y&&l.kind===`oauth-code`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(_7,{label:`Scope (optional)`,children:(0,x.jsx)(p7,{mono:!0,value:l.scope,onChange:w(`scope`)})}),(0,x.jsx)(_7,{label:`Redirect URI`,description:`Default http://localhost:8765/callback.`,children:(0,x.jsx)(p7,{mono:!0,placeholder:`http://localhost:8765/callback`,value:l.redirectUri,onChange:w(`redirectUri`)})})]})]}),l.kind!==`mtls`&&(0,x.jsx)(`button`,{type:`button`,onClick:()=>S(!y),className:`mt-3 text-xs text-muted-foreground underline-offset-4 hover:underline`,children:y?`Fewer options`:`More options (certificate, scope, redirect)`}),(0,x.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-4 border-t border-border/50 pt-3`,children:[(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,x.jsx)(h7,{checked:h,onCheckedChange:e=>g(!!e)}),` Make it the default`]}),l.kind!==`oauth-code`&&(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,x.jsx)(h7,{checked:_,onCheckedChange:e=>v(!!e)}),` Check the instance after saving`]}),(0,x.jsxs)(`div`,{className:`ml-auto flex gap-2`,children:[(0,x.jsx)(J,{size:`sm`,variant:`outline`,onClick:i,children:`Cancel`}),(0,x.jsx)(J,{size:`sm`,disabled:!M||s.isPending,onClick:async()=>{let t={...l,makeDefault:h,verify:_,secrets:{}};for(let e of E)d[e]!==void 0&&(!D.has(e)||p[e])&&(t.secrets[e]=d[e]);e&&e.name!==l.name&&(t.replaces=e.name);try{let n=await s.mutateAsync(t);await o.invalidateQueries({queryKey:a.profiles.list.queryKey()}),l.kind!==`oauth-code`||e&&e.kind===`oauth-code`||await c.mutateAsync({name:n.profile,openBrowser:!0}).catch(()=>null),await o.invalidateQueries({queryKey:a.profiles.list.queryKey()}),i()}catch{}},children:s.isPending?`Saving…`:l.kind===`oauth-code`&&!e?`Save and sign in`:`Save`})]})]}),s.error&&(0,x.jsx)(`p`,{className:`mt-2 text-xs text-destructive-foreground`,children:s.error.message})]})}var Nw=`forge.hint`;function Pw({title:e,children:t}){return(0,x.jsxs)(`section`,{className:`grid gap-x-10 border-b border-border/60 py-4 sm:grid-cols-[7rem_minmax(0,1fr)]`,children:[(0,x.jsx)(`h2`,{className:`text-sm leading-10 text-muted-foreground`,children:e}),(0,x.jsx)(`div`,{className:`min-w-0`,children:t})]})}function Fw({icon:e,name:t,detail:n,ready:r,action:i}){return(0,x.jsxs)(`div`,{className:`flex min-h-10 items-center gap-3 py-1`,children:[(0,x.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center text-muted-foreground`,children:e}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:t}),n&&(0,x.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:n})]}),(0,x.jsx)(`div`,{className:`shrink-0`,children:r?(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,x.jsx)(zd,{className:`size-3.5`}),` Ready`]}):i})]})}function Iw({label:e,open:t,onToggle:n}){return(0,x.jsxs)(`button`,{type:`button`,onClick:n,"aria-expanded":t,className:`group flex min-h-10 w-full items-center gap-3 rounded-md text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,x.jsx)(`span`,{className:`flex size-5 items-center justify-center text-muted-foreground`,children:(0,x.jsx)(wm,{className:`size-4`})}),(0,x.jsx)(`span`,{className:`text-sm text-muted-foreground group-hover:text-foreground`,children:e}),(0,x.jsx)(Vd,{className:K(`ml-auto size-4 text-muted-foreground transition-transform`,t&&`rotate-180`)})]})}function Lw(){let e=ku(),t=C(),n=Ji(),r=U(e.meta.queryOptions()),i=U({...e.profiles.list.queryOptions(),retry:!1}),a=U(e.settings.get.queryOptions()),o=U(e.projects.list.queryOptions()),s=U(e.claude.status.queryOptions()),c=W(e.claude.refresh.mutationOptions()),l=W(e.settings.setOnboarded.mutationOptions()),u=Cx(),[d,f]=b.useState(!1),[p,m]=b.useState(!1),[h,g]=b.useState(``),[_,v]=b.useState(!1),y=i.data?.profiles||[],S=(a.data?.connections||[]).some(e=>e.kind===`claude-subscription`);b.useEffect(()=>{S&&s.data?.status===`unknown`&&!c.isPending&&c.mutate()},[S,s.data?.status]);let w=(a.data?.connections||[]).filter(e=>e.kind!==`mock`||r.data?.devMock),T=o.data||[],E=y.some(e=>e.verifiedAt),D=w.some(e=>e.enabled&&(e.kind===`claude-subscription`?s.data?.status===`ready`:!e.needsKey||e.key.set)),O=()=>l.mutate({done:!0},{onSuccess:()=>{t.invalidateQueries({queryKey:e.settings.get.queryKey()});let r=T[0];r?(localStorage.setItem(Nw,`1`),n({to:`/p/$projectId`,params:{projectId:r.id}})):n({to:`/`})}});return(0,x.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-background`,children:(0,x.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,x.jsxs)(`div`,{className:`mx-auto flex min-h-full w-full max-w-3xl flex-col px-6 pt-12 pb-8 sm:pt-20`,children:[(0,x.jsx)(`div`,{className:`self-start`,children:(0,x.jsx)(p8,{height:28})}),(0,x.jsx)(`h1`,{className:`mt-6 text-2xl font-semibold tracking-tight text-foreground`,children:`Welcome to Forge`}),(0,x.jsxs)(`p`,{className:`mt-1.5 text-sm text-muted-foreground`,children:[`Setting up `,(0,x.jsxs)(`span`,{className:`text-foreground`,children:[`rpf `,r.data?.version]}),` on this computer.`]}),(0,x.jsxs)(`div`,{className:`mt-10 border-t border-border/60`,children:[(0,x.jsxs)(Pw,{title:`Instance`,children:[y.map(e=>(0,x.jsx)(Fw,{icon:(0,x.jsx)(Bm,{className:`size-4`}),name:e.name,detail:`${e.instance.replace(/^https?:\/\//,``)} · ${e.signIn}${e.verifiedAt?` · signed in as ${e.verifiedAs}`:``}`,ready:!!e.verifiedAt,action:(0,x.jsx)(Rw,{name:e.name})},e.name)),y.length===0&&(0,x.jsx)(`p`,{className:`text-sm leading-10 text-muted-foreground`,children:`Add the ServiceNow instance your portals live on. The rpf CLI uses the same profiles.`}),(0,x.jsx)(Iw,{label:y.length?`Add another instance`:`Add an instance`,open:d,onToggle:()=>f(!d)}),d&&(0,x.jsx)(`div`,{className:`pb-2`,children:(0,x.jsx)(Mw,{kinds:i.data?.kinds||[],kindSecrets:i.data?.kindSecrets||{},taken:y.map(e=>e.name),onDone:()=>f(!1)})})]}),(0,x.jsxs)(Pw,{title:`AI provider`,children:[w.map(e=>(0,x.jsx)(Fw,{icon:(0,x.jsx)(NC,{kind:e.kind,name:e.name,accent:e.accentColor}),name:e.name,detail:e.kind===`claude-subscription`?s.data?.headline:e.needsKey&&!e.key.set?`Add a key in Settings › Providers and models`:void 0,ready:e.enabled&&(e.kind===`claude-subscription`?s.data?.status===`ready`:!e.needsKey||e.key.set),action:(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>n({to:`/welcome`,search:{settings:`providers`}}),children:`Set up`})},e.id)),w.length===0&&(0,x.jsx)(`p`,{className:`text-sm leading-10 text-muted-foreground`,children:`Add an API key, or use your Claude plan through Claude Code.`}),(0,x.jsx)(Iw,{label:w.length?`Add another provider`:`Add a provider`,open:p,onToggle:()=>m(!p)}),(0,x.jsx)(ww,{open:p,onOpenChange:m,existing:w.map(e=>e.id),devMock:!!r.data?.devMock,onAdded:()=>t.invalidateQueries({queryKey:e.settings.get.queryKey()})})]}),(0,x.jsxs)(Pw,{title:`First project`,children:[T.slice(0,3).map(e=>(0,x.jsx)(Fw,{icon:(0,x.jsx)(Mf,{className:`size-4`}),name:e.name,detail:e.path,ready:!0},e.id)),(0,x.jsx)(`div`,{className:`grid gap-2 py-2 sm:grid-cols-3`,children:[{id:`new`,icon:eh,label:`New portal`},{id:`pull`,icon:gf,label:`Pull a portal`},{id:`copy`,icon:uf,label:`Copy a portal`}].map(e=>(0,x.jsxs)(`button`,{type:`button`,disabled:!y.length,title:y.length?void 0:`Add an instance first`,onClick:()=>Uu({newProject:e.id}),className:`flex h-10 items-center gap-2.5 rounded-lg border bg-card/40 px-3 text-sm outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50`,children:[(0,x.jsx)(e.icon,{className:`size-4 text-icon-muted`}),` `,e.label]},e.id))}),(0,x.jsx)(Iw,{label:`Open a folder`,open:_,onToggle:()=>v(!_)}),_&&(0,x.jsxs)(`form`,{className:`flex gap-2 pb-2 ps-8`,onSubmit:e=>{e.preventDefault(),h.trim()&&u.mutate({path:h.trim()})},children:[(0,x.jsx)(p7,{size:`compact`,mono:!0,placeholder:`C:\\path\\to\\workspace`,value:h,onChange:e=>g(e.target.value),"aria-label":`Folder path`}),(0,x.jsx)(J,{size:`sm`,type:`submit`,disabled:!h.trim()||u.isPending,children:`Open`})]}),u.error&&(0,x.jsx)(`p`,{className:`ps-8 text-xs text-destructive-foreground`,children:u.error.message})]})]}),(0,x.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center justify-between gap-3`,children:[T.length?(0,x.jsx)(`span`,{}):(0,x.jsx)(J,{variant:`ghost-muted`,disabled:l.isPending,onClick:O,children:`Start without a project`}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3`,children:[!(E&&D)&&(0,x.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[E?`Set up a provider`:`Verify an instance`,` to use everything.`]}),(0,x.jsx)(J,{disabled:l.isPending,onClick:O,children:l.isPending?`Starting…`:`Start`})]})]}),(0,x.jsx)(`p`,{className:`mt-auto pt-12 text-2xs leading-relaxed text-muted-foreground/70`,children:`Forge runs on this computer. Keys and instance credentials stay in rpf's encrypted store; model calls go only to the providers you add.`})]})})})}function Rw({name:e}){let t=ku(),n=C(),r=W(t.profiles.verify.mutationOptions({onSettled:()=>n.invalidateQueries({queryKey:t.profiles.list.queryKey()})}));return(0,x.jsxs)(`span`,{className:`flex items-center gap-2`,children:[r.error&&(0,x.jsx)(`span`,{className:`max-w-56 truncate text-xs text-destructive-foreground`,children:r.error.message}),(0,x.jsx)(J,{size:`xs`,variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({name:e}),children:r.isPending?`Checking…`:`Verify`})]})}function zw(){let[e,t]=b.useState(()=>localStorage.getItem(Nw)===`1`);return e?(0,x.jsxs)(`div`,{className:`mx-auto mb-4 flex max-w-xl items-start gap-3 rounded-xl border border-info/30 bg-info/8 px-4 py-3 text-sm dark:bg-info/16`,children:[(0,x.jsx)(eh,{className:`mt-0.5 size-4 shrink-0 text-info-foreground`}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`p`,{className:`font-medium`,children:`Your project is open`}),(0,x.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`The portal runs in Preview on the right as you. Ask Forge below to change it; edits show as rows you can diff and undo, and nothing reaches the instance until you push.`})]}),(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,onClick:()=>{localStorage.removeItem(Nw),t(!1)},children:`Got it`})]}):null}var Bw=`vercel.ai.error`,Vw=Symbol.for(Bw),Hw=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[Vw]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,Bw)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}},Uw=`AI_APICallError`,Ww=`vercel.ai.error.${Uw}`,Gw=Symbol.for(Ww),Kw=class extends Hw{constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:i,responseBody:a,cause:o,isRetryable:s=r!=null&&(r===408||r===409||r===429||r>=500),data:c}){super({name:Uw,message:e,cause:o}),this[Gw]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=a,this.isRetryable=s,this.data=c}static isInstance(e){return Hw.hasMarker(e,Ww)}},qw=`AI_EmptyResponseBodyError`,Jw=`vercel.ai.error.${qw}`,Yw=Symbol.for(Jw),Xw=class extends Hw{constructor({message:e=`Empty response body`}={}){super({name:qw,message:e}),this[Yw]=!0}static isInstance(e){return Hw.hasMarker(e,Jw)}};function Zw(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var Qw=`AI_InvalidArgumentError`,$w=`vercel.ai.error.${Qw}`,eT=Symbol.for($w),tT=class extends Hw{constructor({message:e,cause:t,argument:n}){super({name:Qw,message:e,cause:t}),this[eT]=!0,this.argument=n}static isInstance(e){return Hw.hasMarker(e,$w)}},nT=`AI_JSONParseError`,rT=`vercel.ai.error.${nT}`,iT=Symbol.for(rT),aT=class extends Hw{constructor({text:e,cause:t}){super({name:nT,message:`JSON parsing failed: Text: ${e}.\nError message: ${Zw(t)}`,cause:t}),this[iT]=!0,this.text=e}static isInstance(e){return Hw.hasMarker(e,rT)}},oT=`AI_TypeValidationError`,sT=`vercel.ai.error.${oT}`,cT=Symbol.for(sT),lT=class e extends Hw{constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:oT,message:`${r}: Value: ${JSON.stringify(e)}.\nError message: ${Zw(t)}`,cause:t}),this[cT]=!0,this.value=e,this.context=n}static isInstance(e){return Hw.hasMarker(e,sT)}static wrap({value:t,cause:n,context:r}){return e.isInstance(n)&&n.value===t&&n.context?.field===r?.field&&n.context?.entityName===r?.entityName&&n.context?.entityId===r?.entityId?n:new e({value:t,cause:n,context:r})}},uT=`AI_UnsupportedFunctionalityError`,dT=`vercel.ai.error.${uT}`,fT=Symbol.for(dT),pT=class extends Hw{constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:uT,message:t}),this[fT]=!0,this.functionality=e}static isInstance(e){return Hw.hasMarker(e,dT)}};function mT(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function hT(e,t=`|`){return e.map(e=>UT(e)).join(t)}function gT(e,t){return typeof t==`bigint`?t.toString():t}var _T=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function vT(e){return new _T(e)}function yT(e){return e==null}function bT(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function xT(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var ST=Symbol(`evaluating`);function CT(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ST)return r===void 0&&(r=ST,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function wT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function TT(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function ET(e){return TT(e._zod.def)??e._zod.def.shape}function DT(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return wT(this,t,e),e},enumerable:!0,configurable:!0})}function OT(e,t,n){t in e?wT(e,t,n):e[t]=n}function kT(e,t,n,r){let i=ET(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?DT(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):OT(e,a,r?r(n.value,a):n.value))}}function AT(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?DT(e,n,()=>t[n]):OT(e,n,r.value))}}function jT(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function MT(e){return JSON.stringify(e)}function NT(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var PT=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function FT(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var IT=vT(()=>{if(kE.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function LT(e){if(FT(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return FT(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function RT(e){return LT(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var zT=new Set([`string`,`number`,`symbol`]);function BT(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function VT(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function HT(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw 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 UT(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function WT(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var GT={safeint:[-(2**53-1),2**53-1],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},KT={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function qT(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return kT(i,e,JT(e,t)),VT(e,jT(n,{shape:i,checks:[]}))}function JT(e,t){let n=ET(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function YT(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(JT(e,t)),a={};return kT(a,e,Reflect.ownKeys(ET(e)).filter(e=>!i.has(e))),VT(e,jT(n,{shape:a,checks:[]}))}function XT(e,t){if(!LT(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=ET(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return VT(e,jT(e._zod.def,{shape:ZT(e,t)}))}function ZT(e,t){let n={};return kT(n,e,Reflect.ownKeys(ET(e))),AT(n,t),n}function QT(e,t){if(!LT(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return VT(e,jT(e._zod.def,{shape:ZT(e,t)}))}function $T(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return kT(n,e,Reflect.ownKeys(ET(e))),kT(n,t,Reflect.ownKeys(ET(t))),VT(e,jT(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function eE(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(JT(t,n)):void 0,o={};return kT(o,t,Reflect.ownKeys(ET(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),VT(t,jT(t._zod.def,{shape:o,checks:[]}))}function tE(e,t,n){let r=n?new Set(JT(t,n)):void 0,i={};return kT(i,t,Reflect.ownKeys(ET(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),VT(t,jT(t._zod.def,{shape:i}))}function nE(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function rE(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function iE(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function aE(e){return typeof e==`string`?e:e?.message}function oE(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function sE(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function cE(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:aE(e.inst?._zod.def?.error?.(e))??aE(a?.(e))??aE(t?.error?.(e))??aE(n.customError?.(e))??aE(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var lE=/[\uD800-\uDBFF]/;function uE(e){let t=e.length;if(!lE.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function dE(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function fE(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function pE(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function mE(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):vE(e,n,r.value)}}function hE(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function gE(e,t,n){return hE(e,t,n,!1)}function _E(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return hE(this,n,r(this))},set(e){hE(this,n,e)}})}return t}function vE(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:hE(this,t,n.bind(this))},set(e){hE(this,t,e)}})}function yE(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var bE,xE=!1,_ee={configurable:!0,get(){xE=!0}};function SE(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&bE!==e._zod?bE=void 0:(bE=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,_ee);let e=xE;xE=!1;try{let r=n(this);return xE?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),xE||=e,r}catch(n){throw delete this[t],xE||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function CE(e,t,n,r){let i=yE(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var vee=`~constantCatch`;function yee(e){let t=()=>e;return t[vee]=!0,t}var wE,bee=Object.freeze({status:`aborted`}),TE={value:void 0,enumerable:!1},EE=`captureStackTrace`in Error?Error:null;function xee(e){let t=EE;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return EE=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function X(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){TE.value=new a(r);try{Object.defineProperty(n,"_zod",TE)}finally{TE.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),mE(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?xee(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var DE=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},OE=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(wE=globalThis).__zod_globalConfig??(wE.__zod_globalConfig={});var kE=globalThis.__zod_globalConfig;function AE(e){return e&&Object.assign(kE,e),kE}function See(){let e=this._zod;return e.message??=JSON.stringify(e.def,gT,2),e.message}function Cee(e){this._zod.message=e}var wee={get:See,set:Cee,enumerable:!0,configurable:!0},jE={value:void 0,enumerable:!1},ME=new WeakSet([Object.prototype,Error.prototype]),NE=(e,t)=>{e.name=`$ZodError`,jE.value=t,Object.defineProperty(e,"issues",jE),jE.value=void 0,Object.defineProperty(e,"message",wee);let n=Object.getPrototypeOf(e);ME.has(n)||(ME.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Tee=X(`$ZodError`,NE),PE=X(`$ZodError`,NE,void 0,{Parent:Error});function Eee(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Dee(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Eee(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Oee(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function FE(e,t){return{callee:t?.callee??e,Err:t?.Err}}var IE=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new DE;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>cE(e,o,AE())));throw PT(n,a?.callee??t),n}return s.value};return t},kee=IE(PE),LE=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>cE(e,o,AE())));throw PT(n,a?.callee??t),n}return s.value};return t},Aee=LE(PE),RE=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new DE;return a.issues.length?BE(e,a.issues,i):{success:!0,data:a.value}},zE=RE(PE);function BE(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>cE(e,n,AE()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var VE=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?BE(e,a.issues,i):{success:!0,data:a.value}},HE=VE(PE),UE=Symbol.for(`zod.compile.invalid`),WE=Symbol.for(`zod.compile.fallback`),GE=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==UE)return!0;if(r.definite===!0&&n===void 0)return!1}return KE(e,t,n)});function KE(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[WE]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new DE;return a.issues.length===0}var qE=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},JE=e=>{let t=IE(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,FE(n,a))};return n},YE=e=>{let t=IE(e),n=(e,r,i,a)=>t(e,r,i,FE(n,a));return n},XE=e=>{let t=LE(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,FE(n,a))};return n},ZE=e=>{let t=LE(e),n=async(e,r,i,a)=>await t(e,r,i,FE(n,a));return n},QE=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return RE(e)(t,n,i)},$E=e=>(t,n,r)=>RE(e)(t,n,r),eD=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return VE(e)(t,n,i)},tD=e=>async(t,n,r)=>VE(e)(t,n,r),nD=/^[cC][0-9a-z]{6,}$/,rD=/^[0-9a-z]+$/,iD=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,aD=/^[0-9a-vA-V]{20}$/,oD=/^[A-Za-z0-9]{27}$/,sD=/^[a-zA-Z0-9_-]{21}$/;function cD(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var lD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,uD=/^([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})$/,dD=e=>e?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)$/,fD=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pD=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function mD(){return new RegExp(pD,`u`)}var hD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gD=/^(([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}|:))$/,_D=/^((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])$/,vD=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bD=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,xD=/^https?$/,SD=/^\+[1-9]\d{6,14}$/,CD=`(?:(?:\\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])))`;function wD(e){return RegExp(`^${e}$`)}var TD=wD(CD);function ED(e){let 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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function DD(e){return RegExp(`^${ED(e)}$`)}function OD(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${ED({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${ED({precision:e.precision})}`:n;return RegExp(`^${CD}T(?:${r})$`)}var kD=/^[\s\S]{0,}$/,AD=/^-?\d+$/,jD=/^-?\d+(?:\.\d+)?$/,MD=/^(?:true|false)$/i,ND=/^null$/i,PD=/^[^A-Z]*$/,FD=/^[^a-z]*$/,ID=X(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),LD=e=>{let t=e.value;return!yT(t)&&t.length!==void 0},RD={number:`number`,bigint:`bigint`,object:`date`},zD=X(`$ZodCheckLessThan`,(e,t)=>{ID.init(e,t);let n=RD[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:RD[typeof r.value]??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})}}),BD=X(`$ZodCheckGreaterThan`,(e,t)=>{ID.init(e,t);let n=RD[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:RD[typeof r.value]??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})}}),VD=X(`$ZodCheckMultipleOf`,(e,t)=>{ID.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):xT(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})}}),HD=X(`$ZodCheckNumberFormat`,(e,t)=>{ID.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=GT[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),UD=X(`$ZodCheckMaxLength`,(e,t)=>{var n;ID.init(e,t),(n=e._zod.def).when??(n.when=LD),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?uE(r):i)<=t.maximum)return;let a=dE(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),WD=X(`$ZodCheckMinLength`,(e,t)=>{var n;ID.init(e,t),(n=e._zod.def).when??(n.when=LD),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?uE(r):i)>=t.minimum)return;let a=dE(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),GD=X(`$ZodCheckLengthEquals`,(e,t)=>{var n;ID.init(e,t),(n=e._zod.def).when??(n.when=LD),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?uE(r):i;if(a===t.length)return;let o=dE(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),KD=X(`$ZodCheckStringFormat`,(e,t)=>{var n,r;ID.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),qD=X(`$ZodCheckRegex`,(e,t)=>{KD.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})}}),JD=X(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=PD,KD.init(e,t)}),YD=X(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=FD,KD.init(e,t)}),XD=X(`$ZodCheckIncludes`,(e,t)=>{ID.init(e,t);let n=BT(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ZD=X(`$ZodCheckStartsWith`,(e,t)=>{ID.init(e,t);let n=RegExp(`^${BT(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),QD=X(`$ZodCheckEndsWith`,(e,t)=>{ID.init(e,t);let n=RegExp(`.*${BT(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function $D(e,t,n){e.issues.length&&t.issues.push(...iE(n,e.issues))}var eO=X(`$ZodCheckProperties`,(e,t)=>{ID.init(e,t),gE(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>$D(t,r,e)))):$D(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),tO=X(`$ZodCheckOverwrite`,(e,t)=>{ID.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),nO=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
186
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
187
|
+
`)}\n};`)(...Object.values(this.closed))}},rO={major:4,minor:6,patch:7},iO=X(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rO;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=nE(t),a;for(let o of n){if(o._zod.def.when){if(rE(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new DE;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(sE(t.issues,n,e),i||=nE(t,n))});else{if(t.issues.length===n)continue;sE(t.issues,n,e),i||=nE(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(nE(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new DE;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new DE;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return gE(this,`~standard`,sO(this))},set"~standard"(e){hE(this,`~standard`,e)}}),aO=(e,t)=>e.issues.length?{issues:e.issues.map(e=>cE(e,t,AE()))}:{value:e.value};async function oO(e,t){let n={async:!0};return aO(await e._zod.run({value:t,issues:[]},n),n)}function sO(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return aO(r,n)}catch{}return oO(e,t)},vendor:`zod`,version:1}}var cO=X(`$ZodString`,(e,t)=>{iO.init(e,t),e._zod.pattern=t.pattern??kD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),lO=X(`$ZodStringFormat`,(e,t)=>{KD.init(e,t),cO.init(e,t)}),uO=X(`$ZodGUID`,(e,t)=>{t.pattern??=uD,lO.init(e,t)}),dO=X(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=dD(e)}else t.pattern??=dD();lO.init(e,t)}),fO=X(`$ZodEmail`,(e,t)=>{t.pattern??=fD,lO.init(e,t)});function pO(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function mO(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?pO(e)||2:hO(e,t)}function hO(e,t){if(!t.normalize&&t.protocol?.source===xD.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var gO=/[\t\n\r]/g;function _O(e){return e.replace(gO,``)}function vO(e,t){return t.lastIndex=0,t.test(e.hostname)}function yO(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var bO=X(`$ZodURL`,(e,t)=>{lO.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=mO(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=_O(r);return}t.hostname&&!vO(i,t.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&&!yO(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:_O(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),xO=X(`$ZodEmoji`,(e,t)=>{t.pattern??=mD(),lO.init(e,t)}),SO=X(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?sD:cD(t.length),lO.init(e,t)}),CO=X(`$ZodCUID`,(e,t)=>{t.pattern??=nD,lO.init(e,t)}),wO=X(`$ZodCUID2`,(e,t)=>{t.pattern??=rD,lO.init(e,t)}),TO=X(`$ZodULID`,(e,t)=>{t.pattern??=iD,lO.init(e,t)}),EO=X(`$ZodXID`,(e,t)=>{t.pattern??=aD,lO.init(e,t)}),DO=X(`$ZodKSUID`,(e,t)=>{t.pattern??=oD,lO.init(e,t)}),OO=X(`$ZodISODateTime`,(e,t)=>{t.pattern??=OD(t),lO.init(e,t)}),kO=X(`$ZodISODate`,(e,t)=>{t.pattern??=TD,lO.init(e,t)}),AO=X(`$ZodISOTime`,(e,t)=>{t.pattern??=DD(t),lO.init(e,t)}),jO=X(`$ZodISODuration`,(e,t)=>{t.pattern??=lD,lO.init(e,t)}),MO=X(`$ZodIPv4`,(e,t)=>{t.pattern??=hD,lO.init(e,t)}),NO=/^[0-9a-fA-F:.]+$/;function PO(e){return NO.test(e)?pO(`http://[${e}]`):!1}var FO=X(`$ZodIPv6`,(e,t)=>{t.pattern??=gD,lO.init(e,t),e._zod.check=n=>{PO(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),IO=X(`$ZodCIDRv4`,(e,t)=>{t.pattern??=_D,lO.init(e,t)});function LO(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:PO(n)}var RO=X(`$ZodCIDRv6`,(e,t)=>{t.pattern??=vD,lO.init(e,t),e._zod.check=n=>{LO(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function zO(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var BO=/^[0-9a-zA-Z+/]*={0,2}$/,VO=X(`$ZodBase64`,(e,t)=>{t.pattern??=BO,lO.init(e,t),e._zod.check=n=>{zO(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),HO=/^[A-Za-z0-9_-]*$/;function UO(e){if(!HO.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return zO(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var WO=X(`$ZodBase64URL`,(e,t)=>{t.pattern??=HO,lO.init(e,t),e._zod.check=n=>{UO(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),GO=X(`$ZodE164`,(e,t)=>{t.pattern??=SD,lO.init(e,t)});function KO(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var qO=X(`$ZodJWT`,(e,t)=>{lO.init(e,t),e._zod.check=n=>{KO(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),JO=X(`$ZodNumber`,(e,t)=>{iO.init(e,t),e._zod.pattern=jD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),YO=X(`$ZodNumberFormat`,(e,t)=>{HD.init(e,t),JO.init(e,t)}),XO=X(`$ZodBoolean`,(e,t)=>{iO.init(e,t),e._zod.pattern=MD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),ZO=X(`$ZodNull`,(e,t)=>{iO.init(e,t),e._zod.pattern=ND,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),QO=X(`$ZodUnknown`,(e,t)=>{iO.init(e,t),e._zod.parse=e=>e}),$O=X(`$ZodNever`,(e,t)=>{iO.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ek(e,t){let n=oE(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of oE(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,sE(n.issues,t,e),n}}return i(n,a)}}var tk=e=>Array.isArray(e)?e.length:-1;function nk(e,t,n){e.issues.length&&t.issues.push(...iE(n,e.issues)),t.value[n]=e.value}var rk=X(`$ZodArray`,(e,t)=>{iO.init(e,t);let n=kE.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>nk(t,r,e)));else if(nk(c,r,e),s&&c.issues.length!==0&&nE(c))break}return o.length?Promise.all(o).then(()=>r):r},ek(e,tk)});function ik(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...iE(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var ak=[];function ok(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ak,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=WT(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function sk(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(nE(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ik(e,n,i,t,d,f))):ik(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var ck=X(`$ZodObject`,(e,t)=>{iO.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=vT(()=>ok(t));SE(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||wT(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=FT,o=t.catchall,s,c=kE.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(nE(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>ik(n,t,e,r,a,o))):ik(s,t,e,r,a,o)}return o?sk(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),lk=X(`$ZodObjectJIT`,(e,t)=>{ck.init(e,t);let n=e._zod.parse,r=vT(()=>ok(t)),i=kE.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new nO([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
188
|
+
let ${e}_ab = false;
|
|
189
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
190
|
+
const iss = ${e}.issues[i];
|
|
191
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
192
|
+
payload.issues.push(iss);
|
|
193
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
194
|
+
}
|
|
195
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
196
|
+
payload.value = newResult;
|
|
197
|
+
return payload;
|
|
198
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:MT(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
199
|
+
const ${n}_present = ${i};
|
|
200
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
201
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (${e}) {
|
|
205
|
+
newResult[${r}] = ${n}.value;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
`)}else f?(o.write(`
|
|
210
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
211
|
+
}
|
|
212
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
213
|
+
if (${n}.value !== undefined || ${i}) {
|
|
214
|
+
newResult[${r}] = ${n}.value;
|
|
215
|
+
}
|
|
216
|
+
`)):o.write(`
|
|
217
|
+
const ${n}_present = ${i};
|
|
218
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
219
|
+
}
|
|
220
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
221
|
+
payload.issues.push({
|
|
222
|
+
code: "invalid_type",
|
|
223
|
+
expected: "nonoptional",
|
|
224
|
+
input: undefined,
|
|
225
|
+
path: [${r}]
|
|
226
|
+
});
|
|
227
|
+
if (ctx && ctx.abortEarly) {
|
|
228
|
+
payload.value = newResult;
|
|
229
|
+
return payload;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (${n}_present) {
|
|
234
|
+
newResult[${r}] = ${n}.value;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=FT,c=!kE.jitless,l=c&&IT.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?sk([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function uk(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!nE(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>cE(e,r,AE())))}),t)}var dk=X(`$ZodUnion`,(e,t)=>{iO.init(e,t),SE(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),SE(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),SE(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),SE(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>bT(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>uk(t,r,e,i)):uk(o,r,e,i)}});function fk(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var pk=X(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,dk.init(e,t);let n=e._zod.parse;SE(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||wT(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=TT(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=vT(()=>fk(t));e._zod.parse=(i,a)=>{let o=i.value;if(!FT(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),mk=X(`$ZodIntersection`,(e,t)=>{iO.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>gk(e,t,n)):gk(e,i,a)}});function hk(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(LT(e)&<(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=hk(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=hk(e[r],t[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function gk(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=hk(t.value,n.value);if(!c.valid){if(nE(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var _k=X(`$ZodRecord`,(e,t)=>{iO.init(e,t);let n=kE.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!LT(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>cE(e,i,AE())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...iE(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...iE(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&jD.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>cE(e,i,AE())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...iE(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...iE(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),vk=X(`$ZodEnum`,(e,t)=>{iO.init(e,t);let n=mT(t.entries),r=new Set(n);e._zod.values=r,SE(e,`pattern`,e=>{let t=mT(e.def.entries).filter(e=>zT.has(typeof e));return RegExp(t.length?`^(${t.map(e=>BT(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),yk=X(`$ZodLiteral`,(e,t)=>{iO.init(e,t);let n=new Set(t.values);e._zod.values=n,SE(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?BT(e):e?BT(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),bk=X(`$ZodTransform`,(e,t)=>{iO.init(e,t),e._zod.optin=`optional`,kE.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new OE(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new DE;return n.value=i,n}});function xk(e,t){return e.value=t.issues.length?void 0:t.value,e}var Sk=X(`$ZodOptional`,(e,t)=>{iO.init(e,t),SE(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,SE(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),SE(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${bT(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>xk(e,t)):xk(e,r)}return t.innerType._zod.run(e,n)}}),Ck=X(`$ZodExactOptional`,(e,t)=>{Sk.init(e,t),SE(e,`values`,e=>e.def.innerType._zod.values),SE(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),wk=X(`$ZodNullable`,(e,t)=>{iO.init(e,t),SE(e,`optin`,e=>e.def.innerType._zod.optin),SE(e,`optout`,e=>e.def.innerType._zod.optout),SE(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${bT(t.source)}|null)$`):void 0}),SE(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Tk=X(`$ZodDefault`,(e,t)=>{iO.init(e,t),e._zod.optin=`defaulted`,SE(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ek(e,t)):Ek(r,t)}});function Ek(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Dk=X(`$ZodPrefault`,(e,t)=>{iO.init(e,t),e._zod.optin=`defaulted`,SE(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ok=X(`$ZodNonOptional`,(e,t)=>{iO.init(e,t),SE(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>kk(t,e)):kk(i,e)}});function kk(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Ak(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>cE(e,r,AE()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var jk=X(`$ZodCatch`,(e,t)=>{iO.init(e,t),SE(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),SE(e,`optout`,e=>e.def.innerType._zod.optout),SE(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Ak(e,r,t,n)):Ak(e,r,t,n)}}),Mk=X(`$ZodPipe`,(e,t)=>{iO.init(e,t),SE(e,`values`,e=>e.def.in._zod.values),SE(e,`optin`,e=>e.def.in._zod.optin),SE(e,`optout`,e=>e.def.out._zod.optout),SE(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Nk(e,t.in,n)):Nk(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Nk(e,t.out,n)):Nk(r,t.out,n)}});function Nk(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Pk=X(`$ZodReadonly`,(e,t)=>{iO.init(e,t),SE(e,`propValues`,e=>e.def.innerType._zod.propValues),SE(e,`values`,e=>e.def.innerType._zod.values),SE(e,`optin`,e=>e.def.innerType?._zod?.optin),SE(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Fk):Fk(r)}});function Fk(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Ik=X(`$ZodLazy`,(e,t)=>{iO.init(e,t),CT(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),SE(e,`pattern`,e=>e.innerType?._zod?.pattern),SE(e,`propValues`,e=>e.innerType?._zod?.propValues),SE(e,`optin`,e=>e.innerType?._zod?.optin??void 0),SE(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Lk=X(`$ZodCustom`,(e,t)=>{ID.init(e,t),iO.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Rk(t,n,r,e));Rk(i,n,r,e)}});function Rk(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(pE(e))}}var zk=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Bk=`~memo`,Vk=[];function Hk(e){return typeof e==`object`&&!!e}function Uk(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Wk=new WeakMap,Gk=0,Kk=1,qk=2;function Jk(e,t,n){let r=Wk.get(e);if(r!==void 0)return r?qk:Gk;if(t.has(e))return qk;t.add(e);let i=Gk,a=e=>{if(i!==qk&&e?._zod){let r=Jk(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Gk;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Kk:o.value?._zod?Jk(o.value,t,n):Gk;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=TT(c);s(e?o(e,!0):Kk),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Jk(r,t,!1):Kk);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Yk(e,i)}function Yk(e,t){return t!==Kk&&Wk.set(e,t===qk),t}function Xk(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Zk,Qk=[],$k={alloc(e,t,n){let r=Zk;if(!r)return n;Zk=void 0;let i={value:n,issues:null};return r.set(t.value,i),Qk.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&tA(n,e.value))throw new zk;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Jk(e,new Set,!1);if(i===Gk)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===qk||r?n=!0:r=!0}let l=s.value;if(!Hk(l))return t(s,c);let u=c[Bk];u||(u={buckets:new WeakMap,backEdges:void 0},c[Bk]=u);let d;i===c?d=a:(d=Xk(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Uk(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Zk=d;let p=Qk.length,m=t(s,c);Zk=void 0;let h=Qk.length>p?Qk.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Uk(e.issues):Vk),e)):(h&&(h.issues=m.issues.length?Uk(m.issues):Vk),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function eA(){return $k}function tA(e,t){let n=e[Bk]?.backEdges;return n!==void 0&&Hk(t)&&n.has(t)}var nA=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(fE(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${UT(e.values[0])}`:`Invalid option: expected one of ${hT(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${hT(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function rA(){return{localeError:nA()}}var iA,aA=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function oA(){return new aA}(iA=globalThis).__zod_globalRegistry??(iA.__zod_globalRegistry=oA());var sA=globalThis.__zod_globalRegistry;function cA(e){return e.checks&&=[...e.checks],e}function lA(e,t){return new e(cA({type:`string`,...HT(t)}))}function uA(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...HT(t)})}function dA(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...HT(t)})}function fA(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...HT(t)})}function pA(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...HT(t)})}function mA(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...HT(t)})}function hA(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...HT(t)})}function gA(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...HT(t)})}function _A(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...HT(t)})}function vA(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...HT(t)})}function yA(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...HT(t)})}function bA(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...HT(t)})}function xA(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...HT(t)})}function SA(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...HT(t)})}function CA(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...HT(t)})}function wA(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...HT(t)})}function TA(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...HT(t)})}function EA(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...HT(t)})}function DA(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...HT(t)})}function OA(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...HT(t)})}function kA(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...HT(t)})}function AA(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...HT(t)})}function jA(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...HT(t)})}function MA(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...HT(t)})}function NA(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...HT(t)})}function PA(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...HT(t)})}function FA(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...HT(t)})}function IA(e,t){return new e(cA({type:`number`,checks:[],...HT(t)}))}function LA(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...HT(t)})}function RA(e,t){return new e({type:`boolean`,...HT(t)})}function zA(e,t){return new e({type:`null`,...HT(t)})}function BA(e){return new e({type:`unknown`})}function VA(e,t){return new e({type:`never`,...HT(t)})}function HA(e,t){return new zD({check:`less_than`,...HT(t),value:e,inclusive:!1})}function UA(e,t){return new zD({check:`less_than`,...HT(t),value:e,inclusive:!0})}function WA(e,t){return new BD({check:`greater_than`,...HT(t),value:e,inclusive:!1})}function GA(e,t){return new BD({check:`greater_than`,...HT(t),value:e,inclusive:!0})}function KA(e){return WA(0,e)}function qA(e){return GA(0,e)}function JA(e,t){return new VD({check:`multiple_of`,...HT(t),value:e})}function YA(e,t){return new UD({check:`max_length`,...HT(t),maximum:e})}function XA(e,t){return new WD({check:`min_length`,...HT(t),minimum:e})}function ZA(e,t){return new GD({check:`length_equals`,...HT(t),length:e})}function QA(e,t){return new qD({check:`string_format`,format:`regex`,...HT(t),pattern:e})}function $A(e){return new JD({check:`string_format`,format:`lowercase`,...HT(e)})}function ej(e){return new YD({check:`string_format`,format:`uppercase`,...HT(e)})}function tj(e,t){return new XD({check:`string_format`,format:`includes`,...HT(t),includes:e})}function nj(e,t){return new ZD({check:`string_format`,format:`starts_with`,...HT(t),prefix:e})}function rj(e,t){return new QD({check:`string_format`,format:`ends_with`,...HT(t),suffix:e})}function ij(e,t){return new eO({check:`properties`,shape:e,...HT(t)})}function aj(e){return new tO({check:`overwrite`,tx:e})}function oj(e){return aj(t=>t.normalize(e))}function sj(){return aj(e=>e.trim())}function cj(){return aj(e=>e.toLowerCase())}function lj(){return aj(e=>e.toUpperCase())}function uj(){return aj(e=>NT(e))}function dj(e,t,n){return new e({type:`array`,element:t,...HT(n)})}function fj(e,t,n){let r=HT(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function pj(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...HT(n)})}function mj(e,t){let n=hj(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(pE(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(pE(r))}},e(t.value,t)),t);return n}function hj(e,t){let n=new ID({check:`custom`,...HT(t)});return n._zod.check=e,n}function gj(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&wT(e,t,n[t]);return e}function _j(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??sA,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function vj(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function yj(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,yj(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&gj(o.schema,c),t.io===`input`&&kj(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 bj(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function xj(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${bj(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+bj(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
238
|
+
|
|
239
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Sj(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Sj(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Cj=new Set([`type`,`properties`,`required`,`additionalProperties`]),wj=[`oneOf`,`anyOf`];function Tj(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ej(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Cj.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Tj(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}wT(n,r,e.length===1?e[0]:Ej(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Tj(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Dj(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Cj)if(t in e)return;let n=t.filter(e=>wj.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ej(t);else{let e=n[0],i=wj.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ej([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,gj(e,r))}function Oj(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):gj(i,s),gj(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Sj(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Dj(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}gj(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,wT(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:jj(t,`input`,e.processors),output:jj(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function kj(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return kj(r.element,n);if(r.type===`set`)return kj(r.valueType,n);if(r.type===`lazy`)return kj(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`||r.type===`catch`)return kj(r.innerType,n);if(r.type===`intersection`)return kj(r.left,n)||kj(r.right,n);if(r.type===`record`||r.type===`map`)return kj(r.keyType,n)||kj(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:kj(r.in,n)||kj(r.out,n);if(r.type===`object`){for(let e in r.shape)if(kj(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(kj(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(kj(e,n))return!0;return!!(r.rest&&kj(r.rest,n))}return!1}var Aj=(e,t={})=>n=>{let r=_j({...n,processors:t});return yj(e,r),xj(r,e),Oj(r,e)},jj=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=_j({...i??{},target:a,io:t,processors:n});return yj(e,o),xj(o,e),Oj(o,e)},Mj=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Nj=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Pj=(e,t)=>{Mj(e,`minimum`,t),Nj(e,`maximum`,t)},Fj=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ij=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Lj=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Rj=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},zj=(e,t)=>Mj(e,`minimum`,t.minimum),Bj=(e,t)=>Nj(e,`maximum`,t.maximum),Vj=e=>(t,n)=>{Rj(t,n.format);let[r,i]=e[n.format];Mj(t,`minimum`,r),Nj(t,`maximum`,i)},Hj={greater_than:(e,t)=>Mj(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Nj(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Fj(e,t.value),number_format:Vj(GT),bigint_format:Vj(KT),min_length:zj,max_length:Bj,length_equals:(e,t)=>Pj(e,t.length),min_size:zj,max_size:Bj,size_equals:(e,t)=>Pj(e,t.size),string_format:(e,t)=>{Rj(e,t.format),t.pattern&&Ij(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Lj(e,t.mime)};function Uj(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Hj[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Mj(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Mj(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Nj(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Nj(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Fj(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Lj(t,i.mime);for(let e of i.patterns??[])Ij(t,e);return t}var Wj={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Gj=new Map([[BO,yD],[HO,bD]]),Kj=e=>Gj.get(e)??e,qj=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Uj(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Wj[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Kj);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Jj=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Uj(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):vj(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Yj=(e,t,n,r)=>{n.type=`boolean`},Xj=(e,t,n,r)=>{vj(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},Zj=(e,t,n,r)=>{vj(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},Qj=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},$j=(e,t,n,r)=>{vj(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},eM=(e,t,n,r)=>{vj(e,t,n,r,`Void cannot be represented in JSON Schema`)},tM=(e,t,n,r)=>{n.not={}},nM=(e,t,n,r)=>{},rM=(e,t,n,r)=>{},iM=(e,t,n,r)=>{vj(e,t,n,r,`Date cannot be represented in JSON Schema`)},aM=(e,t,n,r)=>{let i=mT(e._zod.def.entries);i.length===0?n.not={}:(i.every(e=>typeof e==`number`)&&(n.type=`number`),i.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=i)},oM=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(vj(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(vj(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},sM=(e,t,n,r)=>{vj(e,t,n,r,`NaN cannot be represented in JSON Schema`)},cM=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},lM=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=Uj(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},uM=(e,t,n,r)=>{n.type=`boolean`},dM=(e,t,n,r)=>{vj(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},fM=(e,t,n,r)=>{vj(e,t,n,r,`Function types cannot be represented in JSON Schema`)},pM=(e,t,n,r)=>{vj(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},mM=(e,t,n,r)=>{vj(e,t,n,r,`Map cannot be represented in JSON Schema`)},hM=(e,t,n,r)=>{vj(e,t,n,r,`Set cannot be represented in JSON Schema`)},gM=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Uj(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=yj(a.element,t,{...r,path:[...r.path,`items`]})};function _M(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?_M(t.out):t.type===`catch`?_M(t.innerType):e._zod.optin}var vM=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&vj(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)wT(i.properties,e,yj(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?_M(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=yj(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},yM=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>yj(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},bM=(e,t,n,r)=>{let i=e._zod.def,a=yj(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=yj(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},xM=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>yj(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?yj(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?_M(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=Uj(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function SM(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=SM(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>SM(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?jD:AD).source)),p}var CM=new WeakMap;function wM(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of CM.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=SM(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var TM=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Uj(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=yj(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)wT(i.patternProperties,Kj(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=yj(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=CM.get(t);n||(n=[],CM.set(t,n),t.deferred.push(()=>wM(t))),n.push(e)}i.additionalProperties=yj(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&_M(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},EM=(e,t,n,r)=>{let i=e._zod.def,a=yj(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},DM=(e,t,n,r)=>{let i=e._zod.def;yj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},OM=Symbol();function kM(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(vj(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),OM):JSON.parse(o)}var AM=(e,t,n,r)=>{let i=e._zod.def;yj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=kM(i.defaultValue,e,t,n,r);o!==OM&&(n.default=o)},jM=(e,t,n,r)=>{let i=e._zod.def;yj(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=kM(i.defaultValue,e,t,n,r);o!==OM&&(n._prefault=o)},MM=(e,t,n,r)=>{let i=e._zod.def;yj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{vj(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},NM=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;yj(o,t,r);let s=t.seen.get(e);s.ref=o},PM=(e,t,n,r)=>{let i=e._zod.def;yj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},FM=(e,t,n,r)=>{let i=e._zod.def;yj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},IM=(e,t,n,r)=>{let i=e._zod.def;yj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},LM=(e,t,n,r)=>{let i=e._zod.innerType;yj(i,t,r);let a=t.seen.get(e);a.ref=i},RM={string:qj,number:Jj,boolean:Yj,bigint:Xj,symbol:Zj,null:Qj,undefined:$j,void:eM,never:tM,any:nM,unknown:rM,date:iM,enum:aM,literal:oM,nan:sM,template_literal:cM,file:lM,success:uM,custom:dM,function:fM,transform:pM,map:mM,set:hM,array:gM,object:vM,union:yM,intersection:bM,tuple:xM,record:TM,nullable:EM,nonoptional:DM,default:AM,prefault:jM,catch:MM,pipe:NM,readonly:PM,promise:FM,optional:IM,lazy:LM};function zM(e,t){if(`_idmap`in e){let n=e,r=_j({...t,processors:RM}),i={};for(let e of n._idmap.entries()){let[t,n]=e;yj(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;xj(r,n),wT(a,t,Oj(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=_j({...t,processors:RM});return yj(e,n),xj(n,e),Oj(n,e)}var BM=new WeakSet([Object.prototype,Error.prototype]);function VM(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var HM=X(`ZodError`,(e,t)=>{Tee.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);BM.has(n)||(BM.add(n),VM(n,`format`,e=>t=>Oee(e,t)),VM(n,`flatten`,e=>t=>Dee(e,t)),VM(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,gT,2)}),VM(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,gT,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),UM=IE(HM),WM=LE(HM),GM=RE(HM),KM=VE(HM),qM=JE(HM),JM=YE(HM),YM=XE(HM),XM=ZE(HM),ZM=QE(HM),QM=$E(HM),$M=eD(HM),eN=tD(HM);function tN(){kE.localeError||AE(rA())}function nN(){kE.memoizer||AE({memoizer:eA()})}var rN=X(`ZodType`,(e,t)=>(tN(),iO.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(jT(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return VT(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(kP(e,t))},superRefine(e,t){return this.check(AP(e,t))},overwrite(e){return this.check(aj(e))},optional(){return cP(this)},exactOptional(){return uP(this)},nullable(){return fP(this)},nullish(){return cP(fP(this))},nonoptional(e){return vP(this,e)},array(){return WN(this)},or(e){return JN([this,e])},and(e){return QN(this,e)},transform(e){return SP(this,oP(e))},default(e){return mP(this,e)},prefault(e){return gP(this,e)},catch(e){return bP(this,e)},pipe(e){return SP(this,e)},readonly(){return wP(this)},describe(e){let t=this.clone();return sA.add(t,{description:e}),t},meta(...e){if(e.length===0)return sA.get(this);let t=this.clone();return sA.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return gE(this,`~standard`,{...sO(this),jsonSchema:{input:jj(this,`input`),output:jj(this,`output`)}})},set"~standard"(e){hE(this,`~standard`,e)},parse:function e(t,n){return UM(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await WM(this,t,n,{callee:e})},safeParse(e,t){return GM(this,e,t)},async safeParseAsync(e,t){return KM(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){hE(this,`spa`,e)},validate(e,t){return GE(this,e,t)},validateAsync(e,t){return qE(this,e,t)},encode:function e(t,n){return qM(this,t,n,{callee:e})},decode:function e(t,n){return JM(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await YM(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await XM(this,t,n,{callee:e})},safeEncode(e,t){return ZM(this,e,t)},safeDecode(e,t){return QM(this,e,t)},async safeEncodeAsync(e,t){return $M(this,e,t)},async safeDecodeAsync(e,t){return eN(this,e,t)},toJSONSchema(e){return Aj(this,{})(e)},get description(){return sA.get(this)?.description},get _def(){return this._zod.def}}),iN=X(`_ZodString`,(e,t)=>{cO.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qj(e,t,n,r)},_E({format:e=>Uj(e).format??null,minLength:e=>Uj(e).minimum??null,maxLength:e=>Uj(e).maximum??null},{regex(...e){return this.check(QA(...e))},includes(...e){return this.check(tj(...e))},startsWith(...e){return this.check(nj(...e))},endsWith(...e){return this.check(rj(...e))},min(...e){return this.check(XA(...e))},max(...e){return this.check(YA(...e))},length(...e){return this.check(ZA(...e))},nonempty(...e){return this.check(XA(1,...e))},lowercase(e){return this.check($A(e))},uppercase(e){return this.check(ej(e))},trim(){return this.check(sj())},normalize(...e){return this.check(oj(...e))},toLowerCase(){return this.check(cj())},toUpperCase(){return this.check(lj())},slugify(){return this.check(uj())}})),aN=X(`ZodString`,(e,t)=>{cO.init(e,t),iN.init(e,t)},{email(e){return this.check(uA(fN,e))},url(e){return this.check(gA(hN,e))},jwt(e){return this.check(jA(AN,e))},emoji(e){return this.check(_A(gN,e))},guid(e){return this.check(dA(pN,e))},uuid(e){return this.check(fA(mN,e))},uuidv4(e){return this.check(pA(mN,e))},uuidv6(e){return this.check(mA(mN,e))},uuidv7(e){return this.check(hA(mN,e))},nanoid(e){return this.check(vA(_N,e))},cuid(e){return this.check(yA(vN,e))},cuid2(e){return this.check(bA(yN,e))},ulid(e){return this.check(xA(bN,e))},base64(e){return this.check(OA(DN,e))},base64url(e){return this.check(kA(ON,e))},xid(e){return this.check(SA(xN,e))},ksuid(e){return this.check(CA(SN,e))},ipv4(e){return this.check(wA(CN,e))},ipv6(e){return this.check(TA(wN,e))},cidrv4(e){return this.check(EA(TN,e))},cidrv6(e){return this.check(DA(EN,e))},e164(e){return this.check(AA(kN,e))},datetime(e){return this.check(MA(cN,e))},date(e){return this.check(NA(lN,e))},time(e){return this.check(PA(uN,e))},duration(e){return this.check(FA(dN,e))}});function oN(e){return lA(aN,e)}var sN=X(`ZodStringFormat`,(e,t)=>{lO.init(e,t),iN.init(e,t)}),cN=X(`ZodISODateTime`,(e,t)=>{OO.init(e,t),sN.init(e,t)}),lN=X(`ZodISODate`,(e,t)=>{kO.init(e,t),sN.init(e,t)}),uN=X(`ZodISOTime`,(e,t)=>{AO.init(e,t),sN.init(e,t)}),dN=X(`ZodISODuration`,(e,t)=>{jO.init(e,t),sN.init(e,t)}),fN=X(`ZodEmail`,(e,t)=>{fO.init(e,t),sN.init(e,t)}),pN=X(`ZodGUID`,(e,t)=>{uO.init(e,t),sN.init(e,t)}),mN=X(`ZodUUID`,(e,t)=>{dO.init(e,t),sN.init(e,t)}),hN=X(`ZodURL`,(e,t)=>{bO.init(e,t),sN.init(e,t)}),gN=X(`ZodEmoji`,(e,t)=>{xO.init(e,t),sN.init(e,t)}),_N=X(`ZodNanoID`,(e,t)=>{SO.init(e,t),sN.init(e,t)}),vN=X(`ZodCUID`,(e,t)=>{CO.init(e,t),sN.init(e,t)}),yN=X(`ZodCUID2`,(e,t)=>{wO.init(e,t),sN.init(e,t)}),bN=X(`ZodULID`,(e,t)=>{TO.init(e,t),sN.init(e,t)}),xN=X(`ZodXID`,(e,t)=>{EO.init(e,t),sN.init(e,t)}),SN=X(`ZodKSUID`,(e,t)=>{DO.init(e,t),sN.init(e,t)}),CN=X(`ZodIPv4`,(e,t)=>{MO.init(e,t),sN.init(e,t)}),wN=X(`ZodIPv6`,(e,t)=>{FO.init(e,t),sN.init(e,t)}),TN=X(`ZodCIDRv4`,(e,t)=>{IO.init(e,t),sN.init(e,t)}),EN=X(`ZodCIDRv6`,(e,t)=>{RO.init(e,t),sN.init(e,t)}),DN=X(`ZodBase64`,(e,t)=>{VO.init(e,t),sN.init(e,t)}),ON=X(`ZodBase64URL`,(e,t)=>{WO.init(e,t),sN.init(e,t)}),kN=X(`ZodE164`,(e,t)=>{GO.init(e,t),sN.init(e,t)}),AN=X(`ZodJWT`,(e,t)=>{qO.init(e,t),sN.init(e,t)}),jN=X(`ZodNumber`,(e,t)=>{JO.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jj(e,t,n,r),e.isFinite=!0},_E({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Uj(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Uj(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Uj(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Uj(e).format??null},{gt(e,t){return this.check(WA(e,t))},gte(e,t){return this.check(GA(e,t))},min(e,t){return this.check(GA(e,t))},lt(e,t){return this.check(HA(e,t))},lte(e,t){return this.check(UA(e,t))},max(e,t){return this.check(UA(e,t))},int(e){return this.check(PN(e))},safe(e){return this.check(PN(e))},positive(e){return this.check(WA(0,e))},nonnegative(e){return this.check(GA(0,e))},negative(e){return this.check(HA(0,e))},nonpositive(e){return this.check(UA(0,e))},multipleOf(e,t){return this.check(JA(e,t))},step(e,t){return this.check(JA(e,t))},finite(){return this}}));function MN(e){return IA(jN,e)}var NN=X(`ZodNumberFormat`,(e,t)=>{YO.init(e,t),jN.init(e,t)});function PN(e){return LA(NN,e)}var FN=X(`ZodBoolean`,(e,t)=>{XO.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yj(e,t,n,r)});function IN(e){return RA(FN,e)}var LN=X(`ZodNull`,(e,t)=>{ZO.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qj(e,t,n,r)});function RN(e){return zA(LN,e)}var zN=X(`ZodUnknown`,(e,t)=>{QO.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function BN(){return BA(zN)}var VN=X(`ZodNever`,(e,t)=>{$O.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tM(e,t,n,r)});function HN(e){return VA(VN,e)}var UN=X(`ZodArray`,(e,t)=>{nN(),rk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gM(e,t,n,r),e.element=t.element},{min(e,t){return this.check(XA(e,t))},nonempty(e){return this.check(XA(1,e))},max(e,t){return this.check(YA(e,t))},length(e,t){return this.check(ZA(e,t))},unwrap(){return this.element}});function WN(e,t){return dj(UN,e,t)}var GN=X(`ZodObject`,(e,t)=>{nN(),lk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vM(e,t,n,r),CE(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return nP(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(jT(this._zod.def,{catchall:e}))},passthrough(){return this.clone(jT(this._zod.def,{catchall:BN()}))},loose(){return this.clone(jT(this._zod.def,{catchall:BN()}))},strict(){return this.clone(jT(this._zod.def,{catchall:HN()}))},strip(){return this.clone(jT(this._zod.def,{catchall:void 0}))},extend(e){return XT(this,e)},safeExtend(e){return QT(this,e)},merge(e){return $T(this,e)},pick(e){return qT(this,e)},omit(e){return YT(this,e)},partial(...e){return eE(sP,this,e[0])},exactPartial(...e){return eE(lP,this,e[0],`exactPartial`)},required(...e){return tE(_P,this,e[0])}});function KN(e,t){return new GN({type:`object`,shape:e??{},...HT(t)})}var qN=X(`ZodUnion`,(e,t)=>{dk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yM(e,t,n,r),e.options=t.options});function JN(e,t){return new qN({type:`union`,options:e,...HT(t)})}var YN=X(`ZodDiscriminatedUnion`,(e,t)=>{qN.init(e,t),pk.init(e,t)});function XN(e,t,n){return new YN({type:`union`,options:t,discriminator:e,...HT(n)})}var ZN=X(`ZodIntersection`,(e,t)=>{mk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bM(e,t,n,r)});function QN(e,t){return new ZN({type:`intersection`,left:e,right:t})}var $N=X(`ZodRecord`,(e,t)=>{nN(),_k.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TM(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function eP(e,t,n){return!t||!t._zod?new $N({type:`record`,keyType:oN(),valueType:e,...HT(t)}):new $N({type:`record`,keyType:e,valueType:t,...HT(n)})}var tP=X(`ZodEnum`,(e,t)=>{vk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aM(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new tP({...t,checks:[],...HT(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new tP({...t,checks:[],...HT(r),entries:i})}});function nP(e,t){return new tP({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...HT(t)})}var rP=X(`ZodLiteral`,(e,t)=>{yk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oM(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function iP(e,t){return new rP({type:`literal`,values:Array.isArray(e)?e:[e],...HT(t)})}var aP=X(`ZodTransform`,(e,t)=>{nN(),bk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pM(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new OE(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(pE(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(pE(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function oP(e){return new aP({type:`transform`,transform:e})}var sP=X(`ZodOptional`,(e,t)=>{Sk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cP(e){return new sP({type:`optional`,innerType:e})}var lP=X(`ZodExactOptional`,(e,t)=>{Ck.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uP(e){return new lP({type:`optional`,innerType:e})}var dP=X(`ZodNullable`,(e,t)=>{wk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fP(e){return new dP({type:`nullable`,innerType:e})}var pP=X(`ZodDefault`,(e,t)=>{Tk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function mP(e,t){return new pP({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():RT(t)}})}var hP=X(`ZodPrefault`,(e,t)=>{Dk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gP(e,t){return new hP({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():RT(t)}})}var _P=X(`ZodNonOptional`,(e,t)=>{Ok.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vP(e,t){return new _P({type:`nonoptional`,innerType:e,...HT(t)})}var yP=X(`ZodCatch`,(e,t)=>{jk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bP(e,t){return new yP({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:yee(t)})}var xP=X(`ZodPipe`,(e,t)=>{Mk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NM(e,t,n,r),e.in=t.in,e.out=t.out});function SP(e,t){return new xP({type:`pipe`,in:e,out:t})}var CP=X(`ZodReadonly`,(e,t)=>{Pk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wP(e){return new CP({type:`readonly`,innerType:e})}var TP=X(`ZodLazy`,(e,t)=>{Ik.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LM(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function EP(e){return new TP({type:`lazy`,getter:e})}var DP=X(`ZodCustom`,(e,t)=>{Lk.init(e,t),rN.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dM(e,t,n,r)});function OP(e,t){return fj(DP,e??(()=>!0),t)}function kP(e,t={}){return pj(DP,e,t)}function AP(e,t){return mj(e,t)}var jP=X(`ZodInstanceOf`,(e,t)=>{DP.init(e,t)},{properties(e,t){return this.check(ij(e,t))}});function MP(e,t={}){let n=new jP({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...HT(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var NP=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},PP=10,FP=13,IP=32;function LP(e){}function RP(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=LP,onError:n=LP,onRetry:r=LP,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(`
|
|
240
|
+
`)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new NP(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(`
|
|
241
|
+
`,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(`
|
|
242
|
+
`,n);continue}let i=e.charCodeAt(n);if(zP(e,n,i)){let i=e.charCodeAt(n+5)===IP?n+6:n+5,a=e.slice(i,r);if(d===0&&e.charCodeAt(r+1)===PP){t({id:l,event:f,data:a}),l=void 0,u=``,f=void 0,n=r+2,r=e.indexOf(`
|
|
243
|
+
`,n);continue}u=d===0?a:`${u}
|
|
244
|
+
${a}`,d++}else BP(e,n,i)?f=e.slice(e.charCodeAt(n+6)===IP?n+7:n+6,r)||void 0:_(e,n,r);n=r+1,r=e.indexOf(`
|
|
245
|
+
`,n)}return e.slice(n)}for(;n<e.length;){let t=e.indexOf(`\r`,n),r=e.indexOf(`
|
|
246
|
+
`,n),i=-1;if(t!==-1&&r!==-1?i=t<r?t:r:t===-1?r!==-1&&(i=r):i=t===e.length-1?-1:t,i===-1)break;_(e,n,i),n=i+1,e.charCodeAt(n-1)===FP&&e.charCodeAt(n)===PP&&n++}return e.slice(n)}function _(e,t,n){if(t===n){y();return}let r=e.charCodeAt(t);if(zP(e,t,r)){let r=e.charCodeAt(t+5)===IP?t+6:t+5,i=e.slice(r,n);u=d===0?i:`${u}
|
|
247
|
+
${i}`,d++;return}if(BP(e,t,r)){f=e.slice(e.charCodeAt(t+6)===IP?t+7:t+6,n)||void 0;return}if(r===105&&e.charCodeAt(t+1)===100&&e.charCodeAt(t+2)===58){let r=e.slice(e.charCodeAt(t+3)===IP?t+4:t+3,n);r.includes(`\0`)||(l=r);return}if(r===58){if(i){let r=e.slice(t,n);i(r.slice(e.charCodeAt(t+1)===IP?2:1))}return}let a=e.slice(t,n),o=a.indexOf(`:`);if(o===-1){v(a,``,a);return}let s=a.slice(0,o),c=a.charCodeAt(o+1)===IP?2:1;v(s,a.slice(o+c),a)}function v(e,t,i){switch(e){case`event`:f=t||void 0;break;case`data`:u=d===0?t:`${u}
|
|
248
|
+
${t}`,d++;break;case`id`:t.includes(`\0`)||(l=t);break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new NP(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new NP(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}))}}function y(){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0}function b(e={}){if(e.consume&&o.length>0){let e=o.join(``);_(e,0,e.length)}c=!0,l=void 0,u=``,d=0,f=void 0,o.length=0,s=0,p=!1}return{feed:m,reset:b}}function zP(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function BP(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var VP=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=RP({onEvent:e=>{a.enqueue(e)},onError(t){typeof e==`function`&&e(t),(e===`terminate`||t.type===`max-buffer-size-exceeded`)&&a.error(t)},onRetry:t,onComment:n,maxBufferSize:r})},transform(e){i.feed(e)}})}};new TextDecoder;var{btoa:jee,atob:Mee}=globalThis,HP=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get,UP=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,`byteLength`).get;function WP(e){return ArrayBuffer.isView(e)&&HP.call(e)===`Uint8Array`}function GP(e){if(typeof e!=`object`||!e||!(`byteLength`in e))return!1;try{return UP.call(e),!0}catch{return!1}}function KP(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((e,n)=>{t[n.toLowerCase()]=e});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}var qP=({prefix:e,size:t=16,alphabet:n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,separator:r=`-`}={})=>{let i=()=>{let e=n.length,r=Array(t);for(let i=0;i<t;i++)r[i]=n[Math.random()*e|0];return r.join(``)};if(e==null)return i;if(n.includes(r))throw new tT({argument:`separator`,message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},JP=qP();function YP(e){return globalThis.Buffer?.isBuffer(e)??!1}var XP=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,ZP=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function QP(e){let t=JSON.parse(e);return typeof t!=`object`||!t||XP.test(e)===!1&&ZP.test(e)===!1?t:$P(t)}function $P(e){let t=[e];for(;t.length;){let e=t;t=[];for(let n of e){if(Object.prototype.hasOwnProperty.call(n,`__proto__`)||Object.prototype.hasOwnProperty.call(n,`constructor`)&&n.constructor!==null&&typeof n.constructor==`object`&&Object.prototype.hasOwnProperty.call(n.constructor,`prototype`))throw SyntaxError(`Object contains forbidden prototype property`);for(let e in n){let r=n[e];r&&typeof r==`object`&&t.push(r)}}}return e}function eF(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return QP(e)}try{return QP(e)}finally{Error.stackTraceLimit=t}}function tF(e){if(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)){let{additionalProperties:t}=e;e.additionalProperties=t!=null&&typeof t!=`boolean`&&nF(t);let{properties:n}=e;if(n!=null)for(let e of Object.keys(n))n[e]=nF(n[e])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(nF):nF(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(nF)),e.allOf!=null&&(e.allOf=e.allOf.map(nF)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(nF));let{definitions:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=nF(t[e]);return e}function nF(e){return typeof e==`boolean`?e:tF(e)}var rF=Symbol(`Let zodToJsonSchema decide on which parser to use`),iF={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`},aF=e=>typeof e==`string`?{...iF,name:e}:{...iF,...e};function oF(){return{}}function sF(e,t){let n={type:`array`};return e.type?._def&&e.type?._def?.typeName!==`ZodAny`&&(n.items=QF(e.type._def,{...t,currentPath:[...t.currentPath,`items`]})),e.minLength&&(n.minItems=e.minLength.value),e.maxLength&&(n.maxItems=e.maxLength.value),e.exactLength&&(n.minItems=e.exactLength.value,n.maxItems=e.exactLength.value),n}function cF(e){let t={type:`integer`,format:`int64`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value}return t}function lF(){return{type:`boolean`}}function uF(e,t){return QF(e.type._def,t)}var dF=(e,t)=>QF(e.innerType._def,t);function fF(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(n=>fF(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return pF(e)}}var pF=e=>{let t={type:`integer`,format:`unix-time`};for(let n of e.checks)switch(n.kind){case`min`:t.minimum=n.value;break;case`max`:t.maximum=n.value}return t};function mF(e,t){return{...QF(e.innerType._def,t),default:e.defaultValue()}}function hF(e,t){return t.effectStrategy===`input`?QF(e.schema._def,t):oF()}function gF(e){return{type:`string`,enum:Array.from(e.values)}}var _F=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function vF(e,t){let n=[QF(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),QF(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=[];return n.forEach(e=>{if(_F(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}r.push(t)}}),r.length?{allOf:r}:void 0}function yF(e){let t=typeof e.value;return t!==`bigint`&&t!==`number`&&t!==`boolean`&&t!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:{type:t===`bigint`?`integer`:t,const:e.value}}var bF=void 0,xF={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(bF===void 0&&(bF=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),bF),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function SF(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value;break;case`max`:n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`email`:switch(t.emailStrategy){case`format:email`:EF(n,`email`,r.message,t);break;case`format:idn-email`:EF(n,`idn-email`,r.message,t);break;case`pattern:zod`:DF(n,xF.email,r.message,t)}break;case`url`:EF(n,`uri`,r.message,t);break;case`uuid`:EF(n,`uuid`,r.message,t);break;case`regex`:DF(n,r.regex,r.message,t);break;case`cuid`:DF(n,xF.cuid,r.message,t);break;case`cuid2`:DF(n,xF.cuid2,r.message,t);break;case`startsWith`:DF(n,RegExp(`^${CF(r.value,t)}`),r.message,t);break;case`endsWith`:DF(n,RegExp(`${CF(r.value,t)}$`),r.message,t);break;case`datetime`:EF(n,`date-time`,r.message,t);break;case`date`:EF(n,`date`,r.message,t);break;case`time`:EF(n,`time`,r.message,t);break;case`duration`:EF(n,`duration`,r.message,t);break;case`length`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`includes`:DF(n,RegExp(CF(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&EF(n,`ipv4`,r.message,t),r.version!==`v4`&&EF(n,`ipv6`,r.message,t);break;case`base64url`:DF(n,xF.base64url,r.message,t);break;case`jwt`:DF(n,xF.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&DF(n,xF.ipv4Cidr,r.message,t),r.version!==`v4`&&DF(n,xF.ipv6Cidr,r.message,t);break;case`emoji`:DF(n,xF.emoji(),r.message,t);break;case`ulid`:DF(n,xF.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:EF(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:DF(n,xF.base64,r.message,t)}break;case`nanoid`:DF(n,xF.nanoid,r.message,t)}return n}function CF(e,t){return t.patternStrategy===`escape`?TF(e):e}var wF=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function TF(e){let t=``;for(let n=0;n<e.length;n++)wF.has(e[n])||(t+=`\\`),t+=e[n];return t}function EF(e,t,n,r){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function DF(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:OF(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=OF(t,r)}function OF(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e<r.length;e++)if(a)i+=r[e],a=!1;else{if(n.i){if(o){if(r[e].match(/[a-z]/)){s?(i+=r[e],i+=`${r[e-2]}-${r[e]}`.toUpperCase(),s=!1):r[e+1]===`-`&&r[e+2]?.match(/[a-z]/)?(i+=r[e],s=!0):i+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){i+=`[${r[e]}${r[e].toUpperCase()}]`;continue}}if(n.m){if(r[e]===`^`){i+=`(^|(?<=[\r
|
|
249
|
+
]))`;continue}if(r[e]===`$`){i+=`($|(?=[\r
|
|
250
|
+
]))`;continue}}n.s&&r[e]===`.`?i+=o?`${r[e]}\r\n`:`[${r[e]}\r\n]`:(i+=r[e],r[e]===`\\`?a=!0:o&&r[e]===`]`?o=!1:!o&&r[e]===`[`&&(o=!0))}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join(`/`)} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function kF(e,t){let n={type:`object`,additionalProperties:QF(e.valueType._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]})??t.allowedAdditionalProperties};if(e.keyType?._def.typeName===`ZodString`&&e.keyType._def.checks?.length){let{type:r,...i}=SF(e.keyType._def,t);return{...n,propertyNames:i}}if(e.keyType?._def.typeName===`ZodEnum`)return{...n,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===`ZodBranded`&&e.keyType._def.type._def.typeName===`ZodString`&&e.keyType._def.type._def.checks?.length){let{type:r,...i}=uF(e.keyType._def,t);return{...n,propertyNames:i}}return n}function AF(e,t){return t.mapStrategy===`record`?kF(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[QF(e.keyType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`0`]})||oF(),QF(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`1`]})||oF()],minItems:2,maxItems:2}}}function jF(e){let t=e.values,n=Object.keys(e.values).filter(e=>typeof t[t[e]]!=`number`).map(e=>t[e]),r=Array.from(new Set(n.map(e=>typeof e)));return{type:r.length===1?r[0]===`string`?`string`:`number`:[`string`,`number`],enum:n}}function MF(){return{not:oF()}}function NF(){return{type:`null`}}var PF={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function FF(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in PF&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=PF[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}if(n.every(e=>e._def.typeName===`ZodLiteral`&&!e.description)){let e=n.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case`string`:case`number`:case`boolean`:return[...e,n];case`bigint`:return[...e,`integer`];case`object`:if(t._def.value===null)return[...e,`null`];default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>e._def.typeName===`ZodEnum`))return{type:`string`,enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return IF(e,t)}var IF=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>QF(e._def,{...t,currentPath:[...t.currentPath,`anyOf`,`${n}`]})).filter(e=>!!e&&(!t.strictUnions||typeof e==`object`&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function LF(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[PF[e.innerType._def.typeName],`null`]};let n=QF(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`0`]});return n&&{anyOf:[n,{type:`null`}]}}function RF(e){let t={type:`number`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`int`:t.type=`integer`;break;case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value}return t}function zF(e,t){let n={type:`object`,properties:{}},r=[],i=e.shape();for(let e in i){let a=i[e];if(a===void 0||a._def===void 0)continue;let o=VF(a),s=QF(a._def,{...t,currentPath:[...t.currentPath,`properties`,e],propertyPath:[...t.currentPath,`properties`,e]});s!==void 0&&(n.properties[e]=s,o||r.push(e))}r.length&&(n.required=r);let a=BF(e,t);return a!==void 0&&(n.additionalProperties=a),n}function BF(e,t){if(e.catchall._def.typeName!==`ZodNever`)return QF(e.catchall._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]});switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function VF(e){try{return e.isOptional()}catch{return!0}}var HF=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return QF(e.innerType._def,t);let n=QF(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`1`]});return n?{anyOf:[{not:oF()},n]}:oF()},UF=(e,t)=>{if(t.pipeStrategy===`input`)return QF(e.in._def,t);if(t.pipeStrategy===`output`)return QF(e.out._def,t);let n=QF(e.in._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]});return{allOf:[n,QF(e.out._def,{...t,currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]})].filter(e=>e!==void 0)}};function WF(e,t){return QF(e.type._def,t)}function GF(e,t){let n={type:`array`,uniqueItems:!0,items:QF(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function KF(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>QF(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:QF(e.rest._def,{...t,currentPath:[...t.currentPath,`additionalItems`]})}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>QF(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function qF(){return{not:oF()}}function JF(){return oF()}var YF=(e,t)=>QF(e.innerType._def,t),XF=(e,t,n)=>{switch(t){case`ZodString`:return SF(e,n);case`ZodNumber`:return RF(e);case`ZodObject`:return zF(e,n);case`ZodBigInt`:return cF(e);case`ZodBoolean`:return lF();case`ZodDate`:return fF(e,n);case`ZodUndefined`:return qF();case`ZodNull`:return NF();case`ZodArray`:return sF(e,n);case`ZodUnion`:case`ZodDiscriminatedUnion`:return FF(e,n);case`ZodIntersection`:return vF(e,n);case`ZodTuple`:return KF(e,n);case`ZodRecord`:return kF(e,n);case`ZodLiteral`:return yF(e);case`ZodEnum`:return gF(e);case`ZodNativeEnum`:return jF(e);case`ZodNullable`:return LF(e,n);case`ZodOptional`:return HF(e,n);case`ZodMap`:return AF(e,n);case`ZodSet`:return GF(e,n);case`ZodLazy`:return()=>e.getter()._def;case`ZodPromise`:return WF(e,n);case`ZodNaN`:case`ZodNever`:return MF();case`ZodEffects`:return hF(e,n);case`ZodAny`:return oF();case`ZodUnknown`:return JF();case`ZodDefault`:return mF(e,n);case`ZodBranded`:return uF(e,n);case`ZodReadonly`:return YF(e,n);case`ZodCatch`:return dF(e,n);case`ZodPipeline`:return UF(e,n);case`ZodFunction`:case`ZodVoid`:case`ZodSymbol`:return;default:return(e=>void 0)(t)}},ZF=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join(`/`)};function QF(e,t,n=!1){let r=t.seen.get(e);if(t.override){let i=t.override?.(e,t,r,n);if(i!==rF)return i}if(r&&!n){let e=$F(r,t);if(e!==void 0)return e}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=XF(e,e.typeName,t),o=typeof a==`function`?QF(a(),t):a;if(o&&eI(e,t,o),t.postProcess){let n=t.postProcess(o,e,t);return i.jsonSchema=o,n}return i.jsonSchema=o,o}var $F=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:ZF(t.currentPath,e.path)};case`none`:case`seen`:return e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`),oF()):t.$refStrategy===`seen`?oF():void 0}},eI=(e,t,n)=>(e.description&&(n.description=e.description),n),tI=e=>{let t=aF(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}},nI=(e,t)=>{let n=tI(t),r=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:QF(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0)??oF()}),{}):void 0,i=typeof t==`string`?t:t?.nameStrategy===`title`?void 0:t?.name,a=QF(e._def,i===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,i]},!1)??oF(),o=typeof t==`object`&&t.name!==void 0&&t.nameStrategy===`title`?t.name:void 0;o!==void 0&&(a.title=o);let s=i===void 0?r?{...a,[n.definitionPath]:r}:a:{$ref:[...n.$refStrategy===`relative`?[]:n.basePath,n.definitionPath,i].join(`/`),[n.definitionPath]:{...r,[i]:a}};return s.$schema=`http://json-schema.org/draft-07/schema#`,s},rI=Symbol.for(`vercel.ai.schema`);function iI(e){let t;return()=>(t??=e(),t)}function aI(e,{validate:t}={}){return{[rI]:!0,_type:void 0,get jsonSchema(){return typeof e==`function`&&(e=e()),e},validate:t}}function oI(e){return typeof e==`object`&&!!e&&rI in e&&e[rI]===!0&&`jsonSchema`in e&&`validate`in e}function sI(e){return e==null?aI({type:`object`,properties:{},additionalProperties:!1}):oI(e)?e:`~standard`in e?e[`~standard`].vendor===`zod`?pI(e):cI(e):e()}function cI(e){return aI(()=>{if(!lI(e))throw Error(`Standard schema vendor '${e[`~standard`].vendor}' does not support JSON Schema conversion.`);return tF(e[`~standard`].jsonSchema.input({target:`draft-07`}))},{validate:async t=>{let n=await e[`~standard`].validate(t);return n.issues===void 0&&`value`in n?{success:!0,value:n.value}:{success:!1,error:new lT({value:t,cause:n.issues})}}})}function lI(e){return e[`~standard`].jsonSchema!=null}function uI(e,t){let n=t?.useReferences??!1;return aI(()=>nI(e,{$refStrategy:n?`root`:`none`}),{validate:async t=>{let n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function dI(e,t){AE().localeError||AE(rA());let n=t?.useReferences??!1;return aI(()=>tF(zM(e,{target:`draft-7`,io:`input`,reused:n?`ref`:`inline`})),{validate:async t=>{let n=await KM(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function fI(e){return`_zod`in e}function pI(e,t){return fI(e)?dI(e,t):uI(e,t)}async function mI({value:e,schema:t,context:n}){let r=await hI({value:e,schema:t,context:n});if(!r.success)throw lT.wrap({value:e,cause:r.error,context:n});return r.value}async function hI({value:e,schema:t,context:n}){let r=sI(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};let t=await r.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:lT.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:lT.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function gI({text:e,schema:t}){try{let n=eF(e);return t==null?{success:!0,value:n,rawValue:n}:await hI({value:n,schema:t})}catch(t){return{success:!1,error:aT.isInstance(t)?t:new aT({text:e,cause:t}),rawValue:void 0}}}var _I=67108864;function vI({stream:e,schema:t,maxEventSize:n=_I}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new VP({maxBufferSize:n})).pipeThrough(new TransformStream({async transform({data:e},n){e!==`[DONE]`&&n.enqueue(await gI({text:e,schema:t}))}}))}async function yI(e){return typeof e==`function`&&(e=e()),e}new TextDecoder;var bI=X(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);iO.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){hE(this,`with`,e)},parse(e,t){return kee(this,e,t,{callee:this.parse})},parseAsync(e,t){return Aee(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return zE(this,e,t)},safeParseAsync(e,t){return HE(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0})},clone(e,t){return VT(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),xI=X(`ZodMiniString`,(e,t)=>{cO.init(e,t),bI.init(e,t)});function SI(e){return lA(xI,e)}var CI=X(`ZodMiniNumber`,(e,t)=>{JO.init(e,t),bI.init(e,t)});function wI(e){return IA(CI,e)}var TI=X(`ZodMiniNumberFormat`,(e,t)=>{YO.init(e,t),CI.init(e,t)});function EI(e){return LA(TI,e)}var DI=X(`ZodMiniBoolean`,(e,t)=>{XO.init(e,t),bI.init(e,t)});function OI(e){return RA(DI,e)}var kI=X(`ZodMiniUnknown`,(e,t)=>{QO.init(e,t),bI.init(e,t)});function AI(){return BA(kI)}var jI=X(`ZodMiniNever`,(e,t)=>{$O.init(e,t),bI.init(e,t)});function MI(e){return VA(jI,e)}var NI=X(`ZodMiniArray`,(e,t)=>{rk.init(e,t),bI.init(e,t)});function PI(e,t){return new NI({type:`array`,element:e,...HT(t)})}var FI=X(`ZodMiniObject`,(e,t)=>{ck.init(e,t),bI.init(e,t),CE(e,`shape`,e=>e._zod.def.shape,!1)});function II(e,t){return new FI({type:`object`,shape:e??{},...HT(t)})}function LI(e,t){return new FI({type:`object`,shape:e,catchall:AI(),...HT(t)})}function RI(e,t){return XT(e,t)}var zI=X(`ZodMiniUnion`,(e,t)=>{dk.init(e,t),bI.init(e,t)});function BI(e,t){return new zI({type:`union`,options:e,...HT(t)})}var VI=X(`ZodMiniDiscriminatedUnion`,(e,t)=>{pk.init(e,t),bI.init(e,t)});function HI(e,t,n){return new VI({type:`union`,options:t,discriminator:e,...HT(n)})}var UI=X(`ZodMiniRecord`,(e,t)=>{_k.init(e,t),bI.init(e,t)});function WI(e,t,n){return!t||!t._zod?new UI({type:`record`,keyType:SI(),valueType:e,...HT(t)}):new UI({type:`record`,keyType:e,valueType:t,...HT(n)})}var GI=X(`ZodMiniEnum`,(e,t)=>{vk.init(e,t),bI.init(e,t),e.options=[...e._zod.values]});function KI(e,t){return new GI({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...HT(t)})}var qI=X(`ZodMiniLiteral`,(e,t)=>{yk.init(e,t),bI.init(e,t)});function JI(e,t){return new qI({type:`literal`,values:Array.isArray(e)?e:[e],...HT(t)})}var YI=X(`ZodMiniTransform`,(e,t)=>{bk.init(e,t),bI.init(e,t)});function XI(e){return new YI({type:`transform`,transform:e})}var ZI=X(`ZodMiniOptional`,(e,t)=>{Sk.init(e,t),bI.init(e,t)});function QI(e){return new ZI({type:`optional`,innerType:e})}var $I=X(`ZodMiniPipe`,(e,t)=>{Mk.init(e,t),bI.init(e,t)});function eL(e,t){return new $I({type:`pipe`,in:e,out:t})}var tL=X(`ZodMiniCustom`,(e,t)=>{Lk.init(e,t),bI.init(e,t)});function nL(e,t){return fj(tL,e??(()=>!0),t)}function rL(e,t={}){return pj(tL,e,t)}var iL=`AI_InvalidArgumentError`,aL=`vercel.ai.error.${iL}`,oL=Symbol.for(aL),sL=class extends Hw{constructor({parameter:e,value:t,message:n}){super({name:iL,message:`Invalid argument for parameter ${e}: ${n}`}),this[oL]=!0,this.parameter=e,this.value=t}static isInstance(e){return Hw.hasMarker(e,aL)}};function cL(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let r in t)if(r!==`__proto__`&&r!==`constructor`&&r!==`prototype`&&Object.prototype.hasOwnProperty.call(t,r)){let i=t[r];if(i===void 0)continue;let a=r in e?e[r]:void 0,o=typeof i==`object`&&!!i&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),s=typeof a==`object`&&!!a&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);n[r]=o&&s?cL(a,i):i}return n}new TextEncoder,new TextEncoder;var lL=`AI_UIMessageStreamError`,uL=`vercel.ai.error.${lL}`,dL=Symbol.for(uL),fL=class extends Hw{constructor({chunkType:e,chunkId:t,message:n}){super({name:lL,message:n}),this[dL]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Hw.hasMarker(e,uL)}};function pL(e){let t=[`ROOT`],n=-1,r=null,i=0;function a(e){return e>=`0`&&e<=`9`||e>=`A`&&e<=`F`||e>=`a`&&e<=`f`}function o(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`);break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`);break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`)}}function s(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop()}}function c(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=r,t.pop()}}for(let l=0;l<e.length;l++){let u=e[l];switch(t[t.length-1]){case`ROOT`:o(u,l,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break;case`}`:n=l,t.pop()}break;case`INSIDE_OBJECT_AFTER_COMMA`:u===`"`&&(t.pop(),t.push(`INSIDE_OBJECT_KEY`));break;case`INSIDE_OBJECT_KEY`:u===`"`&&(t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`));break;case`INSIDE_OBJECT_AFTER_KEY`:u===`:`&&(t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`));break;case`INSIDE_OBJECT_BEFORE_VALUE`:o(u,l,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:s(u,l);break;case`INSIDE_STRING`:switch(u){case`"`:t.pop(),n=l;break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=l}break;case`INSIDE_ARRAY_START`:u===`]`?(n=l,t.pop()):o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(u){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=l,t.pop();break;default:n=l}break;case`INSIDE_ARRAY_AFTER_COMMA`:o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),u===`u`?(i=0,t.push(`INSIDE_STRING_UNICODE_ESCAPE`)):n=l;break;case`INSIDE_STRING_UNICODE_ESCAPE`:a(u)&&(i++,i===4&&(t.pop(),n=l));break;case`INSIDE_NUMBER`:switch(u){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=l;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`}`:t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`]`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l);break;default:t.pop()}break;case`INSIDE_LITERAL`:{let i=e.substring(r,l+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?s(u,l):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l)):n=l;break}}}let l=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:l+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:l+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:l+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?l+=`true`.slice(t.length):`false`.startsWith(t)?l+=`false`.slice(t.length):`null`.startsWith(t)&&(l+=`null`.slice(t.length))}}return l}async function mL(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await gI({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await gI({text:pL(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}qP({prefix:`steer`,size:24}),qP({prefix:`aitxt`,size:24}),qP({prefix:`call`,size:24}),TransformStream;var Z={NEVER:bee,array:PI,boolean:OI,custom:nL,discriminatedUnion:HI,enum:KI,extend:RI,int:EI,literal:JI,looseObject:LI,maximum:UA,minLength:XA,never:MI,nonnegative:qA,number:wI,object:II,optional:QI,pipe:eL,positive:KA,record:WI,refine:rL,safeParse:zE,startsWith:nj,string:SI,transform:XI,union:BI,unknown:AI},Q={array:WN,boolean:IN,custom:OP,discriminatedUnion:XN,instanceof:MP,lazy:EP,literal:iP,null:RN,number:MN,object:KN,record:eP,string:oN,union:JN,unknown:BN},hL=Q.lazy(()=>Q.union([Q.null(),Q.string(),Q.number(),Q.boolean(),Q.record(Q.string(),hL.optional()),Q.array(hL)])),gL=Q.record(Q.string(),Q.record(Q.string(),hL.optional()));function _L(e){return Z.object({source:Z.discriminatedUnion(`sourceType`,[Z.object({type:Z.literal(`source`),sourceType:Z.literal(`url`),id:Z.string(),url:Z.string(),title:Z.optional(Z.string()),providerMetadata:Z.optional(e)}),Z.object({type:Z.literal(`source`),sourceType:Z.literal(`document`),id:Z.string(),mediaType:Z.string(),title:Z.string(),filename:Z.optional(Z.string()),providerMetadata:Z.optional(e)})]),startIndex:Z.optional(Z.number().check(Z.int()).check(Z.nonnegative())),endIndex:Z.optional(Z.number().check(Z.int()).check(Z.nonnegative())),citedText:Z.optional(Z.string())})}var vL=_L(gL),yL=Z.record(Z.string(),Z.optional(hL)),bL=iI(()=>pI(Z.union([Z.looseObject({type:Z.literal(`text-start`),id:Z.string(),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`text-delta`),id:Z.string(),delta:Z.string(),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`text-end`),id:Z.string(),citations:Z.optional(Z.array(vL)),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`error`),errorText:Z.string()}),Z.looseObject({type:Z.literal(`tool-input-start`),toolCallId:Z.string(),toolName:Z.string(),inputEncoding:Z.optional(Z.enum([`json`,`text`])),providerExecuted:Z.optional(Z.boolean()),providerMetadata:Z.optional(gL),toolMetadata:Z.optional(yL),dynamic:Z.optional(Z.boolean()),title:Z.optional(Z.string())}),Z.looseObject({type:Z.literal(`tool-input-delta`),toolCallId:Z.string(),inputTextDelta:Z.string()}),Z.looseObject({type:Z.literal(`tool-input-available`),toolCallId:Z.string(),toolName:Z.string(),input:Z.unknown(),providerExecuted:Z.optional(Z.boolean()),providerMetadata:Z.optional(gL),toolMetadata:Z.optional(yL),dynamic:Z.optional(Z.boolean()),title:Z.optional(Z.string())}),Z.looseObject({type:Z.literal(`tool-input-error`),toolCallId:Z.string(),toolName:Z.string(),input:Z.unknown(),providerExecuted:Z.optional(Z.boolean()),providerMetadata:Z.optional(gL),toolMetadata:Z.optional(yL),dynamic:Z.optional(Z.boolean()),errorText:Z.string(),title:Z.optional(Z.string())}),Z.looseObject({type:Z.literal(`tool-approval-request`),approvalId:Z.string(),toolCallId:Z.string(),approvalDescriptor:Z.optional(Z.unknown()),inputSchemaInput:Z.optional(Z.unknown()),reason:Z.optional(Z.string()),isAutomatic:Z.optional(Z.boolean()),signature:Z.optional(Z.string())}),Z.looseObject({type:Z.literal(`tool-approval-response`),approvalId:Z.string(),approved:Z.boolean(),reason:Z.optional(Z.string()),providerExecuted:Z.optional(Z.boolean()),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`tool-output-available`),toolCallId:Z.string(),output:Z.unknown(),providerExecuted:Z.optional(Z.boolean()),providerMetadata:Z.optional(gL),toolMetadata:Z.optional(yL),dynamic:Z.optional(Z.boolean()),preliminary:Z.optional(Z.boolean())}),Z.looseObject({type:Z.literal(`tool-output-error`),toolCallId:Z.string(),errorText:Z.string(),providerExecuted:Z.optional(Z.boolean()),providerMetadata:Z.optional(gL),toolMetadata:Z.optional(yL),dynamic:Z.optional(Z.boolean())}),Z.looseObject({type:Z.literal(`tool-output-denied`),toolCallId:Z.string()}),Z.looseObject({type:Z.literal(`reasoning-start`),id:Z.string(),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`reasoning-delta`),id:Z.string(),delta:Z.string(),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`reasoning-end`),id:Z.string(),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`custom`),kind:Z.pipe(Z.string(),Z.transform(e=>e)),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`source-url`),sourceId:Z.string(),url:Z.string(),title:Z.optional(Z.string()),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`source-document`),sourceId:Z.string(),mediaType:Z.string(),title:Z.string(),filename:Z.optional(Z.string()),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`file`),url:Z.string(),mediaType:Z.string(),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`reasoning-file`),url:Z.string(),mediaType:Z.string(),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`steering-message`),id:Z.string(),parts:Z.array(Z.union([Z.looseObject({type:Z.literal(`text`),text:Z.string(),providerMetadata:Z.optional(gL)}),Z.looseObject({type:Z.literal(`file`),mediaType:Z.string(),url:Z.string(),filename:Z.optional(Z.string()),providerReference:Z.optional(Z.record(Z.string(),Z.string())),providerMetadata:Z.optional(gL)})]))}),Z.looseObject({type:Z.custom(e=>typeof e==`string`&&e.startsWith(`data-`),{message:`Type must start with "data-"`}),id:Z.optional(Z.string()),data:Z.unknown(),transient:Z.optional(Z.boolean())}),Z.looseObject({type:Z.literal(`start-step`)}),Z.looseObject({type:Z.literal(`finish-step`)}),Z.looseObject({type:Z.literal(`reset-step`)}),Z.looseObject({type:Z.literal(`start`),messageId:Z.optional(Z.string()),messageMetadata:Z.optional(Z.unknown())}),Z.looseObject({type:Z.literal(`finish`),finishReason:Z.optional(Z.enum([`stop`,`length`,`content-filter`,`tool-calls`,`error`,`interrupted`,`other`])),messageMetadata:Z.optional(Z.unknown())}),Z.looseObject({type:Z.literal(`abort`),reason:Z.optional(Z.string())}),Z.looseObject({type:Z.literal(`message-metadata`),messageMetadata:Z.unknown()})])));function xL(e){return e.type.startsWith(`data-`)}function SL(){return Object.create(null)}function CL(e){return e.type.startsWith(`tool-`)}function wL(e){return e.type===`dynamic-tool`}function TL(e){return CL(e)||wL(e)}function EL(e){return e.type.split(`-`).slice(1).join(`-`)}function DL({lastMessage:e,messageId:t}){let n=e?.role===`assistant`?e:{id:t,metadata:void 0,role:`assistant`,parts:[]},r=SL(),i=n.parts.findLastIndex(e=>e.type===`step-start`),a=0;for(let e of n.parts.slice(i+1)){if(!TL(e))continue;let t=a;CL(e)&&a++,e.state===`input-streaming`&&(r[e.toolCallId]={text:e.rawInput??``,inputEncoding:e.inputEncoding,index:t,toolName:e.type===`dynamic-tool`?e.toolName:EL(e),dynamic:e.type===`dynamic-tool`,title:e.title,toolMetadata:e.toolMetadata})}return{message:n,activeTextParts:SL(),activeReasoningParts:SL(),partialToolCalls:r}}function OL({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:o,resetStateOnMessageIdChange:s=!1,resetStateOnFirstMessageStart:c=!1}){let l=!0;return e.pipeThrough(new TransformStream({async transform(e,u){await r(async({state:r,write:d})=>{function f(){let e=r.message.parts,t=e.length-1;for(;t>=0&&e[t].type!==`step-start`;)t--;return e.slice(t+1)}function p(){return f().filter(TL)}function m(e){let t=p().find(t=>t.toolCallId===e);if(t==null){let n=r.message.parts;for(let r=n.length-1;r>=0;r--){let i=n[r];if(TL(i)&&i.toolCallId===e){t=i;break}}}if(t==null)throw new fL({chunkType:`tool-invocation`,chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function h(e){let t=r.message.parts.filter(TL).find(t=>t.approval?.id===e);if(t==null)throw new fL({chunkType:`tool-approval-response`,chunkId:e,message:`No tool invocation found for approval ID "${e}".`});return t}function g(e,t){let n=t??f().find(t=>CL(t)&&t.toolCallId===e.toolCallId),i=e,a=n;if(n!=null){n.state=e.state,a.type=`tool-${e.toolName}`,a.input=i.input,a.output=i.output,a.errorText=i.errorText,a.rawInput=i.rawInput,i.inputEncoding==null?delete a.inputEncoding:a.inputEncoding=i.inputEncoding,a.preliminary=i.preliminary,e.title!==void 0&&(a.title=e.title),e.toolMetadata!==void 0&&(a.toolMetadata=e.toolMetadata),a.providerExecuted=i.providerExecuted??n.providerExecuted;let t=i.providerMetadata;if(t!=null){if(e.state===`output-available`||e.state===`output-error`){let e=n;e.resultProviderMetadata=t}else n.callProviderMetadata=t}}else r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,...e.toolMetadata===void 0?{}:{toolMetadata:e.toolMetadata},input:i.input,...i.inputEncoding==null?{}:{inputEncoding:i.inputEncoding},output:i.output,rawInput:i.rawInput,errorText:i.errorText,providerExecuted:i.providerExecuted,preliminary:i.preliminary,...i.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:i.providerMetadata}:{},...i.providerMetadata!=null&&e.state!==`output-available`&&e.state!==`output-error`?{callProviderMetadata:i.providerMetadata}:{}})}function _(e,t){let n=t??f().find(t=>t.type===`dynamic-tool`&&t.toolCallId===e.toolCallId),i=e,a=n;if(n!=null){n.state=e.state,a.toolName=e.toolName,a.input=i.input,a.output=i.output,a.errorText=i.errorText,a.rawInput=i.rawInput,i.inputEncoding==null?delete a.inputEncoding:a.inputEncoding=i.inputEncoding,a.preliminary=i.preliminary,e.title!==void 0&&(a.title=e.title),e.toolMetadata!==void 0&&(a.toolMetadata=e.toolMetadata),a.providerExecuted=i.providerExecuted??n.providerExecuted;let t=i.providerMetadata;if(t!=null){if(e.state===`output-available`||e.state===`output-error`){let e=n;e.resultProviderMetadata=t}else n.callProviderMetadata=t}}else r.message.parts.push({type:`dynamic-tool`,toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:i.input,...i.inputEncoding==null?{}:{inputEncoding:i.inputEncoding},output:i.output,errorText:i.errorText,preliminary:i.preliminary,providerExecuted:i.providerExecuted,title:e.title,...e.toolMetadata===void 0?{}:{toolMetadata:e.toolMetadata},...i.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:i.providerMetadata}:{},...i.providerMetadata!=null&&e.state!==`output-available`&&e.state!==`output-error`?{callProviderMetadata:i.providerMetadata}:{}})}async function v(e){if(e!=null){let n=r.message.metadata==null?e:cL(r.message.metadata,e);t!=null&&await mI({value:n,schema:t,context:{field:`message.metadata`,entityId:r.message.id}}),r.message.metadata=n}}switch(e.type){case`text-start`:{let t={type:`text`,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeTextParts[e.id]=t,r.message.parts.push(t),d();break}case`text-delta`:{let t=r.activeTextParts[e.id];if(t==null)throw new fL({chunkType:`text-delta`,chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=e.providerMetadata??t.providerMetadata,d();break}case`text-end`:{let t=r.activeTextParts[e.id];if(t==null)throw new fL({chunkType:`text-end`,chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});t.state=`done`,e.citations!=null&&(t.citations=e.citations),t.providerMetadata=e.providerMetadata??t.providerMetadata,delete r.activeTextParts[e.id],d();break}case`custom`:{let t={type:`custom`,kind:e.kind,providerMetadata:e.providerMetadata};r.message.parts.push(t),d();break}case`reasoning-start`:{let t={type:`reasoning`,id:e.id,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),d();break}case`reasoning-delta`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new fL({chunkType:`reasoning-delta`,chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=e.providerMetadata??t.providerMetadata,d();break}case`reasoning-end`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new fL({chunkType:`reasoning-end`,chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});t.providerMetadata=e.providerMetadata??t.providerMetadata,t.state=`done`,delete r.activeReasoningParts[e.id],d();break}case`file`:case`reasoning-file`:r.message.parts.push({type:e.type,mediaType:e.mediaType,url:e.url,...e.providerMetadata==null?{}:{providerMetadata:e.providerMetadata}}),d();break;case`source-url`:r.message.parts.push({type:`source-url`,sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),d();break;case`source-document`:r.message.parts.push({type:`source-document`,sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),d();break;case`tool-input-start`:{let t=f().filter(CL);r.partialToolCalls[e.toolCallId]={text:``,inputEncoding:e.inputEncoding,toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title,toolMetadata:e.toolMetadata},e.dynamic?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,inputEncoding:e.inputEncoding,input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}):g({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,inputEncoding:e.inputEncoding,input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}),d();break}case`tool-input-delta`:{let t=r.partialToolCalls[e.toolCallId];if(t==null)throw new fL({chunkType:`tool-input-delta`,chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;let n=t.inputEncoding===`text`?t.text:(await mL(t.text)).value;t.dynamic?_({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,inputEncoding:t.inputEncoding,input:n,rawInput:t.text,title:t.title,toolMetadata:t.toolMetadata}):g({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,inputEncoding:t.inputEncoding,input:n,rawInput:t.text,title:t.title,toolMetadata:t.toolMetadata}),d();break}case`tool-input-available`:e.dynamic?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}):g({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}),d(),a&&!e.providerExecuted&&await a({toolCall:e});break;case`tool-input-error`:{let t=f().filter(TL).find(t=>t.toolCallId===e.toolCallId);(t==null?e.dynamic:t.type===`dynamic-tool`)?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}):g({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}),d();break}case`tool-approval-request`:{let t=m(e.toolCallId);t.state=`approval-requested`,t.approval={id:e.approvalId,...e.approvalDescriptor==null?{}:{descriptor:e.approvalDescriptor},...Object.prototype.hasOwnProperty.call(e,`inputSchemaInput`)?{inputSchemaInput:e.inputSchemaInput}:{},...e.reason==null?{}:{requestReason:e.reason},...e.isAutomatic===!0?{isAutomatic:!0}:{},...e.signature==null?{}:{signature:e.signature}},d();break}case`tool-approval-response`:{let t=h(e.approvalId),n=t.approval==null?{id:e.approvalId}:t.approval;t.state=`approval-responded`,t.approval={...n,id:e.approvalId,approved:e.approved,...e.reason==null?{}:{reason:e.reason}},e.providerExecuted!=null&&(t.providerExecuted=e.providerExecuted),e.providerMetadata!=null&&(t.callProviderMetadata=e.providerMetadata),d();break}case`tool-output-denied`:{let t=m(e.toolCallId);t.state=`output-denied`,d();break}case`tool-output-available`:{let t=m(e.toolCallId);t.type===`dynamic-tool`?_({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-available`,input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t):g({toolCallId:e.toolCallId,toolName:EL(t),state:`output-available`,input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t),d();break}case`tool-output-error`:{let t=m(e.toolCallId);t.type===`dynamic-tool`?_({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-error`,input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t):g({toolCallId:e.toolCallId,toolName:EL(t),state:`output-error`,input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t),d();break}case`steering-message`:r.message.parts.push({type:`steering-message`,id:e.id,parts:e.parts}),d();break;case`start-step`:r.message.parts.push({type:`step-start`});break;case`finish-step`:break;case`reset-step`:{let e=f();r.activeTextParts=SL(),r.activeReasoningParts=SL(),r.partialToolCalls=SL(),e.length>0&&(r.message.parts.splice(r.message.parts.length-e.length,e.length),d());break}case`start`:{let t=c&&l||s&&e.messageId!=null&&e.messageId!==r.message.id;l=!1,t&&Object.assign(r,DL({lastMessage:void 0,messageId:e.messageId??r.message.id}),{finishReason:void 0}),e.messageId!=null&&(r.message.id=e.messageId),await v(e.messageMetadata),(t||e.messageId!=null||e.messageMetadata!=null)&&d({updateStatus:!1});break}case`finish`:e.finishReason!=null&&(r.finishReason=e.finishReason),await v(e.messageMetadata),e.messageMetadata!=null&&d();break;case`message-metadata`:await v(e.messageMetadata),e.messageMetadata!=null&&d();break;case`error`:i?.(Error(e.errorText));break;default:if(xL(e)){let t=n?.[e.type.slice(5)];if(t!=null){let n=r.message.parts.findIndex(t=>`id`in t&&`data`in t&&t.id===e.id&&t.type===e.type),i=n>=0?n:r.message.parts.length;await mI({value:e.data,schema:t,context:{field:`message.parts[${i}].data`,entityName:e.type,entityId:e.id}})}let i=e;if(i.transient){o?.(i);break}let a=i.id==null?void 0:r.message.parts.find(e=>i.type===e.type&&i.id===e.id);a==null?r.message.parts.push(i):a.data=i.data,o?.(i),d()}}u.enqueue(e)})}}))}async function kL({stream:e,onError:t,abortSignal:n}){let r=e.getReader(),i=()=>{r.cancel().catch(()=>{})};n?.aborted?i():n?.addEventListener(`abort`,i,{once:!0});try{for(;;){let{done:e}=await r.read();if(e)break}}catch(e){t?.(e)}finally{n?.removeEventListener(`abort`,i),r.releaseLock()}}function AL(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}qP({prefix:`aitxt`,size:24}),qP({prefix:`call`,size:24}),qP({prefix:`aitxt`,size:24}),qP({prefix:`call`,size:24});var jL=Symbol(`invalid`);function ML(e){let t=[],n=NL(e,t,new Set);return n===jL?{success:!1,path:t}:{success:!0,value:n}}function NL(e,t,n){switch(typeof e){case`string`:case`boolean`:return e;case`number`:return Number.isFinite(e)?e:jL;case`object`:{if(e===null)return e;if(n.has(e))return jL;n.add(e);let r=Array.isArray(e)?PL(e,t,n):FL(e,t,n);return n.delete(e),r}default:return jL}}function PL(e,t,n){let r;for(let i=0;i<e.length;i++){let a=e[i];t.push(i);let o=NL(a,t,n);if(o===jL)return jL;t.pop(),r==null?o!==a&&(r=e.slice(0,i),r.push(o)):r.push(o)}return r??e}function FL(e,t,n){if(!LL(e)||RL(e))return jL;let r=Object.keys(e),i;for(let a=0;a<r.length;a++){let o=r[a];if(o===`__proto__`){i??=IL(e,r,a);continue}let s=e[o],c=s;if(s!==void 0){if(t.push(o),c=NL(s,t,n),c===jL)return jL;t.pop()}i==null?c!==s&&(i=IL(e,r,a),i[o]=c):i[o]=c}return i??e}function IL(e,t,n){let r={};for(let i=0;i<n;i++)r[t[i]]=e[t[i]];return r}function LL(e){let t=e.constructor;if(typeof t!=`function`)return!0;let n=t.prototype;return typeof n==`object`&&!!n&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)}function RL(e){let t=Object.getOwnPropertySymbols(e);for(let n=0;n<t.length;n++)if(Object.prototype.propertyIsEnumerable.call(e,t[n]))return!0;return!1}var zL=Z.pipe(Z.unknown(),Z.transform((e,t)=>{let n=ML(e);return n.success?n.value:(t.issues.push({code:`custom`,message:`Invalid JSON value. Expected null, a string, a finite number, a boolean, an array, or an object.`,input:e,path:n.path}),Z.NEVER)})),BL=Z.custom();Z.pipe(zL,Z.record(Z.string(),BL));var VL=Z.pipe(zL,Z.record(Z.string(),Z.record(Z.string(),BL)));Z.record(Z.string(),Z.string()),_L(VL),qP({prefix:`call`,size:24}),qP({prefix:`call`,size:24}),new TextEncoder,qP({prefix:`call`,size:24}),qP({prefix:`call`,size:24}),qP({prefix:`aiobj`,size:24});var{atob:Nee}=globalThis,HL=class{constructor(){this.queue=[],this.isProcessing=!1,this.idleWaiters=[]}async processQueue(){if(!this.isProcessing){this.isProcessing=!0;try{for(;this.queue.length>0;)await this.queue[0](),this.queue.shift()}finally{this.isProcessing=!1;for(let e of this.idleWaiters.splice(0))e()}}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){n(e)}}),this.processQueue()})}async waitForIdle(){(this.isProcessing||this.queue.length!==0)&&await new Promise(e=>{this.idleWaiters.push(e)})}};qP({prefix:`aiobj`,size:24}),qP({prefix:`call`,size:24});var UL=Q.union([Q.string(),Q.custom(WP,{message:`Must be a Uint8Array`}),Q.custom(GP,{message:`Must be an ArrayBuffer`}),Q.custom(YP,{message:`Must be a Buffer`})]),WL=Q.record(Q.string(),Q.string()),GL=Q.object({type:Q.literal(`text`),text:Q.string(),providerOptions:gL.optional()}),KL=Q.object({type:Q.literal(`image`),image:Q.union([UL,Q.instanceof(URL),WL]),mediaType:Q.string().optional(),providerOptions:gL.optional()}),qL=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`data`),data:UL}),Q.object({type:Q.literal(`url`),url:Q.instanceof(URL)}),Q.object({type:Q.literal(`reference`),reference:WL}),Q.object({type:Q.literal(`text`),text:Q.string()})]),JL=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`data`),data:UL}),Q.object({type:Q.literal(`url`),url:Q.instanceof(URL)})]),YL=Q.object({type:Q.literal(`file`),data:Q.union([qL,UL,Q.instanceof(URL),WL]),filename:Q.string().optional(),mediaType:Q.string(),providerOptions:gL.optional()}),XL=Q.object({type:Q.literal(`reasoning`),text:Q.string(),providerOptions:gL.optional()}),ZL=Q.object({type:Q.literal(`custom`),kind:Q.string().transform(e=>e),providerOptions:gL.optional()}),QL=Q.object({type:Q.literal(`reasoning-file`),data:Q.union([JL,UL,Q.instanceof(URL)]),mediaType:Q.string(),providerOptions:gL.optional()}),$L=Q.object({type:Q.literal(`tool-call`),toolCallId:Q.string(),toolName:Q.string(),input:Q.unknown(),providerOptions:gL.optional(),providerExecuted:Q.boolean().optional()}),eR=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`text`),value:Q.string(),providerOptions:gL.optional()}),Q.object({type:Q.literal(`json`),value:hL,providerOptions:gL.optional()}),Q.object({type:Q.literal(`execution-denied`),reason:Q.string().optional(),providerOptions:gL.optional()}),Q.object({type:Q.literal(`error-text`),value:Q.string(),providerOptions:gL.optional()}),Q.object({type:Q.literal(`error-json`),value:hL,providerOptions:gL.optional()}),Q.object({type:Q.literal(`content`),value:Q.array(Q.union([Q.object({type:Q.literal(`text`),text:Q.string(),providerOptions:gL.optional()}),Q.object({type:Q.literal(`file`),data:qL,mediaType:Q.string(),filename:Q.string().optional(),providerOptions:gL.optional()}),Q.object({type:Q.literal(`file-data`),data:Q.string(),mediaType:Q.string(),filename:Q.string().optional(),providerOptions:gL.optional()}),Q.object({type:Q.literal(`file-url`),url:Q.string(),mediaType:Q.string().optional(),providerOptions:gL.optional()}),Q.object({type:Q.literal(`file-id`),fileId:Q.union([Q.string(),Q.record(Q.string(),Q.string())]),providerOptions:gL.optional()}),Q.object({type:Q.literal(`file-reference`),providerReference:Q.record(Q.string(),Q.string()),providerOptions:gL.optional()}),Q.object({type:Q.literal(`image-data`),data:Q.string(),mediaType:Q.string(),providerOptions:gL.optional()}),Q.object({type:Q.literal(`image-url`),url:Q.string(),providerOptions:gL.optional()}),Q.object({type:Q.literal(`image-file-id`),fileId:Q.union([Q.string(),Q.record(Q.string(),Q.string())]),providerOptions:gL.optional()}),Q.object({type:Q.literal(`image-file-reference`),providerReference:Q.record(Q.string(),Q.string()),providerOptions:gL.optional()}),Q.object({type:Q.literal(`custom`),providerOptions:gL.optional()})]))})]),tR=Q.object({type:Q.literal(`tool-result`),toolCallId:Q.string(),toolName:Q.string(),output:eR,providerOptions:gL.optional()}),nR=Q.object({type:Q.literal(`tool-approval-request`),approvalId:Q.string(),toolCallId:Q.string(),reason:Q.string().optional(),isAutomatic:Q.boolean().optional(),signature:Q.string().optional(),inputSchemaInput:Q.unknown().optional()}),rR=Q.object({type:Q.literal(`tool-approval-response`),approvalId:Q.string(),approved:Q.boolean(),reason:Q.string().optional()}),iR=Q.object({role:Q.literal(`system`),content:Q.string(),providerOptions:gL.optional()}),aR=Q.object({role:Q.literal(`user`),content:Q.union([Q.string(),Q.array(Q.union([GL,KL,YL]))]),providerOptions:gL.optional()}),oR=Q.object({role:Q.literal(`assistant`),content:Q.union([Q.string(),Q.array(Q.union([GL,ZL,YL,XL,QL,$L,tR,nR]))]),providerOptions:gL.optional()}),sR=Q.object({role:Q.literal(`tool`),content:Q.array(Q.union([tR,rR])),providerOptions:gL.optional()});Q.union([iR,aR,oR,sR]),Z.object({token:Z.string().check(Z.refine(e=>e.trim().length>0)),url:Z.string().check(Z.refine(e=>{try{let t=new URL(e);return(t.protocol===`ws:`||t.protocol===`wss:`)&&t.hostname!==``}catch{return!1}})),expiresAt:Z.optional(Z.number().check(Z.positive()).check(Z.maximum(2**53-1))),tools:Z.optional(Z.array(Z.object({type:Z.literal(`function`),name:Z.string().check(Z.minLength(1)),description:Z.optional(Z.string()),parameters:Z.record(Z.string(),Z.unknown())})))}),qP({prefix:`call`,size:24}),qP({prefix:`call`,size:24}),qP({prefix:`call`,size:24});async function cR({response:e,url:t,fallbackMessage:n}){let r=await e.text();return new Kw({message:r||n,url:t,requestBodyValues:void 0,statusCode:e.status,responseBody:r})}async function lR(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new pT({functionality:`FileList`,message:`FileList is not supported in the current environment`});return Promise.all(Array.from(e).map(async e=>{let{name:t,type:n}=e;return{type:`file`,mediaType:n,filename:t,url:await new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{t(e.target?.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}function uR(e,t){let n=e.search(/[?#]/),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n);return`${r.endsWith(`/`)&&t.startsWith(`/`)?r.slice(0,-1):r}${t}${i}`}var dR=class{constructor({api:e=`/api/chat`,credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:o}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=o}async sendMessages({abortSignal:e,...t}){let n=await yI(this.body),r=await yI(this.headers),i=await yI(this.credentials),a={...KP(r),...KP(t.headers)},o=await this.prepareSendMessagesRequest?.({api:this.api,id:t.chatId,messages:t.messages,body:{...n,...t.body},headers:a,credentials:i,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId}),s=o?.api??this.api,c=o?.headers===void 0?a:KP(o.headers),l=o?.body===void 0?{...n,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId}:o.body,u=o?.credentials??i,d=await(this.fetch??globalThis.fetch)(s,{method:`POST`,headers:{"content-type":`application/json`,...c},body:JSON.stringify(l),credentials:u,signal:e});if(!d.ok)throw await cR({response:d,url:s,fallbackMessage:`Failed to fetch the chat response.`});if(!d.body)throw new Xw({message:`The response body is empty.`});return this.processResponseStream(d.body)}async reconnectToStream(e){let t=await yI(this.body),n=await yI(this.headers),r=await yI(this.credentials),i={...KP(n),...KP(e.headers)},a=await this.prepareReconnectToStreamRequest?.({api:this.api,id:e.chatId,body:{...t,...e.body},headers:i,credentials:r,requestMetadata:e.metadata}),o=a?.api;if(o==null){if(e.chatId===`.`||e.chatId===`..`)throw new sL({parameter:`chatId`,value:e.chatId,message:`Chat IDs must not be "." or ".." when using the default reconnect URL.`});o=uR(this.api,`/${encodeURIComponent(e.chatId)}/stream`)}let s=a?.headers===void 0?i:KP(a.headers),c=a?.credentials??r,l=await(this.fetch??globalThis.fetch)(o,{method:`GET`,headers:s,credentials:c,signal:e.abortSignal});if(l.status===204)return null;if(!l.ok)throw await cR({response:l,url:o,fallbackMessage:`Failed to fetch the chat response.`});if(!l.body)throw new Xw({message:`The response body is empty.`});return this.processResponseStream(l.body)}},fR=class extends dR{constructor({resumeStreamIsReplay:e=!0,...t}={}){super(t),this.resumeStreamIsReplay=e}processResponseStream(e){return vI({stream:e,schema:bL}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},pR=class{get id(){return this._id??=this.generateId()}constructor({generateId:e=JP,id:t,transport:n=new fR,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:o,onToolCall:s,onFinish:c,onData:l,sendAutomaticallyWhen:u,experimental_queue:d=!1}){this.queuedMessagesFallback=[],this.queuedMessageOptions=new Map,this.isQueuePaused=!1,this.pendingAutomaticDecisions=[],this.pendingMessagePreparations=new Set,this.interruptedMessageIds=new Set,this.activeResponse=void 0,this.activeResumeRequest=void 0,this.resumableStreamState=void 0,this.jobExecutor=new HL,this.activeStopCount=0,this.stopGeneration=0,this.experimental_removeQueuedMessage=e=>{this.queuedMessageOptions.delete(e),this.setQueuedMessages(this.experimental_queuedMessages.filter(t=>t.id!==e))},this.experimental_sendQueuedMessageNow=async e=>{let t=this.experimental_queuedMessages.find(t=>t.id===e);if(t==null)return;this.setQueuedMessages([t,...this.experimental_queuedMessages.filter(t=>t.id!==e)]);let n=this.stopGeneration+1;await this.stop(),n===this.stopGeneration&&await this.resumeQueue({skipWaitForUser:!0,options:this.queuedMessageOptions.get(e)})},this.sendMessage=async(e,t)=>{if(e==null){let e=this.pendingApprovalMessageId;if(e==null){e=this.lastMessage?.id;for(let t=this.state.messages.length-1;t>=0;t--){let n=this.state.messages[t];if(n.role===`assistant`&&n.parts.some(e=>TL(e)&&e.state===`approval-responded`)){e=n.id;break}}}let n=e!=null&&e===this.pendingApprovalMessageId?this.state.messages.findIndex(t=>t.id===e):-1;await this.makeRequestForToolApproval({messageId:e,messageIndex:n,...t});return}let n;if(`text`in e||`files`in e){let t=new AbortController;this.pendingMessagePreparations.add(t);let r;try{r=Array.isArray(e.files)?e.files:await lR(e.files)}finally{this.pendingMessagePreparations.delete(t)}if(t.signal.aborted)return;n={parts:[...r,...`text`in e&&e.text!=null?[{type:`text`,text:e.text}]:[]]}}else n=e;if(this.queueEnabled&&e.messageId==null&&(this.isRequestInProgress()||this.isWaitingForUser()||this.experimental_queuedMessages.length>0)){let r={...n,id:n.id??this.generateId(),role:n.role??`user`,metadata:e.metadata};t!=null&&this.queuedMessageOptions.set(r.id,t),this.setQueuedMessages([...this.experimental_queuedMessages,r]),await this.resumeQueue({skipWaitForUser:this.isQueuePaused,options:t})}else{if(e.messageId!=null){await this.clearQueueForHistoryChange();let t=this.state.messages.findIndex(t=>t.id===e.messageId);if(t===-1)throw new sL({parameter:`message.messageId`,value:e.messageId,message:`message with id ${e.messageId} not found`});if(this.state.messages[t].role!==`user`)throw new sL({parameter:`message.messageId`,value:e.messageId,message:`message with id ${e.messageId} is not a user message`});this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{id:e.messageId,...n,role:n.role??`user`,metadata:e.metadata})}else this.state.pushMessage({...n,id:n.id??this.generateId(),role:n.role??`user`,metadata:e.metadata});this.isQueuePaused=!1,await this.makeRequest({trigger:`submit-message`,messageId:e.messageId,...t})}},this.regenerate=async({messageId:e,...t}={})=>{await this.clearQueueForHistoryChange();let n=e==null?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(n===-1)throw new sL({parameter:`messageId`,value:e,message:`message ${e} not found`});this.state.messages=this.state.messages.slice(0,this.messages[n].role===`assistant`?n:n+1),await this.makeRequest({trigger:`regenerate-message`,messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:`resume-stream`,...e})},this[`~resumeStreamIfDisconnected`]=async({shouldResume:e=()=>!0}={})=>{let t=this.activeResponse;this.resumableStreamState==null&&t!=null&&(await t.completionPromise,this.resumableStreamState!==t.state)||this.resumableStreamState!=null&&e()&&await this.resumeStream()},this.clearError=()=>{this.status===`error`&&(this.state.error=void 0,this.setStatus({status:`ready`}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:n,options:r})=>this.jobExecutor.run(async()=>{let i=this.stopGeneration,a=this.state.messages,o=r=>TL(r)&&r.state===`approval-requested`&&r.approval.id===e?{...r,state:`approval-responded`,approval:{...r.approval,id:e,approved:t,reason:n}}:r,s=a.findIndex(t=>t.parts.some(t=>TL(t)&&t.state===`approval-requested`&&t.approval.id===e));if(s!==-1){let e=a[s];this.state.replaceMessage(s,{...e,parts:e.parts.map(o)}),this.pendingApprovalMessageId=e.id}if(this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(o)),s!==-1&&this.status!==`streaming`&&this.status!==`submitted`&&this.sendAutomaticallyWhen){let e=await this.shouldSendAutomatically(a[s].id);if(e){this.runAutomaticRequest(()=>{let e=s===-1?this.lastMessage?.id:a[s].id;return this.makeRequestForToolApproval({messageId:e,messageIndex:s,...r})},e);return}}this.settleQueue({stopGeneration:i})}),this.addToolOutput=async({state:e,toolCallId:t,output:n,errorText:r,options:i})=>this.jobExecutor.run(async()=>{let a=this.stopGeneration,o=this.state.messages,s=i=>{if(!TL(i)||i.toolCallId!==t)return i;let{approval:a,...o}=i,s=a?.approved===!0?{approval:{...a,approved:a.approved}}:{};return e===`output-error`?{...o,...s,state:e,input:i.input,output:void 0,errorText:r}:{...o,...s,state:`output-available`,input:i.input,output:n,errorText:void 0}},c=o.findIndex(e=>e.parts.some(e=>TL(e)&&e.toolCallId===t));if(c!==-1){let e=o[c];this.state.replaceMessage(c,{...e,parts:e.parts.map(s)})}if(this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(s)),c!==-1&&this.status!==`streaming`&&this.status!==`submitted`&&this.sendAutomaticallyWhen){let e=await this.shouldSendAutomatically(o[c].id);if(e){this.runAutomaticRequest(()=>this.makeRequest({trigger:`submit-message`,messageId:o[c].id,...i}),e);return}}this.settleQueue({stopGeneration:a})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{this.activeStopCount++,this.stopGeneration++,this.deferredApprovalSend=void 0;try{let e=this.activeResumeRequest,t=this.activeResponse;for(let e of this.pendingMessagePreparations)e.abort();e?.abortController.abort(),t?.abortController.abort(),await Promise.all([e?.completionPromise,t?.completionPromise]),await this.jobExecutor.waitForIdle(),this.isQueuePaused=!0}finally{this.activeStopCount--}},this.dispose=async()=>{await this.stop(),this.transport.close?.()},this._id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=o,this.onToolCall=s,this.onFinish=c,this.onData=l,this.sendAutomaticallyWhen=u,this.queueEnabled=d}get status(){return this.state.status}setStatus({status:e,error:t}){this.status===e?this.error!==t&&(this.state.error=t):(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}get experimental_queuedMessages(){return this.state.experimental_queuedMessages??this.queuedMessagesFallback}setQueuedMessages(e){`experimental_queuedMessages`in this.state?this.state.experimental_queuedMessages=e:this.queuedMessagesFallback=e}async resumeQueue({skipWaitForUser:e,options:t}){if(this.isQueuePaused=!1,this.hasUnsentApprovalResponse()){if(!this.isRequestInProgress()){await this.sendMessage(void 0,t);return}this.deferredApprovalSend={options:t}}await this.settleQueue({skipWaitForUser:e})}async clearQueueForHistoryChange(){this.queueEnabled&&(this.queuedMessageOptions.clear(),this.setQueuedMessages([]),this.deferredApprovalSend=void 0,this.isRequestInProgress()&&await this.stop())}isRequestInProgress(){return this.pendingAutomaticDecisions.includes(this.stopGeneration)||this.activeResponse!=null||this.status===`submitted`||this.status===`streaming`}isWaitingForUser(){let e=this.lastMessage;return e?.role===`assistant`&&e.parts.some(e=>TL(e)&&(e.state===`approval-requested`||e.state===`approval-responded`||!e.providerExecuted&&(e.state===`input-streaming`||e.state===`input-available`)))}hasUnsentApprovalResponse(){let e=this.lastMessage;return e?.role===`assistant`&&e.parts.some(e=>TL(e)&&e.state===`approval-responded`)&&!e.parts.some(e=>TL(e)&&(e.state===`approval-requested`||!e.providerExecuted&&(e.state===`input-streaming`||e.state===`input-available`)))}async settleQueue({stopGeneration:e=this.stopGeneration,skipWaitForUser:t=!1}={}){if(this.isQueuePaused||this.isRequestInProgress()||this.activeStopCount>0||e!==this.stopGeneration)return;let n=this.deferredApprovalSend;if(this.deferredApprovalSend=void 0,n!=null&&this.hasUnsentApprovalResponse()){await this.sendMessage(void 0,n.options);return}let[r,...i]=this.experimental_queuedMessages;if(r==null||!t&&this.isWaitingForUser())return;let a=this.queuedMessageOptions.get(r.id);this.queuedMessageOptions.delete(r.id),this.setQueuedMessages(i),this.state.pushMessage(r),await this.makeRequest({trigger:`submit-message`,...a})}set messages(e){this.state.messages=e}async shouldSendAutomatically(e=this.lastMessage?.id){let t=e=>e!=null&&this.interruptedMessageIds.has(e);if(!this.sendAutomaticallyWhen||t(e)||t(this.lastMessage?.id))return!1;let n=this.stopGeneration;this.pendingAutomaticDecisions.push(n);let r;try{r=await this.sendAutomaticallyWhen({messages:this.state.messages})}finally{this.pendingAutomaticDecisions.splice(this.pendingAutomaticDecisions.indexOf(n),1)}return r&&!t(e)&&!t(this.lastMessage?.id)}async runAutomaticRequest(e,t){let n=this.stopGeneration,r=this.activeStopCount>0;return!(t??await this.shouldSendAutomatically())||r||n!==this.stopGeneration||this.activeStopCount>0?!1:(await e(),!0)}async makeRequestForToolApproval({messageId:e,messageIndex:t,...n}){this.deferredApprovalSend=void 0;let r=e!=null&&e===this.pendingApprovalMessageId;r&&(this.pendingApprovalMessageId=void 0),await this.makeRequest({trigger:`submit-message`,messageId:e,...n}),r&&this.status===`error`&&this.pendingApprovalMessageId==null&&(this.pendingApprovalMessageId=this.state.messages[t]?.id??e)}async makeRequest(e){let t=AL();try{await this.makeRequestImpl({...e,completionPromise:t.promise})}finally{t.resolve()}}async makeRequestImpl({trigger:e,metadata:t,headers:n,body:r,messageId:i,completionPromise:a}){e!==`resume-stream`&&(this.resumableStreamState=void 0);let o=new AbortController,s=e===`resume-stream`?{abortController:o,completionPromise:a}:void 0;s&&(this.activeResumeRequest?.abortController.abort(),this.activeResumeRequest=s);let c=()=>s==null||this.activeResumeRequest===s,l=()=>{this.activeResumeRequest===s&&(this.activeResumeRequest=void 0)},u;if(e===`resume-stream`)try{let e=await this.transport.reconnectToStream({chatId:this.id,abortSignal:o.signal,metadata:t,headers:n,body:r});if(o.signal.aborted||!c()){await e?.cancel().catch(()=>{}),c()&&(this.setStatus({status:`ready`}),this.resumableStreamState=void 0),l();return}if(e==null){this.setStatus({status:`ready`}),this.resumableStreamState=void 0,l();return}u=e}catch(e){if(o.signal.aborted||e.name===`AbortError`){c()&&(this.setStatus({status:`ready`}),this.resumableStreamState=void 0),l();return}if(!c())return;this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:`error`,error:e}),l();return}this.setStatus({status:`submitted`,error:void 0});let d=this.lastMessage,f=e===`submit-message`&&i!=null?this.state.messages.findIndex(e=>e.id===i):this.state.messages.length-1,p=f===-1?d:this.state.messages[f],m=p?.id,h=e===`resume-stream`&&p?.role===`assistant`&&p.parts.some(e=>TL(e)&&(e.state===`input-streaming`||e.state===`input-available`&&e.providerExecuted||e.state===`approval-responded`))?this.state.snapshot(p):void 0,g=f!==-1&&f<this.state.messages.length-1&&p?.role===`assistant`,_=!1,v=!1,y=!1,b;try{let s={state:e===`resume-stream`&&this.resumableStreamState!=null?this.resumableStreamState:DL({lastMessage:e===`resume-stream`?h:e===`regenerate-message`?void 0:this.state.snapshot(p),messageId:this.generateId()}),abortController:o,completionPromise:a};b=s,s.abortController.signal.addEventListener(`abort`,()=>{_=!0}),this.activeResponse=s;let l;if(l=e===`resume-stream`?u:await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:s.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i}),await kL({stream:OL({stream:l,resetStateOnMessageIdChange:e===`resume-stream`,resetStateOnFirstMessageStart:e===`resume-stream`&&this.transport.resumeStreamIsReplay,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:e=>this.jobExecutor.run(()=>s.abortController.signal.aborted?Promise.resolve():e({state:s.state,write:({updateStatus:e=!0}={})=>{if(s.abortController.signal.aborted)return;e&&this.setStatus({status:`streaming`});let t=this.state.messages.findLastIndex(e=>e.id===s.state.message.id);if(t!==-1)this.state.replaceMessage(t,s.state.message);else if(g){let e=this.state.messages.findLastIndex(e=>e.id===m);e===-1?this.state.pushMessage(s.state.message):this.state.replaceMessage(e,s.state.message)}else this.state.pushMessage(s.state.message)}})),onError:e=>{throw e}}),abortSignal:s.abortController.signal,onError:e=>{throw e}}),_)return c()&&(this.setStatus({status:`ready`}),this.resumableStreamState===s.state&&(this.resumableStreamState=void 0)),null;c()&&(this.setStatus({status:`ready`}),this.resumableStreamState===s.state&&(this.resumableStreamState=void 0))}catch(e){if(_||e.name===`AbortError`)return _=!0,c()&&(this.setStatus({status:`ready`}),this.resumableStreamState===b?.state&&(this.resumableStreamState=void 0)),null;if(!c())return null;if(y=!0,e instanceof TypeError){let t=e.message.toLowerCase();v=t.includes(`fetch`)||t.includes(`network`)||t===`load failed`}v?this.resumableStreamState=b?.state:this.resumableStreamState===b?.state&&(this.resumableStreamState=void 0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:`error`,error:e})}finally{try{if(b){let{message:e,finishReason:t}=b.state;t===`interrupted`?this.interruptedMessageIds.add(e.id):!_&&!y&&this.interruptedMessageIds.delete(e.id),this.onFinish?.({message:b.state.message,messages:this.state.messages,isAbort:_,isDisconnect:v,isError:y,finishReason:b.state.finishReason})}}finally{(_||y||b?.state.finishReason===`interrupted`)&&(this.isQueuePaused=!0),this.activeResponse===b&&(this.activeResponse=void 0),l()}}if(!_&&!y&&b?.state.finishReason!==`interrupted`){let e=this.stopGeneration;await this.runAutomaticRequest(()=>this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,metadata:t,headers:n,body:r}))||await this.settleQueue({stopGeneration:e})}}};function mR({messages:e}){let t=e[e.length-1];if(!t||t.role!==`assistant`)return!1;let n=t.parts.reduce((e,t,n)=>t.type===`step-start`?n:e,-1),r=t.parts.slice(n+1).filter(TL);return r.filter(e=>e.state===`approval-responded`).length>0&&r.every(e=>e.state===`output-available`&&e.preliminary!==!0||e.state===`output-error`||e.state===`output-denied`||e.state===`approval-responded`)}var hR=l(o(((e,t)=>{t.exports=function(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);let a=Date.now(),o=t-(a-r);o<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},o)}}}))(),1);function gR(e,t){return t==null?e:(0,hR.default)(e,t)}function _R(e){return Array.isArray(e)?[...e]:typeof e==`object`&&e&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)?{...e}:e}var vR=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e=[]){this.#t=`ready`,this.#n=void 0,this.#r=[],this.#i=new Set,this.#a=new Set,this.#o=new Set,this.#s=new Set,this.pushMessage=e=>{this.#e=this.#e.concat(e),this.#c()},this.popMessage=()=>{this.#e=this.#e.slice(0,-1),this.#c()},this.replaceMessage=(e,t)=>{this.#e=[...this.#e.slice(0,e),this.snapshot(t),...this.#e.slice(e+1)],this.#c()},this.snapshot=e=>{if(typeof e!=`object`||!e||!(`parts`in e)||!Array.isArray(e.parts))return e;let t=e,n={...t,parts:t.parts.map(e=>({...e}))};return`metadata`in t&&(n.metadata=_R(t.metadata)),n},this[`~registerMessagesCallback`]=(e,t)=>{let n=t?gR(e,t):e;return this.#i.add(n),()=>{this.#i.delete(n)}},this[`~registerStatusCallback`]=e=>(this.#o.add(e),()=>{this.#o.delete(e)}),this[`~registerErrorCallback`]=e=>(this.#s.add(e),()=>{this.#s.delete(e)}),this[`~registerQueuedMessagesCallback`]=e=>(this.#a.add(e),()=>{this.#a.delete(e)}),this.#c=()=>{this.#i.forEach(e=>e())},this.#l=()=>{this.#o.forEach(e=>e())},this.#u=()=>{this.#s.forEach(e=>e())},this.#e=e}get status(){return this.#t}set status(e){this.#t=e,this.#l()}get error(){return this.#n}set error(e){this.#n=e,this.#u()}get experimental_queuedMessages(){return this.#r}set experimental_queuedMessages(e){this.#r=e,this.#a.forEach(e=>e())}get messages(){return this.#e}set messages(e){this.#e=[...e],this.#c()}#c;#l;#u},yR=class extends pR{#e;constructor({messages:e,...t}){let n=new vR(e);super({...t,state:n}),this[`~registerMessagesCallback`]=(e,t)=>this.#e[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>this.#e[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>this.#e[`~registerErrorCallback`](e),this[`~registerQueuedMessagesCallback`]=e=>this.#e[`~registerQueuedMessagesCallback`](e),this.#e=n}},bR=new WeakMap;function xR({chat:e,state:t}){if(document.visibilityState!==`visible`||t.pendingVisibilityResume!=null)return;let n=()=>bR.get(e)===t&&t.registrations.size>0,r=()=>{t.pendingVisibilityResume=void 0};t.pendingVisibilityResume=e[`~resumeStreamIfDisconnected`]({shouldResume:()=>n()&&document.visibilityState===`visible`}).then(r,r)}function SR({chat:e,registration:t}){let n=bR.get(e);if(n==null){let t={registrations:new Set};if(bR.set(e,t),n=t,typeof document<`u`){let n=()=>xR({chat:e,state:t});document.addEventListener(`visibilitychange`,n),t.cleanupVisibilityListener=()=>{document.removeEventListener(`visibilitychange`,n)}}}let{registrations:r}=n,i=r.size===0;return r.add(t),i&&e.status!==`submitted`&&e.status!==`streaming`&&e.resumeStream(),()=>{r.delete(t),r.size===0&&(n.cleanupVisibilityListener?.(),bR.delete(e))}}function CR(e){return{chat:e,messages:e.messages,status:e.status,error:e.error,experimental_queuedMessages:e.experimental_queuedMessages}}function wR(e,t){return e.chat===t.chat&&e.messages===t.messages&&e.status===t.status&&e.error===t.error&&e.experimental_queuedMessages===t.experimental_queuedMessages}function TR({throttle:e,experimental_throttle:t,resume:n=!1,...r}={}){let i=e??t,a=(0,b.useRef)({}),o=(0,b.useRef)({});`chat`in r||(o.current={onToolCall:r.onToolCall,onData:r.onData,onFinish:r.onFinish,onError:r.onError,sendAutomaticallyWhen:r.sendAutomaticallyWhen,transport:r.transport});let s,c=()=>o.current.transport??(s??=new fR),l={...r,transport:{get resumeStreamIsReplay(){return c().resumeStreamIsReplay},sendMessages:e=>c().sendMessages(e),reconnectToStream:e=>c().reconnectToStream(e)},onToolCall:e=>o.current.onToolCall?.(e),onData:e=>o.current.onData?.(e),onFinish:e=>o.current.onFinish?.(e),onError:e=>o.current.onError?.(e),sendAutomaticallyWhen:e=>o.current.sendAutomaticallyWhen?.(e)??!1},u=`chat`in r?r.chat:r.id,{chat:d,isExternallyManaged:f}=(0,b.useMemo)(()=>({chat:`chat`in r?r.chat:new yR(l),isExternallyManaged:`chat`in r}),[u]);(0,b.useEffect)(()=>{if(!f)return()=>{d.stop()}},[d,f]);let[p,m]=(0,b.useState)(()=>CR(d));p.chat!==d&&m(CR(d)),(0,b.useEffect)(()=>{let e=!0,t=()=>{if(!e)return;let t=CR(d);m(e=>e.chat!==d||wR(e,t)?e:t)},n=[d[`~registerMessagesCallback`](t,i),d[`~registerStatusCallback`](t),d[`~registerErrorCallback`](t),d[`~registerQueuedMessagesCallback`](t)],r=CR(d);return m(e=>wR(e,r)?e:r),()=>{e=!1,n.forEach(e=>e())}},[d,i]);let{messages:h,status:g,error:_,experimental_queuedMessages:v}=p,y=(0,b.useCallback)(e=>{typeof e==`function`&&(e=e(d.messages)),d.messages=e},[d]);return(0,b.useEffect)(()=>{if(n)return SR({chat:d,registration:a.current})},[n,d]),{get id(){return d.id},messages:h,setMessages:y,sendMessage:d.sendMessage,regenerate:d.regenerate,clearError:d.clearError,stop:d.stop,error:_,resumeStream:d.resumeStream,status:g,addToolResult:d.addToolOutput,addToolOutput:d.addToolOutput,addToolApprovalResponse:d.addToolApprovalResponse,experimental_queuedMessages:v,experimental_removeQueuedMessage:d.experimental_removeQueuedMessage,experimental_sendQueuedMessageNow:d.experimental_sendQueuedMessageNow}}function ER(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var DR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kR={};function AR(e,t){return((t||kR).jsx?OR:DR).test(e)}var jR=/[ \t\n\f\r]/g;function MR(e){return typeof e==`object`?e.type===`text`&&NR(e.value):NR(e)}function NR(e){return e.replace(jR,``)===``}var PR=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};PR.prototype.normal={},PR.prototype.property={},PR.prototype.space=void 0;function FR(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new PR(n,r,t)}function IR(e){return e.toLowerCase()}var LR=class{constructor(e,t){this.attribute=t,this.property=e}};LR.prototype.attribute=``,LR.prototype.booleanish=!1,LR.prototype.boolean=!1,LR.prototype.commaOrSpaceSeparated=!1,LR.prototype.commaSeparated=!1,LR.prototype.defined=!1,LR.prototype.mustUseProperty=!1,LR.prototype.number=!1,LR.prototype.overloadedBoolean=!1,LR.prototype.property=``,LR.prototype.spaceSeparated=!1,LR.prototype.space=void 0;var RR=s({boolean:()=>BR,booleanish:()=>VR,commaOrSpaceSeparated:()=>GR,commaSeparated:()=>WR,number:()=>$,overloadedBoolean:()=>HR,spaceSeparated:()=>UR}),zR=0,BR=KR(),VR=KR(),HR=KR(),$=KR(),UR=KR(),WR=KR(),GR=KR();function KR(){return 2**++zR}var qR=Object.keys(RR),JR=class extends LR{constructor(e,t,n,r){let i=-1;if(super(e,t),YR(this,`space`,r),typeof n==`number`)for(;++i<qR.length;){let e=qR[i];YR(this,qR[i],(n&RR[e])===RR[e])}}};JR.prototype.defined=!0;function YR(e,t,n){n&&(e[t]=n)}function XR(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new JR(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[IR(r)]=r,n[IR(a.attribute)]=r}return new PR(t,n,e.space)}var ZR=XR({properties:{ariaActiveDescendant:null,ariaAtomic:VR,ariaAutoComplete:null,ariaBusy:VR,ariaChecked:VR,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:UR,ariaCurrent:null,ariaDescribedBy:UR,ariaDetails:null,ariaDisabled:VR,ariaDropEffect:UR,ariaErrorMessage:null,ariaExpanded:VR,ariaFlowTo:UR,ariaGrabbed:VR,ariaHasPopup:null,ariaHidden:VR,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:UR,ariaLevel:$,ariaLive:null,ariaModal:VR,ariaMultiLine:VR,ariaMultiSelectable:VR,ariaOrientation:null,ariaOwns:UR,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:VR,ariaReadOnly:VR,ariaRelevant:null,ariaRequired:VR,ariaRoleDescription:UR,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:VR,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function QR(e,t){return t in e?e[t]:t}function $R(e,t){return QR(e,t.toLowerCase())}var ez=XR({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:WR,acceptCharset:UR,accessKey:UR,action:null,allow:null,allowFullScreen:BR,allowPaymentRequest:BR,allowUserMedia:BR,alpha:BR,alt:null,as:null,async:BR,autoCapitalize:null,autoComplete:UR,autoFocus:BR,autoPlay:BR,blocking:UR,capture:null,charSet:null,checked:BR,cite:null,className:UR,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:VR,controls:BR,controlsList:UR,coords:$|WR,crossOrigin:null,data:null,dateTime:null,decoding:null,default:BR,defer:BR,dir:null,dirName:null,disabled:BR,download:HR,draggable:VR,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:BR,formTarget:null,headers:UR,height:$,hidden:HR,high:$,href:null,hrefLang:null,htmlFor:UR,httpEquiv:UR,id:null,imageSizes:null,imageSrcSet:null,inert:BR,inputMode:null,integrity:null,is:null,isMap:BR,itemId:null,itemProp:UR,itemRef:UR,itemScope:BR,itemType:UR,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:BR,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:BR,muted:BR,name:null,nonce:null,noModule:BR,noValidate:BR,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:BR,optimum:$,pattern:null,ping:UR,placeholder:null,playsInline:BR,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:BR,referrerPolicy:null,rel:UR,required:BR,reversed:BR,rows:$,rowSpan:$,sandbox:UR,scope:null,scoped:BR,seamless:BR,selected:BR,shadowRootClonable:BR,shadowRootCustomElementRegistry:BR,shadowRootDelegatesFocus:BR,shadowRootMode:null,shadowRootSerializable:BR,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:VR,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:BR,useMap:null,value:VR,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:UR,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:BR,declare:BR,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:BR,noHref:BR,noShade:BR,noWrap:BR,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:VR,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:BR,disablePictureInPicture:BR,disableRemotePlayback:BR,exportParts:WR,part:UR,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:$R}),tz=XR({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:GR,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:UR,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:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:BR,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,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:WR,g2:WR,glyphName:WR,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:GR,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,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:$,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:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:UR,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:GR,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:GR,rev:GR,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:GR,requiredFeatures:GR,requiredFonts:GR,requiredFormats:GR,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:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:GR,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:GR,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:GR,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:QR}),nz=XR({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()}}),rz=XR({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:$R}),iz=XR({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),az={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`},oz=/[A-Z]/g,sz=/-[a-z]/g,cz=/^data[-\w.:]+$/i;function lz(e,t){let n=IR(t),r=t,i=LR;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&cz.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(sz,dz);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!sz.test(e)){let n=e.replace(oz,uz);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=JR}return new i(r,t)}function uz(e){return`-`+e.toLowerCase()}function dz(e){return e.charAt(1).toUpperCase()}var fz=FR([ZR,ez,nz,rz,iz],`html`),pz=FR([ZR,tz,nz,rz,iz],`svg`);function mz(e){return e.join(` `).trim()}var hz=/\/\*(?:[^*]|\*(?!\/))*\*\//g,gz=/\n/g,_z=/^\s*/,vz=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,yz=/^:\s*/,bz=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,xz=/^[;\s]*/,Sz=`
|
|
251
|
+
`,Cz=`/`,wz=`*`,Tz=``,Ez=`comment`,Dz=`declaration`;function Oz(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(gz);t&&(n+=t.length);var i=e.lastIndexOf(Sz);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(_z)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(Cz==e.charAt(0)&&wz==e.charAt(1)){for(var n=2;Tz!=e.charAt(n)&&(wz!=e.charAt(n)||Cz!=e.charAt(n+1));)++n;if(n+=2,Tz===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Ez,comment:o})}}function f(){var e=a(),t=c(vz);if(t){if(d(),!c(yz))return s(`property missing ':'`);var n=c(bz),r=e({type:Dz,property:t[0].replace(hz,Tz).trim(),value:n?n[0].replace(hz,Tz).trim():Tz});return c(xz),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function kz(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Oz(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var Az=Mz(`end`),jz=Mz(`start`);function Mz(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Nz(e){let t=jz(e),n=Az(e);if(t&&n)return{start:t,end:n}}function Pz(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Iz(e.position):`start`in e||`end`in e?Iz(e):`line`in e||`column`in e?Fz(e):``}function Fz(e){return Lz(e&&e.line)+`:`+Lz(e&&e.column)}function Iz(e){return Fz(e&&e.start)+`-`+Fz(e&&e.end)}function Lz(e){return e&&typeof e==`number`?e:1}var Rz=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=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=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Pz(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=a&&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}};Object.defineProperties(Rz.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var zz={}.hasOwnProperty,Bz=new Map,Vz=/[A-Z]/g,Hz=/-([a-z])/g,Uz=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Wz=new Set([`td`,`th`]),Gz=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Kz(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=rB(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=nB(n,t.jsx,t.jsxs)}let i={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`?pz:fz,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=qz(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function qz(e,t,n){if(t.type===`element`)return Jz(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Yz(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Zz(e,t,n);if(t.type===`mdxjsEsm`)return Xz(e,t);if(t.type===`root`)return Qz(e,t,n);if(t.type===`text`)return $z(e,t)}function Jz(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=pz,e.schema=i),e.ancestors.push(t);let a=lB(e,t.tagName,!1),o=iB(e,t),s=oB(e,t);return Uz.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!MR(e)})),eB(e,o,a,t),tB(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Yz(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}uB(e,t.position)}function Xz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);uB(e,t.position)}function Zz(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=pz,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:lB(e,t.name,!0),o=aB(e,t),s=oB(e,t);return eB(e,o,a,t),tB(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Qz(e,t,n){let r={};return tB(r,oB(e,t)),e.create(t,e.Fragment,r,n)}function $z(e,t){return t.value}function eB(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tB(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function nB(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function rB(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=jz(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function iB(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&zz.call(t.properties,i)){let a=sB(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Wz.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function aB(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else uB(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else uB(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function oB(e,t){let n=[],r=-1,i=e.passKeys?new Map:Bz;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=qz(e,a,o);s!==void 0&&n.push(s)}return n}function sB(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=lz(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?ER(n):mz(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:dB(n):cB(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?az[r.property]||r.property:r.attribute,n]}function cB(e,t){let n={};try{kz(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(Hz,mB))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Rz("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Gz+`#cannot-parse-style-attribute`,r}return n}function lB(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=AR(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=AR(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return zz.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);uB(e)}function uB(e,t){let n=new Rz("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=Gz+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function dB(e){let t={},n;for(n in e)zz.call(e,n)&&(t[fB(n)]=e[n]);return t}function fB(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(Vz,pB);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function pB(e){return`-`+e.toLowerCase()}function mB(e,t){return t.toUpperCase()}var hB={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`]},gB={};function _B(e,t){let n=t||gB;return vB(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function vB(e,t,n){if(bB(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 yB(e.children,t,n)}return Array.isArray(e)?yB(e,t,n):``}function yB(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=vB(e[i],t,n);return r.join(``)}function bB(e){return!!(e&&typeof e==`object`)}var xB=document.createElement(`i`);function SB(e){let t=`&`+e+`;`;xB.innerHTML=t;let n=xB.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function CB(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i: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);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function wB(e,t){return e.length>0?(CB(e,e.length,0,t),e):t}var TB={}.hasOwnProperty;function EB(e){let t={},n=-1;for(;++n<e.length;)DB(t,e[n]);return t}function DB(e,t){let n;for(n in t){let r=(TB.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){TB.call(r,a)||(r[a]=[]);let e=i[a];OB(r[a],Array.isArray(e)?e:e?[e]:[])}}}function OB(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);CB(e,0,0,r)}function kB(e,t){let 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 AB(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var jB=UB(/[A-Za-z]/),MB=UB(/[\dA-Za-z]/),NB=UB(/[#-'*+\--9=?A-Z^-~]/);function PB(e){return e!==null&&(e<32||e===127)}var FB=UB(/\d/),IB=UB(/[\dA-Fa-f]/),LB=UB(/[!-/:-@[-`{-~]/);function RB(e){return e!==null&&e<-2}function zB(e){return e!==null&&(e<0||e===32)}function BB(e){return e===-2||e===-1||e===32}var VB=UB(/\p{P}|\p{S}/u),HB=UB(/\s/);function UB(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function WB(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&MB(e.charCodeAt(n+1))&&MB(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function GB(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return BB(r)?(e.enter(n),s(r)):t(r)}function s(r){return BB(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function KB(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&BB(t)?(e.enter(r),c(t)):l(t)}function c(t){return BB(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var qB={tokenize:JB};function JB(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),GB(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return RB(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var YB=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){XB(this,e,t,n,!1)}addBefore(e,t,n){XB(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function XB(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var ZB={tokenize:$B},QB={tokenize:eV};function $B(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new YB;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(QB,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(QB,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return RB(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new YB;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function eV(e,t,n){return GB(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function tV(e){if(e===null||zB(e)||HB(e))return 1;if(VB(e))return 2}function nV(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var rV={name:`attention`,resolveAll:iV,tokenize:aV};function iV(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};oV(o,-a),oV(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=wB(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=wB(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=wB(r,nV(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=wB(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=wB(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),CB(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function aV(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=tV(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=tV(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function oV(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var sV={name:`autolink`,tokenize:cV};function cV(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return jB(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||MB(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||MB(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||PB(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):NB(t)?(e.consume(t),l):n(t)}function u(e){return MB(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||MB(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var lV={partial:!0,tokenize:uV};function uV(e,t,n){return r;function r(t){return BB(t)?GB(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||RB(e)?t(e):n(e)}}var dV={continuation:{tokenize:pV},exit:mV,name:`blockQuote`,tokenize:fV};function fV(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return BB(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function pV(e,t,n){let r=this;return i;function i(t){return BB(t)?GB(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(dV,t,n)(r)}}function mV(e){e.exit(`blockQuote`)}var hV={name:`characterEscape`,tokenize:gV};function gV(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return LB(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var _V={name:`characterReference`,tokenize:vV};function vV(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=MB,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=IB,u):(e.enter(`characterReferenceValue`),a=7,o=FB,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===MB&&!SB(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var yV={partial:!0,tokenize:bV};function bV(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var xV={concrete:!0,name:`codeFenced`,tokenize:SV};function SV(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),BB(t)?GB(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||RB(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(yV,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||RB(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):BB(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),GB(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||RB(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||RB(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&BB(t)?GB(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||RB(t)?e.check(yV,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||RB(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),BB(t)?GB(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),BB(t)?GB(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||RB(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var CV={name:`codeIndented`,tokenize:TV},wV={partial:!0,tokenize:EV};function TV(e,t,n){return r;function r(t){return e.enter(`codeIndented`),KB(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):RB(t)?e.attempt(wV,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||RB(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function EV(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):RB(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):KB(e,t,a,`linePrefix`,4,4)(o)}function a(e){return RB(e)?i(e):n(e)}}var DV={name:`codeText`,previous:kV,resolve:OV,tokenize:AV};function OV(e){let t=e.length-4,n=3,r,i;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;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function kV(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function AV(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):RB(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||RB(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var jV=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&MV(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),MV(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),MV(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);MV(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);MV(this.left,t.reverse())}}}};function MV(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 NV(e){let t={},n=-1,r,i,a,o,s,c,l,u=new jV(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`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,PV(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return CB(e,0,1/0,u.slice(0)),!l}function PV(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var FV={resolve:LV,tokenize:RV},IV={partial:!0,tokenize:zV};function LV(e){return NV(e),e}function RV(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):RB(t)?e.check(IV,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function zV(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),GB(e,a,`linePrefix`)}function a(i){if(i===null||RB(i))return n(i);let 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(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function BV(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||PB(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||RB(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||zB(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||PB(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function VV(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):RB(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||RB(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!BB(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function HV(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):RB(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),GB(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||RB(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function UV(e,t){let n;return r;function r(i){return RB(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):BB(i)?GB(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var WV={name:`definition`,tokenize:KV},GV={partial:!0,tokenize:qV};function KV(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return VV.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=AB(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return zB(t)?UV(e,l)(t):l(t)}function l(t){return BV(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(GV,d,d)(t)}function d(t){return BB(t)?GB(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||RB(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function qV(e,t,n){return r;function r(t){return zB(t)?UV(e,i)(t):n(t)}function i(t){return HV(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return BB(t)?GB(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||RB(e)?t(e):n(e)}}var JV={name:`hardBreakEscape`,tokenize:YV};function YV(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return RB(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var XV={name:`headingAtx`,resolve:ZV,tokenize:QV};function ZV(e,t){let n=e.length-2,r=3;if(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){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};CB(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function QV(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||zB(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||RB(n)?(e.exit(`atxHeading`),t(n)):BB(n)?GB(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||zB(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var $V=`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`.split(`.`),eH=[`pre`,`script`,`style`,`textarea`],tH={concrete:!0,name:`htmlFlow`,resolveTo:rH,tokenize:iH},nH={partial:!0,tokenize:aH};function rH(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 iH(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):jB(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):jB(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return jB(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||zB(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&eH.includes(l)?(i=1,r.interrupt?t(s):O(s)):$V.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||MB(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return BB(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||jB(t)?(e.consume(t),b):BB(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||MB(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):BB(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):BB(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||RB(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||zB(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||BB(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||RB(t)?O(t):BB(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):RB(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(nH,R,k)(t)):t===null||RB(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(yV,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||RB(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return eH.includes(n)?(e.consume(t),L):O(t)}return jB(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||RB(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function aH(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(lV,t,n)}}var oH={name:`htmlText`,tokenize:sH};function sH(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):jB(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):jB(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):RB(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):RB(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):RB(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):RB(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return jB(t)?(e.consume(t),S):n(t)}function S(t){return t===45||MB(t)?(e.consume(t),S):C(t)}function C(t){return RB(t)?(o=C,N(t)):BB(t)?(e.consume(t),C):M(t)}function w(t){return t===45||MB(t)?(e.consume(t),w):t===47||t===62||zB(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||jB(t)?(e.consume(t),E):RB(t)?(o=T,N(t)):BB(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||MB(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):RB(t)?(o=D,N(t)):BB(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):RB(t)?(o=O,N(t)):BB(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):RB(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||zB(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||zB(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return BB(t)?GB(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var cH={name:`labelEnd`,resolveAll:fH,resolveTo:pH,tokenize:mH},lH={tokenize:hH},uH={tokenize:gH},dH={tokenize:_H};function fH(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&CB(e,0,e.length,n),e}function pH(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={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[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=wB(o,e.slice(i+1,i+r+3)),o=wB(o,[[`enter`,l,t]]),o=wB(o,nV(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=wB(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=wB(o,e.slice(a+1)),o=wB(o,[[`exit`,s,t]]),CB(e,i,e.length,o),e}function mH(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(AB(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(lH,u,o?u:d)(t):t===91?e.attempt(uH,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(dH,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function hH(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return zB(t)?UV(e,a)(t):a(t)}function a(t){return t===41?u(t):BV(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return zB(t)?UV(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?HV(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return zB(t)?UV(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function gH(e,t,n){let r=this;return i;function i(t){return VV.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(AB(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function _H(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var vH={name:`labelStartImage`,resolveAll:cH.resolveAll,tokenize:yH};function yH(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var bH={name:`labelStartLink`,resolveAll:cH.resolveAll,tokenize:xH};function xH(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var SH={name:`lineEnding`,tokenize:CH};function CH(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),GB(e,t,`linePrefix`)}}var wH={name:`thematicBreak`,tokenize:TH};function TH(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||RB(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),BB(t)?GB(e,s,`whitespace`)(t):s(t))}}var EH={continuation:{tokenize:AH},exit:MH,name:`list`,tokenize:kH},DH={partial:!0,tokenize:NH},OH={partial:!0,tokenize:jH};function kH(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:FB(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(wH,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return FB(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(lV,r.interrupt?n:u,e.attempt(DH,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return BB(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function AH(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(lV,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,GB(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!BB(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(OH,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,GB(e,e.attempt(EH,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function jH(e,t,n){let r=this;return GB(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function MH(e){e.exit(this.containerState.type)}function NH(e,t,n){let r=this;return GB(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!BB(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var PH={name:`setextUnderline`,resolveTo:FH,tokenize:IH};function FH(e,t){let n=new YB,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function IH(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),BB(t)?GB(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||RB(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var LH={tokenize:RH};function RH(e){let t=this,n=e.attempt(lV,r,e.attempt(this.parser.constructs.flowInitial,i,GB(e,e.attempt(this.parser.constructs.flow,i,e.attempt(FV,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var zH={resolveAll:UH()},BH=HH(`string`),VH=HH(`text`);function HH(e){return{resolveAll:UH(e===`text`?WH:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function UH(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function WH(e,t){let n=new YB,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var GH=s({attentionMarkers:()=>QH,contentInitial:()=>qH,disable:()=>$H,document:()=>KH,flow:()=>YH,flowInitial:()=>JH,insideSpan:()=>Pee,string:()=>XH,text:()=>ZH}),KH={42:EH,43:EH,45:EH,48:EH,49:EH,50:EH,51:EH,52:EH,53:EH,54:EH,55:EH,56:EH,57:EH,62:dV},qH={91:WV},JH={[-2]:CV,[-1]:CV,32:CV},YH={35:XV,42:wH,45:[PH,wH],60:tH,61:PH,95:wH,96:xV,126:xV},XH={38:_V,92:hV},ZH={[-5]:SH,[-4]:SH,[-3]:SH,33:vH,38:_V,42:rV,60:[sV,oH],91:bH,92:[JV,hV],93:cH,95:rV,96:DV},Pee={null:[rV,zH]},QH={null:[42,95]},$H={null:[]};function eU(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=wB(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=nV(a,l.events,l),l.events):[]}function f(e,t){return nU(p(e),t)}function p(e){return tU(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){RB(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&CB(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function tU(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function nU(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
252
|
+
`;break;case-3:o=`\r
|
|
253
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function rU(e){let t={constructs:EB([GH,...(e||{}).extensions||[]]),content:n(qB),defined:[],document:n(ZB),flow:n(LH),lazy:{},string:n(BH),text:n(VH)};return t;function n(e){return n;function n(n){return eU(t,e,n)}}}function iU(e){for(;!NV(e););return e}var aU=/[\0\t\n\r]/g;function oU(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){aU.lastIndex=c;let n=aU.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var sU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function cU(e){return e.replace(sU,lU)}function lU(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return kB(n.slice(t?2:1),t?16:10)}return SB(n)||e}var uU={}.hasOwnProperty;function dU(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),fU(n)(iU(rU(n).document().write(oU()(e,t,!0))))}function fU(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(pe),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(le),blockQuote:o(ae),characterEscape:E,characterReference:E,codeFenced:o(oe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(oe,s),codeText:o(se,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(H),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ce),hardBreakEscape:o(ue),hardBreakTrailing:o(ue),htmlFlow:o(de,s),htmlFlowData:E,htmlText:o(de,s),htmlTextData:E,image:o(fe),label:s,link:o(pe),listItem:o(he),listItemValue:p,listOrdered:o(me,f),listUnordered:o(me),paragraph:o(ge),reference:B,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(le),strong:o(_e),thematicBreak:o(ye)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ie,autolinkProtocol:re,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:te,characterReference:ne,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:I,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:L,resourceTitleString:R,resource:z,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};mU(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),uU.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||gU).call(o,void 0,e[0])}for(r.position={start:pU(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:pU(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:pU(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Pz({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||gU).call(this,e,r[0])),n.position.end=pU(e.end)}function d(){return _B(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=AB(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=ve(),n.position={start:pU(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=pU(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=pU(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=cU(t),n.identifier=AB(t).toLowerCase()}function I(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function R(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function z(){this.data.inReference=void 0}function B(){this.data.referenceType=`collapsed`}function ee(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=AB(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function V(e){this.data.characterReferenceType=e.type}function te(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=kB(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=SB(t);let i=this.stack[this.stack.length-1];i.value+=r}function ne(e){let t=this.stack.pop();t.position.end=pU(e.end)}function re(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ie(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[],position:void 0}}function oe(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function se(){return{type:`inlineCode`,value:``,position:void 0}}function H(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function ce(){return{type:`emphasis`,children:[],position:void 0}}function le(){return{type:`heading`,depth:0,children:[],position:void 0}}function ue(){return{type:`break`,position:void 0}}function de(){return{type:`html`,value:``,position:void 0}}function fe(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function pe(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function me(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function he(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function ge(){return{type:`paragraph`,children:[],position:void 0}}function _e(){return{type:`strong`,children:[],position:void 0}}function ve(){return{type:`text`,value:``,position:void 0}}function ye(){return{type:`thematicBreak`,position:void 0}}}function pU(e){return{line:e.line,column:e.column,offset:e.offset}}function mU(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?mU(e,r):hU(e,r)}}function hU(e,t){let n;for(n in t)if(uU.call(t,n))switch(n){case`canContainEols`:case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function gU(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Pz({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Pz({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Pz({start:t.start,end:t.end})+`) is still open`)}function _U(e){let t=this;t.parser=n;function n(n){return dU(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function vU(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function yU(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
254
|
+
`}]}function bU(e,t){let n=t.value?t.value+`
|
|
255
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function xU(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SU(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CU(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=WB(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function wU(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TU(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function EU(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function DU(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return EU(e,t);let i={src:WB(r.url||``)};t.alt!==null&&t.alt!==void 0&&(i.alt=t.alt),r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function OU(e,t){let n={src:WB(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function kU(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function AU(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return EU(e,t);let i={href:WB(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function jU(e,t){let n={href:WB(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function MU(e,t,n){let r=e.all(t),i=n?NU(n):PU(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
256
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
257
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function NU(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let{children:n}=e,r=-1;for(;!t&&++r<n.length;)t=PU(n[r])}return t}function PU(e){let{spread:t}=e;return t??e.children.length>1}function FU(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function IU(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LU(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function RU(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zU(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=jz(t.children[1]),o=Az(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function BU(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function VU(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var HU=9,UU=32;function WU(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(GU(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(GU(t.slice(i),i>0,!1)),a.join(``)}function GU(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===HU||t===UU;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===HU||t===UU;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function KU(e,t){let n={type:`text`,value:WU(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function qU(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var JU={blockquote:vU,break:yU,code:bU,delete:xU,emphasis:SU,footnoteReference:CU,heading:wU,html:TU,imageReference:DU,image:OU,inlineCode:kU,linkReference:AU,link:jU,listItem:MU,list:FU,paragraph:IU,root:LU,strong:RU,table:zU,tableCell:VU,tableRow:BU,text:KU,thematicBreak:qU,toml:YU,yaml:YU,definition:YU,footnoteDefinition:YU};function YU(){}var{defineProperty:XU}=Object,ZU=typeof self==`object`?self:globalThis,QU=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new ZU[e](t)},$U=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?XU(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof ZU[e]==`function`?QU(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(QU(a,o),i)};return r},eW=e=>$U(new Map,e)(0),tW=``,{toString:nW}={},{keys:rW,is:iW}=Object,aW=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=nW.call(e).slice(8,-1);switch(n){case`Array`:return[1,tW];case`Object`:return[2,tW];case`Date`:return[3,tW];case`RegExp`:return[4,tW];case`Map`:return[5,tW];case`Set`:return[6,tW];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},oW=([e,t])=>e===0&&(t===`function`||t===`symbol`),sW=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=aW(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&iW(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of rW(o))(e||!oW(aW(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?tW:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(oW(aW(n))||oW(aW(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!oW(aW(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},cW=(e,{json:t,lossy:n}={})=>{let r=[];return sW(!(t||n),!!t,new Map,r)(e),r},lW=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?eW(cW(e,t)):structuredClone(e):(e,t)=>eW(cW(e,t));function uW(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function dW(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function fW(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||uW,r=e.options.footnoteBackLabel||dW,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=[],l=-1;for(;++l<e.footnoteOrder.length;){let t=e.footnoteById.get(e.footnoteOrder[l]);t&&(s[l]=e.all(t))}for(l=-1;++l<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;let a=s[l],o=String(i.identifier).toUpperCase(),u=WB(o.toLowerCase()),d=0,f=[],p=e.footnoteCounts.get(o);for(;p!==void 0&&++d<=p;){f.length>0&&f.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(l,d);typeof e==`string`&&(e={type:`text`,value:e}),f.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+u+(d>1?`-`+d:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(l,d),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let m=a[a.length-1];if(m&&m.type===`element`&&m.tagName===`p`){let e=m.children[m.children.length-1];e&&e.type===`text`?e.value+=` `:m.children.push({type:`text`,value:` `}),m.children.push(...f)}else a.push(...f);let h={type:`element`,tagName:`li`,properties:{id:t+`fn-`+u},children:e.wrap(a,!0)};e.patch(i,h),c.push(h)}if(c.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...lW(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
258
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(c,!0)},{type:`text`,value:`
|
|
259
|
+
`}]}}var pW=(function(e){if(e==null)return vW;if(typeof e==`function`)return _W(e);if(typeof e==`object`)return Array.isArray(e)?mW(e):hW(e);if(typeof e==`string`)return gW(e);throw Error(`Expected function, string, or object as test`)});function mW(e){let t=[],n=-1;for(;++n<e.length;)t[n]=pW(e[n]);return _W(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function hW(e){let t=e;return _W(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function gW(e){return _W(t);function t(t){return t&&t.type===e}}function _W(e){return t;function t(t,n,r){return!!(yW(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function vW(){return!0}function yW(e){return typeof e==`object`&&!!e&&`type`in e}function bW(e){return e}var xW=[],SW=`skip`;function CW(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(o.enter!==null&&o.enter!==void 0){if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor")}if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=pW(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+bW(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=xW;if(s&&r&&(o=wW(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=d(t.children[e],e,r)();if(n[0]===!1)return n;e=typeof n[1]==`number`?n[1]:e+u}}}if(c&&r){let r=wW(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function wW(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?xW:[e]}function TW(e,t,n,r){let i,a,o;typeof n==`function`||n&&typeof n==`object`?(i=t,a=n,o=r):(a=t,o=n),typeof a==`function`?CW(e,i,DW(a),o):CW(e,i,EW(a),o)}function EW(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?DW(e.enter):e.enter,exit:typeof e.exit==`function`?DW(e.exit):e.exit}}function DW(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}var OW={}.hasOwnProperty,kW={};function AW(e,t){let n=t||kW,r=new Map,i=new Map,a={all:s,applyData:MW,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...JU,...n.handlers},one:o,options:n,patch:jW,wrap:PW};return TW(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=String(e.identifier).toUpperCase();e.type===`definition`?r.has(t)||r.set(t,e):i.has(t)||i.set(t,e)}}),a;function o(e,t){let{type:n}=e,r=a.handlers[n];if(OW.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e;return{...lW(n),children:a.all(e)}}return lW(e)}return(a.options.unknownHandler||NW)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=FW(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=FW(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function jW(e,t){e.position&&(t.position=Nz(e))}function MW(e,t){let n=t;if(e&&e.data){let{hChildren:t,hName:r,hProperties:i}=e.data;typeof r==`string`&&(n.type===`element`?n.tagName=r:n={type:`element`,tagName:r,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,lW(i)),`children`in n&&n.children&&t!=null&&(n.children=t)}return n}function NW(e,t){let n=t.data||{},r=`value`in t&&!(OW.call(n,`hProperties`)||OW.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 PW(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
260
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
261
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
262
|
+
`}),n}function FW(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function IW(e,t){let n=AW(e,t),r=n.one(e,void 0),i=fW(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
263
|
+
`},i)),a}function LW(e,t){return e&&`run`in e?async function(n,r){let i=IW(n,{file:r,...t});await e.run(i,r)}:function(n,r){return IW(n,{file:r,...e||t})}}function RW(e){if(e)throw e}var zW=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function BW(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function VW(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?HW(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function HW(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var UW={basename:WW,dirname:GW,extname:KW,join:qW,sep:`/`};function WW(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);XW(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function GW(e){if(XW(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function KW(e){XW(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function qW(...e){let t=-1,n;for(;++t<e.length;)XW(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:JW(n)}function JW(e){XW(e);let t=e.codePointAt(0)===47,n=YW(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function YW(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function XW(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var ZW={cwd:QW};function QW(){return`/`}function $W(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function eG(e){if(typeof e==`string`)e=new URL(e);else if(!$W(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return tG(e)}function tG(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var nG=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],rG=class{constructor(e){let t;t=e?$W(e)?{path:e}:typeof e==`string`||sG(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:ZW.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<nG.length;){let e=nG[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)nG.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?UW.basename(this.path):void 0}set basename(e){aG(e,`basename`),iG(e,`basename`),this.path=UW.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?UW.dirname(this.path):void 0}set dirname(e){oG(this.basename,`dirname`),this.path=UW.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?UW.extname(this.path):void 0}set extname(e){if(iG(e,`extname`),oG(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=UW.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){$W(e)&&(e=eG(e)),aG(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?UW.basename(this.path,this.extname):void 0}set stem(e){aG(e,`stem`),iG(e,`stem`),this.path=UW.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Rz(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function iG(e,t){if(e&&e.includes(UW.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+UW.sep+"`")}function aG(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function oG(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function sG(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var cG=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),lG=l(zW(),1),uG={}.hasOwnProperty,dG=new class e extends cG{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=VW()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,lG.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(mG(`data`,this.frozen),this.namespace[e]=t,this):uG.call(this.namespace,e)&&this.namespace[e]||void 0:e?(mG(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=_G(e),n=this.parser||this.Parser;return fG(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),fG(`process`,this.parser||this.Parser),pG(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=_G(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);yG(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),fG(`processSync`,this.parser||this.Parser),pG(`processSync`,this.compiler||this.Compiler),this.process(e,r),gG(`processSync`,`process`,t),n;function r(e,r){t=!0,RW(e),n=r}}run(e,t,n){hG(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=_G(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),gG(`runSync`,`run`,n),r;function i(e,t){RW(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=_G(t),r=this.compiler||this.Compiler;return pG(`stringify`,r),hG(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(mG(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,lG.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;)i(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];BW(o)&&BW(r)&&(r=(0,lG.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function fG(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function pG(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function mG(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function hG(e){if(!BW(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function gG(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function _G(e){return vG(e)?e:new rG(e)}function vG(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function yG(e){return typeof e==`string`||bG(e)}function bG(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var xG=[],SG={allowDangerousHtml:!0},CG=/^(https?|ircs?|mailto|xmpp)$/i,wG=[{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 TG(e){let t=EG(e),n=DG(e);return OG(t.runSync(t.parse(n),n),e)}function EG(e){let t=e.rehypePlugins||xG,n=e.remarkPlugins||xG,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...SG}:SG;return dG().use(_U).use(n).use(LW,r).use(t)}function DG(e){let t=e.children||``,n=new rG;return typeof t==`string`?n.value=t:``+t,n}function OG(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||kG;for(let e of wG)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return TW(e,l),Kz(e,{Fragment:x.Fragment,components:i,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in hB)if(Object.hasOwn(hB,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=hB[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function kG(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||CG.test(e.slice(0,t))?e:``}function AG(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function jG(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function MG(e,t,n){let r=pW((n||{}).ignore||[]),i=NG(t),a=-1;for(;++a<i.length;)CW(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return SW}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i!==!1){if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(i===!1||d[0].length===0){let t=e.value.codePointAt(n)||0;o.lastIndex=n+(/[uv]/.test(o.flags)&&t>65535?2:1)}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function NG(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([PG(e[0]),FG(e[1])])}return t}function PG(e){return typeof e==`string`?new RegExp(jG(e),`g`):e}function FG(e){return typeof e==`function`?e:function(){return e}}var IG=`phrasing`,LG=[`autolink`,`link`,`image`,`label`];function RG(){return{transforms:[KG],enter:{literalAutolink:BG,literalAutolinkEmail:VG,literalAutolinkHttp:VG,literalAutolinkWww:VG},exit:{literalAutolink:GG,literalAutolinkEmail:WG,literalAutolinkHttp:HG,literalAutolinkWww:UG}}}function zG(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:IG,notInConstruct:LG},{character:`.`,before:`[Ww]{3}`,inConstruct:IG,notInConstruct:LG},{character:`:`,before:`[PSps]`,after:`\\/`,inConstruct:IG,notInConstruct:LG}]}}function BG(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function VG(e){this.config.enter.autolinkProtocol.call(this,e)}function HG(e){this.config.exit.autolinkProtocol.call(this,e)}function UG(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function WG(e){this.config.exit.autolinkEmail.call(this,e)}function GG(e){this.exit(e)}function KG(e){MG(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,qG],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,XG],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,YG],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,JG]],{ignore:[`link`,`linkReference`]})}function qG(e,t,n,r,i){if(!$G(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),VB(n.charCodeAt(0))||!ZG(n))return!1;let o=QG(n+r),s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0],position:void 0}],position:void 0};return o[1]?[s,{type:`text`,value:o[1],position:void 0}]:s}function JG(e,t,n){return!/[\d\-_]$/.test(n)&&{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n,position:void 0}],position:void 0}}function YG(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r=`mailto:`+t+`@`+n;return{type:`link`,title:null,url:r,children:[{type:`text`,value:r,position:void 0}],position:void 0}}function XG(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)===`@`))return!1;let a=`xmpp:`+t+`@`+n+(r||``);return{type:`link`,title:null,url:a,children:[{type:`text`,value:a,position:void 0}],position:void 0}}function ZG(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function QG(e){let t=e.length;for(;t>0;){let n=e.charCodeAt(t-1);if(n===33||n===34||n===38||n===39||n===41||n===44||n===46||n===58||n===59||n===60||n===62||n===63||n===93||n===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(`)`),i=AG(e,`(`),a=AG(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function $G(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||HB(t)||VB(t)}lK.peek=cK;function eK(){this.buffer()}function tK(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function nK(){this.buffer()}function rK(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function iK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=AB(this.sliceSerialize(e)).toLowerCase(),n.label=t}function aK(e){this.exit(e)}function oK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=AB(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sK(e){this.exit(e)}function cK(){return`[`}function lK(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function uK(){return{enter:{gfmFootnoteCallString:eK,gfmFootnoteCall:tK,gfmFootnoteDefinitionLabelString:nK,gfmFootnoteDefinition:rK},exit:{gfmFootnoteCallString:iK,gfmFootnoteCall:aK,gfmFootnoteDefinitionLabelString:oK,gfmFootnoteDefinition:sK}}}function dK(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:lK},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
264
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?pK:fK))),s(),o}}function fK(e,t,n){return t===0?e:pK(e,t,n)}function pK(e,t,n){return(n?``:` `)+e}var mK=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];yK.attention=bK,yK.peek=xK;function hK(){return{canContainEols:[`delete`],enter:{strikethrough:_K},exit:{strikethrough:vK}}}function gK(){return{handlers:{delete:yK},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:mK}]}}function _K(e){this.enter({type:`delete`,children:[],position:void 0},e)}function vK(e){this.exit(e)}function yK(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function bK(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function xK(){return`~`}function SK(e){return e.length}function CK(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||SK,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=wK(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=TK(r[d]);else{let e=TK(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u],r=n.fillRows===!1?Math.max(1,o[u===1?0:u].length):l;d=-1;let i=[];for(;++d<r;){let o=e[d]||``,s=``,l=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];if(n===114)s=` `.repeat(e);else if(n===99){let t=e/2;e%2?(s=` `.repeat(t+.5),l=` `.repeat(t-.5)):(s=` `.repeat(t),l=s)}else l=` `.repeat(e)}n.delimiterStart!==!1&&!d&&i.push(`|`),n.padding===!1||n.alignDelimiters===!1&&o===``||n.delimiterStart===!1&&!d||i.push(` `),n.alignDelimiters!==!1&&i.push(s),i.push(o),n.alignDelimiters!==!1&&i.push(l),n.padding!==!1&&i.push(` `),(n.delimiterEnd!==!1||d!==r-1)&&i.push(`|`)}m.push(n.delimiterEnd===!1?i.join(``).replace(/ +$/,``):i.join(``))}return m.join(`
|
|
265
|
+
`)}function wK(e){return e==null?``:String(e)}function TK(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var EK=pW([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function DK(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),OK);return i(),o}function OK(e,t,n){return`>`+(n?``:` `)+e}function kK(e,t){return AK(e,t.inConstruct,!0)&&!AK(e,t.notInConstruct,!1)}function AK(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function jK(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
266
|
+
`&&!e.before&&!e.after&&kK(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
267
|
+
`}function MK(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function NK(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function PK(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function FK(e,t,n,r){let i=PK(n),a=e.value||``;if(NK(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,IK);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(MK(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
|
|
268
|
+
`,encode:["`"],...o.current()})),t()}return u+=o.move(`
|
|
269
|
+
`),a&&(u+=o.move(a+`
|
|
270
|
+
`)),u+=o.move(s),c(),u}function IK(e,t,n){return(n?``:` `)+e}function LK(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function RK(e,t,n,r){let i=LK(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/^<|[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
271
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function zK(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function BK(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function VK(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function HK(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function UK(e,t,n){let r=tV(e),i=tV(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function WK(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let t=e.charCodeAt(2);return t===45?2:t===91?5:jB(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!jB(a))return;for(;a===45||MB(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&eH.includes(o)?1:$V.includes(o)?6:7}var GK=new Map([[`*`,!1],[`_`,!0]]);function KK(e,t,n){let r=new Set;for(let i of e){let e=n.get(i);if(e&&i.attention&&t.some(e=>e.attention===i.attention))for(let t of e.tokens)r.add(t.attention)}let i=[];for(let t of e)t.attention&&r.delete(t.attention)&&i.push(t.attention);return i.reverse(),i}function qK(e,t,n){let r=[],i=new Map,a=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let s=e[o].value.charAt(0),c=GK.get(s),l=o+1;for(;l<e.length&&e[l].attention&&e[l].value.charAt(0)===s;)l++;let u=o?e[o-1].value:t,d=tV(u.charCodeAt(u.length-1)),f=tV((l<e.length?e[l].value:n).charCodeAt(0)),p=!f||f===2&&!!d,m=!d||d===2&&!!f,h={tokens:e.slice(o,l),markers:[],start:0,end:0,open:c?p&&(!!d||!m):p,close:c?m&&(!!f||!p):m,split:c!==void 0};for(let e of h.tokens){i.set(e,[...h.tokens]),a.set(e,h);let t=e.value.length;for(;t--;)h.markers.push(e)}h.end=h.markers.length,r.push(h),o=l}for(XK(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:KK(e,t,a),index:o}}}function JK(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?BK(n.value):VK(n.value),i=HK(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let e=n.value.slice(0,n.value.length-r.length),t=0;for(;e.charCodeAt(e.length-1-t)===92;)t++;t%2&&(e+=`\\`),n.value=e+i}}function YK(e,t,n,r,i){for(let a of n.attention){let o=t.get(a)||a.sequences[0];for(let s of a.sequences){if(s===o)continue;let c=new Map(t);c.set(a,s);let l=nq(e,c,r,i),u=qK(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function XK(e,t){let n=new Map;for(let r of e){let e=r.tokens[0].value.charAt(0),i=n.get(e);i||(i=[],n.set(e,i));let a=r.close?i.length:0;for(;a--&&r.start<r.end;){let e=i[a],n=e.end-e.start,o=r.end-r.start;if(r.split?(e.close||r.open)&&o%3&&!((n+o)%3):n!==e.markers.length||n!==o)continue;let s=r.split?n>1&&o>1?2:1:o,c=e.markers.slice(e.end-s,e.end),l=r.markers.slice(r.start,r.start+s),u=c[0],d=l[0];if(u===c[s-1]&&u.value.length===s&&d===l[s-1]&&d.value.length===s&&u.attention===d.attention)t.delete(u),t.delete(d);else{let e=[...new Set([...c,...l])];for(let n of e){let r=t.get(n);r&&r.push(...e)}}e.end-=s,r.start+=s,e.start===e.end&&i.splice(a,1),a=i.length}r.open&&r.start<r.end&&i.push(r)}}function ZK(e,t,n){if(t.length===0)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!LB(i.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let e of n)r.push(i.repeat(e))}return r}function QK(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before;r.push(-1);let c=t.createTracker(n);for(;++o<i.length;){let l=i[o],u;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),u=n?BK(n(i[o+1],e,t,{before:``,after:``,...c.current()})):``}else u=n.after;let d=a[a.length-1];typeof d==`string`&&(s===`\r`||s===`
|
|
272
|
+
`)&&l.type===`html`&&WK(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(rq(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=$K(l,f.attention,t,c);if(!e)continue;a.push(e),s=VK(e.sequences[0])}else{let n=t.handle(l,e,t,{...c.current(),after:u,before:s});if(!n)continue;c.move(n),a.push(n),s=VK(n)}}return r.pop(),a}function $K(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=ZK(e.type,a,o),c=s[0],l=n.enter(i),u=n.createTracker(r.current());u.move(c);let d=QK(e,n,{...u.current(),before:c,after:c});if(l(),d.length!==0)return r.move(c),r.move(rq(d,c,c)),r.move(c),{children:d,sequences:s}}function eq(e,t,n,r){let i=nq(e,t,n,r),a=qK(i,n,r);for(;a;){let o=YK(e,t,a,n,r);if(!o)return;t=o.chosen,i=o.tokens,a=o.mistake}return i}function tq(e,t,n,r){let i=n,a=-1;for(;++a<e.length;){let o=e[a];if(typeof o==`string`){i=``;continue}let s=a===e.length-1?r:``,c=o.sequences.find(function(t){let r=t.charAt(0);return r!==i.charAt(0)&&r!==s.charAt(0)||e.length===1&&GK.has(r)&&t.length>n.length})||o.sequences[0];c!==o.sequences[0]&&t.set(o,c),tq(o.children,t,c,c),i=c}}function nq(e,t,n,r){let i=[],a,o=VK(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===BK(n)&&JK([e],!0),a=void 0,i.push(e),e.value&&(o=VK(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=BK(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=nq(n.children,t,c,c),m=p[0].value,h=UK(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&JK(p,!0);let g=VK(p[p.length-1].value),_=UK(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&JK(p,!1),h.outside&&d!==`
|
|
273
|
+
`&&d!==`\r`&&JK(i,!1),_.outside&&(a=f),i.push({value:c,attention:n},...p,{value:c,attention:n}),o=c.charAt(c.length-1)}return i}function rq(e,t,n){let r=new Map;tq(e,r,t,n);let i=(r.size>0?eq(e,r,t,n):void 0)||eq(e,new Map,t,n)||nq(e,new Map,t,n),a=``;for(let e of i)a+=e.value;return a}iq.attention=aq,iq.peek=oq;function iq(e,t,n,r){let i=n.enter(`phrasing`),a=$K(e,aq,n,n.createTracker(r)),o=a?rq([a],r.before,r.after):``;return i(),o}function aq(e,t){return{construct:`emphasis`,markers:zK(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function oq(e,t,n){return n.options.emphasis||`*`}function sq(e,t){let n=!1;return TW(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&_B(e)&&(t.options.setext||n))}function cq(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(sq(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
274
|
+
`,after:`
|
|
275
|
+
`});return r(),t(),o+`
|
|
276
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
277
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
278
|
+
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=HK(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}lq.peek=uq;function lq(e){return e.value||``}function uq(){return`<`}dq.peek=fq;function dq(e,t,n,r){let i=LK(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/^<|[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function fq(){return`!`}pq.peek=mq;function pq(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function mq(){return`!`}hq.peek=gq;function hq(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function gq(){return"`"}function _q(e,t){let n=_B(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}vq.peek=yq;function vq(e,t,n,r){let i=LK(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(_q(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`),u=n.containerPhrasing(e,{before:l,after:`](`,...o.current()});l+=o.move(u),c(),l+=o.move(`](`);let d=/^<|[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!d&&(f===`
|
|
279
|
+
`||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:typeof p==`string`?` `:`)`,...o.current()}))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function yq(e,t,n){return _q(e,n)?`<`:`[`}bq.peek=xq;function bq(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function xq(){return`[`}function Sq(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Cq(e){let t=Sq(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function wq(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Tq(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Eq(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?wq(n):Sq(n),s=e.ordered?o===`.`?`)`:`.`:Cq(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),Tq(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Dq(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Oq(e,t,n,r){let i=Dq(n),a=n.bulletCurrent||Sq(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function kq(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function Aq(e,t,n,r){if(!e.children.some(function(e){return EK(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function jq(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Mq.attention=Nq,Mq.peek=Pq;function Mq(e,t,n,r){let i=n.enter(`phrasing`),a=$K(e,Nq,n,n.createTracker(r)),o=a?rq([a],r.before,r.after):``;return i(),o}function Nq(e,t){return{construct:`strong`,markers:jq(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function Pq(e,t,n){return n.options.strong||`*`}function Fq(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function Iq(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Lq(e,t,n){let r=(Tq(n)+(n.options.ruleSpaces?` `:``)).repeat(Iq(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Rq={blockquote:DK,break:jK,code:FK,definition:RK,emphasis:iq,hardBreak:jK,heading:cq,html:lq,image:dq,imageReference:pq,inlineCode:hq,link:vq,linkReference:bq,list:Eq,listItem:Oq,paragraph:kq,root:Aq,strong:Mq,text:Fq,thematicBreak:Lq};function zq(){return{enter:{table:Bq,tableData:Wq,tableHeader:Wq,tableRow:Hq},exit:{codeText:Gq,table:Vq,tableData:Uq,tableHeader:Uq,tableRow:Uq}}}function Bq(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function Vq(e){this.exit(e),this.data.inTable=void 0}function Hq(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function Uq(e){this.exit(e)}function Wq(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function Gq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Kq));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Kq(e,t){return t===`|`?t:e}function qq(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[Jq],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
280
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
281
|
+
`))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return CK(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=Rq.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function Jq(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&Yq(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function Yq(e,t){let n=!1;return TW(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&_B(e)&&(t.options.setext||n))}function Xq(){return{exit:{taskListCheckValueChecked:Qq,taskListCheckValueUnchecked:Qq,paragraph:$q}}}function Zq(){return{handlers:{paragraph:eJ},join:[tJ]}}function Qq(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function $q(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start={...n.position.start}))}}this.exit(e)}function eJ(e,t,n,r){if(!t||t.type!==`listItem`||nJ(t)!==e)return Rq.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+Rq.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function tJ(e,t,n){if(e.type!==`definition`||n.type!==`listItem`)return;let r=nJ(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function nJ(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function rJ(){return[RG(),uK(),hK(),zq(),Xq()]}function iJ(e){return{extensions:[zG(),dK(e),gK(),qq(e),Zq()]}}var aJ={tokenize:yJ,partial:!0},oJ={tokenize:bJ,partial:!0},sJ={tokenize:xJ,partial:!0},cJ={tokenize:SJ,partial:!0},lJ={tokenize:CJ,partial:!0},uJ={name:`wwwAutolink`,tokenize:_J,previous:wJ},dJ={name:`protocolAutolink`,tokenize:vJ,previous:TJ},fJ={name:`emailAutolink`,tokenize:gJ,previous:EJ},pJ={};function mJ(){return{text:pJ}}for(var hJ=48;hJ<123;)pJ[hJ]=fJ,hJ++,hJ===58?hJ=65:hJ===91&&(hJ=97);pJ[43]=fJ,pJ[45]=fJ,pJ[46]=fJ,pJ[95]=fJ,pJ[72]=[fJ,dJ],pJ[104]=[fJ,dJ],pJ[87]=[fJ,uJ],pJ[119]=[fJ,uJ];function gJ(e,t,n){let r=this,i,a;return o;function o(t){return!DJ(t)||!EJ.call(r,r.previous)||OJ(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return DJ(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(lJ,u,l)(t):t===45||t===95||MB(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&jB(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function _J(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!wJ.call(r,r.previous)||OJ(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(aJ,e.attempt(oJ,e.attempt(sJ,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function vJ(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&TJ.call(r,r.previous)&&!OJ(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(jB(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||PB(t)||zB(t)||HB(t)||VB(t)?n(t):e.attempt(oJ,e.attempt(sJ,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function yJ(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function bJ(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(cJ,c,s)(t):t===null||zB(t)||HB(t)||t!==45&&VB(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function xJ(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(cJ,t,a)(o):o===null||zB(o)||HB(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function SJ(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||zB(o)||HB(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||zB(e)||HB(e)?t(e):r(e)}function a(e){return jB(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):jB(t)?(e.consume(t),o):n(t)}}function CJ(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return MB(e)?n(e):t(e)}}function wJ(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||zB(e)}function TJ(e){return!jB(e)}function EJ(e){return!(e===47||DJ(e))}function DJ(e){return e===43||e===45||e===46||e===95||MB(e)}function OJ(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var kJ={tokenize:LJ,partial:!0};function AJ(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:PJ,continuation:{tokenize:FJ},exit:IJ}},text:{91:{name:`gfmFootnoteCall`,tokenize:NJ},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:jJ,resolveTo:MJ}}}}function jJ(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=AB(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function MJ(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function NJ(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||zB(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(AB(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return zB(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function PJ(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||zB(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=AB(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return zB(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),GB(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function FJ(e,t,n){return e.check(lV,t,e.attempt(kJ,t,n))}function IJ(e){e.exit(`gfmFootnoteDefinition`)}function LJ(e,t,n){let r=this;return GB(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function RJ(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&CB(o,o.length,0,nV(s,e.slice(r+1,n),t)),CB(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),CB(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=tV(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=tV(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var zJ=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){BJ(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function BJ(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function VJ(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function HJ(){return{flow:{null:{name:`table`,tokenize:UJ,resolveAll:WJ}}}}function UJ(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):RB(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):BB(t)?GB(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||zB(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,BB(t)?GB(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return BB(t)?GB(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||RB(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return BB(t)?GB(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||RB(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||RB(n)?(e.exit(`tableRow`),t(n)):BB(n)?GB(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||zB(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function WJ(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new zJ;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(KJ(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=GJ(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=GJ(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=GJ(f,t,o,i,n,d)):(o[0]=o[1],d=GJ(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&KJ(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=VJ(t.events,n))}return e}function GJ(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},qJ(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=qJ(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=qJ(t.events,n[2]),a=qJ(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},qJ(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function KJ(e,t,n,r,i){let a=[],o=qJ(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function qJ(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var JJ={name:`tasklistCheck`,tokenize:XJ};function YJ(){return{text:{91:JJ}}}function XJ(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return zB(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return RB(r)?t(r):BB(r)?e.check({tokenize:ZJ},t,n)(r):n(r)}}function ZJ(e,t,n){return GB(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function QJ(e){return EB([mJ(),AJ(),RJ(e),HJ(),YJ()])}var $J={};function eY(e){let t=this,n=e||$J,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(QJ(n)),a.push(rJ()),o.push(iJ(n))}var tY=`diffs-container`,nY=/(?=^diff --git)/gm,rY=/(?<=\n)/,iY=/^(---|\+\+\+)\s+([^\t\r\n]+)/,aY=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,oY=`header-prefix`,sY=`header-filename-suffix`,cY=`header-metadata`,lY=`header-custom`,uY={dark:`pierre-dark`,light:`pierre-light`},dY=`data-theme-css`,fY=`data-unsafe-css`,pY=`data-diffs-scrollbar-measure`,mY=`--diffs-scrollbar-gutter-measured`,hY=1e5,gY={unmodifiedLines:`{count, plural, one {# unmodified line} other {# unmodified lines}}`,unknownUnmodifiedLines:`More unchanged context may be available`,expandAll:`Expand all`,expandLine:`Show full line`,noNewlineAtEndOfFile:`No newline at end of file`,acceptCurrentChange:`Accept current change`,acceptIncomingChange:`Accept incoming change`,acceptBoth:`Accept both`,searchPlaceholder:`Search`,replacePlaceholder:`Replace`,noSearchResults:`0/0`,searching:`Searching…`,searchResultCount:`{count, plural, one {# result} other {# results}}`,searchResultPosition:`{index}/{count}`,matchCase:`Match Case`,wholeWord:`Whole Word`,regularExpression:`Regexp`,replaceMatch:`Replace`,replaceAllMatches:`Replace All`,previousMatch:`Previous`,nextMatch:`Next`,closeSearch:`Close`,toggleReplace:`Toggle Replace`},_Y={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({..._Y});var vY=Object.freeze({fromStart:0,fromEnd:0}),yY={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},bY=Object.freeze([]),xY,SY=0,CY=class extends Error{constructor(){super(`Highlighter is disposed`),this.name=`HighlighterDisposedError`}};function wY(){return xY}function TY(e){return e??xY??`shiki-js`}function EY(e){if(xY!=null&&xY!==e)throw Error(`Cannot load the "${e}" highlighter while "${xY}" is in use. Only one highlighter type can be active at a time; dispose every "${xY}" instance (disposeHighlighter() disposes the shared one) before switching.`)}function DY(e){EY(e),xY=e,SY++}function OY(){SY--,SY===0&&(xY=void 0)}function kY(e=uY){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function AY(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}function jY(e){let t;return()=>t??=e().then(e=>(t=e,e),e=>{throw t=void 0,e})}function MY(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var NY=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},PY=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},FY=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function IY(e={}){let t=new Map,n=new Map,r=new Map,i=0;function a(e,n){if(t.has(e))throw new NY(e);t.set(e,n)}function o(e,n){return!t.has(e)&&(t.set(e,n),!0)}function s(e){return t.has(e)}function c(a){let o=n.get(a);if(o!==void 0)return Promise.resolve(o);let s=r.get(a);if(s!==void 0)return s;let c=t.get(a);if(c===void 0&&e.fallbackLoader===void 0)return Promise.reject(new PY(a));let l=i,u=Promise.resolve().then(()=>c===void 0?e.fallbackLoader?.(a):c()).then(async t=>{if(t===void 0)throw new PY(a);let o=MY(t),s=e.normalizeTheme===void 0?o:await e.normalizeTheme(o,a);return l===i&&n.set(a,s),r.get(a)===u&&r.delete(a),s}).catch(e=>{throw r.get(a)===u&&r.delete(a),e});return r.set(a,u),u}function l(e){return Promise.all(e.map(e=>c(e)))}function u(e,t){n.set(e,t)}function d(e){for(let[t,n]of e)u(t,n)}function f(e){return n.get(e)}function p(e){let t=[];for(let r of e){let e=n.get(r);if(e===void 0)throw new FY(r);t.push(e)}return t}function m(e){return n.has(e)}function h(e){for(let t of e)if(!n.has(t))return!1;return!0}function g(e){let t=n.get(e);return t===void 0?c(e):t}function _(){i++,n.clear(),r.clear()}return{clearResolvedThemes:_,getResolvedOrResolveTheme:g,getResolvedTheme:f,getResolvedThemes:p,hasRegisteredTheme:s,hasResolvedTheme:m,hasResolvedThemes:h,registerTheme:a,registerThemeIfAbsent:o,resolveTheme:c,resolveThemes:l,seedResolvedTheme:u,seedResolvedThemes:d}}var LY=`modulepreload`,RY=function(e){return`/`+e},zY={},BY={},VY=function(e){return e.pathname.endsWith(`.css`)},HY=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw delete e[t],n});return e[t]=i,i},UY=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)},a,o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{e=RY(e,n);let t=i(e),r=VY(t);return HY(zY,t.href,()=>{if(a===void 0){a={all:new Set,styles:new Set};let e=document.getElementsByTagName(`link`);for(let t=e.length-1;t>=0;t--){let n=e[t];a.all.add(n.href),n.rel===`stylesheet`&&a.styles.add(n.href)}}let e=r?a.styles:a.all,n=r?BY[t.href]:void 0;if(!n&&e.has(t.href))return;let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:LY,r||(i.as=`script`),i.crossOrigin=``,i.href=t.href,s&&i.setAttribute(`nonce`,s),n&&delete BY[t.href],n?.isConnected?n.replaceWith(i):document.head.appendChild(i),r)return new Promise((e,n)=>{let r=a=>{i.removeEventListener(`load`,r),i.removeEventListener(`error`,r),a.type===`error`?(BY[t.href]=i,n(Error(`Unable to preload CSS for ${t}`))):e(a)};i.addEventListener(`load`,r),i.addEventListener(`error`,r)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},WY=new Map,GY=new Map,KY=jY(()=>UY(()=>import(`./loader-Du5I86pW.js`),[])),qY=jY(()=>UY(()=>import(`./themes-BrkVmSlQ.js`),[])),JY=jY(()=>UY(()=>import(`./core-8OhGxroQ.js`).then(e=>e.t),__vite__mapDeps([0,1]))),YY=[[`editor.lineHighlightBackground`,`editor.active_line.background`],[`editor.selectionBackground`,`element.selected`],[`editor.findMatchHighlightBackground`,`search.match_background`],[`editorBracketMatch.background`,`editor.document_highlight.bracket_background`],[`editorError.foreground`,`error`],[`editorWarning.foreground`,`warning`],[`editorInfo.foreground`,`info`],[`editorHint.foreground`,`hint`],[`gitDecoration.addedResourceForeground`,`created`,`terminal.ansi.green`],[`gitDecoration.deletedResourceForeground`,`deleted`,`terminal.ansi.red`],[`gitDecoration.modifiedResourceForeground`,`modified`,`terminal.ansi.blue`]];function XY(e,t){let n=`themes`in t?t.themes[0]:t;if(n==null)throw Error(`Theme "${e}" is an empty Zed theme family.`);let r={...n,name:e},i={};for(let[e,t]of Object.entries(r.style))typeof t==`string`&&(i[e]=t);let a=r.style.players?.[0];a?.cursor!=null&&(i[`editorCursor.foreground`]??=a.cursor),a?.selection!=null&&(i[`editor.selectionBackground`]??=a.selection);for(let[e,...t]of YY){if(i[e]!=null)continue;let n=t.find(e=>i[e]!=null);n!=null&&(i[e]=i[n])}if(r.cssVariables===!0)i[`editor.foreground`]=`var(--hls-foreground)`,i[`editor.background`]=`var(--hls-background)`;else if(typeof r.cssVariables==`object`){i[`editor.foreground`]??=i.text??i.foreground??`foreground`,i[`editor.background`]??=i.background??`background`;let{prefix:e=`--hls-`,defaults:t}=r.cssVariables;for(let[n,r]of Object.entries(i)){let a=t?.[r];i[n]=`var(${e}${r}${a?`, ${a}`:``})`}}let o=r.appearance===`light`?`light`:`dark`;return{name:e,type:o,colors:i,zed:r,fg:i[`editor.foreground`]??i.text??i.foreground??(o===`light`?`#333333`:`#bbbbbb`),bg:i[`editor.background`]??i.background??(o===`light`?`#ffffff`:`#1e1e1e`)}}function ZY(e){let t=GY.get(e);return t??(t=IY({fallbackLoader:async t=>{if(typeof __DIFFS_WORKER__<`u`?__DIFFS_WORKER__:AY())throw Error(`Theme "${t}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedThemes parameter.`);let n=WY.get(t);if(e===`highlights`){let e=n?.zed??n?.diffs;if(e!=null){let n=await e(),r=`default`in n?n.default:n;if(`zed`in r&&r.zed!=null)return r;if(`style`in r||`themes`in r)return XY(t,r);throw Error(`Theme "${t}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`)}let r=KY(),{themes:i}=r instanceof Promise?await r:r,a=i[t];if(a!=null)return XY(t,(await a()).default);if(n?.textmate!=null)throw Error(`Theme "${t}" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`)}else{let e=n?.textmate??n?.diffs,r;if(e!=null){let t=await e();r=`default`in t?t.default:t}else{let e=qY(),{themes:i}=e instanceof Promise?await e:e,a=i.getTheme(t);if(a==null&&n?.zed!=null)throw Error(`Theme "${t}" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`);if(a==null)throw Error(`No valid theme loader registered for "${t}"`);let o=await a.load();r=`default`in o?o.default:o}if(`style`in r||`themes`in r)throw Error(`Theme "${t}" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`);let i=JY(),{normalizeTheme:a,createCssVariablesTheme:o}=i instanceof Promise?await i:i;if(`cssVariables`in r&&r.cssVariables!=null)return{...r,textmate:a(o(r.cssVariables))};if(`textmate`in r&&r.textmate!=null)return{...r,textmate:a(r.textmate)};let s=a(r);return{name:s.name,type:s.type,fg:s.fg,bg:s.bg,colors:s.colors,textmate:s}}throw Error(`No valid theme loader registered for "${t}"`)},normalizeTheme:(e,t)=>{if(e.name!==t)throw Error(`resolvedTheme: themeName: ${t} does not match theme.name: ${e.name}`);return e}}),GY.set(e,t)),t}function QY(e,t=TY()){return typeof t!=`string`&&t.isDisposed?!1:(typeof t==`string`?ZY(t):t.themeResolver).hasResolvedThemes(kY(e))}var $Y;async function eX(e){let t=TY(e);DY(t);try{if(t===`highlights`){let{HighlightsHighlighter:e}=await UY(async()=>{let{HighlightsHighlighter:e}=await import(`./highlights-C-SEG213.js`);return{HighlightsHighlighter:e}},__vite__mapDeps([2,3,1,4,5]));return new e}let{ShikiHighlighter:e}=await UY(async()=>{let{ShikiHighlighter:e}=await import(`./shiki-Bf12fWbJ.js`);return{ShikiHighlighter:e}},__vite__mapDeps([6,3,1,4,7,0]));return await e.create(t)}finally{OY()}}async function tX({themes:e,langs:t,preferredHighlighter:n}){nX();let r=$Y??=eX(wY()??n),i;try{i=await r}catch(e){throw $Y===r&&($Y=void 0),e}if($Y===r&&($Y=i),await Promise.all([i.themeResolver.resolveThemes(e),i.loadLanguages(t)]),i.isDisposed)throw new CY;return i}function nX(){$Y!=null&&!(`then`in $Y)&&$Y.isDisposed&&($Y=void 0)}function rX({theme:e,lang:t,langs:n}={}){nX();let r=$Y;if(!(r==null||`then`in r||e!=null&&!QY(e,r)||(t!=null||n!=null)&&!r.hasLoadedLanguages([...t==null?[]:[t],...n??[]])))return r}function iX(e,t=TY()){return ZY(t).getResolvedOrResolveTheme(e)}function aX(e,t,n=`textmate`){let r=WY.get(e)??{};r[n]==null?(r[n]=t,WY.set(e,r)):console.error(`SharedHighlight.registerCustomTheme: theme name and type already registered`,e,n)}var oX=`highlights`,sX=`forge-light`,cX={light:sX,dark:`pierre-dark`};function lX(e){return e?cX.dark:cX.light}var uX=4.5;function dX(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function fX(e){let t=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(e);if(!t)return e;let n=[0,2,4].map(e=>parseInt(t[1].slice(e,e+2),16)),r=()=>{let[e,t,r]=n.map(dX);return .74/(.2126*e+.7152*t+.0722*r+.05)};if(r()>=uX)return e;for(;r()<uX;)n=n.map(e=>Math.floor(e*.95));return`#`+n.map(e=>e.toString(16).padStart(2,`0`)).join(``)+(t[2]||``)}function pX(e){let t={};for(let[n,r]of Object.entries(e.style.syntax??{}))t[n]=typeof r==`string`?fX(r):r&&typeof r==`object`&&`color`in r&&typeof r.color==`string`?{...r,color:fX(r.color)}:r;return{...e,name:sX,style:{...e.style,syntax:t}}}aX(sX,async()=>{let e=await iX(`pierre-light`,oX);if(!e.zed)throw Error(`pierre-light has no palette for the highlights engine`);return pX(e.zed)},`zed`);var mX=new Map;function hX(e){let t=mX.get(e);if(t)return t;let n=tX({themes:Object.values(cX),langs:[e],preferredHighlighter:oX}).catch(t=>{if(e===`text`)throw mX.delete(e),t;return hX(`text`)});return mX.set(e,n),n}var gX=b.memo(function({text:e,headingOffset:t=0}){let n=b.useMemo(()=>_X(t),[t]);return(0,x.jsx)(`div`,{className:`prose-forge`,children:(0,x.jsx)(TG,{remarkPlugins:[eY],components:{a:({node:e,...t})=>(0,x.jsx)(`a`,{...t,target:`_blank`,rel:`noreferrer noopener`}),pre:({node:e,children:t})=>(0,x.jsx)(bX,{children:t}),...n},children:e})})});function _X(e){if(!e)return{};let t={};for(let n=1;n<=6;n++){let r=`h${Math.min(6,n+e)}`;t[`h${n}`]=({node:e,...t})=>(0,x.jsx)(r,{...t})}return t}function vX(e){let t=b.Children.toArray(e)[0];return/language-([\w+-]+)/.exec(t?.props?.className||``)?.[1]||``}function yX(e){let t=b.Children.toArray(e)[0]?.props?.children;return(Array.isArray(t)?t.join(``):String(t??``)).replace(/\n$/,``)}function bX({children:e}){let t=vX(e)||`text`,[n,r]=b.useState(!0),[i,a]=b.useState(!1);return(0,x.jsxs)(`div`,{dir:`ltr`,className:`code-block my-[0.65rem] overflow-hidden rounded-lg border border-border/70 bg-secondary leading-snug dark:border-transparent dark:bg-input/32`,"data-language":t,"data-wrap":n?`true`:`false`,children:[(0,x.jsxs)(`div`,{className:`code-block-header flex items-center justify-between gap-2 pt-1.5 pr-1.5 pb-0 pl-3 select-none`,children:[(0,x.jsx)(`span`,{className:`truncate font-mono text-2xs`,children:t}),(0,x.jsxs)(`span`,{className:`flex items-center gap-0.5`,role:`toolbar`,"aria-label":`Code block actions`,children:[(0,x.jsx)(Gb,{label:n?`Don’t wrap lines`:`Wrap lines`,children:(0,x.jsx)(J,{type:`button`,variant:n?`secondary`:`ghost-muted`,size:`icon-xs`,"aria-pressed":n,"aria-label":n?`Don’t wrap lines`:`Wrap lines`,onClick:()=>r(!n),children:(0,x.jsx)(gh,{className:`size-3`})})}),(0,x.jsx)(Gb,{label:i?`Copied`:`Copy`,children:(0,x.jsx)(J,{type:`button`,variant:`ghost-muted`,size:`icon-xs`,"aria-label":`Copy`,onClick:()=>{navigator.clipboard.writeText(yX(e)).then(()=>{a(!0),setTimeout(()=>a(!1),1200)})},children:i?(0,x.jsx)(zd,{className:`size-3`}):(0,x.jsx)(uf,{className:`size-3`})})})]})]}),(0,x.jsx)(CX,{code:yX(e),language:t,fallback:(0,x.jsx)(`pre`,{children:e})})]})}var xX=new Map,SX=200;function CX({code:e,language:t,fallback:n}){let r=lX(qu()),i=/^(text|txt|plain|plaintext)$/i.test(t),a=`${r}\u0000${t}\u0000${e}`,[o,s]=b.useState(()=>xX.get(a)??null);return b.useEffect(()=>{if(i)return;let n=xX.get(a);if(n)return s(n);let o=!0;return hX(t).then(n=>{let i;try{i=n.codeToHtml(e,{lang:t,theme:r})}catch{i=n.codeToHtml(e,{lang:`text`,theme:r})}xX.size>=SX&&xX.delete(xX.keys().next().value),xX.set(a,i),o&&s(i)}).catch(()=>{}),()=>{o=!1}},[a,i,e,t,r]),i||!o?(0,x.jsx)(x.Fragment,{children:n}):(0,x.jsx)(`div`,{className:`code-block-highlighted`,dangerouslySetInnerHTML:{__html:o}})}var wX=e=>e.type.replace(/^tool-/,``),TX=e=>e.state===`output-error`||!!e.output?.error||wX(e)===`shell`&&typeof e.output?.exitCode==`number`&&e.output.exitCode!==0;function EX(e,t){let n=-1;e.forEach((e,t)=>{e.kind===`text`&&(n=t)});let r=e.some(e=>e.kind===`tool`&&(e.part.state===`approval-requested`||wX(e.part)===`ask`&&e.part.state===`input-available`));if(t.streaming||r||!t.finished||n<0)return null;let i=new Set;return e.forEach((e,t)=>{t===n||e.kind===`tool`&&wX(e.part)===`ask`||t>n&&e.kind===`tool`&&TX(e.part)||t>n&&e.kind===`group`&&e.parts.some(TX)||i.add(t)}),i.size?i:null}var DX=2e3;function OX({text:e,label:t=`Copy message`}){let[n,r]=b.useState(`idle`);return b.useEffect(()=>{if(n===`idle`)return;let e=setTimeout(()=>r(`idle`),DX);return()=>clearTimeout(e)},[n]),(0,x.jsx)(Gb,{label:n===`failed`?`Couldn’t copy to the clipboard`:t,children:(0,x.jsx)(J,{"aria-label":t,size:`xs`,variant:`ghost-muted`,disabled:n===`copied`,className:`disabled:opacity-100`,onClick:()=>navigator.clipboard.writeText(e).then(()=>r(`copied`),()=>r(`failed`)),children:n===`copied`?(0,x.jsx)(zd,{className:`size-3 text-primary`}):(0,x.jsx)(uf,{className:`size-3`})})})}function kX({at:e}){return e?(0,x.jsx)(Gb,{label:wu(e),children:(0,x.jsx)(`p`,{tabIndex:0,className:`rounded-sm text-xs text-muted-foreground tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:Su(e)})}):null}var AX=e=>K(`transition-opacity duration-200 pointer-coarse:opacity-100 focus-within:opacity-100`,e===`group`?`opacity-0 group-hover:opacity-100`:`opacity-0 group-hover/assistant:opacity-100`);function jX({at:e,text:t,onRevert:n,busy:r}){return(0,x.jsx)(`div`,{className:K(`flex w-full max-w-[80%] items-center justify-end pe-1 text-xs tabular-nums`,AX(`group`)),children:(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-x-2`,children:[(0,x.jsx)(kX,{at:e}),(0,x.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[n&&(0,x.jsx)(Gb,{label:`Edit from here`,children:(0,x.jsx)(J,{"aria-label":`Edit from here`,size:`xs`,variant:`ghost`,disabled:r,onClick:n,children:(0,x.jsx)(mm,{className:`size-3`})})}),t&&(0,x.jsx)(OX,{text:t})]})]})})}function MX({at:e,text:t,status:n,alwaysVisible:r,className:i}){return(0,x.jsxs)(`div`,{className:K(`flex items-center gap-2 text-xs tabular-nums`,r?`opacity-100`:AX(`assistant`),i),children:[n&&(0,x.jsx)(`span`,{className:`rounded-full border border-border/70 px-1.5 py-0.5 font-mono text-3xs text-muted-foreground`,children:n}),t.trim()&&(0,x.jsx)(OX,{text:t}),(0,x.jsx)(kX,{at:e})]})}function NX(e){let t=e.parts.filter(e=>e.type===`text`&&typeof e.text==`string`).map(e=>e.text);return t.length?t.join(`
|
|
282
|
+
`):null}function PX(e){let t=[];return e.forEach((n,r)=>{if(n.role!==`user`)return;let i=null;for(let t=r+1;t<e.length&&e[t].role!==`user`;t++){let n=NX(e[t]);e[t].role===`assistant`&&n!==null&&(i=n)}t.push({id:n.id,rowIndex:r,userText:NX(n)??``,assistantText:i})}),t}var FX=new Set([`paragraph`,`heading`,`tableCell`,`emphasis`,`strong`,`delete`,`link`,`linkReference`]);function IX(e){switch(e.type){case`text`:case`inlineCode`:case`code`:return e.value;case`break`:return` `;case`image`:case`imageReference`:return String(e.alt||``);case`footnoteReference`:case`footnoteDefinition`:case`definition`:case`html`:return``}return Array.isArray(e.children)?e.children.map(IX).join(FX.has(e.type)?``:` `):``}function LX(e){return IX(dU(e,{extensions:[QJ()],mdastExtensions:[rJ()]})).replace(/\s+/g,` `).trim()}function RX(e,t){if(t<=0||t>=e.length)return!1;let n=e.charCodeAt(t-1),r=e.charCodeAt(t);return n>=55296&&n<=56319&&r>=56320&&r<=57343}function zX(e){if(e===null)return null;let t=LX(e.slice(0,RX(e,1500)?1499:1500));return t.length?t:null}function BX(e){return e&&{...e,userText:zX(e.userText),assistantText:zX(e.assistantText)}}var VX=8,HX=5,UX=48,WX=32,GX=40,KX=14;function qX(e){return`min(${Math.max(1,(e-1)*VX)}px, max(4rem, calc(100% - 14.75rem)))`}function JX(e,t){return t<=1?0:Math.max(0,Math.min(e,t-1))/(t-1)*100}function YX(e,t){return t<=0?e:Math.min(e,Math.max(2,Math.floor(t/HX)+1))}function XX(e,t,n){return n>=t?e:Math.round(e/(t-1)*(n-1))}function ZX(e){if(e.count<=0||e.railHeight<=0)return null;if(e.count===1)return 0;let t=Math.max(0,Math.min(1,(e.y-e.railTop)/e.railHeight));return Math.max(0,Math.min(e.count-1,Math.round(t*(e.count-1))))}function QX(e,t,n,r){return n!==null&&r!==null&&e<=r&&(t===void 0||t>n)}function $X(e){if(e.visibleStart===null||e.visibleEnd===null)return null;let t=null;for(let[n,r]of e.rowIndices.entries()){if(r>=e.visibleStart)return r<=e.visibleEnd?n:t;t=n}return t}function eZ(e){return e>=UX}function tZ(e){let t=Number.isFinite(e)?Math.max(0,Math.floor(e)):0;return t<46?{left:0,width:Math.min(8,t)}:{left:WX,width:Math.min(GX,t-WX)}}function nZ(e){return e>=KX}var rZ=150,iZ=[1,3],aZ=new WeakMap;function oZ(e){let t=aZ.get(e);if(t)return cancelAnimationFrame(t.frame),t.stop.abort(),aZ.delete(e),t}function sZ(e,t){let n=oZ(e),r=e.scrollTop,i=n?n.to+r-n.written:r,a={from:r,to:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,i+t)),start:performance.now(),written:r,frame:0,stop:new AbortController};for(let t of[`pointerdown`,`keydown`])window.addEventListener(t,()=>oZ(e),{capture:!0,signal:a.stop.signal});let o=t=>{if(!e.isConnected)return void oZ(e);let n=e.scrollTop-a.written;a.from+=n,a.to+=n;let r=Math.min(1,Math.max(0,(t-a.start)/rZ));e.scrollTop=a.from+(a.to-a.from)*(1-(1-r)**3),a.written=e.scrollTop,r<1?a.frame=requestAnimationFrame(o):oZ(e)};a.frame=requestAnimationFrame(o),aZ.set(e,a)}function cZ(e,t){if(e.defaultPrevented||e.ctrlKey||e.deltaY===0)return;e.preventDefault();let n=e.deltaMode===WheelEvent.DOM_DELTA_LINE?16:e.deltaMode===WheelEvent.DOM_DELTA_PAGE?t.clientHeight:1,r=e.deltaY*n,i=e.wheelDeltaY;e.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i===void 0||iZ.some(t=>Math.abs(i+t*e.deltaY)<1))||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?(oZ(t),t.scrollBy({top:r})):sZ(t,r)}function lZ(e){let t=n=>{n.buttons===0&&(window.removeEventListener(`mouseup`,t),window.removeEventListener(`mousemove`,t),e())};window.addEventListener(`mouseup`,t),window.addEventListener(`mousemove`,t)}function uZ({items:e,persistent:t,hitStrip:n,currentIndex:r,atEnd:i,stripMap:a,onWheel:o,onSelect:s}){let[c,l]=b.useState(null),[u,d]=b.useState(0),[f,p]=b.useState(!1),m=b.useRef(!1),h=b.useRef(null),g=b.useRef(null),_=b.useRef(o);if(_.current=o,b.useEffect(()=>{let e=h.current;if(!e)return;let t=e=>_.current(e);return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[e.length>=2]),b.useEffect(()=>{let e=g.current;if(!e)return;d(e.getBoundingClientRect().height);let t=new ResizeObserver(([e])=>e&&d(e.contentRect.height));return t.observe(e),()=>t.disconnect()},[e.length>=2]),e.length<2)return null;let v=c!==null&&c<e.length?c:null,y=BX(v===null?null:e[v]||null),S=r!==null&&r>=0&&r<e.length?r:null,C=S===null?null:e[S-1]||null,w=S===null||i?null:e[S+1]||null,T=nZ(n.width)&&!f,E=YX(e.length,u),D=Array.from({length:E},()=>[]);e.forEach((t,n)=>D[XX(n,e.length,E)]?.push(t));let O=v===null?null:XX(v,e.length,E),k=t=>{let n=t.currentTarget.getBoundingClientRect();return ZX({count:e.length,railTop:n.top,railHeight:n.height,y:t.clientY})},A=t=>l(n=>Math.max(0,Math.min(e.length-1,(n??0)+t)));return(0,x.jsx)(`div`,{ref:h,"data-testid":`timeline-minimap`,className:K(`group/minimap pointer-events-none absolute top-0 bottom-0 left-0 z-40 w-18`,t?`opacity-100`:`hidden opacity-0 transition-opacity duration-150 hover:opacity-100 focus-within:opacity-100 [@media(pointer:fine)]:block`),children:(0,x.jsx)(`div`,{className:`relative h-full w-full select-none`,children:(0,x.jsxs)(`div`,{ref:g,className:K(`absolute top-1/2 -translate-y-1/2`,n.width>0&&!f?`pointer-events-auto`:`pointer-events-none`),style:{height:qX(e.length),left:n.left,width:n.width},onMouseDown:()=>{m.current||(m.current=!0,lZ(()=>m.current=!1))},onMouseMove:e=>{e.buttons===0||m.current||f||(p(!0),lZ(()=>p(!1)))},children:[(0,x.jsx)(dZ,{direction:`previous`,disabled:!C,interactive:T,onClick:()=>C&&s(C)}),(0,x.jsxs)(`button`,{type:`button`,"aria-label":`Jump to message: ${y?.userText??`User message`}`,className:`absolute inset-y-0 left-0 w-full cursor-pointer bg-transparent before:absolute before:inset-x-0 before:-inset-y-1 before:content-[''] focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:outline-none focus-visible:ring-inset`,onBlur:()=>l(null),onFocus:()=>l(e=>e??S??0),onMouseLeave:()=>l(null),onMouseMove:e=>{(e.buttons===0||m.current)&&l(k(e))},onMouseDown:e=>e.preventDefault(),onClick:t=>{let n=k(t),r=n===null?null:e[n];r&&s(r),t.currentTarget.blur()},onKeyDown:t=>{let n={ArrowDown:()=>A(1),ArrowUp:()=>A(-1),Home:()=>l(0),End:()=>l(e.length-1),Enter:()=>v!==null&&s(e[v])," ":()=>v!==null&&s(e[v])}[t.key];n&&(t.preventDefault(),n())},children:[D.map((e,t)=>{let n=O===null?null:Math.abs(t-O);return(0,x.jsx)(`span`,{"aria-hidden":!0,"data-minimap-strip":!0,"data-in-view":`false`,ref:t=>{if(t){for(let n of e)a.set(n.id,t);return()=>{for(let n of e)a.get(n.id)===t&&a.delete(n.id)}}},style:{top:`${JX(t,E)}%`},className:K(`pointer-events-none absolute left-0 h-0.5 w-6 origin-left -translate-y-1/2 rounded-full transition-transform duration-150 after:absolute after:inset-0 after:rounded-full after:bg-foreground/55 after:opacity-0 after:transition-opacity after:duration-150 data-[in-view=true]:after:opacity-100`,n===0?`bg-muted-foreground/60`:`bg-muted-foreground/25`,n===0?`scale-x-100`:n===1?`scale-x-[0.667]`:n===2?`scale-x-[0.417]`:`scale-x-[0.333]`)},e[0]?.id??t)}),y&&(0,x.jsx)(`span`,{className:`pointer-events-none absolute left-8 w-80 -translate-y-1/2`,style:{top:`${JX(v,e.length)}%`},children:(0,x.jsxs)(`span`,{className:`glass block rounded-xl p-3 text-left text-popover-foreground shadow-xl shadow-black/25`,children:[(0,x.jsx)(`span`,{className:`block max-w-full truncate text-sm leading-5 font-medium`,children:y.userText??`User message`}),y.assistantText&&(0,x.jsx)(`span`,{className:`mt-1 line-clamp-3 max-h-[3.75rem] overflow-hidden text-sm leading-5 text-muted-foreground`,children:y.assistantText})]})})]}),(0,x.jsx)(dZ,{direction:`next`,disabled:!w,interactive:T,onClick:()=>w&&s(w)})]})})})}function dZ({direction:e,disabled:t,interactive:n,onClick:r}){let i=e===`previous`,a=i?`Previous turn`:`Next turn`,o=i?Gd:Vd;return(0,x.jsx)(`span`,{className:K(`absolute left-1 z-10 inline-flex -translate-x-1/2 opacity-0 transition-opacity duration-150 focus-within:opacity-100 hover:opacity-100`,n?`pointer-events-auto`:`pointer-events-none`,i?`bottom-[calc(100%+6px)]`:`top-[calc(100%+6px)]`),children:(0,x.jsx)(Gb,{label:a,side:i?`top`:`bottom`,children:(0,x.jsx)(J,{"aria-label":a,disabled:t,onClick:r,variant:`ghost-muted`,className:`size-5 p-0`,children:(0,x.jsx)(o,{className:`size-4 text-foreground/90`})})})})}var fZ=b.lazy(()=>UY(()=>import(`./diff-view-rgZLuZMg.js`),__vite__mapDeps([8,9,3,1,5])));function pZ(e){return e.state===`input-streaming`||e.state===`input-available`||e.state===`output-available`&&(e.preliminary===!0||e.output?.running===!0)}var mZ=e=>e.type.replace(/^tool-/,``),hZ=new Set([`read_file`,`list_dir`,`glob`,`grep`]),gZ=e=>hZ.has(mZ(e));function _Z(e){return(Array.isArray(e?.todos)?e.todos:[]).flatMap(e=>{let t=String(e?.text??e?.content??``).trim();if(!t)return[];let n=e?.status;return[{text:t,status:n===`completed`?`completed`:n===`running`||n===`in_progress`?`running`:`pending`}]})}function vZ(e){let t=e.filter(e=>e.status===`completed`).length,n=e.find(e=>e.status===`running`)??e.find(e=>e.status===`pending`);return n?`Tasks ${t}/${e.length} · ${n.text}`:`Tasks ${t}/${e.length}`}function yZ(e){if(!e?.plan)return;let{errors:t=0,warnings:n=0}=e.plan;return!t&&!n?`plan checks passed`:`plan: ${t?`${t} error${t===1?``:`s`}`:`${n} warning${n===1?``:`s`}`}`}function bZ(e){let t=e.input||{},n=e.output||{},r=pZ(e),i=e=>(0,x.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:String(e??``)});switch(mZ(e)){case`todo`:return{icon:bp,label:vZ(_Z(t))};case`propose_plan`:return{icon:Of,label:(0,x.jsxs)(x.Fragment,{children:[r?`Proposing a plan`:`Proposed a plan`,n.path?(0,x.jsxs)(x.Fragment,{children:[` `,i(n.path)]}):null]}),meta:n.captured?`saved for review`:void 0};case`read_file`:return{icon:wf,label:(0,x.jsxs)(x.Fragment,{children:[r?`Reading`:`Read`,` `,i(t.path)]}),meta:n.totalLines?`${n.totalLines} lines`:n.error};case`list_dir`:return{icon:Mf,label:(0,x.jsxs)(x.Fragment,{children:[r?`Listing`:`Listed`,` `,i(t.path||`.`)]}),meta:n.entries?`${n.entries.length} entries`:n.error};case`glob`:return{icon:Rm,label:(0,x.jsxs)(x.Fragment,{children:[`Found files `,i(t.pattern)]}),meta:n.files?`${n.files.length} files`:void 0};case`grep`:return{icon:Rm,label:(0,x.jsxs)(x.Fragment,{children:[`Searched “`,t.pattern,`”`]}),meta:n.matches?`${n.matches.length} matches in ${n.files} files`:n.error};case`write_file`:return{icon:nh,label:(0,x.jsxs)(x.Fragment,{children:[r?`Writing`:n.created?`Created`:`Wrote`,` `,i(t.path)]}),stat:n.added===void 0?void 0:{added:n.added,removed:n.removed},meta:yZ(n)};case`edit_file`:return{icon:nh,label:(0,x.jsxs)(x.Fragment,{children:[r?`Editing`:n.error?`Edit`:`Edited`,` `,i(t.path)]}),stat:n.added===void 0?void 0:{added:n.added,removed:n.removed},meta:n.error||yZ(n)};case`rename_path`:return{icon:fm,label:(0,x.jsxs)(x.Fragment,{children:[`Renamed `,i(t.from),` → `,i(t.to)]}),meta:n.error};case`delete_path`:return{icon:vh,label:(0,x.jsxs)(x.Fragment,{children:[n.deleted?`Deleted`:`Delete`,` `,i(t.path)]}),stat:n.removed?{added:0,removed:n.removed}:void 0,meta:e.state===`output-denied`?`declined`:n.error};case`shell`:{let i=typeof n.durationMs==`number`?` · ${(n.durationMs/1e3).toFixed(+(n.durationMs<1e4))}s`:``;return{icon:mh,label:(0,x.jsxs)(x.Fragment,{children:[e.state===`approval-requested`?`Run`:r?`Running`:e.state===`output-denied`?`Not run:`:`Ran`,` `,(0,x.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:String(t.command||``).slice(0,120)})]}),meta:e.state===`output-denied`?e.approval?.reason||`declined`:n.timedOut?`timed out`:typeof n.exitCode==`number`?`exit ${n.exitCode}${i}`:void 0}}default:return CZ(e,r)}}var xZ={dev_open:Jf,dev_act:Kp,dev_screenshot:Nd,dev_inspect:Im,dev_eval:cf,dev_wait_idle:ep,dev_status:dd,search_docs:xd,read_doc:xd,lookup_api:xd,describe_table:ff,data_find_tables:ff,data_query:fh,data_sample:fh,data_table_api:fh,data_relations:Jp,data_stats:Qm,data_graphql:kd,find_pattern:fp,show_example:fp,search_catalog:Xp,list_components:Xp,where_used:Op,check_component:Xf,workspace_check:Xf,workspace_status:Wf,workspace_diff:Wf,workspace_push:Sh},SZ={click:`Clicked`,dblclick:`Double-clicked`,hover:`Hovered`,type:`Typed`,press:`Pressed`,scroll:`Scrolled`,select:`Selected`};function CZ(e,t){let n=mZ(e),r=e.input||{},i=e.output||{},a=xZ[n]||(n.startsWith(`dev_`)?Jf:mf),o=n.startsWith(`data_`)?n===`data_graphql`?``:r.table||r.query||``:r.intent||r.pattern||r.route||r.path||r.query||r.selector||r.component||r.table||r.portal||r.page||r.key||r.name||``,s={dev_open:[`Opening`,`Opened`],dev_act:[`Acting`,SZ[r.action]||`Acted`],dev_screenshot:[`Taking a screenshot`,`Took a screenshot`],dev_inspect:[`Inspecting the page`,`Inspected the page`],search_docs:[`Searching the docs`,`Searched the docs`],find_pattern:[`Finding patterns for`,`Found patterns for`],show_example:[`Opening the example`,`Opened the example`],search_catalog:[`Searching the catalog for`,`Searched the catalog for`],where_used:[`Finding where it is used:`,`Found where it is used:`],data_find_tables:[`Finding tables`,`Found tables`],describe_table:[`Reading the table`,`Read the table`],data_relations:[`Reading relations of`,`Read relations of`],data_query:[`Querying`,`Queried`],data_sample:[`Sampling`,`Sampled`],data_stats:[`Counting`,`Counted`],data_graphql:[`Running a GraphQL query`,`Ran a GraphQL query`],data_table_api:[`Reading rows of`,`Read rows of`],workspace_push:[`Planning a push`,`Planned a push`]}[n],c=s?t?s[0]:s[1]:n.replace(/_/g,` `);return{icon:a,label:(0,x.jsxs)(x.Fragment,{children:[c,o&&(0,x.jsxs)(`span`,{className:`font-mono text-[12.5px]`,children:[` `,String(o).slice(0,80)]})]}),meta:i.refused?`refused`:i.error?String(i.error).split(`
|
|
283
|
+
`)[0].slice(0,80):e.state===`output-denied`?`declined`:void 0}}function wZ({part:e}){let t=e.output||{},n=pZ(e),r=b.useRef(null),i=b.useRef(!0),a=t.output?String(t.output).slice(-6e3):``;return b.useLayoutEffect(()=>{let e=r.current;e&&i.current&&(e.scrollTop=e.scrollHeight)},[a]),(0,x.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`ms-7 mt-0.5 mb-1.5 flex cursor-auto flex-col gap-1.5`,children:[a?(0,x.jsxs)(`pre`,{ref:r,onScroll:e=>{let t=e.currentTarget;i.current=t.scrollHeight-t.scrollTop-t.clientHeight<=8},className:`max-h-80 overflow-auto rounded-lg border bg-muted px-3 py-2 font-mono text-2xs leading-relaxed whitespace-pre-wrap text-muted-foreground select-text`,children:[t.truncated||String(t.output).length>6e3?(0,x.jsx)(`span`,{className:`block italic`,children:`Earlier output not shown`}):null,a]}):n?null:e.state===`output-available`&&!t.error?(0,x.jsx)(`div`,{className:`text-xs text-muted-foreground italic`,children:`No output.`}):null,t.sessionId&&(0,x.jsx)(`button`,{className:`self-start text-xs text-muted-foreground hover:text-foreground hover:underline`,onClick:()=>Uu({drawerOpen:!0,activeTerminal:t.sessionId}),children:`Open in terminal`})]})}function TZ({part:e}){let t=e.output?.result||{};if(e.output?.refused||e.output?.error)return null;let n=t.chunks||[],r=e=>n.reduce((t,n)=>t+(Array.isArray(n[e])?n[e].length:0),0),i=n.reduce((e,t)=>e+(t.compile?.components?.length||0),0),a=n.some(e=>e.compile?.finalize?.reprocess),o=[r(`creates`)&&`${r(`creates`)} create${r(`creates`)===1?``:`s`}`,r(`updates`)&&`${r(`updates`)} update${r(`updates`)===1?``:`s`}`,r(`deactivates`)&&`${r(`deactivates`)} deactivation${r(`deactivates`)===1?``:`s`}`,r(`deletes`)&&`${r(`deletes`)} file deletion${r(`deletes`)===1?``:`s`}`,i&&`${i} compile${i===1?``:`s`}`,a&&`1 reprocess`].filter(Boolean),s=n.flatMap(e=>[...e.creates||[],...e.updates||[]]).map(e=>e.display),c=[...new Set(n.flatMap(e=>e.warnings||[]))];return(0,x.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`ms-7 mt-1 mb-2 cursor-auto rounded-2xl border border-border/80 bg-card/70 p-4 text-sm`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,x.jsxs)(`span`,{className:`inline-flex h-[18px] shrink-0 items-center gap-1 rounded-sm bg-foreground/8 px-1.5 text-xs font-medium whitespace-nowrap`,children:[(0,x.jsx)(Sh,{className:`size-3`}),` Push plan`]}),(0,x.jsxs)(`span`,{className:`truncate font-medium`,children:[[t.portal?.slug,t.app].filter(Boolean).join(` · `)||`Workspace`,t.updateSet?` · ${t.updateSet}`:``]}),t.planHash&&(0,x.jsx)(`span`,{className:`ms-auto shrink-0 font-mono text-xs text-muted-foreground`,children:t.planHash})]}),(0,x.jsx)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:t.refused?`Refused: ${t.reason}`:t.nothingToPush?`Nothing to push: the instance has everything.`:o.join(` · `)||`Planned changes`}),s.length>0&&(0,x.jsxs)(`div`,{className:`mt-1 truncate font-mono text-xs text-foreground/80`,children:[s.slice(0,4).join(`, `),s.length>4?` +${s.length-4}`:``]}),c.slice(0,2).map(e=>(0,x.jsxs)(`div`,{className:`mt-1 truncate text-xs text-warning-foreground`,children:[`⚠ `,e]},e)),!t.nothingToPush&&!t.refused&&(0,x.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5 text-xs`,children:[(0,x.jsx)(Xm,{className:`size-3.5 text-warning-foreground`}),(0,x.jsx)(`span`,{className:`text-warning-foreground`,children:`Waiting for your review`}),(0,x.jsx)(`span`,{className:`text-icon-muted`,children:`·`}),(0,x.jsx)(`button`,{className:`font-medium text-foreground underline-offset-4 hover:underline`,onClick:()=>Uu({pushOpen:!0}),children:`Review and push…`})]})]})}function EZ({ids:e}){let{projectId:t}=b.useContext(DZ);return(0,x.jsx)(`div`,{className:`ms-7 flex gap-2 pt-1 pb-1.5`,children:e.slice(0,3).map(e=>(0,x.jsx)(`a`,{href:`/api/blob/${t}/${e}`,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),children:(0,x.jsx)(`img`,{src:`/api/blob/${t}/${e}`,alt:`Screenshot from the agent's browser`,className:`h-28 w-auto rounded-lg border bg-muted object-cover object-top shadow-xs/5`})},e))})}var DZ=b.createContext({projectId:``,chatId:``,onAnswer:()=>{},onRewind:()=>{},onUndoTurn:()=>{}}),OZ=new Set([`edit_file`,`write_file`,`delete_path`]);function kZ(e){let{projectId:t,chatId:n}=b.useContext(DZ),r=ku(),i=e.output?.editId,a=U({...r.edits.undone.queryOptions({projectId:t}),enabled:!!i&&!!t}),o=W(r.edits.undo.mutationOptions()),s=U({...r.chats.overlaps.queryOptions({projectId:t,chatId:n}),enabled:!!i&&!!t&&!!n}),[c,l]=b.useState(``);if(!i||!OZ.has(mZ(e)))return null;let u=!!a.data?.includes(i),d=(s.data||[]).filter(t=>t.path===e.output?.path),f=!u&&d.length>0&&(0,x.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-xs text-warning-foreground`,title:`Also changed by ${d.map(e=>`“${e.title}”`).join(`, `)}. Undo merges around their edits.`,children:[(0,x.jsx)(Eh,{"aria-hidden":!0,className:`size-3`}),(0,x.jsx)(`span`,{className:`sr-only`,children:`Also changed by another chat`})]});return{editId:i,isUndone:u,actions:(0,x.jsxs)(x.Fragment,{children:[f,(0,x.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-xs opacity-0 transition-opacity group-hover/timeline-row:opacity-100 group-focus-within/timeline-row:opacity-100`,children:[(0,x.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground hover:underline`,onClick:t=>{t.stopPropagation(),Uu({panelOpen:!0,panelTab:`diff`,diffScope:`session`,diffPath:e.output?.path})},children:`View diff`}),!u&&(0,x.jsxs)(`button`,{className:`inline-flex items-center gap-1 text-muted-foreground hover:text-foreground`,title:`Undo this edit`,onClick:async e=>{e.stopPropagation();let r=await o.mutateAsync({projectId:t,chatId:n,editId:i});l(r.ok?``:r.message||`Undo failed`)},children:[(0,x.jsx)(Am,{className:`size-3`}),` Undo`]})]})]}),msg:c}}function AZ({editId:e}){let{projectId:t}=b.useContext(DZ),n=U(ku().edits.diff.queryOptions({projectId:t,editId:e}));return n.data?(0,x.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:`ms-7 mt-0.5 mb-1.5 max-h-96 cursor-auto overflow-auto rounded-lg border`,children:(0,x.jsx)(b.Suspense,{fallback:(0,x.jsx)(`div`,{className:`h-10`}),children:(0,x.jsx)(fZ,{path:n.data.path,oldText:n.data.old,newText:n.data.new})})}):null}function jZ({part:e}){let{onAnswer:t}=b.useContext(DZ),[n,r]=b.useState(``),i=e.input||{},a=e.state===`output-available`?String(e.output?.answer??``):``;return e.state===`input-streaming`?null:(0,x.jsx)(`div`,{className:`my-1 rounded-xl border bg-card/60 p-3 text-sm`,children:(0,x.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,x.jsx)(Ap,{className:`mt-0.5 size-4 shrink-0 text-indigo-600 dark:text-indigo-300`}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`div`,{className:`leading-relaxed`,children:i.question}),a?(0,x.jsxs)(`div`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[`You answered: `,(0,x.jsx)(`span`,{className:`text-foreground`,children:a})]}):(0,x.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[Array.isArray(i.choices)&&i.choices.length>0&&(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.choices.map(n=>(0,x.jsx)(`button`,{onClick:()=>t(e.toolCallId,n),className:`h-7 rounded-[var(--control-radius)] border border-input bg-popover px-2.5 text-xs font-medium shadow-xs/5 hover:bg-accent/50`,children:n},n))}),(0,x.jsxs)(`form`,{onSubmit:r=>{r.preventDefault(),n.trim()&&t(e.toolCallId,n.trim())},className:`flex gap-1.5`,children:[(0,x.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`Or type an answer`,className:`h-7 min-w-0 flex-1 rounded-[var(--control-radius)] border border-input bg-transparent px-2 text-xs outline-none focus:ring-2 focus:ring-ring/40`}),(0,x.jsx)(`button`,{type:`submit`,disabled:!n.trim(),className:`h-7 rounded-[var(--control-radius)] bg-primary px-2.5 text-xs font-medium text-primary-foreground disabled:opacity-50`,children:`Answer`})]})]})]})]})})}var MZ=e=>e.state===`output-error`||!!e.output?.error||mZ(e)===`shell`&&typeof e.output?.exitCode==`number`&&e.output.exitCode!==0;function NZ({added:e,removed:t}){return(0,x.jsxs)(`span`,{className:`font-mono text-xs tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-diff-addition-foreground`,children:[`+`,e]}),` `,(0,x.jsxs)(`span`,{className:`text-diff-deletion-foreground`,children:[`−`,t]})]})}var PZ=`rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70`,FZ=b.createContext(!1);function IZ({at:e}){return e?(0,x.jsx)(`span`,{title:new Date(e).toLocaleString(),className:`pointer-events-none absolute me-1 shrink-0 rounded-md text-xs whitespace-nowrap text-muted-foreground tabular-nums opacity-0 group-focus-within/timeline-row:pointer-events-auto group-focus-within/timeline-row:static group-focus-within/timeline-row:opacity-100 group-hover/timeline-row:pointer-events-auto group-hover/timeline-row:static group-hover/timeline-row:opacity-100`,children:bu(e)}):null}function LZ({icon:e,label:t,meta:n,stat:r,at:i,live:a,error:o,open:s,expandable:c,onToggle:l,actions:u,children:d}){let f=b.useContext(FZ);return(0,x.jsxs)(`div`,{onClick:c?l:void 0,className:K(`group/timeline-row relative w-full min-w-0 rounded-md px-0.5 text-left transition-colors`,f?`py-0`:`py-0.5`,c&&`cursor-pointer`),children:[(0,x.jsxs)(`div`,{role:c?`button`:void 0,tabIndex:c?0:void 0,"aria-expanded":c?!!s:void 0,onKeyDown:e=>{c&&e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l?.())},className:K(`flex min-h-6 min-w-0 items-center gap-1.5 text-sm leading-relaxed select-none`,c&&PZ),children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,x.jsx)(`span`,{className:`relative w-6 shrink-0 leading-0`,children:(0,x.jsx)(`span`,{className:`inline-block size-6 overflow-hidden align-[calc(0.5cap_-_0.75rem)]`,children:(0,x.jsx)(`span`,{className:`flex size-full items-center justify-center`,children:(0,x.jsx)(`span`,{className:K(`flex size-4 items-center justify-center`,o?`text-tool-error-icon/40`:`text-icon-muted`),children:(0,x.jsx)(e,{className:K(`block size-4 shrink-0 stroke-2`,!o&&`opacity-70`)})})})})}),(0,x.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-secondary-label [&_*]:whitespace-nowrap`,children:(0,x.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,x.jsx)(`span`,{className:K(`min-w-0 truncate`,a&&`live-tool-shine`),children:t}),r&&(0,x.jsx)(NZ,{...r}),n&&(0,x.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:n})]})})]}),u,(0,x.jsx)(IZ,{at:i}),o&&(0,x.jsx)(Oh,{"aria-hidden":!0,className:`size-3 shrink-0 text-tool-error-icon/40`}),c&&(0,x.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,"aria-hidden":!0,children:(0,x.jsx)(Ud,{className:K(`size-3 shrink-0 text-icon-muted opacity-70 transition-transform duration-200`,s&&`rotate-90`)})})]}),d]})}function RZ({part:e}){let t=e.errorText||(e.output===void 0?``:JSON.stringify(e.output,null,2));return(0,x.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`ms-7 flex max-h-96 cursor-auto flex-col gap-3 overflow-auto px-0.5 py-1 select-text`,children:[(0,x.jsx)(`pre`,{className:`font-mono text-2xs leading-relaxed whitespace-pre-wrap text-secondary-label`,children:JSON.stringify(e.input,null,2)}),t&&(0,x.jsx)(`pre`,{className:`max-h-64 overflow-auto font-mono text-2xs leading-relaxed whitespace-pre-wrap text-secondary-label`,children:t.length>6e3?t.slice(0,6e3)+`
|
|
284
|
+
…`:t})]})}function zZ({steps:e}){return(0,x.jsx)(`ul`,{onClick:e=>e.stopPropagation(),className:`ms-7 flex cursor-auto flex-col gap-0.5 py-1 text-sm select-text`,children:e.map((e,t)=>(0,x.jsxs)(`li`,{className:K(`flex min-w-0 items-baseline gap-2`,e.status===`completed`?`text-muted-foreground line-through decoration-muted-foreground/40`:`text-secondary-label`),children:[(0,x.jsx)(`span`,{"aria-hidden":!0,className:`w-3 shrink-0 text-center font-mono text-xs`,children:e.status===`completed`?`✓`:e.status===`running`?`◉`:`○`}),(0,x.jsx)(`span`,{className:`min-w-0`,children:e.text})]},t))})}function BZ({part:e,at:t,onApprove:n}){let[r,i]=b.useState(!1),a=bZ(e),o=mZ(e)===`shell`&&/^command:/.test(e.approval?.requestReason||``),s=pZ(e),c=kZ(e);return(0,x.jsxs)(LZ,{...a,meta:c?.isUndone?`undone`:c?.msg||a.meta,actions:c?.actions,at:t,live:s,error:MZ(e),open:r,expandable:!0,onToggle:()=>i(!r),children:[e.state===`approval-requested`&&(0,x.jsx)(`div`,{className:`ms-7.5 flex flex-col gap-1 pb-1 text-xs`,children:(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(Xm,{className:`size-3 text-warning-foreground`}),(0,x.jsx)(`span`,{className:`text-warning-foreground`,children:`Waiting for approval`}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`·`}),(0,x.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground`,onClick:()=>n?.(!1),children:`Decline`}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`·`}),(0,x.jsx)(`button`,{className:`font-medium text-foreground hover:underline`,onClick:()=>n?.(!0),children:`Approve`}),o&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`·`}),(0,x.jsxs)(Pb,{children:[(0,x.jsx)(Fb,{render:(0,x.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground`,"aria-label":`More approval options`}),children:`More`}),(0,x.jsx)(Ib,{align:`start`,children:(0,x.jsx)(Lb,{onClick:()=>n?.(!0,!0),children:`Always allow this session`})})]})]})]})}),mZ(e)===`shell`&&(r||pZ(e))&&(0,x.jsx)(wZ,{part:e}),mZ(e)===`workspace_push`&&e.state===`output-available`&&(0,x.jsx)(TZ,{part:e}),Array.isArray(e.output?.screenshots)&&e.output.screenshots.length>0&&(0,x.jsx)(EZ,{ids:e.output.screenshots}),r&&c&&!c.isUndone&&(0,x.jsx)(AZ,{editId:c.editId}),r&&mZ(e)===`todo`&&(0,x.jsx)(zZ,{steps:_Z(e.input)}),r&&e.output?.plan?.report&&(0,x.jsx)(`div`,{className:`ms-7 py-1 text-xs whitespace-pre-wrap text-muted-foreground select-text`,children:e.output.plan.report}),r&&![`shell`,`todo`,`propose_plan`].includes(mZ(e))&&!c&&(0,x.jsx)(RZ,{part:e})]})}function VZ({parts:e,at:t}){let[n,r]=b.useState(!1),i=t=>e.filter(e=>t.includes(mZ(e))).length,a=i([`read_file`]),o=i([`list_dir`]),s=i([`grep`,`glob`]),c=[a&&`Read ${a} file${a>1?`s`:``}`,o&&`listed ${o} folder${o>1?`s`:``}`,s&&`searched ${s} pattern${s>1?`s`:``}`].filter(Boolean).join(`, `).replace(/^./,e=>e.toUpperCase()),l=e.some(pZ);return(0,x.jsx)(LZ,{icon:wf,label:c,at:t,live:l,error:e.some(MZ),open:n,expandable:!0,onToggle:()=>r(!n),children:n&&(0,x.jsx)(`div`,{className:`flex flex-col pb-1 ps-7`,onClick:e=>e.stopPropagation(),children:(0,x.jsx)(FZ.Provider,{value:!0,children:e.map(e=>(0,x.jsx)(BZ,{part:e},e.toolCallId))})})})}function HZ({text:e,live:t,seconds:n}){let[r,i]=b.useState(!1),a=t?`Thinking`:n?`Thought for ${n}s`:`Thought`,o=e.trim().split(`
|
|
285
|
+
`).filter(Boolean).pop()?.slice(0,160)||``;return(0,x.jsx)(LZ,{icon:jd,label:(0,x.jsxs)(x.Fragment,{children:[a,!r&&o&&(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,o]})]}),live:t,expandable:!!e,open:r,onToggle:()=>i(!r),children:r&&(0,x.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:`ms-7 flex max-h-96 cursor-auto flex-col overflow-auto px-0.5 py-1 text-sm leading-relaxed whitespace-pre-wrap text-secondary-label select-text`,children:e})})}function UZ(e){let t=e.match(/^ {0,3}#{1,6}([ \t].*)?$/);return t?(t[1]??``).replace(/[ \t]#+[ \t]*$/,``).trim():null}function WZ(e){let t=``,n=!1;for(let r of e.replace(/^/,``).split(/\r?\n/)){let[,e=``,i=``]=r.match(/^ {0,3}(`{3,}|~{3,})([^\r\n]*)$/)??[];if(t){e[0]===t[0]&&e.length>=t.length&&/^[ \t]*$/.test(i)&&(t=``);continue}if(n||/^ {0,3}<!--/.test(r)){n=!r.includes(`-->`);continue}if(e&&(e[0]!=="`"||!i.includes("`"))){t=e;continue}let a=UZ(r);if(a)return a}return null}function GZ(e){let t=e.replace(/^/,``).trimEnd().split(/\r?\n/),n=0,r=-1,i=[];for(let e of t){if(r<0&&/^ {0,3}<!--/.test(e)&&(r=n),r<0&&e.trim().length>0&&UZ(e)!==``)break;let t=r>=0?e.indexOf(`-->`):-1;t>=0&&((i.length>0||e.slice(t+3).trim())&&i.push({start:r,end:n+1}),r=-1),n+=1}let a=i[0];if(UZ(t[n]??``))n+=1;else if(a)return t.slice(a.start).join(`
|
|
286
|
+
`);for(;t[n]?.trim().length===0;)n+=1;if(UZ(t[n]??``)?.toLowerCase()===`summary`)for(n+=1;t[n]?.trim().length===0;)n+=1;let o=t.slice(n).join(`
|
|
287
|
+
`);if(!a)return o;let s=i.map(({start:e,end:n})=>t.slice(e,n).join(`
|
|
288
|
+
`)).join(`
|
|
289
|
+
`);return o?`${s}\n\n${o}`:s}function KZ(e,t=8){let n=GZ(e).trimEnd().split(/\r?\n/).map(e=>e.trimEnd()),r=[],i=0,a=!1,o=null;for(let e of n){let n=e.trim().length>0;if(n&&i>=t){a=!0;break}r.push(e),n&&(i+=1);let s=/^( {0,3})(?:(`{3,})[^`]*|(~{3,}).*)$/.exec(e),c=s?.[2]??s?.[3];s!==null&&c!==void 0&&(o===null?o={marker:c,indent:s[1]??``}:c[0]===o.marker[0]&&c.length>=o.marker.length&&e.trim()===c&&(o=null))}for(;r.length>0&&r.at(-1)?.trim().length===0;)r.pop();return r.length===0?WZ(e)??`Plan preview unavailable.`:(o!==null&&r.push(o.indent+o.marker),a&&r.push(``,`...`),r.join(`
|
|
290
|
+
`))}function qZ(e){return e.length>900||e.split(`
|
|
291
|
+
`).length>20}function JZ(e,t){let n=new Blob([`${t.trimEnd()}\n`],{type:`text/markdown;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),window.setTimeout(()=>URL.revokeObjectURL(r),0)}function YZ(e){return e.status===`implementing`?e.stopped?{text:`Paused${e.phase?` at phase ${e.phase}`:``}`,tone:`text-warning-foreground`}:{text:e.phase?`Building phase ${e.phase}`:`Building`,tone:`text-info-foreground`}:e.status===`approved`?e.handedTo?{text:`Building in a new chat`,tone:`text-info-foreground`}:{text:`Approved`,tone:`text-success-foreground`}:e.status===`completed`?{text:`Completed`,tone:`text-success-foreground`}:e.status===`superseded`?{text:`Superseded`,tone:`text-muted-foreground`}:{text:`Draft`,tone:`text-violet-600 dark:text-violet-300/90`}}function XZ({plan:e,projectId:t,busy:n,onBuild:r}){let i=ku(),[a,o]=b.useState(!1),[s,c]=b.useState(!1),l=W(i.plans.approve.mutationOptions()),u=W(i.plans.buildPhase.mutationOptions()),d=W(i.plans.setPause.mutationOptions()),f=e.content,p=qZ(f),m=p&&!a,h=m?KZ(f,10):GZ(f),g=YZ(e),_=e.problems.filter(e=>e.severity===`error`),v=e.problems.filter(e=>e.severity===`warning`),y=e.path.split(`/`).pop()||`plan.md`,S=e.status===`draft`,C=e.status===`approved`||e.status===`implementing`||e.status===`completed`,w=e.changedSinceApproval&&C,T=S||w,E=l.isPending||u.isPending,D=async(n={})=>{try{let i=await l.mutateAsync({projectId:t,chatId:e.chatId,planId:e.id,...n});r({chatId:i.chatId,text:i.text})}catch(e){q8.error(`Not approved`,{description:e.message})}},O=async()=>{try{let n=await u.mutateAsync({projectId:t,chatId:e.chatId,planId:e.id});r({chatId:e.chatId,text:n.text})}catch(e){q8.error(`Can’t build yet`,{description:e.message})}};return(0,x.jsxs)(`div`,{className:`mt-1 mb-2 rounded-2xl border border-border/80 bg-card/70 p-4 sm:p-5`,"data-plan-card":e.id,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(Xb,{children:`Plan`}),(0,x.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground`,children:e.title})]}),(0,x.jsxs)(Pb,{children:[(0,x.jsx)(Fb,{render:(0,x.jsx)(J,{"aria-label":`Plan actions`,size:`icon-xs`,variant:`outline`}),children:(0,x.jsx)(vf,{"aria-hidden":!0,className:`size-4`})}),(0,x.jsxs)(Ib,{align:`end`,children:[(0,x.jsx)(Lb,{closeOnClick:!1,onClick:()=>void navigator.clipboard.writeText(`${f.trimEnd()}\n`).then(()=>{c(!0),setTimeout(()=>c(!1),1500)}),children:s?`Copied!`:`Copy to clipboard`}),(0,x.jsx)(Lb,{onClick:()=>JZ(y,f),children:`Download as markdown`}),T&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(zb,{}),(0,x.jsx)(Lb,{disabled:n||E||_.length>0,onClick:()=>void D({newChat:!0}),children:`Approve and build in a new chat`}),_.length>0&&(0,x.jsxs)(Lb,{disabled:n||E,onClick:()=>void D({anyway:!0}),children:[`Approve anyway (`,_.length,` problem`,_.length===1?``:`s`,`)`]})]}),e.phases.length>1&&e.status!==`superseded`&&e.status!==`completed`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(zb,{}),(0,x.jsxs)(Lb,{closeOnClick:!1,onClick:()=>d.mutate({projectId:t,chatId:e.chatId,planId:e.id,pause:!e.pauseAfterPhase}),children:[(0,x.jsx)(um,{}),(0,x.jsx)(`span`,{className:`flex-1`,children:`Pause after each phase`}),(0,x.jsx)($Z,{on:!!e.pauseAfterPhase})]})]})]})]})]}),(0,x.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,x.jsx)(`button`,{type:`button`,onClick:()=>Yu(e.path),className:`min-w-0 truncate font-mono hover:text-foreground hover:underline`,title:`Open the plan file`,children:e.path}),e.revisions>0&&(0,x.jsxs)(`span`,{children:[`· Revised `,e.revisions,`×`]}),(0,x.jsxs)(`span`,{className:K(`font-medium`,g.tone),children:[`· `,g.text]}),w&&(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-medium text-warning-foreground`,children:[(0,x.jsx)(bh,{className:`size-3`}),` Changed since approval`]}),e.approvedAnyway?.length?(0,x.jsx)(Gb,{label:e.approvedAnyway.map(e=>e.message).join(`
|
|
292
|
+
`),children:(0,x.jsxs)(`span`,{className:`text-warning-foreground`,children:[`· Approved over `,e.approvedAnyway.length,` problem`,e.approvedAnyway.length===1?``:`s`]})}):null]}),e.exists?(0,x.jsxs)(`div`,{className:`mt-4`,children:[(0,x.jsxs)(`div`,{className:K(`relative`,m&&`max-h-104 overflow-hidden`),children:[(0,x.jsx)(gX,{text:h,headingOffset:3}),m&&(0,x.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-24`,style:{background:`linear-gradient(to top, color-mix(in srgb, var(--card) 70%, var(--background)) 5%, color-mix(in srgb, color-mix(in srgb, var(--card) 70%, var(--background)) 80%, transparent) 50%, transparent)`}})]}),p&&(0,x.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,x.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>o(e=>!e),children:a?`Collapse plan`:`Expand plan`})})]}):(0,x.jsx)(`div`,{className:`mt-4 text-sm text-muted-foreground`,children:`The plan file no longer exists.`}),e.exists&&e.status!==`superseded`&&e.problems.length>0&&(0,x.jsx)(ZZ,{errors:_,warnings:v,path:e.path}),e.stopped&&e.status===`implementing`&&(0,x.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5 text-xs text-warning-foreground`,children:[(0,x.jsx)(Zd,{className:`size-3.5 shrink-0`}),(0,x.jsx)(`span`,{className:`min-w-0`,children:e.stopped})]}),e.exists&&e.status!==`superseded`&&(0,x.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,x.jsx)(Gb,{label:`Open the plan in the File tab: select lines to comment on them`,children:(0,x.jsxs)(J,{size:`sm`,variant:`outline`,onClick:()=>Yu(e.path),children:[(0,x.jsx)(Pp,{}),` Review`]})}),(0,x.jsx)(Gb,{label:`Edit the plan file yourself (saves as you type)`,children:(0,x.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:()=>Yu(e.path),children:[(0,x.jsx)(mm,{}),` Edit`]})}),(0,x.jsx)(`span`,{className:`ms-auto`}),T?(0,x.jsx)(Gb,{label:_.length?`Fix the ${_.length} problem${_.length===1?``:`s`} first (or Approve anyway in the menu)`:w?`Approve the changed plan and go on building`:`Approve the plan and start building phase 1`,children:(0,x.jsx)(`span`,{children:(0,x.jsx)(J,{size:`sm`,disabled:n||E||_.length>0,onClick:()=>void D(),children:w?`Approve again`:`Approve and build`})})}):e.status===`implementing`&&e.stopped&&!e.changedSinceApproval?(0,x.jsx)(J,{size:`sm`,disabled:n||E,onClick:()=>void O(),children:e.phase?`Build phase ${e.phase}`:`Continue building`}):null]})]})}function ZZ({errors:e,warnings:t,path:n}){let r=[...e,...t];return(0,x.jsxs)(`div`,{className:`mt-4 rounded-lg border border-border/70 bg-background/40 px-3 py-2 text-xs`,children:[(0,x.jsx)(`div`,{className:`mb-1 font-medium text-foreground`,children:e.length?`${e.length} problem${e.length===1?``:`s`} block Approve`:`${t.length} warning${t.length===1?``:`s`}`}),(0,x.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:r.slice(0,5).map((e,t)=>(0,x.jsxs)(`li`,{className:`flex min-w-0 items-start gap-1.5`,children:[(0,x.jsx)(`span`,{className:K(`mt-1 size-1.5 shrink-0 rounded-full`,e.severity===`error`?`bg-destructive`:`bg-warning`)}),(0,x.jsxs)(`span`,{className:`min-w-0 text-muted-foreground`,children:[e.line?(0,x.jsxs)(`button`,{type:`button`,className:`me-1 font-mono text-foreground/80 hover:underline`,onClick:()=>Yu(n,e.line),children:[`L`,e.line]}):null,e.message]})]},t))}),r.length>5&&(0,x.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`and `,r.length-5,` more`]})]})}function QZ({plan:e,written:t}){let n=e.status===`superseded`&&!t?`Plan superseded`:t?e.status===`superseded`?`Plan written (superseded)`:`Plan written`:`Plan revised`;return(0,x.jsxs)(`div`,{className:`flex min-h-6 items-center gap-1.5 px-0.5 py-0.5 text-sm text-secondary-label`,children:[(0,x.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center`,children:(0,x.jsx)(Of,{className:`size-4 text-icon-muted opacity-70`})}),(0,x.jsxs)(`span`,{className:`min-w-0 truncate`,children:[n,` ·`,` `,(0,x.jsx)(`button`,{type:`button`,onClick:()=>Yu(e.path),className:`font-mono text-[12.5px] hover:text-foreground hover:underline`,children:e.path})]})]})}function $Z({on:e}){return(0,x.jsx)(`span`,{"aria-hidden":!0,className:K(`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors`,e?`bg-primary`:`bg-foreground/15`),children:(0,x.jsx)(`span`,{className:K(`absolute size-3 rounded-full bg-white shadow-xs transition-transform`,e?`translate-x-3.5`:`translate-x-0.5`)})})}function eQ(e){return e.filter(e=>e.type===`file`).map(e=>({id:HS(e)||``,name:String(e.filename||`file`),mediaType:String(e.mediaType||``)})).filter(e=>e.id)}function tQ({items:e,projectId:t}){let n=e.filter(e=>NS(e.mediaType)),r=e.filter(e=>!NS(e.mediaType));if(!e.length)return null;let i=n.length===1;return(0,x.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[n.length>0&&(0,x.jsx)(`div`,{className:K(`grid`,i?`max-w-full`:`w-80 max-w-full grid-cols-2 gap-2`),children:n.map(e=>(0,x.jsxs)(`div`,{className:K(`group/media relative overflow-hidden rounded-2xl bg-background/70 ring-1 ring-[var(--bubble-ring)] ring-inset`,!i&&`aspect-[4/3]`),children:[(0,x.jsx)(`a`,{href:VS(t,e.id),target:`_blank`,rel:`noreferrer`,className:`block h-full w-full cursor-zoom-in`,"aria-label":`Open ${e.name}`,children:(0,x.jsx)(`img`,{src:VS(t,e.id),alt:e.name,loading:`lazy`,decoding:`async`,className:K(`block`,i?`h-48 w-auto max-w-full min-w-24 object-contain`:`size-full object-cover`)})}),(0,x.jsx)(zS,{projectId:t,ids:[e.id],className:`absolute bottom-1.5 left-1.5 opacity-0 transition-opacity group-hover/media:opacity-100 focus-visible:opacity-100`})]},e.id))}),r.map(e=>{let n=/\.([a-z0-9]{1,8})$/i.exec(e.name)?.[1]?.toUpperCase()||`File`;return(0,x.jsxs)(`div`,{className:`flex w-64 max-w-full items-center gap-1 rounded-2xl bg-message py-2 ps-2 pe-1 text-message-foreground ring-1 ring-[var(--bubble-ring)] ring-inset`,children:[(0,x.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,x.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-background/60`,children:(0,x.jsx)(vS,{path:e.name,className:`size-4`})}),(0,x.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,x.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:/^pasted-text(-\d+)?\.txt$/.test(e.name)?`Pasted text`:n})]})]}),(0,x.jsx)(zS,{projectId:t,ids:[e.id],variant:`ghost`,className:`size-6`}),(0,x.jsx)(Gb,{label:`Download ${e.name}`,children:(0,x.jsx)(`a`,{href:`${VS(t,e.id)}?download=1`,"aria-label":`Download ${e.name}`,className:`flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground [&_svg]:size-3.5`,children:(0,x.jsx)(gf,{})})})]},e.id)})]})}function nQ(e,t){let n=[],r=[],i=()=>{r.length&&(r.length===1?n.push({kind:`tool`,key:r[0].toolCallId,part:r[0]}):n.push({kind:`group`,key:r[0].toolCallId,parts:r}),r=[])};return e.parts.forEach((e,a)=>{if(typeof e.type==`string`&&e.type.startsWith(`tool-`)){let t=e;if(gZ(t)&&t.state!==`approval-requested`){r.push(t);return}i(),n.push({kind:`tool`,key:t.toolCallId,part:t})}else if(e.type===`text`){if(!e.text.trim())return;i(),n.push({kind:`text`,key:`t${a}`,text:e.text})}else if(e.type===`reasoning`){if(!e.text.trim())return;i(),n.push({kind:`reasoning`,key:`r${a}`,text:e.text,live:t&&e.state===`streaming`})}}),i(),n}function rQ({m:e,busy:t}){let{onRewind:n}=b.useContext(DZ),r=e.parts.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
293
|
+
`),{projectId:i}=Ki({strict:!1}),a=XS(i),o=b.useMemo(()=>new Map((a.data||[]).map(e=>[e.name,e.description])),[a.data]),s=/^(PLEASE IMPLEMENT (?:PHASE \S+ OF )?THIS PLAN \([^)]+\)):\n/.exec(r),[c,l]=b.useState(!1),u=eQ(e.parts);return(0,x.jsxs)(`div`,{className:`group flex flex-col items-end gap-1 pb-4`,"data-timeline-message":e.id,children:[i&&u.length>0&&(0,x.jsx)(tQ,{items:u,projectId:i}),(0,x.jsx)(`div`,{hidden:!r.trim()&&u.length>0,className:`max-w-[80%] rounded-2xl bg-message p-3 text-sm leading-relaxed break-words whitespace-pre-wrap text-message-foreground ring-1 ring-[var(--bubble-ring)] ring-inset`,children:s?(0,x.jsxs)(x.Fragment,{children:[s[1],(0,x.jsxs)(`button`,{type:`button`,onClick:()=>l(!c),className:`ms-1.5 inline-flex items-center gap-0.5 text-xs text-muted-foreground hover:text-foreground`,children:[c?`Hide the plan`:`Show the plan`,c?(0,x.jsx)(Vd,{className:`size-3`}):(0,x.jsx)(Ud,{className:`size-3`})]}),c&&(0,x.jsx)(`div`,{className:`mt-2 text-xs opacity-80`,children:r.slice(s[0].length)})]}):(0,x.jsx)(kS,{text:r,skills:o})}),(0,x.jsx)(jX,{at:e.metadata?.createdAt,text:r,busy:t,onRevert:()=>n(e.id)})]})}function iQ(e){let t=Math.max(1,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function aQ({label:e,at:t,open:n,onToggle:r,onUndo:i,usage:a}){return(0,x.jsx)(`div`,{className:`group/timeline-row border-b border-border/60 pt-1 pe-0.5 pb-2`,children:(0,x.jsxs)(`div`,{className:`relative flex items-center gap-1`,children:[(0,x.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:r,className:`flex cursor-pointer items-center gap-1 rounded-md px-1 text-sm leading-relaxed text-muted-foreground tabular-nums transition-colors select-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:outline-none focus-visible:ring-inset`,children:[(0,x.jsx)(`span`,{children:e}),(0,x.jsx)(n?Vd:Ud,{className:`size-3.5`})]}),i&&(0,x.jsxs)(`button`,{onClick:i,className:`ms-auto inline-flex items-center gap-1 rounded-md px-1 text-xs text-muted-foreground opacity-0 transition-opacity group-hover/timeline-row:opacity-100 hover:text-foreground`,children:[(0,x.jsx)(Am,{className:`size-3`}),` Undo turn`]}),a&&(0,x.jsxs)(`span`,{className:K(`text-xs text-muted-foreground tabular-nums opacity-0 transition-opacity group-hover/timeline-row:opacity-100`,!i&&`ms-auto`),children:[lQ(a.input),` in`,a.cachedInput?` (${lQ(a.cachedInput)} cached)`:``,` ·`,` `,lQ(a.output),` out`,typeof a.cost==`number`?` · ${uQ(a.cost)}`:``]}),t&&(0,x.jsx)(`span`,{className:K(`text-xs text-muted-foreground tabular-nums opacity-0 transition-opacity group-hover/timeline-row:opacity-100`,!i&&!a&&`ms-auto`),children:bu(t)})]})})}function oQ({m:e,streaming:t,onApprove:n,turnId:r,terminal:i}){let[a,o]=b.useState(!1),{onUndoTurn:s,plans:c,projectId:l,onBuild:u,busy:d}=b.useContext(DZ),f=nQ(e,t),p=r&&c?.length?c.filter(e=>e.turns.includes(r)).map(e=>e.turns[e.turns.length-1]===r&&e.status!==`superseded`&&!t?(0,x.jsx)(XZ,{plan:e,projectId:l,busy:!!d,onBuild:e=>u?.(e)},e.id):(0,x.jsx)(QZ,{plan:e,written:e.turns[0]===r},e.id)):null,m=e.parts.some(e=>[`tool-edit_file`,`tool-write_file`,`tool-delete_path`].includes(e.type)&&e.output?.editId),h=e.metadata?.createdAt,g=EX(f,{streaming:t,finished:!!e.metadata?.finishedAt}),_=[...e.parts].reverse().find(e=>e.type===`tool-workspace_push`&&e.state===`output-available`),v=e.metadata?.createdAt,y=e.metadata?.finishedAt,S=v&&y?`Worked for ${iQ(Date.parse(y)-Date.parse(v))}`:v?`You stopped this response`:`Worked`,C=e.metadata?.error?`failed`:v&&!y&&!t?`stopped`:null,w=f.filter(e=>e.kind===`text`).map(e=>e.text).join(`
|
|
294
|
+
|
|
295
|
+
`),T=g?f.filter((e,t)=>a||!g.has(t)):f,E=[...T].reverse().find(e=>e.kind===`text`),D=!!E&&T.indexOf(E)<T.length-1,O=i&&(w.trim()||C)?{at:y||v,text:w}:null,k=e=>{switch(e.kind){case`text`:return O&&e===E&&!D?(0,x.jsxs)(`div`,{className:`group/assistant relative min-w-0 px-1 py-0.5 pb-2`,children:[(0,x.jsx)(gX,{text:e.text}),(0,x.jsx)(MX,{className:`mt-1.5`,at:O.at,text:O.text,status:C})]},e.key):(0,x.jsx)(`div`,{className:`px-1 py-0.5 pb-2`,children:(0,x.jsx)(gX,{text:e.text})},e.key);case`reasoning`:return(0,x.jsx)(HZ,{text:e.text,live:e.live},e.key);case`tool`:return mZ(e.part)===`ask`?(0,x.jsx)(jZ,{part:e.part},e.key):(0,x.jsx)(BZ,{part:e.part,at:h,onApprove:(t,r)=>e.part.approval&&n(e.part.approval.id,t,r)},e.key);case`group`:return(0,x.jsx)(VZ,{parts:e.parts,at:h},e.key)}},A=O&&(D||!E)?(0,x.jsx)(`div`,{className:`px-1`,children:(0,x.jsx)(MX,{className:`mt-0.5`,at:O.at,text:O.text,status:C,alwaysVisible:!0})}):null,j=i&&C===`failed`&&!w.trim()?(0,x.jsx)(`div`,{className:`mx-1 mb-1 rounded-lg border border-destructive/30 bg-destructive/8 px-3 py-2 text-sm text-destructive-foreground`,children:e.metadata?.error}):null;return g?(0,x.jsxs)(`div`,{className:`flex flex-col pb-4`,"data-timeline-message":e.id,children:[(0,x.jsx)(aQ,{label:S,at:h,open:a,onToggle:()=>o(!a),onUndo:m&&r?()=>s(r):void 0,usage:e.metadata?.usage}),(0,x.jsxs)(`div`,{className:`pt-2`,children:[f.filter((e,t)=>a||!g.has(t)).map(k),!a&&_&&(0,x.jsx)(TZ,{part:_}),p,j,A]})]}):(0,x.jsxs)(`div`,{className:`flex flex-col pb-4`,"data-timeline-message":e.id,children:[f.map(k),p,j,A]})}function sQ(){let{plans:e,projectId:t,onBuild:n,busy:r}=b.useContext(DZ),i=(e||[]).filter(e=>e.turns.length===0&&e.status!==`superseded`);return i.length?(0,x.jsx)(`div`,{className:`pb-4`,children:i.map(e=>(0,x.jsx)(XZ,{plan:e,projectId:t,busy:!!r,onBuild:e=>n?.(e)},e.id))}):null}function cQ({since:e}){let[t,n]=b.useState(Date.now());return b.useEffect(()=>{let e=setInterval(()=>n(Date.now()),500);return()=>clearInterval(e)},[]),(0,x.jsx)(`div`,{className:`border-b border-border/60 pt-1 pb-2`,children:(0,x.jsx)(`div`,{className:`flex h-6 min-w-0 items-baseline gap-2 px-1 text-sm leading-relaxed text-muted-foreground tabular-nums`,children:(0,x.jsxs)(`span`,{className:`relative shrink-0 overflow-hidden whitespace-nowrap`,children:[`Working for `,Tu(t-e)]})})})}function lQ(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function uQ(e){return e===0?`$0.00`:e<.001?`<$0.001`:e<.1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function dQ({c:e,active:t}){let[n,r]=b.useState(!1),i=(0,x.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,x.jsx)(Rp,{"aria-hidden":!0,className:`size-3 shrink-0`}),e?(0,x.jsxs)(x.Fragment,{children:[`Compacted `,e.turns,` earlier turn`,e.turns===1?``:`s`,` `,lQ(e.before),(0,x.jsx)(_d,{"aria-hidden":!0,className:`size-3`}),lQ(e.after),` tokens`,(0,x.jsxs)(`span`,{className:`opacity-80`,children:[`· `,e.model.model,e.cost===null?``:` · ${uQ(e.cost)}`]})]}):`Compacting earlier turns…`]});return(0,x.jsxs)(`div`,{className:`py-1`,children:[(0,x.jsxs)(`div`,{role:`separator`,"aria-label":e?`Compacted ${e.turns} earlier turns`:`Compacting`,className:`flex w-full items-center gap-3 py-1 text-xs text-muted-foreground`,children:[(0,x.jsx)(`span`,{className:`h-px flex-1 bg-border/70`}),(0,x.jsxs)(`span`,{className:`relative min-w-0 overflow-hidden`,children:[i,t&&(0,x.jsx)(m8,{children:i})]}),e&&(0,x.jsx)(`button`,{onClick:()=>r(!n),className:`shrink-0 text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline`,children:n?`Hide summary`:`Show summary`}),(0,x.jsx)(`span`,{className:`h-px flex-1 bg-border/70`})]}),n&&e&&(0,x.jsx)(`div`,{className:`mx-auto mt-1 mb-2 max-w-[40rem] rounded-lg border bg-muted/40 px-3 py-2`,children:(0,x.jsx)(gX,{text:e.summary})})]})}function fQ({messages:e,running:t,runStarted:n,onApprove:r,error:i,compactions:a=[],compacting:o}){let s=b.useRef(null),c=b.useRef(!0),l=b.useRef(0);b.useLayoutEffect(()=>{let e=s.current;e&&c.current&&(e.scrollTop=e.scrollHeight)});let u=e[e.length-1],d=pQ(s,e);return(0,x.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,x.jsx)(`div`,{ref:s,onScroll:e=>{let t=e.currentTarget;Date.now()>l.current&&(c.current=t.scrollHeight-t.scrollTop-t.clientHeight<40),d.schedule()},className:`fade-top min-h-0 flex-1 overflow-y-auto px-3 sm:px-12`,children:(0,x.jsxs)(`div`,{className:`mx-auto w-full max-w-[var(--chat-max)] pt-4 pb-6`,"data-timeline-root":!0,children:[(0,x.jsx)(sQ,{}),e.map((n,i)=>(0,x.jsxs)(b.Fragment,{children:[n.role===`user`?(0,x.jsx)(rQ,{m:n,busy:t}):(0,x.jsx)(oQ,{m:n,streaming:t&&n===u,terminal:!(t&&n===u)&&(i===e.length-1||e[i+1]?.role===`user`),onApprove:r,turnId:[...e.slice(0,i)].reverse().find(e=>e.role===`user`)?.id}),a.filter(e=>e.upTo===n.id).map(e=>(0,x.jsx)(dQ,{c:e},`c${e.upTo}`))]},n.id)),o&&(0,x.jsx)(dQ,{active:!0}),t&&(0,x.jsx)(cQ,{since:n}),i&&(0,x.jsx)(`div`,{className:K(`mt-2 rounded-lg border border-destructive/30 bg-destructive/8 px-3 py-2 text-sm text-destructive-foreground`),children:i})]})}),(0,x.jsx)(uZ,{items:d.items,persistent:d.persistent,hitStrip:d.hitStrip,currentIndex:d.current,atEnd:d.atEnd,stripMap:d.stripMap,onWheel:e=>s.current&&cZ(e,s.current),onSelect:e=>{c.current=!1,l.current=Date.now()+1e3,d.select(e.id)}})]})}function pQ(e,t){let n=b.useMemo(()=>PX(t),[t]),[r]=b.useState(()=>new Map),[i,a]=b.useState(null),[o,s]=b.useState(!1),[c,l]=b.useState(0),u=b.useRef(null),d=b.useRef(n);d.current=n;let f=b.useCallback(()=>{let t=e.current;if(!t)return;let n=t.querySelector(`[data-timeline-root]`),i=t.getBoundingClientRect();n&&l(Math.floor(n.getBoundingClientRect().left-i.left));let o=d.current;if(!o.length)return;let c=[...t.querySelectorAll(`[data-timeline-message]`)],u=e=>{let t=null,n=null;return c.forEach((r,a)=>{let o=r.getBoundingClientRect();o.top<i.bottom&&o.bottom>i.top+e&&(t??=a,n=a)}),{start:t,end:n}},f=new Map(c.map((e,t)=>[e.dataset.timelineMessage,t])),p=o.map(e=>f.get(e.id)??e.rowIndex),m=u(0),h=new Map;o.forEach((e,t)=>{let n=r.get(e.id);if(!n)return;let i=QX(p[t],p[t+1],m.start,m.end);h.set(n,i||h.get(n)===!0)});for(let[e,t]of h)e.dataset.inView!==String(t)&&(e.dataset.inView=String(t));let g=u(25),_=$X({visibleStart:g.start,visibleEnd:g.end,rowIndices:p});a(e=>e===_?e:_),s(t.scrollHeight-t.scrollTop-t.clientHeight<=1)},[e,r]),p=b.useCallback(()=>{u.current===null&&(u.current=requestAnimationFrame(()=>{u.current=null,f()}))},[f]);return b.useEffect(()=>{p()},[t,p]),b.useEffect(()=>{let t=e.current;if(!t)return;let n=new ResizeObserver(p);n.observe(t);let r=t.querySelector(`[data-timeline-root]`);return r&&n.observe(r),()=>{n.disconnect(),u.current!==null&&cancelAnimationFrame(u.current)}},[e,p]),{items:n,stripMap:r,current:i,atEnd:o,persistent:eZ(c),hitStrip:tZ(c),schedule:p,select:t=>{let n=e.current,r=n?.querySelector(`[data-timeline-message="${CSS.escape(t)}"]`);if(!n||!r)return;let i=r.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop-24;n.scrollTo({top:i,behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`})}}}function mQ({chatId:e}){let t=ku(),n=U(t.agent.writes.queryOptions({chatId:e})),r=W(t.agent.answerWrite.mutationOptions()),[i,a]=b.useState(Date.now()),o=n.data||[];return b.useEffect(()=>{if(!o.length)return;let e=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(e)},[o.length]),o.length?(0,x.jsx)(`div`,{className:`mx-auto mb-2 flex w-full max-w-[var(--chat-max)] flex-col gap-2`,children:o.map(e=>(0,x.jsxs)(`div`,{className:`rounded-lg border bg-background p-3 text-xs shadow-xs/5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,x.jsx)(Jf,{className:`size-3.5 text-icon-muted`}),`The agent’s browser wants to write to the instance`,(0,x.jsxs)(`span`,{className:`ms-auto font-normal text-muted-foreground tabular-nums`,children:[`declines in `,Tu(Date.parse(e.expiresAt)-i)]})]}),(0,x.jsxs)(`div`,{className:`mt-1.5 font-mono text-[11.5px] text-foreground/85`,children:[e.method,` `,e.table?`${e.table}${e.sysId?`/${e.sysId}`:``}`:e.path,e.action?` · action ${e.action}`:``]}),e.fields&&e.fields.length>0&&(0,x.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`Fields: `,e.fields.join(`, `)]}),(0,x.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2`,children:[(0,x.jsx)(Xm,{className:`size-3 text-warning-foreground`}),(0,x.jsx)(`span`,{className:`text-warning-foreground`,children:`Waiting for approval`}),(0,x.jsx)(`span`,{className:`ms-auto`}),(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>r.mutate({id:e.id,approved:!1}),children:`Decline`}),(0,x.jsx)(J,{size:`xs`,onClick:()=>r.mutate({id:e.id,approved:!0}),children:`Approve`})]})]},e.id))}):null}var hQ=new Map,gQ=new Map,_Q=(e,t,n,r=[])=>hQ.set(e,{text:t,model:n,files:r}),vQ=(e,t=[])=>t.length?{text:e,files:t}:{text:e};function yQ(e){let t=mZ(e),n=e.input||{};return t===`delete_path`?`delete ${n.path}`:t===`shell`?`run ${String(n.command||``).slice(0,80)}`:`${t.replace(/_/g,` `)} ${n.path||``}`.trim()}function bQ({projectId:e,chatId:t}){let n=ku(),r=C(),i=U(n.chats.get.queryOptions({projectId:e,chatId:t})),a=U(n.projects.get.queryOptions({id:e})),o=W(n.chats.visit.mutationOptions()),s=b.useCallback(()=>{o.mutate({projectId:e,chatId:t},{onSuccess:()=>{r.invalidateQueries({queryKey:n.chats.list.queryKey({projectId:e})}),r.invalidateQueries({queryKey:n.chats.recent.pathKey()})}})},[e,t]);return b.useEffect(()=>s(),[s]),i.isLoading?(0,x.jsx)(`div`,{className:`flex-1`}):i.error?(0,x.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:i.error.message}):(0,x.jsx)(xQ,{projectId:e,chatId:t,title:i.data.title,projectName:a.data?.name||``,initial:i.data.messages,initialModel:i.data.model,initialSafety:i.data.safety,initialMode:i.data.interactionMode||`build`,serverRunning:i.data.running,onDone:()=>{r.invalidateQueries({queryKey:n.chats.get.queryKey({projectId:e,chatId:t})}),s()}},t)}function xQ({projectId:e,chatId:t,title:n,projectName:r,initial:i,initialModel:a,initialSafety:o,initialMode:s,serverRunning:c,onDone:l}){let u=ku(),d=C(),[f,p]=b.useState(a),m=b.useRef(f);m.current=f;let h=W(u.chats.setModel.mutationOptions()),g=W(u.chats.stop.mutationOptions()),_=W(u.chats.rewind.mutationOptions()),v=W(u.edits.undoTurn.mutationOptions()),y=Ji(),[S]=b.useState(()=>{let e=gQ.get(t)||``;return gQ.delete(t),e}),[w,T]=b.useState(o),E=W(u.chats.setSafety.mutationOptions()),[D,O]=b.useState(s),k=W(u.chats.setInteractionMode.mutationOptions()),A=U(u.plans.list.queryOptions({projectId:e,chatId:t})),j=W(u.plans.next.mutationOptions()),[M,N]=b.useState(Date.now()),[P,F]=b.useState(),I=TR({id:t,messages:i,transport:b.useMemo(()=>new fR({api:`/api/chat`,headers:()=>({"x-forge-token":_u()}),prepareSendMessagesRequest:({messages:t,id:n})=>({body:{projectId:e,chatId:n,message:t[t.length-1],model:m.current}}),fetch:(async(e,t)=>{let n=await fetch(e,t);if(!n.ok){let e=`Request failed (${n.status})`,t=``;try{let r=await n.clone().json();e=r.message||e,t=r.code||``}catch{}throw Object.assign(Error(e),{code:t})}return n})}),[e]),sendAutomaticallyWhen:mR,onError:e=>{F(e.message),e.code===`approval_expired`&&z()},onFinish:()=>{l(),L()}}),L=async()=>{for(let n=0;n<6;n++){await new Promise(e=>setTimeout(e,250+n*250));let r;try{r=await j.mutateAsync({projectId:e,chatId:t})}catch{return}if(d.invalidateQueries({queryKey:u.plans.list.pathKey()}),!(r.action===`none`&&r.running)){r.action===`continue`&&(N(Date.now()),I.sendMessage({text:r.text}));return}}},R=n=>{F(void 0),d.invalidateQueries({queryKey:u.plans.list.pathKey()}),n.chatId===t?(O(`build`),N(Date.now()),I.sendMessage({text:n.text})):(_Q(n.chatId,n.text,m.current),y({to:`/p/$projectId/c/$chatId`,params:{projectId:e,chatId:n.chatId}}))},z=async()=>{let n=await d.fetchQuery({...u.chats.get.queryOptions({projectId:e,chatId:t}),staleTime:0});I.setMessages(n.messages)},B=I.status===`submitted`||I.status===`streaming`;b.useEffect(()=>{let e=hQ.get(t);e&&(hQ.delete(t),e.model&&p(e.model),m.current=e.model,N(Date.now()),I.sendMessage(vQ(e.text,e.files)))},[t]);let ee=b.useMemo(()=>{let e=I.messages[I.messages.length-1];return!e||e.role!==`assistant`?null:e.parts.find(e=>e.state===`approval-requested`)},[I.messages]),V=ee?.approval?{id:ee.approval.id,summary:yQ(ee),always:mZ(ee)===`shell`&&/^command:/.test(ee.approval.requestReason||``)}:null,te=W(u.chats.answerSdk.mutationOptions({onError:e=>{F(e.message),z()}})),ne=(n,r,i)=>{F(void 0),n.startsWith(`sdk:`)?te.mutate({chatId:t,projectId:e,approvalId:n,approved:r,always:!!i}):(N(Date.now()),I.addToolApprovalResponse({id:n,approved:r,...i?{reason:`always`}:{}}))},re=([...I.messages].reverse().find(e=>e.metadata?.usage)?.metadata)?.usage?.context||0,ie=U(u.chats.get.queryOptions({projectId:e,chatId:t})),ae=U(u.chats.usage.queryOptions({projectId:e,chatId:t})),oe=U(u.chats.overlaps.queryOptions({projectId:e,chatId:t})),se=W(u.chats.compact.mutationOptions()),H=ae.data?.totals,ce=!!H&&H.cost>0,le=!!H&&!ce&&(H.apiEquivalent||0)>0,ue=!H||!H.calls?``:ce?uQ(H.cost):le?`~${uQ(H.apiEquivalent)}`:`${lQ(H.input+H.output)} tokens`,de=H?`This chat: ${lQ(H.input)} in (${lQ(H.cachedInput)} cached) · ${lQ(H.output)} out`+(le?` · API estimate ${uQ(H.apiEquivalent)} (subscription: no per-token charge)`:``)+(H.unpricedTokens?` · ${lQ(H.unpricedTokens)} tokens without a price (set one in Settings)`:``):``,fe=(oe.data||[]).length?(oe.data||[]).slice(0,2).map(e=>`${e.path.split(`/`).pop()} is also being changed by “${e.title}”`).join(` · `):void 0,pe=U(u.models.queryOptions()).data?.some(e=>e.connectionId===f?.connectionId&&e.kind===`claude-subscription`),me=U({...u.claude.status.queryOptions(),enabled:!!pe}),he=pe&&me.data?.limit?me.data.limit.message:void 0;return(0,x.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,x.jsx)(CQ,{title:n,projectName:r,projectId:e,chatId:t}),(0,x.jsx)(DZ.Provider,{value:{projectId:e,chatId:t,plans:A.data,onBuild:R,busy:B||!!c,onRewind:async n=>{F(void 0);try{let r=await _.mutateAsync({projectId:e,chatId:t,messageId:n});gQ.set(r.chatId,r.text),y({to:`/p/$projectId/c/$chatId`,params:{projectId:e,chatId:r.chatId}})}catch(e){F(e.message)}},onUndoTurn:async n=>{let r=await v.mutateAsync({projectId:e,chatId:t,turnId:n});!r.ok&&`conflictPath`in r&&F(`Undo stopped at ${r.conflictPath}: ${r.message}`)},onAnswer:(n,r)=>{F(void 0),I.messages[I.messages.length-1]?.metadata?.runner===`claude`?te.mutate({chatId:t,projectId:e,toolCallId:n,answer:r}):(N(Date.now()),Promise.resolve(I.addToolOutput({tool:`ask`,toolCallId:n,output:{answer:r}})).then(()=>I.sendMessage()))}},children:(0,x.jsx)(fQ,{messages:I.messages,running:B,runStarted:M,onApprove:ne,error:P,compactions:ie.data?.compactions||[],compacting:se.isPending})}),(0,x.jsxs)(`div`,{className:`px-3 pt-1.5 pb-3 sm:px-12 sm:pt-2 sm:pb-4`,children:[(0,x.jsx)(mQ,{chatId:t}),(0,x.jsx)(zC,{running:B||!!c,model:f,onModel:n=>{p(n),h.mutate({projectId:e,chatId:t,model:n})},onSend:(e,t)=>{F(void 0),N(Date.now()),I.sendMessage(vQ(e,t))},onStop:()=>{I.stop(),g.mutate({chatId:t})},initialText:S,safety:w,onSafety:n=>{T(n),E.mutate({projectId:e,chatId:t,safety:n})},mode:D,onMode:n=>{O(n),k.mutate({projectId:e,chatId:t,mode:n})},pending:B&&!V?.id.startsWith(`sdk:`)?null:V,onAnswer:(e,t)=>V&&ne(V.id,e,t),context:re?lQ(re):``,onCompact:async()=>{F(void 0);try{await se.mutateAsync({projectId:e,chatId:t})}catch(e){F(e.message)}},compacting:se.isPending,cost:ue,costTip:de,banner:c&&!B?`This chat is still running from before a reload. It appears when it finishes, or Stop it.`:fe||he})]})]})}function SQ({title:e,projectId:t,chatId:n}){let r=ku(),i=C(),a=Ji(),[o,s]=b.useState(!1),[c,l]=b.useState(!1),[u,d]=b.useState(!1),f=b.useRef(!1),p=b.useRef(null),m=W(r.chats.rename.mutationOptions({onSettled:()=>i.invalidateQueries({queryKey:r.chats.get.queryKey({projectId:t,chatId:n})})})),h=W(r.chats.delete.mutationOptions()),g=r=>{s(!1);let i=r.trim();i&&i!==e&&m.mutate({projectId:t,chatId:n,title:i})};if(o)return(0,x.jsx)(`input`,{autoFocus:!0,dir:`auto`,"aria-label":`Chat title`,defaultValue:e,onFocus:e=>e.currentTarget.select(),onBlur:e=>{f.current||g(e.currentTarget.value)},onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Enter`?(f.current=!0,g(e.currentTarget.value)):e.key===`Escape`&&(e.preventDefault(),f.current=!0,s(!1)))},className:`w-72 max-w-full min-w-0 rounded-sm bg-transparent px-1 text-sm font-medium text-foreground ring-1 ring-ring/50 outline-none ring-inset focus:ring-ring`});let _=()=>{p.current&&clearTimeout(p.current),f.current=!1,d(!1),s(!0)};return(0,x.jsxs)(Pb,{open:u,onOpenChange:e=>{e||(d(!1),l(!1))},children:[(0,x.jsxs)(Fb,{render:(0,x.jsx)(`button`,{type:`button`,title:e,"aria-label":`Chat actions for ${e}`,onClick:e=>{if(!(e.detail>1)){if(p.current&&clearTimeout(p.current),e.detail===0)return d(!0);p.current=setTimeout(()=>d(!0),220)}},onDoubleClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||_()},className:`group/title inline-flex max-w-full min-w-0 cursor-pointer items-center gap-1 rounded-sm text-left focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-hidden focus-visible:ring-inset`}),children:[(0,x.jsx)(`h2`,{className:`min-w-0 truncate text-foreground`,children:e}),(0,x.jsx)(Vd,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/title:opacity-100 group-focus-visible/title:opacity-100`})]}),(0,x.jsxs)(Ib,{align:`start`,sideOffset:4,children:[(0,x.jsxs)(Lb,{onClick:_,children:[(0,x.jsx)(mm,{}),` Rename`]}),(0,x.jsx)(zb,{}),(0,x.jsxs)(Lb,{closeOnClick:c,onClick:()=>{if(!c)return l(!0);h.mutate({projectId:t,chatId:n},{onSuccess:()=>a({to:`/p/$projectId`,params:{projectId:t}})})},className:`text-destructive data-[highlighted]:text-destructive`,children:[(0,x.jsx)(vh,{}),` `,c?`Click again to delete`:`Delete chat`]})]})]})}function CQ({title:e,projectName:t,projectId:n,chatId:r}){let i=Wu();return(0,x.jsxs)(`header`,{className:`flex h-[var(--topbar-h)] shrink-0 items-center gap-2 px-3 sm:px-5`,children:[!i.sidebarOpen&&(0,x.jsx)(Gb,{label:`Show sidebar`,children:(0,x.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:()=>Uu({sidebarOpen:!0}),children:(0,x.jsx)(im,{})})}),(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium sm:gap-3`,children:[(0,x.jsx)(`span`,{className:`truncate text-muted-foreground`,children:t}),(0,x.jsx)(`span`,{className:`text-icon-muted`,children:`/`}),r?(0,x.jsx)(SQ,{title:e,projectId:n,chatId:r}):(0,x.jsx)(`span`,{className:`truncate text-foreground`,children:e})]}),(0,x.jsx)(`div`,{className:`ms-2 min-w-0 flex-1`,children:(0,x.jsx)(A8,{projectId:n})}),(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,x.jsx)(Gb,{label:`Check the workspace (Push plan tab)`,children:(0,x.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`Check`,onClick:()=>Uu({panelOpen:!0,panelTab:`plan`}),children:(0,x.jsx)(qd,{})})}),(0,x.jsx)(Gb,{label:`Push to the instance (review the plan first)`,children:(0,x.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`Push`,onClick:()=>Uu({pushOpen:!0}),children:(0,x.jsx)(Sh,{})})}),(0,x.jsx)(`span`,{className:`mx-1 h-4 w-px bg-border`,"aria-hidden":!0}),(0,x.jsx)(Gb,{label:`Terminal (${Eu?`⌘`:`Ctrl`}+\`)`,children:(0,x.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`Toggle terminal`,"aria-pressed":i.drawerOpen,onClick:()=>Uu({drawerOpen:!i.drawerOpen}),className:i.drawerOpen?`bg-accent [&_svg]:text-foreground`:``,children:(0,x.jsx)(nm,{})})}),(0,x.jsx)(Gb,{label:`Toggle the right panel`,children:(0,x.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-pressed":i.panelOpen,onClick:()=>Uu({panelOpen:!i.panelOpen}),className:i.panelOpen?`bg-accent [&_svg]:text-foreground`:``,children:(0,x.jsx)(om,{})})})]})]})}function wQ(e){let t=ku(),n=Ji(),r=W(t.chats.create.mutationOptions());return async(t,i,a=[])=>{let o=await r.mutateAsync({projectId:e});_Q(o.id,t,i,a),n({to:`/p/$projectId/c/$chatId`,params:{projectId:e,chatId:o.id}})}}var TQ=500,EQ=new Map,DQ=new Set,OQ=0,kQ=(e,t)=>`${e}\u0000${t}`;function AQ(){OQ+=1;for(let e of DQ)e()}async function jQ(e){if(e.saving||e.latest===null||e.problem)return;e.saving=!0;let t=e.latest;try{e.baseHash=(await Du.files.write.mutate({projectId:e.projectId,path:e.path,content:t,baseHash:e.baseHash})).hash,e.latest===t&&(e.latest=null)}catch(t){let n=t;e.problem={kind:n.data?.code===`CONFLICT`?`conflict`:`failed`,message:n.message||`The file could not be saved`}}finally{e.saving=!1,AQ()}e.latest!==null&&!e.problem&&!e.timer&&jQ(e)}function MQ(e,t,n){let r=kQ(e,t),i=EQ.get(r);i?i.latest===null&&!i.saving&&(i.baseHash=n):EQ.set(r,{projectId:e,path:t,baseHash:n,latest:null,timer:null,saving:!1,problem:null})}function NQ(e,t,n){let r=EQ.get(kQ(e,t));r&&(r.latest=n,r.timer&&clearTimeout(r.timer),r.timer=setTimeout(()=>{r.timer=null,jQ(r)},TQ),AQ())}function PQ(e,t){let n=EQ.get(kQ(e,t));n&&(n.timer&&=(clearTimeout(n.timer),null),jQ(n))}function FQ(e,t,n,r){let i=EQ.get(kQ(e,t));i&&(i.problem=null,n===`reload`?(i.latest=null,i.timer&&clearTimeout(i.timer),i.timer=null,EQ.delete(kQ(e,t)),AQ()):(r!==void 0&&(i.baseHash=r),AQ(),jQ(i)))}function IQ(e,t){let n=EQ.get(kQ(e,t));return!!n&&(n.latest!==null||n.saving)}function LQ(e,t){return EQ.get(kQ(e,t))?.latest??null}function RQ(e){return DQ.add(e),()=>DQ.delete(e)}function zQ(){return(0,b.useSyncExternalStore)(RQ,()=>OQ)}function BQ(e,t){return zQ(),EQ.get(kQ(e,t))?.problem??null}typeof window<`u`&&window.addEventListener(`pagehide`,()=>{for(let e of EQ.values())e.latest!==null&&PQ(e.projectId,e.path)});var VQ=700;function HQ(e){return e?1:.35}function UQ({frame:e,pointer:t}){let n=b.useRef(null),[r,i]=b.useState(0);b.useLayoutEffect(()=>{let e=n.current;if(!e)return;let t=new ResizeObserver(()=>i(e.clientWidth));return t.observe(e),i(e.clientWidth),()=>t.disconnect()},[]);let a=e.width?r/e.width:1;return(0,x.jsxs)(`div`,{className:`relative max-w-full`,children:[(0,x.jsx)(`img`,{ref:n,src:`data:image/jpeg;base64,${e.data}`,alt:`Live view of the agent’s browser`,className:`block max-w-full rounded-lg border bg-white shadow-xs/5`,style:{aspectRatio:`${e.width} / ${e.height}`}}),t&&r?(0,x.jsx)(WQ,{phase:t.phase,sequence:t.sequence,left:t.x*a+1,top:t.y*a+1}):null]})}function WQ({phase:e,sequence:t,left:n,top:r}){let[i,a]=b.useState(null);return b.useEffect(()=>{let e=window.setTimeout(()=>a(t),VQ);return()=>window.clearTimeout(e)},[t]),(0,x.jsxs)(`div`,{className:`pointer-events-none absolute top-0 left-0 z-40 transition-[opacity,transform] duration-150 ease-out motion-reduce:transition-none`,style:{opacity:HQ(i!==t),transform:`translate3d(${n}px, ${r}px, 0)`},"aria-hidden":`true`,"data-agent-cursor":!0,children:[e===`click`?(0,x.jsx)(`span`,{className:`absolute top-0.5 left-0.5 size-4 animate-status-ping rounded-full bg-primary/25 motion-reduce:animate-none`},t):null,(0,x.jsx)(Wp,{className:`relative size-5 -translate-x-0.5 -translate-y-0.5 fill-background stroke-2 text-primary drop-shadow-sm`})]})}function GQ({projectId:e}){let t=ku(),n=U(t.agent.info.queryOptions({projectId:e})),r=W(t.agent.openWindow.mutationOptions()),[i,a]=b.useState(null),[o,s]=b.useState(null),c=!!n.data?.running;return Fc(t.agent.frames.subscriptionOptions({projectId:e},{enabled:c&&n.data?.headless!==!1,onData:e=>`pointer`in e?s(e.pointer):a(e)})),c?(0,x.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,x.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b px-2`,children:[(0,x.jsx)(Xb,{variant:`info`,children:`Read-only`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground`,children:i?.url||``}),n.data?.headless===!1?(0,x.jsxs)(J,{size:`xs`,variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({projectId:e,headless:!0}),children:[(0,x.jsx)(Sf,{}),` Back to headless`]}):(0,x.jsxs)(J,{size:`xs`,variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({projectId:e,headless:!1}),children:[(0,x.jsx)(pd,{}),` Open window`]})]}),(0,x.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start justify-center overflow-auto bg-muted p-3`,children:n.data?.headless===!1?(0,x.jsx)(Dx,{icon:pd,title:`Showing in a window`,children:`The agent’s browser is open as a window on your desktop. Switch back to headless to watch it here.`}):i?(0,x.jsx)(UQ,{frame:i,pointer:o}):(0,x.jsxs)(`div`,{className:`flex h-full items-center gap-2 text-xs text-muted-foreground`,children:[(0,x.jsx)(g8,{size:`sm`,muted:!0}),` Waiting for the first frame…`]})})]}):(0,x.jsx)(Dx,{icon:Kp,title:`The agent’s browser`,children:`It starts the first time the agent opens a page of the preview. Here you watch it live: it looks and clicks, and it can’t change instance data unless you allow browser writes for the chat.`})}var KQ=b.lazy(()=>UY(()=>import(`./terminal-view-Co0jXSWF.js`),__vite__mapDeps([10,11])));function qQ({projectId:e,autoCreate:t}){let n=ku(),r=C(),i=Wu(),a=U(n.terminals.list.queryOptions({projectId:e})),o=W(n.terminals.create.mutationOptions({onSuccess:t=>{r.invalidateQueries({queryKey:n.terminals.list.queryKey({projectId:e})}),Uu({activeTerminal:t.id})}})),s=W(n.terminals.close.mutationOptions({onSuccess:()=>r.invalidateQueries({queryKey:n.terminals.list.queryKey({projectId:e})})})),c=a.data||[],l=c.find(e=>e.id===i.activeTerminal)||c.filter(e=>e.kind===`shell`)[0]||c[0];return b.useEffect(()=>{t&&a.data&&!a.data.some(e=>e.kind===`shell`)&&!o.isPending&&o.mutate({projectId:e})},[t,a.data]),(0,x.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,x.jsx)(`div`,{className:`relative min-w-0 flex-1`,children:l?(0,x.jsx)(b.Suspense,{fallback:(0,x.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,x.jsx)(g8,{size:`sm`,muted:!0})}),children:(0,x.jsx)(KQ,{sessionId:l.id},l.id)}):a.isLoading?null:(0,x.jsx)(Dx,{icon:ih,title:`No terminal yet`,children:`A shell in the project folder. The agent’s commands show here too, read-only, while they run.`})}),(0,x.jsxs)(`div`,{className:`flex w-36 shrink-0 flex-col border-l border-border/80 py-1`,children:[c.map(e=>(0,x.jsxs)(`div`,{className:K(`group mx-1 flex h-[22px] cursor-pointer items-center gap-1.5 rounded px-1.5 text-2xs`,e.id===l?.id?`bg-accent text-foreground`:`text-muted-foreground hover:bg-accent/60`),onClick:()=>Uu({activeTerminal:e.id}),title:e.title,children:[e.kind===`command`?(0,x.jsx)(wf,{className:`size-3 shrink-0`}):(0,x.jsx)(ih,{className:`size-3 shrink-0`}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:e.title}),e.exitCode!==null&&(0,x.jsx)(`span`,{className:K(`tabular-nums`,e.exitCode?`text-destructive-foreground`:`text-success-foreground`),children:e.exitCode}),(0,x.jsx)(`button`,{"aria-label":`Close`,onClick:t=>{t.stopPropagation(),s.mutate({id:e.id})},className:`hidden size-4 items-center justify-center rounded text-muted-foreground group-hover:inline-flex hover:text-foreground`,children:(0,x.jsx)(Oh,{className:`size-3`})})]},e.id)),(0,x.jsx)(Gb,{label:`New terminal`,children:(0,x.jsxs)(`button`,{onClick:()=>o.mutate({projectId:e}),className:`mx-1 mt-0.5 flex h-[22px] items-center gap-1.5 rounded px-1.5 text-2xs text-muted-foreground hover:bg-accent/60 hover:text-foreground`,children:[(0,x.jsx)(wm,{className:`size-3`}),` New`]})})]})]})}function JQ({projectId:e}){let t=Wu();return t.drawerOpen?(0,x.jsxs)(`div`,{className:`relative shrink-0 border-t border-border/80 bg-background`,style:{height:t.drawerHeight},children:[(0,x.jsx)(`div`,{onPointerDown:e=>{e.preventDefault();let t=e=>{let t=window.innerHeight-e.clientY;Uu({drawerHeight:Math.min(window.innerHeight*.75,Math.max(180,t))})},n=()=>{window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerup`,n),document.body.style.cursor=``};document.body.style.cursor=`row-resize`,window.addEventListener(`pointermove`,t),window.addEventListener(`pointerup`,n)},className:`group absolute -top-2 left-0 z-10 flex h-4 w-full cursor-row-resize items-center`,children:(0,x.jsx)(`div`,{className:`h-0.5 w-full transition-colors group-hover:bg-border`})}),(0,x.jsx)(qQ,{projectId:e,autoCreate:!0})]}):null}var YQ={layout:`stacked`,ignoreWhitespace:!1,colors:`red-green`};function XQ(){let e=U(ku().settings.get.queryOptions());return{...YQ,...e.data?.diffs||{}}}var ZQ=b.lazy(()=>UY(()=>import(`./diff-view-rgZLuZMg.js`),__vite__mapDeps([8,9,3,1,5])));function QQ({projectId:e}){let t=ku(),n=Wu(),r=XQ().layout===`split`,i=W(t.settings.setDiffs.mutationOptions()),{chatId:a=``}=Ki({strict:!1}),o=n.diffScope,s=U(t.diffs.files.queryOptions({projectId:e,chatId:a,scope:o})),c=s.data||[],l=c.find(e=>e.path===n.diffPath)||c[0],u=U({...t.diffs.file.queryOptions({projectId:e,chatId:a,scope:o,path:l?.path||``}),enabled:!!l}),d=W(t.diffs.accept.mutationOptions()),f=W(t.diffs.revert.mutationOptions());return(0,x.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,x.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-1 border-b px-2`,children:[(0,x.jsx)(`div`,{className:`inline-flex rounded-md bg-accent p-0.5`,children:[{id:`turn`,label:`This turn`},{id:`session`,label:`Session`},{id:`instance`,label:`vs instance`},{id:`head`,label:`vs git HEAD`}].map(e=>(0,x.jsx)(`button`,{onClick:()=>Uu({diffScope:e.id}),className:K(`h-5 rounded px-2 text-2xs`,o===e.id?`bg-background font-medium text-foreground shadow-xs/5`:`text-muted-foreground hover:text-foreground`),children:e.label},e.id))}),(0,x.jsx)(`span`,{className:`ms-auto`}),(0,x.jsx)(`div`,{className:`inline-flex rounded-md bg-accent p-0.5`,children:[`unified`,`split`].map(e=>(0,x.jsx)(`button`,{onClick:()=>i.mutate({layout:e===`split`?`split`:`stacked`}),className:K(`h-5 rounded px-2 text-2xs capitalize`,r===(e===`split`)?`bg-background font-medium text-foreground shadow-xs/5`:`text-muted-foreground hover:text-foreground`),children:e},e))})]}),s.isLoading?(0,x.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,x.jsx)(g8,{size:`sm`,muted:!0})}):c.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`max-h-[40%] shrink-0 overflow-y-auto border-b py-1`,children:c.map(t=>(0,x.jsxs)(`div`,{onClick:()=>Uu({diffPath:t.path}),className:K(`group mx-1 flex h-7 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px]`,t.path===l?.path?`bg-accent`:`hover:bg-accent/60`),children:[(0,x.jsx)(Gb,{label:t.origin===`outside`?`Changed outside Forge`:t.origin===`git`?`git status`:`Edited by the agent`,children:(0,x.jsx)(`span`,{className:`flex size-4 items-center justify-center text-icon-muted`,children:t.origin===`outside`?(0,x.jsx)(Qf,{className:`size-3.5`}):(0,x.jsx)(nh,{className:`size-3.5`})})}),(0,x.jsx)(`span`,{className:K(`min-w-0 flex-1 truncate font-mono text-xs`,t.status===`deleted`&&`line-through opacity-70`),children:t.path}),t.status!==`modified`&&(0,x.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:t.status}),(0,x.jsx)(NZ,{added:t.added,removed:t.removed}),o===`session`&&a&&(0,x.jsxs)(`span`,{className:`hidden items-center gap-1 group-hover:flex`,children:[(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,onClick:n=>{n.stopPropagation(),f.mutate({projectId:e,chatId:a,path:t.path})},children:`Revert`}),(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:n=>{n.stopPropagation(),d.mutate({projectId:e,chatId:a,path:t.path})},children:`Accept`})]})]},t.path))}),(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[l&&(0,x.jsxs)(`div`,{className:`flex h-8 items-center gap-2 border-b px-3 text-xs`,children:[(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:l.path}),l.status!==`deleted`&&(0,x.jsx)(J,{size:`xs`,variant:`ghost`,onClick:()=>Yu(l.path),children:`Edit`})]}),u.data?(0,x.jsx)(b.Suspense,{fallback:(0,x.jsx)(`div`,{className:`flex h-20 items-center justify-center`,children:(0,x.jsx)(g8,{size:`sm`,muted:!0})}),children:(0,x.jsx)(ZQ,{path:u.data.path,oldText:u.data.old,newText:u.data.new,split:r})}):null]})]}):(0,x.jsx)(Dx,{icon:Ef,title:`No changes`,children:o===`head`?`Nothing differs from git HEAD (or this folder isn’t a git repository).`:o===`instance`?`The files match the instance base (the last pull or push), or this folder has no base yet.`:a?`The agent’s edits in this chat show here, with undo.`:`Open a chat to see its changes.`})]})}var $Q=`flex h-10 min-h-10 shrink-0 items-center gap-2 border-b border-border/60 bg-background px-3`;function e$({label:e,pressed:t,disabled:n,onPress:r,children:i}){return(0,x.jsx)(Gb,{label:e,children:(0,x.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":t,"data-pressed":t?``:void 0,disabled:n,onClick:r,className:K(`relative inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md text-foreground outline-none transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:pointer-events-none disabled:text-muted-foreground [&_svg]:size-3.5 [&_svg]:opacity-80`,t&&`bg-accent text-accent-foreground [&_svg]:opacity-100`),children:i})})}function t$({className:e}){return(0,x.jsx)(`div`,{role:`status`,"aria-label":`Loading file`,className:K(`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,e),children:(0,x.jsx)(g8,{size:`lg`})})}function n$({message:e,onRetry:t}){return(0,x.jsxs)(`div`,{role:`alert`,className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 text-center text-xs leading-relaxed`,children:[(0,x.jsx)(`p`,{className:`text-destructive-foreground`,children:e}),t&&(0,x.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer rounded-md border border-input px-2.5 py-1 text-xs text-foreground hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:`Try again`})]})}function r$({tone:e=`warning`,children:t}){return(0,x.jsx)(`div`,{role:`status`,className:K(`flex shrink-0 items-center gap-2 border-b px-3 py-1.5 text-[11px]`,e===`warning`&&`border-warning/20 bg-warning/8 text-warning-foreground`,e===`error`&&`border-destructive/20 bg-destructive/8 text-destructive-foreground`,e===`muted`&&`text-muted-foreground`),children:t})}function i$({at:e,items:t,onPick:n,onClose:r}){let i=b.useMemo(()=>e?{getBoundingClientRect:()=>DOMRect.fromRect({x:e.x,y:e.y,width:0,height:0})}:null,[e]);return(0,x.jsx)(d6,{open:!!e,onOpenChange:e=>!e&&r(),children:(0,x.jsx)(a3,{children:(0,x.jsx)(Y3,{anchor:i,side:`bottom`,align:`start`,sideOffset:2,className:`z-50 outline-none`,children:(0,x.jsx)(n3,{className:`glass min-w-44 origin-[var(--transform-origin)] rounded-lg p-1 text-sm outline-none transition-[opacity,scale] duration-150 data-[ending-style]:scale-98 data-[ending-style]:opacity-0 data-[starting-style]:scale-98 data-[starting-style]:opacity-0`,children:t.map(e=>(0,x.jsxs)(b.Fragment,{children:[e.separated&&(0,x.jsx)(w6,{className:`mx-2 my-1 h-px bg-border`}),(0,x.jsx)(B1,{disabled:e.disabled,onClick:()=>n(e.id),className:`flex min-h-7 cursor-default items-center gap-2 rounded-sm px-2 py-1 outline-none select-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent`,children:e.label})]},e.id))})})})})}function a$(e){return e.files&&Object.keys(e.files).length?Object.entries(e.files).map(([e,t])=>`${e} ${t}`).join(`, `):[e.change,e.renamedFrom&&`from ${e.renamedFrom}`,e.renamedTo&&`to ${e.renamedTo}`,e.note].filter(Boolean).join(` · `)}function o$({projectId:e}){let t=ku(),n=U(t.push.state.queryOptions({projectId:e})),r=W(t.push.status.mutationOptions()),i=W(t.push.check.mutationOptions()),a=W(t.push.resolve.mutationOptions({onSuccess:()=>r.mutate({projectId:e})})),[o,s]=b.useState(``);b.useEffect(()=>{r.mutate({projectId:e})},[e]);let c=n.data?.push?.at;b.useEffect(()=>{c&&r.mutate({projectId:e})},[c]);let l=r.data,u=i.data,d=n.data?.plan,f=n.data?.push,p=a.isPending?a.variables?.keys[0]:``,m=(t,n,r,i)=>(0,x.jsx)(Gb,{label:i,children:(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,disabled:!!p,onClick:r=>{r.stopPropagation(),a.mutate({projectId:e,keys:[t],action:n})},children:r})}),h=(t,n,r,i={})=>n&&n.length>0?(0,x.jsxs)(`section`,{children:[(0,x.jsxs)(`div`,{className:K(`mb-1 px-2 text-xs font-medium`,r),children:[t,` `,(0,x.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:n.length})]}),(0,x.jsx)(`div`,{className:`flex flex-col`,children:n.slice(0,200).map(t=>(0,x.jsxs)(b.Fragment,{children:[(0,x.jsxs)(`div`,{onClick:i.expandable?()=>s(o===t.key?``:t.key):void 0,className:K(`group flex h-7 items-center gap-2 rounded-md px-2 text-[13px] hover:bg-accent/60`,i.expandable&&`cursor-pointer`),children:[i.expandable&&(0,x.jsx)(Ud,{className:K(`size-3 shrink-0 text-icon-muted/70 transition-transform duration-200`,o===t.key&&`rotate-90`)}),(0,x.jsx)(`span`,{className:`min-w-0 shrink truncate font-mono text-xs`,children:t.key}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:a$(t)}),t.updatedBy&&(0,x.jsx)(`span`,{className:`shrink-0 text-2xs text-muted-foreground group-hover:hidden`,children:t.updatedBy}),p===t.key&&(0,x.jsx)(g8,{size:`xs`,muted:!0}),i.actions&&(0,x.jsx)(`span`,{className:`hidden gap-0.5 group-hover:flex`,children:i.actions(t.key)})]}),i.expandable&&o===t.key&&(0,x.jsx)(c$,{projectId:e,entry:t})]},t.key))})]}):null;return(0,x.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,x.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-1.5 border-b px-2`,children:[(0,x.jsxs)(J,{size:`xs`,variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({projectId:e}),children:[r.isPending?(0,x.jsx)(g8,{size:`xs`}):(0,x.jsx)(Om,{}),` Status`]}),(0,x.jsxs)(J,{size:`xs`,variant:`outline`,disabled:i.isPending,onClick:()=>i.mutate({projectId:e}),children:[i.isPending?(0,x.jsx)(g8,{size:`xs`}):(0,x.jsx)(qd,{}),` Check`]}),(0,x.jsx)(Gb,{label:`Diff the files against the instance base (the last pull or push)`,children:(0,x.jsxs)(J,{size:`xs`,variant:`ghost-muted`,onClick:()=>Uu({panelTab:`diff`,diffScope:`instance`}),children:[(0,x.jsx)(Ef,{}),` vs instance`]})}),(0,x.jsx)(`span`,{className:`ms-auto`}),(0,x.jsxs)(J,{size:`xs`,disabled:n.data?.running,onClick:()=>Uu({pushOpen:!0}),children:[n.data?.running?(0,x.jsx)(g8,{size:`xs`}):(0,x.jsx)(Sh,{}),` Plan push…`]})]}),(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-1 py-3 text-sm`,children:[r.error&&(0,x.jsx)(`div`,{className:`mx-2 mb-3 rounded-lg border border-destructive/30 bg-destructive/6 px-3 py-2 text-xs text-destructive-foreground`,children:r.error.message}),r.isPending&&!l&&(0,x.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,x.jsx)(g8,{size:`sm`,muted:!0})}),l&&(0,x.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-1.5 px-2`,children:[l.clean?(0,x.jsx)(Xb,{variant:`success`,children:`clean`}):(0,x.jsx)(Xb,{variant:`warning`,children:`changes`}),[`local`,`instance`,`conflicts`].map(e=>l.counts?.[e]?(0,x.jsxs)(Xb,{variant:e===`conflicts`?`error`:`outline`,children:[l.counts[e],` `,e===`conflicts`&&l.counts[e]===1?`conflict`:e]},e):null),(0,x.jsxs)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:[[l.on,l.app,l.updateSet].filter(Boolean).join(` · `),l.syncedAt?` · synced ${yu(l.syncedAt)}`:``]})]}),l&&l.clean&&!u&&(0,x.jsx)(Dx,{icon:qd,title:`In sync with the instance`,children:`The files match the instance base. Edits show here as local changes, ready to push.`}),(0,x.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[h(`Conflicts`,l?.conflicts,`text-destructive-foreground`,{expandable:!0,actions:e=>(0,x.jsxs)(x.Fragment,{children:[m(e,`take-local`,`Keep mine`,`Keep the files; the next push overwrites the instance`),m(e,`take-instance`,`Take instance`,`Replace the files with the instance’s version`),m(e,`merge`,`Merge`,`Three-way merge; leaves conflict markers where both changed`)]})}),h(`Local changes (to push)`,l?.local,`text-info-foreground`),h(`Instance changes (a pull takes them)`,l?.instance,`text-warning-foreground`,{actions:e=>m(e,`take-instance`,`Take instance`,`Bring this change into the files`)}),(l?.hints||[]).map(e=>(0,x.jsxs)(`div`,{className:`mx-2 text-xs text-muted-foreground`,children:[`· `,e]},e)),(l?.markers||[]).length>0&&(0,x.jsxs)(`div`,{className:`mx-2 text-xs text-warning-foreground`,children:[`Conflict markers left in: `,l.markers.join(`, `)]})]}),a.error&&(0,x.jsx)(`div`,{className:`mx-2 mt-2 text-xs text-destructive-foreground`,children:a.error.message}),i.error&&(0,x.jsx)(`div`,{className:`mx-2 mt-3 text-xs text-destructive-foreground`,children:i.error.message}),u&&(0,x.jsx)(s$,{c:u}),(d||f)&&(0,x.jsxs)(`div`,{className:`mx-2 mt-4 flex flex-col gap-1 border-t pt-3 text-xs text-muted-foreground`,children:[d&&(0,x.jsxs)(`div`,{children:[`Latest dry run `,yu(d.at),`:`,` `,(0,x.jsx)(`span`,{className:`font-mono`,children:d.result?.planHash||`—`}),d.stale&&(0,x.jsx)(`span`,{className:`text-warning-foreground`,children:` · files changed since`})]}),f&&(0,x.jsxs)(`div`,{children:[`Last push `,yu(f.at),`:`,` `,f.result.failed?`failed in chunk ${f.result.failed.chunk} of ${f.result.failed.of}`:f.result.refused?`refused (${f.result.reason})`:`${f.result.pushed} written`,f.commit?` · git: ${f.commit.message}`:``]})]})]})]})}function s$({c:e}){let t=e.local?.prettier?.unformatted||[],n=e.instance?.compiles||[],r=n.filter(e=>!e.ok);return(0,x.jsxs)(`div`,{className:`mx-2 mt-4 rounded-lg border p-3`,children:[(0,x.jsxs)(`div`,{className:K(`flex items-center gap-2 font-medium`,e.ok?`text-success-foreground`:`text-warning-foreground`),children:[e.ok?(0,x.jsx)(qd,{className:`size-4`}):(0,x.jsx)(Zd,{className:`size-4`}),e.ok?`Check passed`:`Check found ${e.problems.length} problem${e.problems.length===1?``:`s`}`,e.ms?(0,x.jsxs)(`span`,{className:`ms-auto text-xs font-normal text-muted-foreground`,children:[(e.ms/1e3).toFixed(1),` s`]}):null]}),(e.problems||[]).map((e,t)=>(0,x.jsxs)(`div`,{className:`mt-1 text-xs`,children:[`· `,e]},t)),t.length>0&&(0,x.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Not Prettier-formatted: `,(0,x.jsx)(`span`,{className:`font-mono`,children:t.join(`, `)})]}),r.map((e,t)=>(0,x.jsxs)(`div`,{className:`mt-1 font-mono text-xs text-destructive-foreground`,children:[e.component||e.uid,`: `,e.error||e.message||`does not compile`]},t)),e.ok&&(0,x.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Prettier, lint, `,n.length,` compile`,n.length===1?``:`s`,` on the instance, the dry run`,e.updateSet?` and the update set`:``,`: all clear.`]})]})}function c$({projectId:e,entry:t}){let n=U(ku().push.diff.queryOptions({projectId:e,keys:[t.key]})),r=n.data?.entries||[];return(0,x.jsxs)(`div`,{className:`ms-7 me-2 mb-2 rounded-lg border bg-muted/30 p-2 text-xs`,children:[n.isLoading&&(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,x.jsx)(g8,{size:`xs`,muted:!0}),` Reading both sides…`]}),n.error&&(0,x.jsx)(`div`,{className:`text-destructive-foreground`,children:n.error.message}),!n.isLoading&&!r.length&&!n.error&&(0,x.jsx)(`div`,{className:`text-muted-foreground`,children:`No content difference to show (metadata only).`}),r.map(e=>(0,x.jsxs)(`div`,{className:`mb-2 last:mb-0`,children:[r.length>1&&(0,x.jsx)(`div`,{className:`mb-1 font-mono text-muted-foreground`,children:e.id}),e.note&&(0,x.jsx)(`div`,{className:`mb-1 text-warning-foreground`,children:e.note}),(0,x.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:(e.diffs||[]).map((e,t)=>(0,x.jsxs)(`div`,{className:`min-w-0 rounded-md border bg-background`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b px-2 py-1 text-2xs font-medium text-muted-foreground`,children:[e.to===`instance`?(0,x.jsx)(of,{className:`size-3`}):(0,x.jsx)(Kf,{className:`size-3`}),e.from,` → `,e.to===`local`?`mine`:e.to]}),(0,x.jsx)(l$,{d:e})]},t))})]},e.id))]})}function l$({d:e}){return e.unavailable?(0,x.jsx)(`div`,{className:`px-2 py-1.5 text-muted-foreground`,children:e.unavailable}):e.binary?(0,x.jsx)(`div`,{className:`px-2 py-1.5 text-muted-foreground`,children:`binary file changed`}):e.created?(0,x.jsx)(`div`,{className:`px-2 py-1.5 text-success-foreground`,children:`created`}):e.removed?(0,x.jsx)(`div`,{className:`px-2 py-1.5 text-destructive-foreground`,children:`removed`}):Array.isArray(e.fields)?(0,x.jsx)(`div`,{className:`px-2 py-1.5 font-mono`,children:e.fields.map(t=>(0,x.jsxs)(`div`,{className:`truncate`,children:[(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[t.path,`: `]}),(0,x.jsx)(`span`,{className:`text-destructive-foreground line-through decoration-destructive/40`,children:u$(t[e.from])}),` `,(0,x.jsx)(`span`,{className:`text-success-foreground`,children:u$(t[e.to])})]},t.path))}):typeof e.diff==`string`?(0,x.jsx)(`pre`,{className:`max-h-64 overflow-auto px-2 py-1.5 font-mono text-2xs leading-relaxed`,children:e.diff.split(`
|
|
296
|
+
`).filter(e=>!/^(---|\+\+\+) /.test(e)).map((e,t)=>(0,x.jsx)(`div`,{className:K(e.startsWith(`+`)&&`bg-success/8 text-success-foreground`,e.startsWith(`-`)&&`bg-destructive/8 text-destructive-foreground`,e.startsWith(`@@`)&&`text-info-foreground`),children:e||` `},t))}):(0,x.jsx)(`div`,{className:`px-2 py-1.5 text-muted-foreground`,children:`changed`})}function u$(e){let t=typeof e==`string`?e:JSON.stringify(e);return t===void 0?`—`:t.length>80?`${t.slice(0,77)}…`:t}var d$=[{value:`study-only`,label:`Study only`},{value:`own`,label:`Our own`},{value:`permissive`,label:`Permissive`}],f$={image:`Images`,url:`Page capture`,instance:`Instance page`,source:`Source`},p$=(e,t,n)=>`/api/refs/${encodeURIComponent(e)}/${encodeURIComponent(t)}/file?path=${encodeURIComponent(n)}`;function m$({projectId:e}){let t=U(ku().refs.list.queryOptions({projectId:e})),[n,r]=b.useState(null),[i,a]=b.useState(null),o=t.data?.refs||[],s=n?o.find(e=>e.id===n):null;return s?(0,x.jsx)(y$,{projectId:e,r:s,helper:t.data?.describeHelper,onBack:()=>r(null)}):(0,x.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,x.jsx)(h$,{projectId:e,count:o.length,canCapture:!!t.data?.canCapture,onForm:a}),i===`capture`&&(0,x.jsx)(_$,{projectId:e,onDone:e=>(a(null),e&&r(e))}),i===`link`&&(0,x.jsx)(v$,{projectId:e,onDone:e=>(a(null),e&&r(e))}),(0,x.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:t.isLoading?null:o.length===0?(0,x.jsx)(Dx,{icon:mp,title:`No references yet`,children:`Screenshots, captured pages and source folders to match. They stay in references/ (gitignored, never pushed); the agent reads them with ref_list, ref_view and ref_read.`}):(0,x.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(9.5rem,1fr))] gap-3 p-3`,children:o.map(t=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>r(t.id),className:`group/ref flex min-w-0 cursor-pointer flex-col overflow-hidden rounded-lg border border-border/80 bg-card text-left shadow-xs/5 transition-colors hover:border-border hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,children:[(0,x.jsx)(`span`,{className:`relative flex aspect-[4/3] w-full items-center justify-center overflow-hidden border-b border-border/60 bg-muted/50`,children:t.mainImage?(0,x.jsx)(`img`,{src:p$(e,t.id,t.mainImage),alt:``,loading:`lazy`,className:`size-full object-cover object-top`}):t.source.path?(0,x.jsx)(If,{className:`size-6 text-icon-muted`}):(0,x.jsx)(Af,{className:`size-6 text-icon-muted`})}),(0,x.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-2 py-1.5`,children:[(0,x.jsx)(`span`,{className:`truncate text-xs font-medium text-foreground`,children:t.title}),(0,x.jsxs)(`span`,{className:`truncate text-2xs text-muted-foreground`,children:[f$[t.kind]||t.kind,` ·`,` `,d$.find(e=>e.value===t.license)?.label||t.license]})]})]},t.id))})})]})}function h$({projectId:e,count:t,canCapture:n,onForm:r}){let i=ku(),a=C(),o=b.useRef(null),s=W(i.refs.fromAttachments.mutationOptions()),[c,l]=b.useState(``),[u,d]=b.useState(``),f=async t=>{if(t.length){l(`Adding ${t.length} file${t.length===1?``:`s`}…`),d(``);try{let n=[];for(let r of t)n.push((await US(e,r)).id);await s.mutateAsync({projectId:e,attachmentIds:n}),a.invalidateQueries({queryKey:i.refs.list.pathKey()})}catch(e){d(String(e.message||e))}finally{l(``)}}};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2`,children:[(0,x.jsx)(mp,{className:`ms-1 size-3.5 text-icon-muted`}),(0,x.jsx)(`span`,{className:`ms-1 text-xs font-medium`,children:`References`}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t||``}),c&&(0,x.jsx)(`span`,{className:`ms-2 truncate text-xs text-muted-foreground`,children:c}),(0,x.jsx)(`span`,{className:`ms-auto`}),(0,x.jsxs)(Pb,{children:[(0,x.jsxs)(Fb,{render:(0,x.jsx)(J,{size:`xs`,variant:`ghost`,"aria-label":`Add a reference`}),children:[(0,x.jsx)(wm,{}),`Add`]}),(0,x.jsxs)(Ib,{align:`end`,sideOffset:6,className:`min-w-52`,children:[(0,x.jsxs)(Lb,{onClick:()=>o.current?.click(),children:[(0,x.jsx)(Sh,{}),`Add files…`]}),(0,x.jsxs)(Lb,{onClick:()=>r(`link`),children:[(0,x.jsx)(If,{}),`Link a folder…`]}),(0,x.jsxs)(Lb,{disabled:!n,onClick:()=>r(`capture`),children:[(0,x.jsx)(Nd,{}),`Capture a URL…`]})]})]}),(0,x.jsx)(`input`,{ref:o,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{let t=Array.from(e.currentTarget.files??[]);e.currentTarget.value=``,f(t)}})]}),u&&(0,x.jsx)(`div`,{className:`border-b border-border/60 px-3 py-2 text-xs text-destructive-foreground`,children:u})]})}function g$({label:e,children:t}){return(0,x.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),t]})}function _$({projectId:e,onDone:t}){let n=ku(),r=C(),i=W(n.refs.capture.mutationOptions()),[a,o]=b.useState(``),[s,c]=b.useState(`1440, 390`),[l,u]=b.useState(!0),[d,f]=b.useState(!1),[p,m]=b.useState(!1),h=()=>{let o=s.split(/[\s,]+/).filter(Boolean).map(Number);i.mutate({projectId:e,url:a.trim(),widths:o,modes:[...l?[`light`]:[],...d?[`dark`]:[]],instance:p},{onSuccess:e=>{r.invalidateQueries({queryKey:n.refs.list.pathKey()}),t(e.id)}})};return(0,x.jsxs)(`form`,{className:`flex shrink-0 flex-col gap-2.5 border-b border-border/60 bg-muted/30 p-3`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium`,children:[(0,x.jsx)(Nd,{className:`size-3.5 text-icon-muted`}),` Capture a URL`]}),(0,x.jsx)(g$,{label:p?`Path on the instance`:`URL`,children:(0,x.jsx)(p7,{autoFocus:!0,size:`compact`,value:a,onChange:e=>o(e.target.value),placeholder:p?`/esc`:`https://example.com`})}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,x.jsx)(g$,{label:`Widths`,children:(0,x.jsx)(p7,{size:`compact`,className:`w-32`,mono:!0,value:s,onChange:e=>c(e.target.value)})}),(0,x.jsxs)(`label`,{className:`flex h-7 items-center gap-1.5 text-xs`,children:[(0,x.jsx)(h7,{checked:l,onCheckedChange:e=>u(!!e)}),` Light`]}),(0,x.jsxs)(`label`,{className:`flex h-7 items-center gap-1.5 text-xs`,children:[(0,x.jsx)(h7,{checked:d,onCheckedChange:e=>f(!!e)}),` Dark`]}),(0,x.jsxs)(`label`,{className:`flex h-7 items-center gap-1.5 text-xs`,children:[(0,x.jsx)(g7,{checked:p,onCheckedChange:e=>m(!!e)}),` Page of the instance`]})]}),(0,x.jsx)(`p`,{className:`text-2xs leading-normal text-muted-foreground`,children:`The capture browser has its own profile and keeps no cookies; an instance page uses this workspace’s profile session, read-only. Saves screenshots, the DOM without scripts and landmark styles.`}),i.error&&(0,x.jsx)(`div`,{className:`text-xs text-destructive-foreground`,children:i.error.message}),(0,x.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>t(null),children:`Cancel`}),(0,x.jsx)(J,{size:`xs`,type:`submit`,disabled:!a.trim()||!l&&!d||i.isPending,children:i.isPending?`Capturing…`:`Capture`})]})]})}function v$({projectId:e,onDone:t}){let n=ku(),r=C(),i=W(n.refs.link.mutationOptions()),[a,o]=b.useState(``),[s,c]=b.useState(`study-only`);return(0,x.jsxs)(`form`,{className:`flex shrink-0 flex-col gap-2.5 border-b border-border/60 bg-muted/30 p-3`,onSubmit:o=>{o.preventDefault(),i.mutate({projectId:e,path:a.trim(),license:s},{onSuccess:e=>{r.invalidateQueries({queryKey:n.refs.list.pathKey()}),t(e.id)}})},children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium`,children:[(0,x.jsx)(If,{className:`size-3.5 text-icon-muted`}),` Link a folder`]}),(0,x.jsx)(g$,{label:`Folder (absolute path)`,children:(0,x.jsx)(p7,{autoFocus:!0,size:`compact`,mono:!0,value:a,onChange:e=>o(e.target.value),placeholder:`C:\\src\\my-old-site`})}),(0,x.jsx)(g$,{label:`License`,children:(0,x.jsx)(v7,{size:`xs`,value:s,onChange:c,options:d$,"aria-label":`License`})}),(0,x.jsx)(`p`,{className:`text-2xs leading-normal text-muted-foreground`,children:`A link, not a copy: the agent reads it with ref_read, read-only and inside the folder only.`}),i.error&&(0,x.jsx)(`div`,{className:`text-xs text-destructive-foreground`,children:i.error.message}),(0,x.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>t(null),children:`Cancel`}),(0,x.jsx)(J,{size:`xs`,type:`submit`,disabled:!a.trim()||i.isPending,children:`Link`})]})]})}function y$({projectId:e,r:t,helper:n,onBack:r}){let i=ku(),a=C(),o=W(i.refs.update.mutationOptions()),s=W(i.refs.remove.mutationOptions()),c=W(i.refs.describe.mutationOptions()),l=t.files.filter(e=>/\.(png|jpe?g|gif|webp)$/i.test(e)),[u,d]=b.useState(t.mainImage||l[0]||``),[f,p]=b.useState(t.title),[m,h]=b.useState(t.notes||``),[g,_]=b.useState(!1),[v,y]=b.useState(!1),S=()=>a.invalidateQueries({queryKey:i.refs.list.pathKey()}),w=n=>o.mutate({projectId:e,id:t.id,...n},{onSuccess:S}),T=u&&t.descriptions?.[u]||(u===t.mainImage?t.description:``)||``;return(0,x.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,x.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2`,children:[(0,x.jsx)(Gb,{label:`All references`,children:(0,x.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`All references`,className:`inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-icon-muted hover:bg-accent hover:text-foreground`,children:(0,x.jsx)(hd,{className:`size-3.5`})})}),(0,x.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium`,children:t.title}),(0,x.jsx)(`span`,{className:`truncate font-mono text-2xs text-muted-foreground`,children:t.id}),(0,x.jsx)(`span`,{className:`ms-auto`}),(0,x.jsx)(Gb,{label:v?`Added to the composer`:`Mention in chat (@ref:${t.id})`,children:(0,x.jsxs)(J,{size:`xs`,variant:`ghost`,onClick:()=>y(gC(`@ref:${t.id} `)),children:[(0,x.jsx)(yd,{}),`Mention in chat`]})})]}),(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[l.length>0&&(0,x.jsxs)(`div`,{className:`border-b border-border/60 bg-muted/40 p-3`,children:[l.length>1&&(0,x.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1`,children:l.map(e=>(0,x.jsx)(`button`,{type:`button`,onClick:()=>d(e),className:K(`h-6 cursor-pointer rounded-md px-2 font-mono text-2xs`,u===e?`bg-accent text-foreground`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`),children:e.replace(/\.png$/,``)},e))}),(0,x.jsx)(`a`,{href:p$(e,t.id,u),target:`_blank`,rel:`noreferrer`,className:`block`,children:(0,x.jsx)(`img`,{src:p$(e,t.id,u),alt:u,className:`mx-auto max-h-80 w-auto max-w-full rounded-md border border-border/80 bg-background object-contain object-top shadow-xs/5`})})]}),(0,x.jsxs)(`div`,{className:`flex flex-col gap-3 p-3`,children:[(0,x.jsx)(g$,{label:`Title`,children:(0,x.jsx)(p7,{size:`compact`,value:f,onChange:e=>p(e.target.value),onBlur:()=>f.trim()&&f!==t.title&&w({title:f})})}),(0,x.jsx)(g$,{label:`License`,children:(0,x.jsx)(v7,{size:`xs`,value:t.license,onChange:e=>w({license:e}),options:d$,"aria-label":`License`})}),(0,x.jsx)(`p`,{className:`-mt-1.5 text-2xs leading-normal text-muted-foreground`,children:t.license===`own`?`Your own material: the agent may port its code.`:t.license===`permissive`?`Permissively licensed: reuse follows its license.`:`Study only: the agent matches the look and behavior and writes its own code.`}),(0,x.jsx)(g$,{label:`Notes for the agent`,children:(0,x.jsx)(m7,{value:m,onChange:e=>h(e.target.value),onBlur:()=>m!==(t.notes||``)&&w({notes:m}),placeholder:`What to match: the header, the card grid, the empty states…`})}),(t.source.url||t.source.path)&&(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[t.source.url?(0,x.jsx)(Jf,{className:`size-3.5 shrink-0`}):(0,x.jsx)(If,{className:`size-3.5 shrink-0`}),(0,x.jsx)(`span`,{className:`truncate font-mono text-2xs`,title:t.source.url||t.source.path,children:t.source.url||t.source.path})]}),u&&(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-border/80 bg-card p-2.5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium`,children:[(0,x.jsx)(ip,{className:`size-3.5 text-icon-muted`}),`Description`,(0,x.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`for models without vision`}),(0,x.jsx)(`span`,{className:`ms-auto`}),(0,x.jsx)(Gb,{label:n?.error||(T?`Describe again with ${n?.model}`:`Describe with ${n?.model}`),children:(0,x.jsxs)(J,{size:`xs`,variant:`ghost`,disabled:!!n?.error||c.isPending,onClick:()=>c.mutate({projectId:e,id:t.id,file:u,force:!!T},{onSuccess:S}),children:[(0,x.jsx)(eh,{}),c.isPending?`Describing…`:T?`Again`:`Describe`]})})]}),(0,x.jsx)(`div`,{className:`text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground`,children:c.error?c.error.message:T||`None yet. Made once by the helper model when a model that can’t see images views it.`})]}),t.files.length>0&&(0,x.jsxs)(`div`,{className:`flex flex-col`,children:[(0,x.jsx)(`span`,{className:`mb-1 text-xs text-muted-foreground`,children:`Files`}),t.files.map(e=>(0,x.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5 font-mono text-2xs text-foreground/80`,children:[/\.(png|jpe?g|gif|webp)$/i.test(e)?(0,x.jsx)(ip,{className:`size-3 text-icon-muted`}):(0,x.jsx)(Af,{className:`size-3 text-icon-muted`}),e]},e))]}),(0,x.jsx)(`div`,{className:`flex justify-end pt-1`,children:g?(0,x.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Delete references/`,t.id,`/`,t.source.path?` (the linked folder stays)`:``,`?`]}),(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>_(!1),children:`Keep`}),(0,x.jsx)(J,{size:`xs`,variant:`destructive`,onClick:()=>s.mutate({projectId:e,id:t.id},{onSuccess:()=>{S(),r()}}),children:`Remove`})]}):(0,x.jsxs)(J,{size:`xs`,variant:`destructive-outline`,onClick:()=>_(!0),children:[(0,x.jsx)(vh,{}),`Remove`]})})]})]})]})}function b$(e){let t=ku(),{chatId:n}=Ki({strict:!1});return U(t.plans.list.queryOptions(n?{projectId:e,chatId:n}:{projectId:e}))}function x$(e){let t=e=>e.status===`implementing`?0:e.status===`approved`?1:e.status===`draft`?2:3;return[...e].sort((e,n)=>t(e)-t(n)||n.updatedAt.localeCompare(e.updatedAt))[0]}var S$={draft:`Draft`,approved:`Approved`,implementing:`Building`,completed:`Completed`,superseded:`Superseded`};function Fee({projectId:e}){let t=ku(),n=b$(e),r=W(t.plans.setPause.mutationOptions()),i=n.data||[],a=x$(i);if(!a)return(0,x.jsx)(Dx,{icon:gp,title:`No plan yet`,children:`Bigger requests start with a plan file in .plans/: its phases and checklist show here while it is built.`});let o=a.phases.flatMap(e=>e.items),s=o.filter(e=>e.done).length,c=a.problems.filter(e=>e.severity===`error`),l=i.filter(e=>e!==a);return(0,x.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-y-auto px-4 py-3 text-sm`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(Xb,{children:`Plan`}),(0,x.jsx)(`h3`,{className:`min-w-0 truncate font-medium`,children:a.title}),(0,x.jsx)(`span`,{className:`ms-auto shrink-0 text-xs text-muted-foreground`,children:S$[a.status]})]}),(0,x.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,x.jsx)(`button`,{type:`button`,className:`min-w-0 truncate font-mono hover:text-foreground hover:underline`,onClick:()=>Yu(a.path),children:a.path}),o.length>0&&(0,x.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[`· `,s,`/`,o.length,` items`,a.phase&&a.status===`implementing`?` · phase ${a.phase}`:``]})]}),o.length>0&&(0,x.jsx)(`div`,{className:`mt-2 h-1 w-full overflow-hidden rounded-full bg-foreground/8`,"aria-hidden":!0,children:(0,x.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width]`,style:{width:`${Math.round(s/o.length*100)}%`}})}),a.changedSinceApproval&&(0,x.jsxs)(`div`,{className:`mt-2 flex items-center gap-1.5 text-xs font-medium text-warning-foreground`,children:[(0,x.jsx)(bh,{className:`size-3.5`}),` Changed since approval: approve it again from the card`]}),a.stopped&&a.status===`implementing`&&(0,x.jsx)(`div`,{className:`mt-2 text-xs text-warning-foreground`,children:a.stopped}),(0,x.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,x.jsxs)(J,{size:`xs`,variant:`outline`,onClick:()=>Yu(a.path),children:[(0,x.jsx)(Pp,{}),` Review`]}),(0,x.jsxs)(J,{size:`xs`,variant:`ghost`,onClick:()=>Yu(a.path),children:[(0,x.jsx)(mm,{}),` Edit`]}),a.phases.length>1&&a.status!==`completed`&&a.status!==`superseded`&&(0,x.jsx)(Gb,{label:`Stop at every phase boundary instead of going on by itself`,children:(0,x.jsxs)(`label`,{className:`ms-auto flex cursor-pointer items-center gap-1.5 text-xs text-muted-foreground select-none`,children:[(0,x.jsx)(`input`,{type:`checkbox`,className:`accent-[var(--primary)]`,checked:!!a.pauseAfterPhase,onChange:t=>r.mutate({projectId:e,chatId:a.chatId,planId:a.id,pause:t.target.checked})}),`Pause after each phase`]})})]}),a.phases.length>0&&(0,x.jsxs)(`section`,{className:`mt-4`,children:[(0,x.jsx)(`h4`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:`Phases`}),(0,x.jsx)(`ol`,{className:`flex flex-col gap-3`,children:a.phases.map(e=>{let t=a.status===`implementing`&&a.phase===e.id,n=e.items.filter(e=>e.done).length;return(0,x.jsxs)(`li`,{className:K(`rounded-lg border px-3 py-2`,t?`border-primary/40 bg-primary/4`:`border-border/70`),children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(Iee,{done:e.done&&e.items.length>0,current:t}),(0,x.jsxs)(`span`,{className:`min-w-0 truncate font-medium`,children:[`Phase `,e.id,e.title?`: ${e.title}`:``]}),(0,x.jsxs)(`span`,{className:`ms-auto shrink-0 text-xs text-muted-foreground tabular-nums`,children:[n,`/`,e.items.length]})]}),e.items.length>0&&(0,x.jsx)(`ul`,{className:`mt-1.5 flex flex-col gap-0.5 ps-6`,children:e.items.map(e=>(0,x.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2 text-[13px]`,children:[(0,x.jsx)(`span`,{"aria-hidden":!0,className:K(`w-3 shrink-0 text-center font-mono text-xs`,e.done?`text-success-foreground`:`text-icon-muted`),children:e.done?`✓`:`○`}),(0,x.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:e.id}),(0,x.jsx)(`span`,{className:K(`min-w-0`,e.done?`text-muted-foreground`:`text-secondary-label`),children:e.text.replace(/\s*\(owner:[^)]*\)\s*$/i,``)}),e.owner&&(0,x.jsx)(`span`,{className:`ms-auto shrink-0 rounded-sm bg-foreground/6 px-1 text-2xs text-muted-foreground`,children:e.owner})]},e.id))})]},`${e.id}-${e.title}`)})})]}),a.parity.length>0&&(0,x.jsxs)(`section`,{className:`mt-4`,children:[(0,x.jsx)(`h4`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:`Parity checklist`}),(0,x.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:a.parity.map((e,t)=>(0,x.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2 text-[13px]`,children:[(0,x.jsx)(`span`,{"aria-hidden":!0,className:K(`w-3 shrink-0 text-center font-mono text-xs`,e.done?`text-success-foreground`:`text-icon-muted`),children:e.done?`✓`:`○`}),(0,x.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:e.id}),(0,x.jsx)(`span`,{className:`min-w-0 text-secondary-label`,children:e.text.replace(/^[A-Za-z]{1,3}\d+(\.\d+)*\s*/,``)})]},`${e.id}-${t}`))})]}),a.problems.length>0&&a.status!==`superseded`&&(0,x.jsxs)(`section`,{className:`mt-4`,children:[(0,x.jsx)(`h4`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:c.length?`Problems (${c.length} block Approve)`:`Warnings`}),(0,x.jsx)(`ul`,{className:`flex flex-col gap-0.5 text-xs`,children:a.problems.map((e,t)=>(0,x.jsxs)(`li`,{className:`flex min-w-0 items-start gap-1.5 text-muted-foreground`,children:[(0,x.jsx)(`span`,{className:K(`mt-1 size-1.5 shrink-0 rounded-full`,e.severity===`error`?`bg-destructive`:`bg-warning`)}),(0,x.jsxs)(`span`,{className:`min-w-0`,children:[e.line?(0,x.jsxs)(`button`,{type:`button`,className:`me-1 font-mono text-foreground/80 hover:underline`,onClick:()=>Yu(a.path,e.line),children:[`L`,e.line]}):null,e.message]})]},t))})]}),l.length>0&&(0,x.jsxs)(`section`,{className:`mt-5 border-t pt-3`,children:[(0,x.jsx)(`h4`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:`Other plans`}),(0,x.jsx)(`ul`,{className:`flex flex-col gap-1`,children:l.map(e=>(0,x.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-xs`,children:[(0,x.jsx)(`button`,{type:`button`,className:`min-w-0 truncate text-secondary-label hover:text-foreground hover:underline`,onClick:()=>Yu(e.path),children:e.title}),(0,x.jsx)(`span`,{className:`ms-auto shrink-0 text-muted-foreground`,children:S$[e.status]})]},e.id))})]})]})}function Iee({done:e,current:t}){return e?(0,x.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-success/16 text-success-foreground`,children:(0,x.jsx)(zd,{className:`size-3`})}):(0,x.jsx)(tf,{"aria-hidden":!0,className:K(`size-4 shrink-0`,t?`fill-primary/20 text-primary`:`text-icon-muted`)})}function Lee(e,t){if(!e||!t)return null;let n,r;try{n=new URL(e),r=new URL(t)}catch{return null}if(n.port!==r.port||!/^(127\.0\.0\.1|localhost)$/.test(n.hostname)||!n.pathname.startsWith(`/x/`))return null;let i=/\/params\/(?:.*\/)?page-id\/([^/]+)/.exec(n.pathname)?.[1];return{path:n.pathname+n.search,label:i?`/${decodeURIComponent(i)}`:`Home`}}function Ree({projectId:e,dev:t,onRestart:n}){let r=ku(),[i,a]=b.useState(null),[o,s]=b.useState(0),[c,l]=b.useState(``),[u,d]=b.useState(``),f=t&&(t.state===`running`||t.state===`attached`)&&t.enterUrl,p=f?`${t.enterUrl}${c?`&to=${encodeURIComponent(c)}`:``}`:``,m=U(r.agent.info.queryOptions({projectId:e})),h=f?Lee(m.data?.url,t.url):null,[g,_]=b.useState(``),v=h&&h.path!==c&&h.path!==g&&(h.label!==`Home`||c)?h:null;return(0,x.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,x.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-1 border-b px-2`,children:[(0,x.jsx)(Gb,{label:`Reload`,children:(0,x.jsx)(`button`,{disabled:!f,onClick:()=>s(o+1),className:`inline-flex size-6 items-center justify-center rounded-md text-icon-muted hover:bg-accent hover:text-foreground disabled:opacity-50`,children:(0,x.jsx)(Mm,{className:`size-3.5`})})}),(0,x.jsx)(`form`,{className:`min-w-0 flex-1`,onSubmit:e=>{e.preventDefault(),l(u.startsWith(`/`)?u:u?`/`+u:``),s(o+1)},children:(0,x.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),disabled:!f,placeholder:f?`portal home`:``,className:`h-6 w-full rounded-md bg-accent px-2 font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/60 focus:text-foreground`})}),[390,768,1440].map(e=>(0,x.jsx)(`button`,{onClick:()=>a(i===e?null:e),className:K(`h-6 rounded-md px-1.5 text-2xs text-muted-foreground tabular-nums hover:bg-accent`,i===e&&`bg-accent text-foreground`),children:e},e)),(0,x.jsx)(Gb,{label:`Open in a tab`,children:(0,x.jsx)(`a`,{href:p||void 0,target:`_blank`,rel:`noreferrer`,className:`inline-flex size-6 items-center justify-center rounded-md text-icon-muted hover:bg-accent hover:text-foreground`,children:(0,x.jsx)(bf,{className:`size-3.5`})})})]}),(0,x.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-auto bg-muted`,children:[v&&(0,x.jsxs)(`div`,{className:`absolute top-2 left-1/2 z-10 flex -translate-x-1/2 items-center gap-0.5 rounded-full border bg-popover/90 py-0.5 pr-0.5 pl-2.5 text-xs shadow-md backdrop-blur-md`,children:[(0,x.jsx)(Kp,{className:`size-3 text-icon-muted`}),(0,x.jsx)(`span`,{className:`ml-1 text-muted-foreground`,children:`Agent is on`}),(0,x.jsxs)(`button`,{onClick:()=>{l(v.path),d(v.path),s(o+1)},className:`ml-0.5 rounded-full px-1.5 py-0.5 font-medium text-foreground hover:bg-accent`,children:[`Open `,v.label]}),(0,x.jsx)(Gb,{label:`Dismiss`,children:(0,x.jsx)(`button`,{onClick:()=>_(v.path),"aria-label":`Dismiss`,className:`inline-flex size-5 items-center justify-center rounded-full text-icon-muted hover:bg-accent hover:text-foreground`,children:(0,x.jsx)(Oh,{className:`size-3`})})})]}),f?(0,x.jsx)(`iframe`,{src:p,title:`Preview`,className:`mx-auto h-full border-0 bg-white`,style:{width:i?`${i}px`:`100%`}},o):t?.state===`starting`?(0,x.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,x.jsx)(`div`,{className:`skeleton m-4 h-10 rounded-lg bg-foreground/6`}),(0,x.jsx)(`div`,{className:`skeleton mx-4 h-40 rounded-lg bg-foreground/6`}),(0,x.jsx)(`pre`,{className:`mt-auto max-h-40 overflow-hidden px-4 pb-3 font-mono text-2xs leading-relaxed whitespace-pre-wrap text-secondary-label`,children:t.log.slice(-8).join(`
|
|
297
|
+
`)||`Starting the dev server…`})]}):t?.state===`failed`?(0,x.jsx)(Dx,{icon:Zd,title:t.code===`no_profile`?`No profile for this instance`:t.code===`no_portal`?`Nothing to preview`:`The dev server failed`,actions:t.code===`no_portal`?null:(0,x.jsxs)(x.Fragment,{children:[t.code===`no_profile`&&(0,x.jsx)(E8,{section:`instances`,children:(0,x.jsx)(J,{size:`sm`,variant:`outline`,children:`Add a profile`})}),(0,x.jsxs)(J,{size:`sm`,variant:`outline`,onClick:n,children:[(0,x.jsx)(Mm,{}),` Restart`]})]}),children:t.error}):(0,x.jsx)(Dx,{icon:Bp,title:`No preview yet`,children:`The project’s portal appears here, live, once its dev server is running.`})]}),f&&(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 border-t px-3 py-1 text-2xs text-muted-foreground`,children:[(0,x.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),`your session · live data (not read-only)`,t.state===`attached`&&(0,x.jsx)(`span`,{className:`ml-auto`,children:`attached to your rpf dev`})]})]})}var zee={id:`build`,label:`Build plan`,icon:gp},C$=[{id:`preview`,label:`Preview`,icon:pd},{id:`agent`,label:`Agent`,icon:Kp},{id:`diff`,label:`Diff`,icon:Ef},{id:`files`,label:`Files`,icon:Rf},{id:`refs`,label:`References`,icon:mp},{id:`terminal`,label:`Terminal`,icon:ih},{id:`problems`,label:`Problems`,icon:Zd},{id:`plan`,label:`Push plan`,icon:Sh}],Bee={agent:{icon:Kp,title:`The agent’s browser`,text:`A live view of the read-only browser the agent uses to look at and click through the portal.`},diff:{icon:Ef,title:`No changes yet`,text:`Every edit the agent makes shows here, per turn or for the session, with undo.`},files:{icon:Rf,title:`Files`,text:`The project tree, with changed files marked.`},terminal:{icon:ih,title:`Terminal`,text:`Your shell in the project folder, and live views of the agent’s commands.`},problems:{icon:Zd,title:`No problems`,text:`Compile errors, missing components and console errors from the preview show here.`},plan:{icon:Sh,title:`No push plan`,text:`Check and plan a push to the instance; every push is reviewed in a dialog before it runs.`}};function Vee(e,t,n,r,i,a){let o=new Set(e);for(let t of e){let e=Xu(t);e&&PQ(a,e)}let s=t.filter(e=>!o.has(e)),c=e.filter(e=>!Xu(e)),l=i.filter(e=>!o.has(`file:${e}`));if(!s.length)return Uu({panelOpen:!1,openFiles:l,closedTabs:[...r,...c]});let u=n;if(o.has(n)){let e=t.indexOf(n);u=t.slice(e).find(e=>!o.has(e))??t.slice(0,e).reverse().find(e=>!o.has(e))}Uu({closedTabs:[...r,...c],openFiles:l,panelTab:u})}var w$=b.lazy(()=>UY(()=>import(`./file-panel-CpPZ9DXB.js`).then(e=>({default:e.FilePanel})),__vite__mapDeps([12,9,3,1,5,7]))),Hee=e=>e.slice(e.lastIndexOf(`/`)+1);function Uee({projectId:e,dev:t,onRestart:n}){let r=Wu(),i=Bee[r.panelTab],a=r.openFiles||[],o=b$(e).data?.length||0;zQ();let[s,c]=b.useState(null),l=r.closedTabs||[];b.useEffect(()=>{l.includes(r.panelTab)&&Uu({closedTabs:l.filter(e=>e!==r.panelTab)})},[r.panelTab,l]);let u=[...o?[zee]:[],...C$.filter(e=>!l.includes(e.id)||e.id===r.panelTab)],d=C$.filter(e=>!u.includes(e)),f=[...u.map(e=>e.id),...a.map(e=>`file:${e}`)],p=t=>Vee(t.filter(e=>e!==`build`),f,r.panelTab,l,a,e),m=e=>p([e]),h=[...u.map(e=>({id:e.id,label:e.label,icon:(0,x.jsx)(e.icon,{className:`size-3`}),pinned:e.id===`build`})),...a.map(t=>({id:`file:${t}`,label:Hee(t),title:t,icon:(0,x.jsx)(vS,{path:t,className:`size-3`}),pending:IQ(e,t)}))],g=s?f.indexOf(s.id):-1,_=s?[...Xu(s.id)?[{id:`copy-path`,label:`Copy path`}]:[],{id:`close`,label:`Close`},{id:`close-others`,label:`Close others`,disabled:f.length<=1},{id:`close-to-right`,label:`Close to the right`,disabled:g>=f.length-1},{id:`close-all`,label:`Close all`,disabled:f.length===0}]:[],v=e=>{if(!s)return;let t=s.id;c(null),e===`copy-path`?navigator.clipboard.writeText(Xu(t)||``):e===`close`?m(t):e===`close-others`?p(f.filter(e=>e!==t)):e===`close-to-right`?p(f.slice(f.indexOf(t)+1)):e===`close-all`&&p(f)},y=Wee(),S=(0,x.jsxs)(`section`,{className:K(`relative flex h-full shrink-0 flex-col bg-background`,y?`w-full bg-popover`:`border-l`),style:y?void 0:{width:r.panelWidth},children:[(0,x.jsxs)(`div`,{className:`flex h-[var(--topbar-h)] shrink-0 items-center gap-1 overflow-x-auto pl-2 [scrollbar-width:none]`,children:[h.map(e=>(0,x.jsxs)(`div`,{onClick:t=>{t.target===t.currentTarget&&Uu({panelTab:e.id})},onAuxClick:t=>{t.button===1&&!e.pinned&&m(e.id)},onContextMenu:t=>{t.preventDefault(),c({at:{x:t.clientX,y:t.clientY},id:e.id})},title:e.title,className:K(`group/tab flex h-6 max-w-36 shrink-0 cursor-pointer items-center gap-0.5 rounded-md pr-2 pl-1.5 text-xs`,r.panelTab===e.id?`bg-accent text-foreground`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`),children:[e.pinned?(0,x.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,"aria-hidden":!0,children:e.icon}):(0,x.jsxs)(`button`,{type:`button`,"aria-label":`Close ${e.label}`,onClick:()=>m(e.id),className:`group/close relative flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-sm hover:bg-muted`,children:[(0,x.jsx)(`span`,{className:`flex group-hover/tab:hidden group-focus-visible/close:hidden`,children:e.icon}),e.pending&&(0,x.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full bg-current group-hover/tab:hidden`,"aria-hidden":!0}),(0,x.jsx)(Oh,{className:`hidden size-3 group-hover/tab:block group-focus-visible/close:block`})]}),(0,x.jsx)(`button`,{type:`button`,"aria-pressed":r.panelTab===e.id,onClick:()=>Uu({panelTab:e.id}),className:`flex min-w-0 cursor-pointer items-center`,children:(0,x.jsx)(`span`,{className:`truncate`,children:e.label})})]},e.id)),d.length>0&&(0,x.jsxs)(Pb,{children:[(0,x.jsx)(Fb,{render:(0,x.jsx)(J,{"aria-label":`Open a tab`,title:`Open a tab`,className:`shrink-0`,size:`icon-xs`,variant:`ghost-muted`}),children:(0,x.jsx)(wm,{className:`size-3.5`})}),(0,x.jsx)(Ib,{align:`start`,sideOffset:6,children:d.map(e=>(0,x.jsxs)(Lb,{onClick:()=>Uu({panelTab:e.id}),children:[(0,x.jsx)(e.icon,{}),e.label]},e.id))})]})]}),(0,x.jsx)(`div`,{className:`min-h-0 flex-1 border-t`,children:r.panelTab===`build`?(0,x.jsx)(Fee,{projectId:e}):r.panelTab===`preview`?(0,x.jsx)(Ree,{projectId:e,dev:t,onRestart:n}):r.panelTab===`agent`?(0,x.jsx)(GQ,{projectId:e}):r.panelTab===`terminal`?(0,x.jsx)(qQ,{projectId:e}):r.panelTab===`diff`?(0,x.jsx)(QQ,{projectId:e}):Xu(r.panelTab)?(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(w$,{projectId:e,path:Xu(r.panelTab)},r.panelTab)}):r.panelTab===`refs`?(0,x.jsx)(m$,{projectId:e}):r.panelTab===`plan`?(0,x.jsx)(o$,{projectId:e}):r.panelTab===`files`?(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(w$,{projectId:e,path:null})}):i?(0,x.jsx)(Dx,{icon:i.icon,title:i.title,children:i.text}):null}),(0,x.jsx)(i$,{at:s?.at??null,items:_,onPick:v,onClose:()=>c(null)}),!y&&(0,x.jsx)(Kee,{})]});return y?(0,x.jsx)(Gee,{children:S}):S}var T$=`(max-width: 980px)`;function Wee(){let[e,t]=b.useState(()=>window.matchMedia(T$).matches);return b.useEffect(()=>{let e=window.matchMedia(T$),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function Gee({children:e}){return(0,x.jsx)(ub,{open:!0,onOpenChange:(e,t)=>{if(!e){if(t.reason===`escape-key`&&t.event?.repeat)return t.cancel();Uu({panelOpen:!1})}},children:(0,x.jsxs)(lb,{children:[(0,x.jsx)(nb,{className:`fixed inset-0 z-40 bg-background/60 backdrop-blur-xs transition-all duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0`}),(0,x.jsx)(`div`,{className:`fixed inset-0 z-40 flex justify-end`,"data-slot":`sheet-viewport`,children:(0,x.jsx)(cb,{"aria-label":`Workspace panel`,className:`relative flex h-full max-h-full w-[min(42vw,28rem)] max-w-[28rem] min-w-80 flex-col border-s bg-popover text-popover-foreground shadow-lg/5 transition-[opacity,translate] duration-200 ease-in-out will-change-transform data-[ending-style]:translate-x-8 data-[ending-style]:opacity-0 data-[starting-style]:translate-x-8 data-[starting-style]:opacity-0 max-[760px]:w-[min(88vw,24rem)] max-[760px]:min-w-0`,children:e})})]})})}function Kee(){return(0,x.jsx)(`div`,{onPointerDown:e=>{e.preventDefault();let t=e=>{let t=window.innerWidth-e.clientX;Uu({panelWidth:Math.min(window.innerWidth*.7,Math.max(360,t))})},n=()=>{window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerup`,n),document.body.style.cursor=``};document.body.style.cursor=`col-resize`,window.addEventListener(`pointermove`,t),window.addEventListener(`pointerup`,n)},className:`group absolute top-0 -left-2 z-10 flex h-full w-4 cursor-col-resize justify-center`,children:(0,x.jsx)(`div`,{className:`h-full w-0.5 transition-colors group-hover:bg-border`})})}function qee(e=``){return e.replace(/^x_\d+_portal_/,``).replace(/^sys_/,``)}var Jee=/^(server_script|script|server_js|server\.js)$/;function E$({verb:e,tone:t,item:n}){let r=Object.keys(n.changes||n.fields||{}).filter(e=>e!==`sys_updated_on`),i=r.some(e=>Jee.test(e)),a=n.changes?.revision;return(0,x.jsxs)(`div`,{className:`grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-2 py-0.5`,children:[(0,x.jsx)(`span`,{className:K(`font-medium`,t),children:e}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:qee(n.table)}),(0,x.jsx)(`span`,{className:`truncate text-foreground`,children:n.display||n.path||n.id}),a&&(0,x.jsxs)(`span`,{className:`ms-auto shrink-0 text-muted-foreground tabular-nums`,children:[`rev `,String(a.from),` → `,String(a.to)]})]}),r.length>0&&e!==`DEACTIVATE`&&(0,x.jsx)(`div`,{className:`truncate text-muted-foreground`,children:r.filter(e=>e!==`revision`).join(`, `)}),i&&(0,x.jsxs)(`div`,{className:`flex items-center gap-1 text-warning-foreground`,children:[(0,x.jsx)(bh,{className:`size-3 shrink-0`}),` server script: runs on the instance as each visitor`]})]})]})}function Yee({chunks:e}){let t=t=>e.flatMap(e=>e[t]||[]),n=e.flatMap(e=>e.compile?.components||[]),r=e.map(e=>e.compile?.theme).filter(Boolean),i=e.some(e=>e.compile?.finalize?.reprocess),a=[];return t(`creates`).length||a.push(`nothing created`),t(`deactivates`).length||a.push(`nothing deactivated`),t(`deletes`).length||a.push(`no files removed`),(0,x.jsxs)(`div`,{className:`rounded-lg border bg-muted/40 px-3 py-2 font-mono text-xs`,children:[e.map((t,n)=>(0,x.jsxs)(`div`,{className:K(n>0&&`mt-2 border-t border-border/60 pt-2`),children:[e.length>1&&(0,x.jsxs)(`div`,{className:`mb-0.5 text-2xs tracking-wide text-muted-foreground uppercase`,children:[`chunk `,n+1,` of `,e.length]}),(t.creates||[]).map((e,t)=>(0,x.jsx)(E$,{verb:`CREATE`,tone:`text-success-foreground`,item:e},`c${t}`)),(t.updates||[]).map((e,t)=>(0,x.jsx)(E$,{verb:`UPDATE`,tone:`text-info-foreground`,item:e},`u${t}`)),(t.deactivates||[]).map((e,t)=>(0,x.jsx)(E$,{verb:`DEACTIVATE`,tone:`text-warning-foreground`,item:e},`d${t}`)),(t.deletes||[]).map((e,t)=>(0,x.jsx)(E$,{verb:`DELETE FILE`,tone:`text-destructive-foreground`,item:e},`x${t}`)),(t.compile?.components||[]).map(e=>(0,x.jsxs)(`div`,{className:`grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-2 py-0.5`,children:[(0,x.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`COMPILE`}),(0,x.jsx)(`span`,{className:`truncate`,children:e})]},`k${e}`))]},n)),r.length>0&&(0,x.jsxs)(`div`,{className:`grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-2 py-0.5`,children:[(0,x.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`THEME`}),(0,x.jsx)(`span`,{children:r.join(`, `)})]}),i&&(0,x.jsxs)(`div`,{className:`grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-2 py-0.5`,children:[(0,x.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`REPROCESS`}),(0,x.jsx)(`span`,{children:`the portal (once, at the end)`})]}),!n.length&&!i&&!e.some(e=>(e.updates||[]).length)&&(0,x.jsx)(`div`,{className:`py-0.5 text-muted-foreground`,children:`No writes.`}),a.length>0&&(0,x.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[a.join(`, `),`.`]})]})}function Xee({overwrites:e,slug:t,typed:n,onType:r}){return(0,x.jsxs)(`div`,{className:`rounded-lg border border-destructive/40 bg-destructive/6 px-3 py-2.5 dark:bg-destructive/12`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium text-destructive-foreground`,children:[(0,x.jsx)(bh,{className:`size-4`}),` Force push: these instance changes are overwritten`]}),e.length===0?(0,x.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:`No instance-side changes to overwrite.`}):(0,x.jsx)(`div`,{className:`mt-1.5 max-h-44 overflow-auto font-mono text-xs`,children:e.map((e,t)=>(0,x.jsxs)(`div`,{className:`py-0.5`,children:[(0,x.jsxs)(`div`,{className:`flex gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate text-foreground`,children:e.id}),(0,x.jsx)(`span`,{className:`ms-auto shrink-0 text-muted-foreground`,children:[e.updatedBy,e.updatedOn].filter(Boolean).join(` · `)})]}),(e.fields||[]).slice(0,6).map(e=>(0,x.jsxs)(`div`,{className:`truncate ps-3 text-muted-foreground`,children:[e.path,`: `,(0,x.jsx)(`span`,{className:`text-destructive-foreground`,children:D$(e.instance)}),` → `,(0,x.jsx)(`span`,{className:`text-foreground`,children:D$(e.file)})]},e.path)),e.diff&&(0,x.jsx)(`div`,{className:`ps-3 text-muted-foreground`,children:`file content differs`}),e.binary&&(0,x.jsx)(`div`,{className:`ps-3 text-muted-foreground`,children:`image replaced`})]},t))}),(0,x.jsxs)(`label`,{className:`mt-2.5 grid gap-1.5 text-xs`,children:[(0,x.jsxs)(`span`,{children:[`Type `,(0,x.jsx)(`span`,{className:`font-mono font-medium`,children:t||`(unknown portal)`}),` to confirm`]}),(0,x.jsx)(p7,{size:`compact`,mono:!0,value:n,onChange:e=>r(e.target.value),autoComplete:`off`})]})]})}function Zee(e){return/^Conflicts \(or records without a known base\)/.test(e)?`Conflicts are open (or records without a known base). Resolve them in the Push plan tab, or plan a force push to make the instance match the files.`:/merge conflict markers/i.test(e)?`Files still have merge conflict markers: finish the merge first.`:e.replace(/workspace_pull/g,`a pull`).replace(/workspace_push \{ dryRun: true \}/g,`a dry run`)}function D$(e){let t=typeof e==`string`?e:JSON.stringify(e);return t===void 0?`—`:t.length>60?`${t.slice(0,57)}…`:t}function Qee({progress:e}){let t=e?e.phase===`finishing`?96:(e.chunk-1)/e.of*92+4:4;return(0,x.jsxs)(`div`,{className:`rounded-lg border px-3 py-2.5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,x.jsx)(g8,{size:`sm`}),e?e.phase===`finishing`?`Written. Moving the base to the instance…`:`Writing chunk ${e.chunk} of ${e.of}…`:`Checking the plan on the instance…`]}),(0,x.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-foreground/8`,children:(0,x.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width] duration-500`,style:{width:`${t}%`}})})]})}function $ee({projectId:e}){let t=Wu(),n=ku(),r=t.pushOpen,i=U(n.projects.info.queryOptions({id:e})),a=U({...n.push.state.queryOptions({projectId:e}),enabled:r}),o=W(n.push.plan.mutationOptions()),s=W(n.push.run.mutationOptions()),[c,l]=b.useState(!1),[u,d]=b.useState(``),[f,p]=b.useState(!1),[m,h]=b.useState(``),g=i.data?.facts;b.useEffect(()=>{r&&(s.reset(),o.mutate({projectId:e,force:c}))},[r,c]);let _=()=>{s.isPending||(Uu({pushOpen:!1}),l(!1),d(``),p(!1))},v=o.data?.result,y=v?.chunks||[],S=y.reduce((e,t)=>e+(t.creates?.length||0)+(t.updates?.length||0)+(t.deactivates?.length||0)+(t.deletes?.length||0),0),C=s.data?.result,w=a.data?.plan,T=!!w&&w.result?.planHash===v?.planHash&&!!w.stale||!!s.error&&/dry run again|changed since/i.test(s.error.message)||!!C?.refused&&/dry run again|changed since/i.test(C.reason||``),E=[...new Set(y.flatMap(e=>e.warnings||[]))].filter(e=>!/^Force push:/.test(e)),D=v?.instanceChangesLeftAlone||[],O=!!v?.planHash&&!v?.refused&&!v?.nothingToPush&&!s.isPending&&!C&&(!c||u===g?.portal),k=c?`Force push`:`Push`,A=S?`${S} ${S===1?`change`:`changes`}`:v?.pending?`and finish`:``;return(0,x.jsx)(Kb,{open:r,onOpenChange:e=>!e&&_(),children:(0,x.jsx)(Jb,{className:`max-w-3xl`,title:`Push to ${g?.host||`the instance`}`,description:g?`${g.portal||`workspace`} → ${g.instance}${i.data?.profile?` · profile ${i.data.profile}`:``}`:void 0,footer:C&&!C.refused?C.failed?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(J,{variant:`outline`,onClick:_,children:`Close`}),(0,x.jsx)(J,{onClick:()=>{s.reset(),o.mutate({projectId:e,force:!1}),l(!1)},children:`Finish the push…`})]}):(0,x.jsx)(J,{onClick:_,children:`Done`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`label`,{className:`me-auto flex cursor-pointer items-center gap-2 text-xs text-muted-foreground select-none`,children:[(0,x.jsx)(h7,{checked:f,onCheckedChange:e=>p(!!e),disabled:s.isPending}),`Commit the files and forge.workspace.json after the push`]}),(0,x.jsx)(J,{variant:`outline`,onClick:_,disabled:s.isPending,children:`Cancel`}),T?(0,x.jsxs)(J,{disabled:o.isPending,onClick:()=>{s.reset(),o.mutate({projectId:e,force:c})},children:[o.isPending&&(0,x.jsx)(g8,{size:`sm`}),`Re-run dry run`]}):(0,x.jsxs)(J,{variant:c?`destructive`:`default`,disabled:!O||f&&!m.trim(),onClick:()=>s.mutate({projectId:e,planHash:v.planHash,force:c,...c?{confirm:u}:{},...f?{commit:{message:m.trim()}}:{}}),children:[s.isPending?(0,x.jsx)(g8,{size:`sm`}):(0,x.jsx)(Sh,{}),k,` `,A]})]}),children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-3 text-sm`,children:[g&&(0,x.jsxs)(`div`,{className:`grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-2 gap-y-1 text-xs`,children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`App`}),(0,x.jsx)(`span`,{children:v?.app||g.scope}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`Update set`}),(0,x.jsxs)(`span`,{children:[v?.updateSet||g.updateSet||`—`,v?.planHash&&(0,x.jsx)(`span`,{className:`text-success-foreground`,children:` · in progress ✓`})]}),v?.planHash&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`planHash`}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`span`,{className:`font-mono`,children:v.planHash}),(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· dry run `,yu(o.data?.at),` ·`,` `]}),T?(0,x.jsx)(`span`,{className:`text-warning-foreground`,children:`files changed since`}):(0,x.jsx)(`span`,{className:`text-success-foreground`,children:`files unchanged since ✓`})]})]})]}),o.isPending&&(0,x.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-muted-foreground`,children:[(0,x.jsx)(g8,{size:`sm`}),` Running the dry run on the instance…`]}),o.error&&(0,x.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/6 px-3 py-2 text-destructive-foreground`,children:o.error.message}),v?.refused&&!o.isPending&&(0,x.jsxs)(`div`,{className:`rounded-lg border border-warning/30 bg-warning/6 px-3 py-2.5`,children:[(0,x.jsxs)(`div`,{className:`font-medium text-warning-foreground`,children:[`Can’t push yet. `,Zee(v.reason)]}),Array.isArray(v.conflicts)&&v.conflicts.length>0&&(0,x.jsx)(`div`,{className:`mt-1.5 font-mono text-xs`,children:v.conflicts.slice(0,20).map(e=>(0,x.jsxs)(`div`,{className:`flex gap-2 py-0.5`,children:[(0,x.jsx)(`span`,{className:`truncate`,children:e.key}),(0,x.jsx)(`span`,{className:`ms-auto shrink-0 text-muted-foreground`,children:[e.updatedBy,e.updatedOn].filter(Boolean).join(` · `)})]},e.key))}),(0,x.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>{_(),Uu({panelOpen:!0,panelTab:`plan`})},children:`Resolve in Push plan`}),!c&&Array.isArray(v.conflicts)&&(0,x.jsx)(J,{size:`xs`,variant:`destructive-outline`,onClick:()=>l(!0),children:`Plan a force push…`})]})]}),v?.nothingToPush&&!o.isPending&&(0,x.jsxs)(`div`,{className:`flex items-center gap-2 py-4 text-muted-foreground`,children:[(0,x.jsx)(qd,{className:`size-4 text-success-foreground`}),` Nothing to push: the instance has everything.`]}),v?.planHash&&!o.isPending&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:`Planned writes`}),(0,x.jsx)(Yee,{chunks:y})]}),v.pending&&(0,x.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-info-foreground`,children:[(0,x.jsx)(op,{className:`mt-0.5 size-3.5 shrink-0`}),`Also finishes the last push: the compiles and reprocess it still owed.`]}),E.map(e=>(0,x.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-warning-foreground`,children:[(0,x.jsx)(bh,{className:`mt-0.5 size-3.5 shrink-0`}),` `,e]},e)),D.length>0&&(0,x.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-muted-foreground`,children:[(0,x.jsx)(op,{className:`mt-0.5 size-3.5 shrink-0`}),D.length,` instance change`,D.length===1?``:`s`,` left alone (`,D.slice(0,3).map(e=>e.id).join(`, `),D.length>3?`, …`:``,`): a pull takes them.`]}),(v.problems||[]).map(e=>(0,x.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-warning-foreground`,children:[(0,x.jsx)(bh,{className:`mt-0.5 size-3.5 shrink-0`}),` `,e]},e))]}),c&&v?.planHash&&!o.isPending&&(0,x.jsx)(Xee,{overwrites:v.overwrites||[],slug:g?.portal||``,typed:u,onType:d}),f&&!C&&(0,x.jsx)(p7,{size:`compact`,value:m,onChange:e=>h(e.target.value),placeholder:`Commit message, e.g. feat: stalled deals KPI`,"aria-label":`Commit message`}),s.isPending&&(0,x.jsx)(Qee,{progress:a.data?.progress||null}),s.error&&!T&&(0,x.jsx)(`div`,{className:`text-destructive-foreground`,children:s.error.message}),T&&(s.error||C?.refused)&&(0,x.jsx)(`div`,{className:`text-warning-foreground`,children:s.error?.message||C?.reason}),C&&!C.refused&&(0,x.jsx)(ete,{done:C,commit:s.data?.commit}),(0,x.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-muted-foreground`,children:[(0,x.jsx)(op,{className:`mt-0.5 size-3.5 shrink-0`}),`Pushes aren’t undone by Forge. To roll back, revert the files and push again.`]})]})})})}function ete({done:e,commit:t}){if(e.failed)return(0,x.jsxs)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/6 px-3 py-2.5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 font-medium text-destructive-foreground`,children:[(0,x.jsx)($d,{className:`size-4`}),` Chunk `,e.failed.chunk,` of `,e.failed.of,` failed:`,` `,e.failed.message]}),(0,x.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.failed.chunk>1?`Chunks 1–${e.failed.chunk-1} were written. `:``,e.note]}),e.rebased>0&&(0,x.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.rebased,` written record(s) now match the files: their base moved to the instance.`]})]});let n=e.status?.counts||{};return(0,x.jsxs)(`div`,{className:`rounded-lg border px-3 py-2.5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 font-medium text-success-foreground`,children:[(0,x.jsx)(qd,{className:`size-4`}),` Pushed `,e.pushed,` file`,e.pushed===1?``:`s`,` and record`,e.pushed===1?``:`s`,e.ms?(0,x.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[` · `,(e.ms/1e3).toFixed(1),` s`]}):null]}),(0,x.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.status?.clean?`The workspace is clean: the new base is the instance.`:`The new base is the instance for what was pushed. Still open: ${n.local||0} local, ${n.instance||0} instance, ${n.conflicts||0} conflicts.`,e.rebased?` ${e.rebased} record(s) rebased.`:``]}),Array.isArray(e.notConverged)&&e.notConverged.length>0&&(0,x.jsxs)(`div`,{className:`mt-1 text-xs text-warning-foreground`,children:[`Not matching after the push: `,e.notConverged.map(e=>e.id).join(`, `)]}),e.overwritten&&(0,x.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[`The overwritten instance values are kept in `,(0,x.jsx)(`span`,{className:`font-mono`,children:e.overwritten}),`.`]}),t&&(0,x.jsxs)(`div`,{className:K(`mt-1 text-xs`,t.ok?`text-muted-foreground`:`text-warning-foreground`),children:[`git: `,t.message]})]})}function O$({projectId:e,chatId:t}){let n=Wu(),r=U(ku().projects.get.queryOptions({id:e})),i=D8(e);return b.useEffect(()=>{r.data&&(document.title=`rpf forge · ${r.data.name}`)},[r.data]),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-1`,children:[(0,x.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[t?(0,x.jsx)(bQ,{projectId:e,chatId:t}):(0,x.jsx)(tte,{projectId:e,name:r.data?.name||``}),(0,x.jsx)(JQ,{projectId:e})]}),n.panelOpen&&(0,x.jsx)(Uee,{projectId:e,dev:i.status,onRestart:i.restart}),(0,x.jsx)($ee,{projectId:e})]})}function tte({projectId:e,name:t}){let n=U(ku().settings.get.queryOptions()),r=wQ(e),[i,a]=b.useState(null),o=n.data?.projects[e]?.chat||n.data?.defaults.chat||null,s=i||o;return(0,x.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,x.jsx)(CQ,{title:`New chat`,projectName:t,projectId:e}),(0,x.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 sm:px-12`,children:[(0,x.jsx)(`div`,{className:`shrink-0`,style:{flexBasis:`max(0px, calc(50% - 5rem))`}}),(0,x.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col items-center pb-4`,children:[(0,x.jsx)(zw,{}),(0,x.jsxs)(`h1`,{className:`text-center text-2xl font-normal tracking-tight text-foreground sm:text-3xl`,children:[`What should we build in `,(0,x.jsx)(`span`,{className:`font-medium`,children:t||`…`}),`?`]})]}),(0,x.jsx)(zC,{autoFocus:!0,model:s,onModel:a,onSend:(e,t)=>r(e,s,t),placeholder:`Describe a change, ask about the portal, or paste an error`})]})]})}function k$({label:e,onClose:t,children:n}){let[r,i]=b.useState(!0),a=b.useRef(!1),o=b.useRef(null);return(0,x.jsx)(ub,{open:r,disablePointerDismissal:!0,onOpenChange:(e,t)=>{if(!e){if(t.reason===`escape-key`&&t.event.repeat)return t.cancel();i(!1)}},onOpenChangeComplete:e=>{e||t()},children:(0,x.jsxs)(lb,{children:[(0,x.jsx)(nb,{className:`dialog-backdrop fixed inset-0 z-50 transition-all duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0`}),(0,x.jsx)(gee,{className:`fixed inset-0 z-50 flex items-center justify-center sm:p-6 lg:p-10`,onPointerDown:e=>{a.current=e.target===e.currentTarget},onClick:e=>{a.current&&e.target===e.currentTarget&&i(!1),a.current=!1},children:(0,x.jsx)(cb,{ref:o,initialFocus:o,"aria-label":e,className:`relative flex size-full min-h-0 min-w-0 flex-col overflow-hidden bg-background text-foreground outline-none transition-[opacity,scale] duration-150 ease-out data-[ending-style]:scale-[0.985] data-[ending-style]:opacity-0 data-[starting-style]:scale-[0.985] data-[starting-style]:opacity-0 sm:max-h-[60rem] sm:max-w-[80rem] sm:rounded-2xl sm:border sm:shadow-2xl/40`,children:n})})]})})}function A$(){return(0,x.jsx)(Gb,{label:`Close (Esc)`,children:(0,x.jsx)(rb,{"aria-label":`Close`,render:(0,x.jsx)(J,{size:`icon-sm`,variant:`ghost`}),children:(0,x.jsx)(Oh,{})})})}function j$(){let e=Pa({select:e=>e.location.pathname});return/^\/p\/([^/]+)/.exec(e)?.[1]||``}function M$({label:e,onClick:t}){return(0,x.jsx)(Gb,{label:e,children:(0,x.jsx)(J,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":e,onClick:t,children:(0,x.jsx)(Am,{className:`size-3`})})})}function N$({value:e,options:t,onChange:n,label:r}){return(0,x.jsx)(`div`,{role:`radiogroup`,"aria-label":r,className:`inline-flex rounded-[var(--control-radius)] border border-input p-0.5`,children:t.map(t=>(0,x.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e===t.id,onClick:()=>n(t.id),className:K(`inline-flex h-6 items-center gap-1.5 rounded-md px-2.5 text-xs`,e===t.id?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`),children:t.label},t.id))})}function nte(){let e=j$(),[t,n]=b.useState(null),r=t??e;return r?(0,x.jsx)(ate,{id:r,onBack:()=>n(``)}):(0,x.jsx)(rte,{onPick:n})}function rte({onPick:e}){let t=U(ku().projects.list.queryOptions()),n=t.data||[];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(ow,{title:`Projects`,children:[n.length===0&&!t.isLoading&&(0,x.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-muted-foreground`,children:`No projects yet. Create or open one from the sidebar.`}),n.length>0&&(0,x.jsx)(`p`,{className:`px-3 pt-3 pb-1 text-xs text-muted-foreground sm:px-4`,children:`Choose a project to manage its name, model defaults and place in Forge.`}),n.map(t=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>e(t.id),className:`flex w-full min-w-0 cursor-pointer items-center gap-3 px-3 py-3 text-left outline-none first:rounded-t-xl last:rounded-b-xl hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset sm:px-4`,children:[(0,x.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded bg-foreground/8 text-[10px] font-semibold text-muted-foreground uppercase`,children:t.name.slice(0,1)}),(0,x.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:t.name}),(0,x.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[t.missing?`Folder missing · `:``,t.path]})]}),(0,x.jsx)(Ud,{className:`size-4 shrink-0 text-muted-foreground`})]},t.id))]}),(0,x.jsx)(ite,{})]})}function ite(){let e=ku(),t=C(),n=U(e.meta.queryOptions()),r=U(e.settings.get.queryOptions()),i=W(e.settings.setProjectsHome.mutationOptions({onSuccess:()=>t.invalidateQueries({queryKey:e.meta.queryKey()})})),a=r.data?.projectsHome,[o,s]=b.useState(null),c=o??a??``;return(0,x.jsx)(ow,{title:`New projects`,children:(0,x.jsxs)(sw,{title:`Projects folder`,description:(0,x.jsxs)(x.Fragment,{children:[`New portals are pulled into a folder here. Now:`,` `,(0,x.jsx)(`code`,{className:`font-mono`,children:n.data?.projectsHome}),i.error&&(0,x.jsx)(`span`,{className:`block text-destructive-foreground`,children:i.error.message})]}),children:[a&&(0,x.jsx)(M$,{label:`Use the default folder`,onClick:()=>i.mutate({path:``})}),(0,x.jsx)(p7,{size:`compact`,mono:!0,className:`w-64`,placeholder:`~/rpf-projects`,"aria-label":`Projects folder`,value:c,onChange:e=>s(e.target.value),onBlur:()=>{o!==null&&o!==(a??``)&&i.mutate({path:o}),s(null)}})]})})}function ate({id:e,onBack:t}){let n=ku(),r=T8(),i=U(n.projects.list.queryOptions()),a=i.data?.find(t=>t.id===e),o=U({...n.projects.info.queryOptions({id:e}),enabled:!!a}),s=U({...n.chats.list.queryOptions({projectId:e}),enabled:!!a}),c=U(n.settings.get.queryOptions()),l=W(n.projects.rename.mutationOptions()),u=W(n.projects.remove.mutationOptions()),[d,f]=b.useState(null),[p,m]=b.useState(!1);if(!a)return(0,x.jsx)(ow,{title:`Projects`,action:(0,x.jsx)(P$,{onClick:t}),children:(0,x.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-muted-foreground`,children:i.isLoading?`Loading…`:`This project is no longer in Forge.`})});let h=o.data?.facts,g=c.data?.projects?.[e],_=a.name!==a.folderName;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(ow,{title:a.name,action:(0,x.jsx)(P$,{onClick:t}),children:[(0,x.jsxs)(sw,{title:`Name`,description:`Shown in the sidebar and the projects list. The folder keeps its name.`,children:[_&&(0,x.jsx)(M$,{label:`Use the folder name`,onClick:()=>l.mutate({id:e,name:``})}),(0,x.jsx)(p7,{size:`compact`,className:`w-56`,"aria-label":`Project name`,value:d??a.name,onChange:e=>f(e.target.value),onBlur:()=>{d!==null&&d.trim()&&d.trim()!==a.name&&l.mutate({id:e,name:d.trim()}),f(null)}})]}),(0,x.jsx)(sw,{title:`Folder`,description:a.missing?(0,x.jsx)(`span`,{className:`text-warning-foreground`,children:`The folder no longer exists.`}):`Forge reads and edits files here. Chats live in the rpf home, never in the folder.`,children:(0,x.jsxs)(`code`,{className:`flex min-w-0 items-center gap-1.5 self-center font-mono text-xs text-muted-foreground`,children:[(0,x.jsx)(Bf,{className:`size-3.5 shrink-0`}),(0,x.jsx)(`span`,{className:`truncate`,title:a.path,children:a.path})]})}),(0,x.jsx)(sw,{title:`Instance`,description:h?[h.scope&&`App ${h.appName||h.scope}`,h.updateSet&&`update set “${h.updateSet}”`].filter(Boolean).join(` · `)||`From forge.workspace.json`:`Not a React Portal workspace (no forge.workspace.json).`,children:h?.instance?o.data?.profile?(0,x.jsxs)(`span`,{className:`self-center text-xs`,children:[o.data.profile,` · `,h.host]}):(0,x.jsxs)(J,{size:`xs`,variant:`outline`,onClick:()=>r(`instances`),children:[`No profile for `,h.host,` · Add`]}):null}),(0,x.jsxs)(sw,{title:`Models`,description:g?.chat||g?.helper?`Overridden for this project: new chats here start with its own model.`:`Uses your defaults from Providers and models.`,children:[!!(g?.chat||g?.helper)&&(0,x.jsx)(Xb,{variant:`info`,children:`Overridden`}),(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>r(`providers`),children:`Change`})]}),(0,x.jsx)(sw,{title:`Chats`,description:`Kept in the rpf home, keyed by this folder.`,children:(0,x.jsxs)(`span`,{className:`self-center text-xs text-muted-foreground tabular-nums`,children:[s.data?.length??`…`,` `,s.data?.length===1?`chat`:`chats`,o.data?.lastActivity?` · active ${vu(o.data.lastActivity)} ago`:``]})})]}),(0,x.jsx)(ow,{title:`Danger`,children:(0,x.jsx)(sw,{title:`Remove project`,description:`Removes the project from Forge. Its chats stay in the rpf home and files on disk are not touched.`,children:p?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,onClick:()=>m(!1),children:`Cancel`}),(0,x.jsxs)(J,{size:`xs`,variant:`destructive`,onClick:()=>u.mutate({id:e},{onSuccess:t}),children:[`Remove `,a.name]})]}):(0,x.jsx)(J,{size:`xs`,variant:`destructive-outline`,onClick:()=>m(!0),children:`Remove project`})})})]})}function P$({onClick:e}){return(0,x.jsxs)(J,{size:`xs`,variant:`ghost-muted`,onClick:e,children:[(0,x.jsx)(hd,{}),` All projects`]})}function F$({value:e}){return(0,x.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,children:Pu(e).map((e,t)=>(0,x.jsx)(Zb,{children:e},t))})}function ote(){let e=ku(),t=U(e.settings.get.queryOptions()),n=W(e.settings.setKeybinding.mutationOptions()),r=t.data?.keybindings||[],[i,a]=b.useState(``),o=Iu(r),s=i.trim().toLowerCase(),c=Au.filter(e=>!s||e.label.toLowerCase().includes(s)||e.id.toLowerCase().includes(s)||Fu(ju(e,r)).toLowerCase().includes(s)),l=[...new Set(c.map(e=>e.group))];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ow,{title:`Keybindings`,action:(0,x.jsx)(Gb,{label:`The browser may claim some shortcuts first (Ctrl+N, Ctrl+W, Ctrl+T).`,children:(0,x.jsx)(J,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first`,children:(0,x.jsx)(bh,{className:`size-3.5 text-warning-foreground`})})}),children:(0,x.jsx)(`div`,{className:`flex items-center gap-2 px-3 py-3 sm:px-4`,children:(0,x.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,x.jsx)(Rm,{className:`pointer-events-none absolute top-1/2 left-2.5 z-10 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,x.jsx)(p7,{size:`compact`,className:`[&_input]:ps-7.5`,placeholder:`Search keybindings`,"aria-label":`Search keybindings`,value:i,onChange:e=>a(e.target.value)})]})})}),l.length===0&&(0,x.jsx)(`div`,{className:`rounded-xl border border-border/60 bg-card/40 px-4 py-12 text-center text-sm text-muted-foreground`,children:`No keybindings match your search.`}),l.map(e=>(0,x.jsx)(ow,{title:e,children:c.filter(t=>t.group===e).map(e=>(0,x.jsx)(ste,{cmd:e,value:ju(e,r),custom:r.some(t=>t.command===e.id),clashes:(o.get(ju(e,r))||[]).filter(t=>t!==e.id),onSave:t=>n.mutate({command:e.id,key:t===e.key?null:t}),onReset:()=>n.mutate({command:e.id,key:null})},e.id))},e))]})}function ste({cmd:e,value:t,custom:n,clashes:r,onSave:i,onReset:a}){let[o,s]=b.useState(!1),[c,l]=b.useState(null),u=b.useRef(null),d=c!==null&&c!==t,f=e=>Au.find(t=>t.id===e)?.label||e;return(0,x.jsxs)(`div`,{className:`group/row grid items-center gap-x-8 gap-y-2 px-3 py-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:px-4`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,title:e.id,children:[e.label,n&&(0,x.jsx)(Xb,{variant:`outline`,children:`Custom`})]}),(0,x.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:!t&&!d?`No keyboard shortcut assigned. Click Unassigned to set one.`:n&&e.key?`Default: ${Fu(e.key)}`:e.inFields?`Works while typing too`:`Not while typing in a field`})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[r.length>0&&!d&&(0,x.jsx)(Gb,{label:`Conflicts with ${r.map(f).join(`, `)}.`,children:(0,x.jsx)(`span`,{tabIndex:0,"aria-label":`Conflicts with ${r.map(f).join(`, `)}`,className:`inline-flex size-6 items-center justify-center text-warning-foreground`,children:(0,x.jsx)(bh,{className:`size-3.5`})})}),(0,x.jsx)(`span`,{className:`flex items-center opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100 has-[[data-popup-open]]:opacity-100`,children:(0,x.jsxs)(Pb,{children:[(0,x.jsx)(Fb,{render:(0,x.jsx)(J,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Actions for ${e.label}`}),children:(0,x.jsx)(vf,{})}),(0,x.jsxs)(Ib,{align:`end`,children:[(0,x.jsx)(Lb,{disabled:!n,onClick:a,children:`Reset to default`}),(0,x.jsx)(Lb,{disabled:!t,onClick:()=>i(``),children:`Unassign`})]})]})}),d&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(J,{size:`sm`,variant:`ghost-muted`,onClick:()=>l(null),children:`Cancel`}),(0,x.jsx)(J,{size:`sm`,onClick:()=>{i(c),l(null)},children:`Save`})]}),!o&&!d?(0,x.jsx)(`button`,{ref:u,type:`button`,onClick:()=>s(!0),"aria-label":`Edit shortcut for ${e.label}: ${t?Fu(t):`Unassigned`}`,className:`-mr-1.5 inline-flex h-7 cursor-pointer items-center rounded-md border border-transparent px-1.5 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/24 focus-visible:ring-inset`,children:t?(0,x.jsx)(F$,{value:t}):(0,x.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Unassigned`})}):d&&!o?(0,x.jsx)(`button`,{type:`button`,onClick:()=>s(!0),className:`inline-flex h-7 items-center rounded-md border border-border/70 px-1.5`,"aria-label":`Record again`,children:(0,x.jsx)(F$,{value:c})}):(0,x.jsx)(`span`,{"data-keybinding-capture":``,children:(0,x.jsx)(p7,{autoFocus:!0,size:`compact`,mono:!0,className:`w-44`,readOnly:!0,"aria-label":`Keybinding for ${e.label}`,placeholder:`Press shortcut`,value:``,onBlur:()=>s(!1),onKeyDown:e=>{if(e.key===`Tab`&&!o)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey){l(null),s(!1),requestAnimationFrame(()=>u.current?.focus());return}let t=Nu(e.nativeEvent);t&&(l(t),s(!1))}})})]})]})}var I$={layout:`stacked`,ignoreWhitespace:!1,colors:`red-green`};function cte(){let e=ku(),t=U(e.settings.get.queryOptions()),n=W(e.settings.setDiffs.mutationOptions()),r={...I$,...t.data?.diffs||{}};return(0,x.jsxs)(ow,{title:`Diffs`,children:[(0,x.jsxs)(sw,{title:`Diff layout`,description:`Show diffs stacked or side by side. The toggle in the Diff tab changes this too.`,children:[r.layout!==I$.layout&&(0,x.jsx)(M$,{label:`Reset diff layout to default`,onClick:()=>n.mutate({layout:`stacked`})}),(0,x.jsx)(N$,{label:`Diff layout`,value:r.layout,options:[{id:`stacked`,label:`Stacked`},{id:`split`,label:`Side by side`}],onChange:e=>n.mutate({layout:e})})]}),(0,x.jsxs)(sw,{title:`Hide whitespace changes`,description:`Set whether diffs ignore whitespace-only edits by default.`,children:[r.ignoreWhitespace!==I$.ignoreWhitespace&&(0,x.jsx)(M$,{label:`Reset whitespace changes to default`,onClick:()=>n.mutate({ignoreWhitespace:!1})}),(0,x.jsx)(g7,{checked:r.ignoreWhitespace,"aria-label":`Hide whitespace changes by default`,onCheckedChange:e=>n.mutate({ignoreWhitespace:!!e})})]}),(0,x.jsxs)(sw,{title:`Diff colors`,description:`Choose colors for additions and deletions, including change counts.`,children:[r.colors!==I$.colors&&(0,x.jsx)(M$,{label:`Reset diff colors to default`,onClick:()=>n.mutate({colors:`red-green`})}),(0,x.jsx)(N$,{label:`Diff colors`,value:r.colors,options:[{id:`red-green`,label:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(L$,{a:`var(--destructive)`,b:`var(--success)`}),` Red & green`]})},{id:`blue-orange`,label:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(L$,{a:`oklch(0.646 0.222 41.116)`,b:`oklch(0.546 0.245 262.881)`}),` Blue & orange`]})}],onChange:e=>n.mutate({colors:e})})]})]})}function L$({a:e,b:t}){return(0,x.jsxs)(`span`,{"aria-hidden":!0,className:`flex shrink-0 gap-1`,children:[(0,x.jsx)(`span`,{className:`size-2 rounded-full`,style:{backgroundColor:e}}),(0,x.jsx)(`span`,{className:`size-2 rounded-full`,style:{backgroundColor:t}})]})}function lte(){let e=ku(),t=T8(),n=U(e.meta.queryOptions()),r=U(e.about.update.queryOptions()),i=W(e.about.checkUpdate.mutationOptions()),a=W(e.settings.setOnboarded.mutationOptions()),o=Ji(),[s,c]=b.useState(!1),l=n.data?.version||``,u=r.data,d=u?u.status===`disabled`?u.message:u.status===`error`?`Couldn't check for updates: ${u.message}`:u.status===`installed`||u.status===`restarting`?`rpf ${u.installedVersion??u.latest} is installed. Restart Forge to run it.`:u.newer?`rpf ${u.latest} is available.${u.command?` Update with: ${u.command}`:``}`:u.checkedAt?`Up to date · checked ${vu(u.checkedAt)===`now`?`just now`:`${vu(u.checkedAt)} ago`}.`:`Current version of rpf.`:`Current version of rpf.`;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(ow,{title:`App`,children:[(0,x.jsx)(sw,{title:(0,x.jsxs)(`span`,{className:`inline-flex items-baseline gap-2`,children:[`Version`,(0,x.jsx)(Gb,{label:s?`Copied`:`Copy version`,children:(0,x.jsxs)(`button`,{type:`button`,"aria-label":`Copy version ${l}`,onClick:()=>{navigator.clipboard?.writeText(l),c(!0),setTimeout(()=>c(!1),1500)},className:`inline-flex items-center gap-1 rounded font-mono text-2xs font-medium text-muted-foreground hover:text-foreground`,children:[l,(0,x.jsx)(uf,{className:`size-3`})]})})]}),description:(0,x.jsxs)(x.Fragment,{children:[d,i.error&&(0,x.jsx)(`span`,{className:`block text-destructive-foreground`,children:i.error.message})]}),children:(0,x.jsx)(J,{size:`sm`,variant:`outline`,disabled:i.isPending||!u||!u.enabled||[`checking`,`installing`,`restarting`].includes(u.status),onClick:()=>i.mutate(),children:i.isPending||u?.status===`checking`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(g8,{size:`xs`}),` Checking…`]}):u?.status===`up-to-date`?`Up to date`:`Check for updates`})}),(0,x.jsx)(sw,{title:`Welcome page`,description:`See your instances and AI providers, and start a first project.`,children:(0,x.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>a.mutate({done:!1},{onSuccess:()=>o({to:`/welcome`,search:{}})}),children:`Open`})}),u&&[`available`,`installing`,`installed`,`restarting`].includes(u.status)&&(0,x.jsx)(mte,{st:u})]}),(0,x.jsx)(ow,{title:`Legal`,children:(0,x.jsx)(sw,{title:`Open-source licenses`,description:`Notices for the libraries bundled in Forge.`,children:(0,x.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>t(`licenses`),children:`View licenses`})})})]})}function ute(){let e=U({...ku().about.notices.queryOptions(),retry:!1,staleTime:1/0}),[t,n]=b.useState(``),[r,i]=b.useState(!1),[a,o]=b.useState(null),s=e.data?.entries||[],c=t.trim().toLowerCase(),l=s.filter(e=>!c||e.name.toLowerCase().includes(c)||e.license.toLowerCase().includes(c)),u=(0,x.jsx)(`p`,{className:`text-xs font-normal whitespace-nowrap text-muted-foreground tabular-nums`,children:l.length===s.length?`${s.length} notices`:`${l.length} of ${s.length}`});return(0,x.jsx)(ow,{title:`Third-party notices`,action:e.data&&(r?(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`hidden sm:block`,children:u}),(0,x.jsxs)(`div`,{className:`relative w-44`,children:[(0,x.jsx)(Rm,{className:`pointer-events-none absolute top-1/2 left-2.5 z-10 size-3 -translate-y-1/2 text-muted-foreground`}),(0,x.jsx)(p7,{autoFocus:!0,size:`compact`,className:`[&_input]:ps-7`,type:`search`,placeholder:`Search licenses`,"aria-label":`Search open-source licenses`,value:t,onChange:e=>n(e.target.value),onBlur:()=>!t&&i(!1),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n(``),i(!1))}})]})]}):(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[u,(0,x.jsx)(Gb,{label:`Search licenses`,children:(0,x.jsx)(J,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Search open-source licenses`,onClick:()=>i(!0),children:(0,x.jsx)(Rm,{className:`size-3`})})})]})),children:e.error?(0,x.jsxs)(`div`,{className:`flex flex-col items-start gap-3 px-3 py-5 sm:px-4`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h3`,{className:`text-sm font-medium`,children:`Open-source notices are unavailable`}),(0,x.jsx)(`p`,{className:`mt-1 max-w-[70ch] text-xs text-muted-foreground/80`,children:e.error.message})]}),(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:()=>e.refetch(),children:`Try again`})]}):e.data?l.length===0?(0,x.jsx)(`p`,{className:`px-3 py-8 text-center text-sm text-muted-foreground sm:px-4`,children:`No licenses match that search.`}):l.map(e=>{let t=`${e.name}@${e.version}`,n=a===t;return(0,x.jsxs)(`article`,{children:[(0,x.jsxs)(`div`,{className:`flex min-h-9 items-center hover:bg-muted/35`,children:[(0,x.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>o(n?null:t),className:`group flex min-h-9 min-w-0 flex-1 items-center gap-2.5 px-3 text-left text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset sm:px-4`,children:[(0,x.jsx)(Ud,{"aria-hidden":!0,className:K(`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200`,n&&`rotate-90`)}),(0,x.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate font-medium`,children:e.name}),(0,x.jsx)(`code`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.version})]}),(0,x.jsx)(`span`,{className:`max-w-[42%] shrink-0 truncate text-xs text-muted-foreground`,children:e.license||`see notice`})]}),(0,x.jsx)(Gb,{label:`Project page`,children:(0,x.jsx)(`a`,{href:e.sourceUrl,target:`_blank`,rel:`noreferrer noopener`,"aria-label":`View the project page for ${e.name}`,className:`me-3 inline-flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground sm:me-4`,children:(0,x.jsx)(bf,{"aria-hidden":!0,className:`size-3`})})})]}),n&&(0,x.jsx)(`div`,{className:`px-9 pt-1 pb-4 sm:px-10`,children:(0,x.jsx)(`pre`,{className:`max-w-[76ch] font-mono text-xs/5 break-words whitespace-pre-wrap text-foreground/80`,children:e.text})})]},t)}):(0,x.jsx)(`p`,{className:`px-3 py-5 text-sm text-muted-foreground sm:px-4`,children:`Loading open-source notices…`})})}function dte({level:e}){return e===`ok`?(0,x.jsx)(qd,{className:`size-4 text-success-foreground`}):e===`warn`?(0,x.jsx)(bh,{className:`size-4 text-warning-foreground`}):e===`fail`?(0,x.jsx)($d,{className:`size-4 text-destructive-foreground`}):(0,x.jsx)(op,{className:`size-4 text-muted-foreground`})}function fte(){let e=ku(),t=j$(),n=U({...e.profiles.list.queryOptions(),retry:!1}),r=U({...e.projects.info.queryOptions({id:t}),enabled:!!t}),i=W(e.tools.doctor.mutationOptions()),[a,o]=b.useState(``),[s,c]=b.useState(!1),l=(n.data?.profiles||[]).map(e=>e.name),u=a||r.data?.profile||n.data?.default||``,d=i.data?.checks||[],f=[`fail`,`warn`,`ok`].map(e=>[e,d.filter(t=>t.level===e).length]);return(0,x.jsxs)(ow,{title:`Doctor`,action:i.data&&(0,x.jsxs)(J,{size:`xs`,variant:`ghost-muted`,onClick:()=>{navigator.clipboard?.writeText(JSON.stringify(i.data,null,2)),c(!0),setTimeout(()=>c(!1),1500)},children:[(0,x.jsx)(uf,{}),` `,s?`Copied`:`Copy as JSON`]}),children:[(0,x.jsxs)(sw,{title:`Check this computer and an instance`,description:`Node, rpf's toolchain, git, the credential store, the profile and its token, the workspace, and the instance (Forge on, roles, API level, React Portal and Global Helpers versions).`,children:[(0,x.jsxs)(`select`,{"aria-label":`Profile`,value:u,onChange:e=>o(e.target.value),className:`h-7 rounded-md border border-input bg-background px-2 text-xs dark:bg-input/32`,children:[!l.length&&(0,x.jsx)(`option`,{value:``,children:`No profiles`}),l.map(e=>(0,x.jsx)(`option`,{value:e,children:e},e))]}),(0,x.jsx)(J,{size:`sm`,variant:`outline`,disabled:i.isPending,onClick:()=>i.mutate({profile:u||void 0,projectId:t||void 0}),children:i.isPending?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(g8,{size:`xs`}),` Checking…`]}):i.data?`Run again`:`Run checks`})]}),i.error&&(0,x.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive-foreground`,children:i.error.message}),d.length>0&&(0,x.jsxs)(`div`,{className:`px-3 py-2 sm:px-4`,children:[(0,x.jsx)(`p`,{className:`pb-1 text-xs text-muted-foreground`,children:f.map(([e,t])=>`${t} ${e===`ok`?`ok`:e===`warn`?`warning`+(t===1?``:`s`):`failed`}`).join(` · `)}),d.map((e,t)=>(0,x.jsxs)(`div`,{className:`flex min-h-8 items-start gap-2.5 py-1`,children:[(0,x.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:(0,x.jsx)(dte,{level:e.level})}),(0,x.jsxs)(`span`,{className:`min-w-0 text-sm`,children:[e.message,e.fix&&(0,x.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[`→ `,e.fix]})]})]},`${e.id}-${t}`))]})]})}function pte(){let e=ku(),t=C(),n=j$(),r=U({...e.tools.skills.queryOptions({projectId:n||void 0}),retry:!1}),i=W(e.tools.syncSkills.mutationOptions({onSuccess:()=>t.invalidateQueries({queryKey:e.tools.skills.queryKey()})})),[a,o]=b.useState(``),s=r.data,c=(s?.installed||[]).filter(e=>n||e.where===`global`),l=i.data?.skills;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(ow,{title:`Skills`,children:[r.isLoading&&(0,x.jsx)(`p`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`Reading skills…`}),r.error&&(0,x.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive-foreground`,children:r.error.message}),(s?.bundled||[]).map(e=>(0,x.jsx)(sw,{title:e.name,description:e.description,children:(0,x.jsxs)(`span`,{className:`self-center text-xs text-muted-foreground tabular-nums`,children:[e.files.length,` `,e.files.length===1?`file`:`files`,` · rpf `,s.version]})},e.name))]}),c.map(e=>{let t=e.where===`global`?`global`:`project`,r=e.skills.some(e=>e.state!==`not-installed`),s=e.skills.some(e=>e.state===`edited`);return(0,x.jsxs)(ow,{title:t===`global`?`Installed for every project`:`Installed in this project`,action:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(J,{size:`xs`,variant:`outline`,disabled:i.isPending,onClick:()=>i.mutate({projectId:n||void 0,mode:r?`update`:`install`,global:t===`global`,force:!1}),children:r?`Update`:`Install`}),s&&(a===t?(0,x.jsx)(J,{size:`xs`,variant:`destructive`,onClick:()=>{o(``),i.mutate({projectId:n||void 0,mode:`update`,global:t===`global`,force:!0})},children:`Overwrite my edits`}):(0,x.jsx)(J,{size:`xs`,variant:`ghost-muted`,onClick:()=>o(t),children:`Force…`}))]}),children:[(0,x.jsx)(`p`,{className:`px-3 pt-3 font-mono text-2xs break-all text-muted-foreground sm:px-4`,children:e.root}),e.skills.map(e=>(0,x.jsx)(sw,{title:e.name,description:e.state===`edited`?`Edited: ${e.edited.join(`, `)} (kept on update; Force saves yours as .orig)`:e.state===`outdated`?`An update is available${e.version?` (installed from rpf ${e.version})`:``}`:e.state===`up-to-date`?`Up to date${e.version?` · from rpf ${e.version}`:``}`:`Not installed`,children:(0,x.jsx)(Xb,{variant:e.state===`up-to-date`?`success`:e.state===`not-installed`?`outline`:`warning`,children:e.state===`up-to-date`?`up to date`:e.state===`not-installed`?`not installed`:e.state})},e.name))]},e.where)}),i.error&&(0,x.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:i.error.message}),l&&(0,x.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:l.map(e=>`${e.name}: ${e.action.replace(`-`,` `)}${e.edited?.length?` (kept ${e.edited.length} edited)`:``}${e.overwritten?.length?` (yours saved as .orig)`:``}`).join(` · `)})]})}function mte({st:e}){let t=ku(),n=W(t.about.runUpdate.mutationOptions()),r=W(t.about.restart.mutationOptions()),[i,a]=b.useState(e.log);b.useEffect(()=>{let e=e=>{let t=e.detail;t.line!==void 0&&a(e=>[...e,t.line].slice(-200))};return window.addEventListener(`forge:update`,e),()=>window.removeEventListener(`forge:update`,e)},[]),b.useEffect(()=>{e.status===`installing`&&!e.log.length&&a([])},[e.status,e.log.length]);let o=e.installedVersion??e.latest,s=e.status===`installed`?e.errorContext===`restart`?e.message:e.canRestart?`Installed. Restart Forge to run rpf ${o}.`:`Installed. ${r.data?.message||`Restart Forge (Ctrl+C in its terminal, then rpf forge) to run the new version.`}`:e.status===`restarting`?`Restarting Forge…`:e.errorContext===`install`?e.message:``;return(0,x.jsx)(sw,{title:`Update to rpf ${o}`,description:(0,x.jsxs)(x.Fragment,{children:[`Runs `,(0,x.jsx)(`code`,{className:`font-mono`,children:e.command}),` (`,e.installer,`).`,i.length>0&&(0,x.jsx)(`pre`,{className:`mt-2 max-h-48 overflow-auto rounded-md bg-muted p-2 font-mono text-2xs whitespace-pre-wrap text-foreground/80`,children:i.join(`
|
|
298
|
+
`)}),s&&(0,x.jsx)(`span`,{className:K(`mt-1 block`,e.errorContext?`text-destructive-foreground`:`text-success-foreground`),children:s})]}),children:e.status===`installed`||e.status===`restarting`?(0,x.jsx)(J,{size:`sm`,disabled:e.status===`restarting`||r.isPending,onClick:()=>r.mutate(),children:e.status===`restarting`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(g8,{size:`xs`}),` Restarting…`]}):`Restart Forge`}):(0,x.jsx)(J,{size:`sm`,disabled:e.status===`installing`||n.isPending,onClick:()=>n.mutate(),children:e.status===`installing`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(g8,{size:`xs`}),` Updating…`]}):`Update`})})}var R$=[{id:`general`,label:`General`,icon:Hm,group:`Forge`},{id:`appearance`,label:`Appearance`,icon:em,group:`Forge`},{id:`providers`,label:`Providers and models`,icon:Dd,group:`Agent`},{id:`usage`,label:`Usage`,icon:Ld,group:`Agent`},{id:`instances`,label:`Instances`,icon:Bm,group:`rpf`},{id:`projects`,label:`Projects`,icon:Rf,group:`rpf`},{id:`doctor`,label:`Doctor`,icon:ch,group:`rpf`},{id:`skills`,label:`Skills`,icon:eh,group:`rpf`},{id:`keybindings`,label:`Keybindings`,icon:cp,group:`More`},{id:`diffs`,label:`Diffs`,icon:Ef,group:`More`},{id:`about`,label:`About and updates`,icon:op,group:`More`},{id:`licenses`,label:`Open-source licenses`,icon:Pm,group:`More`}];function hte({section:e,onSection:t}){let n=[...new Set(R$.map(e=>e.group))],[r,i]=b.useState(``),a=b.useRef(null),o=R$,s=b.useMemo(()=>Object.fromEntries(R$.map(e=>[e.id,e.label])),[]),c=tw(r,s),[l,u]=b.useState(0),d=Math.min(l,Math.max(c.length-1,0)),[f,p]=b.useState(null);b.useEffect(()=>{if(!f)return;let e=0,t=setInterval(()=>{(nw(f)||++e>20)&&(clearInterval(t),p(null))},50);return()=>clearInterval(t)},[f,e]);let m=e=>{i(``),u(0),t(e.section),e.target&&p(e.target)},h=e=>{if(!e.nativeEvent.isComposing){if(e.key===`Escape`&&r)e.preventDefault(),e.stopPropagation(),i(``);else if(c.length){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=c.length;u((d+(e.key===`ArrowDown`?1:t-1))%t)}else e.key===`Enter`&&(e.preventDefault(),m(c[d]))}}};b.useEffect(()=>{let e=e=>{let t=e.target;e.key===`/`&&!/INPUT|TEXTAREA/.test(t.tagName)&&!t.isContentEditable&&(e.preventDefault(),a.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let g=R$.find(t=>t.id===e)||R$[0];return(0,x.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,children:[(0,x.jsx)(`nav`,{className:`flex w-60 shrink-0 flex-col border-e bg-sidebar text-sidebar-foreground`,children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-2 p-2`,children:[(0,x.jsxs)(`div`,{className:`flex h-8 items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground focus-within:bg-sidebar-row-hover hover:bg-sidebar-row-hover hover:text-sidebar-foreground`,children:[(0,x.jsx)(Rm,{className:`size-4 shrink-0 text-sidebar-muted-foreground/80`}),(0,x.jsx)(`input`,{ref:a,value:r,onChange:e=>{i(e.target.value),u(0)},onKeyDown:h,placeholder:`Search`,"aria-label":`Search settings`,role:`combobox`,"aria-expanded":!!r&&c.length>0,"aria-controls":c.length?`settings-search-results`:void 0,"aria-activedescendant":c[d]?`settings-result-${d}`:void 0,className:`min-w-0 flex-1 bg-transparent outline-none placeholder:text-sidebar-muted-foreground`}),r?(0,x.jsx)(`button`,{"aria-label":`Clear settings search`,onClick:()=>i(``),className:`inline-flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground`,children:(0,x.jsx)(Oh,{className:`size-3`})}):(0,x.jsx)(Zb,{children:`/`})]}),r&&c.length===0&&(0,x.jsx)(`p`,{role:`status`,className:`px-2 py-6 text-center text-xs text-sidebar-muted-foreground`,children:`No settings found`}),r?(0,x.jsx)(`div`,{id:c.length?`settings-search-results`:void 0,role:c.length?`listbox`:void 0,"aria-label":`Settings search results`,className:`flex flex-col gap-px`,children:c.map((e,t)=>{let n=R$.find(t=>t.id===e.section)?.icon||Hm;return(0,x.jsxs)(`button`,{type:`button`,id:`settings-result-${t}`,role:`option`,"aria-selected":t===d,tabIndex:-1,onMouseMove:()=>u(t),onClick:()=>m(e),className:K(`flex min-h-10 w-full items-start gap-2 rounded-[var(--control-radius)] px-2.5 py-1.5 text-left outline-none hover:bg-sidebar-row-hover`,t===d&&`bg-sidebar-row-selected`),children:[(0,x.jsx)(n,{className:`mt-0.5 size-4 shrink-0 text-sidebar-icon`}),(0,x.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`span`,{className:`block truncate text-sm font-medium text-sidebar-foreground`,children:e.title}),(0,x.jsx)(`span`,{className:`block truncate text-2xs text-sidebar-muted-foreground/75`,children:s[e.section]})]})]},e.id)})}):null,(0,x.jsx)(`div`,{className:K(`flex flex-col gap-4`,r&&`hidden`),children:n.filter(e=>o.some(t=>t.group===e)).map(e=>(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,x.jsx)(`h3`,{className:`px-2 text-xs font-medium text-sidebar-muted-foreground/80`,children:e}),(0,x.jsx)(`div`,{className:`flex flex-col gap-px`,children:o.filter(t=>t.group===e).map(e=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id),"aria-current":e.id===g.id?`page`:void 0,className:K(`flex h-8 w-full items-center gap-2 rounded-[var(--control-radius)] px-2.5 text-left text-sm outline-none hover:bg-sidebar-row-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,e.id===g.id&&`bg-sidebar-row-selected font-medium text-sidebar-foreground`),children:[(0,x.jsx)(e.icon,{className:`size-4 shrink-0 text-sidebar-icon`}),(0,x.jsx)(`span`,{className:`truncate`,children:e.label})]},e.id))})]},e))})]})}),(0,x.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,x.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-3 border-b ps-5 pe-2`,children:[(0,x.jsxs)(`nav`,{"aria-label":`Breadcrumb`,className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`Settings`}),(0,x.jsx)(`span`,{className:`text-icon-muted`,children:`/`}),(0,x.jsx)(`span`,{className:`truncate`,children:g.label})]}),(0,x.jsx)(`div`,{className:`ms-auto flex shrink-0 items-center gap-1`,children:(0,x.jsx)(A$,{})})]}),(0,x.jsx)(`div`,{className:`fade-top min-h-0 flex-1 overflow-y-auto`,children:(0,x.jsxs)(`div`,{className:`mx-auto flex max-w-4xl flex-col gap-8 px-5 pt-6 pb-12 sm:px-6`,children:[g.id===`general`&&(0,x.jsx)(gte,{}),g.id===`appearance`&&(0,x.jsx)(_te,{}),g.id===`providers`&&(0,x.jsx)(dw,{}),g.id===`instances`&&(0,x.jsx)(Ow,{}),g.id===`projects`&&(0,x.jsx)(nte,{}),g.id===`keybindings`&&(0,x.jsx)(ote,{}),g.id===`diffs`&&(0,x.jsx)(cte,{}),g.id===`about`&&(0,x.jsx)(lte,{}),g.id===`licenses`&&(0,x.jsx)(ute,{}),g.id===`doctor`&&(0,x.jsx)(fte,{}),g.id===`skills`&&(0,x.jsx)(pte,{})]})})]})]})}function z$({title:e,children:t,action:n}){return(0,x.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center px-3 sm:px-4`,children:[(0,x.jsx)(`h2`,{className:`text-base font-semibold`,children:e}),(0,x.jsx)(`div`,{className:`ml-auto`,children:n})]}),(0,x.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border/60 bg-card/40 shadow-xs/5 [&>*+*]:border-t [&>*+*]:border-border/50`,children:t})]})}function B$({title:e,description:t,children:n}){return(0,x.jsxs)(`div`,{id:typeof e==`string`?YC(e):void 0,className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-8 px-3 py-3 sm:px-4`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e}),t&&(0,x.jsx)(`div`,{className:`mt-0.5 max-w-2xl text-xs leading-normal text-muted-foreground`,children:t})]}),(0,x.jsx)(`div`,{className:`flex max-w-[28rem] min-w-0 justify-end`,children:n})]})}function gte(){let e=U(ku().meta.queryOptions());return(0,x.jsxs)(z$,{title:`General`,children:[(0,x.jsx)(B$,{title:`rpf home`,description:`Profiles, keys, projects and chats live here (RPFORGE_HOME moves it).`,children:(0,x.jsx)(`code`,{className:`font-mono text-xs break-all text-muted-foreground`,children:e.data?.home})}),(0,x.jsx)(B$,{title:`Key store`,description:`Model keys are encrypted in the same store as instance credentials.`,children:(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.data?.keyStore?e.data.keyStore.keySource:`unavailable (keys can’t be saved)`})}),(0,x.jsx)(B$,{title:`Version`,children:(0,x.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`rpf `,e.data?.version]})})]})}function _te(){let e=Wu();return(0,x.jsx)(z$,{title:`Appearance`,children:(0,x.jsx)(B$,{title:`Theme`,description:`Follow the system, or always light or dark.`,children:(0,x.jsx)(`div`,{className:`inline-flex rounded-[var(--control-radius)] border border-input p-0.5`,children:[{id:`system`,label:`System`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}].map(t=>(0,x.jsx)(`button`,{onClick:()=>Uu({theme:t.id}),className:K(`h-6 rounded-md px-2.5 text-xs`,e.theme===t.id?`bg-accent font-medium`:`text-muted-foreground hover:text-foreground`),children:t.label},t.id))})})})}function vte({section:e,onSection:t,onClose:n}){return(0,x.jsx)(k$,{label:`Settings`,onClose:n,children:(0,x.jsx)(hte,{section:e,onSection:t})})}var V$=[`var(--primary)`,`#d97757`,`#4d9f8a`,`#8c7bd1`,`#5b9bbd`,`#c2a14d`,`#8b8b8b`];function H$({value:e,options:t,onChange:n}){return(0,x.jsx)(`div`,{className:`inline-flex rounded-md bg-accent p-0.5`,children:t.map(t=>(0,x.jsx)(`button`,{onClick:()=>n(t.id),className:K(`h-6 rounded px-2 text-xs`,e===t.id?`bg-background font-medium text-foreground shadow-xs/5`:`text-muted-foreground hover:text-foreground`),children:t.label},String(t.id)))})}function U$({label:e,value:t}){return(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,x.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,x.jsx)(`dd`,{className:`text-base font-medium text-foreground tabular-nums`,children:t})]})}function W$({label:e,segments:t,format:n}){let r=t.reduce((e,t)=>e+t.value,0)||1,i=t.filter(e=>e.value>0);return(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2.5`,children:[(0,x.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:e}),(0,x.jsx)(`div`,{"aria-hidden":!0,className:`flex h-2 gap-0.5`,children:i.map(e=>(0,x.jsx)(`div`,{className:`h-full min-w-1 rounded-xs first:rounded-l-full last:rounded-r-full`,style:{width:`${e.value/r*100}%`,backgroundColor:e.color}},e.label))}),(0,x.jsx)(`ul`,{"aria-label":e,className:`flex flex-wrap gap-x-4 gap-y-1 text-xs`,children:i.map(e=>(0,x.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`size-2 rounded-xs`,style:{backgroundColor:e.color}}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),` `,(0,x.jsx)(`span`,{className:`text-foreground tabular-nums`,children:n(e.value)})]},e.label))})]})}function yte({days:e,series:t,metric:n}){let[r,i]=b.useState(null),a=Math.max(1e-9,...t.flatMap(e=>e.values)),o=n===`cost`?uQ:lQ,s=t=>e.length<=1?300:t/(e.length-1)*600,c=e=>200-e/a*192;return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,x.jsxs)(`div`,{className:`flex gap-2`,children:[(0,x.jsx)(`div`,{"aria-hidden":!0,className:`relative h-56 w-14 shrink-0`,children:[1,.5,0].map(e=>(0,x.jsx)(`span`,{className:`absolute right-0 -translate-y-1/2 text-2xs text-muted-foreground tabular-nums`,style:{top:`${(1-e)*100*.96+4*(1-e==0)}%`},children:o(a*e)},e))}),(0,x.jsxs)(`div`,{className:`relative h-56 flex-1`,onMouseLeave:()=>i(null),onMouseMove:t=>{let n=t.currentTarget.getBoundingClientRect(),r=Math.round((t.clientX-n.left)/n.width*(e.length-1));i(Math.max(0,Math.min(e.length-1,r)))},children:[(0,x.jsxs)(`svg`,{viewBox:`0 0 600 200`,preserveAspectRatio:`none`,className:`h-full w-full overflow-visible`,children:[[0,.5,1].map(e=>(0,x.jsx)(`line`,{x1:0,x2:600,y1:c(a*e),y2:c(a*e),className:`text-border`,stroke:`currentColor`,strokeDasharray:e?`3 3`:void 0,vectorEffect:`non-scaling-stroke`},e)),t.map(e=>{let t=e.values.map((e,t)=>`${s(t)},${c(e)}`).join(` `);return(0,x.jsxs)(`g`,{children:[(0,x.jsx)(`polygon`,{points:`0,200 ${t} 600,200`,fill:e.color,opacity:.12}),(0,x.jsx)(`polyline`,{points:t,fill:`none`,stroke:e.color,strokeWidth:1.5,vectorEffect:`non-scaling-stroke`})]},e.key)}),r!==null&&(0,x.jsx)(`line`,{x1:s(r),x2:s(r),y1:0,y2:200,stroke:`currentColor`,className:`text-foreground/40`,vectorEffect:`non-scaling-stroke`})]}),r!==null&&(0,x.jsxs)(`div`,{className:`glass pointer-events-none absolute top-2 z-10 min-w-36 rounded-xl border border-border/50 px-2.5 py-2 text-xs shadow-lg`,style:{left:`min(calc(${s(r)/600*100}% + 8px), calc(100% - 10rem))`},children:[(0,x.jsx)(`div`,{className:`mb-1 text-muted-foreground`,children:e[r]}),t.map(e=>(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,x.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,x.jsx)(`span`,{className:`size-2 rounded-full`,style:{backgroundColor:e.color}}),e.label]}),(0,x.jsx)(`span`,{className:`text-foreground tabular-nums`,children:o(e.values[r]||0)})]},e.key))]})]})]}),(0,x.jsxs)(`div`,{className:`flex justify-between ps-16 text-2xs text-muted-foreground tabular-nums`,children:[(0,x.jsx)(`span`,{children:e[0]}),(0,x.jsx)(`span`,{children:e[e.length-1]})]})]})}function bte(e,t){let n=new Date,r=e?new Date(Date.now()-(e-1)*864e5):new Date(t||n),i=[];for(let e=new Date(r.toISOString().slice(0,10));e<=n;e=new Date(e.getTime()+864e5))i.push(e.toISOString().slice(0,10));return i.length?i:[n.toISOString().slice(0,10)]}function xte(){let e=ku(),[t,n]=b.useState(`cost`),[r,i]=b.useState(30),a=U(e.usage.report.queryOptions({days:r})),o=a.data,s=o?.totals,c=e=>t===`cost`?e.cost:e.input+e.output,l=t===`cost`?uQ:lQ,u=(o?.connections||[]).map((e,t)=>({...e,label:o?.connectionNames[e.key]||e.key,color:V$[t%V$.length]})),d=bte(r,o?.days[0]?.key),f=u.map(e=>({key:e.key,label:e.label,color:e.color,values:d.map(t=>{let n=o?.connectionDays[`${e.key}|${t}`];return n?c(n):0})})),p=s?c(s):0,m=s?s.input-s.cachedInput:0;return(0,x.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,x.jsxs)(`header`,{className:`flex min-h-12 shrink-0 items-center gap-2 border-b ps-5 pe-2`,children:[(0,x.jsx)(`nav`,{"aria-label":`Usage breadcrumb`,className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:(0,x.jsx)(`span`,{className:`truncate`,children:`Usage`})}),(0,x.jsxs)(`div`,{className:`ms-auto flex shrink-0 items-center gap-2`,children:[(0,x.jsx)(H$,{value:t,onChange:n,options:[{id:`cost`,label:`Cost`},{id:`tokens`,label:`Tokens`}]}),(0,x.jsx)(H$,{value:r,onChange:i,options:[{id:7,label:`7 days`},{id:30,label:`30 days`},{id:90,label:`90 days`},{id:0,label:`All`}]}),(0,x.jsx)(A$,{})]})]}),(0,x.jsx)(`div`,{className:`fade-top min-h-0 flex-1 overflow-y-auto`,children:(0,x.jsx)(`div`,{className:`mx-auto flex max-w-6xl flex-col gap-6 px-5 pt-6 pb-12 sm:px-6`,children:a.isLoading?(0,x.jsx)(`div`,{className:`flex justify-center py-16`,children:(0,x.jsx)(g8,{size:`sm`,muted:!0})}):!s||!s.calls?(0,x.jsxs)(`div`,{className:`space-y-2 py-12 text-center text-sm text-muted-foreground`,children:[(0,x.jsx)(`p`,{children:`No usage in this range yet.`}),(0,x.jsx)(`p`,{children:`Each chat run, compaction and title is counted here, by project, model and connection.`})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`section`,{className:`grid gap-6 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,x.jsx)(`p`,{className:`text-4xl font-semibold text-foreground tabular-nums`,children:l(p)}),(0,x.jsxs)(`p`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,x.jsxs)(`span`,{children:[s.chats,` chat`,s.chats===1?``:`s`,` · `,s.calls,` call`,s.calls===1?``:`s`,t===`cost`&&` · API estimate`]}),t===`cost`&&s.unpricedTokens>0&&(0,x.jsx)(Gb,{label:`Excludes ${lQ(s.unpricedTokens)} tokens of models without a price (set prices in Settings › Providers and models).`,children:(0,x.jsx)(op,{className:`size-3`,"aria-label":`Unpriced usage details`})})]})]}),u.map(e=>{let t=p?c(e)/p:0;return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,x.jsxs)(`dl`,{className:`flex items-baseline justify-between gap-4`,children:[(0,x.jsxs)(`dt`,{className:`flex min-w-0 items-center gap-2 text-sm text-foreground`,children:[(0,x.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),(0,x.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,x.jsx)(`span`,{className:`truncate`,children:e.label}),(0,x.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.chats,` chat`,e.chats===1?``:`s`]})]})]}),(0,x.jsx)(`dd`,{className:`text-sm text-foreground tabular-nums`,children:l(c(e))})]}),(0,x.jsx)(`div`,{className:`h-[3px] rounded-full bg-muted-foreground/20`,children:(0,x.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${t*100}%`,backgroundColor:e.color}})})]},e.key)})]}),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,x.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:t===`tokens`?`Daily processed tokens`:`Daily cost`}),(0,x.jsx)(yte,{days:d,series:f,metric:t})]})]}),(0,x.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,x.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Totals`}),(0,x.jsxs)(`dl`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 py-1 md:grid-cols-5`,children:[(0,x.jsx)(U$,{label:`Processed tokens`,value:lQ(s.input+s.output)}),(0,x.jsx)(U$,{label:`Cached input`,value:lQ(s.cachedInput)}),(0,x.jsx)(U$,{label:`Uncached input`,value:lQ(m)}),(0,x.jsx)(U$,{label:`Output`,value:lQ(s.output)}),(0,x.jsx)(U$,{label:`Reasoning`,value:s.reasoning?lQ(s.reasoning):`—`})]})]}),(0,x.jsxs)(`section`,{className:`grid gap-x-12 gap-y-8 lg:grid-cols-2`,children:[(0,x.jsx)(W$,{label:`Tokens by type`,format:lQ,segments:[{label:`Uncached input`,value:m,color:V$[0]},{label:`Cached input`,value:s.cachedInput,color:V$[2]},{label:`Output`,value:s.output,color:V$[1]}]}),(0,x.jsx)(W$,{label:t===`cost`?`Cost by kind`:`Tokens by kind`,format:l,segments:(o?.kinds||[]).map((e,t)=>({label:e.key===`run`?`Chat runs`:e.key===`compaction`?`Compactions`:e.key===`caption`?`Image descriptions`:`Titles`,value:c(e),color:V$[(t+3)%V$.length]}))})]}),(0,x.jsx)(G$,{title:`Models`,rows:(o?.models||[]).map(e=>({...e,name:e.model,sub:o?.connectionNames[e.connectionId]||e.connectionId})),metric:t}),(0,x.jsx)(G$,{title:`Projects`,rows:(o?.projects||[]).map(e=>({...e,sub:``})),metric:t})]})})})]})}function G$({title:e,rows:t,metric:n}){let r=Math.max(1e-9,...t.map(e=>n===`cost`?e.cost:e.input+e.output));return(0,x.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,x.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:e}),(0,x.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b border-border text-right text-xs text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`py-2 pr-3 pl-2 text-left font-normal`,children:`#`}),(0,x.jsx)(`th`,{className:`w-full py-2 text-left font-normal`,children:e===`Models`?`Model`:`Project`}),(0,x.jsx)(`th`,{className:`py-2 pl-6 font-normal`,children:`Tokens`}),(0,x.jsx)(`th`,{className:`hidden py-2 pl-6 font-normal sm:table-cell`,children:`Chats`}),(0,x.jsx)(`th`,{className:`py-2 pr-2 pl-6 font-normal`,children:`Cost`})]})}),(0,x.jsx)(`tbody`,{children:t.map((e,t)=>{let i=n===`cost`?e.cost:e.input+e.output;return(0,x.jsxs)(`tr`,{className:`border-b border-border/50 text-right whitespace-nowrap text-muted-foreground tabular-nums transition-colors hover:bg-muted/50`,children:[(0,x.jsx)(`td`,{className:`py-2.5 pr-3 pl-2 text-left text-xs`,children:t+1}),(0,x.jsxs)(`td`,{className:`py-2.5 text-left whitespace-normal`,children:[(0,x.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-foreground`,children:e.name}),e.sub&&(0,x.jsx)(`span`,{className:`text-xs`,children:e.sub})]}),(0,x.jsx)(`div`,{"aria-hidden":!0,className:`mt-1.5 h-0.5 max-w-48`,children:(0,x.jsx)(`div`,{className:`h-full rounded-full bg-primary/60`,style:{width:`${i/r*100}%`}})})]}),(0,x.jsx)(`td`,{className:`py-2.5 pl-6 text-foreground`,children:lQ(e.input+e.output)}),(0,x.jsx)(`td`,{className:`hidden py-2.5 pl-6 sm:table-cell`,children:e.chats}),(0,x.jsx)(`td`,{className:`py-2.5 pr-2 pl-6 text-foreground`,children:e.cost>0?uQ(e.cost):e.unpricedTokens?(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`no price`}):uQ(0)})]},e.key)})})]})]})}function Ste({onClose:e}){return(0,x.jsx)(k$,{label:`Usage`,onClose:e,children:(0,x.jsx)(xte,{})})}var Cte=[`widget`,`primitive`,`block`,`layout`,`utility`],wte=/^[a-z][a-z0-9_-]{0,39}\/[a-z][a-z0-9-]{0,79}$/;function Tte(e){return`${e.replace(/^x_[a-z0-9]+_/,``).replace(/[^a-z0-9-]+/g,`-`).replace(/^-+|-+$/g,``)||`app`}-components`}var Ete={start:`new`,profile:``,app:``,setMode:`existing`,setId:``,setName:``,name:``,slug:``,slugTouched:!1,description:``,sourceKind:`template`,template:``,portal:``,copyPages:!1,layout:``,themeMode:`keep`,themeKey:``,themeCopy:!1,color:`#2563eb`,tint:`neutral`,contrast:`AA`,icon:``,folder:``,folderTouched:!1,extras:{prettierrc:!0,gitignore:!0,readme:!0,skills:!0,git:!0},components:[],newId:``,newKind:`widget`},Dte={start:`Start from`,components:`Components`,instance:`Instance`,app:`App and update set`,portal:`Portal`,look:`Look and navigation`,folder:`Folder and extras`,review:`Review plan`};function Ote(e){return e===`component`?[`start`,`instance`,`app`,`components`,`folder`,`review`]:e===`new`?[`start`,`instance`,`app`,`portal`,`look`,`folder`,`review`]:[`start`,`instance`,`app`,`portal`,`folder`,`review`]}function kte(e){let t=e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,40).replace(/-+$/,``);return t.length===1&&(t+=`-portal`),t}function K$(e){return`${e.trim()||`Portal`} (React Portal)`.substring(0,80)}function q$(e){let t=/^([a-z_]+): ([\s\S]*)$/.exec(e||``);return t?[t[1],t[2]]:[``,e||``]}var J$={no_profile:`Add or finish the instance profile in Settings › Instances.`,forge_mcp_disabled:`An admin turns Forge on in React Portal (x_312987_portal.forge.mcp.enabled).`,forbidden:`Ask for the React Portal designer or developer role.`,incompatible:`Upgrade React Portal on the instance.`,helper_missing:`Install or upgrade React Portal Global Helpers on the instance.`,no_apps:`You need author access to a scoped application.`};function Y$(e){let t={app:e.app,updateSet:e.setMode===`new`?{create:e.setName.trim()||K$(e.name)}:e.setId,name:e.name.trim(),slug:e.slug};return e.description.trim()&&(t.description=e.description.trim()),t.source=e.start===`copy`?{kind:`portal`,portal:e.portal,pages:e.copyPages?`all`:`none`}:e.sourceKind===`empty`?{kind:`empty`}:{kind:`template`,...e.template?{portal:e.template}:{}},e.start===`new`&&(e.layout&&(t.layout=e.layout),e.themeMode===`pick`&&e.themeKey&&(t.theme={key:e.themeKey,...e.themeCopy?{copy:!0}:{}}),e.themeMode===`keep`&&e.themeCopy&&(t.theme={copy:!0}),e.themeMode===`color`&&(t.theme={color:e.color,tint:e.tint,contrast:e.contrast}),e.icon.trim()&&e.sourceKind!==`empty`&&(t.brand={icon:e.icon.trim()})),t}function Ate(){let e=Wu(),t=!!e.newProject;return(0,x.jsx)(Kb,{open:t,onOpenChange:e=>!e&&Uu({newProject:``}),children:t&&(0,x.jsx)(jte,{preset:e.newProject===`choose`||!e.newProject?void 0:e.newProject},e.newProject)})}function jte({preset:e}){let t=ku(),n=C(),r=Ji(),i=T8(),a=U(t.wizard.context.queryOptions()),o=U({...t.profiles.list.queryOptions(),retry:!1}),[s,c]=b.useState({...Ete,start:e||`new`}),l=e=>c(t=>({...t,...e})),u=Ote(s.start),[d,f]=b.useState(e?`instance`:`start`),p=u.indexOf(d),[m,h]=b.useState(``),g=W(t.wizard.plan.mutationOptions()),_=W(t.wizard.run.mutationOptions()),v=W(t.wizard.pull.mutationOptions()),y=W(t.wizard.startComponents.mutationOptions()),S=W(t.wizard.retryPull.mutationOptions()),w=b.useMemo(()=>crypto.randomUUID(),[]),T=o.data?.profiles||[];b.useEffect(()=>{!s.profile&&T.length&&l({profile:o.data?.default||T[0].name})},[T.length]);let E=!!s.profile&&a.data?.available!==!1,D=U({...t.wizard.preflight.queryOptions({profile:s.profile}),enabled:E,retry:!1,staleTime:6e4}),O=U({...t.wizard.updateSets.queryOptions({profile:s.profile,appId:D.data?.apps.find(e=>e.scope===s.app)?.id||``}),enabled:E&&!!s.app&&!!D.data}),k=U({...t.wizard.portals.queryOptions({profile:s.profile}),enabled:E&&!!D.data});b.useEffect(()=>{if(D.data&&!s.app){let e=D.data.apps.find(e=>e.current&&!e.reactPortal)||D.data.apps.find(e=>!e.reactPortal);e&&l({app:e.scope})}},[D.data]),b.useEffect(()=>{let e=O.data||[];if(e.length&&!e.some(e=>e.id===s.setId)){let t=e.find(e=>e.remembered)||e.find(e=>e.isDefault)||e[0];l({setId:t.id})}},[O.data]);let A=D.data?.apps.find(e=>e.scope===s.app),j=U({...t.wizard.components.queryOptions({profile:s.profile,appId:A?.id||``}),enabled:E&&s.start===`component`&&!!A&&!A.reactPortal}),M=s.start===`pull`?s.portal:s.start===`component`?Tte(s.app):s.slug,N=U({...t.wizard.folder.queryOptions(s.folderTouched&&s.folder?{path:s.folder}:{slug:M||`portal`}),enabled:!!a.data});b.useEffect(()=>{!s.folderTouched&&N.data&&l({folder:N.data.folder})},[N.data?.folder]);let P=U({...t.wizard.job.queryOptions({id:m}),enabled:!!m});b.useEffect(()=>{if(P.data?.state===`done`&&P.data.projectId){n.invalidateQueries({queryKey:t.projects.list.queryKey()});let e=P.data.projectId,i=setTimeout(()=>{Uu({newProject:``}),r({to:`/p/$projectId`,params:{projectId:e}})},700);return()=>clearTimeout(i)}},[P.data?.state,P.data?.projectId,r,n,t]);let[F,I]=q$(D.error?.message),L=U({...t.wizard.slug.queryOptions({profile:s.profile,slug:s.slug}),enabled:E&&!!D.data&&s.start!==`pull`&&/^[a-z0-9][a-z0-9-]{1,39}$/.test(s.slug),staleTime:3e4}),R=()=>{switch(d){case`instance`:return s.profile?D.data?``:D.isLoading?`Checking…`:`The instance refused`:`Pick an instance`;case`app`:return s.app?s.setMode===`existing`&&!s.setId?`Pick an update set`:``:`Pick an application`;case`portal`:return s.start===`pull`?s.portal?``:`Pick a portal`:s.start===`copy`&&!s.portal?`Pick a portal to copy`:s.name.trim()?/^[a-z0-9][a-z0-9-]{1,39}$/.test(s.slug)?L.data&&!L.data.available?`That slug is taken`:``:`The slug needs 2-40 lowercase letters, digits or dashes`:`Name the portal`;case`components`:return D.data?.componentWorkspaces?A?.reactPortal?`React Portal's own app can't hold a component workspace`:s.newId&&!wte.test(s.newId)?`The new component needs <namespace>/<key>`:s.newId&&s.components.includes(s.newId)?`That component already exists`:s.components.length||s.newId?``:`Pick a component or name a new one`:`This instance has no component workspaces yet`;case`folder`:return s.folder?N.data&&!N.data.empty?`The folder is not empty`:``:`Pick a folder`;default:return``}},z=()=>{let e=u[p+1];e&&(e===`review`&&s.start!==`pull`&&s.start!==`component`&&g.mutate({profile:s.profile,answers:Y$(s),folder:s.folder,extras:s.extras}),f(e))},B=()=>p>0&&f(u[p-1]),ee=async()=>{if(s.start===`component`){let e=await y.mutateAsync({profile:s.profile,app:A?.id||s.app,components:s.components,newComponent:s.newId?{id:s.newId,kind:s.newKind}:null,folder:s.folder,updateSet:s.setMode===`new`?{create:s.setName.trim()||`${A?.name||s.app} components (rpf)`}:s.setId,extras:s.extras});h(e.jobId);return}if(s.start===`pull`){let e=await v.mutateAsync({profile:s.profile,portal:s.portal,folder:s.folder,updateSet:s.setId,extras:s.extras});h(e.jobId);return}let e=g.data?.plan?.hash;if(!e)return;let t=await _.mutateAsync({profile:s.profile,answers:Y$(s),folder:s.folder,extras:s.extras,planHash:e,requestId:w});h(t.jobId)},V=R(),te=!!m,ne=D.data?.apps.find(e=>e.scope===s.app)?.reactPortal;return(0,x.jsxs)(lb,{children:[(0,x.jsx)(nb,{className:`fixed inset-0 z-50 bg-background/60 backdrop-blur-[4px] transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0`}),(0,x.jsxs)(cb,{className:`glass fixed top-1/2 left-1/2 z-50 flex h-[min(44rem,calc(100vh-2rem))] w-[calc(100vw-2rem)] max-w-5xl -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl shadow-[0_24px_64px_-24px_rgb(0_0_0/65%)] transition-[opacity,scale] duration-200 data-[ending-style]:scale-98 data-[ending-style]:opacity-0 data-[starting-style]:scale-98 data-[starting-style]:opacity-0`,children:[(0,x.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2 border-b ps-5 pe-2`,children:[(0,x.jsx)(db,{className:`text-sm font-medium`,children:`New project`}),(0,x.jsx)(rb,{"aria-label":`Close (Esc)`,className:`ms-auto inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,children:(0,x.jsx)(Oh,{className:`size-4`})})]}),(0,x.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,x.jsx)(`ol`,{className:`hidden w-56 shrink-0 flex-col gap-0.5 border-e bg-muted/20 p-3 sm:flex`,children:u.map((e,t)=>{let n=t<p||te&&t<=p,r=e===d&&!te;return(0,x.jsx)(`li`,{children:(0,x.jsxs)(`button`,{type:`button`,disabled:te||t>p,onClick:()=>f(e),className:K(`flex h-8 w-full items-center gap-2.5 rounded-md px-2 text-left text-sm`,r?`bg-accent font-medium`:`text-muted-foreground`,t<=p&&!te&&`hover:bg-accent/60`),children:[(0,x.jsx)(`span`,{className:K(`flex size-5 shrink-0 items-center justify-center rounded-full border text-2xs tabular-nums`,n&&`border-transparent bg-success/16 text-success-foreground`,r&&`border-primary bg-primary text-primary-foreground`),children:n?(0,x.jsx)(zd,{className:`size-3`}):t+1}),Dte[e]]})},e)})}),(0,x.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:te?(0,x.jsx)(Hte,{job:P.data,onRetry:()=>S.mutate({jobId:m}),retrying:S.isPending,onBack:()=>{h(``),f(`review`)}}):a.data?.available===!1?(0,x.jsxs)(X$,{icon:op,title:`This rpf build can't create projects`,children:[`Run `,(0,x.jsx)(`code`,{className:`font-mono`,children:`rpf init`}),` in a terminal, then open the folder.`]}):d===`start`?(0,x.jsx)(Mte,{value:s.start,onPick:e=>{l({start:e,portal:``}),f(`instance`)}}):d===`instance`?(0,x.jsx)(Nte,{profiles:T,profile:s.profile,onProfile:e=>l({profile:e,app:``,setId:``}),pre:D.data,loading:D.isLoading&&!!s.profile,code:F,message:I,onAddInstance:()=>i(`instances`),onRetry:()=>D.refetch()}):d===`app`?(0,x.jsx)(Pte,{d:s,set:l,apps:s.start===`component`?(D.data?.apps||[]).filter(e=>!e.reactPortal):D.data?.apps||[],sets:O.data||[],loadingSets:O.isLoading,canCreateSets:s.start!==`pull`&&!!D.data?.canCreateSets}):d===`portal`?(0,x.jsx)(Fte,{d:s,set:l,portals:k.data||[],loading:k.isLoading,slugCheck:L.data,slugChecking:L.isFetching}):d===`components`?(0,x.jsx)(Rte,{d:s,set:l,available:!!D.data?.componentWorkspaces,rows:j.data||[],loading:j.isLoading,error:j.error?.message}):d===`look`?(0,x.jsx)(Ite,{d:s,set:l,profile:s.profile}):d===`folder`?(0,x.jsx)(Bte,{d:s,set:l,free:N.data}):s.start===`component`?(0,x.jsx)(zte,{d:s,sets:O.data||[]}):(0,x.jsx)(Vte,{d:s,sets:O.data||[],plan:g.data,error:g.error?.message,planning:g.isPending,reactPortalApp:!!ne,onReplan:()=>g.mutate({profile:s.profile,answers:Y$(s),folder:s.folder,extras:s.extras})})})]}),!te&&(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-t bg-muted/72 px-6 py-3`,children:[V&&d!==`start`&&d!==`review`&&(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:V}),(0,x.jsxs)(`div`,{className:`ms-auto flex gap-2`,children:[p>0&&(0,x.jsx)(J,{variant:`outline`,onClick:B,children:`Back`}),d===`review`?(0,x.jsx)(J,{disabled:s.start!==`pull`&&s.start!==`component`&&!g.data?.plan?.hash||g.isPending||_.isPending||v.isPending||y.isPending,onClick:ee,children:s.start===`pull`||s.start===`component`?`Pull and open`:`Create and open`}):d!==`start`&&(0,x.jsx)(J,{disabled:!!V,onClick:z,children:`Next`})]})]}),(_.error||v.error)&&!te&&(0,x.jsx)(`div`,{className:`border-t px-6 py-2 text-xs text-destructive-foreground`,children:q$((_.error||v.error)?.message)[1]})]})]})}function X$({icon:e,title:t,children:n}){return(0,x.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-center`,children:[(0,x.jsx)(e,{className:`size-6 text-muted-foreground`}),(0,x.jsx)(`p`,{className:`text-sm font-medium`,children:t}),(0,x.jsx)(`div`,{className:`max-w-md text-xs text-muted-foreground`,children:n})]})}function Z$({title:e,children:t}){return(0,x.jsxs)(`div`,{className:`mb-5`,children:[(0,x.jsx)(`h2`,{className:`text-base font-semibold`,children:e}),t&&(0,x.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:t})]})}function Mte({value:e,onPick:t}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`How do you want to start?`}),(0,x.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 lg:grid-cols-4`,children:[{id:`new`,icon:eh,title:`New portal`,body:`A draft on the instance from a template or empty (rpf init).`},{id:`pull`,icon:gf,title:`Pull a portal`,body:`Work on an existing portal as files. Any portal, React Portal ones included.`},{id:`copy`,icon:uf,title:`Copy a portal`,body:`A new draft copied from any portal, then pulled. Pages are optional.`},{id:`component`,icon:Em,title:`Components`,body:`Build widgets of your app without a portal, shown on a stage with any portal's theme.`}].map(n=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>t(n.id),className:K(`flex flex-col items-start gap-2 rounded-xl border bg-card/40 p-4 text-left shadow-xs/5 outline-none transition-colors hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring`,e===n.id&&`border-primary/60`),children:[(0,x.jsx)(n.icon,{className:`size-5 text-icon-muted`}),(0,x.jsx)(`span`,{className:`text-sm font-medium`,children:n.title}),(0,x.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:n.body})]},n.id))})]})}function Nte({profiles:e,profile:t,onProfile:n,pre:r,loading:i,code:a,message:o,onAddInstance:s,onRetry:c}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`Instance`,children:`The rpf profile the portal lives on. The CLI uses the same profiles.`}),e.length===0?(0,x.jsxs)(`div`,{className:`rounded-xl border border-dashed p-6 text-center`,children:[(0,x.jsx)(`p`,{className:`text-sm font-medium`,children:`No instances yet`}),(0,x.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Add the ServiceNow instance your portals live on.`}),(0,x.jsx)(J,{size:`sm`,className:`mt-3`,onClick:s,children:`Add an instance`})]}):(0,x.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border/60 bg-card/40 shadow-xs/5`,children:e.map(e=>(0,x.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 border-border/50 px-4 py-2.5 not-first:border-t hover:bg-accent/40`,children:[(0,x.jsx)(`input`,{type:`radio`,name:`profile`,checked:t===e.name,onChange:()=>n(e.name),className:y7}),(0,x.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`span`,{className:`text-sm font-medium`,children:e.name}),e.default&&(0,x.jsx)(`span`,{className:`ms-2 text-xs text-muted-foreground`,children:`default`}),(0,x.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.instance.replace(/^https?:\/\//,``)})]})]},e.name))}),t&&(0,x.jsx)(`div`,{className:`mt-4 rounded-lg border border-border/60 px-4 py-3 text-sm`,children:i?(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-muted-foreground`,children:[(0,x.jsx)(g8,{size:`sm`}),` Checking `,t,`…`]}):r?(0,x.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-success-foreground`,children:[(0,x.jsx)(zd,{className:`size-4`}),` Forge on`]}),(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[`as `,r.user,` ·`,` `,Object.keys(r.capabilities||{}).filter(e=>r.capabilities[e]).join(`, `),r.reactPortal?` · React Portal ${r.reactPortal}`:``]}),r.warning&&(0,x.jsx)(`span`,{className:`basis-full text-xs text-warning-foreground`,children:r.warning})]}):o?(0,x.jsxs)(`div`,{className:`flex gap-2`,children:[(0,x.jsx)(Zd,{className:`mt-0.5 size-4 shrink-0 text-destructive-foreground`}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{className:`text-destructive-foreground`,children:o}),J$[a]&&(0,x.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:J$[a]}),(0,x.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:c,children:`Check again`}),a===`no_profile`&&(0,x.jsx)(J,{size:`xs`,variant:`outline`,onClick:s,children:`Open Instances`})]})]})]}):null})]})}function Pte({d:e,set:t,apps:n,sets:r,loadingSets:i,canCreateSets:a}){let o=n.find(t=>t.scope===e.app),s=a&&!o?.reactPortal;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`App and update set`,children:e.start===`pull`?`Pushes from the folder write into this update set.`:`The application that owns the portal, and the update set that captures it.`}),(0,x.jsxs)(`div`,{className:`grid gap-5`,children:[(0,x.jsx)(_7,{label:`Application`,children:(0,x.jsx)(v7,{"aria-label":`Application`,value:e.app,onChange:e=>t({app:e,setId:``,...n.find(t=>t.scope===e)?.reactPortal?{setMode:`existing`}:{}}),options:n.map(e=>({value:e.scope,label:`${e.name} (${e.scope})${e.reactPortal?` · React Portal itself`:e.current?` · current`:``}`}))})}),o?.reactPortal&&(0,x.jsxs)(`p`,{className:`flex gap-2 text-xs text-warning-foreground`,children:[(0,x.jsx)(bh,{className:`size-4 shrink-0`}),`React Portal itself owns these records: a React Portal upgrade may change them.`]}),(0,x.jsxs)(`div`,{className:`grid gap-2`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium`,children:`Update set`}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,x.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`input`,{type:`radio`,className:y7,checked:e.setMode===`existing`,onChange:()=>t({setMode:`existing`})}),`An in-progress set`]}),(0,x.jsx)(v7,{"aria-label":`Update set`,className:`w-auto min-w-64`,disabled:e.setMode!==`existing`,value:e.setId,onChange:e=>t({setId:e}),placeholder:i?`Loading…`:`Choose a set`,options:r.map(e=>({value:e.id,label:`${e.name}${e.isDefault?` (default)`:``}${e.remembered?` · yours`:``}`}))})]}),s&&(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,x.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`input`,{type:`radio`,className:`relative inline-flex size-4.5 shrink-0 cursor-pointer appearance-none items-center justify-center rounded-full border border-input bg-background shadow-xs/5 outline-none transition-shadow not-dark:bg-clip-padding checked:border-primary checked:bg-[radial-gradient(circle,var(--primary-foreground)_0_3px,var(--primary)_3.5px)] checked:shadow-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:opacity-64 sm:size-4 dark:not-checked:bg-input/32`,checked:e.setMode===`new`,onChange:()=>t({setMode:`new`})}),`A new set`]}),(0,x.jsx)(p7,{size:`compact`,className:`w-80`,disabled:e.setMode!==`new`,"aria-label":`New update set name`,placeholder:K$(e.name||`Portal name`),value:e.setName,maxLength:80,onChange:e=>t({setName:e.target.value})})]})]})]})]})}function Fte({d:e,set:t,portals:n,loading:r,slugCheck:i,slugChecking:a}){let[o,s]=b.useState(``),c=n.filter(e=>e.isTemplate),l=(e.start===`pull`?n.filter(e=>!e.isTemplate):n).filter(e=>!o||`${e.slug} ${e.name}`.toLowerCase().includes(o.toLowerCase())),u=e.start!==`pull`&&(0,x.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,x.jsx)(_7,{label:`Portal name`,children:(0,x.jsx)(p7,{autoFocus:!0,placeholder:`HR Portal`,value:e.name,maxLength:100,onChange:n=>t({name:n.target.value,...e.slugTouched?{}:{slug:kte(n.target.value)}})})}),(0,x.jsx)(_7,{label:`Slug`,description:a?`Checking…`:i&&!i.available?(0,x.jsxs)(`span`,{className:`text-destructive-foreground`,children:[`Taken by `,i.takenBy?.name||`another portal`,i.suggestion&&(0,x.jsxs)(x.Fragment,{children:[` · `,(0,x.jsxs)(`button`,{type:`button`,className:`underline`,onClick:()=>t({slug:i.suggestion,slugTouched:!0}),children:[`use `,i.suggestion]})]})]}):i?.available?(0,x.jsxs)(`span`,{className:`text-success-foreground`,children:[`Available · /x/312987/portal/site/`,e.slug]}):`The URL: lowercase letters, digits and dashes`,children:(0,x.jsx)(p7,{mono:!0,value:e.slug,onChange:e=>t({slug:e.target.value.toLowerCase(),slugTouched:!0}),"aria-invalid":i&&!i.available||void 0})}),(0,x.jsx)(_7,{label:`Description (optional)`,className:`sm:col-span-2`,children:(0,x.jsx)(m7,{rows:2,value:e.description,maxLength:1e3,onChange:e=>t({description:e.target.value})})})]}),d=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`relative mb-2`,children:[(0,x.jsx)(Rm,{className:`pointer-events-none absolute top-1/2 left-2.5 z-10 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,x.jsx)(p7,{size:`compact`,className:`[&_input]:ps-7.5`,placeholder:`Search portals`,"aria-label":`Search portals`,value:o,onChange:e=>s(e.target.value)})]}),(0,x.jsxs)(`div`,{className:`max-h-72 overflow-y-auto rounded-xl border border-border/60 bg-card/40 shadow-xs/5`,children:[r&&(0,x.jsx)(`p`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`Reading portals…`}),l.map(n=>(0,x.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 border-border/50 px-4 py-2 not-first:border-t hover:bg-accent/40`,children:[(0,x.jsx)(`input`,{type:`radio`,className:y7,name:`portal`,checked:e.portal===n.slug,onChange:()=>t({portal:n.slug})}),(0,x.jsx)(`span`,{className:`w-32 shrink-0 truncate font-mono text-xs`,children:n.slug}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:n.name}),(0,x.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,title:n.appName||void 0,children:[n.app||`no application`,` · `,n.isTemplate?`template`:n.active?`live`:`draft`,` ·`,` `,n.pageCount,` pages`]}),n.reactPortal&&(0,x.jsx)(Xb,{variant:`info`,children:`React Portal`})]},n.slug))]}),n.find(t=>t.slug===e.portal)?.reactPortal&&(0,x.jsxs)(`p`,{className:`mt-2 flex gap-2 text-xs text-info-foreground`,children:[(0,x.jsx)(op,{className:`size-4 shrink-0`}),`React Portal owns `,e.portal,`: a React Portal upgrade may change these records.`]})]});return e.start===`pull`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`Portal`,children:`The portal to work on as files. Nothing on the instance changes until you push.`}),d]}):e.start===`copy`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`Portal`,children:`A new draft copied from another portal: its layout, theme, chrome, panels and menus.`}),d,(0,x.jsxs)(`label`,{className:`mt-3 flex items-center gap-2 text-sm`,children:[(0,x.jsx)(h7,{checked:e.copyPages,onCheckedChange:e=>t({copyPages:!!e})}),` Copy its pages too`]}),(0,x.jsx)(`div`,{className:`mt-5`,children:u})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`Portal`,children:`The new draft's name, its URL slug, and what it starts from.`}),u,(0,x.jsxs)(`div`,{className:`mt-5 grid gap-2`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium`,children:`Start from`}),(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,x.jsx)(`input`,{type:`radio`,className:y7,checked:e.sourceKind===`template`,onChange:()=>t({sourceKind:`template`})}),`A template`,(0,x.jsx)(v7,{"aria-label":`Template`,className:`w-auto min-w-56`,disabled:e.sourceKind!==`template`,value:e.template,onChange:e=>t({template:e}),options:[{value:``,label:`The default template`},...c.map(e=>({value:e.slug,label:`${e.name} · ${e.pageCount} pages${e.isDefaultTemplate?` (default)`:``}`}))]})]}),(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,x.jsx)(`input`,{type:`radio`,className:y7,checked:e.sourceKind===`empty`,onChange:()=>t({sourceKind:`empty`})}),`Empty: a layout, one empty Home page, empty menus`]})]})]})}function Ite({d:e,set:t,profile:n}){let r=ku(),i=U(r.wizard.layouts.queryOptions({profile:n})),a=U({...r.wizard.themes.queryOptions({profile:n}),enabled:e.themeMode===`pick`}),o=/^#[0-9a-f]{6}$/i.test(e.color),s=U({...r.wizard.brandTheme.queryOptions({color:e.color,tint:e.tint,contrast:e.contrast}),enabled:e.themeMode===`color`&&o}),c=(n,r)=>(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,x.jsx)(`input`,{type:`radio`,className:y7,checked:e.themeMode===n,onChange:()=>t({themeMode:n})}),r]});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`Look and navigation`,children:`Menus and panels come from the source as they are; change them in Studio later.`}),(0,x.jsxs)(`div`,{className:`grid gap-6`,children:[(0,x.jsx)(_7,{label:`Layout`,children:(0,x.jsx)(v7,{"aria-label":`Layout`,className:`max-w-sm`,value:e.layout,onChange:e=>t({layout:e}),options:[{value:``,label:`The source's layout`},...(i.data||[]).map(e=>({value:String(e.uniqueId),label:`${e.name} (${e.uniqueId})`}))]})}),(0,x.jsxs)(`div`,{className:`grid gap-2`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium`,children:`Theme`}),c(`keep`,e.sourceKind===`empty`?`Starter (the default)`:`Keep the source's theme`),c(`pick`,`A theme or preset`),e.themeMode===`pick`&&(0,x.jsx)(`div`,{className:`ms-6 flex flex-wrap gap-2`,children:(a.data||[]).map(n=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>t({themeKey:n.key}),className:K(`inline-flex h-8 items-center gap-2 rounded-lg border px-2.5 text-sm`,e.themeKey===n.key?`border-primary bg-accent`:`hover:bg-accent/50`),children:[(0,x.jsx)(`span`,{className:`size-3 rounded-full`,style:{backgroundColor:n.tokens?.light?.primary}}),n.name]},n.key))}),c(`color`,`From a brand color (contrast-safe light and dark tokens, made here)`),e.themeMode===`color`&&(0,x.jsxs)(`div`,{className:`ms-6 grid gap-3`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsx)(`input`,{type:`color`,"aria-label":`Brand color`,value:o?e.color:`#2563eb`,onChange:e=>t({color:e.target.value}),className:`size-8 cursor-pointer rounded-md border border-input bg-transparent`}),(0,x.jsx)(p7,{size:`compact`,mono:!0,className:`w-28`,value:e.color,onChange:e=>t({color:e.target.value}),"aria-label":`Brand color hex`}),(0,x.jsx)(v7,{"aria-label":`Neutrals`,size:`xs`,className:`w-auto`,value:e.tint,onChange:e=>t({tint:e}),options:[{value:`neutral`,label:`Neutral grays`},{value:`tinted`,label:`Tinted with the brand color`}]}),(0,x.jsx)(v7,{"aria-label":`Contrast target`,size:`xs`,className:`w-auto`,value:e.contrast,onChange:e=>t({contrast:e}),options:[{value:`AA`,label:`AA (4.5:1 text)`},{value:`AAA`,label:`AAA (7:1 text)`}]})]}),(0,x.jsx)(Lte,{tokens:s.data?.tokens,contrast:s.data?.contrast,error:s.error?.message,loading:s.isFetching})]}),e.themeMode!==`color`&&(0,x.jsxs)(`label`,{className:`mt-1 flex items-center gap-2 text-sm`,children:[(0,x.jsx)(h7,{checked:e.themeCopy,onCheckedChange:e=>t({themeCopy:!!e})}),` Make an editable copy of the theme for this portal`]})]}),e.sourceKind!==`empty`&&(0,x.jsx)(_7,{label:`Brand icon (optional)`,description:`A Lucide icon name for the sidebar, such as briefcase.`,children:(0,x.jsx)(p7,{size:`compact`,mono:!0,className:`w-56`,value:e.icon,onChange:e=>t({icon:e.target.value.toLowerCase()})})})]})]})}function Lte({tokens:e,contrast:t,error:n,loading:r}){if(n)return(0,x.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:q$(n)[1]});if(!e)return r?(0,x.jsx)(g8,{size:`sm`,muted:!0}):null;let i=[`primary`,`secondary`,`accent`,`background`,`foreground`,`muted`];return(0,x.jsxs)(`div`,{className:`grid gap-2`,children:[[`light`,`dark`].map(t=>(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`w-10 text-xs text-muted-foreground`,children:t}),i.filter(n=>e[t]?.[n]).map(n=>(0,x.jsx)(`span`,{title:`${n} ${e[t][n]}`,className:`size-6 rounded-md border border-border/60`,style:{backgroundColor:e[t][n]}},n))]},t)),t&&t.length>0?(0,x.jsx)(`ul`,{className:`text-xs text-warning-foreground`,children:t.map(e=>(0,x.jsxs)(`li`,{children:[`Below target: `,e]},e))}):(0,x.jsx)(`p`,{className:`text-xs text-success-foreground`,children:`Contrast ok`})]})}function Rte({d:e,set:t,available:n,rows:r,loading:i,error:a}){if(!n)return(0,x.jsx)(X$,{icon:op,title:`No component workspaces on this instance yet`,children:`Component workspaces need React Portal 1.73.0 or newer on the instance.`});let o=(n,r)=>t({components:r?e.components.concat(n).sort():e.components.filter(e=>e!==n)});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(Z$,{title:`Components`,children:[`Pull existing components of `,e.app||`the application`,`, start a new one, or both. More can be added later (rpf pull --component, rpf new component).`]}),(0,x.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium`,children:`Existing components`}),i?(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Reading the application's components…`}):a?(0,x.jsx)(`span`,{className:`text-xs text-destructive-foreground`,children:a}):r.length?(0,x.jsx)(`div`,{className:`grid max-h-56 gap-1 overflow-y-auto rounded-lg border bg-card/40 p-2`,children:r.map(t=>(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,x.jsx)(h7,{checked:e.components.includes(t.uniqueId),onCheckedChange:e=>o(t.uniqueId,!!e)}),t.name,(0,x.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:t.uniqueId}),(0,x.jsx)(Xb,{children:t.kind})]},t.uniqueId))}):(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`This application has no components yet.`})]}),(0,x.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-[1fr_12rem]`,children:[(0,x.jsx)(_7,{label:`New component (optional)`,description:`<namespace>/<key>, e.g. the app scope as namespace`,children:(0,x.jsx)(p7,{mono:!0,value:e.newId,placeholder:`${e.app||`x_acme_app`}/my-widget`,onChange:e=>t({newId:e.target.value.trim()}),"aria-label":`New component id`})}),(0,x.jsx)(_7,{label:`Kind`,children:(0,x.jsx)(v7,{value:e.newKind,onChange:e=>t({newKind:e}),options:Cte.map(e=>({value:e,label:e})),"aria-label":`Kind`})})]})]})}function zte({d:e,sets:t}){let n=e.setMode===`new`?e.setName.trim()||`${e.app} components (rpf)`:t.find(t=>t.id===e.setId)?.name,r=[];return e.setMode===`new`&&r.push(`Create the update set "${n}" in ${e.app}`),r.push(`A component workspace for ${e.app} in ${e.folder}; pushes write into "${n}"`),e.components.length&&r.push(`Pull ${e.components.join(`, `)}`),e.newId&&r.push(`Scaffold ${e.newId} (${e.newKind}); rpf push creates it on the instance`),r.push(`The preview shows the component stage: options, URL params, any portal's theme, light / dark, widths`),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`Review`,children:`Nothing else is written to the instance until you push.`}),(0,x.jsx)(`ul`,{className:`grid gap-1.5 text-sm`,children:r.map(e=>(0,x.jsxs)(`li`,{className:`flex gap-2`,children:[(0,x.jsx)(zd,{className:`mt-0.5 size-4 shrink-0 text-icon-muted`}),e]},e))})]})}function Bte({d:e,set:t,free:n}){let r=(n,r,i)=>(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,x.jsx)(h7,{checked:e.extras[n],onCheckedChange:r=>t({extras:{...e.extras,[n]:!!r}})}),r,` `,(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i})]});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`Folder and extras`,children:`The portal is pulled into this folder; it must be empty or new.`}),(0,x.jsx)(_7,{label:`Folder`,description:n&&!n.empty?(0,x.jsx)(`span`,{className:`text-destructive-foreground`,children:`This folder has files: pick an empty or new one.`}):`The projects folder is set in Settings › Projects.`,children:(0,x.jsx)(p7,{mono:!0,value:e.folder,onChange:e=>t({folder:e.target.value,folderTouched:!0}),"aria-label":`Folder`})}),(0,x.jsxs)(`div`,{className:`mt-5 grid gap-2`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium`,children:`Also write`}),r(`prettierrc`,`.prettierrc.json`,`React Portal's code style`),r(`gitignore`,`.gitignore`,`.forge/ (the local base copy)`),r(`readme`,`README.md`,`the next commands`),r(`skills`,`Agent skills`,`.claude/skills`),!n?.inRepo&&r(`git`,`git init`,`not inside a repository`)]})]})}function Vte({d:e,sets:t,plan:n,error:r,planning:i,reactPortalApp:a,onReplan:o}){return e.start===`pull`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`Review`,children:`Read-only on the instance: nothing changes there until your first push.`}),(0,x.jsxs)(`dl`,{className:`grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-2 text-sm`,children:[(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Portal`}),(0,x.jsx)(`dd`,{className:`font-mono`,children:e.portal}),(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`App`}),(0,x.jsx)(`dd`,{children:e.app}),(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Pushes go to`}),(0,x.jsxs)(`dd`,{children:[`update set “`,t.find(t=>t.id===e.setId)?.name||e.setId,`”`]}),(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Folder`}),(0,x.jsx)(`dd`,{className:`font-mono text-xs break-all`,children:e.folder}),(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Then`}),(0,x.jsx)(`dd`,{children:Object.entries(e.extras).filter(([,e])=>e).map(([e])=>e).join(`, `)||`nothing else`})]})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:`Plan`,children:`The instance's dry run. Create runs exactly this plan.`}),i?(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,x.jsx)(g8,{size:`sm`}),` Planning on the instance…`]}):r?(0,x.jsxs)(`div`,{className:`flex gap-2 text-sm`,children:[(0,x.jsx)(Zd,{className:`mt-0.5 size-4 shrink-0 text-destructive-foreground`}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{className:`text-destructive-foreground`,children:q$(r)[1]}),(0,x.jsx)(J,{size:`xs`,variant:`outline`,className:`mt-2`,onClick:o,children:`Plan again`})]})]}):n?(0,x.jsxs)(`div`,{className:`grid gap-4 text-sm`,children:[(0,x.jsx)(`p`,{className:`font-medium`,children:n.plan?.summary}),(0,x.jsxs)(`dl`,{className:`grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1.5`,children:[(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Application`}),(0,x.jsxs)(`dd`,{children:[n.app?.name,` (`,n.app?.scope,`)`]}),(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Update set`}),(0,x.jsxs)(`dd`,{children:[`“`,n.updateSet?.name,`” `,n.updateSet?.isNew&&(0,x.jsx)(Xb,{variant:`warning`,children:`new`})]}),(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Creates`}),(0,x.jsx)(`dd`,{children:(n.counts||[]).map(([e,t])=>`${t} ${e}`).join(` · `)||`nothing`}),(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`Then`}),(0,x.jsx)(`dd`,{children:(n.local||[]).join(` · `)}),(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`planHash`}),(0,x.jsx)(`dd`,{className:`font-mono text-xs`,children:n.plan?.hash})]}),(n.plan?.warnings||[]).length>0&&(0,x.jsx)(`ul`,{className:`grid gap-1 text-xs text-warning-foreground`,children:n.plan.warnings.map(e=>(0,x.jsxs)(`li`,{className:`flex gap-1.5`,children:[(0,x.jsx)(bh,{className:`size-3.5 shrink-0`}),` `,e]},e))}),a&&!(n.plan?.warnings||[]).some(e=>/React Portal itself owns/.test(e))&&(0,x.jsx)(`p`,{className:`text-xs text-info-foreground`,children:`React Portal owns these records: a React Portal upgrade may change them.`}),(n.contrast||[]).length>0&&(0,x.jsxs)(`p`,{className:`text-xs text-warning-foreground`,children:[`Theme contrast: `,n.contrast.length,` pair(s) below target.`]}),(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The portal is created as a draft. Publish it in Studio when it is ready; Forge never publishes.`})]}):null]})}function Hte({job:e,onRetry:t,retrying:n,onBack:r}){let i=e?.state||`running`;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z$,{title:i===`done`?`Done`:i===`running`?`Working…`:i===`pull_failed`?`The draft exists; the pull failed`:`Stopped`}),(0,x.jsxs)(`ol`,{className:`grid gap-1.5 font-mono text-xs`,children:[(e?.log||[]).map((e,t,n)=>{let r=t===n.length-1&&(i===`failed`||i===`pull_failed`);return(0,x.jsxs)(`li`,{className:K(`flex gap-2`,r&&`text-destructive-foreground`),children:[r?(0,x.jsx)(Zd,{className:`mt-0.5 size-3 shrink-0`}):(0,x.jsx)(zd,{className:`mt-0.5 size-3 shrink-0 text-success-foreground`}),(0,x.jsx)(`span`,{className:`break-all`,children:e})]},t)}),i===`running`&&(0,x.jsxs)(`li`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,x.jsx)(g8,{size:`xs`}),` working`]})]}),i===`done`&&(0,x.jsx)(`p`,{className:`mt-4 text-sm text-success-foreground`,children:`Opening the project…`}),i===`pull_failed`&&(0,x.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,x.jsx)(J,{size:`sm`,disabled:n,onClick:t,children:`Retry pull`}),e?.result?.studioUrl&&(0,x.jsx)(`a`,{className:`text-xs underline`,href:e.result.studioUrl,target:`_blank`,rel:`noreferrer noopener`,children:`Open the draft in Studio`})]}),i===`failed`&&(0,x.jsxs)(`div`,{className:`mt-4`,children:[(0,x.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:q$(e?.error)[1]}),(0,x.jsx)(J,{size:`sm`,variant:`outline`,className:`mt-2`,onClick:r,children:`Back to the plan`})]})]})}var Ute=[[`general`,`General`],[`appearance`,`Appearance`],[`providers`,`Providers and models`],[`usage`,`Usage`],[`instances`,`Instances`],[`projects`,`Projects`],[`doctor`,`Doctor`],[`skills`,`Skills`],[`keybindings`,`Keybindings`],[`diffs`,`Diffs`],[`about`,`About and updates`],[`licenses`,`Open-source licenses`]];function Wte(){let[e,t]=b.useState(!1);return b.useEffect(()=>{let e=e=>e.detail===`commandPalette.toggle`&&t(e=>!e);return window.addEventListener(`forge:command`,e),()=>window.removeEventListener(`forge:command`,e)},[]),(0,x.jsx)(ub,{open:e,onOpenChange:t,children:e&&(0,x.jsx)(Gte,{onClose:()=>t(!1)})})}function Gte({onClose:e}){let t=ku(),n=Ji(),r=Wu(),i=T8(),a=Pa({select:e=>e.location.pathname}),o=/^\/p\/([^/]+)/.exec(a)?.[1],s=U(t.projects.list.queryOptions()),c=U(t.chats.recent.queryOptions({limit:60})),l=U(t.settings.get.queryOptions()).data?.keybindings||[],[u,d]=b.useState(``),[f,p]=b.useState(0),m=b.useRef(null),h=t=>()=>{e(),t()},g=[...o?[{id:`chat.new`,group:`Actions`,title:`New chat`,icon:nh,command:`chat.new`,run:h(()=>n({to:`/p/$projectId`,params:{projectId:o}}))},{id:`push`,group:`Actions`,title:`Plan a push…`,detail:`dry run, then review`,icon:Sh,run:h(()=>Uu({pushOpen:!0}))}]:[],{id:`project.new`,group:`Actions`,title:`New project…`,detail:`new, pull or copy a portal`,icon:Pf,run:h(()=>Uu({newProject:`choose`}))},{id:`panel`,group:`Actions`,title:r.panelOpen?`Hide the right panel`:`Show the right panel`,icon:om,command:`rightPanel.toggle`,run:h(()=>Uu({panelOpen:!r.panelOpen}))},{id:`terminal`,group:`Actions`,title:r.drawerOpen?`Hide the terminal`:`Show the terminal`,icon:nm,command:`terminal.toggle`,run:h(()=>Uu({drawerOpen:!r.drawerOpen}))},{id:`theme`,group:`Actions`,title:document.documentElement.classList.contains(`dark`)?`Switch to light theme`:`Switch to dark theme`,icon:document.documentElement.classList.contains(`dark`)?uh:Hp,run:h(()=>Uu({theme:document.documentElement.classList.contains(`dark`)?`light`:`dark`}))},{id:`usage`,group:`Actions`,title:`Usage`,icon:Ld,command:`usage.open`,run:h(()=>i(`usage`))},{id:`doctor`,group:`Actions`,title:`Run doctor`,icon:ch,run:h(()=>i(`doctor`))},...(s.data||[]).map(e=>({id:`p:${e.id}`,group:`Projects`,title:e.name,detail:e.path,icon:Bf,run:h(()=>n({to:`/p/$projectId`,params:{projectId:e.id}}))})),...(c.data||[]).slice(0,30).map(e=>({id:`c:${e.id}`,group:`Chats`,title:e.title,detail:e.projectName,icon:Ip,run:h(()=>n({to:`/p/$projectId/c/$chatId`,params:{projectId:e.projectId,chatId:e.id}}))})),...Ute.map(([e,t])=>({id:`s:${e}`,group:`Settings`,title:t,detail:`Settings`,icon:Wm,command:e===`general`?`settings.open`:void 0,run:h(()=>i(e))}))],_=u.toLowerCase().split(/\s+/).filter(Boolean),v=g.filter(e=>_.every(t=>`${e.title} ${e.detail||``} ${e.group}`.toLowerCase().includes(t))),y=u?v:v.filter(e=>e.group!==`Settings`).slice(0,14),S=Math.min(f,Math.max(0,y.length-1));b.useEffect(()=>p(0),[u]),b.useEffect(()=>{m.current?.querySelector(`[data-highlighted]`)?.scrollIntoView({block:`nearest`})},[S]);let C=e=>{e.key===`ArrowDown`?(e.preventDefault(),p((S+1)%Math.max(1,y.length))):e.key===`ArrowUp`?(e.preventDefault(),p((S-1+y.length)%Math.max(1,y.length))):e.key===`Enter`&&(e.preventDefault(),y[S]?.run())},w=e=>{let t=e&&Au.find(t=>t.id===e);return t?Fu(ju(t,l)):``},T=``;return(0,x.jsxs)(lb,{children:[(0,x.jsx)(nb,{className:`fixed inset-0 z-50 bg-background/60 backdrop-blur-[4px] transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0`}),(0,x.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-50 flex flex-col items-center px-4 pt-[max(1rem,4vh)] sm:pt-[10vh]`,children:(0,x.jsxs)(cb,{"aria-label":`Command palette`,className:`glass pointer-events-auto flex max-h-105 w-full max-w-xl flex-col overflow-hidden rounded-2xl text-foreground shadow-[0_24px_64px_-24px_rgb(0_0_0/65%)] transition-[opacity,scale] duration-150 data-[ending-style]:scale-98 data-[ending-style]:opacity-0 data-[starting-style]:scale-98 data-[starting-style]:opacity-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/60 px-4 py-2.5`,children:[(0,x.jsx)(Rm,{className:`size-4 shrink-0 text-icon-muted`}),(0,x.jsx)(`input`,{autoFocus:!0,value:u,onChange:e=>d(e.target.value),onKeyDown:C,placeholder:`Search projects, chats, actions and settings`,"aria-label":`Search commands`,className:`h-7 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,x.jsxs)(`div`,{ref:m,role:`listbox`,className:`min-h-0 flex-1 overflow-y-auto p-2`,children:[y.length===0&&(0,x.jsx)(`p`,{className:`py-10 text-center text-sm text-muted-foreground`,children:`No matching commands`}),y.map((e,t)=>{let n=e.group!==T;return T=e.group,(0,x.jsxs)(b.Fragment,{children:[n&&(0,x.jsx)(`div`,{className:K(`px-2 pb-1 text-xs font-medium text-muted-foreground`,t>0&&`pt-2.5`),children:e.group}),(0,x.jsxs)(`div`,{role:`option`,"aria-selected":t===S,"data-highlighted":t===S||void 0,onMouseMove:()=>p(t),onClick:e.run,className:K(`flex min-h-7 cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm select-none`,t===S&&`bg-foreground/[0.09]`),children:[(0,x.jsx)(e.icon,{className:`size-4 shrink-0 text-icon-muted`}),(0,x.jsx)(`span`,{className:`truncate`,children:e.title}),e.detail&&(0,x.jsx)(`span`,{className:`max-w-[45%] shrink-0 truncate text-xs text-muted-foreground/70`,children:e.detail}),w(e.command)&&(0,x.jsx)(`kbd`,{className:`ms-auto font-sans text-xs font-medium tracking-widest text-secondary-label`,children:w(e.command)})]})]},e.id)})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-border/60 px-4 py-2 text-xs text-muted-foreground`,children:[(0,x.jsx)(`span`,{children:`↑↓ move`}),(0,x.jsx)(`span`,{children:`↵ run`}),(0,x.jsx)(`span`,{children:`Esc close`})]})]})})]})}var Q$=new Ue({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1}}});function Kte(e){let t=Wu(),n=Ji(),r=pi(),i=T8(),a=Pa({select:e=>e.location.pathname}),o=b.useRef({ui:t,overrides:e,path:a});o.current={ui:t,overrides:e,path:a},b.useEffect(()=>{let e=e=>{let{ui:t,path:a}=o.current,s=/^\/p\/([^/]+)/.exec(a)?.[1];switch(e){case`sidebar.toggle`:return Uu({sidebarOpen:!t.sidebarOpen});case`rightPanel.toggle`:return Uu({panelOpen:!t.panelOpen});case`terminal.toggle`:return Uu({drawerOpen:!t.drawerOpen});case`preview.toggle`:return Uu(t.panelOpen&&t.panelTab===`preview`?{panelOpen:!1}:{panelOpen:!0,panelTab:`preview`});case`diff.toggle`:return Uu(t.panelOpen&&t.panelTab===`diff`?{panelOpen:!1}:{panelOpen:!0,panelTab:`diff`});case`settings.open`:return i(`general`);case`usage.open`:return i(`usage`);case`navigation.back`:return r.history.back();case`navigation.forward`:return r.history.forward();case`chat.new`:s&&n({to:`/p/$projectId`,params:{projectId:s}});return;default:window.dispatchEvent(new CustomEvent(`forge:command`,{detail:e}))}},t=t=>{let n=t.target;if(n?.closest?.(`[data-keybinding-capture]`))return;let r=Nu(t);if(!r)return;let i=!!n&&(/INPUT|TEXTAREA|SELECT/.test(n.tagName)||n.isContentEditable),a=Au.find(e=>ju(e,o.current.overrides)===r);!a||i&&!a.inFields||(t.preventDefault(),e(a.id))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[n,r,i])}function qte(){let e=ku(),t=Ji(),n=Pa({select:e=>e.location.pathname}),r=U(e.wizard.context.queryOptions()),i=b.useRef(!1);b.useEffect(()=>{!i.current&&r.data?.firstRun&&n!==`/welcome`&&(i.current=!0,t({to:`/welcome`}))},[r.data?.firstRun,n,t])}function Jte(){let e=Wu();Lu();let t=U(ku().settings.get.queryOptions()),n=qi({strict:!1}),r=T8(),i=Pa({select:e=>e.location.pathname})===`/welcome`;Kte(t.data?.keybindings||[]),qte();let a=t.data?.diffs?.colors||`red-green`;return b.useEffect(()=>{document.documentElement.dataset.diffColors=a},[a]),(0,x.jsxs)(`div`,{className:`flex h-full overflow-hidden`,children:[e.sidebarOpen&&!i&&(0,x.jsx)(_x,{}),(0,x.jsx)(`main`,{className:`flex min-w-0 flex-1 bg-background`,children:(0,x.jsx)(wa,{})}),(0,x.jsx)(Ate,{}),(0,x.jsx)(Wte,{}),(0,x.jsx)(Yte,{}),n.settings===`usage`?(0,x.jsx)(Ste,{onClose:()=>r(null)}):n.settings&&(0,x.jsx)(vte,{section:n.settings,onSection:r,onClose:()=>r(null)})]})}function Yte(){let e=qu();return(0,x.jsx)(cx,{theme:e?`dark`:`light`,position:`bottom-right`,closeButton:!0})}var $$=ma({component:Jte,validateSearch:e=>typeof e.settings==`string`?{settings:e.settings}:{}}),Xte=fa({getParentRoute:()=>$$,path:`/`,component:Ox}),Zte=fa({getParentRoute:()=>$$,path:`/p/$projectId`,component:function(){let{projectId:e}=Ki({from:`/p/$projectId`});return(0,x.jsx)(O$,{projectId:e})}}),Qte=fa({getParentRoute:()=>$$,path:`/p/$projectId/c/$chatId`,component:function(){let{projectId:e,chatId:t}=Ki({from:`/p/$projectId/c/$chatId`});return(0,x.jsx)(O$,{projectId:e,chatId:t})}}),$te=fa({getParentRoute:()=>$$,path:`/welcome`,component:Lw}),ene=fa({getParentRoute:()=>$$,path:`/settings/$section`,beforeLoad:({params:e})=>{throw on({to:`/`,search:{settings:e.section}})}}),tne=Aa({routeTree:$$.addChildren([Xte,$te,Zte,Qte,ene])});Gu(localStorage.getItem(`forge.theme`)||`system`),Va(),(0,Fa.createRoot)(document.getElementById(`root`)).render((0,x.jsx)(b.StrictMode,{children:(0,x.jsx)(w,{client:Q$,children:(0,x.jsx)(Ou,{trpcClient:Du,queryClient:Q$,children:(0,x.jsx)(Wb,{delay:400,children:(0,x.jsx)(Na,{router:tne})})})})}));export{pz as $,Ze as $t,lY as A,Om as At,bY as B,q as Bt,MY as C,Y3 as Ct,DY as D,J as Dt,CY as E,B1 as Et,hY as F,uf as Ft,oY as G,ku as Gt,nY as H,Uu as Ht,_Y as I,cf as It,dY as J,$e as Jt,aY as K,K as Kt,mY as L,Ud as Lt,gY as M,Rf as Mt,yY as N,wf as Nt,OY as O,vh as Ot,uY as P,gf as Pt,fz as Q,Qe as Qt,pY as R,zd as Rt,UY as S,d6 as St,kY as T,n3 as Tt,sY as U,qu as Ut,iY as V,Yu as Vt,cY as W,Wu as Wt,AG as X,et as Xt,fY as Y,tt as Yt,mz as Z,Xe as Zt,lX as _,q8 as _t,t$ as a,k as an,lC as at,QY as b,w6 as bt,NQ as c,C as cn,pC as ct,MQ as d,o as dn,uS as dt,Ye as en,lz as et,LQ as f,s as fn,aS as ft,oX as g,m7 as gt,gX as h,O7 as ht,n$ as i,pe as in,gC as it,vY as j,Mp as jt,TY as k,gh as kt,PQ as l,y as ln,dS as lt,BQ as m,nS as mt,$Q as n,je as nn,ER as nt,r$ as o,B as on,uC as ot,FQ as p,l as pn,eS as pt,rY as q,U as qt,e$ as r,_e as rn,_C as rt,XQ as s,ee as sn,dC as st,i$ as t,Ke as tn,MR as tt,IQ as u,d as un,vS as ut,rX as v,g8 as vt,AY as w,a3 as wt,ZY as x,b6 as xt,tX as y,Gb as yt,tY as z,hd as zt};
|