@quixomatic/rpf 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -1
- package/assets/dev-host/kit-manifest.json +1 -1
- package/assets/forge-app/THIRD_PARTY_NOTICES.txt +5283 -0
- package/assets/forge-app/app/assets/_forge-shiki-langs-DaJjT17w.js +2 -0
- package/assets/forge-app/app/assets/andromeeda-CWX9QkEw.js +1 -0
- package/assets/forge-app/app/assets/appendItems-CWJJlOE7.js +10 -0
- package/assets/forge-app/app/assets/aurora-x-C7LW0A0Z.js +1 -0
- package/assets/forge-app/app/assets/ayu-dark-UyEq0fEv.js +1 -0
- package/assets/forge-app/app/assets/ayu-light-BGLrZRfL.js +1 -0
- package/assets/forge-app/app/assets/ayu-mirage-DU2uuvme.js +1 -0
- package/assets/forge-app/app/assets/catppuccin-frappe-Ba2J56Xe.js +1 -0
- package/assets/forge-app/app/assets/catppuccin-latte-Du_f_kXm.js +1 -0
- package/assets/forge-app/app/assets/catppuccin-macchiato-DAr1oMDX.js +1 -0
- package/assets/forge-app/app/assets/catppuccin-mocha-F6YLrtz0.js +1 -0
- package/assets/forge-app/app/assets/core-Dl2d1S-D.js +12 -0
- package/assets/forge-app/app/assets/css-C8fQr_0Q.js +1 -0
- package/assets/forge-app/app/assets/dark-plus-2IOGu4uA.js +1 -0
- package/assets/forge-app/app/assets/diff-view-Chujmqzi.js +28 -0
- package/assets/forge-app/app/assets/diff-woXpYk--.js +1 -0
- package/assets/forge-app/app/assets/dracula-DZjgIiCY.js +1 -0
- package/assets/forge-app/app/assets/dracula-soft-Buj7Kmgw.js +1 -0
- package/assets/forge-app/app/assets/engine-javascript-C4Jk_eU2.js +141 -0
- package/assets/forge-app/app/assets/engine-oniguruma-D--T0LcV.js +1 -0
- package/assets/forge-app/app/assets/everforest-dark-Lvcw1Pr0.js +1 -0
- package/assets/forge-app/app/assets/everforest-light-YrYDdHjZ.js +1 -0
- package/assets/forge-app/app/assets/file-panel-le_M5nHe.js +1199 -0
- package/assets/forge-app/app/assets/formatCSSVariablePrefix-KRh9vnZf.js +1 -0
- package/assets/forge-app/app/assets/github-dark-CdJXf8Kw.js +1 -0
- package/assets/forge-app/app/assets/github-dark-default-BqPxBNAT.js +1 -0
- package/assets/forge-app/app/assets/github-dark-dimmed-DyY5b2F0.js +1 -0
- package/assets/forge-app/app/assets/github-dark-high-contrast-xd2ezW53.js +1 -0
- package/assets/forge-app/app/assets/github-light-CX58plA4.js +1 -0
- package/assets/forge-app/app/assets/github-light-default-DKbnGXTT.js +1 -0
- package/assets/forge-app/app/assets/github-light-high-contrast-uBB_OJ7x.js +1 -0
- package/assets/forge-app/app/assets/gruvbox-dark-hard-4xwr00-8.js +1 -0
- package/assets/forge-app/app/assets/gruvbox-dark-medium-CpS6Oukh.js +1 -0
- package/assets/forge-app/app/assets/gruvbox-dark-soft-CgQlpZ36.js +1 -0
- package/assets/forge-app/app/assets/gruvbox-light-hard-o8ZwY_jI.js +1 -0
- package/assets/forge-app/app/assets/gruvbox-light-medium-BOAI5TwH.js +1 -0
- package/assets/forge-app/app/assets/gruvbox-light-soft-DYjh34qH.js +1 -0
- package/assets/forge-app/app/assets/highlights-BxaWC1ve.js +7 -0
- package/assets/forge-app/app/assets/horizon-BJ3G7U7Q.js +1 -0
- package/assets/forge-app/app/assets/horizon-bright-onknclPd.js +1 -0
- package/assets/forge-app/app/assets/houston-CzdgljLR.js +1 -0
- package/assets/forge-app/app/assets/html-wSbaAAK3.js +1 -0
- package/assets/forge-app/app/assets/index-BwYJlfwT.css +1 -0
- package/assets/forge-app/app/assets/index-UP3KtgHV.js +291 -0
- package/assets/forge-app/app/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/assets/forge-app/app/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/assets/forge-app/app/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/assets/forge-app/app/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/assets/forge-app/app/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/assets/forge-app/app/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/assets/forge-app/app/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/assets/forge-app/app/assets/javascript-BgS3c2Ky.js +1 -0
- package/assets/forge-app/app/assets/json-qhed-kSA.js +1 -0
- package/assets/forge-app/app/assets/jsonc-CYpm1nAK.js +1 -0
- package/assets/forge-app/app/assets/jsx-Bz0zcwM4.js +1 -0
- package/assets/forge-app/app/assets/kanagawa-dragon-BQVheBBo.js +1 -0
- package/assets/forge-app/app/assets/kanagawa-lotus-CPemrbqC.js +1 -0
- package/assets/forge-app/app/assets/kanagawa-wave-CoCEno9V.js +1 -0
- package/assets/forge-app/app/assets/laserwave-B5bEuTwe.js +1 -0
- package/assets/forge-app/app/assets/lib-BOh9Tw1y.js +1 -0
- package/assets/forge-app/app/assets/light-plus-BZZlmvcU.js +1 -0
- package/assets/forge-app/app/assets/loader-BMv9OYvr.js +1 -0
- package/assets/forge-app/app/assets/markdown-BYOwaDjH.js +1 -0
- package/assets/forge-app/app/assets/material-theme-aeHmkUm6.js +1 -0
- package/assets/forge-app/app/assets/material-theme-darker-0axHxn5k.js +1 -0
- package/assets/forge-app/app/assets/material-theme-lighter-BsSyB7lm.js +1 -0
- package/assets/forge-app/app/assets/material-theme-ocean-BVrhCaVf.js +1 -0
- package/assets/forge-app/app/assets/material-theme-palenight-C7ZR4CGM.js +1 -0
- package/assets/forge-app/app/assets/min-dark-BKaXaz6D.js +1 -0
- package/assets/forge-app/app/assets/min-light-CF3GufC7.js +1 -0
- package/assets/forge-app/app/assets/monokai-CkP2YA7x.js +1 -0
- package/assets/forge-app/app/assets/night-owl-BWMbd2rn.js +1 -0
- package/assets/forge-app/app/assets/night-owl-light-C_TsrL-a.js +1 -0
- package/assets/forge-app/app/assets/nord-62p94tpv.js +1 -0
- package/assets/forge-app/app/assets/one-dark-pro-DUBUnUMB.js +1 -0
- package/assets/forge-app/app/assets/one-light-CqcpbeDc.js +1 -0
- package/assets/forge-app/app/assets/pierre-dark-CFuQzxDG.js +1 -0
- package/assets/forge-app/app/assets/pierre-dark-DMS-zpcK.js +1 -0
- package/assets/forge-app/app/assets/pierre-dark-protanopia-deuteranopia-BSiWRjoV.js +1 -0
- package/assets/forge-app/app/assets/pierre-dark-protanopia-deuteranopia-Ddq4E1VN.js +1 -0
- package/assets/forge-app/app/assets/pierre-dark-soft-BMbLOt5W.js +1 -0
- package/assets/forge-app/app/assets/pierre-dark-soft-BUesjllf.js +1 -0
- package/assets/forge-app/app/assets/pierre-dark-tritanopia-BGSLfXJy.js +1 -0
- package/assets/forge-app/app/assets/pierre-dark-tritanopia-CX9_YYVl.js +1 -0
- package/assets/forge-app/app/assets/pierre-dark-vibrant-Dlj8tZff.js +1 -0
- package/assets/forge-app/app/assets/pierre-dark-vibrant-bYj7HUnF.js +1 -0
- package/assets/forge-app/app/assets/pierre-light-BHq6aQNU.js +1 -0
- package/assets/forge-app/app/assets/pierre-light-DGR1TxHn.js +1 -0
- package/assets/forge-app/app/assets/pierre-light-protanopia-deuteranopia-ChtB5hGy.js +1 -0
- package/assets/forge-app/app/assets/pierre-light-protanopia-deuteranopia-xNu39ZI5.js +1 -0
- package/assets/forge-app/app/assets/pierre-light-soft-BmBpKxVJ.js +1 -0
- package/assets/forge-app/app/assets/pierre-light-soft-DTxn6Rur.js +1 -0
- package/assets/forge-app/app/assets/pierre-light-tritanopia-DF_s91q9.js +1 -0
- package/assets/forge-app/app/assets/pierre-light-tritanopia-DyKDz8Fz.js +1 -0
- package/assets/forge-app/app/assets/pierre-light-vibrant-BEba13rj.js +1 -0
- package/assets/forge-app/app/assets/pierre-light-vibrant-DsCzsubQ.js +1 -0
- package/assets/forge-app/app/assets/plastic-baAbzXTu.js +1 -0
- package/assets/forge-app/app/assets/poimandres-64TexMzA.js +1 -0
- package/assets/forge-app/app/assets/red-cnNTP7m6.js +1 -0
- package/assets/forge-app/app/assets/rose-pine-Dcg36Rqi.js +1 -0
- package/assets/forge-app/app/assets/rose-pine-dawn-Sx7X9we0.js +1 -0
- package/assets/forge-app/app/assets/rose-pine-moon-CoglSunF.js +1 -0
- package/assets/forge-app/app/assets/shellscript-CLZ0U2zV.js +1 -0
- package/assets/forge-app/app/assets/shiki-CoRI3zWj.js +2 -0
- package/assets/forge-app/app/assets/slack-dark-C86YGzJx.js +1 -0
- package/assets/forge-app/app/assets/slack-ochin-DPmXYTYk.js +1 -0
- package/assets/forge-app/app/assets/snazzy-light-BD8dOedc.js +1 -0
- package/assets/forge-app/app/assets/solarized-dark-Bs7TdbJI.js +1 -0
- package/assets/forge-app/app/assets/solarized-light-DXYdl5LH.js +1 -0
- package/assets/forge-app/app/assets/stream-tokenizer-BMtK_3oz.js +4 -0
- package/assets/forge-app/app/assets/synthwave-84-JFh1mrS8.js +1 -0
- package/assets/forge-app/app/assets/terminal-view-BrP-ENHg.css +1 -0
- package/assets/forge-app/app/assets/terminal-view-D3CiLjfu.js +16 -0
- package/assets/forge-app/app/assets/themes-CLX9vH7e.js +2 -0
- package/assets/forge-app/app/assets/tokyo-night-BLjaCl8e.js +1 -0
- package/assets/forge-app/app/assets/tsx-udAQXfEw.js +1 -0
- package/assets/forge-app/app/assets/typescript-bsJCZSQ-.js +1 -0
- package/assets/forge-app/app/assets/useNextRenderData-dgMkjxGZ.js +149 -0
- package/assets/forge-app/app/assets/utils-C9Glzetk.js +2 -0
- package/assets/forge-app/app/assets/vesper-DZzlHXr_.js +1 -0
- package/assets/forge-app/app/assets/vitesse-black-BRf870Fc.js +1 -0
- package/assets/forge-app/app/assets/vitesse-dark-B9ZPQf4u.js +1 -0
- package/assets/forge-app/app/assets/vitesse-light-1s3aLQn3.js +1 -0
- package/assets/forge-app/app/assets/wasm-4KdTHw0F.js +1 -0
- package/assets/forge-app/app/assets/yaml-rwi0_p6S.js +1 -0
- package/assets/forge-app/app/favicon.svg +1 -0
- package/assets/forge-app/app/index.html +23 -0
- package/assets/forge-app/server.mjs +87314 -0
- package/dist/cli.mjs +936 -5
- package/package.json +3 -1
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-Dl2d1S-D.js","assets/lib-BOh9Tw1y.js","assets/highlights-BxaWC1ve.js","assets/appendItems-CWJJlOE7.js","assets/stream-tokenizer-BMtK_3oz.js","assets/formatCSSVariablePrefix-KRh9vnZf.js","assets/shiki-CoRI3zWj.js","assets/utils-C9Glzetk.js","assets/diff-view-Chujmqzi.js","assets/useNextRenderData-dgMkjxGZ.js","assets/terminal-view-D3CiLjfu.js","assets/terminal-view-BrP-ENHg.css","assets/file-panel-le_M5nHe.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`),V=Symbol.for(`react.activity`),H=Symbol.for(`react.legacy_hidden`),ee=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.for(`react.view_transition`),ne=Symbol.for(`react.recoverable`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?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 V:return`Activity`;case te: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?oe(e.type)||`Memo`:t;case B:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=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)?_p(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_p(t),e=vp(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=vp(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 at(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&<(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|0x40000000|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=0x8000000;break;default:e=0}return e}function pt(e){return e&=-e,2<e?8<e?e&0x7ffffff?32:268435456:8:2}function mt(){var e=le.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function ht(e,t){var n=le.p;try{return le.p=e,t()}finally{le.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,yt=`__reactContainer$`+gt,bt=`__reactEvents$`+gt,xt=`__reactListeners$`+gt,St=`__reactHandles$`+gt,Ct=`__reactResources$`+gt,wt=`__reactMarker$`+gt,Tt=`__reactLoad$`+gt;function Et(e){delete e[_t],delete e[vt],delete e[xt],delete e[St]}function Dt(e){var t;if(t=e[_t])return t;for(var n=e.parentNode;n;){if(t=n[yt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ym(e);e!==null;){if(n=e[_t])return n;e=ym(e)}return t}e=n,n=e.parentNode}return null}function Ot(e){if(e=e[_t]||e[yt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function At(e){var t=e[Ct];return t||=e[Ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function jt(e){e[wt]=!0}function Mt(e){e[Tt]=void 0}var Nt=new Set,Pt={};function Ft(e,t){It(e,t),It(e+`Capture`,t)}function It(e,t){for(Pt[e]=t,e=0;e<t.length;e++)Nt.add(t[e])}var Lt=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]*$`),Rt={},zt={};function Bt(e){return je.call(zt,e)?!0:je.call(Rt,e)?!1:Lt.test(e)?zt[e]=!0:(Rt[e]=!0,!1)}var Vt=!1;function Ht(){var e=Vt;return Vt=!1,e}function Ut(e,t,n){if(Bt(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 Wt(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 Gt(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 Kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:case`object`:return e;default:return``}}function qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Jt(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 Yt(e){if(!e._valueTracker){var t=qt(e)?`checked`:`value`;e._valueTracker=Jt(e,t,``+e[t])}}function Xt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Zt=/[\n"\\]/g;function Qt(e){return e.replace(Zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function $t(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=``+Kt(t)):e.value!==``+Kt(t)&&(e.value=``+Kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):tn(e,Kt(n)):o===`number`&&e.value==t?tn(e,Kt(e.value)):tn(e,Kt(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=``+Kt(s):e.removeAttribute(`name`)}function en(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)){Yt(e);return}n=n==null?``:``+Kt(n),t=t==null?n:``+Kt(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),Yt(e)}function tn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function nn(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=``+Kt(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 rn(e,t,n){t!=null&&(t=``+Kt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Kt(n)}function an(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(se(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Yt(e)}function on(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sn=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 cn(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||sn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function ln(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]=``,Vt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(cn(e,a,r),Vt=!0)}else for(var o in t)t.hasOwnProperty(o)&&cn(e,o,t[o])}function un(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 dn=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`]]),fn=/^[\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 pn(e){return fn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function mn(){}var hn=null;function gn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _n=null,vn=null;function yn(e){var t=Ot(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;switch(e=t.stateNode,t.type){case`input`:if($t(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="`+Qt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[vt]||null;if(!a)throw Error(i(90));$t(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&&Xt(r)}break;case`textarea`:rn(e,n.value,n.defaultValue);break;case`select`:t=n.value,t!=null&&nn(e,!!n.multiple,t,!1)}}}var bn=!1;function xn(e,t,n){if(bn)return e(t,n);bn=!0;try{return e(t)}finally{if(bn=!1,(_n!==null||vn!==null)&&(Ud(),_n&&(t=_n,e=vn,vn=_n=null,yn(t),e)))for(t=0;t<e.length;t++)yn(e[t])}}function Sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||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 Cn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,wn=!1;if(Cn)try{var Tn={};Object.defineProperty(Tn,"passive",{get:function(){wn=!0}}),window.addEventListener(`test`,Tn,Tn),window.removeEventListener(`test`,Tn,Tn)}catch{wn=!1}var En=null,Dn=null,On=null;function kn(){if(On)return On;var e,t=Dn,n=t.length,r,i=`value`in En?En.value:En.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 On=i.slice(e,1<r?1-r:void 0)}function An(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 jn(){return!0}function Mn(){return!1}function Nn(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)?jn:Mn,this.isPropagationStopped=Mn,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=jn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=jn)},persist:function(){},isPersistent:jn}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fn=Nn(Pn),In=D({},Pn,{view:0,detail:0}),Ln=Nn(In),Rn,zn,Bn,Vn=D({},In,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qn,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!==Bn&&(Bn&&e.type===`mousemove`?(Rn=e.screenX-Bn.screenX,zn=e.screenY-Bn.screenY):zn=Rn=0,Bn=e),Rn)},movementY:function(e){return`movementY`in e?e.movementY:zn}}),Hn=Nn(Vn),Un=Nn(D({},Vn,{dataTransfer:0})),Wn=Nn(D({},In,{relatedTarget:0})),Gn=Nn(D({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Kn=Nn(D({},Pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),qn=Nn(D({},Pn,{data:0})),Jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Yn={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`},Xn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xn[e])?!!t[e]:!1}function Qn(){return Zn}var $n=Nn(D({},In,{key:function(e){if(e.key){var t=Jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=An(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Yn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qn,charCode:function(e){return e.type===`keypress`?An(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?An(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),er=Nn(D({},Vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tr=Nn(D({},Pn,{submitter:0})),nr=Nn(D({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qn})),rr=Nn(D({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ir=Nn(D({},Vn,{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})),ar=Nn(D({},Pn,{newState:0,oldState:0,source:0})),or=[9,13,27,32],sr=Cn&&`CompositionEvent`in window,cr=null;Cn&&`documentMode`in document&&(cr=document.documentMode);var lr=Cn&&`TextEvent`in window&&!cr,ur=Cn&&(!sr||cr&&8<cr&&11>=cr),dr=` `,fr=!1;function pr(e,t){switch(e){case`keyup`:return or.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function mr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var hr=!1;function gr(e,t){switch(e){case`compositionend`:return mr(t);case`keypress`:return t.which===32?(fr=!0,dr):null;case`textInput`:return e=t.data,e===dr&&fr?null:e;default:return null}}function _r(e,t){if(hr)return e===`compositionend`||!sr&&pr(e,t)?(e=kn(),On=Dn=En=null,hr=!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 ur&&t.locale!==`ko`?null:t.data;default:return null}}var vr={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 yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){_n?vn?vn.push(r):vn=[r]:_n=r,t=ep(t,`onChange`),0<t.length&&(n=new Fn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){Kf(e,0)}function wr(e){if(Xt(kt(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(Cn){var Dr;if(Cn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){xr&&(xr.detachEvent(`onpropertychange`,jr),Sr=xr=null)}function jr(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,gn(e)),xn(Cr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Pr(e,t){if(e===`click`)return wr(t)}function Fr(e,t){if(e===`input`||e===`change`)return wr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(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)||!Lr(e[i],t[i]))return!1}return!0}function zr(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 Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(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=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(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=zr(e.document)}return t}function Wr(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 Gr=Cn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(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}),Jr&&Rr(Jr,r)||(Jr=r,r=ep(qr,`onSelect`),0<r.length&&(t=new Fn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionrun:Zr(`Transition`,`TransitionRun`),transitionstart:Zr(`Transition`,`TransitionStart`),transitioncancel:Zr(`Transition`,`TransitionCancel`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};Cn&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionrun`),oi=ti(`transitionstart`),si=ti(`transitioncancel`),ci=ti(`transitionend`),li=new Map,ui=`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(` `);ui.push(`scrollEnd`);function di(e,t){li.set(e,t),Ft(t,[e])}var fi=0;function pi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=wd.identifierPrefix;var n=fi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function mi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Md;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 hi(e,t){return e=mi(e),t=mi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var gi=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)},_i=[],vi=0,yi=0;function bi(){for(var e=vi,t=yi=vi=0;t<e;){var n=_i[t];_i[t++]=null;var r=_i[t];_i[t++]=null;var i=_i[t];_i[t++]=null;var a=_i[t];if(_i[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&&wi(n,i,a)}}function xi(e,t,n,r){_i[vi++]=e,_i[vi++]=t,_i[vi++]=n,_i[vi++]=r,yi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Si(e,t,n,r){return xi(e,t,n,r),Ti(e)}function Ci(e,t){return xi(e,null,null,t),Ti(e)}function wi(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 Ti(e){if(50<Nd)throw Nd=0,Pd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ei={};function Di(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 Oi(e,t,n,r){return new Di(e,t,n,r)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=Oi(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 ji(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 Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ki(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 V:return e=Oi(31,n,t,a),e.elementType=V,e.lanes=o,e;case j:return Ni(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Oi(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Oi(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Oi(19,n,t,a),e.elementType=R,e.lanes=o,e;case H:case te:return e=a|32,e=Oi(30,n,t,e),e.elementType=te,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=Oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=Oi(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=Oi(6,e,null,t),e.lanes=n,e}function Fi(e){var t=Oi(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=Oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var zi=[],Bi=0,Vi=null,Hi=0,Ui=[],Wi=0,Gi=null,Ki=1,qi=``;function Ji(e,t){zi[Bi++]=Hi,zi[Bi++]=Vi,Vi=e,Hi=t}function Yi(e,t,n){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Gi=e;var r=Ki;e=qi;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,Ki=1<<32-Je(t)+i|n<<i|r,qi=a+e}else Ki=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function Zi(e){for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null;for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,qi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null}function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Ki=t.id,qi=t.overflow,Gi=e}var $i=null,ea=null,ta=!1,na=null,ra=!1,ia=Error(i(519));function aa(e){throw da(Ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ia}function oa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:qf(`cancel`,t),qf(`close`,t);break;case`iframe`:case`object`:case`embed`:qf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Wf.length;n++)qf(Wf[n],t);break;case`source`:qf(`error`,t);break;case`img`:case`image`:case`link`:qf(`error`,t),qf(`load`,t);break;case`details`:qf(`toggle`,t);break;case`input`:qf(`invalid`,t),en(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:qf(`invalid`,t);break;case`textarea`:qf(`invalid`,t),an(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||op(t.textContent,n)?(r.popover!=null&&(qf(`beforetoggle`,t),qf(`toggle`,t)),r.onScroll!=null&&qf(`scroll`,t),r.onScrollEnd!=null&&qf(`scrollend`,t),r.onClick!=null&&(t.onclick=mn),t=!0):t=!1,t||aa(e,!0)}function sa(e){for($i=e.return;$i;)switch($i.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:$i=$i.return}}function ca(e){if(e!==$i)return!1;if(!ta)return sa(e),ta=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||bp(e.type,e.memoizedProps)),n=!n),n&&ea&&aa(e),sa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=vm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=vm(e)}else t===27?(t=ea,kp(e.type)?(e=_m,_m=null,ea=e):ea=t):ea=$i?gm(e.stateNode.nextSibling):null;return!0}function la(){ea=$i=null,ta=!1}function ua(){var e=na;return e!==null&&(gd===null?gd=e:gd.push.apply(gd,e),na=null),e}function da(e){na===null?na=[e]:na.push(e)}var fa=pe(null),pa=null,ma=null;function ha(e,t,n){he(fa,t._currentValue),t._currentValue=n}function ga(e){e._currentValue=fa.current,me(fa)}function _a(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 va(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),_a(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),_a(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),_a(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 ya(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;Lr(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&&va(t,e,n,r),t.flags|=262144,e!==null}function ba(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xa(e){pa=e,ma=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Sa(e){return wa(pa,e)}function Ca(e,t){return pa===null&&xa(e),wa(e,t)}function wa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ma===null){if(e===null)throw Error(i(308));ma=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ma=ma.next=t;return n}var Ta=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()})}},Ea=t.unstable_scheduleCallback,Da=t.unstable_NormalPriority,Oa={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ka(){return{controller:new Ta,data:new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Ea(Da,function(){e.controller.abort()})}function ja(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 Ma=null;function Na(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pa=null,Fa=0,Ia=0,La=null;function Ra(e,t){if(Pa===null){var n=Pa=[];Fa=0,Ia=zf(),La={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Fa++,t.then(za,za),t}function za(){if(--Fa===0&&(Ma=null,Pa!==null)){La!==null&&(La.status=`fulfilled`);var e=Pa;Pa=null,Ia=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ba(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 Va=ce.S;ce.S=function(e,t){if(yd=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&Ra(e,t),Ma!==null)for(var n=Tf;n!==null;)ja(n,Ma),n=n.next;if(n=e.types,n!==null){for(var r=Tf;r!==null;)ja(r,n),r=r.next;if(Ia!==0){r=Ma,r===null&&(r=Ma=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Va!==null&&Va(e,t)};var Ha=pe(null);function Ua(){var e=Ha.current;return e===null?td.pooledCache:e}function Wa(e,t){t===null?he(Ha,Ha.current):he(Ha,t.pool)}function Ga(){var e=Ua();return e===null?null:{parent:Oa._currentValue,pool:e}}var Ka=Error(i(460)),qa=Error(i(474)),Ja=Error(i(542)),Ya={then:function(){}};function Xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Za(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(mn,mn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(mn,mn);else{if(e=td,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,to(e),e}throw $a=t,Ka}}function Qa(e){try{return(0,e._init)(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?($a=e,Ka):e}}var $a=null;function eo(){if($a===null)throw Error(i(459));var e=$a;return $a=null,e}function to(e){if(e===Ka||e===Ja)throw Error(i(483))}var no=null,ro=0;function io(e){var t=ro;return ro+=1,no===null&&(no=[]),Za(no,e,t)}function ao(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function oo(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 so(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=Ai(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=Pi(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),ao(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===B&&Qa(i)===t.type)?(t=a(t,n.props),ao(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),ao(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=Ii(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=Ni(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=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Mi(t.type,t.key,t.props,null,e.mode,n),ao(n,t),n.return=e,n;case A:return t=Ii(t,e.mode,n),t.return=e,t;case B:return t=Qa(t),f(e,t,n)}if(se(t)||ie(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,io(t),n);if(t.$$typeof===F)return f(e,Ca(e,t),n);oo(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=Qa(n),p(e,t,n,r)}if(se(n)||ie(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,io(n),r);if(n.$$typeof===F)return p(e,t,Ca(e,n),r);oo(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=Qa(r),m(e,t,n,r,i)}if(se(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,io(r),i);if(r.$$typeof===F)return m(e,t,n,Ca(t,r),i);oo(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),ta&&Ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ta&&Ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.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)}),ta&&Ji(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ta&&Ji(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ta&&Ji(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.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)}),ta&&Ji(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),ao(c,o),c.return=e,e=c;break e}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===B&&Qa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ao(c,o),c.return=e,e=c;break e}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ni(o.props.children,e.mode,c,o.key),ao(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),ao(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=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case B:return o=Qa(o),_(e,r,o,c)}if(se(o))return h(e,r,o,c);if(ie(o)){if(l=ie(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,io(o),c);if(o.$$typeof===F)return _(e,r,Ca(e,o),c);oo(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=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ro=0;var i=_(e,t,n,r);return no=null,i}catch(t){if(t===Ka||t===Ja)throw t;var a=Oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var co=so(!0),lo=so(!1),uo=!1;function fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function po(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 mo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ho(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ed&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ti(e),wi(e,null,n),t}return xi(e,r,t,n),Ti(e)}function go(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}function _o(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 vo=!1;function yo(){if(vo){var e=La;if(e!==null)throw e}}function bo(e,t,n,r){vo=!1;var i=e.updateQueue;uo=!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?(rd&f)===f:(r&f)===f){f!==0&&f===Ia&&(vo=!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:uo=!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),K|=o,e.lanes=o,e.memoizedState=d}}function xo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function So(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)xo(n[e],t)}var Co=pe(null),wo=pe(0);function To(e,t){e=ld,he(wo,e),he(Co,t),ld=e|t.baseLanes}function Eo(){he(wo,ld),he(Co,Co.current)}function Do(){ld=wo.current,me(Co),me(wo)}var Oo=pe(null),ko=null;function Ao(e){var t=e.alternate;he(Fo,Fo.current&1),he(Oo,e),ko===null&&(t===null||Co.current!==null||t.memoizedState!==null)&&(ko=e)}function jo(e){he(Fo,Fo.current),he(Oo,e),ko===null&&(ko=e)}function Mo(e){e.tag===22?(he(Fo,Fo.current),he(Oo,e),ko===null&&(ko=e)):No()}function No(){he(Fo,Fo.current),he(Oo,Oo.current)}function Po(e){me(Oo),ko===e&&(ko=null),me(Fo)}var Fo=pe(0);function Io(e,t){he(Oo,Oo.current),he(Fo,t)}function Lo(e){me(Fo),me(Oo),ko===e&&(ko=null)}function Ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pm(n)||mm(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 zo=0,Bo=null,Vo=null,Ho=null,Uo=!1,Wo=!1,Go=!1,Ko=0,qo=0,Jo=null,Yo=0;function Xo(){throw Error(i(321))}function Zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Qo(e,t,n,r,i,a){return zo=a,Bo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ce.H=e===null||e.memoizedState===null?hc:gc,Go=!1,a=n(r,i),Go=!1,Wo&&(a=es(t,n,r,i)),$o(e),a}function $o(e){ce.H=mc;var t=Vo!==null&&Vo.next!==null;if(zo=0,Ho=Vo=Bo=null,Uo=!1,qo=0,Jo=null,t)throw Error(i(300));e===null||Nc||(e=e.dependencies,e!==null&&ba(e)&&(Nc=!0))}function es(e,t,n,r){Bo=e;var a=0;do{if(Wo&&(Jo=null),qo=0,Wo=!1,25<=a)throw Error(i(301));if(a+=1,Ho=Vo=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=_c,o=t(n,r)}while(Wo);return o}function ts(){var e=ce.H,t=e.useState()[0];return t=typeof t.then==`function`?cs(t):t,e=e.useState()[0],(Vo===null?null:Vo.memoizedState)!==e&&(Bo.flags|=1024),t}function ns(){var e=Ko!==0;return Ko=0,e}function rs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function is(e){if(Uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Uo=!1}zo=0,Ho=Vo=Bo=null,Wo=!1,qo=Ko=0,Jo=null}function as(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ho===null?Bo.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function os(){if(Vo===null){var e=Bo.alternate;e=e===null?null:e.memoizedState}else e=Vo.next;var t=Ho===null?Bo.memoizedState:Ho.next;if(t!==null)Ho=t,Vo=e;else{if(e===null)throw Bo.alternate===null?Error(i(467)):Error(i(310));Vo=e,e={memoizedState:Vo.memoizedState,baseState:Vo.baseState,baseQueue:Vo.baseQueue,queue:Vo.queue,next:null},Ho===null?Bo.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cs(e){var t=qo;return qo+=1,Jo===null&&(Jo=[]),e=Za(Jo,e,t),t=Bo,(Ho===null?t.memoizedState:Ho.next)===null&&(t=t.alternate,ce.H=t===null||t.memoizedState===null?hc:gc),e}function ls(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return cs(e);if(e.$$typeof===ne)return;if(e.$$typeof===F)return Sa(e)}throw Error(i(438,String(e)))}function us(e){var t=null,n=Bo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Bo.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=ss(),Bo.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]=ee;return t.index++,n}function ds(e,t){return typeof t==`function`?t(e):t}function fs(e){return ps(os(),Vo,e)}function ps(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?(zo&f)===f:(rd&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===Ia&&(d=!0);else if((zo&p)===p){u=u.next,p===Ia&&(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,Bo.lanes|=p,K|=p;f=u.action,Go&&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,Bo.lanes|=f,K|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(Nc=!0,d&&(n=La,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 ms(e){var t=os(),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);Lr(o,t.memoizedState)||(Nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function hs(e,t,n){var r=Bo,a=os(),o=ta;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((Vo||a).memoizedState,n);if(s&&(a.memoizedState=n,Nc=!0),a=a.queue,Bs(vs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ho!==null&&!!(Ho.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},_s.bind(null,r,a,n,t),null),e){if(r.flags|=2048,td===null)throw Error(i(349));o||zo&127||gs(r,t,n)}return n}function gs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Bo.updateQueue,t===null?(t=ss(),Bo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _s(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&bs(e)}function vs(e,t,n){return n(function(){ys(t)&&bs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function bs(e){var t=Ci(e,2);t!==null&&Rd(t,e,2)}function xs(e){var t=as();if(typeof e==`function`){var n=e;if(e=n(),Go){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t}function Ss(e,t,n,r){return e.baseState=n,ps(e,Vo,typeof r==`function`?r:ds)}function Cs(e,t,n,r,a){if(dc(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,ws(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ws(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),Ts(e,t,s)}catch(n){Ds(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),ce.T=a}}else try{a=n(i,r),Ts(e,t,a)}catch(n){Ds(e,t,n)}}function Ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Es(e,t,n)},function(n){return Ds(e,t,n)}):Es(e,t,n)}function Es(e,t,n){t.status=`fulfilled`,t.value=n,Os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ws(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Os(t),t=t.next;while(t!==r)}e.action=null}function Os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ks(e,t){return t}function As(e,t){if(ta){var n=td.formState;if(n!==null){e:{var r=Bo;if(ta){if(ea){t:{for(var i=ea,a=ra;i.nodeType!==8;)if(!a||(i=gm(i.nextSibling),i===null)){i=null;break t}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=gm(i.nextSibling),r=i.data===`F!`;break e}}aa(r)}r=!1}r&&(t=n[0])}}return n=as(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,Bo,r),r.dispatch=n,r=xs(!1),a=uc.bind(null,Bo,!1,r.queue),r=as(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,Bo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(os(),Vo,e)}function Ms(e,t,n){if(t=ps(e,t,ks)[0],e=fs(ds)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=cs(t)}catch(e){throw e===Ka?Ja:e}else r=t;t=os();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Bo.flags|=2048,Fs(9,{destroy:void 0},Ns.bind(null,i,n),null)),[r,a,e]}function Ns(e,t){e.action=t}function Ps(e){var t=os(),n=Vo;if(n!==null)return Ms(t,n,e);os(),t=t.memoizedState,n=os();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Bo.updateQueue,t===null&&(t=ss(),Bo.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 Is(){return os().memoizedState}function Ls(e,t,n,r){var i=as();Bo.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=os();r=r===void 0?null:r;var a=i.memoizedState.inst;Vo!==null&&r!==null&&Zo(r,Vo.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(Bo.flags|=e,i.memoizedState=Fs(1|t,a,n,r))}function zs(e,t){Ls(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){Bo.flags|=4;var t=Bo.updateQueue;if(t===null)t=ss(),Bo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=os().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(ed&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(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 Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zo(t,r[1]))return r[0];if(r=e(),Go){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||zo&0x40000000&&!(rd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Id(),Bo.lanes|=e,K|=e,n)}function Zs(e,t,n,r){return Lr(n,t)?n:Co.current===null?!(zo&106)||zo&0x40000000&&!(rd&261930)?(Nc=!0,e.memoizedState=n):(e=Id(),Bo.lanes|=e,K|=e,t):(e=Xs(e,n,r),Lr(e,t)||(Nc=!0),e)}function Qs(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,uc(e,!1,t,n);try{var c=i(),l=ce.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Ba(c,r),Fd(e)):lc(e,t,r,Fd(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},Fd())}finally{le.p=a,o!==null&&s.types!==null&&(o.types=s.types),ce.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));Qs(e,tc(e).queue,t,ue,n===null?$s:function(){return nc(e),n(r)})}function tc(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:ds,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nc(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),lc(e,t.next.queue,{},Fd())}function rc(){return Sa(ph)}function ic(){return os().memoizedState}function ac(){return os().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Fd();e=mo(n);var r=ho(t,e,n);r!==null&&(Rd(r,t,n),go(r,t,n)),t={cache:ka()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=Fd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dc(e)?fc(t,n):(n=Si(e,t,n,r),n!==null&&(Rd(n,e,r),pc(n,t,r)))}function cc(e,t,n){lc(e,t,n,Fd())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dc(e))fc(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,Lr(s,o))return xi(e,t,i,0),td===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return Rd(n,e,r),pc(n,t,r),!0}return!1}function uc(e,t,n,r){if(r={lane:2,revertLane:zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(i(479))}else t=Si(e,n,r,2),t!==null&&Rd(t,e,2)}function dc(e){var t=e.alternate;return e===Bo||t!==null&&t===Bo}function fc(e,t){Wo=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var mc={readContext:Sa,use:ls,useCallback:Xo,useContext:Xo,useEffect:Xo,useImperativeHandle:Xo,useLayoutEffect:Xo,useInsertionEffect:Xo,useMemo:Xo,useReducer:Xo,useRef:Xo,useState:Xo,useDebugValue:Xo,useDeferredValue:Xo,useTransition:Xo,useSyncExternalStore:Xo,useId:Xo,useHostTransitionStatus:Xo,useFormState:Xo,useActionState:Xo,useOptimistic:Xo,useMemoCache:Xo,useCacheRefresh:Xo,useEffectEvent:Xo},hc={readContext:Sa,use:ls,useCallback:function(e,t){return as().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ls(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var n=as();t=t===void 0?null:t;var r=e();if(Go){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=as();if(n!==void 0){var i=n(t);if(Go){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=sc.bind(null,Bo,e),[r.memoizedState,e]},useRef:function(e){var t=as();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,Bo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(as(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,Bo,e.queue,!0,!1),as().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Bo,a=as();if(ta){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),td===null)throw Error(i(349));rd&127||gs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(vs.bind(null,r,o,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},_s.bind(null,r,o,n,t),null),n},useId:function(){var e=as(),t=td.identifierPrefix;if(ta){var n=qi,r=Ki;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ko++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=as();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=uc.bind(null,Bo,!0,n),n.dispatch=t,[e,t]},useMemoCache:us,useCacheRefresh:function(){return as().memoizedState=oc.bind(null,Bo)},useEffectEvent:function(e){var t=as(),n={impl:e};return t.memoizedState=n,function(){if(ed&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:Sa,use:ls,useCallback:Js,useContext:Sa,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:fs,useRef:Is,useState:function(){return fs(ds)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(os(),Vo.memoizedState,e,t)},useTransition:function(){var e=fs(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(os(),Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs},_c={readContext:Sa,use:ls,useCallback:Js,useContext:Sa,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:ms,useRef:Is,useState:function(){return ms(ds)},useDebugValue:qs,useDeferredValue:function(e,t){var n=os();return Vo===null?Xs(n,e,t):Zs(n,Vo.memoizedState,e,t)},useTransition:function(){var e=ms(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=os();return Vo===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs};function vc(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 yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=mo(r);i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Rd(t,e,r),go(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=mo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Rd(t,e,r),go(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fd(),r=mo(n);r.tag=2,t!=null&&(r.callback=t),t=ho(e,r,n),t!==null&&(Rd(t,e,n),go(t,e,n))}};function bc(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?!Rr(n,r)||!Rr(i,a):!0}function xc(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&&yc.enqueueReplaceState(t,t.state,null)}function Sc(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 Cc(e){gi(e)}function wc(e){console.error(e)}function Tc(e){gi(e)}function Ec(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Dc(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 Oc(e,t,n){return n=mo(n),n.tag=3,n.payload={element:null},n.callback=function(){Ec(e,t)},n}function kc(e){return e=mo(e),e.tag=3,e}function Ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Dc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Dc(t,n,r),typeof i!=`function`&&(Sd===null?Sd=new Set([this]):Sd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function jc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ya(t,n,a,!0),n=Oo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ko===null?Xd():n.alternate===null&&ud===0&&(ud=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),yf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ya?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)),yf(e,r,a)),!1}throw Error(i(435,n.tag))}return yf(e,r,a),Xd(),!1}if(ta)return t=Oo.current,t===null?(r!==ia&&(t=Error(i(423),{cause:r}),da(Ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ri(r,n),a=Oc(e.stateNode,r,a),_o(e,a),ud!==4&&(ud=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ia&&(e=Error(i(422),{cause:r}),da(Ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ri(o,n),hd===null?hd=[o]:hd.push(o),ud!==4&&(ud=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,r,e),_o(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`&&(Sd===null||!Sd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=kc(a),Ac(a,e,n,r),_o(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Mc=Error(i(461)),Nc=!1;function Pc(e,t,n,r){t.child=e===null?lo(t,null,n,r):co(t,e.child,n,r)}function Fc(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 xa(t),r=Qo(e,t,n,o,a,i),s=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(ta&&s&&Xi(t),t.flags|=1,Pc(e,t,r,i),t.child)}function Ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Lc(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ul(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(Nc=!1,t.pendingProps=r=a,ul(e,i))e.flags&131072&&(Nc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return Gc(e,t,n,r,i)}function Rc(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 Bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,a===null?null:a.cachePool),a===null?Eo():To(t,a),Mo(t);else return r=t.lanes=536870912,Bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Wa(t,null),Eo(),No()):(Wa(t,a.cachePool),To(t,a),No(),t.memoizedState=null);return Pc(e,t,i,n),t.child}function zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bc(e,t,n,r,i){var a=Ua();return a=a===null?null:{parent:Oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Wa(t,null),Eo(),Mo(t),e!==null&&ya(e,t,r,!0),t.childLanes=i,null}function Vc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(e,t,n){return co(t,e.child,null,n),e=Vc(t,t.pendingProps),e.flags|=2,Po(t),t.memoizedState=null,e}function Uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ta){if(r.mode===`hidden`)return e=Vc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zc(null,e);if(jo(t),(e=ea)?(e=fm(e,ra),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw aa(t);return t.lanes=536870912,null}return Vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(jo(t),a){if(t.flags&256)t.flags&=-257,t=Hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Nc||ya(e,t,n,!1),a=(n&e.childLanes)!==0,Nc||a){if(Co.current===null){if(r=td,r!==null&&(s=dt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ci(e,s),Rd(r,e,s),Mc;Xd()}t=Hc(e,t,n)}else e=o.treeContext,ea=gm(s.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=Vc(t,r),t.flags|=0x8001000;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(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 Gc(e,t,n,r,i){return xa(t),n=Qo(e,t,n,r,void 0,i),r=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(ta&&r&&Xi(t),t.flags|=1,Pc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return xa(t),t.updateQueue=null,n=es(t,r,n,i),$o(e),r=ns(),e!==null&&!Nc?(rs(e,t,a),ll(e,t,a)):(ta&&r&&Xi(t),t.flags|=1,Pc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(xa(t),t.stateNode===null){var a=Ei,o=n.contextType;typeof o==`object`&&o&&(a=Sa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=yc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},fo(t),o=n.contextType,a.context=typeof o==`object`&&o?Sa(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(vc(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&&yc.enqueueReplaceState(a,a.state,null),bo(t,r,a,i),yo(),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=Sc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ei,typeof u==`object`&&u&&(o=Sa(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)&&xc(t,a,r,o),uo=!1;var f=t.memoizedState;a.state=f,bo(t,r,a,i),yo(),l=t.memoizedState,s||f!==l||uo?(typeof d==`function`&&(vc(t,n,d,r),l=t.memoizedState),(c=uo||bc(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,po(e,t),o=t.memoizedProps,u=Sc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ei,typeof l==`object`&&l&&(c=Sa(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)&&xc(t,a,r,c),uo=!1,f=t.memoizedState,a.state=f,bo(t,r,a,i),yo();var p=t.memoizedState;o!==d||f!==p||uo||e!==null&&e.dependencies!==null&&ba(e.dependencies)?(typeof s==`function`&&(vc(t,n,s,r),p=t.memoizedState),(u=uo||bc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ba(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,Wc(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=co(t,e.child,null,i),t.child=co(t,null,n,i)):Pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return la(),t.flags|=256,Pc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Ga()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=pd),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Fo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ta){if(i?Ao(t):No(),(e=ea)?(e=fm(e,ra),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw aa(t);return t.lanes=mm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(No(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(null,r)):(Ao(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(No(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&0x47f00000,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,zc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=Ga():(s=Oa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(e.child,r)):(Ao(t),n=e.child,e=n.sibling,n=Ai(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 $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return co(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Ao(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(No(),o=a.fallback,s=t.mode,a=el({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,co(t,e.child,null,c),a=t.child,a.memoizedState=Xc(c),a.childLanes=Zc(e,r,c),t.memoizedState=Yc,zc(null,a)):(No(),t.child=e.child,t.flags|=128,null);if(Ao(t),mm(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,da({value:a,source:null,stack:null})),tl(e,t,c)}if(Nc||ya(e,t,c,!1),r=(c&e.childLanes)!==0,Nc||r){if(Co.current!==null)return tl(e,t,c);if(r=td,r!==null&&(a=dt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ci(e,a),Rd(r,e,a),Mc;return pm(o)||Xd(),tl(e,t,c)}return pm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ea=gm(o.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=$c(t,a.children),t.flags|=0x8001000,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_a(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ro(n)===null&&(t=e),e=e.sibling}return t}function al(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 ol(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 sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Fo.current;if(t.flags&128)return Io(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Io(t,o),i===`backwards`&&e!==null?(ol(e),Pc(e,t,r,n),ol(e)):Pc(e,t,r,n),r=ta?Hi:0,!s&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(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=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(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&&Ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return ha(t,t.type,r.value),Pc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),K|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ya(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=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ul(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ba(e)))}function dl(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),ha(t,Oa,e.memoizedState.cache),la();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,jo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ao(t),t.flags|=128,null;r=ya(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(Ao(t),e=ll(e,t,n),e===null?null:e.sibling)}Ao(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ya(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Io(t,Fo.current),r)break;return null;case 22:return t.lanes=0,Rc(e,t,n,t.pendingProps);case 24:ha(t,Oa,e.memoizedState.cache)}return ll(e,t,n)}function fl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Nc=!0;else{if(!ul(e,n)&&!(t.flags&128))return Nc=!1,dl(e,t,n);Nc=!!(e.flags&131072)}}else Nc=!1,ta&&t.flags&1048576&&Yi(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Qa(t.elementType),t.type=e,typeof e==`function`)ki(e)?(r=Sc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=Gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Fc(null,t,e,r,n);break e}if(a===z){t.tag=14,t=Ic(null,t,e,r,n);break e}if(a===F){t.tag=10,t.type=e,t=cl(null,t,n);break e}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Sc(r,t.pendingProps),qc(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,po(e,t),bo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ha(t,Oa,r),r!==o.cache&&va(t,[Oa],n,!0),yo(),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=Jc(e,t,r,n);break e}if(r!==a){a=Ri(Error(i(424)),t),da(a),t=Jc(e,t,r,n);break e}for(e=t.stateNode.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,ea=gm(e.firstChild),$i=t,ta=!0,na=null,ra=!0,n=lo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|0x8001000,n=n.sibling}else{if(la(),r===a){t=ll(e,t,n);break e}Pc(e,t,r,n)}t=t.child}return t;case 26:return Wc(e,t),e===null?(n=Bm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ta||(t.stateNode=yp(t.type,t.pendingProps,ve.current,t)):t.memoizedState=Bm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&ta&&(r=t.stateNode=Sm(t.type,t.pendingProps,ve.current),$i=t,ra=!0,a=ea,kp(t.type)?(_m=a,ea=gm(r.firstChild)):ea=a),Pc(e,t,t.pendingProps.children,n),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ta&&((a=r=ea)&&(r=um(r,t.type,t.pendingProps,ra),r===null?a=!1:(t.stateNode=r,$i=t,ea=gm(r.firstChild),ra=!1,a=!0)),a||aa(t)),Se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,bp(a,o)?r=null:s!==null&&bp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Qo(e,t,ts,null,null,n),ph._currentValue=a),Wc(e,t),Pc(e,t,r,n),t.child;case 6:return e===null&&ta&&((e=n=ea)&&(n=dm(n,t.pendingProps,ra),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||aa(t)),null;case 13:return Qc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Pc(e,t,r,n),t.child;case 11:return Fc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Wc(e,t),Pc(e,t,r,n),t.child;case 8:case 12:return Pc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,xa(t),a=Sa(a),r=r(a),t.flags|=1,Pc(e,t,r,n),t.child;case 14:return Ic(e,t,t.type,t.pendingProps,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Uc(e,t,n);case 22:return Rc(e,t,n,t.pendingProps);case 24:return xa(t),r=Sa(Oa),e===null?(a=Ua(),a===null&&(a=td,o=ka(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},fo(t),ha(t,Oa,a)):((e.lanes&n)!==0&&(po(e,t),bo(t,null,null,n),yo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ha(t,Oa,r),r!==a.cache&&va(t,[Oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ha(t,Oa,r))),Pc(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:ta&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Wc(e,t),Pc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function pl(e){e.flags|=4}function ml(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(qd())e.flags|=8192;else throw $a=Ya,qa}}else e.flags&=-16777217}function hl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(qd())e.flags|=8192;else throw $a=Ya,qa}}function gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:at(),e.lanes|=t,md|=t)}function _l(e,t){if(!ta)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 vl(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 yl(e,t,n){var r=t.pendingProps;switch(Zi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return vl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ga(Oa),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ca(t)?pl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ua())),vl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(pl(t),o===null?(vl(t),ml(t,a,null,r,n)):(vl(t),hl(t,o))):o?o===e.memoizedState?(vl(t),t.flags&=-16777217):(pl(t),vl(t),hl(t,o)):(e=e.memoizedProps,e!==r&&pl(t),vl(t),ml(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&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}e=ge.current,ca(t)?oa(t,e):(e=Sm(a,r,n),t.stateNode=e,pl(t))}return vl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}if(o=ge.current,ca(t))oa(t,o);else{var s=gp(ve.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[_t]=t,o[vt]=r;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,lp(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&&pl(t)}}return vl(t),t.subtreeFlags&=-33554433,ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,ca(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=$i,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||op(e.nodeValue,n)),e||aa(t,!0)}else e=gp(e).createTextNode(r),e[_t]=t,t.stateNode=e}return vl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ca(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[_t]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),e=!1}else n=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Po(t),t):(Po(t),null);if(t.flags&128)throw Error(i(558))}return vl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ca(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[_t]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),a=!1}else a=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Po(t),t):(Po(t),null)}return Po(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),gl(t,t.updateQueue),vl(t),null);case 4:return xe(),e===null&&Xf(t.stateNode.containerInfo),t.flags|=67108864,vl(t),null;case 10:return ga(t.type),vl(t),null;case 19:if(Lo(t),r=t.memoizedState,r===null)return vl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)_l(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ro(e),o!==null){for(t.flags|=128,_l(r,!1),e=o.updateQueue,t.updateQueue=e,gl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return Io(t,Fo.current&1|2),ta&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>bd&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,gl(t,e),_l(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ta)return vl(t),null}else 2*Ie()-r.renderingStartTime>bd&&n!==536870912&&(t.flags|=128,a=!0,_l(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=Fo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ta?Io(t,o):(n=o,he(Oo,t),he(Fo,n),ko===null&&(ko=t)),ta&&Ji(t,r.treeForkCount),e}return vl(t),null;case 22:case 23:return Po(t),Do(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(vl(t),t.subtreeFlags&6&&(t.flags|=8192)):vl(t),n=t.updateQueue,n!==null&&gl(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(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ga(Oa),vl(t),null;case 25:return null;case 30:return t.flags|=33554432,vl(t),null}throw Error(i(156,t.tag))}function bl(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ga(Oa),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(Po(t),t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lo(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 ga(t.type),null;case 22:case 23:return Po(t),Do(),e!==null&&me(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ga(Oa),null;default:return null}}function xl(e,t){switch(Zi(t),t.tag){case 3:ga(Oa),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&Po(t);break;case 13:Po(t);break;case 19:Lo(t);break;case 10:ga(t.type);break;case 22:case 23:Po(t),Do(),e!==null&&me(Ha);break;case 24:ga(Oa)}}function Sl(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){vf(t,t.return,e)}}function Cl(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){vf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){vf(t,t.return,e)}}function wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{So(t,n)}catch(t){vf(e,e.return,t)}}}function Tl(e,t,n){n.props=Sc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){vf(e,t,n)}}function El(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=pi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Vp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Hp(e);m(e.child,!1,am,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){vf(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){vf(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){vf(e,t,n)}else n.current=null}}function Ol(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++)sm(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&sm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&cm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(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){vf(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;dp(r,e.type,n,t),r[vt]=t}catch(t){vf(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kp(e.type)||e.tag===4}function Il(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(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&&kp(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 Ll(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=mn)),Ol(e,r),Vt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,kp(e.type)&&(n=e.stateNode,t=null)),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,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),Vt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,kp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);lp(t,r,n),t[_t]=e,t[vt]=n}catch(t){vf(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var W=null;function Ul(){var e=W;return W=null,e}var Wl=0;function Gl(e,t,n,r,i){return Wl=0,Kl(e.child,t,n,r,i)}function Kl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Fp(o);r.push(s),s.view&&(a=!0)}else a||Fp(o).view&&(a=!0);Bl=!0,Mp(o,Wl===0?t:t+`_`+Wl,n),Wl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Kl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function ql(e,t){for(;e!==null;)e.tag===5?Np(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||ql(e.child,t),e=e.sibling}function Jl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Jl(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=hi(t.default,t.share),t!==`none`&&(Gl(e,n,t,null,!1)||ql(e.child,!1))}e=e.sibling}}function Yl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=pi(r,n),a=hi(r.default,n.paired?r.share:r.enter);a===`none`?Jl(e):Gl(e,i,a,null,!1)?(Jl(e),n.paired||t||Ld(e,r.onEnter)):ql(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e,t),e=e.sibling;else Jl(e)}function Xl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;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=hi(n.default,n.share);if(a!==`none`&&(Gl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ld(e,n.onShare)):ql(e.child,!1)),t.delete(r),t.size===0)break}}}Xl(e)}e=e.sibling}}}function Zl(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Gl(e,n,i,null,!1)?r===void 0?Ld(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Ld(e,t.onShare)):ql(e.child,!1)),Vl!==null&&Xl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Vl!==null&&Xl(e)}function Ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode);t=hi(t.default,t.update),e.flags&=-5,t!==`none`&&Gl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Ql(e);e=e.sibling}}function $l(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,ql(e.child,!1))}$l(e)}e=e.sibling}}function eu(e){if(e.tag===30)e.stateNode.paired=null,ql(e.child,!1),$l(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else $l(e)}function tu(e){for(e=e.child;e!==null;)e.tag===30?ql(e.child,!1):e.subtreeFlags&33554432&&tu(e),e=e.sibling}function nu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Wl<a.length){var l=a[Wl],u=Fp(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&&Mp(c,Wl===0?n:n+`_`+Wl,i),s&&e.flags&4||(W===null&&(W=[]),W.push(c,Wl===0?r:r+`_`+Wl,t.memoizedProps)),Wl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:nu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ru(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=pi(n,r),a=hi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ip)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Wl=0,i=nu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ld(e,n.onUpdate))}else e.subtreeFlags&33554432&&ru(e,t);e=e.sibling}}var iu=!1,au=!1,ou=!1,su=!1,cu=typeof WeakSet==`function`?WeakSet:Set,lu=null,uu=!1,du=!1,fu=!1,pu=!1;function mu(e,t,n){if(e=e.containerInfo,mp=Sh,e=Ur(e),Wr(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(hp={focusedElem:e,selectionRange:r},Sh=!1,n=(n&335544064)===n,lu=t,t=n?9270:1024;lu!==null;){if(e=lu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Zl(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),hu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Zl(r),hu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),hu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,lu=r):(n&&Ql(e),hu(n))}}Vl=null}function hu(e){for(;lu!==null;){var t=lu,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=Sc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){vf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)lm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:lm(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=pi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=hi(a.default,a.update),a!==`none`&&Gl(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,lu=r;break}lu=t.return}}function gu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fu(e,n),r&4&&Sl(5,n);break;case 1:if(Fu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){vf(n,n.return,e)}else{var i=Sc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){vf(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Fu(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{So(e,t)}catch(e){vf(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Fu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Fu(e,n);break;case 31:Fu(e,n),r&4&&wu(e,n);break;case 13:Fu(e,n),r&4&&Tu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Sf.bind(null,n),hm(e,n))));break;case 22:if(r=n.memoizedState!==null||iu,!r){var a=t!==null&&t.memoizedState!==null||au;t=iu,i=au,iu=r,(au=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Lu(e,n,r)):Fu(e,n),iu=t,au=i}break;case 30:Fu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Fu(e,n)}}function _u(e,t){for(e=e.child;e!==null;)G(e,t),e=e.sibling}function G(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){vf(e,e.return,t)}vu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Vt=!0}catch(t){vf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?jp(s,!0):jp(e.stateNode,!1)}catch(t){vf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&_u(e,t);break;default:_u(e,t)}}function vu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,r=t;switch(n.tag){case 4:G(n,r);break e;case 22:n.memoizedState===null&&vu(n,r);break e;default:vu(n,r)}}e=e.sibling}}function yu(e){var t=e.alternate;t!==null&&(e.alternate=null,yu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Et(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 bu=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:au||Dl(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!au&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:au||Dl(n,t),Al(n);var r=bu,i=xu;kp(n.type)&&(bu=n.stateNode,xu=!1),Su(e,t,n),Cm(n.stateNode,n.type,n.memoizedProps),bu=r,xu=i;break;case 5:au||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=bu,i=xu,bu=null,Su(e,t,n),bu=r,xu=i,bu!==null){if(xu)try{(bu.nodeType===9?bu.body:bu.nodeName===`HTML`?bu.ownerDocument.body:bu).removeChild(n.stateNode),Vt=!0}catch(e){vf(n,t,e)}else try{bu.removeChild(n.stateNode),Vt=!0}catch(e){vf(n,t,e)}}break;case 18:bu!==null&&(xu?(e=bu,Ap(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):Ap(bu,n.stateNode));break;case 4:r=bu,i=xu,bu=n.stateNode.containerInfo,xu=!0,Su(e,t,n),bu=r,xu=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),au||Cl(4,n,t),Su(e,t,n);break;case 1:au||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:au=(r=au)||n.memoizedState!==null,Su(e,t,n),au=r;break;case 30:Dl(n,t),Su(e,t,n);break;case 7:au||Dl(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){vf(t,t.return,e)}}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){vf(t,t.return,e)}}function Eu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cu),t;default:throw Error(i(435,e.tag))}}function Du(e,t){var n=Eu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Cf.bind(null,e,t);t.then(r,r)}})}function Ou(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(kp(l.type)){bu=l.stateNode,xu=!1;break e}break;case 5:bu=l.stateNode,xu=!1;break e;case 3:case 4:bu=l.stateNode.containerInfo,xu=!0;break e}l=l.return}if(bu===null)throw Error(i(160));Cu(s,c,o),bu=null,xu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Au(t,e,n),t=t.sibling}var ku=null;function Au(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}Ou(t,e,n),ju(e),a&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:Ou(t,e,n),ju(e),a&512&&(au||r===null||Dl(r,r.return)),a&64&&iu&&(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=ku,Ou(t,e,n),ju(e),a&512&&(au||r===null||Dl(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(iu)e.stateNode=yp(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[wt]||r[_t]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),lp(r,t,n),r[_t]=e,jt(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),lp(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),lp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[_t]=e,jt(r),t=r}e.stateNode=t}}else iu||Qm(o,e.type,e.stateNode)}else e.stateNode=qm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||au||t.parentNode.removeChild(t)):a.count--,n===null?iu||Qm(o,e.type,e.stateNode):qm(o,n,e.memoizedProps))}break;case 27:Ou(t,e,n),ju(e),a&512&&(au||r===null||Dl(r,r.return)),r!==null&&a&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ou,ou=!1,Ou(t,e,n),ou=o,ju(e),a&512&&(au||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{on(t,``),Vt=!0}catch(t){vf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),a&1024&&(su=!0);break;case 6:if(Ou(t,e,n),ju(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Vt=!0}catch(t){vf(e,e.return,t)}}break;case 3:if(Vt=!1,Xm=null,o=ku,ku=Dm(t.containerInfo),Ou(t,e,n),ku=o,ju(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){vf(e,e.return,t)}su&&(su=!1,Mu(e)),Vt=!1;break;case 4:a=ou,ou=iu,r=Ht(),o=ku,ku=Dm(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=o,Vt&&du&&(fu=!0),Vt=r,ou=a;break;case 12:Ou(t,e,n),ju(e);break;case 31:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 13:Ou(t,e,n),ju(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(vd=Ie()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=iu,l=au,u=ou;iu=c||o,ou=u||o,au=l||s,Ou(t,e,n),au=l,ou=u,iu=c,ju(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||iu||au||(t=s||au,n=iu,r=au,iu=o||iu,au=t,Iu(e,2),iu=n,au=r),!o&&ou||_u(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Du(e,n))));break;case 19:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 30:a&512&&(au||r===null||Dl(r,r.return)),a=Ht(),o=du,s=(n&335544064)===n,c=e.memoizedProps,du=s&&hi(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),s&&r!==null&&Vt&&(e.flags|=4),du=o,Vt=a;break;case 21:break;case 7:a&512&&(au||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ou(t,e,n),ju(e)}}function ju(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ml(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(jl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(on(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(i(161))}}catch(t){vf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sh=!0,t.reset(),Sh=!1),e=e.sibling}}function Nu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pu(t,e),t=t.sibling;else ru(t,!1)}function Pu(e,t){var n=e.alternate;if(n===null)Yl(e,!1);else switch(e.tag){case 3:if(pu=uu=!1,Ul(),Nu(t,e),!uu&&!fu){if(e=W,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Np(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`})),pu=!0}W=null;break;case 5:Nu(t,e);break;case 4:r=uu,uu=!1,Nu(t,e),uu&&(fu=!0),uu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Nu(t,e):Yl(e,!1));break;case 30:r=uu,i=Ul(),uu=!1,Nu(t,e),uu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=pi(a,o),o=pi(n.memoizedProps,o);var s=hi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Wl=0,t=nu(e,n,t,o,s,a,!0),Wl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ld(e,e.memoizedProps.onUpdate),W=i):i!==null&&(i.push.apply(i,W),W=i),uu=e.flags&32?!0:r;break;default:Nu(t,e)}}function Fu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gu(e,t.alternate,t),t=t.sibling}function Iu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Iu(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Iu(n,r);break;case 27:r&2&&Cm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Iu(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||au||i.parentNode.removeChild(i),Iu(n,r);break;case 22:n.memoizedState===null&&Iu(n,r);break;case 30:Dl(n,n.return),Iu(n,r);break;case 7:Dl(n,n.return);default:Iu(n,r)}e=e.sibling}}function Lu(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:Lu(i,a,n),Sl(4,a);break;case 1:if(Lu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){vf(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++)xo(l[i],c)}catch(e){vf(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),Lu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||iu||Qm(Dm(c.ownerDocument),a.type,c),Lu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:Lu(i,a,n);break;case 31:Lu(i,a,n),s&&o&4&&wu(i,a);break;case 13:Lu(i,a,n),s&&o&4&&Tu(i,a);break;case 22:a.memoizedState===null&&Lu(i,a,n),El(a,a.return);break;case 30:Lu(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:Lu(i,a,n)}t=t.sibling}}function Ru(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&&Aa(n))}function zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function Bu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Vu(e,t,n,r),t=t.sibling;else i&&tu(t)}function Vu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&eu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Bu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Bu(e,t,n,r);break;case 3:Bu(e,t,n,r),i&&pu&&(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&&Aa(a)));break;case 12:if(a&2048){Bu(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){vf(t,t.return,e)}}else Bu(e,t,n,r);break;case 31:case 13:Bu(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&&eu(t),o._visibility&2?Bu(e,t,n,r):(o._visibility|=2,Hu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&eu(s),o._visibility&2?Bu(e,t,n,r):Uu(e,t)),a&2048&&Ru(s,t);break;case 24:Bu(e,t,n,r),a&2048&&zu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(ql(a.child,!0),ql(t.child,!0))),Bu(e,t,n,r);break;default:Bu(e,t,n,r)}}function Hu(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:Hu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Hu(a,o,s,c,i)):u._visibility&2?Hu(a,o,s,c,i):Uu(a,o),i&&l&2048&&Ru(o.alternate,o);break;case 24:Hu(a,o,s,c,i),i&&l&2048&&zu(o.alternate,o);break;default:Hu(a,o,s,c,i)}t=t.sibling}}function Uu(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:Uu(n,r),i&2048&&Ru(r.alternate,r);break;case 24:Uu(n,r),i&2048&&zu(r.alternate,r);break;default:Uu(n,r)}t=t.sibling}}var Wu=8192;function Gu(e,t,n){if(e.subtreeFlags&Wu)for(e=e.child;e!==null;)Ku(e,t,n),e=e.sibling}function Ku(e,t,n){switch(e.tag){case 26:Gu(e,t,n),e.flags&Wu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,ku,e.memoizedState,e.memoizedProps));break;case 5:Gu(e,t,n),e.flags&Wu&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=ku;ku=Dm(e.stateNode.containerInfo),Gu(e,t,n),ku=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Wu,Wu=16777216,Gu(e,t,n),Wu=r):Gu(e,t,n));break;case 30:if((e.flags&Wu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}Gu(e,t,n);break;default:Gu(e,t,n)}}function qu(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 Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Zu(r,e)}qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yu(e),e=e.sibling}function Yu(e){switch(e.tag){case 0:case 11:case 15:Ju(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:case 12:Ju(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ju(e);break;default:Ju(e)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Zu(r,e)}qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function Zu(e,t){for(;lu!==null;){var n=lu;switch(n.tag){case 0:case 11:case 15:Cl(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:Aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,lu=r;else for(n=e;lu!==null;){r=lu;var i=r.sibling,a=r.return;if(yu(r),r===n){lu=null;break}if(i!==null){i.return=a,lu=i;break}lu=a}}}var Qu={getCacheForType:function(e){var t=Sa(Oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Sa(Oa).controller.signal}},$u=typeof WeakMap==`function`?WeakMap:Map,ed=0,td=null,nd=null,rd=0,id=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,K=0,dd=0,fd=0,pd=0,md=0,hd=null,gd=null,_d=!1,vd=0,yd=0,bd=1/0,xd=null,Sd=null,Cd=0,wd=null,Td=null,Ed=0,Dd=0,Od=null,kd=null,Ad=null,jd=null,Md=null,Nd=0,Pd=null;function Fd(){return ed&2&&rd!==0?rd&-rd:ce.T===null?mt():zf()}function Id(){if(pd===0){if(!(rd&536870912)||ta){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),pd=e}else pd=536870912}return e=Oo.current,e!==null&&(e.flags|=32),pd}function Ld(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Vp(pi(e.memoizedProps,n))),jd===null&&(jd=[]),jd.push(t.bind(null,r))}}function Rd(e,t,n){(e===td&&(id===2||id===9)||e.cancelPendingCommit!==null)&&(Gd(e,0),Hd(e,rd,pd,!1)),st(e,n),ed&2&&e===td||(e===td&&(!(ed&2)&&(dd|=n),ud===4&&Hd(e,rd,pd,!1)),jf(e))}function zd(e,t,n){if(ed&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||U(e,t),a=r?$d(e,t):Zd(e,t,!0),o=r;do{if(a===0){sd&&!r&&Hd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Vd(n))a=Zd(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=hd;var l=c.current.memoizedState.isDehydrated;if(l&&(Gd(c,s).flags|=256),s=Zd(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,dd|=o,a=4;break e}o=gd,gd=a,o!==null&&(gd===null?gd=o:gd.push.apply(gd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Gd(e,0),Hd(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:Hd(r,t,pd,!od);break e;case 2:gd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=vd+300-Ie(),10<a)){if(Hd(r,t,pd,!od),nt(r,0,!0)!==0)break e;Ed=t,r.timeoutHandle=Cp(Bd.bind(null,r,n,gd,xd,_d,t,pd,dd,md,od,o,`Throttled`,-0,0),a);break e}Bd(r,n,gd,xd,_d,t,pd,dd,md,od,o,null,-0,0)}break}}while(1);jf(e)}function Bd(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:mn},Vl=null,Ku(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?vd-Ie():(a&4194048)===a?yd-Ie():0,m=oh(d,m),m!==null)?(Ed=a,e.cancelPendingCommit=m(sf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Hd(e,a,o,!l)):sf(e,t,a,n,r,i,o,s,c,l,u,d)}function Vd(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(!Lr(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 Hd(e,t,n,r){t=rt(e,t),t&=~fd,t&=~dd,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&<(e,n,t)}function Ud(){return ed&6?!0:(Mf(0,!1),!1)}function Wd(){if(nd!==null){if(id===0)var e=nd.return;else e=nd,ma=pa=null,is(e),no=null,ro=0,e=nd;for(;e!==null;)xl(e.alternate,e),e=e.return;nd=null}}function Gd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,wp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ed=0,Wd(),td=e,nd=n=Ai(e.current,null),rd=t,id=0,ad=null,od=!1,sd=U(e,t),cd=!1,md=pd=fd=dd=K=ud=0,gd=hd=null,_d=!1,ld=rt(e,t),bi(),n}function Kd(e,t){Bo=null,ce.H=mc,t===Ka||t===Ja?(t=eo(),id=3):t===qa?(t=eo(),id=4):id=t===Mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,nd===null&&(ud=1,Ec(e,Ri(t,e.current)))}function qd(){var e=Oo.current;return e===null?!0:(rd&4194048)===rd?ko===null:(rd&62914560)===rd||rd&536870912?e===ko:!1}function Jd(){var e=ce.H;return ce.H=mc,e===null?mc:e}function Yd(){var e=ce.A;return ce.A=Qu,e}function Xd(){ud=4,od||(rd&4194048)!==rd&&Oo.current!==null||(sd=!0),!(K&0x7ffffff)&&!(dd&0x7ffffff)||td===null||Hd(td,rd,pd,!1)}function Zd(e,t,n){var r=ed;ed|=2;var i=Jd(),a=Yd();(td!==e||rd!==t)&&(xd=null,Gd(e,t)),t=!1;var o=ud;e:do try{if(id!==0&&nd!==null){var s=nd,c=ad;switch(id){case 8:Wd(),o=6;break e;case 3:case 2:case 9:case 6:Oo.current===null&&(t=!0);var l=id;if(id=0,ad=null,rf(e,s,c,l),n&&sd){o=0;break e}break;default:l=id,id=0,ad=null,rf(e,s,c,l)}}Qd(),o=ud;break}catch(t){Kd(e,t)}while(1);return t&&e.shellSuspendCounter++,ma=pa=null,ed=r,ce.H=i,ce.A=a,nd===null&&(td=null,rd=0,bi()),o}function Qd(){for(;nd!==null;)tf(nd)}function $d(e,t){var n=ed;ed|=2;var r=Jd(),a=Yd();td!==e||rd!==t?(xd=null,bd=Ie()+500,Gd(e,t)):sd=U(e,t);e:do try{if(id!==0&&nd!==null){t=nd;var o=ad;t:switch(id){case 1:id=0,ad=null,rf(e,t,o,1);break;case 2:case 9:if(Xa(o)){id=0,ad=null,nf(t);break}t=function(){id!==2&&id!==9||td!==e||(id=7),jf(e)},o.then(t,t);break e;case 3:id=7;break e;case 4:id=5;break e;case 7:Xa(o)?(id=0,ad=null,nf(t)):(id=0,ad=null,rf(e,t,o,7));break;case 5:var s=null;switch(nd.tag){case 26:s=nd.memoizedState;case 5:case 27:var c=nd;if(s?th(s):c.stateNode.complete){id=0,ad=null;var l=c.sibling;if(l!==null)nd=l;else{var u=c.return;u===null?nd=null:(nd=u,af(u))}break t}}id=0,ad=null,rf(e,t,o,5);break;case 6:id=0,ad=null,rf(e,t,o,6);break;case 8:Wd(),ud=6;break e;default:throw Error(i(462))}}ef();break}catch(t){Kd(e,t)}while(1);return ma=pa=null,ce.H=r,ce.A=a,ed=n,nd===null?(td=null,rd=0,bi(),ud):0}function ef(){for(;nd!==null&&!Pe();)tf(nd)}function tf(e){var t=fl(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?af(e):nd=t}function nf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,rd);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,rd);break;case 5:is(t);var r=t;r===$i&&(ta?(sa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(sa(r),ta=!0));default:xl(n,t),t=nd=ji(t,ld),t=fl(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?af(e):nd=t}function rf(e,t,n,r){ma=pa=null,is(t),no=null,ro=0;var i=t.return;try{if(jc(e,i,t,n,rd)){ud=1,Ec(e,Ri(n,e.current)),nd=null;return}}catch(t){if(i!==null)throw nd=i,t;ud=1,Ec(e,Ri(n,e.current)),nd=null;return}t.flags&32768?(ta||r===1?e=!0:sd||rd&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=Oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),of(t,e)):af(t)}function af(e){var t=e;do{if(t.flags&32768){of(t,od);return}e=t.return;var n=yl(t.alternate,t,ld);if(n!==null){nd=n;return}if(t=t.sibling,t!==null){nd=t;return}nd=t=e}while(t!==null);ud===0&&(ud=5)}function of(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,nd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){nd=e;return}nd=e=n}while(e!==null);ud=6,nd=null}function sf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(Cd!==0);if(ed&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===td&&(nd=td=null,rd=0),Td=t,wd=e,Ed=n,Od=a,kd=r,cf(e,t,n,s,c,l,f)}}function cf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Dd=s,s|=yi,ct(e,n,s,r,i,a),jd=null,(n&335544064)===n?(Md=Na(e),r=10262):(Md=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,wf(Be,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=ce.T,ce.T=null,i=le.p,le.p=2,a=ed,ed|=4;try{mu(e,t,n)}finally{ed=a,le.p=i,ce.T=r}}Cd=1,Bl?Ad=zp(o,e.containerInfo,Md,df,ff,uf,pf,gf,lf,null,null):(df(),ff(),pf())}function lf(e){Cd!==0&&(0,wd.onRecoverableError)(e,{componentStack:null})}function uf(){Cd===3&&(Cd=0,Pu(Td,wd),Cd=4)}function df(){if(Cd===1){Cd=0;var e=wd,t=Td,n=Ed,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=ce.T,ce.T=null;var i=le.p;le.p=2;var a=ed;ed|=4;try{du=fu=!1,Au(t,e,n),n=hp;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(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 _=Vr(s,h),v=Vr(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=!!mp,hp=mp=null}finally{ed=a,le.p=i,ce.T=r}}e.current=t,Cd=2}}function ff(){if(Cd===2){Cd=0;var e=wd,t=Td,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=ce.T,ce.T=null;var r=le.p;le.p=2;var i=ed;ed|=4;try{gu(e,t.alternate,t)}finally{ed=i,le.p=r,ce.T=n}}Cd=3}}function pf(){if(Cd===4||Cd===3){Cd=0;var e=Ad;Ad=null,Fe();var t=wd,n=Td,r=Ed,i=kd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Cd=5:(Cd=0,Td=wd=null,mf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Sd=null),pt(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=jd,o=Md,Md=null,i!==null&&(jd=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);Ed&3&&hf(),jf(t),a=t.pendingLanes,r&261930&&a&42?t===Pd?Nd++:(Nd=0,Pd=t):(Nd=0,Pd=null),Mf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function hf(){return Ad!==null&&(Ad.skipTransition(),Ad=null),df(),ff(),pf(),gf()}function gf(){if(Cd!==5)return!1;var e=wd,t=Dd;Dd=0;var n=pt(Ed),r=ce.T,a=le.p;try{le.p=32>n?32:n,ce.T=null,n=Od,Od=null;var o=wd,s=Ed;if(Cd=0,Td=wd=null,Ed=0,ed&6)throw Error(i(331));var c=ed;if(ed|=4,Yu(o.current),Vu(o,o.current,s,n),ed=c,Mf(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{le.p=a,ce.T=r,mf(e,t)}}function _f(e,t,n){t=Ri(n,t),t=Oc(e.stateNode,t,2),e=ho(e,t,2),e!==null&&(st(e,2),jf(e))}function vf(e,t,n){if(e.tag===3)_f(e,e,n);else for(;t!==null;){if(t.tag===3){_f(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Sd===null||!Sd.has(r))){e=Ri(n,e),n=kc(2),r=ho(t,n,2),r!==null&&(Ac(n,r,t,e),st(r,2),jf(r));break}}t=t.return}}function yf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;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)||(cd=!0,i.add(n),e=bf.bind(null,e,t,n),t.then(e,e))}function bf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,td===e&&(rd&n)===n&&(ud===4||ud===3&&(rd&62914560)===rd&&300>Ie()-vd?ed&2?fd|=n:Gd(e,0):fd|=n,md===rd&&(md=0)),jf(e)}function xf(e,t){t===0&&(t=at()),e=Ci(e,t),e!==null&&(st(e,t),jf(e))}function Sf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xf(e,n)}function Cf(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),xf(e,n)}function wf(e,t){return Me(e,t)}var Tf=null,Ef=null,Df=!1,Of=!1,kf=!1,Af=0;function jf(e){e!==Ef&&e.next===null&&(Ef===null?Tf=Ef=e:Ef=Ef.next=e),Of=!0,Df||(Df=!0,Rf())}function Mf(e,t){if(!kf&&Of){kf=!0;do for(var n=!1,r=Tf;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,Lf(r,a))}else a=rd,a=nt(r,r===td?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||U(r,a)||(n=!0,Lf(r,a))}r=r.next}while(n);kf=!1}}function Nf(){Pf()}function Pf(){Of=Df=!1;var e=0;Af!==0&&Sp()&&(e=Af);for(var t=Ie(),n=null,r=Tf;r!==null;){var i=r.next,a=Ff(r,t);a===0?(r.next=null,n===null?Tf=i:n.next=i,i===null&&(Ef=n)):(n=r,(e!==0||a&3)&&(Of=!0)),r=i}Cd!==0&&Cd!==5||Mf(e,!1),Af!==0&&(Af=0)}function Ff(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=td,n=rd,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(id===2||id===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),pt(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=If.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 If(e,t){if(Cd!==0&&Cd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hf()&&e.callbackNode!==n)return null;var r=rd;return r=nt(e,e===td?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zd(e,r,t),Ff(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?If.bind(null,e):null)}function Lf(e,t){if(hf())return null;zd(e,t,!0)}function Rf(){Dp(function(){ed&6?Me(Re,Nf):Pf()})}function zf(){if(Af===0){var e=Ia;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),Af=e}return Af}function Bf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:pn(e)}function Vf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Bf((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?Bf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Fn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Af!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Hf=0;Hf<ui.length;Hf++){var Uf=ui[Hf];di(Uf.toLowerCase(),`on`+(Uf[0].toUpperCase()+Uf.slice(1)))}di(ni,`onAnimationEnd`),di(ri,`onAnimationIteration`),di(ii,`onAnimationStart`),di(`dblclick`,`onDoubleClick`),di(`focusin`,`onFocus`),di(`focusout`,`onBlur`),di(ai,`onTransitionRun`),di(oi,`onTransitionStart`),di(si,`onTransitionCancel`),di(ci,`onTransitionEnd`),It(`onMouseEnter`,[`mouseout`,`mouseover`]),It(`onMouseLeave`,[`mouseout`,`mouseover`]),It(`onPointerEnter`,[`pointerout`,`pointerover`]),It(`onPointerLeave`,[`pointerout`,`pointerover`]),Ft(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ft(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ft(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ft(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ft(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ft(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Wf=`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(` `),Gf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Wf));function Kf(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){gi(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){gi(e)}i.currentTarget=null,a=c}}}}function qf(e,t){var n=t[bt];n===void 0&&(n=t[bt]=new Set);var r=e+`__bubble`;n.has(r)||(Zf(t,e,2,!1),n.add(r))}function Jf(e,t,n){var r=0;t&&(r|=4),Zf(n,e,r,t)}var Yf=`_reactListening`+Math.random().toString(36).slice(2);function Xf(e){if(!e[Yf]){e[Yf]=!0,Nt.forEach(function(t){t!==`selectionchange`&&(Gf.has(t)||Jf(t,!1,e),Jf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yf]||(t[Yf]=!0,Jf(`selectionchange`,!1,t))}}function Zf(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,!wn||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 Qf(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=Dt(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}xn(function(){var r=a,i=gn(n),s=[];e:{var c=li.get(e);if(c!==void 0){var l=Fn,u=e;switch(e){case`keypress`:if(An(n)===0)break e;case`keydown`:case`keyup`:l=$n;break;case`focusin`:u=`focus`,l=Wn;break;case`focusout`:u=`blur`,l=Wn;break;case`beforeblur`:case`afterblur`:l=Wn;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=Hn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Un;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=nr;break;case ni:case ri:case ii:l=Gn;break;case ci:l=rr;break;case`scroll`:case`scrollend`:l=Ln;break;case`wheel`:l=ir;break;case`copy`:case`cut`:case`paste`:l=Kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=er;break;case`submit`:l=tr;break;case`toggle`:case`beforetoggle`:l=ar}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=Sn(m,p),g!=null&&d.push($f(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!==hn&&(u=n.relatedTarget||n.fromElement)&&(Dt(u)||u[yt]))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?Dt(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=Hn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=er,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:kt(c),h=l==null?u:kt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Dt(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,tp):null,c!==null&&np(s,u,c,d,!1),l!==null&&f!==null&&np(s,f,l,d,!0)))}e:{if(c=r?kt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Tr;else if(yr(c)){if(Er)_=Fr;else{_=Nr;var v=Mr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&un(r.elementType)&&(_=Tr):_=Pr;if(_&&=_(e,r)){br(s,_,n,i);break e}v&&v(e,c,r)}switch(v=r?kt(r):window,e){case`focusin`:(yr(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(s,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(s,n,i)}var y;if(sr)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 hr?pr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(ur&&n.locale!==`ko`&&(hr||b!==`onCompositionStart`?b===`onCompositionEnd`&&hr&&(y=kn()):(En=i,Dn=`value`in En?En.value:En.textContent,hr=!0)),v=ep(r,b),0<v.length&&(b=new qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=mr(n),y!==null&&(b.data=y)))),(y=lr?gr(e,n):_r(e,n))&&(b=ep(r,`onBeforeInput`),0<b.length&&(v=new qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Vf(s,e,r,n,i)}Kf(s,t)})}function $f(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ep(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=Sn(e,n),i!=null&&r.unshift($f(e,i,a)),i=Sn(e,t),i!=null&&r.push($f(e,i,a))),e.tag===3)return r;e=e.return}return[]}function tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function np(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=Sn(n,a),l!=null&&o.unshift($f(n,l,c))):i||(l=Sn(n,a),l!=null&&o.push($f(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var rp=/\r\n?/g,ip=/\u0000|\uFFFD/g;function ap(e){return(typeof e==`string`?e:``+e).replace(rp,`
|
|
10
|
+
`).replace(ip,``)}function op(e,t){return t=ap(t),ap(e)===t}function sp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||on(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&on(e,``+r);else return;break;case`className`:Wt(e,`class`,r);break;case`tabIndex`:Wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Wt(e,n,r);break;case`style`:ln(e,r,o);return;case`data`:if(t!==`object`){Wt(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=pn(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`&&sp(e,t,`name`,a.name,a,null),sp(e,t,`formEncType`,a.formEncType,a,null),sp(e,t,`formMethod`,a.formMethod,a,null),sp(e,t,`formTarget`,a.formTarget,a,null)):(sp(e,t,`encType`,a.encType,a,null),sp(e,t,`method`,a.method,a,null),sp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=mn);return;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`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=pn(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`:qf(`beforetoggle`,e),qf(`toggle`,e),Ut(e,`popover`,r);break;case`xlinkActuate`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ut(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=dn.get(n)||n,Ut(e,n,r);else return}Vt=!0}function cp(e,t,n,r,a,o){switch(n){case`style`:ln(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`)on(e,r);else if(typeof r==`number`||typeof r==`bigint`)on(e,``+r);else return;break;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=mn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:case`innerText`:case`textContent`:return;default:if(!Pt.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[vt]||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}Vt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ut(e,n,r)}return}Vt=!0}function lp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:qf(`error`,e),qf(`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:sp(e,t,o,s,n,null)}}a&&sp(e,t,`srcSet`,n.srcSet,n,null),r&&sp(e,t,`src`,n.src,n,null);return;case`input`:qf(`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:sp(e,t,r,d,n,null)}}en(e,o,c,l,u,s,a,!1);return;case`select`:for(a in qf(`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:sp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&nn(e,!!r,n,!0):nn(e,!!r,t,!1);return;case`textarea`:for(s in qf(`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:sp(e,t,s,c,n,null)}an(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`:sp(e,t,l,r,n,null));return;case`dialog`:qf(`beforetoggle`,e),qf(`toggle`,e),qf(`cancel`,e),qf(`close`,e);break;case`iframe`:case`object`:qf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Wf.length;r++)qf(Wf[r],e);break;case`image`:qf(`error`,e),qf(`load`,e);break;case`details`:qf(`toggle`,e);break;case`embed`:case`source`:case`link`:qf(`error`,e),qf(`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:sp(e,t,u,r,n,null)}return;default:if(un(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&cp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&sp(e,t,c,r,n,null))}var up={};function dp(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)||sp(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&&(Vt=!0),o=m;break;case`name`:m!==f&&(Vt=!0),a=m;break;case`checked`:m!==f&&(Vt=!0),u=m;break;case`defaultChecked`:m!==f&&(Vt=!0),d=m;break;case`value`:m!==f&&(Vt=!0),s=m;break;case`defaultValue`:m!==f&&(Vt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&sp(e,t,p,m,r,f)}}$t(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)||sp(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&&(Vt=!0),p=o;break;case`defaultValue`:o!==l&&(Vt=!0),c=o;break;case`multiple`:o!==l&&(Vt=!0),s=o;default:o!==l&&sp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?nn(e,!!n,n?[]:``,!1):nn(e,!!n,t,!0)):nn(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:sp(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&&(Vt=!0),p=a;break;case`defaultValue`:a!==o&&(Vt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&sp(e,t,s,a,r,o)}rn(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:sp(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&&(Vt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`):sp(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)&&sp(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:sp(e,t,u,p,r,m)}return;default:if(un(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&cp(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||cp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&sp(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||sp(e,t,f,p,r,m)}function fp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function pp(){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&&fp(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&&fp(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 mp=null,hp=null;function gp(e){return e.nodeType===9?e:e.ownerDocument}function _p(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 vp(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 yp(e,t,n,r){return n=gp(n).createElement(e),n[_t]=r,n[vt]=t,lp(n,e,t),jt(n),n}function bp(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 xp=null;function Sp(){var e=window.event;return e&&e.type===`popstate`?e!==xp&&(xp=e,!0):(xp=null,!1)}var Cp=typeof setTimeout==`function`?setTimeout:void 0,wp=typeof clearTimeout==`function`?clearTimeout:void 0,Tp=typeof Promise==`function`?Promise:void 0,Ep=typeof requestAnimationFrame==`function`?requestAnimationFrame:Cp,Dp=typeof queueMicrotask==`function`?queueMicrotask:Tp===void 0?Cp:function(e){return Tp.resolve(null).then(e).catch(Op)};function Op(e){setTimeout(function(){throw e})}function kp(e){return e===`head`}function Ap(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),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[wt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function jp(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 Mp(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 Np(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 Pp(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 Fp(e){return Pp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ip(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Pp(t,n,e)}function Lp(e){return e.documentElement.clientHeight}function Rp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function zp(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`&&(Lp(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(Rp.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 Bp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Bp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Bp.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},Bp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Vp(e){return{name:e,group:new Bp(`group`,e),imagePair:new Bp(`image-pair`,e),old:new Bp(`old`,e),new:new Bp(`new`,e)}}function Hp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Hp.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(qp(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=Gp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Up,e,s,r)}this._eventListeners=a}};function Up(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Hp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=qp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Gp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Wp,e,n,i),r.splice(t,1),a!==null&&a()}};function Wp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Gp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Kp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function qp(e,t,n,r){if(e.length===0)return-1;r=Kp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Kp(a.optionsOrUseCapture)===r)return i}return-1}Hp.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,Gp(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,Gp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Hp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag!==6&&(e=b(e),bm(e,t))}Hp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Yp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Jp(t[n],e);n--);};function Yp(e,t){return t.push(e),!1}Hp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=gp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Xp,e,void 0,void 0))};function Xp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Hp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Hp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Qp,e,void 0,void 0);for(var n=t=0;n<$p.length;n++){var r=$p[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):$p[t++]=r}$p.length=t}};function Qp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var $p=[],em=!1;function tm(e,t,n){$p.push({fragmentInstance:e,observer:t,instance:n}),em||(em=!0,xm(function(){em=!1;var e=$p;$p=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Hp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,nm,e,void 0,void 0),e};function nm(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}Hp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Hp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Yp,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||rm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function rm(e,t,n,r,i){var a=Dt(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 im(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)}Hp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Yp,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),im(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),im(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function am(e,t){return e=b(e),om(e,t),!1}function om(e,t){e.reactFragments??=new Set,e.reactFragments.add(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.addEventListener(i.type,i.attachedListener,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<$p.length;i++){var a=$p[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&($p[r++]=a)}$p.length=r,n.observe(e)}),om(e,t))}function cm(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,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?tm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function lm(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`:lm(n),Et(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function um(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[wt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=gm(e.nextSibling),e===null)break}return null}function dm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gm(e.nextSibling),e===null))return null;return e}function fm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gm(e.nextSibling),e===null))return null;return e}function pm(e){return e.data===`$?`||e.data===`$~`}function mm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hm(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 gm(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 _m=null;function vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ym(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 bm(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 xm(e){Ep(function(){Ep(function(t){return e(t)})})}function Sm(e,t,n){switch(t=gp(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 Cm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&sp(e,t,r,null,up,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===mn&&(e.onclick=null),Et(e)}function wm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Et(e)}var Tm=new Map,Em=new Set;function Dm(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 Om=le.d;le.d={f:km,r:Am,D:Nm,C:Pm,L:Fm,m:Im,X:Rm,S:Lm,M:zm};function km(){var e=Om.f(),t=Ud();return e||t}function Am(e){var t=Ot(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):Om.r(e)}var jm=typeof document>`u`?null:document;function Mm(e,t,n){var r=jm;if(r&&typeof t==`string`&&t){var i=Qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Em.has(i)||(Em.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),lp(t,`link`,e),jt(t),r.head.appendChild(t)))}}function Nm(e){Om.D(e),Mm(`dns-prefetch`,e,null)}function Pm(e,t){Om.C(e,t),Mm(`preconnect`,e,t)}function Fm(e,t,n){Om.L(e,t,n);var r=jm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Qt(n.imageSizes)+`"]`)):i+=`[href="`+Qt(e)+`"]`;var a=i;switch(t){case`style`:a=Vm(e);break;case`script`:a=Gm(e)}if(!(Tm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hm(a))||t===`script`&&r.querySelector(Km(a))))){var o=r.createElement(`link`);lp(o,`link`,e),t===`style`&&(o[Tt]=!0,o.onload=o.onerror=function(){Mt(o)}),jt(o),r.head.appendChild(o)}}}function Im(e,t){Om.m(e,t);var n=jm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Qt(r)+`"][href="`+Qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gm(e)}if(!Tm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Tm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Km(a)))return}r=n.createElement(`link`),lp(r,`link`,e),jt(r),n.head.appendChild(r)}}}function Lm(e,t,n){Om.S(e,t,n);var r=jm;if(r&&e){var i=At(r).hoistableStyles,a=Vm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tm.get(a))&&q(e,n);var c=o=r.createElement(`link`);jt(c),lp(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,Jm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rm(e,t){Om.X(e,t);var n=jm;if(n&&e){var r=At(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0},t),(t=Tm.get(i))&&Ym(e,t),a=n.createElement(`script`),jt(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t){Om.M(e,t);var n=jm;if(n&&e){var r=At(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Tm.get(i))&&Ym(e,t),a=n.createElement(`script`),jt(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t,n,r){var a=(a=ve.current)?Dm(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=Vm(n.href),t=At(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=Vm(n.href);var o=At(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(Hm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Tm.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},Tm.set(e,o)),Wm(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=Gm(n),t=At(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 Vm(e){return`href="`+Qt(e)+`"`}function Hm(e){return`link[rel="stylesheet"][`+e+`]`}function Um(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Tt]){r.loading=1;return}}else t=e.createElement(`link`),t[Tt]=!0,t.onload=t.onerror=Mt.bind(null,t),lp(t,`link`,n),jt(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 Gm(e){return`[src="`+Qt(e)+`"]`}function Km(e){return`script[async]`+e}function qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Qt(n.href)+`"]`);if(r)return t.instance=r,jt(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`),jt(r),lp(r,`style`,a),Jm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vm(n.href);var o=e.querySelector(Hm(a));if(o)return t.state.loading|=4,t.instance=o,jt(o),o;r=Um(n),(a=Tm.get(a))&&q(r,a),o=(e.ownerDocument||e).createElement(`link`),jt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),lp(o,`link`,r),t.state.loading|=4,Jm(o,n.precedence,e),t.instance=o;case`script`:return o=Gm(n.src),(a=e.querySelector(Km(o)))?(t.instance=a,jt(a),a):(r=n,(a=Tm.get(o))&&(r=D({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),jt(a),lp(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,Jm(r,n.precedence,e));return t.instance}function Jm(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 q(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[wt]||a[_t]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function 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=Vm(r.href),a=t.querySelector(Hm(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,jt(a);return}a=t.ownerDocument||t,r=Um(r),(i=Tm.get(i))&&q(r,i),a=a.createElement(`link`),jt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),lp(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*pp());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=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.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=Oi(3,null,null,t),e.current=a,a.stateNode=e,t=ka(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},fo(a),e}function gh(e){return e?(e=Ei,e):Ei}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=mo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=ho(e,r,t),n!==null&&(Rd(n,e,t),go(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=Ci(e,67108864);t!==null&&Rd(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Fd();t=ft(t);var n=Ci(e,t);n!==null&&Rd(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)Qf(e,t,r,Dh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=Ot(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}jf(a),!(ed&6)&&(bd=Ie()+500,Mf(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&Rd(s,a,2),Ud(),yh(a,2)}if(a=Eh(r),a===null&&Qf(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Qf(e,t,r,null,n)}}function Eh(e){return e=gn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=Dt(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,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`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 Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(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=Ot(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Dt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ht(e.priority,function(){xh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ht(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 Hh(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);hn=r,n.target.dispatchEvent(r),hn=null}else return t=Ot(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=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=Ot(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vt]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||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),qh(n)}}}function Yh(){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 Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));_h(t.current,Fd(),e,t,null,null)},Zh.prototype.unmount=Xh.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),Ud(),t[yt]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.1`)throw Error(i(527,Qh,`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 $h={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:ce,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{Ge=eg.inject($h),Ke=eg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Cc,s=wc,c=Tc;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,Yh),e[yt]=t.current,Xf(e),new Xh(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)=>ee(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=H(e)&&H(t);if(!r&&!(ee(e)&&ee(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 V(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 H(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ee(e){if(!te(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!(!te(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function te(e){return Object.prototype.toString.call(e)===`[object Object]`}function ne(e){return new Promise(t=>{E.setTimeout(t,e)})}function re(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:B(e,t)}function ie(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function ae(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var oe=Symbol();function se(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===oe?()=>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),ne(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=se(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?ae:ie;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=re(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===oe||!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=se(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&&!V(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 V(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=re(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=re(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),V(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),V(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===oe&&(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)=>ie(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 at(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 ot=b.useLayoutEffect;function st(e){return e[e.length-1]}function ct(e,t){return typeof e==`function`?e(t):e}var lt=Object.prototype.hasOwnProperty;function ut(e){for(let t in e)if(lt.call(e,t))return!0;return!1}var dt=()=>Object.create(null),ft=(e,t)=>pt(e,t,!0);function pt(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&&!(mt(e)&&mt(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&&st(a)!==`${o-1}`||c&&st(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`?pt(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`?pt(d,o,n,r):o,i&&=u===d&&(a[l]===f||lt.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?dt():{};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`?pt(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function mt(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function ht(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&&!ht(a,o,n,r))return!1}return!0}if(mt(e)&&mt(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!ht(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||!ht(e[a],t[a],n,r)))return!1;return i===0}return!1}var gt=/[\x00-\x1f\x7f"<>`{}]/g;function _t(e){return e.replace(gt,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function vt(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 _t(t)}var yt=[`http:`,`https:`,`mailto:`,`tel:`];function bt(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 xt=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function St(e,t){if(!e)return!1;if(xt.test(e))return!0;let n=bt(e);return n?!t.has(n):!1}function Ct(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+=vt(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=vt(r?e.slice(r):e)}return t}function wt(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Tt(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 Et(){throw Error(`Invariant failed`)}function Dt(e){return e.replace(/\/{2,}/g,`/`)}function Ot(e){return e===`/`?e:e.replace(/^\/+/,``)}function kt(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function At(e){return kt(Ot(e))}function jt(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Mt(e,t,n=`never`,r){if(t.includes(`//`)&&(t=Dt(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=Dt(e)),o=e.split(`/`);o.length>1&&st(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&&(st(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Dt(s):s)||`/`;return a&&r&&r.set(a,c),c}function Nt(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 Pt(e){return e==null||e===``}function Ft(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 It(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&&Pt(f)){if(c===`/`&&!d)continue;f=``}o+=c+Ft(s,f,r)+(d||``)}}return o+a||`/`}function Lt(e){return e?.isNotFound===!0}function Rt(){try{return sessionStorage}catch{return}}var zt=`tsr-scroll-restoration-v1_3`,Bt=Rt();function Vt(){try{return JSON.parse(Bt?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var Ht=Vt(),Ut=`data-scroll-restoration-id`,Wt=e=>e.state.__TSR_key||e.href;function Gt(e){let t=e.getAttribute(Ut);if(t)return`[${Ut}="${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 Kt=!1,qt=`window`;function Jt(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Yt(e){let t=new Set;for(let n of e){if(n===qt)continue;let e=Jt(n);e&&t.add(e)}return t}function Xt(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Wt,a=new Set,o=e=>{let t=Ht[e]||={};for(let e of a)e===document?t[qt]={scrollX,scrollY}:e.isConnected&&(t[Gt(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Kt=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Kt||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{Bt?.setItem(zt,JSON.stringify(Ht))}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=Ht[d];if(e){let t=Ht[u];for(let n in e){if(n===qt){if(s)continue}else{let e=Jt(n);if(!e||s&&o&&(l??=Yt(o),l.has(e)))continue}t||=Ht[u]={},t[n]??=e[n]}}}Kt=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Yt(o));let t=e&&i&&c,s=r.e?Ht[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===qt){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Jt(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{Kt=!1}}))}function Zt(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 Qt(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function $t(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]=Qt(r):Array.isArray(t)?t.push(Qt(r)):n[e]=[t,Qt(r)]}return n}var en=/^(?:\s|["[{\d-]|fa|nu|tr)/,tn=rn(JSON.parse),nn=an(JSON.stringify,JSON.parse);function rn(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=$t(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!en.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function an(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&&!en.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Zt(e,r);return t?`?${t}`:``}}var on=`__root__`;function sn(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 cn(e){return e instanceof Response&&!!e.options}function ln(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 un=4,dn=5;function fn(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 pn(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 mn(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=st(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=pn(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=gn(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=gn(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=gn(r,dn);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=gn(r,un);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 hn(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 gn(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 _n(e,t){let n=gn(),r=[];function i(e,t,n,a){let[o,s,c]=mn(!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(hn);t.masksTree=n,t.flatCache=ln(1e3)}function vn(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Sn(e,t.masksTree);return t.flatCache.set(e,r),r}function yn(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=gn(),mn(t,{from:e},1,o),i.singleCache.set(a,o)),Sn(r,o,n)}function bn(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=Sn(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=wn(a.route)),t.matchCache.set(r,a),a}function xn(e,t=!1){let n=gn(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&Et(),i[e.id]=e,o!==0&&e.path){let t=kt(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=mn(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(hn);return{processedTree:{segmentTree:n,singleCache:ln(1e3),matchCache:ln(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Sn(e,t,n=!1){let r=e.split(`/`),i=En(e,r,t,n);if(!i)return null;let[a]=Cn(e,r,i);return{route:i.node.route,rawParams:a}}function Cn(e,t,n){let r=Tn(n.node),i=n.node.data&&fn(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===un)break;if(u.kind===dn){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 wn(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Tn(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function En(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!st(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&&!An(l,n))continue;if(i.parse){if(!kn(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==un&&An(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===un||i.kind===2)&&An(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&&(kn(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&On(f,o))return n;An(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+Dn(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+Dn(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+Dn(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+Dn(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 Dn(e,t){return 2**(e-t-1)}function On(e,t){return e===2**(t-1)-1}function kn(e,t,n){let r,i;try{[r,i]=Cn(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 An(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===un)>(e.node.kind===un)||t.node.kind===un==(e.node.kind===un)&&t.node.depth>e.node.depth)))}function jn(e,t,n){let r=At(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=Dt(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>Mn(n,s.input({url:e})),output:({url:e})=>s.output({url:Nn(n,e)})}:s}function Mn(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 Nn(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 Pn(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(()=>{Tt(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 Fn=`__TSR_index`,In=`popstate`,Ln=`beforeunload`,Rn=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function zn(e){let t=Rn.exec(e);return t?`/`+e.slice(t[0].length):e}function Bn(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
11
|
+
\r`.includes(e)?``:encodeURIComponent(e))),zn(e)}function Vn(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=Wn(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=Hn(t.state[Fn]+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{i=Hn(t.state[Fn],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[Fn]!==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 Hn(e,t){let n=Gn();return{...t,key:n,__TSR_key:n,[Fn]:e}}function Un(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=>Bn(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>Wn(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Gn();t.history.replaceState({[Fn]: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=Wn(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[Fn]-l.state[Fn],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=Vn({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(Ln,x,{capture:!0}),t.removeEventListener(In,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(Ln,x,{capture:!0}),t.addEventListener(In,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 Wn(e,t){let n=Bn(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=Gn();t={[Fn]: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 Gn(){return(Math.random()+1).toString(36).slice(7)}function Kn(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function qn(e){return e.pathname+e.search+e.hash}function Jn(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Yn(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Xn({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Zn(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Qn(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 $n=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:Un()),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!==`/`&&At(n)?jn(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=Pn(this.latestLocation,e),Xt(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=xn(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&_n(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:ln(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:Ct(e),external:!1,searchStr:o,search:ft(t?.search,i),hash:Ct(r.slice(1)),state:pt(t?.state,a)}}let o=Mn(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:Ct(zn(o.pathname)),external:!!this.rewrite&&Kn(o,this.origin),searchStr:c,search:ft(t?.search,s),hash:Ct(o.hash.slice(1)),state:pt(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=bn(kt(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=Wn(n.href,{});n={...n,to:Mn(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=Mt(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[kt(c)],u=c.includes(`$`),d;if(l)d=l._branch??=wn(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??mn(!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??=ir(n.params,e),!ut(p))break;p===e&&(p=Object.assign(dt(),p));try{Object.assign(p,t(p))}catch{}}}p??=ir(n.params,ar(n.params,f)?o()[3]:or);let m=e.leaveParams?c:zn(Ct(f?It(c,f,p,this.pathParamsDecoder):c)),h=sr(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,rr(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?cr(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||or,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:or,S=`${m}${v}${b}`,C,w,T=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=Nn(this.rewrite,e);C=qn(e),Kn(n,t)?(w=n.href,T=!0):w=zn(qn(n))}else C=wt(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=vn(r.pathname,this.processedTree);if(t){let i=Object.assign(dt(),t.rawParams),{from:a,params:o,...s}=t.route,c=ir(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 er(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=kt(this.latestLocation.href)===kt(n.href)&&ht(Xn(n.state),Xn(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?bt(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 er(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 ti(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(Yn(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`)&&Jn(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(xt.test(n)||(r=bt(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:Kn(e,this.origin)||(n=qn(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=pr,this.preloadRoute=e=>ni(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?Mt(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=yn(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!ht(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?ht(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=Nt(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??nn,parseSearch:e.parseSearch??tn,protocolAllowlist:e.protocolAllowlist??yt}),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=mn(!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[`**`]:kt(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?lr(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=rr(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof tr||(r=new tr(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=dt(),_=i._interpolation?It(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{ur(i,d)}catch(e){if(x=Lt(e)||cn(e)?e:new nr(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:ft(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=Jn(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?ft(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?pt(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`?ft(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=st(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=st(a),c={...e.search};for(let e of a)try{Object.assign(c,rr(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{ur(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function er(e,t,{replace:n,ignoreBlocker:r}){if(!St(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 tr=class extends Error{},nr=class extends Error{};function rr(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new tr(`Async validation not supported`);if(n.issues)throw new tr(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 ir(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 ar(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!lt.call(e,t[1]))}var or=Object.freeze({});function sr(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=rr(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 cr(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=ct(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 lr(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 on}function ur(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function dr(e,t){return e.options[t]?.preload?.()}function fr(e,t){let n=dr(e,`component`),r=dr(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function pr(e,t,n){let r=()=>t===!1?void 0:t?dr(e,t):fr(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 mr(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function hr(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var gr=0,_r=1,vr=2,yr=3,br=[4];function xr(e){return typeof e[0]==`number`}function Sr(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 Cr(e,t){return e.routesById[t.routeId]}function wr(e,t,n){return cn(e)?[yr,e]:Lt(e)?(e.routeId||=n,[vr,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[_r,e]):[gr,e]}function Tr(e,t){let n=wr(t,!0,e.id);if(n[0]!==_r)return n;try{e.options.onError?.(n[1])}catch(t){n=wr(t,!0,e.id)}return n}function Er(e,t,n,r,i){return i[0].signal.aborted?br:Hr(e,t,n,Tr(n,r),i)}async function Dr(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=Cr(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 kr(e,r),[i,Er(e,t,u,a,n)]}if(c.aborted)return[i,br];let p=r.paramsError??r.searchError;if(p!==void 0)return kr(e,r),[i,Er(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{Mr(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Sr(a,c):a);if(c.aborted)return[i,br];let s=Hr(e,t,u,wr(o,!1,u.id),n);if(s[0]!==gr)return kr(e,r),[i,s];r.context={...r.context,...o}}catch(a){return kr(e,r),[i,Er(e,t,u,a,n)]}finally{r.status=h,Mr(e,r,!1,n[0])}}i()}function Or(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 kr(e,t){let n=t._flight;t._flight=void 0,Or(e,t,n)?.abort()}function Ar(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=Or(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function jr(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Mr(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 Nr(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 Pr(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return br;if(!i)return[gr,void 0];let l=n._flight;Mr(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Nr(e,t,n,r,s,a,!!o[3]))).then(e=>wr(e,!1,r.id),e=>wr(e,!0,r.id)).then(t=>(t[0]!==gr&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===_r&&l[2]?Tr(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Hr(e,t,r,await Sr(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return kr(e,n),br}finally{Mr(e,n,!1,s)}}function Fr(e,t,n){t[0]!==yr&&(e.status=`success`,e.error=void 0,t[0]===gr?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function Ir(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&&kr(e,r)}function Lr(e,t){return t[0]===_r||t[0]===vr?{...e,status:t[0]===_r?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Rr(e,t,n,r,i,a,o){let s=t[1][n],c=Cr(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(Nr(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=br)),!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,kr(e,s),p=Er(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,Or(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?Pr(e,t,s,c,g,i,a).then(t=>(Fr(s,t,l),t[0]===gr&&(m&&!a[0].signal.aborted&&Ir(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[gr,s.loaderData]),T=(async()=>{try{let e=pr(c,void 0,C);e&&await Sr(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,Er(e,t,c,r,a)]}let r=await w;x&&r[0]===gr&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>Lr(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=Pr(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,Fr(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>Lr(E,e))}async function zr(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=Cr(e,t[n]);try{let e=pr(i,!1);e&&await Sr(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Br(e,t){t[2]&&=(Ar(e,t[2].map(e=>e[3])),void 0)}async function Vr(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]>=yr)throw[a,t];!i&&t[0]!==gr&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===yr)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Hr(e,t,n,r,i,a){for(;r[0]===yr;){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]?[yr,t]:[yr,t,a]}return[yr,o,n]}catch(e){r=a?[_r,e]:Tr(n,e),a=!0}}return r}async function Ur(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]===vr?zr(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=yr)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]!==gr&&t[0]<yr&&!(`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)>=yr){let n=s[1];if(n[0]!==yr||n[1].options.reloadDocument||n[2])return Br(e,t),n;c=!0,s=[0,[_r,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===_r?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=Cr(e,u);try{await Sr(i?Promise.resolve().then(()=>pr(m,l===_r?`errorComponent`:`notFoundComponent`)):Promise.all([pr(m),pr(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Br(e,t),br}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Br(e,t),Ar(e,o),p()):u.status=`success`}return t}async function Wr(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=Cr(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 Sr(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 Gr(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 zr(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=Rr(e,i,t,u,f,r,l)},m=await Dr(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===vr){let t=await zr(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=yr&&(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=Ur(e,i,u,r[0],Vr(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Vr(i[2],void 0,void 0,h.then(e=>xr(e)?0:mr(n).length,()=>0))),o=await h}catch(t){if(Br(e,i),t===a&&a.aborted)return br;throw t}return xr(o)?o:Wr(e,o,a,r[6]===n.length?r[6]:0)}function Kr(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=Cr(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(()=>Kr(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 qr(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 Jr(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!mr(t[3]).some(e=>e.id===n[1]))return;let i;try{await Sr(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Yr(e,t){e._committed=t,e.stores.setMatches(t)}function Xr(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=mr(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=Cr(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=Zn(n);Yr(e,n),Ar(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Qn(e,i,n,a,l,t)}async function Zr(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Qr(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 $r(e,t,n,r,i){let a=n.map(e=>({...e}));jr(a);for(let t of r)kr(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Ur(e,o,r,t[0],i)}catch(t){throw Ar(e,a),t}if(xr(s))Ar(e,a),s[0]===yr&&e._tx===t&&e._committed===n&&await Qr(e,t,s);else if(await Wr(e,s,t[0].signal),e._tx!==t||e._committed!==n)Ar(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),kr(e,n))}Yr(e,a),Ar(e,n,a)}}async function ei(e,t,n,r,i,a){let o=await Gr(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(xr(o)){let n=o[0]===yr&&e._tx===t;if((!n||o[1].options.reloadDocument)&&qr(e,t),Ar(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){qr(e,t);return}await Qr(e,t,o);return}let s=o[1];if(e._tx===t&&await Jr(e,t),e._tx!==t){qr(e,t),Ar(e,s),Br(e,o);return}let c=t[2],l=Yn(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Jr(e,t),e._tx!==t){qr(e,t),Ar(e,s),Br(e,o);return}let n=await e.startTransition(()=>{qr(e,t),Xr(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&&$r(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)):Br(e,o)})}async function ti(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=Yn(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Zr(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});jr(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){Ar(e,m),await Zr(e,n);return}e._preflight=void 0;let g,_=()=>ei(e,y,f,()=>Kr(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(()=>Zr(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&Mr(e,t,!1)}n[0].abort(),Ar(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))&&Kr(e,y),g?.(_()),await y[5]):(Ar(e,y[3]),y[3]=[],g?.(),await Zr(e,y))}async function ni(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}),jr(a),o=(e._preloads??=new Map).set(i,a),s=await Gr(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),Ar(e,a)),i.abort()}if(!xr(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Lt(e)||console.error(e);return}}}var ri=`Error preloading route! ☝️`,ii=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=on:this.parentRoute||Et();let r=n?on:t?.path;r&&r!==`/`&&(r=Ot(r));let i=t?.id||r,a=n?on:Dt((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:Dt(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=kt(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=>sn({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.`)}},ai=class extends ii{constructor(e){super(e)}},oi=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??si,{error:e[0],reset:this.reset}):this.props.children}};function si({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 ci=()=>!0,li=()=>!1;function ui({children:e,fallback:t=null}){return(0,x.jsx)(b.Fragment,{children:di()?e:t})}function di(e=!0){return b.useSyncExternalStore(fi,ci,e?li:ci)}function fi(){return()=>{}}var pi=b.createContext(null);function mi(e){return b.useContext(pi)}function hi(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{hr(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 gi=b.createContext(void 0),_i=b.createContext(void 0);function vi({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 yi(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 bi=[],xi=0,{link:Si,unlink:Ci,propagate:wi,checkDirty:Ti,shallowPropagate:Ei}=vi({update(e){return e._update()},notify(e){bi[Oi++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Mi(e))}}),Di=0,Oi=0,ki,Ai=0;function ji(e){try{++Ai,e()}finally{--Ai||Ni()}}function Mi(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Ci(n,e)}function Ni(){if(!(Ai>0)){for(;Di<Oi;){let e=bi[Di];bi[Di++]=void 0,e.notify()}Di=0,Oi=0}}function Pi(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 ki!==void 0&&Si(i,ki,xi),i._snapshot},subscribe(e){let t=yi(e),n={current:!1},r=Fi(()=>{i.get(),n.current?(ki=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=ki,o=t?.compare??Object.is;if(n)ki=i,++xi,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{ki=a,n&&(i.flags&=-5),Mi(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&Ti(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Ei(e)}}else e&32&&(i.flags=e&-33);return ki!==void 0&&Si(i,ki,xi),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(wi(e),Ei(e),Ni())}},i}function Fi(e){let t=()=>{let t=ki;ki=n,++xi,n.depsTail=void 0,n.flags=6;try{return e()}finally{ki=t,n.flags&=-5,Mi(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&&Ti(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,Mi(this)}};return t(),n}var Ii=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})),Li=o(((e,t)=>{t.exports=Ii()})),Ri=o((e=>{var t=d(),n=Li();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}})),zi=o(((e,t)=>{t.exports=Ri()}))();function Bi(e,t){return e===t}function Vi(e,t=e=>e,n){let r=n?.compare??Bi,i=(0,b.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,b.useCallback)(()=>e.get(),[e]);return(0,zi.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var Hi={};function Ui(e,t){let n=b.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=pt(n.current,i):i}}function Wi(e){let t=mi(),n=b.useContext(e.from?_i:gi),r=e.from??n,i=t.stores.getMatchStore(r),a=Ui(e,t),o=Vi(i,e=>e?a(e):Hi);if(o!==Hi)return o;(e.shouldThrow??!0)&&Et()}function Gi(e){return Wi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ki(e){let{select:t,...n}=e;return Wi({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function qi(e){return Wi({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 Ji(e){return Wi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Yi(e){let t=mi();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Xi(e){return Wi({...e,select:t=>e.select?e.select(t.context):t.context})}function Zi(...e){let t=b.useRef(e),n=t.current;return e.forEach((e,t)=>{ht(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Qi(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(ri)})}function $i(e,t){let n=typeof e==`string`&&bt(e);if(n)return t.has(n)?e:null}function ea(e,t,n,r){let i=jt(e.pathname,r),a=jt(t.pathname,r);return(n?.exact?i!==a:!i.startsWith(a)||i.length!==a.length&&i[a.length]!==`/`)||(n?.includeSearch??!0)&&!ht(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||e.hash===t.hash}function ta(e,t,n){let r=mi(),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]=Zi(e.search,e.params,o),S=b.useContext(gi),C=(r.stores._linkScopes??={})[S]??=hi(r,S),[w,T,E]=b.useMemo(()=>{let t=$i(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=la(t,r,u),s=u||o&&!bt(o)?ea(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,Qi(r,w)},N):Qi(r,w):t===!1&&sa(i)},[r,w,i,M,N]);b.useEffect(()=>{if(!M)return;M===`render`&&!j.current&&(j.current=!0,Qi(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(),sa(i)}},[r,w,M,P,i]);let F=aa(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(),sa(i),r.navigate({...e,_fromLocation:w._fromLocation}))},L=()=>{M===`intent`&&Qi(r,w)},R=()=>{M===`intent`&&sa(i)};return F.onClick=ca(f,I),F.onBlur=ca(p,R),F.onFocus=ca(m,P),F.onMouseEnter=ca(h,P),F.onMouseLeave=ca(g,R),F.onTouchStart=ca(_,L),oa(F,e,O,D,A,n)}var na={},ra={className:`active`},ia=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 aa(e,t){let n={};for(let r in e)ia.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function oa(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=ct(n?o:s,{})??(n?ra:na);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 sa=e=>{clearTimeout(e.t),e.t=void 0},ca=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function la(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||!St(i,t.protocolAllowlist))return i}var ua=b.memo(b.forwardRef((e,t)=>{let n=e._asChild||`a`,r=ta(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return b.createElement(n,r,i)}),da);function da(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!ia.has(r)||!ht(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}var fa=class extends ii{constructor(e){super(e),this.useMatch=e=>Wi({...e,from:this.id}),this.useRouteContext=e=>Xi({...e,from:this.id}),this.useSearch=e=>Ji({...e,from:this.id}),this.useParams=e=>qi({...e,from:this.id}),this.useLoaderDeps=e=>Ki({...e,from:this.id}),this.useLoaderData=e=>Gi({...e,from:this.id}),this.useNavigate=()=>Yi({from:this.fullPath}),this.Link=b.forwardRef((e,t)=>(0,x.jsx)(ua,{ref:t,from:this.fullPath,...e}))}};function pa(e){return new fa(e)}var ma=class extends ai{constructor(e){super(e),this.useMatch=e=>Wi({...e,from:this.id}),this.useRouteContext=e=>Xi({...e,from:this.id}),this.useSearch=e=>Ji({...e,from:this.id}),this.useParams=e=>qi({...e,from:this.id}),this.useLoaderDeps=e=>Ki({...e,from:this.id}),this.useLoaderData=e=>Gi({...e,from:this.id}),this.useNavigate=()=>Yi({from:this.fullPath}),this.Link=b.forwardRef((e,t)=>(0,x.jsx)(ua,{ref:t,from:this.fullPath,...e}))}};function ha(e){return new ma(e)}function ga(e){let t=mi(),n=`not-found-${Vi(t.stores.location,e=>e.pathname)}-${Vi(t.stores.status)}`;return(0,x.jsx)(oi,{getResetKey:()=>n,onCatch:(t,n)=>{if(Lt(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Lt(t))return e.fallback?.(t);throw t},children:e.children})}function _a(){return(0,x.jsx)(`p`,{children:`Not Found`})}function va(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)(_a,{})}function ya(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,x.jsx)(n,{}):null}var ba=(e,t)=>e[0]===t[0]&&e[1]===t[1],xa=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Sa=b.memo(function({routeId:e}){let t=mi();return Ca(t,Vi(t.stores.getMatchStore(e)))});function Ca(e,t){let n=e.routesById[t.routeId],r=ya(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=xa(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,x.jsx)(wa,{match:t});s&&(l=(0,x.jsx)(ui,{fallback:r,children:l})),o&&(l=(0,x.jsx)(ga,{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)(oi,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Lt(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)(gi.Provider,{value:t.routeId,children:(0,x.jsxs)(u,{children:[l,null]})}):(0,x.jsxs)(gi.Provider,{value:t.routeId,children:[l,null]})}var wa=b.memo(function({match:e}){let t=mi(),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)(Ta,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!xa(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return ya(t,r)}if(e.status===`notFound`)return va(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Ta=b.memo(function(){let e=mi(),t=b.useContext(gi),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Vi(a,e=>[!!e._notFound,e.error],{compare:ba}),i=Vi(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return va(e,e.routesById[t],r);if(!i)return null;let a=(0,x.jsx)(Sa,{routeId:i});return t===`__root__`?(0,x.jsx)(b.Suspense,{fallback:ya(e),children:a}):a});function Ea(e,t){let n=e[1];e.length=0,n?.(t)}function Da({t:e}){let t=mi(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Ea(n,!1),n.push(i,a),e(t),b.startTransition(r)}),ot(()=>{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(kt(r.publicHref)!==kt(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`,...Yn(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Oa(){let e=mi(),t=ya(e,e.routesById[on]),n=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Da,{t:b.useState()[1]}),e.ssr?(0,x.jsx)(ka,{}):(0,x.jsx)(b.Suspense,{fallback:t,children:(0,x.jsx)(ka,{})})]});return e.options.InnerWrap?(0,x.jsx)(e.options.InnerWrap,{children:n}):n}function ka(){let e=mi(),t=e._rendered,n=Vi(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;ot(()=>{t[0]===n&&Ea(t,!0)},[t,n]);let a=i?(0,x.jsx)(Sa,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,x.jsx)(oi,{getResetKey:()=>r,onCatch:void 0,children:a})}var Aa=e=>({createMutableStore:Pi,createReadonlyStore:Pi,batch:ji}),ja=e=>new Ma(e),Ma=class extends $n{constructor(e){super(e,Aa)}};function Na({router:e,children:t,...n}){ut(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,x.jsx)(pi.Provider,{value:e,children:t});return e.options.Wrap?(0,x.jsx)(e.options.Wrap,{children:r}):r}function Pa({router:e,...t}){return(0,x.jsx)(Na,{router:e,...t,children:(0,x.jsx)(Oa,{})})}function Fa(e){let t=mi({warn:e?.router===void 0}),n=e?.router||t;return Vi(n.stores.__store,Ui(e,n))}var Ia=_(),La=`forge.chunk-reloaded`;function Ra(){return document.querySelector(`script[type="module"][src]`)?.src||`dev`}function za(){try{let e=Ra();if(sessionStorage.getItem(La)===e)return!1;sessionStorage.setItem(La,e)}catch{return!1}return window.location.reload(),!0}var Ba=[`Failed to fetch dynamically imported module`,`error loading dynamically imported module`,`Importing a module script failed`];function Va(e){let t=e instanceof Error?e.message:``;return Ba.some(e=>t.startsWith(e))}function Ha(){window.addEventListener(`vite:preloadError`,e=>{za()&&e.preventDefault()}),window.addEventListener(`unhandledrejection`,e=>{Va(e.reason)&&za()&&e.preventDefault()})}function Ua(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(Wa,t)}};return t}function Wa(e,t){return t(e)}function Ga(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 Ka(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 qa(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 Ua(e=>{t++;let n=i;return n.add(e),a(),{unsubscribe(){t--,l(),n.delete(e)}}})}}function Ja(e){try{e()}catch(e){setTimeout(()=>{throw e})}}function Ya(e){let t=e,n=new Set,r=e=>{t!==void 0&&e.next(t),n.add(e)},i=e=>{n.delete(e)},a=Ua(e=>(r(e),()=>{i(e)}));return a.next=e=>{if(t!==e){t=e;for(let t of[...n])n.has(t)&&Ja(()=>t.next(e))}},a.get=()=>t,a}function Xa(e){return Ua(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 Za(e){return Array.isArray(e)?e:[e]}function Qa(e){return t=>{let n=Za(e.true).map(e=>e(t)),r=Za(e.false).map(e=>e(t));return t=>Ua(i=>{let a=e.condition(t.op)?n:r;return Xa({op:t.op,links:a}).subscribe(i)})}}function $a(e){"@babel/helpers - typeof";return $a=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},$a(e)}function eo(e,t){if($a(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($a(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function to(e){var t=eo(e,`string`);return $a(t)==`symbol`?t:t+``}function no(e,t,n){return(t=to(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ro(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 io(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ro(Object(n),!0).forEach(function(t){no(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ro(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ao(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function oo(e){return typeof e==`function`}function so(){return Object.create(null)}var co=typeof Symbol==`function`&&!!Symbol.asyncIterator;function lo(e){return co&&ao(e)&&Symbol.asyncIterator in e}var uo=e=>e();function fo(){}var po={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},mo=[po.BAD_GATEWAY,po.SERVICE_UNAVAILABLE,po.GATEWAY_TIMEOUT,po.INTERNAL_SERVER_ERROR],ho=()=>{},go=e=>{Object.freeze&&Object.freeze(e)};function _o(e,t,n){let r=t.join(`.`);return n[r]??(n[r]=new Proxy(ho,{get(r,i){if(typeof i==`string`&&i!==`then`)return _o(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)}),go(o.args),go(o.path),e(o)}})),n[r]}var vo=e=>_o(e,[],so()),yo=e=>new Proxy(ho,{get(t,n){if(n!==`then`)return e(n)}});function bo(e){"@babel/helpers - typeof";return bo=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},bo(e)}function xo(e,t){if(bo(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(bo(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function So(e){var t=xo(e,`string`);return bo(t)==`symbol`?t:t+``}function Co(e,t,n){return(t=So(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wo(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 To(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wo(Object(n),!0).forEach(function(t){Co(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Eo=class extends Error{constructor(e){super(Do(e)),Object.assign(this,e),Oo(e)&&(typeof e.name==`string`&&(this.name=e.name),typeof e.stack==`string`&&(this.stack=e.stack))}};function Do(e){if(`message`in e)return String(e.message)}function Oo(e){return e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`}function ko(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(ao(e))return new Eo(e)}}var Ao=class extends Error{constructor(e){let t=ko(e.cause),n=e.message??t?.message??e.code;super(n,{cause:t}),Co(this,`cause`,void 0),Co(this,`code`,void 0),this.code=e.code,this.name=`TRPCError`,this.cause??=t}};function jo(e,t){if(`error`in e){let n=t.deserialize(e.error);return{ok:!1,error:To(To({},e),{},{error:n})}}return{ok:!0,result:To(To({},e.result),(!e.result.type||e.result.type===`data`)&&{type:`data`,data:t.deserialize(e.result.data)})}}var Mo=class extends Error{constructor(){super(`Unable to transform response from server`)}};function No(e,t){let n;try{n=jo(e,t)}catch{throw new Mo}if(!n.ok&&(!ao(n.error.error)||typeof n.error.error.code!=`number`)||n.ok&&!ao(n.result))throw new Mo;return n}function Po(e){return typeof e==`function`}async function Fo(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 Io(e){let{type:t,path:n}=e,r=await Fo(e.router,n);if(!r||!Po(r)||r._def.type!==t&&!e.allowMethodOverride)throw new Ao({code:`NOT_FOUND`,message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type===`subscription`)throw new Ao({code:`METHOD_NOT_SUPPORTED`,message:`Method override is not supported for subscriptions`});return r(e)}function Lo(e){return e??`.`}function Ro(e,t){return t===`.`?e:e.split(`.`).join(t)}function zo(e,t){this.v=e,this.k=t}function Bo(e){return function(){return new Vo(e.apply(this,arguments))}}function Vo(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof zo;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)}Vo.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},Vo.prototype.next=function(e){return this._invoke(`next`,e)},Vo.prototype.throw=function(e){return this._invoke(`throw`,e)},Vo.prototype.return=function(e){return this._invoke(`return`,e)};function Ho(e){return Object.prototype.toString.call(e)===`[object Object]`}function Uo(e){var t,n;return Ho(e)!==!1&&(t=e.constructor,t===void 0||!(t===null||(n=t.prototype,Ho(n)===!1)||n.hasOwnProperty(`isPrototypeOf`)===!1))}var Wo,Go=new WeakMap,Ko=()=>{};Wo=Symbol.toStringTag;var qo=class e{constructor(e){Co(this,`promise`,void 0),Co(this,`subscribers`,[]),Co(this,`settlement`,null),Co(this,Wo,`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=Yo();this.subscribers=Xo(this.subscribers,n),e=n.promise,t=()=>{this.subscribers!==null&&(this.subscribers=Qo(this.subscribers,n))}}else{let{status:r}=n;e=r===`fulfilled`?Promise.resolve(n.value):Promise.reject(n.reason),t=Ko}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 Go.set(t,n),Go.set(n,n),n}static getSubscribablePromise(e){return Go.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(Jo);try{return await Promise.race(t)}finally{for(let e of t)e.unsubscribe()}}};function Jo(e){return qo.proxy(e).then(()=>[e])}function Yo(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Xo(e,t){return[...e,t]}function Zo(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Qo(e,t){let n=e.indexOf(t);return n===-1?e:Zo(e,n)}var $o,es;($o=Symbol).dispose??($o.dispose=Symbol()),(es=Symbol).asyncDispose??(es.asyncDispose=Symbol());function ts(e,t){let n=e,r=n[Symbol.dispose];return n[Symbol.dispose]=()=>{t(),r?.call(n)},n}function ns(e,t){let n=e,r=n[Symbol.asyncDispose];return n[Symbol.asyncDispose]=async()=>{await t(),await r?.call(n)},n}var rs=Symbol();function is(e){let t=null;return ts({start(){if(t)throw Error(`Timer already started`);return new Promise(n=>{t=setTimeout(()=>n(rs),e)})}},()=>{t&&clearTimeout(t)})}function as(){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 os(e){return new zo(e,0)}var ss=`ping`,cs=`serialized-error`,ls=`connected`,us=`return`;async function ds(e){try{var t=as();let n=t.u(is(e.timeoutMs)),r=await qo.race([e.promise,n.start()]);return r===rs?await e.onTimeout():r}catch(e){t.e=e}finally{t.d()}}function fs(e){let{deserialize:t=e=>e}=e,n=so(),r=e.signal,i=null,a=()=>{let a=fo;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(ls,e=>{let t=JSON.parse(e.data);n=t,o.enqueue({type:`connected`,options:t,eventSource:l})}),u(cs,e=>{o.enqueue({type:`serialized-error`,error:t(JSON.parse(e.data)),eventSource:l})}),l.addEventListener(ss,()=>{o.enqueue({type:`ping`,eventSource:l})}),l.addEventListener(us,()=>{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 ns({read(){return n.read()},async recreate(){await r(),{stream:e,removeAbortListener:t}=a(),n=e.getReader()}},r)};return uo(Bo(function*(){try{var e=as();let t=e.a(o());for(;;){let e=t.read(),r=n.reconnectAfterInactivityMs;r&&(e=ds({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 os(e);if(a.done)return a.value;yield a.value}}catch(t){e.e=t}finally{yield os(e.d())}}))}po.INTERNAL_SERVER_ERROR;function ps(e){return e instanceof gs}function ms(e){return ao(e)&&ao(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function hs(e,t){return typeof e==`string`?e:ao(e)&&typeof e.message==`string`?e.message:t}var gs=class e extends Error{constructor(t,n){var r,i;let a=n?.cause;super(t,{cause:a}),no(this,`cause`,void 0),no(this,`shape`,void 0),no(this,`data`,void 0),no(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 ps(r)?(n.meta&&(r.meta=io(io({},r.meta),n.meta)),r):ms(r)?new e(r.error.message,io(io({},n),{},{result:r,cause:n.cause})):new e(hs(r,`Unknown error`),io(io({},n),{},{cause:r}))}};function _s(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 vs=e=>typeof e==`function`;function ys(e){if(e)return e;if(typeof window<`u`&&vs(window.fetch))return window.fetch.bind(window);if(typeof globalThis<`u`&&vs(globalThis.fetch))return globalThis.fetch;throw Error(`No fetch implementation found`)}function bs(...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 xs(...e){return Ss(...e).signal}function Ss(...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 Cs=class extends Error{constructor(){let e=`AbortError`;super(e),this.name=e,this.message=e}},ws=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<`u`?new DOMException(`AbortError`,`AbortError`):new Cs};function Ts(e){return{url:e.url.toString(),fetch:e.fetch,transformer:_s(e.transformer),methodOverride:e.methodOverride,pathSeparator:Lo(e.pathSeparator)}}function Es(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];t[n]=r}return t}var Ds={query:`GET`,mutation:`POST`,subscription:`PATCH`};function Os(e){return`input`in e?e.transformer.input.serialize(e.input):Es(e.inputs.map(t=>e.transformer.input.serialize(t)))}var ks=e=>{let t=e.url.split(`?`),n=t[0].replace(/\/$/,``)+`/`+Ro(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=Os(e);t!==void 0&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+=`?`+r.join(`&`)),n},As=e=>{if(e.type===`query`&&e.methodOverride!==`POST`)return;let t=Os(e);return t===void 0?void 0:JSON.stringify(t)},js=e=>Ns(io(io({},e),{},{contentTypeHeader:`application/json`,getUrl:ks,getBody:As}));async function Ms(e){ws(e.signal);let t=e.getUrl(e),n=e.getBody(e),r=e.methodOverride??Ds[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=io(io(io({},e.contentTypeHeader&&r!==`GET`&&!a?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[e.trpcAcceptHeaderKey??`trpc-accept`]:e.trpcAcceptHeader}:void 0),i);return ys(e.fetch)(t,{method:r,signal:e.signal,body:n,headers:o})}async function Ns(e){let t={},n=await Ms(e);t.response=n;let r=await n.json();return t.responseJSON=r,{json:r,meta:t}}var Ps=()=>{throw Error(`Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new`)};function Fs(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:Ps,reject:Ps},i=new Promise((e,n)=>{r.reject=n,r.resolve=e,t??=[],t.push(r)});return n??=setTimeout(a),i}return{load:o}}function Is(e){let t=Ts(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 ks(io(io({},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=bs(...n.map(e=>e.signal)),s=await js(io(io({},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:Fs(i(`query`)),mutation:Fs(i(`mutation`))};return({op:e})=>Ua(n=>{if(e.type===`subscription`)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let r=new AbortController,{signal:i,cleanup:o}=Ss(e.signal,r.signal),s=a[e.type].load(io(io({},e),{},{signal:i})),c=!1,l;return s.then(e=>{c=!0,l=e;let r=No(e.json,t.transformer.output);r.ok?(n.next({context:e.meta,result:r.result}),n.complete()):n.error(gs.from(r.error,{meta:e.meta}))}).catch(e=>{c=!0,n.error(gs.from(e,{meta:l?.meta}))}),()=>{c||r.abort(),o()}})}}var Ls=(e,...t)=>typeof e==`function`?e(...t):e,Rs=class e extends Error{constructor(t){super(t.message,{cause:t.cause}),this.name=`TRPCWebSocketClosedError`,Object.setPrototypeOf(this,e.prototype)}};function zs(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function Bs(e){let t=await Ls(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function Vs(e,t){let n={method:`connectionParams`,data:await Ls(e)};return t.encode(n)}function Hs(e){let{promise:t,resolve:n,reject:r}=zs();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}var Us=new WeakMap;function Ws(e,t){let n=Us.get(e);if(!n){let t=[];n=t,Us.set(e,t),e.addEventListener(`message`,({data:e})=>{var n;e===`PONG`&&((n=t.shift())==null||n())})}n.push(t),e.send(`PING`)}function Gs(e,{intervalMs:t,pongTimeoutMs:n},r){let i,a;function o(){i=setTimeout(()=>{Ws(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)})}no(class e{constructor(t){if(no(this,`id`,++e.connectCount),no(this,`WebSocketPonyfill`,void 0),no(this,`urlOptions`,void 0),no(this,`keepAliveOpts`,void 0),no(this,`encoder`,void 0),no(this,`onPongTimeout`,void 0),no(this,`wsObservable`,Ya(null)),no(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=Bs(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=zs();this.keepAliveOpts.enabled&&Gs(e,this.keepAliveOpts,()=>{this.openPromise===t&&n.reject(new Rs({message:`Pong timeout before connectionParams were sent`})),this.onPongTimeout(e)}),e.addEventListener(`close`,()=>{this.ws===e&&(this.ws=null)}),await Hs(e),this.urlOptions.connectionParams&&e.send(await Promise.race([Vs(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 Ks=[`onStarted`,`onData`,`onError`,`onStopped`,`onComplete`,`onConnectionStateChange`],qs=class{constructor(e){no(this,`links`,void 0),no(this,`runtime`,void 0),no(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return Xa({links:this.links,op:io(io({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(qa())}async requestAsPromise(e){try{return(await Ga(this.$request(e))).result.data}catch(e){throw gs.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=Ks.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=Ka(Ua(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)}})}},Js=Symbol.for(`trpc_untypedClient`),Ys={query:`query`,mutate:`mutation`,subscribe:`subscription`},Xs=e=>Ys[e];function Zs(e){let t=vo(({path:t,args:n})=>{let r=[...t],i=Xs(r.pop()),a=r.join(`.`);return e[i](a,...n)});return yo(n=>n===Js?e:t[n])}function Qs(e){return Zs(new qs(e))}function $s(e){return e[Js]}function ec(e,t){return!t||e!=null&&!Uo(e)?e:io(io({},e??{}),{},{lastEventId:t})}function tc(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 nc(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function nc(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 nc=function(e){this.s=e,this.n=e.next},nc.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 nc(e)}async function rc(e){let t=await Ls(e.url);if(e.connectionParams){let n=await Ls(e.connectionParams),r=t.includes(`?`)?`&`:`?`;t+=r+`connectionParams=`+encodeURIComponent(JSON.stringify(n))}return t}function ic(e){let t=_s(e.transformer),n=Lo(e.pathSeparator);return()=>({op:r})=>Ua(i=>{let{type:a,path:o,input:s}=r;if(a!==`subscription`)throw Error(`httpSubscriptionLink only supports subscriptions`);let c,l=new AbortController,u=fs({url:async()=>ks({transformer:t,url:await rc(e),input:ec(s,c),path:o,pathSeparator:n,type:a,signal:null}),init:()=>Ls(e.eventSourceOptions,{op:r}),signal:xs(r.signal,l.signal),deserialize:e=>t.output.deserialize(e),EventSource:e.EventSource??globalThis.EventSource}),d=Ya({type:`state`,state:`connecting`,error:null}),f=d.subscribe({next(e){i.next({result:e})}});return uo(async()=>{var e=!1,t=!1,n;try{for(var r=tc(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=gs.from({error:e.error});if(mo.includes(e.error.code)){d.next({type:`state`,state:`connecting`,error:t});break}throw t}case`connecting`:{let t=d.get(),n=e.event&&gs.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 gs(`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(gs.from(e))}),()=>{i.complete(),l.abort(),f.unsubscribe()}})}function ac(e,t){this.v=e,this.k=t}function oc(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof ac;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)}oc.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},oc.prototype.next=function(e){return this._invoke(`next`,e)},oc.prototype.throw=function(e){return this._invoke(`throw`,e)},oc.prototype.return=function(e){return this._invoke(`return`,e)};function sc(e){"@babel/helpers - typeof";return sc=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},sc(e)}function cc(e,t){if(sc(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(sc(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function lc(e){var t=cc(e,`string`);return sc(t)==`symbol`?t:t+``}function uc(e,t,n){return(t=lc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dc(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 fc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dc(Object(n),!0).forEach(function(t){uc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pc(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 mc(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function mc(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 mc=function(e){this.s=e,this.n=e.next},mc.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 mc(e)}function hc(e,t){this.v=e,this.k=t}function gc(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 hc(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 _c(e){return function(){return new vc(e.apply(this,arguments))}}function vc(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof hc;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)}vc.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},vc.prototype.next=function(e){return this._invoke(`next`,e)},vc.prototype.throw=function(e){return this._invoke(`throw`,e)},vc.prototype.return=function(e){return this._invoke(`return`,e)};function yc(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 bc(e,t){if(e==null)return{};var n,r,i=yc(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 xc=[`cursor`,`direction`];function Sc(e){return{path:e.path.join(`.`)}}function Cc(e){return e.length>=3}function wc(e){return Cc(e)?{type:`prefixed`,prefix:e[0],path:e[1],args:e[2]}:{type:`unprefixed`,prefix:void 0,path:e[0],args:e[1]}}function Tc(e,t,n){let r=wc(e),i=r.args?.input;return n&&(i=fc(fc(fc({},r.args?.input??{}),n.pageParam===void 0?{}:{cursor:n.pageParam}),{},{direction:n.direction})),[r.path.join(`.`),i,t?.trpc]}async function Ec(e){let t=e.context.client?e.context:fc(fc({},e.context),{},{client:e.queryClient}),n=!1,{iterable:r}=e;function i(){return a.apply(this,arguments)}function a(){return a=_c(function*(){yield*gc(pc(r)),n=!0}),a.apply(this,arguments)}try{return await We({streamFn:i})(t)}finally{n||e.abortController.abort()}}function Dc(e){let t=uo(()=>{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`&&ao(t)&&(`direction`in t||`cursor`in t)){let{cursor:e,direction:n}=t;return[r,{input:bc(t,xc),type:`infinite`}]}return[r,fc(fc({},t!==void 0&&t!==oe&&{input:t}),n&&n!==`any`&&{type:n})]});return e.prefix&&t.unshift([e.prefix]),t}function Oc(e){let t=[e.path.flatMap(e=>e.split(`.`))];return e.prefix&&t.unshift([e.prefix]),t}function kc(e){return oo(e)?e():e}function Ac(e){let{input:t,query:n,path:r,queryKey:i,opts:a}=e,o=t===oe;return Object.assign(it(fc(fc({},a??{}),{},{queryKey:i,queryFn:o?oe:async e=>{var t;let r=fc(fc({},a),{},{trpc:fc(fc({},a?.trpc),a!=null&&(t=a.trpc)!=null&&t.abortOnUnmount?{signal:e.signal}:{signal:null})});return await n(...Tc(i,r,{direction:e.direction,pageParam:e.pageParam}))},initialPageParam:a?.initialCursor??t?.cursor})),{trpc:Sc({path:r})})}function jc(e){let{mutate:t,path:n,prefix:r,opts:i,overrides:a}=e,o=kc(e.queryClient),s=Oc({path:n,prefix:i?.keyPrefix??r}),c=o.defaultMutationOptions(o.getMutationDefaults(s)),l=a?.onSuccess??(e=>e.originalFn());return fc(fc({},i),{},{mutationKey:s,mutationFn:async e=>await t(...Tc([...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:Sc({path:n})})}function Mc(e){let{input:t,query:n,path:r,queryKey:i,opts:a}=e,o=kc(e.queryClient),s=t===oe;return Object.assign(rt(fc(fc({},a),{},{queryKey:i,queryFn:s?oe:async e=>{var t;let r=new AbortController,i=fc(fc({},a),{},{trpc:fc(fc({},a?.trpc),a!=null&&(t=a.trpc)!=null&&t.abortOnUnmount?{signal:e.signal}:{signal:r.signal})}),s=e.queryKey,c=await n(...Tc(s,i));return lo(c)?Ec({iterable:c,context:e,queryClient:o,abortController:r}):c}})),{trpc:Sc({path:r})})}var Nc=e=>{let{subscribe:t,path:n,queryKey:r,input:i,opts:a={}}=e,o=`enabled`in a?!!a.enabled:i!==oe;return fc(fc({},a),{},{enabled:o,subscribe:e=>t(n.join(`.`),i===oe?void 0:i,fc(fc({},e),{},{onComplete:()=>e.onComplete?.call(e)})),queryKey:r,trpc:Sc({path:n})})};function Pc(e){let t=e.keyPrefix,n=t=>(n,r,i)=>`router`in e?Promise.resolve(kc(e.ctx)).then(i=>Io({router:e.router,path:n,getRawInput:async()=>r,ctx:i,type:t,signal:void 0,batchIndex:0})):(e.client instanceof qs?e.client:$s(e.client))[t](n,r,i);return vo(({args:r,path:i})=>{let a=[...i],o=a.pop(),[s,c]=r;return{"~types":void 0,"~queryClient":()=>kc(e.queryClient),pathKey:()=>Dc({path:a,type:`any`,prefix:t}),pathFilter:()=>fc(fc({},s),{},{queryKey:Dc({path:a,type:`any`,prefix:t})}),queryOptions:()=>Mc({input:s,opts:c,path:a,queryClient:e.queryClient,queryKey:Dc({path:a,input:s,type:`query`,prefix:t}),query:n(`query`)}),queryKey:()=>Dc({path:a,input:s,type:`query`,prefix:t}),queryFilter:()=>fc(fc({},c),{},{queryKey:Dc({path:a,input:s,type:`query`,prefix:t})}),infiniteQueryOptions:()=>Ac({input:s,opts:c,path:a,queryClient:e.queryClient,queryKey:Dc({path:a,input:s,type:`infinite`,prefix:t}),query:n(`query`)}),infiniteQueryKey:()=>Dc({path:a,input:s,type:`infinite`,prefix:t}),infiniteQueryFilter:()=>fc(fc({},c),{},{queryKey:Dc({path:a,input:s,type:`infinite`,prefix:t})}),mutationOptions:()=>jc({opts:s,path:a,prefix:t,queryClient:e.queryClient,mutate:n(`mutation`),overrides:e.overrides?.mutations}),mutationKey:()=>Oc({path:a,prefix:t}),subscriptionOptions:()=>Nc({opts:c,path:a,input:s,queryKey:Dc({path:a,input:s,type:`any`,prefix:t}),subscribe:n(`subscription`)})}[o]()})}function Fc(){let e=b.createContext(null),t=b.createContext(null),n=n=>{let r=b.useMemo(()=>Pc({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 Ic(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=>fc(fc({},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=>fc(fc({},e),{},{status:`pending`,error:null}))},onData:e=>{var n,r;(n=(r=t.current).onData)==null||n.call(r,e),u(t=>fc(fc({},t),{},{status:`pending`,data:e,error:null}))},onError:e=>{var n,r;(n=(r=t.current).onError)==null||n.call(r,e),u(t=>fc(fc({},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 fc(fc({},t),{},{status:`connecting`,error:e.error});case`pending`:return t;case`idle`:return fc(fc({},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(Lc(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(Lc(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 Lc(e,t){return new Proxy(e.current,{get(n,r){return t(r),e.current[r]}})}function Rc(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=Rc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function zc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Rc(e))&&(r&&(r+=` `),r+=t);return r}var Bc=(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},Vc=(e,t)=>({classGroupId:e,validator:t}),Hc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Uc=`-`,Wc=[],Gc=`arbitrary..`,Kc=e=>{let t=Yc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Jc(e);let n=e.split(Uc);return qc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Bc(i,t):t:i||Wc}return n[e]||Wc}}},qc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=qc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Uc):e.slice(t).join(Uc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Jc=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?Gc+r:void 0})(),Yc=e=>{let{theme:t,classGroups:n}=e;return Xc(n,t)},Xc=(e,t)=>{let n=Hc();for(let r in e)Zc(e[r],n,r,t);return n},Zc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++)Qc(e[a],t,n,r)},Qc=(e,t,n,r)=>{typeof e==`string`?$c(e,t,n):typeof e==`function`?el(e,t,n,r):tl(e,t,n,r)},$c=(e,t,n)=>{let r=e===``?t:nl(t,e);r.classGroupId=n},el=(e,t,n,r)=>{rl(e)?Zc(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(Vc(n,e)))},tl=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Zc(o,nl(t,a),n,r)}},nl=(e,t)=>{let n=e,r=t.split(Uc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Hc(),n.nextPart.set(t,i)),n=i}return n},rl=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,il=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)}}},al=`!`,ol=`:`,sl=[],cl=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ll=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===ol){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(al)?(c=s.slice(0,-1),l=!0):s.startsWith(al)&&(c=s.slice(1),l=!0);let u=l&&s.startsWith(al)?1:0,d=a&&a>i?a-i-u:void 0;return cl(t,l,c,d)};if(t){let e=t+ol,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):cl(sl,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ul=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}},dl=e=>({cache:il(e.cacheSize),parseClassName:ll(e),sortModifiers:ul(e),postfixLookupClassGroupIds:fl(e),...Kc(e)}),fl=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},pl=/\s+/,ml=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(pl),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?_+al:_,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},hl=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=gl(n))&&(i&&(i+=` `),i+=r);return i},gl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=gl(e[r]))&&(n&&(n+=` `),n+=t);return n},_l=(e,...t)=>{let n,r,i,a,o=o=>(n=dl(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=ml(e,n);return i(e,a),a};return a=o,(...e)=>a(hl(...e))},vl=[],yl=e=>{let t=t=>t[e]||vl;return t.isThemeGetter=!0,t.themeKey=e,t},bl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sl=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wl=/\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$/,Tl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark|contrast-color|device-cmyk|--alpha)\(.+\)$/i,El=/^(?:_*[+-]?(?:\d|\.\d)|[\w-]+\(|_*(?:inherit|initial|revert(?:-layer)?|unset)_*$)/i,Dl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ol=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kl=e=>Sl.test(e),Al=e=>!!e&&!Number.isNaN(Number(e)),jl=e=>!!e&&Number.isInteger(Number(e)),Ml=e=>e.endsWith(`%`)&&Al(e.slice(0,-1)),Nl=e=>Cl.test(e),Pl=()=>!0,Fl=e=>wl.test(e)&&!Tl.test(e),Il=e=>El.test(e)&&!Tl.test(e),Ll=()=>!1,Rl=e=>Dl.test(e),zl=e=>Ol.test(e),Bl=e=>!W(e)&&!Zl(e),Vl=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)),Hl=e=>ou(e,uu,Ll),W=e=>bl.test(e),Ul=e=>ou(e,du,Fl),Wl=e=>ou(e,fu,Il),Gl=e=>ou(e,pu,Al),Kl=e=>ou(e,hu,Pl),ql=e=>ou(e,mu,Ll),Jl=e=>ou(e,cu,Ll),Yl=e=>ou(e,lu,zl),Xl=e=>ou(e,gu,Rl),Zl=e=>xl.test(e),Ql=e=>su(e,du),$l=e=>su(e,fu,!0),eu=e=>su(e,mu),tu=e=>su(e,cu),nu=e=>su(e,uu),ru=e=>su(e,lu),iu=e=>su(e,gu,!0),au=e=>su(e,hu,!0),ou=(e,t,n)=>{let r=bl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},su=(e,t,n=!1)=>{let r=xl.exec(e);return r?r[1]?t(r[1]):n:!1},cu=e=>e===`position`||e===`percentage`,lu=e=>e===`image`||e===`url`,uu=e=>e===`length`||e===`size`||e===`bg-size`,du=e=>e===`length`,fu=e=>e!==`color`,pu=e=>e===`number`,mu=e=>e===`family-name`,hu=e=>e===`number`||e===`weight`,gu=e=>e===`shadow`,_u=_l(()=>{let e=yl(`color`),t=yl(`font`),n=yl(`text`),r=yl(`font-weight`),i=yl(`tracking`),a=yl(`leading`),o=yl(`breakpoint`),s=yl(`container`),c=yl(`spacing`),l=yl(`radius`),u=yl(`shadow`),d=yl(`inset-shadow`),f=yl(`text-shadow`),p=yl(`drop-shadow`),m=yl(`blur`),h=yl(`perspective`),g=yl(`aspect`),_=yl(`ease`),v=yl(`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(),Zl,W],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Zl,W,c],T=()=>[kl,`full`,`auto`,...w()],E=()=>[jl,`none`,`subgrid`,Zl,W],D=()=>[`auto`,{span:[`full`,jl,Zl,W]},jl,Zl,W],O=()=>[jl,`auto`,Zl,W],k=()=>[`auto`,`min`,`max`,`fr`,Zl,W],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=()=>[kl,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,kl,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[kl,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Zl,W],L=()=>[...b(),tu,Jl,{position:[Zl,W]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,nu,Hl,{size:[Zl,W]}],B=()=>[Ml,Ql,Ul],V=()=>[``,`none`,`full`,l,Zl,W],H=()=>[``,Al,Ql,Ul],ee=()=>[`solid`,`dashed`,`dotted`,`double`],te=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ne=()=>[Al,Ml,$l,Wl],re=()=>[``,`none`,m,Zl,W],ie=()=>[`none`,Al,Zl,W],ae=()=>[`none`,Al,Zl,W],oe=()=>[Al,Zl,W],se=()=>[kl,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Nl],breakpoint:[Nl],color:[Pl],container:[Nl],"drop-shadow":[Nl],ease:[`in`,`out`,`in-out`],font:[Bl],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Nl],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Nl],shadow:[Nl],spacing:[`px`,Al],text:[Nl],"text-shadow":[Nl],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,kl,W,Zl,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Zl,W]}],"container-named":[Vl],columns:[{columns:[Al,`auto`,W,Zl,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:[jl,`auto`,Zl,W]}],basis:[{basis:[kl,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Al,kl,`auto`,`initial`,`none`,Zl,W]}],grow:[{grow:[``,Al,Zl,W]}],shrink:[{shrink:[``,Al,Zl,W]}],order:[{order:[jl,`first`,`last`,`none`,Zl,W]}],"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,Ql,Ul]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,au,Kl]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ml,W]}],"font-family":[{font:[eu,ql,t]}],"font-features":[{"font-features":[W]}],"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,Zl,W]}],"line-clamp":[{"line-clamp":[Al,`none`,Zl,W]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Zl,W]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Zl,W]}],"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:[...ee(),`wavy`]}],"text-decoration-thickness":[{decoration:[Al,`from-font`,`auto`,Ql,tu,Ul]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Al,`auto`,Zl,W]}],"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:[jl,Zl,W]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Zl,W]}],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`,Zl,W]}],"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`]},jl,Zl,W],radial:[``,Zl,W],conic:[``,jl,Zl,W]},ru,Yl]}],"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:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":H()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ee(),`hidden`,`none`]}],"divide-style":[{divide:[...ee(),`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:[...ee(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Al,Zl,W]}],"outline-w":[{outline:[``,Al,Ql,Ul]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,iu,Xl]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,iu,Xl]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:H()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Al,Ul]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,iu,Xl]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Al,Zl,W]}],"mix-blend":[{"mix-blend":[...te(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":te()}],"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":[Al]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"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":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"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":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"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":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"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":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"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":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"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":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Zl,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"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":[Al]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"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`,Zl,W]}],filter:[{filter:[``,`none`,Zl,W]}],blur:[{blur:re()}],brightness:[{brightness:[Al,Zl,W]}],contrast:[{contrast:[Al,Zl,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,iu,Xl]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Al,Zl,W]}],"hue-rotate":[{"hue-rotate":[Al,Zl,W]}],invert:[{invert:[``,Al,Zl,W]}],saturate:[{saturate:[Al,Zl,W]}],sepia:[{sepia:[``,Al,Zl,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Zl,W]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[Al,Zl,W]}],"backdrop-contrast":[{"backdrop-contrast":[Al,Zl,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Al,Zl,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Al,Zl,W]}],"backdrop-invert":[{"backdrop-invert":[``,Al,Zl,W]}],"backdrop-opacity":[{"backdrop-opacity":[Al,Zl,W]}],"backdrop-saturate":[{"backdrop-saturate":[Al,Zl,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,Al,Zl,W]}],"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`,Zl,W]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Al,`initial`,Zl,W]}],ease:[{ease:[`linear`,`initial`,_,Zl,W]}],delay:[{delay:[Al,Zl,W]}],animate:[{animate:[`none`,v,Zl,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Zl,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":[`scale-3d`],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[Zl,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":[`translate-none`],zoom:[{zoom:[jl,Zl,W]}],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`,Zl,W]}],"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`,Zl,W]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Al,Ql,Ul,Gl]}],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 G(...e){return _u(zc(e))}function vu(){let e=/(?:^|;\s*)forge_csrf=([^;]*)/.exec(document.cookie);return e?decodeURIComponent(e[1]):``}function yu(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 bu(e,t=Date.now()){let n=yu(e,t);return n===`now`?`just now`:/\d[mhd]$/.test(n)?`${n} ago`:n}function xu(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,hour12:!1}):``}function Su(e){return Math.floor(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())/864e5)}function Cu(e,t=Date.now()){if(!e)return``;let n=new Date(e);if(Number.isNaN(n.getTime()))return``;let r=xu(e),i=new Date(t),a=Su(i)-Su(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 wu(e){return e%100>=11&&e%100<=13?`th`:[`th`,`st`,`nd`,`rd`][e%10]||`th`}function Tu(e){if(!e)return``;let t=new Date(e);if(Number.isNaN(t.getTime()))return``;let n=t.toLocaleDateString(`en-US`,{month:`long`});return`${xu(e)}, ${t.getDate()}${wu(t.getDate())} ${n} ${t.getFullYear()}`}function Eu(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}var Du=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform),Ou=Qs({links:[Qa({condition:e=>e.type===`subscription`,true:ic({url:`/api/trpc`}),false:Is({url:`/api/trpc`,headers:()=>({"x-forge-token":vu()})})})]}),{TRPCProvider:ku,useTRPC:Au}=Fc(),ju=[{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 Mu(e,t){let n=t.find(t=>t.command===e.id);return n?n.key:e.key}var Nu={Backquote:"`",Comma:`,`,Period:`.`,Slash:`/`,BracketLeft:`[`,BracketRight:`]`,Minus:`-`,Equal:`=`,Semicolon:`;`,Quote:`'`,Backslash:`\\`};function Pu(e){if([`Control`,`Meta`,`Shift`,`Alt`].includes(e.key))return``;let t=[];(Du?e.metaKey:e.ctrlKey)&&t.push(`mod`),Du&&e.ctrlKey&&t.push(`ctrl`),!Du&&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):Nu[e.code]?Nu[e.code]:(e.key.length,e.key.toLowerCase()),n===` `&&(n=`space`),t.push(n),t.join(`+`)}function Fu(e){if(!e)return[];let t=Du?{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 Iu(e){return Fu(e).join(Du?``:`+`)}function Lu(e){let t=new Map;for(let n of ju){let r=Mu(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 Ru(){let e=Au(),t=C();Ic(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()});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.edits.undone.queryKey({projectId:r.projectId})}),t.invalidateQueries({queryKey:e.projects.info.queryKey({id: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`: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 zu={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`},Bu=`forge.ui`;function Vu(){try{let e=JSON.parse(localStorage.getItem(Bu)||`{}`);return e.panelTab===`file`&&(e.openFiles=e.openFile?[e.openFile]:[],e.panelTab=e.openFile?`file:${e.openFile}`:`files`),{...zu,...e,fileReveal:null,pushOpen:!1,newProject:``,theme:localStorage.getItem(`forge.theme`)||zu.theme}}catch{return zu}}var Hu=Vu(),Uu=new Set;function Wu(e){Hu={...Hu,...e};let{theme:t,...n}=Hu;localStorage.setItem(Bu,JSON.stringify(n)),localStorage.setItem(`forge.theme`,t),`theme`in e&&Ku(t);for(let e of Uu)e()}function Gu(){return(0,b.useSyncExternalStore)(e=>(Uu.add(e),()=>Uu.delete(e)),()=>Hu)}function Ku(e){let t=e===`dark`||e===`system`&&matchMedia(`(prefers-color-scheme: dark)`).matches;if(document.documentElement.classList.toggle(`dark`,t),t!==qu){qu=t;for(let e of Uu)e()}}var qu=document.documentElement.classList.contains(`dark`);function Ju(){return(0,b.useSyncExternalStore)(e=>(Uu.add(e),()=>Uu.delete(e)),()=>qu)}matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{Hu.theme===`system`&&Ku(`system`)});var Yu=0;function Xu(e,t=null){let n=e.replace(/\\/g,`/`).replace(/\/+$/,``);if(!n)return;let r=Hu.openFiles.includes(n)?Hu.openFiles:[...Hu.openFiles,n],i=Hu.closedTabs.includes(`files`)?Hu.closedTabs:[...Hu.closedTabs,`files`];Yu+=1,Wu({openFiles:r,openFile:n,panelTab:`file:${n}`,panelOpen:!0,closedTabs:i,fileReveal:{path:n,line:t,id:Yu}})}function Zu(e){return e.startsWith(`file:`)?e.slice(5):null}var Qu=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function $u(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Qu(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var ed=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},td=e=>{let t=ed(e);return t.charAt(0).toUpperCase()+t.slice(1)},nd=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),rd={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 id(e){return e!=null}function ad(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??rd.width,a=e.size??e.height??rd.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?nd(...c):nd(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??rd[`stroke-width`])*Number(e.size??e.width??rd.width)/Number(t.size??t.width??rd.width):t.strokeWidth??rd[`stroke-width`];return[`svg`,{...Object.entries(rd).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&id(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&id(t.width)&&{[r(`width`)]:t.width},...`height`in t&&id(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 od(e,t={}){return ad(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var sd=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},cd=(0,b.createContext)({}),ld=()=>(0,b.useContext)(cd),ud=(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=``}=ld()??{},y=!!c||sd(d),[x,S,C=[]]=od(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:nd(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 K(e,t=[],n=[]){let r=typeof e==`string`?$u(e,t,n):e,i=(0,b.forwardRef)(({className:e,...t},n)=>(0,b.createElement)(ud,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=td(r.name)),i}var dd={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`}]]};dd.node;var fd=K(dd),pd={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`}]]};pd.node;var md=K(pd),hd={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};hd.node;var gd=K(hd),_d={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};_d.node;var vd=K(_d),yd={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`}]]};yd.node;var bd=K(yd),xd={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`}]]};xd.node;var Sd=K(xd),Cd={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`}]]};Cd.node;var wd=K(Cd),Td={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`}]]};Td.node;var Ed=K(Td),Dd={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`]};Dd.node;var Od=K(Dd),kd={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`]};kd.node;var Ad=K(kd),jd={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};jd.node;var Md=K(jd),Nd={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Nd.node;var Pd=K(Nd),Fd={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Fd.node;var Id=K(Fd),Ld={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Ld.node;var Rd=K(Ld),zd={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`]};zd.node;var Bd=K(zd),Vd={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`}]]};Vd.node;var Hd=K(Vd),Ud={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`]};Ud.node;var Wd=K(Ud),Gd={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`]};Gd.node;var Kd=K(Gd),qd={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};qd.node;var Jd=K(qd),Yd={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`]};Yd.node;var Xd=K(Yd),Zd={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`]};Zd.node;var Qd=K(Zd),$d={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`}]]};$d.node;var ef=K($d),tf={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`}]]};tf.node;var nf=K(tf),rf={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`}]]};rf.node;var af=K(rf),of={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`}]]};of.node;var sf=K(of),cf={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`]};cf.node;var lf=K(cf),uf={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`}]]};uf.node;var df=K(uf),ff={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`}]]};ff.node;var pf=K(ff),mf={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`}]]};mf.node;var hf=K(mf),gf={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`}]]};gf.node;var _f=K(gf),vf={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`}]]};vf.node;var yf=K(vf),bf={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`}]]};bf.node;var xf=K(bf),Sf={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`}]]};Sf.node;var Cf=K(Sf),wf={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`}]]};wf.node;var Tf=K(wf),Ef={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`}]]};Ef.node;var Df=K(Ef),Of={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`}]]};Of.node;var kf=K(Of),Af={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`}]]};Af.node;var jf=K(Af),Mf={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`}]]};Mf.node;var Nf=K(Mf),Pf={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`}]]};Pf.node;var Ff=K(Pf),If={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`}]]};If.node;var Lf=K(If),Rf={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`}]]};Rf.node;var zf=K(Rf),Bf={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`}]]};Bf.node;var Vf=K(Bf),Hf={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`}]]};Hf.node;var Uf=K(Hf),Wf={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`}]]};Wf.node;var Gf=K(Wf),Kf={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`}]]};Kf.node;var qf=K(Kf),Jf={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`}]]};Jf.node;var Yf=K(Jf),Xf={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`]};Xf.node;var Zf=K(Xf),Qf={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};Qf.node;var $f=K(Qf),ep={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};ep.node;var tp=K(ep),np={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`]};np.node;var rp=K(np),ip={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`}]]};ip.node;var ap=K(ip),op={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`]};op.node;var sp=K(op),cp={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`}]]};cp.node;var lp=K(cp),up={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`}]]};up.node;var dp=K(up),fp={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`}]]};fp.node;var pp=K(fp),mp={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`}]]};mp.node;var hp=K(mp),gp={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`}]]};gp.node;var _p=K(gp),vp={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`}]]};vp.node;var yp=K(vp),bp={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`}]]};bp.node;var xp=K(bp),Sp={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`}]]};Sp.node;var Cp=K(Sp),wp={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`}]]};wp.node;var Tp=K(wp),Ep={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`}]]};Ep.node;var Dp=K(Ep),Op={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`]};Op.node;var kp=K(Op),Ap={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`}]]};Ap.node;var jp=K(Ap),Mp={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`}]]};Mp.node;var Np=K(Mp),Pp={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`}]]};Pp.node;var Fp=K(Pp),Ip={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`}]]};Ip.node;var Lp=K(Ip),Rp={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`}]]};Rp.node;var zp=K(Rp),Bp={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`}]]};Bp.node;var Vp=K(Bp),Hp={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`}]]};Hp.node;var Up=K(Hp),Wp={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`}]]};Wp.node;var Gp=K(Wp),Kp={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Kp.node;var qp=K(Kp),Jp={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`}]]};Jp.node;var Yp=K(Jp),Xp={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`}]]};Xp.node;var Zp=K(Xp),Qp={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`}]]};Qp.node;var $p=K(Qp),em={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`}]]};em.node;var tm=K(em),nm={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`}]]};nm.node;var rm=K(nm),im={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};im.node;var am=K(im),om={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`}]]};om.node;var sm=K(om),cm={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`}]]};cm.node;var lm=K(cm),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 dm=K(um),fm={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`]};fm.node;var pm=K(fm),mm={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`]};mm.node;var hm=K(mm),gm={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`}]]};gm.node;var _m=K(gm),vm={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`]};vm.node;var ym=K(vm),bm={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`]};bm.node;var xm=K(bm),Sm={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`]};Sm.node;var Cm=K(Sm),wm={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`}]]};wm.node;var Tm=K(wm),Em={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`}]]};Em.node;var Dm=K(Em),Om={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`}]]};Om.node;var km=K(Om),Am={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};Am.node;var jm=K(Am),Mm={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`]};Mm.node;var Nm=K(Mm),Pm={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`]};Pm.node;var Fm=K(Pm),Im={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`]};Im.node;var Lm=K(Im),Rm={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`}]]};Rm.node;var zm=K(Rm),Bm={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`]};Bm.node;var Vm=K(Bm),Hm={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`}]]};Hm.node;var Um=K(Hm),Wm={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Wm.node;var Gm=K(Wm),Km=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,qm=zc,Jm=((e,t)=>n=>{if(t?.variants==null)return qm(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=Km(t)||Km(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 qm(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 q({className:e,variant:t,size:n,type:r=`button`,...i}){return(0,x.jsx)(`button`,{type:r,className:G(Jm({variant:t,size:n}),e),...i})}function Ym(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 Xm=Ym(`https://base-ui.com/production-error`,`Base UI`),Zm=b.createContext(void 0);function Qm(e){let t=b.useContext(Zm);if(t===void 0&&!e)throw Error(Xm(33));return t}var $m=b.createContext(void 0);function eh(e){let t=b.useContext($m);if(t===void 0&&!e)throw Error(Xm(36));return t}var th={};function nh(e,t){let n=b.useRef(th);return n.current===th&&(n.current=e(t)),n}function rh(e,t,n,r){let i=nh(ah).current;return oh(i,e,t,n,r)&&ch(i,[e,t,n,r]),i.callback}function ih(e){let t=nh(ah).current;return sh(t,e)&&ch(t,e),t.callback}function ah(){return{callback:null,cleanup:null,refs:[]}}function oh(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function sh(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function ch(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 lh=19;function uh(e){return lh>=e}function dh(e){if(!b.isValidElement(e))return null;let t=e,n=t.props;return(uh(19)?n?.ref:t.ref)??null}function fh(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function ph(){}var mh=Object.freeze([]),hh=Object.freeze({});function gh(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 _h(e,t){return typeof e==`function`?e(t):e}function vh(e,t){return typeof e==`function`?e(t):e}var yh={};function bh(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Sh(t);let a=Sh(e);return t&&(a=Ch(a,t)),n&&(a=Ch(a,n)),r&&(a=Ch(a,r)),i&&(a=Ch(a,i)),a}function xh(e){if(e.length===0)return yh;if(e.length===1)return Sh(e[0]);let t=Sh(e[0]);for(let n=1;n<e.length;n+=1)t=Ch(t,e[n]);return t}function Sh(e){return Dh(e)?{...e(yh)}:wh(e)}function Ch(e,t){return Dh(t)?t(e):Th(e,t)}function wh(e){let t={...e};for(let e in t){let n=t[e];Eh(e,n)&&(t[e]=kh(n))}return t}function Th(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=fh(e.style,r);break;case`className`:e[n]=jh(e.className,r);break;default:e[n]=Eh(n,r)?Oh(e[n],r):r}}return e}function Eh(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 Dh(e){return typeof e==`function`}function Oh(e,t){return t?e?(...n)=>{let r=n[0];if(Mh(r)){let i=r;Ah(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:kh(t):e}function kh(e){return e&&((...t)=>{let n=t[0];return Mh(n)&&Ah(n),e(...t)})}function Ah(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function jh(e,t){return t?e?t+` `+e:t:e}function Mh(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Nh(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Lh(r));let i=Ph(t,n,r);if(n.enabled===!1)return null;let a=n.state??hh;return Rh(e,r,i,a)}function Ph(e,t,n){let{className:r,style:i}=e,{state:a=hh,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?_h(r,a):void 0,d=l?vh(i,a):void 0,f=l?gh(a,c):hh,p=l&&s?Fh(s):void 0,m=l?fh(f,p)??{}:hh;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?ih([m.ref,dh(n),...o]):rh(m.ref,dh(n),o):rh(null,null)),l?(u!==void 0&&(m.className=jh(m.className,u)),d!==void 0&&(m.style=fh(m.style,d)),m):hh}function Fh(e){return Array.isArray(e)?xh(e):bh(void 0,e)}var Ih=Symbol.for(`react.lazy`);function Lh(e){if(e?.$$typeof!==Ih)return e;let t=b.Children.toArray(e)[0];return b.isValidElement(t)?t:e}function Rh(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=bh(n,t.props);return e.ref=n.ref,b.cloneElement(t,e)}return zh(e,n)}function zh(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 Bh=`data-starting-style`,Vh=`data-ending-style`,Hh={[Bh]:``},Uh={[Vh]:``},Wh={transitionStatus(e){return e===`starting`?Hh:e===`ending`?Uh:null}},Gh=`data-open`,Kh=`data-closed`,qh=`data-anchor-hidden`,Jh=`data-popup-open`,Yh=`data-pressed`,Xh={[Jh]:``},Zh={[Jh]:``,[Yh]:``},Qh={[Gh]:``},$h={[Kh]:``},eg={[qh]:``},tg={open(e){return e?Xh:null}},ng={open(e){return e?Zh:null}},rg={open(e){return e?Qh:$h},anchorHidden(e){return e?eg:null}},ig={...rg,...Wh},ag=b.createContext(void 0);function og(e=!0){let t=b.useContext(ag);if(t===void 0&&!e)throw Error(Xm(25));return t}var sg=`none`,cg=`trigger-press`,lg=`trigger-hover`,ug=`trigger-focus`,dg=`outside-press`,fg=`item-press`,pg=`close-press`,mg=`focus-out`,hg=`escape-key`,gg=`list-navigation`,_g=`keyboard`,vg=`pointer`,yg=`cancel-open`,bg=`sibling-open`,xg=`disabled`,Sg=`imperative-action`,Cg=`window-resize`;function wg({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 Tg=b.createContext(null);function Eg(e=`root`){let t=b.useContext(Tg),n=b.useContext($m);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Dg={visible:!0,ref:null};function Og(){return Dg}function kg(e,t,n=`root`){let r=Eg(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Og)({label:e.label,children:e.children,render:e.render}),a=rh(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Ag(){return typeof window<`u`}function jg(e){return Pg(e)?(e.nodeName||``).toLowerCase():`#document`}function Mg(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ng(e){return((Pg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pg(e){return Ag()?e instanceof Node||e instanceof Mg(e).Node:!1}function Fg(e){return Ag()?e instanceof Element||e instanceof Mg(e).Element:!1}function Ig(e){return Ag()?e instanceof HTMLElement||e instanceof Mg(e).HTMLElement:!1}function Lg(e){return!Ag()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Mg(e).ShadowRoot}function Rg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Yg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function zg(e){return/^(table|td|th)$/.test(jg(e))}function Bg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Vg=/transform|translate|scale|rotate|perspective|filter/,Hg=/paint|layout|strict|content/,Ug=e=>!!e&&e!==`none`,Wg;function Gg(e){let t=Fg(e)?Yg(e):e;return Ug(t.transform)||Ug(t.translate)||Ug(t.scale)||Ug(t.rotate)||Ug(t.perspective)||!qg()&&(Ug(t.backdropFilter)||Ug(t.filter))||Vg.test(t.willChange||``)||Hg.test(t.contain||``)}function Kg(e){let t=Zg(e);for(;Ig(t)&&!Jg(t);){if(Gg(t))return t;if(Bg(t))return null;t=Zg(t)}return null}function qg(){return Wg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Wg}function Jg(e){return/^(html|body|#document)$/.test(jg(e))}function Yg(e){return Mg(e).getComputedStyle(e)}function Xg(e){return Fg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zg(e){if(jg(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Lg(e)&&e.host||Ng(e);return Lg(t)?t.host:t}function Qg(e){let t=Zg(e);return Jg(t)?(e.ownerDocument||e).body:Ig(t)&&Rg(t)?t:Qg(t)}function $g(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Qg(e),i=r===e.ownerDocument?.body,a=Mg(r);if(i){let e=e_(a);return t.concat(a,a.visualViewport||[],Rg(r)?r:[],e&&n?$g(e):[])}return t.concat(r,$g(r,[],n))}function e_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var t_={...b},n_=t_.useInsertionEffect,r_=n_&&n_!==t_.useLayoutEffect?n_:e=>e();function i_(e){let t=nh(a_).current;return t.next=e,r_(t.effect),t.trampoline}function a_(){let e={next:void 0,callback:o_,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function o_(){}var J=typeof document<`u`?b.useLayoutEffect:()=>{},s_=b.createContext(void 0);function c_(e=!1){let t=b.useContext(s_);if(t===void 0&&!e)throw Error(Xm(16));return t}function l_(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 u_(e){return e?.ownerDocument||document}function d_(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Mg(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 f_(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=b.useRef(null),s=c_(!0),c=a??s!==void 0,{props:l}=l_({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=b.useCallback(()=>{let e=o.current;p_(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return J(u,[u]),{getButtonProps:b.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return bh({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Ah(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=p_(r),s=!i&&m_(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(),d_(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),d_(r,e)))},onKeyUp(e){t||(Ah(e),a?.(e),e.target===e.currentTarget&&i&&c&&p_(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),d_(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:i_(e=>{o.current=e,u()})}}function p_(e){return Ig(e)&&e.tagName===`BUTTON`}function m_(e){return Ig(e)&&e.tagName===`A`&&!!e.href}function h_(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:g_,platform:__,maxTouchPoints:v_}=h_(),y_=g_.toLowerCase(),b_=__.toLowerCase(),x_=/^i(os$|p)/.test(b_)||b_===`macintel`&&v_>1,S_=`android`,C_=b_===S_||y_.includes(S_),w_=!x_&&b_.startsWith(`mac`);b_.startsWith(`win`),!C_&&/^(linux|chrome os)/.test(b_);var T_=w_||x_,E_=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!E_&&y_.includes(`firefox`),!E_&&y_.includes(`chrom`);var D_=T_,O_=/jsdom|happydom/.test(y_);function k_(e){e.preventDefault()}function A_(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=eh(),u=og(!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?k_: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:fg})},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&&!w_&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&d_(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var j_={type:`regular-item`};function M_(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}=f_({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=A_({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=b.useCallback(e=>bh(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=rh(u,f);return b.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var N_=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function P_(){return b.useContext(N_)}function F_(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=P_(),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 J(()=>{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 I_(){let[,e]=b.useState({});return b.useCallback(()=>{e({})},[])}var L_=0;function R_(e,t=`mui`){let n=b.useRef(void 0),r=I_(),i=e??n.current;return b.useEffect(()=>{n.current??(L_+=1,n.current=`${t}-${L_}`,e??r())},[e,t,r]),i}var z_=t_.useId;function B_(e,t){if(z_!==void 0){let n=z_();return e??(t?`${t}-${n}`:n)}return R_(e,t)}function V_(e){return B_(e,`base-ui`)}function H_(e,t,n,r){let i=!1,a=!1,o=r??hh;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 U_(e,t,n){let r=n??hh;return{reason:e,event:t??new Event(`base-ui`),...r}}function W_(e){b.useEffect(e,mh)}var G_=null;globalThis.requestAnimationFrame;var K_=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)}},q_=class e{static create(){return new e}static request(e){return K_.request(e)}static cancel(e){return K_.cancel(e)}currentId=G_;request(e){this.cancel(),this.currentId=K_.request(()=>{this.currentId=G_,e()})}cancel=()=>{this.currentId!==G_&&(K_.cancel(this.currentId),this.currentId=G_)};disposeEffect=()=>this.cancel};function J_(){let e=nh(q_.create).current;return W_(e.disposeEffect),e}function Y_(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),J(()=>{if(!e&&o&&i!==`ending`&&n){let e=q_.request(()=>{a(`ending`)});return()=>{q_.cancel(e)}}},[e,o,i,n]),J(()=>{if(!e||t||i===void 0)return;let n=q_.request(()=>{a(void 0)});return()=>{q_.cancel(n)}},[t,e,i]),J(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=q_.request(()=>{a(`idle`)});return()=>{q_.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function X_(e){return e==null?e:`current`in e?e.current:e}function Z_(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Q_=l(h(),1),$_=null;function e1(e){if(!$_){let e=[];$_=e,queueMicrotask(()=>{$_=null,Q_.flushSync(()=>{for(let t of e)t()})})}$_.push(e)}function t1(e,t=!1,n=!1){let r=J_();return i_((i,a=null)=>{r.cancel();let o=X_(e);if(o==null)return;let s=o,c=()=>{n?e1(()=>{a?.aborted||i()}):Q_.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Z_(s).map(e=>e.finished.then(ph))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Z_(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Bh;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 n1(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=i_(a),s=t1(r,n,i);b.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var r1=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}=eh(),f=F_({guess:!0,label:a}),p=V_(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}=M_({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:j_});return Nh(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),i1=b.forwardRef(function(e,t){let n=kg(e,t);return n.visible?(0,x.jsx)(r1,{...e,ref:n.ref}):null}),a1=0,o1=class e{static create(){return new e}currentId=a1;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=a1,t()},e)}isStarted(){return this.currentId!==a1}clear=()=>{this.currentId!==a1&&(clearTimeout(this.currentId),this.currentId=a1)};disposeEffect=()=>this.clear};function s1(){let e=nh(o1.create).current;return W_(e.disposeEffect),e}function c1(e){e.preventDefault(),e.stopPropagation()}function l1(e){return`nativeEvent`in e}function u1(e){return e.pointerType===``&&e.isTrusted?!0:C_&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function d1(e){return O_?!1:!C_&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(C_||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function f1(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function p1(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function m1(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function h1(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Lg(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function g1(e,t){let n=e;for(;n;){if(Fg(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Lg(n)?n.host:null)}return null}function _1(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var v1=`data-base-ui-focusable`,y1=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,b1=`ArrowLeft`,x1=`ArrowRight`,S1=`ArrowUp`,C1=`ArrowDown`,w1=`data-trigger-disabled`;function T1(e,t){if(!Fg(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(w1);for(let[,e]of t.entries())if(h1(e,n))return!e.hasAttribute(w1);return!1}function E1(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 D1(e){return e.matches(`html,body`)}function O1(e){return Ig(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function k1(e){return g1(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${y1}`)!=null}function A1(e){return e?e.getAttribute(`role`)===`combobox`&&O1(e):!1}function j1(e){if(!e||O_)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function M1(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function N1(e,t){return t!=null&&!f1(t)?0:typeof e==`function`?e():e}function P1(e,t,n){let r=N1(e,n);return typeof r==`number`?r:r?.[t]}function F1(e){return typeof e==`function`?e():e}function I1(e,t){return t||e===`click`||e===`mousedown`}function L1(e){return e?.includes(`mouse`)&&e!==`mousedown`}var R1=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new o1,currentIdRef:{current:null},currentContextRef:{current:null}});function z1(e,t){e.current=t.current}function B1(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=s1();return J(()=>{a.current=n,o.current?i.current={open:P1(i.current,`open`),close:P1(n,`close`)}:i.current=n},[n,o,i,a]),(0,x.jsx)(R1.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function V1(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(R1),[d,f]=b.useState(!1),p=b.useRef(n);return J(()=>{p.current=n},[n]),J(()=>{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]),J(()=>{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:P1(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,H_(sg))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),J(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,z1(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 H1(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function U1(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function W1(e){let t=nh(G1,e).current;return t.next=e,J(t.effect),t}function G1(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var K1={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},q1={...K1,position:`fixed`,margin:0,top:0,left:0},J1={...K1,position:`absolute`},Y1=b.forwardRef(function(e,t){let[n,r]=b.useState();J(()=>{D_&&E_&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,x.jsx)(`span`,{...e,ref:t,style:q1,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),X1=Math.min,Z1=Math.max,Q1=Math.round,$1=Math.floor,e0=e=>({x:e,y:e}),t0={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function n0(e,t,n){return Z1(e,X1(t,n))}function r0(e,t){return typeof e==`function`?e(t):e}function i0(e){return e.split(`-`)[0]}function a0(e){return e.split(`-`)[1]}function o0(e){return e===`x`?`y`:`x`}function s0(e){return e===`y`?`height`:`width`}function c0(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function l0(e){return o0(c0(e))}function u0(e,t,n){n===void 0&&(n=!1);let r=a0(e),i=l0(e),a=s0(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=y0(o)),[o,y0(o)]}function d0(e){let t=y0(e);return[f0(e),t,f0(t)]}function f0(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var p0=[`left`,`right`],m0=[`right`,`left`],h0=[`top`,`bottom`],g0=[`bottom`,`top`];function _0(e,t,n){switch(e){case`top`:case`bottom`:return n?t?m0:p0:t?p0:m0;case`left`:case`right`:return t?h0:g0;default:return[]}}function v0(e,t,n,r){let i=a0(e),a=_0(i0(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(f0)))),a}function y0(e){let t=i0(e);return t0[t]+e.slice(t.length)}function b0(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function x0(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:b0(e)}function S0(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 C0(e,t){return t<0||t>=e.length}function w0(e,t){return D0(e.current,{disabledIndices:t})}function T0(e,t){return D0(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function E0(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>D0(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:C0(e,u)?-1:u,wrapped:d}}function D0(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&&O0(e,a,r));return a}function O0(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!A0(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function k0(e){return e.visibility===`hidden`||e.visibility===`collapse`}function A0(e,t=e?Yg(e):null){return!e||!e.isConnected||!t||k0(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var j0=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function M0(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Lg(n)?n.host:null}function N0(e){for(let t of Array.from(e.children))if(jg(t)===`summary`)return t;return null}function P0(e,t){let n=N0(t);return!!n&&(e===n||h1(n,e))}function F0(e){let t=e?jg(e):``;return e!=null&&e.matches(j0)&&(t!==`summary`||e.parentElement!=null&&jg(e.parentElement)===`details`&&N0(e.parentElement)===e)&&(t!==`details`||N0(e)==null)&&(t!==`input`||e.type!==`hidden`)}function I0(e){if(!F0(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=M0(t)){let n=t!==e,r=jg(t)===`slot`;if(t.hasAttribute(`inert`)||n&&jg(t)===`details`&&!t.open&&!P0(e,t)||t.hasAttribute(`hidden`)||!r&&!L0(t,n))return!1}return!0}function L0(e,t){let n=Yg(e);return t?n.display!==`none`:A0(e,n)}function R0(e){let t=e.tabIndex;if(t<0){let t=jg(e);if(t===`details`||t===`audio`||t===`video`||Ig(e)&&e.isContentEditable)return 0}return t}function z0(e){if(jg(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function B0(e,t){let n=z0(e);if(!n)return!0;let r=t.find(e=>{let t=z0(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=z0(e);return t?.name===n.name&&t.form===n.form})===n}function V0(e){if(Ig(e)&&jg(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ig(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function H0(e,t){V0(e).forEach(e=>{F0(e)&&t.push(e),H0(e,t)})}function U0(e,t,n){V0(e).forEach(e=>{Ig(e)&&e.matches(t)&&n.push(e),U0(e,t,n)})}function W0(e){return I0(e)&&R0(e)>=0}function G0(e){let t=[];return H0(e,t),t.filter(I0)}function K0(e){let t=G0(e);return t.filter(e=>R0(e)>=0&&B0(e,t))}function q0(e,t){let n=K0(e),r=n.length;if(r===0)return;let i=m1(u_(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function J0(e){return q0(u_(e).body,1)||e}function Y0(e){return q0(u_(e).body,-1)||e}function X0(e,t,n){if(!e)return null;let r=[];H0(u_(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(I0);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!h1(n,o)&&W0(o)&&B0(o,a))return o}return r[i]}function Z0(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!h1(n,r)}function Q0(e){K0(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function $0(e){let t=[];U0(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 ev(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ev(e,t.id,n)])}function tv(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 nv(e){return`data-base-ui-${e}`}var rv=0;function iv(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(),ph;let o=requestAnimationFrame(a);return rv=o,()=>{rv===o&&(cancelAnimationFrame(o),rv=0)}}var av=`data-base-ui-inert`,ov=new WeakMap,sv=new WeakSet,cv=new WeakMap,lv=0;function uv(e){return e?Lg(e)?e.host:uv(e.parentNode):null}var dv=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=uv(t);return e.contains(n)?n:null}).filter(e=>e!=null),fv=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},pv=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{jg(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function mv(e,t,n,{mark:r=!0}){let i=dv(t,e),a=r?pv(t,fv(i),new Set(i)):[],o=[],s=[];if(n){let e=dv(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);pv(t,fv(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(ov.get(e)||0)+1;ov.set(e,r),o.push(e),r===1&&n&&sv.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(cv.get(e)||0)+1;cv.set(e,t),s.push(e),t===1&&e.setAttribute(av,``)}),lv+=1,()=>{o.forEach(e=>{let t=(ov.get(e)||0)-1;ov.set(e,t),t||(sv.has(e)||e.removeAttribute(`aria-hidden`),sv.delete(e))}),r&&s.forEach(e=>{let t=(cv.get(e)||0)-1;cv.set(e,t),t||e.removeAttribute(av)}),--lv,lv||(ov=new WeakMap,sv=new WeakSet,cv=new WeakMap)}}function hv(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t;return mv(e,u_(e[0]).body,n,{mark:r})}var gv={style:{transition:`none`}},_v=`data-base-ui-click-trigger`,vv={fallbackAxisSide:`none`},yv={fallbackAxisSide:`end`},bv={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},xv=b.createContext(null),Sv=()=>b.useContext(xv),Cv=nv(`portal`);function wv(e={}){let{ref:t,container:n,componentProps:r=hh,elementProps:i}=e,a=B_(),o=Sv()?.portalNode,[s,c]=b.useState(null),[l,u]=b.useState(null),d=i_(e=>{e!==null&&u(e)}),f=b.useRef(null);J(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Pg(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=Nh(`div`,r,{ref:[t,d],props:[{id:a,[Cv]:``},i]}),m=s&&p?Q_.createPortal(p,s):null;return{node:l,nodeId:b.isValidElement(p)?p.props.id:void 0,subtree:m}}var Tv=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}=wv({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&&Z0(e)&&(e.type===`focusin`?v.current&&=($0(l),!1):(Q0(l),v.current=!0))}return U1(H1(l,`focusin`,e,!0),H1(l,`focusout`,e,!0))},[l,y]),J(()=>{l&&S===!0&&v.current&&($0(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)(xv.Provider,{value:w,children:[C&&l&&(0,x.jsx)(Y1,{"data-type":`outside`,ref:f,onFocus:e=>{Z0(e,l)?m.current?.focus():Y0(g?g.domReference:null)?.focus()}}),C&&l&&(0,x.jsx)(`span`,{role:s,"aria-owns":u,style:bv}),l&&Q_.createPortal(a,l),C&&l&&(0,x.jsx)(Y1,{"data-type":`outside`,ref:p,onFocus:e=>{Z0(e,l)?h.current?.focus():(J0(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,H_(`focus-out`,e.nativeEvent)))}})]})]})});function Ev(){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 Dv=class{nodesRef={current:[]};events=Ev();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)}},Ov=b.createContext(null),kv=b.createContext(null),Av=()=>b.useContext(Ov)?.id||null,jv=e=>{let t=b.useContext(kv);return e??t};function Mv(e){let t=B_(),n=jv(e),r=Av();return J(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Nv(e){let{children:t,id:n}=e,r=Av();return(0,x.jsx)(Ov.Provider,{value:b.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Pv(e){let{children:t,externalTree:n}=e,r=nh(()=>n??new Dv).current;return(0,x.jsx)(kv.Provider,{value:r,children:t})}function Fv(e,t){let n=Mg(_1(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(u1(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Iv=20,Lv=[];function Rv(){Lv=Lv.filter(e=>e.deref()?.isConnected)}function zv(e){Rv(),e&&jg(e)!==`body`&&(Lv.push(new WeakRef(e)),Lv.length>Iv&&(Lv=Lv.slice(-20)))}function Bv(){return Rv(),Lv[Lv.length-1]?.deref()}function Vv(e){return e?W0(e)?e:K0(e)[0]||e:null}function Hv(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=G0(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return W0(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 Uv(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=i_(()=>S.current.floatingContext?.nodeId),w=i===!1,T=A1(_)&&w,E=W1(i),D=W1(a),O=W1(o),k=W1(u),A=W1(g),j=jv(m),M=Sv(),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),V=rh(z,p,M?.beforeInsideRef),H=rh(B,M?.afterInsideRef),ee=s1(),te=s1(),ne=J_(),re=M!=null,ie=M1(v),ae=i_((e=ie)=>e?K0(e):[]),oe=i_(()=>h?.().filter(e=>e!=null)??[]);b.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&h1(ie,m1(u_(ie)))&&ae().length===0&&!T&&c1(e)}return H1(u_(ie),`keydown`,e)},[r,ie,c,T,ae]),b.useEffect(()=>{if(r||!g)return;let e=u_(ie);function t(){F.current=!1}function n(e){let t=_1(e),n=oe(),r=h1(v,t)||h1(_,t)||h1(M?.portalNode,t)||n.some(e=>e===t||h1(e,t));F.current=!r,R.current=e.pointerType||`keyboard`,g1(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,te.start(0,()=>{P.current=!1}))}function i(){R.current=`keyboard`}return U1(H1(e,`pointerdown`,n,!0),H1(e,`pointerup`,t,!0),H1(e,`pointercancel`,t,!0),H1(e,`keydown`,i,!0),t)},[r,v,_,ie,g,M,te,oe]),b.useEffect(()=>{if(r||!l)return;let e=u_(ie);function n(){P.current=!0,te.start(0,()=>{P.current=!1})}function i(e){let t=_1(e);W0(t)&&(I.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=_1(n);c&&r==null&&a!=null&&h1(v,a)&&zv(a),queueMicrotask(()=>{let o=C(),l=t.context.triggerElements,u=oe(),p=r?.hasAttribute(nv(`focus-guard`))&&[z.current,B.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,X_(f),X_(d)].includes(r),m=!(h1(_,r)||h1(v,r)||h1(r,v)||h1(M?.portalNode,r)||u.some(e=>e===r||h1(e,r))||l.hasMatchingElement(e=>h1(e,r))||p||j&&(ev(j.nodesRef.current,o).find(e=>h1(e.context?.elements.floating,r)||h1(e.context?.elements.domReference,r))||tv(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,M1(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&ie&&Hv(ie),s&&i!==_&&!A0(a)&&m1(e)===e.body){if(Ig(ie)&&(ie.focus(),s===`popup`)){ne.request(()=>{ie.focus()});return}let e=ae(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||ie;Ig(n)&&n.focus()}S.current.insideReactTree?S.current.insideReactTree=!1:(T||!c)&&r&&m&&!P.current&&(T||r!==Bv())&&(N.current=!0,t.setOpen(!1,H_(mg,n)))})}function o(){F.current||(S.current.insideReactTree=!0,ee.start(0,()=>{S.current.insideReactTree=!1}))}let u=Ig(_)?_:null;if(v||u)return U1(u&&H1(u,`focusout`,a),u&&H1(u,`pointerdown`,n),v&&H1(v,`focusin`,i),v&&H1(v,`focusout`,a),v&&M&&H1(v,`focusout`,o,!0))},[r,_,v,ie,c,j,M,t,l,s,ae,T,C,S,ee,te,ne,d,f,oe]),b.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${nv(`portal`)}]`)||[]),t=(j?tv(j.nodesRef.current,C()):[]).find(e=>A1(e.context?.elements.domReference||null))?.context?.elements.domReference,n=hv([v,...e,z.current,B.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...oe(),t,X_(f),X_(d),T?_:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),i=hv([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,M,T,j,C,d,f,oe]),J(()=>{if(!g||r||!Ig(ie))return;L.current=``,R.current=``;let e=u_(ie),t=m1(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||h1(ie,t))return;let i=null,a=()=>(i??=ae(ie),i[0]||ie),o;o=r===!0||r===null?a():X_(r),o||=a();let s=h1(ie,m1(e)),c=S.current.openEvent,l=c?.type===`mousedown`&&u1(c);iv(o,{sync:l,preventScroll:o===ie,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=m1(e);return!(t!==o&&h1(ie,t))}})})},[r,g,ie,ae,E,k,A,S]);let se=b.useRef(null);J(()=>{if(r||!ie){se.current=null;return}se.current&&=(se.current.cancelled=!0,null);let e=u_(ie),t=m1(e),n=k.current==null;zv(t);function i(e){if(e.open||(L.current=Fv(e.nativeEvent,R.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(nv(`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(u1(e.nativeEvent)||d1(e.nativeEvent))N.current=!1;else{let e=!1;u_(ie).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&&jg(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Bv()||null,typeof i==`boolean`?s:X_(i)||s||null}return()=>{y.off(`openchange`,i);let t=m1(e),n=oe(),r=h1(v,t)||n.some(e=>e===t||h1(e,t))||j&&ev(j.nodesRef.current,C(),!1).some(e=>h1(e.context?.elements.floating,t)),o=D.current,s=L.current,c=a(s),l={cancelled:!1};se.current=l,queueMicrotask(()=>{se.current===l&&(se.current=null);let n=Vv(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&Ig(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,ie,D,O,k,y,j,_,C,oe]),J(()=>{if(!E_||g||!v)return;let e=m1(u_(v));Ig(e)&&O1(e)&&h1(v,e)&&e.blur()},[g,v]),J(()=>{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,_]),J(()=>{if(!r&&ie)return Hv(ie),()=>{queueMicrotask(Rv)}},[r,ie]);let ce=!r&&(!c||!T)&&(re||c);return(0,x.jsxs)(b.Fragment,{children:[ce&&(0,x.jsx)(Y1,{"data-type":`inside`,ref:V,onFocus:e=>{if(c){let e=ae();iv(e[e.length-1])}else M?.portalNode&&(N.current=!1,Z0(e,M.portalNode)?J0(_)?.focus():X_(f??M.beforeOutsideRef)?.focus())}}),n,ce&&(0,x.jsx)(Y1,{"data-type":`inside`,ref:H,onFocus:e=>{c?iv(ae()[0]):M?.portalNode&&(l&&(N.current=!0),Z0(e,M.portalNode)?Y0(_)?.focus():X_(d??M.afterOutsideRef)?.focus())}})]})}function Wv(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=cg}=t,l=e.context.dataRef,u=b.useRef(void 0),d=J_(),f=s1(),p=b.useMemo(()=>{function t(t,n,r,i){let a=H_(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=f1(e.pointerType,!0)&&d1(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||f1(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=_1(s),p=O1(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:f1(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}:hh,[n,p])}function Gv(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 Kv(e){return e!=null&&e.clientX!=null}function qv(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=i_(t=>{e.set(`positionReference`,t)}),h=i_((t,n,i)=>{c.current||(!s.current.openEvent||Kv(s.current.openEvent))&&e.set(`positionReference`,Gv(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=i_(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=f1(u)?a:i;b.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=Mg(a);function r(t){let n=_1(t);h1(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||Kv(s.current.openEvent)?l.current=H1(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 Jv(){return!1}function Yv(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Xv(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Jv,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=jv(c),m=i_(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=i_(()=>a),{escapeKey:v,outsidePress:y}=Yv(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=s1(),k=s1(),A=s1(),j=i_(()=>{k.clear(),d.current.insideReactTree=!1}),M=i_(e=>{let t=d.current.floatingContext?.nodeId;return(p?ev(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=i_(t=>E1(t,e.select(`floatingElement`))||E1(t,e.select(`domReferenceElement`))),P=i_(t=>{o()&&e.setOpen(!1,H_(cg,t.nativeEvent))}),F=i_(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=l1(t)?t.nativeEvent:t;if(T.current||i.isComposing||!v&&M(`__escapeKeyBubbles`))return;let a=H_(hg,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),I=i_(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=i_(t=>{if(!l||!n||t.button!==0)return;let r=_1(t.nativeEvent);h1(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=i_(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 o1,i=u_(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(E_?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&&ev(p.nodesRef.current,t).some(t=>E1(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=`[${nv(`inert`)}]`,a=Fg(r)?r.getRootNode():null,o=Array.from((Lg(a)?a:u_(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>h1(e,r))))return;let c=Fg(r)?r:null;for(;c&&!Jg(c);){let e=Zg(c);if(Jg(e)||!Fg(e))break;c=e}if(!(o.length&&Fg(r)&&!D1(r)&&!h1(r,e.select(`floatingElement`))&&o.every(e=>!h1(c,e)))){if(Ig(r)&&!(`touches`in n)){let e=Jg(r),t=Yg(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&&!u1(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof h==`function`&&!h(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,H_(dg,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=H1(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 V(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 H(e){L(e,V)}function ee(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function te(e){L(e,ee)}let ne=U1(r&&U1(H1(i,`keydown`,F),H1(i,`compositionstart`,a),H1(i,`compositionend`,o)),g&&U1(H1(i,`click`,z,!0),H1(i,`pointerdown`,z,!0),H1(i,`pointerup`,B,!0),H1(i,`pointercancel`,B,!0),H1(i,`mousedown`,z,!0),H1(i,`mouseup`,B,!0),H1(i,`touchstart`,R,{capture:!0,passive:!0}),H1(i,`touchmove`,H,{capture:!0,passive:!0}),H1(i,`touchend`,te,{capture:!0,passive:!0})));return()=>{ne(),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 Zv(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),J(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Fg(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 Qv(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=i_(i),{mounted:c,setMounted:l,transitionStatus:u}=Y_(t,!1,!1,o),d=!t&&r;J(()=>{t&&s(!1)},[t,s]);let f=b.useRef(c),p=b.useRef(!1),m=I_(),h=()=>{f.current=!1,l(!1),a()};J(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=i_(()=>{f.current&&(t?(p.current=!0,m()):h())});return n1({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var $v={tabIndex:-1,[v1]:``};function ey(e){return t=>t!==`touch`||e.current}function ty(e,t=!1){let n=B_(),r=Av()!=null,i=nh(()=>e(n,r)).current;return Zv({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function ny({handle:e,store:t}){return J(()=>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 iy(e,t){let n=b.useRef(null);return i_(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 ay(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 oy(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function sy(e,t,n,r={}){let i=n.reason,a=i===lg,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=oy(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=ay(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?Q_.flushSync(l):l()}function cy(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=iy(e,n),o=i_(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=i_(e=>{a(e),e&&o(e)});return J(()=>(s(t.current),()=>s(null)),[s,t,n,e]),J(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function ly(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=b.useRef(null),i=e.useState(`open`);J(()=>{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=H_(sg);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 uy(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Qv({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 nh(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function dy(e,t){e.useSyncedValues(t),J(()=>()=>{e.update({activeTriggerProps:hh,inactiveTriggerProps:hh,popupProps:hh})},[e])}function fy(e,t){J(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),J(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var py=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}},my=[],hy=void 0;function gy(){return hy}function _y(e){my.push(e)}function vy(e){let t=(t,n)=>{let r=nh(by).current,i;try{hy=r;for(let e of my)e.before(r);i=e(t,n);for(let e of my)e.after(r);r.didInitialize=!0}finally{hy=void 0}return i};return t.displayName=e.displayName||e.name,t}function yy(e){return b.forwardRef(vy(e))}function by(){return{didInitialize:!1}}var xy=Li(),Sy=uh(19)?Ty:Ey;function Cy(e,t,n,r,i){return Sy(e,t,n,r,i)}function wy(e,t,n,r,i){let a=b.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,xy.useSyncExternalStore)(e.subscribe,a,a)}_y({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,xy.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ty(e,t,n,r,i){let a=gy();if(!a)return wy(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 Ey(e,t,n,r,i){return(0,zi.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Dy=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 Cy(this,e,t,n,r)}},Oy=class extends Dy{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){b.useDebugValue(e);let n=this;J(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;J(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;J(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){b.useDebugValue(e);let n=this,r=t!==void 0;J(()=>{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),Cy(this,this.selectors[e],t,n,r)}useContextCallback(e,t){b.useDebugValue(e);let n=i_(t??ph);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)}})}},ky={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},Ay=class extends Oy{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:Ev(),nested:n,triggerElements:i},ky),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&p1(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 jy(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Ay({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:hh,inactiveTriggerProps:hh,popupProps:hh}}var My=e=>e.triggerIdProp??e.activeTriggerId,Ny=e=>e.openProp??e.open,Py=e=>(e.popupElement?.id??e.floatingId)||void 0;function Fy(e,t){return t!==void 0&&Ny(e)&&My(e)===t}function Iy(e,t){return Fy(e,t)?!0:t!==void 0&&Ny(e)&&My(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Ly={open:Ny,mounted:e=>e.mounted,transitionStatus:e=>Ny(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:My,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Py,isTriggerActive:(e,t)=>t!==void 0&&My(e)===t,isOpenedByTrigger:(e,t)=>Fy(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&My(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Iy(e,t)?Py(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Ry(e){let t=b.useCallback(t=>e===void 0?ph:e.subscribeStore(t),[e]),n=b.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,xy.useSyncExternalStore)(t,n,()=>e?.serverStore)}function zy(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=B_(),a=Av()!=null,o=nh(()=>new Ay({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new py,floatingId:i,syncOnly:!1,nested:a})).current;return J(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Fg(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 By=w_&&E_;function Vy(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=s1();b.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Mg(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&Ig(t)&&t===m1(u_(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return U1(H1(r,`blur`,i),By&&H1(r,`keydown`,a,!0),By&&H1(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`);Fg(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(Fg(a)){if(By&&!n.relatedTarget){if(!c.current&&!O1(a))return}else if(!j1(a))return}let u=T1(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,H_(ug,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,H_(ug,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=Fg(r)&&r.hasAttribute(nv(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=m1(u_(t));!r&&n===t||h1(a.current.floatingContext?.refs.floating.current,n)||h1(t,n)||o||T1(r??n,e.context.triggerElements)||e.setOpen(!1,H_(ug,i))})}}},[a,r,e,l]);return b.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var Hy=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new o1;restTimeout=new o1;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Uy=new WeakMap;function Wy(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Uy.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Uy.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Gy(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Uy.get(n);a&&a!==e&&Wy(a),Wy(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Uy.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Ky(e){let t=e.context.dataRef.current,n=nh(()=>t.hoverInteractionState??Hy.create()).current;return t.hoverInteractionState||=n,W_(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function qy(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=jv(),u=Av(),d=Ky(e),f=s1(),p=i_(()=>I1(c.current.openEvent?.type,d.interactedInside)),m=i_(()=>L1(c.current.openEvent?.type)),h=i_(()=>{Wy(d)});J(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),b.useEffect(()=>h,[h]),J(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&Fg(s)&&o){let e=s,t=o,n=u_(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??g1(e,`[data-rootownerid]`)??n.body;return Gy(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&&ev(l.nodesRef.current,u).length>0)}function a(t){let n=P1(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,H_(lg,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=_1(e);k1(t)?d.interactedInside=g1(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(T1(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&Fg(o)&&ev(l.nodesRef.current,r,!1).some(e=>h1(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,H_(lg,n)),l.events.emit(`floating.closed`,n)})}let y=o;return U1(y&&H1(y,`mouseenter`,g),y&&H1(y,`mouseleave`,_),y&&H1(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var Jy={current:null};function Yy(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Jy,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=jv(l),v=Ky(e),y=b.useRef(!1),x=W1(i),S=W1(r),C=W1(o),w=W1(n),T=W1(p),E=W1(f),D=i_(()=>I1(h.current.openEvent?.type,v.interactedInside)),O=i_(()=>T.current?.()!==!1),k=i_((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!h1(t,n);if(!Fg(r))return!1;let a=r;return i.hasMatchingElement(e=>h1(e,a))&&(!t||!h1(t,a))}),A=i_(()=>{v.handler&&=(u_(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),j=i_(()=>{Wy(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===lg,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=P1(S.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,H_(lg,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,H_(lg,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!Fg(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!f1(v.pointerType))return;let n=F1(C.current),r=P1(S.current,`open`,v.pointerType),i=_1(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(Fg(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(h1(t,i)){c=t;break}}Fg(o)&&Fg(s)&&!e.context.triggerElements.hasElement(o)&&h1(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&&Fg(c)&&Fg(s)&&h1(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,H_(lg,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,H_(lg,t,c))}):g&&O()&&e.setOpen(!0,H_(lg,t,c)))}function o(n){if(D()){j();return}A();let r=u_(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!T1(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`&&h1(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){h1(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?H1(r,`mouseout`,l):void 0;return s?U1(H1(r,`mousemove`,i,{once:!0}),H1(r,`mouseenter`,i),H1(r,`mouseleave`,o),f):U1(H1(r,`mouseenter`,i),H1(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&&!f1(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;Gy(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=F1(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,H_(lg,n,r))}v.pointerType===`touch`?Q_.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,D,k,a,e,C,O])}function Xy(e){return E_&&e.movementX===0&&e.movementY===0}function Zy(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Qy(e,t){return Zy(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function $y(e,t,n){return Zy(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function e2(e,t,n){return Zy(t,n?e===b1:e===x1,e===C1)}function t2(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Zy(t,n?e===x1:e===b1,e===S1)}function n2(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=M1(D),j=A1(O),M=W1(A),N=Av(),P=jv(S),F=b.useRef(f),I=b.useRef(o??-1),L=b.useRef(null),R=b.useRef(!0),z=i_(e=>{i(I.current===-1?null:I.current,e)}),B=b.useRef(!!D),V=b.useRef(E),H=b.useRef(!1),ee=b.useRef(!1),te=b.useRef(null),ne=W1(h),re=W1(E),ie=W1(o),ae=W1(x),oe=J_(),se=J_(),ce=i_(()=>{oe.cancel();function e(e){d||(te.current=iv(e,{sync:H.current,preventScroll:!0}))}let t=n.current[I.current],r=ee.current;t&&e(t),(H.current?e=>e():e=>oe.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),me&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});J(()=>{k.current.orientation=g},[k,g]),J(()=>{E||(L.current=null),E&&f===`auto`||(F.current=f)},[E,f]),J(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(ee.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),J(()=>{if(a){if(!E)H.current=!1;else if(D){if(r==null){if(H.current=!1,ie.current!=null)return;if(B.current&&(I.current=-1,ce()),(!V.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=>se.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||$y(L.current,_,u)||l?w0(n):T0(n),L.current=null,z())};t()}}else C0(n.current,r)||(I.current=r,ce(),ee.current=!1)}}},[a,E,D,r,ie,l,n,_,u,z,ce,se]),J(()=>{if(!a||D||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=m1(u_(O??t??null)),r=e.some(e=>e.context&&h1(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),J(()=>{V.current=E,B.current=!!D});let le=r!=null,ue=i_(e=>{if(!re.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),de=i_(()=>v??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),fe=i_(()=>w0(n,ne.current)),pe=i_(t=>{if(R.current=!1,H.current=!0,t.which===229||!re.current&&t.currentTarget===M.current)return;if(l&&t2(t.key,g,u,T)){Qy(t.key,de())||c1(t),e.setOpen(!1,H_(gg,t.nativeEvent));let n=C?.current??O;Ig(n)&&n.focus();return}r!=null&&r!==I.current&&!C0(n.current,r)&&(I.current=r);let i=I.current,a=w0(n,h),o=T0(n,h);if(j||(t.key===`Home`&&(c1(t),I.current=a,z(t)),t.key===`End`&&(c1(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(Qy(t.key,g)){c1(t);let e=m1(t.currentTarget.ownerDocument);if(E&&!d&&h1(t.currentTarget,e)&&!n.current.some(t=>t!=null&&h1(t,e))){I.current=$y(t.key,g,u)?a:o,z(t),r===I.current&&ce();return}let{index:l,wrapped:f}=E0(n.current,i,{decrement:!$y(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(H.current=!1),I.current=l,z(t)}}),me=b.useMemo(()=>({onFocus(e){H.current=!0,ue(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Xy(e)||(H.current=!0,ee.current=!1,p&&ue(e))},onPointerLeave(e){if(!re.current||!R.current||e.pointerType===`touch`)return;H.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ae.current&&(te.current?.(),te.current=null,I.current=-1,z(e),!d)){let e=M.current,t=m1(u_(e));e&&h1(e,t)&&e.focus({preventScroll:!0})}}}),[ue,re,M,p,n,z,ae,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&&!h1(M.current,n))return;c1(t);let r=H_(mg,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&Ig(i)&&i.focus()}else pe(t)},onPointerMove(e){Xy(e)||(R.current=!0)}}),[he,pe,M,j,e,E,d,O,C]),_e=b.useMemo(()=>{function t(t){e.setOpen(!0,H_(gg,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&u1(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&d1(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=e2(n.key,de(),u),o=Qy(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||O1(n.currentTarget)))return pe(n);if(r||m||!i){if(s){let e=Qy(n.key,de());L.current=l&&e?null:n.key}l?a&&(c1(n),r?(I.current=fe(),z(n),d&&M.current?.focus()):t(n)):o&&(ie.current!=null&&(I.current=ie.current),c1(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,ie,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 r2(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=i_(s),f=e.useState(`open`),p=s1(),m=b.useRef(``),h=b.useRef(u??i??-1),g=b.useRef(null),_=i_(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!A0(n)||n?.matches(`:disabled`)?!1:o==null||!O0(mh,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===` `&&(c1(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!==` `&&(c1(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=i_(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);h1(r,n)||h1(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});J(()=>{(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 i2=.1,a2=i2*i2,o2=.5;function s2(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function c2(e,t,n,r,i,a,o,s,c,l){let u=!1;return s2(e,t,n,r,i,a)&&(u=!u),s2(e,t,i,a,o,s)&&(u=!u),s2(e,t,o,s,c,l)&&(u=!u),s2(e,t,c,l,n,r)&&(u=!u),u}function l2(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function u2(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 d2(e={}){let{blockPointerEvents:t=!1}=e,n=new o1,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*a2;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`,_=h1(u,h),v=h1(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Fg(r.relatedTarget)&&h1(u,r.relatedTarget))return;function y(){return!!(s&&ev(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=u2(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=u2(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=u2(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=u2(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!l2(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?o2/2:o2*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+o2+1,o=C||T?S.bottom-o2:S.top,s=C?T?S.bottom-o2:S.top:S.bottom-o2;M=c2(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?o2/2:o2*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-o2,o=C||T?S.top+o2:S.bottom,s=C?T?S.top+o2:S.bottom:S.top+o2;M=c2(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?o2/2:o2*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+o2+1,o=w||E?S.right-o2:S.left,s=w?E?S.right-o2:S.left:S.right-o2;M=c2(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?o2/2:o2*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-o2,o=w||E?S.left+o2:S.right,s=w?E?S.left+o2:S.right:S.left+o2;M=c2(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 f2(e,t,n){let{reference:r,floating:i}=e,a=c0(t),o=l0(t),s=s0(o),c=i0(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=a0(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function p2(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}=r0(t,e),p=x0(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=S0(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=S0(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 m2=50,h2=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:p2},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=f2(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<m2&&(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}=f2(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}=r0(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=i0(r),_=c0(o),v=i0(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[y0(o)]:d0(o)),x=p!==`none`;!d&&x&&b.push(...v0(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=u0(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`||_===c0(t)||T.every(e=>c0(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=c0(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{}}}},_2=new Set([`left`,`top`]);async function v2(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=i0(n),s=a0(n),c=c0(n)===`y`,l=_2.has(o)?-1:1,u=a&&c?-1:1,d=r0(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 y2=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 v2(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}}}}},b2=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}=r0(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=c0(i),p=o0(f),m=u[p],h=u[f],g=(e,t)=>n0(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}=r0(e,t),u={x:n,y:r},d=c0(i),f=o0(d),p=u[f],m=u[d],h=r0(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=_2.has(i0(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}}}},S2=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}=r0(e,t),c=await i.detectOverflow(t,s),l=i0(n),u=a0(n),d=c0(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=X1(p-c[m],g),y=X1(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*Z1(c.left,c.right):S=p-2*Z1(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 C2(e){let t=Yg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ig(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Q1(n)!==a||Q1(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function w2(e){return Fg(e)?e:e.contextElement}function T2(e){let t=w2(e);if(!Ig(t))return e0(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=C2(t),o=(a?Q1(n.width):n.width)/r,s=(a?Q1(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var E2=e0(0);function D2(e){let t=Mg(e);return!qg()||!t.visualViewport?E2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function O2(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Mg(e)}function k2(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=w2(e),o=e0(1);t&&(r?Fg(r)&&(o=T2(r)):o=T2(e));let s=O2(a,n,r)?D2(a):e0(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=Mg(a),t=Fg(r)?Mg(r):r,n=e,i=e_(n);for(;i&&t!==n;){let e=T2(i),t=i.getBoundingClientRect(),r=Yg(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=Mg(i),i=e_(n)}}return S0({width:u,height:d,x:c,y:l})}function A2(e,t){let n=Xg(e).scrollLeft;return t?t.left+n:k2(Ng(e)).left+n}function j2(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-A2(e,n),y:n.top+t.scrollTop}}function M2(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ng(r),s=t?Bg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=e0(1),u=e0(0),d=Ig(r);if((d||!a)&&((jg(r)!==`body`||Rg(o))&&(c=Xg(r)),d)){let e=k2(r);l=T2(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?j2(o,c):e0(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 N2(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function P2(e){let t=Xg(e),n=e.ownerDocument.body,r=Z1(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Z1(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+A2(e),o=-t.scrollTop;return Yg(n).direction===`rtl`&&(a+=Z1(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var F2=25;function I2(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Mg(e),a=Ng(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!qg()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(A2(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<=F2&&(s-=o)}return{width:s,height:c,x:l,y:u}}function L2(e,t){let n=k2(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=T2(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function R2(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=I2(e,n,t);else if(t===`document`)r=P2(Ng(e));else if(Fg(t))r=L2(t,n);else{let n=D2(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return S0(r)}function z2(e,t){let n=t.get(e);if(n)return n;let r=$g(e,[],!1).filter(e=>Fg(e)&&jg(e)!==`body`),i=null,a=Yg(e).position===`fixed`,o=a?Zg(e):e;for(;Fg(o)&&!Jg(o);){let e=Yg(o),t=Gg(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Zg(o)}return t.set(e,r),r}function B2(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Bg(t)?[]:z2(t,this._c):[].concat(n),r],o=R2(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=R2(t,a[e],i);s=Z1(n.top,s),c=X1(n.right,c),l=X1(n.bottom,l),u=Z1(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function V2(e){let{width:t,height:n}=C2(e);return{width:t,height:n}}function H2(e,t,n){let r=Ig(t),i=Ng(t),a=n===`fixed`,o=k2(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=e0(0);if((r||!a)&&((jg(t)!==`body`||Rg(i))&&(s=Xg(t)),r)){let e=k2(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=A2(i));let l=i&&!r&&!a?j2(i,s):e0(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 U2(e){return Yg(e).position===`static`}function W2(e,t){if(!Ig(e)||Yg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ng(e)===n&&(n=n.ownerDocument.body),n}function G2(e,t){let n=Mg(e);if(Bg(e))return n;if(!Ig(e)){let t=Zg(e);for(;t&&!Jg(t);){if(Fg(t)&&!U2(t))return t;t=Zg(t)}return n}let r=W2(e,t);for(;r&&zg(r)&&U2(r);)r=W2(r,t);return r&&Jg(r)&&U2(r)&&!Gg(r)?n:r||Kg(e)||n}var K2=async function(e){let t=this.getOffsetParent||G2,n=await(0,this.getDimensions)(e.floating);return{reference:H2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function q2(e){return Yg(e).direction===`rtl`}var J2={convertOffsetParentRelativeRectToViewportRelativeRect:M2,getDocumentElement:Ng,getClippingRect:B2,getOffsetParent:G2,getElementRects:K2,getClientRects:N2,getDimensions:V2,getScale:T2,isElement:Fg,isRTL:q2};function Y2(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function X2(e,t,n){let r=null,i,a=Ng(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=$1(d),h=$1(a.clientWidth-(u+f)),g=$1(a.clientHeight-(d+p)),_=$1(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Z1(0,X1(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Y2(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=Mg(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Z2(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=w2(e),u=i||a?[...l?$g(l):[],...t?$g(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?X2(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?k2(e):null;c&&g();function g(){let t=k2(e);h&&!Y2(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 Q2=y2,$2=b2,e4=g2,t4=S2,n4=x2,r4=(e,t,n)=>{let r=new Map,i=n??{},a={...J2,...i.platform,_c:r};return h2(e,t,{...i,platform:a})},i4=typeof document<`u`?b.useLayoutEffect:function(){};function a4(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(!a4(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)&&!a4(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function o4(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s4(e,t){let n=o4(e);return Math.round(t*n)/n}function c4(e){let t=b.useRef(e);return i4(()=>{t.current=e}),t}function l4(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);a4(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=c4(c),O=c4(i),k=c4(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),r4(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!a4(T.current,t)&&(T.current=t,Q_.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);i4(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=b.useRef(!1);i4(()=>(j.current=!0,()=>{j.current=!1}),[]),i4(()=>{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=s4(N.floating,u.x),r=s4(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...o4(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 u4=(e,t)=>{let n=Q2(e);return{name:n.name,fn:n.fn,options:[e,t]}},d4=(e,t)=>{let n=$2(e);return{name:n.name,fn:n.fn,options:[e,t]}},f4=(e,t)=>({fn:n4(e).fn,options:[e,t]}),p4=(e,t)=>{let n=e4(e);return{name:n.name,fn:n.fn,options:[e,t]}},m4=(e,t)=>{let n=t4(e);return{name:n.name,fn:n.fn,options:[e,t]}},h4=b.createContext(void 0);function g4(e){let t=b.useContext(h4);if(t===void 0&&!e)throw Error(Xm(69));return t}var _4=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function v4(e){return e===`starting`?gv:hh}var y4=b.createContext(void 0);function b4(){return b.useContext(y4)}function x4(e,t){let n=Lh(e.render);if(b.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function S4(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 C4(e,t,n){let r=Lh(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 w4=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}=eh(),m=b4(),{side:h,align:g}=Qm(),_=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]=S4(e,u,d),z=C4(e,T,F),B=E.type===`menu`?m:void 0,V=E.type===`context-menu`,H=s??E.type!==`menu`;s===void 0&&I&&E.type!==`menu`&&(H=()=>l.state.activeIndex===null&&I),n1({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),b.useEffect(()=>{function e(e){l.setOpen(!1,H_(e.reason,e.domEvent))}return A.events.on(`close`,e),()=>{A.events.off(`close`,e)}},[A.events,l]),qy(k,{enabled:M&&!N&&!V&&E.type!==`menubar`,closeDelay:j});let ee=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:te,handleFocus:ne}=(b.useContext(Tg)?.useParentHandoff??E4)(l,E,v,f),re=Nh(`div`,e,{state:{transitionStatus:y,side:h,align:g,open:v,nested:E.type===`menu`,instant:w},ref:[t,l.context.popupRef,ee,R],stateAttributesMapping:ig,props:[S,{id:L,...I?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":z},onKeyDown(e){B?.onPopupKeyDown?.(e),_&&_4.has(e.key)&&e.stopPropagation()},onFocus:ne},v4(y),c,{"data-rootownerid":O}]}),ie=E.type===void 0||V;(T||E.type===`menubar`&&D!==`outside-press`)&&(ie=!0);let ae=B?.getReturnElement??te;return(0,x.jsx)(Uv,{context:k,openInteractionType:P,modal:V,disabled:!C,returnFocus:a??ae??ie,explicitReturnFocus:a===void 0&&ae?!1:void 0,initialFocus:H,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:re})}),T4={parentVirtualFocusRef:void 0,handleFocus:void 0};function E4(){return T4}var D4=b.forwardRef(function(e,t){let n=Eg()?.Popup??w4;return(0,x.jsx)(n,{...e,ref:t})}),O4=b.createContext(void 0);function k4(){let e=b.useContext(O4);if(e===void 0)throw Error(Xm(32));return e}var A4=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=eh();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,x.jsx)(O4.Provider,{value:n,children:(0,x.jsx)(Tv,{ref:t,...r,portalOwnerRole:o})})});function j4(e){return uh(19)?e:e?`true`:void 0}function M4(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=jv(n),p=b.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=l4({...e,elements:{...p,...l&&{reference:l}}}),h=b.useCallback(e=>{let t=Fg(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 J(()=>{o&&(d.current=o)},[o]),J(()=>{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 N4=b.createContext(void 0);function P4(){return b.useContext(N4)?.direction??`ltr`}var F4=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}=r0(e,t)||{};if(l==null)return{};let d=x0(u),f={x:n,y:r},p=l0(i),m=s0(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=n0(D,k,O),j=!c.arrow&&a0(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}}}),I4=(e,t)=>{let{name:n,fn:r}=F4(e);return{name:n,fn:r,options:[e,t]}},L4={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}}}},R4={sideX:`left`,sideY:`top`},z4=`--available-width`,B4=`--available-height`,V4=`--anchor-width`,H4=`--anchor-height`,U4=`--transform-origin`,W4=z4,G4=B4;function K4(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 q4(e,t,n){let{rects:r,placement:i}=e;return{side:K4(t,i0(i),n),align:a0(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function J4(e){return Y4(e,M4)}function Y4(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=i_(k),j=k?A:n,M=W1(n),N=W1(g),P=P4()===`rtl`,[F,I]=b.useState(null);!g&&F!==null&&I(null);let L=S===`placement`,R=F?i0(F):null,z=F&&L?a0(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],V=z||o,H=V===`center`?B:`${B}-${V}`,ee=l;typeof ee==`number`?ee={top:ee,right:ee,bottom:ee,left:ee}:ee&&={top:ee.top||0,right:ee.right||0,bottom:ee.bottom||0,left:ee.left||0};let te=+(i===`bottom`),ne=+(i===`top`),re=+(i===`right`),ie=+(i===`left`),ae={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:ee},oe=b.useRef(null),se=W1(a),ce=W1(s),le=typeof a==`function`?0:a,ue=typeof s==`function`?0:s,de=[];p&&de.push(p),de.push(u4(e=>{let t=q4(e,i,P),n=typeof se.current==`function`?se.current(t):se.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:p4({...ae,padding:{top:ee.top+1+te,right:ee.right+1+ie,bottom:ee.bottom+1+ne,left:ee.left+1+re},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),he=fe?null:d4({...ae,rootBoundary:O,mainAxis:T!==`none`,crossAxis:pe,limiter:u||D?void 0:f4(e=>{if(!oe.current)return{};let{width:t,height:n}=oe.current.getBoundingClientRect(),r=c0(i0(e.placement)),i=r===`y`?t:n,a=r===`y`?ee.left+ee.right:ee.top+ee.bottom;return{offset:i/2+a/2}})},[ae,u,D,O,ee,T]);w===`shift`||T===`shift`||V===`center`?de.push(he,me):de.push(me,he),de.push(m4({...ae,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(W4,`${t}px`),i.setProperty(G4,`${n}px`);let a=Mg(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(V4,`${u}px`),i.setProperty(H4,`${d}px`)}}),I4(e=>({element:oe.current||u_(e.elements.floating).createElement(`div`),padding:oe.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=i0(r),u=a0(r),d=c0(l)===`y`,f=oe.current,p=typeof a==`function`?a(q4(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(U4,d?`${m} ${h}`:`${h} ${m}`),{}}},L4,x),J(()=>{!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:H,middleware:de,strategy:r,whileElementsMounted:m?void 0:(...e)=>Z2(...e,ge),nodeId:y,externalTree:C}),{sideX:De,sideY:Oe}=xe.adaptiveOrigin||R4,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[W4]=`100vw`,e[G4]=`100vh`,Te||(e.opacity=0),e},[x,ke,De,ye,Oe,be,Ee,Te]),je=b.useRef(null);J(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(X4(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`&&X4(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 Z2(ve.reference,ve.floating,Se,ge)},[m,g,ve,Se,ge]);let Me=i0(Ce),Ne=K4(i,Me,P),Pe=a0(Ce)||`center`,Fe=!!xe.hide?.referenceHidden;J(()=>{S&&g&&Te&&(Me!==B||L&&Pe!==V)&&I(Ce)},[S,L,g,Te,Ce,Me,Pe,B,V]);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:oe,arrowUncentered:Le,side:Ne,align:Pe,physicalSide:Me,anchorHidden:Fe,refs:_e,context:we,isPositioned:Te,update:Se}),[Ae,Ie,oe,Le,Ne,Pe,Me,Fe,_e,we,Te,Se])}function X4(e){return e!=null&&`current`in e}function Z4(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=i_(i),[,o]=b.useState(0),s=nh($4).current,c=nh(Q4).current,l=b.useRef(0),u=b.useRef(!0),d=b.useRef(null),f=b.useRef(null),p=i_(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=i_((e,t)=>{c.set(e,t),p()}),h=i_(e=>{c.delete(e),p()}),g=i_(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(!n3(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&r3(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=t3(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=i_(()=>{let[e,t]=e3(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))});J(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),J(()=>{u.current&&v()}),J(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=i_(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)(N_.Provider,{value:S,children:t})}function Q4(){return new Map}function $4(){return new Set}function e3(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)=>r3(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 t3(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function n3(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 r3(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var i3=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 a3(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=b.useRef(null),o=b.useRef(null),s=t1(r);J(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),J(()=>{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 o3(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Nh(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},v4(r),i],stateAttributesMapping:rg})}var s3={},c3={},l3=``;function u3(e,t){return Rg(e)?e:t}function d3(e,t,n){return/hidden|clip/.test(e.getComputedStyle(u3(t,n)).overflowY)}function f3(e){if(typeof document>`u`)return!1;let t=u_(e);return Mg(t).innerWidth-t.documentElement.clientWidth>0}function p3(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=u_(e),n=t.documentElement,r=u3(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 m3(e){let t=u_(e),n=u3(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 h3(e){let t=u_(e),n=t.documentElement,r=t.body,i=Mg(n),a=0,o=0,s=!1,c=q_.create();if(E_&&(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,s3={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},l3=n.style.scrollBehavior,c3={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=u3(n,r);s=p3(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,s3),Object.assign(r.style,c3),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=l3)}function d(){u(),c.request(l)}l();let f=H1(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var g3=new class{lockCount=0;restore=null;timeoutLock=o1.create();timeoutUnlock=o1.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=u_(e),n=t.documentElement,r=t.body,i=Mg(n);if(d3(i,n,r)){let t=new i.MutationObserver(()=>{d3(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=x_||!f3(e);this.restore=a?m3(e):h3(e)}};function _3(e=!0,t=null){J(()=>{if(e)return g3.acquire(t)},[e,t])}var v3=20;function y3(e,t,n,r){let[i,a]=b.useState(!1);J(()=>{if(!e||!t||n==null){a(!1);return}let r=u_(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-v3)},[e,t,n]),_3(e&&(!t||i),r)}var b3=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=vv,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:S}=eh(),C=k4(),w=og(!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`),V=n,H=c,ee=l,te=s,ne=h;T.type===`context-menu`&&(V=n??T.context?.anchor,te??=`start`,!o&&te!==`center`&&(ee=e.alignOffset??2,H=e.sideOffset??-5));let re=o,ie=te;T.type===`menu`?(re??=`inline-end`,ie??=`start`,ne=e.collisionAvoidance??yv):T.type===`menubar`&&(re??=T.context.orientation===`vertical`?`inline-end`:`bottom`,ie??=`start`);let ae=T.type===`context-menu`,oe=J4({anchor:V,floatingRootContext:E,positionMethod:w?`fixed`:r,mounted:O,side:re,sideOffset:H,align:ie,alignOffset:ee,arrowPadding:ae?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:R,keepMounted:C,disableAnchorTracking:m,collisionAvoidance:ne,shift:ae?{crossAxis:!(`side`in ne&&ne.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,H_(bg)))}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,H_(t))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[D.events,v]);let se=s1();b.useEffect(()=>{k||se.clear()},[k,se]),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?se.isStarted()||se.start(e,()=>{v.setOpen(!1,H_(bg))}):v.setOpen(!1,H_(bg))}else se.clear()}}return D.events.on(`itemhover`,e),()=>{D.events.off(`itemhover`,e)}},[D.events,k,M,v,se]),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]),a3({store:v,domReference:B,positionerElement:P,open:k});let ce={open:k,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,nested:T.type===`menu`,instant:F},le=T.type===`menubar`&&T.context.modal;y3(k&&(le||A&&L!==`trigger-hover`),j===`touch`,P,M);let ue=o3(e,ce,{styles:oe.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)(Zm.Provider,{value:oe,children:[de&&(0,x.jsx)(i3,{ref:T.type===`context-menu`||T.type===`nested-context-menu`?T.context.internalBackdropRef:null,inert:j4(!k),cutout:fe}),(0,x.jsx)(Nv,{id:R,children:(0,x.jsx)(Z4,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:S,children:ue})})]})}),x3=b.createContext(null);function S3(e){let t=b.useContext(x3);if(t===null&&!e)throw Error(Xm(5));return t}function C3(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 w3(e,t){let n=b.useRef(e),r=i_(t);J(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function T3(e,t){let{onClick:n,onPointerDown:r}=C3(i_((n,r)=>{(typeof e==`function`?e():e)||t(r||(x_?`touch`:``))}));return b.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function E3(e){let[t,n]=b.useState(null),r=T3(e,n);return w3(e,t=>{t&&!e&&n(null)}),b.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function D3(e){return e==null?sg:e.type.startsWith(`key`)?_g:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?vg:sg}var O3={...Ly,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=Ly.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>E_&&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`&&!Ly.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`)}},k3=class extends Oy{constructor(e,t,n=!1){let r=new py,i=j3(r,t,n,e);super(i,A3(r),O3),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 A3(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 j3(e,t,n=!1,r){return{...jy(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:hh,inputProps:hh,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Dv,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:hh,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var M3=b.createContext(null);function N3(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function P3(e,t){return e===`list-navigation`||N3(e,t)}var F3=vy(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=og(!0),T=eh(!0),E=S3(!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=V_(),j=V_(),[M,N]=b.useState(void 0),P=(M??j)||void 0,F=Av(),I=k.type===`menu`?k.store:void 0,L=(n??o)&&I?.state.transitionStatus===`starting`,R=nh(()=>L?I?.state.instantType:void 0).current,z=nh(()=>{let e=new k3({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`),V=Mv(B),H=z.useState(`open`),ee=z.useState(`activeTriggerElement`),te=z.useState(`positionerElement`),ne=z.useState(`hoverEnabled`),re=z.useState(`disabled`),ie=z.useState(`lastOpenChangeReason`),ae=z.useState(`parent`),oe=z.useState(`activeIndex`),se=z.useState(`keyboardOpen`),ce=z.useState(`payload`),le=z.useState(`floatingParentNodeId`),ue=b.useRef(null),de=b.useRef(ae.type!==`context-menu`),fe=s1(),pe=b.useRef(!0),me=s1(),he=le!=null,{openMethod:ge,triggerProps:_e}=E3(H);z.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:ae.type===void 0?c:void 0,openMethod:ge,rootId:A}),ly(z);let{forceUnmount:ve,transitionStatus:ye}=uy(H,z,()=>{z.set(`allowMouseEnter`,!1)},L),be=t1(z.context.popupRef);b.useEffect(()=>{if(R===void 0)return;let e=()=>{z.state.instantType===R&&z.set(`instantType`,void 0)};if(!H){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,H,ye,be,z]),J(()=>{w&&!T?z.update({parent:{type:`context-menu`,context:w},floatingNodeId:V,floatingParentNodeId:F}):(T||!z.select(`activeTriggerElement`))&&z.update({floatingNodeId:V,floatingParentNodeId:F})},[w,T,V,F,ee,z]),b.useEffect(()=>{H||(ue.current=null),ae.type===`context-menu`&&(H?fe.start(500,()=>{de.current=!0}):(fe.clear(),de.current=!1))},[fe,H,ae.type]),J(()=>{!H&&!ne&&z.set(`hoverEnabled`,!0)},[H,ne,z]);let xe=i_((e,t)=>{let n=t.reason;if(!e&&!z.select(`open`)||H===e&&t.trigger===ee&&ie===n)return;let i=oy(t);if(!e&&t.trigger==null&&(t.trigger=ee??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=ay(z.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&P3(n,a),s.instantType=ae.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:N3(n,a)?`click`:o?`dismiss`:void 0,z.update(s)}),Se=Zv({popupStore:z,floatingRootContext:z.state.floatingRootContext,floatingId:P,nested:F!=null,onOpenChange:xe}),Ce=Se.context.events;J(()=>{let e=({open:e,eventDetails:t})=>xe(e,t);return Ce.on(`setOpen`,e),()=>{Ce?.off(`setOpen`,e)}},[Ce,xe]),J(()=>z.subscribeToParentMenu(),[z]);let we=b.useCallback(()=>{z.setOpen(!1,H_(Sg))},[z]);b.useImperativeHandle(d,()=>({unmount:ve,close:we}),[ve,we]);let Te;ae.type===`context-menu`&&(Te=ae.context),b.useImperativeHandle(Te?.positionerRef,()=>te,[te]),b.useImperativeHandle(Te?.actionsRef,()=>({setOpen:xe}),[xe]);let Ee=Xv(Se,{enabled:!re,bubbles:{escapeKey:f&&ae.type===`menu`},outsidePress(){return ae.type!==`context-menu`||ue.current?.type===`contextmenu`||de.current},externalTree:he?B:void 0}),De=P4(),Oe=n2(Se,{enabled:!re,listRef:z.context.itemDomElements,activeIndex:oe,virtual:v,nested:ae.type===`menubar`||!v&&ae.type!==void 0,parentOrientation:ae.type===`menubar`?ae.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?se:void 0,allowEscape:v&&l&&S,orientation:u,triggerOrientation:v?`vertical`:u,rtl:De===`rtl`,disabledIndices:mh,onNavigate(e,t){z.setActiveIndex(e,D3(t),t?.nativeEvent)},openOnArrowKeyDown:ae.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=r2(Se,{enabled:!re&&!v,listRef:z.context.itemLabels,elementsRef:z.context.itemDomElements,activeIndex:oe,resetMs:500,onMatch:(e,t)=>{H&&e!==oe&&z.setActiveIndex(e,_g,t.nativeEvent)},onTyping:ke}),je=i_(a),Me=b.useRef(-1),Ne=i_(()=>{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=sg,z.context.highlightEvent=void 0,a&&je(t,U_(r,i,{label:t===void 0?void 0:z.context.itemLabels.current[n]??void 0}))});J(()=>{Ne()},[oe,Ne]);let Pe=b.useMemo(()=>{if(!v)return Oe.reference;if(!Oe.trigger)return hh;let{onFocus:e,...t}=Oe.trigger;return t},[v,Oe.reference,Oe.trigger]);z.useSyncedValue(`inputProps`,v?Oe.reference??hh:hh);let Fe=b.useMemo(()=>{let e=bh(Ae.reference,Pe,Ee.reference,{onMouseMove(){z.set(`allowMouseEnter`,!0)}},_e);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=H,e},[z,Ae.reference,Pe,Ee.reference,_e,H]),Ie=b.useMemo(()=>{let e=bh(Oe.trigger,Ee.trigger,_e);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Oe.trigger,Ee.trigger,_e]);nh(()=>(z.update({inactiveTriggerProps:Ie}),null)),dy(z,{floatingRootContext:Se,activeTriggerProps:Fe,inactiveTriggerProps:Ie,popupProps:b.useMemo(()=>bh($v,{onMouseMove(){z.set(`allowMouseEnter`,!0),ae.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),[ae.type,z,Ae.floating,Oe.floating,Ee.floating]),itemProps:Oe.item??hh});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)($m.Provider,{value:Le,children:[p&&(0,x.jsx)(ny,{handle:p,store:z}),Re]});return(ae.type===void 0||ae.type===`context-menu`)&&(ze=(0,x.jsx)(Pv,{externalTree:B,children:ze})),ze});function I3(e){let t=b.useContext(M3);if(t===null)return(0,x.jsx)(F3,{...e});let n=t.Root;return(0,x.jsx)(M3.Provider,{value:null,children:(0,x.jsx)(n,{...t.options,...e})})}var L3=5;function R3(e,t){let n=z3(t);return e.clientX>=n.left-L3&&e.clientX<=n.right+L3&&e.clientY>=n.top-L3&&e.clientY<=n.bottom+L3}function z3(e){let t=e.getBoundingClientRect(),n=Mg(e);if(O_)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 B3(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=c_(),{ref:i,index:a}=F_(e),o=n===a,s=b.useRef(null),c=rh(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 V3(e){let{render:t,className:n,style:r,state:i=hh,props:a=mh,refs:o=mh,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=B3({metadata:s});return Nh(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function H3(e){if(Ig(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Jg(e))return H3(Zg(e))}function U3(e,t){function n(n,r,i){let a=n.currentTarget;Q_.flushSync(()=>{e.setOpen(!1,H_(mg,n.nativeEvent,a))}),X0(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&&Z0(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function W3(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,u_(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:hh,[t,n,r])}var G3=yy(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=eh(!0),h=Ry(d)??m?.store;if(!h)throw Error(Xm(85));let g=V_(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),S=h.useState(`triggerControlsId`,g),C=b.useRef(null),w=q3(),T=c_(!0),E=jv(),D=b.useMemo(()=>E??new Dv,[E]),{registerTrigger:O,isMountedByThisTrigger:k}=cy(g,C,h,{payload:f,closeDelay:u,parent:w,floatingTreeRoot:D,floatingNodeId:Mv(D),floatingParentNodeId:Av(),keyboardEventRelay:T?.relayKeyboardEvent}),A=w.type===`menubar`,j=h.useState(`disabled`),M=a||j||A&&w.context.disabled,{getButtonProps:N,buttonRef:P}=f_({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=s1(),L=i_(e=>{if(!F.current)return;I.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;h1(F.current,t)||h1(h.select(`positionerElement`),t)||t===F.current||t!=null&&H3(t)===h.select(`rootId`)||R3(e,F.current)||D.events.emit(`close`,{domEvent:e,reason:yg})});b.useEffect(()=>{let e=u_(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=Yy(v,{enabled:(c??R)&&!M&&(!A||R&&!k),handleClose:d2({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=K3(y,h.select(`lastOpenChangeReason`)),V=Wv(v,{enabled:!M,event:y&&A?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0&&B}),H=Vy(v,{enabled:!M&&R}),ee=W3({open:y,enabled:A,mouseDownAction:`open`}),te=b.useMemo(()=>bh(H.reference,V.reference),[H.reference,V.reference]),ne=h.useState(`triggerProps`,k),re=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:ie,handleFocusTargetFocus:ae}=U3(h,C),oe={disabled:M,open:y},se=[F,t,P,O,C],ce=[te,z??hh,ne,{"aria-haspopup":`menu`,"aria-controls":S,id:g,onMouseDown:e=>{h.select(`open`)||(I.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),u_(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},re,A?{role:`menuitem`}:{},ee,p,N],le=Nh(`button`,e,{enabled:!A,stateAttributesMapping:ng,state:oe,ref:se,props:ce});return A?(0,x.jsx)(V3,{tag:`button`,render:n,className:r,style:i,state:oe,refs:se,props:ce,stateAttributesMapping:ng}):y?(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(Y1,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:ie},`${g}-pre-focus-guard`),(0,x.jsx)(b.Fragment,{children:le},g),(0,x.jsx)(Y1,{ref:h.context.triggerFocusTargetRef,onFocus:ae},`${g}-post-focus-guard`)]}):(0,x.jsx)(b.Fragment,{children:le},g)});function K3(e,t){let n=s1(),[r,i]=b.useState(!1);return J(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function q3(){let e=S3(!0);return b.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function J3(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 Y3=b.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Nh(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function X3(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Z3(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Q3(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function $3(e){return Q3(e?.[0])}function e6(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if($3(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 t6(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 Z3(e)}function n6(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Z3(e.value):Z3(e)}var r6=b.createContext(void 0);function i6(e){let t=b.useContext(r6);if(t===void 0&&!e)throw Error(Xm(72));return t}var a6={...Ly,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},o6=class extends Oy{constructor(e,t,n){let r=new py;super(s6(e,r,t,n),c6(r),a6)}setOpen=(e,t)=>{sy(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,H_(cg,e))}};function s6(e,t,n,r=!1){return{...jy(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 c6(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var l6=vy(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=ty((e,t)=>new o6({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}),ly(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:S}=uy(h,p),C=p.useState(`isInstantPhase`),w=p.useState(`instantType`),T=p.useState(`lastOpenChangeReason`),E=b.useRef(null);J(()=>{m&&t&&p.setOpen(!1,H_(xg))},[m,t,p]),J(()=>{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]),J(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),b.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,H_(Sg))}),[y,p]);let D=h||_||!t&&a!==`none`;return(0,x.jsxs)(r6.Provider,{value:p,children:[l&&(0,x.jsx)(ny,{handle:l,store:p}),D&&(0,x.jsx)(u6,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function u6({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Xv(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=qv(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=b.useMemo(()=>bh(a.reference,i.reference),[a.reference,i.reference]);return dy(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??hh}),null}var d6=b.createContext(void 0);function f6(){return b.useContext(d6)}var p6=`data-base-ui-tooltip-trigger`;function m6(e){let t=_1(e);return Fg(t)?t:null}var h6=yy(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=i6(!0),m=Ry(a)??p;if(!m)throw Error(Xm(82));let h=V_(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}=cy(h,y,m,{payload:o,closeOnClick:l,closeDelay:x}),w=f6(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=V1(v,{open:_}),k=Ky(v);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=W1(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=b.useRef(!1),I=s1(),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=g1(e,`[${p6}]`);return n!==null&&n!==t&&h1(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 V=Yy(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?d2():null,restMs:R,delay(){return u==null&&O?{close:P1(E.current,`close`)}:{close:x}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),H=Vy(v,{enabled:!j}).reference,ee=e=>{let t=F.current,n=m6(e),r=B(n),i=y.current,a=i&&n&&h1(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,H_(lg,e));else if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&f1(L.current)){let t=()=>{F.current||M.current||m.select(`open`)||m.setOpen(!0,H_(lg,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},te=m.useState(`appliedTriggerProps`,C||N!==`none`);return Nh(`button`,e,{state:{open:_},ref:[t,S,y],props:[V,H,te,{onMouseOver(e){ee(e.nativeEvent)},onFocus(e){z(m6(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,[w1]:j?``:void 0,[p6]:j?void 0:``},f],stateAttributesMapping:tg})}),g6=b.createContext(void 0);function _6(){let e=b.useContext(g6);if(e===void 0)throw Error(Xm(70));return e}var v6=b.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=wv({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,x.jsxs)(b.Fragment,{children:[l,c&&Q_.createPortal(n,c)]})}),y6=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return i6().useState(`mounted`)||n?(0,x.jsx)(g6.Provider,{value:n,children:(0,x.jsx)(v6,{ref:t,...r})}):null}),b6=b.createContext(void 0);function x6(){let e=b.useContext(b6);if(e===void 0)throw Error(Xm(71));return e}var S6=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=yv,style:g,..._}=e,v=i6(),y=_6(),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=J4({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=o3(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)(b6.Provider,{value:k,children:A})}),C6=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=i6(),{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`);n1({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),qy(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Nh(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[$v,f,v4(d),a],stateAttributesMapping:ig})}),w6=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=b.useMemo(()=>({open:t,close:n}),[t,n]);return(0,x.jsx)(d6.Provider,{value:t,children:(0,x.jsx)(B1,{delay:i,timeoutMs:r,children:e.children})})},T6=b.createContext(void 0);function E6(e){let t=b.useContext(T6);if(!e&&t===void 0)throw Error(Xm(27));return t}var D6=b.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=E6(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Nh(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:ig,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),O6=b.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=E6(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=f_({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,H_(pg,e.nativeEvent))}return Nh(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),k6=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=E6(),c=V_(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Nh(`p`,e,{ref:t,props:[{id:c},o]})}),A6=b.createContext(void 0);function j6(){let e=b.useContext(A6);if(e===void 0)throw Error(Xm(26));return e}var M6=`--nested-dialogs`,N6=`data-nested-dialog-open`,P6={...rg,...Wh,nestedDialogOpen(e){return e?{[N6]:``}:null}},F6=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=E6(),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`);j6(),n1({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let w=o===void 0?ey(c.context.popupRef):o,T=g>0,E=c.useStateSetter(`popupElement`),D=Nh(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:T},props:[f,{id:C,"aria-labelledby":y,"aria-describedby":l,role:S,...$v,hidden:!m,onKeyDown(e){_4.has(e.key)&&e.stopPropagation()},style:{[M6]:g}},s],ref:[t,c.context.popupRef,E],stateAttributesMapping:P6});return(0,x.jsx)(Uv,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:w,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:D})}),I6=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=E6(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,x.jsx)(A6.Provider,{value:n,children:(0,x.jsxs)(Tv,{ref:t,...r,children:[a&&o===!0&&(0,x.jsx)(i3,{ref:i.context.internalBackdropRef,inert:j4(!s)}),e.children]})}):null});function L6({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=Xv(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||h1(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return _3(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),J(()=>{!r&&!i&&(u(0),f(0))},[r,i]),J(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),dy(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var R6={...Ly,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},z6=class extends Oy{constructor(e,t,n){let r=new py,i=B6(e,r,t,n);super(i,V6(r),R6)}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(ay(this.state,e,t.trigger)))}};function B6(e,t,n,r=!1){return{...jy(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 V6(e){return{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function H6(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=E6(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},S=ty((e,t)=>new z6({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`);fy(S,C),ly(S);let{forceUnmount:E}=uy(C,S);b.useImperativeHandle(l,()=>({unmount:E,close:()=>S.setOpen(!1,H_(Sg))}),[E,S]);let D=C||w||u!=null;return(0,x.jsxs)(T6.Provider,{value:S,children:[u&&(0,x.jsx)(ny,{handle:u,store:S}),D&&(0,x.jsx)(L6,{store:S,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:T}):n]})}var U6=vy(function(e){return H6(`dialog`,e)}),W6=b.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=j6(),c=E6(),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 Nh(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:P6,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),G6=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=E6(),c=V_(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Nh(`h2`,e,{ref:t,props:[{id:c},o]})}),K6=b.createContext(void 0);function q6(e){let t=b.useContext(K6);if(t===void 0&&!e)throw Error(Xm(47));return t}var J6={...Ly,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!Ly.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&Ly.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>Ly.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},Y6=class extends Oy{constructor(e,t,n){let r=new py;super(X6(e,r,t,n),Z6(r),J6)}setOpen=(e,t)=>{let n=t.reason===lg,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=oy(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=ay(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}),Q_.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function X6(e,t,n,r=!1){let i={...jy(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 Z6(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeTriggerFocusGuardRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new o1,stickIfOpen:!0,triggerElements:e}}var Q6=vy(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=eb(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),fy(u,d),ly(u);let{forceUnmount:m}=uy(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,H_(Sg))}),[m,u]);let h=d||f||s!=null;return(0,x.jsxs)(K6.Provider,{value:u,children:[s&&(0,x.jsx)(ny,{handle:s,store:u}),h&&(0,x.jsx)(tb,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function $6(e){return q6(!0)?(0,x.jsx)(Q6,{props:e}):(0,x.jsx)(Pv,{children:(0,x.jsx)(Q6,{props:e})})}function eb(e,t){let n=ty((e,n)=>new Y6(t,e,n));return b.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function tb({store:e,modal:t}){let n=Xv(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference;return dy(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:n.floating}),null}var nb=yy(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=q6(!0),h=Ry(s)??m;if(!h)throw Error(Xm(74));let g=V_(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}=cy(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=Yy(v,{enabled:!a&&l&&!D,mouseOnly:!0,move:!1,handleClose:d2(),restMs:u,delay:{close:d},triggerElementRef:C,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=Wv(v,{stickIfOpen:i_(()=>h.context.stickIfOpen)}),j=T3(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,T),{getButtonProps:N,buttonRef:P}=f_({disabled:a,native:o}),F={open(e){return E?ng.open(e):tg.open(e)}},{handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=U3(h,C),R=Nh(`button`,e,{state:{disabled:a,open:y},ref:[P,t,w,C],props:[A.reference,k,M,j,{[_v]:``,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)(Y1,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:I}),z,(0,x.jsx)(Y1,{ref:h.context.triggerFocusTargetRef,onFocus:L})]}):z}),rb=b.createContext(void 0);function ib(){let e=b.useContext(rb);if(e===void 0)throw Error(Xm(45));return e}var ab=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return q6().useState(`mounted`)||n?(0,x.jsx)(rb.Provider,{value:n,children:(0,x.jsx)(Tv,{ref:t,...r})}):null}),ob=b.createContext(void 0);function sb(){let e=b.useContext(ob);if(!e)throw Error(Xm(46));return e}var cb=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=yv,..._}=e,v=q6(),y=ib(),b=Mv(),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=J4({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`)});a3({store:v,domReference:S.useState(`domReferenceElement`),positionerElement:k,open:w});let N=D===!0&&T!==`trigger-hover`;y3(w&&N,O===`touch`,k,E);let P=v.useStateSetter(`positionerElement`),F=o3(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)(ob.Provider,{value:M,children:[C&&N&&(0,x.jsx)(i3,{inert:j4(!w),cutout:E}),(0,x.jsx)(Nv,{id:b,children:F})]})}),lb=b.createContext(void 0);function ub(){let[e,t]=b.useState(0),n=i_(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:b.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function db(){let e=b.useContext(lb);J(()=>e?.register(),[e])}var fb=b.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=q6(),l=sb(),u=g4(!0)!=null,{context:d,hasClosePart:f}=ub(),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`);n1({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),qy(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?ey(c.context.popupRef):a,j=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N=Nh(`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`,...$v,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&_4.has(e.key)&&e.stopPropagation()}},v4(g),s],stateAttributesMapping:ig});return(0,x.jsx)(Uv,{context:T,openInteractionType:m,modal:j,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:Ig(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,x.jsx)(lb.Provider,{value:d,children:N})})}),pb=b.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{buttonRef:c,getButtonProps:l}=f_({disabled:a,focusableWhenDisabled:!1,native:o}),u=q6();return db(),Nh(`button`,e,{ref:[t,c],props:[{onClick(e){u.setOpen(!1,H_(pg,e.nativeEvent))}},s,l]})}),mb=I3,hb=G3;function gb({className:e,align:t=`start`,side:n=`bottom`,sideOffset:r=6,children:i}){return(0,x.jsx)(A4,{children:(0,x.jsx)(b3,{align:t,side:n,sideOffset:r,className:`z-50 outline-none`,children:(0,x.jsx)(D4,{className:G(`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 _b({className:e,...t}){return(0,x.jsx)(i1,{className:G(`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 vb({className:e,...t}){return(0,x.jsx)(`div`,{className:G(`px-2 py-1.5 text-xs font-medium text-muted-foreground`,e),...t})}function yb(){return(0,x.jsx)(Y3,{className:`my-1 h-px bg-border`})}var bb=$6,xb=nb,Sb=pb;function Cb({className:e,align:t=`start`,side:n=`bottom`,sideOffset:r=6,children:i}){return(0,x.jsx)(ab,{children:(0,x.jsx)(cb,{align:t,side:n,sideOffset:r,className:`z-50 outline-none`,children:(0,x.jsx)(fb,{className:G(`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=w6;function Tb({label:e,side:t=`bottom`,children:n}){return(0,x.jsxs)(l6,{children:[(0,x.jsx)(h6,{render:n}),(0,x.jsx)(y6,{children:(0,x.jsx)(S6,{side:t,sideOffset:6,className:`z-50`,children:(0,x.jsx)(C6,{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 Eb=U6;function Db({className:e,title:t,description:n,footer:r,children:i}){return(0,x.jsxs)(I6,{children:[(0,x.jsx)(D6,{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)(F6,{className:G(`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)(G6,{className:`text-xl leading-snug font-semibold`,children:t}),n&&(0,x.jsx)(k6,{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)(O6,{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)(Gm,{className:`size-4`})})]})]})}var Ob={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 kb({variant:e=`default`,className:t,...n}){return(0,x.jsx)(`span`,{className:G(`inline-flex h-[18px] items-center gap-1 rounded-sm px-1.5 text-xs font-medium whitespace-nowrap`,Ob[e],t),...n})}function Ab({className:e,...t}){return(0,x.jsx)(`kbd`,{className:G(`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 jb={primary:`#2563eb`,secondary:`#102a43`,wordmark:`#102a43`},Mb={primary:`#2563eb`,secondary:`#ffffff`,wordmark:`#ffffff`},Nb=`128.48 84.48 994.04 1119.04`,Pb=`94.49 112.11 1995.48 518.12`,Fb=`translate(35 73) scale(0.463)`,Ib=`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`,Lb=`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`,Rb=`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 zb(e){if(typeof e==`string`&&e)return/^--[\w-]+$/.test(e)?`var(`+e+`)`:e}function Bb({variant:e,colors:t,primary:n,secondary:r,wordmark:i}){let a=e===`mono`?{primary:`currentColor`,secondary:`currentColor`,wordmark:`currentColor`}:e===`on-dark`?Mb:jb,o=t||{};return{primary:zb(n)||zb(o.primary)||a.primary,secondary:zb(r)||zb(o.secondary)||a.secondary,wordmark:zb(i)||zb(o.wordmark)||a.wordmark}}function Vb({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:G(`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 Hb({fills:e}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{style:{fill:e.primary},d:Ib}),(0,x.jsx)(`path`,{style:{fill:e.secondary},d:Lb})]})}function Ub({variant:e=`color`,colors:t,primary:n,secondary:r,...i}){let a=Bb({variant:e,colors:t,primary:n,secondary:r});return(0,x.jsx)(Vb,{"data-slot":`logomark`,viewBox:Nb,...i,children:(0,x.jsx)(Hb,{fills:a})})}function Wb({variant:e=`color`,colors:t,primary:n,secondary:r,wordmark:i,...a}){let o=Bb({variant:e,colors:t,primary:n,secondary:r,wordmark:i});return(0,x.jsxs)(Vb,{"data-slot":`lockup`,viewBox:Pb,...a,children:[(0,x.jsx)(`g`,{transform:Fb,children:(0,x.jsx)(Hb,{fills:o})}),(0,x.jsx)(`path`,{style:{fill:o.wordmark},fillRule:`evenodd`,d:Rb})]})}function Gb(e){let t=Ju();return(0,x.jsx)(Ub,{variant:t?`on-dark`:`color`,decorative:!0,...e})}function Kb(e){let t=Ju();return(0,x.jsx)(Wb,{variant:t?`on-dark`:`color`,...e})}function qb({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:G(`live-activity-focus-aligned text-foreground`,t),children:e})})})}var Jb={xs:`size-3`,sm:`size-3.5`,md:`size-4`,lg:`size-5`};function Yb({size:e,muted:t,className:n}){return(0,x.jsx)(tp,{role:`status`,"aria-label":`Loading`,className:G(`motion-safe:animate-spin`,e&&Jb[e],t&&`text-muted-foreground`,n)})}function Xb(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 Zb=[`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 Qb(e){let t=0;for(let n of e.normalize(`NFKC`).trim().toLowerCase()||`project`)t=(t*31+(n.codePointAt(0)||0))%Zb.length;return Zb[t]}function $b({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:G(`size-4 shrink-0 rounded-[3px] object-contain`,n)});let a=Xb(e);return(0,x.jsx)(`span`,{"aria-hidden":!0,className:G(`inline-flex size-4 shrink-0 items-center justify-center`,n),children:(0,x.jsx)(`svg`,{viewBox:`0 0 16 16`,className:G(`size-full overflow-hidden rounded-[25%] font-mono select-none`,Qb(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 e8={working:{label:`Working`,icon:Hd,tone:`text-info-foreground`},approval:{label:`Approval`,icon:hm,tone:`text-warning-foreground`},input:{label:`Input`,icon:sp,tone:`text-indigo-600 dark:text-indigo-300`},failed:{label:`Failed`,icon:Wd,tone:`text-destructive-foreground`},done:{label:`Done`,icon:Bd,tone:`text-success-foreground`}};function t8(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`:r&&(i=`done`),{status:i,recede:!t&&i!==`input`&&(i===`working`||(i===null||i===`approval`)&&!r)}}function n8({status:e,iconClass:t}){let n=e8[e],r=n.icon;return(0,x.jsxs)(`span`,{className:G(`inline-flex items-center gap-1 font-medium`,n.tone),children:[(0,x.jsx)(r,{"aria-hidden":!0,className:t}),n.label]})}function r8({chat:e,active:t,showProject:n,onPin:r}){let{status:i,recede:a}=t8(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)(Vp,{"aria-hidden":!0,className:`size-3 group-hover/unpin:hidden`}),(0,x.jsx)(zp,{"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)(n8,{status:i,iconClass:n?`size-4`:`size-3`}):yu(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)(Vp,{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:G(`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)(qb,{className:`truncate text-sm`,children:e.title})]});return(0,x.jsx)(ua,{to:`/p/$projectId/c/$chatId`,params:{projectId:e.projectId,chatId:e.id},"aria-label":i?`${e.title}, ${e8[i].label}`:e.title,"aria-current":t?`page`:void 0,className:G(`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)($b,{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)(Sd,{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 i8(){let e=Yi();return b.useCallback(t=>e({to:`.`,search:e=>{let n={...e};return t?n.settings=t:delete n.settings,n},replace:!1}),[e])}function a8({section:e,className:t,children:n,...r}){return(0,x.jsx)(ua,{to:`.`,search:(t=>({...t,settings:e})),className:t,...r,children:n})}function o8(e){let t=Au(),n=U({...t.dev.status.queryOptions({projectId:e}),refetchInterval:!1}),r=at(t.dev.ensure.mutationOptions()),i=at(t.dev.touch.mutationOptions()),a=at(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 s8(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 c8({icon:e,label:t,tip:n}){return(0,x.jsx)(Tb,{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 l8({projectId:e}){let t=Au(),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)(c8,{icon:sm,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)(c8,{icon:Cp,label:i.scope,tip:`App ${i.appName||i.scope}`}),i?.updateSet&&(0,x.jsx)(c8,{icon:Zf,label:i.updateSet,tip:`Update set: ${i.updateSet}`}),a?.repo&&(0,x.jsx)(c8,{icon:kf,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)(Tb,{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:G(`size-1.5 rounded-full`,s8(r.data.state))}),`dev`,r.data.url?` :${new URL(r.data.url).port}`:``]})})]})}function u8(){let e=Gu(),t=Au(),n=U(t.projects.list.queryOptions()),r=U(t.meta.queryOptions()),i=U(t.about.update.queryOptions()),a=i8(),[o,s]=b.useState(``),[c,l]=b.useState(!1),u=qi({strict:!1}),d=(n.data||[]).filter(e=>!o||e.name.toLowerCase().includes(o.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)(Tb,{label:(0,x.jsxs)(`span`,{children:[`Hide sidebar `,(0,x.jsxs)(Ab,{className:`ml-1`,children:[Du?`⌘`:`Ctrl`,` B`]})]}),children:(0,x.jsx)(q,{variant:`ghost`,size:`icon-sm`,onClick:()=>Wu({sidebarOpen:!1}),className:`text-sidebar-icon`,children:(0,x.jsx)(kp,{})})}),(0,x.jsx)(Gb,{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:[c?(0,x.jsx)(`input`,{autoFocus:!0,value:o,onChange:e=>s(e.target.value),onBlur:()=>!o&&l(!1),onKeyDown:e=>e.key===`Escape`&&(s(``),l(!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)(am,{className:`size-4 text-sidebar-icon`}),`Search`,(0,x.jsxs)(Ab,{className:`ml-auto`,children:[Du?`⌘`:`Ctrl`,` K`]})]}),(0,x.jsxs)(mb,{children:[(0,x.jsx)(Tb,{label:`View`,children:(0,x.jsx)(hb,{"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)($f,{className:`size-4`})})}),(0,x.jsxs)(gb,{align:`start`,className:`w-48`,children:[(0,x.jsx)(vb,{children:`Show chats`}),(0,x.jsxs)(_b,{onClick:()=>Wu({sidebarView:`recent`}),children:[(0,x.jsx)(Jd,{}),` `,(0,x.jsx)(`span`,{className:`flex-1`,children:`By recency`}),e.sidebarView===`recent`&&(0,x.jsx)(Md,{className:`!text-foreground`})]}),(0,x.jsxs)(_b,{onClick:()=>Wu({sidebarView:`projects`}),children:[(0,x.jsx)(Df,{}),` `,(0,x.jsx)(`span`,{className:`flex-1`,children:`By project`}),e.sidebarView===`projects`&&(0,x.jsx)(Md,{className:`!text-foreground`})]})]})]}),(0,x.jsx)(Tb,{label:`New project`,children:(0,x.jsx)(`button`,{type:`button`,"aria-label":`New project`,onClick:()=>Wu({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)(Cf,{className:`size-4`})})}),(0,x.jsx)(d8,{projectId:u.projectId})]}),(0,x.jsx)(`nav`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:e.sidebarView===`recent`?(0,x.jsx)(v8,{filter:o,activeChat:u.chatId}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f8,{label:`Projects`,count:n.data?.length}),n.isLoading&&(0,x.jsx)(m8,{}),n.data&&n.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:()=>Wu({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)(Cf,{className:`size-3`}),` New project`]})})]}),d.map(e=>(0,x.jsx)(p8,{project:e,activeProject:u.projectId,activeChat:u.chatId},e.id))]})}),(0,x.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 pt-1 pb-2`,children:[(0,x.jsx)(Tb,{label:`Settings`,children:(0,x.jsx)(a8,{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)(dm,{className:`size-4`})})}),(0,x.jsx)(Tb,{label:`Usage`,children:(0,x.jsx)(a8,{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)(Ad,{className:`size-4`})})}),(0,x.jsx)(Tb,{label:`All projects`,children:(0,x.jsx)(ua,{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)(xf,{className:`size-4`})})}),i.data?.newer?(0,x.jsxs)(`button`,{type:`button`,onClick:()=>a(`about`),title:`rpf ${i.data.latest} is available`,className:`ml-auto inline-flex h-5 items-center gap-1 rounded-full bg-info/12 px-2 text-2xs font-medium text-info-foreground hover:bg-info/20`,children:[(0,x.jsx)(`span`,{className:`size-1.5 rounded-full bg-info`}),` Update`]}):(0,x.jsxs)(`span`,{className:`ml-auto pr-1 text-2xs text-sidebar-muted-foreground tabular-nums`,children:[`rpf `,r.data?.version||``]})]}),(0,x.jsx)(h8,{})]})}function d8({projectId:e}){let t=Au(),n=Yi(),r=U(t.projects.list.queryOptions()),i=e||r.data?.[0]?.id;return(0,x.jsx)(Tb,{label:(0,x.jsxs)(`span`,{children:[`New chat `,i?``:`(open a project first)`]}),children:(0,x.jsx)(q,{variant:`ghost`,size:`icon-sm`,disabled:!i,onClick:()=>i&&n({to:`/p/$projectId`,params:{projectId:i}}),className:`text-sidebar-icon`,children:(0,x.jsx)(xm,{})})})}function f8({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 p8({project:e,activeProject:t,activeChat:n}){let r=Au(),i=Yi(),[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=_8(),l=y8(),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:G(`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)(Df,{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:G(`size-1.5 rounded-full`,s8(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)(xm,{className:`size-3.5`})}),(0,x.jsx)(Pd,{className:G(`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)(r8,{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 m8(){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 h8(){return(0,x.jsx)(`div`,{onPointerDown:e=>{e.preventDefault();let t=e=>{let t=Math.max(208,window.innerWidth-640);e.clientX<156?Wu({sidebarOpen:!1}):Wu({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:()=>Wu({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 g8(){let e=Au(),t=Yi(),n=C();return at(e.projects.open.mutationOptions({onSuccess:r=>{n.invalidateQueries({queryKey:e.projects.list.queryKey()}),t({to:`/p/$projectId`,params:{projectId:r.id}})}}))}function _8(){let e=U(Au().models.queryOptions());return t=>t?(e.data?.find(e=>e.connectionId===t.connectionId))?.models.find(e=>e.id===t.model)?.name||t.model:``}function v8({filter:e,activeChat:t}){let n=U(Au().chats.recent.queryOptions({limit:60})),r=y8(),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)(m8,{}):i.length?(0,x.jsx)(`div`,{className:`flex flex-col gap-px`,children:i.map(e=>(0,x.jsx)(r8,{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 y8(){let e=at(Au().chats.setPinned.mutationOptions());return(t,n,r)=>e.mutate({projectId:t,chatId:n,pinned:r})}function b8({icon:e,title:t,children:n,actions:r,className:i}){return(0,x.jsxs)(`div`,{className:G(`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 x8(){let e=Au(),t=C(),n=U(e.projects.list.queryOptions()),r=g8(),i=at(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)(xf,{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)(q,{type:`submit`,disabled:!a.trim()||r.isPending,children:`Open folder`}),(0,x.jsxs)(q,{variant:`outline`,onClick:()=>Wu({newProject:`choose`}),children:[(0,x.jsx)(Cf,{}),` 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)(b8,{icon:Df,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)(q,{size:`sm`,onClick:()=>Wu({newProject:`new`}),children:`New portal`}),(0,x.jsx)(q,{size:`sm`,variant:`outline`,onClick:()=>Wu({newProject:`pull`}),children:`Pull a portal`}),(0,x.jsx)(q,{size:`sm`,variant:`outline`,onClick:()=>Wu({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)(S8,{project:e,first:t===0,onRemove:()=>i.mutate({id:e.id})},e.id))]})]})})]})}function S8({project:e,first:t,onRemove:n}){let r=U({...Au().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:G(`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)(ua,{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:G(`size-1.5 shrink-0 rounded-full`,s8(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)(kb,{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:G(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:yu(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)(q,{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)(Gm,{})})]})}function C8(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 w8=`data-valid`,T8=`data-invalid`,E8={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},D8={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},O8={valid(e){return e===null?null:e?{[w8]:``}:{[T8]:``}}},k8=`data-checked`,A8=`data-unchecked`;function j8(e){return{checked(t){return e.indeterminate?{}:t?{[k8]:``}:{[A8]:``}},...O8}}var M8={invalid:void 0,name:void 0,validityData:{state:E8,errors:[],error:``,value:``,initialValue:null},setValidityData:ph,disabled:void 0,setTouched:ph,setDirty:ph,setFilled:ph,setFocused:ph,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:D8,registerFieldControl:ph,validation:{getValidationProps:(e,t=hh)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:ph,getInputControl:()=>null,commit:async()=>{},change:ph}},N8=b.createContext(M8);function P8(e=!0){let t=b.useContext(N8);if(t.setValidityData===ph&&!e)throw Error(Xm(28));return t}function F8(e,t,n){let{setFocused:r,focusOwnerRef:i}=P8(),a=i_(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return J(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function I8(e,t,n,r,i=!0,a){let{registerFieldControl:o}=P8(),s=nh(()=>Symbol());J(()=>{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]),J(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var L8=b.createContext({disabled:!1});function R8(){return b.useContext(L8)}var z8=b.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:ph,validationMode:`onSubmit`,submitCountRef:{current:0}});function B8(){return b.useContext(z8)}var V8=b.createContext({controlId:void 0,registerControlId:ph,resetControlId:ph,labelId:void 0,setLabelId:ph,messageIds:[],setMessageIds:ph,getDescriptionProps:e=>e});function H8(){return b.useContext(V8)}function U8(e,t,n,r=!0,i,a){let[o,s]=b.useState(),c=V_(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return J(()=>{let i=e||t||l||!r?void 0:W8(n.current,c);o!==i&&s(i)}),u}function W8(e,t){let n=G8(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function G8(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 K8(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=H8(),o=V_(),s=nh(()=>Symbol()),c=b.useRef(!1),l=b.useRef(!1),u=i_(()=>{c.current&&i!==ph&&(c.current=!1,i(s.current,void 0))});return J(()=>{if(!n||i===ph){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]),J(()=>u,[u]),(n?r:void 0)??t??o}var q8=b.createContext(void 0);function J8(){return b.useContext(q8)}var Y8=b.createContext(void 0);function X8(){let e=b.useContext(Y8);if(e===void 0)throw Error(Xm(14));return e}var Z8=`data-parent`,Q8=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}=B8(),{disabled:T,name:E,setDirty:D,setFilled:O,setTouched:k,state:A,validationMode:j,validityData:M,validation:N}=P8(),P=R8(),{labelId:F,registerControlId:I,getDescriptionProps:L}=H8(),R=J8(),z=R?.allValues===void 0?void 0:R.parent,B=z!==void 0,V=T||P.disabled||R?.disabled||o,H=E??d,ee=v??H,te=V_(),ne=R?.registerControlId!==I,re=K8({id:c||void 0,enabled:ne}),ie=y?re:te,ae={};B&&(p?ae=z.getParentProps():ee!==void 0&&(ae=z.getChildProps(ee)));let{checked:oe=n,indeterminate:se=l,onCheckedChange:ce,...le}=ae,ue=R?.value,de=b.useRef(null),fe=F8(V,de),{getButtonProps:pe,buttonRef:me}=f_({disabled:V,native:y}),he=R?.validation??N,[ge,_e]=wg({controlled:ee!==void 0&&ue!==void 0&&!p?ue.includes(ee):oe,default:i,name:`Checkbox`,state:`checked`}),ve=B?!!oe:ge,ye=B&&se||l;I8(de,te,ge,void 0,!R&&!V,d);let be=z?.registerChildId,xe=b.useRef(null),Se=he.registerInput,Ce=R?ee:void 0,we=b.useCallback(e=>Se(e,{controlRef:de,value:Ce}),[Se,Ce]),Te=rh(u,xe,p?void 0:we),Ee=U8(a,F,xe,!y,re,C[`aria-label`]);J(()=>{xe.current&&(xe.current.indeterminate=ye),R||O(ge)},[ge,ye,R,O]),w3(ge,()=>{R||(w(H),D(ge!==M.initialValue),he.change(ge))});let De=bh({checked:ge,disabled:V,form:s,name:p?void 0:H,id:y?void 0:re,required:g,ref:Te,style:H?J1:q1,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=H_(sg,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(ce?.(t,n),!n.isCanceled&&(_e(t),ee!==void 0&&R!==void 0&&!p&&!B))){let e=t?[...R.value,ee]:R.value.filter(e=>e!==ee);R.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){de.current?.focus()}},v===void 0?hh:{value:(R?ge&&v:v)||``},L,e=>he.getValidationProps(V,e));b.useEffect(()=>{if(!z||ee===void 0)return;let e=z.disabledStatesRef.current;return e.set(ee,V),()=>{e.delete(ee)}},[z,V,ee]);let Oe=b.useMemo(()=>({...A,checked:ve,disabled:V,readOnly:m,required:g,indeterminate:ye}),[A,ve,V,m,g,ye]),ke=j8(Oe),Ae=Nh(`span`,e,{state:Oe,ref:[me,de,t],props:[{id:ie,role:`checkbox`,"aria-checked":ye?`mixed`:ve,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Ee,[Z8]: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),Mg(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||C8(t)?.click()})},onClick(e){if(m||V)return;e.preventDefault();let t=xe.current;t&&d_(t,e)}},C,le,pe,L,e=>he.getValidationProps(V,e)],stateAttributesMapping:ke}),je=Ae.props.id;return J(()=>{if(be&&!p&&ee!==void 0&&je!==void 0)return be(ee,je)},[be,p,ee,je]),(0,x.jsxs)(Y8.Provider,{value:Oe,children:[Ae,!ge&&!R&&H&&!p&&_!==void 0&&(0,x.jsx)(`input`,{type:`hidden`,form:s,name:H,value:_,disabled:V}),(0,x.jsx)(`input`,{...De,suppressHydrationWarning:!0})]})}),$8=b.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=X8(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=Y_(c),f=b.useRef(null),p={...s,transitionStatus:u};n1({batch:!0,enabled:!c,open:c,ref:f,onComplete(){c||d(!1)}});let m={...j8(s),...Wh},h=a||l,g=Nh(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null}),ex=b.createContext(void 0);function tx(){let e=b.useContext(ex);if(e===void 0)throw Error(Xm(63));return e}var nx=`data-checked`,rx=`data-unchecked`,ix={...O8,checked(e){return e?{[nx]:``}:{[rx]:``}}},ax=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}=B8(),{state:C,setTouched:w,setDirty:T,validityData:E,setFilled:D,validationMode:O,disabled:k,name:A,validation:j}=P8(),{labelId:M}=H8(),N=k||m,P=A??l,F=b.useRef(null),I=rh(F,c,j.inputRef),L=b.useRef(null),R=F8(N,L),z=V_(),B=K8({id:s}),V=u?void 0:B,[H,ee]=wg({controlled:n,default:!!i,name:`Switch`,state:`checked`});I8(L,z,H,void 0,!N,l),J(()=>{D(H)},[H,D]),w3(H,()=>{S(P),T(H!==E.initialValue),j.change(H)});let{getButtonProps:te,buttonRef:ne}=f_({disabled:N,native:u}),re=U8(a,M,F,!u,V,y[`aria-label`]),ie={id:u?B:z,role:`switch`,"aria-checked":H,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":re,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&&d_(t,e)}},ae={...j.getValidationProps(N),checked:H,disabled:N,form:o,id:V,name:P,required:p,style:P?J1:q1,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=H_(sg,e.nativeEvent);d?.(t,n),n.isCanceled||ee(t)},onClick(e){e.stopPropagation()},onFocus(){L.current?.focus()},..._===void 0?hh:{value:_}},oe=b.useMemo(()=>({...C,checked:H,disabled:N,readOnly:f,required:p}),[C,H,N,f,p]),se=Nh(`span`,e,{state:oe,ref:[t,L,ne],props:[ie,y,te,e=>j.getValidationProps(N,e)],stateAttributesMapping:ix});return(0,x.jsxs)(ex.Provider,{value:oe,children:[se,!H&&P&&g!==void 0&&(0,x.jsx)(`input`,{type:`hidden`,form:o,name:P,value:g,disabled:N}),(0,x.jsx)(`input`,{...ae,suppressHydrationWarning:!0})]})}),ox=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Nh(`span`,e,{state:tx(),ref:t,stateAttributesMapping:ix,props:a})});function sx(e){let t=b.useRef(!0);t.current&&(t.current=!1,e())}var cx=b.createContext(void 0),lx=b.createContext(void 0);function ux(){let e=b.useContext(cx);if(e===void 0)throw Error(Xm(60));return e}function dx(){let e=b.useContext(lx);if(e===void 0)throw Error(Xm(61));return e}function fx(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 px=(e,t)=>Object.is(e,t);function mx(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function hx(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!fx(e,t,(e,t)=>mx(e,t,n)):e!==t}function gx(e,t,n){return e?e.some(e=>e!==void 0&&mx(t,e,n)):!1}function _x(e,t,n){return e?e.findIndex(e=>e!==void 0&&mx(e,t,n)):-1}function vx(e,t){if(t!==px)return n=>gx(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 yx(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(vx(t,n)):_x(e,t,n);return i===-1?null:i}function bx(e,t,n,r,i,a){return gx(r,t,i)?a!=null&&e>a&&gx(r,n[a],i)?a:e:e===a?yx(n,r,i,!0):a}function xx(e,t,n){return e.filter(e=>!mx(t,e,n))}var Sx={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:n6(t,r)!==``},hasNullItemLabel:(e,t)=>t?e6(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=>mx(t,e,n)):mx(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 Cx(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function wx(e,t){return Math.max(0,e-t)}function Tx(e,t){if(t<=0)return 0;let n=Cx(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 Ex(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=px,highlightItemOnHover:T=!0,children:E}=e,{clearErrors:D}=B8(),{setDirty:O,setTouched:k,setFocused:A,validityData:j,setFilled:M,name:N,disabled:P,validation:F,validationMode:I}=P8(),L=K8({id:t}),R=P||d,z=N??c,[B,V]=wg({controlled:n,default:y?r??mh:r,name:`Select`,state:`value`}),[H,ee]=wg({controlled:a,default:o,name:`Select`,state:`open`}),te=b.useRef([]),ne=b.useRef([]),re=b.useRef(null),ie=b.useRef(null),ae=b.useRef(0),oe=b.useRef(null),se=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}=E3(H),ge=nh(()=>new Oy({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:H,mounted:H,transitionStatus:void 0,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:hh,triggerProps:hh,itemRoot:{props:hh,multiple:y,disabled:R,readOnly:f,isItemEqualToValue:w},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:ph,setOpen:ph,handleScrollArrowVisibility:ph,onOpenChangeComplete:ph,listRef:te,popupRef:re,scrollHandlerRef:ie,scrollArrowsMountedCountRef:ae,valueRef:oe,valuesRef:se,labelsRef:ne,typingRef:ce,selectionRef:de,firstItemTextRef:le,selectedItemTextRef:ue,alignItemWithTriggerActiveRef:fe,initialValueRef:pe},Sx)).current,[_e,ve]=b.useState(!1),{mounted:ye,transitionStatus:be,forceUnmount:xe}=Qv({open:H,ref:re,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=J3(me),De=me??Ee,Oe=b.useMemo(()=>y?``:n6(B,C),[y,B,C]),ke=b.useMemo(()=>y&&Array.isArray(B)?B.map(e=>n6(e,C)):n6(B,C),[y,B,C]);I8(W1(we),L,B,i_(()=>ke),!R,c);let Ae=y?Array.isArray(B)&&B.length>0:B!=null&&Oe!==``;J(()=>{M(Ae)},[Ae,M]),J(function(){let e=yx(se.current,B,w,y);e===null&&(ue.current=null),H||ge.set(`selectedIndex`,e)},[y,H,B,w,ge]),w3(B,()=>{D(z),O(hx(B,j.initialValue,w)),F.change(B)});let je=i_((e,t)=>{let n=t,r=oy(n);s?.(e,n),t.isCanceled||(e||ve(r()),ee(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,H_(Sg))}}),[xe,je,ge]);let Me=i_((e,t)=>{i?.(e,t),t.isCanceled||V(e)}),Ne=i_(e=>{let t=wx(e.scrollHeight,e.clientHeight),n=Tx(e.scrollTop,t),r=n>0,i=n<t;ge.set(`scrollUpArrowVisible`,r),ge.set(`scrollDownArrowVisible`,i)}),Pe=zy({open:H,onOpenChange:je,elements:{reference:we,floating:Te}}),Fe=Wv(Pe,{enabled:!R,event:`mousedown`}),Ie=Xv(Pe),Le=n2(Pe,{enabled:!R,listRef:te,activeIndex:Se,selectedIndex:Ce,disabledIndices:mh,onNavigate(e){(e!==null||H)&&ge.set(`activeIndex`,e)},focusItemOnHover:T}),Re=r2(Pe,{enabled:!R&&(H||!f&&!y),listRef:ne,activeIndex:Se,selectedIndex:Ce,disabledIndices:e=>X3(te.current[e]),onMatch(e){H?ge.set(`activeIndex`,e):Me(se.current[e],H_(sg))},onTyping(e){ce.current=e}}),ze=b.useMemo(()=>bh(Re.reference,Le.reference,Ie.reference,Fe.reference,he),[Fe.reference,Re.reference,Le.reference,Ie.reference,he]),Be=b.useMemo(()=>bh($v,Re.floating,Le.floating,Ie.floating),[Re.floating,Le.floating,Ie.floating]),Ve=Le.item??hh,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`,_),sx(()=>{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:H,mounted:ye,transitionStatus:be,popupProps:Be,triggerProps:ze,itemRoot:He,items:v,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,openMethod:De});let Ue=rh(g,F.inputRef),We=y?void 0:z,Ge=b.useMemo(()=>!y||!Array.isArray(B)||!z?null:B.map(e=>{let t=n6(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)(cx.Provider,{value:ge,children:[(0,x.jsx)(lx.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=H_(sg,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=se.current.findIndex(t=>n6(t,C).toLowerCase()===e||t6(t,S).toLowerCase()===e);r===-1&&(r=se.current.findIndex((t,n)=>{let r=ne.current[n];return r!=null&&r.toLowerCase()===e}));let i=se.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?J1:q1,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ge]})}function Dx(e,t){return e??t}var Ox=`data-popup-side`,kx=400,Ax={...ng,...O8,popupSide:e=>e?{[Ox]:e}:null,value:()=>null},jx=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}=P8(),{labelId:m}=H8(),h=ux(),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=Dx(m,k);K8({id:i});let P=W1(T),F=b.useRef(null),I=F8(y,F),{getButtonProps:L,buttonRef:R}=f_({disabled:y,native:o}),z=h.useStateSetter(`triggerElement`),B=s1(),V=s1(),H=s1();b.useEffect(()=>{if(x)return H.start(kx,()=>{h.context.selectionRef.current.allowUnselectedMouseUp=!0,h.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{H.clear()};h.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},V.clear()},[x,h,V,H]);let ee=bh(w,{id:M,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?E?.id??M1(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,H_(sg,e.nativeEvent)),B.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){h1(T,e.relatedTarget)||(l(!0),I(!1),u===`onBlur`&&d.commit(C))},onMouseDown(e){if(x)return;let t=u_(e.currentTarget);function n(e){if(!F.current)return;let t=e.target;h1(F.current,t)||h1(P.current,t)||R3(e,F.current)||h.context.setOpen(!1,H_(yg,e))}V.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,L),te=d.getValidationProps(y,ee);te.role=`combobox`;let ne={...f,open:x,disabled:y,value:C,readOnly:g,popupSide:j,placeholder:!A};return Nh(`button`,e,{ref:[t,F,R,z],state:ne,stateAttributesMapping:Ax,props:te})}),Mx=b.forwardRef(function(e,t){let n=ux(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,x.jsx)(Tv,{ref:t,...e}):null}),Nx=b.createContext(void 0);function Px(){let e=b.useContext(Nx);if(!e)throw Error(Xm(59));return e}function Fx(e,t){e&&Object.assign(e.style,t)}var Ix={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},Lx={position:`fixed`},Rx=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=vv,style:_,...v}=e,y=ux(),S=dx(),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),y3((I||T)&&C,D===`touch`,O,k);let L=J4({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?Lx:L.positionerStyles,B={open:C,side:R,align:L.align,anchorHidden:L.anchorHidden};J(()=>{y.set(`popupSide`,L.side)},[y,L.side]);let V=o3(e,B,{styles:z,transitionStatus:j,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!w,inert:!C}),H=b.useRef(0),ee=i_(e=>{if(y.context.valuesRef.current.length===0)return;let t=H.current;H.current=e.size;let n=H_(sg);if(t!==0&&!y.state.multiple&&E!==null&&_x(y.context.valuesRef.current,E,A)===-1){let e=y.context.initialValueRef.current,t=e!=null&&_x(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=>_x(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:``};Fx(O,e),Fx(y.context.popupRef.current,e)}}),te=b.useMemo(()=>({...L,side:R,alignItemWithTriggerActive:I,setControlledAlignItemWithTrigger:F,scrollUpArrowRef:M,scrollDownArrowRef:N}),[L,R,I,F]);return(0,x.jsx)(Z4,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:ee,children:(0,x.jsxs)(Nx.Provider,{value:te,children:[w&&T&&(0,x.jsx)(i3,{inert:j4(!C),cutout:k}),V]})})}),zx=`base-ui-disable-scrollbar`,Bx={className:zx,getElement(e){return(0,x.jsx)(`style`,{nonce:e,href:zx,precedence:`base-ui:low`,children:`.${zx}{scrollbar-width:none}.${zx}::-webkit-scrollbar{display:none}`})}},Vx=b.createContext(void 0),Hx={disableStyleElements:!1};function Ux(){return b.useContext(Vx)??Hx}var Wx=`--transform-origin`,Gx={...rg,...Wh},Kx=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=ux(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=dx(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=Px(),_=g4(!0)!=null,v=P4(),{nonce:y,disableStyleElements:S}=Ux(),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=J_(),I=i_(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=Yx(A),i=Xx(A.getBoundingClientRect().height,`y`,r),a=u_(A),o=Mg(A),c=o.getComputedStyle(A),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=qx(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=Jx(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=Cx(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=Cx(g,0,Jx(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]),n1({open:w,ref:s.context.popupRef,onComplete(){w&&s.context.onOpenChangeComplete(!0)}});let L={open:w,transitionStatus:O,side:f,align:p};J(()=>{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]),J(()=>{w||m||(N.current=!1,M.current=!1,Fx(A,P.current))},[w,m,A]),J(()=>{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(Wx),!m){F.request(()=>s.context.handleScrollArrowVisibility(j||e));return}let t=$x(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=Mg(A),i=r.getComputedStyle(A),a=r.getComputedStyle(e),o=u_(k),c=Yx(k),l=Zx(k.getBoundingClientRect(),c),d=Zx(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=qx(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=Zx(n.getBoundingClientRect(),c);T=Zx(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=`${Cx(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=Jx(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),V=(r.visualViewport?.scale??1)!==1&&E_;if(B||V){Fx(A,P.current),g(!1);return}let H=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=Jx(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=Cx(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(Wx,`50% ${i}%`)}(H===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=Mg(A);function t(e){s.context.setOpen(!1,H_(Cg,e))}return H1(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){_&&_4.has(e.key)&&e.stopPropagation()},onScroll(e){j||I(e.currentTarget)},...m&&{style:j?{height:`100%`}:Ix},className:!j&&m?Bx.className:void 0},z=Nh(`div`,e,{ref:[t,s.context.popupRef],state:L,stateAttributesMapping:Gx,props:[D,R,v4(O),o]});return(0,x.jsxs)(b.Fragment,{children:[!S&&Bx.getElement(y),(0,x.jsx)(Uv,{context:d,modal:!1,disabled:!E,openInteractionType:T,returnFocus:a,restoreFocus:!0,children:z})]})});function qx(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Jx(e){return wx(e.scrollHeight,e.clientHeight)}function Yx(e){return J2.getScale(e)}function Xx(e,t,n){return e/n[t]}function Zx(e,t){return S0({x:Xx(e.x,`x`,t),y:Xx(e.y,`y`,t),width:Xx(e.width,`x`,t),height:Xx(e.height,`y`,t)})}var Qx=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function $x(e){let{style:t}=e,n={};for(let[e,r]of Qx)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Qx){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var e5=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=ux(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=Px(),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:Ix},className:u&&d!==`touch`?Bx.className:void 0};return Nh(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),t5=b.createContext(void 0);function n5(){let e=b.useContext(t5);if(!e)throw Error(Xm(57));return e}var r5=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=F_({guess:!0,label:o,textRef:u}),f=ux(),{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);J(()=>{let e=f.context.valuesRef.current;return e[T]=a,()=>{delete e[T]}},[T,a,f]),J(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=bx(T,a,f.context.valuesRef.current,e,_,t),r=n===T,T===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&mx(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}=f_({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?xx(n,a,_):[...n,a];f.context.setValue(r,H_(fg,e))}else f.context.setValue(a,H_(fg,e)),f.context.setOpen(!1,H_(fg,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&&u1(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=Nh(`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)(t5.Provider,{value:I,children:F})})),i5=b.memo(b.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=n5(),a=ux(),{render:o,className:s,style:c,...l}=e;return Nh(`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})})),a5=`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 o5({className:e,size:t=`default`,mono:n,...r}){return(0,x.jsx)(`span`,{"data-slot":`input-control`,className:G(a5,t===`compact`&&`rounded-md before:rounded-[calc(var(--radius-md)-1px)]`,n&&`font-mono tabular-nums`,e),children:(0,x.jsx)(`input`,{className:G(`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 s5({className:e,...t}){return(0,x.jsx)(`span`,{"data-slot":`textarea-control`,className:G(a5,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 c5({className:e,...t}){return(0,x.jsx)(Q8,{"data-slot":`checkbox`,className:G(`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)($8,{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 l5({className:e,...t}){return(0,x.jsx)(ax,{"data-slot":`switch`,className:G(`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)(ox,{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 u5({label:e,description:t,children:n,className:r}){return(0,x.jsxs)(`label`,{className:G(`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 d5({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)(Ex,{value:e,onValueChange:e=>t(String(e??``)),disabled:i,items:n,children:[(0,x.jsxs)(jx,{"aria-label":s,className:G(`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:G(`min-w-0 flex-1 truncate`,!c&&`text-muted-foreground`),children:c?c.label:r}),(0,x.jsx)(Pd,{"aria-hidden":!0,className:`-me-1 !size-3.5 opacity-70`})]}),(0,x.jsx)(Mx,{children:(0,x.jsx)(Rx,{className:`z-[130] select-none`,side:`bottom`,sideOffset:4,align:`start`,alignItemWithTrigger:!0,children:(0,x.jsx)(Kx,{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)(e5,{className:`max-h-(--available-height) overflow-y-auto p-1`,children:n.map(e=>(0,x.jsx)(r5,{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)(i5,{className:`min-w-0 flex-1`,children:e.label})},e.value))})})})})})]})}var f5=`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`,p5=e=>!!e&&/\s/.test(e);function m5(e,t,n){let r=n;for(;r<e.length&&!p5(e[r]);)r++;return/[/\\]/.test(e.slice(t+1,r))}function h5(e){return/^\.?[0-9][0-9,._]*(?:[kKmMbBtT]|[eE][0-9]+)?[.,;:!?)]*$/.test(e)}function g5(e,t){let n=Math.max(0,Math.min(e.length,Math.floor(t))),r=n-1;for(;r>=0&&!p5(e[r]);)r--;let i=r+1,a=e.slice(i,n);if(a.startsWith(`/`))return m5(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 h5(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 _5(e,t){return!!e&&!!t&&e.kind===t.kind&&e.rangeStart===t.rangeStart}function v5(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>=0?e.slice(t+1):e}function y5(e){return e.replace(/[\\[\]*_~&]/g,e=>e===`[`?`[`:e===`]`?`]`:`\\${e}`)}function b5(e){return encodeURI(e).replaceAll(`(`,`%28`).replaceAll(`)`,`%29`).replaceAll(`&`,`%26`).replaceAll(`#`,`%23`).replaceAll(`?`,`%3F`).replaceAll(`\\`,`%5C`)}function x5(e){let t=b5(e),n=/^[a-z][a-z\d+.-]*:/i.test(e)&&!/^[a-z]:[\\/]/i.test(e);return`[${y5(v5(e))}](${n?`./${t}`:t})`}var S5=/(^|\s)\[((?:\\.|	[13];|&(?!#9[13];)|[^[\]\\&]){0,512})\]\(([^)\s]+)\)(?=\s|$)/g,C5=/(^|\s)@(?:"((?:\\.|[^"\\])*)"|([^\s@"]+))(?=\s)/g,w5=/(^|\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,T5=/^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*(?:\/[^\s@"]+)*$/,E5=/^[\p{ID_Start}_$][\p{ID_Continue}.$]*\(/u;function D5(e,t){let n=[];for(let t of e.matchAll(S5)){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!==v5(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(C5)){let r=t[1]||``,i=t[2],a=i===void 0?t[3]||``:i.replace(/\\(["\\])/g,`$1`);if(!a||i===void 0&&(T5.test(a)||E5.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(w5)){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 O5(e,t){let n=[],r=0;for(let i of D5(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 k5(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 A5(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 j5(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=A5(e,t);if(r!==null)return n.fuzzy+r}return null}function M5(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 N5(e,t){let n=[j5(e.name.toLowerCase(),t,{exact:0,prefix:2,boundary:4,includes:6,fuzzy:100},[`-`,`_`,`/`]),j5(e.description.toLowerCase(),t,{exact:30,prefix:32,boundary:34,includes:36}),j5(e.source.toLowerCase(),t,{exact:40,prefix:42})].filter(e=>e!==null);return n.length?Math.min(...n):null}function P5(e,t){let n=t.replace(/^\/+/,``);if(!n)return 0;let r=[j5(e.name.toLowerCase(),n,{exact:0,prefix:2,boundary:4,includes:6,fuzzy:100},[`-`,`_`,`/`,`:`]),j5(e.description.toLowerCase(),n,{exact:20,prefix:22,boundary:24,includes:26})].filter(e=>e!==null);return r.length?Math.min(...r):null}function F5(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 I5(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=F5(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 L5=`<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>`,R5=`<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>`,z5=`<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>`,B5=`<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>`,V5=`<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>`,H5=`<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>`,U5=`<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>`,W5=`<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>`,G5=`<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>`,K5=`<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>`,q5=`<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>`,J5=`<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>`,Y5=`<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>`,X5=`<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>`,Z5=`<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>`,Q5=`<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>`,$5=`<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>`,e7=`<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>`,t7=`<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>`,n7=`<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>`,r7=`<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>`,i7=`<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>`,a7=`<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>`,o7=`<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>`,s7=`<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>`,c7=`<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>`,l7=`<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>`,u7=`<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>`,d7=`<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>`,f7=`<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>`,p7=`<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>`,m7=`<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>`,h7=`<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>`,g7=`<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>`,_7=`<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>`,v7=`<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>`,y7=`<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>`,b7=`<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>`,x7=`<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>`,S7=`<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>`,C7=`<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>`,w7=`<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>`,T7=`<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>`,E7=`<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>`,D7=`<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>`,O7=`<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>`,k7=`<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>`,A7=`<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>`,j7=`<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>`,M7=`<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>`,N7=`<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>`,P7=`<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>`,F7=`<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>`,I7=[B5,G5,q5,J5,Y5,X5,$5,e7,t7,r7,i7,a7,o7,s7,c7,m7,g7,_7,C7,w7,D7,O7,`<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>`],L7=[R5,z5,V5,H5,U5,W5,K5,Z5,Q5,n7,l7,u7,d7,f7,p7,h7,v7,y7,b7,x7,S7,T7,E7,k7,A7,j7,M7,N7,P7,F7];function R7(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
|
|
179
|
+
`)}\n</svg>`)}var z7=R7(L5,I7),B7={minimal:L5,standard:z7,complete:R7(z7,L7)},V7={".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`},H7={"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`},U7={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},W7=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`]),G7=new Set([`complete`]);function K7(e){return B7[e===`none`?`minimal`:e]}function q7(e){return`file-tree-builtin-${e}`}function J7(e){return e!==`none`&&G7.has(e)}function Y7(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=V7[t.toLowerCase()];if(i!=null&&(r||W7.has(i)))return i;for(let e of n){if(r){let t=U7[e];if(t!=null)return t}let t=H7[e];if(t!=null&&(r||W7.has(t)))return t}return`default`}function X7(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function Z7(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(X7(e)?`none`:`complete`),colored:e.colored??!0}}var Q7=e=>e.trim().toLowerCase(),$7=e=>e.split(`/`).at(-1)??e,e9=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 t9(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function n9(e){let t=Z7(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(Q7(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=$7(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return t9(l,e);for(let[t,n]of a)if(c.includes(t))return t9(n,e);let u=e9(s);for(let t of u){let n=i.get(t);if(n!=null)return t9(n,e)}let d=Y7(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return t9(t,e)}return{name:q7(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:t9(s,e)}}}var r9={set:`complete`,colored:!0},i9=n9(r9),a9={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`]},o9={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`},s9=`forge-file-icon-sprite`;function c9(){if(typeof document>`u`||!document.body||document.getElementById(s9))return;let e=document.createElement(`div`);e.id=s9,e.setAttribute(`aria-hidden`,`true`),e.style.cssText=`position:absolute;width:0;height:0;overflow:hidden;pointer-events:none`,e.innerHTML=K7(`complete`),document.body.prepend(e)}function l9(e){let t=i9.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 u9=b.memo(function({path:e,kind:t=`file`,className:n}){let r=Ju();if(c9(),t===`directory`)return(0,x.jsx)(Df,{className:G(`size-4 shrink-0 text-icon-muted`,n)});let i=l9(e);if(!i)return(0,x.jsx)(yf,{className:G(`size-4 shrink-0 text-icon-muted`,n)});let a=a9[o9[i.token]||`gray`];return(0,x.jsx)(`svg`,{"aria-hidden":`true`,"data-file-icon":i.name,className:G(`size-4 shrink-0`,n),style:{color:a[+!!r]},viewBox:i.viewBox,children:(0,x.jsx)(`use`,{href:`#${i.name}`})})});function d9(){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 f9=new Set;function p9(e){f9.add(e)}function m9({seg:e,skillInfo:t}){let n=e.type===`mention`?v5(e.path)||e.path:e.name,r=e.type===`mention`&&(/[\\/]$/.test(e.path)||f9.has(e.path));return(0,x.jsx)(Tb,{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)(u9,{path:e.path,kind:r?`directory`:`file`,className:`size-[1em]`}):(0,x.jsx)(d9,{}),(0,x.jsx)(`span`,{className:`block min-w-0 truncate`,children:n})]})})}function h9(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+=h9(e)):t+=e.dataset.source)}),t}var g9=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 h9(e||document.body).length;let n=document.createRange();return n.setStart(e,0),n.setEnd(t.anchorNode,t.anchorOffset),h9(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=O5(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||O5(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=h9(e),n=f();O5(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:e=>{e.preventDefault();let t=e.clipboardData.getData(`text/plain`);document.execCommand(`insertText`,!1,t)},onDrop:e=>e.preventDefault(),className:e.className}),s.map((e,t)=>(0,Q_.createPortal)((0,x.jsx)(m9,{seg:e.seg,skillInfo:e.seg.type===`skill`?a?.get(e.seg.name):void 0}),e.el,`${t}:${e.seg.source}`))]})});function _9({part:e}){let t=`${v5(e.filePath)} ${e.rangeLabel}`.trim();return(0,x.jsx)(Tb,{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)(lp,{"aria-hidden":`true`}),(0,x.jsx)(`span`,{className:`truncate`,children:t})]})})}function v9({text:e,names:t,skills:n}){let r=b.useMemo(()=>{let n=O5(`${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)(m9,{seg:e,skillInfo:e.type===`skill`?n?.get(e.name):void 0})},t))})}function y9({text:e,skills:t}){let n=b.useMemo(()=>t?new Set(t.keys()):void 0,[t]),r=b.useMemo(()=>I5(e),[e]);return(0,x.jsx)(x.Fragment,{children:r.map((e,r)=>e.type===`text`?(0,x.jsx)(v9,{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)(_9,{part:e})},r))})}var b9=[{command:`model`,description:`Switch response model for this chat`},{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}],x9=new Set([`clear`,`compact`,`model`,`login`,`logout`,`exit`,`quit`,`config`]),S9=80;function C9(e,t){let[n,r]=b.useState(e);return b.useEffect(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function w9(e){return U({...Au().composer.skills.queryOptions({projectId:e}),staleTime:3e4})}function T9(e){let t=Au(),n=e.trigger?.kind??null,r=n===`path`?e.trigger.query:``,i=C9(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.composer.claudeCommands.queryOptions(),enabled:e.claude&&n===`slash-command`});return{items:(()=>{if(!e.trigger)return[];if(e.trigger.kind===`path`)return(r.trim()?i===r?(o.data?.entries||[]).slice(0,S9):[]:(s.data||[]).map(e=>({path:e.path,kind:e.type===`dir`?`directory`:`file`}))).map(e=>({id:`path:${e.kind}:${e.path}`,type:`path`,path:e.path,kind:e.kind,label:v5(e.path),description:e.path.slice(0,Math.max(0,e.path.lastIndexOf(`/`)))}));if(e.trigger.kind===`skill`)return M5(e.skills||[],e.trigger.query,N5,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=b9.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?(c.data||[]).filter(t=>!x9.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`})):[],l=(e.skills||[]).map(e=>({id:`skill:${e.name}`,type:`skill`,skill:e,label:`/skill:${e.name}`,description:e.description,viaSlash:!0})),u=e.trigger.query.trim().toLowerCase();if(!u)return[...n,...a,...l];let d=[];for(let e of[...n,...a,...l]){let t;if(e.type===`skill`){let n=u.startsWith(`skill:`)?u.slice(6):u;t=u===`skill`?0:n?N5(e.skill,n):0,t===null&&`skill`.startsWith(u)&&(t=2**53-1)}else t=P5({name:e.type===`command`?e.command:e.label.slice(1),description:e.description},u);if(t===null)continue;let n=e.type===`command`?0:e.type===`provider-command`?1:2;d.push({item:e,score:t,key:`${n}\u0000${e.label}`})}return d.sort((e,t)=>e.score-t.score||e.key.localeCompare(t.key)),d.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 E9={model:Sd,clear:xm,compact:pp,push:zm,usage:Od},D9={project:{icon:Df,label:`Project`,skillLabel:`Project Skill`},personal:{icon:Vm,label:`Personal`,skillLabel:`Personal Skill`},rpf:{icon:Cp,label:`rpf`,skillLabel:`rpf Skill`}},O9={path:`Files and folders`,"slash-command":`Commands`,skill:`Skills`};function k9(e,t){return`${e}-${encodeURIComponent(t)}`}function A9(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?O9[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)(j9,{id:k9(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 j9({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`?E9[t.command]:t.type===`provider-command`?jm:null,u=t.type===`skill`?D9[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:G(`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)(u9,{path:t.path,kind:t.kind}):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)(Tb,{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 M9=new Map,N9=new Set,P9=[];function F9(){for(let e of N9)e()}var I9=0;function L9(){return I9+=1,`file-comment-${Date.now()}-${I9}`}function R9(e,t){let n=M9.get(e)||[],r=n.findIndex(e=>e.id===t.id);M9.set(e,r<0?[...n,t]:n.map((e,n)=>n===r?t:e)),F9()}function z9(e,t){let n=M9.get(e);n?.some(e=>e.id===t)&&(M9.set(e,n.filter(e=>e.id!==t)),F9())}function B9(e){let t=M9.get(e)||P9;return t.length&&(M9.delete(e),F9()),t}function V9(e){return(0,b.useSyncExternalStore)(e=>(N9.add(e),()=>N9.delete(e)),()=>e&&M9.get(e)||P9)}var H9=null;function U9(e){return H9=e,()=>{H9===e&&(H9=null)}}function W9(e){return H9?H9(e):!1}function G9(e,t){return e===t?`L${e}`:`L${e} to L${t}`}function K9(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 q9(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`)}function J9(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="${q9(`file:${e.filePath}`)}" sectionTitle="File comment" filePath="${q9(e.filePath)}" startIndex="${e.startLine-1}" endIndex="${e.endLine-1}" rangeLabel="${q9(G9(e.startLine,e.endLine))}">`,e.text.trim(),`${n}${K9(e.filePath)}`,e.lines.trimEnd(),n,`</review_comment>`].join(`
|
|
183
|
+
`)}function Y9(e,t){return t.length?[e.trim(),...t.map(J9)].filter(Boolean).join(`
|
|
184
|
+
|
|
185
|
+
`):e}function X9({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:G(`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 Z9({className:e}){return(0,x.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":!0,className:G(`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 Q9({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:G(`text-foreground`,e),children:t})}function $9({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 eS({className:e}){return(0,x.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":!0,className:G(`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 tS={"claude-subscription":X9,anthropic:Z9,openai:Q9,google:$9,zai:eS};function nS(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 rS(e){let t=e?.trim();return t&&/^#[0-9a-fA-F]{6}$/.test(t)?t:void 0}function iS(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 aS({kind:e,className:t,name:n,accent:r,badge:i}){let a=tS[e||``],o=a?(0,x.jsx)(a,{className:G(`size-4 shrink-0`,t)}):e===`mock`?(0,x.jsx)(Up,{className:G(`size-4 shrink-0 text-muted-foreground`,t)}):(0,x.jsx)(Gp,{className:G(`size-4 shrink-0 text-muted-foreground`,t)}),s=rS(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:G(`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:iS(s)}:void 0,children:nS(n)})]})}var oS=`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 sS({kind:e,name:t,accent:n,badge:r}){return(0,x.jsx)(aS,{kind:e,name:t,accent:n,badge:r})}var cS=(e,t)=>e.find(e=>e.id===t)?.label||``;function lS({value:e,onChange:t,open:n,onOpenChange:r}){let i=U(Au().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)(a8,{section:`providers`,className:oS,children:[(0,x.jsx)(Sd,{}),` Connect a provider`]}):(0,x.jsxs)(mb,{...n===void 0?{}:{open:n,onOpenChange:e=>r?.(e)},children:[(0,x.jsxs)(hb,{className:G(oS,`max-w-48 sm:max-w-56`),children:[a?(0,x.jsx)(sS,{kind:a.kind,name:a.name,accent:a.accentColor,badge:a.badge}):(0,x.jsx)(Sd,{}),(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:cS(s,l)}),(0,x.jsx)(Pd,{className:`!size-3 opacity-60`})]}),(0,x.jsx)(gb,{side:`top`,align:`end`,className:G(`min-w-56`,s.length>0&&`p-0`),children:(0,x.jsxs)(`div`,{className:G(s.length>0&&`flex max-h-86.5`),children:[(0,x.jsx)(`div`,{className:G(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)(yb,{}),(0,x.jsxs)(vb,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(sS,{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)(_b,{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)(Md,{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)(_b,{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)(Md,{className:`!text-foreground`})]},n.id)})})]})]})})]})}function uS({value:e,onChange:t}){let n=e||{remoteWrites:!1,browserWrites:!1},r=n.remoteWrites||n.browserWrites?`Writes on`:`Safe`;return(0,x.jsxs)(mb,{children:[(0,x.jsxs)(hb,{className:oS,children:[n.remoteWrites||n.browserWrites?(0,x.jsx)(pm,{className:`!text-warning-foreground`}):(0,x.jsx)(ap,{}),r,(0,x.jsx)(Pd,{className:`!size-3 opacity-60`})]}),(0,x.jsxs)(gb,{side:`top`,align:`end`,className:`w-80`,children:[(0,x.jsx)(vb,{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)(yb,{}),(0,x.jsxs)(_b,{disabled:!t,closeOnClick:!1,onClick:()=>t?.({...n,remoteWrites:!n.remoteWrites}),children:[(0,x.jsx)(_m,{}),(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)(dS,{on:n.remoteWrites})]}),(0,x.jsxs)(_b,{disabled:!t,closeOnClick:!1,onClick:()=>t?.({...n,browserWrites:!n.browserWrites}),children:[(0,x.jsx)(_m,{}),(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)(dS,{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 dS({on:e}){return(0,x.jsx)(`span`,{"aria-hidden":!0,className:G(`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:G(`absolute size-3 rounded-full bg-white shadow-xs transition-transform`,e?`translate-x-3.5`:`translate-x-0.5`)})})}function fS({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:_}){let[v,y]=b.useState(m),S=b.useRef(null),{projectId:C}=qi({strict:!1}),w=V9(C);b.useEffect(()=>U9(e=>(y(t=>t&&!/\s$/.test(t)?`${t} ${e}`:t+e),S.current?.focus(),!0)),[]);let T=Au(),E=Yi(),D=i8(),O=U(T.models.queryOptions()).data?.find(e=>e.connectionId===r?.connectionId)?.kind===`claude-subscription`,k=w9(C),A=b.useMemo(()=>new Map((k.data||[]).map(e=>[e.name,e.description])),[k.data]),j=pS(),[M,N]=b.useState({id:null,key:null}),[P,F]=b.useState(!1),I=b.useId(),L=T9({trigger:j.trigger,projectId:C,claude:O,canCompact:!!u&&!!l,canPush:!!C,skills:k.data,skillsLoading:k.isPending}),R=j.trigger?`${j.trigger.kind}:${j.trigger.query}`:null,z=L.items.length===0?null:M.key===R&&M.id&&L.items.some(e=>e.id===M.id)?M.id:L.items[0].id,B=!!j.trigger&&!a,V=e=>{let t=j.trigger;if(!t)return;let n=k5(v,t.rangeStart,t.rangeEnd,e);j.reset(null),S.current?.setText(n.text,n.cursor)},H=e=>{if(e.type===`path`)return e.kind===`directory`&&p9(e.path),V(`${x5(e.path)} `);if(e.type===`skill`)return V(`$${e.skill.name} `);if(e.type===`provider-command`)return V(`/${e.name} `);if(e.command===`compact`)return V(`/compact `);V(``),e.command===`model`?F(!0):e.command===`clear`&&C?E({to:`/p/$projectId`,params:{projectId:C}}):e.command===`push`?Wu({pushOpen:!0}):e.command===`usage`&&D(`usage`)},ee=()=>{let t=v.trim();!t&&!w.length||n||(/^\/compact$/i.test(t)&&u?(u(),y(``),j.reset(null)):(e(C?Y9(t,B9(C)):t),y(``),j.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:[B&&(0,x.jsx)(A9,{listId:I,items:L.items,triggerKind:j.trigger?.kind??null,isLoading:L.isLoading,emptyText:L.emptyText,activeId:z,onHighlight:e=>N({id:e,key:R}),onSelect:H}),(0,x.jsxs)(`div`,{className:`composer-surface relative isolate z-10 rounded-2xl shadow-[var(--shadow-composer)]`,children:[w.length>0&&C&&(0,x.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 px-4 pt-3`,children:w.map(e=>(0,x.jsx)(mS,{comment:e,onRemove:()=>z9(C,e.id)},e.id))}),(0,x.jsx)(`div`,{className:`px-4 pt-3.5 pb-2`,children:(0,x.jsx)(g9,{ref:S,autoFocus:f,value:v,skills:A,onChange:(e,t)=>{y(e),j.edited(g5(e,t))},onCaret:e=>j.caretMoved(g5(v,e)),onBlur:()=>j.reset(null),onKeyDown:e=>{if(!e.nativeEvent.isComposing){if(B&&L.items.length>0){let t=Math.max(0,L.items.findIndex(e=>e.id===z));if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let n=L.items.length,r=L.items[(t+(e.key===`ArrowDown`?1:n-1))%n];N({id:r.id,key:R});return}if(e.key===`Enter`&&!e.shiftKey||e.key===`Tab`){e.preventDefault(),H(L.items[t]);return}}B&&e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),j.dismiss(j.trigger)):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),ee())}},menuOpen:B,ariaControls:I,ariaActiveDescendant:B&&z?k9(I,z):void 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)(_m,{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)(q,{size:`xs`,variant:`outline`,onClick:()=>o?.(!1),children:`Decline`}),(0,x.jsx)(q,{size:`xs`,onClick:()=>o?.(!0),children:`Approve`}),(0,x.jsxs)(mb,{children:[(0,x.jsx)(hb,{render:(0,x.jsx)(q,{size:`icon-xs`,variant:`outline`,"aria-label":`More approval options`,title:`More approval options`}),children:(0,x.jsx)(lf,{})}),(0,x.jsxs)(gb,{side:`top`,align:`end`,children:[a.always&&(0,x.jsx)(_b,{onClick:()=>o?.(!0,!0),children:`Always allow this session`}),(0,x.jsx)(_b,{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)(Tb,{label:`Attach files (coming soon)`,children:(0,x.jsx)(q,{variant:`ghost`,size:`icon-sm`,disabled:!0,children:(0,x.jsx)(Np,{})})}),l&&(0,x.jsx)(Tb,{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)(pp,{className:G(d&&`animate-pulse`)}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:l})]})}),(0,x.jsx)(`span`,{className:`ml-auto`}),s&&(0,x.jsx)(Tb,{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)(uS,{value:g,onChange:_}),(0,x.jsx)(lS,{value:r,onChange:i,open:P,onOpenChange:F}),(0,x.jsx)(`span`,{className:`w-1`}),n?(0,x.jsx)(Tb,{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:ee,disabled:!v.trim()&&!w.length||!r,"aria-label":`Send`,title:`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 pS(){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(_5(r.current,e))return i(null);r.current=null,i(e)},caretMoved(e){_5(r.current,e)||(r.current=null),i(_5(n.current,e)?e:null)},dismiss(e){r.current=e,i(null)},reset(e){r.current=null,i(e)}}}function mS({comment:e,onRemove:t}){let n=`${e.filePath.slice(e.filePath.lastIndexOf(`/`)+1)} ${G9(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)(Tb,{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:G9(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)(lp,{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)(Gm,{className:`size-3`})})]})}var hS=`#2563eb`;function gS(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 _S({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 vS=e=>Math.min(1,Math.max(0,e));function yS(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(vS((t.clientX-n.left)/n.width),vS((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 bS({value:e,onPreview:t,onCommit:n,showAdd:r}){let[i,a]=b.useState(()=>gS(e)),[o,s]=b.useState(null),c=_S(i),l=b.useRef(null),u=(e,r)=>{a(e);let i=_S(e);if(!r)return n(i);l.current=i,t(i)},d=()=>{let e=l.current;l.current=null,e&&n(e)},f=yS((e,t)=>u({...i,s:e,v:1-t},!0),d),p=yS(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:vS(i.s+(r===`ArrowLeft`?-n:n))}:{...i,v:vS(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)(o5,{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(gS(t)),n(t.toLowerCase()))},onBlur:()=>s(null)}),r&&(0,x.jsx)(Sb,{render:(0,x.jsx)(q,{size:`sm`,onClick:()=>n(c),children:`Add color`})})]})]})}function xS({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)(xb,{render:(0,x.jsx)(q,{size:`icon-sm`,variant:`ghost-muted`,className:G(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)(qp,{"aria-hidden":!0})}),(0,x.jsxs)(Cb,{children:[(0,x.jsx)(bS,{value:o||hS,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)(Sb,{render:(0,x.jsxs)(q,{size:`sm`,variant:`ghost-muted`,className:`w-full justify-start`,onClick:()=>s(``),children:[(0,x.jsx)(Gm,{"aria-hidden":!0}),` Clear color`]})})})]})]})}function SS(e){return`setting-${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)}`}var CS=(e,t,n)=>({id:`${e}:${t}`,title:t,section:e,target:SS(t),terms:n}),wS=(e,t,n)=>({id:`${e}:${t}`,title:t,section:e,terms:n}),TS=[CS(`general`,`rpf home`,`RPFORGE_HOME folder data profiles keys chats location`),CS(`general`,`Key store`,`encryption credentials keychain secrets`),CS(`general`,`Version`,`rpf version`),CS(`appearance`,`Theme`,`dark light system mode color scheme`),wS(`providers`,`Add provider`,`connect api key anthropic openai google z.ai glm claude subscription`),wS(`providers`,`API key`,`key token secret provider`),wS(`providers`,`Models`,`model list favorite custom refresh reasoning`),wS(`providers`,`Claude sign-in`,`claude subscription login binary path CLAUDE_CONFIG_DIR`),wS(`usage`,`Usage and spend`,`cost tokens price money chats models`),wS(`instances`,`Instances`,`servicenow profile sign in credentials instance url oauth`),CS(`projects`,`Projects folder`,`new projects location default folder`),wS(`projects`,`Remove project`,`delete forget project`),CS(`doctor`,`Check this computer and an instance`,`doctor diagnose health fix problems`),wS(`skills`,`Skills`,`claude skills install update react portal`),wS(`keybindings`,`Keyboard shortcuts`,`keybindings hotkeys keys`),CS(`diffs`,`Diff layout`,`split unified side by side`),CS(`diffs`,`Hide whitespace changes`,`whitespace spaces ignore`),CS(`diffs`,`Diff colors`,`red green blue orange colorblind`),CS(`about`,`Welcome page`,`onboarding first run`),CS(`about`,`Open-source licenses`,`legal notices`),wS(`about`,`Check for updates`,`update upgrade new version`),wS(`licenses`,`Third-party notices`,`licenses legal open source`)];function ES(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()}function DS(e,t,n){return e===t?5:e.startsWith(t)?4:e.includes(t)?3:n.every(t=>e.includes(t))?2:0}function OS(e,t,n=TS){let r=ES(e);if(!r)return[];let i=r.split(` `);return n.flatMap((e,n)=>{let a=ES(e.title),o=[a,ES(t[e.section]||``),ES(e.terms||``)];return i.every(e=>o.some(t=>t.includes(e)))?[{item:e,index:n,rank:Math.max(DS(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 kS(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 AS=[{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`}],jS=Object.fromEntries(AS.map(e=>[e.kind,e.label]));jS.mock=`Replay (development)`;var MS={general:`https://api.z.ai/api/paas/v4`,coding:`https://api.z.ai/api/coding/paas/v4`};function NS({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 PS({title:e,description:t,children:n}){return(0,x.jsxs)(`div`,{id:typeof e==`string`?SS(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 FS(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 IS(){let e=Fa({select:e=>e.location.pathname});return/^\/p\/([^/]+)/.exec(e)?.[1]||``}function LS({at:e}){return e?yu(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:yu(e)}),` ago`]}):(0,x.jsx)(x.Fragment,{children:`Not checked yet`})}function RS(){let e=Au(),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=at(e.claude.refresh.mutationOptions()),c=at(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)(NS,{title:`Providers and models`,plain:!0,action:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(q,{size:`xs`,variant:`ghost-muted`,"aria-label":`Refresh provider status`,onClick:()=>a&&s.mutate(),children:[(0,x.jsx)(Yp,{className:G(s.isPending&&`animate-spin`)}),s.isPending?`Refreshing providers`:(0,x.jsx)(LS,{at:m})]}),(0,x.jsx)(q,{size:`icon-xs`,variant:`ghost`,"aria-label":`Add provider`,title:`Add provider`,onClick:()=>f(!0),children:(0,x.jsx)(qp,{})})]}),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=FS(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:G(`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)(sS,{kind:e.kind,name:e.name,accent:e.accentColor,badge:BS(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:G(`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)(l5,{checked:e.enabled,"aria-label":`Turn ${e.name} ${e.enabled?`off`:`on`}`,onCheckedChange:t=>c.mutate({connection:zS({...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)(qp,{className:`size-4`})}),`Add provider`]})]})}),(0,x.jsx)(`div`,{className:`min-w-0 space-y-6 py-4`,children:p?(0,x.jsx)(VS,{c:p,claude:o.data,badge:BS(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)(q,{size:`sm`,className:`mt-4`,onClick:()=>f(!0),children:[(0,x.jsx)(qp,{}),` Add provider`]})]})})]})})}),(0,x.jsx)(JS,{conns:i}),(0,x.jsx)(YS,{}),(0,x.jsx)(ZS,{open:d,onOpenChange:f,existing:i.map(e=>e.id),devMock:!!r.data?.devMock,onAdded:e=>u(e)})]})}function zS(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 BS(e,t){return!!e.accentColor||t.filter(t=>t.kind===e.kind&&(t.enabled||!e.enabled)).length>1}function VS({c:e,claude:t,badge:n,onRemoved:r}){let i=Au(),a=C(),o=()=>a.invalidateQueries({queryKey:i.settings.get.queryKey()}),s=at(i.settings.saveConnection.mutationOptions({onSuccess:o})),c=at(i.settings.removeConnection.mutationOptions({onSuccess:o})),l=at(i.settings.testConnection.mutationOptions({onSuccess:o})),u=at(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=FS(e,t),k=(t,n)=>s.mutate({connection:zS({...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)(sS,{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)(kb,{variant:`outline`,children:jS[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)(q,{size:`xs`,variant:`ghost-muted`,onClick:()=>D(!1),children:`Cancel`}),(0,x.jsx)(q,{size:`xs`,variant:`destructive`,onClick:()=>c.mutate({id:e.id},{onSuccess:r}),children:`Remove`})]}):(0,x.jsx)(q,{size:`icon-xs`,variant:`ghost`,"aria-label":`Remove ${e.name}`,title:`Remove`,onClick:()=>D(!0),children:(0,x.jsx)(Fm,{})})})]}),(0,x.jsx)(NS,{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)(PS,{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:G(`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:G(`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)(q,{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)(PS,{title:`Display name`,description:`Shown in the provider list and the model picker. The accent color badges its mark.`,children:[(0,x.jsx)(xS,{name:e.name,value:e.accentColor,onCommit:e=>k({accentColor:e||void 0})}),(0,x.jsx)(o5,{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)(PS,{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)(o5,{size:`compact`,type:`password`,className:`w-56`,autoComplete:`off`,placeholder:`Paste the key`,value:p,onChange:e=>m(e.target.value)}),(0,x.jsx)(q,{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)(q,{size:`xs`,variant:`outline`,onClick:()=>g(!0),children:`Replace`})]})}),e.kind===`zai`&&(0,x.jsx)(PS,{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:MS[t]}),className:G(`h-6 rounded-md px-2.5 text-xs`,(e.baseURL||MS.general)===MS[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)(PS,{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)(o5,{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)(PS,{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)(PS,{title:`Binary path`,description:`Leave empty for the Claude Code build that comes with rpf.`,children:(0,x.jsx)(o5,{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)(PS,{title:`CLAUDE_CONFIG_DIR path`,description:`Another Claude Code profile (its sign-in and history).`,children:(0,x.jsx)(o5,{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)(US,{c:e,onSave:e=>k({environment:e})}),(0,x.jsx)(KS,{c:e,onSave:(e,t)=>k({models:e,defaultModel:t})})]})}var HS=0;function US({c:e,onSave:t}){let[n,r]=b.useState(()=>(e.environment||[]).map(e=>({...e,id:HS++}))),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)(NS,{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)(PS,{title:`Variables`,description:`API keys, base URLs and other settings Claude Code reads from its environment.`,children:(0,x.jsxs)(q,{size:`xs`,variant:`outline`,onClick:()=>r([...n,{id:HS++,name:``,sensitive:!0}]),children:[(0,x.jsx)(qp,{}),` 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)(WS,{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 WS({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)(o5,{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)(o5,{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)(q,{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)(ap,{}):(0,x.jsx)(rp,{})}),(0,x.jsx)(q,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Remove environment variable ${l}`,onClick:i,children:(0,x.jsx)(Gm,{})}),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 GS(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 KS({c:e,onSave:t}){let n=at(Au().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)(NS,{title:`Models`,plain:!0,action:e.kind!==`mock`&&e.kind!==`claude-subscription`&&(0,x.jsxs)(q,{size:`xs`,variant:`ghost-muted`,disabled:n.isPending,onClick:f,children:[(0,x.jsx)(Yp,{className:G(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)(o5,{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)(q,{size:`xs`,variant:`ghost-muted`,onClick:()=>t(e.models.map(e=>({...e,hidden:!1})),e.defaultModel),children:`Show all`}),(0,x.jsx)(q,{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:G(`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)(Tm,{className:G(`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:GS(n,e.models).join(` · `)}),(0,x.jsxs)(`span`,{className:`flex gap-0.5 opacity-0 group-hover:opacity-100`,children:[(0,x.jsx)(q,{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)(Gf,{}):(0,x.jsx)(Uf,{})}),(0,x.jsx)(q,{size:`xs`,variant:`ghost-muted`,disabled:r===0,onClick:()=>m(r,-1),"aria-label":`Move up`,children:`↑`}),(0,x.jsx)(q,{size:`xs`,variant:`ghost-muted`,disabled:r===e.models.length-1,onClick:()=>m(r,1),"aria-label":`Move down`,children:`↓`}),(0,x.jsx)(q,{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)(Gm,{})})]}),(0,x.jsx)(l5,{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)(o5,{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)(q,{size:`xs`,variant:`outline`,onClick:p,children:[(0,x.jsx)(qp,{}),` Add custom model`]}),s&&(0,x.jsx)(`span`,{className:`text-xs text-destructive-foreground`,children:s})]})]})})}function qS({value:e,onChange:t,none:n}){let r=U(Au().models.queryOptions()),i=r.data?.find(t=>t.connectionId===e?.connectionId),a=i?.models.find(t=>t.id===e?.model);return(0,x.jsxs)(mb,{children:[(0,x.jsxs)(hb,{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)(sS,{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)(Pd,{className:`size-3 opacity-60`})]}),(0,x.jsxs)(gb,{align:`end`,className:`min-w-64`,children:[n&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(_b,{onClick:()=>t(null),children:[(0,x.jsx)(`span`,{className:`flex-1`,children:n}),!e&&(0,x.jsx)(Md,{})]}),(0,x.jsx)(yb,{})]}),r.data?.map(n=>(0,x.jsxs)(b.Fragment,{children:[(0,x.jsxs)(vb,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(sS,{kind:n.kind}),` `,n.name]}),n.models.map(r=>(0,x.jsxs)(_b,{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)(Md,{})]},r.id))]},n.connectionId))]})]})}function JS({conns:e}){let t=Au(),n=C(),r=U(t.settings.get.queryOptions()),i=IS(),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=at(t.settings.setDefault.mutationOptions({onSuccess:o})),c=at(t.settings.setProjectDefault.mutationOptions({onSuccess:o}));if(!e.length)return null;let l=i&&r.data?.projects?.[i]||{};return(0,x.jsxs)(NS,{title:`Defaults`,children:[(0,x.jsx)(PS,{title:`Chat model`,description:`New chats start with it. Yours to set; each chat keeps its own picker.`,children:(0,x.jsx)(qS,{value:r.data?.defaults.chat,onChange:e=>s.mutate({which:`chat`,model:e})})}),(0,x.jsx)(PS,{title:`Helper model`,description:`Chat titles and compaction summaries.`,children:(0,x.jsx)(qS,{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)(PS,{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)(kb,{variant:`info`,children:`Overridden for this project`})]}),description:`Replaces the chat model above for new chats in this project.`,children:(0,x.jsx)(qS,{value:l.chat,none:`Use default`,onChange:e=>c.mutate({projectId:i,which:`chat`,model:e})})}),(0,x.jsx)(PS,{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)(kb,{variant:`info`,children:`Overridden for this project`})]}),children:(0,x.jsx)(qS,{value:l.helper,none:`Use default`,onChange:e=>c.mutate({projectId:i,which:`helper`,model:e})})})]})]})}function YS(){let e=Au(),t=C(),n=U(e.settings.prices.queryOptions()),r=at(e.settings.setPrice.mutationOptions({onSuccess:()=>t.invalidateQueries({queryKey:e.settings.prices.queryKey()})}));return n.data?.length?(0,x.jsxs)(NS,{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)(XS,{row:e,onSave:t=>r.mutate({key:e.key,price:t})},e.key))]}):null}function XS({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)(o5,{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 ZS({open:e,onOpenChange:t,existing:n,devMock:r,onAdded:i}){let a=Au(),o=C(),s=at(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?[...AS,{kind:`mock`,label:`Replay (development)`,description:`Scripted streams, no network`}]:AS,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)(Eb,{open:e,onOpenChange:t,children:(0,x.jsxs)(Db,{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)(q,{variant:`outline`,size:`sm`,onClick:()=>c===0?t(!1):l(c-1),children:c===0?`Cancel`:`Back`}),c===1&&(0,x.jsx)(q,{size:`sm`,disabled:!!O,onClick:()=>l(2),children:`Next`}),c===2&&(0,x.jsx)(q,{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:MS.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:G(`flex items-center gap-2`,t===c?`font-medium text-foreground`:`text-muted-foreground`),children:[(0,x.jsx)(`span`,{className:G(`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)(Md,{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)(sS,{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)(u5,{label:`Label`,description:`Shown in the provider list.`,children:(0,x.jsx)(o5,{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)(u5,{label:`Instance ID`,description:`Letters, digits, '-', or '_'.`,children:(0,x.jsx)(o5,{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)(u5,{label:`Base URL`,description:`The endpoint that serves /chat/completions and /models.`,children:(0,x.jsx)(o5,{mono:!0,placeholder:`https://…/v1`,value:S,onChange:e=>w(e.target.value)})}),u===`zai`&&(0,x.jsx)(u5,{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(MS[e]),className:G(`h-6 rounded-md px-2.5 text-xs`,(S||MS.general)===MS[e]?`bg-accent font-medium`:`text-muted-foreground`),children:e===`general`?`General API`:`Coding Plan`},e))})}),k&&(0,x.jsx)(u5,{label:`API key`,description:`Kept encrypted in rpf's credential store; never shown again.`,children:(0,x.jsx)(o5,{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 QS={"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`},$S=[`oauth-code`,`basic`,`apikey`,`mtls`,`oauth-client`,`oauth-password`,`bearer`],eC={password:`Password`,clientSecret:`OAuth client secret`,token:`Access token`,apiKey:`API key`,keyPassphrase:`Client key passphrase`};function tC(){let e=U({...Au().profiles.list.queryOptions(),retry:!1}),[t,n]=b.useState(null);if(e.error)return(0,x.jsx)(NS,{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)(NS,{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)(q,{size:`xs`,variant:`outline`,disabled:i?.state===`unreadable`,onClick:()=>n(`new`),children:[(0,x.jsx)(qp,{}),` 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)(pm,{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)(aC,{kinds:r?.kinds||$S,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)(aC,{profile:e,kinds:r?.kinds||$S,kindSecrets:r?.kindSecrets||{},taken:(r?.profiles||[]).map(e=>e.name).filter(t=>t!==e.name),onDone:()=>n(null)})},e.name):(0,x.jsx)(nC,{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)(q,{size:`sm`,className:`mt-4`,onClick:()=>n(`new`),children:[(0,x.jsx)(qp,{}),` Add instance`]})]})]})})}function nC({p:e,login:t,readOnly:n,onEdit:r}){let i=Au(),a=C(),o=()=>a.invalidateQueries({queryKey:i.profiles.list.queryKey()}),s=at(i.profiles.verify.mutationOptions({onSettled:o})),c=at(i.profiles.setDefault.mutationOptions({onSuccess:o})),l=at(i.profiles.remove.mutationOptions({onSuccess:o})),u=at(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)(kb,{variant:`info`,children:[(0,x.jsx)(Tm,{className:`size-3 fill-current`}),` default`]}),(0,x.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:QS[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:G(/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=>eC[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)(Yb,{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,` ·`,` `,yu(e.verifiedAt)===`now`?`just now`:`${yu(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)(iC,{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)(q,{size:`xs`,variant:`ghost-muted`,onClick:()=>f(!1),children:`Cancel`}),(0,x.jsx)(q,{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)(q,{size:`xs`,variant:`outline`,disabled:s.isPending,onClick:()=>s.mutate({name:e.name}),children:`Verify`}),m&&(0,x.jsx)(rC,{name:e.name,again:e.token!==`none`}),(0,x.jsx)(q,{size:`xs`,variant:`ghost-muted`,disabled:n,onClick:r,children:`Edit`}),(0,x.jsxs)(mb,{children:[(0,x.jsx)(hb,{render:(0,x.jsx)(q,{size:`icon-xs`,variant:`ghost-muted`,className:`ms-auto`,"aria-label":`More actions for ${e.name}`}),children:(0,x.jsx)(lf,{})}),(0,x.jsxs)(gb,{align:`end`,children:[!e.default&&(0,x.jsx)(_b,{onClick:()=>c.mutate({name:e.name}),children:`Make default`}),m&&e.token!==`none`&&(0,x.jsx)(_b,{onClick:()=>u.mutate({name:e.name}),children:`Sign out`}),(0,x.jsx)(_b,{disabled:n,onClick:()=>f(!0),children:`Remove…`})]})]})]})]})}function rC({name:e,again:t,label:n}){let r=Au(),i=C(),a=at(r.profiles.login.mutationOptions({onSuccess:()=>i.invalidateQueries({queryKey:r.profiles.list.queryKey()})}));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(q,{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 iC({login:e}){let t=Au(),n=C(),r=at(t.profiles.loginPaste.mutationOptions()),i=at(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:G(`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)(Yb,{size:`xs`}),(0,x.jsx)(`span`,{children:`Waiting for the sign-in in your browser…`}),(0,x.jsx)(q,{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)(q,{size:`xs`,variant:`outline`,onClick:()=>{navigator.clipboard.writeText(e.url),c(!0)},children:[(0,x.jsx)(ef,{}),` `,s?`Copied`:`Copy sign-in link`]}),(0,x.jsxs)(q,{size:`xs`,variant:`outline`,onClick:()=>window.open(e.url,`_blank`,`noopener`),children:[(0,x.jsx)(df,{}),` Open browser again`]})]}),(0,x.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,x.jsx)(o5,{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)(q,{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)(Yb,{size:`xs`}),` Signing in…`]})}function aC({profile:e,kinds:t,kindSecrets:n,taken:r,onDone:i}){let a=Au(),o=C(),s=at(a.profiles.save.mutationOptions()),c=at(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)(u5,{label:`Name`,description:O||`How the CLI and Forge refer to it (dev, test…).`,children:(0,x.jsx)(o5,{autoFocus:!e,placeholder:`dev`,value:l.name,onChange:w(`name`)})}),(0,x.jsx)(u5,{label:`Instance`,description:`Its name or URL.`,children:(0,x.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(o5,{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:$S.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:G(`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:QS[e]},e))})]}),(0,x.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[A&&(0,x.jsx)(u5,{label:`User name`,children:(0,x.jsx)(o5,{value:l.user,onChange:w(`user`),autoComplete:`off`})}),(j||l.kind===`oauth-code`)&&(0,x.jsx)(u5,{label:`OAuth client ID`,description:l.kind===`oauth-code`?`Empty: React Portal's Forge MCP client.`:`From the Application Registry.`,children:(0,x.jsx)(o5,{mono:!0,value:l.clientId,onChange:w(`clientId`)})}),l.kind===`apikey`&&(0,x.jsx)(u5,{label:`API key header`,description:`Default x-sn-apikey.`,children:(0,x.jsx)(o5,{mono:!0,placeholder:`x-sn-apikey`,value:l.apiKeyHeader,onChange:w(`apiKeyHeader`)})}),E.map(e=>(0,x.jsx)(u5,{label:`${eC[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)(q,{size:`xs`,variant:`outline`,onClick:()=>m({...p,[e]:!0}),children:`Replace`})]}):(0,x.jsx)(o5,{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)(u5,{label:`Client certificate${l.kind===`mtls`?``:` (optional)`}`,description:`Path to the PEM file.`,children:(0,x.jsx)(o5,{mono:!0,placeholder:`C:\\certs\\client.pem`,value:l.cert,onChange:w(`cert`)})}),(0,x.jsx)(u5,{label:`Client key${l.kind===`mtls`?``:` (optional)`}`,description:`Path to the PEM file.`,children:(0,x.jsx)(o5,{mono:!0,placeholder:`C:\\certs\\client.key`,value:l.key,onChange:w(`key`)})}),(0,x.jsx)(u5,{label:`Private CA (optional)`,description:`Path to the PEM file of a private server CA.`,children:(0,x.jsx)(o5,{mono:!0,value:l.ca,onChange:w(`ca`)})})]}),y&&l.kind===`oauth-code`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(u5,{label:`Scope (optional)`,children:(0,x.jsx)(o5,{mono:!0,value:l.scope,onChange:w(`scope`)})}),(0,x.jsx)(u5,{label:`Redirect URI`,description:`Default http://localhost:8765/callback.`,children:(0,x.jsx)(o5,{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)(c5,{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)(c5,{checked:_,onCheckedChange:e=>v(!!e)}),` Check the instance after saving`]}),(0,x.jsxs)(`div`,{className:`ml-auto flex gap-2`,children:[(0,x.jsx)(q,{size:`sm`,variant:`outline`,onClick:i,children:`Cancel`}),(0,x.jsx)(q,{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 oC=`forge.hint`;function sC({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 cC({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)(Md,{className:`size-3.5`}),` Ready`]}):i})]})}function lC({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)(qp,{className:`size-4`})}),(0,x.jsx)(`span`,{className:`text-sm text-muted-foreground group-hover:text-foreground`,children:e}),(0,x.jsx)(Pd,{className:G(`ml-auto size-4 text-muted-foreground transition-transform`,t&&`rotate-180`)})]})}function uC(){let e=Au(),t=C(),n=Yi(),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=at(e.claude.refresh.mutationOptions()),l=at(e.settings.setOnboarded.mutationOptions()),u=g8(),[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(oC,`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)(Kb,{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)(sC,{title:`Instance`,children:[y.map(e=>(0,x.jsx)(cC,{icon:(0,x.jsx)(sm,{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)(dC,{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)(lC,{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)(aC,{kinds:i.data?.kinds||[],kindSecrets:i.data?.kindSecrets||{},taken:y.map(e=>e.name),onDone:()=>f(!1)})})]}),(0,x.jsxs)(sC,{title:`AI provider`,children:[w.map(e=>(0,x.jsx)(cC,{icon:(0,x.jsx)(sS,{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)(q,{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)(lC,{label:w.length?`Add another provider`:`Add a provider`,open:p,onToggle:()=>m(!p)}),(0,x.jsx)(ZS,{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)(sC,{title:`First project`,children:[T.slice(0,3).map(e=>(0,x.jsx)(cC,{icon:(0,x.jsx)(xf,{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:ym,label:`New portal`},{id:`pull`,icon:sf,label:`Pull a portal`},{id:`copy`,icon:ef,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:()=>Wu({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)(lC,{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)(o5,{size:`compact`,mono:!0,placeholder:`C:\\path\\to\\workspace`,value:h,onChange:e=>g(e.target.value),"aria-label":`Folder path`}),(0,x.jsx)(q,{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)(q,{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)(q,{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 dC({name:e}){let t=Au(),n=C(),r=at(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)(q,{size:`xs`,variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({name:e}),children:r.isPending?`Checking…`:`Verify`})]})}function fC(){let[e,t]=b.useState(()=>localStorage.getItem(oC)===`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)(ym,{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)(q,{size:`xs`,variant:`ghost-muted`,onClick:()=>{localStorage.removeItem(oC),t(!1)},children:`Got it`})]}):null}var pC=`vercel.ai.error`,mC=Symbol.for(pC),hC=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[mC]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,pC)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}},gC=`AI_APICallError`,_C=`vercel.ai.error.${gC}`,vC=Symbol.for(_C),yC=class extends hC{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:gC,message:e,cause:o}),this[vC]=!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 hC.hasMarker(e,_C)}},bC=`AI_EmptyResponseBodyError`,xC=`vercel.ai.error.${bC}`,SC=Symbol.for(xC),CC=class extends hC{constructor({message:e=`Empty response body`}={}){super({name:bC,message:e}),this[SC]=!0}static isInstance(e){return hC.hasMarker(e,xC)}};function wC(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var TC=`AI_InvalidArgumentError`,EC=`vercel.ai.error.${TC}`,DC=Symbol.for(EC),OC=class extends hC{constructor({message:e,cause:t,argument:n}){super({name:TC,message:e,cause:t}),this[DC]=!0,this.argument=n}static isInstance(e){return hC.hasMarker(e,EC)}},kC=`AI_JSONParseError`,AC=`vercel.ai.error.${kC}`,jC=Symbol.for(AC),MC=class extends hC{constructor({text:e,cause:t}){super({name:kC,message:`JSON parsing failed: Text: ${e}.\nError message: ${wC(t)}`,cause:t}),this[jC]=!0,this.text=e}static isInstance(e){return hC.hasMarker(e,AC)}},NC=`AI_TypeValidationError`,PC=`vercel.ai.error.${NC}`,FC=Symbol.for(PC),IC=class e extends hC{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:NC,message:`${r}: Value: ${JSON.stringify(e)}.\nError message: ${wC(t)}`,cause:t}),this[FC]=!0,this.value=e,this.context=n}static isInstance(e){return hC.hasMarker(e,PC)}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})}},LC=`AI_UnsupportedFunctionalityError`,RC=`vercel.ai.error.${LC}`,zC=Symbol.for(RC),BC=class extends hC{constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:LC,message:t}),this[zC]=!0,this.functionality=e}static isInstance(e){return hC.hasMarker(e,RC)}};function VC(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 HC(e,t=`|`){return e.map(e=>hw(e)).join(t)}function UC(e,t){return typeof t==`bigint`?t.toString():t}var WC=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 GC(e){return new WC(e)}function KC(e){return e==null}function qC(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function JC(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 YC=Symbol(`evaluating`);function XC(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==YC)return r===void 0&&(r=YC,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ZC(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function QC(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function $C(e){return QC(e._zod.def)??e._zod.def.shape}function ew(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return ZC(this,t,e),e},enumerable:!0,configurable:!0})}function tw(e,t,n){t in e?ZC(e,t,n):e[t]=n}function nw(e,t,n,r){let i=$C(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?ew(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):tw(e,a,r?r(n.value,a):n.value))}}function rw(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?ew(e,n,()=>t[n]):tw(e,n,r.value))}}function iw(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function aw(e){return JSON.stringify(e)}function ow(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var sw=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function cw(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var lw=GC(()=>{if(oT.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function uw(e){if(cw(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return cw(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function dw(e){return uw(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var fw=new Set([`string`,`number`,`symbol`]);function pw(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function mw(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Y(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 hw(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function gw(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var _w={safeint:[-(2**53-1),2**53-1],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},vw={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function yw(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 nw(i,e,bw(e,t)),mw(e,iw(n,{shape:i,checks:[]}))}function bw(e,t){let n=$C(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 xw(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(bw(e,t)),a={};return nw(a,e,Reflect.ownKeys($C(e)).filter(e=>!i.has(e))),mw(e,iw(n,{shape:a,checks:[]}))}function Sw(e,t){if(!uw(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=$C(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 mw(e,iw(e._zod.def,{shape:Cw(e,t)}))}function Cw(e,t){let n={};return nw(n,e,Reflect.ownKeys($C(e))),rw(n,t),n}function ww(e,t){if(!uw(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return mw(e,iw(e._zod.def,{shape:Cw(e,t)}))}function Tw(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 nw(n,e,Reflect.ownKeys($C(e))),nw(n,t,Reflect.ownKeys($C(t))),mw(e,iw(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ew(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(bw(t,n)):void 0,o={};return nw(o,t,Reflect.ownKeys($C(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),mw(t,iw(t._zod.def,{shape:o,checks:[]}))}function Dw(e,t,n){let r=n?new Set(bw(t,n)):void 0,i={};return nw(i,t,Reflect.ownKeys($C(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),mw(t,iw(t._zod.def,{shape:i}))}function Ow(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 kw(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 Aw(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function jw(e){return typeof e==`string`?e:e?.message}function Mw(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 Nw(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Pw(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:jw(e.inst?._zod.def?.error?.(e))??jw(a?.(e))??jw(t?.error?.(e))??jw(n.customError?.(e))??jw(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 Fw=/[\uD800-\uDBFF]/;function Iw(e){let t=e.length;if(!Fw.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 Lw(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Rw(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 zw(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Bw(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ww(e,n,r.value)}}function Vw(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Hw(e,t,n){return Vw(e,t,n,!1)}function Uw(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Vw(this,n,r(this))},set(e){Vw(this,n,e)}})}return t}function Ww(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Vw(this,t,n.bind(this))},set(e){Vw(this,t,e)}})}function Gw(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Kw,qw=!1,Jw={configurable:!0,get(){qw=!0}};function Yw(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Kw!==e._zod?Kw=void 0:(Kw=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Jw);let e=qw;qw=!1;try{let r=n(this);return qw?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),qw||=e,r}catch(n){throw delete this[t],qw||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Xw(e,t,n,r){let i=Gw(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 Zw=`~constantCatch`;function Qw(e){let t=()=>e;return t[Zw]=!0,t}var $w,eT=Object.freeze({status:`aborted`}),tT={value:void 0,enumerable:!1},nT=`captureStackTrace`in Error?Error:null;function rT(e){let t=nT;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return nT=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){tT.value=new a(r);try{Object.defineProperty(n,"_zod",tT)}finally{tT.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),Bw(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?rT(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 iT=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},aT=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};($w=globalThis).__zod_globalConfig??($w.__zod_globalConfig={});var oT=globalThis.__zod_globalConfig;function sT(e){return e&&Object.assign(oT,e),oT}function cT(){let e=this._zod;return e.message??=JSON.stringify(e.def,UC,2),e.message}function lT(e){this._zod.message=e}var uT={get:cT,set:lT,enumerable:!0,configurable:!0},dT={value:void 0,enumerable:!1},fT=new WeakSet([Object.prototype,Error.prototype]),pT=(e,t)=>{e.name=`$ZodError`,dT.value=t,Object.defineProperty(e,"issues",dT),dT.value=void 0,Object.defineProperty(e,"message",uT);let n=Object.getPrototypeOf(e);fT.has(n)||(fT.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})}}))},mT=X(`$ZodError`,pT),hT=X(`$ZodError`,pT,void 0,{Parent:Error});function gT(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 _T(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?gT(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function vT(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 yT(e,t){return{callee:t?.callee??e,Err:t?.Err}}var bT=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 iT;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Pw(e,o,sT())));throw sw(n,a?.callee??t),n}return s.value};return t},xT=bT(hT),ST=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=>Pw(e,o,sT())));throw sw(n,a?.callee??t),n}return s.value};return t},CT=ST(hT),wT=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 iT;return a.issues.length?ET(e,a.issues,i):{success:!0,data:a.value}},TT=wT(hT);function ET(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Pw(e,n,sT()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var DT=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?ET(e,a.issues,i):{success:!0,data:a.value}},OT=DT(hT),kT=Symbol.for(`zod.compile.invalid`),AT=Symbol.for(`zod.compile.fallback`),jT=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==kT)return!0;if(r.definite===!0&&n===void 0)return!1}return MT(e,t,n)});function MT(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[AT]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new iT;return a.issues.length===0}var NT=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},PT=e=>{let t=bT(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,yT(n,a))};return n},FT=e=>{let t=bT(e),n=(e,r,i,a)=>t(e,r,i,yT(n,a));return n},IT=e=>{let t=ST(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,yT(n,a))};return n},LT=e=>{let t=ST(e),n=async(e,r,i,a)=>await t(e,r,i,yT(n,a));return n},RT=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return wT(e)(t,n,i)},zT=e=>(t,n,r)=>wT(e)(t,n,r),BT=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return DT(e)(t,n,i)},VT=e=>async(t,n,r)=>DT(e)(t,n,r),HT=/^[cC][0-9a-z]{6,}$/,UT=/^[0-9a-z]+$/,WT=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,GT=/^[0-9a-vA-V]{20}$/,KT=/^[A-Za-z0-9]{27}$/,qT=/^[a-zA-Z0-9_-]{21}$/;function JT(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var YT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,XT=/^([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})$/,ZT=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)$/,QT=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$T=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function eE(){return new RegExp($T,`u`)}var tE=/^(?:(?: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])$/,nE=/^(([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}|:))$/,rE=/^((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])$/,iE=/^(([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])$/,aE=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,oE=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,sE=/^https?$/,cE=/^\+[1-9]\d{6,14}$/,lE=`(?:(?:\\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 uE(e){return RegExp(`^${e}$`)}var dE=uE(lE);function fE(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 pE(e){return RegExp(`^${fE(e)}$`)}function mE(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${fE({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${fE({precision:e.precision})}`:n;return RegExp(`^${lE}T(?:${r})$`)}var hE=/^[\s\S]{0,}$/,gE=/^-?\d+$/,_E=/^-?\d+(?:\.\d+)?$/,vE=/^(?:true|false)$/i,yE=/^null$/i,bE=/^[^A-Z]*$/,xE=/^[^a-z]*$/,SE=X(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),CE=e=>{let t=e.value;return!KC(t)&&t.length!==void 0},wE={number:`number`,bigint:`bigint`,object:`date`},TE=X(`$ZodCheckLessThan`,(e,t)=>{SE.init(e,t);let n=wE[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:wE[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})}}),EE=X(`$ZodCheckGreaterThan`,(e,t)=>{SE.init(e,t);let n=wE[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:wE[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})}}),DE=X(`$ZodCheckMultipleOf`,(e,t)=>{SE.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):JC(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})}}),OE=X(`$ZodCheckNumberFormat`,(e,t)=>{SE.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=_w[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})}}),kE=X(`$ZodCheckMaxLength`,(e,t)=>{var n;SE.init(e,t),(n=e._zod.def).when??(n.when=CE),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Iw(r):i)<=t.maximum)return;let a=Lw(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),AE=X(`$ZodCheckMinLength`,(e,t)=>{var n;SE.init(e,t),(n=e._zod.def).when??(n.when=CE),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Iw(r):i)>=t.minimum)return;let a=Lw(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jE=X(`$ZodCheckLengthEquals`,(e,t)=>{var n;SE.init(e,t),(n=e._zod.def).when??(n.when=CE),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Iw(r):i;if(a===t.length)return;let o=Lw(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})}}),ME=X(`$ZodCheckStringFormat`,(e,t)=>{var n,r;SE.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=()=>{})}),NE=X(`$ZodCheckRegex`,(e,t)=>{ME.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})}}),PE=X(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=bE,ME.init(e,t)}),FE=X(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=xE,ME.init(e,t)}),IE=X(`$ZodCheckIncludes`,(e,t)=>{SE.init(e,t);let n=pw(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})}}),LE=X(`$ZodCheckStartsWith`,(e,t)=>{SE.init(e,t);let n=RegExp(`^${pw(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})}}),RE=X(`$ZodCheckEndsWith`,(e,t)=>{SE.init(e,t);let n=RegExp(`.*${pw(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 zE(e,t,n){e.issues.length&&t.issues.push(...Aw(n,e.issues))}var BE=X(`$ZodCheckProperties`,(e,t)=>{SE.init(e,t),Hw(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=>zE(t,r,e)))):zE(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),VE=X(`$ZodCheckOverwrite`,(e,t)=>{SE.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),HE=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))}},UE={major:4,minor:6,patch:7},WE=X(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=UE;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=Ow(t),a;for(let o of n){if(o._zod.def.when){if(kw(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 iT;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Nw(t.issues,n,e),i||=Ow(t,n))});else{if(t.issues.length===n)continue;Nw(t.issues,n,e),i||=Ow(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Ow(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new iT;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 iT;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Hw(this,`~standard`,qE(this))},set"~standard"(e){Vw(this,`~standard`,e)}}),GE=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Pw(e,t,sT()))}:{value:e.value};async function KE(e,t){let n={async:!0};return GE(await e._zod.run({value:t,issues:[]},n),n)}function qE(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return GE(r,n)}catch{}return KE(e,t)},vendor:`zod`,version:1}}var JE=X(`$ZodString`,(e,t)=>{WE.init(e,t),e._zod.pattern=t.pattern??hE,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}}),YE=X(`$ZodStringFormat`,(e,t)=>{ME.init(e,t),JE.init(e,t)}),XE=X(`$ZodGUID`,(e,t)=>{t.pattern??=XT,YE.init(e,t)}),ZE=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??=ZT(e)}else t.pattern??=ZT();YE.init(e,t)}),QE=X(`$ZodEmail`,(e,t)=>{t.pattern??=QT,YE.init(e,t)});function $E(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function eD(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?$E(e)||2:tD(e,t)}function tD(e,t){if(!t.normalize&&t.protocol?.source===sE.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 nD=/[\t\n\r]/g;function rD(e){return e.replace(nD,``)}function iD(e,t){return t.lastIndex=0,t.test(e.hostname)}function aD(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var oD=X(`$ZodURL`,(e,t)=>{YE.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=eD(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=rD(r);return}t.hostname&&!iD(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&&!aD(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:rD(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),sD=X(`$ZodEmoji`,(e,t)=>{t.pattern??=eE(),YE.init(e,t)}),cD=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?qT:JT(t.length),YE.init(e,t)}),lD=X(`$ZodCUID`,(e,t)=>{t.pattern??=HT,YE.init(e,t)}),uD=X(`$ZodCUID2`,(e,t)=>{t.pattern??=UT,YE.init(e,t)}),dD=X(`$ZodULID`,(e,t)=>{t.pattern??=WT,YE.init(e,t)}),fD=X(`$ZodXID`,(e,t)=>{t.pattern??=GT,YE.init(e,t)}),pD=X(`$ZodKSUID`,(e,t)=>{t.pattern??=KT,YE.init(e,t)}),mD=X(`$ZodISODateTime`,(e,t)=>{t.pattern??=mE(t),YE.init(e,t)}),hD=X(`$ZodISODate`,(e,t)=>{t.pattern??=dE,YE.init(e,t)}),gD=X(`$ZodISOTime`,(e,t)=>{t.pattern??=pE(t),YE.init(e,t)}),_D=X(`$ZodISODuration`,(e,t)=>{t.pattern??=YT,YE.init(e,t)}),vD=X(`$ZodIPv4`,(e,t)=>{t.pattern??=tE,YE.init(e,t)}),yD=/^[0-9a-fA-F:.]+$/;function bD(e){return yD.test(e)?$E(`http://[${e}]`):!1}var xD=X(`$ZodIPv6`,(e,t)=>{t.pattern??=nE,YE.init(e,t),e._zod.check=n=>{bD(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),SD=X(`$ZodCIDRv4`,(e,t)=>{t.pattern??=rE,YE.init(e,t)});function CD(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:bD(n)}var wD=X(`$ZodCIDRv6`,(e,t)=>{t.pattern??=iE,YE.init(e,t),e._zod.check=n=>{CD(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function TD(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var ED=/^[0-9a-zA-Z+/]*={0,2}$/,DD=X(`$ZodBase64`,(e,t)=>{t.pattern??=ED,YE.init(e,t),e._zod.check=n=>{TD(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),OD=/^[A-Za-z0-9_-]*$/;function kD(e){if(!OD.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return TD(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var AD=X(`$ZodBase64URL`,(e,t)=>{t.pattern??=OD,YE.init(e,t),e._zod.check=n=>{kD(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),jD=X(`$ZodE164`,(e,t)=>{t.pattern??=cE,YE.init(e,t)});function MD(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 ND=X(`$ZodJWT`,(e,t)=>{YE.init(e,t),e._zod.check=n=>{MD(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),PD=X(`$ZodNumber`,(e,t)=>{WE.init(e,t),e._zod.pattern=_E,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}}),FD=X(`$ZodNumberFormat`,(e,t)=>{OE.init(e,t),PD.init(e,t)}),ID=X(`$ZodBoolean`,(e,t)=>{WE.init(e,t),e._zod.pattern=vE,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}}),LD=X(`$ZodNull`,(e,t)=>{WE.init(e,t),e._zod.pattern=yE,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}}),RD=X(`$ZodUnknown`,(e,t)=>{WE.init(e,t),e._zod.parse=e=>e}),zD=X(`$ZodNever`,(e,t)=>{WE.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function BD(e,t){let n=Mw(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 Mw(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,Nw(n.issues,t,e),n}}return i(n,a)}}var VD=e=>Array.isArray(e)?e.length:-1;function HD(e,t,n){e.issues.length&&t.issues.push(...Aw(n,e.issues)),t.value[n]=e.value}var UD=X(`$ZodArray`,(e,t)=>{WE.init(e,t);let n=oT.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=>HD(t,r,e)));else if(HD(c,r,e),s&&c.issues.length!==0&&Ow(c))break}return o.length?Promise.all(o).then(()=>r):r},BD(e,VD)});function WD(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(...Aw(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 GD=[];function KD(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:GD,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=gw(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function qD(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(Ow(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=>WD(e,n,i,t,d,f))):WD(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 JD=X(`$ZodObject`,(e,t)=>{WE.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=GC(()=>KD(t));Yw(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)||ZC(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=cw,o=t.catchall,s,c=oT.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(Ow(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=>WD(n,t,e,r,a,o))):WD(s,t,e,r,a,o)}return o?qD(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),YD=X(`$ZodObjectJIT`,(e,t)=>{JD.init(e,t);let n=e._zod.parse,r=GC(()=>KD(t)),i=oT.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new HE([`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)}]`:aw(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=cw,c=!oT.jitless,l=c&&lw.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?qD([],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 XD(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=>!Ow(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=>Pw(e,r,sT())))}),t)}var ZD=X(`$ZodUnion`,(e,t)=>{WE.init(e,t),Yw(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),Yw(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Yw(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)))}),Yw(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=>qC(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=>XD(t,r,e,i)):XD(o,r,e,i)}});function QD(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 $D=X(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,ZD.init(e,t);let n=e._zod.parse;Yw(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)||ZC(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=QC(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=GC(()=>QD(t));e._zod.parse=(i,a)=>{let o=i.value;if(!cw(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)}}),eO=X(`$ZodIntersection`,(e,t)=>{WE.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])=>nO(e,t,n)):nO(e,i,a)}});function tO(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(uw(e)&&uw(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=tO(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=tO(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 nO(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=tO(t.value,n.value);if(!c.valid){if(Ow(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var rO=X(`$ZodRecord`,(e,t)=>{WE.init(e,t);let n=oT.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!uw(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=>Pw(e,i,sT())),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(...Aw(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Aw(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`&&_E.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=>Pw(e,i,sT())),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(...Aw(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Aw(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}}),iO=X(`$ZodEnum`,(e,t)=>{WE.init(e,t);let n=VC(t.entries),r=new Set(n);e._zod.values=r,Yw(e,`pattern`,e=>{let t=VC(e.def.entries).filter(e=>fw.has(typeof e));return RegExp(t.length?`^(${t.map(e=>pw(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}}),aO=X(`$ZodLiteral`,(e,t)=>{WE.init(e,t);let n=new Set(t.values);e._zod.values=n,Yw(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?pw(e):e?pw(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}}),oO=X(`$ZodTransform`,(e,t)=>{WE.init(e,t),e._zod.optin=`optional`,oT.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new aT(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 iT;return n.value=i,n}});function sO(e,t){return e.value=t.issues.length?void 0:t.value,e}var cO=X(`$ZodOptional`,(e,t)=>{WE.init(e,t),Yw(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Yw(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Yw(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${qC(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=>sO(e,t)):sO(e,r)}return t.innerType._zod.run(e,n)}}),lO=X(`$ZodExactOptional`,(e,t)=>{cO.init(e,t),Yw(e,`values`,e=>e.def.innerType._zod.values),Yw(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),uO=X(`$ZodNullable`,(e,t)=>{WE.init(e,t),Yw(e,`optin`,e=>e.def.innerType._zod.optin),Yw(e,`optout`,e=>e.def.innerType._zod.optout),Yw(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${qC(t.source)}|null)$`):void 0}),Yw(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)}),dO=X(`$ZodDefault`,(e,t)=>{WE.init(e,t),e._zod.optin=`defaulted`,Yw(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=>fO(e,t)):fO(r,t)}});function fO(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var pO=X(`$ZodPrefault`,(e,t)=>{WE.init(e,t),e._zod.optin=`defaulted`,Yw(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))}),mO=X(`$ZodNonOptional`,(e,t)=>{WE.init(e,t),Yw(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=>hO(t,e)):hO(i,e)}});function hO(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 gO(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Pw(e,r,sT()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var _O=X(`$ZodCatch`,(e,t)=>{WE.init(e,t),Yw(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Yw(e,`optout`,e=>e.def.innerType._zod.optout),Yw(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=>gO(e,r,t,n)):gO(e,r,t,n)}}),vO=X(`$ZodPipe`,(e,t)=>{WE.init(e,t),Yw(e,`values`,e=>e.def.in._zod.values),Yw(e,`optin`,e=>e.def.in._zod.optin),Yw(e,`optout`,e=>e.def.out._zod.optout),Yw(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=>yO(e,t.in,n)):yO(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>yO(e,t.out,n)):yO(r,t.out,n)}});function yO(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 bO=X(`$ZodReadonly`,(e,t)=>{WE.init(e,t),Yw(e,`propValues`,e=>e.def.innerType._zod.propValues),Yw(e,`values`,e=>e.def.innerType._zod.values),Yw(e,`optin`,e=>e.def.innerType?._zod?.optin),Yw(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(xO):xO(r)}});function xO(e){return e.memo||(e.value=Object.freeze(e.value)),e}var SO=X(`$ZodLazy`,(e,t)=>{WE.init(e,t),XC(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),Yw(e,`pattern`,e=>e.innerType?._zod?.pattern),Yw(e,`propValues`,e=>e.innerType?._zod?.propValues),Yw(e,`optin`,e=>e.innerType?._zod?.optin??void 0),Yw(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),CO=X(`$ZodCustom`,(e,t)=>{SE.init(e,t),WE.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=>wO(t,n,r,e));wO(i,n,r,e)}});function wO(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(zw(e))}}var TO=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},EO=`~memo`,DO=[];function OO(e){return typeof e==`object`&&!!e}function kO(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var AO=new WeakMap,jO=0,MO=1,NO=2;function PO(e,t,n){let r=AO.get(e);if(r!==void 0)return r?NO:jO;if(t.has(e))return NO;t.add(e);let i=jO,a=e=>{if(i!==NO&&e?._zod){let r=PO(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=jO;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?MO:o.value?._zod?PO(o.value,t,n):jO;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=QC(c);s(e?o(e,!0):MO),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?PO(r,t,!1):MO);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),FO(e,i)}function FO(e,t){return t!==MO&&AO.set(e,t===NO),t}function IO(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var LO,RO=[],zO={alloc(e,t,n){let r=LO;if(!r)return n;LO=void 0;let i={value:n,issues:null};return r.set(t.value,i),RO.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`&&VO(n,e.value))throw new TO;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=PO(e,new Set,!1);if(i===jO)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===NO||r?n=!0:r=!0}let l=s.value;if(!OO(l))return t(s,c);let u=c[EO];u||(u={buckets:new WeakMap,backEdges:void 0},c[EO]=u);let d;i===c?d=a:(d=IO(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(...kO(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;LO=d;let p=RO.length,m=t(s,c);LO=void 0;let h=RO.length>p?RO.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?kO(e.issues):DO),e)):(h&&(h.issues=m.issues.length?kO(m.issues):DO),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function BO(){return zO}function VO(e,t){let n=e[EO]?.backEdges;return n!==void 0&&OO(t)&&n.has(t)}var HO=()=>{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(Rw(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${hw(e.values[0])}`:`Invalid option: expected one of ${HC(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`:``}: ${HC(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 UO(){return{localeError:HO()}}var WO,GO=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 KO(){return new GO}(WO=globalThis).__zod_globalRegistry??(WO.__zod_globalRegistry=KO());var qO=globalThis.__zod_globalRegistry;function JO(e){return e.checks&&=[...e.checks],e}function YO(e,t){return new e(JO({type:`string`,...Y(t)}))}function XO(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Y(t)})}function ZO(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Y(t)})}function QO(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Y(t)})}function $O(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Y(t)})}function ek(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Y(t)})}function tk(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Y(t)})}function nk(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Y(t)})}function rk(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Y(t)})}function ik(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Y(t)})}function ak(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Y(t)})}function ok(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Y(t)})}function sk(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Y(t)})}function ck(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Y(t)})}function lk(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Y(t)})}function uk(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Y(t)})}function dk(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Y(t)})}function fk(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Y(t)})}function pk(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Y(t)})}function mk(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Y(t)})}function hk(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Y(t)})}function gk(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Y(t)})}function _k(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Y(t)})}function vk(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Y(t)})}function yk(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Y(t)})}function bk(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Y(t)})}function xk(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Y(t)})}function Sk(e,t){return new e(JO({type:`number`,checks:[],...Y(t)}))}function Ck(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Y(t)})}function wk(e,t){return new e({type:`boolean`,...Y(t)})}function Tk(e,t){return new e({type:`null`,...Y(t)})}function Ek(e){return new e({type:`unknown`})}function Dk(e,t){return new e({type:`never`,...Y(t)})}function Ok(e,t){return new TE({check:`less_than`,...Y(t),value:e,inclusive:!1})}function kk(e,t){return new TE({check:`less_than`,...Y(t),value:e,inclusive:!0})}function Ak(e,t){return new EE({check:`greater_than`,...Y(t),value:e,inclusive:!1})}function jk(e,t){return new EE({check:`greater_than`,...Y(t),value:e,inclusive:!0})}function Mk(e){return Ak(0,e)}function Nk(e){return jk(0,e)}function Pk(e,t){return new DE({check:`multiple_of`,...Y(t),value:e})}function Fk(e,t){return new kE({check:`max_length`,...Y(t),maximum:e})}function Ik(e,t){return new AE({check:`min_length`,...Y(t),minimum:e})}function Lk(e,t){return new jE({check:`length_equals`,...Y(t),length:e})}function Rk(e,t){return new NE({check:`string_format`,format:`regex`,...Y(t),pattern:e})}function zk(e){return new PE({check:`string_format`,format:`lowercase`,...Y(e)})}function Bk(e){return new FE({check:`string_format`,format:`uppercase`,...Y(e)})}function Vk(e,t){return new IE({check:`string_format`,format:`includes`,...Y(t),includes:e})}function Hk(e,t){return new LE({check:`string_format`,format:`starts_with`,...Y(t),prefix:e})}function Uk(e,t){return new RE({check:`string_format`,format:`ends_with`,...Y(t),suffix:e})}function Wk(e,t){return new BE({check:`properties`,shape:e,...Y(t)})}function Gk(e){return new VE({check:`overwrite`,tx:e})}function Kk(e){return Gk(t=>t.normalize(e))}function qk(){return Gk(e=>e.trim())}function Jk(){return Gk(e=>e.toLowerCase())}function Yk(){return Gk(e=>e.toUpperCase())}function Xk(){return Gk(e=>ow(e))}function Zk(e,t,n){return new e({type:`array`,element:t,...Y(n)})}function Qk(e,t,n){let r=Y(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function $k(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Y(n)})}function eA(e,t){let n=tA(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(zw(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(zw(r))}},e(t.value,t)),t);return n}function tA(e,t){let n=new SE({check:`custom`,...Y(t)});return n._zod.check=e,n}function nA(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&ZC(e,t,n[t]);return e}function rA(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??qO,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 iA(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 aA(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,aA(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&nA(o.schema,c),t.io===`input`&&hA(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 oA(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function sA(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}/${oA(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+oA(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 cA(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;cA(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 lA=new Set([`type`,`properties`,`required`,`additionalProperties`]),uA=[`oneOf`,`anyOf`];function dA(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function fA(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!lA.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]??dA(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}ZC(n,r,e.length===1?e[0]:fA(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=dA(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 pA(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of lA)if(t in e)return;let n=t.filter(e=>uA.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=fA(t);else{let e=n[0],i=uA.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=>fA([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,nA(e,r))}function mA(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)):nA(i,s),nA(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())cA(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)??[])pA(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)}nA(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,ZC(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:_A(t,`input`,e.processors),output:_A(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function hA(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 hA(r.element,n);if(r.type===`set`)return hA(r.valueType,n);if(r.type===`lazy`)return hA(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 hA(r.innerType,n);if(r.type===`intersection`)return hA(r.left,n)||hA(r.right,n);if(r.type===`record`||r.type===`map`)return hA(r.keyType,n)||hA(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:hA(r.in,n)||hA(r.out,n);if(r.type===`object`){for(let e in r.shape)if(hA(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(hA(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(hA(e,n))return!0;return!!(r.rest&&hA(r.rest,n))}return!1}var gA=(e,t={})=>n=>{let r=rA({...n,processors:t});return aA(e,r),sA(r,e),mA(r,e)},_A=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=rA({...i??{},target:a,io:t,processors:n});return aA(e,o),sA(o,e),mA(o,e)},vA=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},yA=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},bA=(e,t)=>{vA(e,`minimum`,t),yA(e,`maximum`,t)},xA=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},SA=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},CA=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},wA=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},TA=(e,t)=>vA(e,`minimum`,t.minimum),EA=(e,t)=>yA(e,`maximum`,t.maximum),DA=e=>(t,n)=>{wA(t,n.format);let[r,i]=e[n.format];vA(t,`minimum`,r),yA(t,`maximum`,i)},OA={greater_than:(e,t)=>vA(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>yA(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>xA(e,t.value),number_format:DA(_w),bigint_format:DA(vw),min_length:TA,max_length:EA,length_equals:(e,t)=>bA(e,t.length),min_size:TA,max_size:EA,size_equals:(e,t)=>bA(e,t.size),string_format:(e,t)=>{wA(e,t.format),t.pattern&&SA(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)=>CA(e,t.mime)};function kA(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)OA[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&vA(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&vA(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&yA(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&yA(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&xA(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&CA(t,i.mime);for(let e of i.patterns??[])SA(t,e);return t}var AA={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},jA=new Map([[ED,aE],[OD,oE]]),MA=e=>jA.get(e)??e,NA=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=kA(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=AA[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(MA);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}))])}},PA=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=kA(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)):iA(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}))])}},FA=(e,t,n,r)=>{n.type=`boolean`},IA=(e,t,n,r)=>{iA(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},LA=(e,t,n,r)=>{iA(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},RA=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},zA=(e,t,n,r)=>{iA(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},BA=(e,t,n,r)=>{iA(e,t,n,r,`Void cannot be represented in JSON Schema`)},VA=(e,t,n,r)=>{n.not={}},HA=(e,t,n,r)=>{},UA=(e,t,n,r)=>{},WA=(e,t,n,r)=>{iA(e,t,n,r,`Date cannot be represented in JSON Schema`)},GA=(e,t,n,r)=>{let i=VC(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)},KA=(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(iA(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(iA(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}},qA=(e,t,n,r)=>{iA(e,t,n,r,`NaN cannot be represented in JSON Schema`)},JA=(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},YA=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=kA(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})))},XA=(e,t,n,r)=>{n.type=`boolean`},ZA=(e,t,n,r)=>{iA(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},QA=(e,t,n,r)=>{iA(e,t,n,r,`Function types cannot be represented in JSON Schema`)},$A=(e,t,n,r)=>{iA(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},ej=(e,t,n,r)=>{iA(e,t,n,r,`Map cannot be represented in JSON Schema`)},tj=(e,t,n,r)=>{iA(e,t,n,r,`Set cannot be represented in JSON Schema`)},nj=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=kA(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=aA(a.element,t,{...r,path:[...r.path,`items`]})};function rj(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?rj(t.out):t.type===`catch`?rj(t.innerType):e._zod.optin}var ij=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&iA(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)ZC(i.properties,e,aA(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`?rj(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=aA(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},aj=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>aA(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},oj=(e,t,n,r)=>{let i=e._zod.def,a=aA(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=aA(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)},sj=(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)=>aA(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?aA(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`?rj(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}=kA(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function cj(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=cj(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=>cj(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`)?_E:gE).source)),p}var lj=new WeakMap;function uj(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 lj.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=cj(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 dj=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=kA(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=aA(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)ZC(i.patternProperties,MA(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=aA(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=lj.get(t);n||(n=[],lj.set(t,n),t.deferred.push(()=>uj(t))),n.push(e)}i.additionalProperties=aA(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&rj(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))}},fj=(e,t,n,r)=>{let i=e._zod.def,a=aA(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`}]},pj=(e,t,n,r)=>{let i=e._zod.def;aA(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},mj=Symbol();function hj(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(iA(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),mj):JSON.parse(o)}var gj=(e,t,n,r)=>{let i=e._zod.def;aA(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=hj(i.defaultValue,e,t,n,r);o!==mj&&(n.default=o)},_j=(e,t,n,r)=>{let i=e._zod.def;aA(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=hj(i.defaultValue,e,t,n,r);o!==mj&&(n._prefault=o)},vj=(e,t,n,r)=>{let i=e._zod.def;aA(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{iA(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},yj=(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;aA(o,t,r);let s=t.seen.get(e);s.ref=o},bj=(e,t,n,r)=>{let i=e._zod.def;aA(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xj=(e,t,n,r)=>{let i=e._zod.def;aA(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Sj=(e,t,n,r)=>{let i=e._zod.def;aA(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Cj=(e,t,n,r)=>{let i=e._zod.innerType;aA(i,t,r);let a=t.seen.get(e);a.ref=i},wj={string:NA,number:PA,boolean:FA,bigint:IA,symbol:LA,null:RA,undefined:zA,void:BA,never:VA,any:HA,unknown:UA,date:WA,enum:GA,literal:KA,nan:qA,template_literal:JA,file:YA,success:XA,custom:ZA,function:QA,transform:$A,map:ej,set:tj,array:nj,object:ij,union:aj,intersection:oj,tuple:sj,record:dj,nullable:fj,nonoptional:pj,default:gj,prefault:_j,catch:vj,pipe:yj,readonly:bj,promise:xj,optional:Sj,lazy:Cj};function Tj(e,t){if(`_idmap`in e){let n=e,r=rA({...t,processors:wj}),i={};for(let e of n._idmap.entries()){let[t,n]=e;aA(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;sA(r,n),ZC(a,t,mA(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=rA({...t,processors:wj});return aA(e,n),sA(n,e),mA(n,e)}var Ej=new WeakSet([Object.prototype,Error.prototype]);function Dj(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 Oj=X(`ZodError`,(e,t)=>{mT.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Ej.has(n)||(Ej.add(n),Dj(n,`format`,e=>t=>vT(e,t)),Dj(n,`flatten`,e=>t=>_T(e,t)),Dj(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,UC,2)}),Dj(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,UC,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),kj=bT(Oj),Aj=ST(Oj),jj=wT(Oj),Mj=DT(Oj),Nj=PT(Oj),Pj=FT(Oj),Fj=IT(Oj),Ij=LT(Oj),Lj=RT(Oj),Rj=zT(Oj),zj=BT(Oj),Bj=VT(Oj);function Vj(){oT.localeError||sT(UO())}function Hj(){oT.memoizer||sT({memoizer:BO()})}var Uj=X(`ZodType`,(e,t)=>(Vj(),WE.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(iw(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 mw(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(hN(e,t))},superRefine(e,t){return this.check(gN(e,t))},overwrite(e){return this.check(Gk(e))},optional(){return JM(this)},exactOptional(){return XM(this)},nullable(){return QM(this)},nullish(){return JM(QM(this))},nonoptional(e){return iN(this,e)},array(){return AM(this)},or(e){return PM([this,e])},and(e){return RM(this,e)},transform(e){return cN(this,KM(e))},default(e){return eN(this,e)},prefault(e){return nN(this,e)},catch(e){return oN(this,e)},pipe(e){return cN(this,e)},readonly(){return uN(this)},describe(e){let t=this.clone();return qO.add(t,{description:e}),t},meta(...e){if(e.length===0)return qO.get(this);let t=this.clone();return qO.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 Hw(this,`~standard`,{...qE(this),jsonSchema:{input:_A(this,`input`),output:_A(this,`output`)}})},set"~standard"(e){Vw(this,`~standard`,e)},parse:function e(t,n){return kj(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Aj(this,t,n,{callee:e})},safeParse(e,t){return jj(this,e,t)},async safeParseAsync(e,t){return Mj(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Vw(this,`spa`,e)},validate(e,t){return jT(this,e,t)},validateAsync(e,t){return NT(this,e,t)},encode:function e(t,n){return Nj(this,t,n,{callee:e})},decode:function e(t,n){return Pj(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Fj(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Ij(this,t,n,{callee:e})},safeEncode(e,t){return Lj(this,e,t)},safeDecode(e,t){return Rj(this,e,t)},async safeEncodeAsync(e,t){return zj(this,e,t)},async safeDecodeAsync(e,t){return Bj(this,e,t)},toJSONSchema(e){return gA(this,{})(e)},get description(){return qO.get(this)?.description},get _def(){return this._zod.def}}),Wj=X(`_ZodString`,(e,t)=>{JE.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NA(e,t,n,r)},Uw({format:e=>kA(e).format??null,minLength:e=>kA(e).minimum??null,maxLength:e=>kA(e).maximum??null},{regex(...e){return this.check(Rk(...e))},includes(...e){return this.check(Vk(...e))},startsWith(...e){return this.check(Hk(...e))},endsWith(...e){return this.check(Uk(...e))},min(...e){return this.check(Ik(...e))},max(...e){return this.check(Fk(...e))},length(...e){return this.check(Lk(...e))},nonempty(...e){return this.check(Ik(1,...e))},lowercase(e){return this.check(zk(e))},uppercase(e){return this.check(Bk(e))},trim(){return this.check(qk())},normalize(...e){return this.check(Kk(...e))},toLowerCase(){return this.check(Jk())},toUpperCase(){return this.check(Yk())},slugify(){return this.check(Xk())}})),Gj=X(`ZodString`,(e,t)=>{JE.init(e,t),Wj.init(e,t)},{email(e){return this.check(XO(Qj,e))},url(e){return this.check(nk(tM,e))},jwt(e){return this.check(_k(gM,e))},emoji(e){return this.check(rk(nM,e))},guid(e){return this.check(ZO($j,e))},uuid(e){return this.check(QO(eM,e))},uuidv4(e){return this.check($O(eM,e))},uuidv6(e){return this.check(ek(eM,e))},uuidv7(e){return this.check(tk(eM,e))},nanoid(e){return this.check(ik(rM,e))},cuid(e){return this.check(ak(iM,e))},cuid2(e){return this.check(ok(aM,e))},ulid(e){return this.check(sk(oM,e))},base64(e){return this.check(mk(pM,e))},base64url(e){return this.check(hk(mM,e))},xid(e){return this.check(ck(sM,e))},ksuid(e){return this.check(lk(cM,e))},ipv4(e){return this.check(uk(lM,e))},ipv6(e){return this.check(dk(uM,e))},cidrv4(e){return this.check(fk(dM,e))},cidrv6(e){return this.check(pk(fM,e))},e164(e){return this.check(gk(hM,e))},datetime(e){return this.check(vk(Jj,e))},date(e){return this.check(yk(Yj,e))},time(e){return this.check(bk(Xj,e))},duration(e){return this.check(xk(Zj,e))}});function Kj(e){return YO(Gj,e)}var qj=X(`ZodStringFormat`,(e,t)=>{YE.init(e,t),Wj.init(e,t)}),Jj=X(`ZodISODateTime`,(e,t)=>{mD.init(e,t),qj.init(e,t)}),Yj=X(`ZodISODate`,(e,t)=>{hD.init(e,t),qj.init(e,t)}),Xj=X(`ZodISOTime`,(e,t)=>{gD.init(e,t),qj.init(e,t)}),Zj=X(`ZodISODuration`,(e,t)=>{_D.init(e,t),qj.init(e,t)}),Qj=X(`ZodEmail`,(e,t)=>{QE.init(e,t),qj.init(e,t)}),$j=X(`ZodGUID`,(e,t)=>{XE.init(e,t),qj.init(e,t)}),eM=X(`ZodUUID`,(e,t)=>{ZE.init(e,t),qj.init(e,t)}),tM=X(`ZodURL`,(e,t)=>{oD.init(e,t),qj.init(e,t)}),nM=X(`ZodEmoji`,(e,t)=>{sD.init(e,t),qj.init(e,t)}),rM=X(`ZodNanoID`,(e,t)=>{cD.init(e,t),qj.init(e,t)}),iM=X(`ZodCUID`,(e,t)=>{lD.init(e,t),qj.init(e,t)}),aM=X(`ZodCUID2`,(e,t)=>{uD.init(e,t),qj.init(e,t)}),oM=X(`ZodULID`,(e,t)=>{dD.init(e,t),qj.init(e,t)}),sM=X(`ZodXID`,(e,t)=>{fD.init(e,t),qj.init(e,t)}),cM=X(`ZodKSUID`,(e,t)=>{pD.init(e,t),qj.init(e,t)}),lM=X(`ZodIPv4`,(e,t)=>{vD.init(e,t),qj.init(e,t)}),uM=X(`ZodIPv6`,(e,t)=>{xD.init(e,t),qj.init(e,t)}),dM=X(`ZodCIDRv4`,(e,t)=>{SD.init(e,t),qj.init(e,t)}),fM=X(`ZodCIDRv6`,(e,t)=>{wD.init(e,t),qj.init(e,t)}),pM=X(`ZodBase64`,(e,t)=>{DD.init(e,t),qj.init(e,t)}),mM=X(`ZodBase64URL`,(e,t)=>{AD.init(e,t),qj.init(e,t)}),hM=X(`ZodE164`,(e,t)=>{jD.init(e,t),qj.init(e,t)}),gM=X(`ZodJWT`,(e,t)=>{ND.init(e,t),qj.init(e,t)}),_M=X(`ZodNumber`,(e,t)=>{PD.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PA(e,t,n,r),e.isFinite=!0},Uw({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=kA(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=kA(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=kA(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>kA(e).format??null},{gt(e,t){return this.check(Ak(e,t))},gte(e,t){return this.check(jk(e,t))},min(e,t){return this.check(jk(e,t))},lt(e,t){return this.check(Ok(e,t))},lte(e,t){return this.check(kk(e,t))},max(e,t){return this.check(kk(e,t))},int(e){return this.check(bM(e))},safe(e){return this.check(bM(e))},positive(e){return this.check(Ak(0,e))},nonnegative(e){return this.check(jk(0,e))},negative(e){return this.check(Ok(0,e))},nonpositive(e){return this.check(kk(0,e))},multipleOf(e,t){return this.check(Pk(e,t))},step(e,t){return this.check(Pk(e,t))},finite(){return this}}));function vM(e){return Sk(_M,e)}var yM=X(`ZodNumberFormat`,(e,t)=>{FD.init(e,t),_M.init(e,t)});function bM(e){return Ck(yM,e)}var xM=X(`ZodBoolean`,(e,t)=>{ID.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FA(e,t,n,r)});function SM(e){return wk(xM,e)}var CM=X(`ZodNull`,(e,t)=>{LD.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RA(e,t,n,r)});function wM(e){return Tk(CM,e)}var TM=X(`ZodUnknown`,(e,t)=>{RD.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function EM(){return Ek(TM)}var DM=X(`ZodNever`,(e,t)=>{zD.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VA(e,t,n,r)});function OM(e){return Dk(DM,e)}var kM=X(`ZodArray`,(e,t)=>{Hj(),UD.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nj(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Ik(e,t))},nonempty(e){return this.check(Ik(1,e))},max(e,t){return this.check(Fk(e,t))},length(e,t){return this.check(Lk(e,t))},unwrap(){return this.element}});function AM(e,t){return Zk(kM,e,t)}var jM=X(`ZodObject`,(e,t)=>{Hj(),YD.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ij(e,t,n,r),Xw(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return HM(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(iw(this._zod.def,{catchall:e}))},passthrough(){return this.clone(iw(this._zod.def,{catchall:EM()}))},loose(){return this.clone(iw(this._zod.def,{catchall:EM()}))},strict(){return this.clone(iw(this._zod.def,{catchall:OM()}))},strip(){return this.clone(iw(this._zod.def,{catchall:void 0}))},extend(e){return Sw(this,e)},safeExtend(e){return ww(this,e)},merge(e){return Tw(this,e)},pick(e){return yw(this,e)},omit(e){return xw(this,e)},partial(...e){return Ew(qM,this,e[0])},exactPartial(...e){return Ew(YM,this,e[0],`exactPartial`)},required(...e){return Dw(rN,this,e[0])}});function MM(e,t){return new jM({type:`object`,shape:e??{},...Y(t)})}var NM=X(`ZodUnion`,(e,t)=>{ZD.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aj(e,t,n,r),e.options=t.options});function PM(e,t){return new NM({type:`union`,options:e,...Y(t)})}var FM=X(`ZodDiscriminatedUnion`,(e,t)=>{NM.init(e,t),$D.init(e,t)});function IM(e,t,n){return new FM({type:`union`,options:t,discriminator:e,...Y(n)})}var LM=X(`ZodIntersection`,(e,t)=>{eO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oj(e,t,n,r)});function RM(e,t){return new LM({type:`intersection`,left:e,right:t})}var zM=X(`ZodRecord`,(e,t)=>{Hj(),rO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dj(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function BM(e,t,n){return!t||!t._zod?new zM({type:`record`,keyType:Kj(),valueType:e,...Y(t)}):new zM({type:`record`,keyType:e,valueType:t,...Y(n)})}var VM=X(`ZodEnum`,(e,t)=>{iO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GA(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 VM({...t,checks:[],...Y(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 VM({...t,checks:[],...Y(r),entries:i})}});function HM(e,t){return new VM({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Y(t)})}var UM=X(`ZodLiteral`,(e,t)=>{aO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KA(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 WM(e,t){return new UM({type:`literal`,values:Array.isArray(e)?e:[e],...Y(t)})}var GM=X(`ZodTransform`,(e,t)=>{Hj(),oO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$A(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new aT(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(zw(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(zw(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function KM(e){return new GM({type:`transform`,transform:e})}var qM=X(`ZodOptional`,(e,t)=>{cO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sj(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function JM(e){return new qM({type:`optional`,innerType:e})}var YM=X(`ZodExactOptional`,(e,t)=>{lO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sj(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function XM(e){return new YM({type:`optional`,innerType:e})}var ZM=X(`ZodNullable`,(e,t)=>{uO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fj(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function QM(e){return new ZM({type:`nullable`,innerType:e})}var $M=X(`ZodDefault`,(e,t)=>{dO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gj(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eN(e,t){return new $M({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():dw(t)}})}var tN=X(`ZodPrefault`,(e,t)=>{pO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_j(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function nN(e,t){return new tN({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():dw(t)}})}var rN=X(`ZodNonOptional`,(e,t)=>{mO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pj(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function iN(e,t){return new rN({type:`nonoptional`,innerType:e,...Y(t)})}var aN=X(`ZodCatch`,(e,t)=>{_O.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vj(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oN(e,t){return new aN({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Qw(t)})}var sN=X(`ZodPipe`,(e,t)=>{vO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yj(e,t,n,r),e.in=t.in,e.out=t.out});function cN(e,t){return new sN({type:`pipe`,in:e,out:t})}var lN=X(`ZodReadonly`,(e,t)=>{bO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bj(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uN(e){return new lN({type:`readonly`,innerType:e})}var dN=X(`ZodLazy`,(e,t)=>{SO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cj(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function fN(e){return new dN({type:`lazy`,getter:e})}var pN=X(`ZodCustom`,(e,t)=>{CO.init(e,t),Uj.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ZA(e,t,n,r)});function mN(e,t){return Qk(pN,e??(()=>!0),t)}function hN(e,t={}){return $k(pN,e,t)}function gN(e,t){return eA(e,t)}var _N=X(`ZodInstanceOf`,(e,t)=>{pN.init(e,t)},{properties(e,t){return this.check(Wk(e,t))}});function vN(e,t={}){let n=new _N({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...Y(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 yN=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}},bN=10,xN=13,SN=32;function CN(e){}function wN(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=CN,onError:n=CN,onRetry:r=CN,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 yN(`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(TN(e,n,i)){let i=e.charCodeAt(n+5)===SN?n+6:n+5,a=e.slice(i,r);if(d===0&&e.charCodeAt(r+1)===bN){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 EN(e,n,i)?f=e.slice(e.charCodeAt(n+6)===SN?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)===xN&&e.charCodeAt(n)===bN&&n++}return e.slice(n)}function _(e,t,n){if(t===n){y();return}let r=e.charCodeAt(t);if(TN(e,t,r)){let r=e.charCodeAt(t+5)===SN?t+6:t+5,i=e.slice(r,n);u=d===0?i:`${u}
|
|
247
|
+
${i}`,d++;return}if(EN(e,t,r)){f=e.slice(e.charCodeAt(t+6)===SN?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)===SN?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)===SN?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)===SN?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 yN(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new yN(`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 TN(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 EN(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 DN=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=wN({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:ON,atob:kN}=globalThis,AN=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get,jN=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,`byteLength`).get;function MN(e){return ArrayBuffer.isView(e)&&AN.call(e)===`Uint8Array`}function NN(e){if(typeof e!=`object`||!e||!(`byteLength`in e))return!1;try{return jN.call(e),!0}catch{return!1}}function PN(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 FN=({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 OC({argument:`separator`,message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},IN=FN();function LN(e){return globalThis.Buffer?.isBuffer(e)??!1}var RN=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,zN=/"(?: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 BN(e){let t=JSON.parse(e);return typeof t!=`object`||!t||RN.test(e)===!1&&zN.test(e)===!1?t:VN(t)}function VN(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 HN(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return BN(e)}try{return BN(e)}finally{Error.stackTraceLimit=t}}function UN(e){if(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)){let{additionalProperties:t}=e;e.additionalProperties=t!=null&&typeof t!=`boolean`&&WN(t);let{properties:n}=e;if(n!=null)for(let e of Object.keys(n))n[e]=WN(n[e])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(WN):WN(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(WN)),e.allOf!=null&&(e.allOf=e.allOf.map(WN)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(WN));let{definitions:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=WN(t[e]);return e}function WN(e){return typeof e==`boolean`?e:UN(e)}var GN=Symbol(`Let zodToJsonSchema decide on which parser to use`),KN={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`},qN=e=>typeof e==`string`?{...KN,name:e}:{...KN,...e};function JN(){return{}}function YN(e,t){let n={type:`array`};return e.type?._def&&e.type?._def?.typeName!==`ZodAny`&&(n.items=BP(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 XN(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 ZN(){return{type:`boolean`}}function QN(e,t){return BP(e.type._def,t)}var $N=(e,t)=>BP(e.innerType._def,t);function eP(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(n=>eP(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 tP(e)}}var tP=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 nP(e,t){return{...BP(e.innerType._def,t),default:e.defaultValue()}}function rP(e,t){return t.effectStrategy===`input`?BP(e.schema._def,t):JN()}function iP(e){return{type:`string`,enum:Array.from(e.values)}}var aP=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function oP(e,t){let n=[BP(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),BP(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=[];return n.forEach(e=>{if(aP(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 sP(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 cP=void 0,lP={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:()=>(cP===void 0&&(cP=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),cP),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 uP(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`:mP(n,`email`,r.message,t);break;case`format:idn-email`:mP(n,`idn-email`,r.message,t);break;case`pattern:zod`:hP(n,lP.email,r.message,t)}break;case`url`:mP(n,`uri`,r.message,t);break;case`uuid`:mP(n,`uuid`,r.message,t);break;case`regex`:hP(n,r.regex,r.message,t);break;case`cuid`:hP(n,lP.cuid,r.message,t);break;case`cuid2`:hP(n,lP.cuid2,r.message,t);break;case`startsWith`:hP(n,RegExp(`^${dP(r.value,t)}`),r.message,t);break;case`endsWith`:hP(n,RegExp(`${dP(r.value,t)}$`),r.message,t);break;case`datetime`:mP(n,`date-time`,r.message,t);break;case`date`:mP(n,`date`,r.message,t);break;case`time`:mP(n,`time`,r.message,t);break;case`duration`:mP(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`:hP(n,RegExp(dP(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&mP(n,`ipv4`,r.message,t),r.version!==`v4`&&mP(n,`ipv6`,r.message,t);break;case`base64url`:hP(n,lP.base64url,r.message,t);break;case`jwt`:hP(n,lP.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&hP(n,lP.ipv4Cidr,r.message,t),r.version!==`v4`&&hP(n,lP.ipv6Cidr,r.message,t);break;case`emoji`:hP(n,lP.emoji(),r.message,t);break;case`ulid`:hP(n,lP.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:mP(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:hP(n,lP.base64,r.message,t)}break;case`nanoid`:hP(n,lP.nanoid,r.message,t)}return n}function dP(e,t){return t.patternStrategy===`escape`?pP(e):e}var fP=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function pP(e){let t=``;for(let n=0;n<e.length;n++)fP.has(e[n])||(t+=`\\`),t+=e[n];return t}function mP(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 hP(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:gP(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=gP(t,r)}function gP(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 _P(e,t){let n={type:`object`,additionalProperties:BP(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}=uP(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}=QN(e.keyType._def,t);return{...n,propertyNames:i}}return n}function vP(e,t){return t.mapStrategy===`record`?_P(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[BP(e.keyType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`0`]})||JN(),BP(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`1`]})||JN()],minItems:2,maxItems:2}}}function yP(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 bP(){return{not:JN()}}function xP(){return{type:`null`}}var SP={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function CP(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in SP&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=SP[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 wP(e,t)}var wP=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>BP(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 TP(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[SP[e.innerType._def.typeName],`null`]};let n=BP(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`0`]});return n&&{anyOf:[n,{type:`null`}]}}function EP(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 DP(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=kP(a),s=BP(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=OP(e,t);return a!==void 0&&(n.additionalProperties=a),n}function OP(e,t){if(e.catchall._def.typeName!==`ZodNever`)return BP(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 kP(e){try{return e.isOptional()}catch{return!0}}var AP=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return BP(e.innerType._def,t);let n=BP(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`1`]});return n?{anyOf:[{not:JN()},n]}:JN()},jP=(e,t)=>{if(t.pipeStrategy===`input`)return BP(e.in._def,t);if(t.pipeStrategy===`output`)return BP(e.out._def,t);let n=BP(e.in._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]});return{allOf:[n,BP(e.out._def,{...t,currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]})].filter(e=>e!==void 0)}};function MP(e,t){return BP(e.type._def,t)}function NP(e,t){let n={type:`array`,uniqueItems:!0,items:BP(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 PP(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>BP(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:BP(e.rest._def,{...t,currentPath:[...t.currentPath,`additionalItems`]})}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>BP(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function FP(){return{not:JN()}}function IP(){return JN()}var LP=(e,t)=>BP(e.innerType._def,t),RP=(e,t,n)=>{switch(t){case`ZodString`:return uP(e,n);case`ZodNumber`:return EP(e);case`ZodObject`:return DP(e,n);case`ZodBigInt`:return XN(e);case`ZodBoolean`:return ZN();case`ZodDate`:return eP(e,n);case`ZodUndefined`:return FP();case`ZodNull`:return xP();case`ZodArray`:return YN(e,n);case`ZodUnion`:case`ZodDiscriminatedUnion`:return CP(e,n);case`ZodIntersection`:return oP(e,n);case`ZodTuple`:return PP(e,n);case`ZodRecord`:return _P(e,n);case`ZodLiteral`:return sP(e);case`ZodEnum`:return iP(e);case`ZodNativeEnum`:return yP(e);case`ZodNullable`:return TP(e,n);case`ZodOptional`:return AP(e,n);case`ZodMap`:return vP(e,n);case`ZodSet`:return NP(e,n);case`ZodLazy`:return()=>e.getter()._def;case`ZodPromise`:return MP(e,n);case`ZodNaN`:case`ZodNever`:return bP();case`ZodEffects`:return rP(e,n);case`ZodAny`:return JN();case`ZodUnknown`:return IP();case`ZodDefault`:return nP(e,n);case`ZodBranded`:return QN(e,n);case`ZodReadonly`:return LP(e,n);case`ZodCatch`:return $N(e,n);case`ZodPipeline`:return jP(e,n);case`ZodFunction`:case`ZodVoid`:case`ZodSymbol`:return;default:return(e=>void 0)(t)}},zP=(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 BP(e,t,n=!1){let r=t.seen.get(e);if(t.override){let i=t.override?.(e,t,r,n);if(i!==GN)return i}if(r&&!n){let e=VP(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=RP(e,e.typeName,t),o=typeof a==`function`?BP(a(),t):a;if(o&&HP(e,t,o),t.postProcess){let n=t.postProcess(o,e,t);return i.jsonSchema=o,n}return i.jsonSchema=o,o}var VP=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:zP(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`),JN()):t.$refStrategy===`seen`?JN():void 0}},HP=(e,t,n)=>(e.description&&(n.description=e.description),n),UP=e=>{let t=qN(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}]))}},WP=(e,t)=>{let n=UP(t),r=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:BP(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0)??JN()}),{}):void 0,i=typeof t==`string`?t:t?.nameStrategy===`title`?void 0:t?.name,a=BP(e._def,i===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,i]},!1)??JN(),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},GP=Symbol.for(`vercel.ai.schema`);function KP(e){let t;return()=>(t??=e(),t)}function qP(e,{validate:t}={}){return{[GP]:!0,_type:void 0,get jsonSchema(){return typeof e==`function`&&(e=e()),e},validate:t}}function JP(e){return typeof e==`object`&&!!e&&GP in e&&e[GP]===!0&&`jsonSchema`in e&&`validate`in e}function YP(e){return e==null?qP({type:`object`,properties:{},additionalProperties:!1}):JP(e)?e:`~standard`in e?e[`~standard`].vendor===`zod`?tF(e):XP(e):e()}function XP(e){return qP(()=>{if(!ZP(e))throw Error(`Standard schema vendor '${e[`~standard`].vendor}' does not support JSON Schema conversion.`);return UN(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 IC({value:t,cause:n.issues})}}})}function ZP(e){return e[`~standard`].jsonSchema!=null}function QP(e,t){let n=t?.useReferences??!1;return qP(()=>WP(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 $P(e,t){sT().localeError||sT(UO());let n=t?.useReferences??!1;return qP(()=>UN(Tj(e,{target:`draft-7`,io:`input`,reused:n?`ref`:`inline`})),{validate:async t=>{let n=await Mj(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function eF(e){return`_zod`in e}function tF(e,t){return eF(e)?$P(e,t):QP(e,t)}async function nF({value:e,schema:t,context:n}){let r=await rF({value:e,schema:t,context:n});if(!r.success)throw IC.wrap({value:e,cause:r.error,context:n});return r.value}async function rF({value:e,schema:t,context:n}){let r=YP(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:IC.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:IC.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function iF({text:e,schema:t}){try{let n=HN(e);return t==null?{success:!0,value:n,rawValue:n}:await rF({value:n,schema:t})}catch(t){return{success:!1,error:MC.isInstance(t)?t:new MC({text:e,cause:t}),rawValue:void 0}}}var aF=67108864;function oF({stream:e,schema:t,maxEventSize:n=aF}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new DN({maxBufferSize:n})).pipeThrough(new TransformStream({async transform({data:e},n){e!==`[DONE]`&&n.enqueue(await iF({text:e,schema:t}))}}))}async function sF(e){return typeof e==`function`&&(e=e()),e}new TextDecoder;var cF=X(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);WE.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){Vw(this,`with`,e)},parse(e,t){return xT(this,e,t,{callee:this.parse})},parseAsync(e,t){return CT(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return TT(this,e,t)},safeParseAsync(e,t){return OT(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 mw(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)}}),lF=X(`ZodMiniString`,(e,t)=>{JE.init(e,t),cF.init(e,t)});function uF(e){return YO(lF,e)}var dF=X(`ZodMiniNumber`,(e,t)=>{PD.init(e,t),cF.init(e,t)});function fF(e){return Sk(dF,e)}var pF=X(`ZodMiniNumberFormat`,(e,t)=>{FD.init(e,t),dF.init(e,t)});function mF(e){return Ck(pF,e)}var hF=X(`ZodMiniBoolean`,(e,t)=>{ID.init(e,t),cF.init(e,t)});function gF(e){return wk(hF,e)}var _F=X(`ZodMiniUnknown`,(e,t)=>{RD.init(e,t),cF.init(e,t)});function vF(){return Ek(_F)}var yF=X(`ZodMiniNever`,(e,t)=>{zD.init(e,t),cF.init(e,t)});function bF(e){return Dk(yF,e)}var xF=X(`ZodMiniArray`,(e,t)=>{UD.init(e,t),cF.init(e,t)});function SF(e,t){return new xF({type:`array`,element:e,...Y(t)})}var CF=X(`ZodMiniObject`,(e,t)=>{JD.init(e,t),cF.init(e,t),Xw(e,`shape`,e=>e._zod.def.shape,!1)});function wF(e,t){return new CF({type:`object`,shape:e??{},...Y(t)})}function TF(e,t){return new CF({type:`object`,shape:e,catchall:vF(),...Y(t)})}function EF(e,t){return Sw(e,t)}var DF=X(`ZodMiniUnion`,(e,t)=>{ZD.init(e,t),cF.init(e,t)});function OF(e,t){return new DF({type:`union`,options:e,...Y(t)})}var kF=X(`ZodMiniDiscriminatedUnion`,(e,t)=>{$D.init(e,t),cF.init(e,t)});function AF(e,t,n){return new kF({type:`union`,options:t,discriminator:e,...Y(n)})}var jF=X(`ZodMiniRecord`,(e,t)=>{rO.init(e,t),cF.init(e,t)});function MF(e,t,n){return!t||!t._zod?new jF({type:`record`,keyType:uF(),valueType:e,...Y(t)}):new jF({type:`record`,keyType:e,valueType:t,...Y(n)})}var NF=X(`ZodMiniEnum`,(e,t)=>{iO.init(e,t),cF.init(e,t),e.options=[...e._zod.values]});function PF(e,t){return new NF({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Y(t)})}var FF=X(`ZodMiniLiteral`,(e,t)=>{aO.init(e,t),cF.init(e,t)});function IF(e,t){return new FF({type:`literal`,values:Array.isArray(e)?e:[e],...Y(t)})}var LF=X(`ZodMiniTransform`,(e,t)=>{oO.init(e,t),cF.init(e,t)});function RF(e){return new LF({type:`transform`,transform:e})}var zF=X(`ZodMiniOptional`,(e,t)=>{cO.init(e,t),cF.init(e,t)});function BF(e){return new zF({type:`optional`,innerType:e})}var VF=X(`ZodMiniPipe`,(e,t)=>{vO.init(e,t),cF.init(e,t)});function HF(e,t){return new VF({type:`pipe`,in:e,out:t})}var UF=X(`ZodMiniCustom`,(e,t)=>{CO.init(e,t),cF.init(e,t)});function WF(e,t){return Qk(UF,e??(()=>!0),t)}function GF(e,t={}){return $k(UF,e,t)}var KF=`AI_InvalidArgumentError`,qF=`vercel.ai.error.${KF}`,JF=Symbol.for(qF),YF=class extends hC{constructor({parameter:e,value:t,message:n}){super({name:KF,message:`Invalid argument for parameter ${e}: ${n}`}),this[JF]=!0,this.parameter=e,this.value=t}static isInstance(e){return hC.hasMarker(e,qF)}};function XF(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?XF(a,i):i}return n}new TextEncoder,new TextEncoder;var ZF=`AI_UIMessageStreamError`,QF=`vercel.ai.error.${ZF}`,$F=Symbol.for(QF),eI=class extends hC{constructor({chunkType:e,chunkId:t,message:n}){super({name:ZF,message:n}),this[$F]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return hC.hasMarker(e,QF)}};function tI(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 nI(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await iF({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await iF({text:tI(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}FN({prefix:`steer`,size:24}),FN({prefix:`aitxt`,size:24}),FN({prefix:`call`,size:24}),TransformStream;var Z={NEVER:eT,array:SF,boolean:gF,custom:WF,discriminatedUnion:AF,enum:PF,extend:EF,int:mF,literal:IF,looseObject:TF,maximum:kk,minLength:Ik,never:bF,nonnegative:Nk,number:fF,object:wF,optional:BF,pipe:HF,positive:Mk,record:MF,refine:GF,safeParse:TT,startsWith:Hk,string:uF,transform:RF,union:OF,unknown:vF},Q={array:AM,boolean:SM,custom:mN,discriminatedUnion:IM,instanceof:vN,lazy:fN,literal:WM,null:wM,number:vM,object:MM,record:BM,string:Kj,union:PM,unknown:EM},rI=Q.lazy(()=>Q.union([Q.null(),Q.string(),Q.number(),Q.boolean(),Q.record(Q.string(),rI.optional()),Q.array(rI)])),iI=Q.record(Q.string(),Q.record(Q.string(),rI.optional()));function aI(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 oI=aI(iI),sI=Z.record(Z.string(),Z.optional(rI)),cI=KP(()=>tF(Z.union([Z.looseObject({type:Z.literal(`text-start`),id:Z.string(),providerMetadata:Z.optional(iI)}),Z.looseObject({type:Z.literal(`text-delta`),id:Z.string(),delta:Z.string(),providerMetadata:Z.optional(iI)}),Z.looseObject({type:Z.literal(`text-end`),id:Z.string(),citations:Z.optional(Z.array(oI)),providerMetadata:Z.optional(iI)}),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(iI),toolMetadata:Z.optional(sI),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(iI),toolMetadata:Z.optional(sI),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(iI),toolMetadata:Z.optional(sI),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(iI)}),Z.looseObject({type:Z.literal(`tool-output-available`),toolCallId:Z.string(),output:Z.unknown(),providerExecuted:Z.optional(Z.boolean()),providerMetadata:Z.optional(iI),toolMetadata:Z.optional(sI),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(iI),toolMetadata:Z.optional(sI),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(iI)}),Z.looseObject({type:Z.literal(`reasoning-delta`),id:Z.string(),delta:Z.string(),providerMetadata:Z.optional(iI)}),Z.looseObject({type:Z.literal(`reasoning-end`),id:Z.string(),providerMetadata:Z.optional(iI)}),Z.looseObject({type:Z.literal(`custom`),kind:Z.pipe(Z.string(),Z.transform(e=>e)),providerMetadata:Z.optional(iI)}),Z.looseObject({type:Z.literal(`source-url`),sourceId:Z.string(),url:Z.string(),title:Z.optional(Z.string()),providerMetadata:Z.optional(iI)}),Z.looseObject({type:Z.literal(`source-document`),sourceId:Z.string(),mediaType:Z.string(),title:Z.string(),filename:Z.optional(Z.string()),providerMetadata:Z.optional(iI)}),Z.looseObject({type:Z.literal(`file`),url:Z.string(),mediaType:Z.string(),providerMetadata:Z.optional(iI)}),Z.looseObject({type:Z.literal(`reasoning-file`),url:Z.string(),mediaType:Z.string(),providerMetadata:Z.optional(iI)}),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(iI)}),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(iI)})]))}),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 lI(e){return e.type.startsWith(`data-`)}function uI(){return Object.create(null)}function dI(e){return e.type.startsWith(`tool-`)}function fI(e){return e.type===`dynamic-tool`}function pI(e){return dI(e)||fI(e)}function mI(e){return e.type.split(`-`).slice(1).join(`-`)}function hI({lastMessage:e,messageId:t}){let n=e?.role===`assistant`?e:{id:t,metadata:void 0,role:`assistant`,parts:[]},r=uI(),i=n.parts.findLastIndex(e=>e.type===`step-start`),a=0;for(let e of n.parts.slice(i+1)){if(!pI(e))continue;let t=a;dI(e)&&a++,e.state===`input-streaming`&&(r[e.toolCallId]={text:e.rawInput??``,inputEncoding:e.inputEncoding,index:t,toolName:e.type===`dynamic-tool`?e.toolName:mI(e),dynamic:e.type===`dynamic-tool`,title:e.title,toolMetadata:e.toolMetadata})}return{message:n,activeTextParts:uI(),activeReasoningParts:uI(),partialToolCalls:r}}function gI({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(pI)}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(pI(i)&&i.toolCallId===e){t=i;break}}}if(t==null)throw new eI({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(pI).find(t=>t.approval?.id===e);if(t==null)throw new eI({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=>dI(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:XF(r.message.metadata,e);t!=null&&await nF({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 eI({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 eI({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 eI({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 eI({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(dI);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 eI({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 nI(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(pI).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:mI(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:mI(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=uI(),r.activeReasoningParts=uI(),r.partialToolCalls=uI(),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,hI({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(lI(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 nF({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 _I({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 vI(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}FN({prefix:`aitxt`,size:24}),FN({prefix:`call`,size:24}),FN({prefix:`aitxt`,size:24}),FN({prefix:`call`,size:24});var yI=Symbol(`invalid`);function bI(e){let t=[],n=xI(e,t,new Set);return n===yI?{success:!1,path:t}:{success:!0,value:n}}function xI(e,t,n){switch(typeof e){case`string`:case`boolean`:return e;case`number`:return Number.isFinite(e)?e:yI;case`object`:{if(e===null)return e;if(n.has(e))return yI;n.add(e);let r=Array.isArray(e)?SI(e,t,n):CI(e,t,n);return n.delete(e),r}default:return yI}}function SI(e,t,n){let r;for(let i=0;i<e.length;i++){let a=e[i];t.push(i);let o=xI(a,t,n);if(o===yI)return yI;t.pop(),r==null?o!==a&&(r=e.slice(0,i),r.push(o)):r.push(o)}return r??e}function CI(e,t,n){if(!TI(e)||EI(e))return yI;let r=Object.keys(e),i;for(let a=0;a<r.length;a++){let o=r[a];if(o===`__proto__`){i??=wI(e,r,a);continue}let s=e[o],c=s;if(s!==void 0){if(t.push(o),c=xI(s,t,n),c===yI)return yI;t.pop()}i==null?c!==s&&(i=wI(e,r,a),i[o]=c):i[o]=c}return i??e}function wI(e,t,n){let r={};for(let i=0;i<n;i++)r[t[i]]=e[t[i]];return r}function TI(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 EI(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 DI=Z.pipe(Z.unknown(),Z.transform((e,t)=>{let n=bI(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)})),OI=Z.custom();Z.pipe(DI,Z.record(Z.string(),OI));var kI=Z.pipe(DI,Z.record(Z.string(),Z.record(Z.string(),OI)));Z.record(Z.string(),Z.string()),aI(kI),FN({prefix:`call`,size:24}),FN({prefix:`call`,size:24}),new TextEncoder,FN({prefix:`call`,size:24}),FN({prefix:`call`,size:24}),FN({prefix:`aiobj`,size:24});var{atob:AI}=globalThis,jI=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)})}};FN({prefix:`aiobj`,size:24}),FN({prefix:`call`,size:24});var MI=Q.union([Q.string(),Q.custom(MN,{message:`Must be a Uint8Array`}),Q.custom(NN,{message:`Must be an ArrayBuffer`}),Q.custom(LN,{message:`Must be a Buffer`})]),NI=Q.record(Q.string(),Q.string()),PI=Q.object({type:Q.literal(`text`),text:Q.string(),providerOptions:iI.optional()}),FI=Q.object({type:Q.literal(`image`),image:Q.union([MI,Q.instanceof(URL),NI]),mediaType:Q.string().optional(),providerOptions:iI.optional()}),II=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`data`),data:MI}),Q.object({type:Q.literal(`url`),url:Q.instanceof(URL)}),Q.object({type:Q.literal(`reference`),reference:NI}),Q.object({type:Q.literal(`text`),text:Q.string()})]),LI=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`data`),data:MI}),Q.object({type:Q.literal(`url`),url:Q.instanceof(URL)})]),RI=Q.object({type:Q.literal(`file`),data:Q.union([II,MI,Q.instanceof(URL),NI]),filename:Q.string().optional(),mediaType:Q.string(),providerOptions:iI.optional()}),zI=Q.object({type:Q.literal(`reasoning`),text:Q.string(),providerOptions:iI.optional()}),BI=Q.object({type:Q.literal(`custom`),kind:Q.string().transform(e=>e),providerOptions:iI.optional()}),VI=Q.object({type:Q.literal(`reasoning-file`),data:Q.union([LI,MI,Q.instanceof(URL)]),mediaType:Q.string(),providerOptions:iI.optional()}),HI=Q.object({type:Q.literal(`tool-call`),toolCallId:Q.string(),toolName:Q.string(),input:Q.unknown(),providerOptions:iI.optional(),providerExecuted:Q.boolean().optional()}),UI=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`text`),value:Q.string(),providerOptions:iI.optional()}),Q.object({type:Q.literal(`json`),value:rI,providerOptions:iI.optional()}),Q.object({type:Q.literal(`execution-denied`),reason:Q.string().optional(),providerOptions:iI.optional()}),Q.object({type:Q.literal(`error-text`),value:Q.string(),providerOptions:iI.optional()}),Q.object({type:Q.literal(`error-json`),value:rI,providerOptions:iI.optional()}),Q.object({type:Q.literal(`content`),value:Q.array(Q.union([Q.object({type:Q.literal(`text`),text:Q.string(),providerOptions:iI.optional()}),Q.object({type:Q.literal(`file`),data:II,mediaType:Q.string(),filename:Q.string().optional(),providerOptions:iI.optional()}),Q.object({type:Q.literal(`file-data`),data:Q.string(),mediaType:Q.string(),filename:Q.string().optional(),providerOptions:iI.optional()}),Q.object({type:Q.literal(`file-url`),url:Q.string(),mediaType:Q.string().optional(),providerOptions:iI.optional()}),Q.object({type:Q.literal(`file-id`),fileId:Q.union([Q.string(),Q.record(Q.string(),Q.string())]),providerOptions:iI.optional()}),Q.object({type:Q.literal(`file-reference`),providerReference:Q.record(Q.string(),Q.string()),providerOptions:iI.optional()}),Q.object({type:Q.literal(`image-data`),data:Q.string(),mediaType:Q.string(),providerOptions:iI.optional()}),Q.object({type:Q.literal(`image-url`),url:Q.string(),providerOptions:iI.optional()}),Q.object({type:Q.literal(`image-file-id`),fileId:Q.union([Q.string(),Q.record(Q.string(),Q.string())]),providerOptions:iI.optional()}),Q.object({type:Q.literal(`image-file-reference`),providerReference:Q.record(Q.string(),Q.string()),providerOptions:iI.optional()}),Q.object({type:Q.literal(`custom`),providerOptions:iI.optional()})]))})]),WI=Q.object({type:Q.literal(`tool-result`),toolCallId:Q.string(),toolName:Q.string(),output:UI,providerOptions:iI.optional()}),GI=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()}),KI=Q.object({type:Q.literal(`tool-approval-response`),approvalId:Q.string(),approved:Q.boolean(),reason:Q.string().optional()}),qI=Q.object({role:Q.literal(`system`),content:Q.string(),providerOptions:iI.optional()}),JI=Q.object({role:Q.literal(`user`),content:Q.union([Q.string(),Q.array(Q.union([PI,FI,RI]))]),providerOptions:iI.optional()}),YI=Q.object({role:Q.literal(`assistant`),content:Q.union([Q.string(),Q.array(Q.union([PI,BI,RI,zI,VI,HI,WI,GI]))]),providerOptions:iI.optional()}),XI=Q.object({role:Q.literal(`tool`),content:Q.array(Q.union([WI,KI])),providerOptions:iI.optional()});Q.union([qI,JI,YI,XI]),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())})))}),FN({prefix:`call`,size:24}),FN({prefix:`call`,size:24}),FN({prefix:`call`,size:24});async function ZI({response:e,url:t,fallbackMessage:n}){let r=await e.text();return new yC({message:r||n,url:t,requestBodyValues:void 0,statusCode:e.status,responseBody:r})}async function QI(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new BC({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 $I(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 eL=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 sF(this.body),r=await sF(this.headers),i=await sF(this.credentials),a={...PN(r),...PN(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:PN(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 ZI({response:d,url:s,fallbackMessage:`Failed to fetch the chat response.`});if(!d.body)throw new CC({message:`The response body is empty.`});return this.processResponseStream(d.body)}async reconnectToStream(e){let t=await sF(this.body),n=await sF(this.headers),r=await sF(this.credentials),i={...PN(n),...PN(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 YF({parameter:`chatId`,value:e.chatId,message:`Chat IDs must not be "." or ".." when using the default reconnect URL.`});o=$I(this.api,`/${encodeURIComponent(e.chatId)}/stream`)}let s=a?.headers===void 0?i:PN(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 ZI({response:l,url:o,fallbackMessage:`Failed to fetch the chat response.`});if(!l.body)throw new CC({message:`The response body is empty.`});return this.processResponseStream(l.body)}},tL=class extends eL{constructor({resumeStreamIsReplay:e=!0,...t}={}){super(t),this.resumeStreamIsReplay=e}processResponseStream(e){return oF({stream:e,schema:cI}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},nL=class{get id(){return this._id??=this.generateId()}constructor({generateId:e=IN,id:t,transport:n=new tL,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 jI,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=>pI(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 QI(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 YF({parameter:`message.messageId`,value:e.messageId,message:`message with id ${e.messageId} not found`});if(this.state.messages[t].role!==`user`)throw new YF({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 YF({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=>pI(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=>pI(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(!pI(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=>pI(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=>pI(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=>pI(e)&&e.state===`approval-responded`)&&!e.parts.some(e=>pI(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=vI();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=>pI(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:hI({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 _I({stream:gI({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 rL({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(pI);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 iL=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 aL(e,t){return t==null?e:(0,iL.default)(e,t)}function oL(e){return Array.isArray(e)?[...e]:typeof e==`object`&&e&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)?{...e}:e}var sL=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=oL(t.metadata)),n},this[`~registerMessagesCallback`]=(e,t)=>{let n=t?aL(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},cL=class extends nL{#e;constructor({messages:e,...t}){let n=new sL(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}},lL=new WeakMap;function uL({chat:e,state:t}){if(document.visibilityState!==`visible`||t.pendingVisibilityResume!=null)return;let n=()=>lL.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 dL({chat:e,registration:t}){let n=lL.get(e);if(n==null){let t={registrations:new Set};if(lL.set(e,t),n=t,typeof document<`u`){let n=()=>uL({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?.(),lL.delete(e))}}function fL(e){return{chat:e,messages:e.messages,status:e.status,error:e.error,experimental_queuedMessages:e.experimental_queuedMessages}}function pL(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 mL({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 tL),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 cL(l),isExternallyManaged:`chat`in r}),[u]);(0,b.useEffect)(()=>{if(!f)return()=>{d.stop()}},[d,f]);let[p,m]=(0,b.useState)(()=>fL(d));p.chat!==d&&m(fL(d)),(0,b.useEffect)(()=>{let e=!0,t=()=>{if(!e)return;let t=fL(d);m(e=>e.chat!==d||pL(e,t)?e:t)},n=[d[`~registerMessagesCallback`](t,i),d[`~registerStatusCallback`](t),d[`~registerErrorCallback`](t),d[`~registerQueuedMessagesCallback`](t)],r=fL(d);return m(e=>pL(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 dL({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 hL(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var gL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_L=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vL={};function yL(e,t){return((t||vL).jsx?_L:gL).test(e)}var bL=/[ \t\n\f\r]/g;function xL(e){return typeof e==`object`?e.type===`text`&&SL(e.value):SL(e)}function SL(e){return e.replace(bL,``)===``}var CL=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};CL.prototype.normal={},CL.prototype.property={},CL.prototype.space=void 0;function wL(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new CL(n,r,t)}function TL(e){return e.toLowerCase()}var EL=class{constructor(e,t){this.attribute=t,this.property=e}};EL.prototype.attribute=``,EL.prototype.booleanish=!1,EL.prototype.boolean=!1,EL.prototype.commaOrSpaceSeparated=!1,EL.prototype.commaSeparated=!1,EL.prototype.defined=!1,EL.prototype.mustUseProperty=!1,EL.prototype.number=!1,EL.prototype.overloadedBoolean=!1,EL.prototype.property=``,EL.prototype.spaceSeparated=!1,EL.prototype.space=void 0;var DL=s({boolean:()=>kL,booleanish:()=>AL,commaOrSpaceSeparated:()=>PL,commaSeparated:()=>NL,number:()=>$,overloadedBoolean:()=>jL,spaceSeparated:()=>ML}),OL=0,kL=FL(),AL=FL(),jL=FL(),$=FL(),ML=FL(),NL=FL(),PL=FL();function FL(){return 2**++OL}var IL=Object.keys(DL),LL=class extends EL{constructor(e,t,n,r){let i=-1;if(super(e,t),RL(this,`space`,r),typeof n==`number`)for(;++i<IL.length;){let e=IL[i];RL(this,IL[i],(n&DL[e])===DL[e])}}};LL.prototype.defined=!0;function RL(e,t,n){n&&(e[t]=n)}function zL(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new LL(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[TL(r)]=r,n[TL(a.attribute)]=r}return new CL(t,n,e.space)}var BL=zL({properties:{ariaActiveDescendant:null,ariaAtomic:AL,ariaAutoComplete:null,ariaBusy:AL,ariaChecked:AL,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:ML,ariaCurrent:null,ariaDescribedBy:ML,ariaDetails:null,ariaDisabled:AL,ariaDropEffect:ML,ariaErrorMessage:null,ariaExpanded:AL,ariaFlowTo:ML,ariaGrabbed:AL,ariaHasPopup:null,ariaHidden:AL,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ML,ariaLevel:$,ariaLive:null,ariaModal:AL,ariaMultiLine:AL,ariaMultiSelectable:AL,ariaOrientation:null,ariaOwns:ML,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:AL,ariaReadOnly:AL,ariaRelevant:null,ariaRequired:AL,ariaRoleDescription:ML,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:AL,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function VL(e,t){return t in e?e[t]:t}function HL(e,t){return VL(e,t.toLowerCase())}var UL=zL({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:NL,acceptCharset:ML,accessKey:ML,action:null,allow:null,allowFullScreen:kL,allowPaymentRequest:kL,allowUserMedia:kL,alpha:kL,alt:null,as:null,async:kL,autoCapitalize:null,autoComplete:ML,autoFocus:kL,autoPlay:kL,blocking:ML,capture:null,charSet:null,checked:kL,cite:null,className:ML,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:AL,controls:kL,controlsList:ML,coords:$|NL,crossOrigin:null,data:null,dateTime:null,decoding:null,default:kL,defer:kL,dir:null,dirName:null,disabled:kL,download:jL,draggable:AL,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:kL,formTarget:null,headers:ML,height:$,hidden:jL,high:$,href:null,hrefLang:null,htmlFor:ML,httpEquiv:ML,id:null,imageSizes:null,imageSrcSet:null,inert:kL,inputMode:null,integrity:null,is:null,isMap:kL,itemId:null,itemProp:ML,itemRef:ML,itemScope:kL,itemType:ML,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:kL,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:kL,muted:kL,name:null,nonce:null,noModule:kL,noValidate:kL,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:kL,optimum:$,pattern:null,ping:ML,placeholder:null,playsInline:kL,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:kL,referrerPolicy:null,rel:ML,required:kL,reversed:kL,rows:$,rowSpan:$,sandbox:ML,scope:null,scoped:kL,seamless:kL,selected:kL,shadowRootClonable:kL,shadowRootCustomElementRegistry:kL,shadowRootDelegatesFocus:kL,shadowRootMode:null,shadowRootSerializable:kL,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:AL,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:kL,useMap:null,value:AL,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ML,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:kL,declare:kL,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:kL,noHref:kL,noShade:kL,noWrap:kL,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:AL,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:kL,disablePictureInPicture:kL,disableRemotePlayback:kL,exportParts:NL,part:ML,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:HL}),WL=zL({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:PL,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:ML,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:kL,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:NL,g2:NL,glyphName:NL,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:PL,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:ML,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:PL,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:PL,rev:PL,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:PL,requiredFeatures:PL,requiredFonts:PL,requiredFormats:PL,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:PL,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:PL,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:PL,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:VL}),GL=zL({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()}}),KL=zL({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:HL}),qL=zL({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),JL={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`},YL=/[A-Z]/g,XL=/-[a-z]/g,ZL=/^data[-\w.:]+$/i;function QL(e,t){let n=TL(t),r=t,i=EL;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ZL.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(XL,eR);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!XL.test(e)){let n=e.replace(YL,$L);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=LL}return new i(r,t)}function $L(e){return`-`+e.toLowerCase()}function eR(e){return e.charAt(1).toUpperCase()}var tR=wL([BL,UL,GL,KL,qL],`html`),nR=wL([BL,WL,GL,KL,qL],`svg`);function rR(e){return e.join(` `).trim()}var iR=/\/\*(?:[^*]|\*(?!\/))*\*\//g,aR=/\n/g,oR=/^\s*/,sR=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,cR=/^:\s*/,lR=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,uR=/^[;\s]*/,dR=`
|
|
251
|
+
`,fR=`/`,pR=`*`,mR=``,hR=`comment`,gR=`declaration`;function _R(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(aR);t&&(n+=t.length);var i=e.lastIndexOf(dR);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(oR)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(fR==e.charAt(0)&&pR==e.charAt(1)){for(var n=2;mR!=e.charAt(n)&&(pR!=e.charAt(n)||fR!=e.charAt(n+1));)++n;if(n+=2,mR===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:hR,comment:o})}}function f(){var e=a(),t=c(sR);if(t){if(d(),!c(cR))return s(`property missing ':'`);var n=c(lR),r=e({type:gR,property:t[0].replace(iR,mR).trim(),value:n?n[0].replace(iR,mR).trim():mR});return c(uR),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function vR(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=_R(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 yR=xR(`end`),bR=xR(`start`);function xR(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 SR(e){let t=bR(e),n=yR(e);if(t&&n)return{start:t,end:n}}function CR(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?TR(e.position):`start`in e||`end`in e?TR(e):`line`in e||`column`in e?wR(e):``}function wR(e){return ER(e&&e.line)+`:`+ER(e&&e.column)}function TR(e){return wR(e&&e.start)+`-`+wR(e&&e.end)}function ER(e){return e&&typeof e==`number`?e:1}var DR=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=CR(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(DR.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 OR={}.hasOwnProperty,kR=new Map,AR=/[A-Z]/g,jR=/-([a-z])/g,MR=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),NR=new Set([`td`,`th`]),PR=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function FR(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=KR(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=GR(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`?nR:tR,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=IR(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function IR(e,t,n){if(t.type===`element`)return LR(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return RR(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return BR(e,t,n);if(t.type===`mdxjsEsm`)return zR(e,t);if(t.type===`root`)return VR(e,t,n);if(t.type===`text`)return HR(e,t)}function LR(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=nR,e.schema=i),e.ancestors.push(t);let a=QR(e,t.tagName,!1),o=qR(e,t),s=YR(e,t);return MR.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!xL(e)})),UR(e,o,a,t),WR(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function RR(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)}$R(e,t.position)}function zR(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$R(e,t.position)}function BR(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=nR,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:QR(e,t.name,!0),o=JR(e,t),s=YR(e,t);return UR(e,o,a,t),WR(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function VR(e,t,n){let r={};return WR(r,YR(e,t)),e.create(t,e.Fragment,r,n)}function HR(e,t){return t.value}function UR(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function WR(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function GR(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 KR(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=bR(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 qR(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&OR.call(t.properties,i)){let a=XR(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&NR.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 JR(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 $R(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 $R(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function YR(e,t){let n=[],r=-1,i=e.passKeys?new Map:kR;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=IR(e,a,o);s!==void 0&&n.push(s)}return n}function XR(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=QL(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?hL(n):rR(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:ez(n):ZR(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?JL[r.property]||r.property:r.attribute,n]}function ZR(e,t){let n={};try{vR(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(jR,rz))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new DR("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=PR+`#cannot-parse-style-attribute`,r}return n}function QR(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=yL(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=yL(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return OR.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);$R(e)}function $R(e,t){let n=new DR("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=PR+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function ez(e){let t={},n;for(n in e)OR.call(e,n)&&(t[tz(n)]=e[n]);return t}function tz(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(AR,nz);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function nz(e){return`-`+e.toLowerCase()}function rz(e,t){return t.toUpperCase()}var iz={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`]},az={};function oz(e,t){let n=t||az;return sz(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function sz(e,t,n){if(lz(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 cz(e.children,t,n)}return Array.isArray(e)?cz(e,t,n):``}function cz(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=sz(e[i],t,n);return r.join(``)}function lz(e){return!!(e&&typeof e==`object`)}var uz=document.createElement(`i`);function dz(e){let t=`&`+e+`;`;uz.innerHTML=t;let n=uz.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function fz(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 pz(e,t){return e.length>0?(fz(e,e.length,0,t),e):t}var mz={}.hasOwnProperty;function hz(e){let t={},n=-1;for(;++n<e.length;)gz(t,e[n]);return t}function gz(e,t){let n;for(n in t){let r=(mz.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){mz.call(r,a)||(r[a]=[]);let e=i[a];_z(r[a],Array.isArray(e)?e:e?[e]:[])}}}function _z(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);fz(e,0,0,r)}function vz(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 yz(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var bz=Mz(/[A-Za-z]/),xz=Mz(/[\dA-Za-z]/),Sz=Mz(/[#-'*+\--9=?A-Z^-~]/);function Cz(e){return e!==null&&(e<32||e===127)}var wz=Mz(/\d/),Tz=Mz(/[\dA-Fa-f]/),Ez=Mz(/[!-/:-@[-`{-~]/);function Dz(e){return e!==null&&e<-2}function Oz(e){return e!==null&&(e<0||e===32)}function kz(e){return e===-2||e===-1||e===32}var Az=Mz(/\p{P}|\p{S}/u),jz=Mz(/\s/);function Mz(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Nz(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&xz(e.charCodeAt(n+1))&&xz(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 Pz(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return kz(r)?(e.enter(n),s(r)):t(r)}function s(r){return kz(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Fz(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&kz(t)?(e.enter(r),c(t)):l(t)}function c(t){return kz(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Iz={tokenize:Lz};function Lz(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`),Pz(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 Dz(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Rz=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){zz(this,e,t,n,!1)}addBefore(e,t,n){zz(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 zz(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 Bz={tokenize:Hz},Vz={tokenize:Uz};function Hz(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 Rz;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(Vz,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(Vz,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 Dz(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 Rz;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 Uz(e,t,n){return Pz(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Wz(e){if(e===null||Oz(e)||jz(e))return 1;if(Az(e))return 2}function Gz(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 Kz={name:`attention`,resolveAll:qz,tokenize:Jz};function qz(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};Yz(o,-a),Yz(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=pz(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=pz(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=pz(r,Gz(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=pz(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=pz(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),fz(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 Jz(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Wz(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=Wz(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 Yz(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Xz={name:`autolink`,tokenize:Zz};function Zz(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 bz(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||xz(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||xz(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||Cz(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Sz(t)?(e.consume(t),l):n(t)}function u(e){return xz(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||xz(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Qz={partial:!0,tokenize:$z};function $z(e,t,n){return r;function r(t){return kz(t)?Pz(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Dz(e)?t(e):n(e)}}var eB={continuation:{tokenize:nB},exit:rB,name:`blockQuote`,tokenize:tB};function tB(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 kz(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function nB(e,t,n){let r=this;return i;function i(t){return kz(t)?Pz(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(eB,t,n)(r)}}function rB(e){e.exit(`blockQuote`)}var iB={name:`characterEscape`,tokenize:aB};function aB(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 Ez(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var oB={name:`characterReference`,tokenize:sB};function sB(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=xz,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=Tz,u):(e.enter(`characterReferenceValue`),a=7,o=wz,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===xz&&!dz(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 cB={partial:!0,tokenize:lB};function lB(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 uB={concrete:!0,name:`codeFenced`,tokenize:dB};function dB(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`),kz(t)?Pz(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Dz(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(cB,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Dz(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):kz(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Pz(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Dz(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Dz(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&&kz(t)?Pz(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Dz(t)?e.check(cB,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Dz(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`),kz(t)?Pz(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`),kz(t)?Pz(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Dz(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var fB={name:`codeIndented`,tokenize:mB},pB={partial:!0,tokenize:hB};function mB(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Fz(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Dz(t)?e.attempt(pB,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Dz(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function hB(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Dz(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Fz(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Dz(e)?i(e):n(e)}}var gB={name:`codeText`,previous:vB,resolve:_B,tokenize:yB};function _B(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 vB(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function yB(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)):Dz(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||Dz(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 bB=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&&xB(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),xB(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),xB(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);xB(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);xB(this.left,t.reverse())}}}};function xB(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 SB(e){let t={},n=-1,r,i,a,o,s,c,l,u=new bB(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,CB(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 fz(e,0,1/0,u.slice(0)),!l}function CB(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 wB={resolve:EB,tokenize:DB},TB={partial:!0,tokenize:OB};function EB(e){return SB(e),e}function DB(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):Dz(t)?e.check(TB,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 OB(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Pz(e,a,`linePrefix`)}function a(i){if(i===null||Dz(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 kB(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||Cz(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||Dz(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||Oz(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||Cz(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 AB(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):Dz(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||Dz(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!kz(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function jB(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):Dz(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Pz(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Dz(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 MB(e,t){let n;return r;function r(i){return Dz(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):kz(i)?Pz(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var NB={name:`definition`,tokenize:FB},PB={partial:!0,tokenize:IB};function FB(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return AB.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=yz(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 Oz(t)?MB(e,l)(t):l(t)}function l(t){return kB(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(PB,d,d)(t)}function d(t){return kz(t)?Pz(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Dz(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function IB(e,t,n){return r;function r(t){return Oz(t)?MB(e,i)(t):n(t)}function i(t){return jB(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return kz(t)?Pz(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Dz(e)?t(e):n(e)}}var LB={name:`hardBreakEscape`,tokenize:RB};function RB(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Dz(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var zB={name:`headingAtx`,resolve:BB,tokenize:VB};function BB(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`};fz(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function VB(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||Oz(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Dz(n)?(e.exit(`atxHeading`),t(n)):kz(n)?Pz(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||Oz(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var HB=`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(`.`),UB=[`pre`,`script`,`style`,`textarea`],WB={concrete:!0,name:`htmlFlow`,resolveTo:KB,tokenize:qB},GB={partial:!0,tokenize:JB};function KB(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 qB(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):bz(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):bz(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 bz(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Oz(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&UB.includes(l)?(i=1,r.interrupt?t(s):O(s)):HB.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||xz(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 kz(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||bz(t)?(e.consume(t),b):kz(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||xz(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):kz(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):kz(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Dz(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||Oz(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||kz(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Dz(t)?O(t):kz(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):Dz(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(GB,R,k)(t)):t===null||Dz(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(cB,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Dz(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 UB.includes(n)?(e.consume(t),L):O(t)}return bz(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||Dz(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function JB(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Qz,t,n)}}var YB={name:`htmlText`,tokenize:XB};function XB(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):bz(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):bz(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):Dz(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):Dz(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):Dz(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Dz(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return bz(t)?(e.consume(t),S):n(t)}function S(t){return t===45||xz(t)?(e.consume(t),S):C(t)}function C(t){return Dz(t)?(o=C,N(t)):kz(t)?(e.consume(t),C):M(t)}function w(t){return t===45||xz(t)?(e.consume(t),w):t===47||t===62||Oz(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||bz(t)?(e.consume(t),E):Dz(t)?(o=T,N(t)):kz(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||xz(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Dz(t)?(o=D,N(t)):kz(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):Dz(t)?(o=O,N(t)):kz(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):Dz(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||Oz(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Oz(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 kz(t)?Pz(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 ZB={name:`labelEnd`,resolveAll:tV,resolveTo:nV,tokenize:rV},QB={tokenize:iV},$B={tokenize:aV},eV={tokenize:oV};function tV(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&&fz(e,0,e.length,n),e}function nV(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=pz(o,e.slice(i+1,i+r+3)),o=pz(o,[[`enter`,l,t]]),o=pz(o,Gz(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=pz(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=pz(o,e.slice(a+1)),o=pz(o,[[`exit`,s,t]]),fz(e,i,e.length,o),e}function rV(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(yz(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(QB,u,o?u:d)(t):t===91?e.attempt($B,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(eV,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function iV(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 Oz(t)?MB(e,a)(t):a(t)}function a(t){return t===41?u(t):kB(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Oz(t)?MB(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?jB(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Oz(t)?MB(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 aV(e,t,n){let r=this;return i;function i(t){return AB.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(yz(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function oV(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 sV={name:`labelStartImage`,resolveAll:ZB.resolveAll,tokenize:cV};function cV(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 lV={name:`labelStartLink`,resolveAll:ZB.resolveAll,tokenize:uV};function uV(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 dV={name:`lineEnding`,tokenize:fV};function fV(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Pz(e,t,`linePrefix`)}}var pV={name:`thematicBreak`,tokenize:mV};function mV(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||Dz(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),kz(t)?Pz(e,s,`whitespace`)(t):s(t))}}var hV={continuation:{tokenize:yV},exit:xV,name:`list`,tokenize:vV},gV={partial:!0,tokenize:SV},_V={partial:!0,tokenize:bV};function vV(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:wz(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(pV,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 wz(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(Qz,r.interrupt?n:u,e.attempt(gV,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return kz(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 yV(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Qz,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Pz(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!kz(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(_V,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Pz(e,e.attempt(hV,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function bV(e,t,n){let r=this;return Pz(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 xV(e){e.exit(this.containerState.type)}function SV(e,t,n){let r=this;return Pz(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!kz(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var CV={name:`setextUnderline`,resolveTo:wV,tokenize:TV};function wV(e,t){let n=new Rz,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 TV(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`),kz(t)?Pz(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Dz(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var EV={tokenize:DV};function DV(e){let t=this,n=e.attempt(Qz,r,e.attempt(this.parser.constructs.flowInitial,i,Pz(e,e.attempt(this.parser.constructs.flow,i,e.attempt(wB,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 OV={resolveAll:MV()},kV=jV(`string`),AV=jV(`text`);function jV(e){return{resolveAll:MV(e===`text`?NV: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 MV(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 NV(e,t){let n=new Rz,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 PV=s({attentionMarkers:()=>HV,contentInitial:()=>IV,disable:()=>UV,document:()=>FV,flow:()=>RV,flowInitial:()=>LV,insideSpan:()=>VV,string:()=>zV,text:()=>BV}),FV={42:hV,43:hV,45:hV,48:hV,49:hV,50:hV,51:hV,52:hV,53:hV,54:hV,55:hV,56:hV,57:hV,62:eB},IV={91:NB},LV={[-2]:fB,[-1]:fB,32:fB},RV={35:zB,42:pV,45:[CV,pV],60:WB,61:CV,95:pV,96:uB,126:uB},zV={38:oB,92:iB},BV={[-5]:dV,[-4]:dV,[-3]:dV,33:sV,38:oB,42:Kz,60:[Xz,YB],91:lV,92:[LB,iB],93:ZB,95:Kz,96:gB},VV={null:[Kz,OV]},HV={null:[42,95]},UV={null:[]};function WV(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=pz(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Gz(a,l.events,l),l.events):[]}function f(e,t){return KV(p(e),t)}function p(e){return GV(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){Dz(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&&fz(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 GV(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 KV(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 qV(e){let t={constructs:hz([PV,...(e||{}).extensions||[]]),content:n(Iz),defined:[],document:n(Bz),flow:n(EV),lazy:{},string:n(kV),text:n(AV)};return t;function n(e){return n;function n(n){return WV(t,e,n)}}}function JV(e){for(;!SB(e););return e}var YV=/[\0\t\n\r]/g;function XV(){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;){YV.lastIndex=c;let n=YV.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 ZV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function QV(e){return e.replace(ZV,$V)}function $V(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return vz(n.slice(t?2:1),t?16:10)}return dz(n)||e}var eH={}.hasOwnProperty;function tH(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),nH(n)(JV(qV(n).document().write(XV()(e,t,!0))))}function nH(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(ie),characterEscape:E,characterReference:E,codeFenced:o(ae),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ae,s),codeText:o(oe,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(se),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:re,autolinkProtocol:ne,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:H,characterReferenceMarkerNumeric:H,characterReferenceValue:ee,characterReference:te,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:V,resourceDestinationString:L,resourceTitleString:R,resource:z,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};iH(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]),eH.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]||oH).call(o,void 0,e[0])}for(r.position={start:rH(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:rH(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:rH(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+"` ("+CR({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||oH).call(this,e,r[0])),n.position.end=rH(e.end)}function d(){return oz(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=yz(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:rH(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=rH(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=rH(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=QV(t),n.identifier=yz(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 V(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=yz(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function H(e){this.data.characterReferenceType=e.type}function ee(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=vz(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=dz(t);let i=this.stack[this.stack.length-1];i.value+=r}function te(e){let t=this.stack.pop();t.position.end=rH(e.end)}function ne(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function re(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ie(){return{type:`blockquote`,children:[],position:void 0}}function ae(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function oe(){return{type:`inlineCode`,value:``,position:void 0}}function se(){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 rH(e){return{line:e.line,column:e.column,offset:e.offset}}function iH(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?iH(e,r):aH(e,r)}}function aH(e,t){let n;for(n in t)if(eH.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 oH(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+CR({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+CR({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+CR({start:t.start,end:t.end})+`) is still open`)}function sH(e){let t=this;t.parser=n;function n(n){return tH(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function cH(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 lH(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
254
|
+
`}]}function uH(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 dH(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fH(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pH(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Nz(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 mH(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 hH(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gH(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 _H(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gH(e,t);let i={src:Nz(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 vH(e,t){let n={src:Nz(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 yH(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 bH(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gH(e,t);let i={href:Nz(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 xH(e,t){let n={href:Nz(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 SH(e,t,n){let r=e.all(t),i=n?CH(n):wH(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 CH(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let{children:n}=e,r=-1;for(;!t&&++r<n.length;)t=wH(n[r])}return t}function wH(e){let{spread:t}=e;return t??e.children.length>1}function TH(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 EH(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DH(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function OH(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kH(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=bR(t.children[1]),o=yR(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 AH(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 jH(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var MH=9,NH=32;function PH(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(FH(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(FH(t.slice(i),i>0,!1)),a.join(``)}function FH(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===MH||t===NH;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===MH||t===NH;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function IH(e,t){let n={type:`text`,value:PH(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function LH(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var RH={blockquote:cH,break:lH,code:uH,delete:dH,emphasis:fH,footnoteReference:pH,heading:mH,html:hH,imageReference:_H,image:vH,inlineCode:yH,linkReference:bH,link:xH,listItem:SH,list:TH,paragraph:EH,root:DH,strong:OH,table:kH,tableCell:jH,tableRow:AH,text:IH,thematicBreak:LH,toml:zH,yaml:zH,definition:zH,footnoteDefinition:zH};function zH(){}var{defineProperty:BH}=Object,VH=typeof self==`object`?self:globalThis,HH=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new VH[e](t)},UH=(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__`?BH(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 VH[e]==`function`?HH(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(HH(a,o),i)};return r},WH=e=>UH(new Map,e)(0),GH=``,{toString:KH}={},{keys:qH,is:JH}=Object,YH=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=KH.call(e).slice(8,-1);switch(n){case`Array`:return[1,GH];case`Object`:return[2,GH];case`Date`:return[3,GH];case`RegExp`:return[4,GH];case`Map`:return[5,GH];case`Set`:return[6,GH];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},XH=([e,t])=>e===0&&(t===`function`||t===`symbol`),ZH=(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]=YH(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&JH(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 qH(o))(e||!XH(YH(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?GH: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||!(XH(YH(n))||XH(YH(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!XH(YH(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},QH=(e,{json:t,lossy:n}={})=>{let r=[];return ZH(!(t||n),!!t,new Map,r)(e),r},$H=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?WH(QH(e,t)):structuredClone(e):(e,t)=>WH(QH(e,t));function eU(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 tU(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function nU(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||eU,r=e.options.footnoteBackLabel||tU,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=Nz(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:{...$H(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 rU=(function(e){if(e==null)return cU;if(typeof e==`function`)return sU(e);if(typeof e==`object`)return Array.isArray(e)?iU(e):aU(e);if(typeof e==`string`)return oU(e);throw Error(`Expected function, string, or object as test`)});function iU(e){let t=[],n=-1;for(;++n<e.length;)t[n]=rU(e[n]);return sU(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function aU(e){let t=e;return sU(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function oU(e){return sU(t);function t(t){return t&&t.type===e}}function sU(e){return t;function t(t,n,r){return!!(lU(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function cU(){return!0}function lU(e){return typeof e==`object`&&!!e&&`type`in e}function uU(e){return e}var dU=[],fU=`skip`;function pU(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=rU(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 (`+uU(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=dU;if(s&&r&&(o=mU(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=mU(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 mU(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?dU:[e]}function hU(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`?pU(e,i,_U(a),o):pU(e,i,gU(a),o)}function gU(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?_U(e.enter):e.enter,exit:typeof e.exit==`function`?_U(e.exit):e.exit}}function _U(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}var vU={}.hasOwnProperty,yU={};function bU(e,t){let n=t||yU,r=new Map,i=new Map,a={all:s,applyData:SU,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...RH,...n.handlers},one:o,options:n,patch:xU,wrap:wU};return hU(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(vU.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{...$H(n),children:a.all(e)}}return $H(e)}return(a.options.unknownHandler||CU)(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=TU(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=TU(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function xU(e,t){e.position&&(t.position=SR(e))}function SU(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,$H(i)),`children`in n&&n.children&&t!=null&&(n.children=t)}return n}function CU(e,t){let n=t.data||{},r=`value`in t&&!(vU.call(n,`hProperties`)||vU.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 wU(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 TU(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function EU(e,t){let n=bU(e,t),r=n.one(e,void 0),i=nU(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 DU(e,t){return e&&`run`in e?async function(n,r){let i=EU(n,{file:r,...t});await e.run(i,r)}:function(n,r){return EU(n,{file:r,...e||t})}}function OU(e){if(e)throw e}var kU=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 AU(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 jU(){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?MU(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 MU(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 NU={basename:PU,dirname:FU,extname:IU,join:LU,sep:`/`};function PU(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);BU(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 FU(e){if(BU(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 IU(e){BU(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 LU(...e){let t=-1,n;for(;++t<e.length;)BU(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:RU(n)}function RU(e){BU(e);let t=e.codePointAt(0)===47,n=zU(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function zU(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 BU(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var VU={cwd:HU};function HU(){return`/`}function UU(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function WU(e){if(typeof e==`string`)e=new URL(e);else if(!UU(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 GU(e)}function GU(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 KU=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],qU=class{constructor(e){let t;t=e?UU(e)?{path:e}:typeof e==`string`||ZU(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:VU.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<KU.length;){let e=KU[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)KU.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?NU.basename(this.path):void 0}set basename(e){YU(e,`basename`),JU(e,`basename`),this.path=NU.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?NU.dirname(this.path):void 0}set dirname(e){XU(this.basename,`dirname`),this.path=NU.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?NU.extname(this.path):void 0}set extname(e){if(JU(e,`extname`),XU(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=NU.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){UU(e)&&(e=WU(e)),YU(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?NU.basename(this.path,this.extname):void 0}set stem(e){YU(e,`stem`),JU(e,`stem`),this.path=NU.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 DR(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 JU(e,t){if(e&&e.includes(NU.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+NU.sep+"`")}function YU(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function XU(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function ZU(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var QU=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),$U=l(kU(),1),eW={}.hasOwnProperty,tW=new class e extends QU{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=jU()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,$U.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(iW(`data`,this.frozen),this.namespace[e]=t,this):eW.call(this.namespace,e)&&this.namespace[e]||void 0:e?(iW(`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=sW(e),n=this.parser||this.Parser;return nW(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),nW(`process`,this.parser||this.Parser),rW(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=sW(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);lW(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(),nW(`processSync`,this.parser||this.Parser),rW(`processSync`,this.compiler||this.Compiler),this.process(e,r),oW(`processSync`,`process`,t),n;function r(e,r){t=!0,OU(e),n=r}}run(e,t,n){aW(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=sW(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),oW(`runSync`,`run`,n),r;function i(e,t){OU(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=sW(t),r=this.compiler||this.Compiler;return rW(`stringify`,r),aW(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(iW(`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,$U.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];AU(o)&&AU(r)&&(r=(0,$U.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function nW(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function rW(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function iW(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 aW(e){if(!AU(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function oW(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function sW(e){return cW(e)?e:new qU(e)}function cW(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function lW(e){return typeof e==`string`||uW(e)}function uW(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var dW=[],fW={allowDangerousHtml:!0},pW=/^(https?|ircs?|mailto|xmpp)$/i,mW=[{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 hW(e){let t=gW(e),n=_W(e);return vW(t.runSync(t.parse(n),n),e)}function gW(e){let t=e.rehypePlugins||dW,n=e.remarkPlugins||dW,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fW}:fW;return tW().use(sH).use(n).use(DU,r).use(t)}function _W(e){let t=e.children||``,n=new qU;return typeof t==`string`?n.value=t:``+t,n}function vW(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||yW;for(let e of mW)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return hU(e,l),FR(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 iz)if(Object.hasOwn(iz,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=iz[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 yW(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||pW.test(e.slice(0,t))?e:``}function bW(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 xW(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function SW(e,t,n){let r=rU((n||{}).ignore||[]),i=CW(t),a=-1;for(;++a<i.length;)pU(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 fU}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 CW(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([wW(e[0]),TW(e[1])])}return t}function wW(e){return typeof e==`string`?new RegExp(xW(e),`g`):e}function TW(e){return typeof e==`function`?e:function(){return e}}var EW=`phrasing`,DW=[`autolink`,`link`,`image`,`label`];function OW(){return{transforms:[IW],enter:{literalAutolink:AW,literalAutolinkEmail:jW,literalAutolinkHttp:jW,literalAutolinkWww:jW},exit:{literalAutolink:FW,literalAutolinkEmail:PW,literalAutolinkHttp:MW,literalAutolinkWww:NW}}}function kW(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:EW,notInConstruct:DW},{character:`.`,before:`[Ww]{3}`,inConstruct:EW,notInConstruct:DW},{character:`:`,before:`[PSps]`,after:`\\/`,inConstruct:EW,notInConstruct:DW}]}}function AW(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function jW(e){this.config.enter.autolinkProtocol.call(this,e)}function MW(e){this.config.exit.autolinkProtocol.call(this,e)}function NW(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 PW(e){this.config.exit.autolinkEmail.call(this,e)}function FW(e){this.exit(e)}function IW(e){SW(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,LW],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,BW],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,zW],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,RW]],{ignore:[`link`,`linkReference`]})}function LW(e,t,n,r,i){if(!UW(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),Az(n.charCodeAt(0))||!VW(n))return!1;let o=HW(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 RW(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 zW(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 BW(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 VW(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 HW(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=bW(e,`(`),a=bW(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 UW(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||jz(t)||Az(t)}$W.peek=QW;function WW(){this.buffer()}function GW(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function KW(){this.buffer()}function qW(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function JW(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yz(this.sliceSerialize(e)).toLowerCase(),n.label=t}function YW(e){this.exit(e)}function XW(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yz(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZW(e){this.exit(e)}function QW(){return`[`}function $W(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 eG(){return{enter:{gfmFootnoteCallString:WW,gfmFootnoteCall:GW,gfmFootnoteDefinitionLabelString:KW,gfmFootnoteDefinition:qW},exit:{gfmFootnoteCallString:JW,gfmFootnoteCall:YW,gfmFootnoteDefinitionLabelString:XW,gfmFootnoteDefinition:ZW}}}function tG(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$W},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?rG:nG))),s(),o}}function nG(e,t,n){return t===0?e:rG(e,t,n)}function rG(e,t,n){return(n?``:` `)+e}var iG=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];lG.attention=uG,lG.peek=dG;function aG(){return{canContainEols:[`delete`],enter:{strikethrough:sG},exit:{strikethrough:cG}}}function oG(){return{handlers:{delete:lG},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:iG}]}}function sG(e){this.enter({type:`delete`,children:[],position:void 0},e)}function cG(e){this.exit(e)}function lG(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 uG(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function dG(){return`~`}function fG(e){return e.length}function pG(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||fG,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=mG(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]=hG(r[d]);else{let e=hG(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 mG(e){return e==null?``:String(e)}function hG(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 gG=rU([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function _G(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()),vG);return i(),o}function vG(e,t,n){return`>`+(n?``:` `)+e}function yG(e,t){return bG(e,t.inConstruct,!0)&&!bG(e,t.notInConstruct,!1)}function bG(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 xG(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&&yG(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
267
|
+
`}function SG(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 CG(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 wG(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function TG(e,t,n,r){let i=wG(n),a=e.value||``;if(CG(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,EG);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(SG(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 EG(e,t,n){return(n?``:` `)+e}function DG(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function OG(e,t,n,r){let i=DG(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 kG(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function AG(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function jG(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function MG(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function NG(e,t,n){let r=Wz(e),i=Wz(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 PG(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:bz(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!bz(a))return;for(;a===45||xz(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&UB.includes(o)?1:HB.includes(o)?6:7}var FG=new Map([[`*`,!1],[`_`,!0]]);function IG(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 LG(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=FG.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=Wz(u.charCodeAt(u.length-1)),f=Wz((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(BG(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:IG(e,t,a),index:o}}}function RG(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?AG(n.value):jG(n.value),i=MG(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 zG(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=KG(e,c,r,i),u=LG(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function BG(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 VG(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(!Ez(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 HG(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?AG(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`&&PG(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(qG(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=UG(l,f.attention,t,c);if(!e)continue;a.push(e),s=jG(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=jG(n)}}return r.pop(),a}function UG(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=VG(e.type,a,o),c=s[0],l=n.enter(i),u=n.createTracker(r.current());u.move(c);let d=HG(e,n,{...u.current(),before:c,after:c});if(l(),d.length!==0)return r.move(c),r.move(qG(d,c,c)),r.move(c),{children:d,sequences:s}}function WG(e,t,n,r){let i=KG(e,t,n,r),a=LG(i,n,r);for(;a;){let o=zG(e,t,a,n,r);if(!o)return;t=o.chosen,i=o.tokens,a=o.mistake}return i}function GG(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&&FG.has(r)&&t.length>n.length})||o.sequences[0];c!==o.sequences[0]&&t.set(o,c),GG(o.children,t,c,c),i=c}}function KG(e,t,n,r){let i=[],a,o=jG(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===AG(n)&&RG([e],!0),a=void 0,i.push(e),e.value&&(o=jG(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=AG(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=KG(n.children,t,c,c),m=p[0].value,h=NG(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&RG(p,!0);let g=jG(p[p.length-1].value),_=NG(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&RG(p,!1),h.outside&&d!==`
|
|
273
|
+
`&&d!==`\r`&&RG(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 qG(e,t,n){let r=new Map;GG(e,r,t,n);let i=(r.size>0?WG(e,r,t,n):void 0)||WG(e,new Map,t,n)||KG(e,new Map,t,n),a=``;for(let e of i)a+=e.value;return a}JG.attention=YG,JG.peek=XG;function JG(e,t,n,r){let i=n.enter(`phrasing`),a=UG(e,YG,n,n.createTracker(r)),o=a?qG([a],r.before,r.after):``;return i(),o}function YG(e,t){return{construct:`emphasis`,markers:kG(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function XG(e,t,n){return n.options.emphasis||`*`}function ZG(e,t){let n=!1;return hU(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)&&oz(e)&&(t.options.setext||n))}function QG(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(ZG(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=MG(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}$G.peek=eK;function $G(e){return e.value||``}function eK(){return`<`}tK.peek=nK;function tK(e,t,n,r){let i=DG(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 nK(){return`!`}rK.peek=iK;function rK(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 iK(){return`!`}aK.peek=oK;function aK(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 oK(){return"`"}function sK(e,t){let n=oz(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))}cK.peek=lK;function cK(e,t,n,r){let i=DG(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(sK(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 lK(e,t,n){return sK(e,n)?`<`:`[`}uK.peek=dK;function uK(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 dK(){return`[`}function fK(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 pK(e){let t=fK(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 mK(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function hK(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 gK(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?mK(n):fK(n),s=e.ordered?o===`.`?`)`:`.`:pK(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),hK(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 _K(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 vK(e,t,n,r){let i=_K(n),a=n.bulletCurrent||fK(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 yK(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function bK(e,t,n,r){if(!e.children.some(function(e){return gG(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function xK(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}SK.attention=CK,SK.peek=wK;function SK(e,t,n,r){let i=n.enter(`phrasing`),a=UG(e,CK,n,n.createTracker(r)),o=a?qG([a],r.before,r.after):``;return i(),o}function CK(e,t){return{construct:`strong`,markers:xK(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function wK(e,t,n){return n.options.strong||`*`}function TK(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 EK(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 DK(e,t,n){let r=(hK(n)+(n.options.ruleSpaces?` `:``)).repeat(EK(n));return n.options.ruleSpaces?r.slice(0,-1):r}var OK={blockquote:_G,break:xG,code:TG,definition:OG,emphasis:JG,hardBreak:xG,heading:QG,html:$G,image:tK,imageReference:rK,inlineCode:aK,link:cK,linkReference:uK,list:gK,listItem:vK,paragraph:yK,root:bK,strong:SK,text:TK,thematicBreak:DK};function kK(){return{enter:{table:AK,tableData:PK,tableHeader:PK,tableRow:MK},exit:{codeText:FK,table:jK,tableData:NK,tableHeader:NK,tableRow:NK}}}function AK(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 jK(e){this.exit(e),this.data.inTable=void 0}function MK(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function NK(e){this.exit(e)}function PK(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function FK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,IK));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function IK(e,t){return t===`|`?t:e}function LK(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[RK],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 pG(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=OK.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 RK(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&zK(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function zK(e,t){let n=!1;return hU(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)&&oz(e)&&(t.options.setext||n))}function BK(){return{exit:{taskListCheckValueChecked:HK,taskListCheckValueUnchecked:HK,paragraph:UK}}}function VK(){return{handlers:{paragraph:WK},join:[GK]}}function HK(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function UK(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 WK(e,t,n,r){if(!t||t.type!==`listItem`||KK(t)!==e)return OK.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+OK.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function GK(e,t,n){if(e.type!==`definition`||n.type!==`listItem`)return;let r=KK(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function KK(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function qK(){return[OW(),eG(),aG(),kK(),BK()]}function JK(e){return{extensions:[kW(),tG(e),oG(),LK(e),VK()]}}var YK={tokenize:lq,partial:!0},XK={tokenize:uq,partial:!0},ZK={tokenize:dq,partial:!0},QK={tokenize:fq,partial:!0},$K={tokenize:pq,partial:!0},eq={name:`wwwAutolink`,tokenize:sq,previous:mq},tq={name:`protocolAutolink`,tokenize:cq,previous:hq},nq={name:`emailAutolink`,tokenize:oq,previous:gq},rq={};function iq(){return{text:rq}}for(var aq=48;aq<123;)rq[aq]=nq,aq++,aq===58?aq=65:aq===91&&(aq=97);rq[43]=nq,rq[45]=nq,rq[46]=nq,rq[95]=nq,rq[72]=[nq,tq],rq[104]=[nq,tq],rq[87]=[nq,eq],rq[119]=[nq,eq];function oq(e,t,n){let r=this,i,a;return o;function o(t){return!_q(t)||!gq.call(r,r.previous)||vq(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return _q(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check($K,u,l)(t):t===45||t===95||xz(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&&bz(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function sq(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!mq.call(r,r.previous)||vq(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(YK,e.attempt(XK,e.attempt(ZK,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function cq(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&hq.call(r,r.previous)&&!vq(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(bz(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||Cz(t)||Oz(t)||jz(t)||Az(t)?n(t):e.attempt(XK,e.attempt(ZK,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function lq(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 uq(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(QK,c,s)(t):t===null||Oz(t)||jz(t)||t!==45&&Az(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 dq(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(QK,t,a)(o):o===null||Oz(o)||jz(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function fq(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||Oz(o)||jz(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Oz(e)||jz(e)?t(e):r(e)}function a(e){return bz(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):bz(t)?(e.consume(t),o):n(t)}}function pq(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return xz(e)?n(e):t(e)}}function mq(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Oz(e)}function hq(e){return!bz(e)}function gq(e){return!(e===47||_q(e))}function _q(e){return e===43||e===45||e===46||e===95||xz(e)}function vq(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 yq={tokenize:Dq,partial:!0};function bq(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:wq,continuation:{tokenize:Tq},exit:Eq}},text:{91:{name:`gfmFootnoteCall`,tokenize:Cq},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:xq,resolveTo:Sq}}}}function xq(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=yz(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 Sq(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 Cq(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||Oz(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(yz(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Oz(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 wq(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||Oz(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=yz(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Oz(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),Pz(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Tq(e,t,n){return e.check(Qz,t,e.attempt(yq,t,n))}function Eq(e){e.exit(`gfmFootnoteDefinition`)}function Dq(e,t,n){let r=this;return Pz(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 Oq(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&&fz(o,o.length,0,Gz(s,e.slice(r+1,n),t)),fz(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),fz(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=Wz(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=Wz(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var kq=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){Aq(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 Aq(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 jq(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 Mq(){return{flow:{null:{name:`table`,tokenize:Nq,resolveAll:Pq}}}}function Nq(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):Dz(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):kz(t)?Pz(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||Oz(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,kz(t)?Pz(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 kz(t)?Pz(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||Dz(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 kz(t)?Pz(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Dz(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||Dz(n)?(e.exit(`tableRow`),t(n)):kz(n)?Pz(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Oz(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 Pq(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 kq;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Iq(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=Fq(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=Fq(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=Fq(f,t,o,i,n,d)):(o[0]=o[1],d=Fq(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Iq(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=jq(t.events,n))}return e}function Fq(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Lq(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Lq(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=Lq(t.events,n[2]),a=Lq(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({},Lq(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Iq(e,t,n,r,i){let a=[],o=Lq(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 Lq(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Rq={name:`tasklistCheck`,tokenize:Bq};function zq(){return{text:{91:Rq}}}function Bq(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 Oz(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 Dz(r)?t(r):kz(r)?e.check({tokenize:Vq},t,n)(r):n(r)}}function Vq(e,t,n){return Pz(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Hq(e){return hz([iq(),bq(),Oq(e),Mq(),zq()])}var Uq={};function Wq(e){let t=this,n=e||Uq,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Hq(n)),a.push(qK()),o.push(JK(n))}var Gq=`diffs-container`,Kq=/(?=^diff --git)/gm,qq=/(?<=\n)/,Jq=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Yq=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Xq=`header-prefix`,Zq=`header-filename-suffix`,Qq=`header-metadata`,$q=`header-custom`,eJ={dark:`pierre-dark`,light:`pierre-light`},tJ=`data-theme-css`,nJ=`data-unsafe-css`,rJ=`data-diffs-scrollbar-measure`,iJ=`--diffs-scrollbar-gutter-measured`,aJ=1e5,oJ={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`},sJ={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...sJ});var cJ=Object.freeze({fromStart:0,fromEnd:0}),lJ={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},uJ=Object.freeze([]),dJ,fJ=0,pJ=class extends Error{constructor(){super(`Highlighter is disposed`),this.name=`HighlighterDisposedError`}};function mJ(){return dJ}function hJ(e){return e??dJ??`shiki-js`}function gJ(e){if(dJ!=null&&dJ!==e)throw Error(`Cannot load the "${e}" highlighter while "${dJ}" is in use. Only one highlighter type can be active at a time; dispose every "${dJ}" instance (disposeHighlighter() disposes the shared one) before switching.`)}function _J(e){gJ(e),dJ=e,fJ++}function vJ(){fJ--,fJ===0&&(dJ=void 0)}function yJ(e=eJ){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function bJ(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}function xJ(e){let t;return()=>t??=e().then(e=>(t=e,e),e=>{throw t=void 0,e})}function SJ(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var CJ=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},wJ=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},TJ=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function EJ(e={}){let t=new Map,n=new Map,r=new Map,i=0;function a(e,n){if(t.has(e))throw new CJ(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 wJ(a));let l=i,u=Promise.resolve().then(()=>c===void 0?e.fallbackLoader?.(a):c()).then(async t=>{if(t===void 0)throw new wJ(a);let o=SJ(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 TJ(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 DJ=`modulepreload`,OJ=function(e){return`/`+e},kJ={},AJ={},jJ=function(e){return e.pathname.endsWith(`.css`)},MJ=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},NJ=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=OJ(e,n);let t=i(e),r=jJ(t);return MJ(kJ,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?AJ[t.href]:void 0;if(!n&&e.has(t.href))return;let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:DJ,r||(i.as=`script`),i.crossOrigin=``,i.href=t.href,s&&i.setAttribute(`nonce`,s),n&&delete AJ[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`?(AJ[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)})},PJ=new Map,FJ=new Map,IJ=xJ(()=>NJ(()=>import(`./loader-BMv9OYvr.js`),[])),LJ=xJ(()=>NJ(()=>import(`./themes-CLX9vH7e.js`),[])),RJ=xJ(()=>NJ(()=>import(`./core-Dl2d1S-D.js`).then(e=>e.t),__vite__mapDeps([0,1]))),zJ=[[`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 BJ(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 zJ){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 VJ(e){let t=FJ.get(e);return t??(t=EJ({fallbackLoader:async t=>{if(typeof __DIFFS_WORKER__<`u`?__DIFFS_WORKER__:bJ())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=PJ.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 BJ(t,r);throw Error(`Theme "${t}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`)}let r=IJ(),{themes:i}=r instanceof Promise?await r:r,a=i[t];if(a!=null)return BJ(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=LJ(),{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=RJ(),{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}}),FJ.set(e,t)),t}function HJ(e,t=hJ()){return typeof t!=`string`&&t.isDisposed?!1:(typeof t==`string`?VJ(t):t.themeResolver).hasResolvedThemes(yJ(e))}var UJ;async function WJ(e){let t=hJ(e);_J(t);try{if(t===`highlights`){let{HighlightsHighlighter:e}=await NJ(async()=>{let{HighlightsHighlighter:e}=await import(`./highlights-BxaWC1ve.js`);return{HighlightsHighlighter:e}},__vite__mapDeps([2,3,1,4,5]));return new e}let{ShikiHighlighter:e}=await NJ(async()=>{let{ShikiHighlighter:e}=await import(`./shiki-CoRI3zWj.js`);return{ShikiHighlighter:e}},__vite__mapDeps([6,3,1,4,7,0]));return await e.create(t)}finally{vJ()}}async function GJ({themes:e,langs:t,preferredHighlighter:n}){KJ();let r=UJ??=WJ(mJ()??n),i;try{i=await r}catch(e){throw UJ===r&&(UJ=void 0),e}if(UJ===r&&(UJ=i),await Promise.all([i.themeResolver.resolveThemes(e),i.loadLanguages(t)]),i.isDisposed)throw new pJ;return i}function KJ(){UJ!=null&&!(`then`in UJ)&&UJ.isDisposed&&(UJ=void 0)}function qJ({theme:e,lang:t,langs:n}={}){KJ();let r=UJ;if(!(r==null||`then`in r||e!=null&&!HJ(e,r)||(t!=null||n!=null)&&!r.hasLoadedLanguages([...t==null?[]:[t],...n??[]])))return r}function JJ(e,t=hJ()){return VJ(t).getResolvedOrResolveTheme(e)}function YJ(e,t,n=`textmate`){let r=PJ.get(e)??{};r[n]==null?(r[n]=t,PJ.set(e,r)):console.error(`SharedHighlight.registerCustomTheme: theme name and type already registered`,e,n)}var XJ=`highlights`,ZJ=`forge-light`,QJ={light:ZJ,dark:`pierre-dark`};function $J(e){return e?QJ.dark:QJ.light}var eY=4.5;function tY(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function nY(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(tY);return .74/(.2126*e+.7152*t+.0722*r+.05)};if(r()>=eY)return e;for(;r()<eY;)n=n.map(e=>Math.floor(e*.95));return`#`+n.map(e=>e.toString(16).padStart(2,`0`)).join(``)+(t[2]||``)}function rY(e){let t={};for(let[n,r]of Object.entries(e.style.syntax??{}))t[n]=typeof r==`string`?nY(r):r&&typeof r==`object`&&`color`in r&&typeof r.color==`string`?{...r,color:nY(r.color)}:r;return{...e,name:ZJ,style:{...e.style,syntax:t}}}YJ(ZJ,async()=>{let e=await JJ(`pierre-light`,XJ);if(!e.zed)throw Error(`pierre-light has no palette for the highlights engine`);return rY(e.zed)},`zed`);var iY=new Map;function aY(e){let t=iY.get(e);if(t)return t;let n=GJ({themes:Object.values(QJ),langs:[e],preferredHighlighter:XJ}).catch(t=>{if(e===`text`)throw iY.delete(e),t;return aY(`text`)});return iY.set(e,n),n}var oY=b.memo(function({text:e}){return(0,x.jsx)(`div`,{className:`prose-forge`,children:(0,x.jsx)(hW,{remarkPlugins:[Wq],components:{a:({node:e,...t})=>(0,x.jsx)(`a`,{...t,target:`_blank`,rel:`noreferrer noopener`}),pre:({node:e,children:t})=>(0,x.jsx)(lY,{children:t})},children:e})})});function sY(e){let t=b.Children.toArray(e)[0];return/language-([\w+-]+)/.exec(t?.props?.className||``)?.[1]||``}function cY(e){let t=b.Children.toArray(e)[0]?.props?.children;return(Array.isArray(t)?t.join(``):String(t??``)).replace(/\n$/,``)}function lY({children:e}){let t=sY(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)(Tb,{label:n?`Don’t wrap lines`:`Wrap lines`,children:(0,x.jsx)(q,{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)(Nm,{className:`size-3`})})}),(0,x.jsx)(Tb,{label:i?`Copied`:`Copy`,children:(0,x.jsx)(q,{type:`button`,variant:`ghost-muted`,size:`icon-xs`,"aria-label":`Copy`,onClick:()=>{navigator.clipboard.writeText(cY(e)).then(()=>{a(!0),setTimeout(()=>a(!1),1200)})},children:i?(0,x.jsx)(Md,{className:`size-3`}):(0,x.jsx)(ef,{className:`size-3`})})})]})]}),(0,x.jsx)(fY,{code:cY(e),language:t,fallback:(0,x.jsx)(`pre`,{children:e})})]})}var uY=new Map,dY=200;function fY({code:e,language:t,fallback:n}){let r=$J(Ju()),i=/^(text|txt|plain|plaintext)$/i.test(t),a=`${r}\u0000${t}\u0000${e}`,[o,s]=b.useState(()=>uY.get(a)??null);return b.useEffect(()=>{if(i)return;let n=uY.get(a);if(n)return s(n);let o=!0;return aY(t).then(n=>{let i;try{i=n.codeToHtml(e,{lang:t,theme:r})}catch{i=n.codeToHtml(e,{lang:`text`,theme:r})}uY.size>=dY&&uY.delete(uY.keys().next().value),uY.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 pY=e=>e.type.replace(/^tool-/,``),mY=e=>e.state===`output-error`||!!e.output?.error||pY(e)===`shell`&&typeof e.output?.exitCode==`number`&&e.output.exitCode!==0;function hY(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`||pY(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`&&pY(e.part)===`ask`||t>n&&e.kind===`tool`&&mY(e.part)||t>n&&e.kind===`group`&&e.parts.some(mY)||i.add(t)}),i.size?i:null}var gY=2e3;function _Y({text:e,label:t=`Copy message`}){let[n,r]=b.useState(`idle`);return b.useEffect(()=>{if(n===`idle`)return;let e=setTimeout(()=>r(`idle`),gY);return()=>clearTimeout(e)},[n]),(0,x.jsx)(Tb,{label:n===`failed`?`Couldn’t copy to the clipboard`:t,children:(0,x.jsx)(q,{"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)(Md,{className:`size-3 text-primary`}):(0,x.jsx)(ef,{className:`size-3`})})})}function vY({at:e}){return e?(0,x.jsx)(Tb,{label:Tu(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:Cu(e)})}):null}var yY=e=>G(`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 bY({at:e,text:t,onRevert:n,busy:r}){return(0,x.jsx)(`div`,{className:G(`flex w-full max-w-[80%] items-center justify-end pe-1 text-xs tabular-nums`,yY(`group`)),children:(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-x-2`,children:[(0,x.jsx)(vY,{at:e}),(0,x.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[n&&(0,x.jsx)(Tb,{label:`Edit from here`,children:(0,x.jsx)(q,{"aria-label":`Edit from here`,size:`xs`,variant:`ghost`,disabled:r,onClick:n,children:(0,x.jsx)(Lp,{className:`size-3`})})}),t&&(0,x.jsx)(_Y,{text:t})]})]})})}function xY({at:e,text:t,status:n,alwaysVisible:r,className:i}){return(0,x.jsxs)(`div`,{className:G(`flex items-center gap-2 text-xs tabular-nums`,r?`opacity-100`:yY(`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)(_Y,{text:t}),(0,x.jsx)(vY,{at:e})]})}function SY(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 CY(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=SY(e[t]);e[t].role===`assistant`&&n!==null&&(i=n)}t.push({id:n.id,rowIndex:r,userText:SY(n)??``,assistantText:i})}),t}var wY=new Set([`paragraph`,`heading`,`tableCell`,`emphasis`,`strong`,`delete`,`link`,`linkReference`]);function TY(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(TY).join(wY.has(e.type)?``:` `):``}function EY(e){return TY(tH(e,{extensions:[Hq()],mdastExtensions:[qK()]})).replace(/\s+/g,` `).trim()}function DY(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 OY(e){if(e===null)return null;let t=EY(e.slice(0,DY(e,1500)?1499:1500));return t.length?t:null}function kY(e){return e&&{...e,userText:OY(e.userText),assistantText:OY(e.assistantText)}}var AY=8,jY=5,MY=48,NY=32,PY=40,FY=14;function IY(e){return`min(${Math.max(1,(e-1)*AY)}px, max(4rem, calc(100% - 14.75rem)))`}function LY(e,t){return t<=1?0:Math.max(0,Math.min(e,t-1))/(t-1)*100}function RY(e,t){return t<=0?e:Math.min(e,Math.max(2,Math.floor(t/jY)+1))}function zY(e,t,n){return n>=t?e:Math.round(e/(t-1)*(n-1))}function BY(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 VY(e,t,n,r){return n!==null&&r!==null&&e<=r&&(t===void 0||t>n)}function HY(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 UY(e){return e>=MY}function WY(e){let t=Number.isFinite(e)?Math.max(0,Math.floor(e)):0;return t<46?{left:0,width:Math.min(8,t)}:{left:NY,width:Math.min(PY,t-NY)}}function GY(e){return e>=FY}var KY=150,qY=[1,3],JY=new WeakMap;function YY(e){let t=JY.get(e);if(t)return cancelAnimationFrame(t.frame),t.stop.abort(),JY.delete(e),t}function XY(e,t){let n=YY(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,()=>YY(e),{capture:!0,signal:a.stop.signal});let o=t=>{if(!e.isConnected)return void YY(e);let n=e.scrollTop-a.written;a.from+=n,a.to+=n;let r=Math.min(1,Math.max(0,(t-a.start)/KY));e.scrollTop=a.from+(a.to-a.from)*(1-(1-r)**3),a.written=e.scrollTop,r<1?a.frame=requestAnimationFrame(o):YY(e)};a.frame=requestAnimationFrame(o),JY.set(e,a)}function ZY(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||qY.some(t=>Math.abs(i+t*e.deltaY)<1))||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?(YY(t),t.scrollBy({top:r})):XY(t,r)}function QY(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 $Y({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=kY(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=GY(n.width)&&!f,E=RY(e.length,u),D=Array.from({length:E},()=>[]);e.forEach((t,n)=>D[zY(n,e.length,E)]?.push(t));let O=v===null?null:zY(v,e.length,E),k=t=>{let n=t.currentTarget.getBoundingClientRect();return BY({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:G(`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:G(`absolute top-1/2 -translate-y-1/2`,n.width>0&&!f?`pointer-events-auto`:`pointer-events-none`),style:{height:IY(e.length),left:n.left,width:n.width},onMouseDown:()=>{m.current||(m.current=!0,QY(()=>m.current=!1))},onMouseMove:e=>{e.buttons===0||m.current||f||(p(!0),QY(()=>p(!1)))},children:[(0,x.jsx)(eX,{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:`${LY(t,E)}%`},className:G(`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:`${LY(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)(eX,{direction:`next`,disabled:!w,interactive:T,onClick:()=>w&&s(w)})]})})})}function eX({direction:e,disabled:t,interactive:n,onClick:r}){let i=e===`previous`,a=i?`Previous turn`:`Next turn`,o=i?Rd:Pd;return(0,x.jsx)(`span`,{className:G(`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)(Tb,{label:a,side:i?`top`:`bottom`,children:(0,x.jsx)(q,{"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 tX=b.lazy(()=>NJ(()=>import(`./diff-view-Chujmqzi.js`),__vite__mapDeps([8,9,3,1,5])));function nX(e){return e.state===`input-streaming`||e.state===`input-available`||e.state===`output-available`&&(e.preliminary===!0||e.output?.running===!0)}var rX=e=>e.type.replace(/^tool-/,``),iX=new Set([`read_file`,`list_dir`,`glob`,`grep`]),aX=e=>iX.has(rX(e));function oX(e){let t=e.input||{},n=e.output||{},r=nX(e),i=e=>(0,x.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:String(e??``)});switch(rX(e)){case`read_file`:return{icon:hf,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:xf,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:am,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:am,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:xm,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}};case`edit_file`:return{icon:xm,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};case`rename_path`:return{icon:Fp,label:(0,x.jsxs)(x.Fragment,{children:[`Renamed `,i(t.from),` → `,i(t.to)]}),meta:n.error};case`delete_path`:return{icon:Fm,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:jm,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 lX(e,r)}}var sX={dev_open:Ff,dev_act:xp,dev_screenshot:Ed,dev_inspect:rm,dev_eval:Qd,dev_wait_idle:Vf,dev_status:fd,search_docs:bd,read_doc:bd,lookup_api:bd,describe_table:nf,check_component:Lf,workspace_check:Lf,workspace_status:jf,workspace_diff:jf,workspace_push:zm},cX={click:`Clicked`,dblclick:`Double-clicked`,hover:`Hovered`,type:`Typed`,press:`Pressed`,scroll:`Scrolled`,select:`Selected`};function lX(e,t){let n=rX(e),r=e.input||{},i=e.output||{},a=sX[n]||(n.startsWith(`dev_`)?Ff:af),o=r.route||r.path||r.query||r.selector||r.component||r.table||r.portal||r.key||r.name||``,s={dev_open:[`Opening`,`Opened`],dev_act:[`Acting`,cX[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`],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 uX({part:e}){let t=e.output||{},n=nX(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:()=>Wu({drawerOpen:!0,activeTerminal:t.sessionId}),children:`Open in terminal`})]})}function dX({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)(zm,{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)(_m,{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:()=>Wu({pushOpen:!0}),children:`Review and push…`})]})]})}function fX({ids:e}){let{projectId:t}=b.useContext(pX);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 pX=b.createContext({projectId:``,chatId:``,onAnswer:()=>{},onRewind:()=>{},onUndoTurn:()=>{}}),mX=new Set([`edit_file`,`write_file`,`delete_path`]);function hX(e){let{projectId:t,chatId:n}=b.useContext(pX),r=Au(),i=e.output?.editId,a=U({...r.edits.undone.queryOptions({projectId:t}),enabled:!!i&&!!t}),o=at(r.edits.undo.mutationOptions()),s=U({...r.chats.overlaps.queryOptions({projectId:t,chatId:n}),enabled:!!i&&!!t&&!!n}),[c,l]=b.useState(``);if(!i||!mX.has(rX(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)(Um,{"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(),Wu({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)(Zp,{className:`size-3`}),` Undo`]})]})]}),msg:c}}function gX({editId:e}){let{projectId:t}=b.useContext(pX),n=U(Au().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)(tX,{path:n.data.path,oldText:n.data.old,newText:n.data.new})})}):null}function _X({part:e}){let{onAnswer:t}=b.useContext(pX),[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)(sp,{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 vX=e=>e.state===`output-error`||!!e.output?.error||rX(e)===`shell`&&typeof e.output?.exitCode==`number`&&e.output.exitCode!==0;function yX({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 bX=`rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70`,xX=b.createContext(!1);function SX({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:xu(e)}):null}function CX({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(xX);return(0,x.jsxs)(`div`,{onClick:c?l:void 0,className:G(`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:G(`flex min-h-6 min-w-0 items-center gap-1.5 text-sm leading-relaxed select-none`,c&&bX),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:G(`flex size-4 items-center justify-center`,o?`text-tool-error-icon/40`:`text-icon-muted`),children:(0,x.jsx)(e,{className:G(`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:G(`min-w-0 truncate`,a&&`live-tool-shine`),children:t}),r&&(0,x.jsx)(yX,{...r}),n&&(0,x.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:n})]})})]}),u,(0,x.jsx)(SX,{at:i}),o&&(0,x.jsx)(Gm,{"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)(Id,{className:G(`size-3 shrink-0 text-icon-muted opacity-70 transition-transform duration-200`,s&&`rotate-90`)})})]}),d]})}function wX({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 TX({part:e,at:t,onApprove:n}){let[r,i]=b.useState(!1),a=oX(e),o=rX(e)===`shell`&&/^command:/.test(e.approval?.requestReason||``),s=nX(e),c=hX(e);return(0,x.jsxs)(CX,{...a,meta:c?.isUndone?`undone`:c?.msg||a.meta,actions:c?.actions,at:t,live:s,error:vX(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)(_m,{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)(mb,{children:[(0,x.jsx)(hb,{render:(0,x.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground`,"aria-label":`More approval options`}),children:`More`}),(0,x.jsx)(gb,{align:`start`,children:(0,x.jsx)(_b,{onClick:()=>n?.(!0,!0),children:`Always allow this session`})})]})]})]})}),rX(e)===`shell`&&(r||nX(e))&&(0,x.jsx)(uX,{part:e}),rX(e)===`workspace_push`&&e.state===`output-available`&&(0,x.jsx)(dX,{part:e}),Array.isArray(e.output?.screenshots)&&e.output.screenshots.length>0&&(0,x.jsx)(fX,{ids:e.output.screenshots}),r&&c&&!c.isUndone&&(0,x.jsx)(gX,{editId:c.editId}),r&&rX(e)!==`shell`&&!c&&(0,x.jsx)(wX,{part:e})]})}function EX({parts:e,at:t}){let[n,r]=b.useState(!1),i=t=>e.filter(e=>t.includes(rX(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(nX);return(0,x.jsx)(CX,{icon:hf,label:c,at:t,live:l,error:e.some(vX),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)(xX.Provider,{value:!0,children:e.map(e=>(0,x.jsx)(TX,{part:e},e.toolCallId))})})})}function DX({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)(CX,{icon:wd,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 OX(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(aX(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 kX({m:e,busy:t}){let{onRewind:n}=b.useContext(pX),r=e.parts.map(e=>e.type===`text`?e.text:``).join(`
|
|
286
|
+
`),{projectId:i}=qi({strict:!1}),a=w9(i),o=b.useMemo(()=>new Map((a.data||[]).map(e=>[e.name,e.description])),[a.data]);return(0,x.jsxs)(`div`,{className:`group flex flex-col items-end gap-1 pb-4`,"data-timeline-message":e.id,children:[(0,x.jsx)(`div`,{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:(0,x.jsx)(y9,{text:r,skills:o})}),(0,x.jsx)(bY,{at:e.metadata?.createdAt,text:r,busy:t,onRevert:()=>n(e.id)})]})}function AX(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 jX({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?Pd:Id,{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)(Zp,{className:`size-3`}),` Undo turn`]}),a&&(0,x.jsxs)(`span`,{className:G(`text-xs text-muted-foreground tabular-nums opacity-0 transition-opacity group-hover/timeline-row:opacity-100`,!i&&`ms-auto`),children:[PX(a.input),` in`,a.cachedInput?` (${PX(a.cachedInput)} cached)`:``,` ·`,` `,PX(a.output),` out`,typeof a.cost==`number`?` · ${FX(a.cost)}`:``]}),t&&(0,x.jsx)(`span`,{className:G(`text-xs text-muted-foreground tabular-nums opacity-0 transition-opacity group-hover/timeline-row:opacity-100`,!i&&!a&&`ms-auto`),children:xu(t)})]})})}function MX({m:e,streaming:t,onApprove:n,turnId:r,terminal:i}){let[a,o]=b.useState(!1),{onUndoTurn:s}=b.useContext(pX),c=OX(e,t),l=e.parts.some(e=>[`tool-edit_file`,`tool-write_file`,`tool-delete_path`].includes(e.type)&&e.output?.editId),u=e.metadata?.createdAt,d=hY(c,{streaming:t,finished:!!e.metadata?.finishedAt}),f=[...e.parts].reverse().find(e=>e.type===`tool-workspace_push`&&e.state===`output-available`),p=e.metadata?.createdAt,m=e.metadata?.finishedAt,h=p&&m?`Worked for ${AX(Date.parse(m)-Date.parse(p))}`:p?`You stopped this response`:`Worked`,g=e.metadata?.error?`failed`:p&&!m&&!t?`stopped`:null,_=c.filter(e=>e.kind===`text`).map(e=>e.text).join(`
|
|
287
|
+
|
|
288
|
+
`),v=d?c.filter((e,t)=>a||!d.has(t)):c,y=[...v].reverse().find(e=>e.kind===`text`),S=!!y&&v.indexOf(y)<v.length-1,C=i&&(_.trim()||g)?{at:m||p,text:_}:null,w=e=>{switch(e.kind){case`text`:return C&&e===y&&!S?(0,x.jsxs)(`div`,{className:`group/assistant relative min-w-0 px-1 py-0.5 pb-2`,children:[(0,x.jsx)(oY,{text:e.text}),(0,x.jsx)(xY,{className:`mt-1.5`,at:C.at,text:C.text,status:g})]},e.key):(0,x.jsx)(`div`,{className:`px-1 py-0.5 pb-2`,children:(0,x.jsx)(oY,{text:e.text})},e.key);case`reasoning`:return(0,x.jsx)(DX,{text:e.text,live:e.live},e.key);case`tool`:return rX(e.part)===`ask`?(0,x.jsx)(_X,{part:e.part},e.key):(0,x.jsx)(TX,{part:e.part,at:u,onApprove:(t,r)=>e.part.approval&&n(e.part.approval.id,t,r)},e.key);case`group`:return(0,x.jsx)(EX,{parts:e.parts,at:u},e.key)}},T=C&&(S||!y)?(0,x.jsx)(`div`,{className:`px-1`,children:(0,x.jsx)(xY,{className:`mt-0.5`,at:C.at,text:C.text,status:g,alwaysVisible:!0})}):null;return d?(0,x.jsxs)(`div`,{className:`flex flex-col pb-4`,"data-timeline-message":e.id,children:[(0,x.jsx)(jX,{label:h,at:u,open:a,onToggle:()=>o(!a),onUndo:l&&r?()=>s(r):void 0,usage:e.metadata?.usage}),(0,x.jsxs)(`div`,{className:`pt-2`,children:[c.filter((e,t)=>a||!d.has(t)).map(w),!a&&f&&(0,x.jsx)(dX,{part:f}),T]})]}):(0,x.jsxs)(`div`,{className:`flex flex-col pb-4`,"data-timeline-message":e.id,children:[c.map(w),T]})}function NX({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 `,Eu(t-e)]})})})}function PX(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 FX(e){return e===0?`$0.00`:e<.001?`<$0.001`:e<.1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function IX({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)(pp,{"aria-hidden":!0,className:`size-3 shrink-0`}),e?(0,x.jsxs)(x.Fragment,{children:[`Compacted `,e.turns,` earlier turn`,e.turns===1?``:`s`,` `,PX(e.before),(0,x.jsx)(vd,{"aria-hidden":!0,className:`size-3`}),PX(e.after),` tokens`,(0,x.jsxs)(`span`,{className:`opacity-80`,children:[`· `,e.model.model,e.cost===null?``:` · ${FX(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)(qb,{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)(oY,{text:e.summary})})]})}function LX({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=RX(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:[e.map((n,i)=>(0,x.jsxs)(b.Fragment,{children:[n.role===`user`?(0,x.jsx)(kX,{m:n,busy:t}):(0,x.jsx)(MX,{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)(IX,{c:e},`c${e.upTo}`))]},n.id)),o&&(0,x.jsx)(IX,{active:!0}),t&&(0,x.jsx)(NX,{since:n}),i&&(0,x.jsx)(`div`,{className:G(`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)($Y,{items:d.items,persistent:d.persistent,hitStrip:d.hitStrip,currentIndex:d.current,atEnd:d.atEnd,stripMap:d.stripMap,onWheel:e=>s.current&&ZY(e,s.current),onSelect:e=>{c.current=!1,l.current=Date.now()+1e3,d.select(e.id)}})]})}function RX(e,t){let n=b.useMemo(()=>CY(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=VY(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),_=HY({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:UY(c),hitStrip:WY(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 zX({chatId:e}){let t=Au(),n=U(t.agent.writes.queryOptions({chatId:e})),r=at(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)(Ff,{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 `,Eu(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)(_m,{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)(q,{size:`xs`,variant:`outline`,onClick:()=>r.mutate({id:e.id,approved:!1}),children:`Decline`}),(0,x.jsx)(q,{size:`xs`,onClick:()=>r.mutate({id:e.id,approved:!0}),children:`Approve`})]})]},e.id))}):null}var BX=new Map,VX=new Map,HX=(e,t,n)=>BX.set(e,{text:t,model:n});function UX(e){let t=rX(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 WX({projectId:e,chatId:t}){let n=Au(),r=C(),i=U(n.chats.get.queryOptions({projectId:e,chatId:t})),a=U(n.projects.get.queryOptions({id:e})),o=at(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)(GX,{projectId:e,chatId:t,title:i.data.title,projectName:a.data?.name||``,initial:i.data.messages,initialModel:i.data.model,initialSafety:i.data.safety,serverRunning:i.data.running,onDone:()=>{r.invalidateQueries({queryKey:n.chats.get.queryKey({projectId:e,chatId:t})}),s()}},t)}function GX({projectId:e,chatId:t,title:n,projectName:r,initial:i,initialModel:a,initialSafety:o,serverRunning:s,onDone:c}){let l=Au(),u=C(),[d,f]=b.useState(a),p=b.useRef(d);p.current=d;let m=at(l.chats.setModel.mutationOptions()),h=at(l.chats.stop.mutationOptions()),g=at(l.chats.rewind.mutationOptions()),_=at(l.edits.undoTurn.mutationOptions()),v=Yi(),[y]=b.useState(()=>{let e=VX.get(t)||``;return VX.delete(t),e}),[S,w]=b.useState(o),T=at(l.chats.setSafety.mutationOptions()),[E,D]=b.useState(Date.now()),[O,k]=b.useState(),A=mL({id:t,messages:i,transport:b.useMemo(()=>new tL({api:`/api/chat`,headers:()=>({"x-forge-token":vu()}),prepareSendMessagesRequest:({messages:t,id:n})=>({body:{projectId:e,chatId:n,message:t[t.length-1],model:p.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:rL,onError:e=>{k(e.message),e.code===`approval_expired`&&j()},onFinish:()=>c()}),j=async()=>{let n=await u.fetchQuery({...l.chats.get.queryOptions({projectId:e,chatId:t}),staleTime:0});A.setMessages(n.messages)},M=A.status===`submitted`||A.status===`streaming`;b.useEffect(()=>{let e=BX.get(t);e&&(BX.delete(t),e.model&&f(e.model),p.current=e.model,D(Date.now()),A.sendMessage({text:e.text}))},[t]);let N=b.useMemo(()=>{let e=A.messages[A.messages.length-1];return!e||e.role!==`assistant`?null:e.parts.find(e=>e.state===`approval-requested`)},[A.messages]),P=N?.approval?{id:N.approval.id,summary:UX(N),always:rX(N)===`shell`&&/^command:/.test(N.approval.requestReason||``)}:null,F=at(l.chats.answerSdk.mutationOptions({onError:e=>{k(e.message),j()}})),I=(n,r,i)=>{k(void 0),n.startsWith(`sdk:`)?F.mutate({chatId:t,projectId:e,approvalId:n,approved:r,always:!!i}):(D(Date.now()),A.addToolApprovalResponse({id:n,approved:r,...i?{reason:`always`}:{}}))},L=([...A.messages].reverse().find(e=>e.metadata?.usage)?.metadata)?.usage?.context||0,R=U(l.chats.get.queryOptions({projectId:e,chatId:t})),z=U(l.chats.usage.queryOptions({projectId:e,chatId:t})),B=U(l.chats.overlaps.queryOptions({projectId:e,chatId:t})),V=at(l.chats.compact.mutationOptions()),H=z.data?.totals,ee=!!H&&H.cost>0,te=!!H&&!ee&&(H.apiEquivalent||0)>0,ne=!H||!H.calls?``:ee?FX(H.cost):te?`~${FX(H.apiEquivalent)}`:`${PX(H.input+H.output)} tokens`,re=H?`This chat: ${PX(H.input)} in (${PX(H.cachedInput)} cached) · ${PX(H.output)} out`+(te?` · API estimate ${FX(H.apiEquivalent)} (subscription: no per-token charge)`:``)+(H.unpricedTokens?` · ${PX(H.unpricedTokens)} tokens without a price (set one in Settings)`:``):``,ie=(B.data||[]).length?(B.data||[]).slice(0,2).map(e=>`${e.path.split(`/`).pop()} is also being changed by “${e.title}”`).join(` · `):void 0,ae=U(l.models.queryOptions()).data?.some(e=>e.connectionId===d?.connectionId&&e.kind===`claude-subscription`),oe=U({...l.claude.status.queryOptions(),enabled:!!ae}),se=ae&&oe.data?.limit?oe.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)(qX,{title:n,projectName:r,projectId:e,chatId:t}),(0,x.jsx)(pX.Provider,{value:{projectId:e,chatId:t,onRewind:async n=>{k(void 0);try{let r=await g.mutateAsync({projectId:e,chatId:t,messageId:n});VX.set(r.chatId,r.text),v({to:`/p/$projectId/c/$chatId`,params:{projectId:e,chatId:r.chatId}})}catch(e){k(e.message)}},onUndoTurn:async n=>{let r=await _.mutateAsync({projectId:e,chatId:t,turnId:n});!r.ok&&`conflictPath`in r&&k(`Undo stopped at ${r.conflictPath}: ${r.message}`)},onAnswer:(n,r)=>{k(void 0),A.messages[A.messages.length-1]?.metadata?.runner===`claude`?F.mutate({chatId:t,projectId:e,toolCallId:n,answer:r}):(D(Date.now()),Promise.resolve(A.addToolOutput({tool:`ask`,toolCallId:n,output:{answer:r}})).then(()=>A.sendMessage()))}},children:(0,x.jsx)(LX,{messages:A.messages,running:M,runStarted:E,onApprove:I,error:O,compactions:R.data?.compactions||[],compacting:V.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)(zX,{chatId:t}),(0,x.jsx)(fS,{running:M||!!s,model:d,onModel:n=>{f(n),m.mutate({projectId:e,chatId:t,model:n})},onSend:e=>{k(void 0),D(Date.now()),A.sendMessage({text:e})},onStop:()=>{A.stop(),h.mutate({chatId:t})},initialText:y,safety:S,onSafety:n=>{w(n),T.mutate({projectId:e,chatId:t,safety:n})},pending:M&&!P?.id.startsWith(`sdk:`)?null:P,onAnswer:(e,t)=>P&&I(P.id,e,t),context:L?PX(L):``,onCompact:async()=>{k(void 0);try{await V.mutateAsync({projectId:e,chatId:t})}catch(e){k(e.message)}},compacting:V.isPending,cost:ne,costTip:re,banner:s&&!M?`This chat is still running from before a reload. It appears when it finishes, or Stop it.`:ie||se})]})]})}function KX({title:e,projectId:t,chatId:n}){let r=Au(),i=C(),a=Yi(),[o,s]=b.useState(!1),[c,l]=b.useState(!1),[u,d]=b.useState(!1),f=b.useRef(!1),p=b.useRef(null),m=at(r.chats.rename.mutationOptions({onSettled:()=>i.invalidateQueries({queryKey:r.chats.get.queryKey({projectId:t,chatId:n})})})),h=at(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)(mb,{open:u,onOpenChange:e=>{e||(d(!1),l(!1))},children:[(0,x.jsxs)(hb,{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)(Pd,{"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)(gb,{align:`start`,sideOffset:4,children:[(0,x.jsxs)(_b,{onClick:_,children:[(0,x.jsx)(Lp,{}),` Rename`]}),(0,x.jsx)(yb,{}),(0,x.jsxs)(_b,{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)(Fm,{}),` `,c?`Click again to delete`:`Delete chat`]})]})]})}function qX({title:e,projectName:t,projectId:n,chatId:r}){let i=Gu();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)(Tb,{label:`Show sidebar`,children:(0,x.jsx)(q,{variant:`ghost`,size:`icon-sm`,onClick:()=>Wu({sidebarOpen:!0}),children:(0,x.jsx)(kp,{})})}),(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)(KX,{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)(l8,{projectId:n})}),(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,x.jsx)(Tb,{label:`Check the workspace (Push plan tab)`,children:(0,x.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":`Check`,onClick:()=>Wu({panelOpen:!0,panelTab:`plan`}),children:(0,x.jsx)(Bd,{})})}),(0,x.jsx)(Tb,{label:`Push to the instance (review the plan first)`,children:(0,x.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":`Push`,onClick:()=>Wu({pushOpen:!0}),children:(0,x.jsx)(zm,{})})}),(0,x.jsx)(`span`,{className:`mx-1 h-4 w-px bg-border`,"aria-hidden":!0}),(0,x.jsx)(Tb,{label:`Terminal (${Du?`⌘`:`Ctrl`}+\`)`,children:(0,x.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":`Toggle terminal`,"aria-pressed":i.drawerOpen,onClick:()=>Wu({drawerOpen:!i.drawerOpen}),className:i.drawerOpen?`bg-accent [&_svg]:text-foreground`:``,children:(0,x.jsx)(Dp,{})})}),(0,x.jsx)(Tb,{label:`Toggle the right panel`,children:(0,x.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-pressed":i.panelOpen,onClick:()=>Wu({panelOpen:!i.panelOpen}),className:i.panelOpen?`bg-accent [&_svg]:text-foreground`:``,children:(0,x.jsx)(jp,{})})})]})]})}function JX(e){let t=Au(),n=Yi(),r=at(t.chats.create.mutationOptions());return async(t,i)=>{let a=await r.mutateAsync({projectId:e});HX(a.id,t,i),n({to:`/p/$projectId/c/$chatId`,params:{projectId:e,chatId:a.id}})}}var YX=500,XX=new Map,ZX=new Set,QX=0,$X=(e,t)=>`${e}\u0000${t}`;function eZ(){QX+=1;for(let e of ZX)e()}async function tZ(e){if(e.saving||e.latest===null||e.problem)return;e.saving=!0;let t=e.latest;try{e.baseHash=(await Ou.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,eZ()}e.latest!==null&&!e.problem&&!e.timer&&tZ(e)}function nZ(e,t,n){let r=$X(e,t),i=XX.get(r);i?i.latest===null&&!i.saving&&(i.baseHash=n):XX.set(r,{projectId:e,path:t,baseHash:n,latest:null,timer:null,saving:!1,problem:null})}function rZ(e,t,n){let r=XX.get($X(e,t));r&&(r.latest=n,r.timer&&clearTimeout(r.timer),r.timer=setTimeout(()=>{r.timer=null,tZ(r)},YX),eZ())}function iZ(e,t){let n=XX.get($X(e,t));n&&(n.timer&&=(clearTimeout(n.timer),null),tZ(n))}function aZ(e,t,n,r){let i=XX.get($X(e,t));i&&(i.problem=null,n===`reload`?(i.latest=null,i.timer&&clearTimeout(i.timer),i.timer=null,XX.delete($X(e,t)),eZ()):(r!==void 0&&(i.baseHash=r),eZ(),tZ(i)))}function oZ(e,t){let n=XX.get($X(e,t));return!!n&&(n.latest!==null||n.saving)}function sZ(e,t){return XX.get($X(e,t))?.latest??null}function cZ(e){return ZX.add(e),()=>ZX.delete(e)}function lZ(){return(0,b.useSyncExternalStore)(cZ,()=>QX)}function uZ(e,t){return lZ(),XX.get($X(e,t))?.problem??null}typeof window<`u`&&window.addEventListener(`pagehide`,()=>{for(let e of XX.values())e.latest!==null&&iZ(e.projectId,e.path)});var dZ=700;function fZ(e){return e?1:.35}function pZ({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)(mZ,{phase:t.phase,sequence:t.sequence,left:t.x*a+1,top:t.y*a+1}):null]})}function mZ({phase:e,sequence:t,left:n,top:r}){let[i,a]=b.useState(null);return b.useEffect(()=>{let e=window.setTimeout(()=>a(t),dZ);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:fZ(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)(yp,{className:`relative size-5 -translate-x-0.5 -translate-y-0.5 fill-background stroke-2 text-primary drop-shadow-sm`})]})}function hZ({projectId:e}){let t=Au(),n=U(t.agent.info.queryOptions({projectId:e})),r=at(t.agent.openWindow.mutationOptions()),[i,a]=b.useState(null),[o,s]=b.useState(null),c=!!n.data?.running;return Ic(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)(kb,{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)(q,{size:`xs`,variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({projectId:e,headless:!0}),children:[(0,x.jsx)(pf,{}),` Back to headless`]}):(0,x.jsxs)(q,{size:`xs`,variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({projectId:e,headless:!1}),children:[(0,x.jsx)(md,{}),` 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)(b8,{icon:md,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)(pZ,{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)(Yb,{size:`sm`,muted:!0}),` Waiting for the first frame…`]})})]}):(0,x.jsx)(b8,{icon:xp,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 gZ=b.lazy(()=>NJ(()=>import(`./terminal-view-D3CiLjfu.js`),__vite__mapDeps([10,11])));function _Z({projectId:e,autoCreate:t}){let n=Au(),r=C(),i=Gu(),a=U(n.terminals.list.queryOptions({projectId:e})),o=at(n.terminals.create.mutationOptions({onSuccess:t=>{r.invalidateQueries({queryKey:n.terminals.list.queryKey({projectId:e})}),Wu({activeTerminal:t.id})}})),s=at(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)(Yb,{size:`sm`,muted:!0})}),children:(0,x.jsx)(gZ,{sessionId:l.id},l.id)}):a.isLoading?null:(0,x.jsx)(b8,{icon:Cm,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:G(`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:()=>Wu({activeTerminal:e.id}),title:e.title,children:[e.kind===`command`?(0,x.jsx)(hf,{className:`size-3 shrink-0`}):(0,x.jsx)(Cm,{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:G(`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)(Gm,{className:`size-3`})})]},e.id)),(0,x.jsx)(Tb,{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)(qp,{className:`size-3`}),` New`]})})]})]})}function vZ({projectId:e}){let t=Gu();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;Wu({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)(_Z,{projectId:e,autoCreate:!0})]}):null}var yZ={layout:`stacked`,ignoreWhitespace:!1,colors:`red-green`};function bZ(){let e=U(Au().settings.get.queryOptions());return{...yZ,...e.data?.diffs||{}}}var xZ=b.lazy(()=>NJ(()=>import(`./diff-view-Chujmqzi.js`),__vite__mapDeps([8,9,3,1,5])));function SZ({projectId:e}){let t=Au(),n=Gu(),r=bZ().layout===`split`,i=at(t.settings.setDiffs.mutationOptions()),{chatId:a=``}=qi({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=at(t.diffs.accept.mutationOptions()),f=at(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:()=>Wu({diffScope:e.id}),className:G(`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:G(`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)(Yb,{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:()=>Wu({diffPath:t.path}),className:G(`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)(Tb,{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)(zf,{className:`size-3.5`}):(0,x.jsx)(xm,{className:`size-3.5`})})}),(0,x.jsx)(`span`,{className:G(`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)(yX,{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)(q,{size:`xs`,variant:`ghost-muted`,onClick:n=>{n.stopPropagation(),f.mutate({projectId:e,chatId:a,path:t.path})},children:`Revert`}),(0,x.jsx)(q,{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)(q,{size:`xs`,variant:`ghost`,onClick:()=>Xu(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)(Yb,{size:`sm`,muted:!0})}),children:(0,x.jsx)(xZ,{path:u.data.path,oldText:u.data.old,newText:u.data.new,split:r})}):null]})]}):(0,x.jsx)(b8,{icon:_f,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 CZ=`flex h-10 min-h-10 shrink-0 items-center gap-2 border-b border-border/60 bg-background px-3`;function wZ({label:e,pressed:t,disabled:n,onPress:r,children:i}){return(0,x.jsx)(Tb,{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:G(`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 TZ({className:e}){return(0,x.jsx)(`div`,{role:`status`,"aria-label":`Loading file`,className:G(`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,e),children:(0,x.jsx)(Yb,{size:`lg`})})}function EZ({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 DZ({tone:e=`warning`,children:t}){return(0,x.jsx)(`div`,{role:`status`,className:G(`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 OZ({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)(I3,{open:!!e,onOpenChange:e=>!e&&r(),children:(0,x.jsx)(A4,{children:(0,x.jsx)(b3,{anchor:i,side:`bottom`,align:`start`,sideOffset:2,className:`z-50 outline-none`,children:(0,x.jsx)(D4,{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)(Y3,{className:`mx-2 my-1 h-px bg-border`}),(0,x.jsx)(i1,{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 kZ(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 AZ({projectId:e}){let t=Au(),n=U(t.push.state.queryOptions({projectId:e})),r=at(t.push.status.mutationOptions()),i=at(t.push.check.mutationOptions()),a=at(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)(Tb,{label:i,children:(0,x.jsx)(q,{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:G(`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:G(`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)(Id,{className:G(`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:kZ(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)(Yb,{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)(MZ,{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)(q,{size:`xs`,variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({projectId:e}),children:[r.isPending?(0,x.jsx)(Yb,{size:`xs`}):(0,x.jsx)(Yp,{}),` Status`]}),(0,x.jsxs)(q,{size:`xs`,variant:`outline`,disabled:i.isPending,onClick:()=>i.mutate({projectId:e}),children:[i.isPending?(0,x.jsx)(Yb,{size:`xs`}):(0,x.jsx)(Bd,{}),` Check`]}),(0,x.jsx)(Tb,{label:`Diff the files against the instance base (the last pull or push)`,children:(0,x.jsxs)(q,{size:`xs`,variant:`ghost-muted`,onClick:()=>Wu({panelTab:`diff`,diffScope:`instance`}),children:[(0,x.jsx)(_f,{}),` vs instance`]})}),(0,x.jsx)(`span`,{className:`ms-auto`}),(0,x.jsxs)(q,{size:`xs`,disabled:n.data?.running,onClick:()=>Wu({pushOpen:!0}),children:[n.data?.running?(0,x.jsx)(Yb,{size:`xs`}):(0,x.jsx)(zm,{}),` 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)(Yb,{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)(kb,{variant:`success`,children:`clean`}):(0,x.jsx)(kb,{variant:`warning`,children:`changes`}),[`local`,`instance`,`conflicts`].map(e=>l.counts?.[e]?(0,x.jsxs)(kb,{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 ${bu(l.syncedAt)}`:``]})]}),l&&l.clean&&!u&&(0,x.jsx)(b8,{icon:Bd,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)(jZ,{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 `,bu(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 `,bu(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 jZ({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:G(`flex items-center gap-2 font-medium`,e.ok?`text-success-foreground`:`text-warning-foreground`),children:[e.ok?(0,x.jsx)(Bd,{className:`size-4`}):(0,x.jsx)(Wd,{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 MZ({projectId:e,entry:t}){let n=U(Au().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)(Yb,{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)(Xd,{className:`size-3`}):(0,x.jsx)(Nf,{className:`size-3`}),e.from,` → `,e.to===`local`?`mine`:e.to]}),(0,x.jsx)(NZ,{d:e})]},t))})]},e.id))]})}function NZ({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:PZ(t[e.from])}),` `,(0,x.jsx)(`span`,{className:`text-success-foreground`,children:PZ(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(`
|
|
289
|
+
`).filter(e=>!/^(---|\+\+\+) /.test(e)).map((e,t)=>(0,x.jsx)(`div`,{className:G(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 PZ(e){let t=typeof e==`string`?e:JSON.stringify(e);return t===void 0?`—`:t.length>80?`${t.slice(0,77)}…`:t}function FZ(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 IZ({projectId:e,dev:t,onRestart:n}){let r=Au(),[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?FZ(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)(Tb,{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)($p,{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:G(`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)(Tb,{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)(df,{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)(xp,{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)(Tb,{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)(Gm,{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(`
|
|
290
|
+
`)||`Starting the dev server…`})]}):t?.state===`failed`?(0,x.jsx)(b8,{icon:Wd,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)(a8,{section:`instances`,children:(0,x.jsx)(q,{size:`sm`,variant:`outline`,children:`Add a profile`})}),(0,x.jsxs)(q,{size:`sm`,variant:`outline`,onClick:n,children:[(0,x.jsx)($p,{}),` Restart`]})]}),children:t.error}):(0,x.jsx)(b8,{icon:hp,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 LZ=[{id:`preview`,label:`Preview`,icon:md},{id:`agent`,label:`Agent`,icon:xp},{id:`diff`,label:`Diff`,icon:_f},{id:`files`,label:`Files`,icon:Tf},{id:`terminal`,label:`Terminal`,icon:Cm},{id:`problems`,label:`Problems`,icon:Wd},{id:`plan`,label:`Push plan`,icon:zm}],RZ={agent:{icon:xp,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:_f,title:`No changes yet`,text:`Every edit the agent makes shows here, per turn or for the session, with undo.`},files:{icon:Tf,title:`Files`,text:`The project tree, with changed files marked.`},terminal:{icon:Cm,title:`Terminal`,text:`Your shell in the project folder, and live views of the agent’s commands.`},problems:{icon:Wd,title:`No problems`,text:`Compile errors, missing components and console errors from the preview show here.`},plan:{icon:zm,title:`No push plan`,text:`Check and plan a push to the instance; every push is reviewed in a dialog before it runs.`}};function zZ(e,t,n,r,i,a){let o=new Set(e);for(let t of e){let e=Zu(t);e&&iZ(a,e)}let s=t.filter(e=>!o.has(e)),c=e.filter(e=>!Zu(e)),l=i.filter(e=>!o.has(`file:${e}`));if(!s.length)return Wu({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))}Wu({closedTabs:[...r,...c],openFiles:l,panelTab:u})}var BZ=b.lazy(()=>NJ(()=>import(`./file-panel-le_M5nHe.js`).then(e=>({default:e.FilePanel})),__vite__mapDeps([12,9,3,1,5,7]))),VZ=e=>e.slice(e.lastIndexOf(`/`)+1);function HZ({projectId:e,dev:t,onRestart:n}){let r=Gu(),i=RZ[r.panelTab],a=r.openFiles||[];lZ();let[o,s]=b.useState(null),c=r.closedTabs||[];b.useEffect(()=>{c.includes(r.panelTab)&&Wu({closedTabs:c.filter(e=>e!==r.panelTab)})},[r.panelTab,c]);let l=LZ.filter(e=>!c.includes(e.id)||e.id===r.panelTab),u=LZ.filter(e=>!l.includes(e)),d=[...l.map(e=>e.id),...a.map(e=>`file:${e}`)],f=t=>zZ(t,d,r.panelTab,c,a,e),p=e=>f([e]),m=[...l.map(e=>({id:e.id,label:e.label,icon:(0,x.jsx)(e.icon,{className:`size-3`})})),...a.map(t=>({id:`file:${t}`,label:VZ(t),title:t,icon:(0,x.jsx)(u9,{path:t,className:`size-3`}),pending:oZ(e,t)}))],h=o?d.indexOf(o.id):-1,g=o?[...Zu(o.id)?[{id:`copy-path`,label:`Copy path`}]:[],{id:`close`,label:`Close`},{id:`close-others`,label:`Close others`,disabled:d.length<=1},{id:`close-to-right`,label:`Close to the right`,disabled:h>=d.length-1},{id:`close-all`,label:`Close all`,disabled:d.length===0}]:[],_=e=>{if(!o)return;let t=o.id;s(null),e===`copy-path`?navigator.clipboard.writeText(Zu(t)||``):e===`close`?p(t):e===`close-others`?f(d.filter(e=>e!==t)):e===`close-to-right`?f(d.slice(d.indexOf(t)+1)):e===`close-all`&&f(d)},v=WZ(),y=(0,x.jsxs)(`section`,{className:G(`relative flex h-full shrink-0 flex-col bg-background`,v?`w-full bg-popover`:`border-l`),style:v?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:[m.map(e=>(0,x.jsxs)(`div`,{onClick:t=>{t.target===t.currentTarget&&Wu({panelTab:e.id})},onAuxClick:t=>{t.button===1&&p(e.id)},onContextMenu:t=>{t.preventDefault(),s({at:{x:t.clientX,y:t.clientY},id:e.id})},title:e.title,className:G(`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:[(0,x.jsxs)(`button`,{type:`button`,"aria-label":`Close ${e.label}`,onClick:()=>p(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)(Gm,{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:()=>Wu({panelTab:e.id}),className:`flex min-w-0 cursor-pointer items-center`,children:(0,x.jsx)(`span`,{className:`truncate`,children:e.label})})]},e.id)),u.length>0&&(0,x.jsxs)(mb,{children:[(0,x.jsx)(hb,{render:(0,x.jsx)(q,{"aria-label":`Open a tab`,title:`Open a tab`,className:`shrink-0`,size:`icon-xs`,variant:`ghost-muted`}),children:(0,x.jsx)(qp,{className:`size-3.5`})}),(0,x.jsx)(gb,{align:`start`,sideOffset:6,children:u.map(e=>(0,x.jsxs)(_b,{onClick:()=>Wu({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===`preview`?(0,x.jsx)(IZ,{projectId:e,dev:t,onRestart:n}):r.panelTab===`agent`?(0,x.jsx)(hZ,{projectId:e}):r.panelTab===`terminal`?(0,x.jsx)(_Z,{projectId:e}):r.panelTab===`diff`?(0,x.jsx)(SZ,{projectId:e}):Zu(r.panelTab)?(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(BZ,{projectId:e,path:Zu(r.panelTab)},r.panelTab)}):r.panelTab===`plan`?(0,x.jsx)(AZ,{projectId:e}):r.panelTab===`files`?(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(BZ,{projectId:e,path:null})}):i?(0,x.jsx)(b8,{icon:i.icon,title:i.title,children:i.text}):null}),(0,x.jsx)(OZ,{at:o?.at??null,items:g,onPick:_,onClose:()=>s(null)}),!v&&(0,x.jsx)(KZ,{})]});return v?(0,x.jsx)(GZ,{children:y}):y}var UZ=`(max-width: 980px)`;function WZ(){let[e,t]=b.useState(()=>window.matchMedia(UZ).matches);return b.useEffect(()=>{let e=window.matchMedia(UZ),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function GZ({children:e}){return(0,x.jsx)(U6,{open:!0,onOpenChange:(e,t)=>{if(!e){if(t.reason===`escape-key`&&t.event?.repeat)return t.cancel();Wu({panelOpen:!1})}},children:(0,x.jsxs)(I6,{children:[(0,x.jsx)(D6,{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)(F6,{"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 KZ(){return(0,x.jsx)(`div`,{onPointerDown:e=>{e.preventDefault();let t=e=>{let t=window.innerWidth-e.clientX;Wu({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 qZ(e=``){return e.replace(/^x_\d+_portal_/,``).replace(/^sys_/,``)}var JZ=/^(server_script|script|server_js|server\.js)$/;function YZ({verb:e,tone:t,item:n}){let r=Object.keys(n.changes||n.fields||{}).filter(e=>e!==`sys_updated_on`),i=r.some(e=>JZ.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:G(`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:qZ(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)(Lm,{className:`size-3 shrink-0`}),` server script: runs on the instance as each visitor`]})]})]})}function XZ({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:G(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)(YZ,{verb:`CREATE`,tone:`text-success-foreground`,item:e},`c${t}`)),(t.updates||[]).map((e,t)=>(0,x.jsx)(YZ,{verb:`UPDATE`,tone:`text-info-foreground`,item:e},`u${t}`)),(t.deactivates||[]).map((e,t)=>(0,x.jsx)(YZ,{verb:`DEACTIVATE`,tone:`text-warning-foreground`,item:e},`d${t}`)),(t.deletes||[]).map((e,t)=>(0,x.jsx)(YZ,{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 ZZ({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)(Lm,{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:$Z(e.instance)}),` → `,(0,x.jsx)(`span`,{className:`text-foreground`,children:$Z(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)(o5,{size:`compact`,mono:!0,value:n,onChange:e=>r(e.target.value),autoComplete:`off`})]})]})}function QZ(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 $Z(e){let t=typeof e==`string`?e:JSON.stringify(e);return t===void 0?`—`:t.length>60?`${t.slice(0,57)}…`:t}function eQ({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)(Yb,{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 tQ({projectId:e}){let t=Gu(),n=Au(),r=t.pushOpen,i=U(n.projects.info.queryOptions({id:e})),a=U({...n.push.state.queryOptions({projectId:e}),enabled:r}),o=at(n.push.plan.mutationOptions()),s=at(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||(Wu({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)(Eb,{open:r,onOpenChange:e=>!e&&_(),children:(0,x.jsx)(Db,{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)(q,{variant:`outline`,onClick:_,children:`Close`}),(0,x.jsx)(q,{onClick:()=>{s.reset(),o.mutate({projectId:e,force:!1}),l(!1)},children:`Finish the push…`})]}):(0,x.jsx)(q,{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)(c5,{checked:f,onCheckedChange:e=>p(!!e),disabled:s.isPending}),`Commit the files and forge.workspace.json after the push`]}),(0,x.jsx)(q,{variant:`outline`,onClick:_,disabled:s.isPending,children:`Cancel`}),T?(0,x.jsxs)(q,{disabled:o.isPending,onClick:()=>{s.reset(),o.mutate({projectId:e,force:c})},children:[o.isPending&&(0,x.jsx)(Yb,{size:`sm`}),`Re-run dry run`]}):(0,x.jsxs)(q,{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)(Yb,{size:`sm`}):(0,x.jsx)(zm,{}),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 `,bu(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)(Yb,{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. `,QZ(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)(q,{size:`xs`,variant:`outline`,onClick:()=>{_(),Wu({panelOpen:!0,panelTab:`plan`})},children:`Resolve in Push plan`}),!c&&Array.isArray(v.conflicts)&&(0,x.jsx)(q,{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)(Bd,{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)(XZ,{chunks:y})]}),v.pending&&(0,x.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-info-foreground`,children:[(0,x.jsx)(qf,{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)(Lm,{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)(qf,{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)(Lm,{className:`mt-0.5 size-3.5 shrink-0`}),` `,e]},e))]}),c&&v?.planHash&&!o.isPending&&(0,x.jsx)(ZZ,{overwrites:v.overwrites||[],slug:g?.portal||``,typed:u,onType:d}),f&&!C&&(0,x.jsx)(o5,{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)(eQ,{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)(nQ,{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)(qf,{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 nQ({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)(Kd,{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)(Bd,{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:G(`mt-1 text-xs`,t.ok?`text-muted-foreground`:`text-warning-foreground`),children:[`git: `,t.message]})]})}function rQ({projectId:e,chatId:t}){let n=Gu(),r=U(Au().projects.get.queryOptions({id:e})),i=o8(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)(WX,{projectId:e,chatId:t}):(0,x.jsx)(iQ,{projectId:e,name:r.data?.name||``}),(0,x.jsx)(vZ,{projectId:e})]}),n.panelOpen&&(0,x.jsx)(HZ,{projectId:e,dev:i.status,onRestart:i.restart}),(0,x.jsx)(tQ,{projectId:e})]})}function iQ({projectId:e,name:t}){let n=U(Au().settings.get.queryOptions()),r=JX(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)(qX,{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)(fC,{}),(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)(fS,{autoFocus:!0,model:s,onModel:a,onSend:e=>r(e,s),placeholder:`Describe a change, ask about the portal, or paste an error`})]})]})}function aQ({label:e,onClose:t,children:n}){let[r,i]=b.useState(!0),a=b.useRef(!1),o=b.useRef(null);return(0,x.jsx)(U6,{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)(I6,{children:[(0,x.jsx)(D6,{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)(W6,{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)(F6,{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 oQ(){return(0,x.jsx)(Tb,{label:`Close (Esc)`,children:(0,x.jsx)(O6,{"aria-label":`Close`,render:(0,x.jsx)(q,{size:`icon-sm`,variant:`ghost`}),children:(0,x.jsx)(Gm,{})})})}function sQ(){let e=Fa({select:e=>e.location.pathname});return/^\/p\/([^/]+)/.exec(e)?.[1]||``}function cQ({label:e,onClick:t}){return(0,x.jsx)(Tb,{label:e,children:(0,x.jsx)(q,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":e,onClick:t,children:(0,x.jsx)(Zp,{className:`size-3`})})})}function lQ({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:G(`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 uQ(){let e=sQ(),[t,n]=b.useState(null),r=t??e;return r?(0,x.jsx)(pQ,{id:r,onBack:()=>n(``)}):(0,x.jsx)(dQ,{onPick:n})}function dQ({onPick:e}){let t=U(Au().projects.list.queryOptions()),n=t.data||[];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(NS,{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)(Id,{className:`size-4 shrink-0 text-muted-foreground`})]},t.id))]}),(0,x.jsx)(fQ,{})]})}function fQ(){let e=Au(),t=C(),n=U(e.meta.queryOptions()),r=U(e.settings.get.queryOptions()),i=at(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)(NS,{title:`New projects`,children:(0,x.jsxs)(PS,{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)(cQ,{label:`Use the default folder`,onClick:()=>i.mutate({path:``})}),(0,x.jsx)(o5,{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 pQ({id:e,onBack:t}){let n=Au(),r=i8(),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=at(n.projects.rename.mutationOptions()),u=at(n.projects.remove.mutationOptions()),[d,f]=b.useState(null),[p,m]=b.useState(!1);if(!a)return(0,x.jsx)(NS,{title:`Projects`,action:(0,x.jsx)(mQ,{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)(NS,{title:a.name,action:(0,x.jsx)(mQ,{onClick:t}),children:[(0,x.jsxs)(PS,{title:`Name`,description:`Shown in the sidebar and the projects list. The folder keeps its name.`,children:[_&&(0,x.jsx)(cQ,{label:`Use the folder name`,onClick:()=>l.mutate({id:e,name:``})}),(0,x.jsx)(o5,{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)(PS,{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)(Df,{className:`size-3.5 shrink-0`}),(0,x.jsx)(`span`,{className:`truncate`,title:a.path,children:a.path})]})}),(0,x.jsx)(PS,{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)(q,{size:`xs`,variant:`outline`,onClick:()=>r(`instances`),children:[`No profile for `,h.host,` · Add`]}):null}),(0,x.jsxs)(PS,{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)(kb,{variant:`info`,children:`Overridden`}),(0,x.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>r(`providers`),children:`Change`})]}),(0,x.jsx)(PS,{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 ${yu(o.data.lastActivity)} ago`:``]})})]}),(0,x.jsx)(NS,{title:`Danger`,children:(0,x.jsx)(PS,{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)(q,{size:`xs`,variant:`ghost-muted`,onClick:()=>m(!1),children:`Cancel`}),(0,x.jsxs)(q,{size:`xs`,variant:`destructive`,onClick:()=>u.mutate({id:e},{onSuccess:t}),children:[`Remove `,a.name]})]}):(0,x.jsx)(q,{size:`xs`,variant:`destructive-outline`,onClick:()=>m(!0),children:`Remove project`})})})]})}function mQ({onClick:e}){return(0,x.jsxs)(q,{size:`xs`,variant:`ghost-muted`,onClick:e,children:[(0,x.jsx)(gd,{}),` All projects`]})}function hQ({value:e}){return(0,x.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,children:Fu(e).map((e,t)=>(0,x.jsx)(Ab,{children:e},t))})}function gQ(){let e=Au(),t=U(e.settings.get.queryOptions()),n=at(e.settings.setKeybinding.mutationOptions()),r=t.data?.keybindings||[],[i,a]=b.useState(``),o=Lu(r),s=i.trim().toLowerCase(),c=ju.filter(e=>!s||e.label.toLowerCase().includes(s)||e.id.toLowerCase().includes(s)||Iu(Mu(e,r)).toLowerCase().includes(s)),l=[...new Set(c.map(e=>e.group))];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(NS,{title:`Keybindings`,action:(0,x.jsx)(Tb,{label:`The browser may claim some shortcuts first (Ctrl+N, Ctrl+W, Ctrl+T).`,children:(0,x.jsx)(q,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first`,children:(0,x.jsx)(Lm,{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)(am,{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)(o5,{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)(NS,{title:e,children:c.filter(t=>t.group===e).map(e=>(0,x.jsx)(_Q,{cmd:e,value:Mu(e,r),custom:r.some(t=>t.command===e.id),clashes:(o.get(Mu(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 _Q({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=>ju.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)(kb,{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: ${Iu(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)(Tb,{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)(Lm,{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)(mb,{children:[(0,x.jsx)(hb,{render:(0,x.jsx)(q,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Actions for ${e.label}`}),children:(0,x.jsx)(lf,{})}),(0,x.jsxs)(gb,{align:`end`,children:[(0,x.jsx)(_b,{disabled:!n,onClick:a,children:`Reset to default`}),(0,x.jsx)(_b,{disabled:!t,onClick:()=>i(``),children:`Unassign`})]})]})}),d&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(q,{size:`sm`,variant:`ghost-muted`,onClick:()=>l(null),children:`Cancel`}),(0,x.jsx)(q,{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?Iu(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)(hQ,{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)(hQ,{value:c})}):(0,x.jsx)(`span`,{"data-keybinding-capture":``,children:(0,x.jsx)(o5,{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=Pu(e.nativeEvent);t&&(l(t),s(!1))}})})]})]})}var vQ={layout:`stacked`,ignoreWhitespace:!1,colors:`red-green`};function yQ(){let e=Au(),t=U(e.settings.get.queryOptions()),n=at(e.settings.setDiffs.mutationOptions()),r={...vQ,...t.data?.diffs||{}};return(0,x.jsxs)(NS,{title:`Diffs`,children:[(0,x.jsxs)(PS,{title:`Diff layout`,description:`Show diffs stacked or side by side. The toggle in the Diff tab changes this too.`,children:[r.layout!==vQ.layout&&(0,x.jsx)(cQ,{label:`Reset diff layout to default`,onClick:()=>n.mutate({layout:`stacked`})}),(0,x.jsx)(lQ,{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)(PS,{title:`Hide whitespace changes`,description:`Set whether diffs ignore whitespace-only edits by default.`,children:[r.ignoreWhitespace!==vQ.ignoreWhitespace&&(0,x.jsx)(cQ,{label:`Reset whitespace changes to default`,onClick:()=>n.mutate({ignoreWhitespace:!1})}),(0,x.jsx)(l5,{checked:r.ignoreWhitespace,"aria-label":`Hide whitespace changes by default`,onCheckedChange:e=>n.mutate({ignoreWhitespace:!!e})})]}),(0,x.jsxs)(PS,{title:`Diff colors`,description:`Choose colors for additions and deletions, including change counts.`,children:[r.colors!==vQ.colors&&(0,x.jsx)(cQ,{label:`Reset diff colors to default`,onClick:()=>n.mutate({colors:`red-green`})}),(0,x.jsx)(lQ,{label:`Diff colors`,value:r.colors,options:[{id:`red-green`,label:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(bQ,{a:`var(--destructive)`,b:`var(--success)`}),` Red & green`]})},{id:`blue-orange`,label:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(bQ,{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 bQ({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 xQ(){let e=Au(),t=i8(),n=U(e.meta.queryOptions()),r=U(e.about.update.queryOptions()),i=at(e.about.checkUpdate.mutationOptions()),a=at(e.settings.setOnboarded.mutationOptions()),o=Yi(),[s,c]=b.useState(!1),l=n.data?.version||``,u=i.data||r.data,d=u?u.disabled?`Update checks are off: ${u.disabled}.`:u.newer?`rpf ${u.latest} is available.${u.command?` Update with: ${u.command}`:``}`:u.checkedAt?`Up to date · checked ${yu(u.checkedAt)===`now`?`just now`:`${yu(u.checkedAt)} ago`}.`:`Current version of rpf.`:`Current version of rpf.`;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(NS,{title:`App`,children:[(0,x.jsx)(PS,{title:(0,x.jsxs)(`span`,{className:`inline-flex items-baseline gap-2`,children:[`Version`,(0,x.jsx)(Tb,{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)(ef,{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)(q,{size:`sm`,variant:`outline`,disabled:i.isPending||!r.data||!!u?.disabled,onClick:()=>i.mutate(),children:i.isPending?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Yb,{size:`xs`}),` Checking…`]}):i.data&&!i.data.newer&&i.data.latest?`Up to date`:`Check for updates`})}),(0,x.jsx)(PS,{title:`Welcome page`,description:`See your instances and AI providers, and start a first project.`,children:(0,x.jsx)(q,{size:`sm`,variant:`outline`,onClick:()=>a.mutate({done:!1},{onSuccess:()=>o({to:`/welcome`,search:{}})}),children:`Open`})}),u?.newer&&(0,x.jsx)(EQ,{st:u})]}),(0,x.jsx)(NS,{title:`Legal`,children:(0,x.jsx)(PS,{title:`Open-source licenses`,description:`Notices for the libraries bundled in Forge.`,children:(0,x.jsx)(q,{size:`sm`,variant:`outline`,onClick:()=>t(`licenses`),children:`View licenses`})})})]})}function SQ(){let e=U({...Au().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)(NS,{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)(am,{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)(o5,{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)(Tb,{label:`Search licenses`,children:(0,x.jsx)(q,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Search open-source licenses`,onClick:()=>i(!0),children:(0,x.jsx)(am,{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)(q,{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)(Id,{"aria-hidden":!0,className:G(`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)(Tb,{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)(df,{"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 CQ({level:e}){return e===`ok`?(0,x.jsx)(Bd,{className:`size-4 text-success-foreground`}):e===`warn`?(0,x.jsx)(Lm,{className:`size-4 text-warning-foreground`}):e===`fail`?(0,x.jsx)(Kd,{className:`size-4 text-destructive-foreground`}):(0,x.jsx)(qf,{className:`size-4 text-muted-foreground`})}function wQ(){let e=Au(),t=sQ(),n=U({...e.profiles.list.queryOptions(),retry:!1}),r=U({...e.projects.info.queryOptions({id:t}),enabled:!!t}),i=at(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)(NS,{title:`Doctor`,action:i.data&&(0,x.jsxs)(q,{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)(ef,{}),` `,s?`Copied`:`Copy as JSON`]}),children:[(0,x.jsxs)(PS,{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)(q,{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)(Yb,{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)(CQ,{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 TQ(){let e=Au(),t=C(),n=sQ(),r=U({...e.tools.skills.queryOptions({projectId:n||void 0}),retry:!1}),i=at(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)(NS,{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)(PS,{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)(NS,{title:t===`global`?`Installed for every project`:`Installed in this project`,action:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(q,{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)(q,{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)(q,{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)(PS,{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)(kb,{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 EQ({st:e}){let t=at(Au().about.runUpdate.mutationOptions()),[n,r]=b.useState([]);return b.useEffect(()=>{let e=e=>{let t=e.detail;t.line!==void 0&&r(e=>[...e,t.line].slice(-200))};return window.addEventListener(`forge:update`,e),()=>window.removeEventListener(`forge:update`,e)},[]),(0,x.jsx)(PS,{title:`Update to rpf ${e.latest}`,description:(0,x.jsxs)(x.Fragment,{children:[e.command?(0,x.jsxs)(x.Fragment,{children:[`Runs `,(0,x.jsx)(`code`,{className:`font-mono`,children:e.command}),` (`,e.installer,`).`]}):`Couldn't tell how rpf was installed: update it in a terminal.`,n.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:n.join(`
|
|
291
|
+
`)}),t.data&&(0,x.jsx)(`span`,{className:G(`mt-1 block`,t.data.code===0?`text-success-foreground`:`text-destructive-foreground`),children:t.data.code===0?`Updated. Restart Forge (Ctrl+C in its terminal, then rpf forge) to run the new version.`:`The update failed (exit ${t.data.code}).`})]}),children:(0,x.jsx)(q,{size:`sm`,disabled:!e.command||t.isPending||t.data?.code===0,onClick:()=>t.mutate(),children:t.isPending?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Yb,{size:`xs`}),` Updating…`]}):`Update`})})}var DQ=[{id:`general`,label:`General`,icon:lm,group:`Forge`},{id:`appearance`,label:`Appearance`,icon:Tp,group:`Forge`},{id:`providers`,label:`Providers and models`,icon:Sd,group:`Agent`},{id:`usage`,label:`Usage`,icon:Ad,group:`Agent`},{id:`instances`,label:`Instances`,icon:sm,group:`rpf`},{id:`projects`,label:`Projects`,icon:Tf,group:`rpf`},{id:`doctor`,label:`Doctor`,icon:Dm,group:`rpf`},{id:`skills`,label:`Skills`,icon:ym,group:`rpf`},{id:`keybindings`,label:`Keybindings`,icon:Yf,group:`More`},{id:`diffs`,label:`Diffs`,icon:_f,group:`More`},{id:`about`,label:`About and updates`,icon:qf,group:`More`},{id:`licenses`,label:`Open-source licenses`,icon:tm,group:`More`}];function OQ({section:e,onSection:t}){let n=[...new Set(DQ.map(e=>e.group))],[r,i]=b.useState(``),a=b.useRef(null),o=DQ,s=b.useMemo(()=>Object.fromEntries(DQ.map(e=>[e.id,e.label])),[]),c=OS(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(()=>{(kS(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=DQ.find(t=>t.id===e)||DQ[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)(am,{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)(Gm,{className:`size-3`})}):(0,x.jsx)(Ab,{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=DQ.find(t=>t.id===e.section)?.icon||lm;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:G(`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:G(`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:G(`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)(oQ,{})})]}),(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)(jQ,{}),g.id===`appearance`&&(0,x.jsx)(MQ,{}),g.id===`providers`&&(0,x.jsx)(RS,{}),g.id===`instances`&&(0,x.jsx)(tC,{}),g.id===`projects`&&(0,x.jsx)(uQ,{}),g.id===`keybindings`&&(0,x.jsx)(gQ,{}),g.id===`diffs`&&(0,x.jsx)(yQ,{}),g.id===`about`&&(0,x.jsx)(xQ,{}),g.id===`licenses`&&(0,x.jsx)(SQ,{}),g.id===`doctor`&&(0,x.jsx)(wQ,{}),g.id===`skills`&&(0,x.jsx)(TQ,{})]})})]})]})}function kQ({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 AQ({title:e,description:t,children:n}){return(0,x.jsxs)(`div`,{id:typeof e==`string`?SS(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 jQ(){let e=U(Au().meta.queryOptions());return(0,x.jsxs)(kQ,{title:`General`,children:[(0,x.jsx)(AQ,{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)(AQ,{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)(AQ,{title:`Version`,children:(0,x.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`rpf `,e.data?.version]})})]})}function MQ(){let e=Gu();return(0,x.jsx)(kQ,{title:`Appearance`,children:(0,x.jsx)(AQ,{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:()=>Wu({theme:t.id}),className:G(`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 NQ({section:e,onSection:t,onClose:n}){return(0,x.jsx)(aQ,{label:`Settings`,onClose:n,children:(0,x.jsx)(OQ,{section:e,onSection:t})})}var PQ=[`var(--primary)`,`#d97757`,`#4d9f8a`,`#8c7bd1`,`#5b9bbd`,`#c2a14d`,`#8b8b8b`];function FQ({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:G(`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 IQ({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 LQ({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 RQ({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`?FX:PX,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 zQ(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 BQ(){let e=Au(),[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`?FX:PX,u=(o?.connections||[]).map((e,t)=>({...e,label:o?.connectionNames[e.key]||e.key,color:PQ[t%PQ.length]})),d=zQ(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)(FQ,{value:t,onChange:n,options:[{id:`cost`,label:`Cost`},{id:`tokens`,label:`Tokens`}]}),(0,x.jsx)(FQ,{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)(oQ,{})]})]}),(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)(Yb,{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)(Tb,{label:`Excludes ${PX(s.unpricedTokens)} tokens of models without a price (set prices in Settings › Providers and models).`,children:(0,x.jsx)(qf,{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)(RQ,{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)(IQ,{label:`Processed tokens`,value:PX(s.input+s.output)}),(0,x.jsx)(IQ,{label:`Cached input`,value:PX(s.cachedInput)}),(0,x.jsx)(IQ,{label:`Uncached input`,value:PX(m)}),(0,x.jsx)(IQ,{label:`Output`,value:PX(s.output)}),(0,x.jsx)(IQ,{label:`Reasoning`,value:s.reasoning?PX(s.reasoning):`—`})]})]}),(0,x.jsxs)(`section`,{className:`grid gap-x-12 gap-y-8 lg:grid-cols-2`,children:[(0,x.jsx)(LQ,{label:`Tokens by type`,format:PX,segments:[{label:`Uncached input`,value:m,color:PQ[0]},{label:`Cached input`,value:s.cachedInput,color:PQ[2]},{label:`Output`,value:s.output,color:PQ[1]}]}),(0,x.jsx)(LQ,{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`:`Titles`,value:c(e),color:PQ[(t+3)%PQ.length]}))})]}),(0,x.jsx)(VQ,{title:`Models`,rows:(o?.models||[]).map(e=>({...e,name:e.model,sub:o?.connectionNames[e.connectionId]||e.connectionId})),metric:t}),(0,x.jsx)(VQ,{title:`Projects`,rows:(o?.projects||[]).map(e=>({...e,sub:``})),metric:t})]})})})]})}function VQ({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:PX(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?FX(e.cost):e.unpricedTokens?(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`no price`}):FX(0)})]},e.key)})})]})]})}function HQ({onClose:e}){return(0,x.jsx)(aQ,{label:`Usage`,onClose:e,children:(0,x.jsx)(BQ,{})})}var UQ={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}},WQ={start:`Start from`,instance:`Instance`,app:`App and update set`,portal:`Portal`,look:`Look and navigation`,folder:`Folder and extras`,review:`Review plan`};function GQ(e){return e===`new`?[`start`,`instance`,`app`,`portal`,`look`,`folder`,`review`]:[`start`,`instance`,`app`,`portal`,`folder`,`review`]}function KQ(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 qQ(e){return`${e.trim()||`Portal`} (React Portal)`.substring(0,80)}function JQ(e){let t=/^([a-z_]+): ([\s\S]*)$/.exec(e||``);return t?[t[1],t[2]]:[``,e||``]}var YQ={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 XQ(e){let t={app:e.app,updateSet:e.setMode===`new`?{create:e.setName.trim()||qQ(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 ZQ(){let e=Gu(),t=!!e.newProject;return(0,x.jsx)(Eb,{open:t,onOpenChange:e=>!e&&Wu({newProject:``}),children:t&&(0,x.jsx)(QQ,{preset:e.newProject===`choose`||!e.newProject?void 0:e.newProject},e.newProject)})}function QQ({preset:e}){let t=Au(),n=C(),r=Yi(),i=i8(),a=U(t.wizard.context.queryOptions()),o=U({...t.profiles.list.queryOptions(),retry:!1}),[s,c]=b.useState({...UQ,start:e||`new`}),l=e=>c(t=>({...t,...e})),u=GQ(s.start),[d,f]=b.useState(e?`instance`:`start`),p=u.indexOf(d),[m,h]=b.useState(``),g=at(t.wizard.plan.mutationOptions()),_=at(t.wizard.run.mutationOptions()),v=at(t.wizard.pull.mutationOptions()),y=at(t.wizard.retryPull.mutationOptions()),S=b.useMemo(()=>crypto.randomUUID(),[]),w=o.data?.profiles||[];b.useEffect(()=>{!s.profile&&w.length&&l({profile:o.data?.default||w[0].name})},[w.length]);let T=!!s.profile&&a.data?.available!==!1,E=U({...t.wizard.preflight.queryOptions({profile:s.profile}),enabled:T,retry:!1,staleTime:6e4}),D=U({...t.wizard.updateSets.queryOptions({profile:s.profile,appId:E.data?.apps.find(e=>e.scope===s.app)?.id||``}),enabled:T&&!!s.app&&!!E.data}),O=U({...t.wizard.portals.queryOptions({profile:s.profile}),enabled:T&&!!E.data});b.useEffect(()=>{if(E.data&&!s.app){let e=E.data.apps.find(e=>e.current&&!e.reactPortal)||E.data.apps.find(e=>!e.reactPortal);e&&l({app:e.scope})}},[E.data]),b.useEffect(()=>{let e=D.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})}},[D.data]);let k=s.start===`pull`?s.portal:s.slug,A=U({...t.wizard.folder.queryOptions(s.folderTouched&&s.folder?{path:s.folder}:{slug:k||`portal`}),enabled:!!a.data});b.useEffect(()=>{!s.folderTouched&&A.data&&l({folder:A.data.folder})},[A.data?.folder]);let j=U({...t.wizard.job.queryOptions({id:m}),enabled:!!m});b.useEffect(()=>{if(j.data?.state===`done`&&j.data.projectId){n.invalidateQueries({queryKey:t.projects.list.queryKey()});let e=j.data.projectId,i=setTimeout(()=>{Wu({newProject:``}),r({to:`/p/$projectId`,params:{projectId:e}})},700);return()=>clearTimeout(i)}},[j.data?.state,j.data?.projectId,r,n,t]);let[M,N]=JQ(E.error?.message),P=U({...t.wizard.slug.queryOptions({profile:s.profile,slug:s.slug}),enabled:T&&!!E.data&&s.start!==`pull`&&/^[a-z0-9][a-z0-9-]{1,39}$/.test(s.slug),staleTime:3e4}),F=()=>{switch(d){case`instance`:return s.profile?E.data?``:E.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)?P.data&&!P.data.available?`That slug is taken`:``:`The slug needs 2-40 lowercase letters, digits or dashes`:`Name the portal`;case`folder`:return s.folder?A.data&&!A.data.empty?`The folder is not empty`:``:`Pick a folder`;default:return``}},I=()=>{let e=u[p+1];e&&(e===`review`&&s.start!==`pull`&&g.mutate({profile:s.profile,answers:XQ(s),folder:s.folder,extras:s.extras}),f(e))},L=()=>p>0&&f(u[p-1]),R=async()=>{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:XQ(s),folder:s.folder,extras:s.extras,planHash:e,requestId:S});h(t.jobId)},z=F(),B=!!m,V=E.data?.apps.find(e=>e.scope===s.app)?.reactPortal;return(0,x.jsxs)(I6,{children:[(0,x.jsx)(D6,{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)(F6,{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)(G6,{className:`text-sm font-medium`,children:`New project`}),(0,x.jsx)(O6,{"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)(Gm,{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||B&&t<=p,r=e===d&&!B;return(0,x.jsx)(`li`,{children:(0,x.jsxs)(`button`,{type:`button`,disabled:B||t>p,onClick:()=>f(e),className:G(`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&&!B&&`hover:bg-accent/60`),children:[(0,x.jsx)(`span`,{className:G(`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)(Md,{className:`size-3`}):t+1}),WQ[e]]})},e)})}),(0,x.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:B?(0,x.jsx)(l$,{job:j.data,onRetry:()=>y.mutate({jobId:m}),retrying:y.isPending,onBack:()=>{h(``),f(`review`)}}):a.data?.available===!1?(0,x.jsxs)($Q,{icon:qf,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)(t$,{value:s.start,onPick:e=>{l({start:e,portal:``}),f(`instance`)}}):d===`instance`?(0,x.jsx)(n$,{profiles:w,profile:s.profile,onProfile:e=>l({profile:e,app:``,setId:``}),pre:E.data,loading:E.isLoading&&!!s.profile,code:M,message:N,onAddInstance:()=>i(`instances`),onRetry:()=>E.refetch()}):d===`app`?(0,x.jsx)(r$,{d:s,set:l,apps:E.data?.apps||[],sets:D.data||[],loadingSets:D.isLoading,canCreateSets:s.start!==`pull`&&!!E.data?.canCreateSets}):d===`portal`?(0,x.jsx)(i$,{d:s,set:l,portals:O.data||[],loading:O.isLoading,slugCheck:P.data,slugChecking:P.isFetching}):d===`look`?(0,x.jsx)(a$,{d:s,set:l,profile:s.profile}):d===`folder`?(0,x.jsx)(s$,{d:s,set:l,free:A.data}):(0,x.jsx)(c$,{d:s,sets:D.data||[],plan:g.data,error:g.error?.message,planning:g.isPending,reactPortalApp:!!V,onReplan:()=>g.mutate({profile:s.profile,answers:XQ(s),folder:s.folder,extras:s.extras})})})]}),!B&&(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-t bg-muted/72 px-6 py-3`,children:[z&&d!==`start`&&d!==`review`&&(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:z}),(0,x.jsxs)(`div`,{className:`ms-auto flex gap-2`,children:[p>0&&(0,x.jsx)(q,{variant:`outline`,onClick:L,children:`Back`}),d===`review`?(0,x.jsx)(q,{disabled:s.start!==`pull`&&!g.data?.plan?.hash||g.isPending||_.isPending||v.isPending,onClick:R,children:s.start===`pull`?`Pull and open`:`Create and open`}):d!==`start`&&(0,x.jsx)(q,{disabled:!!z,onClick:I,children:`Next`})]})]}),(_.error||v.error)&&!B&&(0,x.jsx)(`div`,{className:`border-t px-6 py-2 text-xs text-destructive-foreground`,children:JQ((_.error||v.error)?.message)[1]})]})]})}function $Q({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 e$({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 t$({value:e,onPick:t}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(e$,{title:`How do you want to start?`}),(0,x.jsx)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[{id:`new`,icon:ym,title:`New portal`,body:`A draft on the instance from a template or empty (rpf init).`},{id:`pull`,icon:sf,title:`Pull a portal`,body:`Work on an existing portal as files. Any portal, React Portal ones included.`},{id:`copy`,icon:ef,title:`Copy a portal`,body:`A new draft copied from any portal, then pulled. Pages are optional.`}].map(n=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>t(n.id),className:G(`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 n$({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)(e$,{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)(q,{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:f5}),(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)(Yb,{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)(Md,{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)(Wd,{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}),YQ[a]&&(0,x.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:YQ[a]}),(0,x.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,x.jsx)(q,{size:`xs`,variant:`outline`,onClick:c,children:`Check again`}),a===`no_profile`&&(0,x.jsx)(q,{size:`xs`,variant:`outline`,onClick:s,children:`Open Instances`})]})]})]}):null})]})}function r$({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)(e$,{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)(u5,{label:`Application`,children:(0,x.jsx)(d5,{"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)(Lm,{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:f5,checked:e.setMode===`existing`,onChange:()=>t({setMode:`existing`})}),`An in-progress set`]}),(0,x.jsx)(d5,{"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)(o5,{size:`compact`,className:`w-80`,disabled:e.setMode!==`new`,"aria-label":`New update set name`,placeholder:qQ(e.name||`Portal name`),value:e.setName,maxLength:80,onChange:e=>t({setName:e.target.value})})]})]})]})]})}function i$({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)(u5,{label:`Portal name`,children:(0,x.jsx)(o5,{autoFocus:!0,placeholder:`HR Portal`,value:e.name,maxLength:100,onChange:n=>t({name:n.target.value,...e.slugTouched?{}:{slug:KQ(n.target.value)}})})}),(0,x.jsx)(u5,{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)(o5,{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)(u5,{label:`Description (optional)`,className:`sm:col-span-2`,children:(0,x.jsx)(s5,{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)(am,{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)(o5,{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:f5,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)(kb,{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)(qf,{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)(e$,{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)(e$,{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)(c5,{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)(e$,{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:f5,checked:e.sourceKind===`template`,onChange:()=>t({sourceKind:`template`})}),`A template`,(0,x.jsx)(d5,{"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:f5,checked:e.sourceKind===`empty`,onChange:()=>t({sourceKind:`empty`})}),`Empty: a layout, one empty Home page, empty menus`]})]})]})}function a$({d:e,set:t,profile:n}){let r=Au(),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:f5,checked:e.themeMode===n,onChange:()=>t({themeMode:n})}),r]});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(e$,{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)(u5,{label:`Layout`,children:(0,x.jsx)(d5,{"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:G(`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)(o5,{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)(d5,{"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)(d5,{"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)(o$,{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)(c5,{checked:e.themeCopy,onCheckedChange:e=>t({themeCopy:!!e})}),` Make an editable copy of the theme for this portal`]})]}),e.sourceKind!==`empty`&&(0,x.jsx)(u5,{label:`Brand icon (optional)`,description:`A Lucide icon name for the sidebar, such as briefcase.`,children:(0,x.jsx)(o5,{size:`compact`,mono:!0,className:`w-56`,value:e.icon,onChange:e=>t({icon:e.target.value.toLowerCase()})})})]})]})}function o$({tokens:e,contrast:t,error:n,loading:r}){if(n)return(0,x.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:JQ(n)[1]});if(!e)return r?(0,x.jsx)(Yb,{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 s$({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)(c5,{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)(e$,{title:`Folder and extras`,children:`The portal is pulled into this folder; it must be empty or new.`}),(0,x.jsx)(u5,{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)(o5,{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 c$({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)(e$,{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)(e$,{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)(Yb,{size:`sm`}),` Planning on the instance…`]}):r?(0,x.jsxs)(`div`,{className:`flex gap-2 text-sm`,children:[(0,x.jsx)(Wd,{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:JQ(r)[1]}),(0,x.jsx)(q,{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)(kb,{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)(Lm,{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 l$({job:e,onRetry:t,retrying:n,onBack:r}){let i=e?.state||`running`;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(e$,{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:G(`flex gap-2`,r&&`text-destructive-foreground`),children:[r?(0,x.jsx)(Wd,{className:`mt-0.5 size-3 shrink-0`}):(0,x.jsx)(Md,{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)(Yb,{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)(q,{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:JQ(e?.error)[1]}),(0,x.jsx)(q,{size:`sm`,variant:`outline`,className:`mt-2`,onClick:r,children:`Back to the plan`})]})]})}var u$=[[`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 d$(){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)(U6,{open:e,onOpenChange:t,children:e&&(0,x.jsx)(f$,{onClose:()=>t(!1)})})}function f$({onClose:e}){let t=Au(),n=Yi(),r=Gu(),i=i8(),a=Fa({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:xm,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:zm,run:h(()=>Wu({pushOpen:!0}))}]:[],{id:`project.new`,group:`Actions`,title:`New project…`,detail:`new, pull or copy a portal`,icon:Cf,run:h(()=>Wu({newProject:`choose`}))},{id:`panel`,group:`Actions`,title:r.panelOpen?`Hide the right panel`:`Show the right panel`,icon:jp,command:`rightPanel.toggle`,run:h(()=>Wu({panelOpen:!r.panelOpen}))},{id:`terminal`,group:`Actions`,title:r.drawerOpen?`Hide the terminal`:`Show the terminal`,icon:Dp,command:`terminal.toggle`,run:h(()=>Wu({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`)?km:_p,run:h(()=>Wu({theme:document.documentElement.classList.contains(`dark`)?`light`:`dark`}))},{id:`usage`,group:`Actions`,title:`Usage`,icon:Ad,command:`usage.open`,run:h(()=>i(`usage`))},{id:`doctor`,group:`Actions`,title:`Run doctor`,icon:Dm,run:h(()=>i(`doctor`))},...(s.data||[]).map(e=>({id:`p:${e.id}`,group:`Projects`,title:e.name,detail:e.path,icon:Df,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:dp,run:h(()=>n({to:`/p/$projectId/c/$chatId`,params:{projectId:e.projectId,chatId:e.id}}))})),...u$.map(([e,t])=>({id:`s:${e}`,group:`Settings`,title:t,detail:`Settings`,icon:dm,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&&ju.find(t=>t.id===e);return t?Iu(Mu(t,l)):``},T=``;return(0,x.jsxs)(I6,{children:[(0,x.jsx)(D6,{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)(F6,{"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)(am,{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:G(`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:G(`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 p$=new Ue({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1}}});function m$(e){let t=Gu(),n=Yi(),r=mi(),i=i8(),a=Fa({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 Wu({sidebarOpen:!t.sidebarOpen});case`rightPanel.toggle`:return Wu({panelOpen:!t.panelOpen});case`terminal.toggle`:return Wu({drawerOpen:!t.drawerOpen});case`preview.toggle`:return Wu(t.panelOpen&&t.panelTab===`preview`?{panelOpen:!1}:{panelOpen:!0,panelTab:`preview`});case`diff.toggle`:return Wu(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=Pu(t);if(!r)return;let i=!!n&&(/INPUT|TEXTAREA|SELECT/.test(n.tagName)||n.isContentEditable),a=ju.find(e=>Mu(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 h$(){let e=Au(),t=Yi(),n=Fa({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 g$(){let e=Gu();Ru();let t=U(Au().settings.get.queryOptions()),n=Ji({strict:!1}),r=i8(),i=Fa({select:e=>e.location.pathname})===`/welcome`;m$(t.data?.keybindings||[]),h$();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)(u8,{}),(0,x.jsx)(`main`,{className:`flex min-w-0 flex-1 bg-background`,children:(0,x.jsx)(Ta,{})}),(0,x.jsx)(ZQ,{}),(0,x.jsx)(d$,{}),n.settings===`usage`?(0,x.jsx)(HQ,{onClose:()=>r(null)}):n.settings&&(0,x.jsx)(NQ,{section:n.settings,onSection:r,onClose:()=>r(null)})]})}var _$=ha({component:g$,validateSearch:e=>typeof e.settings==`string`?{settings:e.settings}:{}}),v$=pa({getParentRoute:()=>_$,path:`/`,component:x8}),y$=pa({getParentRoute:()=>_$,path:`/p/$projectId`,component:function(){let{projectId:e}=qi({from:`/p/$projectId`});return(0,x.jsx)(rQ,{projectId:e})}}),b$=pa({getParentRoute:()=>_$,path:`/p/$projectId/c/$chatId`,component:function(){let{projectId:e,chatId:t}=qi({from:`/p/$projectId/c/$chatId`});return(0,x.jsx)(rQ,{projectId:e,chatId:t})}}),x$=pa({getParentRoute:()=>_$,path:`/welcome`,component:uC}),S$=pa({getParentRoute:()=>_$,path:`/settings/$section`,beforeLoad:({params:e})=>{throw sn({to:`/`,search:{settings:e.section}})}}),C$=ja({routeTree:_$.addChildren([v$,x$,y$,b$,S$])});Ku(localStorage.getItem(`forge.theme`)||`system`),Ha(),(0,Ia.createRoot)(document.getElementById(`root`)).render((0,x.jsx)(b.StrictMode,{children:(0,x.jsx)(w,{client:p$,children:(0,x.jsx)(ku,{trpcClient:Ou,queryClient:p$,children:(0,x.jsx)(wb,{delay:400,children:(0,x.jsx)(Pa,{router:C$})})})})}));export{nR as $,Ye as $t,$q as A,lp as At,uJ as B,Xu as Bt,SJ as C,A4 as Ct,_J as D,Fm as Dt,pJ as E,q as Et,aJ as F,Qd as Ft,Xq as G,G as Gt,Kq as H,Ju as Ht,sJ as I,Id as It,tJ as J,tt as Jt,Yq as K,U as Kt,iJ as L,Md as Lt,oJ as M,hf as Mt,lJ as N,sf as Nt,vJ as O,Nm as Ot,eJ as P,ef as Pt,tR as Q,Ze as Qt,rJ as R,gd as Rt,NJ as S,b3 as St,yJ as T,i1 as Tt,Zq as U,Gu as Ut,Jq as V,Wu as Vt,Qq as W,Au as Wt,bW as X,Xe as Xt,nJ as Y,et as Yt,rR as Z,Qe as Zt,$J as _,Yb as _t,TZ as a,B as an,L9 as at,HJ as b,G3 as bt,rZ as c,y as cn,V9 as ct,nZ as d,o as dn,n9 as dt,Ke as en,QL as et,sZ as f,s as fn,Z7 as ft,XJ as g,s5 as gt,oY as h,x5 as ht,EZ as i,k as in,W9 as it,cJ as j,Tf as jt,hJ as k,Yp as kt,iZ as l,h as ln,r9 as lt,uZ as m,J7 as mt,CZ as n,_e as nn,hL as nt,DZ as o,V as on,R9 as ot,aZ as p,l as pn,K7 as pt,qq as q,$e as qt,wZ as r,pe as rn,G9 as rt,bZ as s,C as sn,z9 as st,OZ as t,je as tn,xL as tt,oZ as u,d as un,u9 as ut,qJ as v,Tb as vt,bJ as w,D4 as wt,VJ as x,I3 as xt,GJ as y,Y3 as yt,Gq as z,K as zt};
|