pinomad 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-0dh2k3er.js +43 -0
- package/dist/{chunk-47ff1d1t.js → chunk-1mjbt2z2.js} +191 -11
- package/dist/{chunk-7wj0jh3t.js → chunk-1rdbnvy6.js} +1 -1
- package/dist/{chunk-ksfxqd8s.js → chunk-35szq73k.js} +2682 -459
- package/dist/{chunk-mnmqyq7d.js → chunk-5j7ybhjj.js} +1984 -333
- package/dist/{chunk-agq4tn9r.js → chunk-5pv0g1nj.js} +12 -10
- package/dist/{chunk-7mn38n4f.js → chunk-63ymn5c9.js} +2 -2
- package/dist/{chunk-nppgxh6c.js → chunk-6j6hkfbj.js} +8 -4
- package/dist/{chunk-pqe7q1s7.js → chunk-6vbp1vva.js} +2 -1
- package/dist/{chunk-g3ahp7b9.js → chunk-9trbbz4r.js} +1 -1
- package/dist/{chunk-gg2dcqbg.js → chunk-b0nwq1dt.js} +29 -12
- package/dist/chunk-dsr19q5h.js +23 -0
- package/dist/{chunk-41q0saz0.js → chunk-e53c0s8z.js} +9 -7
- package/dist/{chunk-np4jd070.js → chunk-e59k3bmz.js} +307 -56
- package/dist/chunk-eerpgvy9.js +315 -0
- package/dist/chunk-eewxy4cp.js +240 -0
- package/dist/{chunk-vqkb70d7.js → chunk-evbv1fkn.js} +3 -3
- package/dist/{chunk-vx7dy07y.js → chunk-ex5yr09h.js} +11 -6
- package/dist/{chunk-t91zt5f0.js → chunk-hg9gs396.js} +1 -1
- package/dist/{chunk-aqj9wfmb.js → chunk-mtkvft88.js} +1 -1
- package/dist/{chunk-t5abqsva.js → chunk-mxwcnnkg.js} +15 -305
- package/dist/{chunk-5qf1grkk.js → chunk-w927q9m1.js} +52 -16
- package/dist/pinomad.js +12 -12
- package/package.json +16 -11
- package/web/assets/{core-DnpzcQzs.js → core-BWHGsFpV.js} +1 -1
- package/web/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
- package/web/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
- package/web/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
- package/web/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/web/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
- package/web/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
- package/web/assets/{highlighted-diff-Dn5ifsvK.js → highlighted-diff-DJ7KZCpS.js} +2 -2
- package/web/assets/{highlights-DnHv6NBM.js → highlights-CyEmo6OI.js} +1 -1
- package/web/assets/{highlights-themes-CUdrlZk3.js → highlights-themes-CSNkBojy.js} +1 -1
- package/web/assets/index-C_qkbyL7.css +1 -0
- package/web/assets/index-DefQtCI2.js +396 -0
- package/web/assets/{shiki-BuPP5HCg.js → shiki-BzCmRG-v.js} +2 -2
- package/web/assets/{shiki-langs-FJk0v0Ga.js → shiki-langs-DOkjyV4d.js} +1 -1
- package/web/assets/{stream-tokenizer-Bl6bisIa.js → stream-tokenizer-CBPqFe4Z.js} +1 -1
- package/web/assets/{theming-themes-BL_CC-Mm.js → theming-themes-wKVca0aB.js} +1 -1
- package/web/assets/{xterm-view-ZsuzJb2C.js → xterm-view-CKa1-QCM.js} +12 -12
- package/web/index.html +3 -2
- package/web/theme-boot.js +11 -0
- package/dist/chunk-42nqtx5r.js +0 -22
- package/dist/chunk-jeqsdcj1.js +0 -96
- package/web/assets/index-BV0ecolo.css +0 -1
- package/web/assets/index-DNsTTgPE.js +0 -396
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/xterm-view-ZsuzJb2C.js","assets/xterm-view-6GBZ9nXN.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var cI=Object.defineProperty;var Tb=e=>{throw TypeError(e)};var uI=(e,t,n)=>t in e?cI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var be=(e,t,n)=>uI(e,typeof t!="symbol"?t+"":t,n),Nm=(e,t,n)=>t.has(e)||Tb("Cannot "+n);var S=(e,t,n)=>(Nm(e,t,"read from private field"),n?n.call(e):t.get(e)),ue=(e,t,n)=>t.has(e)?Tb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,s)=>(Nm(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),C=(e,t,n)=>(Nm(e,t,"access private method"),n);var Cn=(e,t,n,s)=>({set _(r){W(e,t,r,n)},get _(){return S(e,t,s)}});function dI(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const i=Object.getOwnPropertyDescriptor(s,r);i&&Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function fI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kj={exports:{}},xg={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var hI=Symbol.for("react.transitional.element"),pI=Symbol.for("react.fragment");function bj(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:hI,type:e,key:s,ref:t!==void 0?t:null,props:n}}xg.Fragment=pI;xg.jsx=bj;xg.jsxs=bj;kj.exports=xg;var o=kj.exports,wj={exports:{}},Ie={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react.production.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var C4=Symbol.for("react.transitional.element"),xI=Symbol.for("react.portal"),gI=Symbol.for("react.fragment"),mI=Symbol.for("react.strict_mode"),yI=Symbol.for("react.profiler"),vI=Symbol.for("react.consumer"),kI=Symbol.for("react.context"),bI=Symbol.for("react.forward_ref"),wI=Symbol.for("react.suspense"),jI=Symbol.for("react.memo"),jj=Symbol.for("react.lazy"),SI=Symbol.for("react.activity"),CI=Symbol.for("react.view_transition"),zb=Symbol.iterator;function EI(e){return e===null||typeof e!="object"?null:(e=zb&&e[zb]||e["@@iterator"],typeof e=="function"?e:null)}var Sj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cj=Object.assign,Ej={};function _d(e,t,n){this.props=e,this.context=t,this.refs=Ej,this.updater=n||Sj}_d.prototype.isReactComponent={};_d.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")};_d.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $j(){}$j.prototype=_d.prototype;function E4(e,t,n){this.props=e,this.context=t,this.refs=Ej,this.updater=n||Sj}var $4=E4.prototype=new $j;$4.constructor=E4;Cj($4,_d.prototype);$4.isPureReactComponent=!0;var Nb=Array.isArray;function $y(){}var $t={H:null,A:null,T:null,S:null},Aj=Object.prototype.hasOwnProperty;function A4(e,t,n){var s=n.ref;return{$$typeof:C4,type:e,key:t,ref:s!==void 0?s:null,props:n}}function $I(e,t){return A4(e.type,t,e.props)}function M4(e){return typeof e=="object"&&e!==null&&e.$$typeof===C4}function AI(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var _b=/\/+/g;function _m(e,t){return typeof e=="object"&&e!==null&&e.key!=null?AI(""+e.key):t.toString(36)}function MI(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then($y,$y):(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 nu(e,t,n,s,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case C4:case xI:a=!0;break;case jj:return a=e._init,nu(a(e._payload),t,n,s,r)}}if(a)return r=r(e),a=s===""?"."+_m(e,0):s,Nb(r)?(n="",a!=null&&(n=a.replace(_b,"$&/")+"/"),nu(r,t,n,"",function(u){return u})):r!=null&&(M4(r)&&(r=$I(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(_b,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=s===""?".":s+":";if(Nb(e))for(var c=0;c<e.length;c++)s=e[c],i=l+_m(s,c),a+=nu(s,t,n,i,r);else if(c=EI(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,i=l+_m(s,c++),a+=nu(s,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return nu(MI(e),t,n,s,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function Fh(e,t,n){if(e==null)return e;var s=[],r=0;return nu(e,s,"","",function(i){return t.call(n,i,r++)}),s}function TI(e){if(e._status===-1){var t=e._result,n=t();n.then(function(s){(e._status===0||e._status===-1)&&(e._status=1,e._result=s,n.status===void 0&&(n.status="fulfilled",n.value=s))},function(s){(e._status===0||e._status===-1)&&(e._status=2,e._result=s,n.status===void 0&&(n.status="rejected",n.reason=s))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var Rb=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!==null&&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 Mj(e){var t=$t.T,n={};n.types=t!==null?t.types:null,$t.T=n;try{var s=e(),r=$t.S;r!==null&&r(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then($y,Rb)}catch(i){Rb(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),$t.T=t}}function Tj(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 Mj(Tj.bind(null,e))}var zI={map:Fh,forEach:function(e,t,n){Fh(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fh(e,function(){t++}),t},toArray:function(e){return Fh(e,function(t){return t})||[]},only:function(e){if(!M4(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ie.Activity=SI;Ie.Children=zI;Ie.Component=_d;Ie.Fragment=gI;Ie.Profiler=yI;Ie.PureComponent=E4;Ie.StrictMode=mI;Ie.Suspense=wI;Ie.ViewTransition=CI;Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$t;Ie.__COMPILER_RUNTIME={__proto__:null,c:function(e){return $t.H.useMemoCache(e)}};Ie.addTransitionType=Tj;Ie.cache=function(e){return function(){return e.apply(null,arguments)}};Ie.cacheSignal=function(){return null};Ie.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=Cj({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Aj.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(s[i]=t[i]);var i=arguments.length-2;if(i===1)s.children=n;else if(1<i){for(var a=Array(i),l=0;l<i;l++)a[l]=arguments[l+2];s.children=a}return A4(e.type,r,s)};Ie.createContext=function(e){return e={$$typeof:kI,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:vI,_context:e},e};Ie.createElement=function(e,t,n){var s,r={},i=null;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)Aj.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(s in a=e.defaultProps,a)r[s]===void 0&&(r[s]=a[s]);return A4(e,i,r)};Ie.createRef=function(){return{current:null}};Ie.forwardRef=function(e){return{$$typeof:bI,render:e}};Ie.isValidElement=M4;Ie.lazy=function(e){return{$$typeof:jj,_payload:{_status:-1,_result:e},_init:TI}};Ie.memo=function(e,t){return{$$typeof:jI,type:e,compare:t===void 0?null:t}};Ie.startTransition=Mj;Ie.unstable_useCacheRefresh=function(){return $t.H.useCacheRefresh()};Ie.use=function(e){return $t.H.use(e)};Ie.useActionState=function(e,t,n){return $t.H.useActionState(e,t,n)};Ie.useCallback=function(e,t){return $t.H.useCallback(e,t)};Ie.useContext=function(e){return $t.H.useContext(e)};Ie.useDebugValue=function(){};Ie.useDeferredValue=function(e,t){return $t.H.useDeferredValue(e,t)};Ie.useEffect=function(e,t){return $t.H.useEffect(e,t)};Ie.useEffectEvent=function(e){return $t.H.useEffectEvent(e)};Ie.useId=function(){return $t.H.useId()};Ie.useImperativeHandle=function(e,t,n){return $t.H.useImperativeHandle(e,t,n)};Ie.useInsertionEffect=function(e,t){return $t.H.useInsertionEffect(e,t)};Ie.useLayoutEffect=function(e,t){return $t.H.useLayoutEffect(e,t)};Ie.useMemo=function(e,t){return $t.H.useMemo(e,t)};Ie.useOptimistic=function(e,t){return $t.H.useOptimistic(e,t)};Ie.useReducer=function(e,t,n){return $t.H.useReducer(e,t,n)};Ie.useRef=function(e){return $t.H.useRef(e)};Ie.useState=function(e){return $t.H.useState(e)};Ie.useSyncExternalStore=function(e,t,n){return $t.H.useSyncExternalStore(e,t,n)};Ie.useTransition=function(){return $t.H.useTransition()};Ie.version="19.3.0";wj.exports=Ie;var h=wj.exports;const gg=fI(h),zj=dI({__proto__:null,default:gg},[h]);var af={},Ib;function NI(){if(Ib)return af;Ib=1,Object.defineProperty(af,"__esModule",{value:!0}),af.styleq=void 0;var e=new WeakMap,t="$$css";function n(r){var i,a,l;return r!=null&&(i=r.disableCache===!0,a=r.disableMix===!0,l=r.transform),function(){for(var u=[],d="",f=null,p="",x=i?null:e,g=new Array(arguments.length),v=0;v<arguments.length;v++)g[v]=arguments[v];for(;g.length>0;){var y=g.pop();if(!(y==null||y===!1)){if(Array.isArray(y)){for(var m=0;m<y.length;m++)g.push(y[m]);continue}var k=l!=null?l(y):y;if(k.$$css!=null){var b="";if(x!=null&&x.has(k)){var j=x.get(k);j!=null&&(b=j[0],p=j[2],u.push.apply(u,j[1]),x=j[3])}else{var A=[];for(var M in k){var T=k[M];if(M===t){var z=k[M];z!==!0&&(p=p?z+"; "+p:z);continue}typeof T=="string"||T===null?u.includes(M)||(u.push(M),x!=null&&A.push(M),typeof T=="string"&&(b+=b?" "+T:T)):console.error("styleq: ".concat(M," typeof ").concat(String(T),' is not "string" or "null".'))}if(x!=null){var $=new WeakMap;x.set(k,[b,A,p,$]),x=$}}b&&(d=d?b+" "+d:b)}else if(a)f==null&&(f={}),f=Object.assign({},k,f);else{var E=null;for(var N in k){var _=k[N];_!==void 0&&(u.includes(N)||(_!=null&&(f==null&&(f={}),E==null&&(E={}),E[N]=_),u.push(N),x=null))}E!=null&&(f=Object.assign(E,f))}}}var R=[d,f,p];return R}}var s=af.styleq=n();return s.factory=n,af}var _I=NI();function G(...e){const[t,n,s]=_I.styleq(e),r={};return t!=null&&t!==""&&(r.className=t),n!=null&&Object.keys(n).length>0&&(r.style=n),s!=null&&s!==""&&(r["data-style-src"]=s),r}const RI={"--color-accent":"light-dark(#0064E0, #2694FE)","--color-accent-muted":"light-dark(#0082FB33, #0082FB3F)","--color-on-accent":"light-dark(#FFFFFF, #FFFFFF)","--color-neutral":"light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2))","--color-background-surface":"light-dark(#FFFFFF, #1F1F22)","--color-background-body":"light-dark(#F1F4F7, #111112)","--color-overlay":"light-dark(#01122866, #11111299)","--color-overlay-hover":"light-dark(#0536590C, #FFFFFF0C)","--color-overlay-pressed":"light-dark(#05365919, #FFFFFF19)","--color-background-muted":"light-dark(#0536590C, #1111127F)","--color-text-primary":"light-dark(#0A1317, #DFE2E5)","--color-text-secondary":"light-dark(#4E606F, #AAAFB5)","--color-text-disabled":"light-dark(#A4B0BC, #6F747C)","--color-text-accent":"light-dark(#0064E0, #3E9EFB)","--color-on-dark":"light-dark(#FFFFFF, #FFFFFF)","--color-on-light":"light-dark(#000000, #000000)","--color-icon-accent":"light-dark(#0064E0, #2694FE)","--color-icon-primary":"light-dark(#0A1317, #DFE2E5)","--color-icon-secondary":"light-dark(#4E606F, #AAAFB5)","--color-icon-disabled":"light-dark(#A4B0BC, #6F747C)","--color-background-card":"light-dark(#FFFFFF, #1F1F22)","--color-background-popover":"light-dark(#FFFFFF, #28292C)","--color-background-inverted":"light-dark(#0A1317, #FFFFFF)","--color-background-error-inverted":"light-dark(#AA071E, #E3193B)","--color-success":"light-dark(#0D8626, #0D8626)","--color-success-muted":"light-dark(#0B991F33, #0B991F3F)","--color-on-success":"light-dark(#FFFFFF, #FFFFFF)","--color-error":"light-dark(#E3193B, #F5394F)","--color-error-muted":"light-dark(#E3193B33, #F5394F3F)","--color-on-error":"light-dark(#FFFFFF, #FFFFFF)","--color-warning":"light-dark(#E9AF08, #F2C00B)","--color-warning-muted":"light-dark(#E2A40033, #E2A4003F)","--color-on-warning":"light-dark(#0A1317, #0A1317)","--color-border":"light-dark(#05365919, #F2F4F619)","--color-border-emphasized":"light-dark(#CCD3DB, #494D53)","--color-skeleton":"light-dark(#CCD3DB, #5A5E66)","--color-track":"light-dark(#CCD3DB, #5A5E66)","--color-shadow":"light-dark(rgba(5, 54, 89, 0.1), rgba(0, 0, 0, 0.3))","--color-tint-hover":"light-dark(black, white)","--color-background-blue":"light-dark(#0171E333, #0171E333)","--color-border-blue":"light-dark(#0064E0, #2694FE)","--color-icon-blue":"light-dark(#0064E0, #2694FE)","--color-text-blue":"light-dark(#042F97, #AFD7FF)","--color-background-cyan":"light-dark(#03A7D733, #03A7D733)","--color-border-cyan":"light-dark(#089DD0, #0171A4)","--color-icon-cyan":"light-dark(#00ACC1, #26C6DA)","--color-text-cyan":"light-dark(#014975, #A1EEF9)","--color-background-gray":"light-dark(#0A131733, #666A724C)","--color-border-gray":"light-dark(#647685, #748695)","--color-icon-gray":"light-dark(#4E606F, #AAAFB5)","--color-text-gray":"light-dark(#0A1317, #E7EAED)","--color-background-green":"light-dark(#24BB5E33, #24BB5E33)","--color-border-green":"light-dark(#0D8626, #0B991F)","--color-icon-green":"light-dark(#0D8626, #26A756)","--color-text-green":"light-dark(#09441F, #A5F690)","--color-background-orange":"light-dark(#F2790233, #F2790233)","--color-border-orange":"light-dark(#EB6E00, #B34A01)","--color-icon-orange":"light-dark(#E9690B, #FB8C00)","--color-text-orange":"light-dark(#6B2203, #FDB876)","--color-background-pink":"light-dark(#E638B333, #E638B333)","--color-border-pink":"light-dark(#F351C0, #C02294)","--color-icon-pink":"light-dark(#C2185B, #EC407A)","--color-text-pink":"light-dark(#650053, #FEADE3)","--color-background-purple":"light-dark(#7952FF33, #7952FF33)","--color-border-purple":"light-dark(#9081FF, #7340FE)","--color-icon-purple":"light-dark(#5B08D8, #7952FF)","--color-text-purple":"light-dark(#3E0697, #B3B0FE)","--color-background-red":"light-dark(#E3193B33, #E3193B33)","--color-border-red":"light-dark(#E3193B, #F5394F)","--color-icon-red":"light-dark(#D31130, #E3193B)","--color-text-red":"light-dark(#7B0210, #FFB2B8)","--color-background-teal":"light-dark(#0DB7AF33, #0DB7AF33)","--color-border-teal":"light-dark(#08A3A3, #08767D)","--color-icon-teal":"light-dark(#009688, #26A69A)","--color-text-teal":"light-dark(#083943, #40DCCD)","--color-background-yellow":"light-dark(#E2A40033, #E2A40033)","--color-border-yellow":"light-dark(#C58600, #B47700)","--color-icon-yellow":"light-dark(#FBC02D, #FFEE58)","--color-text-yellow":"light-dark(#753F07, #FBCE03)"},II={"--spacing-0":"0px","--spacing-0-5":"2px","--spacing-1":"4px","--spacing-1-5":"6px","--spacing-2":"8px","--spacing-3":"12px","--spacing-4":"16px","--spacing-5":"20px","--spacing-6":"24px","--spacing-7":"28px","--spacing-8":"32px","--spacing-9":"36px","--spacing-10":"40px","--spacing-11":"44px","--spacing-12":"48px"},wr={"--spacing-1":"var(--spacing-1)","--spacing-2":"var(--spacing-2)"},LI={"--size-element-sm":"28px","--size-element-md":"32px","--size-element-lg":"36px"},OI={"--radius-none":"0px","--radius-inner":"4px","--radius-element":"8px","--radius-container":"12px","--radius-page":"28px","--radius-chat":"28px","--radius-full":"9999px"},DI={"--shadow-low":"0px 1px 1px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))","--shadow-med":"0px 1px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 12px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))","--shadow-high":"0px 2px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 8px 24px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3))","--shadow-inset-hover":"inset 0px 0px 0px 2px light-dark(rgba(5, 54, 89, 0.15), rgba(223, 226, 229, 0.2))","--shadow-inset-selected":"inset 0px 0px 0px 2px rgba(1, 113, 227, 0.5)","--shadow-inset-success":"inset 0px 0px 0px 2px rgba(38, 167, 86, 0.3)","--shadow-inset-warning":"inset 0px 0px 0px 2px rgba(226, 164, 0, 0.3)","--shadow-inset-error":"inset 0px 0px 0px 2px rgba(227, 25, 59, 0.3)"},BI={"--duration-fast-min":"130ms","--duration-fast":"175ms","--duration-fast-max":"230ms","--duration-medium-min":"310ms","--duration-medium":"410ms","--duration-medium-max":"550ms","--duration-slow-min":"730ms","--duration-slow":"975ms","--duration-slow-max":"1300ms"},HI={"--ease-standard":"cubic-bezier(0.24, 1, 0.4, 1)"},qI={"--font-family-body":'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',"--font-family-code":'"SF Mono", Monaco, Consolas, monospace',"--font-family-heading":'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'},PI={"--font-size-4xs":"0.375rem","--font-size-3xs":"0.4375rem","--font-size-2xs":"0.5rem","--font-size-xs":"0.625rem","--font-size-sm":"0.75rem","--font-size-base":"0.875rem","--font-size-lg":"1.0625rem","--font-size-xl":"1.25rem","--font-size-2xl":"1.5rem","--font-size-3xl":"1.8125rem","--font-size-4xl":"2.1875rem","--font-size-5xl":"2.625rem"},UI={"--font-weight-normal":"400","--font-weight-medium":"500","--font-weight-semibold":"600","--font-weight-bold":"700"},FI={"--text-heading-1-size":"var(--font-size-2xl)","--text-heading-1-weight":"var(--font-weight-semibold)","--text-heading-1-leading":"1.3333","--text-heading-2-size":"var(--font-size-xl)","--text-heading-2-weight":"var(--font-weight-semibold)","--text-heading-2-leading":"1.4","--text-heading-3-size":"var(--font-size-lg)","--text-heading-3-weight":"var(--font-weight-semibold)","--text-heading-3-leading":"1.4118","--text-heading-4-size":"var(--font-size-base)","--text-heading-4-weight":"var(--font-weight-semibold)","--text-heading-4-leading":"1.4286","--text-heading-5-size":"var(--font-size-sm)","--text-heading-5-weight":"var(--font-weight-semibold)","--text-heading-5-leading":"1.6667","--text-heading-6-size":"var(--font-size-xs)","--text-heading-6-weight":"var(--font-weight-semibold)","--text-heading-6-leading":"1.6","--text-body-size":"var(--font-size-base)","--text-body-weight":"var(--font-weight-normal)","--text-body-leading":"1.4286","--text-large-size":"var(--font-size-lg)","--text-large-weight":"var(--font-weight-semibold)","--text-large-leading":"1.4118","--text-label-size":"var(--font-size-base)","--text-label-weight":"var(--font-weight-medium)","--text-label-leading":"1.4286","--text-code-size":"var(--font-size-base)","--text-code-weight":"var(--font-weight-normal)","--text-code-leading":"1.4286","--text-supporting-size":"var(--font-size-sm)","--text-supporting-weight":"var(--font-weight-normal)","--text-supporting-leading":"1.6667","--text-display-1-size":"var(--font-size-5xl)","--text-display-1-weight":"var(--font-weight-normal)","--text-display-1-leading":"1.2381","--text-display-2-size":"var(--font-size-4xl)","--text-display-2-weight":"var(--font-weight-normal)","--text-display-2-leading":"1.2571","--text-display-3-size":"var(--font-size-3xl)","--text-display-3-weight":"var(--font-weight-normal)","--text-display-3-leading":"1.2414"},T4=h.createContext(null);T4.displayName="LayoutAreaContext";const VI={hasHeader:!1,hasFooter:!1,hasStart:!1,hasEnd:!1},mg=h.createContext(VI);mg.displayName="LayoutSlotsContext";const yg=h.createContext(null);yg.displayName="LayoutDividerContext";const GI={center:{kGNEyG:"x6s0dn4",$$css:!0},end:{kGNEyG:"xuk3077",$$css:!0},start:{kGNEyG:"x1cy8zhl",$$css:!0},stretch:{kGNEyG:"x1qjc9v5",$$css:!0}},WI={start:{kjj79g:"x1nhvcw1",$$css:!0},center:{kjj79g:"xl56j7k",$$css:!0},end:{kjj79g:"x13a6bvl",$$css:!0},between:{kjj79g:"x1qughib",$$css:!0},around:{kjj79g:"x1l1ennw",$$css:!0},evenly:{kjj79g:"xaw8158",$$css:!0}},KI={horizontal:{kXwgrk:"x1q0g3np",$$css:!0},vertical:{kXwgrk:"xdt5ytf",$$css:!0}},XI={nowrap:{kwnvtZ:"xozqiw3",$$css:!0},wrap:{kwnvtZ:"x1a02dak",$$css:!0},"wrap-reverse":{kwnvtZ:"x8hhl5t",$$css:!0}},ZI={stack:{k1xSpc:"x78zum5",$$css:!0}},YI={0:{k1C7PZ:"x1o57wo1",khm7nJ:"x6yxi7o",$$css:!0},1:{k1C7PZ:"x1lfs0n9",khm7nJ:"x1ngg2t4",$$css:!0},2:{k1C7PZ:"xak3so",khm7nJ:"x1x7z4sm",$$css:!0},3:{k1C7PZ:"xewh9hi",khm7nJ:"x4olc9o",$$css:!0},4:{k1C7PZ:"xty4p9g",khm7nJ:"xtx9w7w",$$css:!0},5:{k1C7PZ:"x1eqhezk",khm7nJ:"x1iu6piu",$$css:!0},6:{k1C7PZ:"x3qlgwd",khm7nJ:"xczp1bk",$$css:!0},8:{k1C7PZ:"xicv188",khm7nJ:"xgx0vcf",$$css:!0},10:{k1C7PZ:"x1p37tyl",khm7nJ:"x1xpicb7",$$css:!0},"0.5":{k1C7PZ:"x1kihgfc",khm7nJ:"x1tw44j4",$$css:!0},"1.5":{k1C7PZ:"x1thn6ci",khm7nJ:"xhq53yo",$$css:!0}};function Ay({crossAlign:e,direction:t,gap:n,mainAlign:s,wrap:r}){return[ZI.stack,KI[t],n!=null&&YI[n],e!=null&&GI[e],s!=null&&WI[s],r!=null&&XI[r]]}const QI={reset:{kAzted:"x2lwn1j",k7Eaqz:"xeuugli",$$css:!0}},JI={center:{kSGwAc:"xamitd3",$$css:!0},end:{kSGwAc:"xpvyfi4",$$css:!0},start:{kSGwAc:"xqcrz7y",$$css:!0},stretch:{kSGwAc:"xkh2ocl",$$css:!0}},eL={fill:{kzQI83:"x1iyjqo2",$$css:!0},static:{kzQI83:"x1c4vz4f",kmuXW:"x2lah0s",$$css:!0}};function tL({crossAlignSelf:e,size:t}={}){return[QI.reset,eL[t??"static"],e!=null&&JI[e]]}function z4(e){return e==="base"?"":e.split("+").map(t=>{const[n,s]=t.split(":");return s===void 0?`.${n}`:/^\d/.test(s)?`.${n}-${s}`:`.${s}`}).join("")}function nL(e,t){return e!=null?`id:${e}`:`fallback:${typeof t=="function"?t():t}`}function Vh(e,t){const n={...e,...t},s=[e.className,t.className].filter(Boolean).join(" ");s?n.className=s:delete n.className;const r=t.style&&e.style?{...e.style,...t.style}:t.style||e.style;return r?n.style=r:delete n.style,n}function ne(e,t,n,s){if(typeof e=="string"){const l=e,c=t??{className:""},u=n;let d=c.className?`${l} ${c.className}`:l;u&&(d=`${d} ${u}`);const f=s&&c.style?{...c.style,...s}:s||c.style;return{...c,className:d,style:f}}let a=Vh(e,typeof t=="string"?{className:t}:t??{});return typeof n=="string"?a=Vh(a,{className:n}):n!=null&&(a=Vh(a,{style:n})),s!=null&&(a=Vh(a,{style:s})),a}function Ft(...e){return t=>{const n=[];for(const s of e)if(typeof s=="function"){const r=s(t);typeof r=="function"&&n.push(r)}else s!=null&&(s.current=t);if(n.length>0)return()=>{for(const s of n)s()}}}function vg(...e){return t=>{for(const n of e)if(n==null||n(t),t.defaultPrevented)return}}const N4="astryx",Nj=N4,kg=N4,sL=N4;function My(e){return`${Nj}-${e}`}function Ls(e){return`data-${kg}-${e}`}function rL(e){return`--${sL}-${e}`}function iL(e){return`data-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`}function oL(e,t){return/^\d/.test(t)?`${e}-${t}`:t}function aL(e,t){const n=[My(e)];if(t)for(const[s,r]of Object.entries(t))r!=null&&n.push(oL(s,String(r)));return n.join(" ")}function lL(e){const t={};if(e)for(const[n,s]of Object.entries(e))s!=null&&(t[iL(n)]=String(s));return t}function J(e,t){return{className:aL(e,t),...lL(t)}}function Lb(e){const t=e.auxiliaryData;return typeof(t==null?void 0:t.group)=="string"?t.group:void 0}function cL(e){var a;if(!e.some(l=>Lb(l)!=null))return[{heading:null,items:e}];const n=[],s=new Map,r=[];for(const l of e){const c=Lb(l);c!=null?(s.has(c)||(n.push(c),s.set(c,[])),(a=s.get(c))==null||a.push(l)):r.push(l)}const i=n.map(l=>({heading:l,items:s.get(l)??[]}));return r.length>0&&i.push({heading:null,items:r}),i}let Rl=null;const tx=new Map;function uL(){return Rl||(Rl=new ResizeObserver(e=>{for(const t of e){const n=tx.get(t.target);n&&n(t)}})),Rl}function _4(e,t){tx.set(e,t),uL().observe(e),t({target:e})}function R4(e){tx.delete(e),Rl&&(Rl.unobserve(e),tx.size===0&&(Rl.disconnect(),Rl=null))}function Rm(e){return e!=null&&typeof e!="boolean"&&e!==""}function Ob(...e){const t=e.flatMap(n=>typeof n=="string"?n.trim().split(/\s+/):[]).filter(Boolean);if(t.length!==0)return Array.from(new Set(t)).join(" ")}function I4(e,t=[],n){return{ariaLabelledBy:n?Ob(n.labelID,e):void 0,ariaDescribedBy:Ob(n==null?void 0:n.describedByIDs,...t)}}const dL={transparent:{r:0,g:0,b:0,a:0},black:{r:0,g:0,b:0,a:1},white:{r:255,g:255,b:255,a:1}},nx=(e,t,n)=>Math.max(t,Math.min(n,e));function fL(e){return e.split("").map(t=>t+t).join("")}function hL(e){if(typeof e!="string")return null;const t=e.trim().replace(/^#/,""),n=t.length===3||t.length===4?fL(t):t;return n.length!==6&&n.length!==8||!/^[0-9a-fA-F]+$/.test(n)?null:{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:n.length===8?parseInt(n.slice(6,8),16)/255:1}}function pL(e){const t=e.indexOf("(");if(t===-1||!e.trim().endsWith(")"))return null;const s=e.slice(t+1,e.lastIndexOf(")")).replace(/\//g," ").split(/[\s,]+/).map(u=>u.trim()).filter(Boolean);if(s.length<3)return null;const r=u=>{const d=u.endsWith("%")?parseFloat(u)/100*255:parseFloat(u);return nx(d,0,255)},i=r(s[0]),a=r(s[1]),l=r(s[2]);if([i,a,l].some(Number.isNaN))return null;let c=1;if(s.length>=4){const u=s[3];if(c=u.endsWith("%")?parseFloat(u)/100:parseFloat(u),Number.isNaN(c))return null;c=nx(c,0,1)}return{r:i,g:a,b:l,a:c}}function Db(e){const t=e.trim(),n=dL[t.toLowerCase()];return n?{...n}:t.startsWith("#")?hL(t):/^rgba?\(/i.test(t)?pL(t):null}function xL(e,t,n){const s=r=>nx(Math.round(r),0,255).toString(16).padStart(2,"0").toUpperCase();return`#${s(e)}${s(t)}${s(n)}`}function gL({r:e,g:t,b:n,a:s}){if(s>=1)return xL(e,t,n);const r=i=>nx(Math.round(i),0,255);return`rgba(${r(e)}, ${r(t)}, ${r(n)}, ${parseFloat(s.toFixed(4))})`}function mL(e,t){return`${e}: ${t}`}function oc(e,t,...n){}function _j(e,t,...n){console.error(mL(e,t),...n)}function L4(e,t,n,...s){}const yL={kbCHJM:"x1nrll8i",k3aq6I:"xsqj5wx",$$css:!0},xd={mirror:{k3aq6I:"xgtlewx",$$css:!0},centerInline:e=>[yL,{"--x-transform":`translate(-50%, ${e})`!=null?`translate(-50%, ${e})`:void 0}]},Rj={0:"spacing0",.5:"spacing0_5",1:"spacing1",1.5:"spacing1_5",2:"spacing2",3:"spacing3",4:"spacing4",5:"spacing5",6:"spacing6",8:"spacing8",10:"spacing10"},Rd={0:{kZCmMZ:"x18gyask",kwRFfy:"x1s0aq8i",kLKAdn:"x1ydh6w3",kGO01o:"x1l20ajd",$$css:!0},1:{kZCmMZ:"x1vsv5vr",kwRFfy:"x1nryj5t",kLKAdn:"xfsso4q",kGO01o:"xy143xn",$$css:!0},2:{kZCmMZ:"x12gdq22",kwRFfy:"x1djylfy",kLKAdn:"x1xye8es",kGO01o:"x1wesfrj",$$css:!0},3:{kZCmMZ:"x126nfab",kwRFfy:"x1t818jl",kLKAdn:"x1vlblms",kGO01o:"xvmdzux",$$css:!0},4:{kZCmMZ:"x1rey3nv",kwRFfy:"xnjyzlh",kLKAdn:"x1oa1p4a",kGO01o:"x1awphl8",$$css:!0},5:{kZCmMZ:"x1blguxw",kwRFfy:"xdbrk9v",kLKAdn:"xx7rijo",kGO01o:"x1hk98q",$$css:!0},6:{kZCmMZ:"x31w388",kwRFfy:"x1we12cn",kLKAdn:"x1adxfkp",kGO01o:"xjpqqx5",$$css:!0},8:{kZCmMZ:"x1j3hnjz",kwRFfy:"x1q91b2g",kLKAdn:"xoxd1wu",kGO01o:"x2oz4g1",$$css:!0},10:{kZCmMZ:"xqp078j",kwRFfy:"x160ivqr",kLKAdn:"xk6660b",kGO01o:"x2izi54",$$css:!0},"0.5":{kZCmMZ:"x138rykx",kwRFfy:"x1le3yxw",kLKAdn:"xbx876j",kGO01o:"xij103a",$$css:!0},"1.5":{kZCmMZ:"xfti1ec",kwRFfy:"x17hk9do",kLKAdn:"x1kwdpsa",kGO01o:"x1opdxmq",$$css:!0}},Id={0:{"--container-padding-inline-start":"x1gu2k80","--container-padding-inline-end":"x91ghl5",$$css:!0},1:{"--container-padding-inline-start":"x1cvlban","--container-padding-inline-end":"x2oyxnl",$$css:!0},2:{"--container-padding-inline-start":"x1xlrr2o","--container-padding-inline-end":"xcas3b9",$$css:!0},3:{"--container-padding-inline-start":"xfdwxua","--container-padding-inline-end":"xu0ipoa",$$css:!0},4:{"--container-padding-inline-start":"x1dlhslv","--container-padding-inline-end":"xs0pscg",$$css:!0},5:{"--container-padding-inline-start":"x1s81nki","--container-padding-inline-end":"xgkj7vj",$$css:!0},6:{"--container-padding-inline-start":"x1ep0dkj","--container-padding-inline-end":"x94cj42",$$css:!0},8:{"--container-padding-inline-start":"xw1diwv","--container-padding-inline-end":"x1b9k1pi",$$css:!0},10:{"--container-padding-inline-start":"xserb3f","--container-padding-inline-end":"xx5lg5w",$$css:!0},"0.5":{"--container-padding-inline-start":"x14ws0sr","--container-padding-inline-end":"x1wz3t3y",$$css:!0},"1.5":{"--container-padding-inline-start":"x176g23i","--container-padding-inline-end":"xntetml",$$css:!0}},Ld={0:{"--container-padding-block-start":"x1i3qcxz",$$css:!0},1:{"--container-padding-block-start":"xnsckjb",$$css:!0},2:{"--container-padding-block-start":"xa8b4fq",$$css:!0},3:{"--container-padding-block-start":"x11k4f5r",$$css:!0},4:{"--container-padding-block-start":"xm01sq8",$$css:!0},5:{"--container-padding-block-start":"xp8wdkl",$$css:!0},6:{"--container-padding-block-start":"x1hmud4d",$$css:!0},8:{"--container-padding-block-start":"xfv60at",$$css:!0},10:{"--container-padding-block-start":"x17h9kl7",$$css:!0},"0.5":{"--container-padding-block-start":"xvdf9ev",$$css:!0},"1.5":{"--container-padding-block-start":"x1kbx601",$$css:!0}},Od={0:{"--container-padding-block-end":"xkunwnr",$$css:!0},1:{"--container-padding-block-end":"x57a7ii",$$css:!0},2:{"--container-padding-block-end":"x1lsgcmx",$$css:!0},3:{"--container-padding-block-end":"x1q3ppug",$$css:!0},4:{"--container-padding-block-end":"x4hfsld",$$css:!0},5:{"--container-padding-block-end":"xbib2ws",$$css:!0},6:{"--container-padding-block-end":"x1q8d17g",$$css:!0},8:{"--container-padding-block-end":"x8lgq76",$$css:!0},10:{"--container-padding-block-end":"x15vxphk",$$css:!0},"0.5":{"--container-padding-block-end":"x1cao3zv",$$css:!0},"1.5":{"--container-padding-block-end":"xv53x8y",$$css:!0}},vL={0:{"--layout-padding-outer-x":"xswhm3q",$$css:!0},1:{"--layout-padding-outer-x":"xc96xmq",$$css:!0},2:{"--layout-padding-outer-x":"x15dxnc0",$$css:!0},3:{"--layout-padding-outer-x":"xadgj3j",$$css:!0},4:{"--layout-padding-outer-x":"x1v56qcf",$$css:!0},5:{"--layout-padding-outer-x":"x1nzs0gl",$$css:!0},6:{"--layout-padding-outer-x":"x1c3n52a",$$css:!0},8:{"--layout-padding-outer-x":"x1t3kfz",$$css:!0},10:{"--layout-padding-outer-x":"x1jdf5a4",$$css:!0},"0.5":{"--layout-padding-outer-x":"xihiwg7",$$css:!0},"1.5":{"--layout-padding-outer-x":"x1u93lgd",$$css:!0}},kL={0:{"--layout-padding-outer-y":"x1mzf5mb",$$css:!0},1:{"--layout-padding-outer-y":"x1gpfxoh",$$css:!0},2:{"--layout-padding-outer-y":"x10pz7y9",$$css:!0},3:{"--layout-padding-outer-y":"x1p6yq3h",$$css:!0},4:{"--layout-padding-outer-y":"xx738ci",$$css:!0},5:{"--layout-padding-outer-y":"x6yxws5",$$css:!0},6:{"--layout-padding-outer-y":"x180vrwl",$$css:!0},8:{"--layout-padding-outer-y":"xid7e43",$$css:!0},10:{"--layout-padding-outer-y":"x26l4wa",$$css:!0},"0.5":{"--layout-padding-outer-y":"x1vj96e0",$$css:!0},"1.5":{"--layout-padding-outer-y":"xd3dqby",$$css:!0}},bL={0:{kZCmMZ:"x18gyask",kwRFfy:"x1s0aq8i",$$css:!0},1:{kZCmMZ:"x1vsv5vr",kwRFfy:"x1nryj5t",$$css:!0},2:{kZCmMZ:"x12gdq22",kwRFfy:"x1djylfy",$$css:!0},3:{kZCmMZ:"x126nfab",kwRFfy:"x1t818jl",$$css:!0},4:{kZCmMZ:"x1rey3nv",kwRFfy:"xnjyzlh",$$css:!0},5:{kZCmMZ:"x1blguxw",kwRFfy:"xdbrk9v",$$css:!0},6:{kZCmMZ:"x31w388",kwRFfy:"x1we12cn",$$css:!0},8:{kZCmMZ:"x1j3hnjz",kwRFfy:"x1q91b2g",$$css:!0},10:{kZCmMZ:"xqp078j",kwRFfy:"x160ivqr",$$css:!0},"0.5":{kZCmMZ:"x138rykx",kwRFfy:"x1le3yxw",$$css:!0},"1.5":{kZCmMZ:"xfti1ec",kwRFfy:"x17hk9do",$$css:!0}},wL={0:{kLKAdn:"x1ydh6w3",kGO01o:"x1l20ajd",$$css:!0},1:{kLKAdn:"xfsso4q",kGO01o:"xy143xn",$$css:!0},2:{kLKAdn:"x1xye8es",kGO01o:"x1wesfrj",$$css:!0},3:{kLKAdn:"x1vlblms",kGO01o:"xvmdzux",$$css:!0},4:{kLKAdn:"x1oa1p4a",kGO01o:"x1awphl8",$$css:!0},5:{kLKAdn:"xx7rijo",kGO01o:"x1hk98q",$$css:!0},6:{kLKAdn:"x1adxfkp",kGO01o:"xjpqqx5",$$css:!0},8:{kLKAdn:"xoxd1wu",kGO01o:"x2oz4g1",$$css:!0},10:{kLKAdn:"xk6660b",kGO01o:"x2izi54",$$css:!0},"0.5":{kLKAdn:"xbx876j",kGO01o:"xij103a",$$css:!0},"1.5":{kLKAdn:"x1kwdpsa",kGO01o:"x1opdxmq",$$css:!0}},Po={layoutOuter:{keTefX:"xojxgvx",k71WvV:"x1fcf3bl",keoZOQ:"x1sa9bsh",k1K539:"x6h7pi7",$$css:!0},layoutInner:{"--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0},fill:{kZKoxP:"x12qplqi",kskxy:"xenllk4",$$css:!0},auto:{kAzted:"x1us19tq",$$css:!0},middle:{kUk6DE:"x98rzlu",kAzted:"x2lwn1j",$$css:!0},fullBleed:{"--layout-padding-outer-x":"x1wbjvqu","--layout-padding-outer-y":"xzxxx64",$$css:!0}},jL={kzqmXN:"xh8yej3",kUOVxO:"xvueqy4",$$css:!0},Bb={contentWidthVar:e=>[{"--layout-content-width":(typeof e=="number"?`${e}px`:e)!=null?"x4906uf":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x---layout-content-width":(typeof e=="number"?`${e}px`:e)!=null?typeof e=="number"?`${e}px`:e:void 0}],contentWidth:e=>[jL,{ks0D6T:(typeof e=="number"?`${e}px`:e)!=null?"xf68679":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-maxWidth":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}]};function lf({area:e,children:t}){return t==null?null:o.jsx(T4,{value:e,children:t})}const SL={"x-default-marker":"x-default-marker",$$css:!0};function Cs({children:e,content:t,contentWidth:n,defaultHasDividers:s,end:r,footer:i,header:a,height:l="fill",padding:c,ref:u,start:d,xstyle:f,className:p,style:x}){const g=l==="fill",v=t??e,y=h.useMemo(()=>s!=null?{defaultHasDividers:s}:null,[s]),m=a!=null,k=i!=null,b=d!=null,j=r!=null,A=h.useMemo(()=>({hasHeader:m,hasFooter:k,hasStart:b,hasEnd:j}),[m,k,b,j]),M=o.jsx(mg,{value:A,children:o.jsx("div",{ref:u,...ne(J("layout",{height:l}),G(Po.layoutOuter,g?Po.fill:Po.auto,f),p,x),children:o.jsxs("div",{...G(SL,Po.layoutInner,...Ay({direction:"vertical"}),g?Po.fill:Po.auto,c===0&&Po.fullBleed,c!=null&&vL[c],c!=null&&kL[c],n!=null&&Bb.contentWidthVar(n)),children:[o.jsx(lf,{area:"header",children:a}),o.jsxs("div",{...G(...Ay({direction:"horizontal"}),Po.middle,n!=null&&Bb.contentWidth(n)),children:[o.jsx(lf,{area:"start",children:d}),o.jsx("div",{...G(...tL({size:"fill"})),children:o.jsx(lf,{area:"content",children:v})}),o.jsx(lf,{area:"end",children:r})]}),o.jsx(lf,{area:"footer",children:i})]})})});return y!=null?o.jsx(yg,{value:y,children:M}):M}Cs.displayName="Layout";const Gh={header:{kmuXW:"x2lah0s",$$css:!0},inner:{kB7OPa:"x9f619",ks0D6T:"xjl2t3p",kUOVxO:"xvueqy4",kZCmMZ:"x139j0dd",kwRFfy:"xpc6k2p",kLKAdn:"x81pis9",kGO01o:"xg476vw","--container-padding-inline-start":"xdvaxxn","--container-padding-inline-end":"xqpvj4r","--container-padding-block-start":"xzz8v79","--container-padding-block-end":"xi9ns85",$$css:!0},fullBleed:{kZCmMZ:"x1c1uobl",kwRFfy:"xyri2b",kLKAdn:"xexx8yu",kGO01o:"x18d9i69","--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0},divider:{kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},CL={sizing:e=>[{kZKoxP:e!=null?"x16ye13r":e,$$css:!0},{"--x-height":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function sx({children:e,hasDivider:t,height:n,label:s,padding:r,role:i,xstyle:a,className:l,style:c,ref:u,...d}){const f=h.use(yg),p=t??(f==null?void 0:f.defaultHasDividers)??!1,x=r===0;return o.jsx("div",{ref:u,role:i,"aria-label":s,"data-divider":p||void 0,...ne(J("layout-header"),G(Gh.header,CL.sizing(n??null),p&&Gh.divider,a),l,c),...d,children:o.jsx("div",{...G(Gh.inner,x&&Gh.fullBleed,r!=null&&Rd[r],r!=null&&Id[r],r!=null&&Ld[r],r!=null&&Od[r]),children:e})})}sx.displayName="LayoutHeader";const Fr={panel:{kB7OPa:"x9f619",kmuXW:"x2lah0s",kVQacm:"x7giv3",kZCmMZ:"xwjyata",kwRFfy:"x1peupej",kLKAdn:"xqty4a",kGO01o:"xg476vw","--container-padding-inline-start":"x408pgh","--container-padding-inline-end":"xikqloz","--container-padding-block-start":"xjmgx01","--container-padding-block-end":"xi9ns85",$$css:!0},startPanel:{kZCmMZ:"x139j0dd",$$css:!0},endPanel:{kwRFfy:"xpc6k2p",$$css:!0},noHeader:{kLKAdn:"x81pis9",$$css:!0},noFooter:{kGO01o:"xon7vh3",$$css:!0},fullBleed:{kZCmMZ:"x1c1uobl",kwRFfy:"xyri2b",kLKAdn:"xexx8yu",kGO01o:"x18d9i69","--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0},scrollable:{kVQacm:"xysyzu8",$$css:!0},dividerEnd:{ke9TFa:"x1lun4ml",k8ry5P:"x18b5jzi",kBCPoo:"x1gejf6u",$$css:!0},dividerStart:{k2ei4v:"xpilrb4",kVhnKS:"x1t7ytsu",kGJrpR:"x1j92z86",$$css:!0},collapseStart:{keTefX:"x1wim8z0",$$css:!0},collapseEnd:{k71WvV:"x1kpg4um",$$css:!0}},EL={sizing:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function O4({children:e,hasDivider:t=!1,isScrollable:n=!0,label:s,padding:r,role:i,width:a,resizable:l,xstyle:c,className:u,style:d,ref:f,...p}){const x=h.use(T4),{hasHeader:g,hasFooter:v}=h.use(mg),y=l?l._size:a,m=x==="start",k=x==="end",b=r===0,j=!t&&!b&&r==null,A=m?Fr.dividerEnd:k?Fr.dividerStart:null,M=m?Fr.collapseEnd:k?Fr.collapseStart:null;return o.jsx("div",{ref:f,role:i,"aria-label":s,...ne(J("layout-panel"),G(Fr.panel,EL.sizing(y??null),m&&!b&&r==null&&Fr.startPanel,k&&!b&&r==null&&Fr.endPanel,!g&&!b&&r==null&&Fr.noHeader,!v&&!b&&r==null&&Fr.noFooter,n&&Fr.scrollable,b&&Fr.fullBleed,r!=null&&Rd[r],r!=null&&Id[r],r!=null&&Ld[r],r!=null&&Od[r],t&&A,j&&M,c),u,d),...p,children:e})}O4.displayName="LayoutPanel";const il={content:{kB7OPa:"x9f619",kZKoxP:"x5yr21d",kUk6DE:"x98rzlu",kAzted:"x2lwn1j",kVQacm:"x7giv3",kZCmMZ:"xwjyata",kwRFfy:"x1peupej",kLKAdn:"xqty4a x1ioh5az",kGO01o:"xg476vw xsg11nj","--container-padding-inline-start":"x408pgh","--container-padding-inline-end":"xikqloz","--container-padding-block-start":"xjmgx01","--container-padding-block-end":"xi9ns85",$$css:!0},noStart:{kZCmMZ:"x139j0dd","--container-padding-inline-start":"xdvaxxn","--container-padding-inline-end":"xqpvj4r",$$css:!0},noEnd:{kwRFfy:"xpc6k2p",$$css:!0},noHeader:{kLKAdn:"x81pis9","--container-padding-block-start":"xzz8v79",$$css:!0},noFooter:{kGO01o:"xon7vh3","--container-padding-block-end":"x1xjq73n",$$css:!0},scrollable:{kVQacm:"xysyzu8",$$css:!0},fullBleed:{kZCmMZ:"x1c1uobl",kwRFfy:"xyri2b",kLKAdn:"xexx8yu",kGO01o:"x18d9i69","--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0}};function Es({children:e,isScrollable:t=!0,padding:n,label:s,role:r,xstyle:i,className:a,style:l,ref:c,...u}){const{hasHeader:d,hasFooter:f,hasStart:p,hasEnd:x}=h.use(mg),g=n===0;return o.jsx("div",{ref:c,role:r,"aria-label":s,...ne(J("layout-content"),G(il.content,!p&&!g&&n==null&&il.noStart,!x&&!g&&n==null&&il.noEnd,!d&&!g&&n==null&&il.noHeader,!f&&!g&&n==null&&il.noFooter,t&&il.scrollable,g&&il.fullBleed,n!=null&&Rd[n],n!=null&&Id[n],n!=null&&Ld[n],n!=null&&Od[n],i),a,l),...u,children:e})}Es.displayName="LayoutContent";function Ij(e){return(e.style.anchorName??"").split(",").map(n=>n.trim()).filter(Boolean)}function Lj(e,t){e.style.anchorName=t.join(", ")}function $L(e,t){const n=Ij(e);n.includes(t)||(n.push(t),Lj(e,n))}function AL(e,t){Lj(e,Ij(e).filter(n=>n!==t))}const Im={base:{keoZOQ:"xdj266r",k1K539:"xat24cr",keTefX:"x1lziwak",k71WvV:"x14z9mp",kLKAdn:"xexx8yu",kGO01o:"x18d9i69",kZCmMZ:"x1c1uobl",kwRFfy:"xyri2b",kMzoRj:"xc342km",ksu8eU:"xng3xce",kVQacm:"x1rea2x4",kMv6JI:"x9ynric",kWkggS:"xjbqb8w",$$css:!0},fixed:{kVAEAm:"xixxii4",$$css:!0}};function ML(e="above",t="center"){if(e==="above"||e==="below"){const s=e==="above"?"self-block-start":"self-block-end";return t==="start"?`${s} span-self-inline-end`:t==="end"?`${s} span-self-inline-start`:s}const n=e==="start"?"self-inline-start":"self-inline-end";return t==="start"?`${n} span-self-block-end`:t==="end"?`${n} span-self-block-start`:n}function TL(e="above",t="center"){const n="flip-block, flip-inline, flip-block flip-inline";if(t!=="center")return n;if(e==="above"||e==="below"){const[i,a]=e==="above"?["top","bottom"]:["bottom","top"];return`${n}, ${i} span-left, ${i} span-right, ${a} span-left, ${a} span-right`}const[s,r]=e==="start"?["left","right"]:["right","left"];return`${n}, ${s} span-top, ${s} span-bottom, ${r} span-top, ${r} span-bottom`}function Dd(e){const{mode:t,onShow:n,onHide:s,lightDismiss:r=!1}=e,i=h.useId(),a=`--astryx-layer-${i.replace(/:/g,"")}`,[l,c]=h.useState(!1),u=h.useRef(null),d=h.useRef(null),f=h.useRef(!1),p=h.useCallback(()=>{const M=u.current;M&&!f.current&&(typeof M.showPopover=="function"?M.showPopover():M.style.display="block",f.current=!0,c(!0),n==null||n())},[n]),x=h.useCallback(()=>{if(f.current){const M=u.current;M&&(typeof M.hidePopover=="function"?M.hidePopover():M.style.display="none"),f.current=!1,c(!1),s==null||s()}},[s]),g=t==="context"?M=>{d.current&&d.current!==M&&AL(d.current,a),M&&$L(M,a),d.current=M}:void 0,v=h.useCallback(M=>{M.newState==="closed"&&f.current&&(f.current=!1,c(!1),s==null||s())},[s]),y=h.useRef(null),m=h.useRef(null),k=h.useCallback((M,T)=>{y.current&&m.current&&(y.current!==M||m.current!==T)&&(y.current.removeEventListener("toggle",m.current),y.current=null,m.current=null),M&&y.current!==M&&(M.addEventListener("toggle",T),y.current=M,m.current=T)},[]),b=h.useCallback(M=>{u.current=M,k(M,v)},[v,k]);h.useEffect(()=>(u.current&&k(u.current,v),()=>{y.current&&m.current&&(y.current.removeEventListener("toggle",m.current),y.current=null,m.current=null)}),[v,k]);const j=h.useCallback((M,T)=>{const{placement:z="above",alignment:$="center",positioning:E="anchor",role:N,"aria-label":_,xstyle:R,className:B,style:D,as:I="div",onMouseEnter:O,onMouseLeave:L}=T||{},H=E==="custom"?{positionAnchor:a}:{positionAnchor:a,positionArea:ML(z,$),positionTryFallbacks:TL(z,$)},q=G(Im.base,R),U=B?`${B} ${q.className??""}`:q.className;return o.jsx(I,{ref:b,id:i,role:N,"aria-label":_,popover:r?"auto":"manual",className:U,style:{...q.style,...H,...D},onMouseEnter:O,onMouseLeave:L,children:M})},[a,i,r,b]),A=h.useCallback((M,T)=>{const{x:z,y:$,xstyle:E,className:N,style:_}=T,R={top:$,left:z},B=G(Im.base,Im.fixed,E),D=N?`${N} ${B.className??""}`:B.className;return o.jsx("div",{ref:b,id:i,popover:r?"auto":"manual",className:D,style:{...B.style,...R,..._},children:M})},[b,i,r]);return t==="context"?{ref:g,anchorId:a,show:p,hide:x,isOpen:l,id:i,render:j}:{ref:void 0,show:p,hide:x,isOpen:l,id:i,render:A}}const wo={below:{kKVMdj:"xl1vlw0 x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},above:{kKVMdj:"x3psbcj x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},end:{kKVMdj:"x1i331go x1vxsm5i x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},start:{kKVMdj:"xck01x9 x18lne9g x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0}},zL=100,Lm={container:{kWkggS:"x19aspcf",kMwMTN:"xrkvqaz",kaIpWk:"x1hviunn",kMv6JI:"x9ynric",kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",$$css:!0},marginBlock:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",keTefX:"x1lziwak",k71WvV:"x14z9mp",$$css:!0},marginInline:{keoZOQ:"xdj266r",k1K539:"xat24cr",keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0}};function NL(e){return e.hasAttribute("tabindex")?e.tabIndex>=0:["A","BUTTON","INPUT","SELECT","TEXTAREA"].includes(e.tagName)?!e.disabled:!!e.isContentEditable}function Ss(e={}){const{placement:t="above",alignment:n="center",delay:s=200,hideDelay:r=0,focusTrigger:i="auto",isEnabled:a=!0,isOpen:l,isDefaultOpen:c=!1,onShow:u,onHide:d}=e,f=t==="above"||t==="below"?Lm.marginBlock:Lm.marginInline,p=Dd({mode:"context",onShow:u,onHide:d}),x=h.useMemo(()=>[Lm.container,f],[f]),g=h.useRef(null),v=h.useRef(null),y=h.useRef(null),m=h.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null),v.current&&(clearTimeout(v.current),v.current=null)},[]),k=h.useCallback(()=>{!a||l===!1||(m(),g.current=setTimeout(()=>{p.show()},s))},[a,l,m,p,s]),b=h.useCallback(()=>{if(l===!0)return;m();const R=r>0?r:zL;v.current=setTimeout(()=>{p.hide()},R)},[l,m,p,r]),j=h.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null)},[]),A=h.useCallback(()=>{typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: none)").matches||k()},[k]),M=h.useCallback(()=>{b()},[b]),T=h.useCallback(R=>{!a||!R.target.matches(":focus-visible")||(m(),p.show())},[a,m,p]),z=h.useCallback(()=>{b()},[b]),$=h.useCallback(()=>{l===void 0&&(m(),p.hide())},[l,m,p]),E=h.useCallback(R=>{y.current&&(y.current.removeEventListener("mouseenter",A),y.current.removeEventListener("mouseleave",M),y.current.removeEventListener("focusin",T),y.current.removeEventListener("focusout",z),y.current.removeEventListener("pointerdown",$)),R&&(R.addEventListener("mouseenter",A),R.addEventListener("mouseleave",M),R.addEventListener("pointerdown",$),(i==="always"||i==="auto"&&NL(R))&&(R.addEventListener("focusin",T),R.addEventListener("focusout",z))),y.current=R},[i,A,M,T,z,$]),N=h.useCallback(R=>{p.ref(R),E(R)},[p,E]);h.useEffect(()=>()=>{m()},[m]),h.useEffect(()=>{c&&p.show()},[]),h.useEffect(()=>{l!==void 0&&(l?(m(),p.show()):(m(),p.hide()))},[l,m,p]),h.useEffect(()=>{if(l!==void 0)return;const R=B=>{B.key==="Escape"&&(B.isComposing||B.keyCode===229||(m(),p.hide()))};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[l,p,m]);const _=h.useCallback((R,B)=>{const D=(B==null?void 0:B.placement)??t,I={placement:D,alignment:(B==null?void 0:B.alignment)??n,role:"tooltip",xstyle:[x,wo[D]],className:J("tooltip").className,onMouseEnter:j,onMouseLeave:b};return p.render(o.jsx("div",{className:"xfsso4q xy143xn x12gdq22 x1djylfy xw5ewwj x13faqbe",children:R}),I)},[p,t,n,x,j,b]);return{ref:N,positionRef:p.ref,interactionRef:E,anchorId:p.anchorId,describedBy:p.id,renderTooltip:_}}const D4={"--color-syntax-keyword":"var(--color-text-accent)","--color-syntax-string":"var(--color-text-green)","--color-syntax-comment":"var(--color-text-secondary)","--color-syntax-number":"var(--color-text-orange)","--color-syntax-function":"var(--color-text-blue)","--color-syntax-type":"var(--color-text-purple)","--color-syntax-variable":"var(--color-text-primary)","--color-syntax-operator":"var(--color-text-cyan)","--color-syntax-constant":"var(--color-text-orange)","--color-syntax-tag":"var(--color-text-red)","--color-syntax-attribute":"var(--color-text-teal)","--color-syntax-property":"var(--color-text-cyan)","--color-syntax-punctuation":"var(--color-text-disabled)","--color-syntax-background":"var(--color-background-muted)"},_L={"--color-data-categorical-blue":"light-dark(#0171E3, #0171E3)","--color-data-categorical-orange":"light-dark(#EB6E00, #EB6E00)","--color-data-categorical-purple":"light-dark(#6B1EFD, #6B1EFD)","--color-data-categorical-green":"light-dark(#0B991F, #0B991F)","--color-data-categorical-pink":"light-dark(#F351C0, #F351C0)","--color-data-categorical-cyan":"light-dark(#0171A4, #0171A4)","--color-data-categorical-red":"light-dark(#F5394F, #F5394F)","--color-data-categorical-teal":"light-dark(#08A3A3, #08A3A3)","--color-data-categorical-brown":"light-dark(#965E03, #965E03)","--color-data-categorical-indigo":"light-dark(#6F8AFF, #6F8AFF)","--color-data-neutral":"light-dark(#8494A3, #8C939B)","--color-data-blue-5":"light-dark(#02165E, #02165E)","--color-data-blue-4":"light-dark(#004CBC, #004CBC)","--color-data-blue-3":"light-dark(#2694FE, #2694FE)","--color-data-blue-2":"light-dark(#78BEFF, #78BEFF)","--color-data-blue-1":"light-dark(#DBECFF, #DBECFF)","--color-data-shamrock-5":"light-dark(#0B603D, #0B603D)","--color-data-shamrock-4":"light-dark(#138546, #138546)","--color-data-shamrock-3":"light-dark(#24BB5E, #24BB5E)","--color-data-shamrock-2":"light-dark(#8EF7AA, #8EF7AA)","--color-data-shamrock-1":"light-dark(#D6FEE4, #D6FEE4)","--color-data-orange-5":"light-dark(#A13F04, #A13F04)","--color-data-orange-4":"light-dark(#D66100, #D66100)","--color-data-orange-3":"light-dark(#FD9537, #FD9537)","--color-data-orange-2":"light-dark(#FDB876, #FDB876)","--color-data-orange-1":"light-dark(#FFE6CF, #FFE6CF)","--color-data-pink-5":"light-dark(#8E1073, #8E1073)","--color-data-pink-4":"light-dark(#D123A1, #D123A1)","--color-data-pink-3":"light-dark(#F989D3, #F989D3)","--color-data-pink-2":"light-dark(#FEADE3, #FEADE3)","--color-data-pink-1":"light-dark(#FCE3F4, #FCE3F4)","--color-data-purple-5":"light-dark(#3E0697, #3E0697)","--color-data-purple-4":"light-dark(#6B1EFD, #6B1EFD)","--color-data-purple-3":"light-dark(#9081FF, #9081FF)","--color-data-purple-2":"light-dark(#B3B0FE, #B3B0FE)","--color-data-purple-1":"light-dark(#E8E8FB, #E8E8FB)","--color-data-red-5":"light-dark(#9D0519, #9D0519)","--color-data-red-4":"light-dark(#D31130, #D31130)","--color-data-red-3":"light-dark(#FB7D87, #FB7D87)","--color-data-red-2":"light-dark(#FFB2B8, #FFB2B8)","--color-data-red-1":"light-dark(#FEE4E6, #FEE4E6)","--color-data-teal-5":"light-dark(#08767D, #08767D)","--color-data-teal-4":"light-dark(#0C9293, #0C9293)","--color-data-teal-3":"light-dark(#0DB7AF, #0DB7AF)","--color-data-teal-2":"light-dark(#6CE6D8, #6CE6D8)","--color-data-teal-1":"light-dark(#D7FCF8, #D7FCF8)","--color-data-yellow-5":"light-dark(#8A5001, #8A5001)","--color-data-yellow-4":"light-dark(#D69804, #D69804)","--color-data-yellow-3":"light-dark(#FBCE03, #FBCE03)","--color-data-yellow-2":"light-dark(#FCEC85, #FCEC85)","--color-data-yellow-1":"light-dark(#FDF6BA, #FDF6BA)","--color-data-gray-5":"light-dark(#25363F, #333338)","--color-data-gray-4":"light-dark(#5D6C7B, #666A72)","--color-data-gray-3":"light-dark(#AFB9C4, #B2B8BE)","--color-data-gray-2":"light-dark(#CCD3DB, #D0D3D6)","--color-data-gray-1":"light-dark(#F1F4F7, #F2F4F6)"},RL={...D4,..._L},Oj=new Map;function IL(e){Oj.set(e.name,e)}function Dj(e){return e==null||e===""?null:Oj.get(e)??null}const LL={avatar:[{property:"fontSize",vars:["--_avatar-fallback-font-size"]},{property:"fontWeight",vars:["--_avatar-fallback-font-weight"]},{property:"color",vars:["--_avatar-fallback-color"]},{property:"backgroundColor",vars:["--_avatar-fallback-background"]}],banner:[{property:"borderRadius",vars:["--_banner-radius"]}],button:[{property:"borderRadius",vars:["--_button-radius"]}],card:[{property:"borderRadius",vars:["--_card-radius"]},{property:"padding",expand:"container"}],chat:[{property:"borderRadius",vars:["--_chat-composer-radius"]},{property:"padding",vars:["--_chat-composer-padding"]}],dialog:[{property:"borderRadius",vars:["--_dialog-radius"]},{property:"padding",expand:"container"}],"dropdown-menu":[{property:"borderRadius",vars:["--_dropdown-menu-radius"]},{property:"padding",vars:["--_dropdown-menu-padding"]}],field:[{property:"borderRadius",vars:["--_field-radius"]}],hovercard:[{property:"borderRadius",vars:["--_hovercard-radius"]}],popover:[{property:"borderRadius",vars:["--_popover-radius"]}],section:[{property:"padding",expand:"container"}],"segmented-control":[{property:"borderRadius",vars:["--_segmented-control-radius"]},{property:"padding",vars:["--_segmented-control-padding"]}]};function Hb(e,t){const n=LL[e];return n?n.filter(s=>s.property===t):[]}function Bj(e){return`[data-${kg}-theme="${e}"]`}const Hj=`[data-${kg}-theme]`;function qb(e){return`[data-${kg}-media="${e}"]`}function Mu(e,t){return`.${Nj}-${e}${t}`}function qj(e,t){const n=[];let s=0,r=0;for(let i=0;i<e.length;i++){const a=e[i];a==="("?s++:a===")"?s=Math.max(0,s-1):a===","&&s===0&&(n.push(e.slice(r,i).trim()),r=i+1)}return n.push(e.slice(r).trim()),n.map(i=>`${i}${t}`).join(", ")}function rx(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const Wh=new Set(["padding","paddingBlock","paddingInline","paddingBlockStart","paddingBlockEnd","paddingInlineStart","paddingInlineEnd"]);function OL(e){const t={};for(const[n,s]of e)switch(n){case"padding":{const r=s.trim().split(/\s+/);r.length===1?(t.blockStart=r[0],t.blockEnd=r[0],t.inline=r[0]):r.length===2?(t.blockStart=r[0],t.blockEnd=r[0],t.inline=r[1]):r.length>=3&&(t.blockStart=r[0],t.inline=r[1],t.blockEnd=r[2]);break}case"paddingBlock":{const r=s.trim().split(/\s+/);t.blockStart=r[0],t.blockEnd=r[1]??r[0];break}case"paddingInline":{const r=s.trim().split(/\s+/);r.length===1?t.inline=r[0]:(t.inlineStart=r[0],t.inlineEnd=r[1]);break}case"paddingBlockStart":t.blockStart=s;break;case"paddingBlockEnd":t.blockEnd=s;break;case"paddingInlineStart":t.inlineStart=s;break;case"paddingInlineEnd":t.inlineEnd=s;break}return t}function DL(e,t){const n=rL(`${e}-padding`),s=[],r=t.inlineStart??t.inline,i=t.inlineEnd??t.inline;return r!=null&&i!=null&&r===i&&t.blockStart!=null&&t.blockEnd!=null&&r===t.blockStart&&t.blockStart===t.blockEnd?(s.push([n,r??""]),s):(t.inlineStart!=null||t.inlineEnd!=null?(r!=null&&s.push([`${n}-inline-start`,r]),i!=null&&s.push([`${n}-inline-end`,i])):t.inline!=null&&s.push([`${n}-inline`,t.inline]),t.blockStart!=null&&s.push([`${n}-block-start`,t.blockStart]),t.blockEnd!=null&&s.push([`${n}-block-end`,t.blockEnd]),s)}function BL(e){const t=[],n=e.tokens,s=i=>n[i]||`var(${i})`,r=Object.entries(n);if(r.length>0){const i=r.map(([a,l])=>` ${a}: ${l};`).join(`
|
|
19
|
-
`);t.push(` :scope {
|
|
20
|
-
${i}
|
|
21
|
-
}`)}return e.components&&HL(e.components,t),qL(s,t),PL(e.components||{},t),FL(e.components||{},t),t}function HL(e,t){for(const[n,s]of Object.entries(e))for(const[r,i]of Object.entries(s)){const a=Object.entries(i);if(a.length===0)continue;const l=z4(r),c=Mu(n,l),u=[],d=[];for(const[g,v]of a)g.startsWith(":")&&typeof v=="object"?d.push([g,v]):u.push([g,v]);let f=u;const p=[];let x=!1;for(const[g,v]of u){const y=Hb(n,g),m=Wh.has(g)&&g!=="padding"?Hb(n,"padding"):[];for(const k of[...y,...m])if(k.expand==="container"&&Wh.has(g)&&(x=!0),k.vars)for(const b of k.vars)p.push([b,v])}if(x){const g=u.filter(([k])=>Wh.has(k)),v=u.filter(([k])=>!Wh.has(k)),y=OL(g),m=DL(n,y);f=[...v,...m]}if(p.length>0&&(f=[...f,...p]),f.length>0){const g=f.map(([v,y])=>` ${rx(v)}: ${y};`).join(`
|
|
22
|
-
`);t.push(` ${c} {
|
|
23
|
-
${g}
|
|
24
|
-
}`)}for(const[g,v]of d){const y=Object.entries(v);if(y.length>0){const m=y.map(([k,b])=>` ${rx(k)}: ${b};`).join(`
|
|
25
|
-
`);t.push(` ${qj(c,g)} {
|
|
26
|
-
${m}
|
|
27
|
-
}`)}}}}function qL(e,t){t.push(` :where(h1, h2, h3, h4, h5, h6) {
|
|
28
|
-
font-family: var(--font-family-heading);
|
|
29
|
-
color: var(--color-text-primary);
|
|
30
|
-
}`);for(let n=1;n<=6;n++)t.push(` :where(h${n}) {
|
|
31
|
-
font-size: ${e(`--text-heading-${n}-size`)};
|
|
32
|
-
font-weight: ${e(`--text-heading-${n}-weight`)};
|
|
33
|
-
line-height: ${e(`--text-heading-${n}-leading`)};
|
|
34
|
-
}`);t.push(` :where(p) {
|
|
35
|
-
font-family: var(--font-family-body);
|
|
36
|
-
font-size: ${e("--text-body-size")};
|
|
37
|
-
font-weight: ${e("--text-body-weight")};
|
|
38
|
-
line-height: ${e("--text-body-leading")};
|
|
39
|
-
color: var(--color-text-primary);
|
|
40
|
-
}`),t.push(` :where(small) {
|
|
41
|
-
font-size: ${e("--text-supporting-size")};
|
|
42
|
-
font-weight: ${e("--text-supporting-weight")};
|
|
43
|
-
line-height: ${e("--text-supporting-leading")};
|
|
44
|
-
color: var(--color-text-secondary);
|
|
45
|
-
}`),t.push(` :where(code, pre) {
|
|
46
|
-
font-family: var(--font-family-code);
|
|
47
|
-
font-size: ${e("--text-code-size")};
|
|
48
|
-
line-height: ${e("--text-code-leading")};
|
|
49
|
-
}`),t.push(` :where(hr) {
|
|
50
|
-
border: none;
|
|
51
|
-
border-top: 1px solid var(--color-border);
|
|
52
|
-
}`)}function PL(e,t){const n={primary:"var(--color-text-primary)",secondary:"var(--color-text-secondary)",disabled:"var(--color-text-disabled)",placeholder:"var(--color-text-secondary)",accent:"var(--color-text-accent)"},s="text"in e,r="heading"in e,i="link"in e;if(s||r||i)for(const[a,l]of Object.entries(n))s&&t.push(` ${Mu("text",`.${a}`)} { color: ${l}; }`),r&&t.push(` ${Mu("heading",`.${a}`)} { color: ${l}; }`),i&&t.push(` ${Mu("link",`.${a}`)} { color: ${l}; }`)}const UL={"4xs":"var(--font-size-4xs)","3xs":"var(--font-size-3xs)","2xs":"var(--font-size-2xs)",xsm:"var(--font-size-xs)",sm:"var(--font-size-sm)",base:"var(--font-size-base)",lg:"var(--font-size-lg)",xl:"var(--font-size-xl)","2xl":"var(--font-size-2xl)","3xl":"var(--font-size-3xl)","4xl":"var(--font-size-4xl)"};function FL(e,t){if("text"in e)for(const[n,s]of Object.entries(UL)){const r=z4(`size:${n}`);t.push(` ${Mu("text",r)} { font-size: ${s}; }`)}}function VL(e){const t=BL(e),n=[],s=[];for(const r of t)r.trimStart().startsWith(":where(")?n.push(r):s.push(r);return{component:s,prose:n}}function GL(e){const t=[],n=Bj(e.name);for(const r of["dark","light"]){const i=r==="dark"?e.__onDark:e.__onLight;if(!i)continue;const a=Object.entries(i.tokens);if(a.length>0){const l=a.map(([c,u])=>` ${c}: ${u};`).join(`
|
|
53
|
-
`);t.push(` ${qb(r)} {
|
|
54
|
-
${l}
|
|
55
|
-
}`)}if(i.components)for(const[l,c]of Object.entries(i.components))for(const[u,d]of Object.entries(c)){const f=Object.entries(d);if(f.length===0)continue;const p=z4(u),x=`:is(${qb(r)}) :is(${Mu(l,p)})`,g=[],v=[];for(const[y,m]of f)y.startsWith(":")&&typeof m=="object"?v.push([y,m]):g.push([y,m]);if(g.length>0){const y=g.map(([m,k])=>` ${rx(m)}: ${k};`).join(`
|
|
56
|
-
`);t.push(` ${x} {
|
|
57
|
-
${y}
|
|
58
|
-
}`)}for(const[y,m]of v){const k=Object.entries(m);if(k.length>0){const b=k.map(([j,A])=>` ${rx(j)}: ${A};`).join(`
|
|
59
|
-
`);t.push(` ${qj(x,y)} {
|
|
60
|
-
${b}
|
|
61
|
-
}`)}}}}if(t.length===0)return"";const s=t.join(`
|
|
62
|
-
|
|
63
|
-
`);return`@scope (${n}) to (${Hj}) {
|
|
64
|
-
${s}
|
|
65
|
-
}`}function WL(e){const{component:t,prose:n}=VL(e),s=Bj(e.name),r=Hj;let i="";if(n.length>0){const c=n.join(`
|
|
66
|
-
|
|
67
|
-
`);i=`@scope (${s}) to (${r}) {
|
|
68
|
-
${c}
|
|
69
|
-
}`}let a="";if(t.length>0){const c=t.join(`
|
|
70
|
-
|
|
71
|
-
`);a=`@scope (${s}) to (${r}) {
|
|
72
|
-
${c}
|
|
73
|
-
}`}const l=GL(e);return l&&(a=a?`${a}
|
|
74
|
-
|
|
75
|
-
${l}`:l),{prose:i,component:a}}const Pj={...RI,...II,...LI,...OI,...DI,...BI,...HI,...qI,...PI,...UI,...FI,...RL};function KL(e){return`var(${e})`}Object.fromEntries(Object.keys(Pj).map(e=>[e,KL(e)]));function B4(e){let t=0,n=null,s=!1;for(let r=0;r<e.length;r++){const i=e[r];if(n!==null){s?s=!1:i==="\\"?s=!0:i===n&&(n=null);continue}if(i==='"'||i==="'"){n=i;continue}if(i==="("){t++;continue}if(i===")"){t=Math.max(0,t-1);continue}if(i===","&&t===0)return[e.slice(0,r).trim(),e.slice(r+1).trim()]}return null}function XL(e){const t=e.trim(),n="light-dark(";if(!t.startsWith(n)||!t.endsWith(")"))return null;const s=t.slice(n.length,-1);return B4(s)}function Om(e,t){if(Array.isArray(e))return t==="dark"?e[1]:e[0];const n=XL(e);return n!==null?t==="dark"?n[1]:n[0]:e}function Uj(e,t){let n=0;for(let s=t;s<e.length;s++){const r=e[s];if(r==="(")n++;else if(r===")"&&(n--,n===0))return s}return-1}function Pb(e){const t=e.trim(),n=t.match(/\s+([\d.]+)%$/);return n?{color:t.slice(0,n.index).trim(),percentage:parseFloat(n[1])}:{color:t,percentage:null}}function ZL(e){const t=e.match(/^in\s+([\w-]+)\s*,\s*(.+)$/s);if(!t)return null;const[,n,s]=t;if(n.toLowerCase()!=="srgb")return null;const r=B4(s);if(r===null)return null;const i=Pb(r[0]),a=Pb(r[1]);if(i===null||a===null)return null;const l=Db(i.color),c=Db(a.color);if(l===null||c===null)return null;let u,d;i.percentage!==null&&a.percentage!==null?(u=i.percentage,d=a.percentage):i.percentage!==null?(u=i.percentage,d=100-u):a.percentage!==null?(d=a.percentage,u=100-d):(u=50,d=50);const f=u+d;if(f<=0)return null;const p=u/f,x=d/f,g=f<100?f/100:1,v=p*l.a+x*c.a,y=(A,M)=>p*A*l.a+x*M*c.a,m=y(l.r,c.r),k=y(l.g,c.g),b=y(l.b,c.b),j=v===0?{r:0,g:0,b:0}:{r:m/v,g:k/v,b:b/v};return gL({...j,a:v*g})}function Ty(e){const t=e.indexOf("color-mix(");if(t===-1)return e;const n=t+9,s=Uj(e,n);if(s===-1)return e;const r=Ty(e.slice(n+1,s)),a=ZL(r)??`color-mix(${r})`;return e.slice(0,t)+a+Ty(e.slice(s+1))}function zy(e,t,n,s){const r=e.indexOf("var(");if(r===-1)return e;const i=r+3,a=Uj(e,i);if(a===-1)return e;const l=e.slice(i+1,a),c=B4(l),u=(c?c[0]:l).trim(),d=c?c[1]:null;let f;s.has(u)?f=e.slice(r,a+1):u in t?(s.add(u),f=Fj(u,t,n,s),s.delete(u)):d!==null?f=zy(d.trim(),t,n,s):f=e.slice(r,a+1);const p=zy(e.slice(a+1),t,n,s);return e.slice(0,r)+f+p}function YL(e,t,n,s){if(!e.includes("var(")&&!e.includes("color-mix("))return e;const r=zy(e,t,n,s);return Ty(r)}function Fj(e,t,n,s){if(e in n)return n[e];const r=t[e];if(r===void 0)return"";const i=YL(r,t,n,s);return n[e]=i,i}function Ub(e){const t={};for(const n of Object.keys(e))Fj(n,e,t,new Set);return t}function QL(e,t){const{mode:n}=t,s={};for(const[r,i]of Object.entries(Pj))s[r]=Om(i,n);if(e==null)return Ub(s);for(const[r,i]of Object.entries(e.tokens))s[r]=Om(i,n);if(e.__inputTokens)for(const[r,i]of Object.entries(e.__inputTokens))i!==void 0&&(s[r]=Om(i,n));return Ub(s)}function Ya(e,t=!1){const n=h.useCallback(i=>{const a=window.matchMedia(e);return a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[e]),s=h.useCallback(()=>window.matchMedia(e).matches,[e]),r=h.useCallback(()=>t,[t]);return h.useSyncExternalStore(n,s,r)}const bg=h.createContext(null);bg.displayName="ThemeContext";function JL(){if(typeof document>"u")return null;const e=document.documentElement.getAttribute("data-theme");return e==="light"||e==="dark"?e:null}function eO(){return null}function tO(){return typeof document>"u"?null:document.documentElement.getAttribute(Ls("theme"))}function nO(){return null}function Vj(){return null}const Af=new Set;let cf=null;const Mf=new Set;let uf=null;function sO(){for(const e of Af)e()}function rO(e){return Af.add(e),Af.size===1&&typeof MutationObserver<"u"&&(cf=new MutationObserver(sO),cf.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})),()=>{Af.delete(e),Af.size===0&&cf&&(cf.disconnect(),cf=null)}}function iO(){for(const e of Mf)e()}function oO(e){return Mf.add(e),Mf.size===1&&typeof MutationObserver<"u"&&(uf=new MutationObserver(iO),uf.observe(document.documentElement,{attributes:!0,attributeFilter:[Ls("theme")]})),()=>{Mf.delete(e),Mf.size===0&&uf&&(uf.disconnect(),uf=null)}}function Gj(){return()=>{}}function aO(e){return h.useSyncExternalStore(e?Gj:rO,e?Vj:JL,eO)}function Wj(e){return h.useSyncExternalStore(e?Gj:oO,e?Vj:tO,nO)}function Kj(){const e=h.use(bg),t=e!=null,n=Wj(t);return(e==null?void 0:e.theme.name)??n}function wg(){const e=h.use(bg),t=e!=null,n=aO(t),s=Wj(t),r=Ya("(prefers-color-scheme: dark)"),i=(e==null?void 0:e.mode)??n??"system",a=(e==null?void 0:e.theme)??Dj(s),l=i==="system"?r?"dark":"light":i,c=h.useMemo(()=>QL(a,{mode:l}),[a,l]),u=d=>c[d]??"";return{name:(a==null?void 0:a.name)??"default",mode:l,token:u,tokens:c}}const lO="modulepreload",cO=function(e){return"/"+e},Fb={},jg=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=cO(c),c in Fb)return;Fb[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":lO,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((p,x)=>{f.addEventListener("load",p),f.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},H4={primary:{kMwMTN:"x1tgivj0",$$css:!0},secondary:{kMwMTN:"xv1l7n4",$$css:!0},disabled:{kMwMTN:"xnbbluu",$$css:!0},placeholder:{kMwMTN:"xv1l7n4",$$css:!0},accent:{kMwMTN:"xjse4m1",$$css:!0},inherit:{kMwMTN:"x1heor9g",$$css:!0}},uO={normal:{k63SB2:"x1sodnla",$$css:!0},medium:{k63SB2:"x1e4wzip",$$css:!0},semibold:{k63SB2:"x2mo6ok",$$css:!0},bold:{k63SB2:"x1lvx875",$$css:!0}},Xj={body:{k63SB2:"xxovm9e",$$css:!0},large:{k63SB2:"x149oux8",$$css:!0},label:{k63SB2:"xmhvcl5",$$css:!0},code:{k63SB2:"xx3eeay",$$css:!0},supporting:{k63SB2:"xv8on6e",$$css:!0},"display-1":{k63SB2:"x1txul5o",$$css:!0},"display-2":{k63SB2:"x1y36c3f",$$css:!0},"display-3":{k63SB2:"x1on40hk",$$css:!0},inherit:{k63SB2:"x1pd3egz",$$css:!0}},q4={body:{kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",$$css:!0},large:{kGuDYH:"x18juvz8",kLWn49:"xf74fhv",$$css:!0},label:{kGuDYH:"xcr08ib",kLWn49:"x1kq96og",$$css:!0},code:{kGuDYH:"xp03k98",kLWn49:"x17iicif",kMv6JI:"x9m5x89",$$css:!0},supporting:{kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",$$css:!0},"display-1":{kGuDYH:"xsub3ws",kLWn49:"x112ttwr",$$css:!0},"display-2":{kGuDYH:"x1yego12",kLWn49:"xh0iwvy",$$css:!0},"display-3":{kGuDYH:"xlgnzhf",kLWn49:"x1ujwuaq",$$css:!0},inherit:{kGuDYH:"x1qlqyl8",kLWn49:"x15bjb6t",$$css:!0}},dO={"4xs":{kGuDYH:"xxc45ev",$$css:!0},"3xs":{kGuDYH:"x10p7juq",$$css:!0},"2xs":{kGuDYH:"x16a80zy",$$css:!0},xsm:{kGuDYH:"x51wmvv",$$css:!0},sm:{kGuDYH:"x1eqnyfr",$$css:!0},base:{kGuDYH:"x1j29vfg",$$css:!0},lg:{kGuDYH:"xc7cgfe",$$css:!0},xl:{kGuDYH:"x1wqms48",$$css:!0},"2xl":{kGuDYH:"xhs0kqb",$$css:!0},"3xl":{kGuDYH:"x10srzze",$$css:!0},"4xl":{kGuDYH:"xqcvi3d",$$css:!0}},fO={1:{kGuDYH:"xcg7oai",kLWn49:"xfmsba7",k63SB2:"x1v68xuy",$$css:!0},2:{kGuDYH:"x1xvnhcw",kLWn49:"x1cpk1wn",k63SB2:"x12yy4cs",$$css:!0},3:{kGuDYH:"xii13ha",kLWn49:"xwjzt0u",k63SB2:"x1jcxfy8",$$css:!0},4:{kGuDYH:"x8tkxat",kLWn49:"xqerer",k63SB2:"x2hcmsi",$$css:!0},5:{kGuDYH:"xsgqta0",kLWn49:"xo3gurs",k63SB2:"xno150v",$$css:!0},6:{kGuDYH:"xw5ohdf",kLWn49:"xeixjfn",k63SB2:"x1pw4frv",$$css:!0}},Zj={inline:{k1xSpc:"xt0psk2",$$css:!0},block:{k1xSpc:"x1lliihq",$$css:!0}},ix={singleLine:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",k1xSpc:"x1lliihq",$$css:!0},multiLine:{kVQacm:"xb3r6kr",k1xSpc:"x104kibb",kgKLqz:"x1ua5tub",$$css:!0}},Yj={"break-word":{kTgw9:"x1lldw8n",kHjlTd:"x1mzt3pk",$$css:!0},"break-all":{kTgw9:"x1yn0g08",$$css:!0}},Qj={wrap:{kN2L0X:"xk4td0m",$$css:!0},nowrap:{kN2L0X:"xebhuq6",$$css:!0},balance:{kN2L0X:"x1w2vvpw",$$css:!0},pretty:{kN2L0X:"x1fzhlzt",$$css:!0}},Jj={enabled:{kxwWH2:"x1b2iylo",kzeHkT:"xwgcxoh",k1xSpc:"x1lliihq",$$css:!0}},eS={strikethrough:{kybGjl:"xmqliwb",$$css:!0}},hO={enabled:{kcqcaj:"xss6m8b",$$css:!0}},tS={start:{k9WMMc:"x1yc453h",$$css:!0},center:{k9WMMc:"x2b8uid",$$css:!0},end:{k9WMMc:"xp4054r",$$css:!0}},nS={content:{ks0D6T:"xw5ewwj",kTgw9:"x13faqbe",$$css:!0}};function sS(e){const{maxLines:t}=e,[n,s]=h.useState(!1),[r,i]=h.useState(""),a=h.useRef(null),l=h.useCallback(u=>{if(t===0){s(!1);return}if(i(u.textContent??""),t===1)s(u.scrollWidth>u.offsetWidth);else{let d=u.scrollHeight;try{const f=document.createRange();f.selectNodeContents(u),d=f.getBoundingClientRect().height,f.detach()}catch{}s(d>u.offsetHeight)}},[t]);return{ref:h.useCallback(u=>{a.current&&R4(a.current),a.current=u,u&&t>0?typeof ResizeObserver<"u"?_4(u,()=>{l(u)}):l(u):(s(!1),i(""))},[t,l]),isTruncated:n,fullText:r}}const pO=h.lazy(async()=>jg(()=>Promise.resolve().then(()=>OS),void 0).then(e=>({default:e.Tooltip}))),xO={body:"primary",large:"primary",label:"primary",supporting:"secondary",code:"primary","display-1":"primary","display-2":"primary","display-3":"primary",inherit:"inherit"};function gO(e){return e in q4?e:"body"}function rS(e){return e in H4?e:"primary"}function K({type:e="body",size:t,color:n,weight:s,display:r="inline",maxLines:i=0,hasTruncateTooltip:a=!0,wordBreak:l,textWrap:c,justify:u="start",hasCapsize:d=!1,hasStrikethrough:f=!1,hasTabularNumbers:p=!1,xstyle:x,className:g,style:v,as:y="span",children:m,ref:k,...b}){const j=n??xO[e]??"primary",A=gO(e),M=rS(j),T=l??(i===1?"break-all":"break-word"),z=i>0||d?"block":r,$=sS({maxLines:i}),E=typeof a=="string"?a:"above",N=i>0&&a!==!1&&$.isTruncated,_=h.useRef(null),R=i>1?{WebkitLineClamp:i}:void 0;return o.jsxs(o.Fragment,{children:[o.jsx(y,{ref:Ft(k,$.ref,_),...ne(J("text",{type:e,size:t,color:j}),G(H4[M],q4[A],t&&dO[t],Xj[A],s&&uO[s],i===1?ix.singleLine:i>1?ix.multiLine:Zj[z],i>0&&Yj[T],c&&Qj[c],u!=="start"&&tS[u],d&&Jj.enabled,f&&eS.strikethrough,p&&hO.enabled,x),g,{...v,...R}),title:N?$.fullText:void 0,...b,children:m}),N&&o.jsx(h.Suspense,{fallback:null,children:o.jsx(pO,{anchorRef:_,content:o.jsx("span",{...G(nS.content),children:$.fullText}),placement:E})})]})}K.displayName="Text";const mO=.75,Vb=1.5,Gb={sm:{diameter:10,border:2},md:{diameter:14,border:3},lg:{diameter:18,border:3},xl:{diameter:28,border:4}},Wb={wrapper:{k1xSpc:"x3nfvp2",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},spinner:{k1xSpc:"xwz0xwf",kgQiWS:"x1ku5rj1",kVQacm:"xb3r6kr",kXLuUW:"xxymvpz",$$css:!0}};function Vt({size:e="md",shade:t="default",label:n,xstyle:s,className:r,style:i,"aria-label":a,"data-testid":l,ref:c,...u}){const d=h.useRef(null),{tokens:f}=wg();h.useEffect(()=>{const j=d.current;if(j==null)return;const A=j.getContext("2d");if(!A)return;const{border:M,diameter:T}=Gb[e],z=window.devicePixelRatio||1,$=t==="inherit"?getComputedStyle(j).color:null,E=t==="inherit"?$:t==="onMedia"?f["--color-on-dark"]:t==="subtle"?f["--color-text-secondary"]:f["--color-accent"],N=t==="inherit"?$:t==="onMedia"?`${f["--color-on-dark"]}4D`:f["--color-track"],_=T+M*2,R=Math.round(_*z),B=R+R%2,D=B/_,I=T/2*D,O=M*D;j.height=j.width=B,j.style.width=j.style.height=_+"px",A.lineCap="round",A.lineWidth=O;const L=B/2;A.beginPath(),A.arc(L,L,I,0,2*Math.PI),A.strokeStyle=N,t==="inherit"&&(A.globalAlpha=.3),A.stroke(),A.globalAlpha=1,A.beginPath(),A.arc(L,L,I,Vb*Math.PI,(Vb+mO)%2*Math.PI),A.strokeStyle=E,A.stroke()},[t,e,f]);const{border:p,diameter:x}=Gb[e],g=x+p*2,v=n!=null,y=h.useId(),m=v&&typeof n=="string"&&a==null,k=a??(typeof n=="string"?n:void 0)??"Loading",b=o.jsx("span",{ref:v?void 0:c,role:"status","aria-label":m?void 0:k,"aria-labelledby":m?y:void 0,"data-testid":v?void 0:l,...v?{}:u,...ne(v?"":J("spinner",{size:e,shade:t}),G(Wb.spinner,!v&&s),v?void 0:r,{...v?{}:i,width:g,height:g}),children:o.jsx("canvas",{ref:d,className:"xlp1x4z x1lliihq x1so62im x14qxm4i xnh0sag xa4qsjk x1ka1v4i x1esw782"})});return v?o.jsxs("div",{ref:c,"data-testid":l,...u,...ne(J("spinner",{size:e,shade:t}),G(Wb.wrapper,s),r,i),children:[b,typeof n=="string"?o.jsx(K,{id:y,type:"body",weight:"bold",children:n}):n]}):b}Vt.displayName="Spinner";function Gi({children:e,as:t="span",ref:n,...s}){return h.createElement(t,{ref:n,...s,className:"x10l6tqk x1i1rx1s xjm9jq1 xkdpibf x1717udv xb3r6kr xzpqnlu xuxw1ft xng3xce x13vifvy x1o0tod x47corl x87ps6o"},e)}Gi.displayName="VisuallyHidden";const ox="data-astryx-edge-comp",yO={keTefX:"x1kftj4p",k71WvV:"x92e2el",$$css:!0},vO={inset:e=>[yO,{"--x-126w13d":(t=>typeof t=="number"?t+"px":t??void 0)(`calc(-1 * ${e})`),"--x-4drmnv":(t=>typeof t=="number"?t+"px":t??void 0)(`calc(-1 * ${e})`)}]},P4=h.createContext(null);P4.displayName="SizeContext";function Qa(e,t="md"){const n=h.use(P4);return e??n??t}P4.Provider;const iS=h.createContext(null);iS.displayName="ButtonGroupContext";function kO(){return h.use(iS)}const oS=h.createContext(null);oS.displayName="LinkContext";function bO(e){function t({href:n,ref:s,...r}){return h.createElement(e,{ref:s,href:n,to:n,...r})}return t.displayName=`LinkWithTo(${typeof e=="string"?e:e.displayName||e.name||"Component"})`,t}function Ja(e){const t=h.use(oS),n=e??(t==null?void 0:t.component)??"a";return h.useMemo(()=>n==="a"?"a":bO(n),[n])}const U4=h.createContext({locale:"en",direction:"ltr",messages:{}});U4.displayName="InternationalizationContext";function wO(e){try{const t=new Intl.Locale(e),n=typeof t.getTextInfo=="function"?t.getTextInfo():t.textInfo;return(n==null?void 0:n.direction)==="rtl"?"rtl":"ltr"}catch{return"ltr"}}function F4({locale:e,messages:t,overrides:n,dir:s,children:r}){const i=s??wO(e),a=h.useMemo(()=>({locale:e,direction:i,messages:t??{},overrides:n}),[e,i,t,n]);return o.jsx(U4,{value:a,children:r})}F4.displayName="InternationalizationProvider";function Dm(e,t){const n=t&&t.cache?t.cache:MO,s=t&&t.serializer?t.serializer:$O;return(t&&t.strategy?t.strategy:CO)(e,{cache:n,serializer:s})}function jO(e){return e==null||typeof e=="number"||typeof e=="boolean"}function SO(e,t,n,s){const r=jO(s)?s:n(s);let i=t.get(r);return typeof i>"u"&&(i=e.call(this,s),t.set(r,i)),i}function aS(e,t,n){const s=Array.prototype.slice.call(arguments,3),r=n(s);let i=t.get(r);return typeof i>"u"&&(i=e.apply(this,s),t.set(r,i)),i}function lS(e,t,n,s,r){return n.bind(t,e,s,r)}function CO(e,t){const n=e.length===1?SO:aS;return lS(e,this,n,t.cache.create(),t.serializer)}function EO(e,t){return lS(e,this,aS,t.cache.create(),t.serializer)}const $O=function(){return JSON.stringify(arguments)};var AO=class{constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}};const MO={create:function(){return new AO}},Bm={variadic:EO},TO=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function zO(e){const t={};return e.replace(TO,n=>{const s=n.length;switch(n[0]){case"G":t.era=s===4?"long":s===5?"narrow":"short";break;case"y":t.year=s===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][s-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][s-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=s===4?"long":s===5?"narrow":"short";break;case"e":if(s<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][s-3];break;case"c":if(s<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][s-3];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][s-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][s-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][s-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][s-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][s-1];break;case"s":t.second=["numeric","2-digit"][s-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=s<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}const NO=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function _O(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");const t=e.split(NO).filter(s=>s.length>0),n=[];for(const s of t){let r=s.split("/");if(r.length===0)throw new Error("Invalid number skeleton");const[i,...a]=r;for(const l of a)if(l.length===0)throw new Error("Invalid number skeleton");n.push({stem:i,options:a})}return n}function RO(e){return e.replace(/^(.*?)-/,"")}const Kb=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,cS=/^(@+)?(\+|#+)?[rs]?$/g,IO=/(\*)(0+)|(#+)(0+)|(0+)/g,uS=/^(0+)$/;function Xb(e){const t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(cS,function(n,s,r){return typeof r!="string"?(t.minimumSignificantDigits=s.length,t.maximumSignificantDigits=s.length):r==="+"?t.minimumSignificantDigits=s.length:s[0]==="#"?t.maximumSignificantDigits=s.length:(t.minimumSignificantDigits=s.length,t.maximumSignificantDigits=s.length+(typeof r=="string"?r.length:0)),""}),t}function dS(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function LO(e){let t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){const n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!uS.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Zb(e){const t={},n=dS(e);return n||t}function OO(e){let t={};for(const n of e){switch(n.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=n.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=RO(n.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...n.options.reduce((i,a)=>({...i,...Zb(a)}),{})};continue;case"engineering":t={...t,notation:"engineering",...n.options.reduce((i,a)=>({...i,...Zb(a)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(n.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(n.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");n.options[0].replace(IO,function(i,a,l,c,u,d){if(a)t.minimumIntegerDigits=l.length;else{if(c&&u)throw new Error("We currently do not support maximum integer digits");if(d)throw new Error("We currently do not support exact integer digits")}return""});continue}if(uS.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(Kb.test(n.stem)){if(n.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");n.stem.replace(Kb,function(a,l,c,u,d,f){return c==="*"?t.minimumFractionDigits=l.length:u&&u[0]==="#"?t.maximumFractionDigits=u.length:d&&f?(t.minimumFractionDigits=d.length,t.maximumFractionDigits=d.length+f.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});const i=n.options[0];i==="w"?t={...t,trailingZeroDisplay:"stripIfInteger"}:i&&(t={...t,...Xb(i)});continue}if(cS.test(n.stem)){t={...t,...Xb(n.stem)};continue}const s=dS(n.stem);s&&(t={...t,...s});const r=LO(n.stem);r&&(t={...t,...r})}return t}let DO=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e}({});function Yb(e){return e.type===0}function BO(e){return e.type===1}function fS(e){return e.type===2}function hS(e){return e.type===3}function pS(e){return e.type===4}function xS(e){return e.type===5}function gS(e){return e.type===6}function HO(e){return e.type===7}function mS(e){return e.type===8}function yS(e){return!!(e&&typeof e=="object"&&e.type===0)}function Ny(e){return!!(e&&typeof e=="object"&&e.type===1)}const vS=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,df={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function qO(e,t){let n="";for(let s=0;s<e.length;s++){const r=e.charAt(s);if(r==="j"){let i=0;for(;s+1<e.length&&e.charAt(s+1)===r;)i++,s++;let a=1+(i&1),l=i<2?1:3+(i>>1),c="a",u=PO(t);for((u=="H"||u=="k")&&(l=0);l-- >0;)n+=c;for(;a-- >0;)n=u+n}else r==="J"?n+="H":n+=r}return n}function PO(e){var r,i;let t=e.hourCycle;if(t===void 0){const a=e;t=((r=a.getHourCycles)==null?void 0:r.call(a)[0])??((i=a.hourCycles)==null?void 0:i[0])}if(t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}const n=e.language;let s;return n!=="root"&&(s=e.maximize().region),(df[`${n}-${s}`]||df[s||""]||df[n||""]||df[`${n}-001`]||df["001"])[0].charAt(0)}const UO=new RegExp(`^${vS.source}*`),FO=new RegExp(`${vS.source}*$`);function Xe(e,t){return{start:e,end:t}}const VO=!!Object.fromEntries,GO=!!String.prototype.trimStart,WO=!!String.prototype.trimEnd,Qb=VO?Object.fromEntries:function(t){const n={};for(const[s,r]of t)n[s]=r;return n},KO=GO?function(t){return t.trimStart()}:function(t){return t.replace(UO,"")},XO=WO?function(t){return t.trimEnd()}:function(t){return t.replace(FO,"")},Jb=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");function ZO(e,t){return Jb.lastIndex=t,Jb.exec(e)[1]??""}function YO(e){if(e.length===0)return null;let t=1,n=1;for(let s=0;s<e.length;){const r=e.charCodeAt(s);switch(r){case 35:case 39:case 60:case 123:case 125:return null}if(r===10)t++,n=1,s++;else if(n++,r>=55296&&r<=56319&&s+1<e.length){const i=e.charCodeAt(s+1);s+=i>=56320&&i<=57343?2:1}else s++}return{offset:e.length,line:t,column:n}}var QO=class{constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(this.offset()!==0)throw Error("parser can only be used once");if(this.message.length>0){const e=this.message.charCodeAt(0);if(e!==35&&e!==39&&e!==60&&e!==123&&e!==125){const t=YO(this.message);if(t){const n=this.clonePosition();return this.position=t,{val:[{type:0,value:this.message,location:Xe(n,this.clonePosition())}],err:null}}}}return this.parseMessage(0,"",!1)}parseMessage(e,t,n){let s=[];for(;!this.isEOF();){const r=this.char();if(r===123){const i=this.parseArgument(e,n);if(i.err)return i;s.push(i.val)}else{if(r===125&&e>0)break;if(r===35&&(t==="plural"||t==="selectordinal")){const i=this.clonePosition();this.bump(),s.push({type:7,location:Xe(i,this.clonePosition())})}else if(r===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(26,Xe(this.clonePosition(),this.clonePosition()))}else if(r===60&&!this.ignoreTag&&_y(this.peek()||0)){const i=this.parseTag(e,t);if(i.err)return i;s.push(i.val)}else{const i=this.parseLiteral(e,t);if(i.err)return i;s.push(i.val)}}}return{val:s,err:null}}parseTag(e,t){const n=this.clonePosition();this.bump();const s=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:0,value:`<${s}/>`,location:Xe(n,this.clonePosition())},err:null};if(this.bumpIf(">")){const r=this.parseMessage(e+1,t,!0);if(r.err)return r;const i=r.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!_y(this.char()))return this.error(23,Xe(a,this.clonePosition()));const l=this.clonePosition();return s!==this.parseTagName()?this.error(26,Xe(l,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:8,value:s,children:i,location:Xe(n,this.clonePosition())},err:null}:this.error(23,Xe(a,this.clonePosition())))}else return this.error(27,Xe(n,this.clonePosition()))}else return this.error(23,Xe(n,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&eD(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const n=this.clonePosition();let s="";for(;;){const i=this.tryParseQuote(t);if(i){s+=i;continue}const a=this.tryParseUnquoted(e,t);if(a){s+=a;continue}const l=this.tryParseLeftAngleBracket();if(l){s+=l;continue}break}const r=Xe(n,this.clonePosition());return{val:{type:0,value:s,location:r},err:null}}tryParseLeftAngleBracket(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!JO(this.peek()||0))?(this.bump(),"<"):null}tryParseQuote(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const n=this.char();if(n===39)if(this.peek()===39)t.push(39),this.bump();else{this.bump();break}else t.push(n);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const n=this.char();return n===60||n===123||n===35&&(t==="plural"||t==="selectordinal")||n===125&&e>0?null:(this.bump(),String.fromCodePoint(n))}parseArgument(e,t){const n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(1,Xe(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(2,Xe(n,this.clonePosition()));let s=this.parseIdentifierIfPossible().value;if(!s)return this.error(3,Xe(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(1,Xe(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:1,value:s,location:Xe(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(1,Xe(n,this.clonePosition())):this.parseArgumentOptions(e,t,s,n);default:return this.error(3,Xe(n,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),n=ZO(this.message,t),s=t+n.length;return this.bumpTo(s),{value:n,location:Xe(e,this.clonePosition())}}parseArgumentOptions(e,t,n,s){let r=this.clonePosition(),i=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(i){case"":return this.error(4,Xe(r,a));case"number":case"date":case"time":{this.bumpSpace();let l=null;if(this.bumpIf(",")){this.bumpSpace();const d=this.clonePosition(),f=this.parseSimpleArgStyleIfPossible();if(f.err)return f;const p=XO(f.val);if(p.length===0)return this.error(6,Xe(this.clonePosition(),this.clonePosition()));l={style:p,styleLocation:Xe(d,this.clonePosition())}}const c=this.tryParseArgumentClose(s);if(c.err)return c;const u=Xe(s,this.clonePosition());if(l&&l.style.startsWith("::")){let d=KO(l.style.slice(2));if(i==="number"){const f=this.parseNumberSkeletonFromString(d,l.styleLocation);return f.err?f:{val:{type:2,value:n,location:u,style:f.val},err:null}}else{if(d.length===0)return this.error(10,u);let f=d;this.locale&&(f=qO(d,this.locale));const p={type:1,pattern:f,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?zO(f):{}};return{val:{type:i==="date"?3:4,value:n,location:u,style:p},err:null}}}return{val:{type:i==="number"?2:i==="date"?3:4,value:n,location:u,style:(l==null?void 0:l.style)??null},err:null}}case"plural":case"selectordinal":case"select":{const l=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(12,Xe(l,{...l}));this.bumpSpace();let c=this.parseIdentifierIfPossible(),u=0;if(i!=="select"&&c.value==="offset"){if(!this.bumpIf(":"))return this.error(13,Xe(this.clonePosition(),this.clonePosition()));this.bumpSpace();const x=this.tryParseDecimalInteger(13,14);if(x.err)return x;this.bumpSpace(),c=this.parseIdentifierIfPossible(),u=x.val}const d=this.tryParsePluralOrSelectOptions(e,i,t,c);if(d.err)return d;const f=this.tryParseArgumentClose(s);if(f.err)return f;const p=Xe(s,this.clonePosition());return i==="select"?{val:{type:5,value:n,options:Qb(d.val),location:p},err:null}:{val:{type:6,value:n,options:Qb(d.val),offset:u,pluralType:i==="plural"?"cardinal":"ordinal",location:p},err:null}}default:return this.error(5,Xe(r,a))}}tryParseArgumentClose(e){return this.isEOF()||this.char()!==125?this.error(1,Xe(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();)switch(this.char()){case 39:{this.bump();let n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(11,Xe(n,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(e>0)e-=1;else return{val:this.message.slice(t.offset,this.offset()),err:null};break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let n=[];try{n=_O(e)}catch{return this.error(7,t)}return{val:{type:0,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?OO(n):{}},err:null}}tryParsePluralOrSelectOptions(e,t,n,s){let r=!1;const i=[],a=new Set;let{value:l,location:c}=s;for(;;){if(l.length===0){const p=this.clonePosition();if(t!=="select"&&this.bumpIf("=")){const x=this.tryParseDecimalInteger(16,19);if(x.err)return x;c=Xe(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(a.has(l))return this.error(t==="select"?21:20,c);l==="other"&&(r=!0),this.bumpSpace();const u=this.clonePosition();if(!this.bumpIf("{"))return this.error(t==="select"?17:18,Xe(this.clonePosition(),this.clonePosition()));const d=this.parseMessage(e+1,t,n);if(d.err)return d;const f=this.tryParseArgumentClose(u);if(f.err)return f;i.push([l,{value:d.val,location:Xe(u,this.clonePosition())}]),a.add(l),this.bumpSpace(),{value:l,location:c}=this.parseIdentifierIfPossible()}return i.length===0?this.error(t==="select"?15:16,Xe(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!r?this.error(22,Xe(this.clonePosition(),this.clonePosition())):{val:i,err:null}}tryParseDecimalInteger(e,t){let n=1;const s=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);let r=!1,i=0;for(;!this.isEOF();){const l=this.char();if(l>=48&&l<=57)r=!0,i=i*10+(l-48),this.bump();else break}const a=Xe(s,this.clonePosition());return r?(i*=n,Number.isSafeInteger(i)?{val:i,err:null}:this.error(t,a)):this.error(e,a)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");const t=this.message.codePointAt(e);if(t===void 0)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&tD(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}};function _y(e){return e>=97&&e<=122||e>=65&&e<=90}function JO(e){return _y(e)||e===47}function eD(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function tD(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Ry(e){e.forEach(t=>{if(delete t.location,xS(t)||gS(t))for(const n in t.options)delete t.options[n].location,Ry(t.options[n].value);else fS(t)&&yS(t.style)||(hS(t)||pS(t))&&Ny(t.style)?delete t.style.location:mS(t)&&Ry(t.children)})}function nD(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const n=new QO(e,t).parse();if(n.err){const s=SyntaxError(DO[n.err.kind]);throw s.location=n.err.location,s.originalMessage=n.err.message,s}return t!=null&&t.captureLocation||Ry(n.val),n.val}var Sg=class extends Error{constructor(e,t,n){super(e),this.code=t,this.originalMessage=n}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}},e6=class extends Sg{constructor(e,t,n,s){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(n).join('", "')}"`,"INVALID_VALUE",s)}},sD=class extends Sg{constructor(e,t,n){super(`Value for "${e}" must be of type ${t}`,"INVALID_VALUE",n)}},rD=class extends Sg{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,"MISSING_VALUE",t)}};function iD(e){return e.length<2?e:e.reduce((t,n)=>{const s=t[t.length-1];return!s||s.type!==0||n.type!==0?t.push(n):s.value+=n.value,t},[])}function oD(e){return typeof e=="function"}function Y0(e,t,n,s,r,i,a){if(e.length===1&&Yb(e[0]))return[{type:0,value:e[0].value}];const l=[];for(const c of e){if(Yb(c)){l.push({type:0,value:c.value});continue}if(HO(c)){typeof i=="number"&&l.push({type:0,value:n.getNumberFormat(t).format(i)});continue}const{value:u}=c;if(!(r&&u in r))throw new rD(u,a);let d=r[u];if(BO(c)){(!d||typeof d=="string"||typeof d=="number"||typeof d=="bigint")&&(d=typeof d=="string"||typeof d=="number"||typeof d=="bigint"?String(d):""),l.push({type:typeof d=="string"?0:1,value:d});continue}if(hS(c)){const f=typeof c.style=="string"?s.date[c.style]:Ny(c.style)?c.style.parsedOptions:void 0;l.push({type:0,value:n.getDateTimeFormat(t,f).format(d)});continue}if(pS(c)){const f=typeof c.style=="string"?s.time[c.style]:Ny(c.style)?c.style.parsedOptions:s.time.medium;l.push({type:0,value:n.getDateTimeFormat(t,f).format(d)});continue}if(fS(c)){const f=typeof c.style=="string"?s.number[c.style]:yS(c.style)?c.style.parsedOptions:void 0;if(f&&f.scale){const p=f.scale||1;if(typeof d=="bigint"){if(!Number.isInteger(p))throw new TypeError(`Cannot apply fractional scale ${p} to bigint value. Scale must be an integer when formatting bigint.`);d=d*BigInt(p)}else d=d*p}l.push({type:0,value:n.getNumberFormat(t,f).format(d)});continue}if(mS(c)){const{children:f,value:p}=c,x=r[p];if(!oD(x))throw new sD(p,"function",a);let g=x(Y0(f,t,n,s,r,i).map(v=>v.value));Array.isArray(g)||(g=[g]),l.push(...g.map(v=>({type:typeof v=="string"?0:1,value:v})))}if(xS(c)){const f=d,p=(Object.prototype.hasOwnProperty.call(c.options,f)?c.options[f]:void 0)||c.options.other;if(!p)throw new e6(c.value,d,Object.keys(c.options),a);l.push(...Y0(p.value,t,n,s,r));continue}if(gS(c)){const f=`=${d}`;let p=Object.prototype.hasOwnProperty.call(c.options,f)?c.options[f]:void 0;if(!p){if(!Intl.PluralRules)throw new Sg(`Intl.PluralRules is not available in this environment.
|
|
76
|
-
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
77
|
-
`,"MISSING_INTL_API",a);const g=typeof d=="bigint"?Number(d):d,v=n.getPluralRules(t,{type:c.pluralType}).select(g-(c.offset||0));p=(Object.prototype.hasOwnProperty.call(c.options,v)?c.options[v]:void 0)||c.options.other}if(!p)throw new e6(c.value,d,Object.keys(c.options),a);const x=typeof d=="bigint"?Number(d):d;l.push(...Y0(p.value,t,n,s,r,x-(c.offset||0)));continue}}return iD(l)}function aD(e,t){return t?{...e,...t,...Object.keys(e).reduce((n,s)=>(n[s]={...e[s],...t[s]},n),{})}:e}function lD(e,t){return t?Object.keys(e).reduce((n,s)=>(n[s]=aD(e[s],t[s]),n),{...e}):e}function Hm(e){return{create(){return{get(t){return e[t]},set(t,n){e[t]=n}}}}}function cD(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Dm((...t)=>new Intl.NumberFormat(...t),{cache:Hm(e.number),strategy:Bm.variadic}),getDateTimeFormat:Dm((...t)=>new Intl.DateTimeFormat(...t),{cache:Hm(e.dateTime),strategy:Bm.variadic}),getPluralRules:Dm((...t)=>new Intl.PluralRules(...t),{cache:Hm(e.pluralRules),strategy:Bm.variadic})}}var Fn,uD=(Fn=class{constructor(t,n=Fn.defaultLocale,s,r){if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=i=>{const a=this.formatToParts(i);if(a.length===1)return a[0].value;const l=a.reduce((c,u)=>(!c.length||u.type!==0||typeof c[c.length-1]!="string"?c.push(u.value):c[c.length-1]+=u.value,c),[]);return l.length<=1?l[0]||"":l},this.formatToParts=i=>Y0(this.ast,this.locales,this.formatters,this.formats,i,void 0,this.message),this.resolvedOptions=()=>{var i;return{locale:((i=this.resolvedLocale)==null?void 0:i.toString())||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}},this.getAst=()=>this.ast,this.locales=n,this.resolvedLocale=Fn.resolveLocale(n),typeof t=="string"){if(this.message=t,!Fn.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...i}=r||{};this.ast=Fn.__parse(t,{...i,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=lD(Fn.formats,s),this.formatters=r&&r.formatters||cD(this.formatterCache)}static get defaultLocale(){return Fn.memoizedDefaultLocale||(Fn.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),Fn.memoizedDefaultLocale}},Fn.memoizedDefaultLocale=null,Fn.resolveLocale=t=>{if(typeof Intl.Locale>"u")return;const n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])},Fn.__parse=nD,Fn.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},Fn),dD=uD;const fD={"@astryx.pagination.label":{defaultMessage:"Pagination",description:"Aria label for the pagination navigation region."},"@astryx.pagination.previous":{defaultMessage:"Go to previous page",description:"Aria label for the previous-page button."},"@astryx.pagination.next":{defaultMessage:"Go to next page",description:"Aria label for the next-page button."},"@astryx.pagination.previousBy":{defaultMessage:"Go back {step, number} {step, plural, one {page} other {pages}}",description:"Aria label for the previous button when it advances more than one page per click (the `step` prop > 1). `step` is the number of pages skipped."},"@astryx.pagination.nextBy":{defaultMessage:"Go forward {step, number} {step, plural, one {page} other {pages}}",description:"Aria label for the next button when it advances more than one page per click (the `step` prop > 1). `step` is the number of pages skipped."},"@astryx.pagination.first":{defaultMessage:"Go to first page",description:"Aria label for the first-page button (« double chevron) in the input pagination variant."},"@astryx.pagination.last":{defaultMessage:"Go to last page",description:"Aria label for the last-page button (» double chevron) in the input pagination variant."},"@astryx.pagination.goToPage":{defaultMessage:"Go to page {page, number}",description:"Aria label for an individual page-number button. `page` is 1-based."},"@astryx.pagination.goToPageInput":{defaultMessage:"Go to page",description:"Aria label for the editable page/row number box in the input pagination variant. No number — the box holds the value itself."},"@astryx.pagination.pageLabel":{defaultMessage:"Page",description:'Visible label before the editable box in the input pagination variant. Example: "Page [ 1 ] / 10".'},"@astryx.pagination.ofTotalPages":{defaultMessage:"/ {total, number}",description:'Visible total shown after the editable box in the input pagination variant. Example: the "/ 10" in "Page [ 1 ] / 10".'},"@astryx.pagination.pageIndicators":{defaultMessage:"Page indicators",description:"Aria label for the dots-variant page-indicator group."},"@astryx.pagination.itemsPerPage":{defaultMessage:"Items per page",description:"Label for the page-size selector."},"@astryx.pagination.count":{defaultMessage:"{from, number}–{to, number} of {total, number}",description:`Visible range-of-total text on a pagination bar. Example: "1–20 of 347"; the en-dash is translator's choice.`},"@astryx.pagination.pageOfTotal":{defaultMessage:"Page {current, number} of {total, number}",description:'Visible "Page X of Y" text on the compact pagination variant; also announced by screen readers. Keep short — sits in a compact toolbar.'},"@astryx.pagination.pageAnnounce":{defaultMessage:"Page {current, number}",description:"Screen-reader announcement when a page changes and total is unknown."},"@astryx.powersearch.editor.field":{defaultMessage:"Field",description:"Noun form-label above the field-picker dropdown in the PowerSearch filter-builder popover (which data column to filter on). Not an action."},"@astryx.powersearch.editor.operator":{defaultMessage:"Operator",description:'Noun form-label above the operator dropdown in the PowerSearch filter-builder popover. Refers to a comparison verb ("is", "contains"), not a math or phone operator.'},"@astryx.powersearch.editor.addFilter":{defaultMessage:"+ Add filter",description:'Button label inside a group in the PowerSearch filter-builder; adds another filter row (e.g. "Status = Active"). The leading "+ " is a plus-sign character.'},"@astryx.powersearch.editor.removeFilter":{defaultMessage:"Remove filter",description:'Screen-reader-only label on the "×" icon button next to a filter row in the PowerSearch editor; removes that row. Imperative verb.'},"@astryx.powersearch.editor.groupOperator":{defaultMessage:"Group operator",description:'Screen-reader-only label for the AND/OR toggle that combines sibling filters inside a filter group. Sighted users see just "AND" or "OR".'},"@astryx.powersearch.editor.group":{defaultMessage:"Group",description:'Fallback noun label shown on a nested filter-group chip when no AND/OR combining operator has been chosen. Use the noun ("a cluster"), not the verb "to group".'},"@astryx.powersearch.editor.delete":{defaultMessage:"Delete",description:"Button label inside the PowerSearch filter-editor popover; deletes the currently-edited filter row. Imperative verb form."},"@astryx.powersearch.editor.cancel":{defaultMessage:"Cancel",description:"Button label inside the PowerSearch filter-editor popover; closes the popover and discards pending edits. Imperative verb form."},"@astryx.powersearch.editor.apply":{defaultMessage:"Apply",description:'Primary button label inside the PowerSearch filter-editor popover; confirms the edited filter. Imperative verb; consumers may override to "Save".'},"@astryx.powersearch.valueEditor.value":{defaultMessage:"Value",description:'Noun form-label above a single free-text/number input in the PowerSearch value editor (e.g. the "acme" in `Name contains acme`). Not a verb or "worth".'},"@astryx.powersearch.valueEditor.values":{defaultMessage:"Values",description:"Plural noun form-label above a multi-value chip input in the PowerSearch value editor. Should match its singular counterpart `Value` in your language."},"@astryx.powersearch.valueEditor.time":{defaultMessage:"Time",description:"Noun form-label above a time-of-day (HH:MM) picker in the PowerSearch value editor. Clock time, not duration or era."},"@astryx.powersearch.valueEditor.date":{defaultMessage:"Date",description:"Noun form-label above a calendar-date picker in the PowerSearch value editor. Calendar date, not romantic date or fruit."},"@astryx.powersearch.valueEditor.relativeDate":{defaultMessage:"Relative date",description:'Label for the relative-date selector (e.g. "Last 7 days") in the PowerSearch value editor.'},"@astryx.powersearch.valueEditor.startDate":{defaultMessage:"Start date",description:"Noun form-label above the start-of-range date picker in the PowerSearch value editor. Pairs with `End date` — keep the two parallel in your language."},"@astryx.powersearch.valueEditor.endDate":{defaultMessage:"End date",description:"Noun form-label above the end-of-range date picker in the PowerSearch value editor. Pairs with `Start date` — keep the two parallel."},"@astryx.powersearch.valueEditor.entities":{defaultMessage:"Entities",description:'"Entities" is jargon — plural noun form-label above an entity picker (people, teams, projects). Prefer a natural collective like "items" if your language has no equivalent.'},"@astryx.powersearch.valueEditor.searchPlaceholder":{defaultMessage:"Search…",description:"Placeholder inside the search input in the PowerSearch entity/typeahead picker. Imperative verb; trailing `…` is one character."},"@astryx.powersearch.valueEditor.enterValuePlaceholder":{defaultMessage:"Enter value…",description:"Placeholder inside a free-text single-value input in the PowerSearch value editor. Imperative verb; trailing `…` is one character."},"@astryx.powersearch.valueEditor.addValuesPlaceholder":{defaultMessage:"Add values…",description:"Placeholder inside a multi-value chip input where the user types items and presses Enter to add each as a chip. Imperative verb; trailing `…` is one character."},"@astryx.powersearch.valueEditor.enterNumberPlaceholder":{defaultMessage:"Enter number…",description:"Placeholder inside a numeric input in the PowerSearch value editor. Imperative verb; trailing `…` is one character."},"@astryx.powersearch.valueEditor.selectValuesPlaceholder":{defaultMessage:"Select values…",description:"Placeholder on a dropdown for choosing values from a fixed enum list in the PowerSearch value editor. Imperative verb (user selects, not types)."},"@astryx.powersearch.operator.contains":{defaultMessage:"contains",description:"PowerSearch string operator, rendered inline as `<field> contains <value>` (e.g. `Name contains acme`). Lowercase verb form."},"@astryx.powersearch.operator.notContains":{defaultMessage:"does not contain",description:"PowerSearch negated string operator. Example: `Name does not contain test`. Lowercase; pairs with `contains`."},"@astryx.powersearch.operator.startsWith":{defaultMessage:"starts with",description:"PowerSearch string prefix operator. Example: `Email starts with admin@`. Lowercase."},"@astryx.powersearch.operator.notStartsWith":{defaultMessage:"does not start with",description:"PowerSearch negated prefix operator. Example: `Email does not start with test`. Lowercase; pairs with `starts with`."},"@astryx.powersearch.operator.endsWith":{defaultMessage:"ends with",description:"PowerSearch string suffix operator. Example: `Email ends with @meta.com`. Lowercase."},"@astryx.powersearch.operator.notEndsWith":{defaultMessage:"does not end with",description:"PowerSearch negated suffix operator. Example: `Email does not end with @gmail.com`. Lowercase; pairs with `ends with`."},"@astryx.powersearch.operator.is":{defaultMessage:"is",description:"PowerSearch equality operator for strings/enums. Example: `Status is Active`. Separate from `operator.equals` (numbers) — translations may diverge."},"@astryx.powersearch.operator.isNot":{defaultMessage:"is not",description:"PowerSearch inequality operator for strings/enums. Example: `Status is not Draft`. Pairs with `is`; separate from `operator.notEquals`."},"@astryx.powersearch.operator.equals":{defaultMessage:"is",description:'PowerSearch numeric equality operator. Example: `Age is 30`. Ships same English "is" as `operator.is` but is separate so numbers may diverge (e.g. "equals").'},"@astryx.powersearch.operator.notEquals":{defaultMessage:"is not",description:"PowerSearch numeric inequality operator. Example: `Count is not 0`. Same divergence option as `operator.equals`."},"@astryx.powersearch.operator.greaterThan":{defaultMessage:"is greater than",description:"PowerSearch numeric operator, strictly greater than. Example: `Age is greater than 18`. Lowercase."},"@astryx.powersearch.operator.lessThan":{defaultMessage:"is less than",description:"PowerSearch numeric operator, strictly less than. Example: `Priority is less than 5`. Lowercase."},"@astryx.powersearch.operator.greaterThanOrEqual":{defaultMessage:"is greater than or equal to",description:'PowerSearch numeric operator, ≥. Example: `Age is greater than or equal to 21`. A shorter form (e.g. "≥") is fine if idiomatic.'},"@astryx.powersearch.operator.lessThanOrEqual":{defaultMessage:"is less than or equal to",description:"PowerSearch numeric operator, ≤. Example: `Priority is less than or equal to 3`. A shorter form is fine if idiomatic."},"@astryx.powersearch.operator.before":{defaultMessage:"is before",description:"PowerSearch date operator, strictly earlier. Example: `Created is before 2024-01-01`. Temporal, not spatial."},"@astryx.powersearch.operator.after":{defaultMessage:"is after",description:"PowerSearch date operator, strictly later. Example: `Updated is after 2024-06-01`. Temporal."},"@astryx.powersearch.operator.between":{defaultMessage:"is between",description:"PowerSearch date operator, inclusive range. Example: `Created is between 2024-01-01 and 2024-06-30`. The `and <end>` portion is composed separately."},"@astryx.powersearch.operator.isTrue":{defaultMessage:"is true",description:"PowerSearch boolean operator: matches truthy. Example: `Is admin is true`. Pairs with `is false`; field may be affirmative or a yes/no question."},"@astryx.powersearch.operator.isFalse":{defaultMessage:"is false",description:"PowerSearch boolean operator: matches falsy. Example: `Is admin is false`. Pairs with `is true`."},"@astryx.powersearch.operator.isAnyOf":{defaultMessage:"is any of",description:"PowerSearch list operator: value is in the set. Example: `Status is any of [Active, Paused, Draft]`. The value list is composed separately; pairs with `is none of`."},"@astryx.powersearch.operator.isNoneOf":{defaultMessage:"is none of",description:"PowerSearch negated list operator: value not in the set. Example: `Status is none of [Archived, Deleted]`. Pairs with `is any of`."},"@astryx.powersearch.valueEditor.itemsCount":{defaultMessage:"{count, number} {count, plural, one {item} other {items}}",description:"Overflow summary on a compact filter chip when the list of selected items is too long. Example: `3 items` or `1 item`."},"@astryx.powersearch.valueEditor.entitiesCount":{defaultMessage:"{count, number} {count, plural, one {entity} other {entities}}",description:"Overflow summary on a compact filter chip when the list of selected entities is too long. Example: `5 entities` or `1 entity`. Pair with `itemsCount` translation."},"@astryx.powersearch.valueEditor.dateRange":{defaultMessage:"date range",description:"Fallback lowercase noun rendered inline in a filter chip when a date-range value can't be formatted (e.g. `Created is between date range`). Keep lowercase."},"@astryx.powersearch.valueEditor.filtersCount":{defaultMessage:"{count, number} {count, plural, one {filter} other {filters}}",description:"Summary inside a filter chip when the value is a nested set of filters. Example: `3 filters` or `1 filter`."},"@astryx.powersearch.resultCount":{defaultMessage:"{count, number} {count, plural, one {result} other {results}}",description:"Live result-count text next to the PowerSearch input, announced to screen readers on change. Example: `12 results`, `1 result`; keep compact."},"@astryx.alertDialog.cancel":{defaultMessage:"Cancel",description:"Button label on the secondary/dismiss button of an AlertDialog (modal confirmation). Imperative verb; consumers usually override with task-specific text."},"@astryx.appShell.mobileNavigation":{defaultMessage:"Mobile navigation",description:'Screen-reader-only accessible name for the mobile-only navigation region on small viewports. "Mobile" = phone/tablet (small screen), not "movable".'},"@astryx.appShell.skipToContent":{defaultMessage:"Skip to content",description:"Text of the skip link — the first focusable element on the page, visible only while keyboard-focused. Activating it jumps focus past the navigation to the main content area. Imperative verb; keep short."},"@astryx.avatar.nameWithStatus":{defaultMessage:"{name}, {status}",description:`Screen-reader accessible name for an Avatar showing a status indicator; composes the person's name with the status label, e.g. "Jane Doe, Online". {name} = the avatar's name/alt text, {status} = the status dot's label. Adjust separator and order per locale.`},"@astryx.avatarGroup.label":{defaultMessage:"Avatars",description:'Screen-reader-only fallback name for a horizontal cluster of user avatar images. Plural noun; consumers usually override with "Team members", "Attendees", etc.'},"@astryx.avatarGroup.keyboardHint":{defaultMessage:"Use arrow keys to move between avatars",description:"Screen-reader-only instruction attached (via aria-describedby) to a group of interactive avatars that share a single Tab stop. Tells keyboard users the Left/Right arrow keys move focus between the avatars. Only announced when the group has interactive (link/button) avatars."},"@astryx.avatarGroup.overflow":{defaultMessage:"{count, number} more",description:'Accessible name for the "+N" overflow indicator at the end of an AvatarGroup — announces how many additional avatars are not shown. Example: `5 more`. The visible "+N" text is unaffected; this is the aria-label only.'},"@astryx.banner.dismiss":{defaultMessage:"Dismiss",description:'"Dismiss" = close/hide this notification (not "reject a person"). Aria label AND tooltip on the small X button on a Banner.'},"@astryx.calendar.previousMonth":{defaultMessage:"Previous month",description:"Screen-reader-only label on the left-arrow button in a Calendar's month header (navigates one month back). Pairs with `calendar.nextMonth`."},"@astryx.calendar.nextMonth":{defaultMessage:"Next month",description:"Screen-reader-only label on the right-arrow button in a Calendar's month header (navigates one month forward). Pairs with `calendar.previousMonth`."},"@astryx.calendar.daySelected":{defaultMessage:"{date}, selected",description:'Accessible name for the Calendar day button that is the current single-mode selection. `{date}` is the localized full date, e.g. "Thursday, January 15, 2026". The trailing state word tells screen-reader users the focused day is selected.'},"@astryx.calendar.dayRangeStart":{defaultMessage:"{date}, range start",description:"Accessible name for the Calendar day button that begins the selected date range (or the first pick of an in-progress range). `{date}` is the localized full date."},"@astryx.calendar.dayRangeEnd":{defaultMessage:"{date}, range end",description:"Accessible name for the Calendar day button that ends the selected date range. `{date}` is the localized full date. Pairs with `calendar.dayRangeStart`."},"@astryx.calendar.dayRangeStartAndEnd":{defaultMessage:"{date}, range start and range end",description:"Accessible name for a Calendar day button that both begins and ends a completed one-day range. `{date}` is the localized full date."},"@astryx.calendar.dayInRange":{defaultMessage:"{date}, in range",description:"Accessible name for a Calendar day button strictly inside the selected date range (not an endpoint). `{date}` is the localized full date."},"@astryx.calendar.rangeStartAnnounce":{defaultMessage:"Start date {date}. Select an end date.",description:"Screen-reader announcement after the first pick of a Calendar range selection. `{date}` is the localized full date. Prompts the user that a second pick completes the range."},"@astryx.calendar.rangeCompleteAnnounce":{defaultMessage:"Selected range: {start} to {end}.",description:"Screen-reader announcement after the second pick completes a Calendar range selection. `{start}` and `{end}` are localized full dates in chronological order."},"@astryx.carousel.label":{defaultMessage:"Carousel",description:'Screen-reader-only fallback name for a horizontally-scrolling row of items. If "carousel" is unfamiliar in your locale, prefer the standard term (e.g. "slider").'},"@astryx.carousel.scrollLeft":{defaultMessage:"Scroll left",description:"Screen-reader-only label on the left arrow button in a Carousel. Pairs with `carousel.scrollRight`; in RTL locales, coordinate the two so left/right match layout."},"@astryx.carousel.scrollRight":{defaultMessage:"Scroll right",description:"Screen-reader-only label on the right arrow button in a Carousel. Pairs with `carousel.scrollLeft`; same RTL note."},"@astryx.carousel.slideLabel":{defaultMessage:"Slide {current, number} of {total, number}",description:"Screen-reader accessible name for one slide in a Carousel, giving its position. `current` is the 1-based slide number; `total` is the slide count."},"@astryx.chat.status.sending":{defaultMessage:"Sending",description:"Chat send-status caption under an outgoing message while it is being transmitted. Part of the set sending → sent → delivered → read (or failed) — keep tense/aspect consistent."},"@astryx.chat.status.sent":{defaultMessage:"Sent",description:"Chat send-status caption shown once the message reaches the server. Part of the set sending → **sent** → delivered → read (or failed) — keep tense consistent."},"@astryx.chat.status.delivered":{defaultMessage:"Delivered",description:"Chat send-status caption shown once the recipient's device received the message. Part of the set sending → sent → **delivered** → read (or failed)."},"@astryx.chat.status.read":{defaultMessage:"Read",description:'Chat send-status caption shown once the recipient opened the message. English past-participle ("has been read", /rɛd/), not the present verb — part of the set sending → sent → delivered → **read**.'},"@astryx.chat.status.failed":{defaultMessage:"Failed",description:"Chat send-status caption shown when the send attempt errored. Part of the set — the terminal failure branch, orthogonal to the sent → delivered → read success track."},"@astryx.chat.messageAriaLabel":{defaultMessage:"Message {status}",description:"Screen-reader-only accessible name for a chat message row. `{status}` interpolates the localized status word (e.g. `Message sent`, `Message delivered`) — reorder if needed."},"@astryx.chat.pastedText.expand":{defaultMessage:"Expand",description:'Button label on a chip in the chat composer representing a long pasted text block; clicking reveals full content. "Expand" here means reveal more, not grow physically.'},"@astryx.checkboxList.item.checkbox":{defaultMessage:"Checkbox",description:"Screen-reader-only last-ditch fallback name for a checkbox inside a list item when no label is provided. Should almost never render — consumers should supply a real label."},"@astryx.commandPalette.emptySearch":{defaultMessage:"No results",description:"Fallback empty-state text inside a CommandPalette when the user's query has no matches. Very short (2 words); neutral tone."},"@astryx.commandPalette.emptyBootstrap":{defaultMessage:"Type to search",description:"Onboarding empty-state text shown inside a CommandPalette on first open, before the user has typed anything. Imperative sentence fragment."},"@astryx.commandPalette.resultCount":{defaultMessage:"{count, number} {count, plural, one {result} other {results}}",description:"Screen-reader-only announcement of how many commands match the CommandPalette query as the user types. Example: `12 results`, `1 result`; keep compact."},"@astryx.commandPalette.noResultsFor":{defaultMessage:"No results for {query}",description:"Screen-reader-only announcement when a CommandPalette query matches nothing. `{query}` is the user's verbatim search text; keep it last if your language allows so truncation-by-AT still conveys the outcome."},"@astryx.commandPalette.loading":{defaultMessage:"Loading",description:"Screen-reader-only announcement that a CommandPalette search has started and results are being fetched. Present-progressive form; matches the visible spinner."},"@astryx.dateRangeInput.presetDateRanges":{defaultMessage:"Preset date ranges",description:'Screen-reader-only accessible name for the sidebar of quick-pick preset ranges inside a DateRangeInput popover (e.g. "Last 7 days", "This month").'},"@astryx.dateTimeInput.timePlaceholder":{defaultMessage:"Select a time",description:'Grey placeholder inside the empty time-of-day slot in a DateTimeInput. "Time" = clock time (HH:MM), not duration.'},"@astryx.dialog.close":{defaultMessage:"Close",description:'"Close" = shut/dismiss the dialog, not "nearby" (English homograph). Aria label AND tooltip on the X at the top-right of a Dialog.'},"@astryx.dropdownMenu.label":{defaultMessage:"Menu",description:'Screen-reader-only fallback name for a dropdown menu popover. Very generic; consumers usually override. Noun ("a menu"), not the imperative.'},"@astryx.lightbox.close":{defaultMessage:"Close",description:'"Close" = shut/dismiss (not "nearby"). Screen-reader-only label on the X button that dismisses a Lightbox.'},"@astryx.lightbox.previous":{defaultMessage:"Previous",description:"Screen-reader-only label on the left-arrow button in a Lightbox (navigates to previous media item). Pairs with `lightbox.next`."},"@astryx.lightbox.next":{defaultMessage:"Next",description:"Screen-reader-only label on the right-arrow button in a Lightbox (navigates to next media item). Pairs with `lightbox.previous`."},"@astryx.markdown.taskList":{defaultMessage:"Task list",description:"Screen-reader-only accessible name for a GitHub-flavored Markdown task list (rendered from `- [ ] item` / `- [x] done` syntax)."},"@astryx.markdown.table":{defaultMessage:"Table",description:'Screen-reader-only accessible name for a table rendered inside a Markdown block. Noun ("a table"), not the verb. Separate from `@astryx.table.label` — translations may diverge.'},"@astryx.mobileNav.closeNavigation":{defaultMessage:"Close navigation",description:"Screen-reader-only label on the X/close button that dismisses the MobileNav overlay. Pairs with `mobileNav.toggle.open`."},"@astryx.multiSelector.selectAll":{defaultMessage:"Select all",description:'Label on the checkbox/toggle at the top of a MultiSelector dropdown that selects every option. "All" is a determiner here (as in "all the options"), not the pronoun.'},"@astryx.multiSelector.searchPlaceholder":{defaultMessage:"Search…",description:"Placeholder inside the search input at the top of a MultiSelector's dropdown panel. Imperative verb; trailing `…` is one character."},"@astryx.multiSelector.searchOptions":{defaultMessage:"Search options",description:"Screen-reader-only accessible name for that same search input inside a MultiSelector."},"@astryx.multiSelector.selectAllPartiallySelected":{defaultMessage:"{label}, partially selected",description:'Accessible name for the MultiSelector select-all option while only some options are selected. `{label}` is the visible select-all label (e.g. "Select all"). ARIA forbids aria-selected="mixed" on options, so the indeterminate state is conveyed through the name instead. "Partially" = some but not all.'},"@astryx.popover.close":{defaultMessage:"Close popover",description:'"Close" = shut/dismiss, not "nearby". Screen-reader-only label on the close button inside a Popover.'},"@astryx.selector.searchPlaceholder":{defaultMessage:"Search…",description:"Placeholder inside the search input at the top of a Selector's dropdown panel (for filtering options). Imperative verb; trailing `…` is one character."},"@astryx.selector.searchOptions":{defaultMessage:"Search options",description:'"Options" = the list of choices in the dropdown. Screen-reader-only accessible name for the search input inside a Selector.'},"@astryx.sideNav.label":{defaultMessage:"Side navigation",description:"Screen-reader-only accessible name for the primary vertical sidebar nav (usually on the left)."},"@astryx.sideNav.resizeSidebar":{defaultMessage:"Resize sidebar",description:"Screen-reader-only label on the vertical drag handle at the right edge of the SideNav that lets the user resize the sidebar's width."},"@astryx.sideNav.heading.openMenu":{defaultMessage:"Open menu",description:"Screen-reader-only label on the `⋯` overflow-menu button embedded in a SideNav section heading. Same string as `topNav.heading.openMenu` — translations may share."},"@astryx.tabList.label":{defaultMessage:"Tabs",description:'Screen-reader-only fallback name for a horizontal tab bar. Plural noun; "Tabs" here = UI tab panels, not browser tabs or the Tab key.'},"@astryx.table.label":{defaultMessage:"Table",description:'Fallback screen-reader-only accessible name for a data-table region when the consumer provides none. Noun ("a table"), not the verb "to table".'},"@astryx.table.noData":{defaultMessage:"No data",description:'Fallback empty-state text in the table body when there are zero rows. Neutral tone (not error-y); consumers commonly override with something specific like "No results".'},"@astryx.table.filter.allPlaceholder":{defaultMessage:"All",description:'Placeholder on a per-column filter dropdown when nothing is selected, meaning "no filter — all rows match". Determiner form (as in "all values"), not the pronoun.'},"@astryx.table.filter.reset":{defaultMessage:"Reset",description:"Button label inside a table's filter panel/popover; clears pending filter values back to defaults. Imperative verb."},"@astryx.table.filter.apply":{defaultMessage:"Apply",description:"Primary button label inside a table's filter panel/popover; commits pending filter values. Imperative verb; pairs with `Reset`."},"@astryx.table.selection.selectAllRows":{defaultMessage:"Select all rows",description:'Aria label for the "select all rows" checkbox in a Table header.'},"@astryx.table.selection.selectRow":{defaultMessage:"Select row",description:'Aria label for the "select row" checkbox on a Table row.'},"@astryx.table.selection.selectRowNamed":{defaultMessage:"Select {label}",description:"Aria label for a Table row's selection checkbox when a per-row label is available (via getRowLabel). `label` is the row's human-readable identity, e.g. \"Alice\"."},"@astryx.table.sort.ascending":{defaultMessage:"Sort ascending",description:"Screen-reader-only label on a column header button that will sort the column ascending. Part of a set with `sort.descending` and `sort.clear` — keep parallel."},"@astryx.table.sort.descending":{defaultMessage:"Sort descending",description:"Screen-reader-only label on a column header button that will sort the column descending. Part of a set with `sort.ascending` and `sort.clear`."},"@astryx.table.sort.clear":{defaultMessage:"Clear sort",description:'Screen-reader-only label on a column header button that will remove the current sort. "Clear" here means remove, not transparent. Part of the sort set.'},"@astryx.table.sort.direction.ascending":{defaultMessage:"ascending",description:"Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."},"@astryx.table.sort.direction.descending":{defaultMessage:"descending",description:"Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."},"@astryx.table.sort.sortBy":{defaultMessage:"Sort by {label}",description:"Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."},"@astryx.table.sort.sortedBy":{defaultMessage:"Sort by {label}, sorted {direction}",description:"Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."},"@astryx.table.sort.sortedByWithPriority":{defaultMessage:"Sort by {label}, sorted {direction}, priority {rank, number} of {total, number}",description:"Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."},"@astryx.toast.dismiss":{defaultMessage:"Dismiss notification",description:"Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."},"@astryx.toast.viewport":{defaultMessage:"Notifications",description:"Screen-reader-only accessible name for the invisible landmark region hosting the stack of Toast popups (usually pinned to a screen corner)."},"@astryx.tokenizer.clearAll":{defaultMessage:"Clear all",description:'Label on the "×" button that removes every token/chip from a Tokenizer input. Imperative verb + determiner "all"; short.'},"@astryx.topNav.heading.openMenu":{defaultMessage:"Open menu",description:"Screen-reader-only label on the `⋯` overflow button in a TopNav section heading. Kept separate from `sideNav.heading.openMenu` so translations may diverge."},"@astryx.topNav.landmarkLabel":{defaultMessage:"Top navigation",description:"Default accessible name (aria-label) for the <nav> landmark rendered by TopNav when no label is provided."},"@astryx.treeList.toggleChildren":{defaultMessage:"Toggle children",description:'"Children" = child nodes in the tree, not human children. Screen-reader-only label on the chevron next to a TreeList item that has children — toggles the sub-list.'},"@astryx.typeahead.emptySearchResults":{defaultMessage:"No results found",description:"Fallback empty-state message inside a Typeahead's suggestion popover when the current query has no matches. Neutral tone (not error-y)."},"@astryx.typeahead.loading":{defaultMessage:"Loading",description:"Screen-reader-only name for a spinner shown inside a Typeahead dropdown while suggestions are being fetched. Present-progressive form."},"@astryx.typeahead.searchResults":{defaultMessage:"Search results",description:"Screen-reader-only accessible name for the list of suggestions inside a Typeahead dropdown."},"@astryx.typeahead.clearSelection":{defaultMessage:"Clear selection",description:'"Selection" = the chosen value (not highlighted text). Screen-reader-only label on the X that clears the currently-selected value from a Typeahead.'},"@astryx.breadcrumbs.label":{defaultMessage:"Breadcrumb",description:"Screen-reader-only fallback name for the breadcrumb trail (e.g. `Home > Section > Page`). Singular in English per ARIA convention; plural is fine if natural in your locale."},"@astryx.chat.composer.placeholder":{defaultMessage:"Type a message…",description:"Grey placeholder text inside the empty chat composer textarea. Imperative verb; trailing `…` is one character."},"@astryx.chat.composerDrawer.label":{defaultMessage:"Items",description:'Fallback aria label for the ChatComposerDrawer — a horizontal list of attachment/tool chips. Consumers usually override with "Attachments", "Tools", etc.'},"@astryx.chat.composerInput.label":{defaultMessage:"Message input",description:'Screen-reader-only accessible name for the chat composer textarea. Reorder freely if your language uses one word for "message field".'},"@astryx.chat.speechRecognition.noSpeechDetected":{defaultMessage:"No speech was detected.",description:"Full-sentence error shown inline in the chat composer after voice input captured silence. Soft-error tone (not alarming); keep terminal period."},"@astryx.commandPalette.label":{defaultMessage:"Command palette",description:'Screen-reader-only fallback name for a keyboard-driven command menu (usually opened with Cmd/Ctrl-K). If unfamiliar, prefer a natural equivalent like "quick actions".'},"@astryx.commandPalette.input.placeholder":{defaultMessage:"Search…",description:"Grey placeholder inside the CommandPalette's search input. Imperative verb; trailing `…` is one character."},"@astryx.commandPalette.list.label":{defaultMessage:"Commands",description:'"Command" = an app action a user can invoke (metaphor from CLI), not a Unix command. Screen-reader-only name for the matching-commands list.'},"@astryx.contextMenu.label":{defaultMessage:"Context menu",description:'Screen-reader-only fallback name for the right-click / long-press popup menu. "Context" = context-specific to the activated element, not linguistic context.'},"@astryx.dateInput.placeholder":{defaultMessage:"Select a date",description:'Grey placeholder inside an empty DateInput field. "Date" = calendar date, not romantic or fruit. Imperative verb.'},"@astryx.dateInput.dialogLabel":{defaultMessage:"Choose date",description:"Screen-reader-only accessible name for the popover dialog opened from a DateInput's calendar toggle. Imperative verb + noun."},"@astryx.dateInput.closeCalendar":{defaultMessage:"Close calendar",description:"Screen-reader-only label on the X inside the DateInput calendar popover (dismisses the popover). Distinct from `dateInput.toggleCalendarClose`, which labels the outer toggle."},"@astryx.dateInput.openCalendar":{defaultMessage:"Open calendar",description:"Aria label for the DateInput / DateRangeInput / DateTimeInput calendar toggle button when the popover is closed."},"@astryx.dateInput.toggleCalendarClose":{defaultMessage:"Close calendar",description:"Aria label for the DateInput / DateRangeInput / DateTimeInput calendar toggle button when the popover is open. Distinct from closeCalendar (which labels the X inside the popover) so translators can differentiate the toggle vs the close-X UI."},"@astryx.dateInput.clear":{defaultMessage:"Clear {label}",description:"Aria label for the clear-value button in DateInput / DateRangeInput / DateTimeInput. `{label}` is the field's own label so screen readers announce e.g. 'Clear Start date'."},"@astryx.dateTimeInput.timeSuffix":{defaultMessage:"{label} time",description:'Screen-reader-only accessible name for the time-of-day slot in a DateTimeInput. Example: `Start date time`; reorder freely (e.g. "time of {label}").'},"@astryx.dateRangeInput.placeholder":{defaultMessage:"Select date range",description:"Grey placeholder inside an empty DateRangeInput field. Represents picking a start–end date pair. Imperative verb."},"@astryx.dateRangeInput.dialogLabel":{defaultMessage:"Choose date range",description:"Screen-reader-only accessible name for the popover dialog opened from a DateRangeInput. Imperative verb + noun phrase."},"@astryx.dateTimeInput.placeholder":{defaultMessage:"Select a date",description:'Grey placeholder inside an empty DateTimeInput field. Note: the English says only "date" though the field is date+time — do not add "and time" unless natural.'},"@astryx.dateTimeInput.dialogLabel":{defaultMessage:"Choose date",description:`Screen-reader-only accessible name for the DateTimeInput picker dialog. Same English-only "date" phrasing as the placeholder — don't add "and time" unless natural.`},"@astryx.link.newTab":{defaultMessage:"(opens in new tab)",description:"Visually-hidden (screen-reader-only) suffix appended to a Link's accessible name when it opens in a new tab. Example: `Documentation (opens in new tab)`."},"@astryx.mobileNav.toggle.open":{defaultMessage:"Open navigation",description:"Screen-reader-only label on the hamburger button that opens the MobileNav overlay (rendered when the overlay is closed). Pairs with `mobileNav.closeNavigation`."},"@astryx.moreMenu.label":{defaultMessage:"More options",description:"Screen-reader-only name for the small `⋯` (three-dots) overflow button that opens a menu of additional actions. Very short — sits on a tiny icon button."},"@astryx.multiSelector.selectPlaceholder":{defaultMessage:"Select…",description:'Placeholder on an empty MultiSelector trigger button. Same English as `selector.placeholder` but a separate key — plural phrasing like "Choose items…" is fine.'},"@astryx.outline.label":{defaultMessage:"Table of contents",description:"Screen-reader-only fallback name for a page's outline / table-of-contents sidebar (list of in-page headings). Rendered as `aria-label` on a `<nav>` landmark."},"@astryx.powersearch.label":{defaultMessage:"Search",description:"Screen-reader-only accessible name for the PowerSearch input (a filter-builder). The visible placeholder is separate; noun form often reads better than the verb."},"@astryx.powersearch.placeholder":{defaultMessage:"Search…",description:"Grey placeholder text inside the empty PowerSearch input. Imperative verb; trailing `…` is one character."},"@astryx.resizable.collapsed":{defaultMessage:"Collapsed",description:"aria-valuetext for the Resizable drag handle (role=separator) while its panel is collapsed to zero size. Replaces the numeric value announcement, since the numeric value is clamped to the minimum while collapsed. Adjective describing the panel state, not a verb/command."},"@astryx.resizable.handle.label":{defaultMessage:"Resize handle",description:"Screen-reader-only accessible name for the small draggable divider between two Resizable panels (users drag it to change the split ratio)."},"@astryx.selector.placeholder":{defaultMessage:"Select…",description:"Placeholder text on an empty Selector trigger button (a dropdown). Imperative verb; trailing `…` is one character. Very short — appears on the button face."},"@astryx.sideNav.heading.dialogLabel":{defaultMessage:"Navigation menu",description:"Screen-reader-only accessible name for the dropdown dialog opened from a SideNavHeading's overflow menu."},"@astryx.table.pagination.label":{defaultMessage:"Table pagination",description:"Screen-reader-only accessible name for the pagination `<nav>` appended below a data table. Kept separate from `@astryx.pagination.label` so translations may diverge."},"@astryx.timeInput.placeholder":{defaultMessage:"Select a time",description:'"Time" = clock time (HH:MM), not duration or era. Grey placeholder inside an empty TimeInput field; imperative verb.'},"@astryx.topNav.heading.dialogLabel":{defaultMessage:"Navigation menu",description:"Screen-reader-only accessible name for the dropdown dialog opened from a TopNavHeading's overflow menu. Kept separate from the SideNav sibling."},"@astryx.typeahead.searchPlaceholder":{defaultMessage:"Search…",description:"Placeholder inside an empty Typeahead input (a search field that suggests results as the user types). Imperative verb; trailing `…` is one character."},"@astryx.banner.collapse":{defaultMessage:"Collapse",description:'"Collapse" = fold up, not crumble. Aria label AND tooltip on the Banner expand/collapse toggle when currently expanded. Pairs with `banner.expand`.'},"@astryx.banner.expand":{defaultMessage:"Expand",description:'"Expand" = reveal more, not grow physically. Aria label AND tooltip on the same toggle when currently collapsed. Pairs with `banner.collapse`.'},"@astryx.button.loading":{defaultMessage:"Loading",description:'Screen-reader-only live-region announcement while a Button is in its loading state (spinner shown, action in flight). Progressive sense ("work in progress"), not a noun. Kept separate from `typeahead.loading` — translations may diverge.'},"@astryx.chatComposerDrawer.expand":{defaultMessage:"Expand {label}",description:"Screen-reader-only label on the ChatComposerDrawer toggle when the drawer is collapsed. `{label}` is the drawer's visible name — example: `Expand Attachments`. Pairs with `collapse`."},"@astryx.chatComposerDrawer.collapse":{defaultMessage:"Collapse {label}",description:"Screen-reader-only label on the ChatComposerDrawer toggle when the drawer is expanded. Example: `Collapse Attachments`. Pairs with `expand`."},"@astryx.chatDictationButton.startDictation":{defaultMessage:"Start dictation",description:"Accessible label for the microphone button when idle (not listening)."},"@astryx.chatDictationButton.stopDictation":{defaultMessage:"Stop dictation",description:"Accessible label for the microphone button when actively listening."},"@astryx.chatLayout.newMessages":{defaultMessage:"New messages",description:"Text on a floating pill at the bottom of a chat viewport when unseen messages arrive below the fold; clicking scrolls to bottom. Keep short — narrow pill."},"@astryx.chatLayoutScrollButton.scrollToBottom":{defaultMessage:"Scroll to bottom",description:"Visible tooltip AND screen-reader label for a small down-arrow button that scrolls the chat viewport to its latest message."},"@astryx.chatMessage.messageFrom":{defaultMessage:"Message from {sender}",description:"Screen-reader-only accessible name for a chat message when the sender name isn't visible. Example: `Message from Sarah`, `Message from Bot` — reorder freely."},"@astryx.chatSendButton.stop":{defaultMessage:"Stop",description:"Button label that replaces `Send` on the chat send button while an AI response is streaming; clicking aborts generation. Short — appears on a small button."},"@astryx.chatSendButton.send":{defaultMessage:"Send",description:"Primary button label on the chat submit button (paperplane icon). Imperative verb; pairs with `Stop`. Very short."},"@astryx.chatToolCalls.error":{defaultMessage:"Error: {message}",description:"Screen-reader text for a tool call that failed. {message} is the error detail."},"@astryx.chatToolCalls.groupLabel":{defaultMessage:"{count} tool calls",description:"Summary label shown in the group header when multiple tool calls are expanded. {count} is the number of calls."},"@astryx.chatTriggerMenu.suggestions":{defaultMessage:"Suggestions",description:"Screen-reader-only fallback label for the popover listbox opened by a trigger character (`@`, `/`) in the chat composer when the trigger provides no specific label."},"@astryx.citation.label":{defaultMessage:"Citation {number}: {title}",description:"Screen-reader-only accessible name for a Citation chip (a small numbered link to a source). Example: `Citation 1: OpenAI research paper`. Reorder freely."},"@astryx.codeBlock.copied":{defaultMessage:"Copied",description:'Screen-reader-only label on the CodeBlock copy button for ~2s after a successful copy. Past-participle ("has been copied"); pairs with `codeBlock.copyCode`.'},"@astryx.codeBlock.copyCode":{defaultMessage:"Copy code",description:'"Code" = source code. Aria label AND tooltip on the CodeBlock copy button in its default state. Pairs with `codeBlock.copied` (post-click state).'},"@astryx.codeBlock.code":{defaultMessage:"Code",description:`Screen-reader-only fallback name for a code-snippet scroll container when the code's language is unknown. "Code" = source code, not secret code or code of conduct.`},"@astryx.field.optional":{defaultMessage:"Optional",description:"Visible indicator shown next to a form field's label when the field is optional (isOptional). Mutually exclusive with the required indicator. Very short — appears inline after the label text."},"@astryx.field.required":{defaultMessage:"Required",description:"Visible indicator shown next to a form field's label when the field must be filled in (isRequired). Mutually exclusive with the optional indicator. Very short — appears inline after the label text."},"@astryx.fileInput.clearLabel":{defaultMessage:"Clear {label}",description:"Screen-reader-only label on the X that removes the selected file from a FileInput. Example: `Clear Attachment`, `Clear Résumé`."},"@astryx.fileInput.required":{defaultMessage:"Required",description:'Screen-reader-only description on the FileInput trigger indicating the field must be filled in. Mirrors the visible `Required` indicator next to the field label; conveyed via description because aria-required is not supported on role="button".'},"@astryx.fileInput.triggerWithFiles":{defaultMessage:"{label}, {fileNames}",description:"Accessible name for a FileInput trigger that has files attached, composing the field label with the selected filenames. Example: `Attachments, report.pdf, notes.txt`."},"@astryx.keyboardHint.toNavigate":{defaultMessage:"to navigate",description:"Trailing text in the keyboard-hint badge, shown after arrow-key icons — reads as `← → to navigate`. Lowercase sentence fragment completing the visual phrase; the badge is aria-hidden, so this is for sighted users only."},"@astryx.lightbox.mediaViewer":{defaultMessage:"Media viewer",description:"Screen-reader-only fallback name for the Lightbox dialog when the current media item has no alt text. Should rarely render — consumers should provide alt."},"@astryx.lightbox.zoom":{defaultMessage:"Zoom",description:'Screen-reader-only label on the Lightbox image acting as a zoom toggle button (aria-pressed reflects zoomed state). Verb ("to zoom"), very short.'},"@astryx.lightbox.zoomedIn":{defaultMessage:"Zoomed in, use arrow keys to pan",description:"Polite screen-reader announcement after zooming into a Lightbox image, including a hint that arrow keys pan while zoomed. Pairs with `lightbox.zoomedOut`."},"@astryx.lightbox.zoomedOut":{defaultMessage:"Zoomed out",description:"Polite screen-reader announcement after zooming back out of a Lightbox image. Pairs with `lightbox.zoomedIn`."},"@astryx.metadataList.showMore":{defaultMessage:"Show more",description:"Button label under a MetadataList that reveals items hidden beyond the configured maximum. Toggles with `metadataList.showLess` — keep the pair parallel in your language."},"@astryx.metadataList.showLess":{defaultMessage:"Show less",description:"Button label under a MetadataList that re-hides the extra items revealed by `metadataList.showMore`. Keep the pair parallel."},"@astryx.mobileNav.navigation":{defaultMessage:"Navigation",description:"Screen-reader-only fallback name for the MobileNav overlay dialog when no explicit label was passed."},"@astryx.multiSelector.clearAll":{defaultMessage:"Clear all {label}",description:"Screen-reader-only label on the X that clears every selected value from a MultiSelector. Example: `Clear all Countries`. `{label}` is typically already plural in English."},"@astryx.input.statusButton.error":{defaultMessage:"Error details",description:"Accessible name for the focusable status icon button inside an input when statusVariant is 'tooltip' and the status type is error. Activating or focusing the button reveals the error message in a tooltip. Keep it short — it labels an icon-only button."},"@astryx.input.statusButton.warning":{defaultMessage:"Warning details",description:"Accessible name for the focusable status icon button inside an input when statusVariant is 'tooltip' and the status type is warning. Activating or focusing the button reveals the warning message in a tooltip."},"@astryx.input.statusButton.success":{defaultMessage:"Success details",description:"Accessible name for the focusable status icon button inside an input when statusVariant is 'tooltip' and the status type is success. Activating or focusing the button reveals the success message in a tooltip."},"@astryx.numberInput.clearLabel":{defaultMessage:"Clear {label}",description:"Screen-reader-only label on the X that clears the value from a NumberInput. Example: `Clear Age`, `Clear Quantity`."},"@astryx.selector.clearLabel":{defaultMessage:"Clear {label}",description:"Screen-reader-only label on the X that clears the selected value from a Selector. `{label}` is the selector's visible label — example: `Clear Country`."},"@astryx.sideNavCollapseButton.expandSidebar":{defaultMessage:"Expand sidebar",description:"Aria label AND tooltip on the SideNav collapse/expand toggle when the sidebar is currently collapsed (clicking expands it). Pairs with `collapseSidebar`."},"@astryx.sideNavCollapseButton.collapseSidebar":{defaultMessage:"Collapse sidebar",description:"Aria label AND tooltip on the same toggle when the sidebar is currently expanded (clicking collapses it). Pairs with `expandSidebar`."},"@astryx.sideNavItem.expand":{defaultMessage:"Expand {label}",description:"Screen-reader-only label on the chevron next to a SideNav item with children when the group is collapsed. Example: `Expand Settings`. Pairs with `sideNavItem.collapse`."},"@astryx.sideNavItem.collapse":{defaultMessage:"Collapse {label}",description:"Screen-reader-only label on the same chevron when the group is expanded. Example: `Collapse Settings`. Pairs with `sideNavItem.expand`."},"@astryx.tableFiltering.filterByColumn":{defaultMessage:"Filter {header}",description:"Triple-use string on per-column filter controls: visible label, placeholder, AND aria label. `{header}` is the column header — example: `Filter Name`. Keep short."},"@astryx.tableGroupedRows.expandGroup":{defaultMessage:"Expand group {groupKey}",description:"Screen-reader-only label on the chevron next to a grouped table's group header when collapsed. Example: `Expand group Q1 2024`. Pairs with `collapseGroup`."},"@astryx.tableGroupedRows.collapseGroup":{defaultMessage:"Collapse group {groupKey}",description:"Screen-reader-only label on the same chevron when the group is expanded. Example: `Collapse group Q1 2024`. Pairs with `expandGroup`."},"@astryx.tableRowExpansion.collapseRow":{defaultMessage:"Collapse row",description:"Screen-reader-only label on the row-expand chevron when the row is currently expanded. Part of the four-way expand/collapse set."},"@astryx.tableRowExpansion.expandRow":{defaultMessage:"Expand row",description:"Screen-reader-only label on the row-expand chevron when the row is currently collapsed. Part of a four-way set with `collapseRow`, `expandAllRows`, `collapseAllRows`."},"@astryx.tableRowExpansion.collapseAllRows":{defaultMessage:"Collapse all rows",description:"Screen-reader-only label on the same header button when every row is expanded. Part of the four-way set."},"@astryx.tableRowExpansion.expandAllRows":{defaultMessage:"Expand all rows",description:"Screen-reader-only label on the header expand-all/collapse-all button when at least one row is collapsed (clicking expands every expandable row). Part of the four-way set."},"@astryx.step.goToStep":{defaultMessage:"Go to step {stepNumber, number}: {label}",description:"Accessible name for a clickable step in the lab Stepper. {stepNumber} is the 1-based position, {label} is the step's visible label."},"@astryx.step.goToStepWithStatus":{defaultMessage:"Go to step {stepNumber, number}: {label}, {status}",description:"Accessible name for a clickable lab Stepper step that also carries a status. {status} is one of the translated `step.status.*` words (completed/warning/error). Keep the pattern parallel to `step.goToStep`."},"@astryx.step.status.completed":{defaultMessage:"completed",description:"Screen-reader-only status word rendered next to a lab Stepper step label when the step is done (either progress-completed or status=success). Lowercase adjective; it is read mid-sentence after the step label."},"@astryx.step.status.warning":{defaultMessage:"warning",description:"Screen-reader-only status word rendered next to a lab Stepper step label when status=warning. Lowercase noun/adjective; read mid-sentence after the step label."},"@astryx.step.status.error":{defaultMessage:"error",description:"Screen-reader-only status word rendered next to a lab Stepper step label when status=error. Lowercase noun; read mid-sentence after the step label."},"@astryx.tableTree.collapseRow":{defaultMessage:"Collapse row",description:"Aria label for the Table tree-data expander chevron when the row is currently expanded."},"@astryx.tableTree.expandRow":{defaultMessage:"Expand row",description:"Aria label for the Table tree-data expander chevron when the row is currently collapsed."},"@astryx.tableTree.collapseAllRows":{defaultMessage:"Collapse all rows",description:"Aria label for the Table tree-data header toggle when all rows are expanded and clicking it collapses them."},"@astryx.tableTree.expandAllRows":{defaultMessage:"Expand all rows",description:"Aria label for the Table tree-data header toggle when rows are collapsed and clicking it expands them."},"@astryx.textArea.charactersRemaining":{defaultMessage:"{count, number} {count, plural, one {character} other {characters}} remaining",description:"Screen-reader-only announcement of how many characters the user can still type before hitting a TextArea's maxLength. Announced politely as the count nears the limit. `{count}` is the number remaining — example: `12 characters remaining`."},"@astryx.textArea.charactersOverLimit":{defaultMessage:"{count, number} {count, plural, one {character} other {characters}} over the limit",description:"Screen-reader-only assertive announcement when the user has typed past a TextArea's maxLength. `{count}` is how many characters over — example: `3 characters over the limit`."},"@astryx.textInput.clearLabel":{defaultMessage:"Clear {label}",description:"Screen-reader-only label on the X that clears the value from a TextInput. Example: `Clear Email`, `Clear Name`."},"@astryx.thumbnail.remove":{defaultMessage:"Remove {accessibleName}",description:'Screen-reader-only label on the "×" on a Thumbnail (image preview chip). `{accessibleName}` is the thumbnail\'s name — example: `Remove profile.jpg`.'},"@astryx.thumbnail.open":{defaultMessage:"Open {accessibleName}",description:'"Open" = launch/reveal (not "unfold" or the adjective). Screen-reader-only name on a clickable Thumbnail — example: `Open Sunset photo`.'},"@astryx.thumbnail.fallbackName":{defaultMessage:"Thumbnail",description:"Generic screen-reader name for a Thumbnail (image preview) that has no `alt` or `label`. Last-resort fallback so the control is never nameless; prefer a real name via `alt` or `label`."},"@astryx.timeInput.clearLabel":{defaultMessage:"Clear {label}",description:"Screen-reader-only label on the X that clears the value from a TimeInput. Example: `Clear Start time`."},"@astryx.timestamp.copyValue":{defaultMessage:"Copy {value}",description:"Aria label on a Timestamp copyable-hover-card row's copy button, in its default state. `value` is the formatted instant that row shows (e.g. `Copy February 19, 2026 at 5:00:00 PM UTC`). Imperative verb. Pairs with `timestamp.copied` (post-click state)."},"@astryx.timestamp.copy":{defaultMessage:"Copy",description:"Short label shown in the tooltip on a Timestamp copyable-hover-card row's copy button (hover/focus), in its default state. Imperative verb. Pairs with `timestamp.copied` (post-click state). The full `copyValue` string remains the button's aria-label for assistive tech."},"@astryx.timestamp.copied":{defaultMessage:"Copied",description:'Aria label on a Timestamp copy button for ~1.5s after a successful copy, and the text announced to a polite live region. Past-participle ("has been copied"); pairs with `timestamp.copyValue`.'},"@astryx.timestamp.detailsLabel":{defaultMessage:"Timestamp details",description:"Accessible name for the Timestamp copyable hover card popup, which lists the instant in the configured time zones/formats with a copy button per row."},"@astryx.token.remove":{defaultMessage:"Remove {label}",description:'Screen-reader-only label on the "×" on an individual Token/chip. Example: `Remove John Smith`, `Remove Active`. Imperative verb.'}},hD=fD,t6=new Map;function pD(e,t){const n=`${t}::${e}`;let s=t6.get(n);return s===void 0&&(s=new dD(e,t),t6.set(n,s)),s}function xD(e){let t;try{t=new Intl.Locale(e).baseName}catch{t=e}const n=t.split("-"),s=[];for(let r=n.length;r>0;r--)s.push(n.slice(0,r).join("-"));return s}function gD(e,t,n,s){var a,l;const r=xD(t);if(s!==void 0)for(const c of r){const u=(a=s[c])==null?void 0:a[e];if(u!==void 0)return u}for(const c of r){const u=(l=n[c])==null?void 0:l[e];if(u!==void 0)return u.defaultMessage}const i=hD[e];return i!==void 0?i.defaultMessage:null}function mD(e,t,n,s,r){const i=gD(e,n,s,r);return i===null?(L4(),e):t===void 0?i:pD(i,n).format(t)}function ze(){const e=h.use(U4);return h.useCallback((t,n)=>mD(t,n,e.locale,e.messages,e.overrides),[e.locale,e.messages,e.overrides])}const Uo={base:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"x1txdalj",k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kMzoRj:"xc342km",ksu8eU:"xng3xce",kaIpWk:"x1jxw6zd",kMv6JI:"xjb2p0i",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",k63SB2:"x1e4wzip",khDVqt:"xuxw1ft",kkrTdU:"x1ypdohk",k1ekBW:"xrafxwg",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",$$css:!0},pressable:{k3aq6I:"x3oybdh xk4oym4",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",kKwaWg:"x18o3ruo",k3aq6I:"x1c071of x1pdlv7q",$$css:!0},ariaDisabled:{kKwaWg:"x18o3ruo x8o3jvd xuqm82a",$$css:!0},iconOnly:{"--button-icon-only-aspect":"x1v15ycx",kOBAk4:"xioom0i",kg3NbH:"xnjsko4",k8WAf4:"xt970qd",$$css:!0},iconWrapper:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",$$css:!0},contentWrapper:{k1xSpc:"xjp7ctv",$$css:!0},link:{kybGjl:"x1hl2dhg",$$css:!0}},yD={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]},vD={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},kD={sm:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",kGuDYH:"x1j61zf2",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",kGuDYH:"x1j61zf2",$$css:!0},lg:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",kGuDYH:"xwsyq91",$$css:!0}},bD={none:{kGVxlE:"x1gnnqk1",$$css:!0},low:{kGVxlE:"x1i5ehqx",$$css:!0},med:{kGVxlE:"x14hfi27",$$css:!0},high:{kGVxlE:"x1kcpxr7",$$css:!0}},wD={primary:{kWkggS:"x1ewilqj",kMwMTN:"x17wrial",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0},secondary:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0},ghost:{kWkggS:"xjbqb8w",kMwMTN:"x1tgivj0",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0},destructive:{kWkggS:"x1pjz0fi",kMwMTN:"x1m024r3",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x1p73he7","--button-focus-offset":"xkzo27j",kInvED:"x1wfwxd8 x13aywxo",$$css:!0}},n6={hiddenContent:{kMwMTN:"x19co3pv",$$css:!0},hiddenContentDelayed:{kKVMdj:"x1ffowhz",k44tkh:"xjlvqhv",kWV6AL:"x10e4vud",kKxzle:"x17yabm6 x14q22ui",$$css:!0}},Kh={horizontal:{krdFHd:"x15mokao x8eehn2",kVL7Gh:"xbiv7yw x1xrp5p4",kfmiAY:"x1ga7v0g xbfdvlp",kT0f0o:"x16uus16 xajhecq",k2ei4v:"xgbv0en x1pjv70x",kVhnKS:"x1t7ytsu xyf0ibl",kGJrpR:"x1j92z86",$$css:!0},vertical:{krdFHd:"x15mokao x8eehn2",kfmiAY:"x1ga7v0g x2qxyot",kVL7Gh:"xbiv7yw x12tyzlf",kT0f0o:"x16uus16 xajhecq",kEafiO:"x11xkdxz x1g31smg",kPef9Z:"x13fuv20 x1d9v4yf",kLZC3w:"x1pc3f07",$$css:!0},onSolidHorizontal:{kGJrpR:"xrvmtm5",$$css:!0},onSolidVertical:{kLZC3w:"x11npmm7",$$css:!0}};function Q({label:e,variant:t="secondary",size:n,type:s="button",isDisabled:r=!1,isLoading:i=!1,isInterruptible:a=!1,clickAction:l,icon:c,isIconOnly:u=!1,width:d,elevation:f="none",children:p,endContent:x,tooltip:g,href:v,as:y,target:m,rel:k,xstyle:b,className:j,style:A,ref:M,...T}){const z=ze(),$=Qa(n,"md"),E=kO(),[N,_]=h.useTransition(),R=h.useRef(!1),B=i||N,D=N||a,I=(E==null?void 0:E.isDisabled)??!1,O=r||I||B&&!a,L=Ja(y),H=v!=null&&!O,q=g!=null&&O,U=Ss({placement:"above",isEnabled:g!=null}),X=oe=>{var F;if(O||R.current&&!a){oe.preventDefault();return}(F=T.onClick)==null||F.call(T,oe),l&&!oe.defaultPrevented&&(R.current=!0,_(async()=>{try{await l(oe)}finally{R.current=!1}}))},Z=q?oe=>{var F;oe.key==="Enter"||oe.key===" "?oe.preventDefault():(F=T.onKeyDown)==null||F.call(T,oe)}:void 0,ae=t==="ghost"?{[ox]:""}:null,xe=G(Uo.base,vD[$],wD[t],u&&Uo.iconOnly,O&&Uo.disabled,q&&Uo.ariaDisabled,H&&Uo.link,!E&&Uo.pressable,E&&(E.orientation==="horizontal"?Kh.horizontal:Kh.vertical),E&&(t==="primary"||t==="destructive")&&(E.orientation==="horizontal"?Kh.onSolidHorizontal:Kh.onSolidVertical),!E&&bD[f],d!=null&&yD.width(d),b),fe=ne(J("button",{variant:t,size:$}),xe,j,A),se=o.jsxs(o.Fragment,{children:[B&&o.jsx("span",{...{0:{className:"x10l6tqk x13vifvy x1o0tod xtijo5x x1ey2m1c xrvj5dj x1ku5rj1"},1:{className:"x10l6tqk x13vifvy x1o0tod xtijo5x x1ey2m1c xrvj5dj x1ku5rj1 xqcmdr3 xb2rp9n xskzprw x17yabm6 x14q22ui"}}[!!D<<0],"aria-hidden":"true",children:o.jsx(Vt,{size:"sm",shade:"inherit"})}),o.jsxs("span",{...G(Uo.contentWrapper,B&&(D?n6.hiddenContentDelayed:n6.hiddenContent)),"aria-hidden":B||void 0,children:[c&&o.jsx("span",{...G(Uo.iconWrapper,kD[$]),children:c}),u?null:o.jsx("span",{className:"xb3r6kr xlyipyv xeuugli",children:p??e}),!u&&x&&o.jsx("span",{className:"x3nfvp2 x6s0dn4 x1heor9g",children:x})]}),o.jsx(Gi,{role:"status","aria-live":"polite",children:B?z("@astryx.button.loading"):""})]}),me=u&&e!==""||B&&!u||p!=null&&p!==e?{"aria-label":e}:null,P=g!=null?{"aria-describedby":[T["aria-describedby"],U.describedBy].filter(Boolean).join(" ")||void 0}:null,V=Ft(M,g!=null?U.ref:void 0);let Y;return H?Y=o.jsx(L,{ref:V,href:v,target:m,rel:k,...fe,...T,...me,...P,...ae,"aria-busy":B||void 0,onClick:X,children:se}):Y=o.jsx("button",{ref:V,type:s,disabled:q?void 0:O,...fe,...T,...me,...P,...ae,"aria-busy":B||void 0,"aria-disabled":q||void 0,onClick:X,...Z?{onKeyDown:Z}:null,children:se}),g?o.jsxs(o.Fragment,{children:[Y,U.renderTooltip(g)]}):Y}Q.displayName="Button";const Wt={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",width:"1em",height:"1em","aria-hidden":!0},Uc={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em","aria-hidden":!0},jD={close:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6"})}),chevronDown:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M6 9l6 6 6-6"})}),chevronLeft:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M15 6l-6 6 6 6"})}),chevronRight:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M9 6l6 6-6 6"})}),chevronsLeft:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M18 6l-6 6 6 6M11 6l-6 6 6 6"})}),chevronsRight:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M6 6l6 6-6 6M13 6l6 6-6 6"})}),check:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M5 13l4 4L19 7"})}),success:o.jsx("svg",{...Uc,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3a9 9 0 100 18 9 9 0 000-18zm4.06 6.56a.75.75 0 00-1.12-1l-3.94 4.4-1.94-1.94a.75.75 0 00-1.06 1.06l2.5 2.5a.75.75 0 001.09-.03l4.47-5z"})}),error:o.jsx("svg",{...Uc,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3a9 9 0 100 18 9 9 0 000-18zm-2.47 5.47a.75.75 0 00-1.06 1.06L10.94 12l-2.47 2.47a.75.75 0 101.06 1.06L12 13.06l2.47 2.47a.75.75 0 101.06-1.06L13.06 12l2.47-2.47a.75.75 0 00-1.06-1.06L12 10.94l-2.47-2.47z"})}),warning:o.jsx("svg",{...Uc,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.29 3.86L2.07 19.05A2 2 0 003.78 22h16.44a2 2 0 001.71-2.95L13.71 3.86a2 2 0 00-3.42 0zM12 9a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0112 9zm0 9a1 1 0 100-2 1 1 0 000 2z"})}),info:o.jsx("svg",{...Uc,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3a9 9 0 100 18 9 9 0 000-18zm0 4a1 1 0 100 2 1 1 0 000-2zm-.75 3.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5z"})}),calendar:o.jsxs("svg",{...Wt,children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),o.jsx("path",{d:"M16 2v4M8 2v4M3 10h18"})]}),clock:o.jsxs("svg",{...Wt,children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"M12 7v5l3 3"})]}),externalLink:o.jsxs("svg",{...Wt,children:[o.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),o.jsx("path",{d:"M15 3h6v6"}),o.jsx("path",{d:"M10 14L21 3"})]}),menu:o.jsx("svg",{...Wt,strokeWidth:2,children:o.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})}),moreHorizontal:o.jsxs("svg",{...Uc,children:[o.jsx("circle",{cx:"5",cy:"12",r:"1.5"}),o.jsx("circle",{cx:"12",cy:"12",r:"1.5"}),o.jsx("circle",{cx:"19",cy:"12",r:"1.5"})]}),search:o.jsxs("svg",{...Wt,children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"M21 21l-4.35-4.35"})]}),arrowUp:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M12 19V5m0 0l-7 7m7-7l7 7"})}),arrowDown:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M12 5v14m0 0l7-7m-7 7l-7-7"})}),arrowsUpDown:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"})}),funnel:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"})}),eyeSlash:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M3.98 8.223A10.477 10.477 0 001.934 12c1.292 4.338 5.31 7.5 10.066 7.5.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})}),viewColumns:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125z"})}),copy:o.jsxs("svg",{...Wt,children:[o.jsx("path",{d:"M8 4v12a2 2 0 002 2h8a2 2 0 002-2V7.242a2 2 0 00-.602-1.43L16.083 2.57A2 2 0 0014.685 2H10a2 2 0 00-2 2z"}),o.jsx("path",{d:"M16 18v2a2 2 0 01-2 2H6a2 2 0 01-2-2V9a2 2 0 012-2h2"})]}),checkDouble:o.jsxs("svg",{...Wt,children:[o.jsx("path",{d:"M2 13l4 4L14 7"}),o.jsx("path",{d:"M9 13l4 4L21 7"})]}),wrench:o.jsx("svg",{...Wt,children:o.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),stop:o.jsx("svg",{...Uc,children:o.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),microphone:o.jsxs("svg",{...Wt,children:[o.jsx("path",{d:"M12 2a3 3 0 00-3 3v6a3 3 0 006 0V5a3 3 0 00-3-3z"}),o.jsx("path",{d:"M19 10v1a7 7 0 01-14 0v-1"}),o.jsx("path",{d:"M12 18v4m-4 0h8"})]})};let SD={};function CD(e){var t;return e==null?null:typeof e=="string"?((t=Dj(e))==null?void 0:t.icons)??null:e.icons??null}function kS(e,t){const n=CD(t);return(n==null?void 0:n[e])??SD[e]??jD[e]}const bS={root:{kmuXW:"x2lah0s",$$css:!0},span:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",$$css:!0}},wS={primary:{kMwMTN:"xtbr613",$$css:!0},secondary:{kMwMTN:"xv9yike",$$css:!0},tertiary:{kMwMTN:"xv9yike",$$css:!0},disabled:{kMwMTN:"xqa6c3m",$$css:!0},accent:{kMwMTN:"xqwr325",$$css:!0},success:{kMwMTN:"xtjic6",$$css:!0},error:{kMwMTN:"xjt36v0",$$css:!0},warning:{kMwMTN:"xs3pv69",$$css:!0},inherit:{kMwMTN:"x1heor9g",$$css:!0},blue:{kMwMTN:"x1fns2mt",$$css:!0},red:{kMwMTN:"xeffzf7",$$css:!0},green:{kMwMTN:"xmxeech",$$css:!0},gray:{kMwMTN:"x1eyinzz",$$css:!0},cyan:{kMwMTN:"x157w0xa",$$css:!0},teal:{kMwMTN:"x1f3zxcb",$$css:!0},yellow:{kMwMTN:"x1g6zdft",$$css:!0},orange:{kMwMTN:"xxu74a4",$$css:!0},pink:{kMwMTN:"x1kxxfg5",$$css:!0},purple:{kMwMTN:"xzdw94u",$$css:!0}},ED={xsm:{kzqmXN:"x1jw3ynk",kZKoxP:"xvle69y",$$css:!0},sm:{kzqmXN:"xcdlrvm",kZKoxP:"x1l36t39",$$css:!0},md:{kzqmXN:"xwqq7k2",kZKoxP:"xmll18r",$$css:!0},lg:{kzqmXN:"xp8d6y2",kZKoxP:"xam5rvr",$$css:!0}},$D={xsm:{kzqmXN:"x1jw3ynk",kZKoxP:"xvle69y",kGuDYH:"xboafo0",$$css:!0},sm:{kzqmXN:"xcdlrvm",kZKoxP:"x1l36t39",kGuDYH:"x1jchvi3",$$css:!0},md:{kzqmXN:"xwqq7k2",kZKoxP:"xmll18r",kGuDYH:"x1603h9y",$$css:!0},lg:{kzqmXN:"xp8d6y2",kZKoxP:"xam5rvr",kGuDYH:"xngnso2",$$css:!0}};function AD(e){return e!=null&&e!==""?{role:"img","aria-label":e}:{"aria-hidden":"true"}}function Te({icon:e,color:t="inherit",size:n="md",label:s,ref:r,className:i,style:a,xstyle:l,...c}){const u=AD(s);if(typeof e=="string")return o.jsx(MD,{name:e,color:t,size:n,a11yProps:u,className:i,style:a,xstyle:l,spanProps:c});const d=e;return o.jsx(d,{ref:r,...u,...ne(J("icon",{size:n,color:t}),G(bS.root,wS[t],ED[n],l),i??void 0,a),...c})}Te.displayName="Icon";function MD({name:e,color:t,size:n,a11yProps:s,className:r,style:i,xstyle:a,spanProps:l}){const c=Kj(),u=kS(e,c);if(u==null)return null;const d=l??{};return o.jsx("span",{...s,...d,...ne(J("icon",{size:n,color:t}),G(bS.span,wS[t],$D[n],a),r??void 0,i),children:u})}function Lr(e,t){return typeof e=="string"?o.jsx(Te,{icon:e,...t}):typeof e=="function"||typeof e=="object"&&e!==null&&"render"in e?o.jsx(Te,{icon:e,...t}):e}function gd(e){const t=Kj();return kS(e,t)}const TD={isMobile:!1,isMobileNavOpen:!1,toggleMobileNav:()=>{},openMobileNav:()=>{},closeMobileNav:()=>{},isMobileNavEnabled:!1,hasAutoToggle:!0},V4=h.createContext(TD);V4.displayName="AppShellMobileContext";function Cg(){return h.use(V4)}function jS({ref:e,children:t,label:n,"data-testid":s,xstyle:r,className:i,style:a}){const l=ze(),c=n??l("@astryx.mobileNav.toggle.open"),{isMobile:u,isMobileNavEnabled:d,isMobileNavOpen:f,mobileNavId:p,toggleMobileNav:x}=Cg();return!u||!d?null:o.jsx(Q,{ref:e,variant:"ghost",label:c,icon:t??o.jsx(Te,{icon:"menu",color:"inherit"}),onClick:x,"aria-expanded":f,"aria-controls":p||void 0,"data-testid":s??"mobile-nav-toggle",xstyle:r,className:i,style:a,isIconOnly:!0})}jS.displayName="MobileNavToggle";const pu=h.createContext("default");pu.displayName="SideNavRenderContext";function SS(){return h.use(pu)}const Iy=h.createContext("default");Iy.displayName="TopNavRenderContext";const Ly=h.createContext(null);Ly.displayName="TopNavMobileContentContext";const zD=typeof gg.Activity<"u",ND=zD?({mode:e,children:t})=>o.jsx(gg.Activity,{mode:e,children:t}):({children:e})=>o.jsx(o.Fragment,{children:e}),_D={sm:640,md:768,lg:1024,none:0},qm="astryx-app-shell-main",En={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kVAEAm:"x1n2onr6",$$css:!0},variantWash:{kWkggS:"x1eiddq6",$$css:!0},variantSurface:{kWkggS:"x10xzikg",$$css:!0},variantSection:{kWkggS:"x10xzikg",$$css:!0},variantElevated:{kWkggS:"x1eiddq6",$$css:!0},rootFill:{kZKoxP:"xtdtrs8",$$css:!0},rootAuto:{kAzted:"x1ov3xa9",$$css:!0},mainFocusTarget:{kI3sdo:"x1uvtmcs",$$css:!0},contentBgSurface:{kWkggS:"x10xzikg",$$css:!0},contentBgWash:{kWkggS:"x1eiddq6",$$css:!0},contentBgTransparent:{kWkggS:"xjbqb8w",kHBbk8:"xc8icb0",$$css:!0},navAreaWash:{kWkggS:"x1eiddq6",$$css:!0},navAreaSurface:{kWkggS:"x10xzikg",$$css:!0},banner:{kmuXW:"x2lah0s",$$css:!0},headerSticky:{kVAEAm:"x7wzq59",k87sOh:"x13vifvy",kY2c9j:"x1vjfegm",$$css:!0},panelAutoFill:{kUk6DE:"x98rzlu",kVQacm:"xysyzu8",$$css:!0}};function CS({variant:e="elevated",banner:t,children:n,contentPadding:s,"data-testid":r,height:i="fill",mobileNav:a,sideNav:l,topNav:c,xstyle:u,className:d,style:f,ref:p,...x}){const g=ze(),v=a===!1,y=a!=null&&a!==!1&&typeof a=="object"&&!h.isValidElement(a)?a:null,m=(y==null?void 0:y.breakpoint)??"md",k=a!=null&&a!==!1&&(h.isValidElement(a)||typeof a=="string")?a:null,b=(y==null?void 0:y.content)??null,j=(y==null?void 0:y.hasToggle)!==!1,A=(y==null?void 0:y.isOpen)!==void 0,M=m==="none"?"(max-width: 0px)":`(max-width: ${_D[m]}px)`,T=Ya(M,y==null?void 0:y.defaultIsMobile),[z,$]=h.useState(!1),E=(y==null?void 0:y.isOpen)??z,N=h.useCallback(at=>{var Mt;A||$(at),(Mt=y==null?void 0:y.onOpenChange)==null||Mt.call(y,at)},[A,y]),_=h.useCallback(()=>{var at;(at=document.getElementById(qm))==null||at.focus()},[]),R=i==="fill",B=i==="auto",D=Rm(t),I=Rm(c),O=Rm(l),H=!v&&(I||O)&&k==null,q=e==="section",U=e==="elevated",X=e==="wash"||e==="elevated"?En.navAreaWash:e==="surface"?En.navAreaSurface:void 0,Z=e==="wash"?En.contentBgWash:e==="elevated"&&I&&O&&!T?En.contentBgTransparent:e==="surface"||e==="elevated"?En.contentBgSurface:void 0,ie=X??En.navAreaSurface,ae=h.useRef(null),xe=h.useRef(null);h.useEffect(()=>{if(!B||!ae.current||!xe.current)return;const at=ae.current,Mt=xe.current,Dn=()=>{const nt=at.getBoundingClientRect().height;Mt.style.setProperty("--appshell-header-height",`${nt}px`)};return _4(at,()=>Dn()),()=>R4(at)},[B]);const fe=O&&!T,se=k!=null,ye=H&&b!=null&&T,me=h.useId(),P=h.useMemo(()=>({isMobile:T,isMobileNavOpen:E,mobileNavId:me,toggleMobileNav:()=>H&&N(!E),openMobileNav:()=>H&&N(!0),closeMobileNav:()=>N(!1),isMobileNavEnabled:H,hasAutoToggle:j}),[T,E,me,N,H,j]),V=O&&j?o.jsx(pu,{value:"drawer-content",children:l}):null,Y=O?o.jsx(pu,{value:"drawer-content",children:l}):null,oe=I?T&&!v&&k==null?o.jsx(Ly,{value:V,children:o.jsx(Iy,{value:"mobile-bar",children:c})}):c:null,F=I||D?o.jsxs(sx,{padding:0,hasDivider:q&&I,children:[D&&o.jsx("div",{...G(En.banner,X),children:t}),I&&oe]}):void 0,le=F!=null?o.jsx("div",{ref:ae,role:"banner",...ne(J("app-shell-header",{variant:e}),G(X,B&&En.headerSticky)),children:F}):void 0,ce=fe?o.jsx(O4,{padding:0,hasDivider:q,isScrollable:R,...J("app-shell-sidenav",{variant:e}),xstyle:[X,B&&ie,B&&En.panelAutoFill],children:l}):void 0,ge=ce!=null&&B?o.jsx("div",{className:"x2lah0s x7giv3 x7wzq59 xepuwc7 x16zugyo x78zum5 xdt5ytf",children:ce}):ce,ve=U&&I&&fe,pe=o.jsx(Es,{padding:s??0,role:"main",id:qm,tabIndex:-1,isScrollable:R,xstyle:[Z,En.mainFocusTarget],children:n}),Ve=ve?o.jsxs("div",{className:"x1n2onr6 x78zum5 x98rzlu x2lwn1j x5yr21d",children:[o.jsx("div",{className:"x10l6tqk x10a8y8t x10xzikg x183tx6i x47corl"}),pe]}):pe,ot=!v&&j&&T&&!I&&O?o.jsx("div",{...ne(J("app-shell-header",{variant:e}),G(X,B&&En.headerSticky)),children:o.jsx(sx,{padding:0,hasDivider:q,children:o.jsxs("div",{className:"x78zum5 x6s0dn4 x1k15mir xf314gf",role:"navigation","aria-label":g("@astryx.appShell.mobileNavigation"),children:[o.jsx(pu,{value:"topbar",children:l}),o.jsx(jS,{})]})})}):void 0;return o.jsx(V4,{value:P,children:o.jsxs("div",{...x,ref:Ft(p,xe),"data-testid":r,...ne(J("app-shell",{variant:e}),G(En.root,e==="wash"?En.variantWash:e==="surface"?En.variantSurface:e==="section"?En.variantSection:En.variantElevated,R?En.rootFill:En.rootAuto,u),d,f),children:[o.jsx("a",{href:`#${qm}`,onClick:_,className:"x10l6tqk x1xrnuwo x1i1rx1s x1jqxupm xjm9jq1 x15cytp8 xt970qd xh2mrf5 xnjsko4 x1cf3d6k xkdpibf x1y5lnwp xb3r6kr xomzh7y x1hyvwdk x1rsz1da xuxw1ft x1hbpcn8 xc342km x13vifvy x1rw3289 x1o0tod xodanix x10xzikg xjse4m1 x1q2oy4v x1hl2dhg x2mo6ok xjm74w1","data-testid":"skip-to-content",children:g("@astryx.appShell.skipToContent")}),o.jsx(Cs,{height:i,padding:0,header:o.jsxs(o.Fragment,{children:[le,ot]}),start:ge,content:Ve}),se&&k,ye&&b,T&&!v&&k==null&&!b&&o.jsxs(ND,{mode:E?"visible":"hidden",children:[O&&!I&&o.jsx(pu,{value:"drawer",children:l}),I&&o.jsx(Ly,{value:Y,children:o.jsx(Iy,{value:"drawer",children:c})})]})]})})}CS.displayName="AppShell";const ES=h.createContext(36);ES.displayName="AvatarSizeContext";const $S=h.createContext(null);$S.displayName="AvatarGroupContext";function RD(){return h.use($S)}const s6=(1-1/Math.SQRT2)/2,ID=.4;function LD(e){if(typeof e=="number")return e;switch(e){case"xsm":return 20;case"sm":return 24;case"md":return 36;case"lg":return 48;case"xl":return 128}}const Fc={wrapper:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kmuXW:"x2lah0s",kaIpWk:"xjspbzw",$$css:!0},content:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kaIpWk:"xjspbzw",kVQacm:"xb3r6kr",kfSwDN:"x87ps6o",$$css:!0},fallback:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kzqmXN:"xh8yej3",kZKoxP:"x5yr21d",kWkggS:"xelv01g",kMwMTN:"xicfil",kMv6JI:"x9ynric",k63SB2:"xi08x9w",kP9fke:"xtvhhri",$$css:!0},status:{kVAEAm:"x10l6tqk",$$css:!0},focusable:{kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},interactive:{kysU6D:"xjyslct",kmVPX3:"x1717udv",kogj98:"x1ghz6dp",kMzoRj:"xc342km",ksu8eU:"xng3xce",kWkggS:"xjbqb8w",kMwMTN:"x1heor9g",kVVagm:"xln7xf2",kybGjl:"x1hl2dhg",kkrTdU:"x1ypdohk",kaIpWk:"xjspbzw",kMeerF:"x1k57tk5 x784prv",k3XXqK:"x1t137rt x9v5kkp",kjBf7l:"xzunyri",kInvED:"x1wfwxd8 x7s97pk",$$css:!0}},OD={kGuDYH:"xdmh292",$$css:!0},DD={krVfgx:"x1nqzi6q",kt4wiu:"xqxgn94",k3aq6I:"x4v1no5 xqgnvz5",$$css:!0},Pm={size:e=>[{kzqmXN:e!=null?"x5lhr3w":e,kZKoxP:e!=null?"x16ye13r":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e),"--x-height":(t=>typeof t=="number"?t+"px":t??void 0)(e)}],fontSize:e=>[OD,{"--x-fontSize":(t=>typeof t=="number"?t+"px":t??void 0)(`var(--_avatar-fallback-font-size, ${e*ID}px)`)}],statusPosition:e=>[DD,{"--x-bottom":(t=>typeof t=="number"?t+"px":t??void 0)(e*s6),"--x-insetInlineEnd":(t=>typeof t=="number"?t+"px":t??void 0)(e*s6)}]},r6={ring:{kaIpWk:"xjspbzw",kMzoRj:"xdh2fpr",ksu8eU:"x1y0btm7",kVAM5u:"x1touxvs",kWkggS:"x10xzikg",kB7OPa:"x1afcbsf",$$css:!0},overlap:{keTefX:"x1sik18w",$$css:!0}},BD={"--_avatar-group-overlap":"xlz5hwt",$$css:!0},HD={overlap:e=>[BD,{"--x---_avatar-group-overlap":`${e}px`!=null?`${e}px`:void 0}]};function qD(e){const t=e.trim().split(/\s+/);return t.length===0?"":t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}function PD(e){if(!h.isValidElement(e))return;const{label:t}=e.props;return typeof t=="string"&&t!==""?t:void 0}function UD({size:e}){return o.jsx("svg",{width:e*.6,height:e*.6,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:o.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})})}function AS({alt:e,"data-testid":t,fallbackSrc:n,name:s,size:r="md",src:i,status:a,tooltip:l=!0,href:c,as:u,target:d,rel:f,onClick:p,xstyle:x,className:g,style:v,ref:y,...m}){const[k,b]=h.useState(void 0),[j,A]=h.useState(void 0),M=i&&k!==i,T=!M&&n&&j!==n,z=!M&&!T&&s,$=!M&&!T&&!s,E=ze(),N=e||s,_=PD(a),R=N&&_?E("@astryx.avatar.nameWithStatus",{name:N,status:_}):N||_,B=!R,D=RD(),I=(D==null?void 0:D.size)??r,O=h.useMemo(()=>LD(I),[I]),L=l===!1?void 0:typeof l=="string"?l:s,H=L==null?void 0:L.trim(),q=H!=null&&H!=="",U=typeof l=="string",X=Ss({placement:"above",isEnabled:q}),Z=Ft(y,q?X.ref:void 0),ie=q&&U?{"aria-describedby":[m["aria-describedby"],X.describedBy].filter(Boolean).join(" ")||void 0}:null,ae=c!=null,xe=!ae&&p!=null,fe=ae||xe,se=Ja(u);fe&&!R&&console.warn("Avatar: an interactive avatar (with `href` or `onClick`) needs a meaningful accessible name. Pass `alt` or `name`.");const ye=o.jsxs(o.Fragment,{children:[o.jsxs("div",{...G(Fc.content,Pm.size(O)),children:[M&&o.jsx("img",{src:i,alt:"",onError:()=>b(i),className:"xh8yej3 x5yr21d xl1xv1r"}),T&&o.jsx("img",{src:n,alt:"",onError:()=>A(n),className:"xh8yej3 x5yr21d xl1xv1r"}),z&&o.jsx("div",{...G(Fc.fallback,Pm.fontSize(O)),children:qD(s)}),$&&o.jsx("div",{className:"x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xelv01g xicfil x9ynric xi08x9w xtvhhri",children:o.jsx(UD,{size:O})})]}),a&&o.jsx("div",{...G(Fc.status,Pm.statusPosition(O)),children:a})]}),me=ne(J("avatar",{size:I}),G(Fc.wrapper,fe&&Fc.interactive,!fe&&q&&!D&&Fc.focusable,D&&r6.ring,D&&r6.overlap,D&&HD.overlap(-D.overlap),x),g,v);let P;const V=m;ae?P=o.jsx(se,{...V,...ie,ref:Z,href:c,target:d,rel:f,"aria-label":R,"data-avatar-item":"","data-testid":t,onClick:p,...me,children:ye}):xe?P=o.jsx("button",{...V,...ie,ref:Z,type:"button","aria-label":R,"data-avatar-item":"","data-testid":t,onClick:p,...me,children:ye}):P=o.jsx("div",{...m,ref:Z,role:B?"presentation":"img","aria-label":B?void 0:R,"aria-hidden":B||void 0,tabIndex:q&&!D?0:void 0,"data-testid":t,...ie,...me,children:ye});const Y=o.jsx(ES,{value:O,children:P});return o.jsxs(o.Fragment,{children:[Y,q?X.renderTooltip(H):null]})}AS.displayName="Avatar";function FD(e){return!e||typeof window>"u"?!1:window.getComputedStyle(e).direction==="rtl"}const Bi=typeof window<"u"?h.useLayoutEffect:h.useEffect,VD=new Set(["text","search","url","tel","email","password","number"]);function GD(e){if(e.isContentEditable)return e;const t=e.closest("[contenteditable]");return t&&t.getAttribute("contenteditable")!=="false"?t:null}function i6(e,t){if(!(e instanceof HTMLElement))return!1;const n=GD(e);if(n){const u=typeof window<"u"?window.getSelection():null;return u&&u.rangeCount>0&&!u.isCollapsed?!0:(n.textContent??"").length>0}const s=e.tagName==="TEXTAREA",r=e.tagName==="INPUT"&&VD.has(e.type);if(!s&&!r)return!1;const i=e,{selectionStart:a,selectionEnd:l,value:c}=i;return a!==l||a==null?!0:t==="ArrowLeft"||t==="ArrowUp"||t==="Home"?a>0:t==="ArrowRight"||t==="ArrowDown"||t==="End"?a<c.length:!1}function Tc(e={}){const{itemSelector:t='[role="menuitem"]',boundarySelector:n,wrap:s=!0,onEscape:r,orientation:i="vertical",hasHomeEnd:a=!0,isRtl:l,hasRovingTabIndex:c=!1,hasCaretGuard:u=!1}=e,d=h.useRef(null),f=h.useCallback(z=>z.getAttribute("aria-disabled")==="true"||z.disabled===!0||z.hasAttribute("disabled"),[]),p=h.useCallback(()=>{const z=d.current;if(!z)return[];const $=Array.from(z.querySelectorAll(t));return n?$.filter(E=>E.closest(n)===z):$},[t,n]),x=h.useCallback(z=>{const $=d.current;if(!$||!n)return!0;const E=z.target;return E?E.closest(n)===$:!0},[n]),g=h.useCallback((z,$,E,N)=>{const _=z.length;if(_===0)return-1;let R=$;for(let B=0;B<_;B++){if(R<0||R>=_){if(!N)return-1;R=(R+_)%_}const D=z[R];if(D&&!f(D))return R;R+=E}return-1},[f]),v=h.useCallback(()=>{const z=p(),$=document.activeElement;return z.findIndex(E=>E===$||E.contains($))},[p]),y=h.useCallback((z,$)=>{z.getAttribute("tabindex")!==String($)&&z.setAttribute("tabindex",String($))},[]),m=h.useCallback(()=>{const z=p(),$=z.filter(_=>!f(_));if($.length===0)return;const N=$.find(_=>_.getAttribute("tabindex")==="0")??$[0];for(const _ of z)y(_,_===N?0:-1)},[p,f,y]);Bi(()=>{c&&m()});const k=h.useCallback((z,$)=>{const E=z[$];if(E){if(c)for(const N of z)y(N,N===E?0:-1);E.focus()}},[c,y]),b=h.useCallback(z=>{const $=p();if($.length===0)return;const E=Math.max(0,Math.min(z,$.length-1));k($,E)},[p,k]),j=h.useCallback(()=>{const z=p(),$=g(z,0,1,!1);return $!==-1?(k(z,$),!0):!1},[p,g,k]),A=h.useCallback(()=>{const z=p(),$=g(z,z.length-1,-1,!1);return $!==-1?(k(z,$),!0):!1},[p,g,k]),M=h.useCallback(()=>{c&&m()},[c,m]),T=h.useCallback(z=>{if(z.ctrlKey||z.metaKey||z.altKey||!x(z))return;if(z.key==="Escape"){z.preventDefault(),r==null||r();return}const $=i==="horizontal"||i==="both",E=i==="vertical"||i==="both",N=[],_=[];if($){const H=z.key==="ArrowLeft"||z.key==="ArrowRight"?l??FD(d.current):!1;N.push(H?"ArrowLeft":"ArrowRight"),_.push(H?"ArrowRight":"ArrowLeft")}E&&(N.push("ArrowDown"),_.push("ArrowUp"));const R=N.includes(z.key),B=_.includes(z.key),D=a&&z.key==="Home",I=a&&z.key==="End";if(!R&&!B&&!D&&!I||u&&(i6(z.target,z.key)||i6(document.activeElement,z.key)))return;const O=v(),L=p();if(R){const H=O===-1?0:O+1,q=g(L,H,1,s);q!==-1&&k(L,q)}else if(B){const H=O===-1?L.length-1:O-1,q=g(L,H,-1,s);q!==-1&&k(L,q)}else D?j():I&&A();z.preventDefault()},[v,p,s,i,l,a,u,g,k,j,A,r,x]);return{listRef:d,handleKeyDown:T,handleFocus:M,focusItem:b,focusFirst:j,focusLast:A,ownsEvent:x,getItems:p}}const WD={base:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"xzye2dw",kZKoxP:"x1grt7ep",k8WAf4:"xt970qd",kg3NbH:"xf314gf",kaIpWk:"xjspbzw",kMv6JI:"xjb2p0i",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",k63SB2:"x1e4wzip",khDVqt:"xuxw1ft",$$css:!0}},KD={neutral:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",$$css:!0},info:{kWkggS:"x1ewilqj",kMwMTN:"x17wrial",$$css:!0},success:{kWkggS:"xdsz4j9",kMwMTN:"xri61p4",$$css:!0},warning:{kWkggS:"x1q8g9m5",kMwMTN:"xrebv38",$$css:!0},error:{kWkggS:"x1pjz0fi",kMwMTN:"x1m024r3",$$css:!0},blue:{kWkggS:"x1o0wnni",kMwMTN:"x1vvqiwl",$$css:!0},cyan:{kWkggS:"x1rgj867",kMwMTN:"x1txnczv",$$css:!0},green:{kWkggS:"x1sqjeoo",kMwMTN:"xltfdvo",$$css:!0},orange:{kWkggS:"x1e9xt6e",kMwMTN:"xm47u9q",$$css:!0},pink:{kWkggS:"xnpoty2",kMwMTN:"xiuofww",$$css:!0},purple:{kWkggS:"x16i6n6f",kMwMTN:"x1m9wyeb",$$css:!0},red:{kWkggS:"x1cibrc5",kMwMTN:"x1joocv1",$$css:!0},teal:{kWkggS:"x1jtji5o",kMwMTN:"x9x0lbs",$$css:!0},yellow:{kWkggS:"x1bo7t0x",kMwMTN:"xdhq94a",$$css:!0}};function Bd({variant:e="neutral",label:t,icon:n,xstyle:s,className:r,style:i,ref:a,...l}){return o.jsxs("span",{ref:a,...ne(J("badge",{variant:e}),G(WD.base,KD[e],s),r,i),...l,children:[n,t]})}Bd.displayName="Badge";const XD={info:"info",warning:"warning",error:"error",success:"success"},ZD={info:"status",warning:"alert",error:"alert",success:"status"},YD={info:"accent",warning:"warning",error:"error",success:"success"},ol={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kMv6JI:"xjb2p0i",$$css:!0},rootElevatedCard:{kaIpWk:"x1hviunn",$$css:!0},header:{k1xSpc:"x78zum5",kGNEyG:"x1cy8zhl",kOIVth:"x1txdalj",k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",$$css:!0},headerCardStandalone:{kaIpWk:"x1hviunn",$$css:!0},headerCardWithContent:{krdFHd:"x81l70g",kfmiAY:"x7hs6f1",kVL7Gh:"xbiv7yw",kT0f0o:"x16uus16",$$css:!0},headerCentered:{kGNEyG:"x6s0dn4",$$css:!0},endArea:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kmuXW:"x2lah0s",keTefX:"xvc5jky",kqGvvJ:"x81ka23",$$css:!0}},QD={info:{kWkggS:"xgcxg3y",$$css:!0},warning:{kWkggS:"x24i8r5",$$css:!0},error:{kWkggS:"x1pritpl",$$css:!0},success:{kWkggS:"xu13z74",$$css:!0}},JD={none:{kGVxlE:"x1gnnqk1",$$css:!0},low:{kGVxlE:"x1i5ehqx",$$css:!0},med:{kGVxlE:"x14hfi27",$$css:!0},high:{kGVxlE:"x1kcpxr7",$$css:!0}};function Oe({status:e,title:t,description:n,icon:s,isDismissable:r=!1,onDismiss:i,endContent:a,container:l="card",elevation:c="none",defaultIsExpanded:u=!1,children:d,xstyle:f,className:p,style:x,ref:g,...v}){const y=ze(),[m,k]=h.useState(!1),[b,j]=h.useState(u),A=h.useId(),M=XD[e],T=ZD[e],z=YD[e],$=d!=null;if(m)return null;const E=()=>{k(!0),i==null||i()},N=()=>{j(O=>!O)},_=a!=null||r||$,R=a!=null||r,B=n==null&&R,D=$&&b,I=l==="card";return o.jsxs("div",{ref:g,role:T,...ne(G(ol.root,JD[c],I&&c!=="none"&&ol.rootElevatedCard,f),p,x),...v,children:[o.jsxs("div",{...ne(J("banner",{container:l,status:e}),G(ol.header,B&&ol.headerCentered,QD[e],I&&(D?ol.headerCardWithContent:ol.headerCardStandalone))),children:[o.jsx("div",{...ne(J("banner-icon",{status:e}),{className:"x78zum5 x6s0dn4 x2lah0s"}),"aria-hidden":"true",children:s??o.jsx(Te,{icon:M,size:"md",color:z})}),o.jsxs("div",{className:"x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli",children:[o.jsx("div",{className:"x1ghz6dp xjb2p0i xcr08ib x2mo6ok x1kq96og x1tgivj0",children:t}),n!=null&&o.jsx("div",{className:"x1ghz6dp xjb2p0i x141an7d x1sodnla x1ltkj2j xv1l7n4",children:n})]}),_&&o.jsxs("div",{...G(ol.endArea,vO.inset(wr["--spacing-2"])),children:[a,$&&o.jsx(Q,{variant:"ghost",size:"sm",label:y(b?"@astryx.banner.collapse":"@astryx.banner.expand"),tooltip:y(b?"@astryx.banner.collapse":"@astryx.banner.expand"),icon:o.jsx("span",{...{0:{className:"x3nfvp2 x11xpdln xuedmi6 x12w9bfk xlr8y92"},1:{className:"x3nfvp2 x11xpdln xuedmi6 x12w9bfk xlr8y92 x19jd1h0"}}[!!b<<0],children:o.jsx(Te,{icon:"chevronDown",size:"sm",color:"inherit"})}),onClick:N,"aria-expanded":b,"aria-controls":D?A:void 0,isIconOnly:!0}),r&&o.jsx(Q,{variant:"ghost",size:"sm",label:y("@astryx.banner.dismiss"),tooltip:y("@astryx.banner.dismiss"),icon:o.jsx(Te,{icon:"close",size:"sm",color:"inherit"}),onClick:E,isIconOnly:!0})]})]}),D&&o.jsx("div",{id:A,...ne(J("banner-content",{container:l,status:e}),{0:{className:"x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh"},1:{className:"x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh x14k8p9y xiaxfje"}}[!!I<<0]),children:d})]})}Oe.displayName="Banner";const eB={root:{k2ei4v:"xtpqe59",kVhnKS:"x1t7ytsu",kGJrpR:"x14ydlgx",kZCmMZ:"x1rey3nv",kMwMTN:"xv1l7n4",keTefX:"x1lziwak",k71WvV:"x14z9mp",keoZOQ:"xdj266r",k1K539:"xat24cr",$$css:!0}};function MS({children:e,cite:t,xstyle:n,className:s,style:r,ref:i,...a}){return o.jsxs("blockquote",{ref:i,...ne(J("blockquote"),G(eB.root,n),s,r),...a,children:[e,t!=null&&o.jsx("footer",{children:o.jsx("cite",{className:"x1lliihq xtbrsbv x141an7d x1ltkj2j x1j61x8r",children:t})})]})}MS.displayName="Blockquote";const tB='button:not([disabled]), a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [contenteditable]:not([contenteditable="false"]), audio[controls], video[controls], iframe, details > summary:first-child',go=[];function nB(e){go.push(e)}function sB(e){for(let t=go.length-1;t>=0;t--)if(go[t].handler===e){go.splice(t,1);return}}function rB(e){if(go.length===0)return!1;let t=go[0];for(let n=1;n<go.length;n++){const s=go[n],r=t.getContainer(),i=s.getContainer();r!=null&&i!=null&&i!==r&&i.contains(r)||(t=s)}return t.handler===e}function o6(){return go.length>0}function TS(e){return e.isComposing===!0||e.keyCode===229}function iB(e){if(e.hasAttribute("inert")||e.closest("[inert]")||e.hidden||e.closest("[hidden]")||e.closest('[aria-hidden="true"]'))return!1;if(typeof window<"u"&&window.getComputedStyle){const t=window.getComputedStyle(e);if(t.visibility==="hidden"||t.display==="none")return!1}return!0}function G4(e){return Array.from(e.querySelectorAll(tB)).filter(iB)}function zS(e){try{e.focus()}catch{}return document.activeElement===e}function a6(e){const t=G4(e);for(const n of t)if(zS(n))return!0;return!1}function oB(e){const t=G4(e);for(let n=t.length-1;n>=0;n--)if(zS(t[n]))return!0;return!1}function aB(e){const{isActive:t,onEscape:n}=e,s=h.useRef(null),r=h.useRef(null),i=h.useRef(!1),a=h.useCallback(()=>{s.current&&a6(s.current)},[]);return h.useEffect(()=>{if(!t)return;const l=document.activeElement,c=s.current;return()=>{const u=document.activeElement;(u==null||u===document.body||u===document.documentElement||c!=null&&c.contains(u))&&l!=null&&l.isConnected&&typeof l.focus=="function"&&l.focus()}},[t]),h.useEffect(()=>{if(!t)return;const l=c=>{const u=s.current;if(!u)return;const d=c.target;u.contains(d)?r.current=d:i.current&&(a6(u),r.current===document.activeElement&&oB(u),r.current=document.activeElement),i.current=!1};return document.addEventListener("focus",l,!0),()=>{document.removeEventListener("focus",l,!0)}},[t]),h.useEffect(()=>{if(!t)return;const l=()=>{n==null||n()};n&&nB({handler:l,getContainer:()=>s.current});const c=u=>{const d=s.current;if(d){if(u.key==="Escape"&&n){if(u.defaultPrevented||TS(u)||!rB(l))return;u.preventDefault(),u.stopPropagation(),n();return}if(u.key==="Tab"){i.current=!0;const f=G4(d);if(f.length===0)return;const p=f[0],x=f[f.length-1];u.shiftKey?document.activeElement===p&&(u.preventDefault(),x.focus()):document.activeElement===x&&(u.preventDefault(),p.focus())}}};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),n&&sB(l)}},[t,n]),{containerRef:s,focusFirst:a}}function Hd(e,t,n=!0){const s=h.useRef(!1);h.useEffect(()=>{n&&!s.current&&(s.current=!0,oc())},[e,t,n])}const Um={surface:{kWkggS:"x1prclbq",kaIpWk:"x1hviunn",kGVxlE:"x1i5ehqx",$$css:!0},contentWrapper:{kVAEAm:"x1n2onr6",$$css:!0},closeButtonWrapper:{kVAEAm:"x10l6tqk",krVfgx:"x1ey2m1c",kY2c9j:"x1vjfegm",kzqmXN:"x1i1rx1s x10okhzq",kZKoxP:"xjm9jq1 x132qfvm",kVQacm:"xb3r6kr x1dordxg",kz4h6p:"x1hyvwdk x10wafsz",kfzvcC:"x47corl xbt4iw",kLKAdn:"xexx8yu x1kw28su",$$css:!0}};function zc(e={}){const{onShow:t,onHide:n,xstyle:s,hasLightDismiss:r=!0,hasEscapeDismiss:i=!0,hasAutoFocus:a=!0,hasSurface:l=!0,hasCloseButton:c=!0,closeButtonLabel:u,dialogLabel:d,role:f="dialog",isModal:p=!0}=e,x=ze(),g=u??x("@astryx.popover.close"),v=h.useRef(null),y=h.useRef(!1),m=Dd({mode:"context",lightDismiss:r,onShow:t,onHide:n}),{containerRef:k,focusFirst:b}=aB({isActive:m.isOpen,onEscape:i||r?m.hide:void 0});h.useEffect(()=>{m.isOpen&&a&&!y.current&&requestAnimationFrame(()=>{b()}),m.isOpen||(y.current=!1)},[m.isOpen,a,b]);const j=h.useCallback($=>{v.current=$,m.ref($)},[m]),A=h.useCallback($=>{y.current=($==null?void 0:$.skipAutoFocus)??!1,m.show()},[m]),M=h.useCallback(()=>{m.isOpen?m.hide():A()},[m,A]),T={"aria-haspopup":f==="dialog"?"dialog":"true","aria-expanded":m.isOpen,"aria-controls":m.id};Hd("usePopover",'role="dialog" without a `dialogLabel` renders an unnamed dialog. Pass `dialogLabel`, or use `role: "none"` for listbox/menu popups whose content already carries its own role.',f==="dialog"&&!d);const z=h.useCallback(($,E)=>m.render(o.jsxs("div",{ref:k,role:f==="dialog"?"dialog":void 0,"aria-modal":f==="dialog"&&p?!0:void 0,"aria-label":f==="dialog"?d:void 0,...G(Um.contentWrapper,l&&Um.surface,s),children:[$,c&&o.jsx("div",{...G(Um.closeButtonWrapper,xd.centerInline("100%")),children:o.jsx(Q,{variant:"secondary",label:g,onClick:m.hide})})]}),{...E,xstyle:E==null?void 0:E.xstyle}),[m,c,l,g,k,d,f,p,s]);return{triggerRef:j,contentRef:k,anchorId:m.anchorId,show:A,hide:m.hide,toggle:M,isOpen:m.isOpen,id:m.id,render:z,triggerProps:T}}function lB(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key!==" "}function W4(e){const{getItemLabels:t,onMatch:n,getCurrentIndex:s,resetMs:r=750,isDisabled:i}=e,a=h.useRef(""),l=h.useRef(void 0),c=h.useCallback(()=>{a.current="",l.current&&(clearTimeout(l.current),l.current=void 0)},[]),u=h.useCallback(()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a.current="",l.current=void 0},r)},[r]);return{onKeyDown:h.useCallback(f=>{const p=f.key===" "&&a.current.length>0;if(!lB(f)&&!p)return!1;const x=t();if(x.length===0)return!1;const g=f.key.toLowerCase(),v=a.current.length>0&&a.current.split("").every(j=>j===g),y=v?g:a.current+g;a.current=y,u();const m=(s==null?void 0:s())??-1,k=x.length,b=v?1:0;for(let j=0;j<k;j++){const A=(m+b+j+k)%k;if(i!=null&&i(A))continue;const M=x[A];if(M!=null&&M.trim().toLowerCase().startsWith(y))return n(A),!0}return!0},[t,n,s,u,i]),reset:c}}const l6={horizontal:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kzqmXN:"xh8yej3",$$css:!0},vertical:{k1xSpc:"x3nfvp2",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kZKoxP:"x5yr21d",$$css:!0}},Vc={horizontalLine:{kZKoxP:"xsyqizj",kzQI83:"x1iyjqo2",kmuXW:"xs83m0k",$$css:!0},verticalLine:{kzqmXN:"xjk4fl7",kzQI83:"x1iyjqo2",kmuXW:"xs83m0k",$$css:!0},subtle:{kWkggS:"x1m4xfpy",$$css:!0},strong:{kWkggS:"x7njt3n",$$css:!0}},c6={horizontal:{keTefX:"xojxgvx",k71WvV:"x1fcf3bl",kzqmXN:"xx6qvi6",$$css:!0},vertical:{keoZOQ:"x1sa9bsh",k1K539:"x6h7pi7",kZKoxP:"x12qplqi",$$css:!0}};function Na({orientation:e="horizontal",label:t,variant:n="subtle",isFullBleed:s=!1,xstyle:r,className:i,style:a,ref:l,"aria-label":c,"aria-labelledby":u,...d}){const f=e==="horizontal",p=h.useId(),x=u??(t&&c==null?p:void 0);return o.jsxs("div",{ref:l,...d,role:"separator","aria-orientation":e,"aria-label":c,"aria-labelledby":x,...ne(J("divider",{variant:n,orientation:e}),G(f?l6.horizontal:l6.vertical,s&&(f?c6.horizontal:c6.vertical),r),i,a),children:[o.jsx("div",{...G(f?Vc.horizontalLine:Vc.verticalLine,Vc[n])}),t&&o.jsx("div",{id:p,...{0:{className:"x2lah0s xrrkdod x141an7d x1ltkj2j xv1l7n4"},1:{className:"x2lah0s x141an7d x1ltkj2j xv1l7n4 xnjsko4 x8o8v82"}}[!f<<0],children:t}),t&&o.jsx("div",{...G(f?Vc.horizontalLine:Vc.verticalLine,Vc[n])})]})}Na.displayName="Divider";const cB=["noopener","noreferrer"];function NS(e,t){if(e!=="_blank")return{target:e,rel:t};const n=(t==null?void 0:t.split(/\s+/).filter(Boolean))??[];for(const s of cB)n.includes(s)||n.push(s);return{target:e,rel:n.join(" ")}}const _S=["button","a","input","select","textarea",'[role="button"]','[role="link"]','[role="checkbox"]','[role="radio"]','[role="switch"]','[role="tab"]','[role="menuitem"]','[role="option"]','[role="combobox"]','[role="listbox"]','[role="slider"]','[role="spinbutton"]',"[data-pressable-container]"].join(","),uB='[aria-readonly="true"]';function u6(e,t){let n=e;for(;n!=null&&n!==t&&n!==document.body;){if(n.matches(_S)&&!n.matches(uB))return!0;n=n.parentElement}return!1}function dB(e){if(typeof document>"u"||!("getSelection"in document))return!1;const t=document.getSelection();return t==null||t.isCollapsed?!1:e.contains(t.anchorNode)}function K4({containerRef:e,interactiveRef:t,onClick:n,href:s,target:r,disabled:i=!1}){h.useEffect(()=>{const c=e.current;c&&c.setAttribute("data-pressable-container","true")},[e]);const a=h.useCallback(c=>{if(i)return;const u=e.current;if(!u||dB(u))return;const d=c.target;if(d instanceof Element&&!(d!==c.currentTarget&&u6(d,u))&&(n==null||n(c),!c.defaultPrevented&&(s!=null&&(r==="_blank"||c.ctrlKey||c.metaKey?window.open(s,"_blank","noopener"):t!=null&&t.current?t.current.click():window.location.href=s),s==null&&n==null&&(t!=null&&t.current)))){const f=new MouseEvent("click",{bubbles:c.bubbles,cancelable:c.cancelable,ctrlKey:c.ctrlKey,metaKey:c.metaKey,shiftKey:c.shiftKey,altKey:c.altKey,button:c.button});t.current.dispatchEvent(f),c.stopPropagation()}},[e,t,n,s,r,i]),l=h.useCallback(c=>{if(i)return;const u=e.current;if(!u)return;const d=c.target;if(!(d instanceof Element))return;c.button===1&&s!=null&&(d===c.currentTarget||!u6(d,u))&&window.open(s,"_blank","noopener")},[e,s,i]);return{onClick:a,onMouseUp:l}}const fB=new Set(["option","tab","row","gridcell","columnheader","rowheader","treeitem"]),xs={root:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kg3NbH:"xf314gf",kVAEAm:"x1n2onr6",kB7OPa:"x9f619",k9WMMc:"x1yc453h",kaIpWk:"xh6dtrn",$$css:!0},alignStart:{kGNEyG:"x1cy8zhl",$$css:!0},interactive:{kkrTdU:"x1ypdohk",k1ekBW:"x15406qy",kIyJzY:"xkvfbh3",kAMwcw:"xlr8y92",kWkggS:"xjbqb8w xe9uy6x xyxi2l3",$$css:!0},focusVisibleOutline:{kI3sdo:"x1a2a7pz x1irc7jg",kInvED:"x1wfwxd8 xdjuwb3",$$css:!0},highlighted:{kWkggS:"x1lmrjuc",$$css:!0},selected:{kWkggS:"xgcxg3y",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kfzvcC:"x47corl",$$css:!0},label:{kMwMTN:"x1tgivj0",kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",$$css:!0},labelSingleTruncate:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:!0},labelMultiTruncate:{kVQacm:"xb3r6kr",k1xSpc:"x104kibb",kgKLqz:"x1ua5tub",$$css:!0},description:{kMwMTN:"xv1l7n4",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",$$css:!0},descriptionSingleTruncate:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:!0},descriptionMultiTruncate:{kVQacm:"xb3r6kr",k1xSpc:"x104kibb",kgKLqz:"x1ua5tub",$$css:!0}},d6={lineClamp:e=>[{kJFfOR:e!=null?"x1yhjpo9":e,$$css:!0},{"--x-WebkitLineClamp":e??void 0}]},hB={compact:{k8WAf4:"xu0wf1k",$$css:!0},balanced:{k8WAf4:"xce4md1",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"xrrkdod",$$css:!0}};function qd({as:e="div",marker:t,startContent:n,label:s,description:r,endContent:i,align:a="center",density:l="balanced",labelLines:c,descriptionLines:u,onClick:d,interactiveRef:f,href:p,target:x,rel:g,isHighlighted:v=!1,isSelected:y=!1,isDisabled:m=!1,xstyle:k,className:b,style:j,ref:A,role:M,...T}){const z=Ja(),$=f!=null,E=h.useRef(null),{onClick:N}=K4({containerRef:E,interactiveRef:f??void 0,disabled:m});Hd("Item","`interactiveRef` is mutually exclusive with `onClick`/`href`. In delegation mode the row only forwards clicks to the referenced control, so `onClick`/`href` are ignored. Drop one of them.",$&&(d!=null||p!=null));const _=d!=null||p!=null||$,{target:R,rel:B}=NS(x,g),D=M!=null,I=M!=null&&fB.has(M),O=typeof s=="string",L=typeof r=="string",H=c!=null?c===1?xs.labelSingleTruncate:xs.labelMultiTruncate:O?xs.labelSingleTruncate:null,q=u!=null?u===1?xs.descriptionSingleTruncate:xs.descriptionMultiTruncate:L?xs.descriptionSingleTruncate:null,U=o.jsxs(o.Fragment,{children:[o.jsx("span",{...G(xs.label,H,c!=null&&c>1&&d6.lineClamp(c)),children:s}),r!=null&&o.jsx("span",{...G(xs.description,q,u!=null&&u>1&&d6.lineClamp(u)),children:r})]}),X=ie=>{m||ie.target.closest("button, a, input, select, textarea")||d==null||d(ie)},Z=o.jsxs(o.Fragment,{children:[t,n!=null&&o.jsx("span",{className:"x3psx0u x78zum5",children:n}),D||$?o.jsx("span",{...{0:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h"},1:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h xbyyjgo"}}[!!m<<0],children:U}):p!=null?o.jsx(z,{href:p,target:R,rel:B,"aria-disabled":m||void 0,tabIndex:m?-1:void 0,...{0:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz"},1:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz xbyyjgo"}}[!!m<<0],children:U}):d!=null?o.jsx("button",{type:"button",onClick:d,disabled:m,...{0:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1a2a7pz"},1:{className:"xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1a2a7pz xbyyjgo"}}[!!m<<0],children:U}):o.jsx("span",{...{0:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h"},1:{className:"x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h xbyyjgo"}}[!!m<<0],children:U}),i!=null&&o.jsx("span",{...{0:{className:"x3psx0u x78zum5 xvc5jky"},1:{className:"x3psx0u x78zum5 xvc5jky xbyyjgo"}}[!!m<<0],children:i})]});return o.jsx(e,{ref:$?Ft(A,E):A,...T,"aria-selected":I&&y||void 0,"aria-current":T["aria-current"]??(y&&!I?!0:void 0),"aria-disabled":m||void 0,...ne(J("item",{density:l,align:a}),G(xs.root,hB[l],a==="start"&&xs.alignStart,_&&xs.interactive,_&&xs.focusVisibleOutline,v&&xs.highlighted,y&&xs.selected,m&&!D&&xs.disabled,k),b,j),role:M,onClick:$?N:D?d:_?X:void 0,children:Z})}qd.displayName="Item";const wh=h.createContext(null);wh.displayName="DropdownMenuContext";function RS(){return h.use(wh)}const pB=h.createContext(null);pB.displayName="DropdownMenuRadioGroupContext";function IS(e,t){if(t||e.pointerType!=="mouse")return;const n=e.currentTarget;n!==n.ownerDocument.activeElement&&n.focus()}const f6={root:{kB7OPa:"x9f619",kzqmXN:"xh8yej3",k8WAf4:"xce4md1",kg3NbH:"xf314gf",kaIpWk:"x1ws5lxm",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kMwMTN:"x1tgivj0",kWkggS:"xjbqb8w x1c52tdz",kkrTdU:"x1ypdohk",k9WMMc:"x1yc453h",kI3sdo:"x1a2a7pz",$$css:!0},disabled:{kSiTet:"xbyyjgo",kkrTdU:"x1h6gzvc",$$css:!0}},xB={sm:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},md:{k8WAf4:"x1vofgu7",$$css:!0},lg:{$$css:!0}};function k1({icon:e,label:t,description:n,onClick:s,isDisabled:r=!1,endContent:i,xstyle:a,className:l,style:c}){const u=RS(),d=(u==null?void 0:u.menuSize)??"md",f=h.useCallback(()=>{r||!s||(s(),u==null||u.closeMenu())},[r,s,u]),p=h.useCallback(x=>IS(x,r),[r]);return o.jsx(qd,{role:"menuitem",tabIndex:r?void 0:-1,onPointerMove:p,startContent:e?Lr(e,{size:"sm",color:"secondary"}):void 0,label:t,description:n,endContent:i,onClick:f,isDisabled:r,xstyle:[f6.root,xB[d],r&&f6.disabled,a],...ne(J("dropdown-menu-item",{size:d}),{className:l,style:c})})}k1.displayName="DropdownMenuItem";function gB(e){const{show:t,hide:n,isOpen:s,isEnabled:r,showDelay:i=150,hideDelay:a=200}=e,l=Ya("(hover: hover)"),c=h.useRef(null),u=h.useRef(null),d=h.useRef(null),f=h.useRef(!1),p=h.useRef(!1),x=h.useRef(s);x.current&&!s&&(f.current=!1),x.current=s;const g=h.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),u.current&&(clearTimeout(u.current),u.current=null)},[]),{listRef:v,handleKeyDown:y,focusFirst:m}=Tc({onEscape:()=>{g(),n()}});h.useEffect(()=>()=>g(),[g]);const k=h.useCallback(()=>{g(),s?(p.current=!0,n()):(p.current=!1,t(),requestAnimationFrame(()=>m()))},[s,g,t,n,m]),b=h.useCallback(()=>{if(l){if(p.current){p.current=!1;return}f.current=!0,g(),i>0?c.current=setTimeout(()=>{t({skipAutoFocus:!0})},i):t({skipAutoFocus:!0})}},[l,g,t,i]),j=h.useCallback(()=>{f.current&&(g(),u.current=setTimeout(()=>{n()},a))},[g,n,a]),A=h.useCallback(()=>{g()},[g]),M=h.useCallback(E=>{d.current=E},[]),T=h.useCallback(()=>{},[]),z=h.useCallback(E=>{},[]),$=h.useCallback(E=>{},[]);return r?{triggerProps:{onClick:k,onMouseEnter:b,onMouseLeave:j},contentProps:{onMouseEnter:A,onMouseLeave:j,onKeyDown:y},menuRef:v,focusFirst:m,setTriggerEl:M}:{triggerProps:{onClick:T,onMouseEnter:T,onMouseLeave:T},contentProps:{onMouseEnter:T,onMouseLeave:T,onKeyDown:$},menuRef:v,focusFirst:m,setTriggerEl:z}}const Eg=new Set(["menuitem","menuitemradio","menuitemcheckbox"]),$g=[...Eg].map(e=>`[role="${e}"]:not([aria-disabled="true"])`).join(","),X4='[role="menu"]',Fm={root:{kB7OPa:"x9f619",kzqmXN:"xh8yej3",k8WAf4:"xce4md1",kg3NbH:"xf314gf",kaIpWk:"x1ws5lxm",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kMwMTN:"x1tgivj0",kWkggS:"xjbqb8w x1c52tdz",kkrTdU:"x1ypdohk",k9WMMc:"x1yc453h",kI3sdo:"x1a2a7pz",$$css:!0},open:{kWkggS:"x1lmrjuc",$$css:!0},disabled:{kSiTet:"xbyyjgo",kkrTdU:"x1h6gzvc",$$css:!0}},mB={sm:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},md:{k8WAf4:"x1vofgu7",$$css:!0},lg:{$$css:!0}},yB={keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0},h6={popover:{k7Eaqz:"x5w4yej",keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0},popoverCustomWidth:e=>[yB,{k7Eaqz:(typeof e=="number"?`${e}px`:e)!=null?"xkj4a21":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}]};function LS(e){const{icon:t,label:n,description:s,isDisabled:r=!1,hasSpinner:i=!1,menuWidth:a,onOpenChange:l,children:c,xstyle:u,className:d,style:f,"data-testid":p,menuDataTestId:x}=e,g=RS(),v=(g==null?void 0:g.menuSize)??"md",y=!r,m=h.useId(),k=h.useId(),b=h.useRef(null),[j,A]=h.useState(!1),M=Dd({mode:"context",lightDismiss:!1,onShow:h.useCallback(()=>{A(!0),l==null||l(!0)},[l]),onHide:h.useCallback(()=>{A(!1),l==null||l(!1)},[l])}),T=h.useCallback(()=>{y&&M.show()},[y,M]),z=h.useCallback(()=>{M.hide()},[M]),{listRef:$,handleKeyDown:E,focusFirst:N,focusItem:_,ownsEvent:R,getItems:B}=Tc({itemSelector:$g,boundarySelector:X4,wrap:!1,onEscape:()=>H({focusTrigger:!0})}),D=W4({getItemLabels:()=>B().map(se=>se.textContent),onMatch:_,getCurrentIndex:()=>B().findIndex(se=>se===document.activeElement||se.contains(document.activeElement))}),{triggerProps:I,contentProps:O}=gB({show:T,hide:z,isOpen:j,isEnabled:y}),L=h.useCallback(se=>{y&&(M.show(),se!=null&&se.focusFirst&&requestAnimationFrame(()=>{var me;N()||(me=$.current)==null||me.focus()}))},[y,M,N,$]),H=h.useCallback(se=>{var ye;M.hide(),(se==null?void 0:se.focusTrigger)!==!1&&((ye=b.current)==null||ye.focus())},[M]),q=h.useCallback(se=>{b.current=se,M.ref(se)},[M]),U=h.useCallback(()=>{r||(j?H({focusTrigger:!0}):L({focusFirst:!0}))},[r,j,L,H]),X=h.useCallback(se=>{if(r)return;const me=(typeof window<"u"&&b.current?window.getComputedStyle(b.current).direction==="rtl":!1)?"ArrowLeft":"ArrowRight";(se.key===me||se.key==="Enter"||se.key===" ")&&(se.preventDefault(),se.stopPropagation(),L({focusFirst:!0}))},[r,L]),Z=h.useCallback(se=>IS(se,r),[r]),ie=h.useCallback(se=>{if(!R(se))return;if(se.key==="Escape"){se.preventDefault(),se.stopPropagation(),H({focusTrigger:!0});return}if(se.key==="Enter"||se.key===" "){se.preventDefault();const P=document.activeElement;P&&Eg.has(P.getAttribute("role")??"")&&P.click();return}const me=(typeof window<"u"&&$.current?window.getComputedStyle($.current).direction==="rtl":!1)?"ArrowRight":"ArrowLeft";if(se.key===me){se.preventDefault(),H({focusTrigger:!0});return}if(D.onKeyDown(se)){se.preventDefault();return}E(se)},[R,H,E,D,$]),ae=h.useMemo(()=>({menuSize:v,closeMenu:()=>{H({focusTrigger:!1}),g==null||g.closeMenu()}}),[v,H,g]),xe=i?o.jsx("span",{...ne(J("dropdown-menu-indicator-icon"),{className:"x78zum5 x6s0dn4"}),children:o.jsx(Vt,{size:"sm"})}):o.jsx("span",{...ne(J("dropdown-menu-indicator-icon"),{className:"x78zum5 x6s0dn4"}),children:o.jsx(Te,{icon:"chevronRight",size:"sm",color:"secondary"})}),fe=a?h6.popoverCustomWidth(a):h6.popover;return o.jsxs(o.Fragment,{children:[o.jsx(qd,{ref:se=>q(se),id:k,role:"menuitem",tabIndex:r?void 0:-1,"aria-haspopup":"menu","aria-expanded":j,"aria-controls":j?m:void 0,"aria-disabled":r||void 0,"data-testid":p,onMouseEnter:I.onMouseEnter,onMouseLeave:I.onMouseLeave,onPointerMove:Z,startContent:t?Lr(t,{size:"sm",color:"secondary"}):void 0,label:n,description:s,endContent:xe,onClick:U,onKeyDown:X,isDisabled:r,xstyle:[Fm.root,mB[v],j&&Fm.open,r&&Fm.disabled,u],...ne(J("dropdown-menu-item",{size:v}),{className:d,style:f})}),M.render(o.jsx("div",{ref:$,id:m,role:"menu",tabIndex:-1,"aria-labelledby":k,onKeyDown:ie,onMouseEnter:O.onMouseEnter,onMouseLeave:O.onMouseLeave,"data-testid":x,...ne(J("dropdown-menu"),{className:"x9f619 x78zum5 xdt5ytf x1lsbc85 xuyqlj2 x1odjw0f x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92"}),children:o.jsx(wh,{value:ae,children:c})}),{placement:"end",alignment:"start",xstyle:[fe,wo.end]})]})}LS.displayName="DropdownMenuSubMenu";const vB={divider:{kqGvvJ:"xsq74q5",$$css:!0}};function Vm(e){return`item-${e.label}`}function kB(e,t){return`section-${e.title??t}`}function Z4(e){const t=[];for(let n=0;n<e.length;n++){const s=e[n];"type"in s&&s.type==="divider"?t.push(o.jsx(Na,{xstyle:vB.divider,...J("dropdown-menu-divider")},`divider-${n}`)):"type"in s&&s.type==="section"?t.push(o.jsxs("div",{role:"group","aria-label":s.title,children:[s.title&&o.jsx("div",{"aria-hidden":"true",...ne(J("dropdown-menu-section-heading"),{className:"xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o"}),children:s.title}),s.items.map(r=>o.jsx(k1,{icon:r.icon,label:r.label,onClick:r.onClick,isDisabled:r.isDisabled},Vm(r)))]},kB(s,n))):"type"in s||(s.items&&s.items.length>0?t.push(o.jsx(LS,{icon:s.icon,label:s.label,isDisabled:s.isDisabled,children:Z4(s.items)},Vm(s))):t.push(o.jsx(k1,{icon:s.icon,label:s.label,onClick:s.onClick,isDisabled:s.isDisabled},Vm(s))))}return t}function bB(e){return typeof e=="string"||typeof e=="number"}function p6(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function Wi({children:e,anchorRef:t,content:n,placement:s="above",alignment:r="center",delay:i=200,hideDelay:a=0,focusTrigger:l="auto",isEnabled:c=!0,onOpenChange:u,hasHoverIndication:d="auto",isOpen:f,isDefaultOpen:p}){const x=h.useRef(null),g=e!=null?bB(e):!1,v=d===!0||d==="auto"&&g,y=h.useCallback(()=>{u==null||u(!0)},[u]),m=h.useCallback(()=>{u==null||u(!1)},[u]),k=Ss({placement:s,alignment:r,delay:i,hideDelay:a,focusTrigger:l,isEnabled:c,isOpen:f,isDefaultOpen:p,onShow:y,onHide:m});return Bi(()=>{if(!t)return;const b=t.current;if(!b)return;k.ref(b);const j=b.getAttribute("aria-describedby");return b.setAttribute("aria-describedby",p6(j,k.describedBy)??""),()=>{k.ref(null),j?b.setAttribute("aria-describedby",j):b.removeAttribute("aria-describedby")}},[t,k.ref,k.describedBy]),Bi(()=>{if(t||g)return;const b=x.current;if(!b)return;const j=b.firstElementChild;if(!j)return;k.ref(j);const A=j.getAttribute("aria-describedby");return j.setAttribute("aria-describedby",p6(A,k.describedBy)??""),()=>{k.ref(null),A?j.setAttribute("aria-describedby",A):j.removeAttribute("aria-describedby")}},[t,g,k.ref,k.describedBy]),t&&e==null?o.jsx(o.Fragment,{children:k.renderTooltip(n)}):g?o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:k.ref,tabIndex:0,"aria-describedby":k.describedBy,...{0:{className:"xt0psk2"},1:{className:"xt0psk2 xujl8zx xev0dqp xycaml9 xrys4gj"}}[!!v<<0],children:e}),k.renderTooltip(n)]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:x,className:"xjp7ctv",children:e}),k.renderTooltip(n)]})}Wi.displayName="Tooltip";const OS=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Wi},Symbol.toStringTag,{value:"Module"})),wB="data-astryx-live-region",jB="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;inset-block-start:0;inset-inline-start:0;pointer-events:none;user-select:none;",SB=2e3,ax={polite:null,assertive:null};function DS(e){const t=ax[e];t!=null&&(clearTimeout(t),ax[e]=null)}function CB(e,t){DS(e),ax[e]=setTimeout(()=>{ax[e]=null,t.textContent=""},SB)}let Zr=null;function x6(e){const t=document.createElement("div");return t.setAttribute(wB,e),t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.setAttribute("role",e==="assertive"?"alert":"status"),t.style.cssText=jB,document.body.appendChild(t),t}function EB(){return typeof document>"u"?null:Zr?(Zr.polite.isConnected||document.body.appendChild(Zr.polite),Zr.assertive.isConnected||document.body.appendChild(Zr.assertive),Zr):(Zr={polite:x6("polite"),assertive:x6("assertive")},Zr)}function $B(e,t){const n=EB();if(!n)return;const s=t==="assertive"?n.assertive:n.polite;s.textContent="",requestAnimationFrame(()=>{s.textContent=e}),CB(t,s)}function AB(e){if(DS(e),!Zr)return;const t=e==="assertive"?Zr.assertive:Zr.polite;t.textContent=""}function Nc(){return h.useCallback((e,t="polite")=>{if(!e){AB(t);return}$B(e,t)},[])}const MB={wrapper:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",kmuXW:"x2lah0s",$$css:!0}},TB={ctrl:"⌃",alt:"⌥",shift:"⇧",enter:"↵",backspace:"⌫",escape:"Esc",tab:"⇥",up:"↑",down:"↓",left:"←",right:"→",plus:"+"};function zB(e,t){return e==="mod"?t?"⌘":"Ctrl":TB[e]??e.toUpperCase()}const NB={ctrl:"Control",alt:"Alt",shift:"Shift",enter:"Enter",backspace:"Backspace",escape:"Escape",tab:"Tab",up:"Up arrow",down:"Down arrow",left:"Left arrow",right:"Right arrow",plus:"Plus"};function _B(e,t){return e==="mod"?t?"Command":"Control":NB[e]??e.toUpperCase()}function RB(){return()=>{}}function IB(){return!1}function LB(){if(typeof navigator>"u")return!1;const e="userAgentData"in navigator?navigator.userAgentData:null;return e&&typeof e=="object"&&"platform"in e?/mac/i.test(e.platform??""):/Mac|iPhone|iPad|iPod/.test(navigator.platform??"")}function BS({keys:e,ref:t,xstyle:n,className:s,style:r,...i}){const a=h.useSyncExternalStore(RB,LB,IB),l=e.split("+").map(u=>u.trim().toLowerCase()),c=l.map(u=>_B(u,a)).join(" + ");return o.jsx("span",{...i,ref:t,role:"img","aria-label":c,...ne(J("kbd"),G(MB.wrapper,n),s,r),children:l.map(u=>o.jsx("kbd",{"aria-hidden":"true",className:"x3nfvp2 x6s0dn4 xl56j7k x16asifk x1grt7ep x7a5moj xx3sua9 x17x4s8c xlxy82 x1q0q8m5 xib2hle xv1l7n4 x9ynric x141an7d x1e4wzip x1ltkj2j x87ps6o",children:zB(u,a)},u))})}BS.displayName="Kbd";const OB=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),DB={horizontal:["left","right"],vertical:["up","down"],both:["left","right","up","down"]},BB={hint:{kVAEAm:"xixxii4",kpwlN0:"x1anvkwx",kogj98:"x1ghz6dp",kWkggS:"x1prclbq",kaIpWk:"xh6dtrn",kGVxlE:"x1i5ehqx",kLKAdn:"xfsso4q",kGO01o:"xy143xn",kZCmMZ:"x12gdq22",kwRFfy:"x1djylfy",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",kMwMTN:"xv1l7n4",khDVqt:"xuxw1ft",kSiTet:"xg01cxk xofkqq2",k1ekBW:"xsm4mo9",kIyJzY:"xx6bhzk",kzIqYQ:"xd00j3c",kfzvcC:"x47corl",$$css:!0}};function HS(e={}){const{orientation:t="horizontal",dismissAfterMs:n=3e3,isEnabled:s=!0}=e,r=ze(),i=h.useRef(null),a=h.useRef(!1),l=h.useRef(!1),c=h.useRef(()=>{}),u=h.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]),d=h.useCallback(()=>{l.current=!0},[]),f=h.useCallback(()=>{l.current=!1,u(),c.current(null)},[u]),p=Dd({mode:"context",onShow:d,onHide:f});c.current=p.ref;const x=h.useCallback(()=>{a.current=!0,u(),p.hide(),l.current=!1,c.current(null)},[u,p]),g=h.useCallback(j=>{a.current||!s||(c.current(j),p.show(),u(),i.current=setTimeout(()=>{x()},n))},[u,x,n,s,p]);h.useEffect(()=>()=>{u(),c.current(null)},[u]);const v=h.useCallback(j=>{if(a.current||!s)return;const A=j.target;if(!A.matches(":focus-visible"))return;const M=j.currentTarget;j.relatedTarget instanceof Node&&M.contains(j.relatedTarget)||g(A)},[g,s]),y=h.useCallback(j=>{if(!l.current)return;const A=j.currentTarget;if(j.relatedTarget instanceof Node&&A.contains(j.relatedTarget)){!a.current&&j.relatedTarget instanceof HTMLElement&&c.current(j.relatedTarget);return}x()},[x]),m=h.useCallback(j=>{l.current&&OB.has(j.key)&&x()},[x]),k=o.jsx("span",{className:"x3nfvp2 x6s0dn4 xzye2dw",children:DB[t].map(j=>o.jsx(BS,{keys:j},j))});return{hintElement:p.render(o.jsxs("span",{"aria-hidden":"true",children:[k,o.jsx("span",{className:"x11g1kdw",children:r("@astryx.keyboardHint.toNavigate")})]}),{placement:"below",alignment:"start",xstyle:BB.hint,style:{marginBlockStart:wr["--spacing-2"]}}),onFocus:v,onBlur:y,onKeyDown:m}}function qS(e){h.useEffect(()=>{if(!e)return;const t=window.scrollX,n=window.scrollY,{body:s}=document,r=s.style.overflow,i=s.style.position,a=s.style.top,l=s.style.left,c=s.style.right;return s.style.overflow="hidden",s.style.position="fixed",s.style.top=`-${n}px`,s.style.left="0",s.style.right="0",()=>{s.style.overflow=r,s.style.position=i,s.style.top=a,s.style.left=l,s.style.right=c,window.scrollTo(t,n)}},[e])}let PS=!1;typeof window<"u"&&requestAnimationFrame(()=>{PS=!0});const HB={slideDown:{kKVMdj:"x1srr2gu x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},slideUp:{kKVMdj:"x1dvww92 x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},fadeIn:{kKVMdj:"xqcmdr3 x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0},scaleIn:{kKVMdj:"x97zbip x1aquc0h",k44tkh:"x9uej1z",kyAemX:"x128ha8g",kWV6AL:"xskzprw",$$css:!0}};function qB(e="slideDown"){const[t]=h.useState(()=>PS);return t?HB[e]:null}const PB=50;function UB(e){const t=e.match(/^([\d.]+)ms$/);if(t)return parseFloat(t[1]);const n=e.match(/^([\d.]+)s$/);return n?parseFloat(n[1])*1e3:null}const FB={natural:10,fast:4,instant:1/0};function VB(e,t,n){const s="natural",r=FB[s],{token:i}=wg(),a=h.useMemo(()=>{const y=UB(i("--duration-fast-min"));if(y==null)return PB;const m=y/10;return Math.max(4,Math.round(m))},[i,s]),[l,c]=h.useState(0),u=h.useRef(e),d=h.useRef(0),f=h.useRef(0),p=h.useRef(null);u.current=e;const x=h.useRef(e.length);e.length!==x.current&&(x.current=e.length,e.length===0&&l!==0&&(d.current=0,c(0)));const g=h.useRef(t);t!==g.current&&(g.current=t,!t&&e.length>0&&(d.current=e.length,c(e.length)));const v=Ya("(prefers-reduced-motion: reduce)");return h.useEffect(()=>{if(!t||s==="instant"||v)return;function y(m){if(m-f.current>=a){f.current=m;const b=u.current,j=d.current;if(j<b.length){const A=Math.min(j+r,b.length);d.current=A,c(A)}}p.current=requestAnimationFrame(y)}return p.current=requestAnimationFrame(y),()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null)}},[t,r,a,s,v]),!t||s==="instant"||v?e:e.slice(0,l)}const GB=new Set(["text","password","email","number","search","tel","url","date","datetime-local","month","time","week"]),WB=new Set(["true","menu","listbox","tree","grid","dialog"]);function KB(e){if(e.getAttribute("role")==="combobox")return!0;const t=e.getAttribute("aria-haspopup");return t!=null&&WB.has(t)}function Y4({containerRef:e,inputRef:t,disabled:n=!1}){const s=h.useCallback(()=>{const r=t.current;r!=null&&(r instanceof HTMLElement&&KB(r)?r.click():r instanceof HTMLInputElement&&GB.has(r.type)||r instanceof HTMLTextAreaElement?r.focus():r instanceof HTMLElement?r.click():"focus"in r&&r.focus())},[t]);return K4({containerRef:e,interactiveRef:t,onClick:s,disabled:n})}const XB={warning:"warning",error:"error",success:"success"},ZB={warning:"@astryx.input.statusButton.warning",error:"@astryx.input.statusButton.error",success:"@astryx.input.statusButton.success"};function US({status:e,statusVariant:t="attached",isInGroup:n=!1,size:s="md"}){const r=ze(),a=t==="tooltip"&&!!(e!=null&&e.message),[l,c]=h.useState(void 0),u=Ss({placement:"above",isEnabled:a,isOpen:l}),d=h.useCallback(()=>{c(void 0)},[]),f=h.useCallback(()=>{typeof window>"u"||typeof window.matchMedia!="function"||!window.matchMedia("(hover: none)").matches||c(g=>g!==!0)},[]);if(h.useEffect(()=>{if(l!==!0)return;const g=v=>{v.key==="Escape"&&c(void 0)};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[l]),!(!!e&&!n&&t!=="detached"))return{statusIcon:null,describedBy:void 0};const x=o.jsx(Te,{icon:XB[e.type],size:s,color:e.type,...J("input-status-icon",{size:s,status:e.type})});return a?{statusIcon:o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",ref:u.ref,"aria-label":r(ZB[e.type]),"aria-describedby":u.describedBy,onClick:f,onBlur:d,className:"x3nfvp2 x6s0dn4 xl56j7k x1717udv x1ghz6dp x1heor9g x1ypdohk xjspbzw x784prv x9v5kkp xzunyri x7s97pk",children:x}),u.renderTooltip(e.message)]}),describedBy:u.describedBy}:{statusIcon:x,describedBy:void 0}}const Q4=h.createContext(null);Q4.displayName="InteractiveRoleContext";function YB(){return h.use(Q4)}function FS({href:e,onClick:t,isDisabled:n=!1}){const s=YB();return e!=null&&!n?"link":t!=null?"button":s??"inert"}const QB=500,JB=10;function eH(e){const{onLongPress:t,disabled:n=!1,delayMs:s=QB,moveCancelPx:r=JB}=e,i=h.useRef(null),a=h.useRef(null),l=h.useRef(t);l.current=t;const c=h.useCallback(()=>{i.current!=null&&(clearTimeout(i.current),i.current=null),a.current=null},[]),u=h.useCallback(f=>{if(n||f.touches.length!==1)return;const p=f.touches[0];c(),a.current={x:p.clientX,y:p.clientY},i.current=setTimeout(()=>{const x=a.current;x!=null&&l.current({x:x.x,y:x.y})},s)},[n,s,c]),d=h.useCallback(f=>{const p=a.current;if(p==null||f.touches.length!==1)return;const x=f.touches[0];(Math.abs(x.clientX-p.x)>r||Math.abs(x.clientY-p.y)>r)&&c()},[r,c]);return h.useEffect(()=>c,[c]),{onTouchStart:u,onTouchMove:d,onTouchEnd:c,onTouchCancel:c}}const J4=6,tH={x177fznd:"x177fznd",$$css:!0},Xh={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu x1ue31p x134zogi x7so5qh x1eb35i0",kSiTet:"xg01cxk xz63v9m x1ceiq2s xhva3ql",kVAEAm:"x10l6tqk xd2i8i8 xw895rg x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk xz63v9m x1ceiq2s xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x1d23w33",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x1d23w33",$$css:!0}},nH={x1e36hu2:"x1e36hu2",$$css:!0},Zh={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu xqw8whb x1xhgmdq x7so5qh x1eb35i0",kSiTet:"xg01cxk x7g73g2 x8e9lel xhva3ql",kVAEAm:"x10l6tqk x13sqjsa xxj8d0r x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk x7g73g2 x8e9lel xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x19f70rm",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x19f70rm",$$css:!0}},sH={x10zkftw:"x10zkftw",$$css:!0},Yh={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu xrhii57 xeozflw x7so5qh x1eb35i0",kSiTet:"xg01cxk xe0m1oz xtpmopf xhva3ql",kVAEAm:"x10l6tqk x1k2a1sm xs5no71 x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk xe0m1oz xtpmopf xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr xramsae",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr xramsae",$$css:!0}},rH={xbjq1vy:"xbjq1vy",$$css:!0},Qh={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu xtj9ir3 x1okg2q x7so5qh x1eb35i0",kSiTet:"xg01cxk xnsjgr4 x1y0vk26 xhva3ql",kVAEAm:"x10l6tqk x1cuf62g x1qy2sty x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk xnsjgr4 x1y0vk26 xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x177ftvf",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x177ftvf",$$css:!0}},iH={x3z7t8n:"x3z7t8n",$$css:!0},Jh={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu x1ybz0u4 x1fpm3bq x7so5qh x1eb35i0",kSiTet:"xg01cxk x1qps2i7 x1a7n03g xhva3ql",kVAEAm:"x10l6tqk xeilikp x1xz04m3 x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk x1qps2i7 x1a7n03g xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x1k1siky",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr x1k1siky",$$css:!0}},oH={x6dglqq:"x6dglqq",$$css:!0},e0={reveal:{k1ekBW:"x1n1p2mu",kIyJzY:"x1tw3moq xsr0bmt",kAMwcw:"xlr8y92",kzIqYQ:"xd00j3c",kIr0Dl:"x11ixquu x17lvmk x192eg1j x7so5qh x1eb35i0",kSiTet:"xg01cxk x52nu6g xt179ik xhva3ql",kVAEAm:"x10l6tqk x8j1s1q x8gw32m x4k19zs",$$css:!0},revealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"xg01cxk x52nu6g xt179ik xhva3ql",$$css:!0},conceal:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr xenj0cg",$$css:!0},concealLayoutPreserved:{k1ekBW:"x19991ni",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kSiTet:"x1hc1fzr xenj0cg",$$css:!0}},aH=[{marker:tH,reveal:Xh.reveal,revealLayoutPreserved:Xh.revealLayoutPreserved,conceal:Xh.conceal,concealLayoutPreserved:Xh.concealLayoutPreserved},{marker:nH,reveal:Zh.reveal,revealLayoutPreserved:Zh.revealLayoutPreserved,conceal:Zh.conceal,concealLayoutPreserved:Zh.concealLayoutPreserved},{marker:sH,reveal:Yh.reveal,revealLayoutPreserved:Yh.revealLayoutPreserved,conceal:Yh.conceal,concealLayoutPreserved:Yh.concealLayoutPreserved},{marker:rH,reveal:Qh.reveal,revealLayoutPreserved:Qh.revealLayoutPreserved,conceal:Qh.conceal,concealLayoutPreserved:Qh.concealLayoutPreserved},{marker:iH,reveal:Jh.reveal,revealLayoutPreserved:Jh.revealLayoutPreserved,conceal:Jh.conceal,concealLayoutPreserved:Jh.concealLayoutPreserved},{marker:oH,reveal:e0.reveal,revealLayoutPreserved:e0.revealLayoutPreserved,conceal:e0.conceal,concealLayoutPreserved:e0.concealLayoutPreserved}],Oy=new Array(J4).fill(!1);function lH(){for(let e=0;e<J4;e++)if(!Oy[e])return Oy[e]=!0,{index:e,isExhausted:!1};return{index:0,isExhausted:!0}}function cH(e,t){t||(Oy[e]=!1)}const g6=Object.freeze({});function uH(e={}){const{isEnabled:t=!0}=e,[n]=h.useState(()=>t?lH():null);if(h.useEffect(()=>{if(n!=null)return()=>cH(n.index,n.isExhausted)},[n]),Hd("useContainerReveal",`More than ${J4} reveal containers are mounted at once; nested containers beyond the pool may share a marker. Add markers to containerReveal.pool.stylex.ts and raise POOL_SIZE.`,(n==null?void 0:n.isExhausted)??!1),n==null)return{getContainerProps:()=>g6,getContentRevealProps:()=>g6};const s=aH[n.index];return{getContainerProps:()=>G(s.marker),getContentRevealProps:(r={})=>{const{isRevealInverted:i=!1,isLayoutPreserved:a=!1}=r,l=i?a?s.concealLayoutPreserved:s.conceal:a?s.revealLayoutPreserved:s.reveal;return G(l)}}}const Gm={label:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",k63SB2:"x1e4wzip",kMwMTN:"xv1l7n4",kkrTdU:"x1ypdohk",$$css:!0},labelDisabled:{kMwMTN:"xnbbluu",kkrTdU:"x1h6gzvc",$$css:!0},srOnly:{ksu8eU:"xng3xce",kMcinP:"xzpqnlu",kZKoxP:"xjm9jq1",kLqNvP:"x1o0tod",kogj98:"xkdpibf",kVQacm:"xb3r6kr",kmVPX3:"x1717udv",kfzvcC:"x47corl",kVAEAm:"x10l6tqk",k87sOh:"x13vifvy",kfSwDN:"x87ps6o",khDVqt:"xuxw1ft",kzqmXN:"x1i1rx1s",$$css:!0}};function Ag({label:e,inputID:t,labelID:n,isGroupLabel:s=!1,isLabelHidden:r=!1,isDisabled:i=!1,isOptional:a=!1,isRequired:l=!1,labelIcon:c,labelTooltip:u,description:d,descriptionID:f,className:p,style:x,xstyle:g,ref:v,...y}){const m=ze(),k=a?m("@astryx.field.optional"):l?m("@astryx.field.required"):null,b=s?"span":"label",j=!s&&t!=null,A=h.useRef(null),M=h.useMemo(()=>({get current(){var $;return t==null?null:(($=A.current)==null?void 0:$.ownerDocument.getElementById(t))??null},set current($){}}),[t]),T=Y4({containerRef:A,inputRef:M,disabled:!j}),z=o.jsxs(o.Fragment,{children:[c&&Lr(c,{size:"sm",color:"inherit"}),e,k&&o.jsxs("span",{className:"x1sodnla x141an7d x1ltkj2j xv1l7n4",children:[o.jsx("span",{"aria-hidden":"true",children:" ∙ "}),k]}),u&&o.jsx(Wi,{content:u,placement:"above",children:o.jsx(Te,{icon:"info",size:"sm",color:"inherit"})})]});return o.jsxs(o.Fragment,{children:[o.jsx(b,{ref:v,id:n,htmlFor:s?void 0:t,...y,...ne(J("field-label"),G(Gm.label,i&&Gm.labelDisabled,r&&Gm.srOnly,g),p,x),children:z}),d&&o.jsx("span",{ref:j?A:void 0,id:f,...j?T:void 0,...{0:{className:"x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4"},2:{className:"x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4 x1ypdohk"},1:{className:"x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4 xng3xce xzpqnlu xjm9jq1 x1o0tod xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"},3:{className:"x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4 x1ypdohk xng3xce xzpqnlu xjm9jq1 x1o0tod xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"}}[!!j<<1|!!r<<0],children:d})]})}Ag.displayName="FieldLabel";const dH={warning:"warning",error:"error",success:"success"},Wm={base:{kMv6JI:"x9ynric",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",$$css:!0},attached:{keoZOQ:"x1c40v9y",kLKAdn:"x1ak3mig",kGO01o:"x1wesfrj",kg3NbH:"xf314gf",kVL7Gh:"xquck67",kT0f0o:"x14i3lts",$$css:!0},detached:{keoZOQ:"xcsaf9d",k8WAf4:"xce4md1",kg3NbH:"xf314gf",kaIpWk:"xh6dtrn",$$css:!0}},fH={warning:{kWkggS:"x24i8r5",kMwMTN:"xdhq94a",$$css:!0},error:{kWkggS:"x1pritpl",kMwMTN:"x1joocv1",$$css:!0},success:{kWkggS:"xu13z74",kMwMTN:"xltfdvo",$$css:!0}};function jh({ref:e,type:t,message:n,id:s,variant:r="attached",xstyle:i,className:a,style:l,...c}){const u=qB("slideDown"),d=Nc();return h.useEffect(()=>{n&&d(n,t==="error"?"assertive":"polite")},[d,n,t]),o.jsx("div",{ref:e,id:s,...c,...ne(J("field-status",{type:t,variant:r}),G(Wm.base,u,r==="attached"?Wm.attached:Wm.detached,fH[t],i),a,l),children:r==="detached"?o.jsxs("span",{className:"x78zum5 x1cy8zhl xzye2dw",children:[o.jsx("span",{className:"x3nfvp2 x6s0dn4 x14o5nre x2lah0s",children:o.jsx(Te,{icon:dH[t],size:"sm",color:"inherit",...J("field-status-icon",{type:t})})}),o.jsx("span",{children:n})]}):n})}jh.displayName="FieldStatus";const hH={x1tspnpo:"x1tspnpo",$$css:!0},Mg=h.createContext(null);Mg.displayName="CheckboxListContext";const gs={container:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},containerLabelHidden:{kOIVth:"xxhr3t",$$css:!0},checkboxWrapper:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",kHBbk8:"xc8icb0",$$css:!0},input:{kVAEAm:"x10l6tqk",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kSiTet:"xg01cxk",kkrTdU:"x1ypdohk",kY2c9j:"x1vjfegm",$$css:!0},inputDisabled:{kkrTdU:"x1h6gzvc",$$css:!0},checkbox:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kaIpWk:"xx3sua9",k1ekBW:"xts7igz",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",$$css:!0},checkboxFocus:{kI3sdo:"x1a2a7pz xkri23q",kInvED:"x81n7kt",$$css:!0},checkboxUnchecked:{kMwMTN:"xqwr325",kVAM5u:"xvy26l8 x1jtjlen",kWkggS:"x10xzikg xrsv7h",$$css:!0},checkboxChecked:{kMwMTN:"x17wrial",kVAM5u:"xad5do x1od6ugu",kWkggS:"x1ewilqj x6aeo4j",$$css:!0},checkboxDisabled:{kSiTet:"xbyyjgo",kVAM5u:"x14i3s5s xmt8yqp",$$css:!0},checkboxDisabledUnchecked:{kWkggS:"xwmxj5m x1cjfj8k",$$css:!0},checkmark:{k1xSpc:"x1s85apg",kMwMTN:"x17wrial xs5hli",$$css:!0},checkmarkVisible:{k1xSpc:"x1lliihq",$$css:!0},indeterminateMark:{k1xSpc:"x1s85apg",kWkggS:"x1azo05 xwvh9j7",kaIpWk:"xjspbzw",$$css:!0},indeterminateMarkVisible:{k1xSpc:"x1lliihq",$$css:!0}},m6={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},pH={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},xH={sm:{kzqmXN:"xsmyaan",kZKoxP:"x1kpxq89",$$css:!0},md:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",$$css:!0}},gH={sm:{kzqmXN:"x1fsd2vl",kZKoxP:"x36qwtl",$$css:!0},md:{kzqmXN:"xsmyaan",kZKoxP:"x36qwtl",$$css:!0}},mH={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function Sh({label:e,isLabelHidden:t=!1,description:n,onChange:s,changeAction:r,isLoading:i=!1,value:a,isDisabled:l=!1,htmlName:c,disabledMessage:u,isReadOnly:d=!1,isOptional:f=!1,isRequired:p=!1,size:x="md",onFocus:g,onBlur:v,labelIcon:y,status:m,width:k,xstyle:b,className:j,style:A,ref:M,...T}){const z=h.useId(),$=h.useId(),E=h.useId(),[,N]=h.useTransition(),[_,R]=h.useOptimistic(a),B=i||_!==a,D=l&&!!u,I=h.use(Mg),O=l&&(D||((I==null?void 0:I.hasDisabledMessage)??!1)),L=Ss({placement:"above",focusTrigger:"always",isEnabled:D}),H=_==="indeterminate",q=_===!0,U=q||H,X=h.useCallback(ae=>{ae&&(ae.indeterminate=H)},[H]),Z=[];n&&Z.push($),m!=null&&m.message&&Z.push(E),D&&Z.push(L.describedBy);const ie=Z.length>0?Z.join(" "):void 0;return o.jsxs("div",{...ne(J("checkbox-input",{size:x}),G(k!=null&&mH.width(k),b),j,A),children:[o.jsxs("div",{ref:ae=>{L.interactionRef(ae)},...G(gs.container,t&&gs.containerLabelHidden,!l&&hH),children:[o.jsxs("div",{...G(gs.checkboxWrapper,m6[x]),children:[o.jsx("input",{...T,ref:Ft(M,X,L.positionRef),id:z,type:"checkbox",name:l?void 0:c,checked:q,disabled:l&&!O,"aria-disabled":O?"true":void 0,readOnly:d,required:p,onChange:ae=>{if(l||B||d)return;const xe=ae.target.checked;s==null||s(xe,ae),r&&!ae.defaultPrevented&&N(async()=>{R(xe),await r(xe,ae)})},onFocus:g,onBlur:v,"aria-readonly":d||void 0,"aria-describedby":ie,"aria-invalid":(m==null?void 0:m.type)==="error"?!0:void 0,"aria-busy":B||void 0,...G(gs.input,m6[x],l&&gs.inputDisabled)}),o.jsx("div",{"aria-hidden":"true",...ne(J("checkbox",{size:x,checked:q?"checked":H?"indeterminate":null,disabled:l?"disabled":null}),G(gs.checkbox,pH[x],!l&&gs.checkboxFocus,U?gs.checkboxChecked:gs.checkboxUnchecked,l&&gs.checkboxDisabled,l&&!U&&gs.checkboxDisabledUnchecked)),children:B?o.jsx(Vt,{size:"sm",shade:"inherit"}):o.jsxs(o.Fragment,{children:[o.jsx("svg",{viewBox:"0 0 10 10",...G(gs.checkmark,xH[x],q&&gs.checkmarkVisible),children:o.jsx("path",{d:"M8.5 2.5L4 7.5L1.5 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})}),o.jsx("div",{...G(gs.indeterminateMark,gH[x],H&&gs.indeterminateMarkVisible)})]})})]}),o.jsx("div",{className:"x78zum5 xdt5ytf x1lsbc85",children:o.jsx(Ag,{label:e,inputID:z,isLabelHidden:t,isDisabled:l,isOptional:f,isRequired:p,labelIcon:y,description:n,descriptionID:$})})]}),(m==null?void 0:m.message)&&o.jsx(jh,{type:m.type,message:m.message,id:E,variant:"detached"}),D&&L.renderTooltip(u)]})}Sh.displayName="CheckboxInput";function Bt({icon:e,...t}){return o.jsx(Q,{...t,icon:e,isIconOnly:!0})}Bt.displayName="IconButton";const y6={container:{kB7OPa:"x9f619",kZCmMZ:"x1c35znw",kwRFfy:"x64h4k7",kLKAdn:"x14m0hsi",kGO01o:"xc1wllq",$$css:!0}},yH={containerPaddingInlineStart:{"--container-padding-inline-start":"xjmlhfd",$$css:!0},containerPaddingInlineEnd:{"--container-padding-inline-end":"x1ihxwbr",$$css:!0},containerPaddingBlockStart:{"--container-padding-block-start":"x1rqz8me",$$css:!0},containerPaddingBlockEnd:{"--container-padding-block-end":"x1omyuck",$$css:!0},layoutPaddingOuterX:{"--layout-padding-outer-x":"x14rzhog",$$css:!0},layoutPaddingOuterY:{"--layout-padding-outer-y":"xjej9fs",$$css:!0},layoutPaddingInnerX:{"--layout-padding-inner-x":"x4poyjn",$$css:!0},layoutPaddingInnerY:{"--layout-padding-inner-y":"x1u1kw4e",$$css:!0}},vH={containerPaddingInlineStart:{"--container-padding-inline-start":"xrgx2ny",$$css:!0},containerPaddingInlineEnd:{"--container-padding-inline-end":"xyk0j9o",$$css:!0},containerPaddingBlockStart:{"--container-padding-block-start":"x876hks",$$css:!0},containerPaddingBlockEnd:{"--container-padding-block-end":"x1u89lk7",$$css:!0},layoutPaddingOuterX:{"--layout-padding-outer-x":"x12sptzx",$$css:!0},layoutPaddingOuterY:{"--layout-padding-outer-y":"xo78phr",$$css:!0},layoutPaddingInnerX:{"--layout-padding-inner-x":"x1we69p7",$$css:!0},layoutPaddingInnerY:{"--layout-padding-inner-y":"xsdnkbz",$$css:!0}},kH={containerPaddingInlineStart:{"--container-padding-inline-start":"x1tewnwq",$$css:!0},containerPaddingInlineEnd:{"--container-padding-inline-end":"x11h1f2o",$$css:!0},containerPaddingBlockStart:{"--container-padding-block-start":"x1g2kccc",$$css:!0},containerPaddingBlockEnd:{"--container-padding-block-end":"x1gvthzm",$$css:!0},layoutPaddingOuterX:{"--layout-padding-outer-x":"x1hsjncj",$$css:!0},layoutPaddingOuterY:{"--layout-padding-outer-y":"x1pui4bz",$$css:!0},layoutPaddingInnerX:{"--layout-padding-inner-x":"x2so38",$$css:!0},layoutPaddingInnerY:{"--layout-padding-inner-y":"xinu7xd",$$css:!0}},bH={card:yH,section:vH,dialog:kH},wH={spacing0:{"--container-padding-inline-start":"x1gu2k80",$$css:!0},spacing0_5:{"--container-padding-inline-start":"x14ws0sr",$$css:!0},spacing1:{"--container-padding-inline-start":"x1cvlban",$$css:!0},spacing1_5:{"--container-padding-inline-start":"x176g23i",$$css:!0},spacing2:{"--container-padding-inline-start":"x1xlrr2o",$$css:!0},spacing3:{"--container-padding-inline-start":"xfdwxua",$$css:!0},spacing4:{"--container-padding-inline-start":"x1dlhslv",$$css:!0},spacing5:{"--container-padding-inline-start":"x1s81nki",$$css:!0},spacing6:{"--container-padding-inline-start":"x1ep0dkj",$$css:!0},spacing7:{"--container-padding-inline-start":"x157xojc",$$css:!0},spacing8:{"--container-padding-inline-start":"xw1diwv",$$css:!0},spacing9:{"--container-padding-inline-start":"xraca2a",$$css:!0},spacing10:{"--container-padding-inline-start":"xserb3f",$$css:!0},spacing11:{"--container-padding-inline-start":"xziclwo",$$css:!0},spacing12:{"--container-padding-inline-start":"x1iiwihq",$$css:!0}},jH={spacing0:{"--container-padding-inline-end":"x91ghl5",$$css:!0},spacing0_5:{"--container-padding-inline-end":"x1wz3t3y",$$css:!0},spacing1:{"--container-padding-inline-end":"x2oyxnl",$$css:!0},spacing1_5:{"--container-padding-inline-end":"xntetml",$$css:!0},spacing2:{"--container-padding-inline-end":"xcas3b9",$$css:!0},spacing3:{"--container-padding-inline-end":"xu0ipoa",$$css:!0},spacing4:{"--container-padding-inline-end":"xs0pscg",$$css:!0},spacing5:{"--container-padding-inline-end":"xgkj7vj",$$css:!0},spacing6:{"--container-padding-inline-end":"x94cj42",$$css:!0},spacing7:{"--container-padding-inline-end":"x11tj35w",$$css:!0},spacing8:{"--container-padding-inline-end":"x1b9k1pi",$$css:!0},spacing9:{"--container-padding-inline-end":"x19w02kr",$$css:!0},spacing10:{"--container-padding-inline-end":"xx5lg5w",$$css:!0},spacing11:{"--container-padding-inline-end":"x1nmgbqg",$$css:!0},spacing12:{"--container-padding-inline-end":"x1wsfsk2",$$css:!0}},SH={spacing0:{"--container-padding-block-start":"x1i3qcxz",$$css:!0},spacing0_5:{"--container-padding-block-start":"xvdf9ev",$$css:!0},spacing1:{"--container-padding-block-start":"xnsckjb",$$css:!0},spacing1_5:{"--container-padding-block-start":"x1kbx601",$$css:!0},spacing2:{"--container-padding-block-start":"xa8b4fq",$$css:!0},spacing3:{"--container-padding-block-start":"x11k4f5r",$$css:!0},spacing4:{"--container-padding-block-start":"xm01sq8",$$css:!0},spacing5:{"--container-padding-block-start":"xp8wdkl",$$css:!0},spacing6:{"--container-padding-block-start":"x1hmud4d",$$css:!0},spacing7:{"--container-padding-block-start":"x1c00sag",$$css:!0},spacing8:{"--container-padding-block-start":"xfv60at",$$css:!0},spacing9:{"--container-padding-block-start":"x14fzdu7",$$css:!0},spacing10:{"--container-padding-block-start":"x17h9kl7",$$css:!0},spacing11:{"--container-padding-block-start":"x1rdjxae",$$css:!0},spacing12:{"--container-padding-block-start":"xecwdl6",$$css:!0}},CH={spacing0:{"--container-padding-block-end":"xkunwnr",$$css:!0},spacing0_5:{"--container-padding-block-end":"x1cao3zv",$$css:!0},spacing1:{"--container-padding-block-end":"x57a7ii",$$css:!0},spacing1_5:{"--container-padding-block-end":"xv53x8y",$$css:!0},spacing2:{"--container-padding-block-end":"x1lsgcmx",$$css:!0},spacing3:{"--container-padding-block-end":"x1q3ppug",$$css:!0},spacing4:{"--container-padding-block-end":"x4hfsld",$$css:!0},spacing5:{"--container-padding-block-end":"xbib2ws",$$css:!0},spacing6:{"--container-padding-block-end":"x1q8d17g",$$css:!0},spacing7:{"--container-padding-block-end":"x1yqogew",$$css:!0},spacing8:{"--container-padding-block-end":"x8lgq76",$$css:!0},spacing9:{"--container-padding-block-end":"x1f7f9rt",$$css:!0},spacing10:{"--container-padding-block-end":"x15vxphk",$$css:!0},spacing11:{"--container-padding-block-end":"x4bg2x9",$$css:!0},spacing12:{"--container-padding-block-end":"x186mjxr",$$css:!0}},EH={spacing0:{"--layout-padding-outer-x":"xswhm3q",$$css:!0},spacing0_5:{"--layout-padding-outer-x":"xihiwg7",$$css:!0},spacing1:{"--layout-padding-outer-x":"xc96xmq",$$css:!0},spacing1_5:{"--layout-padding-outer-x":"x1u93lgd",$$css:!0},spacing2:{"--layout-padding-outer-x":"x15dxnc0",$$css:!0},spacing3:{"--layout-padding-outer-x":"xadgj3j",$$css:!0},spacing4:{"--layout-padding-outer-x":"x1v56qcf",$$css:!0},spacing5:{"--layout-padding-outer-x":"x1nzs0gl",$$css:!0},spacing6:{"--layout-padding-outer-x":"x1c3n52a",$$css:!0},spacing7:{"--layout-padding-outer-x":"x1gfiokx",$$css:!0},spacing8:{"--layout-padding-outer-x":"x1t3kfz",$$css:!0},spacing9:{"--layout-padding-outer-x":"xzr4qsh",$$css:!0},spacing10:{"--layout-padding-outer-x":"x1jdf5a4",$$css:!0},spacing11:{"--layout-padding-outer-x":"x1hct0t0",$$css:!0},spacing12:{"--layout-padding-outer-x":"x11cyqoe",$$css:!0}},$H={spacing0:{"--layout-padding-outer-y":"x1mzf5mb",$$css:!0},spacing0_5:{"--layout-padding-outer-y":"x1vj96e0",$$css:!0},spacing1:{"--layout-padding-outer-y":"x1gpfxoh",$$css:!0},spacing1_5:{"--layout-padding-outer-y":"xd3dqby",$$css:!0},spacing2:{"--layout-padding-outer-y":"x10pz7y9",$$css:!0},spacing3:{"--layout-padding-outer-y":"x1p6yq3h",$$css:!0},spacing4:{"--layout-padding-outer-y":"xx738ci",$$css:!0},spacing5:{"--layout-padding-outer-y":"x6yxws5",$$css:!0},spacing6:{"--layout-padding-outer-y":"x180vrwl",$$css:!0},spacing7:{"--layout-padding-outer-y":"x1q6rme1",$$css:!0},spacing8:{"--layout-padding-outer-y":"xid7e43",$$css:!0},spacing9:{"--layout-padding-outer-y":"x1t5kicu",$$css:!0},spacing10:{"--layout-padding-outer-y":"x26l4wa",$$css:!0},spacing11:{"--layout-padding-outer-y":"x10zktp0",$$css:!0},spacing12:{"--layout-padding-outer-y":"x1yz3n6a",$$css:!0}},AH={spacing0:{"--layout-padding-inner-x":"xj1bl4l",$$css:!0},spacing0_5:{"--layout-padding-inner-x":"xlriy2h",$$css:!0},spacing1:{"--layout-padding-inner-x":"x6uuyak",$$css:!0},spacing1_5:{"--layout-padding-inner-x":"xd38f90",$$css:!0},spacing2:{"--layout-padding-inner-x":"xxqksqd",$$css:!0},spacing3:{"--layout-padding-inner-x":"x1fyui2f",$$css:!0},spacing4:{"--layout-padding-inner-x":"x1i2ajwi",$$css:!0},spacing5:{"--layout-padding-inner-x":"x1tac27u",$$css:!0},spacing6:{"--layout-padding-inner-x":"x1ntgf3t",$$css:!0},spacing7:{"--layout-padding-inner-x":"xhjd9tl",$$css:!0},spacing8:{"--layout-padding-inner-x":"xn7c84u",$$css:!0},spacing9:{"--layout-padding-inner-x":"xeqkbsz",$$css:!0},spacing10:{"--layout-padding-inner-x":"x1vf4qco",$$css:!0},spacing11:{"--layout-padding-inner-x":"xsmamsf",$$css:!0},spacing12:{"--layout-padding-inner-x":"x2xk2xj",$$css:!0}},MH={spacing0:{"--layout-padding-inner-y":"xwuefyo",$$css:!0},spacing0_5:{"--layout-padding-inner-y":"x180h0y5",$$css:!0},spacing1:{"--layout-padding-inner-y":"xmpug6m",$$css:!0},spacing1_5:{"--layout-padding-inner-y":"x1g8jpzm",$$css:!0},spacing2:{"--layout-padding-inner-y":"x1lksgje",$$css:!0},spacing3:{"--layout-padding-inner-y":"x4j7gld",$$css:!0},spacing4:{"--layout-padding-inner-y":"x1s3ehtl",$$css:!0},spacing5:{"--layout-padding-inner-y":"x1rj5eim",$$css:!0},spacing6:{"--layout-padding-inner-y":"x1ftgg6u",$$css:!0},spacing7:{"--layout-padding-inner-y":"x1ho74vh",$$css:!0},spacing8:{"--layout-padding-inner-y":"xm2cs6f",$$css:!0},spacing9:{"--layout-padding-inner-y":"x1vsq92b",$$css:!0},spacing10:{"--layout-padding-inner-y":"x18gbwmk",$$css:!0},spacing11:{"--layout-padding-inner-y":"x14zymzj",$$css:!0},spacing12:{"--layout-padding-inner-y":"xzfpkx9",$$css:!0}},TH={containerMaxHeight:e=>[{"--container-max-height":e!=null?"x18nyedi":e,$$css:!0},{"--x---container-max-height":e??void 0}]};function VS({padding:e="spacing4",paddingOuterX:t,paddingOuterY:n,paddingInnerX:s,paddingInnerY:r,useThemeDefault:i,maxHeight:a}){const l=t??e,c=n??e,u=s??e,d=r??e,f=a?TH.containerMaxHeight(a):null;if(i){const p=bH[i];return[y6.container,p.containerPaddingInlineStart,p.containerPaddingInlineEnd,p.containerPaddingBlockStart,p.containerPaddingBlockEnd,p.layoutPaddingOuterX,p.layoutPaddingOuterY,p.layoutPaddingInnerX,p.layoutPaddingInnerY,f]}return[y6.container,wH[l],jH[l],SH[c],CH[c],EH[l],$H[c],AH[u],MH[d],f]}const Km={card:{"--_card-radius":"x2kkz0m",kaIpWk:"x153u1i6",kVQacm:"x7giv3",kGVxlE:"x1p8z4y0",$$css:!0},withBorder:{kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kVAM5u:"x14i3s5s",kZCmMZ:"xs19ii7",kwRFfy:"x12frdag",kLKAdn:"x1nex4ik",kGO01o:"xbv1mwh",$$css:!0},scrollable:{kVQacm:"xysyzu8",$$css:!0}},zH={default:{kWkggS:"x1de1mus",$$css:!0},transparent:{kWkggS:"xjbqb8w",$$css:!0},muted:{kWkggS:"xwmxj5m",$$css:!0},blue:{kWkggS:"x1o0wnni",$$css:!0},cyan:{kWkggS:"x1rgj867",$$css:!0},gray:{kWkggS:"xspzpui",$$css:!0},green:{kWkggS:"x1sqjeoo",$$css:!0},orange:{kWkggS:"x1e9xt6e",$$css:!0},pink:{kWkggS:"xnpoty2",$$css:!0},purple:{kWkggS:"x16i6n6f",$$css:!0},red:{kWkggS:"x1cibrc5",$$css:!0},teal:{kWkggS:"x1jtji5o",$$css:!0},yellow:{kWkggS:"x1bo7t0x",$$css:!0}},NH={none:{"--_card-elevation":"xw28qpl",$$css:!0},low:{"--_card-elevation":"x1nn8khe",$$css:!0},med:{"--_card-elevation":"x1ovzxg0",$$css:!0},high:{"--_card-elevation":"xnpe7fx",$$css:!0}},_H={sizing:(e,t,n,s)=>[{kzqmXN:e!=null?"x5lhr3w":e,kZKoxP:t!=null?"x16ye13r":t,ks0D6T:n!=null?"xf68679":n,kAzted:s!=null?"x82snj4":s,$$css:!0},{"--x-width":(r=>typeof r=="number"?r+"px":r??void 0)(e),"--x-height":(r=>typeof r=="number"?r+"px":r??void 0)(t),"--x-maxWidth":(r=>typeof r=="number"?r+"px":r??void 0)(n),"--x-minHeight":(r=>typeof r=="number"?r+"px":r??void 0)(s)}]};function Tg({width:e,height:t,maxWidth:n,minHeight:s,children:r,padding:i,variant:a="default",elevation:l="none",xstyle:c,className:u,style:d,ref:f,...p}){const x=t!=null&&t!=="auto",g=i==null,v=i??4,y=Rj[v];return o.jsx("div",{ref:f,...ne(J("card",{variant:a}),G(Km.card,zH[a],NH[l],x&&Km.scrollable,_H.sizing(e??null,t??null,n??null,s??null),...VS(g?{useThemeDefault:"card"}:{paddingInnerX:y,paddingInnerY:y,paddingOuterX:y,paddingOuterY:y}),!g&&v!==4&&Rd[v],!g&&v!==4&&Id[v],!g&&v!==4&&Ld[v],!g&&v!==4&&Od[v],a==="default"&&Km.withBorder,c),u,d),...p,children:r})}Tg.displayName="Card";const t0={base:{k1xSpc:"xjp7ctv",kMwMTN:"x1tgivj0",kMv6JI:"x9ynric",$$css:!0},light:{kQNsl9:"x19aimcq",$$css:!0},dark:{kQNsl9:"xntwwlm",$$css:!0},system:{kQNsl9:"x108lcm5",$$css:!0}},Dy=gg.createContext(!1);Dy.displayName="ThemeNestingContext";const Xm=new Set;function RH(e){const t=h.useId();h.useInsertionEffect(()=>{if(e.__built)return;const n=`astryx-theme-${e.name}`;if(Xm.has(n))return;L4(`theme-injection:${e.name}`,"Theme",`"${e.name}" is using runtime style injection. For better performance, use the pre-built theme:
|
|
78
|
-
|
|
79
|
-
import {${e.name}Theme} from '@astryxdesign/theme-${e.name}/built';
|
|
80
|
-
import '@astryxdesign/theme-${e.name}/theme.css';
|
|
81
|
-
|
|
82
|
-
For custom themes, run \`npx @astryxdesign/cli theme build <file>\` to generate the built artifacts.`);const{prose:s,component:r}=WL(e);if(!(!s&&!r)){if(s){const i=document.createElement("style");i.setAttribute(Ls("theme-prose"),e.name),i.setAttribute(Ls("id"),t),i.textContent=`@layer reset {
|
|
83
|
-
${s}
|
|
84
|
-
}`,document.head.appendChild(i)}if(r){const i=document.createElement("style");i.setAttribute(Ls("theme"),e.name),i.setAttribute(Ls("id"),t),i.textContent=`@layer astryx-theme {
|
|
85
|
-
${r}
|
|
86
|
-
}`,document.head.appendChild(i)}return Xm.add(n),()=>{const i=document.querySelector(`style[${Ls("theme-prose")}="${e.name}"][${Ls("id")}="${t}"]`),a=document.querySelector(`style[${Ls("theme")}="${e.name}"][${Ls("id")}="${t}"]`);i==null||i.remove(),a==null||a.remove(),Xm.delete(n)}}},[e,t])}function IH(e,t,n){Bi(()=>{if(!e&&!(typeof document>"u"))return t==="light"||t==="dark"?document.documentElement.setAttribute("data-theme",t):document.documentElement.removeAttribute("data-theme"),document.documentElement.setAttribute(Ls("theme"),n),()=>{document.documentElement.removeAttribute("data-theme"),document.documentElement.removeAttribute(Ls("theme"))}},[e,t,n])}function GS({theme:e,mode:t="system",children:n}){const s=h.use(Dy);IL(e),RH(e),IH(s,t,e.name);const r=t==="dark"?t0.dark:t==="light"?t0.light:t0.system,i=h.useMemo(()=>({theme:e,mode:t}),[e,t]);return o.jsx(bg,{value:i,children:o.jsx(Dy,{value:!0,children:o.jsx("div",{...G(t0.base,r),"data-astryx-theme":e.name,"data-theme":t==="system"?void 0:t,children:n})})})}GS.displayName="Theme";function WS({mode:e,children:t}){return o.jsx("div",{[Ls("media")]:e,className:"xjp7ctv x1tgivj0",children:t})}WS.displayName="MediaTheme";const KS="--color-syntax-";function LH(e){return KS+e}const OH=Object.keys(D4).map(e=>e.replace(KS,""));function DH(e){const t={};for(const n of OH)t[LH(n)]=e.tokens[n];return t}const XS=h.createContext(null);XS.displayName="SyntaxThemeContext";function ZS({theme:e,children:t}){const n=h.useMemo(()=>DH(e),[e]),s=h.useMemo(()=>({theme:e}),[e]);return o.jsx(XS,{value:s,children:o.jsx("div",{style:n,"data-astryx-syntax-theme":e.name,children:t})})}ZS.displayName="SyntaxTheme";function YS({type:e,body:t,endContent:n,isAutoHide:s,autoHideDuration:r,isExiting:i=!1,onDismiss:a}){const l=ze(),c=h.useRef(null),u=h.useRef(!1),d=h.useRef(r),f=h.useRef(null),p=h.useRef(a);p.current=a;const x=h.useCallback(()=>{!s||u.current||(c.current&&clearTimeout(c.current),f.current=Date.now(),c.current=setTimeout(()=>{p.current("auto")},d.current))},[s]),g=h.useCallback(()=>{if(!(!s||u.current)&&(u.current=!0,c.current&&(clearTimeout(c.current),c.current=null),f.current!=null)){const j=Date.now()-f.current;d.current=Math.max(d.current-j,1e3)}},[s]),v=h.useCallback(()=>{!s||!u.current||(u.current=!1,x())},[s,x]);h.useEffect(()=>(d.current=r,x(),()=>{c.current&&clearTimeout(c.current)}),[r,x]),h.useEffect(()=>{if(s)return window.addEventListener("blur",g),window.addEventListener("focus",v),()=>{window.removeEventListener("blur",g),window.removeEventListener("focus",v)}},[s,g,v]);const y=h.useCallback(()=>{a("manual")},[a]),m=e==="error",{mode:k}=wg(),b=m||k==="light"?"dark":"light";return o.jsx("div",{role:m?"alert":"status","aria-live":m?"assertive":"polite","aria-atomic":"true",onMouseEnter:g,onMouseLeave:v,onFocusCapture:g,onBlurCapture:v,...ne(J("toast",{type:e}),{0:{className:"x1na6nto x1pzlopt x1hviunn x1l2rt3b xxtfdz8 x14hfi27 x1hc1fzr x9ynric xjm74w1 xw6l6zx xnn1q72 x6o7n8i xuedmi6 xsagj69 xlr8y92 x4itv7f x1tswlu5 xenstv7"},2:{className:"x1na6nto x1pzlopt x1hviunn x1l2rt3b xxtfdz8 x14hfi27 x1hc1fzr x9ynric xjm74w1 xw6l6zx xnn1q72 x6o7n8i xuedmi6 xsagj69 xlr8y92 x4itv7f x1tswlu5 x1l5t2a3"},1:{className:"x1na6nto x1pzlopt x1hviunn x1l2rt3b xxtfdz8 x14hfi27 x9ynric xjm74w1 xw6l6zx x6o7n8i xuedmi6 xsagj69 xlr8y92 x4itv7f x1tswlu5 xenstv7 xg01cxk x1lm5u"},3:{className:"x1na6nto x1pzlopt x1hviunn x1l2rt3b xxtfdz8 x14hfi27 x9ynric xjm74w1 xw6l6zx x6o7n8i xuedmi6 xsagj69 xlr8y92 x4itv7f x1tswlu5 x1l5t2a3 xg01cxk x1lm5u"}}[!!m<<1|!!i<<0]),children:o.jsx(WS,{mode:b,children:o.jsxs("div",{className:"x78zum5 x1cy8zhl xjcht0a xh8yej3",children:[o.jsx("div",{className:"x98rzlu xeuugli",children:t}),o.jsxs("div",{className:"x2lah0s x78zum5 x6s0dn4 x1txdalj xacfrgf xmequkd",children:[n,o.jsx(Q,{variant:"ghost",size:"sm",icon:o.jsx(Te,{icon:"close",size:"sm",color:"inherit"}),label:l("@astryx.toast.dismiss"),onClick:y,isIconOnly:!0})]})]})})})}YS.displayName="Toast";const zg=h.createContext(null);zg.displayName="ToastContext";const ff={viewport:{kVAEAm:"xixxii4",kY2c9j:"x6cuj84",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kmVPX3:"x1shk3sm",kfzvcC:"x47corl",kpwlN0:"xh3736h",kogj98:"x1ghz6dp",kWkggS:"xjbqb8w",kVQacm:"x1rea2x4",$$css:!0},bottomEnd:{krVfgx:"x1ey2m1c",kt4wiu:"xtijo5x",kGNEyG:"xuk3077",$$css:!0},bottomStart:{krVfgx:"x1ey2m1c",kLqNvP:"x1o0tod",kGNEyG:"x1cy8zhl",$$css:!0},topEnd:{k87sOh:"x13vifvy",kt4wiu:"xtijo5x",kGNEyG:"xuk3077",kXwgrk:"x3ieub6",$$css:!0},topStart:{k87sOh:"x13vifvy",kLqNvP:"x1o0tod",kGNEyG:"x1cy8zhl",kXwgrk:"x3ieub6",$$css:!0}};function By(e){if(e==null||typeof e=="boolean")return"";if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(By).filter(Boolean).join(" ");if(h.isValidElement(e)){const{children:t}=e.props;return By(t)}return""}function Ng({position:e="bottomEnd",maxVisible:t=5,inset:n,isTopLayer:s=!0,children:r}){const i=ze(),[a,l]=h.useState([]),[c,u]=h.useState(new Set),d=h.useRef(a);d.current=a;const f=h.useRef(null),p=h.useRef(new Set),x=h.useRef(null),g=h.useRef(null),v=h.useRef(null),y=h.useCallback(N=>{if(!N)return null;const _=N.querySelectorAll(_S);for(const R of _)if(!(R.getAttribute("tabindex")==="-1"||R.hasAttribute("disabled")||R.getAttribute("aria-disabled")==="true"))return R;return null},[]),m=Nc(),k=h.useCallback(N=>{const{uniqueID:_,collisionBehavior:R="overwrite"}=N.options;if(_&&R==="ignore"&&d.current.some(D=>D.options.uniqueID===_))return;const B=By(N.options.body);B&&m(B,N.options.type==="error"?"assertive":"polite"),l(D=>_&&D.find(O=>O.options.uniqueID===_)?D.map(O=>O.options.uniqueID===_?N:O):[...D,N])},[m]),b=h.useCallback((N,_)=>{var O,L;if(p.current.has(N))return;p.current.add(N);const R=d.current.find(H=>H.id===N);R&&((L=(O=R.options).onHide)==null||L.call(O,_));const B=f.current,D=document.activeElement,I=(B==null?void 0:B.querySelector(`[data-toast-id="${N}"]`))??null;if(I&&D instanceof Node&&I.contains(D))if(g.current=N,d.current.filter(q=>q.id!==N).length>0){const q=d.current.findIndex(X=>X.id===N),U=d.current[q+1]??d.current[q-1];v.current=U?U.id:"restore"}else v.current="restore";u(H=>H.has(N)?H:new Set(H).add(N))},[]),j=h.useCallback(N=>{p.current.delete(N),u(_=>{if(!_.has(N))return _;const R=new Set(_);return R.delete(N),R}),l(_=>_.filter(R=>R.id!==N))},[]);h.useLayoutEffect(()=>{const N=g.current,_=v.current;if(N==null||_==null||a.some(D=>D.id===N))return;g.current=null,v.current=null;const R=f.current;if(_!=="restore"&&R){const D=R.querySelector(`[data-toast-id="${_}"]`),I=y(D)??D;if(I){I.focus();return}}const B=x.current;x.current=null,B&&B.isConnected?B.focus():R&&R.focus()},[a,y]);const A=h.useCallback(N=>d.current.find(_=>_.options.uniqueID===N),[]),M=h.useMemo(()=>({addToast:k,removeToast:b,findByUniqueID:A}),[k,b,A]),T=a.slice(-t),z={};n!=null&&n.top&&(z.top=n.top),n!=null&&n.bottom&&(z.bottom=n.bottom),n!=null&&n.start&&(z.insetInlineStart=n.start),n!=null&&n.end&&(z.insetInlineEnd=n.end),h.useEffect(()=>{if(!s)return;const N=f.current;if(N&&typeof N.showPopover=="function")try{N.showPopover()}catch{}},[s]);const $=a.length>0;h.useEffect(()=>{if(!$)return;const N=_=>{if(_.key!=="F6")return;const R=f.current;if(!R)return;const B=document.activeElement;if(B instanceof Node&&R.contains(B))return;_.preventDefault(),B instanceof HTMLElement&&(x.current=B);const D=R.querySelectorAll("[data-toast-id]"),I=D[D.length-1]??null;(y(I)??I??R).focus()};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[$,y]);const E=e==="topEnd"?ff.topEnd:e==="topStart"?ff.topStart:e==="bottomStart"?ff.bottomStart:ff.bottomEnd;return o.jsxs(zg,{value:M,children:[r,o.jsx("div",{ref:f,role:"region","aria-label":i("@astryx.toast.viewport"),tabIndex:-1,popover:s?"manual":void 0,...ne(G(ff.viewport,E),{style:Object.keys(z).length>0?z:void 0}),children:T.map(N=>{const _=N.options,R=_.type??"info",B=_.isAutoHide??R!=="error",D=_.autoHideDuration??5e3,I=c.has(N.id);return o.jsx("div",{"data-toast-id":N.id,...{0:{className:"x67bb7w xrvj5dj x1tu4anv xvmdzux xjshnde xuedmi6 xsagj69 xlr8y92 x1sopeo2 x5rzir7"},1:{className:"x67bb7w xrvj5dj xjshnde xuedmi6 xsagj69 xlr8y92 x1sopeo2 x5rzir7 xihq33y x18d9i69"}}[!!I<<0],onTransitionEnd:I?O=>{O.propertyName==="grid-template-rows"&&j(N.id)}:void 0,children:o.jsx("div",{className:"xb3r6kr",children:o.jsx(YS,{type:R,body:_.body,endContent:_.endContent,isAutoHide:B,autoHideDuration:D,isExiting:I,onDismiss:O=>b(N.id,O)})})},N.id)})})]})}Ng.displayName="ToastViewport";const v6='button, [role="button"]';function k6(e){return e.matches(v6)?e:e.querySelector(v6)}const Fo={contentPadding:{kLKAdn:"x1vlblms",kGO01o:"xvmdzux",kZCmMZ:"x126nfab",kwRFfy:"x1t818jl",$$css:!0},gap:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0},customWidth:e=>[{kzqmXN:(typeof e=="number"?`${e}px`:e)!=null?"x5lhr3w":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}],matchTrigger:{k7Eaqz:"xrzjruh",$$css:!0}};function QS({children:e,anchorRef:t,content:n,placement:s="below",alignment:r="start",isOpen:i,onOpenChange:a,isEnabled:l=!0,width:c,label:u,role:d="dialog",isModal:f,hasCloseButton:p,closeButtonLabel:x,hasAutoFocus:g,hasLightDismiss:v=!0,hasEscapeDismiss:y=!0,xstyle:m,className:k,style:b,"data-testid":j}){const A=h.useRef(null),M=i!==void 0,T=h.useRef(0),z=h.useCallback(()=>{a==null||a(!0)},[a]),$=h.useCallback(()=>{T.current=Date.now(),a==null||a(!1)},[a]),E=zc({dialogLabel:u,role:d,isModal:f,hasLightDismiss:v,hasEscapeDismiss:y,hasCloseButton:p,closeButtonLabel:x,hasAutoFocus:g,onShow:z,onHide:$}),N=h.useCallback(()=>{l&&(Date.now()-T.current<50||E.toggle())},[l,E]),_=h.useCallback(I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),N())},[N]),R=h.useCallback(I=>{I.setAttribute("aria-haspopup",E.triggerProps["aria-haspopup"]),I.setAttribute("aria-expanded",String(E.triggerProps["aria-expanded"])),I.setAttribute("aria-controls",E.triggerProps["aria-controls"]),I.addEventListener("click",N);const O=I.tagName!=="BUTTON"&&I.getAttribute("role")==="button";return O&&I.addEventListener("keydown",_),()=>{I.removeAttribute("aria-haspopup"),I.removeAttribute("aria-expanded"),I.removeAttribute("aria-controls"),I.removeEventListener("click",N),O&&I.removeEventListener("keydown",_)}},[E,N,_]);Bi(()=>{if(!t)return;const I=t.current;if(!I)return;const O=k6(I);if(O||oc(),!O)return;E.triggerRef(I);const L=R(O);return()=>{E.triggerRef(null),L()}},[t,E,R]),Bi(()=>{if(t||typeof e=="function")return;const I=A.current;if(!I)return;E.triggerRef(I);const O=k6(I);if(O||oc(),!O)return;const L=R(O);return()=>{E.triggerRef(null),L()}},[t,E,R]),Bi(()=>{M&&(i&&!E.isOpen?E.show():!i&&E.isOpen&&E.hide())},[i,M,E]);const B=c?Fo.customWidth(c):Fo.matchTrigger;if(t&&e==null)return o.jsx(o.Fragment,{children:E.render(o.jsx("div",{"data-testid":j,...ne(J("popover"),G(Fo.contentPadding,m),k,b),children:n}),{placement:s,alignment:r,xstyle:[B,Fo.gap,wo[s]]})});if(typeof e=="function"){const I={ref:E.triggerRef,onClick:N,"aria-haspopup":"dialog","aria-expanded":E.isOpen,"aria-controls":E.id};return o.jsxs(o.Fragment,{children:[e(I),E.render(o.jsx("div",{"data-testid":j,...ne(J("popover"),G(Fo.contentPadding,m),k,b),children:n}),{placement:s,alignment:r,xstyle:[B,Fo.gap,wo[s]]})]})}return o.jsxs(o.Fragment,{children:[o.jsx(Q4,{value:"button",children:o.jsx("div",{ref:A,className:"x3nfvp2",children:e})}),E.render(o.jsx("div",{"data-testid":j,...ne(J("popover"),G(Fo.contentPadding,m),k,b),children:n}),{placement:s,alignment:r,xstyle:[B,Fo.gap,wo[s]]})]})}QS.displayName="Popover";const Zm={container:{kWkggS:"x10xzikg","--_hovercard-radius":"xqwz7mz",kaIpWk:"x7a53xk",kGVxlE:"x14hfi27",$$css:!0},marginBlock:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",keTefX:"x1lziwak",k71WvV:"x14z9mp",$$css:!0},marginInline:{keoZOQ:"xdj266r",k1K539:"xat24cr",keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0}};function BH(e){return e.hasAttribute("tabindex")?e.tabIndex>=0:["A","BUTTON","INPUT","SELECT","TEXTAREA"].includes(e.tagName)?!e.disabled:!!e.isContentEditable}function HH(e={}){const{placement:t="above",alignment:n="center",delay:s=300,hideDelay:r=200,focusTrigger:i="auto",isEnabled:a=!0,label:l,isOpen:c,isDefaultOpen:u=!1,onShow:d,onHide:f}=e,p=t==="above"||t==="below"?Zm.marginBlock:Zm.marginInline,x=Dd({mode:"context",onShow:d,onHide:f}),g=h.useMemo(()=>[Zm.container,p],[p]),v=h.useRef(null),y=h.useRef(null),m=h.useRef(null),k=h.useRef(!1),b=h.useRef(!1),j=h.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null),y.current&&(clearTimeout(y.current),y.current=null)},[]),A=h.useCallback(()=>{!a||c===!1||(j(),v.current=setTimeout(()=>{x.show()},s))},[a,c,j,x,s]),M=h.useCallback(()=>{c!==!0&&(j(),y.current=setTimeout(()=>{k.current||x.hide()},r))},[c,j,x,r]),T=h.useCallback(()=>{A()},[A]),z=h.useCallback(()=>{M()},[M]),$=h.useCallback(()=>{if(a){if(b.current){b.current=!1;return}j(),x.show()}},[a,j,x]),E=h.useCallback(D=>{const I=D.relatedTarget,O=document.getElementById(x.id);O!=null&&O.contains(I)||M()},[x.id,M]),N=h.useCallback(D=>{D.key==="Escape"&&(D.stopPropagation(),j(),x.hide())},[j,x]),_=h.useCallback(D=>{m.current&&(m.current.removeEventListener("mouseenter",T),m.current.removeEventListener("mouseleave",z),m.current.removeEventListener("focusin",$),m.current.removeEventListener("focusout",E),m.current.removeEventListener("keydown",N)),D&&(D.addEventListener("mouseenter",T),D.addEventListener("mouseleave",z),(i==="always"||i==="auto"&&BH(D))&&(D.addEventListener("focusin",$),D.addEventListener("focusout",E)),D.addEventListener("keydown",N)),m.current=D},[i,T,z,$,E,N]),R=h.useCallback(D=>{x.ref(D),_(D)},[x,_]);h.useEffect(()=>()=>{j()},[j]),h.useEffect(()=>{u&&x.show()},[]),h.useEffect(()=>{c!==void 0&&(c?(j(),x.show()):(j(),x.hide()))},[c,j,x]);const B=h.useCallback((D,I)=>{const O=(I==null?void 0:I.placement)??t,L=J("hovercard").className,H={placement:O,alignment:(I==null?void 0:I.alignment)??n,role:l?"dialog":"group","aria-label":l||void 0,xstyle:[g,wo[O],I==null?void 0:I.xstyle],className:I!=null&&I.className?`${L} ${I.className}`:L,style:I==null?void 0:I.style,as:"span"};return x.render(o.jsx("span",{className:"x1lliihq x1vlblms xvmdzux x126nfab x1t818jl",onMouseEnter:()=>{k.current=!0,j()},onMouseLeave:()=>{k.current=!1,M()},onKeyDown:q=>{var U;q.key==="Escape"&&(q.stopPropagation(),b.current=!0,j(),x.hide(),(U=m.current)==null||U.focus())},onBlur:q=>{var Z;const U=q.relatedTarget;q.currentTarget.contains(U)||(Z=m.current)!=null&&Z.contains(U)||M()},children:D}),H)},[x,t,n,l,j,M,g]);return{ref:R,positionRef:x.ref,interactionRef:_,anchorId:x.anchorId,describedBy:x.id,renderHoverCard:B,show:x.show,hide:x.hide}}function qH(e){return typeof e=="string"||typeof e=="number"}function PH(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function JS({children:e,content:t,placement:n="above",alignment:s="center",delay:r=300,hideDelay:i=200,focusTrigger:a="auto",isEnabled:l=!0,label:c,onOpenChange:u,hasHoverIndication:d="auto",isOpen:f,isDefaultOpen:p,xstyle:x,className:g,style:v}){const y=h.useRef(null),m=qH(e),k=d===!0||d==="auto"&&m,b=h.useCallback(()=>{u==null||u(!0)},[u]),j=h.useCallback(()=>{u==null||u(!1)},[u]),A=HH({placement:n,alignment:s,delay:r,hideDelay:i,focusTrigger:a,isEnabled:l,label:c,isOpen:f,isDefaultOpen:p,onShow:b,onHide:j});Bi(()=>{if(m)return;const T=y.current;if(!T)return;const z=T.firstElementChild;if(!z)return;A.ref(z);const $=z.getAttribute("aria-describedby");return z.setAttribute("aria-describedby",PH($,A.describedBy)??""),()=>{A.ref(null),$?z.setAttribute("aria-describedby",$):z.removeAttribute("aria-describedby")}},[m,A.ref,A.describedBy]);const M=A.renderHoverCard(t,{xstyle:x,className:g,style:v});return m?o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:A.ref,tabIndex:0,"aria-describedby":A.describedBy,...{0:{className:"xt0psk2"},1:{className:"xt0psk2 xujl8zx xev0dqp xycaml9 x11b3rvo"}}[!!k<<0],children:e}),M]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:y,className:"xjp7ctv",children:e}),M]})}JS.displayName="HoverCard";const b6=new Map,UH=/\b(const|let|var|function|class|if|else|for|while|return|import|export|from|default|async|await|try|catch|throw|new|typeof|instanceof|interface|type|enum|extends|implements|switch|case|break|continue|do|in|of|void|null|undefined|true|false|this|super|yield|delete|static|public|private|protected|readonly|abstract|as|is|keyof|declare|module|namespace|require)\b/,FH=/\b(def|class|if|elif|else|for|while|return|import|from|as|with|try|except|raise|True|False|None|and|or|not|in|is|lambda|yield|async|await|pass|break|continue|del|global|nonlocal|assert|finally|print|self|cls)\b/,VH=/\b(if|then|else|elif|fi|for|do|done|while|until|case|esac|function|in|select|return|exit|local|export|source|alias|unalias|readonly|shift|eval|exec|set|unset|trap|wait|read|echo|printf|test|true|false)\b/,GH=/\b(important|inherit|initial|unset|revert|auto|none)\b/,WH=/\b(function|class|if|else|elseif|for|foreach|while|return|echo|public|private|protected|static|new|try|catch|throw|namespace|use|require|require_once|include|include_once|extends|implements|interface|abstract|final|const|var|true|false|null|array|isset|unset|empty|list|match|enum|switch|case|break|continue|do|yield|fn)\b/,KH=/\b(function|class|if|else|for|foreach|while|return|echo|public|private|protected|static|new|try|catch|throw|namespace|use|require|include|extends|implements|interface|abstract|final|const|shape|vec|dict|keyset|async|await|concurrent|enum|type|newtype|tuple|inout)\b/;function eC(e){const t=b6.get(e);if(t!==void 0)return t;const n=XH(e);return b6.set(e,n),n}function XH(e){const t=ZH(e);return t?{defaultType:t.defaultType,patterns:t.patterns.map(n=>{const s=n.regex.flags.replace(/[gy]/g,"")+"y";return{...n,anchored:new RegExp(n.regex.source,s)}})}:null}function ZH(e){switch(e){case"typescript":case"javascript":case"tsx":case"jsx":case"ts":case"js":return{defaultType:"variable",patterns:[{type:"comment",regex:/\/\*[\s\S]*?\*\//},{type:"comment",regex:/\/\/[^\n]*/},{type:"string",regex:/`(?:[^`\\]|\\.)*`/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"constant",regex:/@[\w]+/},{type:"number",regex:/\b0[xX][0-9a-fA-F_]+\b/},{type:"number",regex:/\b0[bB][01_]+\b/},{type:"number",regex:/\b0[oO][0-7_]+\b/},{type:"number",regex:/\b\d[\d_]*\.?[\d_]*(?:[eE][+-]?\d+)?\b/},{type:"keyword",regex:UH},{type:"function",regex:/\b[a-zA-Z_$][\w$]*(?=\s*\()/},{type:"type",regex:/\b[A-Z][a-zA-Z0-9_]*\b/},{type:"operator",regex:/[+\-*/%=!<>&|^~?:]+/},{type:"punctuation",regex:/[{}()\[\];,.]/},{type:"variable",regex:/\b[a-zA-Z_$][\w$]*\b/}]};case"json":return{defaultType:"punctuation",patterns:[{type:"property",regex:/"(?:[^"\\]|\\.)*"(?=\s*:)/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"number",regex:/-?\b\d+\.?\d*(?:[eE][+-]?\d+)?\b/},{type:"constant",regex:/\b(true|false|null)\b/},{type:"punctuation",regex:/[{}()\[\]:,]/}]};case"html":case"xml":case"svg":return{defaultType:"variable",patterns:[{type:"comment",regex:/<!--[\s\S]*?-->/},{type:"keyword",regex:/<!DOCTYPE[^>]*>/i},{type:"tag",regex:/<\/[a-zA-Z][\w-]*\s*>/},{type:"tag",regex:/<[a-zA-Z][\w-]*/},{type:"tag",regex:/\/?>/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"attribute",regex:/\b[a-zA-Z_:][\w:.-]*(?=\s*=)/},{type:"operator",regex:/=/}]};case"css":case"scss":case"less":return{defaultType:"variable",patterns:[{type:"comment",regex:/\/\*[\s\S]*?\*\//},{type:"comment",regex:/\/\/[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"variable",regex:/--[a-zA-Z_-][\w-]*/},{type:"number",regex:/-?\b\d+\.?\d*(?:px|em|rem|%|vh|vw|vmin|vmax|ch|ex|deg|rad|turn|s|ms|fr)?\b/},{type:"constant",regex:/#[0-9a-fA-F]{3,8}\b/},{type:"keyword",regex:GH},{type:"keyword",regex:/@[a-zA-Z][\w-]*/},{type:"tag",regex:/[.#][a-zA-Z_-][\w-]*/},{type:"keyword",regex:/::?[a-zA-Z][\w-]*/},{type:"function",regex:/\b[a-zA-Z_-][\w-]*(?=\s*\()/},{type:"property",regex:/[a-zA-Z_-][\w-]*(?=\s*:)/},{type:"punctuation",regex:/[{}()\[\];:,]/},{type:"operator",regex:/[+~>*=|^$]/}]};case"python":case"py":return{defaultType:"variable",patterns:[{type:"string",regex:/"""[\s\S]*?"""/},{type:"string",regex:/'''[\s\S]*?'''/},{type:"string",regex:/f"(?:[^"\\]|\\.)*"/},{type:"string",regex:/f'(?:[^'\\]|\\.)*'/},{type:"comment",regex:/#[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"constant",regex:/@[\w.]+/},{type:"number",regex:/\b0[xX][0-9a-fA-F_]+\b/},{type:"number",regex:/\b0[bB][01_]+\b/},{type:"number",regex:/\b0[oO][0-7_]+\b/},{type:"number",regex:/\b\d[\d_]*\.?[\d_]*(?:[eE][+-]?\d+)?j?\b/},{type:"keyword",regex:FH},{type:"function",regex:/\b[a-zA-Z_][\w]*(?=\s*\()/},{type:"type",regex:/\b[A-Z][a-zA-Z0-9_]*\b/},{type:"operator",regex:/[+\-*/%=!<>&|^~@:]+/},{type:"punctuation",regex:/[{}()\[\];,.]/},{type:"variable",regex:/\b[a-zA-Z_][\w]*\b/}]};case"bash":case"sh":case"zsh":case"shell":return{defaultType:"variable",patterns:[{type:"comment",regex:/#[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'[^']*'/},{type:"variable",regex:/\$\{[^}]+\}/},{type:"variable",regex:/\$[a-zA-Z_][\w]*/},{type:"variable",regex:/\$[0-9@#?*!$-]/},{type:"number",regex:/\b\d+\b/},{type:"keyword",regex:VH},{type:"function",regex:/\b[a-zA-Z_][\w]*(?=\s*\()/},{type:"operator",regex:/[|&<>;!]+/},{type:"punctuation",regex:/[{}()\[\]]/}]};case"php":return{defaultType:"variable",patterns:[{type:"comment",regex:/\/\*[\s\S]*?\*\//},{type:"comment",regex:/\/\/[^\n]*/},{type:"comment",regex:/#[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"variable",regex:/\$[a-zA-Z_][\w]*/},{type:"number",regex:/\b0[xX][0-9a-fA-F]+\b/},{type:"number",regex:/\b\d+\.?\d*(?:[eE][+-]?\d+)?\b/},{type:"keyword",regex:WH},{type:"function",regex:/\b[a-zA-Z_][\w]*(?=\s*\()/},{type:"type",regex:/\b[A-Z][a-zA-Z0-9_]*\b/},{type:"operator",regex:/[+\-*/%=!<>&|^~?:.]+/},{type:"constant",regex:/@[\w]+/},{type:"punctuation",regex:/[{}()\[\];,.]/}]};case"hack":return{defaultType:"variable",patterns:[{type:"comment",regex:/\/\*[\s\S]*?\*\//},{type:"comment",regex:/\/\/[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"variable",regex:/\$[a-zA-Z_][\w]*/},{type:"number",regex:/\b0[xX][0-9a-fA-F]+\b/},{type:"number",regex:/\b\d+\.?\d*(?:[eE][+-]?\d+)?\b/},{type:"keyword",regex:KH},{type:"type",regex:/\b[A-Z][a-zA-Z0-9_]*\b/},{type:"function",regex:/\b[a-zA-Z_][\w]*(?=\s*\()/},{type:"property",regex:new RegExp("(?<=->|::)\\b[a-zA-Z_][\\w]*\\b")},{type:"operator",regex:/[+\-*/%=!<>&|^~?:.]+/},{type:"constant",regex:/<<[\w]+/},{type:"punctuation",regex:/[{}()\[\];,.]/}]};case"yaml":case"yml":return{defaultType:"variable",patterns:[{type:"comment",regex:/#[^\n]*/},{type:"string",regex:/"(?:[^"\\]|\\.)*"/},{type:"string",regex:/'(?:[^'\\]|\\.)*'/},{type:"constant",regex:/\b(true|false|yes|no|on|off|null|~)\b/i},{type:"variable",regex:/[&*][\w]+/},{type:"type",regex:/!!\w+/},{type:"number",regex:/\b-?\d+\.?\d*(?:[eE][+-]?\d+)?\b/},{type:"property",regex:/^[ \t]*[\w][\w ./-]*(?=\s*:)/m},{type:"keyword",regex:/---/},{type:"keyword",regex:/\.\.\./},{type:"operator",regex:/[:|>\-?]/},{type:"punctuation",regex:/[{}()\[\],]/},{type:"variable",regex:/\b[a-zA-Z_][\w]*\b/}]};case"markdown":case"md":return{defaultType:"variable",patterns:[{type:"keyword",regex:/^```[\w]*$/m},{type:"keyword",regex:/^#{1,6}\s+.*/m},{type:"keyword",regex:/^---$/m},{type:"keyword",regex:/^\*\*\*$/m},{type:"string",regex:/\*\*(?:[^*]|\*(?!\*))+\*\*/},{type:"string",regex:/\*(?:[^*])+\*/},{type:"constant",regex:/`[^`]+`/},{type:"function",regex:/\[(?:[^\]])+\]\([^)]+\)/},{type:"comment",regex:/^>\s+.*/m},{type:"operator",regex:/^\s*[-*+]\s/m},{type:"number",regex:/^\s*\d+\.\s/m}]};default:return null}}const w6=2e3,YH=800;async function QH(){return typeof scheduler<"u"&&typeof scheduler.yield=="function"?scheduler.yield():new Promise(e=>setTimeout(e,0))}function tC(e,t,n,s){const r=[];let i=n;const a=Math.min(s,e.length);for(;i<a;){let l=!1;for(const c of t.patterns){c.anchored.lastIndex=i;const u=c.anchored.exec(e);if(u&&u.index===i&&u[0].length>0){c.type!==t.defaultType&&r.push({type:c.type,start:i-n,end:i-n+u[0].length}),i+=u[0].length,l=!0;break}}l||i++}return r}function JH(e,t){const n=eC(t);if(!n)return[];const s=[];let r=0;for(let i=0;i<=e.length;i++)(i===e.length||e[i]===`
|
|
87
|
-
`)&&(s.push(tC(e,n,r,i)),r=i+1);return s}async function eq(e,t,n){const s=eC(t);if(!s)return[];const r=[];let i=0,a=0;for(let l=0;l<=e.length;l++)if((l===e.length||e[l]===`
|
|
88
|
-
`)&&(r.push(tC(e,s,i,l)),a+=l-i+1,i=l+1,a>=YH&&l<e.length)){if(n!=null&&n.aborted)return r;a=0,await QH()}return r}function tq(e,t){const n=[0];for(let i=0;i<t.length;i++)t[i]===`
|
|
89
|
-
`&&n.push(i+1);const s=Array.from({length:n.length},()=>[]);let r=0;for(const i of e){for(;r<n.length-1&&i.start>=n[r+1];)r++;const a=n[r];s[r].push({type:i.type,start:i.start-a,end:i.end-a})}return s}const nq=`:root {
|
|
90
|
-
${Object.entries(D4).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
91
|
-
`)}
|
|
92
|
-
}`,sq=`
|
|
93
|
-
${nq}
|
|
94
|
-
|
|
95
|
-
.astryx-codeblock code::highlight(astryx-keyword),
|
|
96
|
-
.astryx-codeeditor code::highlight(astryx-keyword) { color: var(--color-syntax-keyword); }
|
|
97
|
-
.astryx-codeblock code::highlight(astryx-string),
|
|
98
|
-
.astryx-codeeditor code::highlight(astryx-string) { color: var(--color-syntax-string); }
|
|
99
|
-
.astryx-codeblock code::highlight(astryx-comment),
|
|
100
|
-
.astryx-codeeditor code::highlight(astryx-comment) { color: var(--color-syntax-comment); }
|
|
101
|
-
.astryx-codeblock code::highlight(astryx-number),
|
|
102
|
-
.astryx-codeeditor code::highlight(astryx-number) { color: var(--color-syntax-number); }
|
|
103
|
-
.astryx-codeblock code::highlight(astryx-function),
|
|
104
|
-
.astryx-codeeditor code::highlight(astryx-function) { color: var(--color-syntax-function); }
|
|
105
|
-
.astryx-codeblock code::highlight(astryx-type),
|
|
106
|
-
.astryx-codeeditor code::highlight(astryx-type) { color: var(--color-syntax-type); }
|
|
107
|
-
.astryx-codeblock code::highlight(astryx-tag),
|
|
108
|
-
.astryx-codeeditor code::highlight(astryx-tag) { color: var(--color-syntax-tag); }
|
|
109
|
-
.astryx-codeblock code::highlight(astryx-attribute),
|
|
110
|
-
.astryx-codeeditor code::highlight(astryx-attribute) { color: var(--color-syntax-attribute); }
|
|
111
|
-
.astryx-codeblock code::highlight(astryx-property),
|
|
112
|
-
.astryx-codeeditor code::highlight(astryx-property) { color: var(--color-syntax-property); }
|
|
113
|
-
.astryx-codeblock code::highlight(astryx-operator),
|
|
114
|
-
.astryx-codeeditor code::highlight(astryx-operator) { color: var(--color-syntax-operator); }
|
|
115
|
-
.astryx-codeblock code::highlight(astryx-constant),
|
|
116
|
-
.astryx-codeeditor code::highlight(astryx-constant) { color: var(--color-syntax-constant); }
|
|
117
|
-
.astryx-codeblock code::highlight(astryx-punctuation),
|
|
118
|
-
.astryx-codeeditor code::highlight(astryx-punctuation) { color: var(--color-syntax-punctuation); }
|
|
119
|
-
.astryx-codeblock code::highlight(astryx-variable),
|
|
120
|
-
.astryx-codeeditor code::highlight(astryx-variable) { color: var(--color-syntax-variable); }
|
|
121
|
-
|
|
122
|
-
/* Span-based fallback classes — used when highlightMode='spans' or
|
|
123
|
-
when the CSS Custom Highlight API is not available. */
|
|
124
|
-
.astryx-token-keyword { color: var(--color-syntax-keyword); }
|
|
125
|
-
.astryx-token-string { color: var(--color-syntax-string); }
|
|
126
|
-
.astryx-token-comment { color: var(--color-syntax-comment); }
|
|
127
|
-
.astryx-token-number { color: var(--color-syntax-number); }
|
|
128
|
-
.astryx-token-function { color: var(--color-syntax-function); }
|
|
129
|
-
.astryx-token-type { color: var(--color-syntax-type); }
|
|
130
|
-
.astryx-token-tag { color: var(--color-syntax-tag); }
|
|
131
|
-
.astryx-token-attribute { color: var(--color-syntax-attribute); }
|
|
132
|
-
.astryx-token-property { color: var(--color-syntax-property); }
|
|
133
|
-
.astryx-token-operator { color: var(--color-syntax-operator); }
|
|
134
|
-
.astryx-token-constant { color: var(--color-syntax-constant); }
|
|
135
|
-
.astryx-token-punctuation { color: var(--color-syntax-punctuation); }
|
|
136
|
-
.astryx-token-variable { color: var(--color-syntax-variable); }
|
|
137
|
-
`;let j6=!1;function _g(){if(j6||typeof document>"u")return;const e=document.createElement("style");e.setAttribute("data-astryx-highlight-styles",""),e.textContent=sq,document.head.appendChild(e),j6=!0}const rq=["keyword","string","comment","number","function","type","tag","attribute","property","operator","constant","punctuation","variable"],S6=new Set(rq);let n0=null;function iq(e){if(S6.has(e)||(S6.add(e),_g(),typeof document>"u"))return;if(!n0){const s=document.createElement("style");if(s.setAttribute("data-astryx-highlight-dynamic",""),document.head.appendChild(s),n0=s.sheet??null,!n0)return}const t=`astryx-${e}`,n=`var(--color-syntax-${e}, currentColor)`;n0.insertRule(`.astryx-codeblock code::highlight(${t}), .astryx-codeeditor code::highlight(${t}) { color: ${n}; }`)}function oq(){const e=new Map;return t=>{let n=e.get(t);if(n)return n;iq(t);const s=`astryx-${t}`;return n=CSS.highlights.get(s),n||(n=new Highlight,CSS.highlights.set(s,n)),e.set(t,n),n}}function nC(e,t,n,s){if(t.length===0)return;const r=e.firstChild;if(!r||r.nodeType!==Node.TEXT_NODE)return;const i=r.length;for(const a of t){if(a.start>=i||a.end<=0)continue;const l=Math.min(a.start,i),c=Math.min(a.end,i),u=s(a.type);try{const d=new Range;d.setStart(r,l),d.setEnd(r,c),u.add(d),n.push({range:d,highlight:u})}catch{}}}function Ym(e){for(const{range:t,highlight:n}of e)n.delete(t)}function aq(e,t,n,s){const r=[],i=e.querySelectorAll("[data-line]");for(let a=0;a<i.length;a++){const l=n+a,c=t[l];c&&c.length>0&&nC(i[a],c,r,s)}return r}function lq(e,t){_g();const n=oq(),s=[],r=[];let i=0;for(let d=0;d<e.children.length;d++){const f=e.children[d],p=f.querySelectorAll("[data-line]");p.length>0&&f.tagName==="DIV"&&!f.hasAttribute("data-line")&&(s.push(f),r.push(i),i+=p.length)}if(s.length===0){const d=[],f=e.querySelectorAll("[data-line]");for(let p=0;p<f.length;p++){const x=t[p];x&&x.length>0&&nC(f[p],x,d,n)}return()=>Ym(d)}const a=new Map,l=new Map;function c(d,f){if(a.has(d))return;const p=aq(d,t,r[f],n);a.set(d,p)}function u(d){const f=a.get(d);f&&(Ym(f),a.delete(d))}for(let d=0;d<s.length;d++){const f=s[d],p=g=>{g.skipped?u(f):c(f,d)};f.addEventListener("contentvisibilityautostatechange",p),l.set(f,p);const x=f;typeof x.checkVisibility=="function"?x.checkVisibility({checkVisibilityCSS:!0,contentVisibilityAuto:!0})&&c(f,d):d<5&&c(f,d)}return function(){for(const[f,p]of l)f.removeEventListener("contentvisibilityautostatechange",p);l.clear();for(const f of a.values())Ym(f);a.clear()}}const cq={card:{kaIpWk:"xh6dtrn",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kVAM5u:"x14i3s5s",$$css:!0},section:{kaIpWk:"x2u8bby",kMzoRj:"xc342km",ksu8eU:"xng3xce",kVAM5u:"x9r1u3d","--color-syntax-background":"x1mtvhk1",$$css:!0}},uq={"--_codeblock-gutter-width":"xtk08jq",$$css:!0},e5={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,k7Eaqz:(e==="fit-content"?"min(100%, 400px)":null)!=null?"xkj4a21":e==="fit-content"?"min(100%, 400px)":null,ks0D6T:(e==="fit-content"?"100%":null)!=null?"xf68679":e==="fit-content"?"100%":null,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e),"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(e==="fit-content"?"min(100%, 400px)":null),"--x-maxWidth":(t=>typeof t=="number"?t+"px":t??void 0)(e==="fit-content"?"100%":null)}],gutterWidth:e=>[uq,{"--x---_codeblock-gutter-width":`${e}ch`!=null?`${e}ch`:void 0}]},jo={root:{kVAEAm:"x1n2onr6",kHBbk8:"xc8icb0",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kogj98:"x1ghz6dp",kWkggS:"xzyc27v",kVQacm:"xb3r6kr",$$css:!0},code:{k1xSpc:"x1lliihq",kUk6DE:"x98rzlu",k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",kogj98:"x1ghz6dp",kMv6JI:"x9m5x89",kMwMTN:"xdfisg",kKi2Bq:"xeq4nuv",khDVqt:"x1sdyfia",kTgw9:"x1lldw8n",kHjlTd:"x1h4wwuj",$$css:!0},codeWrapped:{khDVqt:"x126k92a",kTgw9:"x1yn0g08",kHjlTd:"x1mzt3pk",$$css:!0},codeNumbered:{kVAEAm:"x1n2onr6",k5JduY:"x1s928wv",kwXMNM:"x1j6awrg",kSy8m5:"xd54j2p",kc1e00:"x1km86hw",kkgrvl:"xkj6t0a",kQlJh0:"x1p96cux",k6vLHU:"xvsnedh",kkQ525:"xnnzo76",kloYau:"x2q1x1w",$$css:!0},sizeSm:{kGuDYH:"x141an7d",$$css:!0},sizeMd:{kGuDYH:"xp03k98",$$css:!0}},dq=20,fq=100,C6=h.memo(function({lines:t,startIndex:n,highlightSet:s,renderLineContent:r,lineNumbers:i}){return o.jsx(o.Fragment,{children:t.map((a,l)=>{const c=n+l;return o.jsx("div",{"data-line":c+1,...{0:{className:"x17iicif"},2:{className:"x17iicif xrvj5dj x1xx4m37 xf5zn4v x46gnpd x17gn2l9 x19ds33d x1wnbjh8 xtkarl4 x1rbqspl x3nzp0f"},1:{className:"x17iicif xgcxg3y x1ng9b9t x1pzlopt"},3:{className:"x17iicif xrvj5dj x1xx4m37 xf5zn4v x46gnpd x17gn2l9 x19ds33d x1wnbjh8 xtkarl4 x1rbqspl x3nzp0f xgcxg3y x1ng9b9t x1pzlopt"}}[!!i<<1|!!((s==null?void 0:s.has(c+1))??!1)<<0],children:r(a,c)},c)})})});function sC(e,t,n,s,r=dq){if(r=Math.max(1,Math.floor(r)),e.length<fq)return o.jsx(C6,{lines:e,startIndex:0,highlightSet:t,renderLineContent:n,lineNumbers:s});const i=[];for(let a=0;a<e.length;a+=r){const l=Math.min(a+r,e.length),c=e.slice(a,l),u=`${c.length}lh`;i.push(o.jsx("div",{...ne({className:"xb5mbof"},{style:{containIntrinsicBlockSize:`auto ${u}`}}),children:o.jsx(C6,{lines:c,startIndex:a,highlightSet:t,renderLineContent:n,lineNumbers:s})},a))}return i}function rC(){return typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u"}function hq(){if(typeof navigator>"u")return!1;const e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}function pq(e,t,n){const[s,r]=h.useState(null),i=h.useMemo(()=>n?tq(n(e,t),e):e.length>=w6?null:JH(e,t),[e,t,n]);return h.useEffect(()=>{if(e.length<w6||n)return;const a=new AbortController;async function l(){try{const c=await eq(e,t,a.signal);a.signal.aborted||r({code:e,language:t,tokens:c})}catch{a.signal.aborted||r({code:e,language:t,tokens:[]})}}return l(),()=>{a.abort()}},[e,t,n]),i??((s==null?void 0:s.code)===e&&s.language===t?s.tokens:[])}function xq(e,t){if(t.length===0)return e||"";const n=[];let s=0;for(const r of t){r.start>s&&n.push(e.slice(s,r.start));const i=Math.min(r.end,e.length);n.push(o.jsx("span",{className:`astryx-token-${r.type} xds-token-${r.type}`,children:e.slice(r.start,i)},`${r.start}-${r.type}`)),s=i}return s<e.length&&n.push(e.slice(s)),n.length>0?n:""}function gq({lines:e,tokenLines:t,highlightSet:n,isWrapped:s,sizeStyle:r,hasLineNumbers:i,maxDigits:a}){h.useInsertionEffect(()=>{_g()},[]);const l=h.useCallback((c,u)=>{const d=t[u]??[];return o.jsx("span",{className:"xeuugli",children:xq(c,d)})},[t]);return o.jsx("code",{...G(jo.code,r,s&&jo.codeWrapped,i&&jo.codeNumbered,i&&e5.gutterWidth(a)),children:sC(e,n,l,i)})}function mq({lines:e,tokenLines:t,highlightSet:n,isWrapped:s,sizeStyle:r,hasLineNumbers:i,maxDigits:a}){const l=h.useRef(null);h.useEffect(()=>{if(!rC())return;_g();const u=l.current;if(!(!u||t.length===0))return lq(u,t)},[t]);const c=h.useCallback(u=>u||"",[]);return o.jsx("code",{ref:l,...G(jo.code,r,s&&jo.codeWrapped,i&&jo.codeNumbered,i&&e5.gutterWidth(a)),children:sC(e,n,c,i)})}function Ch({code:e,language:t="plaintext",title:n,hasLanguageLabel:s=!0,hasLineNumbers:r=!1,highlightLines:i,hasCopyButton:a=!0,onCopy:l,isWrapped:c=!1,maxHeight:u,isCollapsible:d=!1,collapsibleThreshold:f=10,size:p="md",width:x="fit-content",container:g="card",tokenizer:v,highlightMode:y="auto",syntaxTheme:m,xstyle:k,className:b,style:j,ref:A,...M}){const T=ze(),[z,$]=h.useState(!1),E=h.useRef(null),N=Nc();h.useEffect(()=>()=>{E.current!=null&&clearTimeout(E.current)},[]);const _=y==="spans"||y==="auto"&&!rC()||y==="auto"&&hq(),R=h.useMemo(()=>{const V=e.split(`
|
|
138
|
-
`);return V.length>1&&V[V.length-1]===""&&V.pop(),V},[e]),B=pq(e,t,v),D=h.useMemo(()=>i?new Set(i):null,[i]),I=h.useCallback(async()=>{try{await navigator.clipboard.writeText(e),$(!0),N(T("@astryx.codeBlock.copied")),l==null||l(),E.current!=null&&clearTimeout(E.current),E.current=setTimeout(()=>{E.current=null,$(!1)},2e3)}catch{}},[e,l,N,T]),O=p==="sm"?jo.sizeSm:jo.sizeMd,L=String(R.length).length,H=s&&t!=="plaintext"?t:null,q=n!=null||H!=null,U=d&&R.length>=f,[X,Z]=h.useState(!1),ie=h.useId(),ae=h.useRef(null),xe=u?{maxHeight:typeof u=="number"?`${u}px`:u}:void 0,fe=o.jsx(Te,{icon:z?"check":"copy",size:"sm",color:"inherit"}),se=a?o.jsx("button",{type:"button",onClick:V=>{V.stopPropagation(),I()},"aria-label":T(z?"@astryx.codeBlock.copied":"@astryx.codeBlock.copyCode"),...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x9epnlk x3kzqx6 xx3sua9 xjbqb8w xe9uy6x x1mjzq1q x1ypdohk x14ju556"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x9epnlk x3kzqx6 xx3sua9 xjbqb8w xe9uy6x x1mjzq1q x1ypdohk x14ju556 x10l6tqk xctzyg x72tfeb"}}[!q<<0],children:fe}):null,ye=q?o.jsxs("div",{...{0:{className:"x78zum5 x6s0dn4 x1qughib x1pzlopt xzyc27v x7wzq59 x13vifvy x1vjfegm xce4md1"},1:{className:"x78zum5 x6s0dn4 x1qughib x1pzlopt xzyc27v x7wzq59 x13vifvy x1vjfegm xce4md1 x92x3c3 x1q0q8m5 xw8gpjh"}}[!!r<<0],children:[o.jsx("div",{role:U?"button":void 0,tabIndex:U?0:void 0,"aria-expanded":U?!X:void 0,"aria-controls":U?ie:void 0,onClick:U?()=>Z(V=>!V):void 0,onKeyDown:U?V=>{(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),Z(Y=>!Y))}:void 0,...{0:{className:"x78zum5 x6s0dn4 x98rzlu xeuugli x1717udv xjbqb8w x1heor9g xln7xf2 x1yc453h"},1:{className:"x78zum5 x6s0dn4 x98rzlu xeuugli x1717udv xjbqb8w x1heor9g xln7xf2 x1yc453h x1ypdohk x87ps6o x17nn4n9 x1wfwxd8 x7s97pk"}}[!!U<<0],children:o.jsxs("span",{className:"x78zum5 x6s0dn4 x141an7d x9m5x89 x1e4wzip x1mjzq1q x1ghz6dp x1ltkj2j",children:[U&&o.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnur1sd xb3r6kr x1mjzq1q x1gbn2au x1aquc0h x12wqnr7 x128ha8g x11xpdln xuedmi6 xlr8y92"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnur1sd xb3r6kr x1mjzq1q x1gbn2au x1aquc0h x12wqnr7 x128ha8g x11xpdln xuedmi6 xlr8y92 x1iffjtl"}}[!X<<0],children:o.jsx(Te,{icon:"chevronRight",size:"xsm",color:"inherit"})}),n,n&&H?" — ":"",H]})}),se]}):null,me=o.jsx("div",{ref:ae,tabIndex:0,role:"group","aria-label":H??T("@astryx.codeBlock.code"),...ne({className:"xw2csxc x1odjw0f"},{style:xe}),children:o.jsx("div",{...{0:{className:"x78zum5 x1pshirs"},1:{className:"x78zum5 x1pshirs x1ajqlyv"}}[!!(q&&!r)<<0],children:_?o.jsx(gq,{lines:R,tokenLines:B,highlightSet:D,isWrapped:c,sizeStyle:O,hasLineNumbers:r,maxDigits:L}):o.jsx(mq,{lines:R,tokenLines:B,highlightSet:D,isWrapped:c,sizeStyle:O,hasLineNumbers:r,maxDigits:L})})}),P=o.jsxs("pre",{ref:A,...ne(J("codeblock",{size:p,language:t,container:g}),G(jo.root,e5.width(x),cq[g],k),b,j),...M,children:[ye,U?o.jsx("div",{id:ie,inert:X?!0:void 0,...{0:{className:"xrvj5dj x1tu4anv x1qn9uv2 x80gvsz xlr8y92"},1:{className:"xrvj5dj x1qn9uv2 x80gvsz xlr8y92 xihq33y"}}[!!X<<0],children:o.jsx("div",{className:"xb3r6kr x2lwn1j",children:me})}):me,!q&&se]});return m?o.jsx(ZS,{theme:m,children:P}):P}Ch.displayName="CodeBlock";const yq={base:{kMv6JI:"x9m5x89",kGuDYH:"xp03k98",kLWn49:"x15bjb6t",kWkggS:"xwmxj5m",kg3NbH:"x7a5moj",k8WAf4:"x1hp7d8q",kaIpWk:"xx3sua9",kHjlTd:"x1mzt3pk",kTgw9:"x13faqbe",$$css:!0}},vq={primary:{kMwMTN:"x1tgivj0",$$css:!0},secondary:{kMwMTN:"xv1l7n4",$$css:!0},inherit:{kMwMTN:"x1heor9g",$$css:!0}},kq={inherit:{kGuDYH:"x1qlqyl8",kLWn49:"x15bjb6t",$$css:!0}};function t5({children:e,color:t="primary",size:n,xstyle:s,className:r,style:i,ref:a,...l}){return o.jsx("code",{ref:a,...l,...ne(J("code",{color:t}),G(yq.base,vq[t],n&&kq[n],s),r,i),children:e})}t5.displayName="Code";const n5=h.createContext(null);n5.displayName="DialogContext";function bq(){return h.use(n5)}function wq(e,t=16){const n=e.getBoundingClientRect(),s=n.left+n.width/2-window.innerWidth/2,r=n.top+n.height/2-window.innerHeight/2,i=Math.sqrt(s*s+r*r)||1;return{x:Math.round(s/i*t),y:Math.round(r/i*t)}}const al={dialog:{kVAEAm:"xixxii4",kogj98:"x1bpp3o7",kmVPX3:"x1717udv",kWkggS:"x10xzikg","--_dialog-radius":"xvuvksw",kaIpWk:"xuacgfc",kGVxlE:"x1kcpxr7",k1xSpc:"x1s85apg",kXwgrk:"xdt5ytf",kZKoxP:"xg7h5cd",kZeWKH:"xish69e",kSiTet:"xg01cxk",k44tkh:"xqgcaz",kyAemX:"x128ha8g",kWV6AL:"xskzprw",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},open:{k1xSpc:"x78zum5",kSiTet:"x1hc1fzr",kKVMdj:"x1ewfqum x1aquc0h",$$css:!0},backdrop:{kGyWv1:"xnixb3f",kba3nw:"x1abwkk1",$$css:!0},fullscreen:{kzqmXN:"x1o6l61p",kZKoxP:"xtdtrs8",ks0D6T:"xlbgzzq",kskxy:"x1wj9ous",kaIpWk:"x2u8bby",kogj98:"x1ghz6dp",kpwlN0:"x10a8y8t",$$css:!0},inner:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUk6DE:"x12lumcd",kAzted:"x2lwn1j",kVQacm:"xb3r6kr",kaIpWk:"x1pjcqnp",$$css:!0},inlineWrapper:{kmVPX3:"x1717udv",kWkggS:"x10xzikg","--_dialog-radius":"xvuvksw",kaIpWk:"xuacgfc",kGVxlE:"x1kcpxr7",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kZKoxP:"xg7h5cd",kZeWKH:"xish69e",$$css:!0}},jq={ks0D6T:"x95b5qq",$$css:!0},Sq={kogj98:"x1ghz6dp",$$css:!0},Qm={sizing:(e,t)=>[jq,{kzqmXN:(typeof e=="number"?`${e}px`:e)!=null?"x5lhr3w":typeof e=="number"?`${e}px`:e,kskxy:(typeof t=="number"?`${t}px`:t)!=null?"x1jols5v":typeof t=="number"?`${t}px`:t,$$css:!0},{"--x-width":(n=>typeof n=="number"?n+"px":n??void 0)(typeof e=="number"?`${e}px`:e),"--x-maxHeight":(n=>typeof n=="number"?n+"px":n??void 0)(typeof t=="number"?`${t}px`:t)}],position:(e,t,n,s)=>[Sq,{k87sOh:e!=null?"xjbys53":e,kLqNvP:t!=null?"x1lxsm33":t,kt4wiu:n!=null?"xqxgn94":n,krVfgx:s!=null?"x1nqzi6q":s,$$css:!0},{"--x-top":(r=>typeof r=="number"?r+"px":r??void 0)(e),"--x-insetInlineStart":(r=>typeof r=="number"?r+"px":r??void 0)(t),"--x-insetInlineEnd":(r=>typeof r=="number"?r+"px":r??void 0)(n),"--x-bottom":(r=>typeof r=="number"?r+"px":r??void 0)(s)}]};function s0(e){return typeof e=="number"?`${e}px`:e}function Cq(e){const{top:t,bottom:n,start:s,end:r}=e;return{top:t!==void 0?s0(t):"auto",bottom:n!==void 0?s0(n):"auto",insetInlineStart:s!==void 0?s0(s):"auto",insetInlineEnd:r!==void 0?s0(r):"auto"}}function Us({isOpen:e,isInline:t=!1,onOpenChange:n,width:s=400,maxHeight:r="75vh",position:i,variant:a="standard",purpose:l="info",padding:c,children:u,xstyle:d,className:f,style:p,ref:x,...g}){const v=c==null,y=c??4,m=Rj[y],k=a==="fullscreen",b=h.useId(),j=h.useMemo(()=>({isInline:t,titleId:b}),[t,b]),A=g["aria-label"]!=null||g["aria-labelledby"]!=null,M=h.useRef(null),T=h.useCallback(L=>{if(M.current=L,!L||A)return;L.querySelector(`#${CSS.escape(b)}`)!=null?L.setAttribute("aria-labelledby",b):L.removeAttribute("aria-labelledby")},[b,A]),z=h.useRef(null),$=l!=="required",E=l==="info";h.useEffect(()=>{var H;if(t)return;const L=M.current;if(L)if(e){z.current=document.activeElement;const q=z.current;if(q&&q!==document.body){const U=wq(q);L.style.setProperty("--dialog-dir-x",`${U.x}px`),L.style.setProperty("--dialog-dir-y",`${U.y}px`)}else L.style.setProperty("--dialog-dir-x","0px"),L.style.setProperty("--dialog-dir-y","16px");if(!L.open){L.showModal();const U=L.querySelector("[data-autofocus]");U&&U.focus()}}else L.open&&L.close(),(H=z.current)==null||H.focus(),z.current=null},[e,t]),qS(e&&!t),h.useEffect(()=>{if(t)return;const L=M.current;if(!L||!e)return;const H=q=>{if(q.key==="Escape"){if(TS(q)||o6())return;q.preventDefault(),$&&n(!1)}};return L.addEventListener("keydown",H),()=>L.removeEventListener("keydown",H)},[e,t,$,n]);const N=h.useRef(!1);h.useEffect(()=>{var H;const L=((H=M.current)==null?void 0:H.querySelector(`#${CSS.escape(b)}`))!=null;e&&!t&&!A&&!L&&!N.current&&(N.current=!0,oc())},[e,t,A,b]);const _=L=>{L.target===L.currentTarget&&E&&n(!1)},R=L=>{L.preventDefault(),!o6()&&$&&n(!1)},B=o.jsx("div",{...G(al.inner,...VS(v?{useThemeDefault:"dialog",maxHeight:k?void 0:typeof r=="number"?`${r}px`:r}:{paddingInnerX:m,paddingInnerY:m,paddingOuterX:m,paddingOuterY:m,maxHeight:k?void 0:typeof r=="number"?`${r}px`:r}),!v&&y!==4&&Rd[y],!v&&y!==4&&Id[y],!v&&y!==4&&Ld[y],!v&&y!==4&&Od[y]),children:o.jsx(n5,{value:j,children:u})}),D=i!=null&&!k,{open:I,...O}=g;return t?e?o.jsx("div",{...O,...ne(J("dialog",{variant:a}),G(al.inlineWrapper,!k&&Qm.sizing(s,r),k&&al.fullscreen,d),f,p),"data-testid":g["data-testid"],children:B}):null:o.jsx("dialog",{ref:Ft(x,T),...O,...ne(J("dialog",{variant:a}),G(al.dialog,e&&al.open,al.backdrop,!k&&Qm.sizing(s,r),D&&(()=>{const L=Cq(i);return Qm.position(L.top,L.insetInlineStart,L.insetInlineEnd,L.bottom)})(),k&&al.fullscreen,d),f,p),onClick:_,onCancel:R,"aria-modal":"true",...l==="required"?{role:"alertdialog"}:void 0,children:B})}Us.displayName="Dialog";const Eq=h.lazy(async()=>jg(()=>Promise.resolve().then(()=>OS),void 0).then(e=>({default:e.Tooltip}))),$q={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"};function Jn({level:e,type:t,accessibilityLevel:n,color:s="primary",display:r="block",maxLines:i=0,hasTruncateTooltip:a=!0,wordBreak:l,textWrap:c,justify:u="start",hasCapsize:d=!1,hasStrikethrough:f=!1,xstyle:p,className:x,style:g,children:v,ref:y,...m}){const k=$q[e],b=n&&n!==e?{"aria-level":n}:{},j=l??(i===1?"break-all":"break-word"),A=i>0||d?"block":r,M=sS({maxLines:i}),T=typeof a=="string"?a:"above",z=i>0&&a!==!1&&M.isTruncated,$=h.useRef(null),E=i>1?{WebkitLineClamp:i}:void 0;return o.jsxs(o.Fragment,{children:[o.jsx(k,{ref:Ft(y,M.ref,$),...ne(J("heading",{level:e,color:s,...t&&{type:t}}),G(H4[rS(s)],t?q4[t]:fO[e],t&&Xj[t],i===1?ix.singleLine:i>1?ix.multiLine:Zj[A],i>0&&Yj[j],c&&Qj[c],u!=="start"&&tS[u],d&&Jj.enabled,f&&eS.strikethrough,p),x,{...g,...E}),title:z?M.fullText:void 0,...b,...m,children:v}),z&&o.jsx(h.Suspense,{fallback:null,children:o.jsx(Eq,{anchorRef:$,content:o.jsx("span",{...G(nS.content),children:M.fullText}),placement:T})})]})}Jn.displayName="Heading";const Aq={titleFocusable:{kI3sdo:"x1a2a7pz",$$css:!0}};function Hr({title:e,subtitle:t,onOpenChange:n,startContent:s,endContent:r,hasDivider:i,xstyle:a,className:l,style:c,ref:u,...d}){const f=ze(),p=h.useRef(null),x=bq(),g=(x==null?void 0:x.isInline)!==!0,v=x==null?void 0:x.titleId;return h.useEffect(()=>{g&&p.current&&p.current.focus()},[g]),o.jsx(sx,{ref:u,hasDivider:i,xstyle:a,className:l,style:c,...d,children:o.jsxs("div",{className:"x78zum5 x1cy8zhl x1qughib xjcht0a",children:[s&&o.jsx("div",{className:"x78zum5 x6s0dn4 x1txdalj x2lah0s",children:s}),o.jsxs("div",{className:"x98rzlu xeuugli xqixskq",children:[o.jsx(Jn,{ref:p,id:v,level:2,tabIndex:-1,xstyle:Aq.titleFocusable,children:e}),t&&o.jsx(K,{type:"body",size:"sm",color:"secondary",children:t})]}),(r||n)&&o.jsxs("div",{...{0:{className:"x78zum5 x6s0dn4 x1txdalj x2lah0s"},1:{className:"x78zum5 x6s0dn4 x1txdalj x2lah0s xhzvc8f x3kzqx6"}}[!!n<<0],children:[r,n&&o.jsx(Q,{variant:"ghost",label:f("@astryx.dialog.close"),tooltip:f("@astryx.dialog.close"),icon:o.jsx(Te,{icon:"close",color:"inherit"}),onClick:()=>{n==null||n(!1)},isIconOnly:!0})]})]})})}Hr.displayName="DialogHeader";const Mq={scrollable:{kVQacm:"xysyzu8",$$css:!0}};function s5({direction:e="vertical",hAlign:t,vAlign:n,justify:s,align:r,gap:i,padding:a,paddingInline:l,paddingBlock:c,isScrollable:u,width:d,height:f,maxWidth:p,minHeight:x,wrap:g,as:v="div",xstyle:y,className:m,style:k,children:b,ref:j,...A}){const M=t??(e==="horizontal"?s:r),T=n??(e==="horizontal"?r:s),z=e==="horizontal"?M:T,$=e==="horizontal"?T:M,E=l??a,N=c??a,_=G(...Ay({direction:e,crossAlign:$,mainAlign:z,gap:i,wrap:g}),E!=null&&bL[E],N!=null&&wL[N],u&&Mq.scrollable,y),R={...d!=null&&{width:typeof d=="number"?`${d}px`:d},...f!=null&&{height:typeof f=="number"?`${f}px`:f},...p!=null&&{maxWidth:typeof p=="number"?`${p}px`:p},...x!=null&&{minHeight:typeof x=="number"?`${x}px`:x}};return h.createElement(v,{ref:j,...ne(J("stack",{direction:e,gap:i,wrap:g}),_,m,{...k,...R}),...A},b)}s5.displayName="Stack";function ke({ref:e,justify:t,align:n,hAlign:s,vAlign:r,...i}){return o.jsx(s5,{...i,direction:"horizontal",hAlign:s??t,vAlign:r??n,ref:e})}ke.displayName="HStack";function re({ref:e,justify:t,align:n,hAlign:s,vAlign:r,...i}){return o.jsx(s5,{...i,direction:"vertical",hAlign:s??n,vAlign:r??t,ref:e})}re.displayName="VStack";const r0={footer:{kmuXW:"x2lah0s",$$css:!0},inner:{kB7OPa:"x9f619",ks0D6T:"xjl2t3p",kUOVxO:"xvueqy4",kZCmMZ:"x139j0dd",kwRFfy:"xpc6k2p",kLKAdn:"xqty4a",kGO01o:"xon7vh3","--container-padding-inline-start":"xdvaxxn","--container-padding-inline-end":"xqpvj4r","--container-padding-block-start":"xjmgx01","--container-padding-block-end":"x1xjq73n",$$css:!0},fullBleed:{kZCmMZ:"x1c1uobl",kwRFfy:"xyri2b",kLKAdn:"xexx8yu",kGO01o:"x18d9i69","--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0},divider:{kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"x1pc3f07",$$css:!0}},Tq={sizing:e=>[{kZKoxP:e!=null?"x16ye13r":e,$$css:!0},{"--x-height":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function el({children:e,hasDivider:t,height:n,label:s,padding:r,role:i,xstyle:a,className:l,style:c,ref:u,...d}){const f=h.use(yg),p=t??(f==null?void 0:f.defaultHasDividers)??!1,x=r===0;return o.jsx("div",{ref:u,role:i,"aria-label":s,"data-divider":p||void 0,...ne(J("layout-footer"),G(r0.footer,Tq.sizing(n??null),p&&r0.divider,a),l,c),...d,children:o.jsx("div",{...G(r0.inner,x&&r0.fullBleed,r!=null&&Rd[r],r!=null&&Id[r],r!=null&&Ld[r],r!=null&&Od[r]),children:e})})}el.displayName="LayoutFooter";const iC=h.createContext({direction:"vertical"});iC.displayName="FormLayoutContext";const Jm={container:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",$$css:!0},containerGap:{kOIVth:"xzye2dw",$$css:!0},horizontalLabels:{k1xSpc:"xjp7ctv",$$css:!0}},zq={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function _c({label:e,isLabelHidden:t=!1,description:n,inputID:s,labelID:r,isGroupLabel:i=!1,descriptionID:a,isOptional:l=!1,isRequired:c=!1,isDisabled:u=!1,labelIcon:d,status:f,labelTooltip:p,statusVariant:x="attached",width:g,xstyle:v,children:y,className:m,style:k,ref:b,...j}){const{direction:A}=h.use(iC),M=A==="horizontal-labels",T=a??(n?`${s}-desc`:void 0),z=(f==null?void 0:f.messageID)??(f!=null&&f.message?`${s}-status`:void 0);Hd("Field","isOptional and isRequired are mutually exclusive. isOptional takes precedence.",l&&c);const $=o.jsx(Ag,{label:e,inputID:s,labelID:r,isGroupLabel:i,isLabelHidden:t,isDisabled:u,isOptional:l,isRequired:c,labelIcon:d,labelTooltip:p,description:M?void 0:n,descriptionID:M?void 0:T}),E=f!=null&&f.message&&x!=="tooltip"?o.jsx(jh,{type:f.type,message:f.message,id:z,variant:x}):null;return M?o.jsxs("div",{ref:b,...ne(J("field",{layout:"horizontal-labels"}),G(Jm.horizontalLabels,v),m,k),...j,children:[o.jsx("div",{className:"x1enrzb7",children:$}),o.jsxs("div",{className:"x78zum5 xdt5ytf xc8icb0",children:[n&&o.jsx(K,{type:"supporting",display:"block",id:T,children:n}),y,E]})]}):o.jsxs("div",{ref:b,...ne(J("field"),G(Jm.container,!t&&Jm.containerGap,g!=null&&zq.width(g),v),m,k),...j,children:[$,x==="attached"?o.jsxs("div",{className:"x78zum5 xdt5ytf xc8icb0",children:[y,E]}):o.jsxs(o.Fragment,{children:[y,E]})]})}_c.displayName="Field";const Fa={base:{kB7OPa:"x9f619",kVAEAm:"x1n2onr6",kY2c9j:"x1vjfegm",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kVAM5u:"xvy26l8 x6q1khz","--_field-radius":"x1832zxr",kaIpWk:"xvdfih8",kWkggS:"x10xzikg",k1ekBW:"x12zzom9",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kGVxlE:"x1gnnqk1 x12y27fx xuihb5h",kI3sdo:"x1a2a7pz",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",kVAM5u:"xvy26l8",kGVxlE:"x1gnnqk1",$$css:!0}},Rg={warning:{kVAM5u:"x8wg1ba",$$css:!0},error:{kVAM5u:"x1ofxpqo",$$css:!0},success:{kVAM5u:"x16m2moy",$$css:!0}},Ig={warning:{kGVxlE:"x1gnnqk1 xnoa3fc",$$css:!0},error:{kGVxlE:"x1gnnqk1 xl68szm",$$css:!0},success:{kGVxlE:"x1gnnqk1 xig9bu2",$$css:!0}},oC={warning:{kVAM5u:"x8wg1ba xa1yw2k",$$css:!0},error:{kVAM5u:"x1ofxpqo xk2sxw7",$$css:!0},success:{kVAM5u:"x16m2moy xyq33ac",$$css:!0}},r5={inGroup:{kUk6DE:"x98rzlu",k7Eaqz:"xeuugli",kZKoxP:"x5yr21d",keTefX:"xd10s4z x1pwwqoy",krdFHd:"x15mokao x8eehn2",kVL7Gh:"xbiv7yw x1xrp5p4",kfmiAY:"x1ga7v0g x11xp8u1 xpufgd0 x1ir7nn6",kT0f0o:"x16uus16 x747jw7 xxd14kb x1vej5at",kXnDq0:"x1rm9qnc",$$css:!0}},aC=h.createContext(null);aC.displayName="InputGroupContext";function i5(){return h.use(aC)}const Nq={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}};function st({type:e="text",label:t,isLabelHidden:n=!1,description:s,isOptional:r=!1,isRequired:i=!1,isDisabled:a=!1,disabledMessage:l,startIcon:c,status:u,statusVariant:d="attached",size:f,onChange:p,changeAction:x,isLoading:g=!1,value:v,placeholder:y,labelTooltip:m,hasClear:k=!1,hasAutoFocus:b=!1,htmlName:j,onEnter:A,onKeyDown:M,width:T,xstyle:z,className:$,style:E,ref:N,..._}){const R=ze(),B=Qa(f,"md"),D=h.useId(),I=h.useId(),O=h.useId(),L=h.useId(),H=h.useRef(null),q=h.useRef(null),U=i5(),[,X]=h.useTransition(),[Z,ie]=h.useOptimistic(v),ae=g||Z!==v,xe=a&&!!l,fe=Ss({placement:"above",focusTrigger:"always",isEnabled:xe}),{statusIcon:se,describedBy:ye}=US({status:u,statusVariant:d,isInGroup:!!U}),{ariaLabelledBy:me,ariaDescribedBy:P}=I4(I,[s?O:null,!U&&d!=="tooltip"&&(u!=null&&u.message)?L:null,ye,xe?fe.describedBy:null],U),V=ce=>{if(a)return;const ge=ce.target.value;p==null||p(ge,ce),x&&!ce.defaultPrevented&&X(async()=>{ie(ge),await x(ge,ce)})},Y=h.useCallback(()=>{var ce;p==null||p("",null),(ce=H.current)==null||ce.focus()},[p]),{onClick:oe,onMouseUp:F}=Y4({containerRef:q,inputRef:H,disabled:a}),le=o.jsxs("div",{ref:ce=>{q.current=ce,fe.ref(ce)},onClick:oe,onMouseUp:F,...ne(J("text-input",{size:B,status:(u==null?void 0:u.type)??null}),G(Fa.base,Nq[B],a&&Fa.disabled,u&&Rg[u.type],u&&!a&&Ig[u.type],u&&oC[u.type],U&&r5.inGroup,z),$,E),children:[c&&Lr(c,{size:"sm",color:"secondary"}),U&&o.jsx(Gi,{id:I,children:t}),o.jsx("input",{..._,ref:Ft(N,H),id:D,name:j,type:e,value:Z,onChange:V,onKeyDown:A||M?ce=>{ce.key==="Enter"&&(A==null||A()),M==null||M(ce)}:void 0,placeholder:y,disabled:a&&!xe,"aria-disabled":xe?"true":void 0,readOnly:xe||void 0,autoFocus:b,"data-autofocus":b||void 0,"aria-describedby":P,"aria-required":i===!0?"true":void 0,"aria-invalid":(u==null?void 0:u.type)==="error"?"true":void 0,"aria-busy":ae||void 0,"aria-labelledby":me,...{0:{className:"x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5"},1:{className:"x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5 x1h6gzvc"}}[!!a<<0]}),k&&v!==""&&!a&&o.jsx("button",{type:"button",onClick:Y,"aria-label":R("@astryx.textInput.clearLabel",{label:t}),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:o.jsx(Te,{icon:"close",size:"sm",color:"secondary"})}),ae&&o.jsx(Vt,{size:"sm"}),se]});return U?o.jsxs(o.Fragment,{children:[le,xe&&fe.renderTooltip(l)]}):o.jsxs(_c,{label:t,isLabelHidden:n,description:s,inputID:D,descriptionID:s?O:void 0,isOptional:r,isRequired:i,isDisabled:a,status:u?{type:u.type,message:u.message,messageID:u.message?L:void 0}:void 0,statusVariant:d,labelTooltip:m,width:T,children:[le,xe&&fe.renderTooltip(l)]})}st.displayName="TextInput";function lx(e){return typeof e=="string"?!0:!("type"in e)}function Hy(e){return typeof e=="object"&&"type"in e&&e.type==="divider"}function cx(e){return typeof e=="object"&&"type"in e&&e.type==="section"}function Sa(e){return typeof e=="string"?{value:e,label:e}:{...e,label:e.label??e.value}}function lC(e){const t=[];for(const n of e)if(lx(n))t.push(Sa(n));else if(cx(n))for(const s of n.options)t.push(Sa(s));return t}function _q({isOpen:e,selectedItemIndex:t,listboxId:n,listboxRef:s,triggerRef:r}){const[i,a]=h.useState(0),[l,c]=h.useState(!1),u=h.useCallback((d,f)=>{a(d),c(f)},[]);return Bi(()=>{if(!e){u(0,!1);return}if(!s.current||!r.current){u(0,!0);return}const d=t>=0?t:0,f=`${n}-item-${d}`,p=document.getElementById(f);if(!p){u(0,!0);return}const x=s.current.getBoundingClientRect(),g=p.getBoundingClientRect(),v=r.current.getBoundingClientRect(),y=x.height;if(y<=0){u(0,!0);return}const m=g.top-x.top+g.height/2,b=v.top+v.height/2-m,j=window.innerHeight,A=Math.max(0,j-y),M=Math.min(Math.max(b,0),A),T=Math.max(0,v.bottom-M);u(T,!0)},[e,t,n,s,r,u]),{offset:i,isPositioned:l}}function Rq({selectableItems:e,value:t,isDisabled:n=!1,isOpen:s,hasSearch:r=!1,onOpen:i,onClose:a,onSelect:l,onClear:c,listboxId:u}){const[d,f]=h.useState(-1),[p,x]=h.useState(""),g=h.useRef(void 0),v=h.useCallback(T=>`${u}-item-${T}`,[u]),y=h.useCallback(()=>e.map((T,z)=>T.disabled?-1:z).filter(T=>T>=0),[e]),m=h.useCallback(()=>e.findIndex(T=>T.value===t),[e,t]),k=h.useCallback(()=>{f(-1),a()},[a]),b=h.useCallback(T=>{T.disabled||(l==null||l(T.value),k())},[l,k]),j=h.useCallback(()=>{if(!n){if(s)k();else if(i(),!r){const T=m();f(T>=0?T:0)}}},[n,s,i,k,m,r]),A=h.useCallback((T,z)=>{T.disabled||f(z)},[]),M=h.useCallback(T=>{if(n)return;const z=y();switch(T.key){case"ArrowDown":if(T.preventDefault(),!s)i(),f(0);else{const $=z.indexOf(d),E=Math.min($+1,z.length-1);f(z[E]??d)}break;case"ArrowUp":if(T.preventDefault(),!s)i(),f(e.length-1);else{const $=z.indexOf(d),E=Math.max($-1,0);f(z[E]??d)}break;case" ":if(r)break;case"Enter":if(T.preventDefault(),s&&d>=0){const $=e[d];$&&!$.disabled&&b($)}else if(!s&&(i(),!r)){const $=m();f($>=0?$:0)}break;case"Escape":s&&(T.preventDefault(),k());break;case"Tab":s&&k();break;case"Home":T.preventDefault(),s&&z.length>0&&f(z[0]);break;case"End":T.preventDefault(),s&&z.length>0&&f(z[z.length-1]);break;case"PageUp":T.preventDefault(),s&&z.length>0&&f(z[0]);break;case"PageDown":T.preventDefault(),s&&z.length>0&&f(z[z.length-1]);break;case"Delete":case"Backspace":!r&&!s&&c!=null&&t!=null&&(T.preventDefault(),c());break;default:if(!r&&T.key.length===1&&!T.ctrlKey&&!T.metaKey){const $=p+T.key.toLowerCase();x($),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{x("")},500);const E=e.findIndex(N=>{var _;return!N.disabled&&((_=N.label)==null?void 0:_.toLowerCase().startsWith($))});E>=0&&(s||i(),f(E))}break}},[n,s,i,k,e,d,b,m,y,p,r,c,t]);return{highlightedIndex:d,setHighlightedIndex:f,getItemId:v,onTriggerClick:j,onKeyDown:M,onItemSelect:b,onItemMouseEnter:A}}const Iq={root:{k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kaIpWk:"x2u8bby",$$css:!0}};function cC({icon:e,label:t,description:n,endContent:s,xstyle:r,className:i,style:a}){return o.jsx(qd,{startContent:e?Lr(e,{size:"sm",color:"secondary"}):void 0,label:t,description:n,endContent:s,xstyle:[Iq.root,r],...ne(J("selector-option"),{className:i,style:a})})}cC.displayName="SelectorOption";const Vr={triggerContainer:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kOIVth:"x1txdalj",kzqmXN:"xh8yej3",k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kMv6JI:"x9ynric",kGuDYH:"xcr08ib xdk3u5w",kLWn49:"x1kq96og",kMwMTN:"x1tgivj0",kkrTdU:"x1ypdohk",$$css:!0},triggerPlaceholder:{kMwMTN:"xv1l7n4",$$css:!0},triggerGhost:{kzqmXN:"x14atkfc",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kKwaWg:"x1ilzqfv xq8i9tn",kGVxlE:"x1gnnqk1 x1irk71m x15ysqaf",k63SB2:"x1e4wzip",kI3sdo:"x1a2a7pz x1irc7jg",kInvED:"x1wfwxd8 xscfbxq",k1ekBW:"xrafxwg",k3aq6I:"x3oybdh xk4oym4",$$css:!0},triggerGhostDisabled:{kKwaWg:"x18o3ruo",k3aq6I:"x1c071of x1pdlv7q",$$css:!0},popover:{k7Eaqz:"xrzjruh",$$css:!0},sectionDivider:{kqGvvJ:"xsq74q5",$$css:!0},divider:{kqGvvJ:"xsq74q5",$$css:!0},item:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kOIVth:"x1txdalj",kzqmXN:"xh8yej3",kmVPX3:"xlsj2fj",kaIpWk:"xh6dtrn",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kMwMTN:"x1tgivj0",kWkggS:"xjbqb8w",kkrTdU:"x1ypdohk",k9WMMc:"x1yc453h",kI3sdo:"x1a2a7pz",$$css:!0},itemHighlighted:{kWkggS:"x1lmrjuc",$$css:!0},itemSelected:{k63SB2:"x1e4wzip",$$css:!0},itemDisabled:{kSiTet:"xbyyjgo",kkrTdU:"x1h6gzvc",$$css:!0}},Lq={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},Oq={sm:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},md:{k8WAf4:"x1vofgu7",$$css:!0},lg:{$$css:!0}},E6={warning:"warning",error:"error",success:"success"},$6={warning:"warning",error:"error",success:"success"},Dq={warning:"@astryx.input.statusButton.warning",error:"@astryx.input.statusButton.error",success:"@astryx.input.statusButton.success"};function Bq({option:e}){return o.jsx(cC,{icon:e.icon,label:e.label??e.value})}function qy(e,t){return t?(e.label??e.value).toLowerCase().includes(t.toLowerCase()):!0}function A6(e,t){return t?e.filter(n=>qy(n,t)):e}function xc(e){const t=ze(),{label:n,isLabelHidden:s=!1,description:r,isOptional:i=!1,isRequired:a=!1,isDisabled:l=!1,disabledMessage:c,options:u,value:d,onChange:f,changeAction:p,isLoading:x=!1,placeholder:g,size:v,variant:y="input",status:m,statusVariant:k="attached",labelTooltip:b,startIcon:j,htmlName:A,renderOption:M,hasSearch:T=!1,searchPlaceholder:z,placement:$,isDefaultOpen:E=!1,"data-testid":N,width:_,xstyle:R,className:B,style:D,hasClear:I,...O}=e,L=g??t("@astryx.selector.placeholder"),H=z??t("@astryx.selector.searchPlaceholder"),q=I===!0,U=Qa(v,"md"),X=y==="ghost"&&k==="attached"?"detached":k,Z=d===null?void 0:d,ie=h.useId(),ae=h.useId(),xe=h.useId(),fe=h.useId(),se=h.useId(),ye=h.useId(),me=h.useRef(null),P=h.useRef(null),V=i5(),[Y,oe]=h.useState(""),F=Y.length>0,[,le]=h.useTransition(),[ce,ge]=h.useOptimistic(Z),ve=x||ce!==Z,pe=l&&!!c,Ve=Ss({placement:"above",focusTrigger:"always",isEnabled:pe}),Ye=Ss({placement:"above",isEnabled:X==="tooltip"&&!!(m!=null&&m.message)}),{ariaLabelledBy:ot,ariaDescribedBy:at}=I4(se,[r?xe:null,!V&&X!=="tooltip"&&(m!=null&&m.message)?fe:null,X==="tooltip"&&(m!=null&&m.message)?Ye.describedBy:null,pe?Ve.describedBy:null],V),Mt=h.useMemo(()=>lC(u),[u]),Dn=h.useMemo(()=>A6(Mt,Y),[Mt,Y]),nt=h.useMemo(()=>Mt.findIndex(Se=>Se.value===ce),[Mt,ce]),Tt=h.useMemo(()=>nt>=0?Mt[nt]:void 0,[Mt,nt]),wn=h.useRef(null),Ms=Nc(),Fs=h.useCallback(()=>{var Se;oe(""),Ms(""),(Se=me.current)==null||Se.focus()},[Ms]),yt=zc({onHide:Fs,hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none"});h.useEffect(()=>{E&&yt.show()},[]);const jt=h.useCallback(Se=>{if(oe(Se),Se.length===0){Ms("");return}const It=A6(Mt,Se).length;Ms(It===0?"No results found":`${It} result${It===1?"":"s"}`)},[Ms,Mt]),Fe=$==null&&!T,{offset:ai,isPositioned:Ts}=_q({isOpen:yt.isOpen&&Fe,selectedItemIndex:nt,listboxId:ae,listboxRef:wn,triggerRef:me}),Ho=Fe?ai:0,zs=Fe?Ts:!0,Bn=$??"below",Pr=Ho>0?{marginBlockStart:`-${Ho}px`}:void 0,Yi=h.useCallback(()=>{f==null||f(null),p&&le(async()=>{ge(void 0),await p(null)})},[f,p,le,ge]),{highlightedIndex:jn,getItemId:Ns,onTriggerClick:Sn,onKeyDown:tn,onItemSelect:es,onItemMouseEnter:li}=Rq({selectableItems:Dn,value:Z,isDisabled:l,isOpen:yt.isOpen,hasSearch:T,onOpen:h.useCallback(()=>{yt.show(),T&&requestAnimationFrame(()=>{var Se;(Se=P.current)==null||Se.focus()})},[yt,T]),onClose:yt.hide,onSelect:h.useCallback(Se=>{f==null||f(Se),p&&le(async()=>{ge(Se),await p(Se)})},[f,p,le,ge]),onClear:q?Yi:void 0,listboxId:ae});h.useEffect(()=>{var Se,It;!yt.isOpen||jn<0||(It=(Se=document.getElementById(Ns(jn)))==null?void 0:Se.scrollIntoView)==null||It.call(Se,{block:"nearest"})},[yt.isOpen,jn,Ns]);const Vs=h.useCallback(Se=>{Se.stopPropagation(),Yi()},[Yi]),ci=h.useCallback(()=>T?o.jsx("div",{className:"x78zum5 x6s0dn4 xf314gf xu0wf1k",onKeyDown:Se=>{Se.target!==P.current&&Se.key==="Tab"&&!Se.shiftKey&&tn(Se)},children:o.jsx(st,{ref:P,id:ye,label:t("@astryx.selector.searchOptions"),isLabelHidden:!0,startIcon:"search",hasClear:!0,size:"sm",width:"100%",role:"combobox","aria-expanded":yt.isOpen,"aria-controls":ae,"aria-autocomplete":"list","aria-activedescendant":yt.isOpen&&jn>=0?Ns(jn):void 0,value:Y,onChange:jt,onKeyDown:Se=>{if(Se.key==="ArrowDown"||Se.key==="ArrowUp"||Se.key==="PageUp"||Se.key==="PageDown"||Se.key==="Enter"||Se.key==="Escape"){tn(Se);return}Se.key==="Tab"&&(Se.shiftKey||!F)&&tn(Se)},placeholder:H})}):null,[T,ye,ae,Y,F,H,jt,tn,yt.isOpen,jn,Ns,t]),hs=h.useCallback((Se,It)=>{const ts=It===jn,he=Se.value===Z;return o.jsxs("div",{id:Ns(It),role:"option","aria-selected":he,"aria-disabled":Se.disabled,onClick:()=>es(Se),onMouseEnter:()=>li(Se,It),...G(Vr.item,Oq[U],ts&&Vr.itemHighlighted,he&&Vr.itemSelected,Se.disabled&&Vr.itemDisabled),children:[o.jsx("span",{className:"x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli",children:M?M(Se):o.jsx(Bq,{option:Se})}),he&&o.jsx(Te,{icon:"check",size:"sm",color:"accent"})]},Se.value)},[M,jn,U,Z,Ns,es,li]),ui=h.useCallback(()=>{const Se=T&&!!Y;if(Se&&Dn.length===0)return[o.jsx("div",{role:"presentation",className:"x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib",children:"No results found"},"empty")];let It=0;const ts=[];for(let he=0;he<u.length;he++){const ee=u[he];if(Hy(ee)){if(Se)continue;ts.push(o.jsx(Na,{xstyle:Vr.divider},`divider-${he}`))}else if(cx(ee)){const je=[];for(const te of ee.options){const we=Sa(te);Se&&!qy(we,Y)||(je.push(hs(we,It)),It++)}if(je.length===0)continue;ee.title&&ts.push(o.jsx(Na,{label:ee.title,xstyle:Vr.sectionDivider},`section-divider-${he}`)),ts.push(o.jsx("div",{role:"group","aria-label":ee.title,children:je},`section-${he}`))}else if(lx(ee)){const je=Sa(ee);if(Se&&!qy(je,Y))continue;ts.push(hs(je,It)),It++}}return ts},[u,hs,T,Y,Dn]),Ur=m!=null&&X!=="detached",Gs=m!=null&&X==="tooltip"&&!!m.message,di=o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:Se=>{yt.triggerRef(Se),Ve.ref(Se)},onClick:Sn,"data-testid":N,...ne(J("selector",{variant:y,size:U,status:(m==null?void 0:m.type)??null}),G(Fa.base,Vr.triggerContainer,Lq[U],y==="ghost"&&Vr.triggerGhost,l&&Fa.disabled,y==="ghost"&&l&&Vr.triggerGhostDisabled,!Tt&&Vr.triggerPlaceholder,y!=="ghost"&&m&&Rg[m.type],y!=="ghost"&&m&&!l&&Ig[m.type],y!=="ghost"&&V&&r5.inGroup,R),B,D),children:[j&&Lr(j,{size:"sm",color:"secondary"}),V&&o.jsx(Gi,{id:se,children:n}),o.jsx("button",{ref:me,id:ie,type:"button",role:T?void 0:"combobox",...O,"aria-haspopup":"listbox","aria-expanded":yt.isOpen,"aria-controls":ae,"aria-activedescendant":!T&&yt.isOpen&&jn>=0?Ns(jn):void 0,"aria-describedby":at,"aria-labelledby":ot,"aria-required":a?"true":void 0,"aria-invalid":(m==null?void 0:m.type)==="error"?"true":void 0,"aria-busy":ve||void 0,disabled:l&&!pe,"aria-disabled":pe?"true":void 0,onKeyDown:tn,tabIndex:l&&!pe?-1:0,className:"x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x1a2a7pz",children:o.jsx("span",{className:"x1iyjqo2 xeuugli xb3r6kr xlyipyv xuxw1ft x1yc453h",children:(Tt==null?void 0:Tt.label)??L})}),A!=null&&o.jsx("input",{type:"hidden",name:A,value:d??"",disabled:l}),ve&&o.jsx(Vt,{size:"sm"}),q&&d!=null&&!l&&o.jsx("button",{type:"button",onClick:Vs,"aria-label":t("@astryx.selector.clearLabel",{label:n}),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:o.jsx(Te,{icon:"close",size:"sm",color:"secondary",...J("selector-clear-icon")})}),o.jsx("span",{...{0:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike"},2:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0"},1:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike xq2gx43"},3:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0 xq2gx43"}}[!!(!Ur&&yt.isOpen)<<1|!!Ur<<0],children:Ur?Gs?o.jsx("button",{ref:Ye.ref,type:"button","aria-label":t(Dq[m.type]),"aria-describedby":Ye.describedBy,onClick:Se=>Se.stopPropagation(),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:o.jsx(Te,{icon:E6[m.type],size:"sm",color:$6[m.type]})}):o.jsx(Te,{icon:E6[m.type],size:"sm",color:$6[m.type]}):o.jsx(Te,{icon:"chevronDown",size:"sm",color:"inherit",...J("selector-indicator-icon",{state:yt.isOpen?"expanded":"collapsed"})})})]}),yt.render(T?o.jsxs("div",{children:[ci(),o.jsx("div",{ref:wn,id:ae,role:"listbox","aria-labelledby":ie,className:"x9f619 xuyqlj2 x1odjw0f x9epnlk x1hc1fzr x1ey1afo",children:ui()})]}):o.jsx("div",{ref:wn,id:ae,role:"listbox","aria-labelledby":ie,...{0:{className:"x9f619 xuyqlj2 x1odjw0f x9epnlk x1hc1fzr x1ey1afo"},1:{className:"x9f619 xuyqlj2 x1odjw0f x9epnlk xg01cxk xq2gx43"}}[!zs<<0],children:ui()}),{placement:Bn,alignment:"start",xstyle:[Vr.popover,wo[Bn]],style:Pr}),Gs&&Ye.renderTooltip((m==null?void 0:m.message)??""),pe&&Ve.renderTooltip(c)]});return V?di:o.jsx(_c,{label:n,isLabelHidden:s,description:r,inputID:ie,descriptionID:r?xe:void 0,isOptional:i,isRequired:a,isDisabled:l,status:m?{type:m.type,message:m.message,messageID:m.message?fe:void 0}:void 0,statusVariant:X,labelTooltip:b,width:_,children:di})}xc.displayName="Selector";var uC={exports:{}},fs={};/**
|
|
139
|
-
* @license React
|
|
140
|
-
* react-dom.production.js
|
|
141
|
-
*
|
|
142
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the MIT license found in the
|
|
145
|
-
* LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/var Hq=h;function dC(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 Vo(){}var ws={d:{f:Vo,r:function(){throw Error(dC(522))},D:Vo,C:Vo,L:Vo,m:Vo,X:Vo,S:Vo,M:Vo},p:0,findDOMNode:null},qq=Symbol.for("react.portal"),Pq=Symbol.for("react.recoverable"),M6=Symbol.for("react.optimistic_key");function Uq(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qq,key:s==null?null:s===M6?M6:""+s,children:e,containerInfo:t,implementation:n}}var Qf=Hq.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Lg(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}fs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ws;fs.browser=function(e){return{$$typeof:Pq,_reason:e}};fs.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(dC(299));return Uq(e,t,null,n)};fs.flushSync=function(e){var t=Qf.T,n=ws.p;try{if(Qf.T=null,ws.p=2,e)return e()}finally{Qf.T=t,ws.p=n,ws.d.f()}};fs.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,ws.d.C(e,t))};fs.prefetchDNS=function(e){typeof e=="string"&&ws.d.D(e)};fs.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,s=Lg(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?ws.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:i}):n==="script"&&ws.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};fs.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Lg(t.as,t.crossOrigin);ws.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==null&&ws.d.M(e)};fs.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,s=Lg(n,t.crossOrigin);ws.d.L(e,n,{crossOrigin:s,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})}};fs.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Lg(t.as,t.crossOrigin);ws.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 ws.d.m(e)};fs.requestFormReset=function(e){ws.d.r(e)};fs.unstable_batchedUpdates=function(e,t){return e(t)};fs.useFormState=function(e,t,n){return Qf.H.useFormState(e,t,n)};fs.useFormStatus=function(){return Qf.H.useHostTransitionStatus()};fs.version="19.3.0";function fC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fC)}catch(e){console.error(e)}}fC(),uC.exports=fs;var b1=uC.exports;const T6={popoverSurface:{k7Eaqz:"xfb3i0g",$$css:!0},popoverGap:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0}};function Fq(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);if(!n.collapsed||!e.contains(n.startContainer))return null;const s=n.startContainer;return s.nodeType===Node.TEXT_NODE?(s.textContent??"").slice(0,n.startOffset):null}function Vq(e,t){for(let n=e.length-1;n>=0;n--){const s=e[n];if(s===" "||s===`
|
|
147
|
-
`)return null;for(const r of t)if(s===r.character){const i=n>0?e[n-1]:null;if(i===null||i===" "||i===`
|
|
148
|
-
`){const a=e.slice(n+1);return{trigger:r,query:a,triggerStart:n}}}}return null}function Gq(e,t){const n=window.getSelection();if(!n||n.rangeCount===0)return;const s=n.getRangeAt(0),r=s.startContainer;if(r.nodeType!==Node.TEXT_NODE)return;const i=r.textContent??"",a=s.startOffset,l=i.slice(0,t),c=i.slice(a);r.textContent=l+c;const u=document.createRange();u.setStart(r,t),u.collapse(!0),n.removeAllRanges(),n.addRange(u)}function Wq(e){const t=ze(),{triggers:n,editableRef:s,onInsertToken:r,onInsertText:i,onEmitChange:a,debounceMs:l=150}=e,c=h.useId(),[u,d]=h.useState({isActive:!1,activeTrigger:null,query:"",items:[],highlightedIndex:0,isLoading:!1}),f=h.useRef(-1),p=h.useRef(null),x=h.useRef(null),g=h.useCallback(()=>{x.current&&(x.current.remove(),x.current=null)},[]),v=zc({onHide:h.useCallback(()=>{g(),d(E=>({...E,isActive:!1,activeTrigger:null,query:"",items:[],highlightedIndex:0,isLoading:!1}))},[g]),hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none"});h.useEffect(()=>()=>{p.current&&clearTimeout(p.current),g()},[g]);const y=h.useCallback(()=>{var N,_;p.current&&(clearTimeout(p.current),p.current=null);const E=u.activeTrigger;E!=null&&E.searchSource&&((_=(N=E.searchSource).cancel)==null||_.call(N)),g(),v.hide(),f.current=-1},[v,u.activeTrigger,g]),m=h.useCallback(()=>{const E=s.current;if(!E)return;const N=window.getSelection();if(!N||N.rangeCount===0){v.triggerRef(E);return}g();const _=N.getRangeAt(0).cloneRange();_.collapse(!0);const R=typeof _.getBoundingClientRect=="function"?_.getBoundingClientRect():null;if(!R||R.width===0&&R.height===0&&R.top===0&&R.left===0){v.triggerRef(E);return}const B=document.createElement("span");B.setAttribute("aria-hidden","true"),B.setAttribute("data-astryx-trigger-anchor",""),B.style.position="fixed",B.style.left=`${R.left}px`,B.style.top=`${R.top}px`,B.style.width=`${Math.max(R.width,1)}px`,B.style.height=`${R.height}px`,B.style.pointerEvents="none",B.style.opacity="0",document.body.appendChild(B),x.current=B,v.triggerRef(B)},[s,v,g]),k=h.useCallback((E,N)=>{p.current&&(clearTimeout(p.current),p.current=null);const _=()=>{var R,B;if(E.searchSource){(B=(R=E.searchSource).cancel)==null||B.call(R),d(I=>({...I,isLoading:!0}));const D=E.searchSource.search(N);Promise.resolve(D).then(I=>{d(O=>({...O,items:I,highlightedIndex:I.length>0?0:-1,isLoading:!1}))},()=>{d(I=>({...I,items:[],highlightedIndex:-1,isLoading:!1}))})}};E.searchSource&&(E.searchSource.search("")instanceof Promise&&l>0?(d(D=>({...D,isLoading:!0})),p.current=setTimeout(_,l)):_())},[l]),b=h.useCallback(E=>{const N=u.activeTrigger;if(!N)return;const _=s.current;if(!_)return;g(),Gq(_,f.current);const R=N.onSelect(E);typeof R=="string"?i(R):r(R),a(),y()},[u.activeTrigger,s,g,i,r,a,y]),j=h.useCallback(()=>{if(!n||n.length===0)return;const E=s.current;if(!E)return;const N=Fq(E);if(N===null){u.isActive&&y();return}const _=Vq(N,n);if(!_){u.isActive&&y();return}const{trigger:R,query:B,triggerStart:D}=_;!u.isActive||u.activeTrigger!==R?(f.current=D,d(I=>({...I,isActive:!0,activeTrigger:R,query:B,highlightedIndex:0})),m(),k(R,B),v.show()):u.query!==B&&(d(I=>({...I,query:B})),k(R,B))},[n,s,u.isActive,u.activeTrigger,u.query,y,m,k,v]),A=h.useCallback(E=>{if(!u.isActive||!v.isOpen)return!1;switch(E.key){case"ArrowDown":return E.preventDefault(),d(N=>({...N,highlightedIndex:N.highlightedIndex<N.items.length-1?N.highlightedIndex+1:0})),!0;case"ArrowUp":return E.preventDefault(),d(N=>({...N,highlightedIndex:N.highlightedIndex>0?N.highlightedIndex-1:N.items.length-1})),!0;case"Enter":case"Tab":return u.highlightedIndex>=0&&u.highlightedIndex<u.items.length?(E.preventDefault(),b(u.items[u.highlightedIndex]),!0):!1;case"Escape":return E.preventDefault(),y(),!0;default:return!1}},[u.isActive,u.highlightedIndex,u.items,v.isOpen,b,y]),M=h.useCallback(E=>`${c}-option-${E}`,[c]);h.useEffect(()=>{if(!v.isOpen||u.highlightedIndex<0)return;const E=document.getElementById(M(u.highlightedIndex));E==null||E.scrollIntoView({block:"nearest"})},[u.highlightedIndex,v.isOpen,M]);const z=((n==null?void 0:n.length)??0)>0?u.isActive&&v.isOpen?{role:"combobox","aria-expanded":!0,"aria-controls":c,"aria-activedescendant":u.highlightedIndex>=0?M(u.highlightedIndex):void 0,"aria-haspopup":"listbox"}:{role:"combobox","aria-expanded":!1,"aria-haspopup":"listbox"}:{role:"textbox"},$=h.useCallback(()=>{const E=u.activeTrigger,N=(E==null?void 0:E.emptySearchResultsText)??"No results",_=(E==null?void 0:E.loadingText)??"Searching…";let R;if(u.isLoading)R=o.jsx("div",{role:"status",className:"x1b2ylru x2b8uid x141an7d xv1l7n4",children:_});else if(u.items.length===0&&u.isActive)R=o.jsx("div",{className:"x1b2ylru x2b8uid x141an7d xv1l7n4",children:N});else{const B=cL(u.items);let D=0;R=B.map(I=>{const O=I.items.map(L=>{const H=D++;return o.jsx("div",{id:M(H),role:"option","aria-selected":H===u.highlightedIndex,tabIndex:-1,onMouseDown:q=>{q.preventDefault(),b(L)},onMouseEnter:()=>d(q=>({...q,highlightedIndex:H})),...{0:{className:"x9f619 x78zum5 x6s0dn4 xh8yej3 xlsj2fj xh6dtrn x1ypdohk x1a2a7pz xjbqb8w x1yc453h x9ynric xjm74w1 xw6l6zx x1tgivj0"},1:{className:"x9f619 x78zum5 x6s0dn4 xh8yej3 xlsj2fj xh6dtrn x1ypdohk x1a2a7pz x1yc453h x9ynric xjm74w1 xw6l6zx x1tgivj0 x1lmrjuc"}}[(H===u.highlightedIndex)<<0],children:E!=null&&E.renderItem?E.renderItem(L):o.jsx("span",{className:"x98rzlu xeuugli xb3r6kr xlyipyv xuxw1ft",children:L.label})},L.id)});return I.heading?o.jsxs("div",{role:"group","aria-label":I.heading,children:[o.jsx("div",{"aria-hidden":"true",className:"xf314gf x1xye8es xy143xn x141an7d x1ltkj2j xv1l7n4 x87ps6o",children:I.heading}),O]},`group-${I.heading}`):O})}return v.render(o.jsx("div",{id:c,role:"listbox","aria-label":(E==null?void 0:E.menuLabel)??t("@astryx.chatTriggerMenu.suggestions"),...ne(J("trigger-menu"),{className:"x9f619 x1xiyphd x1odjw0f x9epnlk xfb3i0g"}),children:R}),{placement:"above",alignment:"start",xstyle:[T6.popoverSurface,T6.popoverGap]})},[v,c,u,b,M,t]);return{state:u,handleInput:j,handleKeyDown:A,renderMenu:$,reset:y,ariaProps:z}}function ux(e){const t=window.getSelection();if(!t)return null;if(t.rangeCount>0){const s=t.getRangeAt(0);if(e.contains(s.startContainer))return t}const n=document.createRange();return n.selectNodeContents(e),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t}function Py(e,t){const n=ux(e);if(!n||n.rangeCount===0)return!1;const s=n.getRangeAt(0);s.deleteContents();const r=document.createTextNode(t);return s.insertNode(r),s.setStartAfter(r),s.collapse(!0),n.removeAllRanges(),n.addRange(s),!0}function Kq(e){return"render"in e&&typeof e.render=="function"}function Xq(e){let t=e;for(;t;){if(t instanceof HTMLElement&&t.hasAttribute("data-astryx-token"))return t;t=t.parentNode}return null}function Zq({editableRef:e,onEmitChange:t}){const[n,s]=h.useState([]),r=h.useCallback(u=>{const d=e.current;if(!d)return;const f=ux(d);if(!f||f.rangeCount===0)return;const p=f.getRangeAt(0),x=document.createElement("span"),g=`token-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;x.setAttribute("data-astryx-token",""),x.setAttribute("data-astryx-token-value",u.value),x.setAttribute("data-astryx-token-id",g),x.contentEditable="false",x.style.display="inline-flex",x.style.verticalAlign="baseline",p.deleteContents(),p.insertNode(x);const v=document.createTextNode(" ");x.after(v);const y=document.createRange();return y.setStartAfter(v),y.collapse(!0),f.removeAllRanges(),f.addRange(y),s(m=>[...m,{id:g,span:x,token:u}]),g},[e]),i=h.useCallback(u=>{if(u.key!=="Backspace")return!1;const d=window.getSelection();if(!d||!d.isCollapsed||d.rangeCount===0)return!1;const f=d.getRangeAt(0),{startContainer:p,startOffset:x}=f;if(p.nodeType===Node.TEXT_NODE&&x===0&&p.previousSibling instanceof HTMLElement&&p.previousSibling.hasAttribute("data-astryx-token"))return!1;if(p.nodeType===Node.TEXT_NODE&&p.textContent===" "&&x<=1&&p.previousSibling instanceof HTMLElement&&p.previousSibling.hasAttribute("data-astryx-token")){u.preventDefault();const g=p.previousSibling,v=p.parentNode;return v&&(v.removeChild(p),v.removeChild(g)),t(),!0}return!1},[t]),a=h.useCallback(u=>{const d=e.current;if(!d)return!1;const f=ux(d);if(!f||f.rangeCount===0)return!1;const p=f.getRangeAt(0),x=Xq(p.startContainer);if(x){u.preventDefault();const g=u.clipboardData.getData("text/plain"),v=x.nextSibling,y=document.createRange();return v&&v.nodeType===Node.TEXT_NODE?y.setStartAfter(v):y.setStartAfter(x),y.collapse(!0),f.removeAllRanges(),f.addRange(y),Py(d,g),t(),!0}return!1},[e,t]),l=h.useCallback(u=>{if(!e.current)return;const f=n.find(m=>m.id===u);if(!f)return;const{span:p}=f,x=p.getAttribute("data-astryx-token-value")??"",g=document.createTextNode(x),v=p.nextSibling;(v==null?void 0:v.nodeType)===Node.TEXT_NODE&&v.textContent===" "&&v.remove(),p.replaceWith(g);const y=window.getSelection();if(y){const m=document.createRange();m.setStartAfter(g),m.collapse(!0),y.removeAllRanges(),y.addRange(m)}s(m=>m.filter(k=>k.id!==u)),t()},[e,n,t]),c=h.useCallback(()=>{s(u=>u.filter(d=>{var f;return(f=e.current)==null?void 0:f.contains(d.span)}))},[e]);return{tokenPortals:n,expandToken:l,insertToken:r,handleKeyDown:i,handlePaste:a,cleanupPortals:c}}function Yq(e){const t=e.split(`
|
|
149
|
-
`).length,n=e.length;return t>1?`${t} lines, ${n} chars`:`${n} chars`}function hC({text:e,onExpand:t}){const n=ze(),s=Yq(e),r=o.jsxs("div",{className:"x78zum5 xdt5ytf x1txdalj x17fpy1y",children:[o.jsx("div",{className:"x9m5x89 x141an7d x1ltkj2j x1tgivj0 x126k92a x13faqbe x1xiyphd x1odjw0f",children:e}),o.jsxs("div",{className:"x78zum5 x6s0dn4 x1qughib x1txdalj",children:[o.jsx("span",{className:"x141an7d xv1l7n4",children:s}),t&&o.jsx(Q,{label:n("@astryx.chat.pastedText.expand"),variant:"ghost",size:"sm",onClick:t})]})]});return o.jsx(JS,{content:r,placement:"above",alignment:"start",hasHoverIndication:!1,children:o.jsx(Bd,{label:s,variant:"neutral"})})}hC.displayName="ChatPastedTextToken";function Qq(e){const t=e.split(`
|
|
150
|
-
`).length,n=e.length,s=t>1?`${t} lines, ${n} chars`:`${n} chars`;return{value:e,label:s,variant:"neutral"}}function Jq({inputRef:e,threshold:t=200,toToken:n=Qq}){return{onPaste:h.useCallback((r,i)=>{var l;if(i.length<=t)return!1;const a=n(i);return(l=e.current)==null||l.insertToken(a),!0},[e,t,n])}}const o5=h.createContext(null);o5.displayName="ChatMessageContext";function pC(){return h.use(o5)}const a5=h.createContext(null);a5.displayName="ChatListContext";function eP(){return h.use(a5)}const l5=h.createContext(null);l5.displayName="ChatComposerContext";function xC(){return h.use(l5)}const c5=h.createContext(null);c5.displayName="ChatLayoutContext";function tP(){return h.use(c5)}const nP=22,z6={root:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kAzted:"xe0957l",$$css:!0},disabled:{kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0}};function e2(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}function su(e){let t="";for(const n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE?t+=n.textContent??"":n instanceof HTMLElement&&(n.hasAttribute("data-astryx-token")?t+=n.getAttribute("data-astryx-token-value")??"":n.tagName==="BR"?t+=`
|
|
151
|
-
`:t+=su(n));return t}function u5(e){const t=ze(),n=xC(),s=e.value!==void 0,{ref:r,handleRef:i,value:a=n==null?void 0:n.value,onChange:l,placeholder:c,maxRows:u=8,triggers:d,debounceMs:f=150,hasHistory:p=!0,label:x,isDisabled:g=(n==null?void 0:n.isDisabled)??!1,onPaste:v,pasteAsToken:y,onFiles:m,onSubmit:k=n==null?void 0:n.onSubmit,onKeyDown:b,xstyle:j,className:A,style:M,...T}=e,z=x??t("@astryx.chat.composerInput.label"),$=c??(n==null?void 0:n.placeholder)??t("@astryx.chat.composer.placeholder"),E=n==null?void 0:n.onChange,N=h.useCallback(F=>{if(s){l==null||l(F);return}E==null||E(F),l!==E&&(l==null||l(F))},[E,s,l]),_=h.useRef(null),R=h.useRef(null),[B,D]=h.useState(!0),I=h.useRef([]),O=h.useRef(-1),L=h.useRef(""),H=h.useRef(void 0),q=h.useRef(()=>{}),U=h.useRef(()=>{}),X={insertToken:F=>q.current(F),expandToken:F=>xe.expandToken(F),insertText:F=>U.current(F),focus:()=>{var F;return(F=_.current)==null?void 0:F.focus()},getValue:()=>su(_.current??document.createElement("div"))};R.current=X,h.useImperativeHandle(i,()=>X);const Z=n==null?void 0:n.inputControlRef;h.useEffect(()=>{if(Z)return Z.current={focus:()=>{var F;return(F=_.current)==null?void 0:F.focus()}},()=>{Z.current=null}},[Z]),h.useEffect(()=>{if(a===void 0||!_.current)return;if(a===H.current){H.current=void 0;return}const F=_.current;if(su(F)!==a){H.current=void 0;const le=document.activeElement===F;if(F.textContent=a,le){const ce=window.getSelection();if(ce){const ge=document.createRange();ge.selectNodeContents(F),ge.collapse(!1),ce.removeAllRanges(),ce.addRange(ge)}}D(a.length===0)}else H.current=void 0},[a]);const ie=h.useRef(null),ae=h.useCallback(()=>{var ve;if(!_.current)return;const F=su(_.current),le=_.current.querySelector("[data-astryx-token], [data-astryx-dictation-interim]")!=null,ce=F.trim().length===0&&!le,ge=ce?"":F;H.current=ge,D(ce),N==null||N(ge),(ve=ie.current)==null||ve.call(ie)},[N]),xe=Zq({editableRef:_,onEmitChange:ae});ie.current=xe.cleanupPortals;const fe=Jq({inputRef:R}),se=y===!1?null:y??fe,ye=h.useCallback(F=>{const le=_.current;le&&Py(le,F)},[]);q.current=xe.insertToken,U.current=ye;const me=Wq({triggers:d,editableRef:_,onInsertToken:xe.insertToken,onInsertText:ye,onEmitChange:ae,debounceMs:f}),P=h.useCallback(()=>{ae(),me.handleInput()},[ae,me]),V=h.useCallback(F=>{if(!me.handleKeyDown(F)&&(b==null||b(F),!F.defaultPrevented)){if(F.key==="Backspace"){const le=window.getSelection();if(le&&le.isCollapsed&&le.rangeCount>0){const ce=le.getRangeAt(0),{startContainer:ge,startOffset:ve}=ce;if(!(ge.nodeType===Node.TEXT_NODE&&ve===0&&ge.previousSibling instanceof HTMLElement&&ge.previousSibling.hasAttribute("data-astryx-token"))){if(ge.nodeType===Node.TEXT_NODE&&ge.textContent===" "&&ve<=1&&ge.previousSibling instanceof HTMLElement&&ge.previousSibling.hasAttribute("data-astryx-token")){F.preventDefault();const pe=ge.previousSibling,Ve=ge.parentNode;Ve&&(Ve.removeChild(ge),Ve.removeChild(pe)),ae();return}}}}if(F.key==="Enter"&&!F.shiftKey){if(F.nativeEvent.isComposing||F.nativeEvent.keyCode===229||(F.preventDefault(),!_.current))return;const le=su(_.current).trim();if(!le)return;p&&(I.current.push(le),O.current=-1,L.current=""),k==null||k(le),_.current.textContent="",D(!0),N==null||N("");return}if(p&&(F.key==="ArrowUp"||F.key==="ArrowDown")){if(!_.current)return;const le=su(_.current),ce=I.current;if(ce.length===0)return;if(F.key==="ArrowUp"){O.current===-1&&(L.current=le);const ge=O.current===-1?ce.length-1:Math.max(0,O.current-1);O.current=ge,_.current.textContent=ce[ge],e2(_.current),ae(),F.preventDefault()}else if(F.key==="ArrowDown"&&O.current!==-1){const ge=O.current+1;ge>=ce.length?(O.current=-1,_.current.textContent=L.current,L.current&&e2(_.current)):(O.current=ge,_.current.textContent=ce[ge],e2(_.current)),ae(),F.preventDefault()}}}},[p,k,N,ae,me,b]),Y=h.useCallback(F=>{const le=_.current;if(!le||(ux(le),xe.handlePaste(F)))return;const ce=Array.from(F.clipboardData.files);if(ce.length>0){F.preventDefault(),m==null||m(ce);return}F.preventDefault();const ge=F.clipboardData.getData("text/plain");if(se!=null&&se.onPaste(F,ge)){ae();return}if(v==null?void 0:v(F,ge)){ae();return}Py(le,ge),ae()},[m,v,ae,xe,se]),oe=u*nP;return o.jsxs("div",{ref:r,...ne(J("chat-composer-input"),G(z6.root,g&&z6.disabled,j),A,M),...T,children:[B&&o.jsx("div",{className:"x10l6tqk x13vifvy x1o0tod xtijo5x x47corl xv1l7n4 xjm74w1 x6pjikd x19v9tvf x9ynric x87ps6o x9epnlk","aria-hidden":"true",children:$}),o.jsx("div",{ref:_,"aria-multiline":"true","aria-label":z,contentEditable:!g,suppressContentEditableWarning:!0,onInput:P,onKeyDown:V,onPaste:Y,...me.ariaProps,...ne({className:"x1a2a7pz x126k92a x13faqbe x1odjw0f xjm74w1 x6pjikd x19v9tvf x9ynric x1tgivj0 xxugrtn x9epnlk"},{style:{maxHeight:`${oe}px`}})}),me.renderMenu(),xe.tokenPortals.filter(({span:F})=>F.isConnected).map(({id:F,span:le,token:ce})=>b1.createPortal(Kq(ce)?o.jsx("span",{children:ce.render()},F):ce.value.length>(se===null?1/0:200)?o.jsx(hC,{text:ce.value,onExpand:()=>xe.expandToken(F)},F):o.jsx(Bd,{label:ce.label,variant:ce.variant,icon:ce.icon},F),le))]})}u5.displayName="ChatComposerInput";const sP={root:{kaIpWk:"xy0xnkn",kmuXW:"x2lah0s",$$css:!0}};function d5(e){const t=ze(),n=xC(),{isStopShown:s=(n==null?void 0:n.isStopShown)??!1,isDisabled:r=!((n==null?void 0:n.canSend)??!1),onSend:i,onStop:a=n==null?void 0:n.onStop,sendIcon:l,stopIcon:c,size:u="md",xstyle:d,className:f,style:p,ref:x,...g}=e,v=i??(()=>n==null?void 0:n.onSubmit("")),y=gd("stop"),m=gd("arrowUp");return o.jsx(Q,{ref:x,label:t(s?"@astryx.chatSendButton.stop":"@astryx.chatSendButton.send"),variant:s?"secondary":"primary",size:u,icon:s?c??y:l??m,isIconOnly:!0,isDisabled:!s&&r,onClick:s?a:v,...g,...J("chat-send-button"),className:f,style:p,xstyle:[sP.root,d]})}d5.displayName="ChatSendButton";const N6={body:{kVAEAm:"x1n2onr6",kY2c9j:"xhtitgo",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kmVPX3:"x18oj4ui",kOIVth:"x1txdalj",kaIpWk:"x1xunbrq",kWkggS:"x1prclbq",kkrTdU:"x1ed109x",kmkexE:"xrg7dcy",$$css:!0},compact:{"--_chat-composer-padding":"x18zce08",kOIVth:"xzye2dw",$$css:!0}},rP={low:{kGVxlE:"x1i5ehqx xhouywz",knuKkz:"xyavpck",$$css:!0},none:{kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kVAM5u:"xvy26l8 x6q1khz",kmVPX3:"x1b50gpf",kGVxlE:"x1gnnqk1 x12y27fx xuihb5h",$$css:!0}};function gC(e){const t=ze(),{ref:n,onSubmit:s,onStop:r,isStopShown:i=!1,value:a,onChange:l,placeholder:c,isDisabled:u=!1,density:d="balanced",elevation:f="low",drawer:p,headerActions:x,headerContext:g,input:v,footerActions:y,sendActions:m,sendButton:k,status:b,statusPosition:j="bottom",xstyle:A,className:M,style:T,...z}=e,$=c??t("@astryx.chat.composer.placeholder"),[E,N]=h.useState(""),_=a!==void 0,R=_?a:E,B=h.useCallback(X=>{_||N(X),l==null||l(X)},[_,l]),D=h.useCallback(()=>{const X=R.trim();!X||u||(s(X),B(""))},[R,u,s,B]),I=R.trim().length>0&&!u,O=h.useRef(null),L=h.useRef(null),H=h.useCallback(X=>{var ae;if(X.target.closest('button, a, [role="button"], [contenteditable="true"], [data-astryx-token]'))return;if(L.current){L.current.focus();return}const ie=(ae=O.current)==null?void 0:ae.querySelector('[contenteditable="true"], textarea');ie==null||ie.focus()},[]),q=b?o.jsxs("div",{role:b.type==="error"?"alert":"status",...{0:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x1htvmrp xvpcij2 xckg3cf xkvxy4d x6k0y1c"},4:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x2gtn7z x9jihrk x1z0f2p2 xy7p8pm xzc3kxz"},2:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x1htvmrp xvpcij2 xckg3cf xkvxy4d x6k0y1c x1pritpl x1joocv1"},6:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x2gtn7z x9jihrk x1z0f2p2 xy7p8pm xzc3kxz x1pritpl x1joocv1"},1:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x1htvmrp xvpcij2 xckg3cf xkvxy4d x6k0y1c x24i8r5 xdhq94a"},5:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x2gtn7z x9jihrk x1z0f2p2 xy7p8pm xzc3kxz x24i8r5 xdhq94a"},3:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x1htvmrp xvpcij2 xckg3cf xkvxy4d x6k0y1c x24i8r5 xdhq94a"},7:{className:"x1n2onr6 x1ja2u2z x78zum5 x6s0dn4 x1txdalj x1pzlopt x141an7d x1ltkj2j x9ynric x2gtn7z x9jihrk x1z0f2p2 xy7p8pm xzc3kxz x24i8r5 xdhq94a"}}[(j==="top")<<2|(b.type==="error")<<1|(b.type==="warning")<<0],children:[o.jsx(Te,{icon:b.type==="error"?"error":"warning",size:"md",color:b.type==="error"?"error":"warning"}),b.message]}):null,U=h.useMemo(()=>({value:R,onChange:B,onSubmit:D,placeholder:$,isDisabled:u,isStopShown:i,canSend:I,onStop:r,inputControlRef:L}),[R,B,D,$,u,i,I,r]);return o.jsx(l5,{value:U,children:o.jsxs("div",{ref:n,...ne(J("chat-composer",{density:d}),{0:{className:"x1n2onr6 x1ja2u2z xc8icb0 x78zum5 xdt5ytf xx161y6 xk0ittl xcw7vlg"},1:{className:"x1n2onr6 x1ja2u2z xc8icb0 x78zum5 xdt5ytf xx161y6 xk0ittl xcw7vlg x197sbye x47corl"}}[!!u<<0],M,T),...z,children:[j==="top"&&q,p,o.jsxs("div",{ref:O,onClick:H,...G(N6.body,rP[f],d==="compact"&&N6.compact,A),children:[(x||g)&&o.jsxs("div",{className:"x78zum5 x6s0dn4 x1qughib x1txdalj xe0p6wg",children:[o.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:x}),o.jsx("div",{className:"x78zum5 x6s0dn4 x1txdalj xvc5jky x141an7d x1ltkj2j xv1l7n4",children:g})]}),o.jsx("div",{className:"x78zum5 xdt5ytf",children:v??o.jsx(u5,{})}),o.jsxs("div",{className:"x78zum5 x6s0dn4 x1qughib x1txdalj x21xpn4",children:[o.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:y}),o.jsxs("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:[m,k??o.jsx(d5,{})]})]})]}),j==="bottom"&&q]})})}gC.displayName="ChatComposer";const iP={root:{kVAEAm:"x1n2onr6",kY2c9j:"x1vjfegm",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kVQacm:"xb3r6kr",kg3NbH:"x1pzlopt",kLKAdn:"x1vlblms",kGO01o:"xxbfulo",k1K539:"x1cdrix3",kWkggS:"x10xzikg",kKwaWg:"x1vrk509",krdFHd:"x1n70msy",kfmiAY:"xg0tfu",$$css:!0}};function mC({ref:e,children:t,count:n,label:s,isCollapsed:r,defaultIsCollapsed:i=!1,onCollapsedChange:a,xstyle:l,className:c,style:u,"data-testid":d,...f}){const p=ze(),x=s??p("@astryx.chat.composerDrawer.label"),[g,v]=h.useState(i),y=r!==void 0,m=y?r:g,k=n!=null,b=h.useId(),j=()=>{const A=!m;y||v(A),a==null||a(A)};return o.jsxs("div",{ref:e,"data-testid":d,...ne(J("chat-composer-drawer",{collapsed:m?"collapsed":null}),G(iP.root,l),c,u),...f,children:[k&&o.jsxs("div",{...{0:{className:"xrvj5dj x1y6fwsi x6s0dn4 x1grt7ep x1pzlopt x1ng9b9t x1ypdohk x87ps6o x-default-marker"},1:{className:"xrvj5dj x1y6fwsi x6s0dn4 x1grt7ep x1pzlopt x1ng9b9t x1ypdohk x87ps6o x-default-marker"}}[!!m<<0],role:"button",tabIndex:0,"aria-expanded":!m,"aria-controls":b,"aria-label":m?p("@astryx.chatComposerDrawer.expand",{label:x}):p("@astryx.chatComposerDrawer.collapse",{label:x}),onClick:j,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),j())},children:[o.jsxs("div",{...{0:{className:"x1ms6mhf xgkxs2y x1lqcxt8 x3nfvp2 x6s0dn4 x1grt7ep x1txdalj xjspbzw x1hc1fzr x19991ni xuedmi6 xlr8y92"},1:{className:"x1ms6mhf xgkxs2y x1lqcxt8 x3nfvp2 x6s0dn4 x1grt7ep x1txdalj xjspbzw x19991ni xuedmi6 xlr8y92 xg01cxk x47corl"}}[!m<<0],children:[o.jsx(Bd,{variant:"neutral",label:n}),o.jsx("span",{className:"xv1l7n4 x1t9gxa6 xjm74w1 x7acx1w xt3l3uh xuedmi6 xlr8y92",children:x})]}),o.jsx("div",{...{0:{className:"x1ms6mhf xgkxs2y x7v7x1q x1y8v6su xfyiiit x1b2l0oc xjspbzw x1q5y3ey x1pe4z86 x1hc1fzr x1e8aii2 xuedmi6 xlr8y92"},1:{className:"x1ms6mhf xgkxs2y x7v7x1q x1y8v6su xfyiiit x1b2l0oc xjspbzw x1q5y3ey x1pe4z86 x1e8aii2 xuedmi6 xlr8y92 xg01cxk x47corl"}}[!!m<<0]})]}),o.jsx("div",{id:b,...{0:{className:"xrvj5dj x1tu4anv x1qn9uv2 x80gvsz xlr8y92"},1:{className:"xrvj5dj x1qn9uv2 x80gvsz xlr8y92 xihq33y"}}[!!(k&&m)<<0],children:o.jsx("div",{...{0:{className:"x2lwn1j x78zum5 x1a02dak xzye2dw x1cy8zhl x1hc1fzr x19991ni x80gvsz x10b1n17 xlr8y92"},1:{className:"x2lwn1j x78zum5 x1a02dak xzye2dw x1cy8zhl x19991ni xlr8y92 xg01cxk x1ahifba xuedmi6"}}[!!(k&&m)<<0],children:t})})]})}mC.displayName="ChatComposerDrawer";const hf={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUk6DE:"x98rzlu",kAzted:"x2lwn1j",$$css:!0},inner:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUk6DE:"x98rzlu",kAzted:"x2lwn1j",$$css:!0},gapCompact:{kOIVth:"x1txdalj",k8WAf4:"xce4md1",kg3NbH:"xrrkdod",$$css:!0},gapBalanced:{kOIVth:"x18g69wz",k8WAf4:"x1na6nto",kg3NbH:"x1pzlopt",$$css:!0},gapSpacious:{kOIVth:"x1qh66ti",k8WAf4:"xq6koh6",kg3NbH:"xm7rs69",$$css:!0}},oP={0:{kOIVth:"xsn7fz1",$$css:!0},1:{kOIVth:"xzye2dw",$$css:!0},2:{kOIVth:"x1txdalj",$$css:!0},3:{kOIVth:"xjcht0a",$$css:!0},4:{kOIVth:"x18g69wz",$$css:!0},5:{kOIVth:"x9mgr7n",$$css:!0},6:{kOIVth:"x1qh66ti",$$css:!0},8:{kOIVth:"x4t41sb",$$css:!0},10:{kOIVth:"x3hoi3v",$$css:!0},"0.5":{kOIVth:"x1lsbc85",$$css:!0},"1.5":{kOIVth:"x1s4dlld",$$css:!0}};function yC({children:e,emptyState:t,scrollToTopAction:n,density:s="balanced",gap:r,isStreaming:i=!1,xstyle:a,className:l,style:c,"data-testid":u,ref:d,...f}){const p=tP(),x=h.useRef(null),g=h.useRef(null),[v,y]=h.useTransition();h.useEffect(()=>{if(p!=null&&p.contentRef&&g.current)return p.contentRef(g.current),()=>p.contentRef(null)},[p]);const m=e!=null&&e!==!1&&!(Array.isArray(e)&&e.length===0);h.useEffect(()=>{var T;const A=(T=p==null?void 0:p.scrollContainerRef)==null?void 0:T.current;if(!n||!x.current)return;const M=new IntersectionObserver(z=>{var $;($=z[0])!=null&&$.isIntersecting&&y(async()=>{await n()})},{root:A??null,threshold:0});return M.observe(x.current),()=>M.disconnect()},[n,p]);const k=h.useMemo(()=>({density:s}),[s]),b=s==="compact"?hf.gapCompact:s==="spacious"?hf.gapSpacious:hf.gapBalanced,j=r==null?null:oP[r];return o.jsx(a5,{value:k,children:o.jsx("div",{...f,ref:d,role:"log","aria-live":"polite","aria-busy":i||void 0,tabIndex:0,"data-testid":u,...ne(J("chat-message-list",{density:s}),G(hf.root,a),l,c),children:o.jsxs("div",{ref:g,...G(hf.inner,b,j),children:[n&&o.jsx("div",{ref:x,"aria-hidden":!0}),v&&o.jsx("div",{className:"x78zum5 xl56j7k x8o8v82",children:o.jsx(Vt,{size:"md"})}),o.jsx("div",{className:"x98rzlu x2lwn1j","aria-hidden":!0}),m?e:t?o.jsx("div",{className:"x78zum5 x6s0dn4 xl56j7k x98rzlu x2lwn1j",children:t}):null]})})})}yC.displayName="ChatMessageList";const $n={root:{k1xSpc:"x78zum5",kGNEyG:"x1cy8zhl",ks0D6T:"x193iq5w",$$css:!0},rootGapCompact:{kOIVth:"x1s4dlld",$$css:!0},rootGapBalanced:{kOIVth:"x1txdalj",$$css:!0},rootGapSpacious:{kOIVth:"xjcht0a",$$css:!0},rootAssistant:{kXwgrk:"x1q0g3np",kjj79g:"x1nhvcw1",$$css:!0},rootUser:{kXwgrk:"x15zctf7",kjj79g:"x1nhvcw1",$$css:!0},rootSystem:{kXwgrk:"x1q0g3np",kjj79g:"xl56j7k",$$css:!0},contentColumn:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUk6DE:"x98rzlu",k7Eaqz:"xeuugli",$$css:!0},contentColumnSystem:{ks0D6T:"xq8v1hd",kGNEyG:"x6s0dn4",$$css:!0},contentColumnAssistant:{kGNEyG:"x1cy8zhl",$$css:!0},contentColumnUser:{kGNEyG:"xuk3077",$$css:!0},childrenWrap:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",k7Eaqz:"xeuugli",kzqmXN:"xh8yej3",$$css:!0},childrenAssistant:{kGNEyG:"x1cy8zhl",$$css:!0},childrenUser:{kGNEyG:"xuk3077",$$css:!0},childrenSystem:{kGNEyG:"x6s0dn4",$$css:!0},childrenGapCompact:{kOIVth:"x1lsbc85",$$css:!0},childrenGapBalanced:{kOIVth:"xzye2dw",$$css:!0},childrenGapSpacious:{kOIVth:"x1s4dlld",$$css:!0}};function f5({sender:e,children:t,avatar:n,name:s,metadata:r,density:i,xstyle:a,className:l,style:c,"data-testid":u,ref:d,...f}){const p=ze(),x=eP(),g=i??(x==null?void 0:x.density)??"balanced",v=h.useMemo(()=>({sender:e,density:g}),[e,g]),y=g==="compact"?$n.rootGapCompact:g==="spacious"?$n.rootGapSpacious:$n.rootGapBalanced,m=g==="compact"?$n.childrenGapCompact:g==="spacious"?$n.childrenGapSpacious:$n.childrenGapBalanced,k=e==="system"?$n.rootSystem:e==="user"?$n.rootUser:$n.rootAssistant,b=e==="system"?$n.contentColumnSystem:e==="user"?$n.contentColumnUser:$n.contentColumnAssistant,j=e==="system"?$n.childrenSystem:e==="user"?$n.childrenUser:$n.childrenAssistant,A=e==="system",M=n!=null&&!A,T=s!=null&&!A,z=h.useId();return o.jsx(o5,{value:v,children:o.jsxs("article",{...f,ref:d,"data-testid":u,"aria-label":T?void 0:p("@astryx.chatMessage.messageFrom",{sender:e}),"aria-labelledby":T?z:void 0,...ne(J("chat-message",{sender:e,density:g}),G($n.root,k,M&&y,a),l,c),children:[M&&o.jsx("div",{className:"x2lah0s x5du68j",children:n}),o.jsxs("div",{...G($n.contentColumn,b),children:[T&&o.jsx("div",{id:z,className:"x141an7d x2mo6ok xv1l7n4 x1ltkj2j x14cgwvg",children:s}),o.jsx("div",{...G($n.childrenWrap,j,m),children:t}),r!=null&&!A&&o.jsx("div",{children:r})]})]})})}f5.displayName="ChatMessage";const Ht={content:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",ks0D6T:"xl6temz",kaIpWk:"xashgol",kMv6JI:"x9ynric",kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",kHjlTd:"x1mzt3pk",kTgw9:"x13faqbe",$$css:!0},radiusCompact:{kaIpWk:"x1hviunn",$$css:!0},paddingCompact:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",$$css:!0},paddingBalanced:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",$$css:!0},paddingSpacious:{k8WAf4:"x1na6nto",kg3NbH:"xzz68wx",$$css:!0},paddingBlockNone:{k8WAf4:"xt970qd",$$css:!0},metadataPaddingCompact:{kg3NbH:"x1pzlopt",$$css:!0},metadataPaddingBalanced:{kg3NbH:"x1pzlopt",$$css:!0},metadataPaddingSpacious:{kg3NbH:"xzz68wx",$$css:!0},metadataReducedGap:{keoZOQ:"x1c40v9y",$$css:!0},headerReducedGap:{k1K539:"xdrfirk",$$css:!0},nameRow:{kZKoxP:"x1grt7ep",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",$$css:!0},alignEnd:{k9WMMc:"xp4054r",$$css:!0},assistant:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",$$css:!0},user:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",$$css:!0},ghost:{kWkggS:"xjbqb8w",kMwMTN:"x1tgivj0",$$css:!0},groupFirstAssistant:{kVL7Gh:"xrfs2vl",$$css:!0},groupMiddleAssistant:{krdFHd:"x3qb8m",kVL7Gh:"xrfs2vl",$$css:!0},groupLastAssistant:{krdFHd:"x3qb8m",$$css:!0},groupFirstUser:{kT0f0o:"x1whkvtz",$$css:!0},groupMiddleUser:{kfmiAY:"x126per9",kT0f0o:"x1whkvtz",$$css:!0},groupLastUser:{kfmiAY:"x126per9",$$css:!0}};function vC({children:e,variant:t="filled",name:n,metadata:s,group:r,xstyle:i,className:a,style:l,"data-testid":c,ref:u,...d}){const f=pC(),p=(f==null?void 0:f.sender)??"assistant",x=(f==null?void 0:f.density)??"balanced",g=x==="compact"?Ht.paddingCompact:x==="spacious"?Ht.paddingSpacious:Ht.paddingBalanced,v=p==="user",y=t==="ghost"?Ht.ghost:v?Ht.user:Ht.assistant,m=r==="first"?v?Ht.groupFirstUser:Ht.groupFirstAssistant:r==="middle"?v?Ht.groupMiddleUser:Ht.groupMiddleAssistant:r==="last"?v?Ht.groupLastUser:Ht.groupLastAssistant:null,k=x==="compact"?Ht.metadataPaddingCompact:x==="spacious"?Ht.metadataPaddingSpacious:Ht.metadataPaddingBalanced;return o.jsxs(o.Fragment,{children:[n&&o.jsx("div",{"data-chat-name":!0,...G(k,Ht.nameRow,Ht.headerReducedGap,v&&Ht.alignEnd),children:n}),o.jsx("div",{...d,ref:u,"data-testid":c,...ne(J("chat-message-bubble",{sender:p,variant:t,density:x}),G(Ht.content,x==="compact"&&Ht.radiusCompact,y,g,t==="ghost"&&Ht.paddingBlockNone,m,i),a,l),children:e}),s&&o.jsx("div",{...G(k,Ht.metadataReducedGap,v&&Ht.alignEnd),children:s})]})}vC.displayName="ChatMessageBubble";const aP={sending:{icon:"clock",i18nKey:"@astryx.chat.status.sending"},sent:{icon:"check",i18nKey:"@astryx.chat.status.sent"},delivered:{icon:"checkDouble",i18nKey:"@astryx.chat.status.delivered"},read:{icon:"checkDouble",i18nKey:"@astryx.chat.status.read"},error:{icon:"error",i18nKey:"@astryx.chat.status.failed"}},t2={meta:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",keoZOQ:"xcsaf9d",kGuDYH:"x141an7d",k63SB2:"x1sodnla",kLWn49:"x1ltkj2j",kMwMTN:"xv1l7n4",$$css:!0},metaUser:{kXwgrk:"x15zctf7",$$css:!0},metaAssistant:{kXwgrk:"x1q0g3np",$$css:!0}};function Og({ref:e,timestamp:t,footer:n,status:s,xstyle:r,className:i,style:a,...l}){const c=ze(),u=pC(),d=(u==null?void 0:u.sender)??"assistant",f=s!=null?aP[s]:null,p=f!=null?c(f.i18nKey):"";return t!=null||n!=null||f!=null?o.jsxs("div",{ref:e,...ne(J("chat-message-metadata"),G(t2.meta,d==="user"?t2.metaUser:t2.metaAssistant,r),i,a),...l,children:[t!=null&&o.jsx("span",{children:t}),t!=null&&(n!=null||f!=null)&&o.jsx("span",{children:"·"}),n!=null&&n,n!=null&&f!=null&&o.jsx("span",{children:"·"}),f!=null&&o.jsxs("span",{title:p,"aria-label":c("@astryx.chat.messageAriaLabel",{status:p.toLowerCase()}),...{0:{className:"x3nfvp2 x6s0dn4 xzye2dw"},2:{className:"x3nfvp2 x6s0dn4 xzye2dw xjt36v0"},1:{className:"x3nfvp2 x6s0dn4 xzye2dw xcx56e2 xmg6eyc x4hg4is xa4qsjk x1aquc0h"},3:{className:"x3nfvp2 x6s0dn4 xzye2dw xjt36v0 xcx56e2 xmg6eyc x4hg4is xa4qsjk x1aquc0h"}}[(s==="error")<<1|(s==="sending")<<0],children:[o.jsx(Te,{icon:f.icon,size:"xsm",color:"inherit"}),o.jsx("span",{children:p})]})]}):null}Og.displayName="ChatMessageMetadata";const _6={root:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"x1txdalj",k8WAf4:"xu0wf1k",kMv6JI:"x9ynric",kGuDYH:"x141an7d",k63SB2:"x1sodnla",kMwMTN:"xv1l7n4",k9WMMc:"x2b8uid",$$css:!0},dividerWrap:{kzqmXN:"xh8yej3",$$css:!0}};function Uy({children:e,variant:t="default",icon:n,xstyle:s,className:r,style:i,ref:a,...l}){return t==="divider"?o.jsx("div",{ref:a,...ne(J("chat-system-message",{variant:t}),G(_6.dividerWrap,s),r,i),...l,role:"status",children:o.jsx(Na,{label:e})}):o.jsx("div",{ref:a,...ne(J("chat-system-message",{variant:t}),G(_6.root,s),r,i),...l,role:"status",children:o.jsxs("span",{className:"x3nfvp2 x6s0dn4 x1s4dlld x2lah0s xuxw1ft",children:[n!=null&&o.jsx("span",{className:"x3nfvp2 x6s0dn4 x2lah0s",children:n}),e]})})}Uy.displayName="ChatSystemMessage";const lP=1e3/60;function cP({scrollRef:e,enabled:t=!0,lockThreshold:n=10,buttonThreshold:s=100,damping:r=.7,stiffness:i=.05,mass:a=1.25}){const[l,c]=h.useState(!1),[u,d]=h.useState(!0),f=h.useRef(!0),p=h.useRef(!0),x=h.useRef(0),g=h.useRef(!1),v=h.useRef(void 0),y=h.useRef(0),m=h.useRef(0),k=h.useRef(0),b=h.useCallback(()=>{const R=e.current;if(!R||!f.current){g.current=!1,v.current=void 0,x.current=0;return}if(R.scrollHeight<=R.clientHeight){g.current=!1,v.current=void 0,x.current=0;return}const B=R.scrollHeight-R.clientHeight,D=B-R.scrollTop;if(Math.abs(D)<.5&&Math.abs(x.current)<.1){R.scrollTop=B,g.current=!1,v.current=void 0,x.current=0;return}const I=performance.now(),O=v.current?(I-v.current)/lP:1;v.current=I,x.current=(r*x.current+i*D)/a,R.scrollTop+=x.current*O,requestAnimationFrame(b)},[e,r,i,a]),j=h.useCallback(()=>{const R=e.current;R&&(g.current=!1,x.current=0,v.current=void 0,R.scrollTop=R.scrollHeight-R.clientHeight,y.current=R.scrollTop)},[e]),A=Ya("(prefers-reduced-motion: reduce)"),M=h.useCallback(()=>{if(f.current){if(A){j();return}g.current||(g.current=!0,v.current=void 0,requestAnimationFrame(b))}},[b,j,A]),T=h.useCallback(R=>{if(f.current=!0,d(!0),c(!1),p.current=!1,(R==null?void 0:R.behavior)==="instant"){j();return}M()},[M,j]),z=h.useCallback(R=>{const B=e.current;if(!B)return;const D=B.getBoundingClientRect(),O=R.getBoundingClientRect().top-D.top+B.scrollTop;B.scrollTo({top:O,behavior:"instant"}),y.current=B.scrollTop},[e]),$=h.useCallback(()=>{const R=e.current;if(!R)return;const B=R.getElementsByClassName("astryx-chat-message"),D=B[B.length-1];D instanceof HTMLElement&&z(D)},[e,z]),E=h.useCallback(()=>{f.current=!0,d(!0),c(!1),M()},[M]),N=h.useCallback(()=>{f.current=!1,g.current=!1,d(!1)},[]),_=h.useCallback(()=>{if(!t||!f.current)return;const R=e.current;if(p.current&&R&&R.scrollHeight>R.clientHeight){p.current=!1,j();return}M()},[t,M,j,e]);return h.useEffect(()=>{const R=e.current;if(!R||!t)return;y.current=R.scrollTop,m.current=R.scrollHeight,k.current=R.offsetHeight;const B=()=>{const{scrollTop:L,scrollHeight:H,offsetHeight:q}=R,U=H-L-q;c(U>s);const X=H!==m.current,Z=q!==k.current;if(m.current=H,k.current=q,X||Z){y.current=L;return}const ie=L<y.current;y.current=L,ie&&f.current&&(f.current=!1,g.current=!1,d(!1))},D=()=>{R.scrollHeight-R.scrollTop-R.offsetHeight<=n&&(f.current=!0,d(!0))},I=L=>{L.deltaY<0&&g.current&&(f.current=!1,g.current=!1,d(!1))},O=()=>{g.current&&(f.current=!1,g.current=!1,d(!1))};return R.addEventListener("scroll",B,{passive:!0}),R.addEventListener("scrollend",D),R.addEventListener("wheel",I,{passive:!0}),R.addEventListener("touchmove",O,{passive:!0}),requestAnimationFrame(()=>{R.scrollHeight>R.clientHeight&&(R.scrollTop=R.scrollHeight-R.clientHeight,y.current=R.scrollTop,p.current=!1)}),()=>{R.removeEventListener("scroll",B),R.removeEventListener("scrollend",D),R.removeEventListener("wheel",I),R.removeEventListener("touchmove",O)}},[e,t,n,s]),{isScrolledUp:l,isLocked:u,scrollToBottom:T,scrollToMessage:z,lock:E,unlock:N,scrollIfLocked:_,scrollToLastMessage:$}}function uP({isLocked:e,onResize:t}){const[n,s]=h.useState(!1),r=h.useRef(null),i=h.useRef(e);i.current=e;const a=h.useRef(t);a.current=t;const l=h.useRef(null),c=h.useRef(null),u=h.useCallback(x=>{_4(x,()=>{var y;(y=a.current)==null||y.call(a);const g=x.getElementsByClassName("astryx-chat-message"),v=g.length>0?g[g.length-1]:null;v&&v!==r.current&&(r.current=v,i.current||s(!0))}),c.current=()=>R4(x)},[]),d=h.useCallback(()=>{var x;(x=c.current)==null||x.call(c),c.current=null},[]),f=h.useCallback(x=>{x!==l.current&&(d(),l.current=x,x&&u(x))},[u,d]);h.useEffect(()=>()=>d(),[d]);const p=h.useCallback(()=>{s(!1)},[]);return{hasNewMessages:n,dismiss:p,contentRef:f}}const mo={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",keoZOQ:"xtbrsbv",$$css:!0},statusIcon:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",kaIpWk:"xjspbzw",$$css:!0},nodePill:{kmuXW:"x2lah0s",$$css:!0},colorPending:{kMwMTN:"xnbbluu",$$css:!0},colorRunning:{kMwMTN:"xqwr325",$$css:!0},colorComplete:{kMwMTN:"xtjic6",$$css:!0},colorError:{kMwMTN:"xjt36v0",$$css:!0}},kC={pending:"clock",running:null,complete:"check",error:"close"},bC={pending:mo.colorPending,running:mo.colorRunning,complete:mo.colorComplete,error:mo.colorError};function dP(e){return nL(e.key,()=>{var t,n;return[e.name,e.status??"complete",e.target??"",e.node??"",e.duration??"",((t=e.additions)==null?void 0:t.toString())??"",((n=e.deletions)==null?void 0:n.toString())??"",e.errorMessage??""].join("")})}function R6({call:e}){const t=ze(),n=e.status??"complete",s=e.resultDetail!=null,[r,i]=h.useState(!1),a=h.useId(),l=s?()=>i(u=>!u):void 0,c=o.jsxs("div",{role:s?"button":void 0,tabIndex:s?0:void 0,"aria-expanded":s?r:void 0,"aria-controls":s&&r?a:void 0,onClick:l,onKeyDown:s?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),l==null||l())}:void 0,...{0:{className:"x78zum5 x6s0dn4 x1s4dlld xjwf9q1 x13f7esw"},1:{className:"x78zum5 x6s0dn4 x1s4dlld xjwf9q1 x13f7esw x1ypdohk xh6dtrn x7a5moj xtedp8i xe9uy6x"}}[!!s<<0],children:[o.jsxs("span",{title:n==="error"?e.errorMessage:void 0,...G(mo.statusIcon,bC[n]),children:[n==="running"?o.jsx(Vt,{size:"sm",shade:"subtle"}):n==="pending"?o.jsx(Vt,{size:"sm",shade:"subtle"}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"x10l6tqk x10a8y8t x1pjcqnp xtwfq29 x1xyvc85"}),o.jsx("span",{className:"x1n2onr6 x3nfvp2",children:o.jsx(Te,{icon:kC[n]??"check",size:"xsm",color:"inherit"})})]}),n==="error"&&e.errorMessage!=null&&o.jsx(Gi,{children:t("@astryx.chatToolCalls.error",{message:e.errorMessage??""})})]}),o.jsx("span",{className:"x141an7d x1ltkj2j x9m5x89 x1e4wzip xv1l7n4 xuxw1ft xb3r6kr xlyipyv xs83m0k x13n9wmd",children:e.name}),e.node!=null&&o.jsx(Bd,{label:e.node,variant:"neutral",xstyle:mo.nodePill}),e.target!=null&&o.jsx("span",{className:"x141an7d x1ltkj2j x9ynric xnbbluu xuxw1ft xb3r6kr xlyipyv x1g3ib7 xeuugli",children:e.target}),(e.additions!=null||e.deletions!=null||e.stats!=null)&&o.jsxs("span",{className:"x78zum5 x6s0dn4 xzye2dw x141an7d x1ltkj2j x9ynric xnbbluu x2lah0s",children:[e.additions!=null&&o.jsxs("span",{className:"xtjic6",children:["+",e.additions]}),e.deletions!=null&&o.jsxs("span",{className:"xjt36v0",children:["-",e.deletions]}),e.stats]}),e.duration!=null&&n==="complete"&&o.jsx("span",{className:"x141an7d x1ltkj2j x9ynric xnbbluu xuxw1ft x2lah0s",children:e.duration}),s&&o.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnbbluu x1ob6yzd x9kvfbb xvc5jky"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnbbluu x1ob6yzd x9kvfbb xvc5jky x19jd1h0"}}[!!r<<0],children:o.jsx(Te,{icon:"chevronDown",size:"xsm",color:"inherit"})})]});return s?o.jsxs("div",{children:[c,r&&o.jsx("div",{id:a,className:"x1f43n9v x1wesfrj",children:e.resultDetail})]}):c}function wC(e){const t=ze(),{calls:n,label:s,isExpanded:r,defaultIsExpanded:i,onExpandedChange:a,xstyle:l,className:c,style:u,ref:d,...f}=e,p=i??!1,[x,g]=h.useState(p),v=h.useId(),y=r!==void 0,m=y?r:x,k=h.useCallback(()=>{const A=!m;y||g(A),a==null||a(A)},[m,y,a]);if(n.length===0)return null;if(n.length===1)return o.jsx("div",{ref:d,...ne(J("chat-tool-calls"),G(mo.root,l),c,u),...f,children:o.jsx(R6,{call:n[0]})});const b=n[n.length-1],j=b.status??"complete";return o.jsxs("div",{ref:d,...ne(J("chat-tool-calls"),G(mo.root,l),c,u),...f,children:[o.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,"aria-controls":v,onClick:k,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),k())},className:"x78zum5 x6s0dn4 x1s4dlld xjwf9q1 x13f7esw x1ypdohk",children:[m?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x1kky2od xlup9mm xv1l7n4",children:o.jsx(Te,{icon:"wrench",size:"sm",color:"inherit"})}),o.jsx("span",{className:"x141an7d x1ltkj2j x9ynric x1e4wzip xv1l7n4",children:t("@astryx.chatToolCalls.groupLabel",{count:n.length})})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{...G(mo.statusIcon,bC[j]),children:j==="running"?o.jsx(Vt,{size:"sm",shade:"subtle"}):j==="pending"?o.jsx(Vt,{size:"sm",shade:"subtle"}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"x10l6tqk x10a8y8t x1pjcqnp xtwfq29 x1xyvc85"}),o.jsx("span",{className:"x1n2onr6 x3nfvp2",children:o.jsx(Te,{icon:kC[j]??"check",size:"xsm",color:"inherit"})})]})}),o.jsx("span",{className:"x141an7d x1ltkj2j x9m5x89 x1e4wzip xv1l7n4 xuxw1ft xb3r6kr xlyipyv xs83m0k x13n9wmd",children:b.name}),b.target!=null&&o.jsx("span",{className:"x141an7d x1ltkj2j x9ynric xnbbluu xuxw1ft xb3r6kr xlyipyv x1g3ib7 xeuugli",children:b.target})]}),o.jsx("span",{className:"x3nfvp2 x6s0dn4 x1lsbc85 x141an7d x1ltkj2j x9ynric xnbbluu x2lah0s",children:!m&&o.jsxs(o.Fragment,{children:[o.jsx(Te,{icon:"wrench",size:"xsm",color:"inherit"}),n.length]})}),o.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnbbluu x1ob6yzd x9kvfbb"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x6jxa94 x1v9usgg xnbbluu x1ob6yzd x9kvfbb x19jd1h0"}}[!!m<<0],children:o.jsx(Te,{icon:"chevronDown",size:"xsm",color:"inherit"})})]}),o.jsx("div",{id:v,...{0:{className:"xrvj5dj xihq33y xb0j27v x9kvfbb"},1:{className:"xrvj5dj xb0j27v x9kvfbb x1tu4anv"}}[!!m<<0],children:o.jsx("div",{className:"xb3r6kr x2lwn1j",children:o.jsx("div",{className:"x78zum5 xdt5ytf x7a5moj xtedp8i",children:n.map(A=>o.jsx(R6,{call:A},dP(A)))})})})]})}wC.displayName="ChatToolCalls";const n2={wrapper:{k1xSpc:"x78zum5",kjj79g:"xl56j7k",kGO01o:"xvmdzux",$$css:!0},button:{"--radius-element":"xnpej1e",khDVqt:"xuxw1ft",kg3NbH:"xf314gf",$$css:!0},buttonWithLabel:{kwRFfy:"x1t818jl",$$css:!0}};function jC({ref:e,isVisible:t,label:n,onClick:s,xstyle:r,className:i,style:a,...l}){const c=ze();return o.jsx("div",{ref:e,...ne(G(n2.wrapper,r),i,a),...l,children:o.jsx("div",{...{0:{className:"xawy1a7 xb3r6kr xjspbzw x1prclbq x14hfi27 x10w6t97 x1apppo2 xlr8y92 x2rcmwa x12w9bfk xg01cxk x47corl x1x67gh"},2:{className:"xawy1a7 xb3r6kr xjspbzw x1prclbq x14hfi27 x10w6t97 x1apppo2 xlr8y92 x2rcmwa x12w9bfk x1hc1fzr x67bb7w x1x67gh"},1:{className:"xawy1a7 xb3r6kr xjspbzw x1prclbq x14hfi27 x10w6t97 x1apppo2 xlr8y92 x2rcmwa x12w9bfk xg01cxk x47corl x1ncir08"},3:{className:"xawy1a7 xb3r6kr xjspbzw x1prclbq x14hfi27 x10w6t97 x1apppo2 xlr8y92 x2rcmwa x12w9bfk x1hc1fzr x67bb7w x1ncir08"}}[!!t<<1|!!n<<0],children:o.jsx(Q,{label:n??c("@astryx.chatLayoutScrollButton.scrollToBottom"),"aria-label":n??c("@astryx.chatLayoutScrollButton.scrollToBottom"),icon:o.jsx(Te,{icon:"chevronDown",size:"md"}),variant:"ghost",size:"md",onClick:s,xstyle:[n2.button,n?n2.buttonWithLabel:null],children:n??void 0})})})}jC.displayName="ChatLayoutScrollButton";const An={root:{kVAEAm:"x1n2onr6",k9g6sI:"x12h1iku",kAzted:"x2lwn1j",kUk6DE:"x98rzlu",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",$$css:!0},rootScrollable:{kORKVm:"x1odjw0f",kXHlph:"x6ikm8r",k5wCbM:"x1mqgsch",$$css:!0},messageArea:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUOVxO:"xvueqy4",kzQI83:"x1iyjqo2",kmuXW:"x2lah0s",kCS8Yb:"xdl72j9",kGO01o:"xjpqqx5",kzqmXN:"xh8yej3",ks0D6T:"x193iq5w",kg3NbH:"xnjsko4",$$css:!0},blurLayer:{kVAEAm:"x10l6tqk",krVfgx:"x1ey2m1c",kLqNvP:"x1o0tod",kt4wiu:"xtijo5x",kfzvcC:"x47corl",k6WDB:"xvn2z4z",keRtuK:"x67t5t6",kZKoxP:"xpyat2d",kX1K2I:"xw26lqc",kAExgp:"x1bv1mxo",$$css:!0},dock:{kVAEAm:"x1n2onr6",kY2c9j:"x1vjfegm",kfzvcC:"x67bb7w",kg3NbH:"xrrkdod",kGO01o:"xvmdzux",$$css:!0},dockInner:{kUOVxO:"xvueqy4",kzqmXN:"xh8yej3",ks0D6T:"x193iq5w",$$css:!0},messageAreaCompact:{ks0D6T:"x193iq5w",kg3NbH:"xnjsko4",$$css:!0},messageAreaBalanced:{ks0D6T:"x193iq5w",kg3NbH:"xnjsko4",$$css:!0},messageAreaSpacious:{ks0D6T:"x1ap80js",kg3NbH:"x1pzlopt",$$css:!0},blurLayerCompact:{kZKoxP:"xwzfr38",kX1K2I:"xkm2don",kAExgp:"xiy8rlo",$$css:!0},blurLayerBalanced:{kZKoxP:"xpyat2d",kX1K2I:"xw26lqc",kAExgp:"x1bv1mxo",$$css:!0},blurLayerSpacious:{kZKoxP:"x1wkxgih",kX1K2I:"xr5yg4x",kAExgp:"xo9xo30",$$css:!0},dockCompact:{kg3NbH:"xf314gf",kGO01o:"x1wesfrj",$$css:!0},dockBalanced:{kg3NbH:"xrrkdod",kGO01o:"xvmdzux",$$css:!0},dockSpacious:{kg3NbH:"x1pzlopt",kGO01o:"xvmdzux",$$css:!0},dockInnerCompact:{ks0D6T:"x193iq5w",$$css:!0},dockInnerBalanced:{ks0D6T:"x193iq5w",$$css:!0},dockInnerSpacious:{ks0D6T:"x1ap80js",$$css:!0}};function fP(e){return!(e==null||e===!1||Array.isArray(e)&&e.length===0)}function SC({children:e,composer:t,density:n="balanced",emptyState:s,scrollButton:r,scrollRef:i,xstyle:a,className:l,style:c,"data-testid":u,ref:d,...f}){const p=ze(),x=h.useRef(null),g=i??x,v=!i,y=cP({scrollRef:g}),m=uP({isLocked:y.isLocked,onResize:y.scrollIfLocked}),k=o.jsx(jC,{isVisible:y.isScrolledUp||m.hasNewMessages,label:m.hasNewMessages?p("@astryx.chatLayout.newMessages"):void 0,onClick:()=>{m.dismiss(),y.scrollToBottom()}}),b=h.useMemo(()=>({scrollContainerRef:g,contentRef:m.contentRef}),[g,m.contentRef]),j=!fP(e),M={compact:{messageArea:An.messageAreaCompact,blurLayer:An.blurLayerCompact,dock:An.dockCompact,dockInner:An.dockInnerCompact},balanced:{messageArea:An.messageAreaBalanced,blurLayer:An.blurLayerBalanced,dock:An.dockBalanced,dockInner:An.dockInnerBalanced},spacious:{messageArea:An.messageAreaSpacious,blurLayer:An.blurLayerSpacious,dock:An.dockSpacious,dockInner:An.dockInnerSpacious}}[n];return o.jsx(c5,{value:b,children:o.jsxs("div",{...f,ref:Ft(d,x),"data-testid":u,...ne(J("chat-layout",{density:n}),G(An.root,v&&An.rootScrollable,a),l,c),children:[o.jsx("div",{...G(An.messageArea,M.messageArea),children:j&&s?o.jsx("div",{className:"x78zum5 x6s0dn4 xl56j7k x98rzlu xz65tgg",children:s}):e}),o.jsxs("div",{...{0:{className:"x1ey2m1c x1o0tod xtijo5x x1ja2u2z xc8icb0 x47corl x2lah0s xixxii4"},1:{className:"x1ey2m1c x1o0tod xtijo5x x1ja2u2z xc8icb0 x47corl x2lah0s x7wzq59"}}[!!v<<0],children:[r===void 0?k:r,o.jsx("div",{...G(An.blurLayer,M.blurLayer)}),o.jsx("div",{...G(An.dock,M.dock),children:o.jsx("div",{...G(An.dockInner,M.dockInner),children:t})})]})]})})}SC.displayName="ChatLayout";const w1=h.createContext(null);w1.displayName="ListContext";const s2={list:{kogj98:"x1ghz6dp",kZCmMZ:"x1c1uobl",kH6xsr:"x3ct3a4",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",$$css:!0},withDividers:{kOIVth:"xxhr3t",$$css:!0},withCounter:{kt6KFK:"xif0320",$$css:!0}},hP={kt6KFK:"x1khind5",$$css:!0},pP={counterStart:e=>[hP,{"--x-counterReset":`astryx-list ${e}`!=null?`astryx-list ${e}`:void 0}]};function Jt({children:e,density:t="balanced",hasDividers:n=!1,header:s,listStyle:r="none",start:i,xstyle:a,className:l,style:c,"data-testid":u,ref:d}){const f=h.useId(),p=r==="decimal",x=p?"ol":"ul",g=h.useMemo(()=>({density:t,hasDividers:n,listStyle:r}),[t,n,r]),v=o.jsx(x,{ref:d,"data-testid":u,"aria-labelledby":s!=null?f:void 0,...p&&i!=null&&i!==1?{start:i}:{},role:"list",...ne(J("list",{density:t,listStyle:r}),G(s2.list,n&&s2.withDividers,r!=="none"&&(i!=null&&i!==1?pP.counterStart(i-1):s2.withCounter),a),l,c),children:e});return s==null?o.jsx(w1,{value:g,children:v}):o.jsx(w1,{value:g,children:o.jsxs("div",{className:"x78zum5 xdt5ytf",children:[o.jsx("div",{id:f,className:"x1p37lm5",children:s}),v]})})}Jt.displayName="List";const xP=[];function h5({label:e,isLabelHidden:t=!1,description:n,status:s,value:r,onChange:i,changeAction:a,density:l="balanced",hasDividers:c=!1,isDisabled:u=!1,disabledMessage:d,isReadOnly:f=!1,children:p,ref:x,width:g,xstyle:v,className:y,style:m,"data-testid":k,...b}){const j=h.useId(),A=h.useId(),M=h.useId(),T=h.useId(),[,z]=h.useTransition(),$=r!==void 0,E=r??xP,[N,_]=h.useOptimistic(E),[R,B]=h.useOptimistic(null),D=u&&!!d,I=Ss({placement:"above",focusTrigger:"always",isEnabled:D}),O=h.useCallback((H,q)=>{i==null||i(H),a&&z(async()=>{_(H),q!==void 0&&B(q),await a(H)})},[i,a,z,_,B]),L=h.useMemo(()=>({value:$?N:void 0,onChange:$?O:void 0,isDisabled:u,hasDisabledMessage:D,isReadOnly:f,loadingValue:R}),[$,N,O,u,D,f,R]);return o.jsxs(_c,{...b,ref:x,"data-testid":k,label:e,isLabelHidden:t,description:n,inputID:j,labelID:A,isGroupLabel:!0,descriptionID:n?M:void 0,isDisabled:u,status:s?{type:s.type,message:s.message,messageID:s.message?T:void 0}:void 0,statusVariant:"detached",width:g,xstyle:v,...ne(J("checkbox-list"),{className:y,style:m}),children:[o.jsx(Mg,{value:L,children:o.jsx("div",{ref:H=>{I.ref(H)},role:"group","aria-labelledby":A,"aria-describedby":[n?M:null,s!=null&&s.message?T:null,D?I.describedBy:null].filter(Boolean).join(" ")||void 0,children:o.jsx(Jt,{density:l,hasDividers:c,children:p})})}),D&&I.renderTooltip(d)]})}h5.displayName="CheckboxList";const I6={withCounter:{kAmcRD:"xfrknyr",$$css:!0},withDivider:{kt9PQ7:"x92x3c3",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},gP={noRadius:{kaIpWk:"x2u8bby",$$css:!0}};function Je({label:e,description:t,startContent:n,endContent:s,onClick:r,interactiveRef:i,href:a,target:l,rel:c,isDisabled:u=!1,isSelected:d=!1,xstyle:f,className:p,style:x,ref:g,...v}){const y=h.use(w1),m=(y==null?void 0:y.density)??"balanced",k=(y==null?void 0:y.hasDividers)??!1,b=(y==null?void 0:y.listStyle)??"none",j=b!=="none",A=b==="disc"?o.jsx("span",{className:"xoi2r2e x9f619 x78zum5 x6s0dn4 xl56j7k x2lah0s x12xnipv x1233pnv",children:o.jsx("span",{className:"x1v4s8kt xols6we x16rqkct x19aspcf"})}):b==="circle"?o.jsx("span",{className:"xoi2r2e x9f619 x78zum5 x6s0dn4 xl56j7k x2lah0s x12xnipv x1233pnv",children:o.jsx("span",{className:"x1v4s8kt xols6we x16rqkct xmkeg23 x1y0btm7 xqcx1ss xjbqb8w"})}):b==="decimal"?o.jsx("span",{className:"xoi2r2e x2lah0s x1tgivj0 xjm74w1 xw6l6zx x12xnipv xc2ndz5"}):null;return o.jsx(qd,{as:"li",ref:g,marker:A,startContent:n,label:e,description:t,endContent:s,onClick:r,interactiveRef:i,href:a,target:l,rel:c,isDisabled:u,isSelected:d,density:m,xstyle:[j&&I6.withCounter,k&&I6.withDivider,k&&gP.noRadius,f],...ne(J("list-item"),{className:p,style:x}),...v})}Je.displayName="ListItem";const mP={selected:{kWkggS:"xgcxg3y",$$css:!0}};function dx({label:e,"aria-label":t,value:n,description:s,endContent:r,isDisabled:i=!1,isLoading:a=!1,isChecked:l,onCheck:c,ref:u,xstyle:d,className:f,style:p,onClick:x,...g}){const v=ze(),y=h.use(Mg);if(y&&y.value!==void 0&&n===void 0)throw new Error("CheckboxListItem requires a `value` prop when used inside CheckboxList with a value array.");const m=t??(typeof e=="string"?e:v("@astryx.checkboxList.item.checkbox"));Hd("CheckboxListItem",'`label` is a ReactNode, so the checkbox falls back to the generic accessible name "Checkbox". Pass `aria-label` with a concise string equivalent of the visible label so screen readers can tell items apart.',typeof e!="string"&&t==null);const k=h.use(w1),j=((k==null?void 0:k.density)??"balanced")==="compact"?"sm":"md",A=((y==null?void 0:y.isDisabled)??!1)||i,M=(y==null?void 0:y.isReadOnly)??!1,T=a||((y==null?void 0:y.loadingValue)!=null&&n!==void 0?y.loadingValue===n:!1);let z=!1;y&&y.value!==void 0&&n!==void 0?z=y.value.includes(n):l!==void 0&&(z=l);const $=!M&&(y!=null||c!=null),E=h.useRef(null),N=$||x!=null,_=()=>{var R,B;if(!(A||M||T))if(y&&y.value!==void 0&&n!==void 0)y.value.includes(n)?(R=y.onChange)==null||R.call(y,y.value.filter(I=>I!==n),n):(B=y.onChange)==null||B.call(y,[...y.value,n],n);else{const D=z!==!0;c==null||c(D)}};return o.jsx(Je,{...g,ref:u,label:e,description:s,endContent:r,isDisabled:A,interactiveRef:N?E:void 0,"aria-busy":T||void 0,xstyle:[z===!0&&!A&&!M&&mP.selected,d],className:f,style:p,startContent:o.jsx(Sh,{ref:E,label:m,isLabelHidden:!0,value:z,onChange:()=>_(),onClick:x,isDisabled:A,isReadOnly:M,isLoading:T,size:j})})}dx.displayName="CheckboxListItem";const Fy=120;function yP(e){let t=0,n=0;const s=[];for(const l of e){const c=l.width;if((c==null?void 0:c.type)==="pixel")n+=c.value;else{const u=(c==null?void 0:c.value)??1,d=c!=null?c.minWidth??Fy:0;t+=u,s.push({key:l.key,proportion:u,minWidth:d})}}let r=0;if(t>0)for(const l of s){const c=l.minWidth*t/l.proportion;c>r&&(r=c)}const i=n+r,a=new Map;for(const l of e){const c=l.width,u={};if((c==null?void 0:c.type)==="pixel")u.width=`${c.value}px`,u.minWidth=`${c.value}px`;else{const d=(c==null?void 0:c.value)??1;if(t>0&&(u.width=`${d/t*100}%`),c!=null){const f=c.minWidth??Fy;u.minWidth=`${f}px`}}a.set(l.key,{style:u})}return{columns:a,tableMinWidth:i}}function vP(e=1,t){return{type:"proportional",value:e,minWidth:(t==null?void 0:t.minWidth)??Fy}}function L6(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function kP(e,t){const n=e[t];return n==null?"":n instanceof Date?n.toISOString():typeof n=="string"||typeof n=="number"||typeof n=="boolean"||typeof n=="bigint"?String(n):""}function bP(e){return e==null?0:typeof e=="string"?e.length:typeof e=="number"||typeof e=="boolean"?String(e).length:0}function wP(e){if(e==null||typeof e!="string"&&typeof e!="number"&&typeof e!="boolean")return 0;const t=String(e);let n=0,s=0;for(let r=0;r<=t.length;r++)r===t.length||t[r]===" "||t[r]===" "||t[r]===`
|
|
152
|
-
`?(s>n&&(n=s),s=0):s++;return n}const jP=60,SP=8;function CP(e){if(e.length===0)return[];const t=e[0],n=Object.keys(t),s=e.slice(0,Math.min(5,e.length));return n.map(i=>{const a=L6(i).length;let l=a,c=a;for(const u of s){const d=bP(u[i]);d>l&&(l=d);const f=wP(u[i]);f>c&&(c=f)}return{key:i,headerLen:a,maxContentLen:l,maxWordLen:c}}).map(i=>{const a=i.maxContentLen<=6?1:i.maxContentLen<=15?2:3,l=Math.max(Math.max(i.headerLen,i.maxWordLen)*SP,jP);return{key:i.key,header:L6(i.key),width:vP(a,{minWidth:l})}})}const O6={x139im0d:"x139im0d",$$css:!0},CC={cell:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",ks0D6T:"x1m189uc",$$css:!0}},EP={cell:{kVQacm:"xb3r6kr",kHjlTd:"x1mzt3pk",kTgw9:"x13faqbe",ks0D6T:"x1m189uc",$$css:!0}},EC={compact:{kZCmMZ:"x5uh4xs",kwRFfy:"xbg7gas",$$css:!0},balanced:{kZCmMZ:"x9bi00s",kwRFfy:"xpilulx",$$css:!0},spacious:{kZCmMZ:"x18c6q21",kwRFfy:"x1wzlfcn",$$css:!0}},Dg=h.createContext(null);Dg.displayName="TableContext";const $P={row:{kWkggS:"x1dnou9g","--table-row-overlay":"x1rht92",$$css:!0}},AP={row:{kWkggS:"xe9uy6x","--table-row-overlay":"x1pkcbo2",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0}},MP={row:{kWkggS:"x1dnou9g xe9uy6x","--table-row-overlay":"x1rht92 x1pkcbo2",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0}};function fx({children:e,xstyle:t,ref:n,isHeaderRow:s=!1,...r}){const i=h.use(Dg);if(!i)return o.jsx("tr",{ref:n,...r,...ne(J("table-row"),G(O6,t)),children:e});const a=[];return s||(i.isStriped&&i.hasHover?a.push(MP.row):i.isStriped?a.push($P.row):i.hasHover&&a.push(AP.row)),i.dividers==="rows"||i.dividers,t&&a.push(...t),o.jsx("tr",{ref:n,...r,...ne(J("table-row"),G(O6,...a)),children:e})}fx.displayName="TableRow";const i0={trigger:{kVAEAm:"x1n2onr6",k7VYTy:"xpdipgo",$$css:!0},menu:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",kskxy:"xuyqlj2",kORKVm:"x1odjw0f","--_dropdown-menu-radius":"x1fcsqxe","--_dropdown-menu-padding":"xgory14",kmVPX3:"x9epnlk",kaIpWk:"x1n97fys",kWkggS:"x1prclbq",kGVxlE:"x1i5ehqx",kSiTet:"x1hc1fzr",k1ekBW:"x19991ni",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kfSwDN:"x87ps6o",$$css:!0},popover:{k7Eaqz:"x5w4yej",$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:(typeof e=="number"?`${e}px`:e)!=null?"xkj4a21":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}]};function p5({children:e,menuWidth:t,size:n="md",label:s,isDisabled:r=!1,onOpenChange:i,ref:a,className:l,style:c,xstyle:u,triggerXstyle:d,"data-testid":f,...p}){const x=ze(),g=s??x("@astryx.contextMenu.label"),{items:v,menuContent:y,...m}=p,k=v??[],b=y,j=h.useId(),A=h.useRef({x:0,y:0}),M=h.useRef(null),T=h.useRef(null),z=h.useRef(null),[$,E]=h.useState(!1),N=Dd({mode:"context",onHide:h.useCallback(()=>{E(!1),i==null||i(!1);const fe=z.current;z.current=null,fe&&document.contains(fe)&&fe.focus()},[i]),onShow:h.useCallback(()=>{E(!0),i==null||i(!0)},[i]),lightDismiss:!1}),_=h.useCallback(()=>{N.hide()},[N]),{listRef:R,handleKeyDown:B,focusFirst:D,focusItem:I,ownsEvent:O,getItems:L}=Tc({itemSelector:$g,boundarySelector:X4,wrap:!1,onEscape:_}),H=W4({getItemLabels:()=>L().map(fe=>fe.textContent),onMatch:I,getCurrentIndex:()=>L().findIndex(fe=>fe===document.activeElement||fe.contains(document.activeElement))});h.useEffect(()=>{if(!$)return;const fe=se=>{const ye=R.current;ye&&!ye.contains(se.target)&&_()};return document.addEventListener("mousedown",fe),()=>{document.removeEventListener("mousedown",fe)}},[$,_,R]),h.useEffect(()=>{if(!$)return;const fe=se=>{se.key==="Escape"&&(se.isComposing||se.keyCode===229||(se.preventDefault(),_()))};return document.addEventListener("keydown",fe),()=>{document.removeEventListener("keydown",fe)}},[$,_]);const q=h.useCallback(fe=>{if(O(fe)){if(fe.key==="Enter"||fe.key===" "){fe.preventDefault();const se=document.activeElement;se&&Eg.has(se.getAttribute("role")??"")&&se.click();return}if(fe.key==="Tab"){_();return}if(H.onKeyDown(fe)){fe.preventDefault();return}B(fe)}},[B,_,H,O]),U=h.useCallback((fe,se,ye)=>{A.current={x:fe,y:se};const me=M.current;me&&(me.style.left=`${fe}px`,me.style.top=`${se}px`),z.current=document.activeElement instanceof HTMLElement?document.activeElement:ye,N.show(),requestAnimationFrame(()=>D())},[N,D]),X=h.useCallback(fe=>{if(r)return;fe.preventDefault();const se=T.current,ye=se==null?void 0:se.getBoundingClientRect(),me=fe.clientX===0&&fe.clientY===0&&fe.detail===0,P=me||!ye?0:fe.clientX-ye.left,V=me||!ye?(ye==null?void 0:ye.height)??0:fe.clientY-ye.top;U(P,V,fe.currentTarget)},[r,U]),Z=eH({disabled:r,onLongPress:h.useCallback(fe=>{var ye;const se=(ye=T.current)==null?void 0:ye.getBoundingClientRect();U(se?fe.x-se.left:fe.x,se?fe.y-se.top:fe.y,T.current)},[U])}),ie=t?i0.popoverCustomWidth(t):i0.popover,ae=h.useMemo(()=>({closeMenu:_,menuSize:n}),[_,n]),xe=v!==void 0?Z4(k):b;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:Ft(a,T),onContextMenu:X,...Z,...m,"data-testid":f,...G(i0.trigger,...d?Array.isArray(d)?d:[d]:[]),children:[e,o.jsx("span",{ref:Ft(M,N.ref),"aria-hidden":"true",...ne({className:"x10l6tqk xnalus7 xqtp20y x47corl"},{style:{left:`${A.current.x}px`,top:`${A.current.y}px`}})})]}),N.render(o.jsx("div",{ref:R,id:j,role:"menu","aria-label":g,onKeyDown:q,onContextMenu:fe=>fe.preventDefault(),...ne(J("context-menu"),G(i0.menu,u),l,c),children:o.jsx(wh,{value:ae,children:xe})}),{placement:"below",alignment:"start",xstyle:[ie,wo.below]})]})}p5.displayName="ContextMenu";function $C(e){const t=[],n=new Map;for(const r of e){const i=r.group??"__ungrouped__";let a=n.get(i);a||(a=[],n.set(i,a),t.push(i)),a.push(r)}const s=[];return t.forEach((r,i)=>{i>0&&s.push({type:"divider"});for(const a of n.get(r)??[])s.push({label:typeof a.label=="string"?a.label:a.id,icon:a.checked?o.jsx(Te,{icon:"check",size:"xsm","aria-hidden":!0}):a.icon,isDisabled:a.disabled,onClick:a.onSelect})}),s}function TP({element:e,getActions:t,triggerXstyle:n}){const[s,r]=h.useState(null);return o.jsx(p5,{items:s??[],triggerXstyle:n,onOpenChange:i=>{r(i?$C(t()):null)},children:e})}function AC(e,t,n){return typeof t=="function"?o.jsx(TP,{element:e,getActions:t,triggerXstyle:n}):!t||t.length===0?e:o.jsx(p5,{items:$C(t),triggerXstyle:n,children:e})}function zP(e,t,n){const s=[];return(e.dividers==="rows"||e.dividers==="grid")&&s.push(t),(e.dividers==="columns"||e.dividers==="grid")&&s.push(n),s}function MC(e,t){return t?Array.isArray(t)?[...e,...t]:[...e,t]:e}function TC(){return h.use(Dg)}const NP={compact:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0},balanced:{k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0}},_P={compact:{kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0},balanced:{kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0},spacious:{kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0}},RP={compact:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},balanced:{k8WAf4:"xce4md1",kg3NbH:"xrrkdod",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",$$css:!0}},D6={fill:{k1xSpc:"x1lliihq",kB7OPa:"x9f619",kZKoxP:"x5yr21d",kzqmXN:"xh8yej3",$$css:!0}},IP={cell:{kZKoxP:"x5yr21d",$$css:!0}},LP={cell:{kt9PQ7:"x92x3c3 x1wp2rvj",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},OP={cell:{ke9TFa:"xw8tdv1 x1qlsc9e",k8ry5P:"x18b5jzi",kBCPoo:"x1gejf6u",$$css:!0}},DP={middle:{kXLuUW:"xxymvpz",$$css:!0},top:{kXLuUW:"x16dsc37",$$css:!0},bottom:{kXLuUW:"x3ajldb",$$css:!0}};function x5({children:e,xstyle:t,ref:n,className:s,style:r,contextMenuActions:i,...a}){const l=TC(),c=typeof i=="function"||Array.isArray(i)&&i.length>0,u=l?[c?_P[l.density]:NP[l.density],l.textOverflow==="truncate"?CC.cell:EP.cell,EC[l.density],DP[l.verticalAlign],...zP(l,LP.cell,OP.cell),...c?[IP.cell]:[]]:[],d=c&&l?[D6.fill,RP[l.density]]:c?D6.fill:void 0,f=AC(e,i,d);return o.jsx("td",{ref:n,...a,...ne(J("table-cell",{density:l==null?void 0:l.density}),G(...MC(u,t)),s,r),children:f})}x5.displayName="TableCell";const BP={compact:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",kGuDYH:"xcr08ib",kB7OPa:"x9f619",$$css:!0},balanced:{k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kGuDYH:"xcr08ib",kB7OPa:"x9f619",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",kGuDYH:"xcr08ib",kB7OPa:"x9f619",$$css:!0}},HP={cell:{k63SB2:"x2mo6ok",kMwMTN:"xv1l7n4",k9WMMc:"x1yc453h",$$css:!0}},qP={cell:{kt9PQ7:"x92x3c3",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},PP={cell:{ke9TFa:"xw8tdv1 x1qlsc9e",k8ry5P:"x18b5jzi",kBCPoo:"x1gejf6u",$$css:!0}};function g5({children:e,xstyle:t,ref:n,className:s,style:r,contextMenuActions:i,...a}){const l=TC(),c=[];l&&(c.push(HP.cell,BP[l.density],qP.cell,CC.cell,EC[l.density]),(l.dividers==="columns"||l.dividers==="grid")&&c.push(PP.cell));const u=AC(e,i);return o.jsx("th",{ref:n,...a,...ne(J("table-header-cell",{density:l==null?void 0:l.density}),G(...MC(c,t)),s,r),children:u})}g5.displayName="TableHeaderCell";function m5({ref:e,children:t,xstyle:n,className:s,style:r,...i}){return o.jsx("thead",{ref:e,...ne(J("table-header"),G(n),s,r),...i,children:t})}m5.displayName="TableHeader";function y5({ref:e,children:t,xstyle:n,className:s,style:r,...i}){return o.jsx("tbody",{ref:e,...ne(J("table-body"),G(n),s,r),...i,children:t})}y5.displayName="TableBody";const B6={container:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",k9WMMc:"x2b8uid",kOIVth:"x18g69wz",k8WAf4:"xmfvnks",kg3NbH:"xm7rs69",$$css:!0},containerCompact:{kOIVth:"x1txdalj",k8WAf4:"x1na6nto",kg3NbH:"x1pzlopt",$$css:!0}};function Pi({title:e,description:t,icon:n,actions:s,headingLevel:r=3,isCompact:i=!1,xstyle:a,className:l,style:c,ref:u,...d}){const f=`h${r}`;return o.jsxs("div",{ref:u,role:"status",...ne(J("empty-state",{variant:i?"compact":null}),G(B6.container,i&&B6.containerCompact,a),l,c),...d,children:[n!=null&&o.jsx("div",{"aria-hidden":"true",children:n}),o.jsxs("div",{className:"x78zum5 xdt5ytf x6s0dn4 xxc7z9f",children:[h.createElement(f,{0:{className:"x1ghz6dp xjb2p0i x18juvz8 x2mo6ok xf74fhv x1tgivj0"},1:{className:"x1ghz6dp xjb2p0i x2mo6ok xf74fhv x1tgivj0 xcr08ib"}}[!!i<<0],e),t!=null&&o.jsx("div",{...{0:{className:"x1ghz6dp xjb2p0i xjm74w1 x1sodnla xw6l6zx xv1l7n4"},1:{className:"x1ghz6dp xjb2p0i x1sodnla xw6l6zx xv1l7n4 x141an7d"}}[!!i<<0],children:t})]}),s!=null&&o.jsx("div",{...{0:{className:"x78zum5 x1q0g3np x6s0dn4 x1txdalj xcsaf9d"},1:{className:"x78zum5 x6s0dn4 x1txdalj xcsaf9d xdt5ytf"}}[!!i<<0],children:s})]})}Pi.displayName="EmptyState";const r2={table:{kzqmXN:"xh8yej3",kLvRdT:"x1mwwwfo",kheTzg:"x1gukg7c",kPzzVL:"x140o2bo",$$css:!0},tableAutoLayout:{kPzzVL:"x1drmoe9",$$css:!0}};function zl(e,t,n,...s){return e.reduce((r,i,a)=>{const l=t(i);if(!l)return r;try{return l(r,...s)}catch(c){return _j("Table",`Plugin at index ${a} threw in transform:`,c),r}},n)}const UP=[];function FP(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 VP({item:e,rowIndex:t,rowKey:n,columns:s,plugins:r,textOverflow:i,RowComponent:a,CellComponent:l,ariaRowIndex:c}){const u=s.map((p,x)=>{var j;const g={};p.align&&(g.style={textAlign:p.align});const y=zl(r,A=>A.transformBodyCell,{htmlProps:g,xstyle:[],columnIndex:x,columns:s},p,e,x,s),m=!p.renderCell,k=m?kP(e,p.key):((j=p.renderCell)==null?void 0:j.call(p,e))??null;let b;return m&&i==="truncate"&&typeof k=="string"&&k.length>0?b=o.jsx(K,{type:"body",maxLines:1,children:k}):b=k,o.jsx(l,{...y.htmlProps,contextMenuActions:y.contextMenuActions,xstyle:y.xstyle,children:b},p.key)}),d=zl(r,p=>p.transformBodyRow,{htmlProps:c==null?{}:{"aria-rowindex":c},xstyle:[],children:o.jsx(o.Fragment,{children:u})},e,t);return o.jsx(a,{ref:d.ref,...d.htmlProps,xstyle:d.xstyle,children:d.children},n)}function GP(e,t){if(e.rowKey!==t.rowKey||e.rowIndex!==t.rowIndex||e.ariaRowIndex!==t.ariaRowIndex||e.columns!==t.columns||e.plugins!==t.plugins||e.textOverflow!==t.textOverflow||e.RowComponent!==t.RowComponent||e.CellComponent!==t.CellComponent)return!1;if(e.item===t.item)return!0;const n=e.item,s=t.item,r=Object.keys(s);if(Object.keys(n).length!==r.length)return!1;for(const i of r)if(n[i]!==s[i])return!1;return!0}const WP=h.memo(VP,GP);function KP({data:e,columns:t,idKey:n,plugins:s,children:r,textOverflow:i="wrap",scrollWrapper:a,emptyState:l,rowIndexStart:c,rowCount:u,xstyle:d,className:f,style:p,ref:x,...g}){const v=ze(),y=s??UP,m=c!=null||u!=null,k=c??1,b=m?u??-1:void 0,j=fx,A=x5,M=g5,T=t??(e?CP(e):[]),z=zl(y,H=>H.transformColumns,T),$=h.useRef(z);FP($.current,z)||($.current=z);const E=$.current,N=yP(E),_=zl(y,H=>H.transformTable,{htmlProps:{},xstyle:r?[r2.table,r2.tableAutoLayout]:[r2.table]}),R=E.map((H,q)=>{var le;const U=H.header??H.key,X={"data-column-key":H.key,scope:"col"};H.align&&(X.style={textAlign:H.align});const ie=zl(y,ce=>ce.transformHeaderCell,{htmlProps:X,xstyle:[],content:U,columnIndex:q,columns:E},H,q,E),ae=((le=N.columns.get(H.key))==null?void 0:le.style)??{},xe=ie.htmlProps.style,fe={...ie.htmlProps,style:xe?{...ae,...xe}:ae},se=ie.content??U,ye=typeof se=="string"&&se.length>0?{title:se}:{},{before:me,after:P,overlay:V,below:Y}=ie,F=me!=null||P!=null||V!=null||Y!=null?o.jsxs(o.Fragment,{children:[me,P!=null?o.jsxs("div",{className:"x3nfvp2 x6s0dn4 xzye2dw xeuugli",children:[se,P]}):se,V,Y]}):se;return o.jsx(M,{...fe,...ye,contextMenuActions:ie.contextMenuActions,xstyle:ie.xstyle,children:F},H.key)}),B=zl(y,H=>H.transformHeaderRow,{htmlProps:{},xstyle:[],children:o.jsx(o.Fragment,{children:R})}),D=e!=null&&e.length>0,I=E.length>0,O={..._.htmlProps.style,...p,...N.tableMinWidth>0?{minWidth:`${N.tableMinWidth}px`}:null};let L=o.jsx("table",{ref:x,...b!=null?{"aria-rowcount":b}:null,..._.htmlProps,...ne(J("base-table"),G(..._.xstyle,d),[_.htmlProps.className,f].filter(Boolean).join(" ")||void 0,O),...g,children:r||o.jsxs(o.Fragment,{children:[I&&o.jsx(m5,{children:o.jsx(j,{...B.htmlProps,isHeaderRow:!0,xstyle:B.xstyle,children:B.children})}),o.jsx(y5,{children:D?e.map((H,q)=>{const U=n==null?q:typeof n=="function"?n(H):String(H[n]);return o.jsx(WP,{item:H,rowIndex:q,rowKey:U,columns:E,plugins:y,textOverflow:i,RowComponent:j,CellComponent:A,ariaRowIndex:m?k+q:void 0},U)}):e!=null&&l!==!1&&o.jsx("tr",{children:o.jsx("td",{colSpan:E.length,children:l??o.jsx(Pi,{title:v("@astryx.table.noData"),isCompact:!0})})})})]})});if(a){const H=zl(y,q=>q.transformScrollWrapper,{htmlProps:{},xstyle:[]});L=o.jsx(a,{htmlProps:H.htmlProps,xstyle:H.xstyle,beforeTable:H.beforeTable,afterTable:H.afterTable,children:L})}for(let H=y.length-1;H>=0;H--){const q=y[H];if(q.transformTableContext)try{L=q.transformTableContext(L)}catch(U){_j("Table","Plugin threw in transformTableContext:",U)}}return L}const zC=KP;zC.displayName="BaseTable";const NC=["columnSettings","sort","tree","selection","pagination"],H6=new Map(NC.map((e,t)=>[e,t]));function XP(e){const t=NC.length;return e.sort(([n],[s])=>{const r=H6.get(n)??t,i=H6.get(s)??t;return r-i})}const o0=new Set(["transformColumns","transformTable","transformHeaderRow","transformHeaderCell","transformBodyRow","transformBodyCell","transformScrollWrapper","transformTableContext"]);function ZP(e,t){const n=Object.keys(t);for(const r of n)o0.has(r)||oc("Table",`Plugin "${e}" has unknown key "${r}". Valid keys: ${[...o0].join(", ")}. This key will be ignored.`);for(const r of n)if(o0.has(r)){const i=t[r];i!=null&&typeof i!="function"&&oc()}n.some(r=>o0.has(r)&&typeof t[r]=="function")||oc()}function YP(e,t){const n=h.useRef(null);if(n.current!=null){const i=n.current;if(i.basePlugins===e&&i.userPlugins===t)return i.result;if(i.basePlugins===e&&QP(i.userPlugins,t))return i.userPlugins=t,i.result}const s=t?XP(Object.entries(t)).map(([,i])=>i):[],r=[...e,...s];if(t)for(const[i,a]of Object.entries(t))ZP(i,a);return n.current={basePlugins:e,userPlugins:t,result:r},r}function QP(e,t){if(e===t)return!0;if(e==null||t==null)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}const JP={base:{kMv6JI:"xjb2p0i",kMwMTN:"x1tgivj0",$$css:!0}},q6={base:{kXHlph:"xw2csxc",kuHK5b:"x5lxg6s",$$css:!0},containerBleed:{keTefX:"xojxgvx",k71WvV:"x1fcf3bl",kzqmXN:"xx6qvi6",keoZOQ:"xkibk3",k1K539:"xlayyun",$$css:!0}};function eU({children:e,htmlProps:t,xstyle:n,beforeTable:s,afterTable:r}){const i=ze(),{ref:a,...l}=t??{};return o.jsxs("div",{ref:a,tabIndex:0,role:"group","aria-label":i("@astryx.table.label"),...l,...ne(J("table-scroll-wrapper"),G(q6.base,q6.containerBleed,...n??[])),children:[s,e,r]})}function tU(){return{transformTable(e){const t=e.htmlProps.className??"",n=J("table").className;return{...e,htmlProps:{...e.htmlProps,className:t?`${t} ${n}`:n},xstyle:[...e.xstyle,JP.base]}}}}function nU({density:e="balanced",dividers:t="rows",isStriped:n=!1,hasHover:s=!1,verticalAlign:r="middle",textOverflow:i="wrap",plugins:a,columns:l,data:c,ref:u,...d}){const f=h.useMemo(()=>tU(),[]),p=h.useMemo(()=>[f],[f]),x=YP(p,a),g=h.useMemo(()=>({density:e,dividers:t,isStriped:n,hasHover:s,verticalAlign:r,textOverflow:i}),[e,t,n,s,r,i]);return o.jsx(Dg,{value:g,children:o.jsx(zC,{ref:u,data:c,columns:l,plugins:x,textOverflow:i,scrollWrapper:eU,...d})})}const _C=nU;_C.displayName="Table";function sU(e,t,n){if(e.length===0||t>e[e.length-1]){const s=[...e,t];for(;s.length>n;)s.shift();return s}return e}function rU(e,t,n,s){const r=t+e.length;if(n.length===0)return null;const i=n[0];if(r<=i)return null;const a=[];let l=t;l<i&&i<r&&(a.push({key:`settled-${s}`,text:e.slice(0,i-t),fading:!1}),l=i);for(let c=0;c<n.length;c++){const u=n[c],d=c+1<n.length?n[c+1]:r;if(u>=r||d<=l)continue;const f=Math.max(u,l),p=Math.min(d,r);f>=p||(a.push({key:`fade-${s}-b${u}`,text:e.slice(f-t,p-t),fading:!0}),l=p)}return a.length>0?a:null}const ll={label:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",kXLuUW:"x11njtxf",kZKoxP:"x1grt7ep",kGuDYH:"x141an7d",k63SB2:"xv8on6e",kLWn49:"x1ltkj2j",kMwMTN:"xv1l7n4",kaIpWk:"xh6dtrn",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kVAM5u:"x14i3s5s",kg3NbH:"xf314gf",keTefX:"xladpz9",kybGjl:"x1hl2dhg",k1ekBW:"x1eaenvl",kIyJzY:"x2rcmwa",kAMwcw:"xlr8y92",ks0D6T:"x55n99s",kVQacm:"xb3r6kr",$$css:!0},labelWithIcon:{kZCmMZ:"x138rykx",$$css:!0},labelInteractive:{kkrTdU:"x1ypdohk",$$css:!0},labelHover:{kWkggS:"xe9uy6x",kMwMTN:"xv1l7n4 x140uwzg",$$css:!0},number:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kXLuUW:"x1v0h343",kGuDYH:"x141an7d",k63SB2:"x2mo6ok",kLWn49:"x1ltkj2j",kMwMTN:"xv1l7n4",kWkggS:"xgcxg3y",kaIpWk:"xjspbzw",k7Eaqz:"x16asifk",kZKoxP:"x1grt7ep",kg3NbH:"x7a5moj",kybGjl:"x1hl2dhg",k1ekBW:"x15406qy",kIyJzY:"x2rcmwa",kAMwcw:"xlr8y92",$$css:!0},numberInteractive:{kkrTdU:"x1ypdohk",$$css:!0},numberHover:{kWkggS:"xgcxg3y xe9uy6x",$$css:!0}};function RC({ref:e,source:t,number:n,variant:s="label",xstyle:r,className:i,style:a,"data-testid":l,...c}){const u=ze(),d=t.title??String(n),f=t.url,p=t.icon!=null&&typeof t.icon!="string"?t.icon:null,x=t.src??(typeof t.icon=="string"?t.icon:void 0),g=p!=null||x!=null,v=f?"a":"span",y=f?"doc-noteref":void 0,m=f?{href:f,target:"_blank",rel:"noopener noreferrer",title:d}:{title:d},k=e;return s==="number"?o.jsx(v,{...c,ref:k,role:y,"aria-label":u("@astryx.citation.label",{number:n,title:d}),"data-testid":l,...m,...ne(J("citation",{variant:s}),G(ll.number,f!=null&&ll.numberHover,f!=null&&ll.numberInteractive,r),i,a),children:n}):o.jsxs(v,{...c,ref:k,role:y,"aria-label":u("@astryx.citation.label",{number:n,title:d}),"data-testid":l,...m,...ne(J("citation",{variant:s}),G(ll.label,g&&ll.labelWithIcon,f!=null&&ll.labelHover,f!=null&&ll.labelInteractive,r),i,a),children:[g&&o.jsx("span",{"aria-hidden":"true",className:"x3nfvp2 x6s0dn4 xl56j7k x12xnipv x6b6gus xjspbzw x10xzikg x1litavf x1y0btm7 x14i3s5s xb3r6kr x2lah0s",children:p!=null?Lr(p,{size:"sm"}):o.jsx("img",{src:x,alt:"",className:"x1ad1g3v x9gl9lo"})}),o.jsx("span",{className:"xb3r6kr xlyipyv xuxw1ft xeuugli",children:d})]})}RC.displayName="Citation";const iU={sourceIds:void 0,autolink:void 0};function v5(e){if(e==null)return iU;if(typeof e.has=="function")return{sourceIds:e,autolink:void 0};const t=e;return{sourceIds:t.sourceIds,autolink:t.autolink}}const oU=/^ {0,3}\[([^\]^](?:\\.|[^\]\\])*)\]:[ \t]*(?:<([^<>\n]*)>|(\S+))([ \t]+(?:"[^"\n]*"|'[^'\n]*'|\([^()\n]*\)))?[ \t]*$/,aU=/^ {0,3}(?:"[^"\n]*"|'[^'\n]*'|\([^()\n]*\))[ \t]*$/;function j1(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function lU(e){const t=oU.exec(e);if(t==null)return null;const n=j1(t[1]),s=t[2]!=null?t[2]:t[3];return n===""||s==null?null:{label:n,destination:s,hasTitle:t[4]!=null}}function IC(e){const t=e.split(`
|
|
153
|
-
`),n=new Map,s=new Array(t.length).fill(!0);let r=!0,i=!1,a="";for(let c=0;c<t.length;c++){const u=t[c];if(i){u.startsWith(a)?(i=!1,a="",r=!0):r=!1;continue}const d=u.match(/^(`{3,}|~{3,})/);if(d){i=!0,a=d[1],r=!1;continue}if(u.trim()===""){r=!0;continue}if(r){const f=lU(u);if(f!=null){n.has(f.label)||n.set(f.label,f.destination),s[c]=!1,!f.hasTitle&&c+1<t.length&&aU.test(t[c+1])&&(s[c+1]=!1,c++);continue}}r=/^ {0,3}#{1,6}(?: |\t|$)/.test(u)||k5(u)}if(n.size===0)return{defs:n,cleaned:e};const l=t.filter((c,u)=>s[u]).join(`
|
|
154
|
-
`);return{defs:n,cleaned:l}}function cU(e){return e.size===0?"":[...e].sort((t,n)=>t[0]<n[0]?-1:t[0]>n[0]?1:0).map(([t,n])=>`${t}\0${n}`).join("")}function uU(e,t,n,s){const r=e.indexOf("]",t+1);if(r===-1)return null;const i=e.slice(t+1,r);if(e[r+1]==="["){const l=e.indexOf("]",r+2);if(l!==-1){const c=e.slice(r+2,l),u=c===""?i:c,d=n.get(j1(u));if(d!=null)return{node:{type:"link",href:d,children:aa(i,s)},end:l+1}}}if(i.trim()==="")return null;const a=n.get(j1(i));return a==null?null:{node:{type:"link",href:a,children:aa(i,s)},end:r+1}}function dU(e,t,n){const s=e.indexOf("]",t+2);if(s===-1)return null;const r=e.slice(t+2,s);if(e[s+1]==="["){const a=e.indexOf("]",s+2);if(a!==-1){const l=e.slice(s+2,a),c=l===""?r:l,u=n.get(j1(c));if(u!=null)return{node:{type:"image",src:u,alt:r},end:a+1}}}if(r.trim()==="")return null;const i=n.get(j1(r));return i==null?null:{node:{type:"image",src:i,alt:r},end:s+1}}function P6(e,t){let n=1;for(let s=t;s<e.length;s++)if(e[s]==="(")n++;else if(e[s]===")"&&(n--,n===0))return s;return-1}function Gc(e){return e==null?!1:/\w/.test(e)}function fU(e,t,n){if(!n.sourceIds||e[t]!=="【")return null;const s=e.indexOf("】",t+1);if(s===-1)return null;const r=e.slice(t+1,s);return r.length===0||!n.sourceIds.has(r)?null:{sourceId:r,end:s+1}}function hU(e,t,n){if(!n.sourceIds||e[t]!=="[")return null;const s=e.indexOf("]",t+1);if(s===-1||e[s+1]==="(")return null;const r=e.slice(t+1,s);return r.length===0||!n.sourceIds.has(r)?null:{sourceId:r,end:s+1}}function pU(e,t){return S1(e,v5(t))}function S1(e,t){const n=aa(e,t);return t.autolink==="gfm"?BC(n):n}function aa(e,t){const n=[];let s=0;for(;s<e.length;){if(e[s]==="\\"&&s+1<e.length){n.push({type:"text",content:e[s+1]}),s+=2;continue}if(e[s]==="`"){const l=e[s+1]==="`"?e[s+2]==="`"?3:2:1,c=s+l,u=e.indexOf("`".repeat(l),c);if(u!==-1){n.push({type:"code",content:e.slice(c,u)}),s=u+l;continue}}{const l=fU(e,s,t);if(l){n.push({type:"citation",sourceId:l.sourceId}),s=l.end;continue}}if(e[s]==="!"&&e[s+1]==="["){const l=e.indexOf("]",s+2);if(l!==-1&&e[l+1]==="("){const c=P6(e,l+2);if(c!==-1){n.push({type:"image",src:e.slice(l+2,c),alt:e.slice(s+2,l)}),s=c+1;continue}}}if(t.linkDefs!=null&&e[s]==="!"&&e[s+1]==="["){const l=dU(e,s,t.linkDefs);if(l){n.push(l.node),s=l.end;continue}}{const l=hU(e,s,t);if(l){n.push({type:"citation",sourceId:l.sourceId}),s=l.end;continue}}if(e[s]==="["){const l=e.indexOf("]",s+1);if(l!==-1&&e[l+1]==="("){const c=P6(e,l+2);if(c!==-1){n.push({type:"link",href:e.slice(l+2,c),children:aa(e.slice(s+1,l),t)}),s=c+1;continue}}}if(t.linkDefs!=null&&e[s]==="["){const l=uU(e,s,t.linkDefs,t);if(l){n.push(l.node),s=l.end;continue}}if(e[s]==="*"&&e[s+1]==="*"&&e[s+2]==="*"||e[s]==="_"&&e[s+1]==="_"&&e[s+2]==="_"){const l=e.slice(s,s+3),c=e[s]==="_";if(!(c&&Gc(e[s-1]))){const u=e.indexOf(l,s+3);if(u!==-1&&(!c||!Gc(e[u+3]))){n.push({type:"bold",children:[{type:"italic",children:aa(e.slice(s+3,u),t)}]}),s=u+3;continue}}}if(e[s]==="*"&&e[s+1]==="*"||e[s]==="_"&&e[s+1]==="_"){const l=e.slice(s,s+2),c=e[s]==="_";if(!(c&&Gc(e[s-1]))){const u=e.indexOf(l,s+2);if(u!==-1&&(!c||!Gc(e[u+2]))){n.push({type:"bold",children:aa(e.slice(s+2,u),t)}),s=u+2;continue}}}if(e[s]==="~"&&e[s+1]==="~"){const l=e.indexOf("~~",s+2);if(l!==-1){n.push({type:"strikethrough",children:aa(e.slice(s+2,l),t)}),s=l+2;continue}}if(e[s]==="*"||e[s]==="_"){const l=e[s]==="_";if(!(l&&Gc(e[s-1]))){const c=e.indexOf(e[s],s+1);if(c!==-1&&c>s+1&&(!l||!Gc(e[c+1]))){n.push({type:"italic",children:aa(e.slice(s+1,c),t)}),s=c+1;continue}}}let r=s+1;for(;r<e.length&&!"*_~`[!\\\n【".includes(e[r]);)r++;const i=e.slice(s,r);if(r<e.length&&e[r]===`
|
|
155
|
-
`){const l=i.replace(/ +$/,"");if(i.length-l.length>=2){if(l.length>0){const c=n[n.length-1];(c==null?void 0:c.type)==="text"?c.content+=l:n.push({type:"text",content:l})}n.push({type:"break"}),s=r+1;continue}}const a=n[n.length-1];(a==null?void 0:a.type)==="text"?a.content+=i:n.push({type:"text",content:i}),s=r}return n}const LC="[^\\s<]+",xU="https?:\\/\\/",OC="[A-Za-z0-9._%+-]+",U6="[A-Za-z0-9-]+",DC=`${U6}(?:\\.${U6})+`,gU="[a-zA-Z][a-zA-Z0-9+.-]*",mU="[^<>\\s]*",yU=new RegExp(`${xU}${LC}`,"g"),vU=new RegExp(`www\\.${LC}`,"g"),kU=new RegExp(`${OC}@${DC}`,"g"),bU=new RegExp(`<(${gU}:${mU})>`,"g"),wU=new RegExp(`<(${OC}@${DC})>`,"g"),F6=new Set("?!.,:*_~"),jU=new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._%+-@");function V6(e){let t=e;for(;t.length>0;){if(F6.has(t[t.length-1])){let n=t.length-1;for(;n>0&&F6.has(t[n-1]);)n--;t=t.slice(0,n);continue}if(t.endsWith(")")){let n=0,s=0;for(let r=0;r<t.length;r++)t[r]==="("?n++:t[r]===")"&&s++;if(s>n){t=t.slice(0,-1);continue}}break}return t}const SU=new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/=");function G6(e){return e==null?!0:!SU.has(e)}function CU(e){const t=[];{const r=new RegExp(bU.source,"g");let i;for(;(i=r.exec(e))!==null;){const a=i[1];t.push({start:i.index,end:i.index+i[0].length,href:a,display:a})}}{const r=new RegExp(wU.source,"g");let i;for(;(i=r.exec(e))!==null;){const a=i[1];t.push({start:i.index,end:i.index+i[0].length,href:`mailto:${a}`,display:a})}}{const r=new RegExp(yU.source,"g");let i;for(;(i=r.exec(e))!==null;){const a=e[i.index-1];if(!G6(a)||e.slice(i.index-2,i.index)==="](")continue;const l=V6(i[0]);l.length!==0&&t.push({start:i.index,end:i.index+l.length,href:l,display:l})}}{const r=new RegExp(vU.source,"g");let i;for(;(i=r.exec(e))!==null;){const a=e[i.index-1];if(!G6(a)||e.slice(i.index-3,i.index)==="://")continue;const l=V6(i[0]);l.length!==0&&t.push({start:i.index,end:i.index+l.length,href:`http://${l}`,display:l})}}{const r=new RegExp(kU.source,"g");let i;for(;(i=r.exec(e))!==null;){const a=e[i.index-1];a!=null&&jU.has(a)||e.slice(Math.max(0,i.index-7),i.index)!=="mailto:"&&t.push({start:i.index,end:i.index+i[0].length,href:`mailto:${i[0]}`,display:i[0]})}}t.sort((r,i)=>r.start-i.start);const n=[];let s=0;for(const r of t)r.start>=s&&(n.push(r),s=r.end);return n}function EU(e){const t=CU(e);if(t.length===0)return[{type:"text",content:e}];const n=[];let s=0;for(const r of t)r.start>s&&n.push({type:"text",content:e.slice(s,r.start)}),n.push({type:"link",href:r.href,children:[{type:"text",content:r.display}]}),s=r.end;return s<e.length&&n.push({type:"text",content:e.slice(s)}),n}function BC(e){const t=[];for(const n of e)if(n.type==="text"){const s=EU(n.content);for(const r of s){const i=t[t.length-1];r.type==="text"&&(i==null?void 0:i.type)==="text"?i.content+=r.content:t.push(r)}}else n.type==="bold"||n.type==="italic"||n.type==="strikethrough"?t.push({...n,children:BC(n.children)}):t.push(n);return t}function i2(e){let t=0;for(;t<e.length&&e[t]===" ";)t++;return t}function k5(e){const t=e.trim();if(t.length<3)return!1;const n=t.replace(/ /g,"");if(n.length<3)return!1;const s=n[0];if(s!=="-"&&s!=="*"&&s!=="_")return!1;for(let r=1;r<n.length;r++)if(n[r]!==s)return!1;return!0}function Q0(e){if(!e.includes("|"))return!1;const n=e.split("|").map(s=>s.trim()).filter(s=>s.length>0);return n.length>0&&n.every(s=>/^:?-+:?$/.test(s))}function $U(e){return!!(/^#{1,6} /.test(e)||/^(`{3,}|~{3,})/.test(e)||k5(e)||e.startsWith("> ")||e===">"||/^ {0,9}[-*+] /.test(e)||/^ {0,9}0*1[.)] /.test(e)||e.includes("|"))}function o2(e){let t=0,n=e.length;if(e.startsWith("|"))for(t=1;t<n&&e[t]===" ";)t++;for(;n>t&&e[n-1]===" ";)n--;n>t&&e[n-1]==="|"&&n--;const s=e.slice(t,n),r=[];let i="";for(let a=0;a<s.length;a++)s[a]==="\\"&&a+1<s.length&&s[a+1]==="|"?(i+="\\|",a++):s[a]==="|"?(r.push(i.trim()),i=""):i+=s[a];return r.push(i.trim()),r}function AU(e,t,n){const s=o2(e[t]).map(l=>({children:S1(l,n)})),r=o2(e[t+1]).map(l=>{const c=l.trim(),u=c.startsWith(":"),d=c.endsWith(":");return u&&d?"center":d?"right":u?"left":null}),i=[];let a=t+2;for(;a<e.length&&e[a].includes("|")&&e[a].trim()!=="";)i.push(o2(e[a]).map(l=>({children:S1(l,n)}))),a++;return{node:{type:"table",headers:s,alignments:r,rows:i},nextIndex:a}}function W6(e,t,n,s){const r=[],i=i2(e[t]),a=n?e[t].match(/^ *(\d+)([.)]) /):null,l=a?a[2]:".",c=`\\${l}`,u=n?new RegExp(`^ {${i}}\\d+${c} `):new RegExp(`^ {${i}}[-*+] `),d=a?parseInt(a[1],10):void 0;let f=!1,p=t;for(;p<e.length&&u.test(e[p]);){const x=n?e[p].replace(new RegExp(`^ *\\d+${c} `),""):e[p].replace(/^ *[-*+] /,""),g=x.match(/^\[([ xX])\] (.*)/);let v,y;g?(v=g[1].toLowerCase()==="x",y=g[2]):y=x,p++;const m=[];for(;p<e.length&&e[p].trim()!==""&&i2(e[p])>i;)m.push(e[p]),p++;if(m.length>0){const b=Math.min(...m.map(A=>i2(A))),j=m.map(A=>A.slice(b));y+=`
|
|
156
|
-
`+j.join(`
|
|
157
|
-
`)}r.push({checked:v,children:Il(y,s)});let k=p;for(;k<e.length&&e[k].trim()==="";)k++;k>p&&k<e.length&&u.test(e[k])&&(f=!0,p=k)}return{node:{type:"list",ordered:n,start:d,delimiter:n?l:void 0,loose:f||void 0,items:r},nextIndex:p}}function MU(e,t){return Il(e,v5(t))}function Il(e,t){const{defs:n,cleaned:s}=IC(e),r=t.linkDefs;let i;n.size===0?i=r:r==null?i=n:i=new Map([...n,...r]);const a=i!=null?{...t,linkDefs:i}:t,l=s.split(`
|
|
158
|
-
`),c=[];let u=0;for(;u<l.length;){const d=l[u];if(d.trim()===""){u++;continue}const f=d.match(/^(`{3,}|~{3,})(\w*)/);if(f){const v=f[1],y=f[2]||"plaintext",m=[];for(u++;u<l.length&&!l[u].startsWith(v);)m.push(l[u]),u++;u++,c.push({type:"codeblock",language:y,content:m.join(`
|
|
159
|
-
`)});continue}const p=d.match(/^(#{1,6}) +(.*)/);if(p){c.push({type:"heading",level:p[1].length,children:S1(p[2],a)}),u++;continue}if(k5(d)){c.push({type:"hr"}),u++;continue}const x=d.match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(x&&d.trim()===x[0]){c.push({type:"image",alt:x[1],src:x[2]}),u++;continue}if(u+1<l.length&&d.includes("|")&&Q0(l[u+1])){const v=AU(l,u,a);c.push(v.node),u=v.nextIndex;continue}if(d.startsWith("> ")||d===">"){const v=[];for(;u<l.length&&(l[u].startsWith("> ")||l[u]===">");)v.push(l[u].replace(/^> ?/,"")),u++;c.push({type:"blockquote",children:Il(v.join(`
|
|
160
|
-
`),a)});continue}if(/^ {0,9}[-*+] /.test(d)){const v=W6(l,u,!1,a);c.push(v.node),u=v.nextIndex;continue}if(/^ {0,9}\d+[.)] /.test(d)){const v=W6(l,u,!0,a);c.push(v.node),u=v.nextIndex;continue}const g=[d];for(u++;u<l.length&&!$U(l[u])&&l[u].trim()!=="";)g.push(l[u]),u++;c.push({type:"paragraph",children:S1(g.join(`
|
|
161
|
-
`),a)})}return c}function a2(){return{prevInput:"",settledText:"",settledBlocks:[],settledUpTo:0}}function TU(e){let t=!1,n="",s=-1;for(let r=0;r<e.length;r++){const i=e[r],a=i.match(/^(`{3,}|~{3,})/);a&&(t?a[1].startsWith(n[0])&&a[1].length>=n.length&&(t=!1,n=""):(t=!0,n=a[1])),!t&&i.trim()===""&&r>0&&(s=r)}return t?-1:s}function K6(e){const t=e.lastIndexOf(`
|
|
162
|
-
`),n=t===-1?"":e.slice(0,t+1);let s=t===-1?e:e.slice(t+1);const r=s.lastIndexOf("[");if(r!==-1){const a=s.slice(r);if(!(a.includes("](")&&a.includes(")"))){const c=r>0&&s[r-1]==="!"?r-1:r;s=s.slice(0,c)}}let i=s.length;for(;i>0&&s[i-1]==="`";)i--;if(i<s.length&&i>0){const a=s.length-i;s.lastIndexOf("`".repeat(a),i-1)===-1&&(s=s.slice(0,i))}for(i=s.length;i>0&&s[i-1]==="*";)i--;if(i<s.length&&i>0){const a=s.length-i;a<=3&&s.lastIndexOf("*".repeat(a),i-1)===-1&&(s=s.slice(0,i))}{let a=0;const l=[];for(;a<s.length;){const u=s.indexOf("*",a);if(u===-1)break;let d=1;for(;u+d<s.length&&s[u+d]==="*";)d++;if(d>3){a=u+d;continue}l.push({pos:u,len:d}),a=u+d}const c=new Set;for(let u=0;u<l.length;u++)if(!c.has(u)){for(let d=u+1;d<l.length;d++)if(!c.has(d)&&l[d].len===l[u].len){c.add(u),c.add(d);break}}for(let u=l.length-1;u>=0;u--)if(!c.has(u)){const d=l[u];d.pos+d.len<s.length?s=s+"*".repeat(d.len):s=s.slice(0,d.pos)}}if(s.length>=2&&s.endsWith("~~"))s.lastIndexOf("~~",s.length-3)===-1&&(s=s.slice(0,-2));else if(s.endsWith("~")){const a=s.length-2;a>=0&&s[a]!=="~"&&(s=s.slice(0,-1))}{let a=0,l=0;const c=[];for(;;){const u=s.indexOf("~~",l);if(u===-1)break;c.push(u),a++,l=u+2}a%2===1&&(s=s.slice(0,c[c.length-1]))}return n+s}function zU(e){const t=e.split(`
|
|
163
|
-
`);for(;t.length>0;){const n=t[t.length-1],s=n.trim();if(s===""){t.pop();continue}if(/^ {0,9}[-*+] $/.test(n)||/^ {0,9}\d+[.)] $/.test(n)){t.pop();continue}if(s.includes("|")&&!Q0(n)){let r=!1;for(let i=t.length-2;i>=1;i--)if(Q0(t[i])&&t[i-1].includes("|")){r=!0;break}if(!r){t.pop();continue}}if(Q0(n)&&(t.length<2||!t[t.length-2].includes("|"))){t.pop();continue}break}return t.join(`
|
|
164
|
-
`)}function X6(e,t){if(e.length===0||t.length===0)return[...e,...t];const n=e[e.length-1],s=t[0];if(n.type==="list"&&s.type==="list"&&n.ordered===s.ordered&&n.delimiter===s.delimiter){const r={type:"list",ordered:n.ordered,start:n.start,delimiter:n.delimiter,loose:!0,items:[...n.items,...s.items]};return[...e.slice(0,-1),r,...t.slice(1)]}return[...e,...t]}function NU(e,t,n){const s=v5(n);if(t.autolink!==s.autolink&&(t.prevInput="",t.settledText="",t.settledBlocks=[],t.settledUpTo=0,t.autolink=s.autolink),e==="")return t.prevInput="",t.settledText="",t.settledBlocks=[],t.settledUpTo=0,t.linkDefsKey=void 0,[];const{defs:r}=IC(e),i=cU(r);t.linkDefsKey!==i&&(t.prevInput="",t.settledText="",t.settledBlocks=[],t.settledUpTo=0,t.linkDefsKey=i);const a=r.size>0?{...s,linkDefs:r}:s,l=e.split(`
|
|
165
|
-
`),c=TU(l);if(c<0)return t.prevInput=e,Il(e,a);const u=l.slice(0,c).join(`
|
|
166
|
-
`),d=l.slice(c).join(`
|
|
167
|
-
`).trim(),f=zU(d);let p;if(u===t.settledText)p=t.settledBlocks;else if(t.settledText.length>0&&u.startsWith(t.settledText)){const g=u.slice(t.settledText.length),v=Il(g,a);p=X6(t.settledBlocks,v)}else p=Il(u,a);const x=f?Il(f,a):[];return t.settledText=u,t.settledBlocks=p,t.settledUpTo=c,t.prevInput=e,X6(p,x)}const a0={start:"0",center:"auto"},l2={start:null,center:"auto"},_U={k7Eaqz:"xkj4a21",$$css:!0},Ws={proseWidth:e=>[{ks0D6T:e!=null?"xf68679":e,$$css:!0},{"--x-maxWidth":(t=>typeof t=="number"?t+"px":t??void 0)(e)}],proseAlign:e=>[{kUOVxO:e!=null?"xvlecxo":e,$$css:!0},{"--x-marginInline":(t=>typeof t=="number"?t+"px":t??void 0)(e)}],blockWidth:e=>[_U,{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(`min(${e}, 100%)`)}],blockAlign:e=>[{kUOVxO:e!=null?"xvlecxo":e,$$css:!0},{"--x-marginInline":(t=>typeof t=="number"?t+"px":t??void 0)(e)}],cellMinWidth:e=>[{k7Eaqz:e!=null?"xkj4a21":e,$$css:!0},{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]},l0={center:{k9WMMc:"x2b8uid",$$css:!0},end:{k9WMMc:"xp4054r",$$css:!0}},Me={root:{kMv6JI:"x9ynric",kMwMTN:"x1tgivj0",kLWn49:"xw6l6zx",kGuDYH:"xjm74w1",kzqmXN:"xh8yej3",ks0D6T:"x193iq5w",k7Eaqz:"xeuugli",kHjlTd:"x1mzt3pk",$$css:!0},inlineRoot:{k1xSpc:"xt0psk2",kzqmXN:"x14atkfc",ks0D6T:"x1x1rfll",kMv6JI:"xjb2p0i",kMwMTN:"x1heor9g",kLWn49:"x15bjb6t",kGuDYH:"x1qlqyl8",$$css:!0},headingBase:{kMv6JI:"x1g81bgm",kMwMTN:"x1tgivj0",$$css:!0},h1:{kGuDYH:"xcg7oai",k63SB2:"x1v68xuy",kLWn49:"xfmsba7",$$css:!0},h2:{kGuDYH:"x1xvnhcw",k63SB2:"x12yy4cs",kLWn49:"x1cpk1wn",$$css:!0},h3:{kGuDYH:"xii13ha",k63SB2:"x1jcxfy8",kLWn49:"xwjzt0u",$$css:!0},h4:{kGuDYH:"x8tkxat",k63SB2:"x2hcmsi",kLWn49:"xqerer",$$css:!0},h5:{kGuDYH:"xsgqta0",k63SB2:"xno150v",kLWn49:"xo3gurs",$$css:!0},h6:{kGuDYH:"xw5ohdf",k63SB2:"x1pw4frv",kLWn49:"xeixjfn",$$css:!0},spacingHeadingMajorDefault:{keoZOQ:"x13rv44w",k1K539:"xep27e5",$$css:!0},spacingHeadingMinorDefault:{keoZOQ:"x1s1qpeq",k1K539:"x1p37lm5",$$css:!0},spacingParagraphDefault:{keoZOQ:"xj6sv8s",k1K539:"xep27e5",$$css:!0},spacingCodeblockDefault:{keoZOQ:"x1s1qpeq",k1K539:"xwh1t77",$$css:!0},spacingBlockquoteDefault:{keoZOQ:"x1s1qpeq",k1K539:"xwh1t77",$$css:!0},spacingListDefault:{keoZOQ:"xj6sv8s",k1K539:"xep27e5",$$css:!0},spacingTableDefault:{keoZOQ:"x1s1qpeq",k1K539:"xwh1t77",$$css:!0},spacingHrDefault:{keoZOQ:"x13rv44w",k1K539:"x4d5cxa",$$css:!0},spacingImageDefault:{keoZOQ:"xj6sv8s",k1K539:"xep27e5",$$css:!0},spacingHeadingMajorCompact:{keoZOQ:"x1s1qpeq",k1K539:"x1p37lm5",$$css:!0},spacingHeadingMinorCompact:{keoZOQ:"xj6sv8s",k1K539:"x14cgwvg",$$css:!0},spacingParagraphCompact:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0},spacingCodeblockCompact:{keoZOQ:"xtbrsbv",k1K539:"x1p37lm5",$$css:!0},spacingBlockquoteCompact:{keoZOQ:"xtbrsbv",k1K539:"x1p37lm5",$$css:!0},spacingListCompact:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0},spacingTableCompact:{keoZOQ:"xtbrsbv",k1K539:"x1p37lm5",$$css:!0},spacingHrCompact:{keoZOQ:"xj6sv8s",k1K539:"xep27e5",$$css:!0},spacingImageCompact:{keoZOQ:"xtbrsbv",k1K539:"x1p37lm5",$$css:!0},noMarginBlockStart:{keoZOQ:"xdj266r",$$css:!0},noMarginBlockEnd:{k1K539:"xat24cr",$$css:!0},codeBlockWrapper:{ks0D6T:"x193iq5w",$$css:!0},tableWrapper:{kXHlph:"xw2csxc",ks0D6T:"x193iq5w","--container-padding-inline-start":"xrhngw9","--container-padding-inline-end":"xjsfl84","--container-padding-block-start":"x1047aw6","--container-padding-block-end":"xax9j7h",$$css:!0},blockIndent:{kUOVxO:"x1ho7dyk",$$css:!0},hr:{kMzoRj:"xc342km",kEafiO:"x11xkdxz",kPef9Z:"x13fuv20",kLZC3w:"x1pc3f07",$$css:!0}};function Z6(e){const t=e.match(/^([\d.]+)ms$/);if(t)return parseFloat(t[1]);const n=e.match(/^([\d.]+)s$/);return n?parseFloat(n[1])*1e3:null}function ac(e){let t=0;for(const n of e)switch(n.type){case"text":t+=n.content.length;break;case"code":t+=n.content.length;break;case"image":t+=n.alt.length;break;case"bold":case"italic":case"strikethrough":case"link":t+=ac(n.children);break;case"break":t+=1;break;case"citation":t+=1;break}return t}function Vy(e){let t=0;for(const n of e)switch(n.type){case"heading":case"paragraph":t+=ac(n.children);break;case"codeblock":t+=n.content.length;break;case"blockquote":t+=Vy(n.children);break;case"list":for(const s of n.items)t+=Vy(s.children);break;case"table":for(const s of n.headers)t+=ac(s.children);for(const s of n.rows)for(const r of s)t+=ac(r.children);break;case"hr":break;case"image":t+=n.alt.length;break}return t}const RU={1:Me.h1,2:Me.h2,3:Me.h3,4:Me.h4,5:Me.h5,6:Me.h6},IU=/^(javascript|data|vbscript):/i;function Gy(e){const t=e.trim();return t.length===0||IU.test(t)?null:t}function LU(e,t){const n=[];for(const l of t){l.pattern.lastIndex=0;let c;for(;(c=l.pattern.exec(e))!==null;){let u;if(l.getEndIndex){const d=l.getEndIndex(e,c);if(d===!1)continue;u=d}else u=c.index+c[0].length;n.push({start:c.index,end:u,match:c,plugin:l})}}n.sort((l,c)=>l.start-c.start);const s=[];let r=0;for(const l of n)l.start>=r&&(s.push(l),r=l.end);if(s.length===0)return[{type:"text",content:e}];const i=[];let a=0;for(let l=0;l<s.length;l++){const c=s[l];c.start>a&&i.push({type:"text",content:e.slice(a,c.start)}),i.push({type:"plugin",element:c.plugin.render(c.match,`plugin-${l}`),matchLength:c.end-c.start}),a=c.end}return a<e.length&&i.push({type:"text",content:e.slice(a)}),i}function Y6(e,t,n){const s=t.offset;if(t.offset+=e.length,!t.active)return e;const r=rU(e,s,t.boundaries,n);if(r==null)return e;const i=r.map(a=>a.fading?o.jsx("span",{className:"x1hc1fzr x19991ni x80gvsz x12w9bfk xlr8y92 x4itv7f",children:a.text},a.key):o.jsx("span",{children:a.text},a.key));return o.jsx("span",{children:i},`wrap-${n}`)}function OU(e,t){let n=e.numberMap.get(t);return n==null&&(n=e.nextNumber++,e.numberMap.set(t,n)),n}function rr(e,t,n,s,r,i="a",a,l){switch(e.type){case"text":{if(a&&a.length>0){const c=LU(e.content,a);if(!(c.length===1&&c[0].type==="text")){const u=[];for(let d=0;d<c.length;d++){const f=c[d];f.type==="text"?u.push(Y6(f.content,s,`${t}-seg-${d}`)):(s.offset+=f.matchLength,u.push(o.jsx(h.Fragment,{children:f.element},`plugin-${t}-${d}`)))}return o.jsx(h.Fragment,{children:u},t)}}return Y6(e.content,s,t)}case"bold":return o.jsx("strong",{className:"x2mo6ok",children:e.children.map((c,u)=>rr(c,u,n,s,r,i,a,l))},t);case"italic":return o.jsx("em",{children:e.children.map((c,u)=>rr(c,u,n,s,r,i,a,l))},t);case"strikethrough":return o.jsx("del",{className:"xv1l7n4",children:e.children.map((c,u)=>rr(c,u,n,s,r,i,a,l))},t);case"code":{s.offset+=e.content.length;const c=l==null?void 0:l.inlineCode;return c?o.jsx(c,{children:e.content},t):o.jsx(t5,{children:e.content},t)}case"link":{const c=Gy(e.href);if(c==null)return o.jsx("span",{children:e.children.map((x,g)=>rr(x,g,n,s,r,i,a,l))},t);const u=l==null?void 0:l.link;if(u)return o.jsx(u,{href:c,children:e.children.map((x,g)=>rr(x,g,n,s,r,i,a,l))},t);const d=c.startsWith("https://")||c.startsWith("http://"),f=n?x=>{n(c,x)===!1&&x.preventDefault()}:void 0,p=d?"a":i;return o.jsx(p,{href:c,onClick:f,...d?{target:"_blank",rel:"noopener noreferrer"}:{},className:"xjse4m1 x1bvjpef",children:e.children.map((x,g)=>rr(x,g,n,s,r,i,a,l))},t)}case"image":{const c=Gy(e.src);if(c==null)return o.jsxs("span",{children:["[",e.alt,"]"]},t);const u=l==null?void 0:l.image;return u?o.jsx(u,{src:c,alt:e.alt},t):o.jsx("img",{src:c,alt:e.alt,className:"x193iq5w xh6dtrn"},t)}case"break":return s.offset+=1,o.jsx("br",{},t);case"citation":{if(s.offset+=1,!r)return o.jsxs("span",{children:["[",e.sourceId,"]"]},t);const c=OU(r,e.sourceId),u=r.sources[e.sourceId]??{title:e.sourceId},d=r.style==="number"?"number":"label",f=l==null?void 0:l.citation;return f?o.jsx(f,{source:u,number:c,variant:d},t):o.jsx(RC,{source:u,number:c,variant:d},t)}}}function DU(e,t){const n=t==="compact";switch(e.type){case"heading":return e.level<=3?n?Me.spacingHeadingMajorCompact:Me.spacingHeadingMajorDefault:n?Me.spacingHeadingMinorCompact:Me.spacingHeadingMinorDefault;case"paragraph":return n?Me.spacingParagraphCompact:Me.spacingParagraphDefault;case"codeblock":return n?Me.spacingCodeblockCompact:Me.spacingCodeblockDefault;case"blockquote":return n?Me.spacingBlockquoteCompact:Me.spacingBlockquoteDefault;case"list":return n?Me.spacingListCompact:Me.spacingListDefault;case"table":return n?Me.spacingTableCompact:Me.spacingTableDefault;case"hr":return n?Me.spacingHrCompact:Me.spacingHrDefault;case"image":return n?Me.spacingImageCompact:Me.spacingImageDefault}}function BU(e){return e.headers.map((t,n)=>{let s=ac(t.children);for(const r of e.rows)if(r[n]){const i=ac(r[n].children);i>s&&(s=i)}return s<=6?60:s<=15?80:120})}function Tf(e,t,n,s,r,i,a,l,c,u,d="a",f,p,x){const g=l2[u],v=g!=null?Ws.blockAlign(g):null,y=DU(e,s),m=t===0,k=t===n-1;switch(e.type){case"heading":{const b=Math.min(e.level+r-1,6),j=e.children.map((T,z)=>rr(T,z,i,a,l,d,f,p)),A=p==null?void 0:p.heading;if(A)return o.jsx(A,{level:b,children:j},t);const M=`h${b}`;return o.jsx(M,{...ne(J("markdown-heading",{density:s,level:b}),G(Me.headingBase,RU[b],y,c!=null?Ws.proseWidth(c):null,u!=="start"?Ws.proseAlign(a0[u]):null,m&&Me.noMarginBlockStart,k&&Me.noMarginBlockEnd)),children:j},t)}case"paragraph":{const b=e.children.map((A,M)=>rr(A,M,i,a,l,d,f,p)),j=p==null?void 0:p.paragraph;return j?o.jsx(j,{children:b},t):o.jsx("div",{role:"paragraph",...ne(J("markdown-paragraph",{density:s}),G(y,c!=null?Ws.proseWidth(c):null,u!=="start"?Ws.proseAlign(a0[u]):null,m&&Me.noMarginBlockStart,k&&Me.noMarginBlockEnd)),children:b},t)}case"codeblock":{a.offset+=e.content.length;const b=p==null?void 0:p.code;return b?o.jsx(b,{code:e.content,language:e.language},t):o.jsx("div",{...ne(J("markdown-codeblock",{density:s}),G(y,Me.codeBlockWrapper,m&&Me.noMarginBlockStart,k&&Me.noMarginBlockEnd)),children:o.jsx(Ch,{code:e.content,language:e.language,isCollapsible:!0,xstyle:[c!=null?Ws.blockWidth(c):void 0,v]})},t)}case"blockquote":{const b=p==null?void 0:p.blockquote;if(b){const j=e.children.map((A,M)=>Tf(A,M,e.children.length,s,r,i,a,l,c,u,d,f,p,x));return o.jsx(b,{children:j},t)}return o.jsx(MS,{...J("markdown-blockquote",{density:s}),xstyle:[y,c!=null?Ws.proseWidth(c):void 0,u!=="start"?Ws.proseAlign(a0[u]):void 0,m&&Me.noMarginBlockStart,k&&Me.noMarginBlockEnd],children:e.children.map((j,A)=>Tf(j,A,e.children.length,s,r,i,a,l,c,u,d,f,p,x))},t)}case"list":{if(e.items.length>0&&e.items.every(j=>j.checked!=null)){const j=e.items.map((A,M)=>({item:A,key:`task-${M}`})).filter(({item:A})=>A.checked).map(({key:A})=>A);return o.jsx("div",{...ne(J("markdown-list",{density:s}),G(y,m&&Me.noMarginBlockStart,k&&Me.noMarginBlockEnd)),children:o.jsx(h5,{label:x("@astryx.markdown.taskList"),isLabelHidden:!0,value:j,xstyle:Me.blockIndent,isReadOnly:!0,density:"compact",children:e.items.map((A,M)=>{const T=A.children[0],$=A.children.length===1&&(T==null?void 0:T.type)==="paragraph"?o.jsx(o.Fragment,{children:T.children.map((E,N)=>rr(E,N,i,a,l,d,f,p))}):o.jsx(o.Fragment,{children:A.children.map((E,N)=>Tf(E,N,A.children.length,s,r,i,a,l,c,u,d,f,p,x))});return o.jsx(dx,{value:`task-${M}`,label:$},M)})})},t)}return o.jsx("div",{...ne(J("markdown-list",{density:s}),G(y,c!=null?Ws.proseWidth(c):null,u!=="start"?Ws.proseAlign(a0[u]):null,m&&Me.noMarginBlockStart,k&&Me.noMarginBlockEnd)),children:o.jsx(Jt,{listStyle:e.ordered?"decimal":"disc",density:"compact",start:e.ordered?e.start:void 0,xstyle:Me.blockIndent,children:e.items.map((j,A)=>{const M=j.children[0],z=j.children.length===1&&(M==null?void 0:M.type)==="paragraph"?o.jsx(o.Fragment,{children:M.children.map(($,E)=>rr($,E,i,a,l,d,f,p))}):o.jsx(o.Fragment,{children:j.children.map(($,E)=>Tf($,E,j.children.length,s,r,i,a,l,c,u,d,f,p,x))});return o.jsx(Je,{label:z},A)})})},t)}case"table":{const b=BU(e);return o.jsx("div",{tabIndex:0,role:"group","aria-label":x("@astryx.markdown.table"),...ne(J("markdown-table",{density:s}),G(Me.tableWrapper,y,c!=null?Ws.blockWidth(c):null,l2[u]!=null?Ws.blockAlign(l2[u]):null,m&&Me.noMarginBlockStart,k&&Me.noMarginBlockEnd)),children:o.jsxs(_C,{dividers:"rows",textOverflow:"wrap",children:[o.jsx(m5,{children:o.jsx(fx,{children:e.headers.map((j,A)=>o.jsx(g5,{xstyle:[Ws.cellMinWidth(`${b[A]}px`),e.alignments[A]==="center"&&l0.center,e.alignments[A]==="right"&&l0.end],children:j.children.map((M,T)=>rr(M,T,i,a,l,d,f,p))},A))})}),o.jsx(y5,{children:e.rows.map((j,A)=>{const M=j.map((T,z)=>o.jsx(x5,{xstyle:[e.alignments[z]==="center"&&l0.center,e.alignments[z]==="right"&&l0.end],children:T.children.map(($,E)=>rr($,E,i,a,l,d,f,p))},z));return o.jsx(fx,{children:M},A)})})]})},t)}case"hr":{const b=p==null?void 0:p.hr;return b?o.jsx(b,{},t):o.jsx("hr",{...ne(J("markdown-hr",{density:s}),G(Me.hr,y,m&&Me.noMarginBlockStart,k&&Me.noMarginBlockEnd))},t)}case"image":{const b=Gy(e.src);if(b==null)return o.jsxs("div",{...ne(J("markdown-image",{density:s}),G(y,m&&Me.noMarginBlockStart,k&&Me.noMarginBlockEnd)),children:["[",e.alt,"]"]},t);const j=p==null?void 0:p.image;return j?o.jsx(j,{src:b,alt:e.alt},t):o.jsx("div",{...ne(J("markdown-image",{density:s}),G(y,m&&Me.noMarginBlockStart,k&&Me.noMarginBlockEnd)),children:o.jsx("img",{src:b,alt:e.alt,className:"x193iq5w xh6dtrn"})},t)}}}function b5({ref:e,children:t,display:n="block",density:s="default",headingLevelStart:r=1,isStreaming:i=!1,onLinkClick:a,sources:l,citationStyle:c="label",contentWidth:u=680,contentAlign:d="start",components:f,inlinePlugins:p,autolink:x,xstyle:g,className:v,style:y,"data-testid":m}){const k=ze(),b=Ja(),j=h.useMemo(()=>l?new Set(Object.keys(l)):void 0,[l]),A=h.useMemo(()=>({sourceIds:j,autolink:x}),[j,x]),M=VB(t,i),T=h.useRef(a2()),z=h.useRef(x);z.current!==x&&(T.current=a2(),z.current=x);const $=h.useMemo(()=>{if(n==="inline")return[];if(i){if(M==="")return T.current=a2(),[];const U=K6(M);return NU(U,T.current,A)}return MU(t,A)},[n,M,t,i,A]),E=h.useMemo(()=>{if(n!=="inline")return[];const U=i?K6(M):t;return pU(U,A)},[n,M,t,i,A]),{token:N}=wg(),_=h.useMemo(()=>{const U=Z6(N("--duration-fast-max"))??230,X=Z6(N("--duration-fast-min")),Z=X!=null?Math.max(4,Math.round(X/10)):50;return Math.min(Math.ceil(U/Z),12)},[N]),R=h.useRef([]),B=h.useRef([]),D=h.useRef([]),I=M.length,L={offset:0,boundaries:h.useMemo(()=>{const U=n==="inline"?ac(B.current):Vy(R.current),X=sU(D.current,U,_);return D.current=X,X},[n,I,_]),active:i},H=l?{sources:l,numberMap:new Map,nextNumber:1,style:c}:null;if(n==="inline"){const U=o.jsx("span",{ref:e,"data-testid":m,...ne(J("markdown",{density:s}),G(Me.root,Me.inlineRoot,g),v,y),children:E.map((X,Z)=>rr(X,Z,a,L,H,b,p,f))});return B.current=E,R.current=[],U}const q=o.jsx("div",{role:"document",ref:e,"data-testid":m,...ne(J("markdown",{density:s}),G(Me.root,g),v,y),children:$.map((U,X)=>Tf(U,X,$.length,s,r,a,L,H,u?typeof u=="number"?`${u}px`:u:null,d,b,p,f,k))});return R.current=$,B.current=[],q}b5.displayName="Markdown";const HC=h.createContext(null);HC.displayName="CollapsibleGroupContext";const Wy=h.createContext(null);Wy.displayName="CollapsibleGroupPresentationContext";function HU(e){const{isCollapsible:t,value:n}=e,s=h.use(HC),r=s!=null&&n!=null,i=t===!0?{}:t||null,a=i!=null,[l,c]=h.useState(()=>r?!0:(i==null?void 0:i.isOpen)!==void 0?i.isOpen:(i==null?void 0:i.defaultIsOpen)??!0);let u;return r&&n!=null?u=s.isOpen(n):(i==null?void 0:i.isOpen)!==void 0?u=i.isOpen:u=l,{isEnabled:a,isOpen:u,toggle:()=>{var p;if(r&&n!=null){s.toggle(n);return}const f=!u;(i==null?void 0:i.isOpen)===void 0&&c(f),(p=i==null?void 0:i.onOpenChange)==null||p.call(i,f)}}}const Wc={root:{kzqmXN:"xh8yej3",$$css:!0},trigger:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kzqmXN:"xh8yej3",kkrTdU:"x1ypdohk",kMv6JI:"x9ynric",kGuDYH:"x18juvz8",k63SB2:"x2mo6ok",kMwMTN:"x1tgivj0",k9WMMc:"x1yc453h",k8WAf4:"xt970qd",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},triggerDisabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",$$css:!0},contentHidden:{k1xSpc:"x1s85apg",$$css:!0},content:{kLKAdn:"xfsso4q",kMv6JI:"x9ynric",kGuDYH:"xjm74w1",k63SB2:"xxovm9e",kLWn49:"xw6l6zx",kMwMTN:"x1tgivj0",$$css:!0},divided:{kEafiO:"x11xkdxz x1g31smg",kPef9Z:"x13fuv20",kLZC3w:"x1pc3f07",$$css:!0}},Tu={triggerCompact:{k8WAf4:"xu0wf1k",$$css:!0},triggerBalanced:{k8WAf4:"xce4md1",$$css:!0},triggerSpacious:{k8WAf4:"x8o8v82",$$css:!0},contentCompact:{kGO01o:"xy143xn",$$css:!0},contentBalanced:{kGO01o:"x1wesfrj",$$css:!0},contentSpacious:{kGO01o:"xvmdzux",$$css:!0}},qU={compact:Tu.triggerCompact,balanced:Tu.triggerBalanced,spacious:Tu.triggerSpacious},PU={compact:Tu.contentCompact,balanced:Tu.contentBalanced,spacious:Tu.contentSpacious};function Bg({trigger:e,children:t,defaultIsOpen:n,isOpen:s,isDisabled:r=!1,onOpenChange:i,value:a,ref:l,xstyle:c,className:u,style:d,...f}){const p=s!==void 0?{isOpen:s,onOpenChange:i}:{defaultIsOpen:n??!0,onOpenChange:i},{isOpen:x,toggle:g}=HU({isCollapsible:p,value:a}),v=()=>{r||g()},y=h.use(Wy),m=(y==null?void 0:y.hasDividers)??!1,k=(y==null?void 0:y.density)??null,b=gd("chevronDown"),j=h.useId();return o.jsxs("div",{ref:l,...ne(J("collapsible",{density:k??void 0}),G(Wc.root,m&&Wc.divided,c),u,d),...f,children:[o.jsxs("button",{type:"button",onClick:v,"aria-disabled":r||void 0,"aria-expanded":x,"aria-controls":j,tabIndex:r?-1:void 0,...ne(J("collapsible-trigger",{density:k??void 0}),G(Wc.trigger,k!=null&&qU[k],r&&Wc.triggerDisabled)),children:[o.jsx("span",{className:"x1b2iylo xwgcxoh",children:e}),o.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x11xpdln xuedmi6 xlr8y92 xv9yike x7p49u4"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x11xpdln xuedmi6 xlr8y92 xv9yike x19jd1h0"}}[!!x<<0],children:b})]}),o.jsx("div",{id:j,...ne(J("collapsible-content",{density:k??void 0}),G(Wc.content,k!=null&&PU[k],!x&&Wc.contentHidden)),children:y!=null?o.jsx(Wy,{value:null,children:t}):t})]})}Bg.displayName="Collapsible";const w5=h.createContext(null);w5.displayName="RadioListContext";function j5({ref:e,label:t,isLabelHidden:n=!1,description:s,value:r,onChange:i,orientation:a="vertical",isDisabled:l=!1,disabledMessage:c,isRequired:u=!1,isOptional:d=!1,size:f="md",status:p,labelTooltip:x,width:g,xstyle:v,className:y,style:m,"data-testid":k,htmlName:b,children:j}){const A=h.useId(),M=b??A,T=h.useId(),z=h.useId(),$=h.useId(),E=h.useId(),N=h.useRef(null),_=l&&!!c,R=Ss({placement:"above",focusTrigger:"always",isEnabled:_}),B=h.useMemo(()=>({name:M,value:r,onChange:i,isDisabled:l,hasDisabledMessage:_,isRequired:u,size:f,status:p}),[M,r,i,l,_,u,f,p]),D=h.useCallback(I=>{if(r!=="")return;const O=N.current;if(!O)return;const L=I.relatedTarget;if(L){if(O.contains(L))return}else if(document.activeElement&&document.activeElement!==I.target&&O.contains(document.activeElement))return;const H=Array.from(O.querySelectorAll('input[type="radio"]:not([disabled])'));if(H.length===0)return;const q=I.target,U=H.findIndex(ie=>ie===q);if(U===-1)return;const Z=U===H.length-1?H[H.length-1]:H[0];q!==Z&&Z.focus()},[r]);return o.jsxs(_c,{ref:e,"data-testid":k,label:t,isLabelHidden:n,description:s,inputID:T,labelID:z,isGroupLabel:!0,descriptionID:s?$:void 0,isOptional:d,isRequired:u,isDisabled:l,status:p?{type:p.type,message:p.message,messageID:p.message?E:void 0}:void 0,labelTooltip:x,statusVariant:"detached",width:g,xstyle:v,className:y,style:m,children:[o.jsx("div",{ref:I=>{N.current=I,R.ref(I)},role:"radiogroup","aria-labelledby":z,onFocus:D,"aria-describedby":[s?$:null,p!=null&&p.message?E:null,_?R.describedBy:null].filter(Boolean).join(" ")||void 0,"aria-invalid":(p==null?void 0:p.type)==="error"?!0:void 0,"aria-required":u||void 0,...ne(J("radio-list",{orientation:a,size:f}),{0:{className:"x78zum5 x1q0g3np x9mgr7n"},1:{className:"x78zum5 xdt5ytf x1txdalj"}}[(a==="vertical")<<0]),children:o.jsx(w5,{value:B,children:j})}),_&&R.renderTooltip(c)]})}j5.displayName="RadioList";const UU={xklqth5:"xklqth5",$$css:!0},Gr={container:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},radioWrapper:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",kHBbk8:"xc8icb0",$$css:!0},input:{kVAEAm:"x10l6tqk",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kSiTet:"xg01cxk",kkrTdU:"x1ypdohk",kY2c9j:"x1vjfegm",$$css:!0},inputDisabled:{kkrTdU:"x1h6gzvc",$$css:!0},radio:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kMzoRj:"x1litavf",ksu8eU:"x1y0btm7",kaIpWk:"x16rqkct",k1ekBW:"xts7igz",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kB7OPa:"x9f619",$$css:!0},radioUnchecked:{kVAM5u:"xvy26l8 x70talc",kWkggS:"x10xzikg xy1ay1n",$$css:!0},radioChecked:{kVAM5u:"xad5do xaq2ahg",kWkggS:"x1ewilqj xwnx32n",$$css:!0},radioWrapperFocus:{kI3sdo:"x1a2a7pz x1irc7jg",kInvED:"x1wfwxd8 xdjuwb3",kaIpWk:"x16rqkct",$$css:!0},radioDisabled:{kSiTet:"xbyyjgo",kVAM5u:"x14i3s5s",$$css:!0},radioDisabledUnchecked:{kWkggS:"xwmxj5m",$$css:!0},innerDot:{kaIpWk:"x16rqkct",kWkggS:"x1azo05 xwvh9j7",$$css:!0}},Q6={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},FU={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},VU={sm:{kzqmXN:"x1xc55vz",kZKoxP:"xdk7pt",$$css:!0},md:{kzqmXN:"x1fsd2vl",kZKoxP:"x170jfvy",$$css:!0}},GU={root:{k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kaIpWk:"x2u8bby",kUk6DE:"x98rzlu",k7Eaqz:"xeuugli",$$css:!0}};function hx({ref:e,label:t,value:n,description:s,isDisabled:r=!1,startContent:i,endContent:a,xstyle:l,className:c,style:u,...d}){const f=h.use(w5);if(!f)throw new Error("RadioListItem must be used within an RadioList");const p=h.useId(),x=h.useId(),g=f.isDisabled||r,v=f.hasDisabledMessage&&!r,y=f.value===n,m=f.size,k=o.jsxs("div",{...G(Gr.radioWrapper,Q6[m],!g&&Gr.radioWrapperFocus),children:[o.jsx("input",{id:p,type:"radio",name:f.name,value:n,checked:y,disabled:g&&!v,"aria-disabled":v?"true":void 0,form:v?"":void 0,required:f.isRequired,onChange:()=>{g||f.onChange(n)},"aria-describedby":s?x:void 0,...G(Gr.input,Q6[m],g&&Gr.inputDisabled)}),o.jsx("div",{"aria-hidden":"true",...ne(J("radio",{size:m,checked:y?"checked":null,disabled:g?"disabled":null}),G(Gr.radio,FU[m],y?Gr.radioChecked:Gr.radioUnchecked,g&&Gr.radioDisabled,g&&!y&&Gr.radioDisabledUnchecked)),children:y&&o.jsx("div",{...ne(J("radio-dot",{size:m}),G(Gr.innerDot,VU[m]))})})]}),b=i!=null?o.jsxs(o.Fragment,{children:[k,i]}):k;return o.jsx("div",{ref:e,...ne(J("radio-list-item"),G(Gr.container,!g&&UU,l),c,u),...d,children:o.jsx(qd,{startContent:b,label:o.jsx("label",{htmlFor:p,...{0:{},1:{className:"xnbbluu x1h6gzvc"}}[!!g<<0],children:t}),description:s!=null?o.jsx("span",{id:x,children:s}):void 0,endContent:a,xstyle:GU.root})})}hx.displayName="RadioListItem";const WU=50,KU=40,qC="astryx-resizable:";function c0(e,t,n,s){const r=Math.min(n,Math.max(t,e));if(s.length>0){let i=s[0],a=Math.abs(r-i);for(let l=1;l<s.length;l++){const c=Math.abs(r-s[l]);c<a&&(i=s[l],a=c)}return Math.min(n,Math.max(t,i))}return r}function XU(e){if(typeof window>"u")return null;try{const t=localStorage.getItem(qC+e);if(t!=null){const n=JSON.parse(t);if(typeof n=="number")return n}}catch{}return null}function ZU(e,t){if(!(typeof window>"u"))try{localStorage.setItem(qC+e,JSON.stringify(t))}catch{}}function YU(e){if(e==null)return 250;if(typeof e=="number")return e;if(e.endsWith("%")){const t=parseFloat(e);if(!isNaN(t)){const n=typeof window<"u"?window.innerWidth:1200;return Math.round(t/100*n)}}return 250}function PC(e){const{defaultSize:t,minSizePx:n=WU,maxSizePx:s=1/0,collapsible:r=!1,collapsedSize:i=KU,snaps:a=[],autoSaveId:l,onSizeChange:c,onCollapseChange:u}=e,d=YU(t),f=l?XU(l):null,p=f??d,[x,g]=h.useState(()=>c0(p,n,s,a)),[v,y]=h.useState(()=>f===0&&r),m=h.useRef(x),k=h.useRef(x);h.useEffect(()=>{l&&ZU(l,v?0:x)},[x,v,l]);const b=h.useCallback(()=>{r&&(m.current=x,y(!0),g(0),u==null||u(!0),c==null||c(0))},[r,x,u,c]),j=h.useCallback(()=>{y(!1);const E=m.current||d,N=c0(E,n,s,a);g(N),u==null||u(!1),c==null||c(N)},[d,n,s,a,u,c]),A=h.useCallback(E=>{const N=c0(E,n,s,a);g(N),y(!1),c==null||c(N)},[n,s,a,c]),M=h.useCallback(()=>{k.current=v?0:x},[x,v]),T=h.useCallback(E=>{const N=k.current+E;if(r&&N<i){v||(m.current=x,u==null||u(!0)),y(!0),g(0),c==null||c(0);return}v&&N>=i&&(y(!1),u==null||u(!1));const _=c0(N,n,s,a);g(_),c==null||c(_)},[r,i,v,x,n,s,a,c,u]),z=h.useCallback(()=>{},[]);return{size:v?0:x,isCollapsed:v,collapse:b,expand:j,resize:A,props:{_size:v?0:x,_isCollapsed:v,_onResizeStart:M,_onResizeMove:T,_onResizeEnd:z,_minSizePx:n,_maxSizePx:s,_snaps:a,_collapsedSize:i,_collapsible:r,_isResizableProps:!0}}}function QU(e){const{regions:t,autoSaveId:n}=e,s=Object.entries(t),r=s.map(([a,l])=>PC({...l,autoSaveId:n?`${n}:${a}`:void 0})),i={};return s.forEach(([a],l)=>{i[a]=r[l]}),i}function UC(e){return"regions"in e?QU(e):PC(e)}const JU=10,eF=50;function tF(e,t,n){if(e!=="auto")return e;const s=t?"end":"start";return n?s==="start"?"end":"start":s}function nF(e){return e==="center"?null:e==="start"?-1:1}const qt={handle:{kVAEAm:"x1n2onr6",kmuXW:"x2lah0s",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kWkggS:"x1m4xfpy",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kI3sdo:"x1a2a7pz x17nn4n9",kInvED:"xh2nty3",$$css:!0},overlay:{kVAEAm:"x10l6tqk",kY2c9j:"xhtitgo",kWkggS:"xjbqb8w",$$css:!0},overlayHorizontal:{kt4wiu:"xtijo5x",k87sOh:"x13vifvy",krVfgx:"x1ey2m1c",kzqmXN:"xkhob8h",$$css:!0},overlayVertical:{krVfgx:"x1ey2m1c",kLqNvP:"x1o0tod",kt4wiu:"xtijo5x",kZKoxP:"x5kfih4",$$css:!0},horizontal:{kzqmXN:"x1i1rx1s",kZKoxP:"x5yr21d",kkrTdU:"xicojor",$$css:!0},vertical:{kZKoxP:"xjm9jq1",kzqmXN:"xh8yej3",kkrTdU:"xyozgr7",$$css:!0},noDividerHorizontal:{kWkggS:"xjbqb8w",kzqmXN:"xnalus7",$$css:!0},noDividerVertical:{kWkggS:"xjbqb8w",kZKoxP:"xqtp20y",$$css:!0},handleHover:{kWkggS:"x1m4xfpy",$$css:!0},handleActive:{kWkggS:"x7njt3n",$$css:!0},disabled:{kkrTdU:"xt0e3qv",kfzvcC:"x47corl",$$css:!0},hitArea:{kVAEAm:"x10l6tqk",kY2c9j:"x1vjfegm",kFalU9:"x5ve5x3",kfSwDN:"x87ps6o",$$css:!0},hitAreaHorizontal:{kzqmXN:"x12xnipv",k87sOh:"x13vifvy",krVfgx:"x1ey2m1c",kkrTdU:"xicojor",$$css:!0},hitAreaVertical:{kZKoxP:"x6b6gus",kLqNvP:"x1o0tod",kt4wiu:"xtijo5x",kkrTdU:"xyozgr7",$$css:!0},hitAreaCenteredY:{k87sOh:"xwa60dl",k3aq6I:"x1cb1t30",$$css:!0},pill:{kVAEAm:"x10l6tqk",kY2c9j:"xhtitgo",kfzvcC:"x47corl",kaIpWk:"xjspbzw",kWkggS:"x1m4xfpy",k1ekBW:"x1wbls7o",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",k87sOh:"xwa60dl",$$css:!0},pillHorizontal:{kzqmXN:"x1g8rjiy",kZKoxP:"x18to7ep",$$css:!0},pillVertical:{kzqmXN:"xgc8j7m",kZKoxP:"xuoj239",$$css:!0},pillHidden:{kSiTet:"xg01cxk",$$css:!0},pillVisible:{kSiTet:"x1hc1fzr",$$css:!0},pillHover:{kSiTet:"x1hc1fzr",kWkggS:"x1m4xfpy",$$css:!0},pillActive:{kSiTet:"x1hc1fzr",kWkggS:"x7njt3n",$$css:!0}},sF={kLqNvP:"x1o0tod",k3aq6I:"x11wx31z x75qhwu",$$css:!0},rF={k87sOh:"x13vifvy",k3aq6I:"xsqj5wx",$$css:!0},iF={kLqNvP:"x1o0tod",k3aq6I:"xsqj5wx",$$css:!0},oF={k87sOh:"x13vifvy",k3aq6I:"xsqj5wx",$$css:!0},u0={hitAreaOffsetX:e=>[sF,{"--x-qthpiu":`translate(calc(${e} * (3px + ${wr["--spacing-1"]}) - 6.5px), -50%)`!=null?`translate(calc(${e} * (3px + ${wr["--spacing-1"]}) - 6.5px), -50%)`:void 0,"--x-sj6hyi":`translate(calc(${e} * (3px + ${wr["--spacing-1"]}) + 6.5px), -50%)`!=null?`translate(calc(${e} * (3px + ${wr["--spacing-1"]}) + 6.5px), -50%)`:void 0}],hitAreaOffsetY:e=>[rF,{"--x-transform":`translate(-50%, calc(${e} * (3px + ${wr["--spacing-1"]}) - 6.5px))`!=null?`translate(-50%, calc(${e} * (3px + ${wr["--spacing-1"]}) - 6.5px))`:void 0}],pillOffsetX:e=>[iF,{"--x-transform":`translate(calc(${e} * (100% + ${wr["--spacing-1"]})), -50%)`!=null?`translate(calc(${e} * (100% + ${wr["--spacing-1"]})), -50%)`:void 0}],pillOffsetY:e=>[oF,{"--x-transform":`translate(-50%, calc(${e} * (100% + ${wr["--spacing-1"]})))`!=null?`translate(-50%, calc(${e} * (100% + ${wr["--spacing-1"]})))`:void 0}]};function S5({direction:e="horizontal",position:t="inline",isReversed:n=!1,isDisabled:s=!1,hasDivider:r=!1,isAlwaysVisible:i=!0,pillPlacement:a="auto",label:l,resizable:c,children:u,xstyle:d,className:f,ref:p,...x}){const g=ze(),v=l??g("@astryx.resizable.handle.label"),y=h.useRef(null),m=h.useRef(null),[k,b]=h.useState(!1),[j,A]=h.useState(!1),[M,T]=h.useState(!1),z=e==="horizontal",$=t==="overlay",E=n?-1:1,N=tF(a,n,(c==null?void 0:c._isCollapsed)??!1),_=nF(N),R=h.useCallback(()=>{const Z=y.current;return Z&&getComputedStyle(Z).direction==="rtl"?-1:1},[]),B=j||M,D=h.useCallback(Z=>{if(s||!c)return;Z.preventDefault(),Z.stopPropagation(),b(!0),c._onResizeStart();const ie=z?Z.clientX:Z.clientY,ae=z?R():1;document.body.style.cursor=z?"col-resize":"row-resize",document.body.style.userSelect="none";const xe=me=>{const V=((z?me.clientX:me.clientY)-ie)*ae*E;c._onResizeMove(V)},fe=()=>{ye(),b(!1),c._onResizeEnd(),document.body.style.cursor="",document.body.style.userSelect=""},se=()=>{ye(),b(!1),document.body.style.cursor="",document.body.style.userSelect=""};function ye(){window.removeEventListener("pointermove",xe),window.removeEventListener("pointerup",fe),window.removeEventListener("pointercancel",se),m.current=null}window.addEventListener("pointermove",xe),window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",se),m.current=ye},[s,c,z,R,E]),I=h.useCallback(Z=>{if(s||!c)return;const ie=Z.shiftKey?eF:JU,ae=z?R():1;switch(Z.key){case"ArrowRight":case"ArrowDown":{Z.preventDefault(),c._onResizeStart(),c._onResizeMove(ie*(z?ae:1)*E),c._onResizeEnd();break}case"ArrowLeft":case"ArrowUp":{Z.preventDefault(),c._onResizeStart(),c._onResizeMove(-ie*(z?ae:1)*E),c._onResizeEnd();break}case"Home":{Z.preventDefault(),c._onResizeStart(),c._onResizeMove(c._minSizePx-c._size),c._onResizeEnd();break}case"End":{Z.preventDefault(),c._maxSizePx!==1/0&&(c._onResizeStart(),c._onResizeMove(c._maxSizePx-c._size),c._onResizeEnd());break}case"Enter":{Z.preventDefault(),c._collapsible&&(c._onResizeStart(),c._onResizeMove(c._isCollapsed?c._minSizePx:-c._size),c._onResizeEnd());break}}},[s,c,z,R,E]),O=h.useCallback(()=>{s||!c||!c._collapsible||(c._onResizeStart(),c._onResizeMove(c._isCollapsed?c._minSizePx:-c._size),c._onResizeEnd())},[s,c]);h.useEffect(()=>()=>{m.current&&(m.current(),document.body.style.cursor="",document.body.style.userSelect="")},[]);const L=(c==null?void 0:c._isCollapsed)??!1,H=c?L?Math.max(c._size,c._minSizePx):c._size:void 0,q=c?c._minSizePx:void 0,U=c&&c._maxSizePx!==1/0?c._maxSizePx:void 0,X=c&&L?g("@astryx.resizable.collapsed"):void 0;return o.jsxs("div",{ref:Ft(p,y),role:"separator","aria-orientation":z?"vertical":"horizontal","aria-valuenow":H,"aria-valuemin":q,"aria-valuemax":U,"aria-valuetext":X,"aria-label":v,"aria-disabled":s||void 0,tabIndex:s?-1:0,onDoubleClick:O,onFocus:()=>T(!0),onBlur:()=>T(!1),"data-resizing":k||void 0,...ne(J("resize-handle"),G(qt.handle,$&&qt.overlay,$&&(z?qt.overlayHorizontal:qt.overlayVertical),!$&&(z?qt.horizontal:qt.vertical),!$&&!r&&(z?qt.noDividerHorizontal:qt.noDividerVertical),!$&&r&&B&&!k&&qt.handleHover,!$&&r&&k&&qt.handleActive,s&&qt.disabled,d),f),...x,onKeyDown:Z=>{var ie;(ie=x.onKeyDown)==null||ie.call(x,Z),I(Z)},children:[o.jsx("div",{...G(qt.hitArea,z?qt.hitAreaHorizontal:qt.hitAreaVertical,_==null?z?xd.centerInline("0px"):qt.hitAreaCenteredY:z?u0.hitAreaOffsetX(_):u0.hitAreaOffsetY(_),s&&qt.disabled),onPointerDown:D,onPointerEnter:()=>A(!0),onPointerLeave:()=>{k||A(!1)}}),u??o.jsx("div",{...ne(J("resize-handle-pill"),G(qt.pill,z?qt.pillHorizontal:qt.pillVertical,N==="center"?xd.centerInline("-50%"):z?u0.pillOffsetX(N==="start"?-1:1):u0.pillOffsetY(N==="start"?-1:1),i?qt.pillVisible:qt.pillHidden,B&&!k&&qt.pillHover,k&&qt.pillActive))})]})}S5.displayName="ResizeHandle";const Kc={dialog:{kVAEAm:"xixxii4",kpwlN0:"x10a8y8t",kzqmXN:"xn9wirt",kZKoxP:"x1dr59a3",ks0D6T:"x1x1rfll",kskxy:"x7ab17h",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kWkggS:"xjbqb8w",kVQacm:"xb3r6kr",kI3sdo:"x1a2a7pz",kGyWv1:"xnixb3f",kba3nw:"x1abwkk1",$$css:!0},image:{ks0D6T:"x193iq5w",kskxy:"xmz0i5r",kVIFPx:"x19kjcj4",kfzvcC:"x47corl",k1ekBW:"x11xpdln",kIyJzY:"x13dflua x12w9bfk",kAMwcw:"x9lcvmn",$$css:!0},imageDragging:{k1ekBW:"x13b0p5u",$$css:!0},controlButton:{kMwMTN:"x9e3rv5",$$css:!0}},aF={imageTransform:e=>[{k3aq6I:e!=null?"xsqj5wx":e,$$css:!0},{"--x-transform":e??void 0}]},d0=50,J6={ArrowLeft:[d0,0],ArrowRight:[-d0,0],ArrowUp:[0,d0],ArrowDown:[0,-d0]};function FC({isOpen:e,onOpenChange:t,media:n,index:s,defaultIndex:r=0,onIndexChange:i,hasZoom:a=!1,hasAutoPlay:l=!1,xstyle:c,className:u,style:d,ref:f,onClick:p,onKeyDown:x,...g}){const v=ze(),y=h.useRef(null),m=h.useRef(null),k=h.useRef(null),b=h.useRef(null),j=s!==void 0,[A,M]=h.useState(r),T=j?s:A,z=h.useCallback(pe=>{j||M(pe),i==null||i(pe)},[j,i,M]),[$,E]=h.useState(1),[N,_]=h.useState({x:0,y:0}),[R,B]=h.useState(!1),D=h.useRef({x:0,y:0,panX:0,panY:0}),I=h.useMemo(()=>Array.isArray(n)?n:[n],[n]),O=I.length>1,L=I.length>0?I[Math.min(T,I.length-1)]:null,q=((L==null?void 0:L.type)??"image")==="video",U=O&&T>0,X=O&&T<I.length-1;qS(e),h.useEffect(()=>{E(1),_({x:0,y:0})},[T,L==null?void 0:L.src]);const Z=Nc(),ie=h.useRef(T),ae=h.useRef(e);h.useEffect(()=>{const pe=ie.current!==T,Ve=ae.current;if(ie.current=T,ae.current=e,!pe||!e||!Ve)return;const Ye=I[Math.min(T,I.length-1)],ot=`${T+1} of ${I.length}`;Z(Ye!=null&&Ye.alt?`${Ye.alt}, ${ot}`:`Image ${ot}`)},[T,e,Z,I]),Bi(()=>{const pe=y.current;pe&&(e&&!pe.open?(b.current=document.activeElement,pe.showModal()):!e&&pe.open&&(pe.close(),b.current instanceof HTMLElement&&b.current.focus()))},[e]);const xe=h.useCallback(()=>{t(!1)},[t]),fe=h.useCallback(pe=>{pe.preventDefault(),xe()},[xe]),se=h.useRef(!1),ye=h.useCallback(pe=>{if(se.current){se.current=!1;return}(pe.target===pe.currentTarget||pe.target===m.current)&&xe()},[xe]),me=h.useCallback(()=>{U&&z(T-1)},[U,T,z]),P=h.useCallback(()=>{X&&z(T+1)},[X,T,z]),V=h.useCallback(pe=>{!a||q||pe===$||(E(pe),_({x:0,y:0}),Z(pe>1?v("@astryx.lightbox.zoomedIn"):v("@astryx.lightbox.zoomedOut")))},[a,q,$,Z,v]),Y=h.useCallback(()=>{V($===1?2:1)},[V,$]),oe=h.useCallback(pe=>{if(a&&!q){if(pe.key==="+"||pe.key==="="){pe.preventDefault(),V(2);return}if(pe.key==="-"){pe.preventDefault(),V(1);return}if($>1&&J6[pe.key]!==void 0){pe.preventDefault();const[Ve,Ye]=J6[pe.key];_(ot=>({x:ot.x+Ve,y:ot.y+Ye}));return}}pe.key==="ArrowLeft"?(pe.preventDefault(),me()):pe.key==="ArrowRight"&&(pe.preventDefault(),P())},[a,q,$,V,me,P]),F=h.useCallback(pe=>{(pe.key==="Enter"||pe.key===" ")&&(pe.preventDefault(),Y())},[Y]),le=h.useCallback(pe=>{$<=1||!a||(B(!0),se.current=!1,D.current={x:pe.clientX,y:pe.clientY,panX:N.x,panY:N.y})},[$,a,N]);h.useEffect(()=>{if(!R)return;const pe=Ye=>{se.current=!0;const ot=Ye.clientX-D.current.x,at=Ye.clientY-D.current.y;_({x:D.current.panX+ot,y:D.current.panY+at})},Ve=()=>{B(!1)};return window.addEventListener("pointermove",pe),window.addEventListener("pointerup",Ve),()=>{window.removeEventListener("pointermove",pe),window.removeEventListener("pointerup",Ve)}},[R]);const ce=$>1,ge=a&&!q,ve=$===1?null:`scale(${$}) translate(${N.x/$}px, ${N.y/$}px)`;return L?o.jsx("dialog",{ref:Ft(f,y),onCancel:fe,onClick:pe=>{ye(pe),p==null||p(pe)},onKeyDown:pe=>{oe(pe),x==null||x(pe)},"aria-label":L.alt||v("@astryx.lightbox.mediaViewer"),...ne(J("lightbox"),G(Kc.dialog,c),u,d),...g,children:o.jsxs("div",{ref:m,className:"x78zum5 xdt5ytf x6s0dn4 xl56j7k xh8yej3 x5yr21d x1n2onr6",children:[o.jsx("div",{className:"x10l6tqk xyx6v2t x1mcfs9z x1vjfegm",children:o.jsx(Bt,{icon:o.jsx(Te,{icon:"close",size:"sm",color:"inherit"}),label:v("@astryx.lightbox.close"),variant:"ghost",onClick:xe,xstyle:Kc.controlButton})}),O&&o.jsx("div",{className:"x10l6tqk xwa60dl x1cb1t30 x1vjfegm x1ybfrjj",children:o.jsx(Bt,{icon:o.jsx("span",{...G(xd.mirror),children:o.jsx(Te,{icon:"chevronLeft",size:"sm",color:"inherit"})}),label:v("@astryx.lightbox.previous"),variant:"ghost",isDisabled:!U,onClick:me,xstyle:Kc.controlButton})}),o.jsxs("div",{className:"x78zum5 xdt5ytf x6s0dn4 x193iq5w xmz0i5r xb3r6kr",children:[o.jsx("div",{ref:k,role:ge?"button":void 0,tabIndex:ge?0:void 0,"aria-pressed":ge?ce:void 0,"aria-label":ge?v("@astryx.lightbox.zoom"):void 0,...{0:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr xt0e3qv x87ps6o x2lwn1j"},8:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr xt0e3qv x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk"},4:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1huxd7x x2dt3px"},12:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1huxd7x x2dt3px"},2:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1jm3nie"},10:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1jm3nie"},6:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1jm3nie"},14:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1jm3nie"},1:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j xi9pz9s"},9:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk xi9pz9s"},5:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j xi9pz9s"},13:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk xi9pz9s"},3:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j xi9pz9s"},11:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk xi9pz9s"},7:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j xi9pz9s"},15:{className:"x78zum5 x6s0dn4 xl56j7k xb3r6kr x87ps6o x2lwn1j x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk xi9pz9s"}}[!!ge<<3|!!(!q&&a&&!ce)<<2|!!(!q&&ce)<<1|!!(!q&&R)<<0],onDoubleClick:q?void 0:Y,onKeyDown:ge?F:void 0,onPointerDown:q?void 0:le,children:q?o.jsx("video",{src:L.src,"aria-label":L.alt,controls:!0,autoPlay:l,className:"x193iq5w xmz0i5r x19kjcj4 x1a2a7pz"}):o.jsx("img",{src:L.src,alt:L.alt,draggable:!1,...G(Kc.image,R&&Kc.imageDragging,ve!=null&&aF.imageTransform(ve))})}),L.caption&&o.jsx("div",{className:"x9e3rv5 x18juvz8 xf74fhv x2b8uid x1xye8es x18d9i69 xrrkdod xrlsmeg x2lah0s",children:L.caption})]}),O&&o.jsx("div",{className:"x10l6tqk xwa60dl x1cb1t30 x1vjfegm x1mcfs9z",children:o.jsx(Bt,{icon:o.jsx("span",{...G(xd.mirror),children:o.jsx(Te,{icon:"chevronRight",size:"sm",color:"inherit"})}),label:v("@astryx.lightbox.next"),variant:"ghost",isDisabled:!X,onClick:P,xstyle:Kc.controlButton})}),O&&I.length>1&&o.jsxs("div",{className:"x10l6tqk xyx6v2t x1ybfrjj x9e3rv5 xjm74w1 xw6l6zx x1vjfegm",children:[T+1," / ",I.length]})]})}):null}FC.displayName="Lightbox";const Ks={base:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x1lsbc85",kMv6JI:"xjb2p0i",kGuDYH:"x1qlqyl8",kLWn49:"x15bjb6t",k63SB2:"x1pd3egz",kybGjl:"x1hl2dhg x4ohgrr",kkrTdU:"x1ypdohk",k1ekBW:"x1mpt4pi",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},buttonReset:{kWkggS:"xjbqb8w",ksu8eU:"xng3xce",kmVPX3:"x1717udv",kfzvcC:"x67bb7w",kVAEAm:"x1n2onr6",$$css:!0},hasUnderline:{kybGjl:"x1bvjpef",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0},standalone:{kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",$$css:!0}},c2={primary:{kMwMTN:"x1tgivj0 x4z56r7",$$css:!0},secondary:{kMwMTN:"xv1l7n4 x7ruf5d",$$css:!0},disabled:{kMwMTN:"xnbbluu",$$css:!0},placeholder:{kMwMTN:"xv1l7n4",$$css:!0},accent:{kMwMTN:"xjse4m1 x17qfo7y",$$css:!0},inherit:{kMwMTN:"x1heor9g",$$css:!0}};function lF(e){e.preventDefault()}function Hg({as:e,label:t,href:n,hasUnderline:s=!1,isDisabled:r=!1,isExternalLink:i=!1,newTabLabel:a,target:l,onClick:c,tooltip:u,isStandalone:d=!1,type:f="body",size:p,weight:x,color:g="accent",display:v="inline",maxLines:y=0,children:m,rel:k,xstyle:b,className:j,style:A,ref:M,...T}){const z=ze(),$=a??z("@astryx.link.newTab"),E=Ja(e),N=FS({href:n,onClick:c,isDisabled:r}),{target:_,rel:R}=NS(i?"_blank":l,k),B=N==="button"||N==="inert"&&n==null,D=o.jsxs(o.Fragment,{children:[o.jsx(K,{type:f,size:p,weight:x,color:g,display:v,maxLines:y,children:m}),i&&!B&&o.jsxs(o.Fragment,{children:[o.jsx(Te,{icon:"externalLink",size:"xsm",color:"inherit"}),o.jsx(Gi,{children:$})]})]});let I;return B?I=o.jsx("button",{ref:M,type:"button",onClick:c,"aria-label":t||void 0,"aria-disabled":r||void 0,tabIndex:r?-1:void 0,disabled:r,...ne(J("link",{color:g}),G(Ks.base,Ks.buttonReset,c2[g],s&&Ks.hasUnderline,d&&Ks.standalone,r&&Ks.disabled,b),j,A),...T,children:D}):r?I=o.jsx("a",{ref:M,onClick:lF,"aria-label":t||void 0,"aria-disabled":!0,tabIndex:-1,...ne(J("link",{color:g}),G(Ks.base,c2[g],s&&Ks.hasUnderline,d&&Ks.standalone,Ks.disabled,b),j,A),...T,children:D}):I=o.jsx(E,{ref:M,href:n,target:_,rel:R,onClick:c,"aria-label":t||void 0,"aria-disabled":r||void 0,tabIndex:r?-1:void 0,...ne(J("link",{color:g}),G(Ks.base,c2[g],s&&Ks.hasUnderline,d&&Ks.standalone,r&&Ks.disabled,b),j,A),...T,children:D}),u?o.jsx(Wi,{content:u,placement:"above",children:I}):I}Hg.displayName="Link";const C5=h.createContext(null);C5.displayName="MetadataListContext";const cl={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",$$css:!0},dl:{kogj98:"x1ghz6dp",kmVPX3:"x1717udv",$$css:!0},gridSingle:{k1xSpc:"xrvj5dj",kumcoG:"x1pmbctz",kOIVth:"xpec5dj",kGNEyG:"x1pha0wt",$$css:!0},gridMulti:{k1xSpc:"xrvj5dj",kumcoG:"x189bvgu",kOIVth:"x18g69wz",$$css:!0},gridStackedSingle:{k1xSpc:"xrvj5dj",kumcoG:"x1y6fwsi",kOIVth:"xjcht0a",$$css:!0},gridStackedMulti:{k1xSpc:"xrvj5dj",kumcoG:"x189bvgu",kOIVth:"x18g69wz",$$css:!0},horizontal:{k1xSpc:"x78zum5",kXwgrk:"x1q0g3np",kwnvtZ:"x1a02dak",kOIVth:"x18g69wz",$$css:!0}},cF={gridTemplate:e=>[{kumcoG:e!=null?"xqketvx":e,$$css:!0},{"--x-gridTemplateColumns":e??void 0}]},uF={position:"start"},e7={position:"top"};function VC({children:e,columns:t="single",label:n,maxNumOfItems:s,orientation:r="vertical",title:i,xstyle:a,className:l,style:c,"data-testid":u,ref:d}){const f=t==="multi"||typeof t=="number"&&t>1,p=n??(f?e7:uF),[x,g]=h.useState(!1),v=h.useId(),y=ze(),m=h.useMemo(()=>({labelConfig:r==="horizontal"?e7:p,orientation:r}),[p,r]),k=h.Children.toArray(e),b=r==="horizontal",j=b?void 0:s,A=j!=null&&k.length>j,M=A&&!x?k.slice(0,j):k,T=i!=null?o.jsx("div",{className:"xep27e5",children:i}):null,z=()=>b?cl.horizontal:p.position==="top"?t==="single"||t===1?cl.gridStackedSingle:cl.gridStackedMulti:t==="single"||t===1?cl.gridSingle:cl.gridMulti,E=(()=>{if(b)return null;const N=p.position==="top";return typeof t=="number"&&t>1?N?`repeat(${t}, 1fr)`:`repeat(${t}, auto 1fr)`:!N&&p.width!=null?`${typeof p.width=="number"?`${p.width}px`:p.width} 1fr`:null})();return o.jsx(C5,{value:m,children:o.jsxs("div",{ref:d,"data-testid":u,...ne(J("metadata-list",{columns:String(t),orientation:r}),G(cl.root,a),l,c),children:[T,o.jsx("dl",{id:v,...G(cl.dl,z(),E!=null&&cF.gridTemplate(E)),children:M}),A&&o.jsx("button",{type:"button","aria-controls":v,"aria-expanded":x,onClick:()=>g(N=>!N),className:"xjyslct x15nmkw0 x1ypdohk xqwr325 xjm74w1 xw6l6zx x1e4wzip xjb2p0i x1yc453h xqcrz7y",children:y(x?"@astryx.metadataList.showLess":"@astryx.metadataList.showMore")})]})})}VC.displayName="MetadataList";const t7={label:{kMwMTN:"xv1l7n4",kGuDYH:"xjm74w1",kLWn49:"xw6l6zx",k63SB2:"x1e4wzip",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kAzted:"xjwf9q1",kTgw9:"x13faqbe",$$css:!0},stackedWrapper:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",$$css:!0}};function zf({children:e,icon:t,label:n,xstyle:s,className:r,style:i,"data-testid":a,ref:l}){const c=h.use(C5),d=((c==null?void 0:c.labelConfig.position)??"start")==="top"||(c==null?void 0:c.orientation)==="horizontal",f=o.jsxs(o.Fragment,{children:[t!=null&&o.jsx("span",{className:"x3nfvp2 x6s0dn4 x2lah0s xv1l7n4",children:t}),n]});return d?o.jsxs("div",{ref:l,"data-testid":a,...ne(J("metadata-list-item"),G(t7.stackedWrapper,s),r,i),children:[o.jsx("dt",{className:"xv1l7n4 xjm74w1 xw6l6zx x1e4wzip x78zum5 x6s0dn4 x1txdalj x1ghz6dp x1717udv",children:f}),o.jsx("dd",{className:"x1tgivj0 xjm74w1 xw6l6zx x1ghz6dp x1717udv x13faqbe",children:e})]}):o.jsxs(o.Fragment,{children:[o.jsx("dt",{ref:l,"data-testid":a?`${a}-label`:void 0,...ne(J("metadata-list-item"),G(t7.label,s),r,i),children:f}),o.jsx("dd",{"data-testid":a?`${a}-value`:void 0,className:"x1tgivj0 xjm74w1 xw6l6zx x1ghz6dp x1717udv xjwf9q1 x13faqbe",children:e})]})}zf.displayName="MetadataListItem";const dF={x1iwu4tg:"x1iwu4tg",$$css:!0},fF={sm:{kzqmXN:"x1td3qas",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"x100vrsf",kZKoxP:"xxk0z11",$$css:!0}},hF={sm:{kzqmXN:"x1td3qas",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"x100vrsf",kZKoxP:"xxk0z11",$$css:!0}},pF={sm:{kzqmXN:"x1td3qas",kZKoxP:"x1qx5ct2",kmVPX3:"x1i3ajwb",$$css:!0},md:{kzqmXN:"x100vrsf",kZKoxP:"xxk0z11",kmVPX3:"xfawy5m",$$css:!0}},xF={sm:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",k3aq6I:"xbryuvx",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",k3aq6I:"xbryuvx",$$css:!0}},gF={sm:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",k3aq6I:"xv5t66b xi9aj42",$$css:!0},md:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",k3aq6I:"x15481yp x12xz5k6",$$css:!0}},mF={sm:{kAzted:"xisnujt",$$css:!0},md:{kAzted:"xjwf9q1",$$css:!0}},ns={container:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},containerSpread:{kjj79g:"x1qughib",kzqmXN:"xh8yej3",$$css:!0},switchWrapper:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kmuXW:"x2lah0s",kHBbk8:"xc8icb0",$$css:!0},input:{kVAEAm:"x10l6tqk",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kSiTet:"xg01cxk",kkrTdU:"x1ypdohk",kY2c9j:"x1vjfegm",$$css:!0},inputDisabled:{kkrTdU:"x1h6gzvc",$$css:!0},inputBusy:{kfzvcC:"x47corl",$$css:!0},track:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kaIpWk:"xjspbzw",k1ekBW:"x15406qy",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",kB7OPa:"x9f619",kMzoRj:"xc342km x13rsnn2",ksu8eU:"xng3xce xx61lck",kVAM5u:"x1w1tqly",$$css:!0},trackFocus:{kI3sdo:"x1a2a7pz x1gj1ihy",kInvED:"x1edzap1",$$css:!0},trackOff:{kWkggS:"xspzpui x1a8ae7b x9yvj25",$$css:!0},trackOn:{kWkggS:"x1ewilqj xcgwt1n x1jzqe4",$$css:!0},trackDisabled:{kSiTet:"xbyyjgo",kVAM5u:"xmnqt3w",$$css:!0},trackDisabledOff:{kWkggS:"xspzpui",$$css:!0},thumb:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kaIpWk:"xjspbzw",k1ekBW:"xh3q6i0",kIyJzY:"xuedmi6 x12w9bfk",kAMwcw:"xlr8y92",$$css:!0},thumbOff:{kWkggS:"x10xzikg xwvh9j7",$$css:!0},thumbOn:{kWkggS:"x10xzikg x1sir5s4",$$css:!0},labelWrapper:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",kjj79g:"xl56j7k",$$css:!0}},yF={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function E5({label:e,isLabelHidden:t=!1,description:n,onChange:s,changeAction:r,isLoading:i=!1,value:a,isDisabled:l=!1,htmlName:c,disabledMessage:u,isOptional:d=!1,isRequired:f=!1,onFocus:p,onBlur:x,labelIcon:g,labelTooltip:v,labelPosition:y="end",labelSpacing:m="hug",status:k,size:b="md",width:j,xstyle:A,className:M,style:T,ref:z,...$}){const E=h.useId(),N=h.useId(),_=h.useId(),[,R]=h.useTransition(),[B,D]=h.useOptimistic(a),I=i||B!==a,O=B===!0,L=l&&!!u,H=Ss({placement:"above",focusTrigger:"always",isEnabled:L}),q=[];n&&q.push(N),k!=null&&k.message&&q.push(_),L&&q.push(H.describedBy);const U=q.length>0?q.join(" "):void 0,X=o.jsxs("div",{...G(ns.switchWrapper,fF[b]),children:[o.jsx("input",{ref:Ft(z,H.positionRef),id:E,type:"checkbox",role:"switch",name:l?void 0:c,checked:O,disabled:l&&!L,"aria-disabled":L?"true":void 0,required:f,onChange:ie=>{if(l||I)return;const ae=ie.target.checked;s==null||s(ae,ie),r&&!ie.defaultPrevented&&R(async()=>{D(ae),await r(ae,ie)})},onFocus:p,onBlur:x,"aria-describedby":U,"aria-invalid":(k==null?void 0:k.type)==="error"?!0:void 0,"aria-busy":I||void 0,...G(ns.input,hF[b],l&&ns.inputDisabled,I&&ns.inputBusy)}),o.jsx("div",{"aria-hidden":"true",...ne(J("switch",{checked:O?"checked":null,disabled:l?"disabled":null,size:b}),G(ns.track,pF[b],O?ns.trackOn:ns.trackOff,!l&&ns.trackFocus,l&&ns.trackDisabled,l&&!O&&ns.trackDisabledOff)),children:o.jsx("div",{...ne(J("switch-thumb",{checked:O?"checked":null,size:b}),G(ns.thumb,O?gF[b]:xF[b],O?ns.thumbOn:ns.thumbOff)),children:I&&o.jsx(Vt,{size:"sm"})})}),I&&o.jsx(Gi,{role:"status",children:"Loading"})]}),Z=o.jsx("div",{...G(ns.labelWrapper,mF[b]),children:o.jsx(Ag,{label:e,inputID:E,isLabelHidden:t,isDisabled:l,isOptional:d,isRequired:f,labelIcon:g,labelTooltip:v,description:n,descriptionID:N})});return o.jsxs("div",{...ne(J("switch-field",{labelPosition:y!=="end"?y:void 0,labelSpacing:m!=="hug"?m:void 0}),G(j!=null&&yF.width(j),A),M,T),...$,children:[o.jsxs("div",{ref:ie=>{H.interactionRef(ie)},...G(ns.container,m==="spread"&&ns.containerSpread,!l&&dF),children:[" ",y==="start"?o.jsxs(o.Fragment,{children:[Z,X]}):o.jsxs(o.Fragment,{children:[X,Z]})]}),(k==null?void 0:k.message)&&o.jsx("div",{className:"xtbrsbv",children:o.jsx(jh,{type:k.type,message:k.message,id:_,variant:"detached"})}),L&&H.renderTooltip(u)]})}E5.displayName="Switch";const $5=h.createContext(null);$5.displayName="SegmentedControlContext";function vF(){const e=h.use($5);if(e==null)throw new Error("useSegmentedControlContext must be used within SegmentedControl. Wrap your SegmentedControlItem in <SegmentedControl>.");return e}const f0={container:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x1lsbc85","--_segmented-control-padding":"x18jk3ff",kmVPX3:"xpoxszi",kWkggS:"x17x4s8c",$$css:!0},fill:{k1xSpc:"x78zum5",kzqmXN:"xh8yej3",$$css:!0},disabled:{kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0},disabledWithMessage:{kSiTet:"xbyyjgo",$$css:!0}},kF={sm:{"--_segmented-control-radius":"x9icjy1",kaIpWk:"x1hapoqb",$$css:!0},md:{"--_segmented-control-radius":"x9icjy1",kaIpWk:"x1hapoqb",$$css:!0},lg:{"--_segmented-control-radius":"x9icjy1",kaIpWk:"x1hapoqb",$$css:!0}};function A5({ref:e,value:t,onChange:n,label:s,size:r,layout:i="hug",isDisabled:a=!1,disabledMessage:l,children:c,xstyle:u,className:d,style:f,onKeyDown:p,onFocus:x,onBlur:g,...v}){const y=Qa(r,"md"),m=a&&!!l,k=Ss({placement:"above",focusTrigger:"always",isEnabled:m}),{listRef:b,handleKeyDown:j,handleFocus:A}=Tc({itemSelector:'[role="radio"]:not([aria-disabled="true"])',hasRovingTabIndex:!0,wrap:!0,orientation:"horizontal"}),M=HS({orientation:"horizontal",isEnabled:!a}),T=h.useCallback(E=>{p==null||p(E),!E.defaultPrevented&&(M.onKeyDown(E),j(E))},[p,M,j]),z=h.useCallback(E=>{var R;if(x==null||x(E),E.defaultPrevented||(M.onFocus(E),A(E),a)||!E.currentTarget.contains(E.relatedTarget))return;const N=(R=E.target)==null?void 0:R.closest('[role="radio"][data-value]');if(!N||N.getAttribute("aria-disabled")==="true")return;const _=N.dataset.value;_!=null&&_!==t&&n(_)},[x,M,A,a,n,t]),$=h.useMemo(()=>({value:t,onChange:n,size:y,layout:i,isDisabled:a,hasDisabledMessage:m}),[t,n,y,i,a,m]);return o.jsxs($5,{value:$,children:[o.jsxs("div",{ref:Ft(e,b,k.ref),...v,role:"radiogroup","aria-label":s,"aria-disabled":a||void 0,"aria-describedby":m?k.describedBy:void 0,onKeyDown:T,onFocus:z,onBlur:vg(g,M.onBlur),...ne(J("segmented-control",{size:y}),G(f0.container,kF[y],i==="fill"&&f0.fill,a&&(m?f0.disabledWithMessage:f0.disabled),u),d,f),children:[c,M.hintElement]}),m&&k.renderTooltip(l)]})}A5.displayName="SegmentedControl";const Xc={base:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"xzye2dw",kg3NbH:"xrrkdod",kWkggS:"xjbqb8w",kMzoRj:"xc342km",ksu8eU:"xng3xce",kMv6JI:"xjb2p0i",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",k63SB2:"x1e4wzip",kMwMTN:"xv1l7n4",kkrTdU:"x1ypdohk",k1ekBW:"x1vix5yk",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},hover:{kWkggS:"xe9uy6x",$$css:!0},selected:{kAXs8y:"x1kzknox",kMwMTN:"x1tgivj0 x1k5gbb1",k63SB2:"x2mo6ok",kWkggS:"x10xzikg x1jzqe4",kGVxlE:"x1i5ehqx",$$css:!0},disabled:{kkrTdU:"xt0e3qv",kMwMTN:"xnbbluu",$$css:!0},fill:{kUk6DE:"x98rzlu",kjj79g:"xl56j7k",$$css:!0},icon:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",$$css:!0}},bF={sm:{kZKoxP:"xzj98nu",kaIpWk:"xc910v0",kg3NbH:"xf314gf",kGuDYH:"x141an7d",$$css:!0},md:{kZKoxP:"x184gfjb",kaIpWk:"xc910v0",kg3NbH:"xrrkdod",$$css:!0},lg:{kZKoxP:"x1uiybsj",kaIpWk:"xc910v0",kg3NbH:"xrrkdod",$$css:!0}},wF={sm:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",$$css:!0},lg:{kzqmXN:"x1xp8n7a",kZKoxP:"xmix8c7",$$css:!0}};function zu({ref:e,value:t,label:n,isLabelHidden:s=!1,icon:r,isDisabled:i=!1,onClick:a,xstyle:l,...c}){const u=vF(),d=u.value===t,f=i||u.isDisabled,p=d&&(u.hasDisabledMessage??!1)&&!i,x=u.size,g=u.layout==="fill",v=vg(a,()=>{!f&&!d&&u.onChange(t)}),y=r?o.jsx("span",{...G(Xc.icon,wF[x]),children:r}):null;return o.jsxs("button",{ref:e,...c,type:"button",role:"radio","aria-checked":d,"aria-disabled":f||void 0,"aria-label":s?n:void 0,"data-value":t,tabIndex:d&&!f||p?0:-1,onClick:v,...ne(J("segmented-control-item",{size:x,selected:d?"selected":null,disabled:f?"disabled":null}),G(Xc.base,bF[x],g&&Xc.fill,d&&Xc.selected,!d&&!f&&Xc.hover,f&&Xc.disabled,l)),children:[y,!s&&o.jsx("span",{children:n})]})}zu.displayName="SegmentedControlItem";function jF({selectableItems:e,isDisabled:t=!1,isOpen:n,hasSearch:s=!1,onOpen:r,onClose:i,onToggle:a,onClear:l,hasValue:c=!1,listboxId:u}){const[d,f]=h.useState(-1),[p,x]=h.useState(""),g=h.useRef(void 0),v=h.useCallback(A=>`${u}-item-${A}`,[u]),y=h.useCallback(()=>e.map((A,M)=>A.disabled?-1:M).filter(A=>A>=0),[e]),m=h.useCallback(()=>{f(-1),i()},[i]),k=h.useCallback(()=>{t||(n?m():(r(),s||f(0)))},[t,n,r,m,s]),b=h.useCallback((A,M)=>{A.disabled||f(M)},[]),j=h.useCallback(A=>{if(t)return;const M=y();switch(A.key){case"ArrowDown":if(A.preventDefault(),!n)r(),f(0);else{const T=M.indexOf(d),z=Math.min(T+1,M.length-1);f(M[z]??d)}break;case"ArrowUp":if(A.preventDefault(),!n)r(),f(e.length-1);else{const T=M.indexOf(d),z=Math.max(T-1,0);f(M[z]??d)}break;case"Enter":case" ":if(A.key===" "&&s)break;if(A.preventDefault(),n&&d>=0){const T=e[d];T&&!T.disabled&&a(T.value)}else n||(r(),s||f(0));break;case"Tab":n&&m();break;case"Escape":n&&(A.preventDefault(),m());break;case"Home":A.preventDefault(),n&&M.length>0&&f(M[0]);break;case"End":A.preventDefault(),n&&M.length>0&&f(M[M.length-1]);break;case"PageUp":A.preventDefault(),n&&M.length>0&&f(M[0]);break;case"PageDown":A.preventDefault(),n&&M.length>0&&f(M[M.length-1]);break;case"Delete":case"Backspace":!s&&!n&&l!=null&&c&&(A.preventDefault(),l());break;default:if(!s&&A.key.length===1&&!A.ctrlKey&&!A.metaKey){const T=p+A.key.toLowerCase();x(T),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{x("")},500);const z=e.findIndex($=>{var E;return!$.disabled&&((E=$.label)==null?void 0:E.toLowerCase().startsWith(T))});z>=0&&(n||r(),f(z))}break}},[t,n,r,m,e,d,a,y,p,s,l,c]);return{highlightedIndex:d,setHighlightedIndex:f,getItemId:v,onTriggerClick:k,onKeyDown:j,onItemMouseEnter:b}}const u2="__xds_select_all__",vr={triggerContainer:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kOIVth:"x1txdalj",kzqmXN:"xh8yej3",k8WAf4:"xce4md1",kg3NbH:"xrrkdod",kMv6JI:"x9ynric",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",kMwMTN:"x1tgivj0",kkrTdU:"x1ypdohk",$$css:!0},triggerPlaceholder:{kMwMTN:"xv1l7n4",$$css:!0},triggerGhost:{kzqmXN:"x14atkfc",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kKwaWg:"x1ilzqfv xq8i9tn",kGVxlE:"x1gnnqk1 x1irk71m x15ysqaf",k63SB2:"x1e4wzip",kI3sdo:"x1a2a7pz x1irc7jg",kInvED:"x1wfwxd8 xscfbxq",k1ekBW:"xrafxwg",k3aq6I:"x3oybdh xk4oym4",$$css:!0},triggerGhostDisabled:{kKwaWg:"x18o3ruo",k3aq6I:"x1c071of x1pdlv7q",$$css:!0},popover:{k7Eaqz:"xrzjruh",keoZOQ:"xcsaf9d",$$css:!0},selectAllWrapper:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kkrTdU:"x1ypdohk",$$css:!0},sectionDivider:{kqGvvJ:"xsq74q5",$$css:!0},divider:{kqGvvJ:"xsq74q5",$$css:!0},item:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kzqmXN:"xh8yej3",kaIpWk:"xh6dtrn",kkrTdU:"x1ypdohk",kWkggS:"xjbqb8w",kI3sdo:"x1a2a7pz",$$css:!0},itemHighlighted:{kWkggS:"x1lmrjuc",$$css:!0},itemDisabled:{kSiTet:"xbyyjgo",kkrTdU:"x1h6gzvc",$$css:!0}},SF={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},CF={sm:{kmVPX3:"x9epnlk",$$css:!0},md:{k8WAf4:"x1vofgu7",kg3NbH:"xf314gf",$$css:!0},lg:{kmVPX3:"xlsj2fj",$$css:!0}},EF={sm:{kg3NbH:"x7a5moj",k8WAf4:"x13f7esw",$$css:!0},md:{kg3NbH:"xf314gf",k8WAf4:"xu0wf1k",$$css:!0},lg:{kg3NbH:"xf314gf",k8WAf4:"xu0wf1k",$$css:!0}},n7={warning:"warning",error:"error",success:"success"},s7={warning:"warning",error:"error",success:"success"},$F={warning:"@astryx.input.statusButton.warning",error:"@astryx.input.statusButton.error",success:"@astryx.input.statusButton.success"};function Nf(e,t){return t?(e.label??e.value).toLowerCase().includes(t.toLowerCase()):!0}function r7(e,t){return t?e.filter(n=>Nf(n,t)):e}function GC({label:e,isLabelHidden:t=!1,description:n,isOptional:s=!1,isRequired:r=!1,isDisabled:i=!1,disabledMessage:a,options:l,value:c,onChange:u,changeAction:d,isLoading:f=!1,placeholder:p,size:x,variant:g="input",status:v,statusVariant:y="attached",labelTooltip:m,startIcon:k,hasClear:b=!1,hasSelectAll:j=!1,selectAllLabel:A,hasSearch:M=!1,searchPlaceholder:T,triggerDisplay:z="count",maxBadges:$=3,renderOption:E,isDefaultOpen:N=!1,"data-testid":_,htmlName:R,width:B,xstyle:D,className:I,style:O}){const L=ze(),H=p??L("@astryx.multiSelector.selectPlaceholder"),q=A??L("@astryx.multiSelector.selectAll"),U=T??L("@astryx.multiSelector.searchPlaceholder"),X=Qa(x,"md"),Z=g==="ghost"&&y==="attached"?"detached":y,ie=h.useId(),ae=h.useId(),xe=h.useId(),fe=h.useId(),se=h.useId(),ye=h.useId(),me=h.useRef(null),P=h.useRef(null),V=i5(),[Y,oe]=h.useState(""),F=Y.length>0,[le,ce]=h.useState(null),[,ge]=h.useTransition(),[ve,pe]=h.useOptimistic(c),Ve=f||ve!==c,Ye=i&&!!a,ot=Ss({placement:"above",focusTrigger:"always",isEnabled:Ye}),at=Ss({placement:"above",isEnabled:Z==="tooltip"&&!!(v!=null&&v.message)}),{ariaLabelledBy:Mt,ariaDescribedBy:Dn}=I4(se,[n?xe:null,!V&&Z!=="tooltip"&&(v!=null&&v.message)?fe:null,Z==="tooltip"&&(v!=null&&v.message)?at.describedBy:null,Ye?ot.describedBy:null],V),nt=h.useMemo(()=>lC(l),[l]),Tt=Nc(),wn=h.useCallback(he=>{const ee=nt.length,je=new Set(nt.map(we=>we.value)),te=he.filter(we=>je.has(we)).length;te===0?Tt("Selection cleared"):ee>0&&te===ee?Tt("All selected"):Tt(`${te} of ${ee} selected`)},[Tt,nt]),Ms=h.useMemo(()=>r7(nt,Y),[nt,Y]),Fs=h.useMemo(()=>{const he=le??new Set,ee=[];let je=[];const te=Ce=>{const He=Ce.filter(ps=>he.has(ps.value)),lt=Ce.filter(ps=>!he.has(ps.value));return[...He,...lt]},we=()=>{je.length!==0&&(ee.push(...te(je)),je=[])};for(const Ce of l)if(Hy(Ce))we();else if(cx(Ce)){we();const He=Ce.options.map(lt=>Sa(lt)).filter(lt=>Nf(lt,Y));ee.push(...te(He))}else if(lx(Ce)){const He=Sa(Ce);Nf(He,Y)&&je.push(He)}return we(),j?[{value:u2,label:q},...ee]:ee},[Y,l,le,j,q]),yt=h.useCallback(()=>{var he;oe(""),ce(null),Tt(""),(he=me.current)==null||he.focus()},[Tt]),jt=zc({hasLightDismiss:!0,onHide:yt,hasCloseButton:!1,hasAutoFocus:!1,role:"none"});h.useEffect(()=>{N&&jt.show()},[]);const Fe=h.useCallback(he=>{if(oe(he),he.length===0){Tt("");return}const ee=r7(nt,he).length;Tt(ee===0?"No results found":`${ee} result${ee===1?"":"s"}`)},[Tt,nt]),ai=h.useCallback(()=>{u([]),wn([]),d&&ge(async()=>{pe([]),await d([])})},[u,d,ge,pe,wn]),Ts=ve.length>0,Ho=h.useCallback(he=>{he.stopPropagation(),ai()},[ai]),zs=h.useCallback(he=>{const ee=ve.includes(he)?ve.filter(je=>je!==he):[...ve,he];u(ee),wn(ee),d&&ge(async()=>{pe(ee),await d(ee)})},[ve,u,d,ge,pe,wn]),Bn=h.useMemo(()=>Ms.filter(he=>!he.disabled),[Ms]),Pr=h.useMemo(()=>Bn.length>0&&Bn.every(he=>ve.includes(he.value)),[Bn,ve]),Yi=h.useMemo(()=>Bn.some(he=>ve.includes(he.value)),[Bn,ve]),jn=Pr?!0:Yi?"indeterminate":!1,Ns=h.useCallback(()=>{let he;if(Pr){const ee=new Set(Bn.map(je=>je.value));he=ve.filter(je=>!ee.has(je))}else{const ee=new Set(ve);he=[...ve];for(const je of Bn)ee.has(je.value)||he.push(je.value)}u(he),wn(he),d&&ge(async()=>{pe(he),await d(he)})},[Pr,Bn,ve,u,d,ge,pe,wn]),Sn=h.useCallback(he=>{he===u2?Ns():zs(he)},[Ns,zs]),{highlightedIndex:tn,getItemId:es,onTriggerClick:li,onKeyDown:Vs,onItemMouseEnter:ci}=jF({selectableItems:Fs,isDisabled:i,isOpen:jt.isOpen,hasSearch:M,onOpen:h.useCallback(()=>{ce(new Set(ve)),jt.show(),M&&requestAnimationFrame(()=>{var he;(he=P.current)==null||he.focus()})},[jt,M,ve]),onClose:jt.hide,onToggle:Sn,onClear:b?ai:void 0,hasValue:Ts,listboxId:ae});h.useEffect(()=>{var he,ee;!jt.isOpen||tn<0||(ee=(he=document.getElementById(es(tn)))==null?void 0:he.scrollIntoView)==null||ee.call(he,{block:"nearest"})},[jt.isOpen,tn,es]);const hs=h.useMemo(()=>ve.map(he=>{const ee=nt.find(je=>je.value===he);return(ee==null?void 0:ee.label)??he}),[ve,nt]),ui=h.useCallback(()=>{if(ve.length===0)return o.jsx("span",{className:"xb3r6kr xlyipyv xuxw1ft",children:H});switch(z){case"count":return o.jsxs("span",{className:"xb3r6kr xlyipyv xuxw1ft",children:[ve.length," selected"]});case"labels":{const he=hs.slice(0,3),ee=hs.length-he.length,je=ee>0?`${he.join(", ")}, +${ee}`:he.join(", ");return o.jsx("span",{className:"xb3r6kr xlyipyv xuxw1ft",children:je})}case"badges":{const he=hs.slice(0,$),ee=hs.length-he.length;return o.jsxs("span",{className:"x78zum5 x1a02dak xzye2dw x6s0dn4",children:[he.map(je=>o.jsx(Bd,{label:je,variant:"neutral"},je)),ee>0&&o.jsxs("span",{className:"x2lah0s xcr08ib xv1l7n4 x1e4wzip",children:["+",ee]})]})}}},[ve,z,hs,H,$]),Ur=h.useCallback(()=>M?o.jsx("div",{className:"x78zum5 x6s0dn4 xf314gf xu0wf1k",onKeyDown:he=>{he.target!==P.current&&he.key==="Tab"&&!he.shiftKey&&Vs(he)},children:o.jsx(st,{ref:P,id:ye,label:L("@astryx.multiSelector.searchOptions"),isLabelHidden:!0,startIcon:"search",hasClear:!0,size:"sm",width:"100%",role:"combobox","aria-expanded":jt.isOpen,"aria-controls":ae,"aria-autocomplete":"list","aria-activedescendant":jt.isOpen&&tn>=0?es(tn):void 0,value:Y,onChange:Fe,onKeyDown:he=>{if(he.key==="ArrowDown"||he.key==="ArrowUp"||he.key==="PageUp"||he.key==="PageDown"||he.key==="Enter"||he.key==="Escape"){Vs(he);return}he.key==="Tab"&&(he.shiftKey||!F)&&Vs(he)},placeholder:U})}):null,[M,ye,ae,Y,F,U,Fe,Vs,jt.isOpen,tn,es,L]),Gs=h.useCallback((he,ee)=>{const je=ee===tn,te=he.value===u2,we=te?Pr:ve.includes(he.value),Ce=te?jn:we,He=te&&jn==="indeterminate";return o.jsxs("div",{id:es(ee),role:"option","aria-selected":we,"aria-label":He?L("@astryx.multiSelector.selectAllPartiallySelected",{label:q}):void 0,"aria-disabled":he.disabled,onClick:()=>{he.disabled||Sn(he.value)},onMouseEnter:()=>ci(he,ee),...G(vr.item,te?EF[X]:CF[X],te&&vr.selectAllWrapper,je&&vr.itemHighlighted,he.disabled&&vr.itemDisabled),children:[o.jsx("div",{inert:!0,className:"x47corl x78zum5 x2lah0s",children:o.jsx(Sh,{label:"",isLabelHidden:!0,value:Ce,onChange:()=>{},isDisabled:he.disabled,size:X==="lg"?"md":X})}),E&&!te?E(he):o.jsx("span",{...{0:{className:"x9ynric xcr08ib x1e4wzip x1tgivj0 xeuugli xb3r6kr xlyipyv xuxw1ft"},1:{className:"x9ynric xcr08ib x1e4wzip xeuugli xb3r6kr xlyipyv xuxw1ft xnbbluu"}}[!!he.disabled<<0],children:he.label??he.value})]},he.value)},[E,tn,ve,Pr,jn,q,es,Sn,ci,X,L]),di=h.useCallback(()=>{const he=[];let ee=0;const je=j?Fs.length-1:Fs.length;if(j&&je>0?(he.push(Gs(Fs[0],0)),he.push(o.jsx(Na,{xstyle:vr.divider},"select-all-divider")),ee=1):j&&(ee=1),je===0)return he.push(o.jsx("div",{role:"presentation",className:"x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib",children:"No results found"},"empty")),he;const te=!!Y;let we=0;const Ce=()=>{for(let He=0;He<we;He++)he.push(Gs(Fs[ee],ee)),ee++;we=0};for(let He=0;He<l.length;He++){const lt=l[He];if(Hy(lt))Ce(),te||he.push(o.jsx(Na,{xstyle:vr.divider},`divider-${He}`));else if(cx(lt)){Ce();const ps=te?lt.options.filter(fi=>Nf(Sa(fi),Y)).length:lt.options.length;if(ps===0)continue;const qo=[];for(let fi=0;fi<ps;fi++)qo.push(Gs(Fs[ee],ee)),ee++;lt.title&&he.push(o.jsx(Na,{label:lt.title,xstyle:vr.sectionDivider},`section-divider-${He}`)),he.push(o.jsx("div",{role:"group","aria-label":lt.title,children:qo},`section-${He}`))}else lx(lt)&&(!te||Nf(Sa(lt),Y))&&we++}return Ce(),he},[l,Gs,Fs,Y,j]),Se=v!=null&&Z!=="detached",It=v!=null&&Z==="tooltip"&&!!v.message,ts=o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:he=>{jt.triggerRef(he),ot.ref(he)},onClick:li,"data-testid":_,...ne(J("multi-selector",{variant:g,size:X,status:(v==null?void 0:v.type)??null}),G(Fa.base,vr.triggerContainer,SF[X],g==="ghost"&&vr.triggerGhost,i&&Fa.disabled,g==="ghost"&&i&&vr.triggerGhostDisabled,ve.length===0&&vr.triggerPlaceholder,g!=="ghost"&&v&&Rg[v.type],g!=="ghost"&&v&&!i&&Ig[v.type],g!=="ghost"&&V&&r5.inGroup,D),I,O),children:[k&&Lr(k,{size:"sm",color:"secondary"}),V&&o.jsx(Gi,{id:se,children:e}),o.jsx("button",{ref:me,id:ie,type:"button",role:M?void 0:"combobox","aria-haspopup":"listbox","aria-expanded":jt.isOpen,"aria-controls":ae,"aria-activedescendant":!M&&jt.isOpen&&tn>=0?es(tn):void 0,"aria-describedby":Dn,"aria-labelledby":Mt,"aria-required":r?"true":void 0,"aria-invalid":(v==null?void 0:v.type)==="error"?"true":void 0,"aria-busy":Ve||void 0,disabled:i&&!Ye,"aria-disabled":Ye?"true":void 0,onKeyDown:Vs,tabIndex:i&&!Ye?-1:0,className:"x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x1a2a7pz xh6dtrn",children:o.jsx("span",{className:"x78zum5 x6s0dn4 xzye2dw x1iyjqo2 xs83m0k x1r8uery xeuugli xb3r6kr",children:ui()})}),R!=null&&c.map(he=>o.jsx("input",{type:"hidden",name:R,value:he,disabled:i},he)),Ve&&o.jsx(Vt,{size:"sm"}),b&&c.length>0&&!i&&o.jsx("button",{type:"button",onClick:Ho,"aria-label":L("@astryx.multiSelector.clearAll",{label:e}),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:o.jsx(Te,{icon:"close",size:"sm",color:"secondary",...J("multi-selector-clear-icon")})}),o.jsx("span",{...{0:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike"},2:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0"},1:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike xq2gx43"},3:{className:"x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0 xq2gx43"}}[!!(!Se&&jt.isOpen)<<1|!!Se<<0],children:Se?It?o.jsx("button",{ref:at.ref,type:"button","aria-label":L($F[v.type]),"aria-describedby":at.describedBy,onClick:he=>he.stopPropagation(),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:o.jsx(Te,{icon:n7[v.type],size:"sm",color:s7[v.type]})}):o.jsx(Te,{icon:n7[v.type],size:"sm",color:s7[v.type]}):o.jsx(Te,{icon:"chevronDown",size:"sm",color:"inherit",...J("multi-selector-indicator-icon",{state:jt.isOpen?"expanded":"collapsed"})})})]}),jt.render(o.jsxs("div",{className:"x9f619 xuyqlj2 x1odjw0f x9epnlk",children:[Ur(),o.jsx("div",{id:ae,role:"listbox","aria-multiselectable":"true","aria-labelledby":ie,children:di()})]}),{placement:"below",alignment:"start",xstyle:vr.popover}),It&&at.renderTooltip((v==null?void 0:v.message)??""),Ye&&ot.renderTooltip(a)]});return V?ts:o.jsx(_c,{label:e,isLabelHidden:t,description:n,inputID:ie,descriptionID:n?xe:void 0,isOptional:s,isRequired:r,isDisabled:i,status:v?{type:v.type,message:v.message,messageID:v.message?fe:void 0}:void 0,statusVariant:Z,labelTooltip:m,width:B,children:ts})}GC.displayName="MultiSelector";const M5=h.createContext(null);M5.displayName="TabListContext";function WC(){const e=h.use(M5);if(e==null)throw new Error("useTabListContext must be used within TabList. Wrap your Tab/TabMenu in <TabList>.");return e}const AF="[data-tab-value],[data-tab-menu]",d2={nav:{k1xSpc:"x78zum5",kGNEyG:"x1qjc9v5",kOIVth:"x1lsbc85",ks0D6T:"x193iq5w",k7Eaqz:"xeuugli",$$css:!0},fill:{kzqmXN:"xh8yej3",$$css:!0},divider:{kt9PQ7:"x92x3c3",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",kGO01o:"xy143xn","--_tab-indicator-bottom":"xficto1",$$css:!0}};function KC({ref:e,value:t,onChange:n,size:s,layout:r="hug",hasDivider:i=!1,xstyle:a,className:l,style:c,children:u,onKeyDown:d,onFocus:f,onBlur:p,"aria-label":x,"aria-orientation":g,[ox]:v,...y}){const m=ze(),k=x??m("@astryx.tabList.label"),b=Qa(s,"md"),{listRef:j,handleKeyDown:A,handleFocus:M}=Tc({itemSelector:AF,orientation:"both",hasRovingTabIndex:!0}),{hintElement:T,onKeyDown:z,onFocus:$,onBlur:E}=HS(),N=h.useMemo(()=>({value:t,onChange:n,size:b,layout:r}),[t,n,b,r]),_=h.useCallback(D=>{d==null||d(D),!D.defaultPrevented&&(z(D),A(D))},[d,z,A]),R=h.useCallback(D=>{f==null||f(D),!D.defaultPrevented&&($(D),M(D))},[f,$,M]),B=h.useCallback(D=>{p==null||p(D),!D.defaultPrevented&&E(D)},[p,E]);return o.jsx(M5,{value:N,children:o.jsxs("nav",{ref:Ft(e,j),...y,"aria-label":k,onKeyDown:_,onFocus:R,onBlur:B,[ox]:"",...ne(J("tab-list",{size:b}),G(d2.nav,r==="fill"&&d2.fill,i&&d2.divider,a),l,c),children:[u,T]})})}KC.displayName="TabList";const XC={x1u3b27q:"x1u3b27q",$$css:!0},h0={base:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"xzye2dw",kg3NbH:"xrrkdod",kWkggS:"xjbqb8w",kMzoRj:"xc342km",ksu8eU:"xng3xce",kaIpWk:"xh6dtrn",kMv6JI:"xjb2p0i",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",k63SB2:"x1sodnla",kMwMTN:"xv1l7n4",kkrTdU:"x1ypdohk",kybGjl:"x1hl2dhg",khDVqt:"xuxw1ft",k1ekBW:"xt3l3uh",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},hoverBg:{kVAEAm:"x10l6tqk",kpwlN0:"x10a8y8t",kogj98:"x1bpp3o7",kzqmXN:"xh8yej3",kaIpWk:"xh6dtrn",kfzvcC:"x47corl",kWkggS:"xjbqb8w x1a1zr74",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0},selected:{kMwMTN:"x1tgivj0",k63SB2:"x2mo6ok",$$css:!0},icon:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",$$css:!0}},MF={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},TF={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},zF={fill:{kUk6DE:"x98rzlu",kjj79g:"xl56j7k",$$css:!0}},NF={sm:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",$$css:!0},lg:{kzqmXN:"x1xp8n7a",kZKoxP:"xmix8c7",$$css:!0}};function ZC({as:e,ref:t,value:n,label:s,isLabelHidden:r=!1,href:i,icon:a,selectedIcon:l,endContent:c,xstyle:u,className:d,style:f,...p}){const x=WC(),g=Ja(e),v=x.value===n,y=x.size,m=x.layout==="fill",k=v&&l?l:a,b=!r&&s!=="",j=h.useCallback(()=>{x.onChange(n)},[x,n]),A=k?o.jsx("span",{...G(h0.icon,NF[y]),children:k}):null,M={...p,...r?{"aria-label":s}:{},[ox]:"","data-tab-value":n,"aria-current":v?"page":void 0,tabIndex:v?0:-1,...ne(J("tab",{selected:v?"selected":null}),G(h0.base,MF[y],v&&h0.selected,m&&zF.fill,XC,u),d,f)},T=o.jsx("span",{"aria-hidden":"true",...G(h0.hoverBg,TF[y])}),z=o.jsx("span",{...ne(J("tab-indicator",{selected:v?"selected":null}),{0:{className:"x10l6tqk xyi47jn x1ybfrjj x1mcfs9z x36qwtl xjspbzw x47corl xnpjden xuedmi6 xlr8y92 xjbqb8w xg01cxk"},1:{className:"x10l6tqk xyi47jn x1ybfrjj x1mcfs9z x36qwtl xjspbzw x47corl xnpjden xuedmi6 xlr8y92 x1ewilqj x1hc1fzr"}}[!!v<<0])}),$=b?o.jsxs("span",{className:"xwz0xwf",children:[o.jsx("span",{className:"x1agbcgv xcrlgei",children:s}),o.jsx("span",{"aria-hidden":"true",className:"x1agbcgv xcrlgei xlshs6z x47corl x2mo6ok",children:s})]}):null,E=c?o.jsx("span",{className:"x3nfvp2 x6s0dn4 x2lah0s",children:c}):null;return i!=null?o.jsxs(g,{ref:t,href:i,onClick:j,...M,children:[T,A,$,E,z]}):o.jsxs("button",{ref:t,type:"button",onClick:j,...M,children:[T,A,$,E,z]})}ZC.displayName="Tab";const f2={trigger:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kOIVth:"xzye2dw",kg3NbH:"xrrkdod",kWkggS:"xjbqb8w",kMzoRj:"xc342km",ksu8eU:"xng3xce",kaIpWk:"xh6dtrn",kMv6JI:"xjb2p0i",kGuDYH:"xcr08ib",kLWn49:"x1kq96og",k63SB2:"x1sodnla",kMwMTN:"xv1l7n4",kkrTdU:"x1ypdohk",kybGjl:"x1hl2dhg",k1ekBW:"xt3l3uh",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},triggerSelected:{kMwMTN:"x1tgivj0",k63SB2:"x2mo6ok",$$css:!0},hoverBg:{kVAEAm:"x10l6tqk",kpwlN0:"x10a8y8t",kogj98:"x1bpp3o7",kzqmXN:"xh8yej3",kaIpWk:"xh6dtrn",kfzvcC:"x47corl",kWkggS:"xjbqb8w x1a1zr74",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0}},_F={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},RF={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}};function YC({ref:e,label:t,options:n,xstyle:s,className:r,style:i}){const a=WC(),l=h.useId(),c=h.useRef(null),u=zc({hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none",onHide:h.useCallback(()=>{var M;(M=c.current)==null||M.focus()},[])}),{listRef:d,handleKeyDown:f,handleFocus:p,focusFirst:x}=Tc({hasRovingTabIndex:!0,itemSelector:$g,onEscape:()=>u.hide()}),g=h.useCallback(()=>{u.isOpen?u.hide():(u.show(),requestAnimationFrame(()=>x()))},[u,x]),v=h.useCallback(M=>{if(M.key==="Tab"){u.hide();return}f(M)},[f,u]),y=n.find(M=>M.value===a.value),m=(y==null?void 0:y.label)??t,k=y!=null,b=a.size,j=h.useCallback(M=>{a.onChange(M),u.hide()},[a,u]),A=Ft(u.triggerRef,c,e);return o.jsxs(o.Fragment,{children:[o.jsxs("button",{ref:A,type:"button","aria-haspopup":"menu","aria-expanded":u.isOpen,"aria-controls":l,"data-tab-menu":"",tabIndex:k?0:-1,onClick:g,...ne(J("tab-menu"),G(f2.trigger,_F[b],k&&f2.triggerSelected,XC,s),r,i),children:[o.jsx("span",{"aria-hidden":"true",...G(f2.hoverBg,RF[b])}),o.jsxs("span",{className:"x1n2onr6 xwz0xwf x6s0dn4 xkh2ocl",children:[o.jsx("span",{className:"x1agbcgv xcrlgei",children:m}),o.jsx("span",{"aria-hidden":"true",className:"x1agbcgv xcrlgei xlshs6z x47corl x2mo6ok",children:m})]}),o.jsx("span",{"aria-hidden":"true",...{0:{className:"x12xnipv x6b6gus x2lah0s x11xpdln xuedmi6 xlr8y92"},1:{className:"x12xnipv x6b6gus x2lah0s x11xpdln xuedmi6 xlr8y92 x19jd1h0"}}[!!u.isOpen<<0],children:o.jsx(Te,{icon:"chevronDown",size:"sm",color:"inherit"})}),k&&o.jsx("span",{...ne(J("tab-indicator",{selected:"selected"}),{className:"x10l6tqk xyi47jn x1ybfrjj x1mcfs9z x36qwtl xjspbzw x47corl xnpjden xuedmi6 xlr8y92 xowkcby x1hc1fzr"})})]}),u.render(o.jsxs("div",{ref:d,id:l,role:"menu","aria-label":t,onKeyDown:v,onFocus:p,...ne(J("tab-menu-dropdown"),{className:"x78zum5 xdt5ytf x1lsbc85 xu0wf1k x7a5moj"}),children:[o.jsx("span",{role:"presentation",className:"x141an7d x1ltkj2j x2mo6ok xv1l7n4 xu0wf1k xrrkdod",children:t}),n.map(M=>{const T=a.value===M.value;return o.jsxs("div",{role:"menuitemradio",tabIndex:-1,"aria-checked":T,onClick:()=>j(M.value),onKeyDown:z=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),j(M.value))},...ne(J("tab-menu-item"),{0:{className:"x78zum5 x6s0dn4 x1qughib x1txdalj xce4md1 xrrkdod xh6dtrn xjb2p0i xcr08ib x1kq96og x1sodnla x1tgivj0 x1ypdohk x15406qy xuedmi6 xlr8y92 xjbqb8w xe9uy6x x17nn4n9"},1:{className:"x78zum5 x6s0dn4 x1qughib x1txdalj xce4md1 xrrkdod xh6dtrn xjb2p0i xcr08ib x1kq96og x1tgivj0 x1ypdohk x15406qy xuedmi6 xlr8y92 xjbqb8w xe9uy6x x17nn4n9 x1e4wzip"}}[!!T<<0]),children:[o.jsxs("span",{className:"x78zum5 x6s0dn4 x1txdalj",children:[M.icon&&Lr(M.icon,{size:"sm",color:"secondary"}),M.label]}),T&&o.jsx(Te,{icon:"check",size:"sm",color:"accent"})]},M.value)})]}),{placement:"below",alignment:"start"})]})}YC.displayName="TabMenu";const IF=.8,ul={wrapper:{kY2c9j:"x1vjfegm",k1xSpc:"x1lliihq",kmVPX3:"x1717udv","--_textarea-inline-padding":"x1kdpo6e",$$css:!0},textarea:{k1xSpc:"x1lliihq",kzqmXN:"xh8yej3",kB7OPa:"x9f619",k7Eaqz:"xeuugli",kMzoRj:"xc342km",ksu8eU:"xng3xce",k8WAf4:"xu0wf1k",kg3NbH:"x1w6f3ag",kMv6JI:"x9ynric",kGuDYH:"xjm74w1 x6pjikd",kLWn49:"xw6l6zx",kMwMTN:"x1tgivj0",kWkggS:"xjbqb8w",kI3sdo:"x1a2a7pz",k8Qsv1:"xeyghm5",kHenm0:"x288g5",$$css:!0},textareaDisabled:{kkrTdU:"x1h6gzvc",$$css:!0},textareaWithStartIcon:{kZCmMZ:"x1b6te9z",$$css:!0},textareaWithStatus:{kwRFfy:"xp2dy4z",$$css:!0},textareaWithBusyStatus:{kwRFfy:"x1g2apga",$$css:!0},textareaWithCounter:{kGO01o:"xekm6fs",$$css:!0}},LF={sm:{$$css:!0},md:{$$css:!0},lg:{k8WAf4:"xce4md1",$$css:!0}};function QC({label:e,isLabelHidden:t=!1,description:n,isOptional:s=!1,isRequired:r=!1,onChange:i,changeAction:a,isLoading:l=!1,value:c,placeholder:u,rows:d=3,isDisabled:f=!1,disabledMessage:p,status:x,statusVariant:g="attached",labelTooltip:v,startIcon:y,hasSpellCheck:m=!0,onPaste:k,maxLength:b,hasAutoFocus:j=!1,size:A,htmlName:M,onFocus:T,onBlur:z,width:$,xstyle:E,className:N,style:_,ref:R,...B}){const D=Qa(A,"md"),I=ze(),O=Nc(),L=h.useId(),H=h.useId(),q=h.useId(),U=h.useId(),X=h.useRef(null),Z=h.useRef(null),ie=h.useRef(null),[,ae]=h.useTransition(),[xe,fe]=h.useOptimistic(c),se=l||xe!==c,ye=f&&!!p,me=Ss({placement:"above",focusTrigger:"always",isEnabled:ye}),{statusIcon:P,describedBy:V}=US({status:x,statusVariant:g}),Y=[n?H:null,g!=="tooltip"&&(x!=null&&x.message)?q:null,V,b!=null?U:null,ye?me.describedBy:null].filter(Boolean).join(" ")||void 0,oe=h.useCallback(ve=>{if(b==null)return;const pe=ve>b?"over":ve>=b*IF?"near":"under";pe!==ie.current&&(ie.current=pe,pe==="over"?O(I("@astryx.textArea.charactersOverLimit",{count:ve-b}),"assertive"):pe==="near"&&O(I("@astryx.textArea.charactersRemaining",{count:b-ve})))},[O,I,b]),F=ve=>{if(f)return;const pe=ve.target.value;oe(pe.length),i==null||i(pe,ve),a&&!ve.defaultPrevented&&ae(async()=>{fe(pe),await a(pe,ve)})},le=f||se,{onClick:ce,onMouseUp:ge}=Y4({containerRef:Z,inputRef:X,disabled:le});return o.jsxs(_c,{label:e,isLabelHidden:t,description:n,inputID:L,descriptionID:n?H:void 0,isOptional:s,isRequired:r,isDisabled:f,status:x?{type:x.type,message:x.message,messageID:x.message?q:void 0}:void 0,statusVariant:g,labelTooltip:v,width:$,children:[o.jsxs("div",{ref:ve=>{Z.current=ve,me.ref(ve)},onClick:ce,onMouseUp:ge,...ne(J("textarea",{size:D,status:(x==null?void 0:x.type)??null}),G(Fa.base,ul.wrapper,f&&Fa.disabled,x&&Rg[x.type],x&&!f&&Ig[x.type],x&&oC[x.type],E),N,_),children:[y&&o.jsx("span",{className:"x10l6tqk xctzyg x1kiyvbf x47corl x78zum5",children:Lr(y,{size:"sm",color:"secondary"})}),o.jsx("textarea",{...B,ref:Ft(R,X),id:L,name:M,value:xe,onChange:F,onPaste:k,onFocus:T,onBlur:z,placeholder:u,rows:d,disabled:f&&!ye,"aria-disabled":ye?"true":void 0,readOnly:ye||void 0,spellCheck:m,autoFocus:j,"data-autofocus":j||void 0,"aria-describedby":Y,"aria-required":r&&!s?"true":void 0,"aria-invalid":(x==null?void 0:x.type)==="error"||b!=null&&xe.length>b?"true":void 0,"aria-busy":se||void 0,...G(ul.textarea,LF[D],f&&ul.textareaDisabled,!!y&&ul.textareaWithStartIcon,(x||se)&&ul.textareaWithStatus,se&&!!P&&ul.textareaWithBusyStatus,b!=null&&ul.textareaWithCounter)}),(se||P)&&o.jsxs("span",{className:"x10l6tqk xctzyg x13oyzgk x47corl x78zum5 x6s0dn4 x1txdalj",children:[se&&o.jsx(Vt,{size:"sm"}),P]}),b!=null&&o.jsxs("div",{id:U,...{0:{className:"x10l6tqk x112dmjn x13oyzgk x47corl x78zum5 x6s0dn4 xzye2dw x9ynric x141an7d x1ltkj2j xv1l7n4"},1:{className:"x10l6tqk x112dmjn x13oyzgk x47corl x78zum5 x6s0dn4 xzye2dw x9ynric x141an7d x1ltkj2j xjt36v0"}}[(xe.length>b)<<0],children:[xe.length>b&&o.jsx(Te,{icon:"warning",size:"sm"}),xe.length,"/",b]})]}),ye&&me.renderTooltip(p)]})}QC.displayName="TextArea";function JC({ref:e,href:t,isDisabled:n,LinkComponent:s,linkStyleProps:r,labelContent:i,icon:a,endContent:l,removeButton:c,...u}){const d=h.useRef(null),f=h.useRef(null),{onClick:p,onMouseUp:x}=K4({containerRef:d,interactiveRef:f,href:t,disabled:n});return o.jsxs("span",{ref:Ft(e,d),onClick:n?void 0:p,onMouseUp:n?void 0:x,...u,children:[a,o.jsx(s,{ref:f,href:t,"aria-disabled":n||void 0,...r,children:i}),l,c]})}JC.displayName="TokenLink";const Xs={base:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",k8WAf4:"xt970qd",kMzoRj:"xc342km",ksu8eU:"xng3xce",kaIpWk:"xx3sua9",kMv6JI:"xjb2p0i",kGuDYH:"x141an7d",kLWn49:"x1ltkj2j",k63SB2:"x1e4wzip",khDVqt:"xuxw1ft",kybGjl:"x1hl2dhg",ks0D6T:"x193iq5w",kVQacm:"xb3r6kr",$$css:!0},interactive:{kkrTdU:"x1ypdohk",k1ekBW:"x12qzo2w",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",kKwaWg:"x1ilzqfv xq8i9tn",kI3sdo:"x17nn4n9",kInvED:"x1wfwxd8 x7s97pk",$$css:!0},disabled:{kkrTdU:"x1h6gzvc",kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0},focusVisibleOutline:{kI3sdo:"x1irc7jg",kInvED:"x1wfwxd8 xdjuwb3",$$css:!0}},p0={sm:{kZKoxP:"xzydfjl",kGuDYH:"x141an7d",kg3NbH:"xf314gf",$$css:!0},md:{kZKoxP:"xrmxcn7",kg3NbH:"xf314gf",$$css:!0},lg:{kZKoxP:"x102lyln",kg3NbH:"xf314gf",$$css:!0}},x0={default:{kWkggS:"x17x4s8c",kMwMTN:"x1tgivj0",$$css:!0},red:{kWkggS:"x1cibrc5",kMwMTN:"x1joocv1",$$css:!0},orange:{kWkggS:"x1e9xt6e",kMwMTN:"xm47u9q",$$css:!0},yellow:{kWkggS:"x1bo7t0x",kMwMTN:"xdhq94a",$$css:!0},green:{kWkggS:"x1sqjeoo",kMwMTN:"xltfdvo",$$css:!0},teal:{kWkggS:"x1jtji5o",kMwMTN:"x9x0lbs",$$css:!0},cyan:{kWkggS:"x1rgj867",kMwMTN:"x1txnczv",$$css:!0},blue:{kWkggS:"x1o0wnni",kMwMTN:"x1vvqiwl",$$css:!0},purple:{kWkggS:"x16i6n6f",kMwMTN:"x1m9wyeb",$$css:!0},pink:{kWkggS:"xnpoty2",kMwMTN:"xiuofww",$$css:!0},gray:{kWkggS:"xspzpui",kMwMTN:"xru1t7f",$$css:!0}};function Ln({label:e,size:t="md",color:n="default",icon:s,isDisabled:r=!1,onRemove:i,onClick:a,href:l,description:c,endContent:u,isLabelHidden:d=!1,xstyle:f,className:p,style:x,"data-testid":g,ref:v}){const y=ze(),m=Ja(),k=FS({href:l,onClick:a,isDisabled:r}),b=a??(k==="button"?()=>{}:null),j=i!=null&&o.jsx("button",{type:"button","aria-label":y("@astryx.token.remove",{label:e}),onClick:T=>{T.stopPropagation(),i(T)},disabled:r,className:"x3nfvp2 x6s0dn4 xl56j7k x1n2onr6 x1717udv xkd40ry x1ypdohk xjspbzw x1kky2od xlup9mm x1heor9g x17nn4n9 x1s928wv x1j6awrg x1xsm0q9",children:o.jsx(Te,{icon:"close",size:"xsm",color:"inherit"})}),A=o.jsxs(o.Fragment,{children:[s,o.jsx("span",{...{0:{className:"xb3r6kr xlyipyv xuxw1ft xeuugli"},1:{className:"xlyipyv xeuugli x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr x1hyvwdk xuxw1ft xc342km"}}[!!d<<0],children:e}),u,j]}),M={"data-testid":g,"aria-label":d?e:void 0,"aria-description":c};if(k==="link")return i==null?o.jsx(m,{ref:v,href:l,"aria-disabled":r||void 0,...M,...ne(J("token",{color:n,size:t}),G(Xs.base,p0[t],x0[n],Xs.interactive,r&&Xs.disabled,f),p,x),children:A}):o.jsx(JC,{ref:v,href:l,isDisabled:r,LinkComponent:m,icon:s,endContent:u,removeButton:j,linkStyleProps:{className:"xmper1u xln7xf2 x1heor9g x1a2a7pz xb3r6kr xeuugli"},labelContent:o.jsx("span",{...{0:{className:"xb3r6kr xlyipyv xuxw1ft xeuugli"},1:{className:"xlyipyv xeuugli x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr x1hyvwdk xuxw1ft xc342km"}}[!!d<<0],children:e}),...M,...ne(J("token",{color:n,size:t}),G(Xs.base,p0[t],x0[n],Xs.interactive,Xs.focusVisibleOutline,r&&Xs.disabled,f),p,x)});if(b!=null){const T=z=>{z.target.closest("button, a")||b(z)};return o.jsxs("span",{ref:v,onClick:r?void 0:T,...M,...ne(J("token",{color:n,size:t}),G(Xs.base,p0[t],x0[n],Xs.interactive,Xs.focusVisibleOutline,r&&Xs.disabled,f),p,x),children:[s,o.jsx("button",{type:"button",onClick:b,disabled:r,className:"xmper1u xln7xf2 x1heor9g x1a2a7pz xb3r6kr xeuugli",children:o.jsx("span",{...{0:{className:"xb3r6kr xlyipyv xuxw1ft xeuugli"},1:{className:"xlyipyv xeuugli x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr x1hyvwdk xuxw1ft xc342km"}}[!!d<<0],children:e})}),u,j]})}return o.jsx("span",{ref:v,...M,...ne(J("token",{color:n,size:t}),G(Xs.base,p0[t],x0[n],r&&Xs.disabled,f),p,x),children:A})}Ln.displayName="Token";const OF=1e3,DF=100,i7={root:{kWkggS:"xprdx6m x1j0df82 x1o55y2u",kSiTet:"xvpkmg4 x1tbh5bv",$$css:!0},animate:{kILWW9:"xpz12be",k44tkh:"xqgcaz",ko0y90:"xa4qsjk",kKVMdj:"xeuoslp x1aquc0h",kyAemX:"x193epu2",$$css:!0}},BF={0:{kaIpWk:"xwksslw",$$css:!0},1:{kaIpWk:"xx3sua9",$$css:!0},2:{kaIpWk:"xh6dtrn",$$css:!0},3:{kaIpWk:"x1hviunn",$$css:!0},4:{kaIpWk:"x1hviunn",$$css:!0},none:{kaIpWk:"x2u8bby",$$css:!0},rounded:{kaIpWk:"xjspbzw",$$css:!0}},HF={kKxzle:"xvo38ju",$$css:!0},o7={animationDelay:e=>[HF,{"--x-animationDelay":(t=>typeof t=="number"?t+"ms":t??void 0)(`${OF+DF*e}ms`)}],dimensions:(e,t)=>[{kzqmXN:(typeof e=="number"?`${e}px`:e)!=null?"x5lhr3w":typeof e=="number"?`${e}px`:e,kZKoxP:(typeof t=="number"?`${t}px`:t)!=null?"x16ye13r":typeof t=="number"?`${t}px`:t,$$css:!0},{"--x-width":(n=>typeof n=="number"?n+"px":n??void 0)(typeof e=="number"?`${e}px`:e),"--x-height":(n=>typeof n=="number"?n+"px":n??void 0)(typeof t=="number"?`${t}px`:t)}]};function gc({width:e="100%",height:t="100%",radius:n=3,index:s=0,"data-testid":r,xstyle:i,className:a,style:l,ref:c,...u}){return o.jsx("div",{ref:c,"aria-hidden":"true","data-testid":r,...ne(J("skeleton"),G(i7.root,i7.animate,BF[n],o7.dimensions(e,t),o7.animationDelay(s),i),a,l),...u})}gc.displayName="Skeleton";const h2={root:{kVAEAm:"x1n2onr6",k1xSpc:"x3nfvp2",kXwgrk:"xdt5ytf",kzqmXN:"x1fu8urw",kmuXW:"x2lah0s",kHBbk8:"xc8icb0",$$css:!0},removeButtonOverrides:{"--_button-radius":"xh8ntw8",kZKoxP:"x1qx5ct2",k7Eaqz:"xt4ypqs",kWkggS:"x1u4601x",kMwMTN:"x9e3rv5",$$css:!0},disabled:{kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0}};function qF(){return o.jsx("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:o.jsx("path",{d:"M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2M8.5 13.5l2.5 3 3.5-4.5 4.5 6H5l3.5-5.5z"})})}function px({src:e,alt:t,label:n,onRemove:s,onClick:r,isLoading:i=!1,isDisabled:a=!1,showRemoveOn:l="hover",xstyle:c,className:u,style:d,"data-testid":f,ref:p,...x}){const g=ze(),[v,y]=h.useState(void 0),m=e!=null,k=m&&v===e,b=i&&!m,j=m&&!b&&!k,A=i&&m,M=!i&&!m||k,T=r!=null&&!a&&!i,z=s!=null&&!a,$=z&&l==="hover",{getContainerProps:E,getContentRevealProps:N}=uH({isEnabled:$}),_=n&&t?`${n} — ${t}`:n??t??g("@astryx.thumbnail.fallbackName"),R=!t,B=t!=null||n!=null||x["aria-label"]!=null||x["aria-labelledby"]!=null;Hd("Thumbnail",'`src` is set without `alt` or `label`. The image is treated as decorative and hidden from assistive technology, and the thumbnail falls back to a generic "thumbnail" name. Pass `alt` to describe the image content, or `label` (file name) to name the thumbnail.',m&&!B);const D=o.jsxs(o.Fragment,{children:[j&&o.jsx("img",{src:e,alt:t??"",role:R?"presentation":void 0,"aria-hidden":R||void 0,onError:()=>y(e),className:"xh8yej3 x5yr21d xl1xv1r x1lliihq"}),b&&o.jsx(gc,{radius:2}),M&&o.jsx("div",{className:"x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xv9yike",children:o.jsx(qF,{})})]}),I=z?o.jsx("div",{...ne({className:"x10l6tqk x8d4r5l xy3asu9 x1vjfegm x14ju556"},$?N({isLayoutPreserved:!0}):{}),children:o.jsx(Q,{icon:o.jsx(Te,{icon:"close",size:"xsm"}),label:g("@astryx.thumbnail.remove",{accessibleName:_}),variant:"secondary",size:"sm",isIconOnly:!0,onClick:L=>{L.stopPropagation(),s(L)},xstyle:h2.removeButtonOverrides})}):null,O=o.jsx("div",{ref:p,"data-testid":f,role:"group","aria-label":_,...ne(J("thumbnail"),G(h2.root,a&&h2.disabled,c),u,d),...x,children:o.jsxs("div",{...ne({0:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c"},4:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1ypdohk x1irc7jg x1wfwxd8 xdjuwb3"},2:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1s928wv x1j6awrg xarstr8 x1k48kgn x2q1x1w x1ywzrc5 x97pup0 x1dlmc9c xyhc2n1 x1k7wiig"},6:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1ypdohk x1irc7jg x1wfwxd8 xdjuwb3 x1s928wv x1j6awrg xarstr8 x1k48kgn x2q1x1w x1ywzrc5 x97pup0 x1dlmc9c xyhc2n1 x1k7wiig"},1:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c xi14tyy"},5:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1ypdohk x1irc7jg x1wfwxd8 xdjuwb3 xi14tyy"},3:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1s928wv x1j6awrg xarstr8 x1k48kgn x2q1x1w x1ywzrc5 x97pup0 x1dlmc9c xyhc2n1 x1k7wiig xi14tyy"},7:{className:"x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1ypdohk x1irc7jg x1wfwxd8 xdjuwb3 x1s928wv x1j6awrg xarstr8 x1k48kgn x2q1x1w x1ywzrc5 x97pup0 x1dlmc9c xyhc2n1 x1k7wiig xi14tyy"}}[!!T<<2|!!T<<1|!!T<<0],$?E():{}),children:[T?o.jsx("button",{type:"button",onClick:r,"aria-label":g("@astryx.thumbnail.open",{accessibleName:_}),className:"x1ypdohk x1lliihq xh8yej3 x5yr21d xh6dtrn xb3r6kr",children:D}):D,j&&o.jsx("div",{className:"x10l6tqk x10a8y8t x1pjcqnp x1er153n x47corl"}),A&&o.jsx("div",{className:"x10l6tqk x10a8y8t x78zum5 x6s0dn4 xl56j7k x1u4601x x1pjcqnp x1vjfegm x14ju556",children:o.jsx(Vt,{size:"sm",shade:"onMedia"})}),I]})});return n!=null?o.jsx(Wi,{content:n,children:O}):O}px.displayName="Thumbnail";function T5({ref:e,isOpen:t,isInline:n,onOpenChange:s,title:r,description:i,cancelLabel:a,actionLabel:l,actionVariant:c="destructive",isActionLoading:u,onAction:d,width:f=400,xstyle:p,className:x,style:g,"data-testid":v,...y}){const m=ze(),k=a??m("@astryx.alertDialog.cancel"),b=h.useId(),j=h.useId(),A=h.useCallback(()=>{s(!1)},[s]);return o.jsx(Us,{...y,ref:e,isOpen:t,isInline:n,onOpenChange:s,width:f,purpose:"form",role:"alertdialog","aria-labelledby":b,"aria-describedby":j,...ne(J("alert-dialog"),{className:x,style:g}),xstyle:p,"data-testid":v,children:o.jsx(Cs,{content:o.jsxs(Es,{children:[o.jsx(Jn,{level:2,id:b,children:r}),o.jsx(K,{type:"body",color:"secondary",id:j,children:i})]}),footer:o.jsx(el,{children:o.jsxs(ke,{gap:2,hAlign:"end",children:[o.jsx(Q,{variant:"ghost",label:k,onClick:A}),o.jsx(Q,{variant:c,label:l,onClick:d,isLoading:u})]})})})})}T5.displayName="AlertDialog";const pf={dropdown:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",kskxy:"xuyqlj2",kORKVm:"x1odjw0f","--_dropdown-menu-radius":"x1fcsqxe","--_dropdown-menu-padding":"xgory14",kmVPX3:"x9epnlk",kaIpWk:"x1n97fys",kSiTet:"x1hc1fzr",k1ekBW:"x19991ni",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0},popover:{k7Eaqz:"xrzjruh",$$css:!0},popoverBlockGap:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0},popoverInlineGap:{keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:(typeof e=="number"?`${e}px`:e)!=null?"xkj4a21":typeof e=="number"?`${e}px`:e,$$css:!0},{"--x-minWidth":(t=>typeof t=="number"?t+"px":t??void 0)(typeof e=="number"?`${e}px`:e)}]},PF="@astryx.dropdownMenu.label";function Rc({button:e,isMenuOpen:t,onOpenChange:n,menuWidth:s,onClick:r,hasChevron:i=!0,placement:a="below",alignment:l="start",className:c,style:u,xstyle:d,"data-testid":f,...p}){const x=ze(),g=e??{label:x(PF)},v=("items"in p?p.items:void 0)??[],y=p.children,{items:m,children:k,...b}=p,j=h.useId(),A=g.size??"md",M=h.useRef(null),[T,z]=h.useState(!1),$=t!==void 0,E=$?t:T,N=h.useRef(0),_=h.useCallback(()=>{var oe;N.current=Date.now(),n==null||n(!1),$||z(!1),(oe=M.current)==null||oe.focus()},[$,n]),R=h.useRef(!1),B=h.useCallback(()=>{n==null||n(!0),$||z(!0)},[$,n]),D=zc({onHide:_,onShow:B,hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none"}),I=h.useCallback(()=>{D.hide()},[D]),{listRef:O,handleKeyDown:L,focusFirst:H,focusItem:q,ownsEvent:U,getItems:X}=Tc({itemSelector:$g,boundarySelector:X4,wrap:!1,onEscape:I}),Z=W4({getItemLabels:()=>X().map(oe=>oe.textContent),onMatch:q,getCurrentIndex:()=>X().findIndex(oe=>oe===document.activeElement||oe.contains(document.activeElement))});h.useEffect(()=>{$&&(t&&!D.isOpen?(R.current=!0,D.show()):!t&&D.isOpen&&D.hide())},[t,$,D]),h.useEffect(()=>{!D.isOpen||!R.current||(R.current=!1,requestAnimationFrame(()=>H()))},[D.isOpen,H]);const ie=h.useCallback(oe=>{if(U(oe)){if(oe.key==="Enter"||oe.key===" "){oe.preventDefault();const F=document.activeElement;F&&Eg.has(F.getAttribute("role")??"")&&F.click();return}if(oe.key==="Tab"){I();return}if(Z.onKeyDown(oe)){oe.preventDefault();return}L(oe)}},[L,I,Z,U]),ae=h.useCallback(()=>{R.current=!0,D.show()},[D]),xe=h.useCallback(()=>{Date.now()-N.current<50||(r==null||r(),$?n==null||n(!t):D.isOpen?D.hide():ae())},[r,$,n,t,D,ae]),fe=h.useCallback(oe=>{D.isOpen||(oe.key==="ArrowDown"||oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),ae())},[D.isOpen,ae]),se=g.isIconOnly===!0,ye=g.endContent??(i&&!se?o.jsx(Te,{icon:"chevronDown",size:"sm",color:"inherit"}):void 0),me=s?pf.popoverCustomWidth(s):pf.popover,P=a==="above"||a==="below"?pf.popoverBlockGap:pf.popoverInlineGap,V=h.useMemo(()=>({closeMenu:I,menuSize:A}),[I,A]),Y=p.items!==void 0?Z4(v):y;return o.jsxs(o.Fragment,{children:[o.jsx(Q,{...g,ref:oe=>{M.current=oe,D.triggerRef(oe);const F=g.ref;typeof F=="function"?F(oe):F&&(F.current=oe)},tooltip:E?void 0:g.tooltip,endContent:ye,onClick:xe,onKeyDown:fe,"aria-haspopup":"menu","aria-expanded":E,"aria-controls":j,"data-testid":f}),D.render(o.jsx("div",{...b,ref:O,id:j,role:"menu","aria-label":g.label,onKeyDown:ie,...ne(J("dropdown-menu"),G(pf.dropdown,d),c,u),children:o.jsx(wh,{value:V,children:Y})}),{placement:a,alignment:l,xstyle:[me,P,wo[a]]})]})}Rc.displayName="DropdownMenu";function qg({items:e,label:t,variant:n="ghost",size:s,icon:r,isDisabled:i=!1,isMenuOpen:a,onOpenChange:l,xstyle:c,className:u,style:d,"data-testid":f,ref:p}){const x=ze(),g=t??x("@astryx.moreMenu.label"),v=Qa(s,"md"),y=gd("moreHorizontal");return o.jsx(Rc,{className:u?`${My("more-menu")} ${u}`:My("more-menu"),xstyle:c,style:d,isMenuOpen:a,onOpenChange:l,button:{label:g,icon:r??y,variant:n,size:v,isDisabled:i,tooltip:g,isIconOnly:!0,ref:p},items:e,hasChevron:!1,"data-testid":f})}qg.displayName="MoreMenu";const Qi={dialog:{kVAEAm:"xixxii4",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",ks0D6T:"x1x1rfll",kskxy:"x7ab17h",kpwlN0:"x10a8y8t",kzqmXN:"xn9wirt",kZKoxP:"xtdtrs8",kWkggS:"xjbqb8w",kVQacm:"xb3r6kr",kZeWKH:"xish69e",kFalU9:"x5ve5x3",kI3sdo:"x1a2a7pz",k1xSpc:"x1s85apg",$$css:!0},open:{k1xSpc:"x78zum5",$$css:!0},backdrop:{kGyWv1:"xnixb3f",kba3nw:"x1abwkk1",k5sjJv:"xph5o2a",kND0Po:"x167zut7",k9an0g:"xft5bk6",kb4ib:"x15h3t91",kA5Tbj:"x1viac0w",$$css:!0},backdropOpen:{k5sjJv:"xb3n6bw",$$css:!0},drawer:{kVAEAm:"x10l6tqk",k87sOh:"x13vifvy",krVfgx:"x1ey2m1c",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kWkggS:"x10xzikg",kB7OPa:"x9f619",kVQacm:"xb3r6kr",k1ekBW:"x11xpdln",kIyJzY:"x80gvsz",kAMwcw:"xlr8y92",kI3sdo:"x1a2a7pz",k6CgDc:"xzg1mie",$$css:!0},drawerStart:{kLqNvP:"x1o0tod",ke9TFa:"xw8tdv1",k8ry5P:"x18b5jzi",kBCPoo:"x1gejf6u",k3aq6I:"x5i6ehr xttggg",$$css:!0},drawerStartOpen:{k3aq6I:"xbryuvx",$$css:!0},drawerEnd:{kt4wiu:"xtijo5x",k2ei4v:"xgbv0en",kVhnKS:"x1t7ytsu",kGJrpR:"x1j92z86",k3aq6I:"xumwmo6 x1df3fe5",$$css:!0},drawerEndOpen:{k3aq6I:"xbryuvx",$$css:!0}},UF={kzqmXN:"xn9wirt",ks0D6T:"xf68679",$$css:!0},FF={width:e=>[UF,{"--x-maxWidth":(t=>typeof t=="number"?t+"px":t??void 0)(`${e}px`)}]};function z5({isOpen:e,onOpenChange:t,children:n,header:s,width:r=320,side:i="auto",label:a,"data-testid":l,xstyle:c,className:u,style:d,onClick:f,ref:p,...x}){const g=ze(),v=Cg(),y=e??v.isMobileNavOpen,m=h.useId(),k=v.mobileNavId||m,b=h.useMemo(()=>t??(N=>{N?v.openMobileNav():v.closeMobileNav()}),[t,v]),j=h.useRef(null),A=h.useRef(null),[M,T]=h.useState(i==="auto"?"end":i);h.useEffect(()=>{const N=j.current;if(N){if(A.current&&(clearTimeout(A.current),A.current=null),y){if(i==="auto"){const _=document.activeElement;if(_&&_!==document.body){const R=_.getBoundingClientRect(),B=R.left+R.width/2;T(B<window.innerWidth/2?"start":"end")}}else T(i);N.open||N.showModal(),document.documentElement.style.overflow="clip"}else if(N.open){document.documentElement.style.overflow="";const _=window.matchMedia("(prefers-reduced-motion: reduce)").matches?10:250;A.current=setTimeout(()=>{N.close()},_)}return()=>{A.current&&(clearTimeout(A.current),A.current=null),document.documentElement.style.overflow="",N.open&&N.close()}}},[y,i]);const z=h.useCallback(N=>{N.preventDefault(),b(!1)},[b]),$=h.useCallback(N=>{N.target===N.currentTarget&&b(!1)},[b]),E=M==="start";return o.jsx("dialog",{ref:Ft(p,j),id:k,...ne(J("mobile-nav",{side:M}),G(Qi.dialog,y&&Qi.open,Qi.backdrop,y&&Qi.backdropOpen,c),u,d),...x,"data-testid":l,"aria-label":a??(typeof s=="string"?s:g("@astryx.mobileNav.navigation")),onClick:vg(f,$),onCancel:z,children:o.jsxs("div",{tabIndex:-1,...G(Qi.drawer,FF.width(r),E&&Qi.drawerStart,E&&y&&Qi.drawerStartOpen,!E&&Qi.drawerEnd,!E&&y&&Qi.drawerEndOpen),children:[o.jsxs("div",{...{0:{className:"x78zum5 x6s0dn4 x1qughib x1k15mir xf314gf x2lah0s x92x3c3 x1q0q8m5 xw8gpjh"},1:{className:"x78zum5 x6s0dn4 x1k15mir xf314gf x2lah0s x92x3c3 x1q0q8m5 xw8gpjh x13a6bvl"}}[!s<<0],children:[typeof s=="string"?o.jsx("span",{className:"x11g1kdw",children:o.jsx(Jn,{level:2,children:s})}):s??null,o.jsx(Q,{variant:"ghost",label:g("@astryx.mobileNav.closeNavigation"),icon:o.jsx(Te,{icon:"close",color:"inherit"}),onClick:()=>b(!1),isIconOnly:!0})]}),o.jsx("div",{className:"x98rzlu x1odjw0f x6ikm8r xish69e xx69xxh xf314gf xce4md1",children:n})]})})}z5.displayName="MobileNav";const Go={item:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",kzqmXN:"xh8yej3",kZKoxP:"x1ueg155",kg3NbH:"xf314gf",k8WAf4:"xt970qd",kaIpWk:"xh6dtrn",kMzoRj:"xc342km",ksu8eU:"xng3xce",kWkggS:"xjbqb8w",kMwMTN:"x1tgivj0",kybGjl:"x1hl2dhg",kkrTdU:"x1ypdohk",kMv6JI:"xjb2p0i",kGuDYH:"xcr08ib",k63SB2:"x1sodnla",kLWn49:"x1kq96og",k9WMMc:"x1yc453h",kB7OPa:"x9f619",kHE3J0:"xe9uy6x",kSReZ0:"xyxi2l3",$$css:!0},selected:{kWkggS:"x17x4s8c",k63SB2:"x1e4wzip",kHE3J0:"x1sua13m",kSReZ0:"xjtnuge",$$css:!0},disabled:{kMwMTN:"xnbbluu",kkrTdU:"x1h6gzvc",kfzvcC:"x47corl",$$css:!0},sm:{kZKoxP:"x6k0iem",kg3NbH:"x7a5moj",$$css:!0},md:{kZKoxP:"x1ueg155",kg3NbH:"xf314gf",$$css:!0},lg:{kZKoxP:"xssyfek",kg3NbH:"xf314gf",$$css:!0}},Pg=h.createContext({isCollapsed:!1,toggle:()=>{},isCollapsible:!1});Pg.displayName="SideNavCollapseContext";function N5(){return h.use(Pg)}function eE({ref:e,handleRef:t,label:n,children:s,onClick:r,...i}){const a=ze(),l=gd("chevronLeft"),{isCollapsed:c,toggle:u,isCollapsible:d}=VF(t),{isMobile:f}=Cg();return!d||f?null:o.jsx(Q,{ref:e,label:n??a(c?"@astryx.sideNavCollapseButton.expandSidebar":"@astryx.sideNavCollapseButton.collapseSidebar"),variant:"ghost",...i,onClick:vg(r,u),icon:s??o.jsx("span",{...G(xd.mirror),children:o.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 x11xpdln xuedmi6 xlr8y92"},1:{className:"x3nfvp2 x6s0dn4 x11xpdln xuedmi6 xlr8y92 x19jd1h0"}}[!!c<<0],children:l})}),isIconOnly:!0})}eE.displayName="SideNavCollapseButton";function VF(e){var s;const t=N5();if(e==null)return t;const n=((s=e.current)==null?void 0:s.getCollapseState())??null;return{isCollapsed:(n==null?void 0:n.isCollapsed)??!1,toggle:()=>{var r,i;(i=(r=e.current)==null?void 0:r.getCollapseState())==null||i.toggle()},isCollapsible:(n==null?void 0:n.isCollapsible)??!0}}const GF=160,p2={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kZKoxP:"x5yr21d",kzqmXN:"x1hfn5x7",kWkggS:"xgcd1z6",kB7OPa:"x9f619",kVQacm:"xb3r6kr",$$css:!0},rootCollapsed:{kzqmXN:"xhgvbfk",$$css:!0},topbar:{k1xSpc:"x78zum5",kXwgrk:"x1q0g3np",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kZKoxP:"xsdox4t",kzqmXN:"xh8yej3",kWkggS:"xgcd1z6",kB7OPa:"x9f619",kVQacm:"xb3r6kr",$$css:!0}};function _5({header:e,topContent:t,children:n,footer:s,footerIcons:r,collapsible:i=!1,resizable:a=!1,xstyle:l,className:c,style:u,"data-testid":d,ref:f,handleRef:p,...x}){const g=ze(),v=typeof i=="object"?i:{},y=!!i,m=v.hasButton??!0,k=v.defaultIsCollapsed??!1,b=v.isCollapsed,j=v.onCollapsedChange,A=typeof a=="object"?a:{},M=!!a,T=b!==void 0,[z,$]=h.useState(k),E=T?b:z,N=h.useRef(null),_=h.useRef({isCollapsed:E,toggle:()=>{},isCollapsible:y}),R=h.useCallback(xe=>{T||$(xe),j==null||j(xe)},[T,j]),B=UC({defaultSize:A.defaultWidth??260,minSizePx:A.minWidth??180,maxSizePx:A.maxWidth??480,collapsible:y,collapsedSize:GF,autoSaveId:A.autoSaveId,onSizeChange:A.onWidthChange,onCollapseChange:y?R:void 0}),D=h.useCallback(()=>{const xe=!E;_.current={..._.current,isCollapsed:xe},R(xe),M&&(xe?B.collapse():B.expand())},[E,R,M,B]),I=M&&!E;_.current={isCollapsed:E,toggle:D,isCollapsible:y};const O={isCollapsed:E,toggle:D,isCollapsible:y};h.useImperativeHandle(p,()=>({getCollapseState:()=>_.current}),[]);const L=SS();if(L==="topbar")return o.jsxs("div",{"data-testid":d,...ne(J("side-nav",{mode:"topbar"}),G(p2.topbar,l),c,u),children:[e,o.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw xvc5jky",children:r})]});const H=!!(s||r);if(L==="drawer")return o.jsxs(z5,{header:e,"data-testid":d,children:[t,n,H&&o.jsxs("div",{className:"x78zum5 xdt5ytf xr1yuqi x1txdalj x1xye8es",children:[s,r&&o.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:r})]})]});if(L==="drawer-content")return o.jsxs(o.Fragment,{children:[t,n,H&&o.jsxs("div",{className:"x78zum5 xdt5ytf xr1yuqi x1txdalj x1xye8es",children:[s,r&&o.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:r})]})]});const q=!!(e||t),U=!!(s||r),X=y&&m,Z=M?{...u??{},width:E?void 0:B.size}:u,ie=o.jsxs("nav",{ref:Ft(f,N),role:"navigation","aria-label":g("@astryx.sideNav.label"),"data-testid":d,...ne(J("side-nav"),G(p2.root,E&&p2.rootCollapsed,l),c,Z),...x,children:[q&&o.jsxs("div",{...{0:{className:"x78zum5 xdt5ytf x2lah0s x7wzq59 x13vifvy x1vjfegm xgcd1z6 x1xye8es x1wesfrj xf314gf x1txdalj"},1:{className:"x78zum5 xdt5ytf x2lah0s x7wzq59 x13vifvy x1vjfegm xgcd1z6 x1xye8es x1wesfrj xf314gf x1txdalj x6s0dn4"}}[!!E<<0],children:[e,t&&o.jsx("div",{children:t})]}),o.jsx("div",{...{0:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x1xye8es x1wesfrj"},4:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x78zum5 xdt5ytf x6s0dn4 x1xye8es x1wesfrj"},2:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf xfsso4q x1wesfrj"},6:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x78zum5 xdt5ytf x6s0dn4 xfsso4q x1wesfrj"},1:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x1xye8es xy143xn"},5:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x78zum5 xdt5ytf x6s0dn4 x1xye8es xy143xn"},3:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf xfsso4q xy143xn"},7:{className:"x98rzlu x1odjw0f x6ikm8r xf314gf x78zum5 xdt5ytf x6s0dn4 xfsso4q xy143xn"}}[!!E<<2|!!q<<1|!!U<<0],children:n}),(U||X)&&o.jsxs("div",{...{0:{className:"x78zum5 xdt5ytf x2lah0s xr1yuqi x7wzq59 x1ey2m1c xgcd1z6 x1txdalj xf314gf xfsso4q x1wesfrj"},1:{className:"x78zum5 xdt5ytf x2lah0s xr1yuqi x7wzq59 x1ey2m1c xgcd1z6 x1txdalj xf314gf x1wesfrj xexx8yu"}}[!!E<<0],children:[s,o.jsxs("div",{...{0:{className:"x78zum5 x6s0dn4 xzye2dw"},1:{className:"x78zum5 x6s0dn4 xzye2dw x3ieub6"}}[!!E<<0],children:[X&&o.jsx(eE,{}),r]})]})]}),ae=I?o.jsxs("div",{className:"x1n2onr6 x78zum5 x2lah0s x5yr21d",children:[ie,o.jsx(S5,{"data-testid":"astryx-sidenav-resize-handle",direction:"horizontal",position:"overlay",pillPlacement:"end",isAlwaysVisible:!1,resizable:B.props,label:g("@astryx.sideNav.resizeSidebar")})]}):ie;return y?o.jsx(Pg,{value:O,children:ae}):ae}_5.displayName="SideNav";const Zc={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kzqmXN:"xh8yej3",$$css:!0},itemCollapsed:{kjj79g:"xl56j7k",kzqmXN:"x805d0l",kg3NbH:"xnjsko4",$$css:!0},itemCollapsedSm:{kzqmXN:"x1fvqzum",$$css:!0},itemCollapsedLg:{kzqmXN:"x1m747yf",$$css:!0}},WF={isCollapsed:!1,toggle:()=>{},isCollapsible:!1};function x2({href:e,as:t,isDisabled:n,onClick:s,ref:r,children:i,...a}){const l=Ja(t);return e&&!n?o.jsx(l,{ref:r,href:e,onClick:s,...a,children:i}):o.jsx("button",{ref:r,type:"button",onClick:s,disabled:n,...a,children:i})}function Ni({as:e,label:t,icon:n,selectedIcon:s,isSelected:r=!1,isDisabled:i=!1,href:a,onClick:l,endContent:c,children:u,collapsible:d,size:f="md","data-testid":p,ref:x,xstyle:g}){const v=ze(),y=gd("chevronDown"),{isCollapsed:m}=N5(),k=SS(),{closeMobileNav:b}=Cg(),j=k==="drawer"||k==="drawer-content",A=h.useId(),M=!!u,T=h.useRef(null),z=zc({hasLightDismiss:!0,hasAutoFocus:!0,hasCloseButton:!1,dialogLabel:`${t} submenu`}),$=h.useMemo(()=>typeof d=="object"?d:{},[d]),E=M&&d!==!1,N=$.isCollapsed,_=N!==void 0,[R,B]=h.useState($.defaultIsCollapsed??!1),D=_?N:R,I=h.useCallback(()=>{var oe;const Y=!D;_||B(Y),(oe=$.onCollapsedChange)==null||oe.call($,Y)},[D,_,$]),O=r&&s?s:n,H=E&&(!!a||!!l)&&!m,q=Y=>{if(i){Y.preventDefault();return}if(E&&!H&&!m){Y.preventDefault(),I();return}l==null||l(Y),j&&b()},U=Y=>{Y.preventDefault(),Y.stopPropagation(),I()},X=h.useRef(null),Z=h.useRef(null),ie=h.useCallback(()=>{X.current&&(clearTimeout(X.current),X.current=null),Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),ae=h.useCallback(()=>{ie(),X.current=setTimeout(()=>{z.show({skipAutoFocus:!0})},150)},[ie,z]),xe=h.useCallback(()=>{ie(),Z.current=setTimeout(()=>{z.hide()},200)},[ie,z]),fe=h.useCallback(()=>{ae()},[ae]),se=h.useCallback(()=>{xe()},[xe]);if(m&&!n)return null;if(m){const Y=O&&Lr(O,{size:"sm",color:r?"primary":i?"disabled":"secondary"}),oe=ne(J("side-nav-item",{size:f,selected:r?"selected":null}),G(Go.item,Go[f],Zc.itemCollapsed,f==="sm"&&Zc.itemCollapsedSm,f==="lg"&&Zc.itemCollapsedLg,r&&Go.selected,i&&Go.disabled));if(M)return o.jsxs("div",{...G(Zc.root,g),children:[o.jsx("button",{ref:Ft(x,z.triggerRef),type:"button",onClick:z.toggle,onMouseEnter:fe,onMouseLeave:se,"aria-label":t,"data-testid":p,...z.triggerProps,...oe,children:Y}),z.render(o.jsxs("div",{className:"x1litavf x1y0btm7 x14i3s5s xu0wf1k x7a5moj x11g1kdw xfb3i0g",onMouseEnter:fe,onMouseLeave:se,onClick:()=>z.hide(),children:[o.jsx("div",{className:"xf314gf xu0wf1k x141an7d x2mo6ok xv1l7n4 x1ltkj2j",children:t}),o.jsx(Pg,{value:WF,children:u})]}),{placement:"end",alignment:"start"})]});const F={"aria-current":r?"page":void 0,"aria-disabled":i||void 0,"aria-label":t,"data-testid":p},le=o.jsx(x2,{ref:x,href:a,as:e,isDisabled:i,onClick:q,...F,...oe,children:Y});return o.jsxs("div",{ref:T,...G(Zc.root,g),children:[le,o.jsx(Wi,{content:t,placement:"end",anchorRef:T})]})}const ye=o.jsxs(o.Fragment,{children:[O&&Lr(O,{size:"sm",color:r?"primary":i?"disabled":"secondary"}),!m&&o.jsx("span",{className:"x98rzlu xeuugli xb3r6kr xlyipyv xuxw1ft",children:t}),!m&&c&&o.jsx("span",{className:"x2lah0s x78zum5 x6s0dn4",children:c}),!m&&E&&!H&&o.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x1mtvzj0 xvpftlf x11xpdln xuedmi6 xlr8y92 x2lah0s"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x1mtvzj0 xvpftlf x11xpdln xuedmi6 xlr8y92 x2lah0s x19jd1h0"}}[!D<<0],children:y})]}),me=ne(J("side-nav-item",{size:f,selected:r?"selected":null}),G(Go.item,Go[f],r&&Go.selected,i&&Go.disabled));let P;if(H)P=o.jsxs("div",{"data-testid":p,...me,children:[o.jsx(x2,{ref:x,href:a,as:e,isDisabled:i,onClick:q,"aria-current":r?"page":void 0,className:"x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli x1heor9g x1hl2dhg x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x1pd3egz x15bjb6t x1yc453h x1ypdohk",children:ye}),o.jsx("button",{type:"button",onClick:U,"aria-label":D?v("@astryx.sideNavItem.expand",{label:t}):v("@astryx.sideNavItem.collapse",{label:t}),"aria-expanded":!D,"aria-controls":`${A}-children`,className:"x3nfvp2 x6s0dn4 xl56j7k x2lah0s x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn xe9uy6x xyxi2l3",children:o.jsx("span",{...{0:{className:"x3nfvp2 x6s0dn4 xl56j7k x1mtvzj0 xvpftlf x11xpdln xuedmi6 xlr8y92 x2lah0s"},1:{className:"x3nfvp2 x6s0dn4 xl56j7k x1mtvzj0 xvpftlf x11xpdln xuedmi6 xlr8y92 x2lah0s x19jd1h0"}}[!D<<0],children:y})})]});else{const Y={"aria-current":r?"page":void 0,"aria-disabled":i||void 0,"aria-expanded":E?!D:void 0,"aria-controls":E?`${A}-children`:void 0,"data-testid":p};P=o.jsx(x2,{ref:x,href:a,as:e,isDisabled:i,onClick:q,...Y,...me,children:ye})}return o.jsxs("div",{ref:T,...G(Zc.root,g),children:[P,M&&!m&&o.jsx("div",{id:`${A}-children`,role:"group","aria-labelledby":`${A}-label`,"aria-hidden":D,inert:D?!0:void 0,...{0:{className:"xrvj5dj x1tu4anv x1qn9uv2 x80gvsz xlr8y92"},1:{className:"xrvj5dj x1qn9uv2 x80gvsz xlr8y92 xihq33y"}}[!!D<<0],children:o.jsxs("div",{className:"xb3r6kr x2lwn1j x31w388",children:[o.jsx("span",{id:`${A}-label`,hidden:!0,children:t}),u]})})]})}Ni.displayName="SideNavItem";const KF={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",k8WAf4:"xu0wf1k",$$css:!0}};function Ug({ref:e,title:t,subtitle:n,children:s,endContent:r,isHeaderHidden:i=!1,xstyle:a,className:l,style:c,"data-testid":u,...d}){const{isCollapsed:f}=N5(),x=`${h.useId()}-title`,g=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"x78zum5 xdt5ytf x98rzlu xeuugli",children:[o.jsx("span",{id:x,className:"x141an7d x2mo6ok x1ltkj2j xv1l7n4 xb3r6kr xlyipyv xuxw1ft",children:t}),n&&o.jsx("span",{className:"x141an7d x1ltkj2j xv1l7n4 xb3r6kr xlyipyv xuxw1ft",children:n})]}),r&&o.jsx("span",{className:"x2lah0s x78zum5 x6s0dn4",children:r})]}),v=i||f,y=v?{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:0}:{};return o.jsxs("div",{ref:e,...ne(J("side-nav-section"),G(KF.root,a),l,c),...d,role:"group","aria-labelledby":x,"data-testid":u,children:[o.jsx("div",{...ne({className:"x78zum5 x6s0dn4 x1txdalj xf314gf xu0wf1k xt0e3qv x87ps6o"},{style:v?y:void 0}),children:g}),o.jsx("div",{className:"x78zum5 xdt5ytf x1lsbc85",children:s})]})}Ug.displayName="SideNavSection";var tE={exports:{}},Fg={},nE={exports:{}},sE={};/**
|
|
168
|
-
* @license React
|
|
169
|
-
* scheduler.production.js
|
|
170
|
-
*
|
|
171
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the MIT license found in the
|
|
174
|
-
* LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/(function(e){function t(I,O){var L=I.length;I.push(O);e:for(;0<L;){var H=L-1>>>1,q=I[H];if(0<r(q,O))I[H]=O,I[L]=q,L=H;else break e}}function n(I){return I.length===0?null:I[0]}function s(I){if(I.length===0)return null;var O=I[0],L=I.pop();if(L!==O){I[0]=L;e:for(var H=0,q=I.length,U=q>>>1;H<U;){var X=2*(H+1)-1,Z=I[X],ie=X+1,ae=I[ie];if(0>r(Z,L))ie<q&&0>r(ae,Z)?(I[H]=ae,I[ie]=L,H=ie):(I[H]=Z,I[X]=L,H=X);else if(ie<q&&0>r(ae,L))I[H]=ae,I[ie]=L,H=ie;else break e}}return O}function r(I,O){var L=I.sortIndex-O.sortIndex;return L!==0?L:I.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,p=3,x=!1,g=!1,v=!1,y=!1,m=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function j(I){for(var O=n(u);O!==null;){if(O.callback===null)s(u);else if(O.startTime<=I)s(u),O.sortIndex=O.expirationTime,t(c,O);else break;O=n(u)}}function A(I){if(v=!1,j(I),!g)if(n(c)!==null)g=!0,M||(M=!0,_());else{var O=n(u);O!==null&&D(A,O.startTime-I)}}var M=!1,T=-1,z=5,$=-1;function E(){return y?!0:!(e.unstable_now()-$<z)}function N(){if(y=!1,M){var I=e.unstable_now();$=I;var O=!0;try{e:{g=!1,v&&(v=!1,k(T),T=-1),x=!0;var L=p;try{t:{for(j(I),f=n(c);f!==null&&!(f.expirationTime>I&&E());){var H=f.callback;if(typeof H=="function"){f.callback=null,p=f.priorityLevel;var q=H(f.expirationTime<=I);if(I=e.unstable_now(),typeof q=="function"){f.callback=q,j(I),O=!0;break t}f===n(c)&&s(c),j(I)}else s(c);f=n(c)}if(f!==null)O=!0;else{var U=n(u);U!==null&&D(A,U.startTime-I),O=!1}}break e}finally{f=null,p=L,x=!1}O=void 0}}finally{O?_():M=!1}}}var _;if(typeof b=="function")_=function(){b(N)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,B=R.port2;R.port1.onmessage=N,_=function(){B.postMessage(null)}}else _=function(){m(N,0)};function D(I,O){T=m(function(){I(e.unstable_now())},O)}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(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(I){switch(p){case 1:case 2:case 3:var O=3;break;default:O=p}var L=p;p=O;try{return I()}finally{p=L}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(I,O){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var L=p;p=I;try{return O()}finally{p=L}},e.unstable_scheduleCallback=function(I,O,L){var H=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?H+L:H):L=H,I){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=L+q,I={id:d++,callback:O,priorityLevel:I,startTime:L,expirationTime:q,sortIndex:-1},L>H?(I.sortIndex=L,t(u,I),n(c)===null&&I===n(u)&&(v?(k(T),T=-1):v=!0,D(A,L-H))):(I.sortIndex=q,t(c,I),g||x||(g=!0,M||(M=!0,_()))),I},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(I){var O=p;return function(){var L=p;p=O;try{return I.apply(this,arguments)}finally{p=L}}}})(sE);nE.exports=sE;var XF=nE.exports;/**
|
|
176
|
-
* @license React
|
|
177
|
-
* react-dom-client.production.js
|
|
178
|
-
*
|
|
179
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
180
|
-
*
|
|
181
|
-
* This source code is licensed under the MIT license found in the
|
|
182
|
-
* LICENSE file in the root directory of this source tree.
|
|
183
|
-
*/var yn=XF,rE=h,ZF=b1;function de(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 iE(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Eh(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 oE(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 aE(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 a7(e){if(Eh(e)!==e)throw Error(de(188))}function YF(e){var t=e.alternate;if(!t){if(t=Eh(e),t===null)throw Error(de(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return a7(r),e;if(i===s)return a7(r),t;i=i.sibling}throw Error(de(188))}if(n.return!==s.return)n=r,s=i;else{for(var a=!1,l=r.child;l;){if(l===n){a=!0,n=r,s=i;break}if(l===s){a=!0,s=r,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,s=r;break}if(l===s){a=!0,s=i,n=r;break}l=l.sibling}if(!a)throw Error(de(189))}}if(n.alternate!==s)throw Error(de(190))}if(n.tag!==3)throw Error(de(188));return n.stateNode.current===n?e:t}function lE(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=lE(e),t!==null)return t;e=e.sibling}return null}function qs(e,t,n,s,r,i){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,s,r,i)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&qs(e.child,t,n,s,r,i))return!0;e=e.sibling}return!1}function Ic(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 l7(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 cE(e){var t=[null,null],n=Ic(e);return n===null||uE(t,e,n.child,{foundSelf:!1}),t}function uE(e,t,n,s){for(;n!==null;){if(n===t)s.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(s.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&uE(e,t,n.child,s))return!0;n=n.sibling}return!1}function mn(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(de(559))}}var xu=null,Ky=null;function QF(e,t,n){return e===n?!0:e===t?(xu=e,!0):!1}function JF(e,t,n){return e===n?(Ky=e,!1):e===t?(Ky!==null&&(xu=e),!0):!1}function c7(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 Xy(e,t,n){for(var s=0,r=e;r;r=n(r))s++;r=0;for(var i=t;i;i=n(i))r++;for(;0<s-r;)e=n(e),s--;for(;0<r-s;)t=n(t),r--;for(;s--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var wt=Object.assign,eV=Symbol.for("react.element"),g0=Symbol.for("react.transitional.element"),_f=Symbol.for("react.portal"),gu=Symbol.for("react.fragment"),dE=Symbol.for("react.strict_mode"),Zy=Symbol.for("react.profiler"),fE=Symbol.for("react.consumer"),Ii=Symbol.for("react.context"),R5=Symbol.for("react.forward_ref"),Yy=Symbol.for("react.suspense"),Qy=Symbol.for("react.suspense_list"),I5=Symbol.for("react.memo"),ra=Symbol.for("react.lazy"),Jy=Symbol.for("react.activity"),tV=Symbol.for("react.legacy_hidden"),nV=Symbol.for("react.memo_cache_sentinel"),ev=Symbol.for("react.view_transition"),sV=Symbol.for("react.recoverable"),u7=Symbol.iterator;function xf(e){return e===null||typeof e!="object"?null:(e=u7&&e[u7]||e["@@iterator"],typeof e=="function"?e:null)}var rV=Symbol.for("react.client.reference");function tv(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===rV?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case gu:return"Fragment";case Zy:return"Profiler";case dE:return"StrictMode";case Yy:return"Suspense";case Qy:return"SuspenseList";case Jy:return"Activity";case ev:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case _f:return"Portal";case Ii:return e.displayName||"Context";case fE:return(e._context.displayName||"Context")+".Consumer";case R5:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I5:return t=e.displayName||null,t!==null?t:tv(e.type)||"Memo";case ra:t=e._payload,e=e._init;try{return tv(e(t))}catch{}}return null}var Rf=Array.isArray,Ne=rE.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,it=ZF.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lc={pending:!1,data:null,method:null,action:null},nv=[],mu=-1;function Ki(e){return{current:e}}function Kn(e){0>mu||(e.current=nv[mu],nv[mu]=null,mu--)}function At(e,t){mu++,nv[mu]=e.current,e.current=t}var Hi=Ki(null),C1=Ki(null),_a=Ki(null),xx=Ki(null);function gx(e,t){switch(At(_a,t),At(C1,e),At(Hi,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?j8(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=j8(t),e=RA(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Kn(Hi),At(Hi,e)}function md(){Kn(Hi),Kn(C1),Kn(_a)}function sv(e){var t=e.memoizedState;t!==null&&($d._currentValue=t.memoizedState,At(xx,e)),t=Hi.current;var n=RA(t,e.type);t!==n&&(At(C1,e),At(Hi,n))}function mx(e){C1.current===e&&(Kn(Hi),Kn(C1)),xx.current===e&&(Kn(xx),$d._currentValue=lc)}var g2,d7;function Zo(e){if(g2===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);g2=t&&t[1]||"",d7=-1<n.stack.indexOf(`
|
|
184
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
185
|
-
`+g2+e+d7}var m2=!1;function y2(e,t){if(!e||m2)return"";m2=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(g){var p=g}Reflect.construct(e,[],f)}else{try{f.call()}catch(g){p=g}f=!1;try{var x=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),f=!0,new e}finally{f&&(x!==void 0?Object.defineProperty(e.prototype,"props",x):delete e.prototype.props)}}}else{try{throw Error()}catch(g){p=g}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(g){if(g&&p&&typeof g.stack=="string")return[g.stack,p.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=s.DetermineComponentFrameRoot(),a=i[0],l=i[1];if(a&&l){var c=a.split(`
|
|
186
|
-
`),u=l.split(`
|
|
187
|
-
`);for(r=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(s===c.length||r===u.length)for(s=c.length-1,r=u.length-1;1<=s&&0<=r&&c[s]!==u[r];)r--;for(;1<=s&&0<=r;s--,r--)if(c[s]!==u[r]){if(s!==1||r!==1)do if(s--,r--,0>r||c[s]!==u[r]){var d=`
|
|
188
|
-
`+c[s].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=s&&0<=r);break}}}finally{m2=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Zo(n):""}function iV(e,t){switch(e.tag){case 26:case 27:case 5:return Zo(e.type);case 16:return Zo("Lazy");case 13:return e.child!==t&&t!==null?Zo("Suspense Fallback"):Zo("Suspense");case 19:return Zo("SuspenseList");case 0:case 15:return y2(e.type,!1);case 11:return y2(e.type.render,!1);case 1:return y2(e.type,!0);case 31:return Zo("Activity");case 30:return Zo("ViewTransition");default:return""}}function f7(e){try{var t="",n=null;do t+=iV(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
|
|
189
|
-
Error generating stack: `+s.message+`
|
|
190
|
-
`+s.stack}}var rv=Object.prototype.hasOwnProperty,L5=yn.unstable_scheduleCallback,v2=yn.unstable_cancelCallback,oV=yn.unstable_shouldYield,aV=yn.unstable_requestPaint,dr=yn.unstable_now,lV=yn.unstable_getCurrentPriorityLevel,hE=yn.unstable_ImmediatePriority,pE=yn.unstable_UserBlockingPriority,yx=yn.unstable_NormalPriority,cV=yn.unstable_LowPriority,xE=yn.unstable_IdlePriority,uV=yn.log,dV=yn.unstable_setDisableYieldValue,$h=null,fr=null;function Ca(e){if(typeof uV=="function"&&dV(e),fr&&typeof fr.setStrictMode=="function")try{fr.setStrictMode($h,e)}catch{}}var hr=Math.clz32?Math.clz32:pV,fV=Math.log,hV=Math.LN2;function pV(e){return e>>>=0,e===0?32:31-(fV(e)/hV|0)|0}var m0=256,y0=262144,v0=4194304;function gl(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 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Vg(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~i,s!==0?r=gl(s):(a&=l,a!==0?r=gl(a):n||(n=l&~e,n!==0&&(r=gl(n))))):(l=s&~i,l!==0?r=gl(l):a!==0?r=gl(a):n||(n=s&~e,n!==0&&(r=gl(n)))),r===0?0:t!==0&&t!==r&&!(t&i)&&(i=r&-r,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:r}function Ah(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function gE(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var s=31-hr(n),r=1<<s;t|=e[s],n&=~r}return t}function xV(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;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mE(){var e=v0;return v0<<=1,!(v0&62914560)&&(v0=4194304),e}function k2(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Mh(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gV(e,t,n,s,r,i){var a=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 l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0<n;){var d=31-hr(n),f=1<<d;l[d]=0,c[d]=-1;var p=u[d];if(p!==null)for(u[d]=null,d=0;d<p.length;d++){var x=p[d];x!==null&&(x.lane&=-536870913)}n&=~f}s!==0&&yE(e,s,0),i!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=i&~(a&~t))}function yE(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-hr(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function vE(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-hr(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}function kE(e,t){var n=t&-t;return n=n&42?1:O5(n),n&(e.suspendedLanes|t)?0:n}function O5(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=134217728;break;default:e=0}return e}function D5(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bE(){var e=it.p;return e!==0?e:(e=window.event,e===void 0?32:tM(e.type))}function h7(e,t){var n=it.p;try{return it.p=e,t()}finally{it.p=n}}var Lo=Math.random().toString(36).slice(2),Gn="__reactFiber$"+Lo,Ps="__reactProps$"+Lo,Pd="__reactContainer$"+Lo,p7="__reactEvents$"+Lo,mV="__reactListeners$"+Lo,yV="__reactHandles$"+Lo,x7="__reactResources$"+Lo,Th="__reactMarker$"+Lo,vx="__reactLoad$"+Lo;function Gg(e){delete e[Gn],delete e[Ps],delete e[mV],delete e[yV]}function Ll(e){var t;if(t=e[Gn])return t;for(var n=e.parentNode;n;){if(t=n[Pd]||n[Gn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=z8(e);e!==null;){if(n=e[Gn])return n;e=z8(e)}return t}e=n,n=e.parentNode}return null}function Ud(e){if(e=e[Gn]||e[Pd]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function If(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(de(33))}function Nu(e){var t=e[x7];return t||(t=e[x7]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Nn(e){e[Th]=!0}function wE(e){e[vx]=void 0}var jE=new Set,SE={};function Lc(e,t){yd(e,t),yd(e+"Capture",t)}function yd(e,t){for(SE[e]=t,e=0;e<t.length;e++)jE.add(t[e])}var vV=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]*$"),g7={},m7={};function kV(e){return rv.call(m7,e)?!0:rv.call(g7,e)?!1:vV.test(e)?m7[e]=!0:(g7[e]=!0,!1)}var tt=!1;function y7(){var e=tt;return tt=!1,e}function J0(e,t,n){if(kV(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function k0(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 Ji(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,s)}}function sr(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function CE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bV(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,i=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function iv(e){if(!e._valueTracker){var t=CE(e)?"checked":"value";e._valueTracker=bV(e,t,""+e[t])}}function EE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=CE(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}var wV=/[\n"\\]/g;function Tr(e){return e.replace(wV,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ov(e,t,n,s,r,i,a,l){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+sr(t)):e.value!==""+sr(t)&&(e.value=""+sr(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?a==="number"&&e.value==t?b2(e,sr(e.value)):b2(e,sr(t)):n!=null?b2(e,sr(n)):s!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+sr(l):e.removeAttribute("name")}function $E(e,t,n,s,r,i,a,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){iv(e);return}n=n!=null?""+sr(n):"",t=t!=null?""+sr(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=l?e.checked:!!s,e.defaultChecked=!!s,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),iv(e)}function b2(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function _u(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+sr(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function AE(e,t,n){if(t!=null&&(t=""+sr(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+sr(n):""}function ME(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(de(92));if(Rf(s)){if(1<s.length)throw Error(de(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=sr(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),iv(e)}function vd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jV=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 v7(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||jV.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function TE(e,t,n){if(t!=null&&typeof t!="object")throw Error(de(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",tt=!0);for(var r in t)s=t[r],t.hasOwnProperty(r)&&n[r]!==s&&(v7(e,r,s),tt=!0)}else for(var i in t)t.hasOwnProperty(i)&&v7(e,i,t[i])}function B5(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 SV=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"]]),CV=/^[\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 ep(e){return CV.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Li(){}var av=null;function H5(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yu=null,Ru=null;function k7(e){var t=Ud(e);if(t&&(e=t.stateNode)){var n=e[Ps]||null;e:switch(e=t.stateNode,t.type){case"input":if(ov(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="'+Tr(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=s[Ps]||null;if(!r)throw Error(de(90));ov(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&EE(s)}break e;case"textarea":AE(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&_u(e,!!n.multiple,t,!1)}}}var w2=!1;function zE(e,t,n){if(w2)return e(t,n);w2=!0;try{var s=e(t);return s}finally{if(w2=!1,(yu!==null||Ru!==null)&&(om(),yu&&(t=yu,e=Ru,Ru=yu=null,k7(t),e)))for(t=0;t<e.length;t++)k7(e[t])}}function E1(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Ps]||null;if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(de(231,t,typeof n));return n}var Ao=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lv=!1;if(Ao)try{var gf={};Object.defineProperty(gf,"passive",{get:function(){lv=!0}}),window.addEventListener("test",gf,gf),window.removeEventListener("test",gf,gf)}catch{lv=!1}var Ea=null,q5=null,tp=null;function NE(){if(tp)return tp;var e,t=q5,n=t.length,s,r="value"in Ea?Ea.value:Ea.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var a=n-e;for(s=1;s<=a&&t[n-s]===r[i-s];s++);return tp=r.slice(e,1<s?1-s:void 0)}function np(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 b0(){return!0}function b7(){return!1}function $s(e){function t(n,s,r,i,a){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?b0:b7,this.isPropagationStopped=b7,this}return wt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=b0)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=b0)},persist:function(){},isPersistent:b0}),t}var tl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wg=$s(tl),zh=wt({},tl,{view:0,detail:0}),EV=$s(zh),j2,S2,mf,Kg=wt({},zh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:P5,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!==mf&&(mf&&e.type==="mousemove"?(j2=e.screenX-mf.screenX,S2=e.screenY-mf.screenY):S2=j2=0,mf=e),j2)},movementY:function(e){return"movementY"in e?e.movementY:S2}}),w7=$s(Kg),$V=wt({},Kg,{dataTransfer:0}),AV=$s($V),MV=wt({},zh,{relatedTarget:0}),C2=$s(MV),TV=wt({},tl,{animationName:0,elapsedTime:0,pseudoElement:0}),zV=$s(TV),NV=wt({},tl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_V=$s(NV),RV=wt({},tl,{data:0}),j7=$s(RV),IV={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LV={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"},OV={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DV(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=OV[e])?!!t[e]:!1}function P5(){return DV}var BV=wt({},zh,{key:function(e){if(e.key){var t=IV[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=np(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?LV[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:P5,charCode:function(e){return e.type==="keypress"?np(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?np(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),HV=$s(BV),qV=wt({},Kg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),S7=$s(qV),PV=wt({},tl,{submitter:0}),UV=$s(PV),FV=wt({},zh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:P5}),VV=$s(FV),GV=wt({},tl,{propertyName:0,elapsedTime:0,pseudoElement:0}),WV=$s(GV),KV=wt({},Kg,{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}),XV=$s(KV),ZV=wt({},tl,{newState:0,oldState:0,source:0}),YV=$s(ZV),QV=[9,13,27,32],U5=Ao&&"CompositionEvent"in window,Jf=null;Ao&&"documentMode"in document&&(Jf=document.documentMode);var JV=Ao&&"TextEvent"in window&&!Jf,_E=Ao&&(!U5||Jf&&8<Jf&&11>=Jf),C7=" ",E7=!1;function RE(e,t){switch(e){case"keyup":return QV.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function IE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vu=!1;function eG(e,t){switch(e){case"compositionend":return IE(t);case"keypress":return t.which!==32?null:(E7=!0,C7);case"textInput":return e=t.data,e===C7&&E7?null:e;default:return null}}function tG(e,t){if(vu)return e==="compositionend"||!U5&&RE(e,t)?(e=NE(),tp=q5=Ea=null,vu=!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 _E&&t.locale!=="ko"?null:t.data;default:return null}}var nG={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 $7(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!nG[e.type]:t==="textarea"}function LE(e,t,n,s){yu?Ru?Ru.push(s):Ru=[s]:yu=s,t=qx(t,"onChange"),0<t.length&&(n=new Wg("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var e1=null,$1=null;function sG(e){zA(e,0)}function Xg(e){var t=If(e);if(EE(t))return e}function A7(e,t){if(e==="change")return t}var OE=!1;if(Ao){var E2;if(Ao){var $2="oninput"in document;if(!$2){var M7=document.createElement("div");M7.setAttribute("oninput","return;"),$2=typeof M7.oninput=="function"}E2=$2}else E2=!1;OE=E2&&(!document.documentMode||9<document.documentMode)}function T7(){e1&&(e1.detachEvent("onpropertychange",DE),$1=e1=null)}function DE(e){if(e.propertyName==="value"&&Xg($1)){var t=[];LE(t,$1,e,H5(e)),zE(sG,t)}}function rG(e,t,n){e==="focusin"?(T7(),e1=t,$1=n,e1.attachEvent("onpropertychange",DE)):e==="focusout"&&T7()}function iG(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xg($1)}function oG(e,t){if(e==="click")return Xg(t)}function aG(e,t){if(e==="input"||e==="change")return Xg(t)}function lG(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gr=typeof Object.is=="function"?Object.is:lG;function A1(e,t){if(gr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!rv.call(t,r)||!gr(e[r],t[r]))return!1}return!0}function cv(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function z7(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function N7(e,t){var n=z7(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=z7(n)}}function BE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?BE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function HE(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=cv(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=cv(e.document)}return t}function F5(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 cG=Ao&&"documentMode"in document&&11>=document.documentMode,ku=null,uv=null,t1=null,dv=!1;function _7(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;dv||ku==null||ku!==cv(s)||(s=ku,"selectionStart"in s&&F5(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),t1&&A1(t1,s)||(t1=s,s=qx(uv,"onSelect"),0<s.length&&(t=new Wg("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=ku)))}function dl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var bu={animationend:dl("Animation","AnimationEnd"),animationiteration:dl("Animation","AnimationIteration"),animationstart:dl("Animation","AnimationStart"),transitionrun:dl("Transition","TransitionRun"),transitionstart:dl("Transition","TransitionStart"),transitioncancel:dl("Transition","TransitionCancel"),transitionend:dl("Transition","TransitionEnd")},A2={},qE={};Ao&&(qE=document.createElement("div").style,"AnimationEvent"in window||(delete bu.animationend.animation,delete bu.animationiteration.animation,delete bu.animationstart.animation),"TransitionEvent"in window||delete bu.transitionend.transition);function Oc(e){if(A2[e])return A2[e];if(!bu[e])return e;var t=bu[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qE)return A2[e]=t[n];return e}var PE=Oc("animationend"),UE=Oc("animationiteration"),FE=Oc("animationstart"),uG=Oc("transitionrun"),dG=Oc("transitionstart"),fG=Oc("transitioncancel"),VE=Oc("transitionend"),GE=new Map,fv="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(" ");fv.push("scrollEnd");function oi(e,t){GE.set(e,t),Lc(t,[e])}var hG=0;function Mo(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=si.identifierPrefix;var n=hG++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function R7(e){if(e==null||typeof e=="string")return e;var t=null,n=qu;if(n!==null)for(var s=0;s<n.length;s++){var r=e[n[s]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function Oo(e,t){return e=R7(e),t=R7(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var kx=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!==null&&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)},$r=[],wu=0,V5=0;function Zg(){for(var e=wu,t=V5=wu=0;t<e;){var n=$r[t];$r[t++]=null;var s=$r[t];$r[t++]=null;var r=$r[t];$r[t++]=null;var i=$r[t];if($r[t++]=null,s!==null&&r!==null){var a=s.pending;a===null?r.next=r:(r.next=a.next,a.next=r),s.pending=r}i!==0&&WE(n,r,i)}}function Yg(e,t,n,s){$r[wu++]=e,$r[wu++]=t,$r[wu++]=n,$r[wu++]=s,V5|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function G5(e,t,n,s){return Yg(e,t,n,s),bx(e)}function Dc(e,t){return Yg(e,null,null,t),bx(e)}function WE(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var r=!1,i=e.return;i!==null;)i.childLanes|=n,s=i.alternate,s!==null&&(s.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(r=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,r&&t!==null&&(r=31-hr(n),e=i.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=n|536870912),i):null}function bx(e){if(50<d1)throw d1=0,fp=null,Error(de(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ju={};function pG(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ds(e,t,n,s){return new pG(e,t,n,s)}function W5(e){return e=e.prototype,!(!e||!e.isReactComponent)}function So(e,t){var n=e.alternate;return n===null?(n=Ds(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&1206910976,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 KE(e,t){e.flags&=1206910978;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 sp(e,t,n,s,r,i){var a=0;if(s=e,typeof s=="function")W5(s)&&(a=1);else if(typeof s=="string")a=PW(e,n,Hi.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Jy:return e=Ds(31,n,t,r),e.elementType=Jy,e.lanes=i,e;case gu:return cc(n.children,r,i,t);case dE:a=8,r|=24;break;case Zy:return e=Ds(12,n,t,r|2),e.elementType=Zy,e.lanes=i,e;case Yy:return e=Ds(13,n,t,r),e.elementType=Yy,e.lanes=i,e;case Qy:return e=Ds(19,n,t,r),e.elementType=Qy,e.lanes=i,e;case tV:case ev:return e=r|32,e=Ds(30,n,t,e),e.elementType=ev,e.lanes=i,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case Ii:a=10;break e;case fE:a=9;break e;case R5:a=11;break e;case I5:a=14;break e;case ra:a=16,s=null;break e}a=29,n=Error(de(130,e===null?"null":typeof e,"")),s=null}return t=Ds(a,n,t,r),t.elementType=e,t.type=s,t.lanes=i,t}function cc(e,t,n,s){return e=Ds(7,e,s,t),e.lanes=n,e}function M2(e,t,n){return e=Ds(6,e,null,t),e.lanes=n,e}function XE(e){var t=Ds(18,null,null,0);return t.stateNode=e,t}function T2(e,t,n){return t=Ds(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var I7=new WeakMap;function zr(e,t){if(typeof e=="object"&&e!==null){var n=I7.get(e);return n!==void 0?n:(t={value:e,source:t,stack:f7(t)},I7.set(e,t),t)}return{value:e,source:t,stack:f7(t)}}var Su=[],Cu=0,wx=null,M1=0,Ar=[],Mr=0,Va=null,Oi=1,Di="";function no(e,t){Su[Cu++]=M1,Su[Cu++]=wx,wx=e,M1=t}function ZE(e,t,n){Ar[Mr++]=Oi,Ar[Mr++]=Di,Ar[Mr++]=Va,Va=e;var s=Oi;e=Di;var r=32-hr(s)-1;s&=~(1<<r),n+=1;var i=32-hr(t)+r;if(30<i){var a=r-r%5;i=(s&(1<<a)-1).toString(32),s>>=a,r-=a,Oi=1<<32-hr(t)+r|n<<r|s,Di=i+e}else Oi=1<<i|n<<r|s,Di=e}function Qg(e){e.return!==null&&(no(e,1),ZE(e,1,0))}function K5(e){for(;e===wx;)wx=Su[--Cu],Su[Cu]=null,M1=Su[--Cu],Su[Cu]=null;for(;e===Va;)Va=Ar[--Mr],Ar[Mr]=null,Di=Ar[--Mr],Ar[Mr]=null,Oi=Ar[--Mr],Ar[Mr]=null}function YE(e,t){Ar[Mr++]=Oi,Ar[Mr++]=Di,Ar[Mr++]=Va,Oi=t.id,Di=t.overflow,Va=e}var Rn=null,Et=null,Ue=!1,Ra=null,Nr=!1,hv=Error(de(519));function Ga(e){var t=Error(de(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw T1(zr(t,e)),hv}function L7(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[Gn]=e,t[Ps]=s,n){case"dialog":Ge("cancel",t),Ge("close",t);break;case"iframe":case"object":case"embed":Ge("load",t);break;case"video":case"audio":for(n=0;n<R1.length;n++)Ge(R1[n],t);break;case"source":Ge("error",t);break;case"img":case"image":case"link":Ge("error",t),Ge("load",t);break;case"details":Ge("toggle",t);break;case"input":Ge("invalid",t),$E(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ge("invalid",t);break;case"textarea":Ge("invalid",t),ME(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||_A(t.textContent,n)?(s.popover!=null&&(Ge("beforetoggle",t),Ge("toggle",t)),s.onScroll!=null&&Ge("scroll",t),s.onScrollEnd!=null&&Ge("scrollend",t),s.onClick!=null&&(t.onclick=Li),t=!0):t=!1,t||Ga(e,!0)}function jx(e){for(Rn=e.return;Rn;)switch(Rn.tag){case 5:case 31:case 13:Nr=!1;return;case 27:case 3:Nr=!0;return;default:Rn=Rn.return}}function Yc(e){if(e!==Rn)return!1;if(!Ue)return jx(e),Ue=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Yv(e.type,e.memoizedProps)),n=!n),n&&Et&&Ga(e),jx(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(de(317));Et=T8(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(de(317));Et=T8(e)}else t===27?(t=Et,nl(e.type)?(e=tk,tk=null,Et=e):Et=t):Et=Rn?Rr(e.stateNode.nextSibling):null;return!0}function mc(){Et=Rn=null,Ue=!1}function z2(){var e=Ra;return e!==null&&(Is===null?Is=e:Is.push.apply(Is,e),Ra=null),e}function T1(e){Ra===null?Ra=[e]:Ra.push(e)}var pv=Ki(null),Bc=null,yo=null;function $a(e,t,n){At(pv,t._currentValue),t._currentValue=n}function Co(e){e._currentValue=pv.current,Kn(pv)}function rp(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function xv(e,t,n,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var i=r.dependencies;if(i!==null){var a=r.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),rp(i.return,n,e),s||(a=null);break e}i=l.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(de(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),rp(a,n,e),a=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=n,a=r.alternate,a!==null&&(a.lanes|=n),rp(r.return,n,e),a=r.child,a=a!==null?a.sibling:null):a=r.child;if(a!==null)a.return=r;else for(a=r;a!==null;){if(a===e){a=null;break}if(r=a.sibling,r!==null){r.return=a.return,a=r;break}a=a.return}r=a}}function yc(e,t,n,s){e=null;for(var r=t,i=!1;r!==null;){if(!i){if(r.flags&524288)i=!0;else if(r.flags&262144)break}if(r.tag===10){var a=r.alternate;if(a===null)throw Error(de(387));if(a=a.memoizedProps,a!==null){var l=r.type;gr(r.pendingProps.value,a.value)||(e!==null?e.push(l):e=[l])}}else if(r===xx.current){if(a=r.alternate,a===null)throw Error(de(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push($d):e=[$d])}r=r.return}return e!==null&&xv(t,e,n,s),t.flags|=262144,e!==null}function Sx(e){for(e=e.firstContext;e!==null;){if(!gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function vc(e){Bc=e,yo=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Wn(e){return QE(Bc,e)}function w0(e,t){return Bc===null&&vc(e),QE(e,t)}function QE(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},yo===null){if(e===null)throw Error(de(308));yo=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else yo=yo.next=t;return n}var xG=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},gG=yn.unstable_scheduleCallback,mG=yn.unstable_NormalPriority,dn={$$typeof:Ii,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function X5(){return{controller:new xG,data:new Map,refCount:0}}function Nh(e){e.refCount--,e.refCount===0&&gG(mG,function(){e.controller.abort()})}function O7(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var s=t[e];n.indexOf(s)===-1&&n.push(s)}}}var Lf=null;function yG(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var n1=null,gv=0,kc=0,Iu=null;function vG(e,t){if(n1===null){var n=n1=[];gv=0,kc=j3(),Iu={status:"pending",value:void 0,then:function(s){n.push(s)}}}return gv++,t.then(D7,D7),t}function D7(){if(--gv===0&&(Lf=null,n1!==null)){Iu!==null&&(Iu.status="fulfilled");var e=n1;n1=null,kc=0,Iu=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function kG(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),s}var B7=Ne.S;Ne.S=function(e,t){if(gA=dr(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&vG(e,t),Lf!==null)for(var n=Sd;n!==null;)O7(n,Lf),n=n.next;if(n=e.types,n!==null){for(var s=Sd;s!==null;)O7(s,n),s=s.next;if(kc!==0){s=Lf,s===null&&(s=Lf=[]);for(var r=0;r<n.length;r++){var i=n[r];s.indexOf(i)===-1&&s.push(i)}}}B7!==null&&B7(e,t)};var uc=Ki(null);function Z5(){var e=uc.current;return e!==null?e:bt.pooledCache}function ip(e,t){t===null?At(uc,uc.current):At(uc,t.pool)}function JE(){var e=Z5();return e===null?null:{parent:dn._currentValue,pool:e}}var Fd=Error(de(460)),Y5=Error(de(474)),Jg=Error(de(542)),Cx={then:function(){}};function H7(e){return e=e.status,e==="fulfilled"||e==="rejected"}function e$(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Li,Li),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,P7(e),e===void 0&&!("reason"in t)?Error(de(600)):e;default:if(typeof t.status=="string")t.then(Li,Li);else{if(e=bt,e!==null&&100<e.shellSuspendCounter)throw Error(de(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,P7(e),e}throw dc=t,Fd}}function ml(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(dc=n,Fd):n}}var dc=null;function q7(){if(dc===null)throw Error(de(459));var e=dc;return dc=null,e}function P7(e){if(e===Fd||e===Jg)throw Error(de(483))}var Lu=null,z1=0;function j0(e){var t=z1;return z1+=1,Lu===null&&(Lu=[]),e$(Lu,e,t)}function Wo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function S0(e,t){throw t.$$typeof===eV?Error(de(525)):(e=Object.prototype.toString.call(t),Error(de(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function t$(e){function t(m,k){if(e){var b=m.deletions;b===null?(m.deletions=[k],m.flags|=16):b.push(k)}}function n(m,k){if(!e)return null;for(;k!==null;)t(m,k),k=k.sibling;return null}function s(m){for(var k=new Map;m!==null;)m.key===null?k.set(m.index,m):k.set(m.key,m),m=m.sibling;return k}function r(m,k){return m=So(m,k),m.index=0,m.sibling=null,m}function i(m,k,b){return m.index=b,e?(b=m.alternate,b!==null?(b=b.index,b<k?(m.flags|=2,k):b):(m.flags|=134217730,k)):(m.flags|=1048576,k)}function a(m){return e&&m.alternate===null&&(m.flags|=134217730),m}function l(m,k,b,j){return k===null||k.tag!==6?(k=M2(b,m.mode,j),k.return=m,k):(k=r(k,b),k.return=m,k)}function c(m,k,b,j){var A=b.type;return A===gu?(m=d(m,k,b.props.children,j,b.key),Wo(m,b),m):k!==null&&(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===ra&&ml(A)===k.type)?(k=r(k,b.props),Wo(k,b),k.return=m,k):(k=sp(b.type,b.key,b.props,null,m.mode,j),Wo(k,b),k.return=m,k)}function u(m,k,b,j){return k===null||k.tag!==4||k.stateNode.containerInfo!==b.containerInfo||k.stateNode.implementation!==b.implementation?(k=T2(b,m.mode,j),k.return=m,k):(k=r(k,b.children||[]),k.return=m,k)}function d(m,k,b,j,A){return k===null||k.tag!==7?(k=cc(b,m.mode,j,A),k.return=m,k):(k=r(k,b),k.return=m,k)}function f(m,k,b){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=M2(""+k,m.mode,b),k.return=m,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case g0:return b=sp(k.type,k.key,k.props,null,m.mode,b),Wo(b,k),b.return=m,b;case _f:return k=T2(k,m.mode,b),k.return=m,k;case ra:return k=ml(k),f(m,k,b)}if(Rf(k)||xf(k))return k=cc(k,m.mode,b,null),k.return=m,k;if(typeof k.then=="function")return f(m,j0(k),b);if(k.$$typeof===Ii)return f(m,w0(m,k),b);S0(m,k)}return null}function p(m,k,b,j){var A=k!==null?k.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return A!==null?null:l(m,k,""+b,j);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case g0:return b.key===A?c(m,k,b,j):null;case _f:return b.key===A?u(m,k,b,j):null;case ra:return b=ml(b),p(m,k,b,j)}if(Rf(b)||xf(b))return A!==null?null:d(m,k,b,j,null);if(typeof b.then=="function")return p(m,k,j0(b),j);if(b.$$typeof===Ii)return p(m,k,w0(m,b),j);S0(m,b)}return null}function x(m,k,b,j,A){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return m=m.get(b)||null,l(k,m,""+j,A);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case g0:return m=m.get(j.key===null?b:j.key)||null,c(k,m,j,A);case _f:return m=m.get(j.key===null?b:j.key)||null,u(k,m,j,A);case ra:return j=ml(j),x(m,k,b,j,A)}if(Rf(j)||xf(j))return m=m.get(b)||null,d(k,m,j,A,null);if(typeof j.then=="function")return x(m,k,b,j0(j),A);if(j.$$typeof===Ii)return x(m,k,b,w0(k,j),A);S0(k,j)}return null}function g(m,k,b,j){for(var A=null,M=null,T=k,z=k=0,$=null;T!==null&&z<b.length;z++){T.index>z?($=T,T=null):$=T.sibling;var E=p(m,T,b[z],j);if(E===null){T===null&&(T=$);break}e&&T&&E.alternate===null&&t(m,T),k=i(E,k,z),M===null?A=E:M.sibling=E,M=E,T=$}if(z===b.length)return n(m,T),Ue&&no(m,z),A;if(T===null){for(;z<b.length;z++)T=f(m,b[z],j),T!==null&&(k=i(T,k,z),M===null?A=T:M.sibling=T,M=T);return Ue&&no(m,z),A}for(T=s(T);z<b.length;z++)$=x(T,m,z,b[z],j),$!==null&&(e&&(E=$.alternate,E!==null&&T.delete(E.key===null?z:E.key)),k=i($,k,z),M===null?A=$:M.sibling=$,M=$);return e&&T.forEach(function(N){return t(m,N)}),Ue&&no(m,z),A}function v(m,k,b,j){if(b==null)throw Error(de(151));for(var A=null,M=null,T=k,z=k=0,$=null,E=b.next();T!==null&&!E.done;z++,E=b.next()){T.index>z?($=T,T=null):$=T.sibling;var N=p(m,T,E.value,j);if(N===null){T===null&&(T=$);break}e&&T&&N.alternate===null&&t(m,T),k=i(N,k,z),M===null?A=N:M.sibling=N,M=N,T=$}if(E.done)return n(m,T),Ue&&no(m,z),A;if(T===null){for(;!E.done;z++,E=b.next())E=f(m,E.value,j),E!==null&&(k=i(E,k,z),M===null?A=E:M.sibling=E,M=E);return Ue&&no(m,z),A}for(T=s(T);!E.done;z++,E=b.next())E=x(T,m,z,E.value,j),E!==null&&(e&&($=E.alternate,$!==null&&T.delete($.key===null?z:$.key)),k=i(E,k,z),M===null?A=E:M.sibling=E,M=E);return e&&T.forEach(function(_){return t(m,_)}),Ue&&no(m,z),A}function y(m,k,b,j){if(typeof b=="object"&&b!==null&&b.type===gu&&b.key===null&&b.props.ref===void 0&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case g0:e:{for(var A=b.key;k!==null;){if(k.key===A){if(A=b.type,A===gu){if(k.tag===7){n(m,k.sibling),j=r(k,b.props.children),Wo(j,b),j.return=m,m=j;break e}}else if(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===ra&&ml(A)===k.type){n(m,k.sibling),j=r(k,b.props),Wo(j,b),j.return=m,m=j;break e}n(m,k);break}else t(m,k);k=k.sibling}b.type===gu?(j=cc(b.props.children,m.mode,j,b.key),Wo(j,b),j.return=m,m=j):(j=sp(b.type,b.key,b.props,null,m.mode,j),Wo(j,b),j.return=m,m=j)}return a(m);case _f:e:{for(A=b.key;k!==null;){if(k.key===A)if(k.tag===4&&k.stateNode.containerInfo===b.containerInfo&&k.stateNode.implementation===b.implementation){n(m,k.sibling),j=r(k,b.children||[]),j.return=m,m=j;break e}else{n(m,k);break}else t(m,k);k=k.sibling}j=T2(b,m.mode,j),j.return=m,m=j}return a(m);case ra:return b=ml(b),y(m,k,b,j)}if(Rf(b))return g(m,k,b,j);if(xf(b)){if(A=xf(b),typeof A!="function")throw Error(de(150));return b=A.call(b),v(m,k,b,j)}if(typeof b.then=="function")return y(m,k,j0(b),j);if(b.$$typeof===Ii)return y(m,k,w0(m,b),j);S0(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,k!==null&&k.tag===6?(n(m,k.sibling),j=r(k,b),j.return=m,m=j):(n(m,k),j=M2(b,m.mode,j),j.return=m,m=j),a(m)):n(m,k)}return function(m,k,b,j){try{z1=0;var A=y(m,k,b,j);return Lu=null,A}catch(T){if(T===Fd||T===Jg)throw T;var M=Ds(29,T,null,m.mode);return M.lanes=j,M.return=m,M}finally{}}}var bc=t$(!0),n$=t$(!1),ia=!1;function Q5(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mv(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 Ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,rt&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=bx(e),WE(e,null,n),t}return Yg(e,s,t,n),bx(e)}function s1(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,vE(e,n)}}function N2(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?r=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var yv=!1;function r1(){if(yv){var e=Iu;if(e!==null)throw e}}function i1(e,t,n,s){yv=!1;var r=e.updateQueue;ia=!1;var i=r.firstBaseUpdate,a=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=r.baseState;a=0,d=u=c=null,l=i;do{var p=l.lane&-536870913,x=p!==l.lane;if(x?(Ke&p)===p:(s&p)===p){p!==0&&p===kc&&(yv=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,v=l;p=t;var y=n;switch(v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(y,f,p);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,p=typeof g=="function"?g.call(y,f,p):g,p==null)break e;f=wt({},f,p);break e;case 2:ia=!0}}p=l.callback,p!==null&&(e.flags|=64,x&&(e.flags|=8192),x=r.callbacks,x===null?r.callbacks=[p]:x.push(p))}else x={lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=x,c=f):d=d.next=x,a|=p;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;x=l,l=x.next,x.next=null,r.lastBaseUpdate=x,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,i===null&&(r.shared.lanes=0),Xa|=a,e.lanes=a,e.memoizedState=f}}function s$(e,t){if(typeof e!="function")throw Error(de(191,e));e.call(t)}function r$(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)s$(n[e],t)}var Wa=Ki(null),Ex=Ki(0);function U7(e,t){e=_o,At(Ex,e),At(Wa,t),_o=e|t.baseLanes}function vv(){At(Ex,_o),At(Wa,Wa.current)}function J5(){_o=Ex.current,Kn(Wa),Kn(Ex)}var Yn=Ki(null),ls=null;function Oa(e){var t=e.alternate;At(Xn,Xn.current&1),At(Yn,e),ls===null&&(t===null||Wa.current!==null||t.memoizedState!==null)&&(ls=e)}function kv(e){At(Xn,Xn.current),At(Yn,e),ls===null&&(ls=e)}function i$(e){e.tag===22?(At(Xn,Xn.current),At(Yn,e),ls===null&&(ls=e)):Da()}function Da(){At(Xn,Xn.current),At(Yn,Yn.current)}function ir(e){Kn(Yn),ls===e&&(ls=null),Kn(Xn)}var Xn=Ki(0);function N1(e,t){At(Yn,Yn.current),At(Xn,t)}function e3(e){Kn(Xn),Kn(Yn),ls===e&&(ls=null)}function $x(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ek(n)||$3(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 To=0,Be=null,gt=null,un=null,Ax=!1,Ou=!1,wc=!1,Mx=0,_1=0,Du=null,bG=0;function Kt(){throw Error(de(321))}function t3(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gr(e[n],t[n]))return!1;return!0}function n3(e,t,n,s,r,i){return To=i,Be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ne.H=e===null||e.memoizedState===null?L$:O$,wc=!1,i=n(s,r),wc=!1,Ou&&(i=a$(t,n,s,r)),o$(e),i}function o$(e){Ne.H=Tx;var t=gt!==null&>.next!==null;if(To=0,un=gt=Be=null,Ax=!1,_1=0,Du=null,t)throw Error(de(300));e===null||fn||(e=e.dependencies,e!==null&&Sx(e)&&(fn=!0))}function a$(e,t,n,s){Be=e;var r=0;do{if(Ou&&(Du=null),_1=0,Ou=!1,25<=r)throw Error(de(301));if(r+=1,un=gt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}Ne.H=MG,i=t(n,s)}while(Ou);return i}function wG(){var e=Ne.H,t=e.useState()[0];return t=typeof t.then=="function"?_h(t):t,e=e.useState()[0],(gt!==null?gt.memoizedState:null)!==e&&(Be.flags|=1024),t}function s3(){var e=Mx!==0;return Mx=0,e}function r3(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function i3(e){if(Ax){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ax=!1}To=0,un=gt=Be=null,Ou=!1,_1=Mx=0,Du=null}function bs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?Be.memoizedState=un=e:un=un.next=e,un}function rn(){if(gt===null){var e=Be.alternate;e=e!==null?e.memoizedState:null}else e=gt.next;var t=un===null?Be.memoizedState:un.next;if(t!==null)un=t,gt=e;else{if(e===null)throw Be.alternate===null?Error(de(467)):Error(de(310));gt=e,e={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},un===null?Be.memoizedState=un=e:un=un.next=e}return un}function em(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _h(e){var t=_1;return _1+=1,Du===null&&(Du=[]),e=e$(Du,e,t),t=Be,(un===null?t.memoizedState:un.next)===null&&(t=t.alternate,Ne.H=t===null||t.memoizedState===null?L$:O$),e}function tm(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return _h(e);if(e.$$typeof===sV)return;if(e.$$typeof===Ii)return Wn(e)}throw Error(de(438,String(e)))}function o3(e){var t=null,n=Be.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Be.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=em(),Be.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=nV;return t.index++,n}function zo(e,t){return typeof t=="function"?t(e):t}function op(e){var t=rn();return a3(t,gt,e)}function a3(e,t,n){var s=e.queue;if(s===null)throw Error(de(311));s.lastRenderedReducer=n;var r=e.baseQueue,i=s.pending;if(i!==null){if(r!==null){var a=r.next;r.next=i.next,i.next=a}t.baseQueue=r=i,s.pending=null}if(i=e.baseState,r===null)e.memoizedState=i;else{t=r.next;var l=a=null,c=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(Ke&f)===f:(To&f)===f){var p=u.revertLane;if(p===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===kc&&(d=!0);else if((To&p)===p){u=u.next,p===kc&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=f,a=i):c=c.next=f,Be.lanes|=p,Xa|=p;f=u.action,wc&&n(i,f),i=u.hasEagerState?u.eagerState:n(i,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=p,a=i):c=c.next=p,Be.lanes|=f,Xa|=f;u=u.next}while(u!==null&&u!==t);if(c===null?a=i:c.next=l,!gr(i,e.memoizedState)&&(fn=!0,d&&(n=Iu,n!==null)))throw n;e.memoizedState=i,e.baseState=a,e.baseQueue=c,s.lastRenderedState=i}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function _2(e){var t=rn(),n=t.queue;if(n===null)throw Error(de(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do i=e(i,a.action),a=a.next;while(a!==r);gr(i,t.memoizedState)||(fn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function l$(e,t,n){var s=Be,r=rn(),i=Ue;if(i){if(n===void 0)throw Error(de(407));n=n()}else n=t();var a=!gr((gt||r).memoizedState,n);if(a&&(r.memoizedState=n,fn=!0),r=r.queue,l3(d$.bind(null,s,r,e),[e]),e=r.getSnapshot!==t||a||un!==null&&(un.memoizedState.tag&1)!==0,kd(e?9:8,{destroy:void 0},u$.bind(null,s,r,n,t),null),e){if(s.flags|=2048,bt===null)throw Error(de(349));i||To&127||c$(s,t,n)}return n}function c$(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Be.updateQueue,t===null?(t=em(),Be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function u$(e,t,n,s){t.value=n,t.getSnapshot=s,f$(t)&&h$(e)}function d$(e,t,n){return n(function(){f$(t)&&h$(e)})}function f$(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gr(e,n)}catch{return!0}}function h$(e){var t=Dc(e,2);t!==null&&Hs(t,e,2)}function bv(e){var t=bs();if(typeof e=="function"){var n=e;if(e=n(),wc){Ca(!0);try{n()}finally{Ca(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t}function p$(e,t,n,s){return e.baseState=n,a3(e,gt,typeof s=="function"?s:zo)}function jG(e,t,n,s,r){if(sm(e))throw Error(de(485));if(e=t.action,e!==null){var i={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){i.listeners.push(a)}};Ne.T!==null?n(!0):i.isTransition=!1,s(i),n=t.pending,n===null?(i.next=t.pending=i,x$(t,i)):(i.next=n.next,t.pending=n.next=i)}}function x$(e,t){var n=t.action,s=t.payload,r=e.state;if(t.isTransition){var i=Ne.T,a={};a.types=i!==null?i.types:null,Ne.T=a;try{var l=n(r,s),c=Ne.S;c!==null&&c(a,l),F7(e,t,l)}catch(u){wv(e,t,u)}finally{i!==null&&a.types!==null&&(i.types=a.types),Ne.T=i}}else try{i=n(r,s),F7(e,t,i)}catch(u){wv(e,t,u)}}function F7(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){V7(e,t,s)},function(s){return wv(e,t,s)}):V7(e,t,n)}function V7(e,t,n){t.status="fulfilled",t.value=n,g$(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,x$(e,n)))}function wv(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,g$(t),t=t.next;while(t!==s)}e.action=null}function g$(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function m$(e,t){return t}function G7(e,t){if(Ue){var n=bt.formState;if(n!==null){e:{var s=Be;if(Ue){if(Et){t:{for(var r=Et,i=Nr;r.nodeType!==8;){if(!i){r=null;break t}if(r=Rr(r.nextSibling),r===null){r=null;break t}}i=r.data,r=i==="F!"||i==="F"?r:null}if(r){Et=Rr(r.nextSibling),s=r.data==="F!";break e}}Ga(s)}s=!1}s&&(t=n[0])}}return n=bs(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:m$,lastRenderedState:t},n.queue=s,n=_$.bind(null,Be,s),s.dispatch=n,s=bv(!1),i=f3.bind(null,Be,!1,s.queue),s=bs(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,n=jG.bind(null,Be,r,i,n),r.dispatch=n,s.memoizedState=e,[t,n,!1]}function W7(e){var t=rn();return y$(t,gt,e)}function y$(e,t,n){if(t=a3(e,t,m$)[0],e=op(zo)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=_h(t)}catch(a){throw a===Fd?Jg:a}else s=t;t=rn();var r=t.queue,i=r.dispatch;return n!==t.memoizedState&&(Be.flags|=2048,kd(9,{destroy:void 0},SG.bind(null,r,n),null)),[s,i,e]}function SG(e,t){e.action=t}function K7(e){var t=rn(),n=gt;if(n!==null)return y$(t,n,e);rn(),t=t.memoizedState,n=rn();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function kd(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Be.updateQueue,t===null&&(t=em(),Be.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function v$(){return rn().memoizedState}function ap(e,t,n,s){var r=bs();Be.flags|=e,r.memoizedState=kd(1|t,{destroy:void 0},n,s===void 0?null:s)}function nm(e,t,n,s){var r=rn();s=s===void 0?null:s;var i=r.memoizedState.inst;gt!==null&&s!==null&&t3(s,gt.memoizedState.deps)?r.memoizedState=kd(t,i,n,s):(Be.flags|=e,r.memoizedState=kd(1|t,i,n,s))}function X7(e,t){ap(8390656,8,e,t)}function l3(e,t){nm(2048,8,e,t)}function CG(e){Be.flags|=4;var t=Be.updateQueue;if(t===null)t=em(),Be.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function k$(e){var t=rn().memoizedState;return CG({ref:t,nextImpl:e}),function(){if(rt&2)throw Error(de(440));return t.impl.apply(void 0,arguments)}}function b$(e,t){return nm(4,2,e,t)}function w$(e,t){return nm(4,4,e,t)}function j$(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 S$(e,t,n){n=n!=null?n.concat([e]):null,nm(4,4,j$.bind(null,t,e),n)}function c3(){}function C$(e,t){var n=rn();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&t3(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function E$(e,t){var n=rn();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&t3(t,s[1]))return s[0];if(s=e(),wc){Ca(!0);try{e()}finally{Ca(!1)}}return n.memoizedState=[s,t],s}function u3(e,t,n){return n===void 0||To&1073741824&&!(Ke&261930)?e.memoizedState=t:(e.memoizedState=n,e=yA(),Be.lanes|=e,Xa|=e,n)}function $$(e,t,n,s){return gr(n,t)?n:Wa.current!==null?(e=u3(e,n,s),gr(e,t)||(fn=!0),e):!(To&106)||To&1073741824&&!(Ke&261930)?(fn=!0,e.memoizedState=n):(e=yA(),Be.lanes|=e,Xa|=e,t)}function A$(e,t,n,s,r){var i=it.p;it.p=i!==0&&8>i?i:8;var a=Ne.T,l={};l.types=a!==null?a.types:null,Ne.T=l,f3(e,!1,t,n);try{var c=r(),u=Ne.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=kG(c,s);o1(e,t,d,pr(e))}else o1(e,t,s,pr(e))}catch(f){o1(e,t,{then:function(){},status:"rejected",reason:f},pr())}finally{it.p=i,a!==null&&l.types!==null&&(a.types=l.types),Ne.T=a}}function EG(){}function jv(e,t,n,s){if(e.tag!==5)throw Error(de(476));var r=M$(e).queue;A$(e,r,t,lc,n===null?EG:function(){return T$(e),n(s)})}function M$(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:lc,baseState:lc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:lc},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function T$(e){var t=M$(e);t.next===null&&(t=e.alternate.memoizedState),o1(e,t.next.queue,{},pr())}function d3(){return Wn($d)}function z$(){return rn().memoizedState}function N$(){return rn().memoizedState}function $G(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pr();e=Ia(n);var s=La(t,e,n);s!==null&&(Hs(s,t,n),s1(s,t,n)),t={cache:X5()},e.payload=t;return}t=t.return}}function AG(e,t,n){var s=pr();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sm(e)?R$(t,n):(n=G5(e,t,n,s),n!==null&&(Hs(n,e,s),I$(n,t,s)))}function _$(e,t,n){var s=pr();o1(e,t,n,s)}function o1(e,t,n,s){var r={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sm(e))R$(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(r.hasEagerState=!0,r.eagerState=l,gr(l,a))return Yg(e,t,r,0),bt===null&&Zg(),!1}catch{}finally{}if(n=G5(e,t,r,s),n!==null)return Hs(n,e,s),I$(n,t,s),!0}return!1}function f3(e,t,n,s){if(s={lane:2,revertLane:j3(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},sm(e)){if(t)throw Error(de(479))}else t=G5(e,n,s,2),t!==null&&Hs(t,e,2)}function sm(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function R$(e,t){Ou=Ax=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function I$(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,vE(e,n)}}var Tx={readContext:Wn,use:tm,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt,useEffectEvent:Kt},L$={readContext:Wn,use:tm,useCallback:function(e,t){return bs().memoizedState=[e,t===void 0?null:t],e},useContext:Wn,useEffect:X7,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ap(4194308,4,j$.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ap(4194308,4,e,t)},useInsertionEffect:function(e,t){ap(4,2,e,t)},useMemo:function(e,t){var n=bs();t=t===void 0?null:t;var s=e();if(wc){Ca(!0);try{e()}finally{Ca(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=bs();if(n!==void 0){var r=n(t);if(wc){Ca(!0);try{n(t)}finally{Ca(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=AG.bind(null,Be,e),[s.memoizedState,e]},useRef:function(e){var t=bs();return e={current:e},t.memoizedState=e},useState:function(e){e=bv(e);var t=e.queue,n=_$.bind(null,Be,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:c3,useDeferredValue:function(e,t){var n=bs();return u3(n,e,t)},useTransition:function(){var e=bv(!1);return e=A$.bind(null,Be,e.queue,!0,!1),bs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Be,r=bs();if(Ue){if(n===void 0)throw Error(de(407));n=n()}else{if(n=t(),bt===null)throw Error(de(349));Ke&127||c$(s,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,X7(d$.bind(null,s,i,e),[e]),s.flags|=2048,kd(9,{destroy:void 0},u$.bind(null,s,i,n,t),null),n},useId:function(){var e=bs(),t=bt.identifierPrefix;if(Ue){var n=Di,s=Oi;n=(s&~(1<<32-hr(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Mx++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=bG++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:d3,useFormState:G7,useActionState:G7,useOptimistic:function(e){var t=bs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=f3.bind(null,Be,!0,n),n.dispatch=t,[e,t]},useMemoCache:o3,useCacheRefresh:function(){return bs().memoizedState=$G.bind(null,Be)},useEffectEvent:function(e){var t=bs(),n={impl:e};return t.memoizedState=n,function(){if(rt&2)throw Error(de(440));return n.impl.apply(void 0,arguments)}}},O$={readContext:Wn,use:tm,useCallback:C$,useContext:Wn,useEffect:l3,useImperativeHandle:S$,useInsertionEffect:b$,useLayoutEffect:w$,useMemo:E$,useReducer:op,useRef:v$,useState:function(){return op(zo)},useDebugValue:c3,useDeferredValue:function(e,t){var n=rn();return $$(n,gt.memoizedState,e,t)},useTransition:function(){var e=op(zo)[0],t=rn().memoizedState;return[typeof e=="boolean"?e:_h(e),t]},useSyncExternalStore:l$,useId:z$,useHostTransitionStatus:d3,useFormState:W7,useActionState:W7,useOptimistic:function(e,t){var n=rn();return p$(n,gt,e,t)},useMemoCache:o3,useCacheRefresh:N$,useEffectEvent:k$},MG={readContext:Wn,use:tm,useCallback:C$,useContext:Wn,useEffect:l3,useImperativeHandle:S$,useInsertionEffect:b$,useLayoutEffect:w$,useMemo:E$,useReducer:_2,useRef:v$,useState:function(){return _2(zo)},useDebugValue:c3,useDeferredValue:function(e,t){var n=rn();return gt===null?u3(n,e,t):$$(n,gt.memoizedState,e,t)},useTransition:function(){var e=_2(zo)[0],t=rn().memoizedState;return[typeof e=="boolean"?e:_h(e),t]},useSyncExternalStore:l$,useId:z$,useHostTransitionStatus:d3,useFormState:K7,useActionState:K7,useOptimistic:function(e,t){var n=rn();return gt!==null?p$(n,gt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:o3,useCacheRefresh:N$,useEffectEvent:k$};function R2(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:wt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Sv={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=pr(),r=Ia(s);r.payload=t,n!=null&&(r.callback=n),t=La(e,r,s),t!==null&&(Hs(t,e,s),s1(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=pr(),r=Ia(s);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=La(e,r,s),t!==null&&(Hs(t,e,s),s1(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pr(),s=Ia(n);s.tag=2,t!=null&&(s.callback=t),t=La(e,s,n),t!==null&&(Hs(t,e,n),s1(t,e,n))}};function Z7(e,t,n,s,r,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,a):t.prototype&&t.prototype.isPureReactComponent?!A1(n,s)||!A1(r,i):!0}function Y7(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Sv.enqueueReplaceState(t,t.state,null)}function jc(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=wt({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function D$(e){kx(e)}function B$(e){console.error(e)}function H$(e){kx(e)}function zx(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Q7(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Cv(e,t,n){return n=Ia(n),n.tag=3,n.payload={element:null},n.callback=function(){zx(e,t)},n}function q$(e){return e=Ia(e),e.tag=3,e}function P$(e,t,n,s){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=s.value;e.payload=function(){return r(i)},e.callback=function(){Q7(t,n,s)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){Q7(t,n,s),typeof r!="function"&&(Ba===null?Ba=new Set([this]):Ba.add(this));var l=s.stack;this.componentDidCatch(s.value,{componentStack:l!==null?l:""})})}function TG(e,t,n,s,r){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&yc(t,n,r,!0),n=Yn.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ls===null?Bx():n.alternate===null&&Qt===0&&(Qt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,s===Cx?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),q2(e,s,r)),!1;case 22:return n.flags|=65536,s===Cx?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),q2(e,s,r)),!1}throw Error(de(435,n.tag))}return q2(e,s,r),Bx(),!1}if(Ue)return t=Yn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==hv&&(e=Error(de(422),{cause:s}),T1(zr(e,n)))):(s!==hv&&(t=Error(de(423),{cause:s}),T1(zr(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=zr(s,n),r=Cv(e.stateNode,s,r),N2(e,r),Qt!==4&&(Qt=2)),!1;var i=Error(de(520),{cause:s});if(i=zr(i,n),u1===null?u1=[i]:u1.push(i),Qt!==4&&(Qt=2),t===null)return!0;s=zr(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Cv(n.stateNode,s,e),N2(n,e),!1;case 1:if(t=n.type,i=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ba===null||!Ba.has(i))))return n.flags|=65536,r&=-r,n.lanes|=r,r=q$(r),P$(r,e,n,s),N2(n,r),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var h3=Error(de(461)),fn=!1;function gn(e,t,n,s){t.child=e===null?n$(t,null,n,s):bc(t,e.child,n,s)}function J7(e,t,n,s,r){n=n.render;var i=t.ref;if("ref"in s){var a={};for(var l in s)l!=="ref"&&(a[l]=s[l])}else a=s;return vc(t),s=n3(e,t,n,a,i,r),l=s3(),e!==null&&!fn?(r3(e,t,r),No(e,t,r)):(Ue&&l&&Qg(t),t.flags|=1,gn(e,t,s,r),t.child)}function e8(e,t,n,s,r){if(e===null){var i=n.type;return typeof i=="function"&&!W5(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,U$(e,t,i,s,r)):(e=sp(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!x3(e,r)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:A1,n(a,s)&&e.ref===t.ref)return No(e,t,r)}return t.flags|=1,e=So(i,s),e.ref=t.ref,e.return=t,t.child=e}function U$(e,t,n,s,r){if(e!==null){var i=e.memoizedProps;if(A1(i,s)&&e.ref===t.ref)if(fn=!1,t.pendingProps=s=i,x3(e,r))e.flags&131072&&(fn=!0);else return t.lanes=e.lanes,No(e,t,r)}return Ev(e,t,n,s,r)}function F$(e,t,n,s){var r=s.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if(t.flags&128){if(i=i!==null?i.baseLanes|n:n,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~i}else s=0,t.child=null;return t8(e,t,i,n,s)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ip(t,i!==null?i.cachePool:null),i!==null?U7(t,i):vv(),i$(t);else return s=t.lanes=536870912,t8(e,t,i!==null?i.baseLanes|n:n,n,s)}else i!==null?(ip(t,i.cachePool),U7(t,i),Da(),t.memoizedState=null):(e!==null&&ip(t,null),vv(),Da());return gn(e,t,r,n),t.child}function a1(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function t8(e,t,n,s,r){var i=Z5();return i=i===null?null:{parent:dn._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&ip(t,null),vv(),i$(t),e!==null&&yc(e,t,s,!0),t.childLanes=r,null}function lp(e,t){return t=rm({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function n8(e,t,n){return bc(t,e.child,null,n),e=lp(t,t.pendingProps),e.flags|=2,ir(t),t.memoizedState=null,e}function zG(e,t,n){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(s.mode==="hidden")return e=lp(t,s),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},a1(null,e);if(kv(t),(e=Et)?(e=UA(e,Nr),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Va!==null?{id:Oi,overflow:Di}:null,retryLane:536870912,hydrationErrors:null},n=XE(e),n.return=t,t.child=n,Rn=t,Et=null)):e=null,e===null)throw Ga(t);return t.lanes=536870912,null}return lp(t,s)}var i=e.memoizedState;if(i!==null){var a=i.dehydrated;if(kv(t),r)if(t.flags&256)t.flags&=-257,t=n8(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(de(558));else if(fn||yc(e,t,n,!1),r=(n&e.childLanes)!==0,fn||r){if(Wa.current===null){if(s=bt,s!==null&&(a=kE(s,n),a!==0&&a!==i.retryLane))throw i.retryLane=a,Dc(e,a),Hs(s,e,a),h3;Bx()}t=n8(e,t,n)}else e=i.treeContext,Et=Rr(a.nextSibling),Rn=t,Ue=!0,Ra=null,Nr=!1,e!==null&&YE(t,e),t=lp(t,s),t.flags|=134221824;return t}return e=So(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ru(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(de(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Ev(e,t,n,s,r){return vc(t),n=n3(e,t,n,s,void 0,r),s=s3(),e!==null&&!fn?(r3(e,t,r),No(e,t,r)):(Ue&&s&&Qg(t),t.flags|=1,gn(e,t,n,r),t.child)}function s8(e,t,n,s,r,i){return vc(t),t.updateQueue=null,n=a$(t,s,n,r),o$(e),s=s3(),e!==null&&!fn?(r3(e,t,i),No(e,t,i)):(Ue&&s&&Qg(t),t.flags|=1,gn(e,t,n,i),t.child)}function r8(e,t,n,s,r){if(vc(t),t.stateNode===null){var i=ju,a=n.contextType;typeof a=="object"&&a!==null&&(i=Wn(a)),i=new n(s,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Sv,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=s,i.state=t.memoizedState,i.refs={},Q5(t),a=n.contextType,i.context=typeof a=="object"&&a!==null?Wn(a):ju,i.state=t.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(R2(t,n,a,s),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(a=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),a!==i.state&&Sv.enqueueReplaceState(i,i.state,null),i1(t,s,i,r),r1(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=jc(n,l);i.props=c;var u=i.context,d=n.contextType;a=ju,typeof d=="object"&&d!==null&&(a=Wn(d));var f=n.getDerivedStateFromProps;d=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||u!==a)&&Y7(t,i,s,a),ia=!1;var p=t.memoizedState;i.state=p,i1(t,s,i,r),r1(),u=t.memoizedState,l||p!==u||ia?(typeof f=="function"&&(R2(t,n,f,s),u=t.memoizedState),(c=ia||Z7(t,n,c,s,p,u,a))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=u),i.props=s,i.state=u,i.context=a,s=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{i=t.stateNode,mv(e,t),a=t.memoizedProps,d=jc(n,a),i.props=d,f=t.pendingProps,p=i.context,u=n.contextType,c=ju,typeof u=="object"&&u!==null&&(c=Wn(u)),l=n.getDerivedStateFromProps,(u=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==f||p!==c)&&Y7(t,i,s,c),ia=!1,p=t.memoizedState,i.state=p,i1(t,s,i,r),r1();var x=t.memoizedState;a!==f||p!==x||ia||e!==null&&e.dependencies!==null&&Sx(e.dependencies)?(typeof l=="function"&&(R2(t,n,l,s),x=t.memoizedState),(d=ia||Z7(t,n,d,s,p,x,c)||e!==null&&e.dependencies!==null&&Sx(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(s,x,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(s,x,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=x),i.props=s,i.state=x,i.context=c,s=d):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),s=!1)}return i=s,ru(e,t),s=(t.flags&128)!==0,i||s?(i=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&s?(t.child=bc(t,e.child,null,r),t.child=bc(t,null,n,r)):gn(e,t,n,r),t.memoizedState=i.state,e=t.child):e=No(e,t,r),e}function i8(e,t,n,s){return mc(),t.flags|=256,gn(e,t,n,s),t.child}var $v={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Av(e){return{baseLanes:e,cachePool:JE()}}function Mv(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=lr),e}function V$(e,t,n){var s=t.pendingProps,r=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(Xn.current&2)!==0),a&&(r=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(r?Oa(t):Da(),(e=Et)?(e=UA(e,Nr),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Va!==null?{id:Oi,overflow:Di}:null,retryLane:536870912,hydrationErrors:null},n=XE(e),n.return=t,t.child=n,Rn=t,Et=null)):e=null,e===null)throw Ga(t);return $3(e)?t.lanes=32:t.lanes=536870912,null}return i=s.children,s=s.fallback,r?(Da(),r=t.mode,i=rm({mode:"hidden",children:i},r),s=cc(s,r,n,null),i.return=t,s.return=t,i.sibling=s,t.child=i,s=t.child,s.memoizedState=Av(n),s.childLanes=Mv(e,a,n),t.memoizedState=$v,a1(null,s)):(Oa(t),p3(t,i))}var l=e.memoizedState;if(l!==null){var c=l.dehydrated;if(c!==null)return NG(e,t,i,a,s,c,l,n)}return r?(Da(),r=s.fallback,i=t.mode,l=e.child,c=l.sibling,s=So(l,{mode:"hidden",children:s.children}),s.subtreeFlags=l.subtreeFlags&1206910976,c!==null?r=So(c,r):(r=cc(r,i,n,null),r.flags|=2),r.return=t,s.return=t,s.sibling=r,t.child=s,a1(null,s),s=t.child,r=e.child.memoizedState,r===null?r=Av(n):(i=r.cachePool,i!==null?(l=dn._currentValue,i=i.parent!==l?{parent:l,pool:l}:i):i=JE(),r={baseLanes:r.baseLanes|n,cachePool:i}),s.memoizedState=r,s.childLanes=Mv(e,a,n),t.memoizedState=$v,a1(e.child,s)):(Oa(t),n=e.child,e=n.sibling,n=So(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=n,t.memoizedState=null,n)}function p3(e,t){return t=rm({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function rm(e,t){return e=Ds(22,e,null,t),e.lanes=0,e}function C0(e,t,n){return bc(t,e.child,null,n),e=p3(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function NG(e,t,n,s,r,i,a,l){if(n)return t.flags&256?(Oa(t),t.flags&=-257,C0(e,t,l)):t.memoizedState!==null?(Da(),t.child=e.child,t.flags|=128,null):(Da(),i=r.fallback,a=t.mode,r=rm({mode:"visible",children:r.children},a),i=cc(i,a,l,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,bc(t,e.child,null,l),r=t.child,r.memoizedState=Av(l),r.childLanes=Mv(e,s,l),t.memoizedState=$v,a1(null,r));if(Oa(t),$3(i)){if(s=i.nextSibling&&i.nextSibling.dataset,s)var c=s.dgst;return s=c,s!==""&&(r=Error(de(419)),r.stack="",r.digest=s,T1({value:r,source:null,stack:null})),C0(e,t,l)}if(fn||yc(e,t,l,!1),s=(l&e.childLanes)!==0,fn||s){if(Wa.current!==null)return C0(e,t,l);if(s=bt,s!==null&&(r=kE(s,l),r!==0&&r!==a.retryLane))throw a.retryLane=r,Dc(e,r),Hs(s,e,r),h3;return ek(i)||Bx(),C0(e,t,l)}return ek(i)?(t.flags|=192,t.child=e.child,null):(e=a.treeContext,Et=Rr(i.nextSibling),Rn=t,Ue=!0,Ra=null,Nr=!1,e!==null&&YE(t,e),t=p3(t,r.children),t.flags|=134221824,t)}function o8(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),rp(e.return,t,n)}function a8(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&$x(n)===null&&(t=e),e=e.sibling}return t}function E0(e,t,n,s,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r,treeForkCount:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=r,a.treeForkCount=i)}function I2(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 Tv(e,t,n){var s=t.pendingProps,r=s.revealOrder,i=s.tail;s=s.children;var a=Xn.current;if(t.flags&128)return N1(t,a),null;var l=(a&2)!==0;if(l?(a=a&1|2,t.flags|=128):a&=1,N1(t,a),r==="backwards"&&e!==null?(I2(e),gn(e,t,s,n),I2(e)):gn(e,t,s,n),s=Ue?M1:0,!l&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&o8(e,n,t);else if(e.tag===19)o8(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"backwards":n=a8(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null,I2(t)),E0(t,!0,r,null,i,s);break;case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&$x(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}E0(t,!0,n,null,i,s);break;case"together":E0(t,!1,null,null,void 0,s);break;case"independent":t.memoizedState=null;break;default:n=a8(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),E0(t,!1,r,n,i,s)}return t.child}function l8(e,t,n){var s=t.pendingProps;return $a(t,t.type,s.value),gn(e,t,s.children,n),t.child}function No(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xa|=t.lanes,!(n&t.childLanes))if(e!==null){if(yc(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(de(153));if(t.child!==null){for(e=t.child,n=So(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=So(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function x3(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Sx(e)))}function _G(e,t,n){switch(t.tag){case 3:gx(t,t.stateNode.containerInfo),$a(t,dn,e.memoizedState.cache),mc();break;case 27:case 5:sv(t);break;case 4:gx(t,t.stateNode.containerInfo);break;case 10:$a(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,kv(t),null;break;case 13:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return Oa(t),t.flags|=128,null;s=yc(e,t,n,!1);var r=t.child.childLanes;return s||n&r?V$(e,t,n):(Oa(t),e=No(e,t,n),e!==null?e.sibling:null)}Oa(t);break;case 19:if(t.flags&128)return Tv(e,t,n);if(r=(e.flags&128)!==0,s=(n&t.childLanes)!==0,s||(yc(e,t,n,!1),s=(n&t.childLanes)!==0),r){if(s)return Tv(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),N1(t,Xn.current),s)break;return null;case 22:return t.lanes=0,F$(e,t,n,t.pendingProps);case 24:$a(t,dn,e.memoizedState.cache)}return No(e,t,n)}function G$(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)fn=!0;else{if(!x3(e,n)&&!(t.flags&128))return fn=!1,_G(e,t,n);fn=!!(e.flags&131072)}else fn=!1,Ue&&t.flags&1048576&&ZE(t,M1,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=ml(t.elementType),t.type=e,typeof e=="function")W5(e)?(s=jc(e,s),t.tag=1,t=r8(null,t,e,s,n)):(t.tag=0,t=Ev(null,t,e,s,n));else{if(e!=null){var r=e.$$typeof;if(r===R5){t.tag=11,t=J7(null,t,e,s,n);break e}else if(r===I5){t.tag=14,t=e8(null,t,e,s,n);break e}else if(r===Ii){t.tag=10,t.type=e,t=l8(null,t,n);break e}}throw t=tv(e)||e,Error(de(306,t,""))}}return t;case 0:return Ev(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,r=jc(s,t.pendingProps),r8(e,t,s,r,n);case 3:e:{if(gx(t,t.stateNode.containerInfo),e===null)throw Error(de(387));s=t.pendingProps;var i=t.memoizedState;r=i.element,mv(e,t),i1(t,s,null,n);var a=t.memoizedState;if(s=a.cache,$a(t,dn,s),s!==i.cache&&xv(t,[dn],n,!0),r1(),s=a.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=i8(e,t,s,n);break e}else if(s!==r){r=zr(Error(de(424)),t),T1(r),t=i8(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Et=Rr(e.firstChild),Rn=t,Ue=!0,Ra=null,Nr=!0,n=n$(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(mc(),s===r){t=No(e,t,n);break e}gn(e,t,s,n)}t=t.child}return t;case 26:return ru(e,t),e===null?(n=_8(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ue||(t.stateNode=IA(t.type,t.pendingProps,_a.current,t)):t.memoizedState=_8(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return sv(t),e===null&&Ue&&(s=t.stateNode=FA(t.type,t.pendingProps,_a.current),Rn=t,Nr=!0,r=Et,nl(t.type)?(tk=r,Et=Rr(s.firstChild)):Et=r),gn(e,t,t.pendingProps.children,n),ru(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((r=s=Et)&&(s=$W(s,t.type,t.pendingProps,Nr),s!==null?(t.stateNode=s,Rn=t,Et=Rr(s.firstChild),Nr=!1,r=!0):r=!1),r||Ga(t)),sv(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,Yv(r,i)?s=null:a!==null&&Yv(r,a)&&(t.flags|=32),t.memoizedState!==null&&(r=n3(e,t,wG,null,null,n),$d._currentValue=r),ru(e,t),gn(e,t,s,n),t.child;case 6:return e===null&&Ue&&((e=n=Et)&&(n=AW(n,t.pendingProps,Nr),n!==null?(t.stateNode=n,Rn=t,Et=null,e=!0):e=!1),e||Ga(t)),null;case 13:return V$(e,t,n);case 4:return gx(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=bc(t,null,s,n):gn(e,t,s,n),t.child;case 11:return J7(e,t,t.type,t.pendingProps,n);case 7:return s=t.pendingProps,ru(e,t),gn(e,t,s,n),t.child;case 8:return gn(e,t,t.pendingProps.children,n),t.child;case 12:return gn(e,t,t.pendingProps.children,n),t.child;case 10:return l8(e,t,n);case 9:return r=t.type._context,s=t.pendingProps.children,vc(t),r=Wn(r),s=s(r),t.flags|=1,gn(e,t,s,n),t.child;case 14:return e8(e,t,t.type,t.pendingProps,n);case 15:return U$(e,t,t.type,t.pendingProps,n);case 19:return Tv(e,t,n);case 31:return zG(e,t,n);case 22:return F$(e,t,n,t.pendingProps);case 24:return vc(t),s=Wn(dn),e===null?(r=Z5(),r===null&&(r=bt,i=X5(),r.pooledCache=i,i.refCount++,i!==null&&(r.pooledCacheLanes|=n),r=i),t.memoizedState={parent:s,cache:r},Q5(t),$a(t,dn,r)):(e.lanes&n&&(mv(e,t),i1(t,null,null,n),r1()),r=e.memoizedState,i=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),$a(t,dn,s)):(s=i.cache,$a(t,dn,s),s!==r.cache&&xv(t,[dn],n,!0))),gn(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=t.pendingProps,s.name!=null&&s.name!=="auto"?t.flags|=e===null?18882560:18874368:Ue&&Qg(t),e!==null&&e.memoizedProps.name!==s.name?t.flags|=4194816:ru(e,t),gn(e,t,s.children,n),t.child;case 29:throw t.pendingProps}throw Error(de(156,t.tag))}function eo(e){e.flags|=4}function L2(e,t,n,s,r){var i;if((i=(e.mode&32)!==0)&&(i=n===null?L8(t,s):L8(t,s)&&(s.src!==n.src||s.srcSet!==n.srcSet)),i){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(bA())e.flags|=8192;else throw dc=Cx,Y5}else e.flags&=-16777217}function c8(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!KA(t))if(bA())e.flags|=8192;else throw dc=Cx,Y5}function $0(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?mE():536870912,e.lanes|=t,bd|=t)}function yf(e,t){if(!Ue)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.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 St(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&1206910976,s|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function RG(e,t,n){var s=t.pendingProps;switch(K5(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return St(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Co(dn),md(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Yc(t)?eo(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,z2())),St(t),null;case 26:var r=t.type,i=t.memoizedState;return e===null?(eo(t),i!==null?(St(t),c8(t,i)):(St(t),L2(t,r,null,s,n))):i?i!==e.memoizedState?(eo(t),St(t),c8(t,i)):(St(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&eo(t),St(t),L2(t,r,e,s,n)),null;case 27:if(mx(t),n=_a.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&eo(t);else{if(!s){if(t.stateNode===null)throw Error(de(166));return St(t),t.subtreeFlags&=-33554433,null}e=Hi.current,Yc(t)?L7(t):(e=FA(r,s,n),t.stateNode=e,eo(t))}return St(t),t.subtreeFlags&=-33554433,null;case 5:if(mx(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&eo(t);else{if(!s){if(t.stateNode===null)throw Error(de(166));return St(t),t.subtreeFlags&=-33554433,null}if(i=Hi.current,Yc(t))L7(t);else{var a=L1(_a.current);switch(i){case 1:i=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:i=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":i=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":i=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":i=a.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof s.is=="string"?a.createElement("select",{is:s.is}):a.createElement("select"),s.multiple?i.multiple=!0:s.size&&(i.size=s.size);break;default:i=typeof s.is=="string"?a.createElement(r,{is:s.is}):a.createElement(r)}}i[Gn]=t,i[Ps]=s;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)i.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=i;e:switch(Zn(i,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&eo(t)}}return St(t),t.subtreeFlags&=-33554433,L2(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&eo(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(de(166));if(e=_a.current,Yc(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,r=Rn,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[Gn]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||_A(e.nodeValue,n)),e||Ga(t,!0)}else e=L1(e).createTextNode(s),e[Gn]=t,t.stateNode=e}return St(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Yc(t),n!==null){if(e===null){if(!s)throw Error(de(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(de(557));e[Gn]=t}else mc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;St(t),e=!1}else n=z2(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ir(t),t):(ir(t),null);if(t.flags&128)throw Error(de(558))}return St(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Yc(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(de(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(de(317));r[Gn]=t}else mc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;St(t),r=!1}else r=z2(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ir(t),t):(ir(t),null)}return ir(t),t.flags&128?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==r&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),$0(t,t.updateQueue),St(t),null);case 4:return md(),e===null&&S3(t.stateNode.containerInfo),t.flags|=67108864,St(t),null;case 10:return Co(t.type),St(t),null;case 19:if(e3(t),s=t.memoizedState,s===null)return St(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)yf(s,!1);else{if(Qt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=$x(e),i!==null){for(t.flags|=128,yf(s,!1),e=i.updateQueue,t.updateQueue=e,$0(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)KE(n,e),n=n.sibling;return N1(t,Xn.current&1|2),Ue&&no(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&dr()>Ox&&(t.flags|=128,r=!0,yf(s,!1),t.lanes=4194304)}else{if(!r)if(e=$x(i),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,$0(t,e),yf(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!i.alternate&&!Ue)return St(t),null}else 2*dr()-s.renderingStartTime>Ox&&n!==536870912&&(t.flags|=128,r=!0,yf(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(e=s.last,e!==null?e.sibling=i:t.child=i,s.last=i)}if(s.tail!==null){e=s.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=dr(),e.sibling=null,i=Xn.current,i=r?i&1|2:i&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!n||Ue?N1(t,i):(n=i,At(Yn,t),At(Xn,n),ls===null&&(ls=t)),Ue&&no(t,s.treeForkCount),e}return St(t),null;case 22:case 23:return ir(t),J5(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),n=t.updateQueue,n!==null&&$0(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&Kn(uc),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Co(dn),St(t),null;case 25:return null;case 30:return t.flags|=33554432,St(t),null}throw Error(de(156,t.tag))}function IG(e,t){switch(K5(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Co(dn),md(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return mx(t),null;case 31:if(t.memoizedState!==null){if(ir(t),t.alternate===null)throw Error(de(340));mc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ir(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(de(340));mc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return e3(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 md(),null;case 10:return Co(t.type),null;case 22:case 23:return ir(t),J5(),e!==null&&Kn(uc),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Co(dn),null;case 25:return null;default:return null}}function W$(e,t){switch(K5(t),t.tag){case 3:Co(dn),md();break;case 26:case 27:case 5:mx(t);break;case 4:md();break;case 31:t.memoizedState!==null&&ir(t);break;case 13:ir(t);break;case 19:e3(t);break;case 10:Co(t.type);break;case 22:case 23:ir(t),J5(),e!==null&&Kn(uc);break;case 24:Co(dn)}}function Rh(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){s=void 0;var i=n.create,a=n.inst;s=i(),a.destroy=s}n=n.next}while(n!==r)}}catch(l){ht(t,t.return,l)}}function Ka(e,t,n){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var i=r.next;s=i;do{if((s.tag&e)===e){var a=s.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){ht(r,c,d)}}}s=s.next}while(s!==i)}}catch(d){ht(t,t.return,d)}}function K$(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{r$(t,n)}catch(s){ht(e,e.return,s)}}}function X$(e,t,n){n.props=jc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){ht(e,t,s)}}function Ti(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var r=e.stateNode,i=Mo(e.memoizedProps,r);(r.ref===null||r.ref.name!==i)&&(r.ref=DA(i)),s=r.ref;break;case 7:if(e.stateNode===null){var a=new yr(e);qs(e.child,!1,CW,a,void 0,void 0),e.stateNode=a}s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(l){ht(e,t,l)}}function Vn(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(r){ht(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){ht(e,t,r)}else n.current=null}function Nx(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++)PA(e.stateNode,t[n])}function u8(e){for(var t=e.return;t!==null&&(m3(t)&&PA(e.stateNode,t.stateNode),!g3(t));)t=t.return}function l1(e){for(var t=e.return;t!==null&&(m3(t)&&EW(e.stateNode,t.stateNode),!g3(t));)t=t.return}function g3(e){return e.tag===5||e.tag===3||e.tag===27}function m3(e){return e&&e.tag===7&&e.stateNode!==null}function zv(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(r){ht(e,e.return,r)}}function O2(e,t,n){try{var s=e.stateNode;aW(s,e.type,n,t),s[Ps]=t}catch(r){ht(e,e.return,r)}}function Z$(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nl(e.type)||e.tag===4}function D2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Z$(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&&nl(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 Nv(e,t,n,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(r,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(r),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Li)),Nx(e,s),tt=!0;else if(r!==4&&(r===27&&(Nx(e,s),s=null,nl(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Nv(e,t,n,s),e=e.sibling;e!==null;)Nv(e,t,n,s),e=e.sibling}function _x(e,t,n,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?n.insertBefore(r,t):n.appendChild(r),Nx(e,s),tt=!0;else if(r!==4&&(r===27&&(Nx(e,s),s=null,nl(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(_x(e,t,n,s),e=e.sibling;e!==null;)_x(e,t,n,s),e=e.sibling}function Y$(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Zn(t,s,n),t[Gn]=e,t[Ps]=n}catch(i){ht(e,e.return,i)}}var Rx=!1,ar=null;function d8(e){(e.tag===30||e.subtreeFlags&33554432)&&(Rx=!0)}var _i=null;function f8(){var e=_i;return _i=null,e}var Os=0;function Vd(e,t,n,s,r){return Os=0,Q$(e.child,t,n,s,r)}function Q$(e,t,n,s,r){for(var i=!1;e!==null;){if(e.tag===5){var a=e.stateNode;if(s!==null){var l=Qv(a);s.push(l),l.view&&(i=!0)}else i||Qv(a).view&&(i=!0);Rx=!0,LA(a,Os===0?t:t+"_"+Os,n),Os++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||Q$(e.child,t,n,s,r)&&(i=!0));e=e.sibling}return i}function Ui(e,t){for(;e!==null;)e.tag===5?OA(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ui(e.child,t)),e=e.sibling}function cp(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(cp(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(de(544));var n=t.name;t=Oo(t.default,t.share),t!=="none"&&(Vd(e,n,t,null,!1)||Ui(e.child,!1))}e=e.sibling}}function _v(e,t){if(e.tag===30){var n=e.stateNode,s=e.memoizedProps,r=Mo(s,n),i=Oo(s.default,n.paired?s.share:s.enter);i!=="none"?Vd(e,r,i,null,!1)?(cp(e),n.paired||t||wd(e,s.onEnter)):Ui(e.child,!1):cp(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)_v(e,t),e=e.sibling;else cp(e)}function Rv(e){if(ar!==null&&ar.size!==0){var t=ar;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,s=n.name;if(s!=null&&s!=="auto"){var r=t.get(s);if(r!==void 0){var i=Oo(n.default,n.share);if(i!=="none"&&(Vd(e,s,i,null,!1)?(i=e.stateNode,r.paired=i,i.paired=r,wd(e,n.onShare)):Ui(e.child,!1)),t.delete(s),t.size===0)break}}}Rv(e)}e=e.sibling}}}function Iv(e){if(e.tag===30){var t=e.memoizedProps,n=Mo(t,e.stateNode),s=ar!==null?ar.get(n):void 0,r=Oo(t.default,s!==void 0?t.share:t.exit);r!=="none"&&(Vd(e,n,r,null,!1)?s!==void 0?(r=e.stateNode,s.paired=r,r.paired=s,ar.delete(n),wd(e,t.onShare)):wd(e,t.onExit):Ui(e.child,!1)),ar!==null&&Rv(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Iv(e),e=e.sibling;else ar!==null&&Rv(e)}function J$(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Mo(t,e.stateNode);t=Oo(t.default,t.update),e.flags&=-5,t!=="none"&&Vd(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&J$(e);e=e.sibling}}function Lv(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,Ui(e.child,!1))}Lv(e)}e=e.sibling}}function up(e){if(e.tag===30)e.stateNode.paired=null,Ui(e.child,!1),Lv(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)up(e),e=e.sibling;else Lv(e)}function eA(e){for(e=e.child;e!==null;)e.tag===30?Ui(e.child,!1):e.subtreeFlags&33554432&&eA(e),e=e.sibling}function y3(e,t,n,s,r,i,a){for(var l=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(i!==null&&Os<i.length){var u=i[Os],d=Qv(c);(u.view||d.view)&&(l=!0);var f;if(f=(e.flags&4)===0)if(d.clip)f=!0;else{f=u.rect;var p=d.rect;f=f.y!==p.y||f.x!==p.x||f.height!==p.height||f.width!==p.width}f&&(e.flags|=4),d.abs?d=!u.abs:(u=u.rect,d=d.rect,d=u.height!==d.height||u.width!==d.width),d&&(e.flags|=32)}else e.flags|=32;e.flags&4&&LA(c,Os===0?n:n+"_"+Os,r),l&&e.flags&4||(_i===null&&(_i=[]),_i.push(c,Os===0?s:s+"_"+Os,t.memoizedProps)),Os++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&a?e.flags|=t.flags&32:y3(e,t.child,n,s,r,i,a)&&(l=!0));t=t.sibling}return l}function tA(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,s=e.stateNode,r=Mo(n,s),i=Oo(n.default,n.update),a;a=e.memoizedState,e.memoizedState=null,s=e;var l=e.child;Os=0,r=y3(s,l,r,r,i,a,!1),e.flags&4&&r&&wd(e,n.onUpdate)}else e.subtreeFlags&33554432&&tA(e);e=e.sibling}}var Tn=!1,ct=!1,hi=!1,B2=!1,h8=typeof WeakSet=="function"?WeakSet:Set,zn=null,pi=!1,Of=!1,Ix=!1,Ov=!1;function LG(e,t,n){if(e=e.containerInfo,Xv=Ad,e=HE(e),F5(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{s.nodeType,a.nodeType}catch{s=null;break e}var l=0,c=-1,u=-1,d=0,f=0,p=e,x=null;t:for(;;){for(var g;p!==s||i!==0&&p.nodeType!==3||(c=l+i),p!==a||r!==0&&p.nodeType!==3||(u=l+r),p.nodeType===3&&(l+=p.nodeValue.length),(g=p.firstChild)!==null;)x=p,p=g;for(;;){if(p===e)break t;if(x===s&&++d===i&&(c=l),x===a&&++f===r&&(u=l),(g=p.nextSibling)!==null)break;p=x,x=p.parentNode}p=g}s=c===-1||u===-1?null:{start:c,end:u}}else s=null}s=s||{start:0,end:0}}else s=null;for(Zv={focusedElem:e,selectionRange:s},Ad=!1,n=(n&335544064)===n,zn=t,t=n?9270:1024;zn!==null;){if(e=zn,n&&(s=e.deletions,s!==null))for(i=0;i<s.length;i++)n&&Iv(s[i]);if(e.alternate===null&&e.flags&2)n&&d8(e),A0(n);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&n&&Iv(s),A0(n);continue}else if(s!==null&&s.memoizedState!==null){n&&d8(e),A0(n);continue}}s=e.child,e.subtreeFlags&t&&s!==null?(s.return=e,zn=s):(n&&J$(e),A0(n))}}ar=null}function A0(e){for(;zn!==null;){var t=zn,n=e,s=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(r&1024&&s!==null){n=void 0,r=s.memoizedProps,s=s.memoizedState;var i=t.stateNode;try{var a=jc(t.type,r);n=i.getSnapshotBeforeUpdate(a,s),i.__reactInternalSnapshotBeforeUpdate=n}catch(l){ht(t,t.return,l)}}break;case 3:if(r&1024){if(s=t.stateNode.containerInfo,n=s.nodeType,n===9)Jv(s);else if(n===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Jv(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&s!==null&&(n=Mo(s.memoizedProps,s.stateNode),r=t.memoizedProps,r=Oo(r.default,r.update),r!=="none"&&Vd(s,n,r,s.memoizedState=[],!0));break;default:if(r&1024)throw Error(de(163))}if(s=t.sibling,s!==null){s.return=t.return,zn=s;break}zn=t.return}}function nA(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:xi(e,n),s&4&&Rh(5,n);break;case 1:if(xi(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(a){ht(n,n.return,a)}else{var r=jc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){ht(n,n.return,a)}}s&64&&K$(n),s&512&&Ti(n,n.return);break;case 3:if(xi(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{r$(e,t)}catch(a){ht(n,n.return,a)}}break;case 27:t===null&&s&4&&Y$(n);case 26:case 5:xi(e,n),t===null&&s&4&&zv(n),s&512&&Ti(n,n.return);break;case 12:xi(e,n);break;case 31:xi(e,n),s&4&&oA(e,n);break;case 13:xi(e,n),s&4&&aA(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=KG.bind(null,n),MW(e,n))));break;case 22:if(s=n.memoizedState!==null||Tn,!s){var i=t!==null&&t.memoizedState!==null||ct;t=Tn,r=ct,Tn=s,(ct=i)&&!r?(s=2,n.subtreeFlags&8772&&(s|=1),Kr(e,n,s)):xi(e,n),Tn=t,ct=r}break;case 30:xi(e,n),s&512&&Ti(n,n.return);break;case 7:s&512&&Ti(n,n.return);default:xi(e,n)}}function Dv(e,t){for(e=e.child;e!==null;)sA(e,t),e=e.sibling}function sA(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var s=n.style;typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"}else{var r=e.stateNode,i=e.memoizedProps.style,a=i!=null&&i.hasOwnProperty("display")?i.display:null;r.style.display=a==null||typeof a=="boolean"?"":(""+a).trim()}}catch(c){ht(e,e.return,c)}Bv(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,tt=!0}catch(c){ht(e,e.return,c)}break;case 18:try{var l=e.stateNode;t?$8(l,!0):$8(e.stateNode,!1)}catch(c){ht(e,e.return,c)}break;case 22:case 23:e.memoizedState===null&&Dv(e,t);break;default:Dv(e,t)}}function Bv(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,s=t;switch(n.tag){case 4:sA(n,s);break e;case 22:n.memoizedState===null&&Bv(n,s);break e;default:Bv(n,s)}}e=e.sibling}}function rA(e){var t=e.alternate;t!==null&&(e.alternate=null,rA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Gg(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 Lt=null,Rs=!1;function Wr(e,t,n){for(n=n.child;n!==null;)iA(e,t,n),n=n.sibling}function iA(e,t,n){if(fr&&typeof fr.onCommitFiberUnmount=="function")try{fr.onCommitFiberUnmount($h,n)}catch{}switch(n.tag){case 26:ct||Vn(n,t),Wr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ct&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ct||Vn(n,t),l1(n);var s=Lt,r=Rs;nl(n.type)&&(Lt=n.stateNode,Rs=!1),Wr(e,t,n),VA(n.stateNode,n.type,n.memoizedProps),Lt=s,Rs=r;break;case 5:ct||Vn(n,t),l1(n);case 6:if(n.tag===6&&l1(n),s=Lt,r=Rs,Lt=null,Wr(e,t,n),Lt=s,Rs=r,Lt!==null)if(Rs)try{(Lt.nodeType===9?Lt.body:Lt.nodeName==="HTML"?Lt.ownerDocument.body:Lt).removeChild(n.stateNode),tt=!0}catch(i){ht(n,t,i)}else try{Lt.removeChild(n.stateNode),tt=!0}catch(i){ht(n,t,i)}break;case 18:Lt!==null&&(Rs?(e=Lt,E8(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Md(e)):E8(Lt,n.stateNode));break;case 4:s=Lt,r=Rs,Lt=n.stateNode.containerInfo,Rs=!0,Wr(e,t,n),Lt=s,Rs=r;break;case 0:case 11:case 14:case 15:Ka(2,n,t),ct||Ka(4,n,t),Wr(e,t,n);break;case 1:ct||(Vn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&X$(n,t,s)),Wr(e,t,n);break;case 21:Wr(e,t,n);break;case 22:ct=(s=ct)||n.memoizedState!==null,Wr(e,t,n),ct=s;break;case 30:Vn(n,t),Wr(e,t,n);break;case 7:ct||Vn(n,t),Wr(e,t,n);break;default:Wr(e,t,n)}}function oA(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Md(e)}catch(n){ht(t,t.return,n)}}}function aA(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Md(e)}catch(n){ht(t,t.return,n)}}function OG(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new h8),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new h8),t;default:throw Error(de(435,e.tag))}}function M0(e,t){var n=OG(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var r=XG.bind(null,e,s);s.then(r,r)}})}function ms(e,t,n){var s=t.deletions;if(s!==null)for(var r=0;r<s.length;r++){var i=s[r],a=e,l=t,c=l;e:for(;c!==null;){switch(c.tag){case 27:if(nl(c.type)){Lt=c.stateNode,Rs=!1;break e}break;case 5:Lt=c.stateNode,Rs=!1;break e;case 3:case 4:Lt=c.stateNode.containerInfo,Rs=!0;break e}c=c.return}if(Lt===null)throw Error(de(160));iA(a,l,i),Lt=null,Rs=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)lA(t,e,n),t=t.sibling}var Jr=null;function lA(e,t,n){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(s=e.updateQueue,s=s!==null?s.events:null,s!==null))for(var i=0;i<s.length;i++){var a=s[i];a.ref.impl=a.nextImpl}ms(t,e,n),ys(e),r&4&&(Ka(3,e,e.return),Rh(3,e),Ka(5,e,e.return));break;case 1:ms(t,e,n),ys(e),r&512&&(ct||s===null||Vn(s,s.return)),r&64&&Tn&&(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(i=Jr,ms(t,e,n),ys(e),r&512&&(ct||s===null||Vn(s,s.return)),r&4)if(r=s!==null?s.memoizedState:null,n=e.memoizedState,s===null)if(n===null)if(e.stateNode===null)if(Tn)e.stateNode=IA(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,r=i.ownerDocument||i;t:switch(t){case"title":s=r.getElementsByTagName("title")[0],(!s||s[Th]||s[Gn]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(t),r.head.insertBefore(s,r.querySelector("head > title"))),Zn(s,t,n),s[Gn]=e,Nn(s),t=s;break e;case"link":if(i=I8("link","href",r).get(t+(n.href||""))){for(a=0;a<i.length;a++)if(s=i[a],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(a,1);break t}}s=r.createElement(t),Zn(s,t,n),r.head.appendChild(s);break;case"meta":if(i=I8("meta","content",r).get(t+(n.content||""))){for(a=0;a<i.length;a++)if(s=i[a],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(a,1);break t}}s=r.createElement(t),Zn(s,t,n),r.head.appendChild(s);break;default:throw Error(de(468,t))}s[Gn]=e,Nn(s),t=s}e.stateNode=t}else Tn||nk(i,e.type,e.stateNode);else e.stateNode=R8(i,n,e.memoizedProps);else r!==n?(r===null?(t=s.stateNode,t===null||ct||t.parentNode.removeChild(t)):r.count--,n===null?Tn||nk(i,e.type,e.stateNode):R8(i,n,e.memoizedProps)):n===null&&e.stateNode!==null&&O2(e,e.memoizedProps,s.memoizedProps);break;case 27:ms(t,e,n),ys(e),r&512&&(ct||s===null||Vn(s,s.return)),s!==null&&r&4&&O2(e,e.memoizedProps,s.memoizedProps);break;case 5:if(i=hi,hi=!1,ms(t,e,n),hi=i,ys(e),r&512&&(ct||s===null||Vn(s,s.return)),e.flags&32){t=e.stateNode;try{vd(t,""),tt=!0}catch(d){ht(e,e.return,d)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,O2(e,t,s!==null?s.memoizedProps:t)),r&1024&&(B2=!0);break;case 6:if(ms(t,e,n),ys(e),r&4){if(e.stateNode===null)throw Error(de(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,tt=!0}catch(d){ht(e,e.return,d)}}break;case 3:if(tt=!1,pp=null,i=Jr,Jr=O1(t.containerInfo),ms(t,e,n),Jr=i,ys(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{Md(t.containerInfo)}catch(d){ht(e,e.return,d)}B2&&(B2=!1,cA(e)),tt=!1;break;case 4:r=hi,hi=Tn,s=y7(),i=Jr,Jr=O1(e.stateNode.containerInfo),ms(t,e,n),ys(e),Jr=i,tt&&Of&&(Ix=!0),tt=s,hi=r;break;case 12:ms(t,e,n),ys(e);break;case 31:ms(t,e,n),ys(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,M0(e,t)));break;case 13:ms(t,e,n),ys(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(im=dr()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,M0(e,t)));break;case 22:i=e.memoizedState!==null,a=s!==null&&s.memoizedState!==null;var l=Tn,c=ct,u=hi;Tn=l||i,hi=u||i,ct=c||a,ms(t,e,n),ct=c,hi=u,Tn=l,ys(e),r&8192&&(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,!i||s===null||a||Tn||ct||(t=a||ct,n=Tn,s=ct,Tn=i||Tn,ct=t,Yo(e,2),Tn=n,ct=s),!i&&hi||Dv(e,i)),r&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,M0(e,n))));break;case 19:ms(t,e,n),ys(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,M0(e,t)));break;case 30:r&512&&(ct||s===null||Vn(s,s.return)),r=y7(),i=Of,a=(n&335544064)===n,l=e.memoizedProps,Of=a&&Oo(l.default,l.update)!=="none",ms(t,e,n),ys(e),a&&s!==null&&tt&&(e.flags|=4),Of=i,tt=r;break;case 21:break;case 7:r&512&&(ct||s===null||Vn(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:ms(t,e,n),ys(e)}}function ys(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(Z$(s)){n=s;break}s=s.return}s=null;for(var r=e.return;r!==null;){if(m3(r)){var i=r.stateNode;s===null?s=[i]:s.push(i)}if(g3(r))break;r=r.return}var a=s;if(n==null)throw Error(de(160));switch(n.tag){case 27:var l=n.stateNode,c=D2(e);_x(e,c,l,a);break;case 5:var u=n.stateNode;n.flags&32&&(vd(u,""),n.flags&=-33);var d=D2(e);_x(e,d,u,a);break;case 3:case 4:var f=n.stateNode.containerInfo,p=D2(e);Nv(e,p,f,a);break;default:throw Error(de(161))}}catch(x){ht(e,e.return,x)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function cA(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;cA(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ad=!0,t.reset(),Ad=!1),e=e.sibling}}function Qc(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)uA(t,e),t=t.sibling;else tA(t)}function uA(e,t){var n=e.alternate;if(n===null)_v(e,!1);else switch(e.tag){case 3:if(Ov=pi=!1,f8(),Qc(t,e),!pi&&!Ix){if(e=_i,e!==null)for(var s=0;s<e.length;s+=3){n=e[s];var r=e[s+1];OA(n,e[s+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}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"})),Ov=!0}_i=null;break;case 5:Qc(t,e);break;case 4:s=pi,pi=!1,Qc(t,e),pi&&(Ix=!0),pi=s;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?_v(e,!1):Qc(t,e));break;case 30:s=pi,r=f8(),pi=!1,Qc(t,e),pi&&(e.flags|=4);var i=e.memoizedProps,a=e.stateNode;t=Mo(i,a),a=Mo(n.memoizedProps,a);var l=Oo(i.default,i.update);l==="none"?t=!1:(i=n.memoizedState,n.memoizedState=null,n=e.child,Os=0,t=y3(e,n,t,a,l,i,!0),Os!==(i===null?0:i.length)&&(e.flags|=32)),e.flags&4&&t?(wd(e,e.memoizedProps.onUpdate),_i=r):r!==null&&(r.push.apply(r,_i),_i=r),pi=e.flags&32?!0:s;break;default:Qc(t,e)}}function xi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nA(e,t.alternate,t),t=t.sibling}function Yo(e,t){for(e=e.child;e!==null;){var n=e,s=t;switch(n.tag){case 0:case 11:case 14:case 15:Ka(4,n,n.return),Yo(n,s);break;case 1:Vn(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&X$(n,n.return,r),Yo(n,s);break;case 27:s&2&&VA(n.stateNode,n.type,n.memoizedProps);case 5:Vn(n,n.return),n.tag!==5&&n.tag!==27||l1(n),Yo(n,s);break;case 6:l1(n);break;case 26:Vn(n,n.return),r=n.stateNode,n.memoizedState!==null||r===null||ct||r.parentNode.removeChild(r),Yo(n,s);break;case 22:n.memoizedState===null&&Yo(n,s);break;case 30:Vn(n,n.return),Yo(n,s);break;case 7:Vn(n,n.return);default:Yo(n,s)}e=e.sibling}}function Kr(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var s=t.alternate,r=e,i=t,a=i.flags,l=(n&1)!==0;switch(i.tag){case 0:case 11:case 15:Kr(r,i,n),Rh(4,i);break;case 1:if(Kr(r,i,n),s=i,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(d){ht(s,s.return,d)}if(s=i,r=s.updateQueue,r!==null){var c=s.stateNode;try{var u=r.shared.hiddenCallbacks;if(u!==null)for(r.shared.hiddenCallbacks=null,r=0;r<u.length;r++)s$(u[r],c)}catch(d){ht(s,s.return,d)}}l&&a&64&&K$(i),Ti(i,i.return);break;case 27:n&2&&Y$(i);case 5:i.tag!==5&&i.tag!==27||u8(i),Kr(r,i,n),l&&s===null&&a&4&&zv(i),Ti(i,i.return);break;case 6:u8(i);break;case 26:c=i.stateNode,i.memoizedState!==null||c===null||Tn||nk(O1(c.ownerDocument),i.type,c),Kr(r,i,n),l&&s===null&&a&4&&zv(i),Ti(i,i.return);break;case 12:Kr(r,i,n);break;case 31:Kr(r,i,n),l&&a&4&&oA(r,i);break;case 13:Kr(r,i,n),l&&a&4&&aA(r,i);break;case 22:i.memoizedState===null&&Kr(r,i,n),Ti(i,i.return);break;case 30:Kr(r,i,n),Ti(i,i.return);break;case 7:Ti(i,i.return);default:Kr(r,i,n)}t=t.sibling}}function v3(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&&Nh(n))}function k3(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Nh(e))}function kr(e,t,n,s){var r=(n&335544064)===n;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)dA(e,t,n,s),t=t.sibling;else r&&eA(t)}function dA(e,t,n,s){var r=(n&335544064)===n;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&up(t);var i=t.flags;switch(t.tag){case 0:case 11:case 15:kr(e,t,n,s),i&2048&&Rh(9,t);break;case 1:kr(e,t,n,s);break;case 3:kr(e,t,n,s),r&&Ov&&(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="")),i&2048&&(i=null,t.alternate!==null&&(i=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==i&&(t.refCount++,i!=null&&Nh(i)));break;case 12:if(i&2048){kr(e,t,n,s),i=t.stateNode;try{var a=t.memoizedProps,l=a.id,c=a.onPostCommit;typeof c=="function"&&c(l,t.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(u){ht(t,t.return,u)}}else kr(e,t,n,s);break;case 31:kr(e,t,n,s);break;case 13:kr(e,t,n,s);break;case 23:break;case 22:a=t.stateNode,l=t.alternate,t.memoizedState!==null?(r&&l!==null&&l.memoizedState===null&&up(l),a._visibility&2?kr(e,t,n,s):c1(e,t)):(r&&l!==null&&l.memoizedState!==null&&up(t),a._visibility&2?kr(e,t,n,s):(a._visibility|=2,iu(e,t,n,s,(t.subtreeFlags&10256)!==0||!1))),i&2048&&v3(l,t);break;case 24:kr(e,t,n,s),i&2048&&k3(t.alternate,t);break;case 30:r&&(i=t.alternate,i!==null&&(Ui(i.child,!0),Ui(t.child,!0))),kr(e,t,n,s);break;default:kr(e,t,n,s)}}function iu(e,t,n,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,a=t,l=n,c=s,u=a.flags;switch(a.tag){case 0:case 11:case 15:iu(i,a,l,c,r),Rh(8,a);break;case 23:break;case 22:var d=a.stateNode;a.memoizedState!==null?d._visibility&2?iu(i,a,l,c,r):c1(i,a):(d._visibility|=2,iu(i,a,l,c,r)),r&&u&2048&&v3(a.alternate,a);break;case 24:iu(i,a,l,c,r),r&&u&2048&&k3(a.alternate,a);break;default:iu(i,a,l,c,r)}t=t.sibling}}function c1(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,r=s.flags;switch(s.tag){case 22:c1(n,s),r&2048&&v3(s.alternate,s);break;case 24:c1(n,s),r&2048&&k3(s.alternate,s);break;default:c1(n,s)}t=t.sibling}}var yl=8192;function fl(e,t,n){if(e.subtreeFlags&yl)for(e=e.child;e!==null;)fA(e,t,n),e=e.sibling}function fA(e,t,n){switch(e.tag){case 26:fl(e,t,n),e.flags&yl&&(e.memoizedState!==null?UW(n,Jr,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&O8(n,e)));break;case 5:fl(e,t,n),e.flags&yl&&(e=e.stateNode,(t&335544128)===t&&O8(n,e));break;case 3:case 4:var s=Jr;Jr=O1(e.stateNode.containerInfo),fl(e,t,n),Jr=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=yl,yl=16777216,fl(e,t,n),yl=s):fl(e,t,n));break;case 30:if(e.flags&yl&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var r=e.stateNode;r.paired=null,ar===null&&(ar=new Map),ar.set(s,r)}fl(e,t,n);break;default:fl(e,t,n)}}function hA(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 vf(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];zn=s,xA(s,e)}hA(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)pA(e),e=e.sibling}function pA(e){switch(e.tag){case 0:case 11:case 15:vf(e),e.flags&2048&&Ka(9,e,e.return);break;case 3:vf(e);break;case 12:vf(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,dp(e)):vf(e);break;default:vf(e)}}function dp(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];zn=s,xA(s,e)}hA(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ka(8,t,t.return),dp(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,dp(t));break;default:dp(t)}e=e.sibling}}function xA(e,t){for(;zn!==null;){var n=zn;switch(n.tag){case 0:case 11:case 15:Ka(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Nh(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,zn=s;else e:for(n=e;zn!==null;){s=zn;var r=s.sibling,i=s.return;if(rA(s),s===n){zn=null;break e}if(r!==null){r.return=i,zn=r;break e}zn=i}}}var DG={getCacheForType:function(e){var t=Wn(dn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Wn(dn).controller.signal}},BG=typeof WeakMap=="function"?WeakMap:Map,rt=0,bt=null,We=null,Ke=0,dt=0,nr=null,Aa=!1,Gd=!1,b3=!1,_o=0,Qt=0,Xa=0,fc=0,Lx=0,lr=0,bd=0,u1=null,Is=null,Hv=!1,im=0,gA=0,Ox=1/0,Dx=null,Ba=null,Ut=0,si=null,Sc=null,qi=0,qv=0,Pv=null,mA=null,Bu=null,Hu=null,qu=null,d1=0,fp=null;function pr(){return rt&2&&Ke!==0?Ke&-Ke:Ne.T!==null?j3():bE()}function yA(){if(lr===0)if(!(Ke&536870912)||Ue){var e=y0;y0<<=1,!(y0&3932160)&&(y0=262144),lr=e}else lr=536870912;return e=Yn.current,e!==null&&(e.flags|=32),lr}function wd(e,t){if(t!=null){var n=e.stateNode,s=n.ref;s===null&&(s=n.ref=DA(Mo(e.memoizedProps,n))),Hu===null&&(Hu=[]),Hu.push(t.bind(null,s))}}function Hs(e,t,n){(e===bt&&(dt===2||dt===9)||e.cancelPendingCommit!==null)&&(jd(e,0),Ma(e,Ke,lr,!1)),Mh(e,n),(!(rt&2)||e!==bt)&&(e===bt&&(!(rt&2)&&(fc|=n),Qt===4&&Ma(e,Ke,lr,!1)),Xi(e))}function vA(e,t,n){if(rt&6)throw Error(de(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ah(e,t),r=s?PG(e,t):H2(e,t,!0),i=s;do{if(r===0){Gd&&!s&&Ma(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!HG(n)){r=H2(e,t,!1),i=!1;continue}if(r===2){if(i=t,e.errorRecoveryDisabledLanes&i)var a=0;else a=e.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){t=a;e:{var l=e;r=u1;var c=l.current.memoizedState.isDehydrated;if(c&&(jd(l,a).flags|=256),a=H2(l,a,!1),a!==2&&a!==6){if(b3&&!c){l.errorRecoveryDisabledLanes|=i,fc|=i,r=4;break e}i=Is,Is=r,i!==null&&(Is===null?Is=i:Is.push.apply(Is,i))}r=a}if(i=!1,r!==2)continue}}if(r===1){jd(e,0),Ma(e,t,0,!0);break}e:{switch(s=e,i=r,i){case 0:case 1:throw Error(de(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ma(s,t,lr,!Aa);break e;case 2:Is=null;break;case 3:case 5:break;default:throw Error(de(329))}if((t&62914560)===t&&(r=im+300-dr(),10<r)){if(Ma(s,t,lr,!Aa),Vg(s,0,!0)!==0)break e;qi=t,s.timeoutHandle=C3(p8.bind(null,s,n,Is,Dx,Hv,t,lr,fc,bd,Aa,i,"Throttled",-0,0),r);break e}p8(s,n,Is,Dx,Hv,t,lr,fc,bd,Aa,i,null,-0,0)}}break}while(!0);Xi(e)}function p8(e,t,n,s,r,i,a,l,c,u,d,f,p,x){e.timeoutHandle=-1;var g=t.subtreeFlags,v=(i&335544064)===i;if(f=null,(v||g&8192||(g&16785408)===16785408)&&(f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Li},ar=null,fA(t,i,f),v&&(g=f,v=e.containerInfo,v=(v.nodeType===9?v:v.ownerDocument).__reactViewTransition,v!=null&&(g.count++,g.waitingForViewTransition=!0,g=D1.bind(g),v.finished.then(g,g))),g=(i&62914560)===i?im-dr():(i&4194048)===i?gA-dr():0,g=FW(f,g),g!==null)){qi=i,e.cancelPendingCommit=g(g8.bind(null,e,t,i,n,s,r,a,l,c,u,d,f,null,p,x)),Ma(e,i,a,!u);return}g8(e,t,i,n,s,r,a,l,c,u,d,f)}function HG(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 s=0;s<n.length;s++){var r=n[s],i=r.getSnapshot;r=r.value;try{if(!gr(i(),r))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 Ma(e,t,n,s){t=gE(e,t),t&=~Lx,t&=~fc,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var i=31-hr(r),a=1<<i;s[i]=-1,r&=~a}n!==0&&yE(e,n,t)}function om(){return rt&6?!0:(Ih(0),!1)}function w3(){if(We!==null){if(dt===0)var e=We.return;else e=We,yo=Bc=null,i3(e),Lu=null,z1=0,e=We;for(;e!==null;)W$(e.alternate,e),e=e.return;We=null}}function jd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,uW(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),qi=0,w3(),bt=e,We=n=So(e.current,null),Ke=t,dt=0,nr=null,Aa=!1,Gd=Ah(e,t),b3=!1,bd=lr=Lx=fc=Xa=Qt=0,Is=u1=null,Hv=!1,_o=gE(e,t),Zg(),n}function kA(e,t){Be=null,Ne.H=Tx,t===Fd||t===Jg?(t=q7(),dt=3):t===Y5?(t=q7(),dt=4):dt=t===h3?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,nr=t,We===null&&(Qt=1,zx(e,zr(t,e.current)))}function bA(){var e=Yn.current;return e===null?!0:(Ke&4194048)===Ke?ls===null:(Ke&62914560)===Ke||Ke&536870912?e===ls:!1}function wA(){var e=Ne.H;return Ne.H=Tx,e===null?Tx:e}function jA(){var e=Ne.A;return Ne.A=DG,e}function Bx(){Qt=4,Aa||(Ke&4194048)!==Ke&&Yn.current!==null||(Gd=!0),!(Xa&134217727)&&!(fc&134217727)||bt===null||Ma(bt,Ke,lr,!1)}function H2(e,t,n){var s=rt;rt|=2;var r=wA(),i=jA();(bt!==e||Ke!==t)&&(Dx=null,jd(e,t)),t=!1;var a=Qt;e:do try{if(dt!==0&&We!==null){var l=We,c=nr;switch(dt){case 8:w3(),a=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(t=!0);var u=dt;if(dt=0,nr=null,Eu(e,l,c,u),n&&Gd){a=0;break e}break;default:u=dt,dt=0,nr=null,Eu(e,l,c,u)}}qG(),a=Qt;break}catch(d){kA(e,d)}while(!0);return t&&e.shellSuspendCounter++,yo=Bc=null,rt=s,Ne.H=r,Ne.A=i,We===null&&(bt=null,Ke=0,Zg()),a}function qG(){for(;We!==null;)SA(We)}function PG(e,t){var n=rt;rt|=2;var s=wA(),r=jA();bt!==e||Ke!==t?(Dx=null,Ox=dr()+500,jd(e,t)):Gd=Ah(e,t);e:do try{if(dt!==0&&We!==null){t=We;var i=nr;t:switch(dt){case 1:dt=0,nr=null,Eu(e,t,i,1);break;case 2:case 9:if(H7(i)){dt=0,nr=null,x8(t);break}t=function(){dt!==2&&dt!==9||bt!==e||(dt=7),Xi(e)},i.then(t,t);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:H7(i)?(dt=0,nr=null,x8(t)):(dt=0,nr=null,Eu(e,t,i,7));break;case 5:var a=null;switch(We.tag){case 26:a=We.memoizedState;case 5:case 27:var l=We;if(a?KA(a):l.stateNode.complete){dt=0,nr=null;var c=l.sibling;if(c!==null)We=c;else{var u=l.return;u!==null?(We=u,am(u)):We=null}break t}}dt=0,nr=null,Eu(e,t,i,5);break;case 6:dt=0,nr=null,Eu(e,t,i,6);break;case 8:w3(),Qt=6;break e;default:throw Error(de(462))}}UG();break}catch(d){kA(e,d)}while(!0);return yo=Bc=null,Ne.H=s,Ne.A=r,rt=n,We!==null?0:(bt=null,Ke=0,Zg(),Qt)}function UG(){for(;We!==null&&!oV();)SA(We)}function SA(e){var t=G$(e.alternate,e,_o);e.memoizedProps=e.pendingProps,t===null?am(e):We=t}function x8(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=s8(n,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=s8(n,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:i3(t);var s=t;s===Rn&&(Ue?(jx(s),s.tag===5&&s.stateNode!=null&&(Et=s.stateNode)):(jx(s),Ue=!0));default:W$(n,t),t=We=KE(t,_o),t=G$(n,t,_o)}e.memoizedProps=e.pendingProps,t===null?am(e):We=t}function Eu(e,t,n,s){yo=Bc=null,i3(t),Lu=null,z1=0;var r=t.return;try{if(TG(e,r,t,n,Ke)){Qt=1,zx(e,zr(n,e.current)),We=null;return}}catch(i){if(r!==null)throw We=r,i;Qt=1,zx(e,zr(n,e.current)),We=null;return}t.flags&32768?(Ue||s===1?e=!0:Gd||Ke&536870912?e=!1:(Aa=e=!0,(s===2||s===9||s===3||s===6)&&(s=Yn.current,s!==null&&s.tag===13&&(s.flags|=16384))),CA(t,e)):am(t)}function am(e){var t=e;do{if(t.flags&32768){CA(t,Aa);return}e=t.return;var n=RG(t.alternate,t,_o);if(n!==null){We=n;return}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);Qt===0&&(Qt=5)}function CA(e,t){do{var n=IG(e.alternate,e);if(n!==null){n.flags&=32767,We=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){We=e;return}We=e=n}while(e!==null);Qt=6,We=null}function g8(e,t,n,s,r,i,a,l,c,u,d,f){e.cancelPendingCommit=null;do lm();while(Ut!==0);if(rt&6)throw Error(de(327));if(t!==null){if(t===e.current)throw Error(de(177));e===bt&&(We=bt=null,Ke=0),Sc=t,si=e,qi=n,Pv=r,mA=s,FG(e,t,n,a,l,c,f)}}function FG(e,t,n,s,r,i,a){var l=t.lanes|t.childLanes;if(qv=l,l|=V5,gV(e,n,l,s,r,i),Hu=null,(n&335544064)===n?(qu=yG(e),s=10262):(qu=null,s=10256),t.subtreeFlags&s||t.flags&s?(e.callbackNode=null,e.callbackPriority=0,ZG(yx,function(){return Gv(),null})):(e.callbackNode=null,e.callbackPriority=0),Rx=!1,s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=Ne.T,Ne.T=null,r=it.p,it.p=2,i=rt,rt|=4;try{LG(e,t,n)}finally{rt=i,it.p=r,Ne.T=s}}Ut=1,Rx?Bu=gW(a,e.containerInfo,qu,Uv,Fv,GG,Vv,Gv,VG):(Uv(),Fv(),Vv())}function VG(e){if(Ut!==0){var t=si.onRecoverableError;t(e,{componentStack:null})}}function GG(){Ut===3&&(Ut=0,uA(Sc,si),Ut=4)}function Uv(){if(Ut===1){Ut=0;var e=si,t=Sc,n=qi,s=(t.flags&13878)!==0;if(t.subtreeFlags&13878||s){s=Ne.T,Ne.T=null;var r=it.p;it.p=2;var i=rt;rt|=4;try{Of=Ix=!1,lA(t,e,n),n=Zv;var a=HE(e.containerInfo),l=n.focusedElem,c=n.selectionRange;if(a!==l&&l&&l.ownerDocument&&BE(l.ownerDocument.documentElement,l)){if(c!==null&&F5(l)){var u=c.start,d=c.end;if(d===void 0&&(d=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(d,l.value.length);else{var f=l.ownerDocument||document,p=f&&f.defaultView||window;if(p.getSelection){var x=p.getSelection(),g=l.textContent.length,v=Math.min(c.start,g),y=c.end===void 0?v:Math.min(c.end,g);!x.extend&&v>y&&(a=y,y=v,v=a);var m=N7(l,v),k=N7(l,y);if(m&&k&&(x.rangeCount!==1||x.anchorNode!==m.node||x.anchorOffset!==m.offset||x.focusNode!==k.node||x.focusOffset!==k.offset)){var b=f.createRange();b.setStart(m.node,m.offset),x.removeAllRanges(),v>y?(x.addRange(b),x.extend(k.node,k.offset)):(b.setEnd(k.node,k.offset),x.addRange(b))}}}}for(f=[],x=l;x=x.parentNode;)x.nodeType===1&&f.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var j=f[l];j.element.scrollLeft=j.left,j.element.scrollTop=j.top}}Ad=!!Xv,Zv=Xv=null}finally{rt=i,it.p=r,Ne.T=s}}e.current=t,Ut=2}}function Fv(){if(Ut===2){Ut=0;var e=si,t=Sc,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Ne.T,Ne.T=null;var s=it.p;it.p=2;var r=rt;rt|=4;try{nA(e,t.alternate,t)}finally{rt=r,it.p=s,Ne.T=n}}Ut=3}}function Vv(){if(Ut===4||Ut===3){Ut=0;var e=Bu;Bu=null,aV();var t=si,n=Sc,s=qi,r=mA,i=(s&335544064)===s?10262:10256;if(n.subtreeFlags&i||n.flags&i?Ut=5:(Ut=0,Sc=si=null,EA(t,t.pendingLanes)),i=t.pendingLanes,i===0&&(Ba=null),D5(s),n=n.stateNode,fr&&typeof fr.onCommitFiberRoot=="function")try{fr.onCommitFiberRoot($h,n,void 0,(n.current.flags&128)===128)}catch{}if(r!==null){n=Ne.T,i=it.p,it.p=2,Ne.T=null;try{for(var a=t.onRecoverableError,l=0;l<r.length;l++){var c=r[l];a(c.value,{componentStack:c.stack})}}finally{Ne.T=n,it.p=i}}if(r=Hu,a=qu,qu=null,r!==null&&(Hu=null,a===null&&(a=[]),e!==null))for(c=0;c<r.length;c++)n=(0,r[c])(a),n!==void 0&&e.finished.finally(n);qi&3&&lm(),Xi(t),i=t.pendingLanes,s&261930&&i&42?t===fp?d1++:(d1=0,fp=t):(d1=0,fp=null),Ih(0)}}function EA(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Nh(t)))}function lm(){return Bu!==null&&(Bu.skipTransition(),Bu=null),Uv(),Fv(),Vv(),Gv()}function Gv(){if(Ut!==5)return!1;var e=si,t=qv;qv=0;var n=D5(qi),s=Ne.T,r=it.p;try{it.p=32>n?32:n,Ne.T=null,n=Pv,Pv=null;var i=si,a=qi;if(Ut=0,Sc=si=null,qi=0,rt&6)throw Error(de(331));var l=rt;if(rt|=4,pA(i.current),dA(i,i.current,a,n),rt=l,Ih(0,!1),fr&&typeof fr.onPostCommitFiberRoot=="function")try{fr.onPostCommitFiberRoot($h,i)}catch{}return!0}finally{it.p=r,Ne.T=s,EA(e,t)}}function m8(e,t,n){t=zr(n,t),t=Cv(e.stateNode,t,2),e=La(e,t,2),e!==null&&(Mh(e,2),Xi(e))}function ht(e,t,n){if(e.tag===3)m8(e,e,n);else for(;t!==null;){if(t.tag===3){m8(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ba===null||!Ba.has(s))){e=zr(n,e),n=q$(2),s=La(t,n,2),s!==null&&(P$(n,s,t,e),Mh(s,2),Xi(s));break}}t=t.return}}function q2(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new BG;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(b3=!0,r.add(n),e=WG.bind(null,e,t,n),t.then(e,e))}function WG(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,bt===e&&(Ke&n)===n&&(Qt===4||Qt===3&&(Ke&62914560)===Ke&&300>dr()-im?rt&2?Lx|=n:jd(e,0):Lx|=n,bd===Ke&&(bd=0)),Xi(e)}function $A(e,t){t===0&&(t=mE()),e=Dc(e,t),e!==null&&(Mh(e,t),Xi(e))}function KG(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$A(e,n)}function XG(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(de(314))}s!==null&&s.delete(t),$A(e,n)}function ZG(e,t){return L5(e,t)}var Sd=null,ou=null,Wv=!1,Hx=!1,P2=!1,Ta=0;function Xi(e){e!==ou&&e.next===null&&(ou===null?Sd=ou=e:ou=ou.next=e),Hx=!0,Wv||(Wv=!0,QG())}function Ih(e,t){if(!P2&&Hx){P2=!0;do for(var n=!1,s=Sd;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var i=0;else{var a=s.suspendedLanes,l=s.pingedLanes;i=(1<<31-hr(42|e)+1)-1,i&=r&~(a&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,y8(s,i))}else i=Ke,i=Vg(s,s===bt?i:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(i&3)||Ah(s,i)||(n=!0,y8(s,i));s=s.next}while(n);P2=!1}}function YG(){AA()}function AA(){Hx=Wv=!1;var e=0;Ta!==0&&cW()&&(e=Ta);for(var t=dr(),n=null,s=Sd;s!==null;){var r=s.next,i=MA(s,t);i===0?(s.next=null,n===null?Sd=r:n.next=r,r===null&&(ou=n)):(n=s,(e!==0||i&3)&&(Hx=!0)),s=r}Ut!==0&&Ut!==5||Ih(e),Ta!==0&&(Ta=0)}function MA(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var a=31-hr(i),l=1<<a,c=r[a];c===-1?(!(l&n)||l&s)&&(r[a]=xV(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=bt,n=Ke,n=Vg(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(dt===2||dt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&v2(s),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ah(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&v2(s),D5(n)){case 2:case 8:n=pE;break;case 32:n=yx;break;case 268435456:n=xE;break;default:n=yx}return s=TA.bind(null,e),n=L5(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&v2(s),e.callbackPriority=2,e.callbackNode=null,2}function TA(e,t){if(Ut!==0&&Ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lm()&&e.callbackNode!==n)return null;var s=Ke;return s=Vg(e,e===bt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(vA(e,s,t),MA(e,dr()),e.callbackNode!=null&&e.callbackNode===n?TA.bind(null,e):null)}function y8(e,t){if(lm())return null;vA(e,t,!0)}function QG(){dW(function(){rt&6?L5(hE,YG):AA()})}function j3(){if(Ta===0){var e=kc;e===0&&(e=m0,m0<<=1,!(m0&261888)&&(m0=256)),Ta=e}return Ta}function v8(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ep(e)}function JG(e,t,n,s,r){if(t==="submit"&&n&&n.stateNode===r){var i=v8((r[Ps]||null).action),a=s.submitter;a&&(t=(t=a[Ps]||null)?v8(t.formAction):a.getAttribute("formAction"),t!==null&&(i=t,a=null));var l=new Wg("action","action",null,s,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ta!==0){var c=new FormData(r,a);jv(n,{pending:!0,data:c,method:r.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=new FormData(r,a),jv(n,{pending:!0,data:c,method:r.method,action:i},i,c))},currentTarget:r}]})}}for(var U2=0;U2<fv.length;U2++){var F2=fv[U2],eW=F2.toLowerCase(),tW=F2[0].toUpperCase()+F2.slice(1);oi(eW,"on"+tW)}oi(PE,"onAnimationEnd");oi(UE,"onAnimationIteration");oi(FE,"onAnimationStart");oi("dblclick","onDoubleClick");oi("focusin","onFocus");oi("focusout","onBlur");oi(uG,"onTransitionRun");oi(dG,"onTransitionStart");oi(fG,"onTransitionCancel");oi(VE,"onTransitionEnd");yd("onMouseEnter",["mouseout","mouseover"]);yd("onMouseLeave",["mouseout","mouseover"]);yd("onPointerEnter",["pointerout","pointerover"]);yd("onPointerLeave",["pointerout","pointerover"]);Lc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Lc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Lc("onBeforeInput",["compositionend","keypress","textInput","paste"]);Lc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Lc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Lc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var R1="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(" "),nW=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(R1));function zA(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var a=s.length-1;0<=a;a--){var l=s[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(d){kx(d)}r.currentTarget=null,i=c}else for(a=0;a<s.length;a++){if(l=s[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(d){kx(d)}r.currentTarget=null,i=c}}}}function Ge(e,t){var n=t[p7];n===void 0&&(n=t[p7]=new Set);var s=e+"__bubble";n.has(s)||(NA(t,e,2,!1),n.add(s))}function V2(e,t,n){var s=0;t&&(s|=4),NA(n,e,s,t)}var T0="_reactListening"+Math.random().toString(36).slice(2);function S3(e){if(!e[T0]){e[T0]=!0,jE.forEach(function(n){n!=="selectionchange"&&(nW.has(n)||V2(n,!1,e),V2(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[T0]||(t[T0]=!0,V2("selectionchange",!1,t))}}function NA(e,t,n,s){switch(tM(t)){case 2:var r=KW;break;case 8:r=XW;break;default:r=z3}n=r.bind(null,t,n,e),r=void 0,!lv||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function G2(e,t,n,s,r){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var a=s.tag;if(a===3||a===4){var l=s.stateNode.containerInfo;if(l===r)break;if(a===4)for(a=s.return;a!==null;){var c=a.tag;if((c===3||c===4)&&a.stateNode.containerInfo===r)return;a=a.return}for(;l!==null;){if(a=Ll(l),a===null)return;if(c=a.tag,c===5||c===6||c===26||c===27){s=i=a;continue e}l=l.parentNode}}s=s.return}zE(function(){var u=i,d=H5(n),f=[];e:{var p=GE.get(e);if(p!==void 0){var x=Wg,g=e;switch(e){case"keypress":if(np(n)===0)break e;case"keydown":case"keyup":x=HV;break;case"focusin":g="focus",x=C2;break;case"focusout":g="blur",x=C2;break;case"beforeblur":case"afterblur":x=C2;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":x=w7;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=AV;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=VV;break;case PE:case UE:case FE:x=zV;break;case VE:x=WV;break;case"scroll":case"scrollend":x=EV;break;case"wheel":x=XV;break;case"copy":case"cut":case"paste":x=_V;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=S7;break;case"submit":x=UV;break;case"toggle":case"beforetoggle":x=YV}var v=(t&4)!==0,y=!v&&(e==="scroll"||e==="scrollend"),m=v?p!==null?p+"Capture":null:p;v=[];for(var k=u,b;k!==null;){var j=k;if(b=j.stateNode,j=j.tag,j!==5&&j!==26&&j!==27||b===null||m===null||(j=E1(k,m),j!=null&&v.push(I1(k,j,b))),y)break;k=k.return}0<v.length&&(p=new x(p,g,null,n,d),f.push({event:p,listeners:v}))}}if(!(t&7)){e:{if(x=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",x&&n!==av&&(g=n.relatedTarget||n.fromElement)&&(Ll(g)||g[Pd]))break e;(p||x)&&(g=d.window===d?d:(x=d.ownerDocument)?x.defaultView||x.parentWindow:window,p?(x=n.relatedTarget||n.toElement,p=u,x=x?Ll(x):null,x!==null&&(y=Eh(x),v=x.tag,x!==y||v!==5&&v!==27&&v!==6)&&(x=null)):(p=null,x=u),p!==x&&(v=w7,j="onMouseLeave",m="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(v=S7,j="onPointerLeave",m="onPointerEnter",k="pointer"),y=p==null?g:If(p),b=x==null?g:If(x),g=new v(j,k+"leave",p,n,d),g.target=y,g.relatedTarget=b,j=null,Ll(d)===u&&(v=new v(m,k+"enter",x,n,d),v.target=b,v.relatedTarget=y,j=v),y=j,v=p&&x?Xy(p,x,sW):null,p!==null&&k8(f,g,p,v,!1),x!==null&&y!==null&&k8(f,y,x,v,!0)))}e:{if(p=u?If(u):window,x=p.nodeName&&p.nodeName.toLowerCase(),x==="select"||x==="input"&&p.type==="file")var A=A7;else if($7(p))if(OE)A=aG;else{A=iG;var M=rG}else x=p.nodeName,!x||x.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?u&&B5(u.elementType)&&(A=A7):A=oG;if(A&&(A=A(e,u))){LE(f,A,n,d);break e}M&&M(e,p,u)}switch(M=u?If(u):window,e){case"focusin":($7(M)||M.contentEditable==="true")&&(ku=M,uv=u,t1=null);break;case"focusout":t1=uv=ku=null;break;case"mousedown":dv=!0;break;case"contextmenu":case"mouseup":case"dragend":dv=!1,_7(f,n,d);break;case"selectionchange":if(cG)break;case"keydown":case"keyup":_7(f,n,d)}var T;if(U5)e:{switch(e){case"compositionstart":var z="onCompositionStart";break e;case"compositionend":z="onCompositionEnd";break e;case"compositionupdate":z="onCompositionUpdate";break e}z=void 0}else vu?RE(e,n)&&(z="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(z="onCompositionStart");z&&(_E&&n.locale!=="ko"&&(vu||z!=="onCompositionStart"?z==="onCompositionEnd"&&vu&&(T=NE()):(Ea=d,q5="value"in Ea?Ea.value:Ea.textContent,vu=!0)),M=qx(u,z),0<M.length&&(z=new j7(z,e,null,n,d),f.push({event:z,listeners:M}),T?z.data=T:(T=IE(n),T!==null&&(z.data=T)))),(T=JV?eG(e,n):tG(e,n))&&(z=qx(u,"onBeforeInput"),0<z.length&&(M=new j7("onBeforeInput","beforeinput",null,n,d),f.push({event:M,listeners:z}),M.data=T)),JG(f,e,u,n,d)}zA(f,t)})}function I1(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qx(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,i=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||i===null||(r=E1(e,n),r!=null&&s.unshift(I1(e,r,i)),r=E1(e,t),r!=null&&s.push(I1(e,r,i))),e.tag===3)return s;e=e.return}return[]}function sW(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function k8(e,t,n,s,r){for(var i=t._reactName,a=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===s)break;l!==5&&l!==26&&l!==27||u===null||(c=u,r?(u=E1(n,i),u!=null&&a.unshift(I1(n,u,c))):r||(u=E1(n,i),u!=null&&a.push(I1(n,u,c)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var rW=/\r\n?/g,iW=/\u0000|\uFFFD/g;function b8(e){return(typeof e=="string"?e:""+e).replace(rW,`
|
|
191
|
-
`).replace(iW,"")}function _A(e,t){return t=b8(t),b8(e)===t}function ft(e,t,n,s,r,i){switch(n){case"children":if(typeof s=="string")t==="body"||t==="textarea"&&s===""||vd(e,s);else if(typeof s=="number"||typeof s=="bigint")t!=="body"&&vd(e,""+s);else return;break;case"className":k0(e,"class",s);break;case"tabIndex":k0(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":k0(e,n,s);break;case"style":TE(e,s,i);return;case"data":if(t!=="object"){k0(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=ep(s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="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}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&ft(e,t,"name",r.name,r,null),ft(e,t,"formEncType",r.formEncType,r,null),ft(e,t,"formMethod",r.formMethod,r,null),ft(e,t,"formTarget",r.formTarget,r,null)):(ft(e,t,"encType",r.encType,r,null),ft(e,t,"method",r.method,r,null),ft(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=ep(s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Li);return;case"onScroll":s!=null&&Ge("scroll",e);return;case"onScrollEnd":s!=null&&Ge("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(de(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(de(60));(i!=null?i.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=ep(s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Ge("beforetoggle",e),Ge("toggle",e),J0(e,"popover",s);break;case"xlinkActuate":Ji(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Ji(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Ji(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Ji(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Ji(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Ji(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Ji(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Ji(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Ji(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":J0(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=SV.get(n)||n,J0(e,n,s);else return}tt=!0}function Kv(e,t,n,s,r,i){switch(n){case"style":TE(e,s,i);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(de(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(de(60));(i!=null?i.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof s=="string")vd(e,s);else if(typeof s=="number"||typeof s=="bigint")vd(e,""+s);else return;break;case"onScroll":s!=null&&Ge("scroll",e);return;case"onScrollEnd":s!=null&&Ge("scrollend",e);return;case"onClick":s!=null&&(e.onclick=Li);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!SE.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),i=n.slice(2,r?n.length-7:void 0),t=e[Ps]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(i,t,r),typeof s=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(i,s,r);break e}tt=!0,n in e?e[n]=s:s===!0?e.setAttribute(n,""):J0(e,n,s)}return}tt=!0}function Zn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",e),Ge("load",e);var s=!1,r=!1,i;for(i in n)if(n.hasOwnProperty(i)){var a=n[i];if(a!=null)switch(i){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(de(137,t));default:ft(e,t,i,a,n,null)}}r&&ft(e,t,"srcSet",n.srcSet,n,null),s&&ft(e,t,"src",n.src,n,null);return;case"input":Ge("invalid",e);var l=i=a=r=null,c=null,u=null;for(s in n)if(n.hasOwnProperty(s)){var d=n[s];if(d!=null)switch(s){case"name":r=d;break;case"type":a=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":i=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(de(137,t));break;default:ft(e,t,s,d,n,null)}}$E(e,i,l,c,u,a,r,!1);return;case"select":Ge("invalid",e),s=a=i=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":i=l;break;case"defaultValue":a=l;break;case"multiple":s=l;default:ft(e,t,r,l,n,null)}t=i,n=a,e.multiple=!!s,t!=null?_u(e,!!s,t,!1):n!=null&&_u(e,!!s,n,!0);return;case"textarea":Ge("invalid",e),i=r=s=null;for(a in n)if(n.hasOwnProperty(a)&&(l=n[a],l!=null))switch(a){case"value":s=l;break;case"defaultValue":r=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(de(91));break;default:ft(e,t,a,l,n,null)}ME(e,s,r,i);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(s=n[c],s!=null))switch(c){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:ft(e,t,c,s,n,null)}return;case"dialog":Ge("beforetoggle",e),Ge("toggle",e),Ge("cancel",e),Ge("close",e);break;case"iframe":case"object":Ge("load",e);break;case"video":case"audio":for(s=0;s<R1.length;s++)Ge(R1[s],e);break;case"image":Ge("error",e),Ge("load",e);break;case"details":Ge("toggle",e);break;case"embed":case"source":case"link":Ge("error",e),Ge("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)&&(s=n[u],s!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(de(137,t));default:ft(e,t,u,s,n,null)}return;default:if(B5(t)){for(d in n)n.hasOwnProperty(d)&&(s=n[d],s!==void 0&&Kv(e,t,d,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(s=n[l],s!=null&&ft(e,t,l,s,n,null))}var oW={};function aW(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,i=null,a=null,l=null,c=null,u=null,d=null;for(x in n){var f=n[x];if(n.hasOwnProperty(x)&&f!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":c=f;default:s.hasOwnProperty(x)||ft(e,t,x,null,s,f)}}for(var p in s){var x=s[p];if(f=n[p],s.hasOwnProperty(p)&&(x!=null||f!=null))switch(p){case"type":x!==f&&(tt=!0),i=x;break;case"name":x!==f&&(tt=!0),r=x;break;case"checked":x!==f&&(tt=!0),u=x;break;case"defaultChecked":x!==f&&(tt=!0),d=x;break;case"value":x!==f&&(tt=!0),a=x;break;case"defaultValue":x!==f&&(tt=!0),l=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(de(137,t));break;default:x!==f&&ft(e,t,p,x,s,f)}}ov(e,a,l,c,u,d,i,r);return;case"select":x=a=l=p=null;for(i in n)if(c=n[i],n.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":x=c;default:s.hasOwnProperty(i)||ft(e,t,i,null,s,c)}for(r in s)if(i=s[r],c=n[r],s.hasOwnProperty(r)&&(i!=null||c!=null))switch(r){case"value":i!==c&&(tt=!0),p=i;break;case"defaultValue":i!==c&&(tt=!0),l=i;break;case"multiple":i!==c&&(tt=!0),a=i;default:i!==c&&ft(e,t,r,i,s,c)}t=l,n=a,s=x,p!=null?_u(e,!!n,p,!1):!!s!=!!n&&(t!=null?_u(e,!!n,t,!0):_u(e,!!n,n?[]:"",!1));return;case"textarea":x=p=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!s.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:ft(e,t,l,null,s,r)}for(a in s)if(r=s[a],i=n[a],s.hasOwnProperty(a)&&(r!=null||i!=null))switch(a){case"value":r!==i&&(tt=!0),p=r;break;case"defaultValue":r!==i&&(tt=!0),x=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(de(91));break;default:r!==i&&ft(e,t,a,r,s,i)}AE(e,p,x);return;case"option":for(var g in n)if(p=n[g],n.hasOwnProperty(g)&&p!=null&&!s.hasOwnProperty(g))switch(g){case"selected":e.selected=!1;break;default:ft(e,t,g,null,s,p)}for(c in s)if(p=s[c],x=n[c],s.hasOwnProperty(c)&&p!==x&&(p!=null||x!=null))switch(c){case"selected":p!==x&&(tt=!0),e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:ft(e,t,c,p,s,x)}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 v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!s.hasOwnProperty(v)&&ft(e,t,v,null,s,p);for(u in s)if(p=s[u],x=n[u],s.hasOwnProperty(u)&&p!==x&&(p!=null||x!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(de(137,t));break;default:ft(e,t,u,p,s,x)}return;default:if(B5(t)){for(var y in n)p=n[y],n.hasOwnProperty(y)&&p!==void 0&&!s.hasOwnProperty(y)&&Kv(e,t,y,void 0,s,p);for(d in s)p=s[d],x=n[d],!s.hasOwnProperty(d)||p===x||p===void 0&&x===void 0||Kv(e,t,d,p,s,x);return}}for(var m in n)p=n[m],n.hasOwnProperty(m)&&p!=null&&!s.hasOwnProperty(m)&&ft(e,t,m,null,s,p);for(f in s)p=s[f],x=n[f],!s.hasOwnProperty(f)||p===x||p==null&&x==null||ft(e,t,f,p,s,x)}function w8(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lW(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var r=n[s],i=r.transferSize,a=r.initiatorType,l=r.duration;if(i&&l&&w8(a)){for(a=0,l=r.responseEnd,s+=1;s<n.length;s++){var c=n[s],u=c.startTime;if(u>l)break;var d=c.transferSize,f=c.initiatorType;d&&w8(f)&&(c=c.responseEnd,a+=d*(c<l?1:(l-u)/(c-u)))}if(--s,t+=8*(i+a)/(r.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 Xv=null,Zv=null;function L1(e){return e.nodeType===9?e:e.ownerDocument}function j8(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 RA(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 IA(e,t,n,s){return n=L1(n).createElement(e),n[Gn]=s,n[Ps]=t,Zn(n,e,t),Nn(n),n}function Yv(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 W2=null;function cW(){var e=window.event;return e&&e.type==="popstate"?e===W2?!1:(W2=e,!0):(W2=null,!1)}var C3=typeof setTimeout=="function"?setTimeout:void 0,uW=typeof clearTimeout=="function"?clearTimeout:void 0,S8=typeof Promise=="function"?Promise:void 0,C8=typeof requestAnimationFrame=="function"?requestAnimationFrame:C3,dW=typeof queueMicrotask=="function"?queueMicrotask:typeof S8<"u"?function(e){return S8.resolve(null).then(e).catch(fW)}:C3;function fW(e){setTimeout(function(){throw e})}function nl(e){return e==="head"}function E8(e,t){var n=t,s=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(r),Md(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")X2(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,X2(n);for(var i=n.firstChild;i;){var a=i.nextSibling,l=i.nodeName;i[Th]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=a}}else n==="body"&&X2(e.ownerDocument.body);n=r}while(n);Md(t)}function $8(e,t){var n=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function LA(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var s=1;else for(var r=s=0;r<t.length;r++){var i=t[r];0<i.width&&0<i.height&&s++}s===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function OA(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null: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?e.margin=n:(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)))}function hW(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 Qv(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return hW(t,n,e)}function pW(e){return e.documentElement.clientHeight}function xW(e){this.addEventListener("load",e),this.addEventListener("error",e)}function gW(e,t,n,s,r,i,a,l,c){var u=t.nodeType===9?t:t.ownerDocument;try{var d=u.startViewTransition({update:function(){var p=u.defaultView,x=p.navigation&&p.navigation.transition,g=u.fonts.status;s();var v=[];if(g==="loaded"&&(pW(u),u.fonts.status==="loading"&&v.push(u.fonts.ready)),g=v.length,e!==null)for(var y=e.suspenseyImages,m=0,k=0;k<y.length;k++){var b=y[k];if(!b.complete){var j=b.getBoundingClientRect();if(0<j.bottom&&0<j.right&&j.top<p.innerHeight&&j.left<p.innerWidth){if(m+=XA(b),m>xp){v.length=g;break}b=new Promise(xW.bind(b)),v.push(b)}}}if(0<v.length)return p=Promise.race([Promise.all(v),new Promise(function(A){return setTimeout(A,500)})]).then(r,r),(x?Promise.allSettled([x.finished,p]):p).then(i,i);if(r(),x)return x.finished.then(i,i);i()},types:n});u.__reactViewTransition=d;var f=[];return d.ready.then(function(){for(var p=u.documentElement.getAnimations({subtree:!0}),x=0;x<p.length;x++){var g=p[x],v=g.effect,y=v.pseudoElement;if(y!=null&&y.startsWith("::view-transition")){f.push(g),g=v.getKeyframes();for(var m=y=void 0,k=!0,b=0;b<g.length;b++){var j=g[b],A=j.width;if(y===void 0)y=A;else if(y!==A){k=!1;break}if(A=j.height,m===void 0)m=A;else if(m!==A){k=!1;break}delete j.width,delete j.height,j.transform==="none"&&delete j.transform}k&&y!==void 0&&m!==void 0&&(v.setKeyframes(g),k=getComputedStyle(v.target,v.pseudoElement),k.width!==y||k.height!==m)&&(k=g[0],k.width=y,k.height=m,k=g[g.length-1],k.width=y,k.height=m,v.setKeyframes(g))}}a()},function(p){u.__reactViewTransition===d&&(u.__reactViewTransition=null);try{if(typeof p=="object"&&p!==null)switch(p.name){case"InvalidStateError":(p.message==="View transition was skipped because document visibility state is hidden."||p.message==="Skipping view transition because document visibility state has become hidden."||p.message==="Skipping view transition because viewport size changed."||p.message==="Transition was aborted because of invalid state")&&(p=null)}p!==null&&c(p)}finally{s(),r(),a()}}),d.finished.finally(function(){for(var p=0;p<f.length;p++)f[p].cancel();u.__reactViewTransition===d&&(u.__reactViewTransition=null),l()}),d}catch{return s(),r(),a(),null}}function Ol(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Ol.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:wt({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};Ol.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),s=[],r=0;r<n.length;r++){var i=n[r].effect;i!==null&&i.target===e&&i.pseudoElement===t&&s.push(n[r])}return s};Ol.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function DA(e){return{name:e,group:new Ol("group",e),imagePair:new Ol("image-pair",e),old:new Ol("old",e),new:new Ol("new",e)}}function yr(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}yr.prototype.addEventListener=function(e,t,n){var s=null,r=null;if(!(n!=null&&typeof n!="boolean"&&(s=n.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var i=this._eventListeners;if(BA(i,e,t,n)===-1){var a=this,l=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(l=function(c){a.removeEventListener(e,t,n),typeof t=="function"?t.call(this,c):t.handleEvent(c)}),s!==null&&(r=a.removeEventListener.bind(a,e,t,n),s.addEventListener("abort",r,{once:!0}),r=s.removeEventListener.bind(s,"abort",r)),s=Cd(n),i.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:l,cleanup:r}),qs(this._fragmentFiber.child,!1,mW,e,l,s)}this._eventListeners=i}};function mW(e,t,n,s){return mn(e).addEventListener(t,n,s),!1}yr.prototype.removeEventListener=function(e,t,n){var s=this._eventListeners;if(s!==null&&(t=BA(s,e,t,n),t!==-1)){var r=s[t];n=r.attachedListener;var i=r.cleanup;r=Cd(r.optionsOrUseCapture),qs(this._fragmentFiber.child,!1,yW,e,n,r),s.splice(t,1),i!==null&&i()}};function yW(e,t,n,s){return mn(e).removeEventListener(t,n,s),!1}function Cd(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function A8(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function BA(e,t,n,s){if(e.length===0)return-1;s=A8(s);for(var r=0;r<e.length;r++){var i=e[r];if(i.type===t&&i.listener===n&&A8(i.optionsOrUseCapture)===s)return r}return-1}yr.prototype.dispatchEvent=function(e){var t=Ic(this._fragmentFiber);if(t===null)return!0;t=mn(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var s=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var r=0;r<n.length;r++){var i=n[r];s.addEventListener(i.type,i.attachedListener,Cd(i.optionsOrUseCapture))}if(t.appendChild(s),e=s.dispatchEvent(e),n)for(r=0;r<n.length;r++)i=n[r],s.removeEventListener(i.type,i.attachedListener,Cd(i.optionsOrUseCapture));return t.removeChild(s),e}return t.dispatchEvent(e)};yr.prototype.focus=function(e){qs(this._fragmentFiber.child,!0,HA,e,void 0,void 0)};function HA(e,t){return e.tag===6?!1:(e=mn(e),TW(e,t))}yr.prototype.focusLast=function(e){var t=[];qs(this._fragmentFiber.child,!0,E3,t,void 0,void 0);for(var n=t.length-1;0<=n&&!HA(t[n],e);n--);};function E3(e,t){return t.push(e),!1}yr.prototype.blur=function(){var e=Ic(this._fragmentFiber);e!==null&&(e=mn(e),e=L1(e).activeElement,e!==null&&qs(this._fragmentFiber.child,!1,vW,e,void 0,void 0))};function vW(e,t){return e.tag===6?!1:(e=mn(e),e===t||e.contains(t)?(t.blur(),!0):!1)}yr.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),qs(this._fragmentFiber.child,!1,kW,e,void 0,void 0)};function kW(e,t){return e.tag===6||(e=mn(e),t.observe(e)),!1}yr.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),qs(this._fragmentFiber.child,!1,bW,e,void 0,void 0);for(var n=t=0;n<ti.length;n++){var s=ti[n];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):ti[t++]=s}ti.length=t}};function bW(e,t){return e.tag===6||(e=mn(e),t.unobserve(e)),!1}var ti=[],K2=!1;function wW(e,t,n){ti.push({fragmentInstance:e,observer:t,instance:n}),K2||(K2=!0,zW(function(){K2=!1;var s=ti;ti=[];for(var r=0;r<s.length;r++){var i=s[r];i.observer.unobserve(i.instance)}}))}yr.prototype.getClientRects=function(){var e=[];return qs(this._fragmentFiber.child,!1,jW,e,void 0,void 0),e};function jW(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=mn(e),t.push.apply(t,e.getClientRects());return!1}yr.prototype.getRootNode=function(e){var t=Ic(this._fragmentFiber);return t===null?this:mn(t).getRootNode(e)};yr.prototype.compareDocumentPosition=function(e){var t=Ic(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];qs(this._fragmentFiber.child,!1,E3,n,void 0,void 0);var s=mn(t);if(n.length===0){if(n=s,l7(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 r=s=n.compareDocumentPosition(e);return n===e?r=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=cE(t)[1],n===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=mn(n).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=mn(n[0]),r=mn(n[n.length-1]);var i=l7(this._fragmentFiber)?t.parentElement:s;if(i==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=i.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,i=i.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var a=t.compareDocumentPosition(e),l=r.compareDocumentPosition(e),c=a&Node.DOCUMENT_POSITION_CONTAINED_BY||l&Node.DOCUMENT_POSITION_CONTAINED_BY;return l=s&&i&&a&Node.DOCUMENT_POSITION_FOLLOWING&&l&Node.DOCUMENT_POSITION_PRECEDING,t=s&&t===e||i&&r===e||c||l?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&t===e||!i&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:a,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||SW(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function SW(e,t,n,s,r){var i=Ll(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!i)e:{for(;i!==null;){if(i.tag===7&&(i===t||i.alternate===t)){n=!0;break e}i=i.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(i===null)return i=r.ownerDocument,r===i||r===i.documentElement||r===i.body;e:{for(i=t,t=Ic(t);i!==null;){if(!(i.tag!==5&&i.tag!==3&&i.tag!==27||i!==t&&i.alternate!==t)){i=!0;break e}i=i.return}i=!1}return i}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!i)&&!(t=i===n)&&(t=Xy(n,i,c7),t===null?t=!1:(qs(t,!0,QF,i,n),i=xu,xu=null,t=i!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!i)&&!(t=i===s)&&(t=Xy(s,i,c7),t===null?t=!1:(qs(t,!0,JF,i,s),i=xu,Ky=xu=null,t=i!==null)),t):!1}function M8(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)}yr.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(de(566));var t=[];qs(this._fragmentFiber.child,!1,E3,t,void 0,void 0);var n=e!==!1;if(t.length===0){var s=cE(this._fragmentFiber);if(s=n?s[1]||s[0]||Ic(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=mn(s),M8(e,n);return}if(s=mn(s),s.nodeType!==9){if(s.nodeType===11){n="host"in s?s.host:null,n!==null&&n.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=n?t.length-1:0;s!==(n?-1:t.length);){var r=t[s];r.tag===6?(r=mn(r),M8(r,n)):mn(r).scrollIntoView(e),s+=n?-1:1}};function CW(e,t){return e=mn(e),qA(e,t),!1}function qA(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function PA(e,t){var n=t._eventListeners;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];e.addEventListener(r.type,r.attachedListener,Cd(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(i){for(var a=0,l=0;l<ti.length;l++){var c=ti[l];(c.fragmentInstance!==t||c.observer!==i||c.instance!==e)&&(ti[a++]=c)}ti.length=a,i.observe(e)}),qA(e,t))}function EW(e,t){var n=t._eventListeners;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];e.removeEventListener(r.type,r.attachedListener,Cd(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(i){typeof i.rootMargin=="string"?wW(t,i,e):i.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Jv(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":Jv(n),Gg(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function $W(e,t,n,s){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Th])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Rr(e.nextSibling),e===null)break}return null}function AW(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Rr(e.nextSibling),e===null))return null;return e}function UA(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rr(e.nextSibling),e===null))return null;return e}function ek(e){return e.data==="$?"||e.data==="$~"}function $3(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function MW(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Rr(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 tk=null;function T8(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Rr(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function z8(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 TW(e,t){function n(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return s}function zW(e){C8(function(){C8(function(t){return e(t)})})}function FA(e,t,n){switch(t=L1(n),e){case"html":if(e=t.documentElement,!e)throw Error(de(452));return e;case"head":if(e=t.head,!e)throw Error(de(453));return e;case"body":if(e=t.body,!e)throw Error(de(454));return e;default:throw Error(de(451))}}function VA(e,t,n){for(var s in n){var r=n[s];n.hasOwnProperty(s)&&r!=null&&ft(e,t,s,null,oW,r)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Li&&(e.onclick=null),Gg(e)}function X2(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Gg(e)}var Or=new Map,N8=new Set;function O1(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 Do=it.d;it.d={f:NW,r:_W,D:RW,C:IW,L:LW,m:OW,X:BW,S:DW,M:HW};function NW(){var e=Do.f(),t=om();return e||t}function _W(e){var t=Ud(e);t!==null&&t.tag===5&&t.type==="form"?T$(t):Do.r(e)}var Wd=typeof document>"u"?null:document;function GA(e,t,n){var s=Wd;if(s&&typeof t=="string"&&t){var r=Tr(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),N8.has(r)||(N8.add(r),e={rel:e,crossOrigin:n,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),Zn(t,"link",e),Nn(t),s.head.appendChild(t)))}}function RW(e){Do.D(e),GA("dns-prefetch",e,null)}function IW(e,t){Do.C(e,t),GA("preconnect",e,t)}function LW(e,t,n){Do.L(e,t,n);var s=Wd;if(s&&e&&t){var r='link[rel="preload"][as="'+Tr(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Tr(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Tr(n.imageSizes)+'"]')):r+='[href="'+Tr(e)+'"]';var i=r;switch(t){case"style":i=Ed(e);break;case"script":i=Kd(e)}if(!(Or.has(i)||(e=wt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Or.set(i,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(Lh(i))||t==="script"&&s.querySelector(Oh(i))))){var a=s.createElement("link");Zn(a,"link",e),t==="style"&&(a[vx]=!0,a.onload=a.onerror=function(){wE(a)}),Nn(a),s.head.appendChild(a)}}}function OW(e,t){Do.m(e,t);var n=Wd;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Tr(s)+'"][href="'+Tr(e)+'"]',i=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Kd(e)}if(!Or.has(i)&&(e=wt({rel:"modulepreload",href:e},t),Or.set(i,e),n.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Oh(i)))return}s=n.createElement("link"),Zn(s,"link",e),Nn(s),n.head.appendChild(s)}}}function DW(e,t,n){Do.S(e,t,n);var s=Wd;if(s&&e){var r=Nu(s).hoistableStyles,i=Ed(e);t=t||"default";var a=r.get(i);if(!a){var l={loading:0,preload:null};if(a=s.querySelector(Lh(i)))l.loading=5;else{e=wt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Or.get(i))&&A3(e,n);var c=a=s.createElement("link");Nn(c),Zn(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,hp(a,t,s)}a={type:"stylesheet",instance:a,count:1,state:l},r.set(i,a)}}}function BW(e,t){Do.X(e,t);var n=Wd;if(n&&e){var s=Nu(n).hoistableScripts,r=Kd(e),i=s.get(r);i||(i=n.querySelector(Oh(r)),i||(e=wt({src:e,async:!0},t),(t=Or.get(r))&&M3(e,t),i=n.createElement("script"),Nn(i),Zn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function HW(e,t){Do.M(e,t);var n=Wd;if(n&&e){var s=Nu(n).hoistableScripts,r=Kd(e),i=s.get(r);i||(i=n.querySelector(Oh(r)),i||(e=wt({src:e,async:!0,type:"module"},t),(t=Or.get(r))&&M3(e,t),i=n.createElement("script"),Nn(i),Zn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function _8(e,t,n,s){var r=(r=_a.current)?O1(r):null;if(!r)throw Error(de(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=Ed(n.href),t=Nu(r).hoistableStyles,s=t.get(n),s||(s={type:"style",instance:null,count:0,state:null},t.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ed(n.href);var i=Nu(r).hoistableStyles,a=i.get(e);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,a),(i=r.querySelector(Lh(e)))?i._p||(a.instance=i,a.state.loading=5):(i=Or.get(e),i||(i={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Or.set(e,i)),qW(r,e,i,a.state))),t&&s===null)throw Error(de(528,""));return a}if(t&&s!==null)throw Error(de(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=Kd(n),t=Nu(r).hoistableScripts,s=t.get(n),s||(s={type:"script",instance:null,count:0,state:null},t.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(de(444,e))}}function Ed(e){return'href="'+Tr(e)+'"'}function Lh(e){return'link[rel="stylesheet"]['+e+"]"}function WA(e){return wt({},e,{"data-precedence":e.precedence,precedence:null})}function qW(e,t,n,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[vx]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[vx]=!0,t.onload=t.onerror=wE.bind(null,t),Zn(t,"link",n),Nn(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function Kd(e){return'[src="'+Tr(e)+'"]'}function Oh(e){return"script[async]"+e}function R8(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Tr(n.href)+'"]');if(s)return t.instance=s,Nn(s),s;var r=wt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Nn(s),Zn(s,"style",r),hp(s,n.precedence,e),t.instance=s;case"stylesheet":r=Ed(n.href);var i=e.querySelector(Lh(r));if(i)return t.state.loading|=4,t.instance=i,Nn(i),i;s=WA(n),(r=Or.get(r))&&A3(s,r),i=(e.ownerDocument||e).createElement("link"),Nn(i);var a=i;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Zn(i,"link",s),t.state.loading|=4,hp(i,n.precedence,e),t.instance=i;case"script":return i=Kd(n.src),(r=e.querySelector(Oh(i)))?(t.instance=r,Nn(r),r):(s=n,(r=Or.get(i))&&(s=wt({},n),M3(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),Nn(r),Zn(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(de(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,hp(s,n.precedence,e));return t.instance}function hp(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,i=r,a=0;a<s.length;a++){var l=s[a];if(l.dataset.precedence===t)i=l;else if(i!==r)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function A3(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function M3(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var pp=null;function I8(e,t,n){if(pp===null){var s=new Map,r=pp=new Map;r.set(n,s)}else r=pp,s=r.get(n),s||(s=new Map,r.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var i=n[r];if(!(i[Th]||i[Gn]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var a=i.getAttribute(t)||"";a=e+a;var l=s.get(a);l?l.push(i):s.set(a,[i])}}return s}function nk(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function PW(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;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}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 L8(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function KA(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function XA(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function O8(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=XA(t),e.suspenseyImages.push(t)),e=VW.bind(e),t.decode().then(e,e))}function UW(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=Ed(s.href),i=t.querySelector(Lh(r));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=D1.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,Nn(i);return}i=t.ownerDocument||t,s=WA(s),(r=Or.get(r))&&A3(s,r),i=i.createElement("link"),Nn(i);var a=i;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Zn(i,"link",s),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=D1.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var xp=0;function FW(e,t){return e.stylesheets&&e.count===0&&gp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&gp(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&xp===0&&(xp=62500*lW());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gp(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>xp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function ZA(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)gp(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function D1(){this.count--,ZA(this)}function VW(){this.imgCount--,ZA(this)}var Px=null;function gp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Px=new Map,t.forEach(GW,e),Px=null,D1.call(e))}function GW(e,t){if(!(t.state.loading&4)){var n=Px.get(e);if(n)var s=n.get(null);else{n=new Map,Px.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<r.length;i++){var a=r[i];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),s=a)}s&&n.set(null,s)}r=t.instance,a=r.getAttribute("data-precedence"),i=n.get(a)||s,i===s&&n.set(null,r),n.set(a,r),this.count++,s=D1.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),i?i.parentNode.insertBefore(r,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var $d={$$typeof:Ii,Provider:null,Consumer:null,_currentValue:lc,_currentValue2:lc,_threadCount:0};function WW(e,t,n,s,r,i,a,l,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=k2(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=k2(0),this.hiddenUpdates=k2(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=i,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function YA(e,t,n,s,r,i,a,l,c,u,d,f){return e=new WW(e,t,n,a,c,u,d,f,l),t=1,i===!0&&(t|=24),i=Ds(3,null,null,t),e.current=i,i.stateNode=e,t=X5(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:s,isDehydrated:n,cache:t},Q5(i),e}function QA(e){return e?(e=ju,e):ju}function JA(e,t,n,s,r,i){r=QA(r),s.context===null?s.context=r:s.pendingContext=r,s=Ia(t),s.payload={element:n},i=i===void 0?null:i,i!==null&&(s.callback=i),n=La(e,s,t),n!==null&&(Hs(n,e,t),s1(n,e,t))}function D8(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function T3(e,t){D8(e,t),(e=e.alternate)&&D8(e,t)}function eM(e){if(e.tag===13||e.tag===31){var t=Dc(e,67108864);t!==null&&Hs(t,e,67108864),T3(e,67108864)}}function B8(e){if(e.tag===13||e.tag===31){var t=pr();t=O5(t);var n=Dc(e,t);n!==null&&Hs(n,e,t),T3(e,t)}}var Ad=!0;function KW(e,t,n,s){var r=Ne.T;Ne.T=null;var i=it.p;try{it.p=2,z3(e,t,n,s)}finally{it.p=i,Ne.T=r}}function XW(e,t,n,s){var r=Ne.T;Ne.T=null;var i=it.p;try{it.p=8,z3(e,t,n,s)}finally{it.p=i,Ne.T=r}}function z3(e,t,n,s){if(Ad){var r=sk(s);if(r===null)G2(e,t,s,Ux,n),H8(e,s);else if(YW(r,e,t,n,s))s.stopPropagation();else if(H8(e,s),t&4&&-1<ZW.indexOf(e)){for(;r!==null;){var i=Ud(r);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var a=gl(i.pendingLanes);if(a!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;a;){var c=1<<31-hr(a);l.entanglements[1]|=c,a&=~c}Xi(i),!(rt&6)&&(Ox=dr()+500,Ih(0))}}break;case 31:case 13:l=Dc(i,2),l!==null&&Hs(l,i,2),om(),T3(i,2)}if(i=sk(s),i===null&&G2(e,t,s,Ux,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else G2(e,t,s,null,n)}}function sk(e){return e=H5(e),N3(e)}var Ux=null;function N3(e){if(Ux=null,e=Ll(e),e!==null){var t=Eh(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=oE(t),e!==null)return e;e=null}else if(n===31){if(e=aE(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 Ux=e,null}function tM(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(lV()){case hE:return 2;case pE:return 8;case yx:case cV:return 32;case xE:return 268435456;default:return 32}default:return 32}}var rk=!1,Ha=null,qa=null,Pa=null,B1=new Map,H1=new Map,la=[],ZW="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 H8(e,t){switch(e){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Pa=null;break;case"pointerover":case"pointerout":B1.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":H1.delete(t.pointerId)}}function kf(e,t,n,s,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},t!==null&&(t=Ud(t),t!==null&&eM(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function YW(e,t,n,s,r){switch(t){case"focusin":return Ha=kf(Ha,e,t,n,s,r),!0;case"dragenter":return qa=kf(qa,e,t,n,s,r),!0;case"mouseover":return Pa=kf(Pa,e,t,n,s,r),!0;case"pointerover":var i=r.pointerId;return B1.set(i,kf(B1.get(i)||null,e,t,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,H1.set(i,kf(H1.get(i)||null,e,t,n,s,r)),!0}return!1}function nM(e){var t=Ll(e.target);if(t!==null){var n=Eh(t);if(n!==null){if(t=n.tag,t===13){if(t=oE(n),t!==null){e.blockedOn=t,h7(e.priority,function(){B8(n)});return}}else if(t===31){if(t=aE(n),t!==null){e.blockedOn=t,h7(e.priority,function(){B8(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 mp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=sk(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);av=s,n.target.dispatchEvent(s),av=null}else return t=Ud(n),t!==null&&eM(t),e.blockedOn=n,!1;t.shift()}return!0}function q8(e,t,n){mp(e)&&n.delete(t)}function QW(){rk=!1,Ha!==null&&mp(Ha)&&(Ha=null),qa!==null&&mp(qa)&&(qa=null),Pa!==null&&mp(Pa)&&(Pa=null),B1.forEach(q8),H1.forEach(q8)}function z0(e,t){e.blockedOn===t&&(e.blockedOn=null,rk||(rk=!0,yn.unstable_scheduleCallback(yn.unstable_NormalPriority,QW)))}var N0=null;function P8(e){N0!==e&&(N0=e,yn.unstable_scheduleCallback(yn.unstable_NormalPriority,function(){N0===e&&(N0=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(N3(s||n)===null)continue;break}var i=Ud(n);i!==null&&(e.splice(t,3),t-=3,jv(i,{pending:!0,data:r,method:n.method,action:s},s,r))}}))}function Md(e){function t(c){return z0(c,e)}Ha!==null&&z0(Ha,e),qa!==null&&z0(qa,e),Pa!==null&&z0(Pa,e),B1.forEach(t),H1.forEach(t);for(var n=0;n<la.length;n++){var s=la[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<la.length&&(n=la[0],n.blockedOn===null);)nM(n),n.blockedOn===null&&la.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var r=n[s],i=n[s+1],a=r[Ps]||null;if(typeof i=="function")a||P8(n);else if(a){var l=null;if(i&&i.hasAttribute("formAction")){if(r=i,a=i[Ps]||null)l=a.formAction;else if(N3(r)!==null)continue}else l=a.action;typeof l=="function"?n[s+1]=l:(n.splice(s,3),s-=3),P8(n)}}}function sM(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(a){return r=a})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function _3(e){this._internalRoot=e}cm.prototype.render=_3.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(de(409));var n=t.current,s=pr();JA(n,s,e,t,null,null)};cm.prototype.unmount=_3.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;JA(e.current,2,null,e,null,null),om(),t[Pd]=null}};function cm(e){this._internalRoot=e}cm.prototype.unstable_scheduleHydration=function(e){if(e){var t=bE();e={blockedOn:null,target:e,priority:t};for(var n=0;n<la.length&&t!==0&&t<la[n].priority;n++);la.splice(n,0,e),n===0&&nM(e)}};var U8=rE.version;if(U8!=="19.3.0")throw Error(de(527,U8,"19.3.0"));it.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(de(188)):(e=Object.keys(e).join(","),Error(de(268,e)));return e=YF(t),e=e!==null?lE(e):null,e=e===null?null:e.stateNode,e};var JW={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:Ne,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_0.isDisabled&&_0.supportsFiber)try{$h=_0.inject(JW),fr=_0}catch{}}Fg.createRoot=function(e,t){if(!iE(e))throw Error(de(299));var n=!1,s="",r=D$,i=B$,a=H$;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=YA(e,1,!1,null,null,n,s,null,r,i,a,sM),e[Pd]=t.current,S3(e),new _3(t)};Fg.hydrateRoot=function(e,t,n){if(!iE(e))throw Error(de(299));var s=!1,r="",i=D$,a=B$,l=H$,c=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(c=n.formState)),t=YA(e,1,!0,t,n??null,s,r,c,i,a,l,sM),t.context=QA(null),n=t.current,s=pr(),s=O5(s),r=Ia(s),r.callback=null,La(n,r,s),n=s,t.current.lanes=n,Mh(t,n),Xi(t),e[Pd]=t.current,S3(e),new cm(t)};Fg.version="19.3.0";function rM(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rM)}catch(e){console.error(e)}}rM(),tE.exports=Fg;var iM=tE.exports;let Zs=null,F8=null;const V8=["data-theme",Ls("theme")];function eK(e){const t=()=>{let s=null;for(const r of V8){const i=document.documentElement.getAttribute(r);i==null?e.removeAttribute(r):(e.setAttribute(r,i),r==="data-theme"&&(s=i))}s==="light"||s==="dark"?e.style.colorScheme=s:e.style.removeProperty("color-scheme")};t(),new MutationObserver(t).observe(document.documentElement,{attributes:!0,attributeFilter:[...V8]})}function tK(){if(Zs)return Zs;if(typeof document>"u")throw new Error("useToast: Cannot create fallback viewport during SSR. Wrap your app with <LayerProvider> or <AppShell>.");L4();const e=document.createElement("div");e.setAttribute("data-astryx-toast-fallback",""),document.body.appendChild(e),eK(e);let t;const n=new Promise(a=>{t=a}),s=()=>{const a=h.use(zg),l=h.useRef(!1);return h.useEffect(()=>{a&&!l.current&&(l.current=!0,Zs=a,t==null||t(a))},[a]),null};F8=iM.createRoot(e),F8.render(o.jsx(Ng,{children:o.jsx(s,{})}));const r=[],i={addToast:a=>{Zs&&Zs!==i?Zs.addToast(a):(r.push(a),n.then(l=>{for(const c of r)l.addToast(c);r.length=0}))},removeToast:(a,l)=>{Zs&&Zs!==i&&Zs.removeToast(a,l)},findByUniqueID:a=>{if(Zs&&Zs!==i)return Zs.findByUniqueID(a)}};return Zs=i,i}let nK=0;function sK(){return`astryx-toast-${++nK}`}function Xd(){const e=h.use(zg);return h.useCallback(n=>{const s=e??tK(),r=sK(),i={id:r,options:n,createdAt:Date.now()};return s.addToast(i),()=>s.removeToast(r,"manual")},[e])}const Z2={base:{k1xSpc:"x1rg5ohu",kaIpWk:"x16rqkct",kmuXW:"x2lah0s",kzqmXN:"x1xc55vz",kZKoxP:"xdk7pt",$$css:!0},pulsing:{kKVMdj:"x1mta51n",k44tkh:"x1c74tu6",kyAemX:"x4hg4is",ko0y90:"xa4qsjk",$$css:!0},reducedMotion:{kjO2d4:"x1aquc0h",$$css:!0}},rK={success:{kWkggS:"xdsz4j9",$$css:!0},warning:{kWkggS:"x1q8g9m5",$$css:!0},error:{kWkggS:"x1pjz0fi",$$css:!0},accent:{kWkggS:"x1ewilqj",$$css:!0},neutral:{kWkggS:"x1q5y3ey",$$css:!0}};function Fi({variant:e,label:t,isPulsing:n=!1,tooltip:s,xstyle:r,className:i,style:a,ref:l,...c}){const u=o.jsx("span",{ref:l,role:"img","aria-label":t,...ne(J("statusdot",{variant:e}),G(Z2.base,rK[e],n&&Z2.pulsing,n&&Z2.reducedMotion,r),i,a),...c});return s?o.jsx(Wi,{content:s,children:u}):u}Fi.displayName="StatusDot";/**
|
|
192
|
-
* @license lucide-react v1.52.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const iK=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
197
|
-
* @license lucide-react v1.52.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/function oK(e,t,n=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:iK(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}/**
|
|
202
|
-
* @license lucide-react v1.52.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const aK=e=>{let t="",n=!1;for(const s of e){if(s==="-"||s==="_"||s<=" "){n=t.length>0;continue}t.length===0?t+=s.toLowerCase():t+=n?s.toUpperCase():s,n=!1}return t};/**
|
|
207
|
-
* @license lucide-react v1.52.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const lK=e=>{const t=aK(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
212
|
-
* @license lucide-react v1.52.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const ik=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
|
|
217
|
-
* @license lucide-react v1.52.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const hl={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"};/**
|
|
222
|
-
* @license lucide-react v1.52.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/function Y2(e){return e!=null}function cK(e,t={}){var p,x;const n=t.attributeNames??{},s=g=>n[g]??g,r=e.size??e.width??hl.width,i=e.size??e.height??hl.height,a=((p=e.aliases)==null?void 0:p.filter(g=>typeof g=="string"&&g.trim()!=="").map(g=>`lucide-${g}`))??[],l=[...e.name?[`lucide-${e.name}`]:[],...a],c=((x=t.className)==null?void 0:x.split(" ").filter(Boolean))??[],u=t.includeDefaultClasses===!1?ik(...c):ik("lucide",...l,...c),d=t.absoluteStrokeWidth?Number(t.strokeWidth??hl["stroke-width"])*Number(e.size??e.width??hl.width)/Number(t.size??t.width??hl.width):t.strokeWidth??hl["stroke-width"];return["svg",{...Object.entries(hl).reduce((g,[v,y])=>(g[s(v)]=y,g),{}),..."color"in t&&t.color&&{[s("stroke")]:t.color},..."size"in t&&Y2(t.size)&&{[s("width")]:t.size,[s("height")]:t.size},..."width"in t&&Y2(t.width)&&{[s("width")]:t.width},..."height"in t&&Y2(t.height)&&{[s("height")]:t.height},[s("stroke-width")]:d,...u&&{[s("class")]:u},[s("viewBox")]:`0 0 ${r} ${i}`,...t.hasA11yProp===!1?{[s("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(g=>{const[v,y,m]=g,k=t.nonScalingStroke?{[s("vector-effect")]:"non-scaling-stroke",...y}:y;return m?[v,k,m]:[v,k]})]}/**
|
|
227
|
-
* @license lucide-react v1.52.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/function uK(e,t={}){return cK(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
232
|
-
* @license lucide-react v1.52.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const dK=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},fK=h.createContext({}),hK=()=>h.useContext(fK),pK=h.forwardRef(({color:e,size:t,width:n,height:s,strokeWidth:r,absoluteStrokeWidth:i,nonScalingStroke:a,className:l="",children:c,iconNode:u=[],icon:d={node:u,aliases:[],size:24},...f},p)=>{const{size:x=24,strokeWidth:g=2,absoluteStrokeWidth:v=!1,nonScalingStroke:y=!1,color:m="currentColor",className:k=""}=hK()??{},b=!!c||dK(f),[j,A,M=[]]=uK(d,{color:e??m,width:n??t??x,height:s??t??x,strokeWidth:r??g,absoluteStrokeWidth:i??v,nonScalingStroke:a??y,className:ik(k,l),hasA11yProp:b,attributes:f});return h.createElement(j,{ref:p,...A},[...M.map(([T,z])=>h.createElement(T,z)),...Array.isArray(c)?c:[c]])});/**
|
|
237
|
-
* @license lucide-react v1.52.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/function mt(e,t=[],n=[]){const s=typeof e=="string"?oK(e,t,n):e,r=h.forwardRef(({className:i,...a},l)=>h.createElement(pK,{ref:l,icon:s,className:i,...a}));return s.name&&(r.displayName=lK(s.name)),r}/**
|
|
242
|
-
* @license lucide-react v1.52.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const oM={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};oM.node;const xK=mt(oM);/**
|
|
247
|
-
* @license lucide-react v1.52.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const aM={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]};aM.node;const gK=mt(aM);/**
|
|
252
|
-
* @license lucide-react v1.52.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const lM={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};lM.node;const mK=mt(lM);/**
|
|
257
|
-
* @license lucide-react v1.52.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const cM={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]};cM.node;const yK=mt(cM);/**
|
|
262
|
-
* @license lucide-react v1.52.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const uM={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]};uM.node;const vK=mt(uM);/**
|
|
267
|
-
* @license lucide-react v1.52.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const dM={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};dM.node;const kK=mt(dM);/**
|
|
272
|
-
* @license lucide-react v1.52.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const fM={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};fM.node;const bK=mt(fM);/**
|
|
277
|
-
* @license lucide-react v1.52.0 - ISC
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the ISC license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const hM={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};hM.node;const wK=mt(hM);/**
|
|
282
|
-
* @license lucide-react v1.52.0 - ISC
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the ISC license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const pM={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};pM.node;const jK=mt(pM);/**
|
|
287
|
-
* @license lucide-react v1.52.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const xM={name:"chevrons-left",size:24,node:[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]};xM.node;const SK=mt(xM);/**
|
|
292
|
-
* @license lucide-react v1.52.0 - ISC
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the ISC license.
|
|
295
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const gM={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};gM.node;const CK=mt(gM);/**
|
|
297
|
-
* @license lucide-react v1.52.0 - ISC
|
|
298
|
-
*
|
|
299
|
-
* This source code is licensed under the ISC license.
|
|
300
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const mM={name:"circle-check-big",size:24,node:[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-circle"]};mM.node;const EK=mt(mM);/**
|
|
302
|
-
* @license lucide-react v1.52.0 - ISC
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the ISC license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const yM={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"]};yM.node;const $K=mt(yM);/**
|
|
307
|
-
* @license lucide-react v1.52.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* This source code is licensed under the ISC license.
|
|
310
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const vM={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};vM.node;const AK=mt(vM);/**
|
|
312
|
-
* @license lucide-react v1.52.0 - ISC
|
|
313
|
-
*
|
|
314
|
-
* This source code is licensed under the ISC license.
|
|
315
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const kM={name:"columns-2",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],aliases:["columns"]};kM.node;const MK=mt(kM);/**
|
|
317
|
-
* @license lucide-react v1.52.0 - ISC
|
|
318
|
-
*
|
|
319
|
-
* This source code is licensed under the ISC license.
|
|
320
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const bM={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"}]]};bM.node;const TK=mt(bM);/**
|
|
322
|
-
* @license lucide-react v1.52.0 - ISC
|
|
323
|
-
*
|
|
324
|
-
* This source code is licensed under the ISC license.
|
|
325
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const wM={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"]};wM.node;const zK=mt(wM);/**
|
|
327
|
-
* @license lucide-react v1.52.0 - ISC
|
|
328
|
-
*
|
|
329
|
-
* This source code is licensed under the ISC license.
|
|
330
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const jM={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"}]]};jM.node;const NK=mt(jM);/**
|
|
332
|
-
* @license lucide-react v1.52.0 - ISC
|
|
333
|
-
*
|
|
334
|
-
* This source code is licensed under the ISC license.
|
|
335
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/const SM={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"}]]};SM.node;const _K=mt(SM);/**
|
|
337
|
-
* @license lucide-react v1.52.0 - ISC
|
|
338
|
-
*
|
|
339
|
-
* This source code is licensed under the ISC license.
|
|
340
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/const CM={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};CM.node;const RK=mt(CM);/**
|
|
342
|
-
* @license lucide-react v1.52.0 - ISC
|
|
343
|
-
*
|
|
344
|
-
* This source code is licensed under the ISC license.
|
|
345
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const EM={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"}]]};EM.node;const IK=mt(EM);/**
|
|
347
|
-
* @license lucide-react v1.52.0 - ISC
|
|
348
|
-
*
|
|
349
|
-
* This source code is licensed under the ISC license.
|
|
350
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/const $M={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};$M.node;const LK=mt($M);/**
|
|
352
|
-
* @license lucide-react v1.52.0 - ISC
|
|
353
|
-
*
|
|
354
|
-
* This source code is licensed under the ISC license.
|
|
355
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const AM={name:"mic",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]};AM.node;const OK=mt(AM);/**
|
|
357
|
-
* @license lucide-react v1.52.0 - ISC
|
|
358
|
-
*
|
|
359
|
-
* This source code is licensed under the ISC license.
|
|
360
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const MM={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};MM.node;const DK=mt(MM);/**
|
|
362
|
-
* @license lucide-react v1.52.0 - ISC
|
|
363
|
-
*
|
|
364
|
-
* This source code is licensed under the ISC license.
|
|
365
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const TM={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};TM.node;const BK=mt(TM);/**
|
|
367
|
-
* @license lucide-react v1.52.0 - ISC
|
|
368
|
-
*
|
|
369
|
-
* This source code is licensed under the ISC license.
|
|
370
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const zM={name:"triangle-alert",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"]};zM.node;const HK=mt(zM);/**
|
|
372
|
-
* @license lucide-react v1.52.0 - ISC
|
|
373
|
-
*
|
|
374
|
-
* This source code is licensed under the ISC license.
|
|
375
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const NM={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};NM.node;const qK=mt(NM);/**
|
|
377
|
-
* @license lucide-react v1.52.0 - ISC
|
|
378
|
-
*
|
|
379
|
-
* This source code is licensed under the ISC license.
|
|
380
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const _M={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};_M.node;const PK=mt(_M);var xt={size:"1em","aria-hidden":!0},UK={close:o.jsx(PK,{...xt}),chevronDown:o.jsx(bK,{...xt}),chevronLeft:o.jsx(wK,{...xt}),chevronRight:o.jsx(jK,{...xt}),chevronsLeft:o.jsx(SK,{...xt}),chevronsRight:o.jsx(CK,{...xt}),check:o.jsx(kK,{...xt}),success:o.jsx(EK,{...xt}),error:o.jsx($K,{...xt}),warning:o.jsx(HK,{...xt}),info:o.jsx(IK,{...xt}),calendar:o.jsx(yK,{...xt}),clock:o.jsx(AK,{...xt}),externalLink:o.jsx(NK,{...xt}),menu:o.jsx(LK,{...xt}),moreHorizontal:o.jsx(zK,{...xt}),search:o.jsx(DK,{...xt}),arrowUp:o.jsx(mK,{...xt}),arrowDown:o.jsx(xK,{...xt}),arrowsUpDown:o.jsx(gK,{...xt}),funnel:o.jsx(RK,{...xt}),eyeSlash:o.jsx(_K,{...xt}),viewColumns:o.jsx(MK,{...xt}),copy:o.jsx(TK,{...xt}),checkDouble:o.jsx(vK,{...xt}),wrench:o.jsx(qK,{...xt}),stop:o.jsx(BK,{...xt}),microphone:o.jsx(OK,{...xt})};const FK={name:"neutral",__built:!0,tokens:{"--font-size-4xs":"0.375rem","--font-size-3xs":"0.4375rem","--font-size-2xs":"0.5rem","--font-size-xs":"0.625rem","--font-size-sm":"0.75rem","--font-size-base":"0.875rem","--font-size-lg":"1.0625rem","--font-size-xl":"1.25rem","--font-size-2xl":"1.5rem","--font-size-3xl":"1.8125rem","--font-size-4xl":"2.1875rem","--font-size-5xl":"2.625rem","--text-heading-1-size":"var(--font-size-2xl)","--text-heading-1-weight":"var(--font-weight-semibold)","--text-heading-1-leading":"1.3333","--text-heading-2-size":"var(--font-size-xl)","--text-heading-2-weight":"var(--font-weight-semibold)","--text-heading-2-leading":"1.4","--text-heading-3-size":"var(--font-size-lg)","--text-heading-3-weight":"var(--font-weight-bold)","--text-heading-3-leading":"1.4118","--text-heading-4-size":"var(--font-size-base)","--text-heading-4-weight":"var(--font-weight-bold)","--text-heading-4-leading":"1.4286","--text-heading-5-size":"var(--font-size-sm)","--text-heading-5-weight":"var(--font-weight-semibold)","--text-heading-5-leading":"1.6667","--text-heading-6-size":"var(--font-size-xs)","--text-heading-6-weight":"var(--font-weight-semibold)","--text-heading-6-leading":"1.6","--text-body-size":"var(--font-size-base)","--text-body-weight":"var(--font-weight-normal)","--text-body-leading":"1.4286","--text-large-size":"var(--font-size-lg)","--text-large-weight":"var(--font-weight-semibold)","--text-large-leading":"1.4118","--text-label-size":"var(--font-size-base)","--text-label-weight":"var(--font-weight-medium)","--text-label-leading":"1.4286","--text-code-size":"var(--font-size-base)","--text-code-weight":"var(--font-weight-normal)","--text-code-leading":"1.4286","--text-supporting-size":"var(--font-size-sm)","--text-supporting-weight":"var(--font-weight-normal)","--text-supporting-leading":"1.6667","--text-display-1-size":"var(--font-size-5xl)","--text-display-1-weight":"var(--font-weight-normal)","--text-display-1-leading":"1.2381","--text-display-2-size":"var(--font-size-4xl)","--text-display-2-weight":"var(--font-weight-normal)","--text-display-2-leading":"1.2571","--text-display-3-size":"var(--font-size-3xl)","--text-display-3-weight":"var(--font-weight-normal)","--text-display-3-leading":"1.3793","--duration-fast-min":"95ms","--duration-fast":"125ms","--duration-fast-max":"165ms","--duration-medium-min":"225ms","--duration-medium":"300ms","--duration-medium-max":"400ms","--duration-slow-min":"525ms","--duration-slow":"700ms","--duration-slow-max":"935ms","--font-family-body":'Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',"--font-family-heading":'Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',"--font-family-code":'ui-monospace, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace',"--color-syntax-keyword":"light-dark(#700084, #efa8ff)","--color-syntax-string":"light-dark(#005600, #a6d2a2)","--color-syntax-comment":"light-dark(#737373, #a3a3a3)","--color-syntax-number":"light-dark(#6e3500, #ffb37f)","--color-syntax-function":"light-dark(#00458c, #a0caff)","--color-syntax-type":"light-dark(#700084, #efa8ff)","--color-syntax-variable":"light-dark(#171717, #e5e5e5)","--color-syntax-operator":"light-dark(#737373, #a3a3a3)","--color-syntax-constant":"light-dark(#6e3500, #ffb37f)","--color-syntax-tag":"light-dark(#89001a, #ffaeaa)","--color-syntax-attribute":"light-dark(#584400, #eec12f)","--color-syntax-property":"light-dark(#005348, #83dac9)","--color-syntax-punctuation":"light-dark(#a3a3a3, #525252)","--color-syntax-background":"light-dark(#fafafa, #0a0a0a)","--color-background-surface":"light-dark(#ffffff, #262626)","--color-background-body":"light-dark(#f1f1f1, #1b1b1b)","--color-background-card":"light-dark(#ffffff, #1b1b1b)","--color-background-popover":"light-dark(#ffffff, #1b1b1b)","--color-background-muted":"light-dark(#f1f1f1, #1b1b1b)","--color-accent":"light-dark(#262626, #ebebeb)","--color-accent-muted":"light-dark(#f1f1f1, #262626)","--color-neutral":"light-dark(#0000000F, #FFFFFF1A)","--color-overlay":"light-dark(#00000080, #000000CC)","--color-overlay-hover":"light-dark(#0000000D, #FFFFFF0D)","--color-overlay-pressed":"light-dark(#0000001A, #FFFFFF1A)","--color-text-primary":"light-dark(#171717, #fafafa)","--color-text-secondary":"light-dark(#525252, #a3a3a3)","--color-text-disabled":"light-dark(#a3a3a3, #525252)","--color-text-accent":"light-dark(#262626, #ebebeb)","--color-on-dark":"#ffffff","--color-on-light":"#171717","--color-on-accent":"light-dark(#ffffff, #171717)","--color-on-success":"light-dark(#ffffff, #171717)","--color-on-error":"light-dark(#ffffff, #171717)","--color-on-warning":"#171717","--color-icon-accent":"light-dark(#262626, #ebebeb)","--color-icon-primary":"light-dark(#171717, #fafafa)","--color-icon-secondary":"light-dark(#737373, #a3a3a3)","--color-icon-disabled":"light-dark(#a3a3a3, #525252)","--color-success":"light-dark(#007004, #9fe59b)","--color-error":"light-dark(#a50c25, #ffc6c1)","--color-warning":"light-dark(#745b00, #fdcf4f)","--color-success-muted":"light-dark(#c5e5c0, #84c9803D)","--color-error-muted":"light-dark(#facecb, #ff9e973D)","--color-warning-muted":"light-dark(#f8da9d, #deb4333D)","--color-border":"light-dark(#00000014, #FFFFFF1A)","--color-border-emphasized":"light-dark(#d4d4d4, #525252)","--color-skeleton":"light-dark(#ebebeb, #525252)","--color-shadow":"light-dark(#0000001A, #0000004D)","--color-tint-hover":"light-dark(black, white)","--color-background-red":"light-dark(#facecb, #ff9e973D)","--color-border-red":"light-dark(#e6bab8, #ff6f6c)","--color-icon-red":"light-dark(#89001a, #ff9e97)","--color-text-red":"light-dark(#89001a, #ffc6c1)","--color-background-orange":"light-dark(#fad0b5, #ffa2583D)","--color-border-orange":"light-dark(#e6bda2, #e2883e)","--color-icon-orange":"light-dark(#6e3500, #ffa258)","--color-text-orange":"light-dark(#6e3500, #ffc9a2)","--color-background-yellow":"light-dark(#f8da9d, #deb4333D)","--color-border-yellow":"light-dark(#e4c279, #c0990e)","--color-icon-yellow":"light-dark(#584400, #deb433)","--color-text-yellow":"light-dark(#584400, #fdcf4f)","--color-background-green":"light-dark(#c5e5c0, #84c9803D)","--color-border-green":"light-dark(#b2d1ac, #69ad67)","--color-icon-green":"light-dark(#0c5700, #84c980)","--color-text-green":"light-dark(#0c5700, #9fe59b)","--color-background-teal":"light-dark(#a5e3d6, #7ec6b83D)","--color-border-teal":"light-dark(#94d6c8, #63ab9d)","--color-icon-teal":"light-dark(#005348, #7ec6b8)","--color-text-teal":"light-dark(#005348, #99e2d3)","--color-background-cyan":"light-dark(#a3e0ef, #83c2d43D)","--color-border-cyan":"light-dark(#91d3e3, #67a7b8)","--color-icon-cyan":"light-dark(#00505f, #83c2d4)","--color-text-cyan":"light-dark(#00505f, #9edef0)","--color-background-blue":"light-dark(#c4ddfb, #9eb7ff3D)","--color-border-blue":"light-dark(#b1c9e7, #6d9cfe)","--color-icon-blue":"light-dark(#00458c, #9eb7ff)","--color-text-blue":"light-dark(#00458c, #c7d3ff)","--color-background-purple":"light-dark(#eccef3, #f297ff3D)","--color-border-purple":"light-dark(#d8bbdf, #dd74f0)","--color-icon-purple":"light-dark(#700084, #f297ff)","--color-text-purple":"light-dark(#700084, #fac1ff)","--color-background-pink":"light-dark(#fccadc, #ff99c33D)","--color-border-pink":"light-dark(#e7b7c8, #f273aa)","--color-icon-pink":"light-dark(#83004b, #ff99c3)","--color-text-pink":"light-dark(#83004b, #ffc3da)","--color-background-gray":"light-dark(#e5e5e5, var(--color-neutral))","--color-border-gray":"light-dark(#d4d4d4, #262626)","--color-icon-gray":"light-dark(#525252, #a3a3a3)","--color-text-gray":"light-dark(#262626, #e5e5e5)","--radius-none":"0.25rem","--radius-inner":"0.375rem","--radius-element":"0.625rem","--radius-container":"0.75rem","--radius-page":"1.75rem","--radius-full":"9999px","--shadow-low":"0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 8%))","--shadow-med":"0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 12%))","--shadow-high":"0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 15%))","--shadow-inset-hover":"inset 0px 0px 0px 2px #0074e24D","--shadow-inset-selected":"inset 0px 0px 0px 2px #0074e280","--shadow-inset-success":"inset 0px 0px 0px 2px #1981004D","--shadow-inset-warning":"inset 0px 0px 0px 2px #ffce2f4D","--shadow-inset-error":"inset 0px 0px 0px 2px #e33f4a4D"},icons:UK},VK=["image/jpeg","image/png","image/gif","image/webp"];function GK(e){return"data"in e?e:{ref:e.ref}}const WK=new TextEncoder;async function KK(e){const t=await globalThis.crypto.subtle.digest("SHA-256",WK.encode(`${e.mimeType}
|
|
382
|
-
${e.data}`));return Array.from(new Uint8Array(t),n=>n.toString(16).padStart(2,"0")).join("")}const f1=4,XK=5*1024*1024,ZK=/^[A-Za-z0-9+/]*={0,2}$/;function YK(e){if(e.length>f1)return`At most ${f1} images per message`;for(let t=0;t<e.length;t++){const n=e[t];if(!VK.includes(n.mimeType))return`Unsupported image type: ${n.mimeType} (use JPEG, PNG, GIF or WebP)`;if(n.data===""||n.data.length%4!==0||!ZK.test(n.data))return`Image ${t+1} is not valid base64`;const s=n.data.endsWith("==")?2:n.data.endsWith("=")?1:0;if(n.data.length*3/4-s>XK)return`Image ${t+1} is larger than 5 MB`}}function QK(e,t){const n=new Map(t.map(d=>[d.id,d])),s=new Map,r=new Map;for(const d of e.conversations){const f=d.home;if(f.kind==="project"&&!e.projects.some(x=>x.path===f.path))continue;const p=n.get(d.id);p!==void 0&&(r.set(d.id,d),s.set(d.id,{summary:p,children:[]}))}for(const d of t){const f=[d];let p=d;for(;!r.has(p.id);){const x=p.parent===void 0?void 0:n.get(p.parent);if(x===void 0||f.includes(x))break;f.push(x),p=x}if(r.has(p.id))for(let x=f.length-1;x>=0;x--){const g=f[x];if(s.has(g.id)||s.set(g.id,{summary:g,children:[]}),x<f.length-1){const v=s.get(f[x+1].id),y=s.get(g.id);v.children.includes(y)||v.children.push(y)}}}const i=(d,f)=>d.summary.id-f.summary.id,a=d=>l(s.get(d.id)),l=d=>({summary:d.summary,children:[...d.children].sort(i).map(l)}),c=[...r.values()].sort((d,f)=>f.createdAt-d.createdAt),u=c.filter(d=>d.archived!==!0);return{chats:u.filter(d=>d.home.kind==="chat").map(a),projects:[...e.projects].sort((d,f)=>f.addedAt-d.addedAt).map(d=>({project:d,conversations:u.filter(f=>f.home.kind==="project"&&f.home.path===d.path).map(a)})),archived:c.filter(d=>d.archived===!0).map(d=>{const f=d.home,p=f.kind==="project"?e.projects.find(x=>x.path===f.path):void 0;return{node:a(d),...p===void 0?{}:{project:p}}})}}function ei(e,t){const n=s=>{for(const r of s){if(r.summary.id===t)return r;const i=n(r.children);if(i!==void 0)return i}};return n([...e.chats,...e.projects.flatMap(s=>s.conversations)])}function JK(e,t,n){var l,c;const s=(l=e.checkouts)==null?void 0:l.find(u=>u.conversationId===n);if(s!==void 0)return s;const r=new Map(t.map(u=>[u.id,u])),i=new Set;let a=r.get(n);for(;a!==void 0&&!i.has(a.id);){i.add(a.id);const u=(c=e.checkouts)==null?void 0:c.find(d=>d.conversationId===a.id);if(u!==void 0)return u;a=a.parent===void 0?void 0:r.get(a.parent)}}function eX(e,t,n){const s=e.conversations.find(l=>l.id===n);if(s!==void 0)return s.home;const r=new Map(t.map(l=>[l.id,l])),i=new Set;let a=r.get(n);for(;a!==void 0&&!i.has(a.id);){i.add(a.id);const l=e.conversations.find(c=>c.id===a.id);if(l!==void 0)return l.home;a=a.parent===void 0?void 0:r.get(a.parent)}}function RM(e){if(e!==void 0)return e.currentAgent===void 0?e.role:e.currentAgent??void 0}const G8={"needs-answer":3,failed:2,running:1};function tX(e){let t;const n=s=>{const r=s.summary.status;r!==void 0&&(t===void 0||G8[r]>G8[t])&&(t=r);for(const i of s.children)n(i)};return n(e),t}function nX(e){let t;const n=s=>{const r=s.summary.updatedAt;r!==void 0&&(t===void 0||r>t)&&(t=r);for(const i of s.children)n(i)};return n(e),t}function Zd(e,t){const n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return"now";const s=Math.floor(n/60);if(s<60)return`${s}m`;const r=Math.floor(s/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}const sX=/^\s*in the working directory\s+\S+,\s*/i;function Dr(e){var n;if(e===void 0)return"Conversation";if(e.kind!=="subagent")return e.title??"New conversation";if(e.label!==void 0)return e.label;const t=(n=e.title)==null?void 0:n.replace(sX,"").trim();return t===void 0||t===""?"Subagent":t}function q1(e,t){let n=ei(e,t);for(let s=0;n!==void 0&&n.summary.parent!==void 0&&s<4;s++)n=ei(e,n.summary.parent);return n}function R3(e){const t=[],n=s=>{for(const r of s.children)r.summary.kind==="fork"&&(t.push(r),n(r))};return n(e),t}function ok(e){return e.lifecycle==="background"?"background":"foreground"}function rX(e){const t=[],n=s=>{for(const r of s.children)r.summary.kind==="subagent"&&ok(r.summary)==="background"&&t.push(r),n(r)};return n(e),t.sort((s,r)=>s.summary.id-r.summary.id)}function I3(e){const t=[],n=e.children.filter(s=>s.summary.kind==="subagent"&&ok(s.summary)==="foreground");n.length>0&&t.push({owner:e.summary,label:"This conversation",tasks:[...n]});for(const s of R3(e)){const r=s.children.filter(i=>i.summary.kind==="subagent"&&ok(i.summary)==="foreground");r.length>0&&t.push({owner:s.summary,label:Dr(s.summary),tasks:[...r]})}return t}function IM(e,t,n){var s;return(((s=ei(e,t))==null?void 0:s.children)??[]).filter(r=>r.summary.forkedAt===n).map(r=>r.summary.id)}function iX(e){return e==="auto"||e==="directOnly"||e==="relayOnly"?e:void 0}const W8=1,oX=4,aX=1024;function lX(e){const t=e.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,"");return t==="localhost"||t.endsWith(".localhost")||t==="::1"||/^127(?:\.\d{1,3}){3}$/.test(t)}function P1(e){try{return lX(new URL(e).hostname)}catch{return!1}}const K8=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),cX=e=>{if(e.length===0)return!1;try{const t=new URL(e).protocol;return t==="ws:"||t==="wss:"}catch{return!1}};function um(e){if(e===void 0)return{kind:"absent"};if(!K8(e))return{kind:"malformed"};const t=e.schemaVersion;if(typeof t!="number")return{kind:"malformed"};if(t!==W8)return{kind:"unsupported"};const n=e.endpoints;if(!Array.isArray(n))return{kind:"malformed"};if(n.length>oX)return{kind:"malformed"};const s=[],r=new Map;for(const i of n){if(!K8(i))return{kind:"malformed"};const a=i.transport;if(typeof a!="string")return{kind:"malformed"};if(a!=="webSocket")continue;const l=i.role;if(l!=="direct"&&l!=="relay")return{kind:"malformed"};const c=i.url;if(typeof c!="string"||c.length>aX)return{kind:"malformed"};if(!cX(c))return{kind:"malformed"};const u=r.get(c);if(u!==void 0){if(u!==l)return{kind:"malformed"};continue}r.set(c,l),s.push({transport:"webSocket",role:l,url:c})}return s.length===0&&n.length>0?{kind:"unsupported"}:{kind:"valid",endpointSet:{schemaVersion:W8,endpoints:s}}}function LM(e){return encodeURIComponent(JSON.stringify(e))}function uX(e){try{return um(JSON.parse(e))}catch{return{kind:"malformed"}}}const dX="mixed content: this HTTPS page blocks the insecure ws:// connection";function Q2(e,t){return t==="auto"?[...e]:t==="relayOnly"?e.filter(n=>n.role==="loopback"||n.role==="relay"||n.role==="legacy"):e.filter(n=>n.role==="loopback"||n.role==="direct")}function fX(e){return e.filter(t=>t.role==="relay"||t.role==="legacy")}const OM="Direct connection unavailable: this host cannot be reached without the relay and WebRTC did not connect.",hX=e=>{try{return new URL(e).protocol==="ws:"&&!P1(e)}catch{return!1}},pX=(e,t)=>t.pageProtocol==="https:"&&hX(e)?dX:void 0;function U1(e,t,n={}){const s=[],r=new Set,i=(a,l)=>{if(r.has(a))return;r.add(a);const c=pX(a,n);s.push({url:a,role:l,...c===void 0?{}:{unsupported:c}})};if(P1(e)&&i(e,"loopback"),t!==void 0){for(const a of t.endpoints)a.role==="relay"&&i(a.url,"relay");for(const a of t.endpoints)a.role==="direct"&&i(a.url,"direct")}else P1(e)||i(e,"legacy");return s}const X8=(e,t)=>{var n;return(n=e.find(s=>s.role===t))==null?void 0:n.url};function L3(e,t){if(P1(e))return e;const n=X8(t.endpoints,"relay");return n!==void 0?n:X8(t.endpoints,"direct")??e}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function ak(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const Fx=e=>e?`"${e}" `:"";function lk(e,t=""){if(typeof e!="boolean")throw new TypeError(Fx(t)+"expected boolean, got type="+typeof e);return e}function Pu(e,t=""){if(typeof e!="number")throw new TypeError(Fx(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(Fx(t)+"expected integer >= 0, got "+e);return e}function _n(e,t,n=""){if(ak(e)&&(t===void 0||e.length===t))return e;t!==void 0&&Pu(t,"length");const s=ak(e),r=t!==void 0?` of length ${t}`:"",i=s?`length=${e.length}`:`type=${typeof e}`,a=Fx(n)+"expected Uint8Array"+r+", got "+i;throw s?new RangeError(a):new TypeError(a)}const Z8=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(t==="object"?"expected valid options object":`"${t}" expected object, got type=${typeof e}`)};function Y8(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function xX(e,t){_n(e,void 0,"output");const n=t.outputLen;if(!(e.length>=n))throw new RangeError('"output" expected length >= '+n)}function vo(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Ua(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function gX(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}const Uu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function mX(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function yX(e){for(let t=0;t<e.length;t++)e[t]=mX(e[t]);return e}const Dl=Uu?e=>e:yX;function vX(e,t){return!e.byteLength||!t.byteLength?!1:e.buffer===t.buffer&&e.byteOffset<t.byteOffset+t.byteLength&&t.byteOffset<e.byteOffset+e.byteLength}function kX(e,t){if(vX(e,t)&&e.byteOffset<t.byteOffset)throw new Error("complex overlap of input and output is not supported")}function bX(e,t){return Z8(e,"defaults"),Z8(t,"opts"),Object.assign(e,t)}function wX(e,t){if(e=_n(e),t=_n(t),e.length!==t.length)return!1;let n=0;for(let s=0;s<e.length;s++)n|=e[s]^t[s];return n===0}function jX(e,t,n){const s=t,r=()=>[],i=(l,c)=>s(c,...r(l)).update(l).digest(),a=s(new Uint8Array(e),...r(new Uint8Array(0)));return i.outputLen=a.outputLen,i.blockLen=a.blockLen,i.create=(l,...c)=>s(l,...c),i}const SX=(e,t)=>{function n(s,...r){if(_n(s,void 0,"key"),e.nonceLength!==void 0){const f=r[0];_n(f,e.varSizeNonce?void 0:e.nonceLength,"nonce")}const i=e.tagLength,a=e.nonceLength!==void 0?1:0;if(!e.withAAD){for(let f=a;f<r.length;f++)if(ak(r[f]))throw new Error("AAD not supported")}e.withAAD&&r[a]!==void 0&&_n(r[a],void 0,"AAD");const l=t(s,...r),c=(f,p)=>{if(p!==void 0){if(f!==2)throw new Error("cipher output not supported");_n(p,void 0,"output")}};let u=!1;return{encrypt(f,p){if(u)throw new Error("cannot encrypt() twice with same key + nonce");return u=!0,_n(f,void 0,"data"),c(l.encrypt.length,p),l.encrypt(f,p)},decrypt(f,p){if(_n(f,void 0,"data"),i&&f.length<i)throw new Error('"ciphertext" expected length >= tagLength='+i);return c(l.decrypt.length,p),l.decrypt(f,p)}}}return Object.assign(n,e),n};function ck(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(_n(t,e,"output"),n&&!Vx(t))throw new Error("invalid output, must be aligned");return t}function CX(e,t,n){Pu(e),Pu(t),lk(n);const s=new Uint8Array(16),r=gX(s);return r.setBigUint64(0,BigInt(t),n),r.setBigUint64(8,BigInt(e),n),s}function Vx(e){return e.byteOffset%4===0}function Gx(e){return Uint8Array.from(_n(e))}const DM=e=>Uint8Array.from(e.split(""),t=>t.charCodeAt(0)),EX=Dl(vo(DM("expand 16-byte k"))),$X=Dl(vo(DM("expand 32-byte k")));function et(e,t){return e<<t|e>>>32-t}const bf=64,AX=16,uk=2**32-1,Q8=Uint32Array.of();function MX(e,t,n,s,r,i,a,l){const c=r.length,u=new Uint8Array(bf),d=vo(u),f=Uu&&Vx(r)&&Vx(i),p=f?vo(r):Q8,x=f?vo(i):Q8;if(!Uu){for(let g=0;g<c;a++){if(e(t,n,s,d,a,l),Dl(d),a>=uk)throw new Error("arx: counter overflow");const v=Math.min(bf,c-g);for(let y=0,m;y<v;y++)m=g+y,i[m]=r[m]^u[y];g+=v}return}for(let g=0;g<c;a++){if(e(t,n,s,d,a,l),a>=uk)throw new Error("arx: counter overflow");const v=Math.min(bf,c-g);if(f&&v===bf){const y=g/4;if(g%4!==0)throw new Error("arx: invalid block position");for(let m=0,k;m<AX;m++)k=y+m,x[k]=p[k]^d[m];g+=bf;continue}for(let y=0,m;y<v;y++)m=g+y,i[m]=r[m]^u[y];g+=v}}function TX(e,t){const{allowShortKeys:n,extendNonceFn:s,counterLength:r,counterRight:i,rounds:a}=bX({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!="function")throw new Error("core must be a function");return Pu(r),Pu(a),lk(i),lk(n),(l,c,u,d,f=0)=>{_n(l,void 0,"key"),_n(c,void 0,"nonce"),_n(u,void 0,"data");const p=u.length,x=d!==void 0;if(d=ck(p,d,!1),x&&kX(u,d),Pu(f),f<0||f>=uk)throw new Error("arx: counter overflow");const g=[];let v=l.length,y,m;if(v===32)g.push(y=Gx(l)),m=$X;else if(v===16&&n)y=new Uint8Array(32),y.set(l),y.set(l,16),m=EX,g.push(y);else throw _n(l,32,"arx key"),new Error("invalid key size");(!Uu||!Vx(c))&&g.push(c=Gx(c));let k=vo(y);if(s){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const A=c.subarray(0,16);if(Uu)s(m,k,vo(A),k);else{const M=Dl(Uint32Array.from(m));s(M,k,vo(A),k),Ua(M),Dl(k)}c=c.subarray(16)}else Uu||Dl(k);const b=16-r;if(b!==c.length)throw new Error(`arx: nonce must be ${b} or 16 bytes`);if(b!==12){const A=new Uint8Array(12);A.set(c,i?0:12-c.length),c=A,g.push(c)}const j=Dl(vo(c));try{return MX(e,m,k,j,u,d,f,a),d}finally{Ua(...g)}}}function Hn(e,t){return e[t++]&255|(e[t++]&255)<<8}class zX{constructor(t){be(this,"blockLen",16);be(this,"outputLen",16);be(this,"buffer",new Uint8Array(16));be(this,"r",new Uint16Array(10));be(this,"h",new Uint16Array(10));be(this,"pad",new Uint16Array(8));be(this,"pos",0);be(this,"finished",!1);be(this,"destroyed",!1);t=Gx(_n(t,32,"key"));const n=Hn(t,0),s=Hn(t,2),r=Hn(t,4),i=Hn(t,6),a=Hn(t,8),l=Hn(t,10),c=Hn(t,12),u=Hn(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|s<<3)&8191,this.r[2]=(s>>>10|r<<6)&7939,this.r[3]=(r>>>7|i<<9)&8191,this.r[4]=(i>>>4|a<<12)&255,this.r[5]=a>>>1&8190,this.r[6]=(a>>>14|l<<2)&8191,this.r[7]=(l>>>11|c<<5)&8065,this.r[8]=(c>>>8|u<<8)&8191,this.r[9]=u>>>5&127;for(let d=0;d<8;d++)this.pad[d]=Hn(t,16+2*d)}process(t,n,s=!1){const r=s?0:2048,{h:i,r:a}=this,l=a[0],c=a[1],u=a[2],d=a[3],f=a[4],p=a[5],x=a[6],g=a[7],v=a[8],y=a[9],m=Hn(t,n+0),k=Hn(t,n+2),b=Hn(t,n+4),j=Hn(t,n+6),A=Hn(t,n+8),M=Hn(t,n+10),T=Hn(t,n+12),z=Hn(t,n+14);let $=i[0]+(m&8191),E=i[1]+((m>>>13|k<<3)&8191),N=i[2]+((k>>>10|b<<6)&8191),_=i[3]+((b>>>7|j<<9)&8191),R=i[4]+((j>>>4|A<<12)&8191),B=i[5]+(A>>>1&8191),D=i[6]+((A>>>14|M<<2)&8191),I=i[7]+((M>>>11|T<<5)&8191),O=i[8]+((T>>>8|z<<8)&8191),L=i[9]+(z>>>5|r),H=0,q=H+$*l+E*(5*y)+N*(5*v)+_*(5*g)+R*(5*x);H=q>>>13,q&=8191,q+=B*(5*p)+D*(5*f)+I*(5*d)+O*(5*u)+L*(5*c),H+=q>>>13,q&=8191;let U=H+$*c+E*l+N*(5*y)+_*(5*v)+R*(5*g);H=U>>>13,U&=8191,U+=B*(5*x)+D*(5*p)+I*(5*f)+O*(5*d)+L*(5*u),H+=U>>>13,U&=8191;let X=H+$*u+E*c+N*l+_*(5*y)+R*(5*v);H=X>>>13,X&=8191,X+=B*(5*g)+D*(5*x)+I*(5*p)+O*(5*f)+L*(5*d),H+=X>>>13,X&=8191;let Z=H+$*d+E*u+N*c+_*l+R*(5*y);H=Z>>>13,Z&=8191,Z+=B*(5*v)+D*(5*g)+I*(5*x)+O*(5*p)+L*(5*f),H+=Z>>>13,Z&=8191;let ie=H+$*f+E*d+N*u+_*c+R*l;H=ie>>>13,ie&=8191,ie+=B*(5*y)+D*(5*v)+I*(5*g)+O*(5*x)+L*(5*p),H+=ie>>>13,ie&=8191;let ae=H+$*p+E*f+N*d+_*u+R*c;H=ae>>>13,ae&=8191,ae+=B*l+D*(5*y)+I*(5*v)+O*(5*g)+L*(5*x),H+=ae>>>13,ae&=8191;let xe=H+$*x+E*p+N*f+_*d+R*u;H=xe>>>13,xe&=8191,xe+=B*c+D*l+I*(5*y)+O*(5*v)+L*(5*g),H+=xe>>>13,xe&=8191;let fe=H+$*g+E*x+N*p+_*f+R*d;H=fe>>>13,fe&=8191,fe+=B*u+D*c+I*l+O*(5*y)+L*(5*v),H+=fe>>>13,fe&=8191;let se=H+$*v+E*g+N*x+_*p+R*f;H=se>>>13,se&=8191,se+=B*d+D*u+I*c+O*l+L*(5*y),H+=se>>>13,se&=8191;let ye=H+$*y+E*v+N*g+_*x+R*p;H=ye>>>13,ye&=8191,ye+=B*f+D*d+I*u+O*c+L*l,H+=ye>>>13,ye&=8191,H=(H<<2)+H|0,H=H+q|0,q=H&8191,H=H>>>13,U+=H,i[0]=q,i[1]=U,i[2]=X,i[3]=Z,i[4]=ie,i[5]=ae,i[6]=xe,i[7]=fe,i[8]=se,i[9]=ye}finalize(){const{h:t,pad:n}=this,s=new Uint16Array(10);let r=t[1]>>>13;t[1]&=8191;for(let l=2;l<10;l++)t[l]+=r,r=t[l]>>>13,t[l]&=8191;t[0]+=r*5,r=t[0]>>>13,t[0]&=8191,t[1]+=r,r=t[1]>>>13,t[1]&=8191,t[2]+=r,s[0]=t[0]+5,r=s[0]>>>13,s[0]&=8191;for(let l=1;l<10;l++)s[l]=t[l]+r,r=s[l]>>>13,s[l]&=8191;s[9]-=8192;let i=(r^1)-1;for(let l=0;l<10;l++)s[l]&=i;i=~i;for(let l=0;l<10;l++)t[l]=t[l]&i|s[l];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let a=t[0]+n[0];t[0]=a&65535;for(let l=1;l<8;l++)a=(t[l]+n[l]|0)+(a>>>16)|0,t[l]=a&65535;Ua(s)}update(t){Y8(this),_n(t),t=Gx(t);const{buffer:n,blockLen:s}=this,r=t.length;for(let i=0;i<r;){const a=Math.min(s-this.pos,r-i);if(a===s){for(;s<=r-i;i+=s)this.process(t,i);continue}n.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===s&&(this.process(n,0,!1),this.pos=0)}return this}destroy(){this.destroyed=!0,Ua(this.h,this.r,this.buffer,this.pad)}digestInto(t){Y8(this),xX(t,this),this.finished=!0;const{buffer:n,h:s}=this;let{pos:r}=this;if(r){for(n[r++]=1;r<16;r++)n[r]=0;this.process(n,0,!0)}this.finalize();let i=0;for(let a=0;a<8;a++)t[i++]=s[a]>>>0,t[i++]=s[a]>>>8}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}}const NX=jX(32,e=>new zX(e));function _X(e,t,n,s,r,i=20){let a=e[0],l=e[1],c=e[2],u=e[3],d=t[0],f=t[1],p=t[2],x=t[3],g=t[4],v=t[5],y=t[6],m=t[7],k=r,b=n[0],j=n[1],A=n[2],M=a,T=l,z=c,$=u,E=d,N=f,_=p,R=x,B=g,D=v,I=y,O=m,L=k,H=b,q=j,U=A;for(let Z=0;Z<i;Z+=2)M=M+E|0,L=et(L^M,16),B=B+L|0,E=et(E^B,12),M=M+E|0,L=et(L^M,8),B=B+L|0,E=et(E^B,7),T=T+N|0,H=et(H^T,16),D=D+H|0,N=et(N^D,12),T=T+N|0,H=et(H^T,8),D=D+H|0,N=et(N^D,7),z=z+_|0,q=et(q^z,16),I=I+q|0,_=et(_^I,12),z=z+_|0,q=et(q^z,8),I=I+q|0,_=et(_^I,7),$=$+R|0,U=et(U^$,16),O=O+U|0,R=et(R^O,12),$=$+R|0,U=et(U^$,8),O=O+U|0,R=et(R^O,7),M=M+N|0,U=et(U^M,16),I=I+U|0,N=et(N^I,12),M=M+N|0,U=et(U^M,8),I=I+U|0,N=et(N^I,7),T=T+_|0,L=et(L^T,16),O=O+L|0,_=et(_^O,12),T=T+_|0,L=et(L^T,8),O=O+L|0,_=et(_^O,7),z=z+R|0,H=et(H^z,16),B=B+H|0,R=et(R^B,12),z=z+R|0,H=et(H^z,8),B=B+H|0,R=et(R^B,7),$=$+E|0,q=et(q^$,16),D=D+q|0,E=et(E^D,12),$=$+E|0,q=et(q^$,8),D=D+q|0,E=et(E^D,7);let X=0;s[X++]=a+M|0,s[X++]=l+T|0,s[X++]=c+z|0,s[X++]=u+$|0,s[X++]=d+E|0,s[X++]=f+N|0,s[X++]=p+_|0,s[X++]=x+R|0,s[X++]=g+B|0,s[X++]=v+D|0,s[X++]=y+I|0,s[X++]=m+O|0,s[X++]=k+L|0,s[X++]=b+H|0,s[X++]=j+q|0,s[X++]=A+U|0}const RX=TX(_X,{counterRight:!1,counterLength:4,allowShortKeys:!1}),IX=new Uint8Array(16),J8=(e,t)=>{e.update(t);const n=t.length%16;n&&e.update(IX.subarray(n))},LX=new Uint8Array(32);function e9(e,t,n,s,r){r!==void 0&&_n(r,void 0,"AAD");const i=e(t,n,LX),a=CX(s.length,r?r.length:0,!0),l=NX.create(i);r&&J8(l,r),J8(l,s),l.update(a);const c=l.digest();return Ua(i,a),c}const OX=e=>(t,n,s)=>({encrypt(i,a){const l=i.length;a=ck(l+16,a,!1),a.set(i);const c=a.subarray(0,-16);e(t,n,c,c,1);const u=e9(e,t,n,c,s);return a.set(u,l),Ua(u),a},decrypt(i,a){a=ck(i.length-16,a,!1);const l=i.subarray(0,-16),c=i.subarray(-16),u=e9(e,t,n,l,s);if(!wX(c,u))throw Ua(u),new Error("invalid tag");return a.set(i.subarray(0,-16)),e(t,n,a,a,1),Ua(u),a}}),t9=SX({blockSize:64,nonceLength:12,tagLength:16,withAAD:!0},OX(RX)),DX=e=>e/2**32|0,BX=e=>e>>>0;function dk(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const fk=e=>e?`"${e}" `:"";function Ro(e,t=""){if(typeof e!="number")throw new TypeError(fk(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(fk(t)+"expected integer >= 0, got "+e);return e}function Ir(e,t,n=""){if(dk(e)&&(t===void 0||e.length===t))return e;t!==void 0&&Ro(t,"length");const s=dk(e),r=t!==void 0?` of length ${t}`:"",i=s?`length=${e.length}`:`type=${typeof e}`,a=fk(n)+"expected Uint8Array"+r+", got "+i;throw s?new RangeError(a):new TypeError(a)}function n9(e){return Uint8Array.from(Ir(e))}function HX(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("expected hash wrapped by utils.createHasher");if(Ro(e.outputLen),Ro(e.blockLen),e.outputLen<1||e.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}const qX=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},s9=(e,t)=>{qX(e,t);const n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw new TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw new TypeError(`"${t}.__proto__" is not allowed`)};function Wx(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function BM(e,t){Ir(e,void 0,"output");const n=t.outputLen;if(!(e.length>=n))throw new RangeError('"output" expected length >= '+n)}function Kx(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function hk(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Xx(e,t){return e<<32-t|e>>>t}const HM=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function qM(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Df=HM?e=>e:e=>qM(e)>>>0;function PX(e){for(let t=0;t<e.length;t++)e[t]=qM(e[t]);return e}const Jc=HM?e=>e:PX,PM=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",UX=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function O3(e){if(Ir(e),PM)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=UX[e[n]];return t}function r9(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function UM(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);if(PM)try{return Uint8Array.fromHex(e)}catch(r){throw r instanceof SyntaxError?new RangeError(r.message):r}const t=e.length,n=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);const s=new Uint8Array(n);for(let r=0,i=0;r<n;r++,i+=2){const a=r9(e.charCodeAt(i)),l=r9(e.charCodeAt(i+1));if(a===void 0||l===void 0){const c=e[i]+e[i+1];throw new RangeError('hex string expected, got non-hex character "'+c+'" at index '+i)}s[r]=a*16+l}return s}function FM(e,t,n="opts"){return s9(e,"defaults"),t!==void 0&&s9(t,n),Object.assign(Object.create(null),e,t)}function FX(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=FM({},t,"info");const n=(r,i)=>e(i).update(r).digest(),s=e(void 0);return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.canXOF=s.canXOF,n.create=r=>e(r),Object.assign(n,t),Object.freeze(n)}function VX(e=32){Ro(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof(t==null?void 0:t.getRandomValues)!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const GX=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function VM(e,t,n=()=>{}){if(!Array.isArray(e))throw new TypeError(`"${t}" expected array, got type=${typeof e}`);for(let s=0;s<e.length;s++)n(e[s],`${t}[${s}]`);return e}const Fu=(e,t,n)=>Ir(e,t,n),GM=Ro;function Vu(e,t="object"){if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(t==="object"?"expected valid options object":`"${t}" expected object, got type=${typeof e}`);return e}function h1(e,t){if(typeof e!="function")throw new TypeError(`"${t}" is invalid: expected function, got ${typeof e}`);return e}const WX=O3,KX=e=>UM(e),WM=dk,KM=e=>VX(e),Zx=BigInt(0),i9=BigInt(1),XX=e=>e?`"${e}" `:"";function dm(e,t=""){if(typeof e!="boolean")throw new TypeError(XX(t)+"expected boolean, got type="+typeof e);return e}function ZX(e){if(typeof e=="bigint"){if(!hc(e))throw new RangeError("positive bigint expected, got "+e)}else GM(e);return e}function pk(e,t=""){if(typeof e!="number"){const n=t&&`"${t}" `;throw new TypeError(n+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){const n=t&&`"${t}" `;throw new RangeError(n+"expected safe integer, got "+e)}}function XM(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?Zx:BigInt("0x"+e)}function ZM(e){return XM(O3(e))}function Yx(e){return XM(O3(F1(Ir(e)).reverse()))}function YM(e,t){if(Ro(t),t===0)throw new Error("zero output length is invalid");e=ZX(e);const n=t*2,s=e.toString(16);if(s.length>n)throw new RangeError("number is too large");return UM(s.padStart(n,"0"))}function QM(e,t){return YM(e,t).reverse()}function F1(e){return Uint8Array.from(Fu(e))}function hc(e){return typeof e=="bigint"&&Zx<=e}function JM(e,t,n){return hc(e)&&hc(t)&&hc(n)&&t<=e&&e<n}function p1(e,t,n,s){if(!JM(t,n,s))throw new RangeError("expected valid "+e+": "+n+" <= n < "+s+", got "+t)}function YX(e){if(e<Zx)throw new Error("expected non-negative bigint, got "+e);return e===Zx?0:e.toString(2).length}const QX=e=>(pk(e,"n"),(i9<<BigInt(e))-i9);function Qx(e,t={},n={},s="object"){Vu(e,s),Vu(t,"fields"),Vu(n,"optFields");function r(a,l,c){const u=s==="object"?`param "${String(a)}"`:`"${s}.${String(a)}"`,d=e[a];if(!Object.hasOwn(e,a)&&(c?d!==void 0:l!=="function"))throw new TypeError(`${u} is invalid: expected own property`);if(c&&d===void 0)return;const f=typeof d;if(f!==l||d===null)throw new TypeError(`${u} is invalid: expected ${l}, got ${f}`)}const i=(a,l)=>Object.entries(a).forEach(([c,u])=>r(c,u,l));i(t,!1),i(n,!0)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const In=BigInt(0),Dt=BigInt(1),Bl=BigInt(2),eT=BigInt(3),D3=BigInt(4),tT=BigInt(5),JX=BigInt(7),nT=BigInt(8),eZ=BigInt(9),tZ=BigInt(15),sT=BigInt(16),nZ=BigInt("0x10000000000000000");function Ot(e,t){if(t<=In)throw new Error("mod: expected positive modulus, got "+t);const n=e%t;return n>=In?n:t+n}function sZ(e,t,n){if(n<=Dt)throw new Error("pow: expected modulus > 1, got "+n);if(typeof t!="bigint")throw new TypeError("invalid exponent: expected bigint, got "+typeof t);if(t<In)throw new Error("invalid exponent, negatives unsupported");if(t===In)return Dt;if(t===Dt)return e;let s=e%n;if(s<In&&(s+=n),t<nZ){let l=Dt;for(;t>In;)t&Dt&&(l=l*s%n),s=s*s%n,t>>=Dt;return l}const r=[];for(;t>In;)r.push(Number(t&tZ)),t>>=D3;const i=new Array(16);i[0]=Dt,i[1]=s;for(let l=2;l<16;l++)i[l]=i[l-1]*s%n;let a=i[r[r.length-1]];for(let l=r.length-2;l>=0;l--){a=a*a%n,a=a*a%n,a=a*a%n,a=a*a%n;const c=r[l];c!==0&&(a=a*i[c]%n)}return a}function Xr(e,t,n){if(n<=Dt)throw new Error("pow2: expected modulus > 1, got "+n);if(t<In)throw new Error("pow2: expected non-negative exponent, got "+t);let s=e;for(;t-- >In;)s*=s,s%=n;return s}function o9(e,t){if(e===In)throw new Error("invert: expected non-zero number");if(t<=Dt)throw new Error("invert: expected modulus > 1, got "+t);let n=Ot(e,t),s=t,r=In,i=Dt;for(;n!==In;){const l=s/n,c=s-n*l,u=r-i*l;s=n,n=c,r=i,i=u}if(s!==Dt)throw new Error("invert: does not exist");return Ot(r,t)}function B3(e,t,n){const s=e;if(!s.eql(s.sqr(t),n))throw new Error("Cannot find square root")}function H3(e,t){if((e&Dt)===In)throw new Error(t+": expected odd modulus, got "+e)}function rT(e,t){const n=e,s=(n.ORDER+Dt)/D3,r=n.pow(t,s);return B3(n,r,t),r}function rZ(e,t){const n=e,s=(n.ORDER-tT)/nT,r=n.mul(t,Bl),i=n.pow(r,s),a=n.mul(t,i),l=n.mul(n.mul(a,Bl),i),c=n.mul(a,n.sub(l,n.ONE));return B3(n,c,t),c}function iZ(e){const t=q3(e),n=iT(e),s=n(t,t.neg(t.ONE)),r=n(t,s),i=n(t,t.neg(s)),a=(e+JX)/sT;return(l,c)=>{const u=l;let d=u.pow(c,a),f=u.mul(d,s);const p=u.mul(d,r),x=u.mul(d,i),g=u.eql(u.sqr(f),c),v=u.eql(u.sqr(p),c);d=u.cmov(d,f,g),f=u.cmov(x,p,v);const y=u.eql(u.sqr(f),c),m=u.cmov(d,f,y);return B3(u,m,c),m}}function iT(e){if(e<eT)throw new Error("sqrt is not defined for small field");H3(e,"tonelliShanks");let t=e-Dt,n=0;for(;t%Bl===In;)t/=Bl,n++;let s=Bl;const r=q3(e);for(;Jx(r,s)===1;)if(s++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return rT;let i=r.pow(s,t);const a=(t+Dt)/Bl;return function(c,u){const d=c;if(d.is0(u))return u;if(Jx(d,u)!==1)throw new Error("Cannot find square root");let f=n,p=d.mul(d.ONE,i),x=d.pow(u,t),g=d.pow(u,a);for(;!d.eql(x,d.ONE);){if(d.is0(x))throw new Error("Cannot find square root: probably non-prime P");let v=1,y=d.sqr(x);for(;!d.eql(y,d.ONE);)if(v++,y=d.sqr(y),v===f)throw new Error("Cannot find square root");const m=Dt<<BigInt(f-v-1),k=d.pow(p,m);f=v,p=d.sqr(k),x=d.mul(x,p),g=d.mul(g,k)}return g}}function oZ(e){return H3(e,"Fp.sqrt"),e%D3===eT?rT:e%nT===tT?rZ:e%sT===eZ?iZ(e):iT(e)}const aZ=(e,t)=>(Ot(e,t)&Dt)===Dt,lZ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function V1(e){if(Vu(e,"field"),typeof e.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof e.ORDER);pk(e.BYTES,"BYTES"),pk(e.BITS,"BITS");for(const t of lZ)h1(e[t],"field."+t);if(e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=Dt)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function oT(e,t,n=!1){V1(e),VM(t,"nums"),dm(n,"passZero");const s=e,r=new Array(t.length).fill(n?s.ZERO:void 0),i=t.reduce((l,c,u)=>s.is0(c)?l:(r[u]=l,s.mul(l,c)),s.ONE),a=s.inv(i);return t.reduceRight((l,c,u)=>s.is0(c)?l:(r[u]=s.mul(l,r[u]),s.mul(l,c)),a),r}function Jx(e,t){V1(e);const n=e;H3(n.ORDER,"FpLegendre");const s=(n.ORDER-Dt)/Bl,r=n.pow(t,s),i=n.eql(r,n.ONE),a=n.eql(r,n.ZERO),l=n.eql(r,n.neg(n.ONE));if(!i&&!a&&!l)throw new Error("invalid Legendre symbol result");return i?1:a?0:-1}function cZ(e,t){if(t!==void 0&&GM(t),e<=In)throw new Error("invalid n length: expected positive n, got "+e);if(t!==void 0&&t<1)throw new Error("invalid n length: expected positive bit length, got "+t);const n=YX(e);if(t!==void 0&&t<n)throw new Error(`invalid n length: expected nBitLength (${t}) >= bitLen(n) (${n})`);const s=t!==void 0?t:n,r=Math.ceil(s/8);return{nBitLength:s,nByteLength:r}}const a9=new WeakMap;class l9{constructor(t,n={}){be(this,"ORDER");be(this,"BITS");be(this,"BYTES");be(this,"isLE");be(this,"ZERO",In);be(this,"ONE",Dt);be(this,"_lengths");be(this,"_mod");if(t<=Dt)throw new Error("invalid field: expected ORDER > 1, got "+t);let s;this.isLE=!1,n!=null&&typeof n=="object"&&(typeof n.BITS=="number"&&(s=n.BITS),typeof n.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:n.sqrt,enumerable:!0}),typeof n.isLE=="boolean"&&(this.isLE=n.isLE),n.allowedLengths&&(this._lengths=Object.freeze(n.allowedLengths.slice())),typeof n.modFromBytes=="boolean"&&(this._mod=n.modFromBytes));const{nBitLength:r,nByteLength:i}=cZ(t,s);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=r,this.BYTES=i,Object.freeze(this)}create(t){return Ot(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof t);return In<=t&&t<this.ORDER}is0(t){return t===In}isValidNot0(t){return!this.is0(t)&&this.isValid(t)}isOdd(t){return(t&Dt)===Dt}neg(t){return Ot(-t,this.ORDER)}eql(t,n){return t===n}sqr(t){return Ot(t*t,this.ORDER)}add(t,n){return Ot(t+n,this.ORDER)}sub(t,n){return Ot(t-n,this.ORDER)}mul(t,n){return Ot(t*n,this.ORDER)}pow(t,n){return sZ(t,n,this.ORDER)}div(t,n){return Ot(t*o9(n,this.ORDER),this.ORDER)}sqrN(t){return t*t}addN(t,n){return t+n}subN(t,n){return t-n}mulN(t,n){return t*n}inv(t){return o9(t,this.ORDER)}sqrt(t){let n=a9.get(this);return n||a9.set(this,n=oZ(this.ORDER)),n(this,t)}toBytes(t){return this.isLE?QM(t,this.BYTES):YM(t,this.BYTES)}fromBytes(t,n=!1){Fu(t);const{_lengths:s,BYTES:r,isLE:i,ORDER:a,_mod:l}=this;if(s){if(t.length<1||!s.includes(t.length)||t.length>r)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+t.length);const u=new Uint8Array(r);u.set(t,i?0:u.length-t.length),t=u}if(t.length!==r)throw new Error("Field.fromBytes: expected "+r+" bytes, got "+t.length);let c=i?Yx(t):ZM(t);if(l&&(c=Ot(c,a)),!n&&!this.isValid(c))throw new Error("invalid field element: outside of range 0..ORDER");return c}invertBatch(t){return oT(this,t,!0)}cmov(t,n,s){return dm(s,"condition"),s?n:t}}function q3(e,t={}){return Object.freeze(l9.prototype),new l9(e,t)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const P3=BigInt(0),G1=BigInt(1),uZ=BigInt(4),J2=16,c9=128,dZ=5,u9=2**31;function U3(e){const t=e;if(typeof t!="function")throw new TypeError('"Point" expected constructor, got type='+typeof e);h1(t.fromAffine,"Point.fromAffine"),h1(t.fromBytes,"Point.fromBytes"),h1(t.fromHex,"Point.fromHex"),Vu(t.BASE,"Point.BASE"),Vu(t.ZERO,"Point.ZERO"),V1(t.Fp),V1(t.Fn)}function fZ(e,t){U3(e),aT(t,e);const n=oT(e.Fp,t.map(s=>s.Z));return t.map((s,r)=>e.fromAffine(s.toAffine(n[r])))}function hZ(e,t,n=1){if(!Number.isSafeInteger(e)||e<n||e>t)throw new Error("invalid window size, expected ["+n+".."+t+"], got W="+e)}function pZ(e,t){const n=e*(4*t+128);if(n>u9)throw new Error("invalid window size: table would need ~"+Math.ceil(n/2**20)+" MiB, max "+u9/2**20+" MiB")}function xZ(e,t){if(e!==void 0){h1(e,"randomBytes");try{const n=e(t);if(!WM(n)||n.length!==t)return}catch{return}return e}}function aT(e,t){VM(e,"points"),e.forEach((n,s)=>{if(!(n instanceof t))throw new Error("invalid point at index "+s)})}function gZ(e,t,n){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((s,r)=>{if(!(n===void 0?t.isValid(s):hc(s)&&s<n))throw new Error("invalid scalar at index "+r)})}const lT=new WeakMap;function ey(e){return lT.get(e)||1}function mZ(e,t){const n=e.double(),s=[e];for(let r=1;r<t;r++)s.push(s[r-1].add(n));return s}function yZ(e,t){const n=2**t,s=n/2,r=BigInt(n-1),i=[];for(;e>P3;){let a=0;e&G1&&(a=Number(e&r),a>=s&&(a-=n),e-=BigInt(a)),i.push(a),e>>=G1}return i}function vZ(e,t,n){const s=2**t,r=s/2,i=BigInt(s-1),a=BigInt(t),l=[];for(let c=0;c<n;c++){let u=Number(e&i);e>>=a,u>r&&(u-=s,e+=G1),l.push(u)}if(e!==P3)throw new Error("invalid wnaf");return l}function kZ(e,t,n){let s=0;for(const i of n)s=Math.max(s,i.length);let r=e;for(let i=s-1;i>=0;i--){i!==s-1&&(r=r.double());for(let a=0;a<n.length;a++){const l=n[a][i];if(l){const c=t[a][Math.abs(l)-1>>1];r=r.add(l<0?c.negate():c)}}}return r}class bZ{constructor(t,n){be(this,"Point");be(this,"BASE");be(this,"ZERO");be(this,"randomBytes");be(this,"wnafPrecomputes",new WeakMap);be(this,"baseCanBeBlinded");be(this,"bits");U3(t),this.randomBytes=xZ(n,J2),this.Point=t,this.BASE=t.BASE,this.ZERO=t.ZERO,this.bits=t.Fn.BITS}buildWnafTable(t,n,s){const r=Math.ceil(s/n)+1,i=2**(n-1),a=[];let l=t;for(let c=0;c<r;c++){let u=l;for(let d=0;d<i;d++)a.push(u),u=u.add(l);l=a[a.length-1].double()}return{W:n,bits:s,windows:r,comp:a}}wnafCachedCT(t,n){const{W:s,windows:r,comp:i}=t,a=2**(s-1),l=vZ(n,s,r);let c=this.ZERO,u=this.BASE;for(let d=0;d<r;d++){const f=l[d],p=d*a,x=Math.abs(f)-1;let g=i[p];for(let y=1;y<a;y++)g=y===x?i[p+y]:g;const v=g.negate();f===0?u=u.add(i[p]):c=c.add(f<0?v:g)}return{p:c,f:u}}getWnafPrecomputes(t,n,s,r){let i=this.wnafPrecomputes.get(n),a=i==null?void 0:i.find(l=>l.W===t&&l.bits===s);return a||(a=this.buildWnafTable(n,t,s),typeof r=="function"&&(a={...a,comp:r(a.comp)}),i||(i=[],this.wnafPrecomputes.set(n,i)),i.push(a)),a}assertPoint(t){if(!(t instanceof this.Point))throw new TypeError('"point" expected Point instance, got type='+typeof t)}validateMulInput(t,n){if(this.assertPoint(t),!JM(n,G1,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(t,n,s,r){const i=ey(t);return i===1?this.fixedWindowCT(t,n,s):this.wnafCachedCT(this.getWnafPrecomputes(i,t,s,r),n)}mulCT(t,n,s){return this.validateMulInput(t,n),this.runCT(t,n,this.bits,s)}mulCTBlinded(t,n,s){if(this.validateMulInput(t,n),this.randomBytes===void 0)throw new Error("randomBytes is required for scalar blinding");const r=this.Point.Fn.BITS+c9,i=this.randomBytes(J2);if(!WM(i)||i.length!==J2)throw new Error("randomBytes returned invalid byte array");i[0]=i[0]&63|128;const a=n+ZM(i)*this.Point.Fn.ORDER;return this.runCT(t,a,r,s)}fixedWindowCT(t,n,s){const r=dZ,i=1<<r,a=QX(r),l=new Array(i);l[0]=this.ZERO;for(let d=1;d<i;d++)l[d]=l[d-1].add(t);const c=Math.ceil(s/r);let u=this.ZERO;for(let d=c-1;d>=0;d--){if(d!==c-1)for(let x=0;x<r;x++)u=u.double();const f=Number(n>>BigInt(d*r)&a);let p=l[0];for(let x=1;x<i;x++)p=x===f?l[x]:p;u=u.add(p)}return{p:u,f:u}}shouldBlind(t,n){return this.randomBytes===void 0?!1:n===G1?!0:t!==this.BASE?!1:(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded)}mulSecret(t,n,s,r){return this.shouldBlind(t,s)?this.mulCTBlinded(t,n,r):this.mulCT(t,n,r)}mulUnsafe(t,n,s){if(this.assertPoint(t),!hc(n))throw new Error("invalid scalar");const r=ey(t);if(r===1||n>=this.Point.Fn.ORDER)return wZ(this.Point,[t],[n],!0);const i=this.getWnafPrecomputes(r,t,this.bits,s);return this.wnafCachedCT(i,n).p}setWindowSize(t,n){this.assertPoint(t),hZ(n,this.bits);const s=Math.ceil((this.bits+c9)/n)+1;pZ(s*2**(n-1),this.Point.Fp.BYTES),lT.set(t,n),this.wnafPrecomputes.delete(t)}hasWindowSize(t){return ey(t)!==1}}function wZ(e,t,n,s=!1){if(U3(e),aT(t,e),dm(s,"allowOversized"),gZ(n,e.Fn,s?e.Fn.ORDER**uZ:void 0),t.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const r=t.map(a=>mZ(a,4)),i=n.map(a=>yZ(a,4));return kZ(e.ZERO,r,i)}function d9(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return V1(t),t}else return q3(e,{isLE:n})}function jZ(e,t,n={},s){if(s===void 0&&(s=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);Qx(n);for(const c of["p","n","h"]){const u=t[c];if(!(hc(u)&&u!==P3))throw new Error(`CURVE.${c} must be positive bigint`)}const r=d9(t.p,n.Fp,s),i=d9(t.n,n.Fn,s),l=["Gx","Gy","a","d"];for(const c of l)if(!r.isValid(t[c]))throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:r,Fn:i}}function SZ(e,t){return function(s){const r=e(s);return{secretKey:r,publicKey:t(r)}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const R0=BigInt(0),I0=BigInt(1),L0=BigInt(2),CZ=BigInt(4),f9=BigInt(8);function EZ(e,t,n,s){const r=e.sqr(n),i=e.sqr(s),a=e.add(e.mul(t.a,r),i),l=e.add(e.ONE,e.mul(t.d,e.mul(r,i)));return e.eql(a,l)}function $Z(e,t={}){Qx(t,{},{},"extraOpts");const n=t,s=jZ("edwards",e,n,n.FpFnLE),{Fp:r,Fn:i}=s;let a=s.CURVE;const{h:l}=a;if(Jx(r,a.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(Jx(r,a.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");Qx(n,{},{uvRatio:"function",randomBytes:"function"});const c=n.randomBytes===void 0?KM:n.randomBytes,u=L0<<BigInt(r.BYTES*8)-I0;function d(b){if(!r.isOdd)throw new Error("Field does not have .isOdd()");return r.isOdd(b)}const f=n.uvRatio===void 0?(b,j)=>{try{return{isValid:!0,value:r.sqrt(r.div(b,j))}}catch{return{isValid:!1,value:R0}}}:n.uvRatio;if(!EZ(r,a,a.Gx,a.Gy))throw new Error("bad curve params: generator point");const p=r.eql(a.a,r.neg(r.ONE))?b=>r.neg(b):r.eql(a.a,r.ONE)?b=>b:b=>r.mul(a.a,b);function x(b,j,A=!1){const M=A?I0:R0;return p1("coordinate "+b,j,M,u),j}function g(b){if(!(b instanceof v))throw new Error("EdwardsPoint expected")}const k=class k{constructor(j,A,M,T){be(this,"X");be(this,"Y");be(this,"Z");be(this,"T");this.X=x("x",j),this.Y=x("y",A),this.Z=x("z",M,!0),this.T=x("t",T),Object.freeze(this)}static CURVE(){return a}static fromAffine(j){if(j instanceof k)throw new Error("extended point not allowed");const{x:A,y:M}=j||{};return x("x",A),x("y",M),new k(A,M,r.ONE,r.mul(A,M))}static fromBytes(j,A=!1){const M=r.BYTES,{a:T,d:z}=a;j=F1(Fu(j,M,"point")),dm(A,"zip215");const $=F1(j),E=j[M-1];$[M-1]=E&-129;const N=Yx($),_=A?u:r.ORDER;p1("point.y",N,R0,_);const R=r.sqr(N),B=r.sub(R,r.ONE),D=r.sub(r.mulN(z,R),T);let{isValid:I,value:O}=f(B,D);if(!I)throw new Error("bad point: invalid y coordinate");const L=d(O),H=(E&128)!==0;if(!A&&r.is0(O)&&H)throw new Error("bad point: x=0 and x_0=1");return H!==L&&(O=r.neg(O)),k.fromAffine({x:O,y:N})}static fromHex(j,A=!1){return k.fromBytes(KX(j),A)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(j=6,A=!0){return m.setWindowSize(this,j),A||this.multiply(L0),this}assertValidity(){const j=this,{a:A,d:M}=a;if(j.is0())throw new Error("bad point: ZERO");const{X:T,Y:z,Z:$,T:E}=j,N=r.sqr(T),_=r.sqr(z),R=r.sqr($),B=r.sqr(R),D=r.mul(N,A),I=r.mul(r.add(D,_),R),O=r.add(B,r.mul(M,r.mul(N,_)));if(!r.eql(I,O))throw new Error("bad point: equation left != right (1)");const L=r.mul(T,z),H=r.mul($,E);if(!r.eql(L,H))throw new Error("bad point: equation left != right (2)")}equals(j){g(j);const{X:A,Y:M,Z:T}=this,{X:z,Y:$,Z:E}=j,N=r.mul(A,E),_=r.mul(z,T),R=r.mul(M,E),B=r.mul($,T);return r.eql(N,_)&&r.eql(R,B)}is0(){return this.equals(k.ZERO)}negate(){return new k(r.neg(this.X),this.Y,this.Z,r.neg(this.T))}double(){const{X:j,Y:A,Z:M}=this,T=r.sqr(j),z=r.sqr(A),$=r.mul(r.sqr(M),L0),E=p(T),N=r.addN(j,A),_=r.sub(r.subN(r.sqr(N),T),z),R=r.addN(E,z),B=r.subN(R,$),D=r.subN(E,z),I=r.mul(_,B),O=r.mul(R,D),L=r.mul(_,D),H=r.mul(B,R);return new k(I,O,H,L)}add(j){g(j);const{d:A}=a,{X:M,Y:T,Z:z,T:$}=this,{X:E,Y:N,Z:_,T:R}=j,B=r.mul(M,E),D=r.mul(T,N),I=r.mul(r.mulN($,A),R),O=r.mul(z,_),L=r.sub(r.subN(r.mulN(r.addN(M,T),r.addN(E,N)),B),D),H=r.subN(O,I),q=r.addN(O,I),U=r.sub(D,p(B)),X=r.mul(L,H),Z=r.mul(q,U),ie=r.mul(L,U),ae=r.mul(H,q);return new k(X,Z,ae,ie)}subtract(j){return g(j),this.add(j.negate())}multiply(j){if(!i.isValidNot0(j))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:A,f:M}=m.mulSecret(this,j,l,y);return y([A,M])[0]}multiplyUnsafe(j){if(!i.isValid(j))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return j===R0?k.ZERO:this.is0()||j===I0?this:m.mulUnsafe(this,j,y)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return m.mulUnsafe(this,a.n).is0()}toAffine(j){const A=this;let M=j;if(M!=null&&typeof M!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof M);const{X:T,Y:z,Z:$}=A,E=A.is0();M==null&&(M=E?r.create(f9):r.inv($));const N=r.mul(T,M),_=r.mul(z,M),R=r.mul($,M);if(E)return{x:r.ZERO,y:r.ONE};if(!r.eql(R,r.ONE))throw new Error("invZ was invalid");return{x:N,y:_}}clearCofactor(){return l===I0?this:l===L0?this.double():l===CZ?this.double().double():l===f9?this.double().double().double():this.multiplyUnsafe(l)}toBytes(){const{x:j,y:A}=this.toAffine(),M=r.toBytes(A);return M[M.length-1]|=d(j)?128:0,M}toHex(){return WX(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}};be(k,"BASE",new k(a.Gx,a.Gy,r.ONE,r.mul(a.Gx,a.Gy))),be(k,"ZERO",new k(r.ZERO,r.ONE,r.ONE,r.ZERO)),be(k,"Fp",r),be(k,"Fn",i);let v=k;const y=b=>fZ(v,b),m=new bZ(v,c);return m.bits>=6&&v.BASE.precompute(6),Object.freeze(v.prototype),Object.freeze(v),v}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pl=BigInt(0),jr=BigInt(1),O0=BigInt(2);function h9(e,t){return e+t-(t>>jr<<jr)}function AZ(e){const t=BigInt(6)*e;return(n,s,r)=>{const i=s+r,l=((t+r-s)*n+s)%e;return{x_2:l,x_3:i-l}}}function MZ(e){return Qx(e,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function",scalarMultBase:"function"}),Object.freeze({...e})}function TZ(e){const t=MZ(e),{P:n,type:s,adjustScalarBytes:r,powPminus2:i,randomBytes:a}=t,l=t.scalarMultBase,c=s==="x25519";if(!c&&s!=="x448")throw new Error("invalid type");const u=a===void 0?KM:a,d=c?255:448,f=AZ(n),p=c?32:56,x=BigInt(c?9:5),g=BigInt(c?121665:39081),v=c?O0**BigInt(254):O0**BigInt(447),y=c?BigInt(8)*(O0**BigInt(251)-jr):BigInt(4)*(O0**BigInt(445)-jr),m=v+y+jr,k=I=>Ot(I,n),b=j(x);function j(I){return QM(k(I),p)}function A(I){const O=F1(Fu(I,p,"uCoordinate"));return c&&(O[31]&=127),k(Yx(O))}function M(I){return Yx(r(F1(Fu(I,p,"scalar"))))}const T=new Set(c?[pl,jr,n-jr,BigInt("325606250916557431795983626356110631294008115727848805560023387167927233504"),BigInt("39382357235489614581723060781553021112529911719440698176882885853963445705823")]:[pl,jr,n-jr]);function z(I,O){const L=A(O);if(T.has(L))throw new Error("invalid private or public key received");const H=_(L,M(I));if(H===pl)throw new Error("invalid private or public key received");return j(H)}function $(I){if(l===void 0)return z(I,b);const O=M(I);p1("scalar",O,v,m);const L=k(l(O));if(L===pl)throw new Error("invalid private or public key received");return j(L)}const E=$,N=z;function _(I,O){p1("u",I,pl,n),p1("scalar",O,v,m);const L=O,H=I;let q=jr,U=pl,X=I,Z=jr;const ie=L^L>>jr;for(let fe=BigInt(d-1);fe>=pl;fe--){const se=h9(n,ie>>fe);({x_2:q,x_3:X}=f(se,q,X)),{x_2:U,x_3:Z}=f(se,U,Z);const ye=q+U,me=k(ye*ye),P=q-U,V=k(P*P),Y=me-V,oe=X+Z,F=X-Z,le=k(F*ye),ce=k(oe*P),ge=le+ce,ve=le-ce;X=k(ge*ge),Z=k(H*k(ve*ve)),q=k(me*V),U=k(Y*(me+k(g*Y)))}const ae=h9(n,L);({x_2:q,x_3:X}=f(ae,q,X)),{x_2:U,x_3:Z}=f(ae,U,Z);const xe=i(U);return k(q*xe)}const R={secretKey:p,publicKey:p,seed:p},B=I=>(I=I===void 0?u(p):I,Fu(I,R.seed,"seed"),I),D={randomSecretKey:B};return Object.freeze(R),Object.freeze(D),Object.freeze({keygen:SZ(B,E),getSharedSecret:N,getPublicKey:E,scalarMult:z,scalarMultBase:$,utils:D,GuBytes:b.slice(),lengths:R})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const p9=BigInt(0),zZ=BigInt(1),x9=BigInt(2),NZ=BigInt(3),_Z=BigInt(5),RZ=BigInt(8),fm=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),IZ={p:fm,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:RZ,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function cT(e){const t=BigInt(10),n=BigInt(20),s=BigInt(40),r=BigInt(80),i=fm,l=e*e%i*e%i,c=Xr(l,x9,i)*l%i,u=Xr(c,zZ,i)*e%i,d=Xr(u,_Z,i)*u%i,f=Xr(d,t,i)*d%i,p=Xr(f,n,i)*f%i,x=Xr(p,s,i)*p%i,g=Xr(x,r,i)*x%i,v=Xr(g,r,i)*x%i,y=Xr(v,t,i)*d%i;return{pow_p_5_8:Xr(y,x9,i)*e%i,b2:l}}function LZ(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const g9=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function OZ(e,t){const n=fm,s=Ot(t*t*t,n),r=Ot(s*s*t,n),i=cT(e*r).pow_p_5_8;let a=Ot(e*s*i,n);const l=Ot(t*a*a,n),c=a,u=Ot(a*g9,n),d=l===e,f=l===Ot(-e,n),p=l===Ot(-e*g9,n);return d&&(a=c),(f||p)&&(a=u),aZ(a,n)&&(a=Ot(-a,n)),{isValid:d||f,value:a}}const m9=$Z(IZ,{uvRatio:OZ}),F3=(()=>{const e=fm,t=n=>{const{pow_p_5_8:s,b2:r}=cT(n);return Ot(Xr(s,NZ,e)*r,e)};return TZ({P:e,type:"x25519",powPminus2:t,adjustScalarBytes:LZ,scalarMultBase:n=>{const s=Ot(n,m9.Fn.ORDER);if(s===p9)return p9;const r=m9.BASE.multiply(s);return Ot((r.Z+r.Y)*t(Ot(r.Z-r.Y,e)),e)}})})(),DZ=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);function Ko(e,t,n,s,r){return e=e+t+r|0,s=Xx(s^e,16),n=n+s|0,t=Xx(t^n,12),{a:e,b:t,c:n,d:s}}function Xo(e,t,n,s,r){return e=e+t+r|0,s=Xx(s^e,8),n=n+s|0,t=Xx(t^n,7),{a:e,b:t,c:n,d:s}}function BZ(e,t={},n,s,r){if(Ro(n),e<=0||e>n)throw new Error('"dkLen" must be 1..'+n+", got "+e);const{key:i,salt:a,personalization:l}=t;if(i!==void 0&&(i.length<1||i.length>n))throw new Error('"key" expected to be undefined or of length=1..'+n);a!==void 0&&Ir(a,s,"salt"),l!==void 0&&Ir(l,r,"personalization")}class HZ{constructor(t,n){be(this,"buffer");be(this,"buffer32");be(this,"finished",!1);be(this,"destroyed",!1);be(this,"length",0);be(this,"pos",0);be(this,"blockLen");be(this,"outputLen");be(this,"canXOF",!1);Ro(t),Ro(n),this.blockLen=t,this.outputLen=n,this.buffer=new Uint8Array(t),this.buffer32=Kx(this.buffer)}update(t){Wx(this),Ir(t);const{blockLen:n,buffer:s,buffer32:r}=this,i=t.length,a=t.byteOffset,l=t.buffer;for(let c=0;c<i;){this.pos===n&&(Jc(r),this.compress(r,0,!1),Jc(r),this.pos=0);const u=Math.min(n-this.pos,i-c),d=a+c;if(u===n&&!(d%4)&&c+u<i){const f=new Uint32Array(l,d,Math.floor((i-c)/4));Jc(f);for(let p=0;c+n<i;p+=r.length,c+=n)this.length+=n,this.compress(f,p,!1);Jc(f);continue}s.set(c===0&&u===i?t:t.subarray(c,c+u),this.pos),this.pos+=u,this.length+=u,c+=u}return this}digestInto(t){if(Wx(this),BM(t,this),t.byteOffset&3)throw new RangeError('"output" expected 4-byte aligned byteOffset, got '+t.byteOffset);const{pos:n,buffer32:s}=this;this.finished=!0,this.buffer.fill(0,n),Jc(s),this.compress(s,0,!0),Jc(s);const r=this.get(),i=t===this.buffer?s:Kx(t),a=Math.floor(this.outputLen/4);for(let d=0;d<a;d++)i[d]=Df(r[d]);const l=this.outputLen%4;if(!l)return;const c=a*4,u=r[a];for(let d=0;d<l;d++)t[c+d]=u>>>8*d}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}_cloneInto(t){const{buffer:n,length:s,finished:r,destroyed:i,outputLen:a,pos:l}=this;return t||(t=new this.constructor({dkLen:a})),t.set(...this.get()),t.buffer.set(n),t.destroyed=i,t.finished=r,t.length=s,t.pos=l,t.outputLen=a,t}clone(){return this._cloneInto()}}function qZ(e,t,n,s,r,i,a,l,c,u,d,f,p,x,g,v,y,m,k,b){let j=0;for(let A=0;A<s;A++)({a:r,b:c,c:p,d:y}=Ko(r,c,p,y,n[t+e[j++]])),{a:r,b:c,c:p,d:y}=Xo(r,c,p,y,n[t+e[j++]]),{a:i,b:u,c:x,d:m}=Ko(i,u,x,m,n[t+e[j++]]),{a:i,b:u,c:x,d:m}=Xo(i,u,x,m,n[t+e[j++]]),{a,b:d,c:g,d:k}=Ko(a,d,g,k,n[t+e[j++]]),{a,b:d,c:g,d:k}=Xo(a,d,g,k,n[t+e[j++]]),{a:l,b:f,c:v,d:b}=Ko(l,f,v,b,n[t+e[j++]]),{a:l,b:f,c:v,d:b}=Xo(l,f,v,b,n[t+e[j++]]),{a:r,b:u,c:g,d:b}=Ko(r,u,g,b,n[t+e[j++]]),{a:r,b:u,c:g,d:b}=Xo(r,u,g,b,n[t+e[j++]]),{a:i,b:d,c:v,d:y}=Ko(i,d,v,y,n[t+e[j++]]),{a:i,b:d,c:v,d:y}=Xo(i,d,v,y,n[t+e[j++]]),{a,b:f,c:p,d:m}=Ko(a,f,p,m,n[t+e[j++]]),{a,b:f,c:p,d:m}=Xo(a,f,p,m,n[t+e[j++]]),{a:l,b:c,c:x,d:k}=Ko(l,c,x,k,n[t+e[j++]]),{a:l,b:c,c:x,d:k}=Xo(l,c,x,k,n[t+e[j++]]);return{v0:r,v1:i,v2:a,v3:l,v4:c,v5:u,v6:d,v7:f,v8:p,v9:x,v10:g,v11:v,v12:y,v13:m,v14:k,v15:b}}const qn=GX.slice();class PZ extends HZ{constructor(n={}){n=FM({},n);const s=n.dkLen===void 0?32:n.dkLen;super(64,s);be(this,"v0",qn[0]|0);be(this,"v1",qn[1]|0);be(this,"v2",qn[2]|0);be(this,"v3",qn[3]|0);be(this,"v4",qn[4]|0);be(this,"v5",qn[5]|0);be(this,"v6",qn[6]|0);be(this,"v7",qn[7]|0);BZ(s,n,32,8,8);let{key:r,personalization:i,salt:a}=n,l=0;if(r!==void 0&&(Ir(r,void 0,"key"),l=r.length),this.v0^=this.outputLen|l<<8|65536|1<<24,a!==void 0){Ir(a,void 0,"salt");const c=Kx(n9(a));this.v4^=Df(c[0]),this.v5^=Df(c[1])}if(i!==void 0){Ir(i,void 0,"personalization");const c=Kx(n9(i));this.v6^=Df(c[0]),this.v7^=Df(c[1])}if(r!==void 0){const c=new Uint8Array(this.blockLen);c.set(r),this.update(c),hk(c)}}get(){const{v0:n,v1:s,v2:r,v3:i,v4:a,v5:l,v6:c,v7:u}=this;return[n,s,r,i,a,l,c,u]}set(n,s,r,i,a,l,c,u){this.v0=n|0,this.v1=s|0,this.v2=r|0,this.v3=i|0,this.v4=a|0,this.v5=l|0,this.v6=c|0,this.v7=u|0}compress(n,s,r){const i=BX(this.length),a=DX(this.length),{v0:l,v1:c,v2:u,v3:d,v4:f,v5:p,v6:x,v7:g,v8:v,v9:y,v10:m,v11:k,v12:b,v13:j,v14:A,v15:M}=qZ(DZ,s,n,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,qn[0],qn[1],qn[2],qn[3],i^qn[4],a^qn[5],r?~qn[6]:qn[6],qn[7]);this.v0^=l^v,this.v1^=c^y,this.v2^=u^m,this.v3^=d^k,this.v4^=f^b,this.v5^=p^j,this.v6^=x^A,this.v7^=g^M}destroy(){this.destroyed=!0,hk(this.buffer32),this.set(0,0,0,0,0,0,0,0)}}const yp=FX(e=>new PZ(e));class y9{constructor(t,n){be(this,"oHash");be(this,"iHash");be(this,"blockLen");be(this,"outputLen");be(this,"canXOF",!1);be(this,"finished",!1);be(this,"destroyed",!1);if(HX(t),Ir(n,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("expected Hash instance");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,r=new Uint8Array(s);r.set(n.length>s?t.create().update(n).digest():n);for(let i=0;i<r.length;i++)r[i]^=54;this.iHash.update(r),this.oHash=t.create();for(let i=0;i<r.length;i++)r[i]^=106;this.oHash.update(r),hk(r)}update(t){return Wx(this),this.iHash.update(t),this}digestInto(t){Wx(this),BM(t,this),this.finished=!0;const n=t.subarray(0,this.outputLen);this.iHash.digestInto(n),this.oHash.update(n),this.oHash.digestInto(n),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:s,finished:r,destroyed:i,blockLen:a,outputLen:l,canXOF:c}=this;return t=t,t.finished=r,t.destroyed=i,t.blockLen=a,t.outputLen=l,t.canXOF=c,t.oHash=n._cloneInto(t.oHash),t.iHash=s._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ty=(()=>{const e=(t,n,s)=>new y9(t,n).update(s).digest();return e.create=(t,n)=>new y9(t,n),e})(),UZ=new TextEncoder().encode("Noise_IK_25519_ChaChaPoly_BLAKE2s"),po=32,v9=65535,FZ=2n**64n-1n,k9=e=>yp(e,{dkLen:po}),eg=(...e)=>{const t=new Uint8Array(e.reduce((s,r)=>s+r.length,0));let n=0;for(const s of e)t.set(s,n),n+=s.length;return t};function b9(e,t,n){const s=ty(yp,e,t),r=ty(yp,s,new Uint8Array([1])),i=ty(yp,s,eg(r,new Uint8Array([2])));return[r,i]}function V3(){return Td(F3.utils.randomSecretKey())}function Td(e){if(e.length!==po)throw new Error(`X25519 private key must be ${po} bytes`);return{publicKey:F3.getPublicKey(e),privateKey:e}}const tg=(e,t)=>F3.getSharedSecret(e.privateKey,t);var Xu,Ul,nh,xk;class ny{constructor(){ue(this,nh);ue(this,Xu);ue(this,Ul,0n)}setKey(t){W(this,Xu,t),W(this,Ul,0n)}encrypt(t,n=new Uint8Array(0)){const s=S(this,Xu);return s===void 0?t:t9(s,C(this,nh,xk).call(this),n).encrypt(t)}decrypt(t,n=new Uint8Array(0)){const s=S(this,Xu);return s===void 0?t:t9(s,C(this,nh,xk).call(this),n).decrypt(t)}}Xu=new WeakMap,Ul=new WeakMap,nh=new WeakSet,xk=function(){if(S(this,Ul)===FZ)throw new Error("nonce exhausted");const t=new Uint8Array(12);return new DataView(t.buffer).setBigUint64(4,S(this,Ul),!0),W(this,Ul,S(this,Ul)+1n),t};var Fl,bi;class VZ{constructor(){ue(this,Fl);ue(this,bi);be(this,"cipher",new ny);const t=UZ;W(this,bi,t.length<=po?eg(t,new Uint8Array(po-t.length)):k9(t)),W(this,Fl,S(this,bi).slice())}mixKey(t){const[n,s]=b9(S(this,Fl),t);W(this,Fl,n),this.cipher.setKey(s.subarray(0,po))}mixHash(t){W(this,bi,k9(eg(S(this,bi),t)))}encryptAndHash(t){const n=this.cipher.encrypt(t,S(this,bi));return this.mixHash(n),n}decryptAndHash(t){const n=this.cipher.decrypt(t,S(this,bi));return this.mixHash(t),n}get handshakeHash(){return S(this,bi)}split(){const[t,n]=b9(S(this,Fl),new Uint8Array(0)),s=new ny;s.setKey(t.subarray(0,po));const r=new ny;return r.setKey(n.subarray(0,po)),[s,r]}}Fl=new WeakMap,bi=new WeakMap;function uT(e,t){if(e.offset+t>e.buffer.length)throw new Error("malformed Noise message");const n=e.buffer.subarray(e.offset,e.offset+t);return e.offset+=t,n}function GZ(e,t,n,s){t.push(n.ephemeral.publicKey),e.mixHash(n.ephemeral.publicKey),e.mixKey(tg(n.ephemeral,s)),t.push(e.encryptAndHash(n.static.publicKey)),e.mixKey(tg(n.static,s))}function WZ(e,t,n){const s=uT(t,po).slice();return e.mixHash(s),e.mixKey(tg(n.ephemeral,s)),e.mixKey(tg(n.static,s)),s}const w9=(e,t)=>{if(e.length>v9)throw new Error(`${t} exceeds ${v9} bytes`)};function KZ(e,t){const n=new VZ;return n.mixHash(e),n.mixHash(t),n}function dT(e){const t=e.ephemeral??V3(),n=KZ(e.prologue,e.remoteStatic);return{writeMessage1(s){const r=[];GZ(n,r,{static:e.static,ephemeral:t},e.remoteStatic),r.push(n.encryptAndHash(s));const i=eg(...r);return w9(i,"handshake message"),i},readMessage2(s){w9(s,"handshake message");const r={buffer:s,offset:0};WZ(n,r,{ephemeral:t,static:e.static});const i=n.decryptAndHash(uT(r,s.length-r.offset)),[a,l]=n.split();return{payload:i,result:{send:a,receive:l,handshakeHash:n.handshakeHash}}}}}const fT=new TextEncoder().encode("pinomad/1"),XZ=new TextEncoder().encode("pinomad-signal/1"),hT=new TextEncoder,pT=new TextDecoder("utf-8",{fatal:!0}),xT=e=>hT.encode(JSON.stringify(e));function ZZ(e){try{return JSON.parse(pT.decode(e))}catch{throw new Error("handshake payload is not JSON")}}function gT(e){const t=ZZ(e);if((t==null?void 0:t.v)!==1)throw new Error("unsupported host hello");return{v:1}}const Bf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Dh(e){let t="";for(let n=0;n<e.length;n+=3){const s=e[n],r=e[n+1],i=e[n+2];t+=Bf[s>>2]+Bf[(s&3)<<4|(r??0)>>4],r!==void 0&&(t+=Bf[(r&15)<<2|(i??0)>>6]),i!==void 0&&(t+=Bf[i&63])}return t}function Vi(e){if(e.length%4===1)throw new Error("invalid base64url");const t=new Map(Array.from(Bf,(s,r)=>[s,r])),n=[];for(let s=0;s<e.length;s+=4){const i=[...e.slice(s,s+4)].map(l=>{const c=t.get(l);if(c===void 0)throw new Error("invalid base64url");return c}),a=i.reduce((l,c,u)=>l|c<<18-u*6,0);n.push(a>>16&255),i.length>2&&n.push(a>>8&255),i.length>3&&n.push(a&255)}return new Uint8Array(n)}const D0=65518;var sh,rh,Zu;class mT{constructor(t){ue(this,sh);ue(this,rh);ue(this,Zu,[]);W(this,sh,t.send),W(this,rh,t.receive)}seal(t){const n=hT.encode(t),s=[];for(let r=0;r<=n.length;r+=D0){const i=r+D0>=n.length,a=new Uint8Array(1+Math.min(D0,n.length-r));if(a[0]=i?0:1,a.set(n.subarray(r,r+D0),1),s.push(S(this,sh).encrypt(a)),i)break}return s}open(t){const n=S(this,rh).decrypt(t),s=n[0];if(s!==0&&s!==1)throw new Error("bad record flag");if(S(this,Zu).push(n.subarray(1)),s===1)return;const r=YZ(S(this,Zu));return W(this,Zu,[]),pT.decode(r)}}sh=new WeakMap,rh=new WeakMap,Zu=new WeakMap;function YZ(e){const t=new Uint8Array(e.reduce((s,r)=>s+r.length,0));let n=0;for(const s of e)t.set(s,n),n+=s.length;return t}function gk(e){let t=e.pairing;return{label:e.url,open(n){const s=new WebSocket(e.url);s.binaryType="arraybuffer";const r=dT({prologue:e.prologue??fT,static:e.device,remoteStatic:e.hostKey});let i,a=[],l=!1,c=!1;const u=(f,p)=>{l||(l=!0,n.closed(f,p))},d=f=>{s.close(),u(1008,f)};return s.onopen=()=>{var p;(p=n.opened)==null||p.call(n);const f=t===void 0?{v:1}:{v:1,pair:t};s.send(r.writeMessage1(xT(f)))},s.onmessage=f=>{var p,x;try{const g=f.data instanceof ArrayBuffer?new Uint8Array(f.data):new Uint8Array(f.data);if(i===void 0){const{payload:v,result:y}=r.readMessage2(g);gT(v),i=new mT(y),c||(c=!0,(p=n.authenticated)==null||p.call(n)),t!==void 0&&(t=void 0,(x=e.onPaired)==null||x.call(e));const m=a;a=[];for(const k of m)for(const b of i.seal(k))s.send(b)}else{const v=i.open(g);v!==void 0&&n.message(v)}}catch(g){d(g instanceof Error?g.message:"secure channel failure")}},s.onclose=f=>u(f.code,f.reason===""?void 0:f.reason),s.onerror=()=>{},{send(f){if(i===void 0){a.push(f);return}for(const p of i.seal(f))s.send(p)},close(){s.close()}}}}}const mk=e=>{if(typeof e!="string")return!1;try{return Vi(e).length===32}catch{return!1}},QZ=e=>{if(typeof e!="string")return!1;try{const t=new URL(e).protocol;return t==="ws:"||t==="wss:"}catch{return!1}},JZ=e=>{if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.serverOrigin=="string"&&t.serverOrigin!==""&&mk(t.hostId)};function yT(e){if(typeof e!="object"||e===null)return;const t=e;if(!QZ(t.url)||!mk(t.hostKey)||!mk(t.privateKey))return;const n=JZ(t.account)?t.account:void 0,s=typeof t.name=="string"&&t.name!==""?t.name:void 0,r=um(t.endpointSet),i=iX(t.connectionMode),a=t.rtcSignalOnly===!0?!0:void 0;return{url:t.url,hostKey:t.hostKey,privateKey:t.privateKey,...s===void 0?{}:{name:s},...n===void 0?{}:{account:n},...r.kind==="valid"?{endpointSet:r.endpointSet}:{},...i===void 0?{}:{connectionMode:i},...a===void 0?{}:{rtcSignalOnly:a}}}function x1(e,t){const n=t.endpointSet??e.endpointSet,s=t.connectionMode??e.connectionMode,r=t.rtcSignalOnly??e.rtcSignalOnly,i=t.account!==void 0||e.account===void 0?void 0:t.privateKey===e.privateKey||e.account.vouched!==!0?e.account:{serverOrigin:e.account.serverOrigin,hostId:e.account.hostId};return{...t,...t.name===void 0&&e.name!==void 0?{name:e.name}:{},...i===void 0?{}:{account:i},...n===void 0?{}:{endpointSet:n},...s===void 0?{}:{connectionMode:s},...r===void 0?{}:{rtcSignalOnly:r}}}function vT(e,t){return{...e,endpointSet:t,url:L3(e.url,t)}}function kT(e,t){const n={...e};return"connectionMode"in t&&(t.connectionMode===void 0?delete n.connectionMode:n.connectionMode=t.connectionMode),"rtcSignalOnly"in t&&(t.rtcSignalOnly===void 0?delete n.rtcSignalOnly:n.rtcSignalOnly=t.rtcSignalOnly),n}function Bh(e){const t=l=>{if(l.name!==void 0)return l.name;try{return new URL(l.url).host}catch{return l.url}},n=e.map(t),s=e.map(()=>0),r=new Map;for(const l of n)r.set(l,(r.get(l)??0)+1);n.forEach((l,c)=>{r.get(l)>1&&(s[c]=6)});const i=l=>s[l]===0?n[l]:`${n[l]} · ${e[l].hostKey.slice(0,s[l])}`;for(;;){const l=new Map,c=new Set;if(e.forEach((d,f)=>{const p=l.get(i(f));p===void 0?l.set(i(f),f):(c.add(p),c.add(f))}),c.size===0)break;let u=!1;for(const d of c)s[d]>0&&s[d]<e[d].hostKey.length&&(s[d]+=1,u=!0);if(!u)break}const a=new Map;return e.forEach((l,c)=>a.set(l.hostKey,i(c))),a}function hm(){typeof Notification>"u"||Notification.permission!=="default"||Notification.requestPermission()}const eY=100*1024*1024,tY=4,au=(e,t)=>`${t}:${e}`,j9=(e,t,n)=>`${e??""}\0${au(t,n)}`;var ih,rs,da,Vl,fa,wi,$o,yk,vp;class nY{constructor(t=eY){ue(this,$o);ue(this,ih);ue(this,rs,new Map);ue(this,da,new Map);ue(this,Vl,[]);ue(this,fa,0);ue(this,wi,new Map);W(this,ih,t)}peek(t,n="original"){const s=S(this,rs).get(au(t,n));return s!==void 0||n==="original"?s:S(this,rs).get(au(t,"original"))}get(t,n="original"){let s=au(t,n);!S(this,rs).has(s)&&n!=="original"&&(s=au(t,"original"));const r=S(this,rs).get(s);if(r!==void 0)return S(this,rs).delete(s),S(this,rs).set(s,r),r}prime(t,n,s="original"){const r=au(t,s),i=S(this,rs).get(r);for(i!==void 0&&W(this,fa,S(this,fa)-i.data.length),S(this,rs).delete(r),S(this,rs).set(r,n),W(this,fa,S(this,fa)+n.data.length);S(this,fa)>S(this,ih);){const a=S(this,rs).keys().next().value;if(a===void 0)break;const l=S(this,rs).get(a);S(this,rs).delete(a),W(this,fa,S(this,fa)-l.data.length)}}load(t,n,s="original",r){const i=this.get(t,s);if(i!==void 0)return Promise.resolve(i);const a=r??"",l=j9(r,t,s),c=S(this,da).get(l)??(s==="original"?void 0:S(this,da).get(j9(r,t,"original")));if(c!==void 0)return c;const u=new Promise((d,f)=>{S(this,Vl).push({key:l,source:a,ref:t,variant:s,loader:n,resolve:d,reject:f})});return S(this,da).set(l,u),C(this,$o,yk).call(this),u}clear(){S(this,rs).clear(),S(this,da).clear(),S(this,Vl).length=0,W(this,fa,0),S(this,wi).clear()}}ih=new WeakMap,rs=new WeakMap,da=new WeakMap,Vl=new WeakMap,fa=new WeakMap,wi=new WeakMap,$o=new WeakSet,yk=function(){for(;;){const t=S(this,Vl).findIndex(r=>(S(this,wi).get(r.source)??0)<tY);if(t===-1)return;const[n]=S(this,Vl).splice(t,1);if(n===void 0)return;S(this,wi).set(n.source,(S(this,wi).get(n.source)??0)+1);let s;try{s=Promise.resolve(n.variant==="original"?n.loader(n.ref):n.loader(n.ref,n.variant))}catch(r){C(this,$o,vp).call(this,n),n.reject(r instanceof Error?r:new Error(String(r)));continue}s.then(r=>{this.prime(n.ref,r,r.variant??"original"),C(this,$o,vp).call(this,n),n.resolve(r)},r=>{C(this,$o,vp).call(this,n),n.reject(r instanceof Error?r:new Error(String(r)))})}},vp=function(t){S(this,da).delete(t.key);const n=(S(this,wi).get(t.source)??1)-1;n<=0?S(this,wi).delete(t.source):S(this,wi).set(t.source,n),C(this,$o,yk).call(this)};const ca=new nY;async function sY(e,t,n){return"data"in e?e:ca.load(e.ref,t,"original",n)}async function bT(e){await Promise.all(e.map(async t=>{if("data"in t)try{ca.prime(await KK(t),t)}catch{}}))}const Gu=e=>`data:${e.mimeType};base64,${e.data}`,wT=h.createContext(void 0);function rY({load:e,retryKey:t=0,source:n,children:s}){const r=h.useMemo(()=>({load:e,retryKey:t,...n===void 0?{}:{source:n}}),[e,t,n]);return o.jsx(wT.Provider,{value:r,children:s})}function iY(e){var a;const[t,n]=h.useState(0),s=h.useRef(e.connection),r=h.useRef(void 0),i=h.useRef(void 0);return h.useEffect(()=>{if(e.connection==="connected"&&s.current!=="connected"){const l=r.current;l!==void 0&&(l.main!==void 0||l.side!==void 0)?i.current={...l}:i.current=void 0}e.connection!=="connected"&&(i.current=void 0),s.current=e.connection},[e.connection]),h.useEffect(()=>{var c,u;if(e.connection!=="connected")return;const l=i.current;if(l!==void 0){let d=!1;if(l.main!==void 0&&e.conversation!==l.main&&(l.main=void 0,d=!0),l.side!==void 0&&((c=e.side)==null?void 0:c.conversation)!==l.side&&(l.side=void 0,d=!0),!d)return;l.main===void 0&&l.side===void 0&&(i.current=void 0),n(f=>f+1)}i.current===void 0&&(r.current={...e.conversation===void 0?{}:{main:e.conversation},...((u=e.side)==null?void 0:u.conversation)===void 0?{}:{side:e.side.conversation}})},[e.connection,e.conversation,(a=e.side)==null?void 0:a.conversation]),t}function G3(e,t,n="original",s=0){const r=h.useContext(wT),i=e!==void 0&&"ref"in e?e.ref:void 0,a=i===void 0?void 0:`${(r==null?void 0:r.source)??""}:${n}:${i}`,[l,c]=h.useState(void 0),u=(r==null?void 0:r.retryKey)??0,d=r==null?void 0:r.load,f=r==null?void 0:r.source;if(h.useEffect(()=>{if(i===void 0||a===void 0)return;const g=ca.get(i,n);if(g!==void 0){c({key:a,image:g});return}if(!t||d===void 0)return;let v=!1;return c(void 0),(n==="original"?ca.load(i,d,"original",f):ca.load(i,d,n,f).catch(()=>ca.load(i,d,"original",f))).then(m=>{v||c({key:a,image:m})},()=>{v||c({key:a,failed:!0})}),()=>{v=!0}},[i,a,t,u,d,f,n,s]),e===void 0)return{status:"loading"};if("data"in e)return{status:"ready",src:Gu(e)};const p=(l==null?void 0:l.key)===a?l:void 0;if(p!==void 0)return"image"in p?{status:"ready",src:Gu(p.image)}:{status:"error"};if(i===void 0)return{status:"loading"};const x=ca.peek(i,n);return x!==void 0?{status:"ready",src:Gu(x)}:{status:"loading"}}function jT(){const[e,t]=h.useState(null),[n,s]=h.useState(!1);return h.useEffect(()=>{if(e===null)return;if(typeof IntersectionObserver>"u"){s(!0);return}const r=new IntersectionObserver(i=>{i.some(a=>a.isIntersecting)&&(s(!0),r.disconnect())},{rootMargin:"100% 0px"});return r.observe(e),()=>r.disconnect()},[e]),[t,n]}function S9(e,t="original"){if("data"in e)return Gu(e);const n=ca.peek(e.ref,t);return n===void 0?void 0:Gu(n)}const oY=e=>{const t=[],n=s=>{t.push(s.summary);for(const r of s.children)n(r)};for(const s of[...e.chats,...e.projects.flatMap(r=>r.conversations)])n(s);return t};function aY(e,t){const n=[],s=[],r=new Map;for(const i of oY(t)){if(r.set(i.id,i.status),e===void 0)continue;const a=e.get(i.id);if(a!==i.status&&s.push(i.id),i.status==="needs-answer"&&a!=="needs-answer"){n.push({id:i.id,title:Dr(i),body:"Waiting for your answer"});continue}(a==="running"||a==="needs-answer")&&(i.status===void 0||i.status==="failed")&&i.kind!=="subagent"&&n.push({id:i.id,title:Dr(i),body:i.status==="failed"?"Failed":"Finished"})}if(e!==void 0)for(const i of e.keys())r.has(i)||s.push(i);return{notices:n,changed:s,baseline:r}}function ST(e,t,n,s,r=!0){const i=h.useRef(void 0),a=h.useRef(new Map),l=h.useRef(s);l.current=s,h.useEffect(()=>()=>{for(const c of a.current.values())c.close();a.current.clear()},[]),h.useEffect(()=>{var p;if(!r||e.connection!=="connected")return;const{notices:c,changed:u,baseline:d}=aY(i.current,e.organized);i.current=d;for(const x of u)(p=a.current.get(x))==null||p.close(),a.current.delete(x);if(typeof Notification>"u"||Notification.permission!=="granted")return;const f=t??"local";for(const x of c){if(document.visibilityState==="visible"&&document.hasFocus()&&n===x.id)continue;const g=new Notification(x.title,{body:x.body,tag:`pinomad-conversation-${f}-${x.id}`});a.current.set(x.id,g),g.onclose=()=>{a.current.get(x.id)===g&&a.current.delete(x.id)},g.onclick=()=>{window.focus(),l.current({hostKey:f,conversationId:x.id}),g.close(),a.current.get(x.id)===g&&a.current.delete(x.id)}}},[r,t,n,e.connection,e.organized])}function CT(e){const[t,n]=h.useState(),s=h.useRef(0),r=h.useCallback(a=>{const l=++s.current;n({id:a,failed:!1}),e.controller.switchConversation(a).then(()=>{var u;if(l!==s.current)return;const c=((u=e.view.current().conversation)==null?void 0:u.conversation.id)===a;n(c?void 0:{id:a,failed:!0})})},[e]),i=h.useCallback(()=>{s.current++,n(void 0)},[]);return{opening:t,open:r,cancel:i}}const lY="92px";function cY(e){var n;return(typeof document>"u"||(n=document.documentElement)==null?void 0:n.dataset.pinomadPlatform)==="darwin"?"darwin":"other"}function W3(e=cY()){return e==="darwin"?{platform:e,reserveMacTrafficLights:!0,safeLeft:lY}:{platform:e,reserveMacTrafficLights:!1,safeLeft:"0px"}}const uY={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},ET=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n,absoluteStrokeWidth:s=!1,className:r="",altIcon:i,showAlt:a=!1,icon:l,primaryColor:c,secondaryColor:u,disableSecondaryOpacity:d=!1,...f},p)=>{const x=n!==void 0?s?Number(n)*24/Number(t):n:void 0,g=x!==void 0?{strokeWidth:x,stroke:"currentColor"}:{},v={ref:p,...uY,width:t,height:t,color:c||e,className:r,...g,...f},m=[...a&&i?i:l].sort(([,k],[,b])=>{const j=k.opacity!==void 0;return b.opacity!==void 0?1:j?-1:0}).map(([k,b])=>{const j=b.opacity!==void 0,A=j&&!d?b.opacity:void 0,M=u?{...b.stroke!==void 0?{stroke:j?u:c||e}:{fill:j?u:c||e}}:{};return h.createElement(k,{...b,...g,...M,opacity:A,key:b.key})});return h.createElement("svg",v,m)});ET.displayName="HugeiconsIcon";const dY=[["path",{d:"M12.001 5.00003V19.002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19.002 12.002L4.99998 12.002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],fY=[["path",{d:"M6.53792 2.32172C6.69664 1.89276 7.30336 1.89276 7.46208 2.32172L8.1735 4.2443C8.27331 4.51403 8.48597 4.72669 8.7557 4.8265L10.6783 5.53792C11.1072 5.69664 11.1072 6.30336 10.6783 6.46208L8.7557 7.1735C8.48597 7.27331 8.27331 7.48597 8.1735 7.7557L7.46208 9.67828C7.30336 10.1072 6.69665 10.1072 6.53792 9.67828L5.8265 7.7557C5.72669 7.48597 5.51403 7.27331 5.2443 7.1735L3.32172 6.46208C2.89276 6.30336 2.89276 5.69665 3.32172 5.53792L5.2443 4.8265C5.51403 4.72669 5.72669 4.51403 5.8265 4.2443L6.53792 2.32172Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.4039 9.64136L15.8869 11.1244M6 22H7.49759C8.70997 22 9.31617 22 9.86124 21.7742C10.4063 21.5484 10.835 21.1198 11.6923 20.2625L19.8417 12.1131C20.3808 11.574 20.6503 11.3045 20.7944 11.0137C21.0685 10.4605 21.0685 9.81094 20.7944 9.25772C20.6503 8.96695 20.3808 8.69741 19.8417 8.15832C19.3026 7.61924 19.0331 7.3497 18.7423 7.20561C18.1891 6.93146 17.5395 6.93146 16.9863 7.20561C16.6955 7.3497 16.426 7.61924 15.8869 8.15832L7.73749 16.3077C6.8802 17.165 6.45156 17.5937 6.22578 18.1388C6 18.6838 6 19.29 6 20.5024V22Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],hY=[["path",{d:"M3 12C3 7.75736 3 5.63604 4.31802 4.31802C5.63604 3 7.75736 3 12 3C16.2426 3 18.364 3 19.682 4.31802C21 5.63604 21 7.75736 21 12C21 16.2426 21 18.364 19.682 19.682C18.364 21 16.2426 21 12 21C7.75736 21 5.63604 21 4.31802 19.682C3 18.364 3 16.2426 3 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.37545 7.99976H7.25045M7.37482 11.9999H7.24982M7.37498 15.9999H7.24998M7.50045 7.99976C7.50045 8.13783 7.38852 8.24976 7.25045 8.24976C7.11238 8.24976 7.00045 8.13783 7.00045 7.99976C7.00045 7.86169 7.11238 7.74976 7.25045 7.74976C7.38852 7.74976 7.50045 7.86169 7.50045 7.99976ZM7.49982 11.9999C7.49982 12.138 7.38789 12.2499 7.24982 12.2499C7.11175 12.2499 6.99982 12.138 6.99982 11.9999C6.99982 11.8618 7.11175 11.7499 7.24982 11.7499C7.38789 11.7499 7.49982 11.8618 7.49982 11.9999ZM7.49998 15.9999C7.49998 16.138 7.38805 16.2499 7.24998 16.2499C7.11191 16.2499 6.99998 16.138 6.99998 15.9999C6.99998 15.8618 7.11191 15.7499 7.24998 15.7499C7.38805 15.7499 7.49998 15.8618 7.49998 15.9999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 8H17M11 12H17M11 16H17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],pY=[["path",{d:"M8 3C7.28543 3.05475 6.78159 3.18135 6.34921 3.47408C5.58736 3.98988 5.22202 4.90323 4.49134 6.72994L2.42914 11.9271C2.21522 12.4619 2.10826 12.7293 2.05413 13.0104C2 13.2915 2 13.5795 2 14.1555V15C2 17.8284 2 19.2426 2.87868 20.1213C3.75736 21 5.17157 21 8 21H16C18.8284 21 20.2426 21 21.1213 20.1213C22 19.2426 22 17.8284 22 15V14.1555C22 13.5795 22 13.2915 21.9459 13.0104C21.8917 12.7293 21.7848 12.4619 21.5709 11.9271L19.5087 6.72994C18.778 4.90323 18.4126 3.98988 17.6508 3.47408C17.2184 3.18135 16.7146 3.05475 16 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 13H5.58579C6.16263 13 6.45105 13 6.71982 13.0766C6.86747 13.1187 7.00978 13.1776 7.14394 13.2523C7.38816 13.3882 7.59211 13.5921 8 14C8.40789 14.4079 8.61184 14.6118 8.85606 14.7477C8.99022 14.8224 9.13253 14.8813 9.28018 14.9234C9.54895 15 9.83737 15 10.4142 15H13.5858C14.1626 15 14.4511 15 14.7198 14.9234C14.8675 14.8813 15.0098 14.8224 15.1439 14.7477C15.3882 14.6118 15.5921 14.4079 16 14C16.4079 13.5921 16.6118 13.3882 16.8561 13.2523C16.9902 13.1776 17.1325 13.1187 17.2802 13.0766C17.5489 13 17.8374 13 18.4142 13H21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15 7.00002C15 7.00002 12.7905 9.99999 12 10C11.2094 10 9 7 9 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M12 3V9.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],xY=[["path",{d:"M9 15C9 15 11.2095 12 12 12C12.7906 12 15 15 15 15M12 13V21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M20 8V15.0093C20 17.8415 20 19.2576 19.1213 20.1375C18.48 20.7797 17.5534 20.9531 16 21M4 8V15.0093C4 17.8415 4 19.2576 4.87868 20.1375C5.51998 20.7797 6.44655 20.9531 7.99999 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M19.5 3H4.5C3.56538 3 3.09808 3 2.75 3.20096C2.52197 3.33261 2.33261 3.52197 2.20096 3.75C2 4.09808 2 4.56538 2 5.5C2 6.43462 2 6.90192 2.20096 7.25C2.33261 7.47803 2.52197 7.66739 2.75 7.79904C3.09808 8 3.56538 8 4.5 8H19.5C20.4346 8 20.9019 8 21.25 7.79904C21.478 7.66739 21.6674 7.47803 21.799 7.25C22 6.90192 22 6.43462 22 5.5C22 4.56538 22 4.09808 21.799 3.75C21.6674 3.52197 21.478 3.33261 21.25 3.20096C20.9019 3 20.4346 3 19.5 3Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],gY=[["path",{d:"M13 2H11C7.22876 2 5.34315 2 4.17157 3.17157C3 4.34315 3 6.22876 3 10V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V10C21 6.22876 21 4.34315 19.8284 3.17157C18.6569 2 16.7712 2 13 2Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M21 12H3",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15 7H9",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M15 17H9",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],mY=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],yY=[["path",{d:"M16.998 7.12652C17.3182 7.04393 17.654 7 18 7C20.2091 7 22 8.79086 22 11C22 13.2091 20.2091 15 18 15C17.6451 15 17.3009 14.9538 16.9733 14.867M16.998 7.12652C16.9993 7.08451 17 7.04233 17 7C17 4.79086 15.2091 3 13 3C11.0824 3 9.47994 4.34939 9.09041 6.15043M16.998 7.12652C16.9769 7.80763 16.7854 8.44584 16.4649 9M16.9733 14.867C16.9909 14.7472 17 14.6247 17 14.5C17 13.2905 16.1411 12.2816 15 12.05M16.9733 14.867C16.7957 16.0737 15.756 17 14.5 17H14C11.7909 17 10 18.7909 10 21M9.09041 6.15043C8.74377 6.05243 8.37801 6 8 6C5.79086 6 4 7.79086 4 10C4 10.3886 4.05542 10.7643 4.15878 11.1195M9.09041 6.15043C10.1015 6.43625 10.9498 7.10965 11.4649 8M4.15878 11.1195C2.9114 11.4832 2 12.6352 2 14C2 15.6569 3.34315 17 5 17C6.30622 17 7.41746 16.1652 7.82929 15M4.15878 11.1195C4.24921 11.4303 4.37632 11.7255 4.53513 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.8361 11.7435C11.3257 12.2353 10.453 12.3202 9.70713 11.9008C8.9612 11.4814 8.58031 10.6917 8.73535 10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],vY=[["path",{d:"M21.5 12C21.5 17.2467 17.2467 21.5 12 21.5C10.3719 21.5 8.8394 21.0904 7.5 20.3687C5.63177 19.362 4.37462 20.2979 3.26592 20.4658C3.09774 20.4913 2.93024 20.4302 2.80997 20.31C2.62741 20.1274 2.59266 19.8451 2.6935 19.6074C3.12865 18.5818 3.5282 16.6382 2.98341 15C2.6698 14.057 2.5 13.0483 2.5 12C2.5 6.75329 6.75329 2.5 12 2.5C17.2467 2.5 21.5 6.75329 21.5 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12.1257 12H12.0007M8.125 12H8M16.125 12H16M12.2507 12C12.2507 12.1381 12.1388 12.25 12.0007 12.25C11.8627 12.25 11.7507 12.1381 11.7507 12C11.7507 11.8619 11.8627 11.75 12.0007 11.75C12.1388 11.75 12.2507 11.8619 12.2507 12ZM8.25 12C8.25 12.1381 8.13807 12.25 8 12.25C7.86193 12.25 7.75 12.1381 7.75 12C7.75 11.8619 7.86193 11.75 8 11.75C8.13807 11.75 8.25 11.8619 8.25 12ZM16.25 12C16.25 12.1381 16.1381 12.25 16 12.25C15.8619 12.25 15.75 12.1381 15.75 12C15.75 11.8619 15.8619 11.75 16 11.75C16.1381 11.75 16.25 11.8619 16.25 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],kY=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],bY=[["path",{d:"M2 10.5C2 9.72921 2.01346 8.97679 2.03909 8.2503C2.12282 5.87683 2.16469 4.69009 3.13007 3.71745C4.09545 2.74481 5.3157 2.6926 7.7562 2.58819C9.09517 2.5309 10.5209 2.5 12 2.5C13.4791 2.5 14.9048 2.5309 16.2438 2.58819C18.6843 2.6926 19.9046 2.74481 20.8699 3.71745C21.8353 4.69009 21.8772 5.87683 21.9609 8.2503C21.9865 8.97679 22 9.72921 22 10.5C22 11.2708 21.9865 12.0232 21.9609 12.7497C21.8772 15.1232 21.8353 16.3099 20.8699 17.2826C19.9046 18.2552 18.6843 18.3074 16.2437 18.4118C15.5098 18.4432 14.7498 18.4667 13.9693 18.4815C13.2282 18.4955 12.8576 18.5026 12.532 18.6266C12.2064 18.7506 11.9325 18.9855 11.3845 19.4553L9.20503 21.3242C9.07273 21.4376 8.90419 21.5 8.72991 21.5C8.32679 21.5 8 21.1732 8 20.7701V18.4219C7.91842 18.4186 7.83715 18.4153 7.75619 18.4118C5.31569 18.3074 4.09545 18.2552 3.13007 17.2825C2.16469 16.3099 2.12282 15.1232 2.03909 12.7497C2.01346 12.0232 2 11.2708 2 10.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5 10.5H8.5M12 7V14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],wY=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12.5L10.5 15L16 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],jY=[["path",{d:"M9.00005 18C9.00005 18 15 13.5811 15 12C15 10.4188 9 6 9 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],SY=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],CY=[["path",{d:"M14 4H10C6.22876 4 4.34315 4 3.17157 5.17157C2 6.34315 2 8.22876 2 12C2 15.7712 2 17.6569 3.17157 18.8284C4.34315 20 6.22876 20 10 20H14C17.7712 20 19.6569 20 20.8284 18.8284C22 17.6569 22 15.7712 22 12C22 8.22876 22 6.34315 20.8284 5.17157C19.6569 4 17.7712 4 14 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7 9L8.83981 10.5858C9.61327 11.2525 10 11.5858 10 12C10 12.4142 9.61327 12.7475 8.83981 13.4142L7 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 16H17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],EY=[["path",{d:"M14 21H16M14 21C13.1716 21 12.5 20.3284 12.5 19.5V17L12 17M14 21H10M10 21H8M10 21C10.8284 21 11.5 20.3284 11.5 19.5V17L12 17M12 17V21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16 3H8C5.17157 3 3.75736 3 2.87868 3.87868C2 4.75736 2 6.17157 2 9V11C2 13.8284 2 15.2426 2.87868 16.1213C3.75736 17 5.17157 17 8 17H16C18.8284 17 20.2426 17 21.1213 16.1213C22 15.2426 22 13.8284 22 11V9C22 6.17157 22 4.75736 21.1213 3.87868C20.2426 3 18.8284 3 16 3Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],$Y=[["path",{d:"M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],AY=[["path",{d:"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.5 16.5L9.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.5 16.5L14.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],MY=[["path",{d:"M8 7L16 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 11L12 11",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],TY=[["path",{d:"M5.9925 12V18M9 14.9925L3 14.9925",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 22H9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 22C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V10.6569C21 9.83935 21 9.4306 20.8478 9.06306C20.6955 8.69552 20.4065 8.40649 19.8284 7.82843L15.0919 3.09188C14.593 2.593 14.3436 2.34355 14.0345 2.19575C13.9702 2.165 13.9044 2.13772 13.8372 2.11401C13.5141 2 13.1614 2 12.4558 2C9.21082 2 7.58831 2 6.48933 2.88607C6.26732 3.06508 6.06508 3.26731 5.88608 3.48933C5.14374 4.41003 5.02332 5.69818 5.00378 8M14 2.5V3C14 5.82843 14 7.24264 14.8787 8.12132C15.7574 9 17.1716 9 20 9H20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],zY=[["path",{d:"M13.5 16.5L15 18M14 14.5C14 15.8807 12.8807 17 11.5 17C10.1193 17 9 15.8807 9 14.5C9 13.1193 10.1193 12 11.5 12C12.8807 12 14 13.1193 14 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5M20 10.6569V14C20 17.7712 20 19.6569 18.8284 20.8284C17.6569 22 15.7712 22 12 22C8.22876 22 6.34315 22 5.17157 20.8284C4 19.6569 4 17.7712 4 14V9.45584C4 6.21082 4 4.58831 4.88607 3.48933C5.06508 3.26731 5.26731 3.06508 5.48933 2.88607C6.58831 2 8.21082 2 11.4558 2C12.1614 2 12.5141 2 12.8372 2.11401C12.9044 2.13772 12.9702 2.165 13.0345 2.19575C13.3436 2.34355 13.593 2.593 14.0919 3.09188L18.8284 7.82843C19.4065 8.40649 19.6955 8.69552 19.8478 9.06306C20 9.4306 20 9.83935 20 10.6569Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],NY=[["path",{d:"M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}]],_Y=[["path",{d:"M2 19V7.54902C2 6.10516 2 5.38322 2.24332 4.81647C2.5467 4.10985 3.10985 3.5467 3.81647 3.24332C4.38322 3 5.09805 3 6.54902 3H7.04311C7.64819 3 8.22075 3.27394 8.60041 3.74509L10.4175 6M10.4175 6H16C17.4001 6 18.1002 6 18.635 6.27248C19.1054 6.51217 19.4878 6.89462 19.7275 7.36502C20 7.8998 20 8.59987 20 10V11M10.4175 6H7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3.15802 15.5144L3.45643 14.7717C4.19029 12.9449 4.55723 12.0316 5.3224 11.5158C6.08757 11 7.07557 11 9.05157 11H17.1119C19.8004 11 21.1446 11 21.7422 11.8787C22.3397 12.7575 21.8405 14.0002 20.842 16.4856L20.5436 17.2283C19.8097 19.0551 19.4428 19.9684 18.6776 20.4842C17.9124 21 16.9244 21 14.9484 21H6.88812C4.19961 21 2.85535 21 2.25782 20.1213C1.66029 19.2425 2.15953 17.9998 3.15802 15.5144Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],RY=[["path",{d:"M13 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 13V21M22 17H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],IY=[["path",{d:"M8 6.50116H16.75C18.8567 6.50116 19.91 6.50116 20.6667 7.0069C20.9943 7.22584 21.2755 7.50717 21.4944 7.83484C22 8.59173 22 9.64538 22 11.7527C22 12.0122 22 12.2621 21.9997 12.5029M12 6.50116L11.3666 5.23392C10.8418 4.18406 10.3622 3.1273 9.19926 2.69106C8.6899 2.5 8.10802 2.5 6.94427 2.5C5.1278 2.5 4.21956 2.5 3.53806 2.88043C3.05227 3.15161 2.65142 3.55257 2.38032 4.03851C2 4.72021 2 5.62871 2 7.44571V10.5023C2 15.2177 2 17.5754 3.46447 19.0403C4.70529 20.2815 6.58687 20.4711 10 20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["circle",{cx:"14",cy:"12.5",r:"2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"20",cy:"18.5",r:"2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M18 18.5C15.7909 18.5 14 16.7091 14 14.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M14 14.5V21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],LY=[["path",{d:"M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M5 7L5 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"5",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["circle",{cx:"19",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["circle",{cx:"5",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"4"}]],OY=[["path",{d:"M6 8C7.10457 8 8 7.10457 8 6C8 4.89543 7.10457 4 6 4C4.89543 4 4 4.89543 4 6C4 7.10457 4.89543 8 6 8Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 20C13.1046 20 14 19.1046 14 18C14 16.8954 13.1046 16 12 16C10.8954 16 10 16.8954 10 18C10 19.1046 10.8954 20 12 20Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M18 8C19.1046 8 20 7.10457 20 6C20 4.89543 19.1046 4 18 4C16.8954 4 16 4.89543 16 6C16 7.10457 16.8954 8 18 8Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M6.01734 8.74067C6.01734 10.4142 5.77537 12.1995 9.22051 11.9855H12.0053M17.9929 8.57617C18.1259 11.9855 16.9199 11.7648 15.7861 11.9855H12.0053M12.0053 15.7001V11.9855",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],DY=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12C8 18 12 22 12 22C12 22 16 18 16 12C16 6 12 2 12 2C12 2 8 6 8 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 15H3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M21 9H3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],BY=[["path",{d:"M12 8.5L3.12132 17.3787C2.72349 17.7765 2.5 18.3161 2.5 18.8787C2.5 20.0503 3.44975 21 4.62132 21C5.18393 21 5.72349 20.7765 6.12132 20.3787L15 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16.1207 5.03693L20.3682 9.3197C21.014 9.97093 21.3369 10.2966 21.4435 10.6774C21.5188 10.9467 21.5188 11.2317 21.4435 11.501C21.3369 11.8819 21.014 12.2075 20.3682 12.8587C19.7223 13.51 19.3994 13.8356 19.0216 13.943C18.7546 14.019 18.4719 14.019 18.2048 13.943C17.8271 13.8356 17.5042 13.51 16.8583 12.8587L10.0245 5.96802C8.99015 4.92507 8.47297 4.40359 8.50109 3.94831C8.51495 3.7239 8.60259 3.51054 8.75017 3.34197C9.04956 3 9.78095 3 11.2437 3C12.4209 3 13.0095 3 13.5574 3.16035C13.8406 3.24325 14.1139 3.3574 14.3723 3.50071C14.8721 3.77792 15.2883 4.19759 16.1207 5.03693Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],HY=[["circle",{cx:"7.5",cy:"7.5",r:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M5 21C9.37246 15.775 14.2741 8.88406 21.4975 13.5424",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],qY=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 8.25H12M12.25 8.25C12.25 8.11193 12.1381 8 12 8C11.8619 8 11.75 8.11193 11.75 8.25C11.75 8.38807 11.8619 8.5 12 8.5C12.1381 8.5 12.25 8.38807 12.25 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],PY=[["path",{d:"M15 15.5C18.5899 15.5 21.5 12.5899 21.5 9C21.5 5.41015 18.5899 2.5 15 2.5C11.4101 2.5 8.5 5.41015 8.5 9C8.5 9.41773 8.5394 9.82625 8.6147 10.2221C8.75737 10.972 8.82871 11.347 8.75558 11.5844C8.68245 11.8217 8.47202 12.032 8.05118 12.4526L3.67253 16.8283C3.094 17.4064 2.80474 17.6955 2.65237 18.0631C2.5 18.4308 2.5 18.8398 2.5 19.6576V21.5H6V19.5H8V17.5H10L11.5526 15.9485C11.9729 15.5286 12.183 15.3186 12.4201 15.2456C12.6572 15.1726 13.0316 15.2436 13.7806 15.3858C14.1756 15.4608 14.5832 15.5 15 15.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 7.5C18 8.32843 17.3284 9 16.5 9C15.6716 9 15 8.32843 15 7.5C15 6.67157 15.6716 6 16.5 6C17.3284 6 18 6.67157 18 7.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],UY=[["path",{d:"M15.9999 13.5001V17.5001C15.9999 18.9143 15.9999 19.6214 16.4392 20.0608C16.8786 20.5001 17.5857 20.5001 18.9999 20.5001C20.4141 20.5001 21.1212 20.5001 21.5605 20.0608C21.9999 19.6214 21.9999 18.9143 21.9999 17.5001V13.5001C21.9999 12.0859 21.9999 11.3788 21.5605 10.9395C21.1212 10.5001 20.4141 10.5001 18.9999 10.5001C17.5857 10.5001 16.8786 10.5001 16.4392 10.9395C15.9999 11.3788 15.9999 12.0859 15.9999 13.5001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3.99988 16.5005V8.50049C3.99988 6.14347 3.99988 4.96495 4.73254 4.23272C5.46521 3.50049 6.64442 3.50049 9.00283 3.50049H16.007C18.3654 3.50049 19.5446 3.50049 20.2773 4.23272C20.8346 4.78969 20.9679 5.60486 20.9999 7.00049",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.9999 20.5005H2.51567C2.13273 20.5005 1.88367 20.1093 2.05493 19.7769L3.99988 16.5005H12.9999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],FY=[["path",{d:"M20.4999 16.5V8.5C20.4999 6.14298 20.4999 4.96447 19.7676 4.23223C19.0354 3.5 17.8569 3.5 15.4999 3.5H8.49988C6.14286 3.5 4.96434 3.5 4.23211 4.23223C3.49988 4.96447 3.49988 6.14298 3.49988 8.5V16.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M21.9841 20.5H2.01567C1.63273 20.5 1.38367 20.1088 1.55493 19.7764L3.49988 16.5H20.4999L22.4448 19.7764C22.6161 20.1088 22.367 20.5 21.9841 20.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],VY=[["path",{d:"M11.0991 3.00012C7.45013 3.00669 5.53932 3.09629 4.31817 4.31764C3.00034 5.63568 3.00034 7.75704 3.00034 11.9997C3.00034 16.2424 3.00034 18.3638 4.31817 19.6818C5.63599 20.9999 7.75701 20.9999 11.9991 20.9999C16.241 20.9999 18.3621 20.9999 19.6799 19.6818C20.901 18.4605 20.9906 16.5493 20.9972 12.8998",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M20.556 3.49612L11.0487 13.0586M20.556 3.49612C20.062 3.00151 16.7343 3.04761 16.0308 3.05762M20.556 3.49612C21.05 3.99074 21.0039 7.32273 20.9939 8.02714",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],GY=[["path",{d:"M6.00449 12.5V12M18.0045 12.5V12M12.0045 12.5V12M7.00449 12.5C7.00449 11.9477 6.55677 11.5 6.00449 11.5C5.4522 11.5 5.00449 11.9477 5.00449 12.5C5.00449 13.0523 5.4522 13.5 6.00449 13.5C6.55677 13.5 7.00449 13.0523 7.00449 12.5ZM19.0045 12.5C19.0045 11.9477 18.5568 11.5 18.0045 11.5C17.4522 11.5 17.0045 11.9477 17.0045 12.5C17.0045 13.0523 17.4522 13.5 18.0045 13.5C18.5568 13.5 19.0045 13.0523 19.0045 12.5ZM13.0045 12.5C13.0045 11.9477 12.5568 11.5 12.0045 11.5C11.4522 11.5 11.0045 11.9477 11.0045 12.5C11.0045 13.0523 11.4522 13.5 12.0045 13.5C12.5568 13.5 13.0045 13.0523 13.0045 12.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],WY=[["path",{d:"M15.2141 5.98239L16.6158 4.58063C17.39 3.80646 18.6452 3.80646 19.4194 4.58063C20.1935 5.3548 20.1935 6.60998 19.4194 7.38415L18.0176 8.78591M15.2141 5.98239L6.98023 14.2163C5.93493 15.2616 5.41226 15.7842 5.05637 16.4211C4.70047 17.058 4.3424 18.5619 4 20C5.43809 19.6576 6.94199 19.2995 7.57889 18.9436C8.21579 18.5877 8.73844 18.0651 9.78375 17.0198L18.0176 8.78591M15.2141 5.98239L18.0176 8.78591",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11 20H17",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],KY=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M19.5 12C19.5 11.0151 19.306 10.0398 18.9291 9.12987C18.5522 8.21993 17.9997 7.39314 17.3033 6.6967C16.6069 6.00026 15.7801 5.44781 14.8701 5.0709C13.9602 4.69399 12.9849 4.5 12 4.5L12 12H19.5Z",fill:"currentColor",key:"1"}]],XY=[["path",{d:"M12.828 6.00096C12.9388 5.68791 12.999 5.35099 12.999 5C12.999 3.34315 11.6559 2 9.99904 2C8.34219 2 6.99904 3.34315 6.99904 5C6.99904 5.35099 7.05932 5.68791 7.17008 6.00096C4.88532 6.0093 3.66601 6.09039 2.87772 6.87868C2.08951 7.66689 2.00836 8.88603 2 11.1704C2.31251 11.06 2.64876 11 2.99904 11C4.6559 11 5.99904 12.3431 5.99904 14C5.99904 15.6569 4.6559 17 2.99904 17C2.64876 17 2.31251 16.94 2 16.8296C2.00836 19.114 2.08951 20.3331 2.87772 21.1213C3.66593 21.9095 4.88508 21.9907 7.16941 21.999C7.05908 21.6865 6.99904 21.3503 6.99904 21C6.99904 19.3431 8.34219 18 9.99904 18C11.6559 18 12.999 19.3431 12.999 21C12.999 21.3503 12.939 21.6865 12.8287 21.999C15.113 21.9907 16.3322 21.9095 17.1204 21.1213C17.9086 20.333 17.9897 19.1137 17.9981 16.829C18.3111 16.9397 18.648 17 18.999 17C20.6559 17 21.999 15.6569 21.999 14C21.999 12.3431 20.6559 11 18.999 11C18.648 11 18.3111 11.0603 17.9981 11.171C17.9897 8.88627 17.9086 7.66697 17.1204 6.87868C16.3321 6.09039 15.1128 6.0093 12.828 6.00096Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],ZY=[["path",{d:"M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],YY=[["path",{d:"M12 4V2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M20 22C20 17.5817 16.4183 14 12 14C7.58172 14 4 17.5817 4 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.375 8.25H9.25M9.5 8.25C9.5 8.38807 9.38807 8.5 9.25 8.5C9.11193 8.5 9 8.38807 9 8.25C9 8.11193 9.11193 8 9.25 8C9.38807 8 9.5 8.11193 9.5 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.875 8.25H14.75M15 8.25C15 8.38807 14.8881 8.5 14.75 8.5C14.6119 8.5 14.5 8.38807 14.5 8.25C14.5 8.11193 14.6119 8 14.75 8C14.8881 8 15 8.11193 15 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M15.1538 4H8.84615C7.59095 4 6.96334 4 6.47397 4.22025C5.91693 4.47095 5.47095 4.91693 5.22025 5.47397C5 5.96334 5 6.59095 5 7.84615C5 9.85448 5 10.8586 5.3524 11.6417C5.75353 12.5329 6.46709 13.2465 7.35835 13.6476C8.14135 14 9.14552 14 11.1538 14H12.8462C14.8545 14 15.8586 14 16.6417 13.6476C17.5329 13.2465 18.2465 12.5329 18.6476 11.6417C19 10.8586 19 9.85448 19 7.84615C19 6.59095 19 5.96334 18.7797 5.47397C18.529 4.91693 18.0831 4.47095 17.526 4.22025C17.0367 4 16.4091 4 15.1538 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],QY=[["path",{d:"M15.5 15.0001L17.5 17.0001M16.5 11.5001C16.5 9.01483 14.4853 7.00011 12 7.00011C9.51472 7.00011 7.5 9.01483 7.5 11.5001C7.5 13.9854 9.51472 16.0001 12 16.0001C14.4853 16.0001 16.5 13.9854 16.5 11.5001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15 21.5001C16.8623 21.5001 17.7935 21.5001 18.5391 21.2287C19.789 20.7738 20.7737 19.7891 21.2286 18.5392C21.5 17.7936 21.5 16.8624 21.5 15.0001M9 21.5001C7.13769 21.5001 6.20653 21.5001 5.46091 21.2287C4.21096 20.7738 3.22633 19.7891 2.77138 18.5392C2.5 17.7936 2.5 16.8624 2.5 15.0001M9 2.50011C7.13769 2.50011 6.20653 2.50011 5.46091 2.77149C4.21096 3.22643 3.22633 4.21107 2.77138 5.46102C2.5 6.20664 2.5 7.13779 2.5 9.00011M15 2.50011C16.8623 2.50011 17.7935 2.50011 18.5391 2.77149C19.789 3.22643 20.7737 4.21107 21.2286 5.46102C21.5 6.20664 21.5 7.13779 21.5 9.00011",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],JY=[["path",{d:"M21.3175 7.14139L20.8239 6.28479C20.4506 5.63696 20.264 5.31305 19.9464 5.18388C19.6288 5.05472 19.2696 5.15664 18.5513 5.36048L17.3311 5.70418C16.8725 5.80994 16.3913 5.74994 15.9726 5.53479L15.6357 5.34042C15.2766 5.11043 15.0004 4.77133 14.8475 4.37274L14.5136 3.37536C14.294 2.71534 14.1842 2.38533 13.9228 2.19657C13.6615 2.00781 13.3143 2.00781 12.6199 2.00781H11.5051C10.8108 2.00781 10.4636 2.00781 10.2022 2.19657C9.94085 2.38533 9.83106 2.71534 9.61149 3.37536L9.27753 4.37274C9.12465 4.77133 8.84845 5.11043 8.48937 5.34042L8.15249 5.53479C7.73374 5.74994 7.25259 5.80994 6.79398 5.70418L5.57375 5.36048C4.85541 5.15664 4.49625 5.05472 4.17867 5.18388C3.86109 5.31305 3.67445 5.63696 3.30115 6.28479L2.80757 7.14139C2.45766 7.74864 2.2827 8.05227 2.31666 8.37549C2.35061 8.69871 2.58483 8.95918 3.05326 9.48012L4.0843 10.6328C4.3363 10.9518 4.51521 11.5078 4.51521 12.0077C4.51521 12.5078 4.33636 13.0636 4.08433 13.3827L3.05326 14.5354C2.58483 15.0564 2.35062 15.3168 2.31666 15.6401C2.2827 15.9633 2.45766 16.2669 2.80757 16.8741L3.30114 17.7307C3.67443 18.3785 3.86109 18.7025 4.17867 18.8316C4.49625 18.9608 4.85542 18.8589 5.57377 18.655L6.79394 18.3113C7.25263 18.2055 7.73387 18.2656 8.15267 18.4808L8.4895 18.6752C8.84851 18.9052 9.12464 19.2442 9.2775 19.6428L9.61149 20.6403C9.83106 21.3003 9.94085 21.6303 10.2022 21.8191C10.4636 22.0078 10.8108 22.0078 11.5051 22.0078H12.6199C13.3143 22.0078 13.6615 22.0078 13.9228 21.8191C14.1842 21.6303 14.294 21.3003 14.5136 20.6403L14.8476 19.6428C15.0004 19.2442 15.2765 18.9052 15.6356 18.6752L15.9724 18.4808C16.3912 18.2656 16.8724 18.2055 17.3311 18.3113L18.5513 18.655C19.2696 18.8589 19.6288 18.9608 19.9464 18.8316C20.264 18.7025 20.4506 18.3785 20.8239 17.7307L21.3175 16.8741C21.6674 16.2669 21.8423 15.9633 21.8084 15.6401C21.7744 15.3168 21.5402 15.0564 21.0718 14.5354L20.0407 13.3827C19.7887 13.0636 19.6098 12.5078 19.6098 12.0077C19.6098 11.5078 19.7888 10.9518 20.0407 10.6328L21.0718 9.48012C21.5402 8.95918 21.7744 8.69871 21.8084 8.37549C21.8423 8.05227 21.6674 7.74864 21.3175 7.14139Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5195 12C15.5195 13.933 13.9525 15.5 12.0195 15.5C10.0865 15.5 8.51953 13.933 8.51953 12C8.51953 10.067 10.0865 8.5 12.0195 8.5C13.9525 8.5 15.5195 10.067 15.5195 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],eQ=[["path",{d:"M15 2L15.5387 4.39157C15.9957 6.42015 17.5798 8.00431 19.6084 8.46127L22 9L19.6084 9.53873C17.5798 9.99569 15.9957 11.5798 15.5387 13.6084L15 16L14.4613 13.6084C14.0043 11.5798 12.4202 9.99569 10.3916 9.53873L8 9L10.3916 8.46127C12.4201 8.00431 14.0043 6.42015 14.4613 4.39158L15 2Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7 12L7.38481 13.7083C7.71121 15.1572 8.84275 16.2888 10.2917 16.6152L12 17L10.2917 17.3848C8.84275 17.7112 7.71121 18.8427 7.38481 20.2917L7 22L6.61519 20.2917C6.28879 18.8427 5.15725 17.7112 3.70827 17.3848L2 17L3.70827 16.6152C5.15725 16.2888 6.28879 15.1573 6.61519 13.7083L7 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],tQ=[["path",{d:"M2 11.5C2 12.6046 2.89543 13.5 4 13.5C5.65685 13.5 7 12.1569 7 10.5V6.5C7 4.84315 5.65685 3.5 4 3.5C2.89543 3.5 2 4.39543 2 5.5V11.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.4787 16.1937L15.2124 15.3337C14.9942 14.6289 14.8851 14.2765 14.969 13.9982C15.0369 13.7731 15.1859 13.579 15.389 13.4513C15.64 13.2935 16.0197 13.2935 16.7791 13.2935H17.1831C19.7532 13.2935 21.0382 13.2935 21.6452 12.5327C21.7145 12.4458 21.7762 12.3533 21.8296 12.2563C22.2965 11.4079 21.7657 10.2649 20.704 7.9789C19.7297 5.88111 19.2425 4.83222 18.338 4.21485C18.2505 4.15508 18.1605 4.0987 18.0683 4.04586C17.116 3.5 15.9362 3.5 13.5764 3.5H13.0646C10.2057 3.5 8.77628 3.5 7.88814 4.36053C7 5.22106 7 6.60607 7 9.37607V10.3497C7 11.8054 7 12.5332 7.25834 13.1994C7.51668 13.8656 8.01135 14.4134 9.00069 15.5089L13.0921 20.0394C13.1947 20.1531 13.246 20.2099 13.2913 20.2493C13.7135 20.6167 14.3652 20.5754 14.7344 20.1577C14.774 20.1129 14.8172 20.0501 14.9036 19.9245C15.0388 19.728 15.1064 19.6297 15.1654 19.5323C15.6928 18.6609 15.8524 17.6256 15.6108 16.6429C15.5838 16.5331 15.5488 16.4199 15.4787 16.1937Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],nQ=[["path",{d:"M2 12.5C2 11.3954 2.89543 10.5 4 10.5C5.65685 10.5 7 11.8431 7 13.5V17.5C7 19.1569 5.65685 20.5 4 20.5C2.89543 20.5 2 19.6046 2 18.5V12.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.4787 7.80626L15.2124 8.66634C14.9942 9.37111 14.8851 9.72349 14.969 10.0018C15.0369 10.2269 15.1859 10.421 15.389 10.5487C15.64 10.7065 16.0197 10.7065 16.7791 10.7065H17.1831C19.7532 10.7065 21.0382 10.7065 21.6452 11.4673C21.7145 11.5542 21.7762 11.6467 21.8296 11.7437C22.2965 12.5921 21.7657 13.7351 20.704 16.0211C19.7297 18.1189 19.2425 19.1678 18.338 19.7852C18.2505 19.8449 18.1605 19.9013 18.0683 19.9541C17.116 20.5 15.9362 20.5 13.5764 20.5H13.0646C10.2057 20.5 8.77628 20.5 7.88814 19.6395C7 18.7789 7 17.3939 7 14.6239V13.6503C7 12.1946 7 11.4668 7.25834 10.8006C7.51668 10.1344 8.01135 9.58664 9.00069 8.49112L13.0921 3.96056C13.1947 3.84694 13.246 3.79012 13.2913 3.75075C13.7135 3.38328 14.3652 3.42464 14.7344 3.84235C14.774 3.8871 14.8172 3.94991 14.9036 4.07554C15.0388 4.27205 15.1064 4.37031 15.1654 4.46765C15.6928 5.33913 15.8524 6.37436 15.6108 7.35715C15.5838 7.46692 15.5488 7.5801 15.4787 7.80626Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],sQ=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],rQ=[["path",{d:"M18.4984 19.1511C17.3377 17.4018 15.2947 16.2009 12.9313 16.0569L11.9984 16C11.6652 16.0083 11.3547 16.0194 11.0617 16.0325C8.71722 16.1376 6.66598 17.3796 5.5 19.1511",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.9961 10C14.9961 11.6569 13.6529 13 11.9961 13C10.3392 13 8.99609 11.6569 8.99609 10C8.99609 8.34315 10.3392 7 11.9961 7C13.6529 7 14.9961 8.34315 14.9961 10Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],iQ=1.75;function _e(e){return function(n){return o.jsx(ET,{color:"currentColor",icon:e,strokeWidth:iQ,...n})}}const oQ=_e(fY),aQ=_e(hY),lQ=_e(gY),$T=_e(pY),cQ=_e(xY),pm=_e(mY),Yd=_e(YY),uQ=_e(yY),AT=_e(kY),C9=_e(bY),vk=_e(vY),Zi=_e(jY),oa=_e(sQ),MT=_e(wY),dQ=_e(SY),xm=_e(CY),W1=_e(EY),K3=_e($Y),Qd=_e(MY),TT=_e(TY),fQ=_e(zY),hQ=_e(RY),K1=_e(NY),pQ=_e(IY),xQ=_e(_Y),zT=_e(LY),E9=_e(OY),gQ=_e(DY),mQ=_e(BY),X3=_e(HY),yQ=_e(qY),vQ=_e(PY),kQ=_e(UY),bQ=_e(FY),wQ=_e(KY),NT=_e(VY),Jd=_e(GY),_T=_e(WY),X1=_e(dY),jQ=_e(XY),Hh=_e(ZY),SQ=_e(QY),CQ=_e(JY),gm=_e(eQ),EQ=_e(tQ),$Q=_e(nQ),RT=_e(AY),AQ=_e(rQ);function Z3(e,t){return function({size:s=24,isAnimated:r=!0,className:i,ref:a,...l}){const c=h.useRef(null);return h.useImperativeHandle(a,()=>c.current,[]),h.useLayoutEffect(()=>{const u=c.current,d=u==null?void 0:u.closest("button, a, [role='menuitem']");if(!r||!u||!d)return;let f=d.matches(":hover");const p=v=>{v.relatedTarget instanceof Node&&!v.relatedTarget.isConnected&&(f=!0)},x=v=>{f||v.pointerType!=="mouse"||v.buttons!==0||d.matches(":disabled, [aria-disabled='true']")||(f=!0,u.setAttribute("data-icon-hover",""))},g=()=>{f=!1,u.removeAttribute("data-icon-hover")};return d.addEventListener("pointerenter",p),d.addEventListener("pointermove",x),d.addEventListener("pointerleave",g),()=>{d.removeEventListener("pointerenter",p),d.removeEventListener("pointermove",x),d.removeEventListener("pointerleave",g),u.removeAttribute("data-icon-hover")}},[r]),o.jsx("svg",{ref:c,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:`pigui-animated-icon ${i??""}`.trim(),"data-icon-motion":r?e:void 0,...l,children:t})}}const MQ=Z3("new-chat",o.jsxs(o.Fragment,{children:[o.jsxs("g",{"data-icon-part":"bubble",children:[o.jsx("path",{d:"M12.5 3.00372C11.6049 2.99039 10.7047 3.01289 9.8294 3.07107C5.64639 3.34913 2.31441 6.72838 2.04024 10.9707C1.98659 11.8009 1.98659 12.6607 2.04024 13.4909C2.1401 15.036 2.82343 16.4666 3.62791 17.6746C4.09501 18.5203 3.78674 19.5758 3.30021 20.4978C2.94941 21.1626 2.77401 21.495 2.91484 21.7351C3.05568 21.9752 3.37026 21.9829 3.99943 21.9982C5.24367 22.0285 6.08268 21.6757 6.74868 21.1846C7.1264 20.9061 7.31527 20.7668 7.44544 20.7508C7.5756 20.7348 7.83177 20.8403 8.34401 21.0513C8.8044 21.2409 9.33896 21.3579 9.8294 21.3905C11.2536 21.4852 12.7435 21.4854 14.1706 21.3905C18.3536 21.1125 21.6856 17.7332 21.9598 13.4909C22.0021 12.836 22.011 12.1627 21.9866 11.5"}),o.jsx("path",{d:"M8.5 15H15.5M8.5 10H12"})]}),o.jsx("path",{"data-icon-part":"add",d:"M15 5.5H22M18.5 2L18.5 9"})]})),IT=o.jsxs(o.Fragment,{children:[o.jsx("path",{d:"M13 3H11C7.22876 3 5.34315 3 4.17157 4.17157C3 5.34315 3 7.22876 3 11V13C3 16.7712 3 18.6569 4.17157 19.8284C5.34315 21 7.22876 21 11 21H13C16.7712 21 18.6569 21 19.8284 19.8284C21 18.6569 21 16.7712 21 13V11C21 7.22876 21 5.34315 19.8284 4.17157C18.6569 3 16.7712 3 13 3Z"}),o.jsx("path",{"data-icon-part":"divider",d:"M9 3V21"})]}),ng=Z3("sidebar",IT),TQ=Z3("sidebar",o.jsx("g",{transform:"translate(24 0) scale(-1 1)",children:IT}));function Y3(){var s;const e=(s=window.pinomadDesktop)==null?void 0:s.updates,[t,n]=h.useState();if(h.useEffect(()=>{if(e===void 0)return;let r=!0;e.status().then(a=>{r&&n(a)});const i=e.onStatus(a=>{r&&n(a)});return()=>{r=!1,i()}},[e]),!(e===void 0||t===void 0))return{status:t,check:()=>void e.check(),install:()=>void e.install()}}const zQ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Anthropic</title><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></svg>',NQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Arcee</title><path d="M13.236 2.377L2.751 20.493H0L11.863 0l1.373 2.377zm3.554 6.156l-9.606 11.96H4.13L15.511 6.32l1.279 2.212zm6.908 11.96H14.05l8.406-2.151 1.242 2.15zm-3.42-5.922l-7.843 5.92H8.482l10.597-7.997 1.2 2.077z" fill="#008C8C"></path></svg>',_Q='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Azure</title><path d="M7.242 1.613A1.11 1.11 0 018.295.857h6.977L8.03 22.316a1.11 1.11 0 01-1.052.755h-5.43a1.11 1.11 0 01-1.053-1.466L7.242 1.613z" fill="url(#lobe-icons-azure-0-_R_0_)"></path><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill="#0078D4"></path><path d="M15.272.857H7.497L0 23.071h7.775l1.596-4.73 5.068 4.73h6.665l-2.707-7.775h-7.998L15.272.857z" fill="url(#lobe-icons-azure-1-_R_0_)"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z" fill="url(#lobe-icons-azure-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-0-_R_0_" x1="8.247" x2="1.002" y1="1.626" y2="23.03"><stop stop-color="#114A8B"></stop><stop offset="1" stop-color="#0669BC"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-1-_R_0_" x1="14.042" x2="12.324" y1="15.302" y2="15.888"><stop stop-opacity=".3"></stop><stop offset=".071" stop-opacity=".2"></stop><stop offset=".321" stop-opacity=".1"></stop><stop offset=".623" stop-opacity=".05"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-2-_R_0_" x1="12.841" x2="20.793" y1="1.626" y2="22.814"><stop stop-color="#3CCBF4"></stop><stop offset="1" stop-color="#2892DF"></stop></linearGradient></defs></svg>',RQ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Baseten</title><path d="M2.316 4.8h14.682v4.8H7.31a.302.302 0 00-.308.3v4.2c0 .171.14.3.308.3h9.688v4.8h-4.686a.302.302 0 00-.308.3v4.2c0 .171.141.3.308.3h4.378a.297.297 0 00.308-.3v-4.5h4.694a.302.302 0 00.308-.3v-4.2c0-.171-.14-.3-.308-.3h-4.694V9.6h4.694A.302.302 0 0022 9.3V5.1c0-.171-.14-.3-.308-.3h-4.694V.3c0-.171-.14-.3-.308-.3H2.316A.31.31 0 002 .3v4.2c0 .171.14.3.316.3z"></path></svg>',IQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Bedrock</title><defs><linearGradient id="lobe-icons-bedrock-_R_0_" x1="80%" x2="20%" y1="20%" y2="80%"><stop offset="0%" stop-color="#6350FB"></stop><stop offset="50%" stop-color="#3D8FFF"></stop><stop offset="100%" stop-color="#9AD8F8"></stop></linearGradient></defs><path d="M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z" fill="url(#lobe-icons-bedrock-_R_0_)" fill-rule="nonzero"></path></svg>',LQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>ByteDance</title><path d="M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z" fill="#00C8D2" fill-rule="nonzero"></path><path d="M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z" fill="#3C8CFF" fill-rule="nonzero"></path><path d="M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z" fill="#78E6DC" fill-rule="nonzero"></path><path d="M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z" fill="#325AB4"></path></svg>',OQ='<svg fill="currentColor" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path></svg>',DQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Claude</title><path d="M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z" fill="#D97757" fill-rule="nonzero"></path></svg>',BQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cloudflare</title><path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437" fill="#F38020"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777" fill="#FCAD32"></path></svg>',HQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Codex</title><path d="M19.503 0H4.496A4.496 4.496 0 000 4.496v15.007A4.496 4.496 0 004.496 24h15.007A4.496 4.496 0 0024 19.503V4.496A4.496 4.496 0 0019.503 0z" fill="#fff"></path><path d="M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z" fill="url(#lobe-icons-codex-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-codex-_R_0_" x1="12" x2="12" y1="3" y2="21"><stop stop-color="#B1A7FF"></stop><stop offset=".5" stop-color="#7A9DFF"></stop><stop offset="1" stop-color="#3941FF"></stop></linearGradient></defs></svg>',qQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cohere</title><path clip-rule="evenodd" d="M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z" fill="#39594D" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z" fill="#D18EE2" fill-rule="evenodd"></path><path d="M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z" fill="#FF7759"></path></svg>',PQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>DeepSeek</title><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>',UQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Fireworks</title><path clip-rule="evenodd" d="M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z" fill="#5019C5" fill-rule="evenodd"></path></svg>',FQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-0-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-1-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-0-_R_0_" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-1-_R_0_" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-2-_R_0_" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs></svg>',VQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemma</title><defs><linearGradient id="lobe-icons-gemma-_R_0_" x1="24.419%" x2="75.194%" y1="75.581%" y2="25.194%"><stop offset="0%" stop-color="#446EFF"></stop><stop offset="36.661%" stop-color="#2E96FF"></stop><stop offset="83.221%" stop-color="#B1C5FF"></stop></linearGradient></defs><path d="M12.34 5.953a8.233 8.233 0 01-.247-1.125V3.72a8.25 8.25 0 015.562 2.232H12.34zm-.69 0c.113-.373.199-.755.257-1.145V3.72a8.25 8.25 0 00-5.562 2.232h5.304zm-5.433.187h5.373a7.98 7.98 0 01-.267.696 8.41 8.41 0 01-1.76 2.65L6.216 6.14zm-.264-.187H2.977v.187h2.915a8.436 8.436 0 00-2.357 5.767H0v.186h3.535a8.436 8.436 0 002.357 5.767H2.977v.186h2.976v2.977h.187v-2.915a8.436 8.436 0 005.767 2.357V24h.186v-3.535a8.436 8.436 0 005.767-2.357v2.915h.186v-2.977h2.977v-.186h-2.915a8.436 8.436 0 002.357-5.767H24v-.186h-3.535a8.436 8.436 0 00-2.357-5.767h2.915v-.187h-2.977V2.977h-.186v2.915a8.436 8.436 0 00-5.767-2.357V0h-.186v3.535A8.436 8.436 0 006.14 5.892V2.977h-.187v2.976zm6.14 14.326a8.25 8.25 0 005.562-2.233H12.34c-.108.367-.19.743-.247 1.126v1.107zm-.186-1.087a8.015 8.015 0 00-.258-1.146H6.345a8.25 8.25 0 005.562 2.233v-1.087zm-8.186-7.285h1.107a8.23 8.23 0 001.125-.247V6.345a8.25 8.25 0 00-2.232 5.562zm1.087.186H3.72a8.25 8.25 0 002.232 5.562v-5.304a8.012 8.012 0 00-1.145-.258zm15.47-.186a8.25 8.25 0 00-2.232-5.562v5.315c.367.108.743.19 1.126.247h1.107zm-1.086.186c-.39.058-.772.144-1.146.258v5.304a8.25 8.25 0 002.233-5.562h-1.087zm-1.332 5.69V12.41a7.97 7.97 0 00-.696.267 8.409 8.409 0 00-2.65 1.76l3.346 3.346zm0-6.18v-5.45l-.012-.013h-5.451c.076.235.162.468.26.696a8.698 8.698 0 001.819 2.688 8.698 8.698 0 002.688 1.82c.228.097.46.183.696.259zM6.14 17.848V12.41c.235.078.468.167.696.267a8.403 8.403 0 012.688 1.799 8.404 8.404 0 011.799 2.688c.1.228.19.46.267.696H6.152l-.012-.012zm0-6.245V6.326l3.29 3.29a8.716 8.716 0 01-2.594 1.728 8.14 8.14 0 01-.696.259zm6.257 6.257h5.277l-3.29-3.29a8.716 8.716 0 00-1.728 2.594 8.135 8.135 0 00-.259.696zm-2.347-7.81a9.435 9.435 0 01-2.88 1.96 9.14 9.14 0 012.88 1.94 9.14 9.14 0 011.94 2.88 9.435 9.435 0 011.96-2.88 9.14 9.14 0 012.88-1.94 9.435 9.435 0 01-2.88-1.96 9.434 9.434 0 01-1.96-2.88 9.14 9.14 0 01-1.94 2.88z" fill="url(#lobe-icons-gemma-_R_0_)" fill-rule="evenodd"></path></svg>',GQ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>GithubCopilot</title><path d="M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"></path></svg>',WQ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Grok</title><path d="M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"></path></svg>',KQ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Groq</title><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>',XQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>HuggingFace</title><path d="M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z" fill="#FF9D0B"></path><path d="M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z" fill="#FFD21E"></path><path d="M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z" fill="#FF323D"></path><path d="M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003zm1.12 5.34a2.166 2.166 0 011.325-1.106c.07-.02.144.06.219.171l.192.306c.069.1.139.175.209.175.074 0 .15-.074.223-.172l.205-.302c.08-.11.157-.188.234-.165.537.168.986.536 1.25 1.026.932-.724 1.275-1.905 1.275-2.633 0-.508-.306-.426-.81-.19l-.616.296c-.52.24-1.148.48-1.824.48-.676 0-1.302-.24-1.823-.48l-.589-.283c-.52-.248-.838-.342-.838.177 0 .703.32 1.831 1.187 2.56l.18.14z" fill="#3A3B45"></path><path d="M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8zM4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z" fill="#FF9D0B"></path><path d="M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z" fill="#FFD21E"></path></svg>',ZQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Hunyuan</title><circle cx="12" cy="12" fill="#0055E9" r="12"></circle><path d="M12 0c.518 0 1.028.033 1.528.096A6.188 6.188 0 0112.12 12.28l-.12.001c-2.99 0-5.242 2.179-5.554 5.11-.223 2.086.353 4.412 2.242 6.146C3.672 22.1 0 17.479 0 12 0 5.373 5.373 0 12 0z" fill="#A8DFF5"></path><path d="M5.286 5a2.438 2.438 0 01.682 3.38c-3.962 5.966-3.215 10.743 2.648 15.136C3.636 22.056 0 17.452 0 12c0-1.787.39-3.482 1.09-5.006.253-.435.525-.872.817-1.311A2.438 2.438 0 015.286 5z" fill="#0055E9"></path><path d="M12.98.04c.272.021.543.053.81.093.583.106 1.117.254 1.538.44 6.638 2.927 8.07 10.052 1.748 15.642a4.125 4.125 0 01-5.822-.358c-1.51-1.706-1.3-4.184.357-5.822.858-.848 3.108-1.223 4.045-2.441 1.257-1.634 2.122-6.009-2.523-7.506L12.98.039z" fill="#00BCFF"></path><path d="M13.528.096A6.187 6.187 0 0112 12.281a5.75 5.75 0 00-1.71.255c.147-.905.595-1.784 1.321-2.501.858-.848 3.108-1.223 4.045-2.441 1.27-1.651 2.14-6.104-2.676-7.554.184.014.367.033.548.056z" fill="#ECECEE"></path></svg>',YQ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>IBM</title><path clip-rule="evenodd" d="M24 16.333V17h-3.158v-.667H24zm-7.579 0V17h-3.158v-.667h3.158zm2.464 0L18.63 17l-.25-.667h.504zm-7.075 0a2.528 2.528 0 01-1.717.667h-5.04v-.667h6.757zm-7.389 0V17H0v-.667h4.421zm12-1.333v.667h-3.158V15h3.158zm2.958 0l-.246.667h-1L17.885 15h1.494zm-6.937 0c-.057.237-.148.46-.265.667H5.053V15h7.39zm-8.02 0v.667H0V15h4.421zM24 15v.667h-3.158V15H24zm-1.263-1.333v.666h-1.895v-.666h1.895zm-6.316 0v.666h-1.895v-.666h1.895zm3.453 0l-.248.666h-1.989l-.25-.666h2.487zm-7.52 0c.056.212.088.435.088.666h-2.337v-.666h2.249zm-4.143 0v.666H6.316v-.666H8.21zm-5.053 0v.666H1.263v-.666h1.895zm19.579-1.334V13h-1.895v-.667h1.895zm-6.316 0V13h-1.895v-.667h1.895zm3.948 0l-.247.667h-2.987l-.245-.667h3.48zm-8.792 0c.218.188.405.414.55.667H6.315v-.667h5.26zm-8.42 0V13H1.264v-.667h1.895zM18.456 11l.177.539.176-.539h3.929v.667h-1.895v-.613l-.215.613H16.63l-.209-.613v.613h-1.895V11h3.929zM3.158 11v.667H1.263V11h1.895zm8.968 0a2.555 2.555 0 01-.55.667h-5.26V11h5.81zm10.61-1.333v.666h-3.709l.224-.666h3.486zm-4.722 0l.224.666h-3.712v-.666h3.488zm-5.572 0c0 .23-.032.454-.088.666h-2.249v-.666h2.337zm-4.231 0v.666H6.316v-.666H8.21zm-5.053 0v.666H1.263v-.666h1.895zm14.419-1.334l.22.667h-4.534v-.667h4.314zm6.423 0V9h-4.536l.229-.667H24zm-11.823 0c.117.206.208.43.265.667h-7.39v-.667h7.125zm-7.756 0V9H0v-.667h4.421zM17.133 7l.224.667h-4.094V7h3.87zM24 7v.667h-4.089L20.13 7H24zM10.093 7c.662 0 1.264.253 1.717.667H5.053V7h5.04zM4.42 7v.667H0V7h4.421z"></path></svg>',QQ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Inception</title><path d="M14.767 1H7.884L1 7.883v6.884h6.884V7.883h6.883V1zM9.234 23h6.882L23 16.116V9.233h-6.884v6.883H9.234V23z"></path></svg>',JQ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Kimi</title><path d="M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z" fill="#1783FF"></path><path d="M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z" fill="currentColor"></path></svg>',eJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Kwaipilot</title><path d="M11.765.03C5.327.03.108 5.25.108 11.686c0 3.514 1.556 6.665 4.015 8.804L9.89 8.665h6.451L9.31 23.083c.807.173 1.63.26 2.455.26 6.438 0 11.657-5.22 11.657-11.658S18.202.028 11.765.028V.03z" fill="url(#lobe-icons-kwaipilot-0-_R_0_)"></path><path d="M4.123 20.489l6.362-13.046c.017-.036.035-.073.055-.11l.086-.18h.005a6.697 6.697 0 015.913-3.551c2.784 0 5.171 1.7 6.184 4.116-1.622-4.485-5.92-7.69-10.963-7.69C5.327.028.108 5.247.108 11.685c0 3.514 1.556 6.666 4.015 8.804z" fill="url(#lobe-icons-kwaipilot-1-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-kwaipilot-0-_R_0_" x1="13.469" x2="12.557" y1="4.823" y2="21.302"><stop offset=".313" stop-color="#9EC0E0"></stop><stop offset="1" stop-color="#fff"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-kwaipilot-1-_R_0_" x1="13.739" x2="5.647" y1="4.229" y2="17.386"><stop stop-color="#fff"></stop><stop offset="1" stop-color="#BCD5EC"></stop></linearGradient></defs></svg>',tJ='<svg fill="#144DFF" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Ling</title><path d="M9.561 0.074a0.46 0.46 0 0 1 0.517 0.011l2.848 1.357a0.222 0.222 0 0 1-0.033 0.374C9.008 3.93 6.663 5.994 5.43 7.997c-0.798 1.296-2.264 4.83-0.937 8.02 1.375 3.301 4.49 4.493 6.797 4.493 1.743 0 2.927-0.522 4.13-1.334 3.262-2.204 3.638-6.503 1.21-9.46a10 10 0 0 1 2.2 2.902 6.5 6.5 0 0 0-0.72-1.664c-0.72-1.176-1.688-2.163-3.056-2.849-3.045-1.526-9.397-0.79-10.397 5.78 0.1-4.557 3.127-7.416 5.868-8.3a9.7 9.7 0 0 1 4.654-0.314c2.029-1.639 4.272-2.376 5.075-2.601a0.53 0.53 0 0 1 0.522 0.137c0.23 0.23 0.63 0.632 1.142 1.135h0.003c0.152 0.15 0.073 0.41-0.138 0.45-1.974 0.38-3.322 0.755-4.746 1.412 1.727 0.698 3.206 1.92 4.108 3.606a0.367 0.367 0 0 1-0.199 0.52l-1.207 0.437c1.061 1.8 1.334 4.006 0.813 6.266-0.884 3.843-3.845 6.562-7.626 7.209a9.5 9.5 0 0 1-1.756 0.157 0.37 0.37 0 0 1-0.363-0.341 0.36 0.36 0 0 1-0.043-0.245l0.231-1.295c-1.055-0.074-2.045-0.248-3.036-0.648C2.077 19.094 1.46 13.297 2.304 9.785 3.4 5.23 6.766 1.78 9.561 0.074"></path></svg>',nJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Liquid</title><path d="M12.028 8.546l-.008.005 3.03 5.25a3.94 3.94 0 01.643 2.162c0 .754-.212 1.46-.58 2.062l6.173-1.991L11.63 0 9.304 3.872l2.724 4.674zM6.837 24l4.85-4.053h-.013c-2.219 0-4.017-1.784-4.017-3.984 0-.794.235-1.534.64-2.156l2.865-4.976-2.381-4.087L2 16.034 6.83 24h.007zM13.737 19.382h-.001L8.222 24h8.182l4.148-6.769-6.815 2.151z"></path></svg>',sJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>LM Studio</title><path d="M2.84 2a1.273 1.273 0 100 2.547h14.107a1.273 1.273 0 100-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H22.04a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h14.106a1.274 1.274 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H15.38a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h14.106a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h9.698a1.273 1.273 0 100-2.547h-9.698z" fill-opacity=".3"></path><path d="M2.84 2a1.273 1.273 0 100 2.547h10.287a1.274 1.274 0 000-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H18.22a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H11.56a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h5.78a1.273 1.273 0 100-2.547h-5.78z"></path></svg>',rJ='<svg fill="currentColor" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>LongCat</title><path clip-rule="evenodd" d="M.507 19.883a.507.507 0 01-.489-.642L4.29 3.745a1.013 1.013 0 011.533-.578l5.622 3.687a1.013 1.013 0 001.11 0L18.2 3.165a1.013 1.013 0 011.532.58l4.25 15.497a.506.506 0 01-.49.64H18.07a6.297 6.297 0 001.53-4.115v-.177a6.09 6.09 0 00-1.513-4.017l-.697-3.495a.438.438 0 00-.694-.266L14.07 9.781a.748.748 0 01-.654.121 5.156 5.156 0 00-2.833 0 .746.746 0 01-.653-.121L7.302 7.81a.435.435 0 00-.688.269l-.675 3.652a5.36 5.36 0 00-1.539 3.76v.333c0 1.474.527 2.9 1.488 4.02l.032.038H.507z" fill="#29E154" fill-rule="evenodd"></path><path d="M9.213 16.843h1.52v-3.546h-1.29l-.23 3.546zm5.573 0h-1.52v-3.546h1.29l.23 3.546z"></path></svg>',iJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Meta</title><path d="M6.897 4h-.024l-.031 2.615h.022c1.715 0 3.046 1.357 5.94 6.246l.175.297.012.02 1.62-2.438-.012-.019a48.763 48.763 0 00-1.098-1.716 28.01 28.01 0 00-1.175-1.629C10.413 4.932 8.812 4 6.896 4z" fill="url(#lobe-icons-meta-0-_R_0_)"></path><path d="M6.873 4C4.95 4.01 3.247 5.258 2.02 7.17a4.352 4.352 0 00-.01.017l2.254 1.231.011-.017c.718-1.083 1.61-1.774 2.568-1.785h.021L6.896 4h-.023z" fill="url(#lobe-icons-meta-1-_R_0_)"></path><path d="M2.019 7.17l-.011.017C1.2 8.447.598 9.995.274 11.664l-.005.022 2.534.6.004-.022c.27-1.467.786-2.828 1.456-3.845l.011-.017L2.02 7.17z" fill="url(#lobe-icons-meta-2-_R_0_)"></path><path d="M2.807 12.264l-2.533-.6-.005.022c-.177.918-.267 1.851-.269 2.786v.023l2.598.233v-.023a12.591 12.591 0 01.21-2.44z" fill="url(#lobe-icons-meta-3-_R_0_)"></path><path d="M2.677 15.537a5.462 5.462 0 01-.079-.813v-.022L0 14.468v.024a8.89 8.89 0 00.146 1.652l2.535-.585a4.106 4.106 0 01-.004-.022z" fill="url(#lobe-icons-meta-4-_R_0_)"></path><path d="M3.27 16.89c-.284-.31-.484-.756-.589-1.328l-.004-.021-2.535.585.004.021c.192 1.01.568 1.85 1.106 2.487l.014.017 2.018-1.745a2.106 2.106 0 01-.015-.016z" fill="url(#lobe-icons-meta-5-_R_0_)"></path><path d="M10.78 9.654c-1.528 2.35-2.454 3.825-2.454 3.825-2.035 3.2-2.739 3.917-3.871 3.917a1.545 1.545 0 01-1.186-.508l-2.017 1.744.014.017C2.01 19.518 3.058 20 4.356 20c1.963 0 3.374-.928 5.884-5.33l1.766-3.13a41.283 41.283 0 00-1.227-1.886z" fill="#0082FB"></path><path d="M13.502 5.946l-.016.016c-.4.43-.786.908-1.16 1.416.378.483.768 1.024 1.175 1.63.48-.743.928-1.345 1.367-1.807l.016-.016-1.382-1.24z" fill="url(#lobe-icons-meta-6-_R_0_)"></path><path d="M20.918 5.713C19.853 4.633 18.583 4 17.225 4c-1.432 0-2.637.787-3.723 1.944l-.016.016 1.382 1.24.016-.017c.715-.747 1.408-1.12 2.176-1.12.826 0 1.6.39 2.27 1.075l.015.016 1.589-1.425-.016-.016z" fill="#0082FB"></path><path d="M23.998 14.125c-.06-3.467-1.27-6.566-3.064-8.396l-.016-.016-1.588 1.424.015.016c1.35 1.392 2.277 3.98 2.361 6.971v.023h2.292v-.022z" fill="url(#lobe-icons-meta-7-_R_0_)"></path><path d="M23.998 14.15v-.023h-2.292v.022c.004.14.006.282.006.424 0 .815-.121 1.474-.368 1.95l-.011.022 1.708 1.782.013-.02c.62-.96.946-2.293.946-3.91 0-.083 0-.165-.002-.247z" fill="url(#lobe-icons-meta-8-_R_0_)"></path><path d="M21.344 16.52l-.011.02c-.214.402-.519.67-.917.787l.778 2.462a3.493 3.493 0 00.438-.182 3.558 3.558 0 001.366-1.218l.044-.065.012-.02-1.71-1.784z" fill="url(#lobe-icons-meta-9-_R_0_)"></path><path d="M19.92 17.393c-.262 0-.492-.039-.718-.14l-.798 2.522c.449.153.927.222 1.46.222.492 0 .943-.073 1.352-.215l-.78-2.462c-.167.05-.341.075-.517.073z" fill="url(#lobe-icons-meta-10-_R_0_)"></path><path d="M18.323 16.534l-.014-.017-1.836 1.914.016.017c.637.682 1.246 1.105 1.937 1.337l.797-2.52c-.291-.125-.573-.353-.9-.731z" fill="url(#lobe-icons-meta-11-_R_0_)"></path><path d="M18.309 16.515c-.55-.642-1.232-1.712-2.303-3.44l-1.396-2.336-.011-.02-1.62 2.438.012.02.989 1.668c.959 1.61 1.74 2.774 2.493 3.585l.016.016 1.834-1.914a2.353 2.353 0 01-.014-.017z" fill="url(#lobe-icons-meta-12-_R_0_)"></path><defs><linearGradient id="lobe-icons-meta-0-_R_0_" x1="75.897%" x2="26.312%" y1="89.199%" y2="12.194%"><stop offset=".06%" stop-color="#0867DF"></stop><stop offset="45.39%" stop-color="#0668E1"></stop><stop offset="85.91%" stop-color="#0064E0"></stop></linearGradient><linearGradient id="lobe-icons-meta-1-_R_0_" x1="21.67%" x2="97.068%" y1="75.874%" y2="23.985%"><stop offset="13.23%" stop-color="#0064DF"></stop><stop offset="99.88%" stop-color="#0064E0"></stop></linearGradient><linearGradient id="lobe-icons-meta-2-_R_0_" x1="38.263%" x2="60.895%" y1="89.127%" y2="16.131%"><stop offset="1.47%" stop-color="#0072EC"></stop><stop offset="68.81%" stop-color="#0064DF"></stop></linearGradient><linearGradient id="lobe-icons-meta-3-_R_0_" x1="47.032%" x2="52.15%" y1="90.19%" y2="15.745%"><stop offset="7.31%" stop-color="#007CF6"></stop><stop offset="99.43%" stop-color="#0072EC"></stop></linearGradient><linearGradient id="lobe-icons-meta-4-_R_0_" x1="52.155%" x2="47.591%" y1="58.301%" y2="37.004%"><stop offset="7.31%" stop-color="#007FF9"></stop><stop offset="100%" stop-color="#007CF6"></stop></linearGradient><linearGradient id="lobe-icons-meta-5-_R_0_" x1="37.689%" x2="61.961%" y1="12.502%" y2="63.624%"><stop offset="7.31%" stop-color="#007FF9"></stop><stop offset="100%" stop-color="#0082FB"></stop></linearGradient><linearGradient id="lobe-icons-meta-6-_R_0_" x1="34.808%" x2="62.313%" y1="68.859%" y2="23.174%"><stop offset="27.99%" stop-color="#007FF8"></stop><stop offset="91.41%" stop-color="#0082FB"></stop></linearGradient><linearGradient id="lobe-icons-meta-7-_R_0_" x1="43.762%" x2="57.602%" y1="6.235%" y2="98.514%"><stop offset="0%" stop-color="#0082FB"></stop><stop offset="99.95%" stop-color="#0081FA"></stop></linearGradient><linearGradient id="lobe-icons-meta-8-_R_0_" x1="60.055%" x2="39.88%" y1="4.661%" y2="69.077%"><stop offset="6.19%" stop-color="#0081FA"></stop><stop offset="100%" stop-color="#0080F9"></stop></linearGradient><linearGradient id="lobe-icons-meta-9-_R_0_" x1="30.282%" x2="61.081%" y1="59.32%" y2="33.244%"><stop offset="0%" stop-color="#027AF3"></stop><stop offset="100%" stop-color="#0080F9"></stop></linearGradient><linearGradient id="lobe-icons-meta-10-_R_0_" x1="20.433%" x2="82.112%" y1="50.001%" y2="50.001%"><stop offset="0%" stop-color="#0377EF"></stop><stop offset="99.94%" stop-color="#0279F1"></stop></linearGradient><linearGradient id="lobe-icons-meta-11-_R_0_" x1="40.303%" x2="72.394%" y1="35.298%" y2="57.811%"><stop offset=".19%" stop-color="#0471E9"></stop><stop offset="100%" stop-color="#0377EF"></stop></linearGradient><linearGradient id="lobe-icons-meta-12-_R_0_" x1="32.254%" x2="68.003%" y1="19.719%" y2="84.908%"><stop offset="27.65%" stop-color="#0867DF"></stop><stop offset="100%" stop-color="#0471E9"></stop></linearGradient></defs></svg>',oJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Azure</title><path d="M11.49 2H2v9.492h9.492V2h-.002z" fill="#F25022"></path><path d="M22 2h-9.492v9.492H22V2z" fill="#7FBA00"></path><path d="M11.49 12.508H2V22h9.492v-9.492h-.002z" fill="#00A4EF"></path><path d="M22 12.508h-9.492V22H22v-9.492z" fill="#FFB900"></path></svg>',aJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Minimax</title><defs><linearGradient id="lobe-icons-minimax-_R_0_" x1="0%" x2="100.182%" y1="50.057%" y2="50.057%"><stop offset="0%" stop-color="#E2167E"></stop><stop offset="100%" stop-color="#FE603C"></stop></linearGradient></defs><path d="M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z" fill="url(#lobe-icons-minimax-_R_0_)" fill-rule="nonzero"></path></svg>',lJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path></svg>',cJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>MoonshotAI</title><path d="M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"></path></svg>',uJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nova</title><g mask="url(#lobe-icons-nova-0-_R_0_)"><mask height="23.2727" id="lobe-icons-nova-0-_R_0_" maskUnits="userSpaceOnUse" style="mask-type:luminance" width="23.2727" x="0" y=".3636"><path d="M23.127 0.364H0v23.272h23.127z" fill="#fff"></path></mask><mask height="23.2727" id="lobe-icons-nova-1-_R_0_" maskUnits="userSpaceOnUse" style="mask-type:alpha" width="23.2727" x="0" y=".3636"><path d="M12.993 17.295l1.115 1.122c0.051 0.051 0.067 0.127 0.04 0.194l-1.744 4.449A0.902 0.902 0 0 1 11.564 23.636c-0.371 0-0.705-0.229-0.84-0.576l-2.51-6.403-4.06 4.085a0.179 0.179 0 0 1-0.254 0l-1.024-1.029a0.182 0.182 0 0 1 0-0.256l5.011-5.042a0.945 0.945 0 0 1 0.607-0.289 0.909 0.909 0 0 1 0.896 0.574l2.176 5.549 1.132-2.892a0.18 0.18 0 0 1 0.297-0.062z m5.981-14.037l-4.061 4.085-2.509-6.403a0.902 0.902 0 0 0-1.04-0.555c-0.301 0.067-0.541 0.296-0.653 0.586l-1.731 4.416a0.182 0.182 0 0 0 0.04 0.194l1.115 1.122c0.092 0.092 0.247 0.06 0.296-0.062L11.564 3.749l2.175 5.548a0.902 0.902 0 0 0 1.48 0.31l5.034-5.066a0.182 0.182 0 0 0 0-0.256L19.229 3.256a0.179 0.179 0 0 0-0.254 0zM6.239 13.139l-2.875-1.14 5.514-2.189c0.356-0.142 0.593-0.498 0.571-0.902a0.945 0.945 0 0 0-0.288-0.611l-5.008-5.04a0.179 0.179 0 0 0-0.254 0L2.876 4.287a0.182 0.182 0 0 0 0 0.257l4.06 4.085-6.364 2.525a0.909 0.909 0 0 0 0 1.691l4.421 1.754a0.175 0.175 0 0 0 0.194-0.04l1.115-1.121a0.182 0.182 0 0 0-0.062-0.298z m16.315-1.986l-4.422-1.754a0.175 0.175 0 0 0-0.192 0.04l-1.115 1.122a0.182 0.182 0 0 0 0.061 0.298L19.761 12l-5.514 2.189a0.913 0.913 0 0 0-0.571 0.902c0.013 0.231 0.125 0.447 0.287 0.611l5.011 5.041a0.179 0.179 0 0 0 0.254 0l1.023-1.03a0.182 0.182 0 0 0 0-0.256l-4.06-4.085 6.364-2.525a0.909 0.909 0 0 0 0-1.691z" fill="#fff"></path></mask><g mask="url(#lobe-icons-nova-1-_R_0_)"><path d="M-2.12 25.182h27.235V-1.17H-2.12z" fill="url(#lobe-icons-nova-2-_R_0_)"></path></g></g><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-nova-2-_R_0_" x1="24.4822" x2="-1.5171" y1="24.824" y2="-1.0189"><stop stop-color="#ff6200"></stop><stop offset=".399" stop-color="#e433ff"></stop><stop offset=".96" stop-color="#6842ff"></stop></linearGradient></defs></svg>',dJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path></svg>',fJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Ollama</title><path d="M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z"></path></svg>',hJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenAI</title><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></svg>',pJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>opencode</title><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></svg>',xJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M18.654 3.87a5.087 5.087 0 110 10.174L23.7 19.09c.64.641.187 1.737-.72 1.737H8.48a8.479 8.479 0 010-16.958h10.175zM8.479 7.26a5.087 5.087 0 100 10.176 5.087 5.087 0 000-10.175z"></path></svg>',gJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Poolside</title><g clip-path="url(#lobe-icons-poolside-0-_R_0_)"><mask height="24" id="lobe-icons-poolside-4-_R_0_" maskUnits="userSpaceOnUse" style="mask-type:alpha" width="24" x="0" y="0"><path d="M24 0H0v24h24V0z" fill="url(#lobe-icons-poolside-1-_R_0_)"></path><path d="M24 0H0v24h24V0z" fill="url(#lobe-icons-poolside-2-_R_0_)"></path><path d="M24 0H0v24h24V0z" fill="url(#lobe-icons-poolside-3-_R_0_)"></path></mask><g mask="url(#lobe-icons-poolside-4-_R_0_)"><path d="M6.742 22.786a11.93 11.93 0 01-5.232-4.963 11.98 11.98 0 01-1.463-6.886.975.975 0 011.943.173c-.178 2.005.246 4 1.226 5.769a9.968 9.968 0 003.526 3.685l4.586-9.405c-1.795-.598-3.29-.338-3.425-.312l-.058.012a.972.972 0 01-1.054-.576c-.24-.448-.96-1.544-1.834-1.97-.873-.426-2.218-.289-2.651-.195a.977.977 0 01-1.087-1.38C4.117.792 11.315-1.686 17.262 1.215c5.946 2.9 8.422 10.093 5.529 16.038l-.01.02c-2.903 5.94-10.095 8.414-16.039 5.514zm6.338-10.773l-4.586 9.405c4.629 1.73 9.896-.192 12.304-4.558-.338-.524-.932-1.275-1.62-1.61-.888-.434-2.19-.292-2.637-.198a.989.989 0 01-.616-.055.984.984 0 01-.49-.473c-.028-.058-.739-1.438-2.355-2.51zM5.81 6.56c.747.365 1.356.944 1.81 1.49 1.406-2.15 3.314-3.774 4.787-4.82a20.81 20.81 0 011.66-1.067A10.078 10.078 0 003.882 6.077c.617.042 1.297.174 1.929.482zm12.671-2.243c.09.624.152 1.294.182 1.965.083 1.801-.021 4.296-.844 6.722.686.018 1.484.14 2.214.495.652.318 1.198.8 1.628 1.28a10.082 10.082 0 00-3.18-10.462zm-5.394 5.46a9.522 9.522 0 012.984 2.287c1.075-3.493.606-7.402.215-8.85-1.381.584-4.75 2.62-6.84 5.618a9.515 9.515 0 013.64.944z" fill="#4137FF"></path></g></g><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-poolside-1-_R_0_" x1="6.75" x2="5.625" y1="20.55" y2="20.55"><stop></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-poolside-2-_R_0_" x1="6.825" x2="7.2" y1="11.85" y2="11.137"><stop stop-opacity="0"></stop><stop offset="1"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-poolside-3-_R_0_" x1=".975" x2=".975" y1="20.512" y2="10.912"><stop></stop><stop offset=".105" stop-opacity=".9"></stop><stop offset=".904" stop-opacity=".04"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><clipPath id="lobe-icons-poolside-0-_R_0_"><path d="M0 0h24v24H0z" fill="#fff"></path></clipPath></defs></svg>',mJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Qwen</title><path d="M19.713 2.825h-5.907c0-.251-.066-.503-.196-.728L12.819.728A1.46 1.46 0 0 0 11.559 0h-1.58c-.52 0-1 .275-1.26.728l-2.42 4.19a1.45 1.45 0 0 0 0 1.453l.791 1.37c.26.448.74.727 1.26.727h11.36c.52 0 1-.275 1.26-.728l.79-1.37a1.45 1.45 0 0 0 0-1.451l-.79-1.37a1.46 1.46 0 0 0-1.26-.728zM.195 9.905l2.951 5.115a1.46 1.46 0 0 0-.531.531l-.791 1.37a1.45 1.45 0 0 0 0 1.452l.79 1.37c.26.448.74.727 1.26.727h4.84c.52 0 1-.275 1.26-.728l.79-1.37a1.45 1.45 0 0 0 0-1.451L5.086 7.083a1.46 1.46 0 0 0-1.26-.728h-1.58c-.52 0-1 .276-1.26.728l-.79 1.37a1.45 1.45 0 0 0 0 1.452m15.888 13.367 2.951-5.115c.217.125.469.196.728.196h1.582c.52 0 1-.275 1.26-.728l.79-1.37a1.45 1.45 0 0 0 0-1.451l-2.42-4.191a1.46 1.46 0 0 0-1.259-.728h-1.582c-.52 0-1 .276-1.259.728l-5.678 9.838a1.45 1.45 0 0 0 0 1.452l.79 1.37c.26.448.74.727 1.26.727h1.582c.52 0 1-.275 1.26-.728z" fill="#082dff"></path></svg>',yJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Reka</title><path d="M3.662.014C4.347.004 5.052.012 5.74.012h3.9q1.01.006 2.02-.006c-.005.87-.01 1.779 0 2.647-.16-.027-.593-.018-.774-.018H4.943l-1.408.001c-.263.001-.595.01-.852-.004.014 1.216.002 2.455.002 3.673v4.681c0 .185-.008.48.016.656-.834-.039-1.849-.005-2.7-.01.032-.717.008-1.576.008-2.307V3.69c-.001-.44-.023-.812.065-1.246.11-.557.377-1.07.77-1.481A3 3 0 0 1 2.756.03c.245-.022.644-.01.905-.017M23.74 11.641c-.688-.03-1.54-.007-2.237-.007H15.92c-.853.001-1.373.024-2.139-.422a3.02 3.02 0 0 1-1.4-1.842c-.146-.553-.1-1.285-.1-1.863V5.299l-.002-1.535c0-.37-.011-.794.035-1.156.053-.388.183-.763.382-1.1A3.01 3.01 0 0 1 15.102.013c.387-.022.869-.01 1.261-.01l2.224.001h1.607c.88-.001 1.449-.037 2.237.426a3.02 3.02 0 0 1 1.293 1.544c.08.217.12.395.177.615v1.027c-.072.167-.123.472-.227.719a3.04 3.04 0 0 1-1.176 1.375c-.318.204-.74.34-1.098.467l-.951.34-3.181 1.132c-.552.196-1.205.41-1.74.626-.03-.646.008-1.316-.007-1.965-.005-.2-.006-.432.01-.632.463-.189.96-.368 1.43-.547l2.719-1.038c.357-.137.717-.268 1.074-.405.174-.067.352-.135.433-.315.186-.414-.112-.74-.538-.739q-.555 0-1.106.003l-2.161-.002H16.12c-.248 0-.506-.008-.752.018-.124.008-.327.157-.362.28-.07.246-.052.597-.052.852l.003 1.055V7.5c0 .497.01 1.024-.004 1.519.334-.026.816-.01 1.164-.01H18.2c1.825 0 3.726-.027 5.547.004-.023.228-.01.686-.01.93zm-11.272.779h7.626c.361 0 .814-.013 1.165.03a3.04 3.04 0 0 1 2.45 1.907c.084.215.13.419.192.64v6.485c-.052.193-.097.395-.166.58a3.05 3.05 0 0 1-1.352 1.597c-.154.088-.241.13-.404.19-.078.028-.388.124-.43.15h-6.903c-.062-.036-.497-.172-.648-.245A3.05 3.05 0 0 1 12.444 22c-.47-1.365.06-2.953 1.31-3.685.356-.209.745-.33 1.132-.467l1.37-.486c1.465-.52 2.956-1.073 4.424-1.571-.029.83.016 1.742-.005 2.588-.121.057-.337.13-.468.18l-.894.34-2.847 1.085c-.158.06-.327.118-.481.181-.188.098-.73.226-.864.37-.36.388-.097.89.415.887.42-.003.772 0 1.15-.002l1.988.001h1.367c.256 0 .52.008.774-.013.21-.018.393-.228.416-.432.026-.229.018-.458.017-.688l-.001-1.018v-2.639c0-.516-.008-1.054.006-1.568-1.352-.03-2.79-.007-4.148-.007-1.532 0-3.117-.02-4.645.007.015-.292.006-.642.006-.939zm-4.554.015c.33-.021.705-.002 1.04-.008.847-.016 1.738.023 2.582-.002-.195.22-.434.43-.646.637l-1.017 1.002L7.04 16.84c-.435.427-.912.866-1.333 1.304.124.154.418.431.571.585l1.084 1.082 2.176 2.168q1.034 1 2.047 2.022H7.849c-.248-.236-.495-.493-.74-.735l-1.632-1.6q-.595-.569-1.18-1.147c-.27-.268-.57-.541-.775-.86a2.656 2.656 0 0 1 .338-3.262c.21-.22.454-.447.672-.66l1.58-1.548q.611-.612 1.239-1.21c.137-.134.427-.44.564-.543m-7.909-.001c.755-.032 1.53.006 2.286-.008.13-.002.273-.003.403.002-.029.317-.01.988-.01 1.338v2.557L2.686 24H.007l.002-7.917V13.61c0-.34-.018-.847-.003-1.175"></path></svg>',vJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>sakana.ai</title><path d="M15.568 3.02c2.621-.149 5.368.572 7.88 1.323.455.136.642.493.511.962-.425 1.516-.763 3.077-1.34 4.545a17.1 17.1 0 0 1-6.447 7.982c-1.461.975-3.224 1.864-4.747 2.784-.774.431-1.528.91-2.313 1.32-.301.158-.741.006-.912-.278a.75.75 0 0 1-.082-.572c.126-.468 1.603-1.182 2.066-1.448l3.579-2.058c-1.09-1.631-2.457-2.584-4.184-3.438-.644 2.639-2.597 4.942-4.872 6.37q-.066.045-.135.084a.863.863 0 0 1-1.136-.295c-.141-.225.04-.672.253-.794 2.31-1.324 3.771-3.218 4.552-5.757-1.557-.467-3.522-.362-5.072.091-.833.244-1.463.574-2.23.953a.71.71 0 0 1-.8-.278c-.626-.937 1.02-1.5 1.699-1.763a10.94 10.94 0 0 1 6.684-.427c.16-1.959-.05-3.54-.89-5.333-.818.47-5.133 3.08-5.6 3.14A.73.73 0 0 1 1.5 9.98a.7.7 0 0 1-.263-.484.78.78 0 0 1 .181-.558c.297-.33 2.11-1.277 2.616-1.566 4.122-2.362 6.6-4.11 11.533-4.351M8.89 6.223c.921 1.992 1.411 4.3.989 6.484 2.027.813 3.96 2.242 5.13 4.107l.477-.309c2.955-2.1 4.873-4.56 6.052-8.024.332-.974.533-1.999.832-2.969-2.234-.589-4.6-1.284-6.955-1.063-2.413.164-4.356.675-6.525 1.774" fill="#e10600"></path></svg>',kJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Stepfun</title><path d="M22.012 0h1.032v.927H24v.968h-.956V3.78h-1.032V1.896h-1.878v-.97h1.878V0zM2.6 12.371V1.87h.969v10.502h-.97zm10.423.66h10.95v.918h-6.208v9.579h-4.742V13.03zM5.629 3.333v12.356H0v4.51h10.386V8L20.859 8l-.003-4.668-15.227.001z" fill="url(#lobe-icons-stepfun-_R_0_)" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-stepfun-_R_0_" x1="1.646" x2="18.342" y1="1.916" y2="22.091"><stop stop-color="#01A9FF"></stop><stop offset="1" stop-color="#0160FF"></stop></linearGradient></defs></svg>',bJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>together.ai</title><path d="M23.197 4.503A6 6 0 0015 2.307a5.973 5.973 0 00-2.995 4.933l5.996.008v.515h-5.996c.039.937.298 1.87.8 2.74a6 6 0 1010.39-6z" fill="#EF2CC1"></path><path d="M.805 4.5A6 6 0 003 12.697a5.972 5.972 0 005.77.127L5.779 7.627l.446-.257 2.997 5.192A6 6 0 10.804 4.5z" fill="#CAAEF5"></path><path d="M12 23.894a6 6 0 005.999-6c0-2.13-1.1-3.996-2.775-5.06l-3.005 5.189-.444-.258 2.997-5.192A6 6 0 1012 23.894z" fill="#FC4C02"></path></svg>',wJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Upsate</title><path d="M19.763 0l-.373 1.297h2.594L22.354 0h-2.591zM16.192 2.27l-.376 1.298h5.52l.37-1.298h-5.514zM12.897 4.54l-.376 1.298h8.166l.37-1.298h-8.16zM2.85 6.81l-.377 1.298h17.565l.37-1.297H2.848zM3.884 9.081l-.376 1.297H19.39l.37-1.297H3.882zM4.088 24l.376-1.297H1.866L1.5 24h2.588zM7.662 21.73l.376-1.297H2.515L2.15 21.73h5.513zM10.957 19.459l.376-1.297h-8.17l-.366 1.297h8.16zM21.005 17.189l.376-1.297H3.812l-.366 1.297h17.559zM19.967 14.919l.376-1.297H4.461l-.366 1.297h15.872zM18.786 12.649l.376-1.297H4.26l-.366 1.297h14.893z" fill="url(#lobe-icons-upsate-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-upsate-_R_0_" x1="11.927" x2="11.927" y2="24"><stop offset="0" stop-color="#AEBCFE"></stop><stop offset="1" stop-color="#805DFA"></stop></linearGradient></defs></svg>',jJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Vercel</title><path d="M12 0l12 20.785H0L12 0z"></path></svg>',SJ='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>VertexAI</title><path d="M11.995 20.216a1.892 1.892 0 100 3.785 1.892 1.892 0 000-3.785zm0 2.806a.927.927 0 11.927-.914.914.914 0 01-.927.914z" fill="#4285F4"></path><path clip-rule="evenodd" d="M21.687 14.144c.237.038.452.16.605.344a.978.978 0 01-.18 1.3l-8.24 6.082a1.892 1.892 0 00-1.147-1.508l8.28-6.08a.991.991 0 01.682-.138z" fill="#669DF6" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M10.122 21.842l-8.217-6.066a.952.952 0 01-.206-1.287.978.978 0 011.287-.206l8.28 6.08a1.893 1.893 0 00-1.144 1.479z" fill="#AECBFA" fill-rule="evenodd"></path><path d="M4.273 4.475a.978.978 0 01-.965-.965V1.09a.978.978 0 111.943 0v2.42a.978.978 0 01-.978.965zM4.247 13.034a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 10.19a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 7.332a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#AECBFA"></path><path d="M19.718 7.307a.978.978 0 01-.965-.979v-2.42a.965.965 0 011.93 0v2.42a.964.964 0 01-.965.979zM19.743 13.047a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 10.151a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 2.068a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#4285F4"></path><path d="M11.995 15.917a.978.978 0 01-.965-.965v-2.459a.978.978 0 011.943 0v2.433a.976.976 0 01-.978.991zM11.995 18.762a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 10.64a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 7.783a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#669DF6"></path><path d="M15.856 10.177a.978.978 0 01-.965-.965v-2.42a.977.977 0 011.702-.763.979.979 0 01.241.763v2.42a.978.978 0 01-.978.965zM15.869 4.913a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 12.996a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#4285F4"></path><path d="M8.121 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 7.783a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 4.913a.978.978 0 100-1.957.978.978 0 000 1.957zM8.134 12.996a.978.978 0 01-.978-.94V9.611a.965.965 0 011.93 0v2.445a.966.966 0 01-.952.94z" fill="#AECBFA"></path></svg>',CJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Grok</title><path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"></path></svg>',EJ='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>XiaomiMiMo</title><path d="M.958 15.936a.459.459 0 01.459.44v2.729a.46.46 0 01-.918 0v-2.729a.459.459 0 01.459-.44zm4.814-2.035a.46.46 0 01.553.45v4.754a.458.458 0 11-.918 0V15.48L3.74 17.202a.462.462 0 01-.655.016.462.462 0 01-.065-.082L.628 14.67a.459.459 0 01.658-.637l2.124 2.187 2.127-2.188a.46.46 0 01.235-.13zm2.068.004a.46.46 0 01.458.445v4.755a.46.46 0 01-.458.458.459.459 0 01-.458-.458V14.35a.459.459 0 01.458-.445zm1.973 2.014a.46.46 0 01.46.457v2.729a.46.46 0 01-.784.324.46.46 0 01-.134-.324v-2.729a.46.46 0 01.458-.458zm.002-2.045a.458.458 0 01.328.157l2.127 2.19 2.125-2.19a.459.459 0 01.784.318v4.756a.46.46 0 01-.455.458.46.46 0 01-.458-.458V15.48l-1.667 1.723a.46.46 0 01-.65.008l-.005-.005c0-.002-.002-.002-.004-.003l-2.455-2.534a.46.46 0 01-.008-.667.461.461 0 01.338-.128zm6.797 1.206a.46.46 0 01.53.651A1.966 1.966 0 0019.81 18.4a.462.462 0 01.623.18.46.46 0 01-.181.624 2.863 2.863 0 01-1.38.353l-.142-.004a2.88 2.88 0 01-2.393-4.263.461.461 0 01.274-.21zm.864-.931a2.884 2.884 0 013.915 3.914.46.46 0 01-.402.24l-.057-.004a.458.458 0 01-.164-.055.46.46 0 01-.182-.622 1.967 1.967 0 00-2.669-2.67.459.459 0 11-.441-.803zM9.59 6.368c1.481 0 1.696 1.202 1.696 1.654v2.648h-.917v-.432c-.26.346-.792.535-1.36.535-.133 0-1.289-.03-1.384-1.136-.082-.932.675-1.61 2.053-1.61h.691c0-.563-.367-.886-.983-.886-.44.013-.864.174-1.2.458l-.36-.664c.484-.379 1.012-.567 1.764-.567zm4.427.1c1.263 0 2.082.97 2.083 2.15 0 1.181-.824 2.154-2.083 2.154-1.26 0-2.084-.972-2.084-2.152 0-1.18.82-2.153 2.084-2.153zm6.801.015c.68 0 1.202.465 1.197 1.548v2.642H21.1V8.29c0-.312-.002-.98-.63-.98s-.628.667-.628.838v2.524h-.89V8.148c0-.17-.001-.838-.63-.838-.628 0-.628.668-.628.98v2.383h-.917v-4.03h.917V7a1.22 1.22 0 01.947-.516c.398 0 .76.193.982.686a1.321 1.321 0 011.195-.686zm-18.093.872l1.457-1.772H5.32L3.311 8.07l2.14 2.602H4.24L2.725 8.796 1.21 10.672H0L2.138 8.07.13 5.583h1.138l1.458 1.772zm4.149 3.317h-.916V6.644h.916v4.028zm16.99 0h-.916V6.644h.916v4.028zM9.925 8.71c-1.055 0-1.359.412-1.326.742.032.329.324.537.757.537a1.013 1.013 0 001.014-.968l.002-.31h-.447zM14.018 7.3c-.663 0-1.184.487-1.184 1.32 0 .832.52 1.32 1.184 1.32.662 0 1.182-.49 1.182-1.32 0-.832-.52-1.32-1.182-1.32zM6.417 5.001a.568.568 0 01.587.582.588.588 0 01-1.175 0A.57.57 0 016.417 5zm16.991 0a.57.57 0 01.592.582.588.588 0 01-1.174 0 .57.57 0 01.357-.542.572.572 0 01.225-.04z"></path></svg>',$J='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Z.ai</title><path d="M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"></path></svg>',AJ=Object.assign({"./logos/anthropic.svg":zQ,"./logos/arcee-color.svg":NQ,"./logos/azure-color.svg":_Q,"./logos/baseten.svg":RQ,"./logos/bedrock-color.svg":IQ,"./logos/bytedance-color.svg":LQ,"./logos/cerebras-color.svg":OQ,"./logos/claude-color.svg":DQ,"./logos/cloudflare-color.svg":BQ,"./logos/codex-color.svg":HQ,"./logos/cohere-color.svg":qQ,"./logos/deepseek-color.svg":PQ,"./logos/fireworks-color.svg":UQ,"./logos/gemini-color.svg":FQ,"./logos/gemma-color.svg":VQ,"./logos/githubcopilot.svg":GQ,"./logos/grok.svg":WQ,"./logos/groq.svg":KQ,"./logos/huggingface-color.svg":XQ,"./logos/hunyuan-color.svg":ZQ,"./logos/ibm.svg":YQ,"./logos/inception.svg":QQ,"./logos/kimi-color.svg":JQ,"./logos/kwaipilot-color.svg":eJ,"./logos/ling-color.svg":tJ,"./logos/liquid.svg":nJ,"./logos/lmstudio.svg":sJ,"./logos/longcat-color.svg":rJ,"./logos/meta-color.svg":iJ,"./logos/microsoft-color.svg":oJ,"./logos/minimax-color.svg":aJ,"./logos/mistral-color.svg":lJ,"./logos/moonshot.svg":cJ,"./logos/nova-color.svg":uJ,"./logos/nvidia-color.svg":dJ,"./logos/ollama.svg":fJ,"./logos/openai.svg":hJ,"./logos/opencode.svg":pJ,"./logos/openrouter.svg":xJ,"./logos/poolside-color.svg":gJ,"./logos/qwen-color.svg":mJ,"./logos/reka.svg":yJ,"./logos/sakana-color.svg":vJ,"./logos/stepfun-color.svg":kJ,"./logos/together-color.svg":bJ,"./logos/upstage-color.svg":wJ,"./logos/vercel.svg":jJ,"./logos/vertexai-color.svg":SJ,"./logos/xai.svg":CJ,"./logos/xiaomimimo.svg":EJ,"./logos/zai.svg":$J}),MJ=[["anthropic","anthropic"],["openai-codex","codex-color"],["openai","openai"],["github-copilot","githubcopilot"],["xai","xai"],["kimi-coding","kimi-color"],["meta","meta-color"],["openrouter","openrouter"],["google-vertex","vertexai-color"],["google","gemini-color"],["amazon-bedrock","bedrock-color"],["azure","azure-color"],["deepseek","deepseek-color"],["mistral","mistral-color"],["groq","groq"],["cerebras","cerebras-color"],["together","together-color"],["fireworks","fireworks-color"],["baseten","baseten"],["huggingface","huggingface-color"],["nvidia","nvidia-color"],["vercel-ai-gateway","vercel"],["cloudflare","cloudflare-color"],["zai","zai"],["moonshotai","moonshot"],["minimax","minimax-color"],["qwen-token-plan","qwen-color"],["xiaomi","xiaomimimo"],["ant-ling","ling-color"],["opencode","opencode"],["ollama","ollama"],["lmstudio","lmstudio"]],LT=e=>{var t;return(t=MJ.find(([n])=>e===n||e.startsWith(`${n}-`)))==null?void 0:t[1]},OT=e=>{var t;return(t=AJ[`./logos/${e}.svg`])==null?void 0:t.replace(/<title>.*?<\/title>/,"")},$9=e=>{const t=LT(e);return t===void 0?void 0:OT(t)},TJ="11434",zJ=e=>{try{return new URL(e).port}catch{return}},NJ=e=>e.split(/\s+/).filter(t=>t!=="").slice(0,2).map(t=>t[0].toUpperCase()).join("");function ua({providerId:e,name:t,baseUrl:n,size:s=32}){const r=n===void 0?$9(e):zJ(n)===TJ?$9("ollama"):void 0,i={"--provider-logo-size":`${s}px`};return r===void 0?o.jsx("span",{className:"provider-logo","data-initials":"",style:i,"aria-hidden":"true",children:NJ(t)}):o.jsx("span",{className:"provider-logo",style:i,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:r}})}const _J=[[/^claude/,"claude-color"],[/^(gpt|chatgpt|codex)|^o\d$/,"openai"],[/^gemini/,"gemini-color"],[/gemma/,"gemma-color"],[/^grok/,"grok"],[/^(qwen|qwq|qvq)/,"qwen-color"],[/^deepseek/,"deepseek-color"],[/^(kimi|moonshot)/,"kimi-color"],[/^(glm|chatglm)/,"zai"],[/^minimax/,"minimax-color"],[/^(mistral|mixtral|codestral|devstral|magistral|ministral|pixtral|voxtral)/,"mistral-color"],[/^llama|^muse$/,"meta-color"],[/^(mimo|xiaomimimo)/,"xiaomimimo"],[/^(nvidia|nemotron)/,"nvidia-color"],[/^nova$/,"nova-color"],[/^(command|c4ai|aya|cohere)$/,"cohere-color"],[/^(seed|doubao|bytedance)/,"bytedance-color"],[/^hunyuan|^hy\d$/,"hunyuan-color"],[/^(step\d*|stepfun)$/,"stepfun-color"],[/^longcat/,"longcat-color"],[/^(ling|ring)$/,"ling-color"],[/^(phi\d*|mai)$/,"microsoft-color"],[/^granite/,"ibm"],[/^solar/,"upstage-color"],[/^mercury$/,"inception"],[/^lfm/,"liquid"],[/^laguna$/,"poolside-color"],[/^trinity$/,"arcee-color"],[/^kat$/,"kwaipilot-color"],[/^(sakana|fugu|namazu)$/,"sakana-color"],[/^reka$/,"reka"]],RJ=e=>{var t;for(const n of e.modelId.toLowerCase().split(/[^a-z0-9]+/)){const s=(t=_J.find(([r])=>r.test(n)))==null?void 0:t[1];if(s!==void 0)return s}return LT(e.provider)};function kk({model:e,size:t=16,reserve:n=!1}){const s=RJ(e),r=s===void 0?void 0:OT(s);if(r===void 0&&!n)return null;const i={"--model-logo-size":`${t}px`};return o.jsx("span",{className:"model-logo",style:i,"aria-hidden":"true",...r===void 0?{}:{dangerouslySetInnerHTML:{__html:r}}})}function IJ(e,t){const n=t!=="/"&&(e===t||e.startsWith(`${t}/`)),s=n?t:"/",r=[{label:n?"~":"/",path:s}];let i=s==="/"?"":s;for(const a of e.slice(s.length).split("/"))a!==""&&(i=`${i}/${a}`,r.push({label:a,path:i}));return r}function A9(e){if(e==="/")return;const t=e.lastIndexOf("/");return t===0?"/":e.slice(0,t)}const sy=e=>e instanceof Error?e.message:String(e),bk=e=>`add-project-folder-${e}`;function LJ(e){const t=h.useRef(""),n=h.useRef(void 0);return h.useEffect(()=>()=>clearTimeout(n.current),[]),s=>s.key.length!==1||s.key===" "||s.metaKey||s.ctrlKey||s.altKey?!1:(t.current+=s.key.toLowerCase(),clearTimeout(n.current),n.current=setTimeout(()=>t.current="",600),e(t.current),!0)}function OJ({remote:e,connected:t,onAdded:n,onClose:s}){const[r,i]=h.useState({status:"loading"}),[a,l]=h.useState({}),[c,u]=h.useState(void 0),[d,f]=h.useState(!1),[p,x]=h.useState(void 0),g=h.useRef(!1);h.useEffect(()=>(g.current=!0,()=>{g.current=!1}),[]);const v=h.useRef(new Set),y=h.useRef(void 0),m=h.useRef(null),k=h.useCallback(O=>{v.current.has(O)||(v.current.add(O),l(L=>({...L,[O]:{status:"loading"}})),e.controller.listFolders(O).then(L=>{g.current&&l(H=>({...H,[O]:{status:"ok",folders:L.folders}}))},L=>{v.current.delete(O),g.current&&l(H=>({...H,[O]:{status:"error",message:sy(L)}}))}))},[e]),b=h.useCallback(()=>{i({status:"loading"}),e.controller.listFolders().then(O=>{g.current&&(v.current.add(O.path),l(L=>({...L,[O.path]:{status:"ok",folders:O.folders}})),i({status:"ok",home:O.home}),u(O.path))},O=>{g.current&&i({status:"error",message:sy(O)})})},[e]);h.useEffect(()=>b(),[b]),h.useEffect(()=>{const O=y.current;if(O===void 0||O!==c)return;const L=a[O];L===void 0||L.status==="loading"||(y.current=void 0,L.status==="ok"&&L.folders.length>0&&u(L.folders[0].path))},[a,c]),h.useEffect(()=>{if(r.status!=="ok"||!window.matchMedia("(pointer: fine)").matches)return;const O=requestAnimationFrame(()=>{var L;return(L=m.current)==null?void 0:L.focus()});return()=>cancelAnimationFrame(O)},[r.status]),h.useLayoutEffect(()=>{var L;const O=m.current;O===null||c===void 0||(O.scrollLeft=O.scrollWidth,(L=document.getElementById(bk(c)))==null||L.scrollIntoView({block:"nearest",inline:"nearest"}))},[c]);const j=r.status==="ok"?r.home:void 0,A=c===void 0||j===void 0?[]:IJ(c,j),M=A.map(O=>O.path),T=M[0],z=T===void 0||T==="/"?A:[{label:"/",path:"/"},...A],$=M.join("\0");h.useEffect(()=>{for(const O of $.split("\0"))O!==""&&k(O)},[$,k]);const E=O=>{d||(y.current=void 0,x(void 0),u(O))},N=O=>{const L=O===void 0?void 0:a[O];return(L==null?void 0:L.status)==="ok"?L.folders:void 0},_=c===void 0?void 0:c===T?T:A9(c),R=LJ(O=>{var H;const L=(H=N(_))==null?void 0:H.find(q=>q.name.toLowerCase().startsWith(O));L!==void 0&&E(L.path)}),B=()=>{c!==void 0&&(f(!0),x(void 0),e.controller.addProject(c).then(O=>{g.current&&n(O)},O=>{g.current&&(f(!1),x(sy(O)))}))},D=O=>{if(O.target!==O.currentTarget||c===void 0||d)return;const L=N(_)??[],H=L.findIndex(q=>q.path===c);switch(O.key){case"ArrowDown":L.length>0&&E(L[Math.min(H+1,L.length-1)].path);break;case"ArrowUp":H>0&&E(L[H-1].path);break;case"Home":L.length>0&&E(L[0].path);break;case"End":L.length>0&&E(L.at(-1).path);break;case"ArrowRight":{const q=N(c);q===void 0?y.current=c:q.length>0&&E(q[0].path);break}case"ArrowLeft":{const q=A9(c);q!==void 0&&E(q);break}case"Enter":t&&B();break;default:if(!R(O))return}O.preventDefault()},I=O=>{var L;E(O),(L=m.current)==null||L.focus()};return o.jsx(Us,{isOpen:!0,onOpenChange:O=>O?void 0:s(),purpose:"form",width:"min(780px, calc(100vw - 32px))",children:o.jsx(Cs,{header:o.jsx(Hr,{title:"Add project",subtitle:"Choose a folder on the host.",onOpenChange:()=>s()}),content:o.jsx(Es,{children:r.status!=="ok"?o.jsx("div",{className:"flex h-[24rem] items-center justify-center",children:r.status==="loading"?o.jsx(Vt,{"aria-label":"Loading folders"}):o.jsxs(re,{gap:2,hAlign:"center",children:[o.jsx(K,{type:"supporting",children:r.message}),o.jsx(Q,{label:"Try again",variant:"secondary",onClick:b})]})}):o.jsxs("div",{className:"overflow-hidden rounded-[var(--radius-inner)] border border-[var(--color-border)]",children:[o.jsx("div",{ref:m,role:"group","aria-label":"Folders",tabIndex:0,"aria-activedescendant":c===void 0||c===T?void 0:bk(c),onKeyDown:D,className:"group flex h-[22rem] overflow-x-auto overflow-y-hidden outline-none",children:M.map((O,L)=>o.jsx(DJ,{path:O,label:A[L].label,listing:a[O],next:M[L+1],selected:c,disabled:d,onPick:I,onRetry:()=>k(O)},O))}),o.jsx("nav",{"aria-label":"Selected folder","data-testid":"picker-path","data-path":c,className:"flex h-8 min-w-0 items-center gap-0.5 border-t border-[var(--color-border)] bg-[var(--color-background-muted)] px-2 text-[13px] text-[var(--color-text-secondary)]",children:z.map((O,L)=>{const H=L===z.length-1;return o.jsxs("span",{className:`flex min-w-0 items-center gap-0.5 ${H?"shrink-0":""}`,children:[L===0?null:o.jsx(Zi,{"aria-hidden":"true",className:"size-3 shrink-0 opacity-60"}),o.jsx("button",{type:"button",disabled:d,"aria-current":H?"location":void 0,onClick:()=>I(O.path),className:`max-w-[14rem] min-w-0 truncate rounded px-1 py-0.5 hover:bg-[var(--color-overlay-hover)] focus-visible:outline-2 focus-visible:outline-[var(--color-border-emphasized)] ${H?"text-[var(--color-text-primary)]":""}`,children:O.label})]},O.path)})})]})}),footer:o.jsx(el,{children:o.jsxs(ke,{gap:2,vAlign:"center",hAlign:"between",children:[o.jsx("div",{className:"min-w-0 flex-1",children:p!==void 0?o.jsx(K,{type:"supporting",role:"alert",maxLines:1,style:{color:"var(--danger)"},children:p}):o.jsx("div",{className:"hidden pointer-fine:block",children:o.jsx(K,{type:"supporting",maxLines:1,children:"Arrow keys to browse, Enter to add"})})}),o.jsxs(ke,{gap:2,hAlign:"end",children:[o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:s}),o.jsx(Q,{label:d?"Adding…":"Add project",variant:"primary",isDisabled:!t||c===void 0||d,onClick:B})]})]})})})})}function DJ({path:e,label:t,listing:n,next:s,selected:r,disabled:i,onPick:a,onRetry:l}){const c=(n==null?void 0:n.status)!=="ok"||n.folders.length===0;return o.jsx("div",{role:"listbox","aria-label":t,className:`flex shrink-0 flex-col overflow-y-auto overscroll-y-contain border-r border-[var(--color-border)] p-1 last:border-r-0 ${c?"min-w-56 flex-1":"w-56"}`,children:n===void 0||n.status==="loading"?o.jsx("div",{className:"flex flex-1 items-center justify-center",children:o.jsx(Vt,{"aria-label":`Loading ${t}`,size:"sm"})}):n.status==="error"?o.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-2 text-center",children:[o.jsx(K,{type:"supporting",children:n.message}),o.jsx(Q,{label:"Try again",size:"sm",variant:"secondary",isDisabled:i,onClick:l})]}):n.folders.length===0?o.jsx("div",{className:"flex flex-1 items-center justify-center",children:o.jsx(K,{type:"supporting",children:"No subfolders"})}):n.folders.map(u=>{const d=u.path===r;return o.jsxs("div",{id:bk(u.path),role:"option","aria-selected":d,"aria-disabled":i||void 0,title:u.name,onMouseDown:f=>f.preventDefault(),onClick:()=>a(u.path),className:`flex h-7 shrink-0 cursor-default items-center gap-2 rounded-[7px] px-2 text-sm ${d?"bg-[var(--color-overlay-pressed)] group-focus:bg-[var(--color-accent)] group-focus:text-[var(--color-on-accent)]":u.path===s?"bg-[var(--color-overlay-pressed)]":"hover:bg-[var(--color-overlay-hover)]"}`,children:[o.jsx(K1,{"aria-hidden":"true",className:"size-4 shrink-0 opacity-70"}),o.jsx("span",{className:"min-w-0 flex-1 truncate",children:u.name}),o.jsx(Zi,{"aria-hidden":"true",className:"size-3 shrink-0 opacity-50"})]},u.path)})})}function BJ({project:e,remote:t,connected:n,onClose:s}){const r=()=>{t.controller.removeProject(e.path),s()};return o.jsx(Us,{isOpen:!0,onOpenChange:i=>i?void 0:s(),purpose:"form",width:480,children:o.jsx(Cs,{header:o.jsx(Hr,{title:`Remove project ${e.name}?`,subtitle:"The directory and its conversations are kept; only the registration is removed.",onOpenChange:()=>s()}),content:o.jsx(Es,{}),footer:o.jsx(el,{children:o.jsxs(ke,{gap:2,hAlign:"end",children:[o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:s}),o.jsx(Q,{label:"Remove project",variant:"primary",isDisabled:!n,onClick:r})]})})})})}function HJ({summary:e,remote:t,connected:n,onClose:s}){const r=Dr(e),[i,a]=h.useState(r),[l,c]=h.useState(!1),[u,d]=h.useState(void 0),f=h.useRef(null);h.useEffect(()=>{var g;return(g=f.current)==null?void 0:g.select()},[]);const p=i.trim(),x=()=>{p===""||p===r||l||(c(!0),d(void 0),t.controller.renameConversation(e.id,p).then(()=>s(),g=>{c(!1),d(g instanceof Error?g.message:String(g))}))};return o.jsx(Us,{isOpen:!0,onOpenChange:g=>g?void 0:s(),purpose:"form",width:480,children:o.jsx(Cs,{header:o.jsx(Hr,{title:"Rename conversation",onOpenChange:()=>s()}),content:o.jsxs(Es,{children:[o.jsx(st,{ref:f,label:"Title",value:i,onChange:a,onEnter:x,hasAutoFocus:!0,isDisabled:l}),u===void 0?null:o.jsx(K,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:u})]}),footer:o.jsx(el,{children:o.jsxs(ke,{gap:2,hAlign:"end",children:[o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:s}),o.jsx(Q,{label:"Save",variant:"primary",isDisabled:!n||l||p===""||p===r,onClick:x})]})})})})}const qJ=["openai-completions","openai-responses","anthropic-messages","google-generative-ai"],DT={off:!0,minimal:!0,low:!0,medium:!0,high:!0,xhigh:!0,max:!0},wk=Object.keys(DT),PJ=e=>typeof e=="string"&&Object.prototype.hasOwnProperty.call(DT,e),UJ=64,FJ=e=>e<32||e>=127&&e<=159;function VJ(e){let t=e;for(;;){const s=[...(t.endsWith(".local")?t.slice(0,-6):t).trim()].filter(r=>!FJ(r.codePointAt(0))).join("").slice(0,UJ);if(s===t)return s;t=s}}const BT={conversations:0,index:0,devices:0,mcp:0,models:1,auth:1,settings:2,agents:6,providers:21},Q3=Object.keys(BT);function ry(e){return Q3.filter(t=>BT[t]<=e)}const xl=e=>`conversation:${e}`,wf=(e,t)=>`doc:${e}:${t}`,kp=4401,iy={major:5},GJ={addProject:0,removeProject:0,listFolders:3,listFiles:10,listSkills:13,listCommands:17,createConversation:0,archive:0,renameConversation:4,submit:0,submission:25,withdrawQueued:14,steerQueued:14,abort:0,compact:0,runCommand:17,setModel:0,setThinkingLevel:0,setAgent:18,fork:0,answer:0,changes:0,createPairing:0,revokeDevice:0,logout:1,beginLogin:21,answerLogin:21,cancelLogin:21,saveCustomProvider:21,removeCustomProvider:21,listEndpointModels:21,updateSettings:2,createAgent:6,updateAgent:6,deleteAgent:6,setPushToken:7,image:15,beginAttachment:19,appendAttachment:19,rtcOffer:23,ping:23,openTerminal:27,terminalInput:27,resizeTerminal:27,renameTerminal:27,restartTerminal:27,closeTerminal:27};function Ze(e,t){return e>=GJ[t]}const WJ={images:5,acceptAccountDevices:8,apnsPush:9,agentConversations:10,liveBranch:11,hostName:12,imageRefs:15,boundSkills:16,attachments:19,imageVariants:20,rtc:23,submitEntry:25,terminals:27};function Yt(e,t){return e>=WJ[t]}[...Q3];function J3(e){const t=e.indexOf(".");if(t<=0||e.indexOf(".",t+1)!==-1)return;const n=e.slice(0,t),s=e.slice(t+1);try{if(Vi(n).length!==32||Vi(s).length===0)return}catch{return}return{hostKey:n,secret:s}}function HT(e){const t=e.getAll("endpointSet");if(t.length>1)return!1;if(t.length===0)return;const n=uX(t[0]);if(n.kind==="malformed")return!1;if(n.kind==="valid")return n.endpointSet.endpoints.length===0?!1:n.endpointSet}function KJ(e){let t;try{t=new URL(e.trim())}catch{return}const n=new URLSearchParams(t.hash.replace(/^#/,"")),s=n.get("pair"),r=s===null?void 0:J3(s);if(r===void 0)return;let i=n.get("url");if(i===null||i==="")if(t.protocol==="http:")i=`ws://${t.host}/`;else if(t.protocol==="https:")i=`wss://${t.host}/`;else return;else try{const l=new URL(i).protocol;if(l!=="ws:"&&l!=="wss:")return}catch{return}const a=HT(n);if(a!==!1)return{hostKey:r.hostKey,secret:r.secret,url:i,...a===void 0?{}:{endpointSet:a}}}function qT(e){const t=KJ(e);if(t===void 0)return;const n=t.endpointSet===void 0?"":`&endpointSet=${LM(t.endpointSet)}`;return`pair=${t.hostKey}.${t.secret}&url=${encodeURIComponent(t.url)}${n}`}const PT=(e,t)=>fetch(e,t),zt=e=>({ok:!0,value:e}),an=(e,t)=>({ok:!1,error:{code:e,...t===void 0?{}:{status:t}}}),M9=e=>{const t=e.filter(i=>i.outcome!=="unsupported"),n=t.length>0&&t.every(i=>i.outcome==="rejected"),s=i=>t.some(a=>a.outcome===i);return{ok:!1,error:{code:n?"pair_rejected":s("timeout")?"pair_timeout":s("unreachable")?"pair_unreachable":e.some(i=>i.outcome==="unsupported")?"pair_unsupported":"pair_unreachable",...e.length===0?{}:{candidates:e}}}},jf=e=>e.code==="unauthenticated";async function XJ(e,t=PT){const n=new AbortController,s=setTimeout(()=>n.abort(),5e3);try{const r=await t(`${e.replace(/\/+$/,"")}/api/me`,{signal:n.signal,redirect:"manual"});if(r.status===401)return"enabled";if(r.status===200){const i=await r.text();let a;try{a=JSON.parse(i)}catch{return"disabled"}return typeof(a==null?void 0:a.user)=="object"&&a.user!==null?"enabled":"disabled"}return r.status===404?"disabled":"unreachable"}catch{return"unreachable"}finally{clearTimeout(s)}}function ZJ(e){let t;try{t=new URL(e)}catch{return!1}const n=t.hostname,s=/^127(?:\.\d{1,3}){3}$/.test(n),r=n==="localhost"||n.endsWith(".localhost")||s||n==="::1"||n==="[::1]";return t.protocol==="https:"||t.protocol==="http:"&&r}function Bs(e){try{return new URL(e).origin}catch{return e.replace(/\/+$/,"")}}const or=e=>typeof e=="object"&&e!==null,T9=e=>or(e)&&typeof e.hostId=="string"&&typeof e.name=="string"&&typeof e.os=="string"&&typeof e.sourceIp=="string"&&typeof e.ipDiffers=="boolean"&&typeof e.expiresAt=="number"?{hostId:e.hostId,name:e.name,os:e.os,sourceIp:e.sourceIp,ipDiffers:e.ipDiffers,expiresAt:e.expiresAt}:void 0,z9=e=>{if(!(!or(e)||typeof e.redirect!="string"))try{const t=new URL(e.redirect);return t.protocol==="http:"&&t.hostname==="127.0.0.1"&&t.port!==""?e.redirect:void 0}catch{return}},N9=e=>{if(!(!or(e)||!or(e.user)||typeof e.user.username!="string"))return{user:{username:e.user.username},...e.admin===!0?{admin:!0}:{}}},YJ=new Set(["registered","revoking","revoked"]),QJ=e=>or(e)&&typeof e.hostId=="string"&&typeof e.name=="string"&&typeof e.state=="string"&&YJ.has(e.state),JJ=e=>or(e)&&typeof e.id=="number"&&(e.name===void 0||typeof e.name=="string")&&typeof e.createdAt=="number"&&typeof e.lastSeenAt=="number"&&typeof e.current=="boolean"&&(e.kickedAt===void 0||typeof e.kickedAt=="number")&&Array.isArray(e.hosts)&&e.hosts.every(QJ),_9=e=>e===void 0?{}:{device:{id:e.id,...e.name===void 0?{}:{name:e.name}}},eee=e=>or(e)&&typeof e.id=="number"&&typeof e.createdAt=="number"&&typeof e.expiresAt=="number"&&(e.usedAt===void 0||typeof e.usedAt=="number")&&(e.usedBy===void 0||typeof e.usedBy=="string");function Sf(e){const t=e.fetch??PT,n=Bs(e.origin),s=e.credentials.mode==="bearer"?e.credentials.token:void 0,r={redirect:"manual",...e.credentials.mode==="cookie"?{credentials:"same-origin"}:{}},i=async(l,c,u)=>{let d;try{d=await t(`${n}${l}`,{...r,method:c,headers:{...s===void 0?{}:{authorization:`Bearer ${s}`},...u===void 0?{}:{"content-type":"application/json"}},...u===void 0?{}:{body:JSON.stringify(u)}})}catch{return an("network")}if(d.status===0)return an("network");const f=await d.json().catch(()=>{});if(d.status>=200&&d.status<300)return zt(f);const p=or(f)&&typeof f.error=="string"?f.error:d.status===401?"unauthenticated":"unknown";return an(p,d.status)},a=l=>{if(!l.ok)return l;const c=N9(l.value);if(c===void 0||!or(l.value)||typeof l.value.expiresAt!="number")return an("invalid_response");const u=l.value.token;return zt({...c,expiresAt:l.value.expiresAt,...typeof u=="string"?{token:u}:{}})};return{origin:n,login:async(l,c,u)=>a(await i("/api/login","POST",{username:l,password:c,..._9(u)})),register:async(l,c,u,d)=>a(await i("/api/register","POST",{invite:l,username:c,password:u,..._9(d)})),me:async()=>{const l=await i("/api/me","GET");if(!l.ok)return l;const c=N9(l.value);return c===void 0?an("invalid_response"):zt(c)},logout:async l=>{const c=await i("/api/logout","POST",(l==null?void 0:l.revoke)===!0?{revoke:!0}:void 0);return c.ok?zt(void 0):c},revokeAllSessions:async()=>{const l=await i("/api/sessions/revoke-all","POST");return l.ok?zt(void 0):l},changePassword:async(l,c)=>{const u=await i("/api/password","POST",{currentPassword:l,newPassword:c});return u.ok?zt(void 0):u},deleteAccount:async l=>{const c=await i("/api/me/delete","POST",{password:l});return c.ok?zt(void 0):c},createJoinToken:async()=>{const l=await i("/api/join-tokens","POST");if(!l.ok)return l;const c=l.value;return!or(c)||typeof c.token!="string"||typeof c.expiresAt!="number"||typeof c.command!="string"?an("invalid_response"):zt({token:c.token,expiresAt:c.expiresAt,command:c.command})},lookupHostLink:async l=>{const c=await i("/api/host-link/lookup","POST",{userCode:l});if(!c.ok)return c;const u=T9(c.value);return u===void 0?an("invalid_response"):zt(u)},confirmHostLink:async l=>{const c=await i("/api/host-link/confirm","POST",{userCode:l});return c.ok?zt(void 0):c},denyHostLink:async l=>{const c=await i("/api/host-link/deny","POST",{userCode:l});return c.ok?zt(void 0):c},lookupHostLinkRequest:async l=>{const c=await i("/api/host-link/lookup","POST",{requestId:l});if(!c.ok)return c;const u=T9(c.value);return u===void 0?an("invalid_response"):zt(u)},confirmHostLinkRequest:async l=>{const c=await i("/api/host-link/confirm","POST",{requestId:l});if(!c.ok)return c;const u=z9(c.value);return u===void 0?an("invalid_response"):zt(u)},denyHostLinkRequest:async l=>{const c=await i("/api/host-link/deny","POST",{requestId:l});if(!c.ok)return c;const u=z9(c.value);return u===void 0?an("invalid_response"):zt(u)},listHosts:async()=>{const l=await i("/api/hosts","GET");if(!l.ok)return l;if(!Array.isArray(l.value))return an("invalid_response");const c=[];for(const u of l.value){if(!or(u)||typeof u.hostId!="string"||typeof u.name!="string"||typeof u.noisePublicKey!="string"||typeof u.online!="boolean"||typeof u.lastSeenAt!="number"||u.pairing!=="available"&&u.pairing!=="offline"&&u.pairing!=="host_too_old"&&u.pairing!=="key_mismatch"||u.deviceReports!==void 0&&typeof u.deviceReports!="boolean")return an("invalid_response");c.push({hostId:u.hostId,name:u.name,noisePublicKey:u.noisePublicKey,online:u.online,lastSeenAt:u.lastSeenAt,pairing:u.pairing,...u.deviceReports===void 0?{}:{deviceReports:u.deviceReports}})}return zt(c)},listDevices:async()=>{const l=await i("/api/devices","GET");return l.ok?!Array.isArray(l.value)||!l.value.every(JJ)?an("invalid_response"):zt(l.value.map(c=>({id:c.id,...c.name===void 0?{}:{name:c.name},createdAt:c.createdAt,lastSeenAt:c.lastSeenAt,current:c.current,...c.kickedAt===void 0?{}:{kickedAt:c.kickedAt},hosts:c.hosts.map(u=>({hostId:u.hostId,name:u.name,state:u.state}))}))):l},removeHost:async(l,c)=>{const u=await i(`/api/hosts/${encodeURIComponent(l)}/remove`,"POST",{password:c});return u.ok?zt(void 0):u},kickDevice:async(l,c)=>{const u=await i(`/api/devices/${l}/kick`,"POST",{password:c});return u.ok?zt(void 0):u},requestPairing:async l=>{const c=await i(`/api/hosts/${encodeURIComponent(l)}/pairing`,"POST");if(!c.ok)return c;const u=c.value;if(!or(u)||typeof u.url!="string"||typeof u.hostKey!="string"||typeof u.secret!="string"||typeof u.expiresAt!="number")return an("invalid_response");let d;if(u.endpointSet!==void 0){const f=um(u.endpointSet);if(f.kind==="malformed")return an("invalid_response");if(f.kind==="valid"){if(f.endpointSet.endpoints.length===0)return an("invalid_response");d=f.endpointSet}}return zt({url:u.url,hostKey:u.hostKey,secret:u.secret,expiresAt:u.expiresAt,...d===void 0?{}:{endpointSet:d}})},registerPushToken:async l=>{const c=await i("/api/push-tokens","POST",{apns:l.apns,environment:l.environment});return c.ok?zt(void 0):c},removePushToken:async l=>{const c=await i("/api/push-tokens/remove","POST",{apns:l.apns,environment:l.environment});return c.ok?zt(void 0):c},listInvites:async()=>{const l=await i("/api/invites","GET");return l.ok?!Array.isArray(l.value)||!l.value.every(eee)?an("invalid_response"):zt(l.value.map(c=>({id:c.id,createdAt:c.createdAt,expiresAt:c.expiresAt,...c.usedAt===void 0?{}:{usedAt:c.usedAt},...c.usedBy===void 0?{}:{usedBy:c.usedBy}}))):l},createInvite:async()=>{const l=await i("/api/invites","POST");if(!l.ok)return l;const c=l.value;return!or(c)||typeof c.code!="string"||typeof c.expiresAt!="number"?an("invalid_response"):zt({code:c.code,expiresAt:c.expiresAt})},revokeInvite:async l=>{const c=await i("/api/invites/revoke","POST",{id:l});return c.ok?zt(void 0):c}}}function tee(e){const t=e.endpointSet===void 0?"":`&endpointSet=${LM(e.endpointSet)}`;return qT(`https://server.invalid/#pair=${e.hostKey}.${e.secret}&url=${encodeURIComponent(e.url)}${t}`)}function R9(e,t,n,s,r){const i=Bs(e),a=new Set(s.map(l=>`${Bs(l.serverOrigin)}\0${l.hostId}`));return t.map(l=>{const c=(p,x,g=!1)=>({host:l,status:p,...x===void 0?{}:{stored:x},linkable:g,autoRegister:r&&p==="unpaired"&&!a.has(`${i}\0${l.hostId}`)}),u=n.filter(p=>p.account!==void 0&&Bs(p.account.serverOrigin)===i&&p.account.hostId===l.hostId),d=u.find(p=>p.hostKey===l.noisePublicKey);if(d!==void 0)return c("paired",d);if(u.length>0)return c("key_changed",u[0]);const f=n.find(p=>p.hostKey===l.noisePublicKey);return f!==void 0?c("paired",f,f.account===void 0):c("unpaired")})}class UT extends Error{constructor(n){super(n===void 0?"pairing connection closed":`pairing connection closed (${n})`);be(this,"code");this.name="PairingHandshakeError",n!==void 0&&(this.code=n)}}const nee=e=>{if(e instanceof UT)return e.code===kp?{code:e.code}:void 0;if(typeof e=="object"&&e!==null){const n=e.code;if(n===kp)return{code:n}}const t=e instanceof Error?e.message:String(e);return/\b4401\b/.test(t)?{code:kp}:void 0};function see(e){return new Promise((t,n)=>{let s,r=!1;const i=e.signal,a=()=>i==null?void 0:i.removeEventListener("abort",c),l=d=>{r||(r=!0,a(),s==null||s.close(),d===void 0?t():n(d))},c=()=>l(new Error("pairing attempt aborted"));if(i!=null&&i.aborted){l(new Error("pairing attempt aborted"));return}i==null||i.addEventListener("abort",c,{once:!0});const u=gk({url:e.url,hostKey:e.hostKey,device:e.device,pairing:{secret:e.secret,name:e.name},onPaired:()=>l()});try{s=u.open({message:()=>{},closed:d=>l(new UT(d))}),r&&s.close()}catch(d){l(d instanceof Error?d:new Error(String(d)))}})}async function I9(e,t,n,s=see,r={}){const i=await e.requestPairing(t);if(!i.ok)return i;const a=tee(i.value);if(a===void 0)return an("invalid_offer");const l=new URLSearchParams(a),c=J3(l.get("pair")),u=l.get("url");if(c===void 0||u===null)return an("invalid_offer");const d=Vi(c.hostKey),f=V3(),p=U1(u,i.value.endpointSet,{pageProtocol:r.pageProtocol}),x=p.map(b=>b.unsupported===void 0?void 0:{url:b.url,role:b.role,outcome:"unsupported",reason:b.unsupported}),g=p.filter(b=>b.unsupported===void 0),v=()=>x.filter(b=>b!==void 0);if(g.length===0)return M9(v());const y=r.attemptTimeoutMs??1e4;let m=!1;for(let b=0;b<p.length;b++){const j=p[b];if(j.unsupported!==void 0)continue;const A=new AbortController;let M,T=!1;const z=new Promise((E,N)=>{A.signal.addEventListener("abort",()=>N(new Error("pairing attempt aborted")),{once:!0})}),$=new Promise((E,N)=>{M=setTimeout(()=>{T=!0,A.abort(),N(new Error("pairing attempt timed out"))},y)});try{await Promise.race([s({url:j.url,hostKey:d,device:f,secret:c.secret,name:n,signal:A.signal}),z,$]),m=!0;break}catch(E){if(T)x[b]={url:j.url,role:j.role,outcome:"timeout",reason:`no answer within ${y}ms`};else{const N=nee(E),_=E instanceof Error?E.message:String(E);x[b]=N===void 0?{url:j.url,role:j.role,outcome:"unreachable",reason:_}:{url:j.url,role:j.role,outcome:"rejected",reason:_,...N.code===void 0?{}:{code:N.code}}}}finally{M!==void 0&&clearTimeout(M),A.abort()}}if(!m)return M9(v());const k=i.value.endpointSet;return zt({url:k===void 0?u:L3(u,k),hostKey:c.hostKey,privateKey:Dh(f.privateKey),account:{serverOrigin:e.origin,hostId:t,vouched:!0},...k===void 0?{}:{endpointSet:k}})}const ree="ws://127.0.0.1:7420",pc="pinomad.device";function eb(e){if(e!==null)try{return yT(JSON.parse(e))}catch{return}}function iee(e,t,n,s){const r=new URLSearchParams(e.replace(/^#/,"")),i=r.get("token");if(i!==null&&i!=="")return{kind:"token",url:r.get("url")??ree,token:i};const a=r.get("pair");if(a!==null){const c=J3(a);if(c===void 0)return;const u=HT(r);return u===!1?void 0:{kind:"pair",url:r.get("url")??`${t.protocol==="https:"?"wss":"ws"}://${t.host}/`,hostKey:c.hostKey,secret:c.secret,...u===void 0?{}:{endpointSet:u}}}if(e.replace(/^#/,"")!=="")return;const l=n.find(c=>c.hostKey===s)??n[0];return l===void 0?void 0:{kind:"device",...l}}function oee(e,t){return new URL(e).host===t.host}function FT(e){const t=/iPhone/.test(e)?"iPhone":/iPad/.test(e)?"iPad":/Android/.test(e)?"Android":/Windows/.test(e)?"Windows":/Mac/.test(e)?"Mac":/Linux/.test(e)?"Linux":void 0,n=/Edg(?:e|A|iOS)?\//.test(e)?"Edge":/Firefox\//.test(e)?"Firefox":/Chrome\//.test(e)||/HeadlessChrome\//.test(e)?"Chrome":/Safari\//.test(e)?"Safari":void 0,s=[t,n].filter(r=>r!==void 0).join(" ");return s===""?"Browser":s}async function tb(){var e,t;try{const n=await((t=(e=window.pinomadDesktop)==null?void 0:e.deviceName)==null?void 0:t.call(e));if(typeof n=="string"&&n!=="")return n}catch{}return FT(navigator.userAgent)}const aee={darwin:"Mac",win32:"Windows",linux:"Linux"};function lee(e,t){if(t===void 0)return FT(e);const n=aee[t];return n===void 0?"Desktop":`${n} Desktop`}const VT="pinomad.hosts",cee=()=>{const e=localStorage.getItem(VT);if(e===null)return[];let t;try{t=JSON.parse(e)}catch{return[]}return Array.isArray(t)?t.flatMap(n=>{const s=yT(n);return s===void 0?[]:[s]}):[]},lu=e=>{localStorage.setItem(VT,JSON.stringify(e))};function eu(){const e=cee(),t=eb(localStorage.getItem(pc));if(t===void 0)return e;if(e.some(n=>n.hostKey===t.hostKey))return localStorage.removeItem(pc),e;try{lu([...e,t]),localStorage.removeItem(pc)}catch{}return[...e,t]}const Qo={list:()=>Promise.resolve(eu()),save:e=>{const t=eu(),n=t.find(s=>s.hostKey===e.hostKey);return lu([...t.filter(s=>s.hostKey!==e.hostKey),n===void 0?e:x1(n,e)]),Promise.resolve()},remove:e=>{lu(eu().filter(n=>n.hostKey!==e));const t=eb(localStorage.getItem(pc));return t!==void 0&&t.hostKey===e&&localStorage.removeItem(pc),Promise.resolve()},setName:(e,t)=>{const n=eu();return n.some(s=>s.hostKey===e)&&lu(n.map(s=>s.hostKey===e?{...s,name:t}:s)),Promise.resolve()},updateEndpoints:(e,t)=>{const n=eu(),s=n.findIndex(i=>i.hostKey===e);if(s===-1)return Promise.resolve();const r=[...n];return r[s]=vT(n[s],t),lu(r),Promise.resolve()},updateConnection:(e,t)=>{const n=eu(),s=n.findIndex(i=>i.hostKey===e);if(s===-1)return Promise.resolve();const r=[...n];return r[s]=kT(n[s],t),lu(r),Promise.resolve()}};function uee(e){let t;const n=async()=>{const s=eb(localStorage.getItem(pc));if(s!==void 0)try{(await e.hosts.list()).some(i=>i.hostKey===s.hostKey)||await e.hosts.save(s),localStorage.removeItem(pc);return}catch(r){return console.error("Could not migrate the stored device into the desktop host list",r),s}};return{list:async()=>{const s=await(t??(t=n())),r=await e.hosts.list();return s===void 0||r.some(i=>i.hostKey===s.hostKey)?r:[...r,s]},save:s=>e.hosts.save(s),remove:s=>e.hosts.remove(s),setName:(s,r)=>e.hosts.setName(s,r),updateEndpoints:(s,r)=>e.hosts.updateEndpoints(s,r),updateConnection:(s,r)=>e.hosts.updateConnection(s,r)}}function dee(){const e=window.pinomadDesktop;return e===void 0?Qo:uee(e)}const fee={store:Qo,hosts:[],focus:null,paired:e=>Qo.save(e),setName:(e,t)=>Qo.setName(e,t),endpoints:(e,t)=>Qo.updateEndpoints(e,t),setConnection:(e,t)=>Qo.updateConnection(e,t),focusHost:()=>{},focusConversation:()=>{},rememberConversation:()=>{},focusDraft:()=>{},forget:e=>Qo.remove(e),dropHost:e=>Qo.remove(e)},GT=h.createContext(fee),As=()=>h.useContext(GT);function WT(e,t){const{hosts:n,setName:s}=As(),r=t==null?void 0:t.hostName;h.useEffect(()=>{if(e===void 0||r===void 0)return;const i=n.find(a=>a.hostKey===e);i===void 0||i.name===r||s(e,r).catch(a=>console.error("Could not store the host name",a))},[e,r,n,s])}const KT="pinomad.declinedAccountHosts",Hf=e=>`${Bs(e.serverOrigin)}\0${e.hostId}`,hee=e=>{let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];const n=new Set,s=[];for(const r of t){if(typeof r!="object"||r===null)continue;const i=r;if(typeof i.serverOrigin!="string"||typeof i.hostId!="string")continue;const a={serverOrigin:Bs(i.serverOrigin),hostId:i.hostId},l=Hf(a);n.has(l)||(n.add(l),s.push(a))}return s};function oy(e){const t=e.getItem(KT);return t===null?[]:hee(t)}function pee(e=localStorage){const t=new Set,n=()=>{for(const r of t)r()},s=r=>{e.setItem(KT,JSON.stringify(r)),n()};return{list:()=>oy(e),add:r=>{const i={serverOrigin:Bs(r.serverOrigin),hostId:r.hostId},a=oy(e),l=Hf(i);a.some(c=>Hf(c)===l)||s([...a,i])},remove:r=>{const i=Hf(r),a=oy(e),l=a.filter(c=>Hf(c)!==i);l.length!==a.length&&s(l)},subscribe:r=>(t.add(r),()=>{t.delete(r)})}}const XT=pee(),jk=new Set;function Sk(e){for(const t of jk)t(e)}function xee(e){return jk.add(e),()=>{jk.delete(e)}}const L9="pinomad.accountDeviceId",gee=/^[A-Za-z0-9_-]{22,64}$/;function mee(e){let t;return()=>{let n;try{n=e();const s=n.getItem(L9);if(s!==null&&gee.test(s))return s}catch{}t??(t=Dh(crypto.getRandomValues(new Uint8Array(16))));try{n==null||n.setItem(L9,t)}catch{}return t}}const yee=mee(()=>localStorage),vee={subscribe(e){if(typeof document>"u")return()=>{};const t=()=>{document.visibilityState==="visible"&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},nn=e=>({ok:!1,error:{code:e}}),ZT=5e3,kee=12e4/ZT,bee=new Set(["pair_rejected","disabled"]),wee=typeof navigator<"u"&&navigator.locks!==void 0?{request:async(e,t)=>await navigator.locks.request(e,()=>t())}:void 0,cu=(e,t)=>`${Bs(e)}\0${t}`,Cf=e=>e.account===void 0?e.hostKey:cu(e.account.serverOrigin,e.account.hostId);function jee(e){const t=new Set;let n={status:"checking"},s,r=e.bridge===void 0?"cookie":"bearer",i,a=!1;const l=new Set,c=e.declined??XT,u=e.autoRegister!==!1,d=new Map;let f=0,p;const x=new Map;let g;const v=new Map,y=(P,V)=>v.get(P)!==V,m=new Map;xee(P=>{for(const[V,Y]of x)P!==void 0&&!V.endsWith(`\0${P}`)||(Y.cancelled=!0,x.delete(V))});const k=P=>{n=P;for(const V of t)V()},b=()=>{n.status==="signed-in"&&k({...n,unsavedHosts:[...d.values()]})},j=P=>{d.set(Cf(P),P),b()},A=P=>{d.delete(Cf(P))&&b()},M=()=>{g==null||g(),g=void 0},T=()=>{s=void 0,a=!1,f+=1;for(const P of x.values())P.cancelled=!0;x.clear(),d.clear(),M();for(const{timer:P}of m.values())clearTimeout(P);m.clear()},z=()=>k({status:"signed-out",mode:r,...i===void 0?{}:{serverOrigin:i}}),$=()=>{T(),z()},E=(P,V,Y,oe)=>({status:"signed-in",mode:r,user:V,admin:a,serverOrigin:P.origin,hosts:Y,rejectedHostKeys:[...l],unsavedHosts:[...d.values()],...oe}),N=(P,V)=>s===P&&V===f,_=async(P,V)=>{var F;let Y;try{Y=await e.hosts.list()}catch(le){return console.error("Could not read the paired hosts to forget them",le),!1}const oe=le=>{var ce;return((ce=le.account)==null?void 0:ce.vouched)===!0&&Bs(le.account.serverOrigin)===P&&(V===void 0||le.account.hostId===V)};for(const le of Y.filter(oe))await(((F=e.removeHost)==null?void 0:F.call(e,le.hostKey))??e.hosts.remove(le.hostKey)).catch(ce=>console.error("Could not forget a host",ce));try{return!(await e.hosts.list()).some(oe)}catch(le){return console.error("Could not check the forgotten hosts",le),!1}},R=async()=>(e.name??(()=>"This device"))(),B=P=>{l.delete(P)&&n.status==="signed-in"&&k({...n,rejectedHostKeys:[...l]})},D=()=>{g===void 0&&(g=(e.visibility??vee).subscribe(()=>{s!==void 0&&n.status==="signed-in"&&Z(s,n.user)}))},I=P=>P.account!==void 0&&c.list().some(V=>Bs(V.serverOrigin)===Bs(P.account.serverOrigin)&&V.hostId===P.account.hostId),O=async(P,V)=>{if(s!==P)return!1;if(I(V))return d.delete(Cf(V)),b(),!1;const Y=Cf(V),oe=v.get(Y);try{await e.paired(V)}catch{return!1}return V.account!==void 0&&y(Y,oe)?(await _(P.origin,V.account.hostId),!1):(B(V.hostKey),A(V),!0)},L=async P=>{let V=0;for(const Y of[...d.values()])if(d.get(Cf(Y))===Y){if(!await O(P,Y))return V;V+=1}return V},H=(P,V,Y)=>{if(N(P,f)!==!1){if(jf(Y)){$();return}bee.has(Y.code)&&c.add({serverOrigin:P.origin,hostId:V})}},q=P=>{var V;return n.status==="signed-in"?(V=n.hosts.find(Y=>Y.host.hostId===P))==null?void 0:V.host.name:void 0},U=(P,V)=>{const Y=q(P);return Y===void 0||Y===""?V:{...V,name:Y}},X=async(P,V,Y,oe)=>{if(!u||!oe)return;const F=await L(P);if(N(P,f)){if(F>0){await Z(P,V);return}for(const le of Y){if(!le.autoRegister)continue;const ce=cu(P.origin,le.host.hostId);if(x.has(ce))continue;const ge=f,ve=v.get(ce),pe={cancelled:!1,promise:Promise.resolve()},Ve=async()=>{if(pe.cancelled||!N(P,ge))return;const ot=await e.hosts.list().catch(()=>{});if(ot===void 0||pe.cancelled||!N(P,ge))return;const at=R9(P.origin,[le.host],ot,c.list(),!0)[0];if((at==null?void 0:at.autoRegister)!==!0){if((at==null?void 0:at.stored)!==void 0){let Tt=!0;await e.paired(at.stored).catch(wn=>{Tt=!1,console.error("Could not sync a host paired by another tab",wn)}),Tt&&s===P&&await Z(P,V)}return}const Mt=d.get(cu(P.origin,le.host.hostId));if(Mt!==void 0){await O(P,Mt)&&s===P&&await Z(P,V);return}const Dn=await I9(P,le.host.hostId,await R(),e.connect,{pageProtocol:window.location.protocol});if(pe.cancelled||!N(P,ge))return;if(!Dn.ok){H(P,le.host.hostId,Dn.error);return}const nt=U(le.host.hostId,Dn.value);B(nt.hostKey);try{await e.paired(nt)}catch{y(ce,ve)||j(nt);return}if(y(ce,ve)){await _(P.origin,le.host.hostId);return}s===P&&await Z(P,V)},Ye=(async()=>{const ot=e.locks??wee;ot===void 0?await Ve():await ot.request(`pinomad.autoRegister:${Bs(P.origin)}:${le.host.hostId}`,Ve)})().catch(ot=>{console.error("Could not auto-register an account host",ot)}).finally(()=>{x.get(ce)===pe&&x.delete(ce)});pe.promise=Ye,x.set(ce,pe)}}},Z=async(P,V)=>{var ce,ge;const Y=await P.listHosts();if(s!==P)return{ok:!1,error:{code:"stale"}};if(!Y.ok){if(jf(Y.error))return r==="bearer"&&((ge=(ce=e.bridge)==null?void 0:ce.account)==null||ge.clear().catch(()=>{})),$(),Y;const ve=n.status==="signed-in"?n.hosts:[];return k(E(P,V,ve,{hostsError:Y.error})),D(),Y}let oe,F=!0;try{oe=await e.hosts.list()}catch{oe=[],F=!1}if(s!==P)return{ok:!1,error:{code:"stale"}};const le=R9(P.origin,Y.value,oe,c.list(),F);for(const ve of le)if(ve.linkable&&ve.stored!==void 0){const pe=ve.stored;e.paired({...pe,account:{serverOrigin:P.origin,hostId:ve.host.hostId}}).catch(()=>{})}return k(E(P,V,le)),D(),X(P,V,le,F),{ok:!0,value:le}};(async()=>{var oe,F;const P=e.bridge;if(P!==void 0){const le=await((oe=P.account)==null?void 0:oe.get().catch(()=>{}));if(le===void 0){$();return}i=le.serverOrigin;const ce=Sf({origin:le.serverOrigin,credentials:{mode:"bearer",token:le.token},fetch:e.fetch}),ge=await ce.me();if(!ge.ok){jf(ge.error)&&((F=P.account)==null||F.clear().catch(()=>{})),$();return}s=ce,a=ge.value.admin===!0,await Z(ce,ge.value.user.username);return}if(await XJ(e.origin,e.fetch)!=="enabled"){k({status:"unavailable"});return}const V=Sf({origin:e.origin,credentials:{mode:"cookie"},fetch:e.fetch}),Y=await V.me();if(!Y.ok){i=e.origin,$();return}s=V,i=e.origin,a=Y.value.admin===!0,await Z(V,Y.value.user.username)})();const ae=async P=>{var pe;if(s===void 0)return nn("unauthenticated");const V=s,Y=f,oe=cu(V.origin,P),F=v.get(oe);c.remove({serverOrigin:V.origin,hostId:P}),Sk(P);const le=d.get(oe);if(le!==void 0)return await O(V,le)?{ok:!0,value:le}:nn("pairing_not_saved");const ce=await I9(V,P,await R(),e.connect,{pageProtocol:window.location.protocol});if(!ce.ok)return H(V,P,ce.error),ce;if(!N(V,Y))return nn("stale");if(y(oe,F))return nn("host_removed");const ge=U(P,ce.value);B(ge.hostKey);try{await e.paired(ge)}catch{return y(oe,F)?nn("host_removed"):(j(ge),nn("pairing_not_saved"))}if(y(oe,F))return await _(V.origin,P),nn("host_removed");A(ge);const ve=await e.hosts.list().catch(()=>[]);for(const Ve of ve)Ve.account!==void 0&&Bs(Ve.account.serverOrigin)===V.origin&&Ve.account.hostId===P&&Ve.hostKey!==ge.hostKey&&(((pe=e.removeHost)==null?void 0:pe.call(e,Ve.hostKey))??e.hosts.remove(Ve.hostKey)).catch(()=>{});return n.status==="signed-in"&&s!==void 0&&await Z(s,n.user),{ok:!0,value:ge}},xe=P=>{if(s===void 0)return;const V=s,Y=f,oe={},F=m.get(P);F!==void 0&&clearTimeout(F.timer),m.set(P,{watch:oe});const le=()=>{var pe;return N(V,Y)&&((pe=m.get(P))==null?void 0:pe.watch)===oe},ce=()=>n.status==="signed-in"&&n.hosts.some(pe=>pe.host.hostId===P&&pe.status==="paired"),ge=()=>{var pe;((pe=m.get(P))==null?void 0:pe.watch)===oe&&m.delete(P)},ve=async pe=>{if(!le()||n.status!=="signed-in"||ce())return ge();if(await Z(V,n.user),!!le()){if(ce()||pe===0)return ge();m.set(P,{watch:oe,timer:setTimeout(()=>void ve(pe-1),ZT)})}};ve(kee)},fe=async(P,V)=>{var oe;const Y=cu(P,V);v.set(Y,(v.get(Y)??0)+1),Sk(V),d.delete(Y)&&b(),clearTimeout((oe=m.get(V))==null?void 0:oe.timer),m.delete(V),await _(P,V)},se=async({hostId:P,password:V})=>{if(s===void 0||n.status!=="signed-in")return nn("unauthenticated");const Y=s,oe=f,F=n.user,le=await Y.removeHost(P,V);if(!N(Y,oe))return le;if(!le.ok){if(jf(le.error))$();else if(le.error.code==="not_found"){const ce=await Z(Y,F);return ce.ok?ce.value.some(ge=>ge.host.hostId===P)?nn("remove_unsupported"):(await fe(Y.origin,P),{ok:!0,value:void 0}):ce}return le}return await fe(Y.origin,P),N(Y,oe)&&await Z(Y,F),{ok:!0,value:void 0}},ye=async(P,V)=>{var F,le;let Y;if(r==="cookie")await p,Y=Sf({origin:e.origin,credentials:{mode:"cookie"},fetch:e.fetch});else{const ce=P??i;if(ce===void 0)return nn("origin_required");if(!ZJ(ce))return nn("insecure_origin");Y=Sf({origin:ce,credentials:{mode:"bearer"},fetch:e.fetch})}const oe=await V(Y);if(!oe.ok)return oe;if(r==="bearer"){if(oe.value.token===void 0)return nn("invalid_response");Y=Sf({origin:Y.origin,credentials:{mode:"bearer",token:oe.value.token},fetch:e.fetch}),i=Y.origin,(le=(F=e.bridge)==null?void 0:F.account)==null||le.save({serverOrigin:Y.origin,token:oe.value.token}).catch(ce=>console.error("Could not persist the account session",ce))}return s=Y,a=oe.value.admin===!0,await Z(Y,oe.value.user.username),{ok:!0,value:void 0}},me=async(P,V)=>{if(s===void 0)return nn("unauthenticated");const Y=s,oe=f,F=await P(Y);return N(Y,oe)&&(F.ok?V==null||V():jf(F.error)&&$()),F};return{get state(){return n},subscribe:P=>(t.add(P),()=>{t.delete(P)}),login:({username:P,password:V,serverOrigin:Y})=>ye(Y,oe=>{var F;return oe.login(P,V,(F=e.device)==null?void 0:F.call(e))}),register:({invite:P,username:V,password:Y,serverOrigin:oe})=>ye(oe,F=>{var le;return F.register(P,V,Y,(le=e.device)==null?void 0:le.call(e))}),logout:async P=>{var ge,ve;if(s===void 0)return nn("unauthenticated");const V=s,Y=(P==null?void 0:P.revoke)===!0;T(),r==="bearer"?((ve=(ge=e.bridge)==null?void 0:ge.account)==null||ve.clear().catch(()=>{}),z()):k({status:"checking"});const oe=(async()=>({forgotten:Y?await _(V.origin):!0,result:await V.logout(Y?{revoke:!0}:void 0)}))(),F=oe.then(()=>{});r==="cookie"&&(p=F);const{forgotten:le,result:ce}=await oe;return p===F&&(p=void 0),r==="cookie"&&s===void 0&&n.status==="checking"&&z(),le?ce.ok?{ok:!0,value:void 0}:ce:nn("hosts_not_forgotten")},revokeAll:async()=>{var V,Y;if(s===void 0)return nn("unauthenticated");const P=await s.revokeAllSessions();return r==="bearer"&&((Y=(V=e.bridge)==null?void 0:V.account)==null||Y.clear().catch(()=>{})),$(),P.ok?{ok:!0,value:void 0}:P},refreshHosts:async()=>s===void 0||n.status!=="signed-in"?nn("unauthenticated"):Z(s,n.user),changePassword:({currentPassword:P,newPassword:V})=>me(Y=>Y.changePassword(P,V)),deleteAccount:({password:P})=>me(V=>V.deleteAccount(P),()=>{var V,Y;r==="bearer"&&((Y=(V=e.bridge)==null?void 0:V.account)==null||Y.clear().catch(()=>{})),$()}),listDevices:()=>me(P=>P.listDevices()),kickDevice:({id:P,password:V})=>me(Y=>Y.kickDevice(P,V)),removeHost:se,createJoinToken:()=>me(P=>P.createJoinToken()),lookupHostLink:P=>me(V=>V.lookupHostLink(P)),confirmHostLink:P=>me(V=>V.confirmHostLink(P)),denyHostLink:P=>me(V=>V.denyHostLink(P)),lookupHostLinkRequest:P=>me(V=>V.lookupHostLinkRequest(P)),confirmHostLinkRequest:P=>me(V=>V.confirmHostLinkRequest(P)),denyHostLinkRequest:P=>me(V=>V.denyHostLinkRequest(P)),watchForHost:xe,listInvites:()=>me(P=>P.listInvites()),createInvite:()=>me(P=>P.createInvite()),revokeInvite:P=>me(V=>V.revokeInvite(P)),pairHost:ae,retryUnsavedHost:async P=>{if(n.status!=="signed-in")return nn("nothing_pending");const V=P===void 0?[...d.values()]:[d.get(cu(n.serverOrigin,P))].filter(oe=>oe!==void 0);if(V.length===0)return nn("nothing_pending");const Y=s;if(Y===void 0)return nn("unauthenticated");for(const oe of V)if(!await O(Y,oe))return nn("pairing_not_saved");return{ok:!0,value:void 0}},hostRejected:P=>{l.add(P),n.status==="signed-in"&&k({...n,rejectedHostKeys:[...l]})}}}function See(){const{store:e,paired:t,dropHost:n}=As(),[s]=h.useState(()=>jee({origin:window.location.origin,bridge:window.pinomadDesktop,hosts:e,paired:t,removeHost:n,name:tb,device:()=>({id:yee(),name:lee(navigator.userAgent,document.documentElement.dataset.pinomadPlatform)})}));return h.useSyncExternalStore(s.subscribe,()=>s.state),s}const Xt=()=>Promise.reject(new Error("no AccountProvider")),Cee={state:{status:"unavailable"},subscribe:()=>()=>{},login:Xt,register:Xt,logout:Xt,revokeAll:Xt,changePassword:Xt,deleteAccount:Xt,refreshHosts:Xt,listDevices:Xt,kickDevice:Xt,removeHost:Xt,createJoinToken:Xt,lookupHostLink:Xt,confirmHostLink:Xt,denyHostLink:Xt,lookupHostLinkRequest:Xt,confirmHostLinkRequest:Xt,denyHostLinkRequest:Xt,watchForHost:()=>{},listInvites:Xt,createInvite:Xt,revokeInvite:Xt,pairHost:Xt,retryUnsavedHost:Xt,hostRejected:()=>{}},YT=h.createContext(Cee);function Eee({children:e}){const t=See();return o.jsx(YT.Provider,{value:t,children:e})}function qr(){const e=h.useContext(YT);return h.useSyncExternalStore(e.subscribe,()=>e.state),e}function $ee(e){const t=Mee(e);if(t===void 0)return"unknown";if(t.family===4)return D9(t.octets);const n=zee(t.segments);return n===void 0?Nee(t.segments):D9(n)}function O9(e){return{...e.type===void 0?{}:{type:e.type},...e.address===void 0?{}:{address:e.address},scope:$ee(e.address)}}function Aee(e,t){return{local:O9(e),remote:O9(t)}}function Mee(e){if(e===void 0)return;const t=e.trim();if(t==="")return;let n=t;if(t.startsWith("[")){const a=t.indexOf("]");if(a===-1)return;const l=t.slice(a+1);if(l!==""&&!/^:\d+$/.test(l))return;n=t.slice(1,a)}else if(t.split(":").length===2){const[a,l]=t.split(":");/^\d+$/.test(l)&&(n=a)}const s=n.indexOf("%");s!==-1&&(n=n.slice(0,s));const r=QT(n);if(r!==void 0)return{family:4,octets:r};const i=Tee(n);return i===void 0?void 0:{family:6,segments:i}}function QT(e){const t=e.split(".");if(t.length!==4)return;const n=[];for(const s of t){if(!/^(?:0|[1-9]\d{0,2})$/.test(s))return;const r=Number(s);if(r>255)return;n.push(r)}return n}function Tee(e){const t=e.split("::");if(t.length>2)return;const n=(a,l)=>{if(a==="")return[];const c=a.split(":"),u=[];for(let d=0;d<c.length;d++){const f=c[d];if(l&&d===c.length-1&&f.includes(".")){const p=QT(f);if(p===void 0)return;u.push(p[0]<<8|p[1],p[2]<<8|p[3]);continue}if(!/^[0-9a-fA-F]{1,4}$/.test(f))return;u.push(Number.parseInt(f,16))}return u};if(t.length===1){const a=n(e,!0);return(a==null?void 0:a.length)===8?a:void 0}const s=n(t[0],!1),r=n(t[1],!0);if(s===void 0||r===void 0)return;const i=8-s.length-r.length;if(!(i<1))return[...s,...new Array(i).fill(0),...r]}function zee(e){if(!(!e.slice(0,5).every(t=>t===0)||e[5]!==65535))return[e[6]>>8,e[6]&255,e[7]>>8,e[7]&255]}function D9(e){const[t,n]=e;return t===127?"loopback":t===100&&n>=64&&n<=127?"tailnet":t===10||t===172&&n>=16&&n<=31||t===192&&n===168||t===169&&n===254?"lan":"public"}function Nee(e){return e[0]===64890&&e[1]===4444&&e[2]===41440?"tailnet":(e[0]&65024)===64512||(e[0]&65472)===65152?"lan":e.slice(0,7).every(t=>t===0)&&e[7]===1?"loopback":"public"}const JT="pinomad",_ee=65535,Ree=65536,B9=_ee;function Iee(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return Array.isArray(t.stun)&&t.stun.every(n=>typeof n=="string"&&n.length>0)&&t.signalOnly===!0}function Lee(e){return e.split(/\r?\n/).filter(t=>t.startsWith("a=candidate:")).map(t=>t.slice(2))}function Oee(e,t){const n=e.split(/\r?\n/).filter(r=>r!==""&&!r.startsWith("a=candidate:")&&r!=="a=end-of-candidates"),s=[...new Set(t.map(r=>r.replace(/^a=/,"")))];return[...n,...s.map(r=>`a=${r}`),"a=end-of-candidates",""].join(`\r
|
|
383
|
-
`)}function Dee(e){const t=e.split(/\r?\n/).find(r=>r.startsWith("a=max-message-size:"));if(t===void 0)return{kind:"bounded",bytes:Ree};const n=t.slice(19).trim();if(!/^\d+$/.test(n))return{kind:"invalid",reason:`malformed a=max-message-size: ${n}`};const s=Number(n);return Number.isSafeInteger(s)?s===0?{kind:"unlimited"}:s<B9?{kind:"invalid",reason:`a=max-message-size ${s} cannot carry a ${B9}-byte record`}:{kind:"bounded",bytes:s}:{kind:"invalid",reason:`a=max-message-size is not a safe integer: ${n}`}}const Bee=256*1024,Hee=64*1024,qee=1e4,Pee=2e3,ez={now:()=>typeof performance>"u"?Date.now():performance.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)};function Uee(e){return{label:`webrtc:${JT}`,open(t){const n=e.clock??ez,s=e.stallMs??qee,r=e.prologue??fT,i=dT({prologue:r,static:e.device,remoteStatic:e.hostKey}),a=[],l=[];let c,u,d,f=!1,p=!1,x=n.now(),g,v,y=!1;const m=()=>{g!==void 0&&n.clearTimeout(g),g=void 0},k=()=>{v!==void 0&&n.clearTimeout(v),v=void 0},b=$=>{if(!p){p=!0,m(),k();try{c==null||c.close()}catch{}t.closed(1006,$)}},j=()=>{p||l.length===0||g!==void 0||(g=n.setTimeout(()=>{if(g=void 0,!p&&l.length!==0){if(n.now()-x<s){j();return}b(`the DataChannel made no progress for ${s}ms`)}},s))},A=()=>{if(p||u===void 0)return;if(l.length===0){m(),k();return}if(u.bufferedAmount>=Bee)return;let $;try{$=u.send(l[0])}catch(E){b(E instanceof Error?E.message:"the DataChannel send failed");return}if($==="rejected"){v===void 0&&(v=n.setTimeout(()=>{v=void 0,A()},50));return}k(),l.shift(),x=n.now(),j(),queueMicrotask(A)},M=$=>{p||$.length===0||(l.push(...$),x=n.now(),j(),A())},T=()=>{if(d!==void 0)for(const $ of a.splice(0))M(d.seal($))},z=$=>{var E;if(!p)try{if(d===void 0){const{payload:_,result:R}=i.readMessage2($);gT(_),d=new mT(R),(E=t.authenticated)==null||E.call(t),T();return}const N=d.open($);N!==void 0&&t.message(N)}catch(N){b(N instanceof Error?N.message:"secure DataChannel failure")}};return e.platform.createPeer(e.stun).then($=>{if(p){$.close();return}c=$,u=$.channel,u.onOpen(()=>{var N,_,R;p||f||(f=!0,(_=e.onSelectedPair)==null||_.call(e,(N=$.selectedPair)==null?void 0:N.call($)),(R=t.opened)==null||R.call(t),y||(y=!0,M([i.writeMessage1(xT({v:1}))])))}),u.onMessage(z),u.onClosed(N=>{p||b(N===void 0?"the DataChannel closed":`the DataChannel closed: ${N}`)}),u.onBufferedAmountLow(A);let E;return e.offer($.offerSdp).then(N=>{var R;if(p)return;const _=Dee(N);if(_.kind==="invalid")throw new Error(_.reason);E=N,$.acceptAnswer(E),(R=t.signaled)==null||R.call(t)})},$=>b($ instanceof Error?$.message:String($))).catch($=>b($ instanceof Error?$.message:String($))),{send($){if(!p){if(d===void 0){a.push($);return}M(d.seal($))}},close(){if(!p){p=!0,m(),k();try{c==null||c.close()}catch{}}}}}}}function tz(){return typeof RTCPeerConnection<"u"}function H9(e){const t=e,n=(t==null?void 0:t.address)??(t==null?void 0:t.ip);return{...typeof(t==null?void 0:t.candidateType)=="string"?{type:t.candidateType}:{},...typeof n=="string"&&n!==""?{address:n}:{}}}async function Fee(e){try{const t=await e.getStats(),n=new Map;t.forEach(r=>n.set(r.id,r));let s;return t.forEach(r=>{if(r.type!=="transport")return;const i=r.selectedCandidatePairId;if(i===void 0)return;const a=n.get(i);(a==null?void 0:a.type)==="candidate-pair"&&(s=a)}),s===void 0&&t.forEach(r=>{if(r.type!=="candidate-pair")return;const i=r;(i.selected===!0||i.state==="succeeded"&&i.nominated===!0)&&(s=i)}),s===void 0?void 0:{local:H9(s.localCandidateId===void 0?void 0:n.get(s.localCandidateId)),remote:H9(s.remoteCandidateId===void 0?void 0:n.get(s.remoteCandidateId))}}catch{return}}function Vee(e,t,n,s,r,i){const a=()=>{if(!(s.closed||s.locallyClosed)&&s.openNotified!==!0){s.openNotified=!0;for(const c of n.open)c()}},l={send(c){return e.send(c),"queued"},get bufferedAmount(){return e.bufferedAmount},close(){e.close()},onOpen(c){n.open.push(c)},onMessage(c){n.message.push(c)},onClosed(c){n.closed.push(c)},onBufferedAmountLow(c){n.low.push(c)}};return e.binaryType="arraybuffer",e.bufferedAmountLowThreshold=Hee,e.onbufferedamountlow=()=>{for(const c of n.low)c()},e.onmessage=c=>{if(s.closed||s.locallyClosed)return;const u=c.data,d=u instanceof ArrayBuffer?new Uint8Array(u):ArrayBuffer.isView(u)?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):void 0;if(d===void 0){i("the DataChannel delivered a non-binary message");return}for(const f of n.message)f(d)},e.onopen=()=>{Fee(t).then(c=>{c!==void 0&&(s.selectedPair=c),a()})},e.onclose=c=>{if(s.locallyClosed||s.closed)return;const u=c.reason;r(u===""||u===void 0?"the DataChannel closed":u)},e.onerror=c=>{var d;const u=(d=c.error)==null?void 0:d.message;i(u===void 0||u===""?"the DataChannel failed":u)},t.onconnectionstatechange=()=>{t.connectionState==="failed"?i("the PeerConnection failed"):t.connectionState==="closed"&&!s.locallyClosed&&r("the PeerConnection closed")},t.oniceconnectionstatechange=()=>{t.iceConnectionState==="failed"&&i("the ICE connection failed")},l}async function Gee(e){const t=[];let n,s=!1,r,i;const a=new Promise((d,f)=>{r=d,i=f}),l=()=>{n!==void 0&&clearTimeout(n),n=void 0,e.onicecandidate=null,e.onicegatheringstatechange=null},c=d=>{s||(s=!0,l(),i(new Error(d)))},u=()=>{if(s)return;const d=e.localDescription;if(d===null){c("the browser produced no local offer description");return}const f=[...new Set([...t,...Lee(d.sdp)])];if(f.length===0){c("the browser gathered no ICE candidates");return}s=!0,l(),r(Oee(d.sdp,f))};e.onicecandidate=d=>{if(!s){if(d.candidate===null){u();return}t.push(d.candidate.candidate)}},e.onicegatheringstatechange=()=>{e.iceGatheringState==="complete"&&u()},n=setTimeout(u,Pee);try{const d=await e.createOffer();await e.setLocalDescription(d),e.iceGatheringState==="complete"&&u()}catch(d){c(d instanceof Error?d.message:String(d))}return a}async function Wee(e){const t={open:[],message:[],closed:[],low:[]},n={locallyClosed:!1,closed:!1},s=u=>{if(!(n.closed||n.locallyClosed)){n.closed=!0;for(const d of t.closed)d(u)}},r=()=>{try{a.close()}catch{}try{e.close()}catch{}},i=u=>{n.closed||n.locallyClosed||(s(u),r())},a=e.createDataChannel(JT,{ordered:!0}),l=Vee(a,e,t,n,s,i);let c;try{c=await Gee(e)}catch(u){throw n.locallyClosed=!0,r(),u}return{offerSdp:c,acceptAnswer(u){n.locallyClosed||e.setRemoteDescription({type:"answer",sdp:u}).catch(d=>{i(d instanceof Error?d.message:String(d))})},channel:l,selectedPair:()=>n.selectedPair,close(){n.locallyClosed||(n.locallyClosed=!0,r())}}}function nz(){if(tz())return{createPeer(e){const t=new RTCPeerConnection({iceServers:e.map(n=>({urls:n}))});return Wee(t)}}}function ko(e){return e===void 0||e.phase==="connecting"?"connecting":e.phase==="failed"?e.mismatch===void 0&&!e.unauthorized?"offline":"terminal":e.view.connection==="connected"?"connected":e.view.connection==="reconnecting"?"offline":"terminal"}function nb(e){if(!(e===void 0||ko(e)!=="terminal")){if(e.phase==="failed")return e.mismatch===void 0?"rejected":"protocol_mismatch";if(e.phase!=="connecting")return e.view.connection==="outdated"||e.view.protocolMismatch!==void 0?"protocol_mismatch":e.view.unauthorized===!0?"rejected":"closed"}}var Gl,Wl,Yu;class Kee{constructor(){ue(this,Gl,new Map);ue(this,Wl,new Set);ue(this,Yu,0);be(this,"subscribe",t=>(S(this,Wl).add(t),()=>{S(this,Wl).delete(t)}));be(this,"snapshot",()=>S(this,Yu))}publish(t,n){S(this,Gl).set(t,n),W(this,Yu,S(this,Yu)+1);for(const s of S(this,Wl))s()}remove(t){if(S(this,Gl).delete(t)){W(this,Yu,S(this,Yu)+1);for(const n of S(this,Wl))n()}}get(t){return S(this,Gl).get(t)}all(){return S(this,Gl)}}Gl=new WeakMap,Wl=new WeakMap,Yu=new WeakMap;function Xee(){return new Kee}const mm=h.createContext(void 0);function Zee(){return h.useContext(mm)}function sz(){const e=Zee();return h.useSyncExternalStore((e==null?void 0:e.subscribe)??(()=>()=>{}),(e==null?void 0:e.snapshot)??(()=>0)),(e==null?void 0:e.all())??new Map}function Ck(e){switch(ko(e)){case"connected":return"Connected";case"connecting":return"Connecting";case"offline":return"Offline";case"terminal":{const t=nb(e);return t==="rejected"?"Not paired":t==="protocol_mismatch"?"Protocol mismatch":"Disconnected"}}}function zd({connectVariant:e="primary"}={}){const[t,n]=h.useState(""),[s,r]=h.useState(),i=()=>{const a=qT(t);if(a===void 0){r(/[#?&]token=/.test(t)?"Token links can't pair a device — paste a pairing link instead (pinomad pair, or Settings → Devices → Pair a device).":"That isn't a pairing link — paste one like http://<host>/#pair=… or pinomad://pair#pair=…");return}window.location.hash=a,window.location.reload()};return o.jsxs(o.Fragment,{children:[o.jsxs(ke,{gap:2,vAlign:"end",style:{width:"100%"},children:[o.jsx("div",{className:"min-w-0 flex-1",children:o.jsx(st,{label:"Pairing link",isLabelHidden:!0,placeholder:"http://…/#pair=… or pinomad://pair#…",value:t,onChange:a=>{r(void 0),n(a)},onEnter:i,width:"100%"})}),o.jsx(Q,{label:"Connect",variant:e,isDisabled:t.trim()==="",onClick:i})]}),s===void 0?null:o.jsx(Oe,{status:"error",title:"Not a pairing link",description:s})]})}const Yee=5e3;async function rz({host:e,remote:t,forget:n}){let s=!1;if(t!==void 0){let r;s=await Promise.race([t.controller.revokeDevice(Dh(Td(Vi(e.privateKey)).publicKey)).then(()=>!0),new Promise(i=>{r=setTimeout(()=>i(!1),Yee)})]),clearTimeout(r)}return await n(e.hostKey),{hostAnswered:s}}function iz(e){return{body:`${e} didn't answer, so only this device forgot it. Unpair this device under Settings → Devices on ${e}.`,type:"info"}}const Qee="https://app.pinomad.si";function Bo(e){const[t,n]=h.useState(()=>Date.now());return h.useEffect(()=>{const s=setInterval(()=>n(Date.now()),e);return()=>clearInterval(s)},[e]),t}function us(e){switch(e.code){case"invalid_credentials":return"Wrong username or password.";case"rate_limited":return"Too many attempts. Wait a few minutes and try again.";case"network":return"Can't reach the server. Check the address and your connection.";case"origin_required":return"Enter the server address.";case"insecure_origin":return"The server address must start with https://.";case"unauthenticated":return"You were signed out. Sign in again.";case"accounts_disabled":return"This server doesn't have accounts turned on.";case"host_offline":return"The host is offline.";case"host_too_old":return"The host needs an update (run pinomad upgrade on it).";case"key_mismatch":return"The host's key doesn't match its account record. Run pinomad join on it again.";case"disabled":return"The host doesn't accept account devices. Turn it on in Devices, or pair with a QR code.";case"not_joined":case"rebinding":return"The host is moving between servers. Try again after it restarts.";case"host_timeout":return"The host didn't answer in time. Try again.";case"pair_rejected":return"The host refused this device. If you revoked it before, pair it with a QR code instead.";case"pair_unreachable":return"Couldn't reach the host on any offered path. Check your network connection or Tailscale and try again.";case"pair_timeout":return"The host didn't answer on any offered path in time. Try again.";case"pair_unsupported":return"This app can't connect to any address the host offered. The page may block an insecure ws:// path; try the desktop app or a secure address.";case"pairing_not_saved":return"Paired, but this device couldn't save the pairing.";case"invalid_invite":return"This invite code isn't valid. It may have been used or revoked.";case"invite_expired":return"This invite code has expired. Ask for a new one.";case"invalid_username":return"Use 2–32 lowercase letters, digits, dots, dashes or underscores, starting with a letter or digit.";case"weak_password":return"Use a password of at least 12 characters.";case"wrong_password":return"The current password is wrong.";case"host_removed":return"The host was removed from the account.";case"remove_unsupported":return"This server can't remove hosts yet. Run pinomad leave on the host instead.";case"current_device":return"That's the device you're using. Sign out instead.";case"admin_account":return"The server's admin account can't be deleted.";case"username_taken":return"That username is taken.";case"forbidden":return"Only the server's admin can do this.";default:return`Something went wrong (${e.code}).`}}function oz({bridge:e,serverOrigin:t,onOpened:n}){const[s,r]=h.useState(!1),[i,a]=h.useState(),l=()=>{r(!0),a(void 0),e.runSetup(t).catch(c=>({ok:!1,message:c instanceof Error?c.message:String(c)})).then(c=>{r(!1),c.ok?n==null||n():a(c.message)})};return o.jsxs(re,{gap:2,children:[o.jsx(ke,{children:o.jsx(Q,{label:"Run in Terminal",variant:"secondary",isLoading:s,onClick:l})}),i===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't open Terminal",description:i})]})}const az=()=>{var e;return(e=window.pinomadDesktop)==null?void 0:e.localHost},Jee=12e4;function lz(e,t=2e3){const[n,s]=h.useState(),[r,i]=h.useState(),a=h.useRef(0),l=h.useCallback(async()=>{if(e===void 0)return;const d=++a.current;let f;try{f=await e.state()}catch(p){f={kind:"error",message:p instanceof Error?p.message:String(p)}}d===a.current&&s(f)},[e]);h.useEffect(()=>{l();const d=()=>void l();return window.addEventListener("focus",d),()=>{window.removeEventListener("focus",d),a.current+=1}},[l]);const c=(n==null?void 0:n.kind)==="not-installed"||(n==null?void 0:n.kind)==="installed"&&!n.running&&!n.stopped;h.useEffect(()=>{if(r===void 0||!c)return;if(Date.now()>=r){i(void 0);return}const d=setTimeout(()=>void l(),t);return()=>clearTimeout(d)},[n,c,r,t,l]);const u=h.useCallback(()=>i(Date.now()+Jee),[]);return{state:n,refresh:l,pollUntilInstalled:u}}const cz=8;function ete(e){return e.toUpperCase().replace(/[^A-Z]/g,"").slice(0,cz)}function uz(e){return e.length>4?`${e.slice(0,4)}-${e.slice(4)}`:e}function dz(e){return e.length===cz}const fz="pinomad.knownAccountHosts",ay=e=>`${Bs(e.serverOrigin)}\0${e.user}`,q9=e=>{let t;try{t=e.getItem(fz)}catch{return}if(t===null)return{};let n;try{n=JSON.parse(t)}catch{return{}}if(typeof n!="object"||n===null||Array.isArray(n))return{};const s={};for(const[r,i]of Object.entries(n))Array.isArray(i)&&(s[r]=i.filter(a=>typeof a=="string"));return s},ly=(e,t)=>{try{e.setItem(fz,JSON.stringify(t))}catch(n){console.error("Could not save the known account hosts",n)}};function tte(e=localStorage){return{arrivals:(t,n)=>{const s=q9(e);if(s===void 0)return[];const r=ay(t),i=s[r];if(i===void 0)return ly(e,{...s,[r]:[...n]}),[];const a=n.filter(l=>!i.includes(l));return a.length>0&&ly(e,{...s,[r]:[...i,...a]}),a},add:(t,n)=>{const s=q9(e),r=s==null?void 0:s[ay(t)];s===void 0||r===void 0||r.includes(n)||ly(e,{...s,[ay(t)]:[...r,n]})}}}const sb=tte();function hz(e,t){switch(e.code){case"not_found":return t==="lookup"?"No host is waiting with this code. Check it against the host's terminal; codes expire after 10 minutes.":"This host is no longer waiting: it timed out, or it was confirmed or denied elsewhere. Run pinomad up on it again.";case"rate_limited":return"Too many wrong codes. Wait 15 minutes and try again.";case"invalid_request":return"Enter the 8-letter code from the host's terminal.";default:return us(e)}}function rb({knownHosts:e=sb,onSettled:t,onClose:n}){const s=qr(),[r,i]=h.useState(""),[a,l]=h.useState({kind:"entry"}),[c,u]=h.useState(),d=()=>{i(""),l({kind:"entry"})},f=()=>{if(!dz(r)||c!==void 0)return;const x=uz(r);u("lookup"),s.lookupHostLink(x).then(g=>{u(void 0),l(g.ok?{kind:"confirm",code:x,request:g.value}:{kind:"entry",error:g.error})})},p=x=>{if(a.kind!=="confirm"||c!==void 0)return;const{code:g,request:v}=a;u(x?"confirm":"deny"),(x?s.confirmHostLink(g):s.denyHostLink(g)).then(y=>{if(u(void 0),!y.ok){l({...a,error:y.error});return}x&&s.state.status==="signed-in"&&(e.add({serverOrigin:s.state.serverOrigin,user:s.state.user},v.hostId),s.watchForHost(v.hostId)),l({kind:x?"confirmed":"denied",name:v.name}),t==null||t(x?"confirmed":"denied")})};switch(a.kind){case"entry":return o.jsx(ste,{code:r,error:a.error,isBusy:c==="lookup",onChange:x=>i(ete(x)),onSubmit:f,...n===void 0?{}:{onCancel:n}});case"confirm":return o.jsx(pz,{request:a.request,error:a.error,busy:c==="confirm"||c==="deny"?c:void 0,onConfirm:()=>p(!0),onDeny:()=>p(!1),onBack:d});case"confirmed":case"denied":return o.jsx(ite,{outcome:a.kind,name:a.name,onDone:n??d})}}function nte({requestId:e,navigate:t,knownHosts:n=sb,onSettled:s,onClose:r}){const i=qr(),[a,l]=h.useState({kind:"looking"}),[c,u]=h.useState();h.useEffect(()=>{let f=!0;return i.lookupHostLinkRequest(e).then(p=>{f&&l(p.ok?{kind:"confirm",request:p.value}:{kind:"missing",error:p.error})}),()=>{f=!1}},[i,e]);const d=f=>{if(a.kind!=="confirm"||c!==void 0)return;const{request:p}=a;u(f?"confirm":"deny"),(f?i.confirmHostLinkRequest(e):i.denyHostLinkRequest(e)).then(x=>{if(u(void 0),!x.ok){l({...a,error:x.error});return}f&&i.state.status==="signed-in"&&(n.add({serverOrigin:i.state.serverOrigin,user:i.state.user},p.hostId),i.watchForHost(p.hostId)),l({kind:"leaving"}),s==null||s(),t(x.value)})};switch(a.kind){case"looking":case"leaving":return o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Vt,{size:"sm"}),o.jsx(K,{type:"supporting",children:a.kind==="looking"?"Looking up the host…":"Handing the answer back to the host…"})]});case"missing":return o.jsxs(re,{gap:3,style:{width:"100%"},children:[o.jsx(Oe,{status:"error",title:"Couldn't find this host",description:a.error.code==="not_found"?"It's no longer waiting: it timed out, or it was confirmed or denied already. Run pinomad up on it again.":us(a.error)}),r===void 0?null:o.jsx(ke,{children:o.jsx(Q,{label:"Close",variant:"secondary",onClick:r})})]});case"confirm":return o.jsx(pz,{request:a.request,error:a.error,busy:c,onConfirm:()=>d(!0),onDeny:()=>d(!1)})}}function ste({code:e,error:t,isBusy:n=!1,onChange:s,onSubmit:r,onCancel:i}){return o.jsxs(re,{gap:3,style:{width:"100%"},children:[o.jsx(st,{label:"Code from the host",description:"The host's terminal shows it, like KXHN-BWCV.",placeholder:"XXXX-XXXX",value:uz(e),onChange:s,onEnter:r,width:"100%"}),t===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't find that host",description:hz(t,"lookup")}),o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Q,{label:"Continue",variant:"primary",isLoading:n,isDisabled:!dz(e),onClick:r}),i===void 0?null:o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:i})]})]})}const P9={width:"var(--spacing-4)",height:"var(--spacing-4)"},rte=e=>e.length>16?`${e.slice(0,8)}…${e.slice(-6)}`:e;function pz({request:e,error:t,busy:n,onConfirm:s,onDeny:r,onBack:i}){const a=Bo(1e3),[l,c]=h.useState(!1),u=Math.max(0,Math.ceil((e.expiresAt-a)/1e3)),d=u===0;return o.jsxs(re,{gap:4,style:{width:"100%"},children:[o.jsxs(re,{gap:1,children:[o.jsx(Jn,{level:3,children:"Add this host to your account?"}),o.jsx(K,{type:"supporting",children:"Only confirm a computer you are setting up yourself right now."})]}),e.ipDiffers?o.jsx(Oe,{status:"warning",title:"This request came from a different network address than this device",description:`The host asked from ${e.sourceIp}. If you aren't setting it up on another network yourself, deny it.`}):null,o.jsxs(VC,{children:[o.jsx(zf,{label:"Name",children:o.jsx(K,{weight:"semibold",children:e.name})}),o.jsx(zf,{label:"System",children:o.jsx(K,{children:e.os})}),o.jsx(zf,{label:"Asked from",children:o.jsx(K,{type:"code",children:e.sourceIp})}),o.jsx(zf,{label:"Host ID",children:o.jsxs(ke,{gap:2,vAlign:"center",wrap:"wrap",children:[o.jsx(Wi,{content:e.hostId,children:o.jsx("span",{tabIndex:0,"aria-label":`Host ID ${e.hostId}`,children:o.jsx(K,{type:"code",children:rte(e.hostId)})})}),o.jsx(Q,{label:l?"Copied":"Copy",variant:"secondary",size:"sm",icon:l?o.jsx(oa,{"aria-hidden":"true",style:P9}):o.jsx(K3,{"aria-hidden":"true",style:P9}),onClick:()=>{var f;(f=navigator.clipboard)==null||f.writeText(e.hostId).then(()=>c(!0),()=>{})}})]})})]}),d?o.jsx(Oe,{status:"warning",title:"This request has expired",description:"Run pinomad up on the host again."}):o.jsxs(K,{type:"supporting",hasTabularNumbers:!0,children:["The host's terminal should show the same name and ID. Expires in ",Math.floor(u/60),":",String(u%60).padStart(2,"0")]}),t===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't answer the host",description:hz(t,"answer")}),o.jsxs(ke,{gap:2,vAlign:"center",hAlign:"between",wrap:"wrap",children:[o.jsxs(ke,{gap:2,children:[o.jsx(Q,{label:"Confirm",variant:"primary",isLoading:n==="confirm",isDisabled:d||n==="deny",onClick:s}),o.jsx(Q,{label:"Deny",variant:"secondary",isLoading:n==="deny",isDisabled:n==="confirm",onClick:r})]}),i===void 0?null:o.jsx(Q,{label:"Enter another code",variant:"ghost",isDisabled:n!==void 0,onClick:i})]})]})}function ite({outcome:e,name:t,onDone:n}){return o.jsxs(re,{gap:3,style:{width:"100%"},children:[e==="confirmed"?o.jsx(Oe,{status:"success",title:`${t} joined your account`,description:"It will appear in your hosts and connect on its own once its terminal finishes setting up."}):o.jsx(Oe,{status:"info",title:`Turned ${t} away`,description:"Its terminal will say the join was denied."}),o.jsx(ke,{children:o.jsx(Q,{label:"Done",variant:"secondary",onClick:n})})]})}const ote=e=>`curl -fsSL https://pinomad.si/install.sh | sh -s -- up --origin ${e.replace(/\/+$/,"")}`;function xz({serverOrigin:e}){const t=az(),{state:n,pollUntilInstalled:s}=lz(t);return o.jsxs(re,{gap:4,style:{width:"100%"},children:[o.jsxs(re,{gap:2,children:[o.jsx(K,{type:"supporting",children:"On the computer you want to add, open a terminal and run:"}),o.jsx(Ch,{code:ote(e),hasCopyButton:!0,isWrapped:!0,width:"100%"})]}),t!==void 0&&(n==null?void 0:n.kind)==="not-installed"?o.jsxs(re,{gap:2,children:[o.jsx(K,{type:"supporting",children:"Or run it on this Mac in Terminal, then enter the code it shows below."}),o.jsx(oz,{bridge:t,serverOrigin:e})]}):null,o.jsxs(re,{gap:2,children:[o.jsx(K,{type:"supporting",children:"It asks how your other devices should reach the host; press Enter to go through this server. Then it opens a page to confirm the host, or, on a computer without a browser, prints a code. Enter that code here:"}),o.jsx(rb,{onSettled:r=>r==="confirmed"&&s()})]}),o.jsx(ate,{})]})}function ate(){const e=qr(),[t,n]=h.useState(!1),[s,r]=h.useState(),[i,a]=h.useState(),[l,c]=h.useState(!1),u=()=>{c(!0),a(void 0),e.createJoinToken().then(f=>{c(!1),f.ok?r(f.value):a(f.error)})},d=f=>{n(f),f&&s===void 0&&!l&&u()};return o.jsx(Bg,{trigger:o.jsx(K,{type:"supporting",children:"Advanced: join with a one-time token"}),isOpen:t,onOpenChange:d,children:o.jsxs(re,{gap:2,children:[o.jsx(K,{type:"supporting",children:"For scripts: this command joins without a code to confirm. Anyone who has it can add a host."}),s===void 0?i===void 0?o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Vt,{size:"sm"}),o.jsx(K,{type:"supporting",children:"Creating a command…"})]}):o.jsx(Oe,{status:"error",title:"Couldn't create a join command",description:us(i),endContent:o.jsx(Q,{label:"Try again",variant:"secondary",isLoading:l,onClick:u})}):o.jsx(lte,{token:s,onRenew:u}),s!==void 0&&i!==void 0?o.jsx(Oe,{status:"error",title:"Couldn't create a new command",description:us(i)}):null]})})}function lte({token:e,onRenew:t}){const n=Bo(1e3),s=Math.max(0,Math.ceil((e.expiresAt-n)/1e3));return o.jsxs(re,{gap:2,children:[o.jsx(Ch,{code:e.command,hasCopyButton:!0,isWrapped:!0,width:"100%"}),s===0?o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(K,{type:"supporting",children:"Expired"}),o.jsx(Q,{label:"New command",variant:"secondary",size:"sm",onClick:t})]}):o.jsxs(K,{type:"supporting",hasTabularNumbers:!0,children:["Works once · expires in ",Math.floor(s/60),":",String(s%60).padStart(2,"0")]})]})}function gz({account:e,hostId:t,name:n,serverOrigin:s,onClose:r}){const[i,a]=h.useState(""),[l,c]=h.useState(!1),[u,d]=h.useState(),f=()=>{i===""||l||(c(!0),d(void 0),e.removeHost({hostId:t,password:i}).then(p=>{c(!1),p.ok?r(!0):d(p.error)}))};return o.jsxs(re,{gap:2,children:[o.jsxs(K,{type:"supporting",children:[n," leaves your account and stops connecting through ",new URL(s).host,". Only running pinomad up on that machine brings it back. This device forgets it too, unless you paired it with a QR code."]}),o.jsx(st,{label:"Password",type:"password",value:i,onChange:a,onEnter:f,width:"100%"}),u===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't remove the host",description:us(u)}),o.jsxs(ke,{gap:2,children:[o.jsx(Q,{label:"Remove host",variant:"destructive",isLoading:l,isDisabled:i==="",onClick:f}),o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:()=>r(!1)})]})]})}function cte(e){return o.jsx(Us,{isOpen:!0,purpose:"form",onOpenChange:t=>t?void 0:e.onClose(!1),width:440,children:o.jsx(Cs,{header:o.jsx(Hr,{title:`Remove ${e.name}`,onOpenChange:()=>e.onClose(!1)}),content:o.jsx(Es,{children:o.jsx("div",{style:{padding:"var(--spacing-2)"},children:o.jsx(gz,{...e})})})})})}function ib(){const e=qr(),{state:t}=e,[n,s]=h.useState();switch(h.useEffect(()=>{t.status==="signed-in"&&s(void 0)},[t.status]),t.status){case"unavailable":return null;case"checking":return o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Vt,{size:"sm"}),o.jsx(K,{type:"supporting",children:"Checking for an account…"})]});case"signed-out":return o.jsxs(re,{gap:3,style:{width:"100%"},children:[n===void 0?null:o.jsx(Oe,{...n}),o.jsx(ute,{account:e,state:t})]});case"signed-in":return o.jsx(hte,{account:e,state:t,onNotice:s})}}function ute({account:e,state:t}){const[n,s]=h.useState(t.serverOrigin??Qee),[r,i]=h.useState(!1),a=t.mode==="bearer"?{origin:n,setOrigin:s}:void 0;return r?o.jsx(fte,{account:e,server:a,onSignIn:()=>i(!1)}):o.jsx(dte,{account:e,server:a,onSignUp:()=>i(!0)})}function dte({account:e,server:t,onSignUp:n}){const s=t!==void 0,r=(t==null?void 0:t.origin)??"",[i,a]=h.useState(""),[l,c]=h.useState(""),[u,d]=h.useState(!1),[f,p]=h.useState(),x=i.trim()!==""&&l!==""&&(!s||r.trim()!==""),g=()=>{!x||u||(d(!0),p(void 0),e.login({username:i.trim(),password:l,...s?{serverOrigin:r.trim()}:{}}).then(v=>{d(!1),v.ok||p(v.error)}))};return o.jsxs(re,{gap:3,style:{width:"100%"},children:[o.jsxs(re,{gap:1,children:[o.jsx(Jn,{level:3,children:"Sign in"}),o.jsx(K,{type:"supporting",children:"See the hosts on your account and connect without a QR code."})]}),t===void 0?null:o.jsx(st,{label:"Server",placeholder:"https://nomad.example.com",value:t.origin,onChange:t.setOrigin,onEnter:g,width:"100%"}),o.jsx(st,{label:"Username",value:i,onChange:a,onEnter:g,width:"100%"}),o.jsx(st,{label:"Password",type:"password",value:l,onChange:c,onEnter:g,width:"100%"}),f===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't sign in",description:us(f)}),o.jsxs(ke,{gap:2,vAlign:"center",hAlign:"between",children:[o.jsx(Q,{label:"Sign in",variant:"primary",isLoading:u,isDisabled:!x,onClick:g}),o.jsx(Q,{label:"Create an account",variant:"ghost",onClick:n})]})]})}function fte({account:e,server:t,onSignIn:n}){const s=t!==void 0,r=(t==null?void 0:t.origin)??"",[i,a]=h.useState(""),[l,c]=h.useState(""),[u,d]=h.useState(""),[f,p]=h.useState(!1),[x,g]=h.useState(),v=i.trim()!==""&&l.trim()!==""&&u!==""&&(!s||r.trim()!==""),y=()=>{!v||f||(p(!0),g(void 0),e.register({invite:i.trim(),username:l.trim(),password:u,...s?{serverOrigin:r.trim()}:{}}).then(m=>{p(!1),m.ok||g(m.error)}))};return o.jsxs(re,{gap:3,style:{width:"100%"},children:[o.jsxs(re,{gap:1,children:[o.jsx(Jn,{level:3,children:"Create an account"}),o.jsx(K,{type:"supporting",children:"You need an invite code from the server's admin."})]}),t===void 0?null:o.jsx(st,{label:"Server",placeholder:"https://nomad.example.com",value:t.origin,onChange:t.setOrigin,onEnter:y,width:"100%"}),o.jsx(st,{label:"Invite code",value:i,onChange:a,onEnter:y,width:"100%"}),o.jsx(st,{label:"Username",description:"Lowercase letters, digits, dots, dashes or underscores",value:l,onChange:c,onEnter:y,width:"100%"}),o.jsx(st,{label:"Password",description:"At least 12 characters",type:"password",value:u,onChange:d,onEnter:y,width:"100%"}),x===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't create the account",description:us(x)}),o.jsxs(ke,{gap:2,vAlign:"center",hAlign:"between",children:[o.jsx(Q,{label:"Create account",variant:"primary",isLoading:f,isDisabled:!v,onClick:y}),o.jsx(Q,{label:"Sign in instead",variant:"ghost",onClick:n})]})]})}function hte({account:e,state:t,onNotice:n}){const[s,r]=h.useState(),{focusHost:i}=As(),a=new URL(t.serverOrigin).host,l=c=>{var u;r(void 0),e.retryUnsavedHost((u=c.account)==null?void 0:u.hostId).then(d=>{d.ok?i(c.hostKey):r(d.error)})};return o.jsxs(re,{gap:4,style:{width:"100%"},children:[o.jsxs(re,{gap:1,children:[o.jsx(Jn,{level:3,children:t.user}),o.jsxs(K,{type:"supporting",children:["Signed in to ",a]})]}),t.unsavedHosts.map(c=>o.jsx(Oe,{status:"warning",title:"This pairing wasn't saved",description:`${c.name??c.url} will be lost when the app restarts.`,endContent:o.jsx(Q,{label:"Retry",variant:"secondary",onClick:()=>l(c)})},c.hostKey)),o.jsx(pte,{account:e,state:t,onError:r}),s===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't pair",description:us(s)}),o.jsx(mte,{account:e,serverOrigin:t.serverOrigin}),o.jsx(bte,{account:e,hosts:t.hosts}),t.admin?o.jsx(yte,{account:e}):null,o.jsx(Cte,{account:e}),o.jsx($te,{account:e,onNotice:n}),t.admin?null:o.jsx(Ate,{account:e,server:a,onNotice:n})]})}function pte({account:e,state:t,onError:n}){const s=Bo(3e4),{focus:r,focusHost:i}=As(),[a,l]=h.useState(),[c,u]=h.useState(),d=f=>{l(f),n(void 0),e.pairHost(f).then(p=>{l(void 0),p.ok?i(p.value.hostKey):n(p.error)})};return o.jsxs(re,{gap:2,children:[o.jsxs(ke,{gap:2,vAlign:"center",hAlign:"between",children:[o.jsx(K,{weight:"semibold",children:"Hosts"}),o.jsx(Q,{label:"Refresh",variant:"secondary",size:"sm",onClick:()=>void e.refreshHosts()})]}),t.hostsError===void 0?null:o.jsx(Oe,{status:"warning",title:"Couldn't refresh hosts",description:us(t.hostsError)}),t.hosts.length===0?o.jsx(K,{type:"supporting",children:"No hosts yet. Add one below."}):o.jsx(Jt,{density:"compact",children:t.hosts.map(f=>{var p;return o.jsx(gte,{match:f,now:s,isCurrent:f.status==="paired"&&((p=f.stored)==null?void 0:p.hostKey)===(r==null?void 0:r.hostKey),isRevoked:f.stored!==void 0&&t.rejectedHostKeys.includes(f.stored.hostKey),isPairing:a===f.host.hostId,isBusy:a!==void 0,isRemoveDisabled:c!==void 0||a===f.host.hostId,onPair:()=>d(f.host.hostId),onRemove:()=>u(f.host)},f.host.hostId)})}),c===void 0?null:o.jsxs(re,{gap:2,children:[o.jsxs(K,{weight:"semibold",children:["Remove ",c.name]}),o.jsx(gz,{account:e,hostId:c.hostId,name:c.name,serverOrigin:t.serverOrigin,onClose:()=>u(void 0)})]})]})}const xte={offline:"Offline",host_too_old:"Needs pinomad upgrade",key_mismatch:"Run pinomad join again"};function gte({match:e,now:t,isCurrent:n,isRevoked:s,isPairing:r,isBusy:i,isRemoveDisabled:a,onPair:l,onRemove:c}){const{focusHost:u}=As(),{host:d,status:f,stored:p}=e,x=d.online?"Online":`Last seen ${Zd(d.lastSeenAt,t)}`,g=d.pairing==="available",v=k=>o.jsx(Q,{label:k,variant:"secondary",size:"sm",isLoading:r,isDisabled:!g||i,onClick:l});let y=x,m;return s?(y="This device was refused by the host",m=v("Pair again")):f==="key_changed"?(y="The host's identity changed. Pair again only if you reinstalled it.",m=o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Ln,{label:"Key changed",color:"orange",size:"sm"}),v("Pair again")]})):f==="paired"?m=n?o.jsx(Ln,{label:"Connected",size:"sm"}):o.jsx(Q,{label:"Connect",variant:"secondary",size:"sm",onClick:()=>u(p.hostKey)}):(g||(y=`${x} · ${xte[d.pairing]}`),m=v("Pair")),o.jsx(Je,{label:d.name,description:y,startContent:o.jsx(Fi,{variant:d.online?"success":"neutral",label:d.online?"Online":"Offline"}),endContent:o.jsxs(ke,{gap:1,vAlign:"center",children:[m,o.jsx(Q,{label:"Remove",variant:"secondary",size:"sm",isDisabled:a,onClick:c})]})})}function mte({account:e,serverOrigin:t}){const[n,s]=h.useState(!1);return n?o.jsxs(re,{gap:3,children:[o.jsxs(ke,{gap:2,vAlign:"center",hAlign:"between",children:[o.jsx(K,{weight:"semibold",children:"Add a host"}),o.jsx(Q,{label:"Done",variant:"secondary",size:"sm",onClick:()=>{s(!1),e.refreshHosts()}})]}),o.jsx(xz,{serverOrigin:t})]}):o.jsx(Q,{label:"Add a host",variant:"secondary",onClick:()=>s(!0)})}const g1=(e,t)=>{const n=Zd(e,t);return n==="now"?"just now":`${n} ago`};function yte({account:e}){const t=Bo(6e4),[n,s]=h.useState(),[r,i]=h.useState(),[a,l]=h.useState(),[c,u]=h.useState(!1),d=()=>e.listInvites().then(x=>{x.ok?s(x.value):l(x.error)});h.useEffect(()=>{d()},[e]);const f=()=>{u(!0),l(void 0),e.createInvite().then(async x=>{if(u(!1),!x.ok){l(x.error);return}i(x.value),await d()})},p=x=>{l(void 0),e.revokeInvite(x).then(async g=>{g.ok||l(g.error),await d()})};return o.jsxs(re,{gap:2,children:[o.jsxs(ke,{gap:2,vAlign:"center",hAlign:"between",children:[o.jsx(K,{weight:"semibold",children:"Invites"}),o.jsx(Q,{label:"Create invite",variant:"secondary",size:"sm",isLoading:c,onClick:f})]}),r===void 0?null:o.jsxs(re,{gap:2,children:[o.jsx(K,{type:"supporting",children:"Send this code to the person you're inviting. It won't be shown again."}),o.jsx(Ch,{code:r.code,hasCopyButton:!0,isWrapped:!0}),o.jsxs(ke,{gap:2,vAlign:"center",hAlign:"between",children:[o.jsxs(K,{type:"supporting",children:["Works once · expires in ",Zd(t,r.expiresAt)]}),o.jsx(Q,{label:"Done",variant:"secondary",size:"sm",onClick:()=>i(void 0)})]})]}),n===void 0||n.length===0?n===void 0?null:o.jsx(K,{type:"supporting",children:"No invites yet. Each one lets one person create an account."}):o.jsx(Jt,{density:"compact",children:n.map(x=>o.jsx(vte,{invite:x,now:t,onRevoke:()=>p(x.id)},x.id))}),a===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't update invites",description:us(a)})]})}function vte({invite:e,now:t,onRevoke:n}){return e.usedAt!==void 0?o.jsx(Je,{label:e.usedBy===void 0?"Used":`Used by ${e.usedBy}`,description:`Signed up ${g1(e.usedAt,t)}`}):e.expiresAt<=t?o.jsx(Je,{label:"Expired",description:`Created ${g1(e.createdAt,t)}`}):o.jsx(Je,{label:"Unused",description:`Created ${g1(e.createdAt,t)} · expires in ${Zd(t,e.expiresAt)}`,endContent:o.jsx(Q,{label:"Revoke",variant:"secondary",size:"sm",onClick:n})})}const kte={registered:"registered",revoking:"waiting for the host to revoke",revoked:"revoked"};function bte({account:e,hosts:t}){const n=Bo(6e4),[s,r]=h.useState(),[i,a]=h.useState(),[l,c]=h.useState(!1),[u,d]=h.useState(),f=()=>e.listDevices().then(p=>{p.ok?(r(p.value),a(void 0)):p.error.status===404?c(!0):a(p.error)});return h.useEffect(()=>{f()},[e]),l?null:o.jsxs(re,{gap:2,children:[o.jsxs(ke,{gap:2,vAlign:"center",hAlign:"between",children:[o.jsx(K,{weight:"semibold",children:"Devices"}),o.jsx(Q,{label:"Refresh",variant:"secondary",size:"sm",onClick:()=>void f()})]}),i===void 0?null:o.jsx(Oe,{status:"warning",title:"Couldn't load devices",description:us(i)}),s===void 0||s.length===0?null:o.jsx(Jt,{density:"compact",children:s.map(p=>o.jsx(wte,{device:p,now:n,isBusy:u!==void 0,onRemove:()=>d(p)},p.id))}),u===void 0?null:o.jsx(Ste,{account:e,device:u,hosts:t,onClose:p=>{d(void 0),p&&f()}})]})}function wte({device:e,now:t,isBusy:n,onRemove:s}){const r=`Last sign-in ${g1(e.lastSeenAt,t)}`,i=e.current?o.jsx(Ln,{label:"This device",size:"sm"}):e.kickedAt!==void 0?o.jsx(Ln,{label:"Removed",color:"gray",size:"sm"}):o.jsx(Q,{label:"Remove",variant:"secondary",size:"sm",isDisabled:n,onClick:s});return o.jsx(Je,{label:e.name??"Unknown device",description:o.jsxs(re,{gap:0,children:[o.jsx(K,{type:"inherit",children:e.kickedAt===void 0?r:`${r} · removed ${g1(e.kickedAt,t)}`}),e.hosts.length===0?null:o.jsx(K,{type:"inherit",children:e.hosts.map(a=>`${a.name}: ${kte[a.state]}`).join(" · ")})]}),endContent:i})}const jte=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function Ste({account:e,device:t,hosts:n,onClose:s}){const[r,i]=h.useState(""),[a,l]=h.useState(!1),[c,u]=h.useState(),d=t.name??"this device",f=n.filter(x=>x.host.deviceReports===!1).map(x=>x.host.name),p=()=>{r===""||a||(l(!0),u(void 0),e.kickDevice({id:t.id,password:r}).then(x=>{l(!1),x.ok||x.error.code==="not_found"?s(!0):u(x.error)}))};return o.jsxs(re,{gap:2,children:[o.jsxs(K,{weight:"semibold",children:["Remove ",d]}),o.jsxs(K,{type:"supporting",children:["This signs ",d," out of your account and asks each host it joined through your account to revoke it. Hosts that are offline revoke it when they reconnect.",f.length===0?null:f.length===1?` The host ${f[0]} can't be asked. If ${d} joined it, revoke it in that host's Devices.`:` The hosts ${jte(f)} can't be asked. If ${d} joined them, revoke it in each one's Devices.`]}),o.jsx(st,{label:"Password",type:"password",value:r,onChange:i,onEnter:p,width:"100%"}),c===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't remove the device",description:us(c)}),o.jsxs(ke,{gap:2,children:[o.jsx(Q,{label:"Remove device",variant:"destructive",isLoading:a,isDisabled:r==="",onClick:p}),o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:()=>s(!1)})]})]})}function Cte({account:e}){const[t,n]=h.useState(!1),[s,r]=h.useState(""),[i,a]=h.useState(""),[l,c]=h.useState(!1),[u,d]=h.useState(),[f,p]=h.useState(!1),x=s!==""&&i!=="",g=()=>{n(!1),r(""),a(""),d(void 0)},v=()=>{!x||l||(c(!0),d(void 0),e.changePassword({currentPassword:s,newPassword:i}).then(y=>{if(c(!1),!y.ok){d(y.error);return}g(),p(!0)}))};return t?o.jsxs(re,{gap:2,children:[o.jsx(K,{weight:"semibold",children:"Change password"}),o.jsx(st,{label:"Current password",type:"password",value:s,onChange:r,onEnter:v,width:"100%"}),o.jsx(st,{label:"New password",description:"At least 12 characters. Your other devices will be signed out.",type:"password",value:i,onChange:a,onEnter:v,width:"100%"}),u===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't change the password",description:us(u)}),o.jsxs(ke,{gap:2,children:[o.jsx(Q,{label:"Change password",variant:"primary",isLoading:l,isDisabled:!x,onClick:v}),o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:g})]})]}):o.jsxs(re,{gap:1,children:[o.jsx(ke,{gap:2,children:o.jsx(Q,{label:"Change password",variant:"secondary",onClick:()=>{p(!1),n(!0)}})}),f?o.jsx(K,{type:"supporting",children:"Password changed. Your other devices were signed out."}):null]})}function Ete(e,t){if(!e.ok)return e.error.code==="hosts_not_forgotten"?"Some hosts couldn't be removed from this device, so it may still connect to them. Forget them in the host list, or revoke this device on each host.":t?"This device forgot its account hosts, but the server didn't confirm asking them to revoke it. Remove it from another device, or revoke it on each host.":"Signed out on this device, but the server didn't confirm. The session ends on its own within 30 days."}function $te({account:e,onNotice:t}){const[n,s]=h.useState(!1),[r,i]=h.useState(!1),[a,l]=h.useState(!1),c=u=>t(u===void 0?void 0:{status:"warning",title:"Sign-out not confirmed",description:u});return h.useEffect(()=>{if(!a)return;const u=setTimeout(()=>l(!1),5e3);return()=>clearTimeout(u)},[a]),n?o.jsxs(re,{gap:2,children:[o.jsx(K,{weight:"semibold",children:"Sign out"}),o.jsx(Sh,{label:"This is a shared computer",description:"Also remove this device from the hosts it joined through your account, and forget them here. Hosts paired with a QR code stay.",value:r,onChange:i}),o.jsxs(ke,{gap:2,children:[o.jsx(Q,{label:"Sign out",variant:r?"destructive":"primary",onClick:()=>{c(void 0),e.logout({revoke:r}).then(u=>c(Ete(u,r)))}}),o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:()=>{s(!1),i(!1)}})]})]}):o.jsxs(re,{gap:1,children:[o.jsxs(ke,{gap:2,children:[o.jsx(Q,{label:"Sign out",variant:"secondary",onClick:()=>{l(!1),s(!0)}}),o.jsx(Q,{label:a?"Sign out everywhere?":"Sign out everywhere",variant:a?"destructive":"secondary",onClick:()=>{if(!a){l(!0);return}c(void 0),e.revokeAll().then(u=>{u.ok||c("Other devices may still be signed in. Sign in and try Sign out everywhere again.")})}})]}),o.jsx(K,{type:"supporting",children:"Signing out keeps this device paired with its hosts, unless you say it's a shared computer."})]})}function Ate({account:e,server:t,onNotice:n}){const[s,r]=h.useState(!1),[i,a]=h.useState(""),[l,c]=h.useState(!1),[u,d]=h.useState(),f=()=>{r(!1),a(""),d(void 0)},p=()=>{i===""||l||(c(!0),d(void 0),e.deleteAccount({password:i}).then(x=>{if(x.ok){if(e.state.status!=="signed-out")return;n({status:"success",title:"Account deleted",description:"This device is still registered on your hosts. To remove it, revoke it in each host's Devices."});return}c(!1),d(x.error)}))};return s?o.jsxs(re,{gap:2,children:[o.jsx(K,{weight:"semibold",children:"Delete account"}),o.jsxs(K,{type:"supporting",children:["This deletes your account on ",t," and signs you out everywhere. Hosts joined to it are disconnected from the server; run pinomad join on each to connect it again. This device and your others stay registered on their hosts. To remove them, revoke them in each host's Devices."]}),o.jsx(st,{label:"Password",type:"password",value:i,onChange:a,onEnter:p,width:"100%"}),u===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't delete the account",description:us(u)}),o.jsxs(ke,{gap:2,children:[o.jsx(Q,{label:"Delete account",variant:"destructive",isLoading:l,isDisabled:i==="",onClick:p}),o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:f})]})]}):o.jsx(ke,{gap:2,children:o.jsx(Q,{label:"Delete account",variant:"secondary",onClick:()=>r(!0)})})}function ym({onClose:e}){return o.jsx(Us,{isOpen:!0,onOpenChange:t=>t?void 0:e(),width:480,children:o.jsx(Cs,{header:o.jsx(Hr,{title:"Account",onOpenChange:()=>e()}),content:o.jsx(Es,{children:o.jsx("div",{style:{padding:"var(--spacing-2)"},children:o.jsx(ib,{})})})})})}const mz={p2p:"P2P",relay:"Relay",direct:"Direct",loopback:"Local"},Ek={loopback:"Local",lan:"LAN",tailnet:"Tailnet",public:"Internet",unknown:"Unknown"},Mte={signal:"Signal",ice:"ICE",noise:"Noise",warm:"Warm-up",commit:"Switch",liveness:"Liveness"};function Tte(e){if(e!==void 0){if(e.remote.scope!=="unknown")return e.remote.scope;if(e.local.scope!=="unknown")return e.local.scope}}function yz(e){const t=Tte(e);return t===void 0?void 0:Ek[t]}function zte(e){if(e.path!=="p2p")return mz[e.path];const t=yz(e.selectedPair);return t===void 0?"P2P":`P2P · ${t}`}function Nte(e){const t=Math.floor(Math.max(0,e)/1e3);if(t<60)return`${t}s ago`;const n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function _te(e){const t=Mte[e.stage],n=e.reason===void 0?t:`${t} — ${e.reason}`,s=yz(e.pair);return[n,Nte(e.agoMs),...s===void 0?[]:[`on ${s}`]].join(" · ")}function Rte(e){const t=[e.type,e.address].filter(n=>n!==void 0&&n.trim()!=="").join(" · ");return t===""?Ek[e.scope]:`${t} (${Ek[e.scope]})`}const Ite={auto:"Start on the relay, then switch to a direct peer-to-peer link once it is stable.",directOnly:"Never send conversation data through the PiNomad server. The relay is used only to set up the link.",relayOnly:"Always go through the relay; never try peer-to-peer."};function Lte(e){const t=Math.max(1,Math.ceil(e/1e3));return t>=60?`${Math.ceil(t/60)}m`:`${t}s`}function Ote(e,t){const[n,s]=h.useState();return h.useEffect(()=>{if(!t||e===void 0){s(void 0);return}const r=()=>s(e.rtcDiagnostics());r();const i=setInterval(r,1e3);return()=>clearInterval(i)},[t,e]),n}function Dte({diagnostics:e,mode:t,hostMinor:n,rtcAvailable:s,connectedSince:r}){return s?n!==void 0&&!Yt(n,"rtc")?"Not available on this host":t==="relayOnly"?"Off (Relay only)":e===void 0?"Preparing…":e.path==="p2p"||e.phase==="active"?"Active":e.phase==="cooldown"?`Cooling down · retry in ${Lte(e.cooldownRemainingMs)}`:e.phase!=="idle"?"Preparing…":e.lastFailure!==void 0?"Idle":Date.now()-r>2500?"Not available on this host":"Preparing…":"Not available in this browser"}function U9({label:e,end:t}){return o.jsxs(ke,{gap:2,style:{alignItems:"baseline"},children:[o.jsx(K,{type:"supporting",className:"w-20 shrink-0",children:e}),o.jsx(K,{type:"code",size:"sm",color:"secondary",hasTabularNumbers:!0,style:{wordBreak:"break-all",userSelect:"all"},children:Rte(t)})]})}function vz(){const{hosts:e,focus:t,focusHost:n}=As(),s=sz(),r=Bh(e),i=a=>s.get(a.hostKey);return{hosts:e,focusHost:n,label:a=>r.get(a.hostKey)??a.url,isCurrent:a=>(t==null?void 0:t.hostKey)===a.hostKey,isConnected:a=>ko(i(a))==="connected",info:i,infoOf:a=>a===void 0?void 0:s.get(a)}}function kz({connected:e}){return o.jsx("span",{"aria-hidden":"true",className:"inline-flex",children:e?o.jsx(Fi,{variant:"success",label:"Connected",isPulsing:!0}):o.jsx(Fi,{variant:"neutral",label:"Not connected"})})}function Bte({onLocate:e}){const t=vz();return o.jsx(Rc,{hasChevron:!1,placement:"above",alignment:"end",menuWidth:"max-content",button:{icon:o.jsx(W1,{"aria-hidden":"true"}),isIconOnly:!0,label:"Hosts",tooltip:"Hosts",size:"sm",variant:"ghost"},children:t.hosts.map(n=>o.jsx(k1,{icon:o.jsx(kz,{connected:t.isConnected(n)}),label:o.jsxs(o.Fragment,{children:[t.label(n),o.jsx("span",{"aria-hidden":"true",className:"ms-2 text-muted",children:Ck(t.info(n))}),o.jsx(Gi,{children:`(${Ck(t.info(n)).toLowerCase()})`})]}),...e===void 0?{}:{onClick:()=>e(n.hostKey)}},n.hostKey))})}function bz({rtcAvailable:e=tz()}){var T;const t=vz(),{setConnection:n,forget:s,focus:r}=As(),[i,a]=h.useState(),l=Xd(),[c,u]=h.useState(),[d,f]=h.useState(),p=c===void 0?void 0:t.info(c);ko(p);const x=(c==null?void 0:c.hostKey)??(r==null?void 0:r.hostKey),g=t.infoOf(x),v=(g==null?void 0:g.phase)==="ready"?g.remote:void 0,y=Ote(v,ko(g)==="connected"),m=h.useRef(Date.now());h.useEffect(()=>{m.current=Date.now()},[v,x]);const k=c===void 0?void 0:t.hosts.find(z=>z.hostKey===c.hostKey)??c,b=(p==null?void 0:p.phase)==="ready"?(T=p.view.host)==null?void 0:T.protocol.minor:void 0,j=z=>{f(void 0),a(void 0),u($=>($==null?void 0:$.hostKey)===z.hostKey?void 0:z)},A=(z,$)=>{f(void 0),n(z.hostKey,{connectionMode:$}).then(()=>{const E=t.info(z);if(E!==void 0){if(E.phase!=="ready"){E.retry();return}E.view.connection==="closed"||E.view.connection==="outdated"?E.retry():E.remote.setConnectionMode($)}},E=>{const N=E instanceof Error?E.message:String(E);console.error("Could not store the host connection mode",E),f(N)})},M=z=>{const $=t.info(z);return ko($)!=="connected"?Ck($):x===z.hostKey&&y!==void 0?`Connected · ${mz[y.path]}`:"Connected"};return o.jsxs(re,{gap:5,children:[t.hosts.length===0?o.jsx(K,{type:"supporting",children:"No paired hosts."}):o.jsx(Jt,{density:"compact",children:t.hosts.map(z=>{const $=t.label(z),E=t.isConnected(z);return o.jsx(Je,{startContent:o.jsx(kz,{connected:E}),label:$,description:M(z),endContent:o.jsxs(ke,{gap:2,vAlign:"center",children:[t.isCurrent(z)?o.jsx(Ln,{label:"Current",size:"sm"}):o.jsx(Q,{label:"Switch","aria-label":`Switch to ${$}`,variant:"secondary",size:"sm",onClick:()=>t.focusHost(z.hostKey)}),o.jsx(Q,{label:"Connection…","aria-label":`Connection to ${$}`,variant:"secondary",size:"sm",onClick:()=>j(z)}),o.jsx(Q,{label:"Unpair…","aria-label":`Unpair ${$}…`,variant:"secondary",size:"sm",onClick:()=>{u(void 0),a(z)}})]})},z.hostKey)})}),k===void 0?null:o.jsxs(re,{gap:3,role:"group","aria-label":`Connection to ${t.label(k)}`,children:[o.jsx(K,{weight:"semibold",children:`Connection to ${t.label(k)}`}),o.jsxs(re,{gap:1,children:[o.jsx(ke,{gap:2,vAlign:"center",wrap:"wrap",children:o.jsxs(A5,{className:"shrink-0",value:k.connectionMode??"auto",onChange:z=>A(k,z),label:"Connection mode",size:"sm",children:[o.jsx(zu,{value:"auto",label:"Auto"}),o.jsx(zu,{value:"directOnly",label:"Direct only"}),o.jsx(zu,{value:"relayOnly",label:"Relay only"})]})}),o.jsx(K,{type:"supporting",children:Ite[k.connectionMode??"auto"]})]}),d===void 0?null:o.jsx(K,{type:"supporting",children:`Could not save the connection mode: ${d}`}),t.isConnected(k)?o.jsxs(re,{gap:1,children:[o.jsx(K,{weight:"semibold",children:"Status"}),o.jsxs(Jt,{density:"compact",children:[o.jsx(Je,{label:"Path",description:o.jsxs(re,{gap:1,children:[o.jsx(K,{type:"inherit",children:y===void 0?"—":zte(y)}),(y==null?void 0:y.path)==="p2p"&&y.selectedPair!==void 0?o.jsx(Bg,{defaultIsOpen:!1,trigger:o.jsx(K,{type:"body",size:"sm",color:"secondary",className:"block min-h-11 py-3",children:"Show addresses"}),children:o.jsxs(re,{gap:1,children:[o.jsx(U9,{label:"This device",end:y.selectedPair.local}),o.jsx(U9,{label:"Host",end:y.selectedPair.remote})]})}):null]})}),o.jsx(Je,{label:"Peer-to-peer",description:Dte({diagnostics:y,mode:k.connectionMode??"auto",hostMinor:b,rtcAvailable:e,connectedSince:m.current})}),(y==null?void 0:y.lastFailure)===void 0?null:o.jsx(Je,{label:"Last failure",description:o.jsx(K,{type:"inherit",hasTabularNumbers:!0,children:_te(y.lastFailure)})})]})]}):null,o.jsx(ke,{hAlign:"end",children:o.jsx(Q,{label:"Close",variant:"secondary",size:"sm",onClick:()=>u(void 0)})})]}),i===void 0?null:o.jsxs(re,{gap:2,role:"group","aria-label":`Unpair ${t.label(i)}?`,children:[o.jsx(K,{weight:"semibold",children:`Unpair ${t.label(i)}?`}),o.jsx(K,{type:"supporting",children:Hte(t.label(i),t.info(i))}),o.jsxs(ke,{gap:2,hAlign:"end",children:[o.jsx(Q,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>a(void 0)}),o.jsx(Q,{label:"Unpair",variant:"destructive",size:"sm",onClick:()=>{const z=i,$=t.label(z),E=t.info(z),N=(E==null?void 0:E.phase)==="ready"&&ko(E)==="connected"?E.remote:void 0;a(void 0),u(void 0),rz({host:z,remote:N,forget:s}).then(({hostAnswered:_})=>{N!==void 0&&!_&&l(iz($))},_=>console.error("Could not unpair the host",_))}})]})]}),o.jsxs(re,{gap:2,children:[o.jsx(Jn,{level:3,children:"Pair a host"}),o.jsx(K,{type:"supporting",children:"Paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),o.jsx(zd,{})]})]})}function Hte(e,t){return ko(t)==="connected"?`${e} will stop accepting this device, and this device forgets it. Connecting again needs a new pairing link.`:nb(t)==="rejected"?`${e} no longer accepts this device. This removes it here.`:`${e} isn't connected, so only this device forgets it. ${e} keeps listing this device until you unpair it under Settings → Devices there.`}function $k(){const e=qr(),[t,n]=h.useState(!1);return o.jsxs(re,{gap:3,className:"mt-4 w-full max-w-md",children:[o.jsx(bz,{}),e.state.status==="unavailable"?null:o.jsx("div",{children:o.jsx(Q,{label:"Account…",variant:"secondary",size:"sm",onClick:()=>n(!0)})}),t?o.jsx(ym,{onClose:()=>n(!1)}):null]})}const qte="pinomad.projectSidebar.expanded",Pte="pinomad.conversationSidebar.expanded",Ute=(e,t)=>`${Pte}.${e}.${t}`,wz=e=>`${qte}.${e}`,Fte=e=>{const t=window.localStorage.getItem(wz(e));if(t===null)return{};try{const n=JSON.parse(t);return Object.fromEntries(Object.entries(n).filter(s=>typeof s[0]=="string"&&typeof s[1]=="boolean"))}catch{return{}}},F9=(e,t)=>{window.localStorage.setItem(wz(e),JSON.stringify(t))},sg=e=>e.flatMap(t=>[t,...sg(t.children)]);function Vte({onCollapse:e,safeLeft:t}){return o.jsx("div",{className:"pinomad-drag flex h-6 items-center px-2",style:t===void 0?void 0:{paddingLeft:t},children:o.jsx(Bt,{icon:o.jsx(ng,{className:"size-4"}),label:"Collapse sidebar",size:"sm",variant:"ghost",onClick:e})})}function V9({onOpenSettings:e,onOpenAccount:t,onLocateHost:n,onSelect:s}){const r=Y3();return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("div",{className:"min-w-0 flex-1",children:o.jsx(Gte,{onOpenAccount:()=>{s==null||s(),t()}})}),o.jsx(Bte,{...n===void 0?{}:{onLocate:n}}),o.jsxs("span",{className:"relative inline-flex",children:[o.jsx(Bt,{icon:o.jsx(CQ,{"aria-hidden":"true"}),label:"Settings",tooltip:"Settings",size:"sm",variant:"ghost",onClick:()=>{s==null||s(),e()}}),(r==null?void 0:r.status.state)==="ready"?o.jsx("span",{"aria-label":"Update ready",className:"pointer-events-none absolute right-1 top-1 size-2 rounded-full bg-primary",role:"img"}):null]})]})}function Gte({onOpenAccount:e}){const t=qr(),n=t.state.status,[s,r]=h.useState();if(h.useEffect(()=>{if(n!=="unavailable")return;let i=!0;return tb().then(a=>{i&&r(a)}),()=>{i=!1}},[n]),t.state.status==="signed-in"){const{user:i}=t.state;return o.jsx(Q,{label:i,icon:o.jsx(AS,{name:i,size:"xsm",tooltip:!1}),variant:"ghost",size:"sm",onClick:e})}return n==="signed-out"?o.jsx(Q,{label:"Sign in",icon:o.jsx(AQ,{"aria-hidden":"true"}),variant:"ghost",size:"sm",onClick:e}):o.jsx("span",{className:"block truncate px-2 text-sm text-muted",children:s})}function Wte({title:e,expanded:t,contentId:n,onToggle:s,actions:r,pinnedActions:i=!1}){return o.jsxs("div",{className:"pigui-sidenav-section-header",children:[o.jsxs("button",{type:"button",className:"pigui-sidenav-section-toggle","aria-label":t?`Collapse ${e}`:`Expand ${e}`,"aria-expanded":t,"aria-controls":n,onClick:s,children:[o.jsx("span",{className:"pigui-sidenav-section-toggle__title",children:e}),o.jsx("span",{"aria-hidden":"true",className:"pigui-sidenav-section-toggle__chevron","data-expanded":t?"true":"false",children:o.jsx(Te,{icon:"chevronRight",size:"sm",color:"inherit"})})]}),o.jsx(ke,{className:i?void 0:"pigui-sidenav-hover-actions",gap:.5,vAlign:"center",children:r})]})}function bp(){return o.jsx("span",{className:"pigui-session-glyph","data-testid":"session-glyph"})}const jz={"needs-answer":"Waiting for your answer",failed:"Failed",running:"Running"};function Sz({status:e}){const t=e==="needs-answer"?"warning":e==="failed"?"error":"success",n=jz[e];return o.jsx("span",{className:"pigui-session-glyph","aria-hidden":"true",children:o.jsx(Fi,{variant:t,label:n,tooltip:n,isPulsing:e!=="failed"})})}function G9({expanded:e,closed:t,open:n}){const s=e?n:t;return o.jsxs("span",{"aria-hidden":"true",className:"pigui-project-expansion-indicator","data-expanded":e?"true":"false",children:[o.jsx(s,{className:"pigui-project-expansion-indicator__state"}),o.jsx("span",{className:"pigui-project-expansion-indicator__chevron",children:o.jsx(Te,{icon:"chevronRight",size:"sm",color:"inherit"})})]})}function Kte({node:e,shown:t,disabled:n,onOpen:s,onSelect:r}){const{summary:i}=e;return o.jsx("div",{className:"pigui-background-tree-child",children:o.jsx(Ni,{icon:o.jsx(kk,{model:i.model??{provider:"unknown",modelId:"unknown"},reserve:!0}),label:Dr(i),isSelected:i.id===t,isDisabled:n,endContent:i.status===void 0?void 0:o.jsx(Sz,{status:i.status}),onClick:()=>{s(i.id),r==null||r()}})})}function W9({machineKey:e,node:t,shown:n,disabled:s,remote:r,kind:i="root",onOpen:a,onSelect:l}){const{summary:c}=t,u=i==="fork",d=u?c.status:tX(t),f=u?[]:rX(t),p=n!==void 0&&f.some(T=>T.summary.id===n),x=!u&&R3(t).some(T=>T.summary.id===n),g=u?c.id===n:c.id===n||n!==void 0&&!p&&!x&&sg([t]).some(T=>T.summary.id===n),v=Ute(e,c.id),[y,m]=h.useState(()=>window.localStorage.getItem(v)!=="false"),[k,b]=h.useState(!1),j=h.useRef(null),A=T=>{window.localStorage.setItem(v,String(T)),m(T)};h.useEffect(()=>{var T,z;p&&(m($=>$||(window.localStorage.setItem(v,"true"),!0)),(z=(T=j.current)==null?void 0:T.scrollIntoView)==null||z.call(T,{block:"nearest"}))},[p,v]);const M=o.jsx(Ni,{...f.length===0?{}:{collapsible:{isCollapsed:!y,onCollapsedChange:T=>A(!T)}},icon:d===void 0?o.jsx(bp,{}):o.jsx(Sz,{status:d}),label:c.title??"New conversation",isSelected:g,isDisabled:s,endContent:o.jsx("span",{"aria-hidden":"true",className:"pigui-sidenav-actions-spacer pigui-sidenav-actions-spacer--single",children:f.length===0||y?null:o.jsxs("span",{className:"pigui-sidenav-subagent-count",children:[o.jsx(Yd,{className:"size-3"}),f.length]})}),onClick:()=>{a(c.id),l==null||l()},children:f.length===0?null:o.jsx("div",{className:"pigui-background-tree-children",children:f.map(T=>o.jsx(Kte,{node:T,shown:n,disabled:s,onOpen:a,onSelect:l},T.summary.id))})});return o.jsxs("div",{ref:j,className:"pigui-sidenav-row-with-actions pigui-sidenav-session-row","data-kind":u?"fork":"root",...d===void 0?{}:{"data-status":d},children:[M,d===void 0?null:o.jsx(Gi,{children:jz[d]}),o.jsx(ke,{className:"pigui-sidenav-row-actions pigui-sidenav-hover-actions",gap:.5,vAlign:"center",children:o.jsx(Rc,{hasChevron:!1,button:{icon:o.jsx(Jd,{"aria-hidden":"true"}),isIconOnly:!0,label:"Conversation actions",size:"sm",variant:"ghost",isDisabled:s},items:[{label:"Rename",icon:o.jsx(_T,{"aria-hidden":"true",size:16}),onClick:()=>b(!0)},...u?[]:[{label:"Archive",icon:o.jsx($T,{"aria-hidden":"true",size:16}),onClick:()=>void r.controller.archive(c.id,!0)}]]})}),k?o.jsx(HJ,{summary:c,remote:r,connected:!s,onClose:()=>b(!1)}):null]})}const K9=e=>`pinomad.sidebarMachine.${e}.expanded`,cy=":chats";function Xte({machines:e,focusKey:t,draftingChat:n,shownId:s,locate:r,onNewChat:i,onDraft:a,onOpen:l,onShowMachine:c,onSelect:u}){return o.jsxs(o.Fragment,{children:[o.jsx(Ug,{isHeaderHidden:!0,title:"New chat",children:o.jsx(Ni,{icon:o.jsx(MQ,{className:"size-4"}),label:"New chat",isSelected:n,isDisabled:i===void 0,onClick:()=>{i==null||i(),u==null||u()}})}),e.map(d=>o.jsx(Zte,{machine:d,shownId:d.key===t?s:void 0,locateSeq:(r==null?void 0:r.key)===d.key?r.seq:void 0,onDraft:f=>a(d.key,f),onOpen:f=>l(d.key,f),...c===void 0?{}:{onShow:()=>c(d.key)},onSelect:u},d.key))]})}function Zte({machine:e,shownId:t,locateSeq:n,onDraft:s,onOpen:r,onShow:i,onSelect:a}){const{key:l,label:c,view:u,remote:d,rejected:f=!1}=e,p=(u==null?void 0:u.connection)!=="connected",x=h.useId(),g=h.useRef(null),[v,y]=h.useState(()=>window.localStorage.getItem(K9(l))!=="false"),m=B=>{window.localStorage.setItem(K9(l),String(B)),y(B)},[k,b]=h.useState(!1),[j,A]=h.useState(),[M,T]=h.useState(()=>Fte(l)),z=f||u==null?void 0:u.organized,$=B=>{s(B),a==null||a()},E=h.useMemo(()=>{var B;if(!(t===void 0||z===void 0))return sg(z.chats).some(D=>D.summary.id===t)?cy:(B=z.projects.find(({conversations:D})=>sg(D).some(I=>I.summary.id===t)))==null?void 0:B.project.path},[z,t]);h.useEffect(()=>{E!==void 0&&(v||m(!0),T(B=>{if(B[E]!==!1)return B;const D={...B,[E]:!0};return F9(l,D),D}))},[l,E]),h.useEffect(()=>{var B,D;n!==void 0&&(m(!0),(D=(B=g.current)==null?void 0:B.scrollIntoView)==null||D.call(B,{block:"nearest"}))},[n]);const N=B=>T(D=>{const I={...D,[B]:!(D[B]??!0)};return F9(l,I),I}),_=B=>d===void 0?null:o.jsxs(h.Fragment,{children:[o.jsx(W9,{machineKey:l,node:B,shown:t,disabled:p,remote:d,onOpen:r,onSelect:a}),R3(B).map(D=>o.jsx(W9,{machineKey:l,node:D,shown:t,disabled:p,remote:d,kind:"fork",onOpen:r,onSelect:a},D.summary.id))]},B.summary.id),R=M[cy]??!0;return o.jsxs(Ug,{isHeaderHidden:!0,title:c,children:[o.jsx("div",{ref:g,children:o.jsx(Wte,{title:c,expanded:v,contentId:x,onToggle:()=>m(!v),actions:o.jsxs(o.Fragment,{children:[o.jsx(Bt,{icon:o.jsx(X1,{"aria-hidden":"true"}),label:`New chat on ${c}`,tooltip:"New chat",size:"sm",variant:"ghost",isDisabled:p,onClick:()=>$({kind:"chat"})}),o.jsx(Bt,{icon:o.jsx(hQ,{"aria-hidden":"true"}),label:`Add project on ${c}`,tooltip:"Add project",size:"sm",variant:"ghost",isDisabled:p,onClick:()=>b(!0)})]})})}),o.jsx(re,{id:x,gap:.5,children:v?z===void 0?o.jsx(Ni,{icon:o.jsx(bp,{}),label:f?"Not paired":"No conversations available",isDisabled:i===void 0,onClick:()=>{i==null||i(),a==null||a()}}):z.chats.length===0&&z.projects.length===0?o.jsx(Ni,{icon:o.jsx(bp,{}),isDisabled:!0,label:"No conversations"}):o.jsxs(o.Fragment,{children:[z.chats.length===0?null:o.jsx("div",{className:"pigui-sidenav-row-with-actions",children:o.jsx(Ni,{collapsible:{isCollapsed:!R,onCollapsedChange:()=>N(cy)},icon:o.jsx(G9,{expanded:R,closed:vk,open:vk}),label:"Chats",isDisabled:p,children:z.chats.map(_)})}),z.projects.map(({project:B,conversations:D})=>{const I=M[B.path]??!0;return o.jsxs("div",{className:"pigui-sidenav-row-with-actions",children:[o.jsx(Ni,{collapsible:{isCollapsed:!I,onCollapsedChange:()=>N(B.path)},icon:o.jsx(G9,{expanded:I,closed:K1,open:xQ}),label:B.name,isDisabled:p,endContent:o.jsx("span",{"aria-hidden":"true",className:"pigui-sidenav-actions-spacer"}),children:D.length===0?o.jsx(Ni,{icon:o.jsx(bp,{}),isDisabled:!0,label:"No conversations"}):D.map(_)}),o.jsx(ke,{className:"pigui-sidenav-row-actions",gap:.5,vAlign:"center",children:o.jsxs(ke,{className:"pigui-sidenav-hover-actions",gap:.5,vAlign:"center",children:[o.jsx(Bt,{icon:o.jsx(X1,{"aria-hidden":"true"}),label:`New conversation in ${B.name}`,size:"sm",variant:"ghost",isDisabled:p,onClick:()=>$({kind:"project",path:B.path})}),o.jsx(Rc,{hasChevron:!1,button:{icon:o.jsx(Jd,{"aria-hidden":"true"}),isIconOnly:!0,label:`Project actions for ${B.name}`,size:"sm",variant:"ghost",isDisabled:p},items:[{label:"Remove project",icon:o.jsx(RT,{"aria-hidden":"true",size:16}),onClick:()=>A(B)}]})]})})]},B.path)})]}):null}),k&&d!==void 0?o.jsx(OJ,{remote:d,connected:!p,onAdded:B=>{b(!1),$({kind:"project",path:B.path})},onClose:()=>b(!1)}):null,j===void 0||d===void 0?null:o.jsx(BJ,{project:j,remote:d,connected:!p,onClose:()=>A(void 0)})]})}const X9=32,Z9=1024,Yte=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function Cz(e){return e.length>X9||!Yte.test(e)?`Name must be lowercase letters, digits and hyphens (max ${X9})`:void 0}function Qte(e){const t=Cz(e.name);if(t!==void 0)return t;const n=e.description.trim();if(n==="")return"description is required";if(n.length>Z9)return`description is too long (max ${Z9})`;if(e.model!==void 0){const s=e.model.indexOf("/");if(s<=0||s===e.model.length-1)return"model must be provider/modelId"}if(e.thinkingLevel!==void 0&&!PJ(e.thinkingLevel))return`thinkingLevel must be one of ${wk.join(", ")}`}const Z1={off:"Off",minimal:"Minimal",low:"Low",medium:"Medium",high:"High",xhigh:"X-High",max:"Max"},uy=(e,t)=>e!==void 0&&t!==void 0&&e.provider===t.provider&&e.modelId===t.modelId,Y9=["off","minimal","low","medium","high","xhigh","max"],rg=(e,t)=>{if(e.includes(t))return t;const n=Y9.indexOf(t);return e.filter(s=>Y9.indexOf(s)<=n).at(-1)??"off"},xr=(e,t)=>t===void 0?void 0:e.find(n=>n.provider===t.provider&&n.modelId===t.modelId);function Jte(e,t){var i;const n=xr(e,t.model),s=(n==null?void 0:n.thinkingLevels)??["off"],r=(n==null?void 0:n.name)??((i=t.model)==null?void 0:i.modelId)??"No model";return s.length>1?`${r} · ${Z1[t.level]}`:r}function ene(e,t){const n=t.trim().toLowerCase();return n===""?e:e.filter(s=>s.name.toLowerCase().includes(n)||`${s.provider}/${s.modelId}`.toLowerCase().includes(n))}function tne(e,t,n){var i;const s=n.model!==void 0&&xr(e,n.model)!==void 0?n.model:xr(e,t.model)!==void 0?t.model:e[0]===void 0?void 0:{provider:e[0].provider,modelId:e[0].modelId},r=rg(((i=xr(e,s))==null?void 0:i.thinkingLevels)??["off"],n.level);return{model:s,level:r}}const nne=e=>{const t=e.indexOf("/");return{provider:e.slice(0,t),modelId:e.slice(t+1)}};function sne(e,t,n,s,r){var v;const i=t==null?void 0:t.roles.find(y=>y.name===e),a=i===void 0||i.model===void 0?void 0:nne(i.model),l=r.model??a??s.model,c=r.model!==void 0?"override":a!==void 0?"agent":s.model!==void 0?"default":void 0,u=r.level!==void 0?"override":(i==null?void 0:i.thinkingLevel)!==void 0?"agent":"default",d=r.level??(i==null?void 0:i.thinkingLevel)??s.thinkingLevel??"off",f=xr(n,l),p=f===void 0?d:rg(f.thinkingLevels,d),x=(v=t==null?void 0:t.problems.find(y=>y.file===`${e}.md`))==null?void 0:v.reason,g=i===void 0?{kind:"agent-missing",agent:e,...x===void 0?{}:{reason:x}}:l===void 0?{kind:"model-missing",agent:e}:f===void 0?{kind:"model-unavailable",agent:e,model:l,source:c}:void 0;return{...l===void 0?{}:{model:l},level:p,...c===void 0?{}:{modelFrom:c},levelFrom:u,send:{agent:e,...r.model===void 0?{}:{model:r.model},...r.level===void 0?{}:{thinkingLevel:r.level}},...g===void 0?{}:{problem:g}}}function ob({models:e,selected:t,isDisabled:n=!1,agent:s,sourceHint:r,problem:i,onModelChange:a,onLevelChange:l}){const[c,u]=h.useState(""),d=h.useRef(null),f=e.find(y=>uy(y,t.model)),p=(f==null?void 0:f.thinkingLevels)??["off"],x=ene(e,c),g=s===void 0?void 0:s.kind==="pick"?s.value:s.name,v=(s==null?void 0:s.kind)==="pick"&&s.value!==void 0&&!s.roles.some(y=>y.name===s.value)?s.value:void 0;return o.jsx(QS,{alignment:"start",label:"Model and Thinking",placement:"above",width:236,hasAutoFocus:!1,onOpenChange:y=>{y&&requestAnimationFrame(()=>{var m;return(m=d.current)==null?void 0:m.focus()})},content:o.jsxs("div",{className:"flex w-full flex-col gap-1 p-1","data-testid":"model-thinking-popover",onClick:y=>y.stopPropagation(),onMouseDown:y=>y.stopPropagation(),onPointerDown:y=>y.stopPropagation(),children:[s===void 0?null:o.jsxs("div",{"aria-label":"Agent",role:"group",children:[o.jsx("p",{className:"px-2 pt-1 text-xs text-muted",children:s.kind==="pick"?"Agent · sets the system prompt":"Agent · fixed at creation"}),s.kind==="pick"?o.jsxs(Jt,{className:"max-h-48 overflow-y-auto",density:"compact",children:[v===void 0?null:o.jsx(Je,{description:"No longer available",endContent:o.jsx(oa,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}),isDisabled:!0,isSelected:!0,label:v}),o.jsx(Je,{description:"Default system prompt",endContent:s.value===void 0?o.jsx(oa,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,isSelected:s.value===void 0,label:"No agent",onClick:()=>s.onChange(void 0)}),s.roles.map(y=>o.jsx(Je,{description:y.description,endContent:s.value===y.name?o.jsx(oa,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,isSelected:s.value===y.name,label:y.name,onClick:()=>s.onChange(y.name)},y.name))]}):o.jsx(Jt,{density:"compact",children:o.jsx(Je,{...s.description===void 0?{}:{description:s.description},endContent:o.jsx(oa,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}),isSelected:!0,label:s.name})})]}),o.jsx(st,{isLabelHidden:!0,label:"Search models",placeholder:"Search models",ref:d,size:"sm",value:c,width:"100%",onChange:y=>u(y)}),o.jsx(Jt,{"aria-label":"Model",className:"max-h-72 overflow-y-auto",density:"compact",children:x.map(y=>o.jsx(Je,{description:y.provider,startContent:o.jsx(kk,{model:y,reserve:!0}),endContent:uy(y,t.model)?o.jsx(oa,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,isSelected:uy(y,t.model),label:y.name,onClick:()=>a({provider:y.provider,modelId:y.modelId})},`${y.provider}/${y.modelId}`))}),p.length>1?o.jsxs("div",{"aria-label":"Thinking",role:"group",children:[o.jsx("p",{className:"px-2 pt-1 text-xs text-muted",children:"Thinking"}),o.jsx(Jt,{density:"compact",children:p.map(y=>o.jsx(Je,{endContent:y===t.level?o.jsx(oa,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,label:Z1[y],onClick:()=>l(y)},y))})]}):null]}),children:o.jsx(Q,{className:"min-w-0 max-w-[19rem] flex-nowrap gap-1.5 px-2 text-muted","data-testid":"model-thinking-trigger",isDisabled:n||e.length===0,label:"Model and Thinking",size:"sm",variant:"ghost",...i===void 0?{}:{tooltip:i.title},children:o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[i===void 0&&t.model!==void 0?o.jsx(kk,{model:t.model,size:14}):null,i===void 0?o.jsxs("span",{className:"truncate",children:[g===void 0?"":`@${g} · `,Jte(e,t)]}):o.jsx("span",{className:"truncate text-danger",children:i.label}),r===void 0||i!==void 0?null:o.jsx("span",{className:"shrink-0 truncate text-xs text-muted",children:r}),o.jsx(Te,{icon:"chevronDown",size:"sm",color:"inherit"})]})})})}const br="",Q9=e=>`${e.provider}/${e.modelId}`,J9=e=>{const t=e.indexOf("/");if(!(t<=0||t===e.length-1))return{provider:e.slice(0,t),modelId:e.slice(t+1)}};function rne({view:e,remote:t,connected:n,role:s,onClose:r}){const i=s!==void 0,[a,l]=h.useState((s==null?void 0:s.name)??""),[c,u]=h.useState((s==null?void 0:s.description)??""),[d,f]=h.useState((s==null?void 0:s.model)??br),[p,x]=h.useState((s==null?void 0:s.thinkingLevel)??br),[g,v]=h.useState((s==null?void 0:s.prompt)??""),[y,m]=h.useState(!1),[k,b]=h.useState(void 0),j=d===br?void 0:xr(e.models,J9(d)),A=[{value:br,label:"Don't pin — use the caller's model"},...e.models.map(E=>({value:Q9(E),label:`${E.name} (${Q9(E)})`})),...d!==br&&j===void 0?[{value:d,label:`${d} (not available)`}]:[]],M=j===void 0?wk:j.thinkingLevels,T=[{value:br,label:"Don't pin"},...M.map(E=>({value:E,label:Z1[E]})),...p!==br&&!M.includes(p)?[{value:p,label:`${Z1[p]} (not supported by this model)`}]:[]],z=E=>{f(E);const N=E===br?void 0:xr(e.models,J9(E)),_=N===void 0?wk:N.thinkingLevels;p!==br&&!_.includes(p)&&x(br)},$=()=>{const E={name:a.trim(),description:c.trim(),...d===br?{}:{model:d},...p===br?{}:{thinkingLevel:p},prompt:g.trim()},N=Qte(E);if(N!==void 0){b(N);return}m(!0),b(void 0),(i?t.controller.updateAgent(E):t.controller.createAgent(E)).then(()=>r(),_=>{m(!1),b(_ instanceof Error?_.message:String(_))})};return o.jsx(Us,{isOpen:!0,onOpenChange:E=>E?void 0:r(),purpose:"form",width:480,"aria-label":i?`Edit ${s.name}`:"New agent",children:o.jsx(Cs,{header:o.jsx(Hr,{title:i?`Edit ${s.name}`:"New agent",onOpenChange:()=>r()}),content:o.jsx(Es,{children:o.jsxs(re,{gap:4,children:[o.jsx(re,{gap:1,children:o.jsx(st,{label:"Name",value:a,onChange:l,isDisabled:y||i,hasAutoFocus:!i,description:i?"The name is the file name and can't be changed.":void 0})}),o.jsx(st,{label:"Description",value:c,onChange:u,isDisabled:y}),o.jsx(xc,{label:"Model",value:d,options:A,onChange:z,isDisabled:y}),o.jsx(xc,{label:"Thinking level",value:p,options:T,onChange:E=>x(E),isDisabled:y}),o.jsx(QC,{label:"Prompt",value:g,onChange:v,isDisabled:y,rows:4}),k===void 0?null:o.jsx(K,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:k})]})}),footer:o.jsx(el,{children:o.jsxs(ke,{gap:2,hAlign:"end",children:[o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:r}),o.jsx(Q,{label:"Save",variant:"primary",isDisabled:!n||y,onClick:$})]})})})})}var Nl=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(Nl||{});const ine=[0,1],Ez=[1,0],$z=[2,3],Az=[3,2],one={L:ine,M:Ez,Q:$z,H:Az},ane=/^\d*$/,lne=/^[A-Z0-9 $%*+./:-]*$/,dy="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",ab=1,lb=40,ew=3,cne=3,B0=40,une=10,Mz=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Tz=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class dne{constructor(t,n,s,r){be(this,"size");be(this,"mask");be(this,"modules",[]);be(this,"types",[]);if(this.version=t,this.ecc=n,t<ab||t>lb)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=t*4+17;const i=Array.from({length:this.size}).fill(!1);for(let l=0;l<this.size;l++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();const a=this.addEccAndInterleave(s);if(this.drawCodewords(a),r===-1){let l=1e9;for(let c=0;c<8;c++){this.applyMask(c),this.drawFormatBits(c);const u=this.getPenaltyScore();u<l&&(r=c,l=u),this.applyMask(c)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}getModule(t,n){return t>=0&&t<this.size&&n>=0&&n<this.size&&this.modules[n][t]}drawFunctionPatterns(){for(let s=0;s<this.size;s++)this.setFunctionModule(6,s,s%2===0,Nl.Timing),this.setFunctionModule(s,6,s%2===0,Nl.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const t=this.getAlignmentPatternPositions(),n=t.length;for(let s=0;s<n;s++)for(let r=0;r<n;r++)s===0&&r===0||s===0&&r===n-1||s===n-1&&r===0||this.drawAlignmentPattern(t[s],t[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){const n=this.ecc[1]<<3|t;let s=n;for(let i=0;i<10;i++)s=s<<1^(s>>>9)*1335;const r=(n<<10|s)^21522;for(let i=0;i<=5;i++)this.setFunctionModule(8,i,to(r,i));this.setFunctionModule(8,7,to(r,6)),this.setFunctionModule(8,8,to(r,7)),this.setFunctionModule(7,8,to(r,8));for(let i=9;i<15;i++)this.setFunctionModule(14-i,8,to(r,i));for(let i=0;i<8;i++)this.setFunctionModule(this.size-1-i,8,to(r,i));for(let i=8;i<15;i++)this.setFunctionModule(8,this.size-15+i,to(r,i));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let s=0;s<12;s++)t=t<<1^(t>>>11)*7973;const n=this.version<<12|t;for(let s=0;s<18;s++){const r=to(n,s),i=this.size-11+s%3,a=Math.floor(s/3);this.setFunctionModule(i,a,r),this.setFunctionModule(a,i,r)}}drawFinderPattern(t,n){for(let s=-4;s<=4;s++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(s)),a=t+r,l=n+s;a>=0&&a<this.size&&l>=0&&l<this.size&&this.setFunctionModule(a,l,i!==2&&i!==4,Nl.Position)}}drawAlignmentPattern(t,n){for(let s=-2;s<=2;s++)for(let r=-2;r<=2;r++)this.setFunctionModule(t+r,n+s,Math.max(Math.abs(r),Math.abs(s))!==1,Nl.Alignment)}setFunctionModule(t,n,s,r=Nl.Function){this.modules[n][t]=s,this.types[n][t]=r}addEccAndInterleave(t){const n=this.version,s=this.ecc;if(t.length!==wp(n,s))throw new RangeError("Invalid argument");const r=Tz[s[0]][n],i=Mz[s[0]][n],a=Math.floor(Ak(n)/8),l=r-a%r,c=Math.floor(a/r),u=[],d=kne(i);for(let p=0,x=0;p<r;p++){const g=t.slice(x,x+c-i+(p<l?0:1));x+=g.length;const v=bne(g,d);p<l&&g.push(0),u.push(g.concat(v))}const f=[];for(let p=0;p<u[0].length;p++)u.forEach((x,g)=>{(p!==c-i||g>=l)&&f.push(x[p])});return f}drawCodewords(t){if(t.length!==Math.floor(Ak(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let s=this.size-1;s>=1;s-=2){s===6&&(s=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const a=s-i,c=(s+1&2)===0?this.size-1-r:r;!this.types[c][a]&&n<t.length*8&&(this.modules[c][a]=to(t[n>>>3],7-(n&7)),n++)}}}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let s=0;s<this.size;s++){let r;switch(t){case 0:r=(s+n)%2===0;break;case 1:r=n%2===0;break;case 2:r=s%3===0;break;case 3:r=(s+n)%3===0;break;case 4:r=(Math.floor(s/3)+Math.floor(n/2))%2===0;break;case 5:r=s*n%2+s*n%3===0;break;case 6:r=(s*n%2+s*n%3)%2===0;break;case 7:r=((s+n)%2+s*n%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[n][s]&&r&&(this.modules[n][s]=!this.modules[n][s])}}getPenaltyScore(){let t=0;for(let i=0;i<this.size;i++){let a=!1,l=0;const c=[0,0,0,0,0,0,0];for(let u=0;u<this.size;u++)this.modules[i][u]===a?(l++,l===5?t+=ew:l>5&&t++):(this.finderPenaltyAddHistory(l,c),a||(t+=this.finderPenaltyCountPatterns(c)*B0),a=this.modules[i][u],l=1);t+=this.finderPenaltyTerminateAndCount(a,l,c)*B0}for(let i=0;i<this.size;i++){let a=!1,l=0;const c=[0,0,0,0,0,0,0];for(let u=0;u<this.size;u++)this.modules[u][i]===a?(l++,l===5?t+=ew:l>5&&t++):(this.finderPenaltyAddHistory(l,c),a||(t+=this.finderPenaltyCountPatterns(c)*B0),a=this.modules[u][i],l=1);t+=this.finderPenaltyTerminateAndCount(a,l,c)*B0}for(let i=0;i<this.size-1;i++)for(let a=0;a<this.size-1;a++){const l=this.modules[i][a];l===this.modules[i][a+1]&&l===this.modules[i+1][a]&&l===this.modules[i+1][a+1]&&(t+=cne)}let n=0;for(const i of this.modules)n=i.reduce((a,l)=>a+(l?1:0),n);const s=this.size*this.size,r=Math.ceil(Math.abs(n*20-s*10)/s)-1;return t+=r*une,t}getAlignmentPatternPositions(){if(this.version===1)return[];{const t=Math.floor(this.version/7)+2,n=this.version===32?26:Math.ceil((this.version*4+4)/(t*2-2))*2,s=[6];for(let r=this.size-7;s.length<t;r-=n)s.splice(1,0,r);return s}}finderPenaltyCountPatterns(t){const n=t[1],s=n>0&&t[2]===n&&t[3]===n*3&&t[4]===n&&t[5]===n;return(s&&t[0]>=n*4&&t[6]>=n?1:0)+(s&&t[6]>=n*4&&t[0]>=n?1:0)}finderPenaltyTerminateAndCount(t,n,s){return t&&(this.finderPenaltyAddHistory(n,s),n=0),n+=this.size,this.finderPenaltyAddHistory(n,s),this.finderPenaltyCountPatterns(s)}finderPenaltyAddHistory(t,n){n[0]===0&&(t+=this.size),n.pop(),n.unshift(t)}}function xo(e,t,n){if(t<0||t>31||e>>>t)throw new RangeError("Value out of range");for(let s=t-1;s>=0;s--)n.push(e>>>s&1)}function to(e,t){return(e>>>t&1)!==0}class cb{constructor(t,n,s){if(this.mode=t,this.numChars=n,this.bitData=s,n<0)throw new RangeError("Invalid argument");this.bitData=s.slice()}getData(){return this.bitData.slice()}}const fne=[1,10,12,14],hne=[2,9,11,13],pne=[4,8,16,16];function zz(e,t){return e[Math.floor((t+7)/17)+1]}function Nz(e){const t=[];for(const n of e)xo(n,8,t);return new cb(pne,e.length,t)}function xne(e){if(!_z(e))throw new RangeError("String contains non-numeric characters");const t=[];for(let n=0;n<e.length;){const s=Math.min(e.length-n,3);xo(Number.parseInt(e.substring(n,n+s),10),s*3+1,t),n+=s}return new cb(fne,e.length,t)}function gne(e){if(!Rz(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const t=[];let n;for(n=0;n+2<=e.length;n+=2){let s=dy.indexOf(e.charAt(n))*45;s+=dy.indexOf(e.charAt(n+1)),xo(s,11,t)}return n<e.length&&xo(dy.indexOf(e.charAt(n)),6,t),new cb(hne,e.length,t)}function mne(e){return e===""?[]:_z(e)?[xne(e)]:Rz(e)?[gne(e)]:[Nz(vne(e))]}function _z(e){return ane.test(e)}function Rz(e){return lne.test(e)}function yne(e,t){let n=0;for(const s of e){const r=zz(s.mode,t);if(s.numChars>=1<<r)return Number.POSITIVE_INFINITY;n+=4+r+s.bitData.length}return n}function vne(e){e=encodeURI(e);const t=[];for(let n=0;n<e.length;n++)e.charAt(n)!=="%"?t.push(e.charCodeAt(n)):(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2);return t}function Ak(e){if(e<ab||e>lb)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function wp(e,t){return Math.floor(Ak(e)/8)-Mz[t[0]][e]*Tz[t[0]][e]}function kne(e){if(e<1||e>255)throw new RangeError("Degree out of range");const t=[];for(let s=0;s<e-1;s++)t.push(0);t.push(1);let n=1;for(let s=0;s<e;s++){for(let r=0;r<t.length;r++)t[r]=Mk(t[r],n),r+1<t.length&&(t[r]^=t[r+1]);n=Mk(n,2)}return t}function bne(e,t){const n=t.map(s=>0);for(const s of e){const r=s^n.shift();n.push(0),t.forEach((i,a)=>n[a]^=Mk(i,r))}return n}function Mk(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");let n=0;for(let s=7;s>=0;s--)n=n<<1^(n>>>7)*285,n^=(t>>>s&1)*e;return n}function wne(e,t,n=1,s=40,r=-1,i=!0){if(!(ab<=n&&n<=s&&s<=lb)||r<-1||r>7)throw new RangeError("Invalid value");let a,l;for(a=n;;a++){const f=wp(a,t)*8,p=yne(e,a);if(p<=f){l=p;break}if(a>=s)throw new RangeError("Data too long")}for(const f of[Ez,$z,Az])i&&l<=wp(a,f)*8&&(t=f);const c=[];for(const f of e){xo(f.mode[0],4,c),xo(f.numChars,zz(f.mode,a),c);for(const p of f.getData())c.push(p)}const u=wp(a,t)*8;xo(0,Math.min(4,u-c.length),c),xo(0,(8-c.length%8)%8,c);for(let f=236;c.length<u;f^=253)xo(f,8,c);const d=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((f,p)=>d[p>>>3]|=f<<7-(p&7)),new dne(a,t,d,r)}function jne(e,t){var f;const{ecc:n="L",boostEcc:s=!1,minVersion:r=1,maxVersion:i=40,maskPattern:a=-1,border:l=1}=t||{},c=typeof e=="string"?mne(e):Array.isArray(e)?[Nz(e)]:void 0;if(!c)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const u=wne(c,one[n],r,i,a,s),d=Sne({version:u.version,maskPattern:u.mask,size:u.size,data:u.modules,types:u.types},l);return t!=null&&t.invert&&(d.data=d.data.map(p=>p.map(x=>!x))),(f=t==null?void 0:t.onEncoded)==null||f.call(t,d),d}function Sne(e,t=1){if(!t)return e;const{size:n}=e,s=n+t*2;e.size=s,e.data.forEach(i=>{for(let a=0;a<t;a++)i.unshift(!1),i.push(!1)});for(let i=0;i<t;i++)e.data.unshift(Array.from({length:s},a=>!1)),e.data.push(Array.from({length:s},a=>!1));const r=Nl.Border;e.types.forEach(i=>{for(let a=0;a<t;a++)i.unshift(r),i.push(r)});for(let i=0;i<t;i++)e.types.unshift(Array.from({length:s},a=>r)),e.types.push(Array.from({length:s},a=>r));return e}function Cne({view:e,remote:t,self:n,hostKey:s}){const{hosts:r,forget:i}=As(),a=e.connection==="connected",l=n===void 0?void 0:Dh(n.publicKey),[c,u]=h.useState(),d=Xd(),[f,p]=h.useState(),[x,g]=h.useState(),v=()=>{g(void 0),t.controller.createPairing().then(p,y=>{g(y instanceof Error?y.message:String(y))})};return o.jsxs(re,{gap:4,children:[e.devices.length===0?o.jsx(K,{type:"supporting",children:"No paired devices."}):o.jsx(Jt,{density:"compact",children:e.devices.map(y=>o.jsx(Mne,{device:y,isSelf:y.publicKey===l,connected:a,onUnpair:()=>u(y)},y.publicKey))}),c===void 0?null:o.jsx(Tne,{device:c,isSelf:c.publicKey===l,onCancel:()=>u(void 0),onConfirm:()=>{u(void 0);const y=c.publicKey===l?r.find(m=>m.hostKey===s):void 0;if(y===void 0){t.controller.revokeDevice(c.publicKey);return}rz({host:y,remote:t,forget:i}).then(({hostAnswered:m})=>{m||d(iz(Bh(r).get(y.hostKey)??y.url))})}}),o.jsx(Ene,{view:e,remote:t}),x===void 0?null:o.jsx(Oe,{status:"error",title:"Could not create a pairing offer",description:x}),f===void 0?o.jsx(Q,{label:"Pair a device",variant:"secondary",isDisabled:!a,onClick:v}):o.jsx(zne,{url:f.url,expiresAt:f.expiresAt,onRenew:v})]})}function Ene({view:e,remote:t}){var s;const n=(s=e.host)==null?void 0:s.protocol.minor;return e.settings===null||n===void 0||!Yt(n,"acceptAccountDevices")?null:o.jsx(E5,{label:"Accept devices from your account",description:"Devices signed in to the server this host joined can pair without a QR code. Turn off to allow QR codes only.",value:e.settings.acceptAccountDevices,isDisabled:e.connection!=="connected",onChange:r=>void t.controller.updateSettings({acceptAccountDevices:r})})}const $ne={account:"via account",qr:"via QR code",local:"on this machine"},Ane=new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"});function Mne({device:e,isSelf:t,connected:n,onUnpair:s}){const r=e.source===void 0?"":` ${$ne[e.source]}`;return o.jsx(Je,{label:e.name,description:`Paired ${Ane.format(e.pairedAt)}${r}`,endContent:o.jsxs(ke,{gap:2,vAlign:"center",children:[t?o.jsx(Ln,{label:"This device",size:"sm"}):null,o.jsx(Q,{label:"Unpair…","aria-label":`Unpair ${e.name}…`,variant:"secondary",size:"sm",isDisabled:!n,onClick:s})]})})}function Tne({device:e,isSelf:t,onCancel:n,onConfirm:s}){const r=t?"Unpair this device?":`Unpair ${e.name}?`;return o.jsxs(re,{gap:2,role:"group","aria-label":r,children:[o.jsx(K,{weight:"semibold",children:r}),o.jsx(K,{type:"supporting",children:t?"This host will stop accepting this device, and this device forgets the host. Connecting again needs a new pairing link.":"This host will stop accepting it. It can pair again with a new pairing link."}),o.jsxs(ke,{gap:2,hAlign:"end",children:[o.jsx(Q,{label:"Cancel",variant:"secondary",size:"sm",onClick:n}),o.jsx(Q,{label:"Unpair",variant:"destructive",size:"sm",onClick:s})]})]})}function zne({url:e,expiresAt:t,onRenew:n}){const[s,r]=h.useState(Date.now());h.useEffect(()=>{const l=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(l)},[]);const i=Math.max(0,Math.ceil((t-s)/1e3));if(i===0)return o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(K,{type:"supporting",children:"Expired"}),o.jsx(Q,{label:"New code",variant:"secondary",size:"sm",onClick:n})]});const a=P1(e);return o.jsxs(re,{gap:3,hAlign:"center",children:[a?null:o.jsx(Nne,{text:e}),o.jsx(K,{type:"supporting",style:{wordBreak:"break-all",userSelect:"all"},children:e}),a?o.jsx(K,{type:"supporting",children:"This link only works on this machine — paste it into the desktop app. To pair a phone, start the host with --remote-port or --relay."}):null,o.jsxs(K,{type:"supporting",children:["Expires in ",Math.floor(i/60),":",String(i%60).padStart(2,"0")]})]})}const fy=2;function Nne({text:e}){const t=h.useMemo(()=>{try{return jne(e,{border:0})}catch(s){if(s instanceof Error&&s.message==="Data too long")return;throw s}},[e]);if(t===void 0)return o.jsx(K,{type:"supporting",children:"This link is too long for a QR code. Copy it below and paste it into the app instead."});const n=t.size+fy*2;return o.jsxs("svg",{role:"img","aria-label":"Pairing QR code",viewBox:`0 0 ${n} ${n}`,width:200,height:200,style:{display:"block"},children:[o.jsx("rect",{width:n,height:n,fill:"#ffffff"}),o.jsx("path",{shapeRendering:"crispEdges",fill:"#000000",d:t.data.flatMap((s,r)=>s.map((i,a)=>i?`M${a+fy} ${r+fy}h1v1h-1z`:"")).filter(s=>s!=="").join("")})]})}function _ne({pollIntervalMs:e}){const t=az();return t===void 0?null:o.jsx(Rne,{bridge:t,pollIntervalMs:e})}function Rne({bridge:e,pollIntervalMs:t}){const{state:n,refresh:s,pollUntilInstalled:r}=lz(e,t),[i,a]=h.useState(),[l,c]=h.useState(!1),[u,d]=h.useState(),f=h.useRef(void 0);h.useEffect(()=>()=>{var m;return(m=f.current)==null?void 0:m.call(f)},[]);const p=()=>{a({kind:"starting"}),d(void 0),e.start().catch(m=>({ok:!1,message:tw(m)})).then(async m=>{m.ok||d(m.message),await s(),a(void 0)})},x=m=>{var k;a({kind:"stopping",lines:[]}),d(void 0),(k=f.current)==null||k.call(f),f.current=e.onStopLines(b=>a(j=>(j==null?void 0:j.kind)==="stopping"?{...j,lines:b}:j)),m().catch(b=>({outcome:"failed",message:tw(b)})).then(async b=>{var j;(j=f.current)==null||j.call(f),f.current=void 0,(b==null?void 0:b.outcome)==="failed"&&d(b.message),await s(),a(void 0)})},g=()=>{c(!1),x(()=>e.stop())},v=(n==null?void 0:n.kind)==="installed"&&n.stopping&&i===void 0;if(h.useEffect(()=>{v&&x(()=>e.followStop())},[v]),n===void 0)return o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Vt,{size:"sm"}),o.jsx(K,{type:"supporting",children:"Checking this Mac…"})]});const y=u===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't change the host",description:u});switch(n.kind){case"error":return o.jsx(Oe,{status:"error",title:"Couldn't check the host on this Mac",description:n.message,endContent:o.jsx(Q,{label:"Try again",variant:"secondary",onClick:()=>void s()})});case"too-old":return o.jsx(K,{as:"p",type:"supporting",children:"The PiNomad host on this Mac is too old for this switch. Run pinomad upgrade in Terminal, then come back here."});case"not-installed":return o.jsx(Ine,{bridge:e,onConfirmed:r});case"installed":return o.jsxs(re,{gap:3,children:[o.jsx(E5,{label:"Run the host on this Mac",description:n.detail,labelPosition:"start",labelSpacing:"spread",width:"100%",value:!n.stopped,isLoading:i!==void 0,isDisabled:i!==void 0,onChange:m=>m?p():c(!0)}),(i==null?void 0:i.kind)==="stopping"?o.jsxs(re,{gap:2,children:[o.jsx(K,{as:"p",type:"supporting",children:"Stopping…"}),i.lines.length===0?null:o.jsx("div",{role:"log","aria-label":"Stop progress",style:Lne,children:i.lines.map((m,k)=>o.jsx("div",{children:m},k))}),o.jsx(ke,{children:o.jsx(Q,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>void e.cancelStop()})})]}):null,y,o.jsx(T5,{isOpen:l,onOpenChange:c,title:"Turn off the host on this Mac?",description:"Your other devices can't reach this Mac while it's off. Running tasks finish first, so this may take a while.",actionLabel:"Turn off",onAction:g})]})}}function Ine({bridge:e,onConfirmed:t}){const n=qr(),[s,r]=h.useState(!1);return n.state.status!=="signed-in"?o.jsx(K,{as:"p",type:"supporting",children:"The PiNomad host isn't installed on this Mac. Sign in to your account first: the host joins it while it installs."}):o.jsxs(re,{gap:4,children:[o.jsxs(re,{gap:2,children:[o.jsx(K,{as:"p",type:"supporting",children:"The PiNomad host isn't installed on this Mac. Install it in Terminal; it joins your account when it's done."}),o.jsx(oz,{bridge:e,serverOrigin:n.state.serverOrigin,onOpened:()=>r(!0)})]}),s?o.jsxs(re,{gap:2,children:[o.jsx(K,{as:"p",type:"supporting",children:"When Terminal shows a code, enter it here:"}),o.jsx(rb,{onSettled:i=>i==="confirmed"&&t()})]}):null]})}const Lne={fontFamily:"var(--font-family-code)",fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)",whiteSpace:"pre-wrap"},tw=e=>e instanceof Error?e.message:String(e),Wu=e=>e!==null&&typeof e=="object",Iz=new Set(["__proto__","constructor","prototype"]);class Nd extends Error{constructor(n){super(`unsafe path segment: ${String(n)}`);be(this,"segment");this.segment=n,this.name="UnsafePathError"}}function Lz(e){if(!Array.isArray(e)||e.length===0)throw new TypeError("op is not a tuple");switch(e[0]){case"r":if(e.length!==2)throw new TypeError("r arity");return;case"s":if(e.length!==3)throw new TypeError("s arity");tu(e[1],!0);return;case"d":if(e.length!==2)throw new TypeError("d arity");tu(e[1],!0);return;case"a":if(e.length!==3||typeof e[2]!="string")throw new TypeError("a shape");tu(e[1],!0);return;case"t":if(e.length!==3||!Number.isInteger(e[2])||e[2]<0)throw new TypeError("t shape");tu(e[1],!0);return;case"p":{if(e.length!==5)throw new TypeError("p arity");if(tu(e[1]),!Number.isInteger(e[2])||e[2]<0)throw new TypeError("p index");if(!Number.isInteger(e[3])||e[3]<0)throw new TypeError("p remove");if(!Array.isArray(e[4]))throw new TypeError("p items");return}case"m":if(e.length!==3)throw new TypeError("m arity");tu(e[1]),One(e[2]);return;default:throw new TypeError(`unknown op verb: ${String(e[0])}`)}}function tu(e,t=!1){if(!Array.isArray(e))throw new TypeError("path is not an array");if(t&&e.length===0)throw new TypeError("path is empty");Oz(e)}function One(e){if(!Array.isArray(e))throw new TypeError("m permutation is not an array");const t=new Uint8Array(e.length);for(const n of e){if(!Number.isInteger(n)||n<0||n>=e.length||t[n]!==0)throw new TypeError("m permutation is not a bijection");t[n]=1}}function Oz(e){for(const t of e)if(typeof t=="string"){if(Iz.has(t))throw new Nd(t)}else if(!Number.isInteger(t)||t<0)throw new Nd(t)}function Dne(e,t){if(t>e.length)throw new Nd(t)}class _r extends Error{constructor(n){super(`unresolvable path: ${JSON.stringify(n)}`);be(this,"path");this.path=n,this.name="PathError"}}function Bne(e,t){let n=e;for(const s of t){if(Lz(s),s[0]==="r"){n=s[1];continue}const r=s[1];if(Oz(r),s[0]==="p"){const u=r.length===0?n:jp(n,r);if(!Array.isArray(u))throw new _r(r);u.splice(s[2],s[3]);const d=1e4;for(let f=0;f<s[4].length;f+=d)u.splice(s[2]+f,0,...s[4].slice(f,f+d));continue}if(s[0]==="m"){const u=r.length===0?n:jp(n,r);if(!Array.isArray(u)||u.length!==s[2].length)throw new _r(r);const d=u.slice();for(let f=0;f<s[2].length;f++)u[f]=d[s[2][f]];continue}const i=jp(n,r.slice(0,-1)),a=r[r.length-1];if(Array.isArray(i)){if(typeof a!="number")throw new Nd(a);Dne(i,a)}const l=u=>{Object.defineProperty(i,a,{value:u,writable:!0,enumerable:!0,configurable:!0})},c=()=>Object.hasOwn(i,a)?i[a]:void 0;switch(s[0]){case"s":l(s[2]);break;case"d":if(Array.isArray(i)){if(typeof a!="number"||a>=i.length)throw new _r(r);i.splice(a,1)}else delete i[a];break;case"a":{const u=c();if(typeof u!="string")throw new _r(r);l(`${u}${s[2]}`);break}case"t":{const u=c();if(typeof u!="string")throw new _r(r);l(u.slice(s[2]));break}}}return n}function Hne(e,t){return qne(e,[t])}function qne(e,t){let n=e;const s=new WeakSet;for(const r of t)for(const i of r){if(Lz(i),i[0]==="r"){n=i[1];continue}if(i[0]==="p"){const a=Pne(n,i,s);if(a!==void 0){n=a;continue}}n=Dz(n,i[0]==="p"||i[0]==="m"?i[1]:i[1].slice(0,-1),s),n=Bne(n,[i])}return n}function Pne(e,t,n){const[,s,r,i,a]=t;if(i!==0)return;let l=e;for(const f of s){if(!(typeof f=="string"?!Iz.has(f)&&Wu(l)&&!Array.isArray(l):Number.isInteger(f)&&f>=0&&Array.isArray(l))||!Object.hasOwn(l,f))return;l=l[f]}if(!Array.isArray(l)||n.has(l)||r!==l.length)return;const c=l.concat(a);if(n.add(c),s.length===0)return c;const u=s.slice(0,-1),d=Dz(e,u,n);return Object.defineProperty(jp(d,u),s[s.length-1],{value:c,writable:!0,enumerable:!0,configurable:!0}),d}function Dz(e,t,n){const s=a=>{if(Array.isArray(a))return a.slice();if(!Wu(a))throw new _r(t);const l=Object.create(Object.getPrototypeOf(a)===null?null:Object.prototype);for(const c of Object.keys(a))Object.defineProperty(l,c,{value:a[c],writable:!0,enumerable:!0,configurable:!0});return l};if(!Wu(e))throw new _r(t);let r;n.has(e)?r=e:(r=s(e),n.add(r));let i=r;for(const a of t){if(!Object.hasOwn(i,a))throw new _r(t);if(Array.isArray(i)&&typeof a!="number")throw new Nd(a);const l=i[a];if(!Wu(l))throw new _r(t);if(n.has(l)){i=l;continue}const c=s(l);Object.defineProperty(i,a,{value:c,writable:!0,enumerable:!0,configurable:!0}),n.add(c),i=c}return r}function Une(e,t){let n=e;for(const s of t){if(!Wu(n))throw new _r(t);if(Array.isArray(n)&&typeof s!="number")throw new Nd(s);if(!Object.hasOwn(n,s))throw new _r(t);n=n[s]}return n}function jp(e,t){const n=Une(e,t);if(!Wu(n))throw new _r(t);return n}const nw=10*1024*1024,Ri=10,Fne=512*1024,Vne=/^[A-Za-z0-9_-]{22}$/;function Gne(e){return Vne.test(e)}const sw='<attachments v="1">',Wne="The user attached these files. They are read-only originals on this machine: read them with your tools when relevant, and copy one into the working directory before changing it.",rw="</attachments>";function Kne(e,t){if(e.trim()==="")return"Attachment name cannot be empty";if(!Number.isSafeInteger(t)||t<0)return"Attachment size must be a non-negative integer";if(t>nw)return`Attachment is larger than ${nw/(1024*1024)} MB`}const Xne='<file id="',Zne='" name="',Yne='" path="',Qne='" size="',iw='"/>',Jne=/^(?:0|[1-9][0-9]*)$/;function ese(e){return e.replace(/&(amp|lt|gt|quot|apos|#x[0-9A-Fa-f]+|#[0-9]+);/g,(t,n)=>{if(n==="amp")return"&";if(n==="lt")return"<";if(n==="gt")return">";if(n==="quot")return'"';if(n==="apos")return"'";const s=n.startsWith("#x")?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return s>=0&&s<=1114111?String.fromCodePoint(s):t})}function H0(e,t,n){if(!e.startsWith(n,t))return;const s=t+n.length,r=e.indexOf('"',s);if(r!==-1)return{value:e.slice(s,r),next:r}}function tse(e){const t=H0(e,0,Xne);if(t===void 0)return;const n=H0(e,t.next,Zne);if(n===void 0)return;const s=H0(e,n.next,Yne);if(s===void 0)return;const r=H0(e,s.next,Qne);if(r===void 0||!e.startsWith(iw,r.next)||r.next+iw.length!==e.length||!Gne(t.value)||!Jne.test(r.value))return;const i=Number(r.value);if(Number.isSafeInteger(i))return{id:t.value,name:ese(n.value),size:i}}function nse(e){if(!e.startsWith(sw+`
|
|
384
|
-
`)||!e.endsWith(`
|
|
385
|
-
`+rw))return;const t=e.slice(sw.length+1,-(rw.length+1)).split(`
|
|
386
|
-
`);if(t[0]!==Wne||t.length<2)return;const n=[];for(const s of t.slice(1)){const r=tse(s);if(r===void 0)return;n.push(r)}return n}function Bz(e,t){return{label:e,open(n){const s=new URL(e);s.searchParams.set("token",t);const r=new WebSocket(s);return r.onopen=()=>{var i,a;(i=n.opened)==null||i.call(n),(a=n.authenticated)==null||a.call(n)},r.onmessage=i=>n.message(String(i.data)),r.onclose=i=>n.closed(i.code),{send:i=>r.send(i),close:()=>r.close()}}}}function sse(e){return e!==null&&typeof e=="object"&&typeof e.limit=="number"}const rse=e=>`terminals:${e}`,ow=e=>`terminal:${e}`;function ig(e){var n;const t=(n=e.docs)==null?void 0:n["pi.live"];return(t==null?void 0:t.run)!==void 0}const ise={socketOpenMs:5e3,noiseMs:5e3,helloMs:5e3,syncMs:1e4};class ose extends Error{constructor(n){super(`Could not connect to the host: ${n.map(mse).join("; ")}`);be(this,"failures");this.name="ConnectionFailedError",this.failures=n}}class Hz extends Error{constructor(n){super(`${OM} (${n})`);be(this,"reason");this.name="DirectUnavailableError",this.reason=n}}const hy="Remote access is unavailable: the host published no remote path and this device has no local entry.",q0=5e3,aw=15e3,ase=3e3,lse=1e3,cse=300,lw=3e4,cw=25e3,use=1e3,dse=3e4,fse=10*6e4,hse=10*6e4,uw=6e4,pse=6e4,xse=3e4,_s=e=>e instanceof Error?e:new Error(String(e)),gse=e=>Array.from(crypto.getRandomValues(new Uint8Array(e)),t=>t.toString(16).padStart(2,"0")).join(""),mse=e=>{const n=`${e.candidate.role==="loopback"?"local":e.candidate.role} ${e.candidate.url}`;if(e.stage==="unsupported")return`${n} skipped (${e.reason??"unsupported"})`;const s=e.code===void 0?"":` (close ${e.code})`;return`${n} failed at ${e.stage}${s}${e.reason===void 0?"":`: ${e.reason}`}`};function yse(e){return new vse(e).ready}class Sp extends Error{constructor(){super("Unauthorized: this client is not allowed (wrong token, or the device is not paired or was revoked)"),this.name="UnauthorizedError"}}class Pn extends Error{constructor(){super("Disconnected from host"),this.name="DisconnectedError"}}class qz extends Error{constructor(n,s,r){const i=n>s?"client-older":"host-older";super(i==="client-older"?`Client out of date: the host speaks protocol major ${n}, this client speaks ${s}`:`Host out of date: this client speaks protocol major ${s}, the host speaks ${n}`);be(this,"hostMajor");be(this,"clientMajor");be(this,"hostVersion");be(this,"direction");this.name="ProtocolMismatchError",this.hostMajor=n,this.clientMajor=s,r!==void 0&&(this.hostVersion=r),this.direction=i}}function dw(e){return e.some(t=>{const n="data"in t?t.data:"",s="ref"in t?t.ref:"";return n===""&&s!==""})}var Sr,Qu,Nt,ut,Cr,Ju,fg,ji,is,Yr,Kl,er,Er,Qe,Si,Ci,qe,ln,Ct,os,so,Xl,Zl,ha,ro,oh,Ei,Yl,ed,$i,pa,Ql,io,xa,Qr,Jl,ec,tc,nc,ks,ah,lh,sc,Ae,td,nd,ch,sd,ga,ma,rd,id,od,ad,rc,Ai,uh,ld,Zt,cn,as,Mi,hg,ic,oo,ao,lo,Re,ya,dh,fh,cd,hh,co,tr,va,ka,ud,pg,De,dd,ba,ph,wa,w,vs,vl,Cp,Jo,Ep,Tk,Pz,zk,Nk,Uz,_k,$p,kl,ea,bl,wl,Rk,Ik,qf,Ap,Lk,Ok,ss,Fz,Vz,Mp,Gz,uu,Pf,Wz,Dk,Kz,Xz,Zz,Bk,Uf,Hk,qk,Pk,Ff,Uk,Yz,Tp,jl,Sl,Qz,Cl,Fk,zp,Vk,Jz,Gk,Np,eN,_p,El,tN,nN,sN,Rp,gi,rN,Wk,Kk,Ip,du,iN,oN,aN,Vf,fu,$l,ta,Lp,na,lN,sa,cN,Gf,uN,mi,Xk,Op,Wf,Kf,dN,Dp,Zk,Al,fN,Ys,Yk,Qk,hN,pN,xN,xn,gN,Bp,yi,Hp,Qs,mN,qp,Pp,hu,yN,Up,Jk,e4,vN,kN,bN,Fp,wN,jN,Xf,SN,t4,CN,EN,n4,Js,Un,s4,vi,Ml,Le,Vp,r4,Mn,on,$N,AN,Gp,Wp,MN,Zf,TN;class vse{constructor(t){ue(this,w);be(this,"ready");ue(this,Sr);ue(this,Qu,new Set);ue(this,Nt,new Map);ue(this,ut,new Set);ue(this,Cr,new Set);ue(this,Ju,[]);ue(this,fg,{});ue(this,ji,new Map);ue(this,is,new Map);ue(this,Yr);ue(this,Kl);ue(this,er);ue(this,Er);ue(this,Qe);ue(this,Si);ue(this,Ci);ue(this,qe);ue(this,ln);ue(this,Ct);ue(this,os);ue(this,so);ue(this,Xl,0);ue(this,Zl,0);ue(this,ha,0);ue(this,ro,0);ue(this,oh,Number.NEGATIVE_INFINITY);ue(this,Ei);ue(this,Yl,"loopback");ue(this,ed);ue(this,$i);ue(this,pa);ue(this,Ql,0);ue(this,io,0);ue(this,xa,!1);ue(this,Qr,new Map);ue(this,Jl,[]);ue(this,ec);ue(this,tc);ue(this,nc);ue(this,ks);ue(this,ah);ue(this,lh);ue(this,sc);ue(this,Ae);ue(this,td,0);ue(this,nd,0);ue(this,ch,0);ue(this,sd,[]);ue(this,ga);ue(this,ma);ue(this,rd,0);ue(this,id);ue(this,od);ue(this,ad);ue(this,rc,!1);ue(this,Ai,!1);ue(this,uh,!1);ue(this,ld,!1);ue(this,Zt);ue(this,cn);ue(this,as);ue(this,Mi,1);ue(this,hg,1);ue(this,ic,new Map);ue(this,oo,[]);ue(this,ao,new Set);ue(this,lo,new Map);ue(this,Re,0);ue(this,ya,!1);ue(this,dh,[]);ue(this,fh,{});ue(this,cd);ue(this,hh);ue(this,co,new Map);ue(this,tr,new Map);ue(this,va,new Map);ue(this,ka,new Map);ue(this,ud,0);ue(this,pg,gse(8));ue(this,De,!1);ue(this,dd,!1);ue(this,ba,Promise.resolve());ue(this,ph);ue(this,wa);var r,i,a,l;W(this,Sr,t),W(this,er,t.connectionMode??"auto"),W(this,Er,t.rtc),W(this,Qe,t.clock??ez),W(this,Ci,((r=t.rtc)==null?void 0:r.signalOnlyHint)===!0),W(this,lh,"candidates"in t),"candidates"in t?(W(this,Yr,[...t.candidates]),W(this,ec,t.openTransport),W(this,sc,t.pairing),W(this,tc,t.legacyUrl??((i=t.candidates[0])==null?void 0:i.url)??""),W(this,nc,t.pageProtocol)):"transport"in t?(W(this,Yr,[{url:t.transport.label,role:"legacy"}]),W(this,ec,()=>t.transport),W(this,tc,t.transport.label),W(this,nc,void 0)):(W(this,Yr,U1(t.url,void 0)),W(this,ec,()=>Bz(t.url,t.token)),W(this,tc,t.url),W(this,nc,void 0)),W(this,Kl,Q2(S(this,Yr),S(this,er))),W(this,ks,{...ise,...t.candidateTimeouts}),W(this,ah,t.roundTimeoutMs),this.ready=new Promise((c,u)=>{W(this,ph,c),W(this,wa,u)});const n=t.signal,s=(n==null?void 0:n.aborted)===!0;if(n!==void 0){const c=()=>C(this,w,lN).call(this);s?queueMicrotask(c):(n.addEventListener("abort",c,{once:!0}),W(this,ad,()=>n.removeEventListener("abort",c)))}W(this,id,(a=t.network)==null?void 0:a.subscribe(()=>C(this,w,Ok).call(this))),W(this,od,(l=t.lifecycle)==null?void 0:l.subscribe(c=>{c==="background"?C(this,w,tN).call(this):C(this,w,nN).call(this)})),s||C(this,w,Jo).call(this)}setConnectionMode(t){var n,s;if(t!==S(this,er)){if(W(this,er,t),W(this,Kl,Q2(S(this,Yr),t)),C(this,w,Pf).call(this),C(this,w,gi).call(this),C(this,w,du).call(this),S(this,Ct)!==void 0&&C(this,w,Ff).call(this,new Pn),S(this,qe)!==void 0){const r=S(this,qe);W(this,qe,void 0),C(this,w,jl).call(this,r);try{(n=r.connection)==null||n.close()}catch{}}if(S(this,ln)!==void 0){const r=S(this,ln);W(this,ln,void 0),r.timer!==void 0&&S(this,Qe).clearTimeout(r.timer);try{(s=r.connection)==null||s.close()}catch{}}S(this,De)||(C(this,w,fu).call(this),C(this,w,$l).call(this),C(this,w,ea).call(this),C(this,w,bl).call(this),C(this,w,wl).call(this,new Pn),S(this,Zt)!==void 0&&C(this,w,Un).call(this,{connection:"reconnecting"}),C(this,w,Jo).call(this))}}rtcDiagnostics(){var i;const t=S(this,qe),n=C(this,w,zp).call(this);let s;t!==void 0?s=t.phase:((i=S(this,Ae))==null?void 0:i.p2p)===!0&&S(this,Ae).phase==="ready"?s="active":S(this,Ct)!==void 0?s="warm":n>0?s="cooldown":S(this,so)!==void 0?s="scheduled":s="idle";const r=S(this,ed);return{path:S(this,Yl),phase:s,...r===void 0?{}:{lastFailure:{stage:r.stage,...r.reason===void 0?{}:{reason:r.reason},agoMs:Math.max(0,C(this,w,ss).call(this)-r.atMs),...r.pair===void 0?{}:{pair:r.pair}}},...S(this,$i)===void 0?{}:{selectedPair:S(this,$i)},cooldownRemainingMs:n}}}Sr=new WeakMap,Qu=new WeakMap,Nt=new WeakMap,ut=new WeakMap,Cr=new WeakMap,Ju=new WeakMap,fg=new WeakMap,ji=new WeakMap,is=new WeakMap,Yr=new WeakMap,Kl=new WeakMap,er=new WeakMap,Er=new WeakMap,Qe=new WeakMap,Si=new WeakMap,Ci=new WeakMap,qe=new WeakMap,ln=new WeakMap,Ct=new WeakMap,os=new WeakMap,so=new WeakMap,Xl=new WeakMap,Zl=new WeakMap,ha=new WeakMap,ro=new WeakMap,oh=new WeakMap,Ei=new WeakMap,Yl=new WeakMap,ed=new WeakMap,$i=new WeakMap,pa=new WeakMap,Ql=new WeakMap,io=new WeakMap,xa=new WeakMap,Qr=new WeakMap,Jl=new WeakMap,ec=new WeakMap,tc=new WeakMap,nc=new WeakMap,ks=new WeakMap,ah=new WeakMap,lh=new WeakMap,sc=new WeakMap,Ae=new WeakMap,td=new WeakMap,nd=new WeakMap,ch=new WeakMap,sd=new WeakMap,ga=new WeakMap,ma=new WeakMap,rd=new WeakMap,id=new WeakMap,od=new WeakMap,ad=new WeakMap,rc=new WeakMap,Ai=new WeakMap,uh=new WeakMap,ld=new WeakMap,Zt=new WeakMap,cn=new WeakMap,as=new WeakMap,Mi=new WeakMap,hg=new WeakMap,ic=new WeakMap,oo=new WeakMap,ao=new WeakMap,lo=new WeakMap,Re=new WeakMap,ya=new WeakMap,dh=new WeakMap,fh=new WeakMap,cd=new WeakMap,hh=new WeakMap,co=new WeakMap,tr=new WeakMap,va=new WeakMap,ka=new WeakMap,ud=new WeakMap,pg=new WeakMap,De=new WeakMap,dd=new WeakMap,ba=new WeakMap,ph=new WeakMap,wa=new WeakMap,w=new WeakSet,vs=function(t){return!S(this,De)&&S(this,Ae)===t&&!t.done&&t.generation===S(this,td)},vl=function(t){t.timer!==void 0&&(clearTimeout(t.timer),t.timer=void 0)},Cp=function(t,n,s){C(this,w,vl).call(this,t),t.timer=setTimeout(()=>{t.timer=void 0,C(this,w,vs).call(this,t)&&C(this,w,kl).call(this,t,n,void 0,`no progress within ${s}ms`)},Math.max(0,s))},Jo=function(){if(S(this,De)||S(this,Ae)!==void 0)return;C(this,w,fu).call(this),C(this,w,$l).call(this),W(this,nd,S(this,nd)+1);const t=S(this,nd);W(this,Jl,[...S(this,Kl)]),W(this,ch,0),W(this,sd,[]),W(this,rc,!1),W(this,Ai,!0);const n=S(this,ks).socketOpenMs+S(this,ks).noiseMs+S(this,ks).helloMs+S(this,ks).syncMs,s=S(this,ah)??S(this,Jl).length*n+1e3;W(this,ga,setTimeout(()=>{if(W(this,ga,void 0),S(this,De)||!S(this,Ai)||S(this,nd)!==t)return;const r=S(this,Ae);W(this,rc,!0),r!==void 0&&(C(this,w,$p).call(this,r.candidate,"round",!1,void 0,`the connection round exceeded ${s}ms`),C(this,w,ea).call(this,r)),C(this,w,qf).call(this)},s)),C(this,w,Ep).call(this)},Ep=function(){if(S(this,De)||!S(this,Ai)||S(this,Ae)!==void 0)return;if(S(this,rc)){C(this,w,qf).call(this);return}const t=S(this,Jl)[Cn(this,ch)._++];if(t===void 0){C(this,w,qf).call(this);return}if(t.unsupported!==void 0){C(this,w,$p).call(this,t,"unsupported",!1,void 0,t.unsupported),queueMicrotask(()=>C(this,w,Ep).call(this));return}const n={candidate:t,generation:++Cn(this,td)._,phase:"open",done:!1};W(this,Ae,n),W(this,ya,!1),C(this,w,Cp).call(this,n,"open",S(this,ks).socketOpenMs);const s={opened:()=>{C(this,w,vs).call(this,n)&&C(this,w,Tk).call(this,n,"noise",S(this,ks).noiseMs)},authenticated:()=>{C(this,w,vs).call(this,n)&&(C(this,w,Tk).call(this,n,"hello",S(this,ks).helloMs),C(this,w,Pz).call(this))},message:a=>{C(this,w,vs).call(this,n)&&C(this,w,zk).call(this,n,a)},closed:(a,l)=>{C(this,w,vs).call(this,n)&&C(this,w,kl).call(this,n,n.phase==="ready"?"closed":n.phase,a,l)}};let r;try{r=S(this,ec).call(this,t,S(this,sc))}catch(a){C(this,w,kl).call(this,n,"open",void 0,_s(a).message);return}let i;try{i=r.open(s)}catch(a){C(this,w,kl).call(this,n,"open",void 0,_s(a).message);return}if(!C(this,w,vs).call(this,n)){i.close();return}n.connection=i},Tk=function(t,n,s){C(this,w,vs).call(this,t)&&(t.phase=n,C(this,w,Cp).call(this,t,n,s))},Pz=function(){if(S(this,sc)===void 0||(W(this,sc,void 0),S(this,Sr).onPaired===void 0))return;const t=n=>{var s,r;try{(r=(s=S(this,Sr)).onPairedError)==null||r.call(s,_s(n))}catch{}};try{Promise.resolve(S(this,Sr).onPaired()).catch(t)}catch(n){t(n)}},zk=function(t,n){let s;try{s=JSON.parse(n)}catch{C(this,w,kl).call(this,t,t.phase==="ready"?"closed":t.phase,void 0,"the host sent a frame that is not JSON");return}if(!(s===null||typeof s!="object")){if(s.type==="hello"){C(this,w,Nk).call(this,t,s);return}C(this,w,cN).call(this,s)}},Nk=function(t,n){var l;const s=n.protocol,r=typeof s=="number"?s:s!==null&&typeof s=="object"?s.major:void 0;if(r!==iy.major){const c=new qz(typeof r=="number"?r:Number.NaN,iy.major,n.hostVersion);W(this,De,!0),C(this,w,ta).call(this),C(this,w,Lp).call(this),C(this,w,na).call(this),C(this,w,ea).call(this),S(this,Zt)===void 0?S(this,wa).call(this,c):(C(this,w,Un).call(this,{connection:"outdated",protocolMismatch:{hostMajor:c.hostMajor,clientMajor:c.clientMajor,...c.hostVersion===void 0?{}:{hostVersion:c.hostVersion},direction:c.direction}}),C(this,w,vi).call(this,"error",c.message));return}C(this,w,vl).call(this,t),t.phase="sync",C(this,w,Cp).call(this,t,"sync",S(this,ks).syncMs);const i=s!==null&&typeof s=="object"&&typeof s.minor=="number"?s.minor:0;W(this,Re,i),W(this,ya,!0),W(this,Si,n.rtc!==void 0&&Iee(n.rtc)?n.rtc:void 0),((l=S(this,Si))==null?void 0:l.signalOnly)===!0&&!S(this,Ci)&&(W(this,Ci,!0),C(this,w,Mp).call(this)),W(this,Ju,n.docs),W(this,fg,n.toolPresentations),W(this,dh,n.models),W(this,fh,n.defaults??{}),W(this,cd,n.hostVersion),W(this,hh,sse(n.terminals)?n.terminals:void 0),S(this,Cr).clear();const a=new Set(ry(i));for(const c of Q3)a.has(c)?S(this,ut).add(c):(S(this,ut).delete(c),S(this,Nt).delete(c),S(this,Cr).delete(c));if(S(this,cn)!==void 0)for(const c of C(this,w,mi).call(this,S(this,cn)))S(this,ut).add(c);if(S(this,as)!==void 0)for(const c of C(this,w,mi).call(this,S(this,as)))S(this,ut).add(c);C(this,w,dN).call(this);for(const c of S(this,ut))C(this,w,Wf).call(this,c);if(n.endpointSet!==void 0){const c=um(n.endpointSet);if(c.kind==="valid"&&(S(this,lh)&&(W(this,Yr,U1(S(this,tc),c.endpointSet,{pageProtocol:S(this,nc)})),W(this,Kl,Q2(S(this,Yr),S(this,er)))),S(this,Sr).onEndpointSet!==void 0)){const u=d=>{var f,p;try{(p=(f=S(this,Sr)).onEndpointSetError)==null||p.call(f,_s(d))}catch{}};try{Promise.resolve(S(this,Sr).onEndpointSet(c.endpointSet)).catch(u)}catch(d){u(d)}}}S(this,Zt)!==void 0&&(C(this,w,Un).call(this,{session:n.session,toolPresentations:n.toolPresentations,connection:"reconnecting",host:C(this,w,Yk).call(this)}),C(this,w,Js).call(this)),C(this,w,Uz).call(this,t,n,i)},Uz=async function(t,n,s){try{const r=C(this,w,uN).call(this,s),i=new Set(ry(s)),a=r.filter(c=>i.has(c)&&!S(this,Cr).has(c));await Promise.all(a.map(c=>C(this,w,Gf).call(this,c,!0))),S(this,Zt)!==void 0&&t.p2p!==!0&&(C(this,w,Un).call(this,{connection:"connected"}),C(this,w,Js).call(this),C(this,w,Vf).call(this),W(this,Ai,!1),t.phase="ready");const l=r.filter(c=>!S(this,Cr).has(c));S(this,Zt)!==void 0&&t.p2p!==!0&&l.length>0&&W(this,os,{entries:[]}),await Promise.all(l.map(c=>C(this,w,Gf).call(this,c,!0)))}catch{return}if(C(this,w,vs).call(this,t)){if(C(this,w,vl).call(this,t),C(this,w,Vf).call(this),t.phase="ready",W(this,Ai,!1),W(this,ud,0),W(this,uh,!0),W(this,ld,!1),W(this,Yl,C(this,w,Vz).call(this,t.candidate,t.p2p===!0)),S(this,Zt)===void 0){W(this,Zt,{session:n.session,organized:{chats:[],projects:[],archived:[]},models:C(this,w,Ys).call(this,"models")??n.models,defaults:C(this,w,Qk).call(this,n.defaults??{}),notices:[],connection:"connected",docs:[],submissions:[],toolPresentations:n.toolPresentations,devices:[],mcp:null,auth:null,providers:null,settings:null,agents:null,host:C(this,w,Yk).call(this)}),C(this,w,Js).call(this),S(this,ph).call(this,{view:C(this,w,$N).call(this),controller:C(this,w,AN).call(this),terminals:C(this,w,fN).call(this),setConnectionMode:r=>this.setConnectionMode(r),rtcDiagnostics:()=>this.rtcDiagnostics(),close:()=>C(this,w,TN).call(this)}),C(this,w,Uk).call(this),C(this,w,_k).call(this,t);return}if(C(this,w,Un).call(this,{session:n.session,connection:"connected"}),C(this,w,Js).call(this),await C(this,w,jN).call(this),!!C(this,w,vs).call(this,t)){for(const[r,i]of S(this,ka))C(this,w,Vp).call(this,"resizeTerminal",{terminalId:r,...i}).catch(()=>{});C(this,w,Uk).call(this),C(this,w,_k).call(this,t)}}},_k=function(t){if(t.p2p===!0){C(this,w,Yz).call(this),C(this,w,sN).call(this),C(this,w,Vk).call(this);return}C(this,w,gi).call(this),C(this,w,uu).call(this,C(this,w,Fz).call(this))},$p=function(t,n,s,r,i){var l,c;const a={candidate:t,stage:n,unauthorized:s,...r===void 0?{}:{code:r},...i===void 0?{}:{reason:i}};S(this,sd).push(a);try{(c=(l=S(this,Sr)).onCandidateFailure)==null||c.call(l,a)}catch{}},kl=function(t,n,s,r){if(!C(this,w,vs).call(this,t))return;const i=t.phase==="ready";if(t.p2p===!0&&(C(this,w,Cl).call(this,i?"liveness":"commit",r,S(this,$i)),i&&(W(this,ro,C(this,w,ss).call(this)+uw),C(this,w,gi).call(this),C(this,w,du).call(this))),C(this,w,$p).call(this,t.candidate,n,s===kp,s,r),C(this,w,ea).call(this,t),C(this,w,pN).call(this),C(this,w,bl).call(this),S(this,Ct)!==void 0&&(S(this,Ct).old===t||S(this,Ct).standby.installed&&S(this,Ct).standby===S(this,qe))&&C(this,w,Ff).call(this,new Pn),!S(this,De)){if(t.p2p===!0&&!i){C(this,w,Un).call(this,{connection:"reconnecting"}),C(this,w,Jo).call(this);return}if(i){C(this,w,Un).call(this,{connection:"reconnecting"}),C(this,w,Jo).call(this);return}if(S(this,rc)){C(this,w,qf).call(this);return}queueMicrotask(()=>C(this,w,Ep).call(this))}},ea=function(t){var s;const n=S(this,Ae);if(!(n===void 0||t!==void 0&&n!==t)){if(n.p2p===!0&&W(this,$i,void 0),W(this,Ae,void 0),n.done=!0,C(this,w,vl).call(this,n),S(this,os)!==void 0){for(const r of S(this,os).entries.splice(0))r.reject(new Pn);W(this,os,void 0)}C(this,w,wl).call(this,new Pn),(s=n.connection)==null||s.close()}},bl=function(){for(const t of S(this,is).values())t.reject(new Pn);S(this,is).clear()},wl=function(t){for(const n of S(this,ji).values())for(const s of n.splice(0))s.reject(t)},Rk=function(t){return t.filter(n=>n.stage!=="unsupported")},Ik=function(t){const n=C(this,w,Rk).call(this,t);return n.length>0&&n.every(s=>s.unauthorized)},qf=function(){if(!S(this,Ai))return;if(W(this,Ai,!1),C(this,w,fu).call(this),C(this,w,$l).call(this),S(this,os)!==void 0){for(const i of S(this,os).entries.splice(0))i.reject(new Pn);W(this,os,void 0)}if(W(this,Ae,void 0),S(this,De))return;const t=[...S(this,sd)],n=C(this,w,Rk).call(this,t),s=C(this,w,Ik).call(this,t),r=S(this,Jl).length===0;if(!s&&S(this,er)==="directOnly"&&S(this,Er)!==void 0&&(S(this,Ci)||S(this,Si)!==void 0)&&S(this,ln)===void 0&&S(this,qe)===void 0&&S(this,Ae)===void 0){C(this,w,Gk).call(this);return}if(!S(this,uh)){W(this,De,!0),C(this,w,ta).call(this),C(this,w,na).call(this),S(this,wa).call(this,s?new Sp:r?new Error(hy):C(this,w,Ap).call(this,t));return}if(s){W(this,De,!0),C(this,w,ta).call(this),C(this,w,na).call(this),C(this,w,Un).call(this,{connection:"closed",unauthorized:!0}),C(this,w,vi).call(this,"error",new Sp().message);return}if(n.length===0){W(this,De,!0),C(this,w,ta).call(this),C(this,w,na).call(this),C(this,w,Un).call(this,{connection:"closed"}),C(this,w,vi).call(this,"error",r?hy:C(this,w,Ap).call(this,t).message);return}C(this,w,Un).call(this,{connection:"reconnecting"}),S(this,ld)||(W(this,ld,!0),C(this,w,vi).call(this,"error",C(this,w,Ap).call(this,t).message)),C(this,w,Lk).call(this)},Ap=function(t){return C(this,w,Ik).call(this,t)?new Sp:t.length===0?new Error(hy):new ose(t)},Lk=function(){C(this,w,$l).call(this);const{min:t,max:n}=S(this,Sr).reconnectDelayMs??{min:200,max:2e3},s=Math.min(n,t*2**Cn(this,ud)._++),r=S(this,rd);W(this,ma,setTimeout(()=>{S(this,rd)===r&&(W(this,ma,void 0),S(this,De)||C(this,w,Jo).call(this))},s))},Ok=function(){var t,n;if(!S(this,De)){if(C(this,w,oN).call(this),((t=S(this,Ae))==null?void 0:t.p2p)===!0&&S(this,Ae).phase==="ready"){C(this,w,Wk).call(this);return}((n=S(this,Ae))==null?void 0:n.phase)!=="ready"&&(C(this,w,$l).call(this),C(this,w,fu).call(this),C(this,w,ea).call(this),W(this,ud,0),C(this,w,Jo).call(this))}},ss=function(){return S(this,Qe).now()},Fz=function(){return lse},Vz=function(t,n=!1){return n?"p2p":t.role==="legacy"?"relay":t.role},Mp=function(t=!0){var s,r;const n=i=>{var a,l;try{(l=(a=S(this,Er))==null?void 0:a.onSignalOnlyError)==null||l.call(a,_s(i))}catch{}};try{Promise.resolve((r=(s=S(this,Er))==null?void 0:s.onSignalOnly)==null?void 0:r.call(s,t)).catch(n)}catch(i){n(i)}},Gz=function(){for(const t of S(this,ji).values())if(t.length>0)return!0;return!1},uu=function(t){if(S(this,De)||S(this,Er)===void 0||S(this,er)==="relayOnly")return;C(this,w,Pf).call(this);const n=++Cn(this,Xl)._;W(this,so,S(this,Qe).setTimeout(()=>{W(this,so,void 0),n===S(this,Xl)&&C(this,w,Wz).call(this)},Math.max(0,t)))},Pf=function(){S(this,so)!==void 0&&(S(this,Qe).clearTimeout(S(this,so)),W(this,so,void 0))},Wz=function(){var r;if(S(this,De)||S(this,Er)===void 0||S(this,er)==="relayOnly"||S(this,qe)!==void 0||S(this,Ct)!==void 0||S(this,ln)!==void 0)return;const t=C(this,w,ss).call(this),n=Math.max(S(this,ha),S(this,ro));if(t<n){C(this,w,uu).call(this,n-t);return}const s=S(this,Ae);if((s==null?void 0:s.phase)==="ready"&&s.connection!==void 0&&((r=S(this,Zt))==null?void 0:r.connection)==="connected"){if(S(this,Si)===void 0)return;C(this,w,Dk).call(this,s.connection,!1);return}S(this,er)==="directOnly"&&(S(this,Si)===void 0&&!S(this,Ci)||C(this,w,Gk).call(this))},Dk=function(t,n){var u;const s=S(this,Er);if(s===void 0||S(this,qe)!==void 0||S(this,De))return;const r=++Cn(this,Xl)._,i={generation:r,phase:"signal",signal:t,signalOnly:n,installed:!1};W(this,qe,i),W(this,ed,void 0),i.timer=S(this,Qe).setTimeout(()=>{S(this,qe)!==i||S(this,Ct)!==void 0||C(this,w,Sl).call(this,i,"warm",`WebRTC preparation exceeded ${cw}ms`)},cw);const a=`rtc-${S(this,pg)}-${r}`,l=Uee({platform:s.platform,stun:((u=S(this,Si))==null?void 0:u.stun)??[],hostKey:s.hostKey,device:s.device,clock:S(this,Qe),offer:d=>C(this,w,Kz).call(this,t,a,d),onSelectedPair:d=>{d!==void 0&&(i.selectedPair=Aee(d.local,d.remote))}}),c={signaled:()=>{S(this,qe)===i&&(i.phase="ice")},opened:()=>{S(this,qe)===i&&(i.phase="noise")},authenticated:()=>{var d;if(S(this,qe)===i&&(i.phase="noise",i.signalOnly)){try{(d=i.signal)==null||d.close()}catch{}i.signal=void 0}},message:d=>{var f;if(i.installed){const p=i.installed&&((f=S(this,Ae))==null?void 0:f.connection)===i.connection?S(this,Ae):void 0;p!==void 0&&C(this,w,vs).call(this,p)&&C(this,w,zk).call(this,p,d);return}C(this,w,Xz).call(this,i,d)},closed:(d,f)=>{var p;if(i.installed){const x=((p=S(this,Ae))==null?void 0:p.connection)===i.connection?S(this,Ae):void 0;x!==void 0&&C(this,w,vs).call(this,x)&&C(this,w,kl).call(this,x,x.phase==="ready"?"closed":x.phase,d,f);return}S(this,qe)===i&&C(this,w,Sl).call(this,i,i.phase,f??`DataChannel closed (${d})`)}};try{i.connection=l.open(c)}catch(d){C(this,w,Sl).call(this,i,"signal",_s(d).message)}},Kz=function(t,n,s){const r=Cn(this,Mi)._++;return new Promise((i,a)=>{S(this,is).set(r,{resolve:i,reject:a});try{t.send(JSON.stringify({type:"call",id:r,method:"rtcOffer",args:{attempt:n,sdp:s}}))}catch(l){S(this,is).delete(r),a(_s(l))}}).then(i=>{const a=i;if(a===null||typeof a!="object"||typeof a.sdp!="string")throw new Error("the host returned a malformed rtcOffer answer");return a.sdp})},Xz=function(t,n){var r;if(S(this,qe)!==t)return;let s;try{s=JSON.parse(n)}catch{C(this,w,Sl).call(this,t,"noise","the DataChannel sent a frame that is not JSON");return}if(!(s===null||typeof s!="object")){if(s.type==="hello"){t.hello=s,t.pingId===void 0&&C(this,w,Zz).call(this,t);return}if(s.type==="result"&&((r=t.verify)==null?void 0:r.id)===s.id){const i=t.verify;t.verify=void 0,i.timer!==void 0&&S(this,Qe).clearTimeout(i.timer),s.ok?i.resolve():i.reject(new Error(s.error));return}}},Zz=function(t){if(S(this,qe)!==t||t.hello===void 0)return;const n=Cn(this,Mi)._++;t.pingId=n,C(this,w,Bk).call(this,t,n,5e3).then(()=>{S(this,qe)!==t||t.installed||(t.phase="warm",t.warmAt=C(this,w,ss).call(this),t.timer!==void 0&&S(this,Qe).clearTimeout(t.timer),t.timer=S(this,Qe).setTimeout(()=>{S(this,qe)===t&&S(this,Ct)===void 0&&C(this,w,Qz).call(this,t,`no idle window within ${lw}ms`)},lw),C(this,w,Uf).call(this,t))},s=>{S(this,qe)===t&&C(this,w,Sl).call(this,t,"warm",_s(s).message)})},Bk=function(t,n,s){return S(this,qe)!==t||t.connection===void 0?Promise.reject(new Error("the RTC carrier is gone")):new Promise((r,i)=>{const a=S(this,Qe).setTimeout(()=>{var l;((l=t.verify)==null?void 0:l.id)===n&&(t.verify=void 0,i(new Error(`the RTC carrier did not answer a ping within ${s}ms`)))},s);t.verify={id:n,resolve:r,reject:i,timer:a};try{t.connection.send(JSON.stringify({type:"call",id:n,method:"ping",args:{id:`rtc-${n}`}}))}catch(l){S(this,Qe).clearTimeout(a),t.verify=void 0,i(_s(l))}})},Uf=function(t){var s;if(S(this,qe)!==t||t.phase!=="warm"||t.installed||S(this,Ct)!==void 0)return;if(((s=S(this,Ae))==null?void 0:s.phase)!=="ready"){C(this,w,Hk).call(this,t);return}if(S(this,is).size>0||C(this,w,Gz).call(this))t.idleSince=void 0;else{const r=C(this,w,ss).call(this);if(t.idleSince??(t.idleSince=r),r-t.idleSince>=cse){C(this,w,Hk).call(this,t);return}}t.idleTimer!==void 0&&S(this,Qe).clearTimeout(t.idleTimer),t.idleTimer=S(this,Qe).setTimeout(()=>C(this,w,Uf).call(this,t),100)},Hk=function(t){var s;if(S(this,qe)!==t||S(this,Ct)!==void 0||t.hello===void 0)return;t.idleTimer!==void 0&&S(this,Qe).clearTimeout(t.idleTimer),t.idleTimer=void 0;const n={standby:t,old:S(this,Ae),entries:[],warmAt:t.warmAt??C(this,w,ss).call(this),prepared:!1,released:!1};if(W(this,Ct,n),((s=n.old)==null?void 0:s.phase)==="ready"&&n.old.connection!==void 0){const r=Cn(this,Mi)._++;t.verify=void 0,C(this,w,Bk).call(this,t,r,3e3).then(()=>{S(this,Ct)!==n||n.released||(n.prepared=!0,C(this,w,qk).call(this,n))},i=>{S(this,Ct)!==n||n.released||C(this,w,Pk).call(this,n,_s(i).message)})}else n.prepared=!0,C(this,w,qk).call(this,n)},qk=function(t){var a;if(S(this,Ct)!==t||t.released)return;const n=t.standby,s=n.hello;if(s===void 0||n.connection===void 0){C(this,w,Ff).call(this,new Error("the RTC carrier lost its hello before handoff"));return}const r=t.old;if(r!==void 0){r.done=!0;try{(a=r.connection)==null||a.close()}catch{}}const i={candidate:{url:"webrtc",role:"direct"},generation:++Cn(this,td)._,phase:"sync",connection:n.connection,done:!1,p2p:!0};W(this,Ae,i),n.installed=!0,W(this,Yl,"p2p"),W(this,$i,n.selectedPair),n.signalOnly&&(n.signal=void 0),C(this,w,Nk).call(this,i,s)},Pk=function(t,n){var r;W(this,Ct,void 0),W(this,qe,void 0),C(this,w,jl).call(this,t.standby);try{(r=t.standby.connection)==null||r.close()}catch{}if(t.standby.signalOnly&&t.standby.signal!==void 0)try{t.standby.signal.close()}catch{}C(this,w,Cl).call(this,"commit",n,t.standby.selectedPair),C(this,w,Fk).call(this);const s=t.old;for(const i of t.entries.splice(0))s===void 0?i.reject(new Error("Not connected to the host")):C(this,w,Tp).call(this,s,i);C(this,w,uu).call(this,C(this,w,zp).call(this))},Ff=function(t){var s;const n=S(this,Ct);if(n!==void 0){W(this,Ct,void 0),W(this,qe,void 0),C(this,w,jl).call(this,n.standby);try{(s=n.standby.connection)==null||s.close()}catch{}if(n.standby.signalOnly&&n.standby.signal!==void 0)try{n.standby.signal.close()}catch{}for(const r of n.entries.splice(0))r.reject(t)}},Uk=function(){const t=S(this,os);if(t===void 0)return;W(this,os,void 0);const n=S(this,Ae);for(const s of t.entries.splice(0))n===void 0?s.reject(new Pn):C(this,w,Tp).call(this,n,s)},Yz=function(){const t=S(this,Ct);if(t===void 0||!t.standby.installed)return;W(this,Ct,void 0),W(this,qe,void 0);const n=S(this,Ae);for(const s of t.entries.splice(0))n===void 0?s.reject(new Error("Not connected to the host")):C(this,w,Tp).call(this,n,s);C(this,w,Vk).call(this)},Tp=function(t,n){if(!C(this,w,vs).call(this,t)||t.phase!=="ready"||t.connection===void 0){n.reject(new Error("Not connected to the host"));return}S(this,is).set(n.id,{resolve:n.resolve,reject:n.reject});try{t.connection.send(JSON.stringify(n.frame))}catch(s){S(this,is).delete(n.id),n.reject(_s(s))}},jl=function(t){var n;for(const s of[t.timer,t.pingTimer,t.idleTimer,(n=t.verify)==null?void 0:n.timer])s!==void 0&&S(this,Qe).clearTimeout(s);t.timer=void 0,t.pingTimer=void 0,t.idleTimer=void 0,t.verify=void 0},Sl=function(t,n,s){var i;if(S(this,qe)!==t)return;const r=S(this,Ct);if(r!==void 0&&r.standby===t){C(this,w,Pk).call(this,r,s);return}W(this,qe,void 0),C(this,w,jl).call(this,t);try{(i=t.connection)==null||i.close()}catch{}if(t.signalOnly&&t.signal!==void 0)try{t.signal.close()}catch{}if(C(this,w,Cl).call(this,n,s,t.selectedPair),t.signalOnly&&n==="signal"&&(W(this,Ci,!1),C(this,w,Mp).call(this,!1)),C(this,w,Fk).call(this),S(this,Zt)===void 0&&S(this,er)==="directOnly"&&S(this,Ae)===void 0){C(this,w,El).call(this,s);return}C(this,w,uu).call(this,C(this,w,zp).call(this))},Qz=function(t,n){var s;if(S(this,qe)===t){W(this,qe,void 0),C(this,w,jl).call(this,t);try{(s=t.connection)==null||s.close()}catch{}if(t.signalOnly&&t.signal!==void 0)try{t.signal.close()}catch{}C(this,w,Cl).call(this,"commit",n,t.selectedPair),C(this,w,uu).call(this,use)}},Cl=function(t,n,s){W(this,ed,{stage:t,...n===void 0?{}:{reason:n},atMs:C(this,w,ss).call(this),...s===void 0?{}:{pair:s}})},Fk=function(){W(this,Zl,S(this,Zl)+1);const t=Math.min(fse,dse*2**(S(this,Zl)-1));W(this,ha,C(this,w,ss).call(this)+t)},zp=function(){return Math.max(0,Math.max(S(this,ha),S(this,ro))-C(this,w,ss).call(this))},Vk=function(){S(this,Ei)!==void 0&&S(this,Qe).clearTimeout(S(this,Ei)),W(this,Ei,S(this,Qe).setTimeout(()=>{var t;W(this,Ei,void 0),S(this,Yl)==="p2p"&&((t=S(this,Ae))==null?void 0:t.phase)==="ready"&&(W(this,Zl,0),W(this,ha,0),W(this,ro,0))},hse))},Jz=function(){W(this,Zl,0),W(this,ha,0),W(this,ro,0)},Gk=function(){const t=S(this,Er);if(t===void 0||S(this,ln)!==void 0||S(this,De))return;if(t.openSignalTransport===void 0){C(this,w,El).call(this,"the platform has no signal-only transport");return}const n=fX(S(this,Yr));if(n.length===0){C(this,w,El).call(this,"no relay candidate is available for signaling");return}const s={generation:++Cn(this,Xl)._,index:0,token:0,done:!1};W(this,ln,s),C(this,w,Np).call(this,s,n)},Np=function(t,n){var s;if(!(S(this,ln)!==t||t.done||S(this,De))){for(t.timer!==void 0&&(S(this,Qe).clearTimeout(t.timer),t.timer=void 0);t.index<n.length;){const r=n[t.index++];if(r.unsupported!==void 0)continue;const i=(s=S(this,Er))==null?void 0:s.openSignalTransport;if(i===void 0){C(this,w,_p).call(this,t,"the platform has no signal-only transport");return}let a;try{a=i(r)}catch(d){C(this,w,_p).call(this,t,_s(d).message);return}const l=++t.token,c=S(this,ks).socketOpenMs+S(this,ks).noiseMs+S(this,ks).helloMs;t.timer=S(this,Qe).setTimeout(()=>{var d;if(!(S(this,ln)!==t||t.done||t.token!==l)){t.done=!0,t.token+=1;try{(d=t.connection)==null||d.close()}catch{}t.connection=void 0,t.done=!1,C(this,w,Np).call(this,t,n)}},c);const u={message:d=>C(this,w,eN).call(this,t,d),closed:(d,f)=>{if(t.token===l){if(S(this,ln)!==t||t.done){const p=S(this,qe);(p==null?void 0:p.signalOnly)===!0&&p.signal===t.connection&&!p.installed&&p.phase!=="noise"&&p.phase!=="warm"&&C(this,w,Sl).call(this,p,p.phase,"the signal-only connection closed");return}t.done=!0,t.connection=void 0,t.done=!1,C(this,w,Np).call(this,t,n)}}};try{t.connection=a.open(u)}catch{continue}return}C(this,w,_p).call(this,t,"every relay signal path failed")}},eN=function(t,n){let s;try{s=JSON.parse(n)}catch{return}if(s===null||typeof s!="object")return;if(s.type==="result"){const i=S(this,is).get(s.id);S(this,is).delete(s.id),s.ok?i==null||i.resolve(s.value):i==null||i.reject(new Error(s.error));return}if(s.type!=="signalHello"||S(this,ln)!==t||t.done)return;if(t.done=!0,W(this,ln,void 0),t.timer!==void 0&&S(this,Qe).clearTimeout(t.timer),t.timer=void 0,s.rtc===void 0){C(this,w,El).call(this,"the host did not advertise WebRTC on its signal connection");return}W(this,Si,s.rtc),s.rtc.signalOnly&&C(this,w,Mp).call(this);const r=t.connection;if(r===void 0){C(this,w,El).call(this,"the signal-only connection vanished before its offer");return}C(this,w,Dk).call(this,r,!0)},_p=function(t,n){S(this,ln)===t&&(W(this,ln,void 0),t.timer!==void 0&&S(this,Qe).clearTimeout(t.timer),t.timer=void 0,C(this,w,Cl).call(this,"signal",n),W(this,Ci,!1),C(this,w,El).call(this,n))},El=function(t){if(!S(this,De)){if(S(this,Zt)===void 0){W(this,De,!0),C(this,w,ta).call(this),C(this,w,na).call(this),C(this,w,bl).call(this),C(this,w,wl).call(this,new Pn),S(this,wa).call(this,new Hz(t));return}C(this,w,vi).call(this,"error",`${OM} (${t})`),C(this,w,Un).call(this,{connection:"reconnecting"}),C(this,w,Lk).call(this)}},tN=function(){S(this,De)||(W(this,xa,!0),C(this,w,gi).call(this))},nN=function(){var t,n;if(!S(this,De)){if(W(this,xa,!1),((t=S(this,Ae))==null?void 0:t.p2p)===!0&&S(this,Ae).phase==="ready"){C(this,w,Wk).call(this);return}((n=S(this,Ae))==null?void 0:n.phase)!=="ready"&&C(this,w,Ok).call(this)}},sN=function(){var n;if(C(this,w,gi).call(this),S(this,De)||S(this,xa)||((n=S(this,Ae))==null?void 0:n.p2p)!==!0||S(this,Ae).phase!=="ready")return;const t=C(this,w,ss).call(this);W(this,Ql,t+aw),W(this,io,t+q0),C(this,w,Rp).call(this)},Rp=function(){var n;if(S(this,De)||S(this,xa)||((n=S(this,Ae))==null?void 0:n.p2p)!==!0||S(this,Ae).phase!=="ready")return;const t=Math.max(0,S(this,io)-C(this,w,ss).call(this));W(this,pa,S(this,Qe).setTimeout(()=>{W(this,pa,void 0),C(this,w,rN).call(this)},t))},gi=function(){S(this,pa)!==void 0&&S(this,Qe).clearTimeout(S(this,pa)),W(this,pa,void 0);for(const t of S(this,Qr).values())t.timer!==void 0&&S(this,Qe).clearTimeout(t.timer);S(this,Qr).clear()},rN=function(){const t=S(this,Ae);if(S(this,De)||S(this,xa)||(t==null?void 0:t.p2p)!==!0||t.phase!=="ready")return;const n=C(this,w,ss).call(this);if(n>=S(this,Ql)){C(this,w,Ip).call(this,"no pong within 15000ms");return}C(this,w,Kk).call(this,!1),W(this,io,S(this,io)+q0),S(this,io)<=n&&W(this,io,n+q0),C(this,w,Rp).call(this)},Wk=function(){var n;C(this,w,gi).call(this),!(((n=S(this,Ae))==null?void 0:n.p2p)!==!0||S(this,Ae).phase!=="ready"||C(this,w,Kk).call(this,!0)===void 0)&&(W(this,io,C(this,w,ss).call(this)+q0),C(this,w,Rp).call(this))},Kk=function(t){const n=S(this,Ae);if((n==null?void 0:n.connection)===void 0||n.p2p!==!0)return;const s=Cn(this,Mi)._++,r={generation:n.generation};S(this,Qr).set(s,r),t&&(r.timer=S(this,Qe).setTimeout(()=>{S(this,Qr).has(s)&&(S(this,Qr).delete(s),C(this,w,Ip).call(this,"the foreground verification ping did not answer within 3000ms"))},ase));try{n.connection.send(JSON.stringify({type:"call",id:s,method:"ping",args:{id:`probe-${s}`}}))}catch(i){S(this,Qr).delete(s),r.timer!==void 0&&S(this,Qe).clearTimeout(r.timer),C(this,w,Ip).call(this,_s(i).message);return}return s},Ip=function(t){var s;const n=S(this,Ae);if((n==null?void 0:n.p2p)===!0){C(this,w,Cl).call(this,"liveness",t,S(this,$i)),W(this,$i,void 0),W(this,ro,C(this,w,ss).call(this)+uw),C(this,w,gi).call(this),C(this,w,du).call(this),n.done=!0;try{(s=n.connection)==null||s.close()}catch{}S(this,Ae)===n&&W(this,Ae,void 0),C(this,w,bl).call(this),C(this,w,wl).call(this,new Pn),C(this,w,fu).call(this),C(this,w,Un).call(this,{connection:"reconnecting"}),C(this,w,Jo).call(this)}},du=function(){S(this,Ei)!==void 0&&(S(this,Qe).clearTimeout(S(this,Ei)),W(this,Ei,void 0))},iN=function(){return aw},oN=function(){const t=C(this,w,ss).call(this);t-S(this,oh)<pse||(W(this,oh,t),C(this,w,Jz).call(this))},aN=function(){S(this,Ae)!==void 0&&C(this,w,vl).call(this,S(this,Ae))},Vf=function(){S(this,ga)!==void 0&&(clearTimeout(S(this,ga)),W(this,ga,void 0))},fu=function(){C(this,w,Vf).call(this),C(this,w,aN).call(this)},$l=function(){W(this,rd,S(this,rd)+1),S(this,ma)!==void 0&&(clearTimeout(S(this,ma)),W(this,ma,void 0))},ta=function(){for(const t of S(this,oo))C(this,w,yi).call(this,t);C(this,w,Vf).call(this),C(this,w,$l).call(this),C(this,w,Pf).call(this),C(this,w,gi).call(this),C(this,w,du).call(this),S(this,Ae)!==void 0&&C(this,w,vl).call(this,S(this,Ae))},Lp=function(){var t,n;if(C(this,w,Pf).call(this),C(this,w,gi).call(this),C(this,w,du).call(this),S(this,Ct)!==void 0&&C(this,w,Ff).call(this,new Pn),S(this,qe)!==void 0){const s=S(this,qe);W(this,qe,void 0),C(this,w,jl).call(this,s);try{(t=s.connection)==null||t.close()}catch{}if(s.signalOnly&&s.signal!==void 0)try{s.signal.close()}catch{}}if(S(this,ln)!==void 0){const s=S(this,ln);W(this,ln,void 0),s.timer!==void 0&&S(this,Qe).clearTimeout(s.timer);try{(n=s.connection)==null||n.close()}catch{}}},na=function(){var t,n,s;(t=S(this,id))==null||t.call(this),W(this,id,void 0),(n=S(this,od))==null||n.call(this),W(this,od,void 0),(s=S(this,ad))==null||s.call(this),W(this,ad,void 0)},lN=function(){S(this,De)||(W(this,De,!0),C(this,w,ta).call(this),C(this,w,Lp).call(this),C(this,w,na).call(this),C(this,w,ea).call(this),C(this,w,bl).call(this),C(this,w,wl).call(this,new Pn),C(this,w,Un).call(this,{connection:"closed"}),S(this,wa).call(this,new Error("Connection attempt aborted")))},sa=function(t){var n,s;(s=(n=S(this,Ae))==null?void 0:n.connection)==null||s.send(JSON.stringify(t))},cN=function(t){var n,s,r,i,a;if(!(t===null||typeof t!="object"))switch(t.type){case"snapshot":if(!S(this,ut).has(t.stream))return;if(t.stream.startsWith("terminals:")){S(this,Nt).set(t.stream,t.value),C(this,w,Dp).call(this,t.stream,{kind:"ready",list:t.value});return}S(this,Nt).set(t.stream,t.value),S(this,Cr).add(t.stream),S(this,lo).set(t.stream,(S(this,lo).get(t.stream)??0)+1),C(this,w,Js).call(this);for(const l of((n=S(this,ji).get(t.stream))==null?void 0:n.splice(0))??[])l.resolve();return;case"ops":if(!S(this,ut).has(t.stream)||!S(this,Nt).has(t.stream))return;S(this,Nt).set(t.stream,Hne(S(this,Nt).get(t.stream),t.ops)),C(this,w,Js).call(this);return;case"output":{const l=S(this,tr).get(t.stream);if(l===void 0||!S(this,ut).has(t.stream))return;S(this,va).set(t.stream,t.seq),l.output(t.data,t.reset===!0);return}case"ended":{if(t.stream.startsWith("terminals:")||t.stream.startsWith("terminal:")){C(this,w,Zk).call(this,t.stream,t.reason);return}S(this,ut).delete(t.stream),S(this,Nt).delete(t.stream),S(this,Cr).delete(t.stream);const l=new Error(`Stream ${t.stream} ended: ${t.reason}`);for(const c of((s=S(this,ji).get(t.stream))==null?void 0:s.splice(0))??[])c.endSatisfies?c.resolve():c.reject(l);S(this,cn)!==void 0&&C(this,w,mi).call(this,S(this,cn)).includes(t.stream)?C(this,w,Wp).call(this):S(this,as)!==void 0&&C(this,w,mi).call(this,S(this,as)).includes(t.stream)&&W(this,as,void 0),C(this,w,Js).call(this);return}case"result":{const l=S(this,Qr).get(t.id);if(l!==void 0){S(this,Qr).delete(t.id),l.timer!==void 0&&S(this,Qe).clearTimeout(l.timer),t.ok&&((r=S(this,Ae))==null?void 0:r.generation)===l.generation&&W(this,Ql,Math.max(S(this,Ql),S(this,Qe).now()+C(this,w,iN).call(this))),((i=S(this,qe))==null?void 0:i.phase)==="warm"&&C(this,w,Uf).call(this,S(this,qe));return}const c=S(this,is).get(t.id);S(this,is).delete(t.id),t.ok?c==null||c.resolve(t.value):c==null||c.reject(new Error(t.error)),((a=S(this,qe))==null?void 0:a.phase)==="warm"&&C(this,w,Uf).call(this,S(this,qe));return}case"notice":C(this,w,vi).call(this,t.level,t.message);return}},Gf=function(t,n=!1){return S(this,ut).has(t)?new Promise((s,r)=>{const i=S(this,ji).get(t)??[];i.push({resolve:s,reject:r,endSatisfies:n}),S(this,ji).set(t,i)}):Promise.resolve()},uN=function(t){const n=new Set(ry(t));for(const s of[S(this,cn),S(this,as)])if(s!==void 0)for(const r of C(this,w,mi).call(this,s))n.add(r);return[...n]},mi=function(t){return[xl(t),...S(this,Ju).map(n=>wf(n.kind,t))]},Xk=async function(t){const n=C(this,w,mi).call(this,t).filter(i=>!S(this,ut).has(i)),s=C(this,w,mi).call(this,t).filter(i=>S(this,ut).has(i)&&!S(this,Cr).has(i));for(const i of n)S(this,ut).add(i);const r=Promise.all([...n,...s].map(i=>C(this,w,Gf).call(this,i)));for(const i of n)S(this,ya)&&C(this,w,Wf).call(this,i);await r},Op=function(t,n){var r;const s=new Set(n===void 0?[]:C(this,w,mi).call(this,n));for(const i of C(this,w,mi).call(this,t))if(!s.has(i)){S(this,ut).delete(i),S(this,Nt).delete(i),S(this,Cr).delete(i);for(const a of((r=S(this,ji).get(i))==null?void 0:r.splice(0))??[])a.resolve();C(this,w,sa).call(this,{type:"unsubscribe",stream:i})}},Wf=function(t){const n=t.startsWith("conversation:")&&Yt(S(this,Re),"imageRefs"),s=S(this,va).get(t);C(this,w,sa).call(this,{type:"subscribe",stream:t,...n?{images:"ref"}:{},...s===void 0?{}:{since:s}})},Kf=function(){if(!Yt(S(this,Re),"terminals"))return"The host is too old for terminals (needs protocol 5.27); run `pinomad upgrade` on the host";if(S(this,hh)===void 0)return"The host couldn't load its terminal module; its log says which package is missing"},dN=function(){const t=C(this,w,Kf).call(this);if(t===void 0){for(const n of S(this,co).keys())S(this,ut).add(n);for(const n of S(this,tr).keys())S(this,ut).add(n);return}for(const n of[...S(this,co).keys()])S(this,ut).delete(n),S(this,Nt).delete(n),C(this,w,Dp).call(this,n,{kind:"unavailable",reason:t});for(const n of[...S(this,tr).keys()])C(this,w,Zk).call(this,n,t)},Dp=function(t,n){for(const s of[...S(this,co).get(t)??[]])s(n)},Zk=function(t,n){if(S(this,ut).delete(t),S(this,Nt).delete(t),t.startsWith("terminals:")){C(this,w,Dp).call(this,t,{kind:"unavailable",reason:n});return}const s=S(this,tr).get(t);S(this,tr).delete(t),S(this,va).delete(t),S(this,ka).delete(t.slice(9)),s==null||s.ended(n)},Al=function(t,n){const s=C(this,w,Kf).call(this);return s===void 0?C(this,w,Le).call(this,t,n):Promise.reject(new Error(s))},fN=function(){return{watch:(t,n)=>{const s=rse(t);let r=S(this,co).get(s);const i=r===void 0;r===void 0&&S(this,co).set(s,r=new Set),r.add(n);const a=C(this,w,Kf).call(this),l=S(this,Nt).get(s);return n(a!==void 0?{kind:"unavailable",reason:a}:l!==void 0?{kind:"ready",list:l}:{kind:"loading"}),i&&a===void 0&&(S(this,ut).add(s),S(this,ya)&&C(this,w,Wf).call(this,s)),()=>{!r.delete(n)||r.size>0||(S(this,co).delete(s),S(this,ut).delete(s)&&(S(this,Nt).delete(s),C(this,w,sa).call(this,{type:"unsubscribe",stream:s})))}},attach:(t,n)=>{const s=ow(t),r=C(this,w,Kf).call(this);return r!==void 0?(n.ended(r),()=>{}):(S(this,tr).has(s)&&S(this,ut).has(s)&&C(this,w,sa).call(this,{type:"unsubscribe",stream:s}),S(this,tr).set(s,n),S(this,va).delete(s),S(this,ut).add(s),S(this,ya)&&C(this,w,Wf).call(this,s),()=>{S(this,tr).get(s)===n&&(S(this,tr).delete(s),S(this,va).delete(s),S(this,ka).delete(t),S(this,ut).delete(s)&&C(this,w,sa).call(this,{type:"unsubscribe",stream:s}))})},open:(t,n)=>C(this,w,Al).call(this,"openTerminal",{conversationId:t,...n}).then(({terminalId:s})=>s),input:(t,n)=>{C(this,w,Al).call(this,"terminalInput",{terminalId:t,data:n}).catch(()=>{})},resize:(t,n)=>{S(this,tr).has(ow(t))&&S(this,ka).set(t,n),C(this,w,Al).call(this,"resizeTerminal",{terminalId:t,...n}).catch(()=>{})},rename:(t,n)=>C(this,w,Al).call(this,"renameTerminal",{terminalId:t,name:n}).then(()=>{}),restart:(t,n)=>C(this,w,Al).call(this,"restartTerminal",{terminalId:t,...S(this,ka).get(t)??n}).then(()=>{}),close:t=>C(this,w,Al).call(this,"closeTerminal",{terminalId:t}).then(()=>{})}},Ys=function(t){return S(this,Nt).get(t)},Yk=function(){return{protocol:{major:iy.major,minor:S(this,Re)},...S(this,cd)===void 0?{}:{version:S(this,cd)}}},Qk=function(t){const n=C(this,w,Ys).call(this,"settings");return n===void 0?t:{...n.defaultModel===null?{}:{model:n.defaultModel},...n.defaultThinkingLevel===null?{}:{thinkingLevel:n.defaultThinkingLevel}}},hN=function(t,n){const s=C(this,w,Ys).call(this,"conversations")??[],r=new Map(s.map(a=>[a.id,a.parent]));let i=t;for(let a=0;i!==void 0&&a<8;a++){if(i===n)return!0;i=r.get(i)}return!1},pN=function(){for(const t of S(this,oo))t.phase!=="inFlight"||t.admitted||(t.phase="unknown",C(this,w,yi).call(this,t))},xN=function(){return S(this,oo).filter(t=>t.phase!=="settled").map(t=>({requestId:t.requestId,...t.conversationId===void 0?{}:{conversationId:t.conversationId},text:t.text,whenBusy:t.whenBusy,placement:t.placement,phase:t.phase,images:t.images,...t.imageViews===void 0?{}:{imageViews:t.imageViews},skills:t.skills??[],attachments:t.attachments,...t.attachmentDetails===void 0?{}:{attachmentDetails:t.attachmentDetails},...t.submissionId===void 0?{}:{submissionId:t.submissionId},...t.entry===void 0?{}:{entry:t.entry},...t.error===void 0?{}:{error:t.error}}))},xn=function(){C(this,w,Js).call(this)},gN=function(t){C(this,w,yi).call(this,t),t.timer=setTimeout(()=>{if(t.timer=void 0,S(this,De)||t.phase==="settled"||t.admitted)return;t.phase==="inFlight"&&(t.phase="unknown");const n=t.timeoutResolve;t.timeoutResolve=void 0,C(this,w,xn).call(this),n==null||n()},xse)},Bp=function(t){C(this,w,gN).call(this,t);let n;const s=new Promise(r=>{n=r});return t.timeoutResolve=n,s},yi=function(t){const n=t.timeoutResolve;t.timeoutResolve=void 0,t.timer!==void 0&&(clearTimeout(t.timer),t.timer=void 0),n==null||n()},Hp=function(t){return t.phase==="settled"},Qs=function(t){C(this,w,Hp).call(this,t)||(t.phase="settled",t.error=void 0,C(this,w,yi).call(this,t))},mN=function(t){if(t===void 0)return[];const n=S(this,Nt).get(xl(t));return(n==null?void 0:n.entries)??[]},qp=function(t){return t.entry===void 0?!1:C(this,w,mN).call(this,t.conversationId).some(n=>String(n.id)===String(t.entry))},Pp=function(t){if(t.conversationId===void 0||t.submissionId===void 0)return!1;const n=S(this,Nt).get(wf("pi.inbox",t.conversationId));return((n==null?void 0:n.items)??[]).some(s=>String(s.id)===String(t.submissionId))},hu=function(t,n){t.admitted=!0,t.submissionId=n.submissionId,t.error=void 0,C(this,w,yi).call(this,t),n.entry!==void 0&&(t.entry=n.entry),t.entry!==void 0?C(this,w,qp).call(this,t)||n.status==="done"?C(this,w,Qs).call(this,t):t.phase="inFlight":C(this,w,Pp).call(this,t)?C(this,w,Qs).call(this,t):n.status==="placed"||n.status==="done"||n.status==="unanswered"?C(this,w,Qs).call(this,t):t.phase="inFlight",C(this,w,xn).call(this)},yN=function(){for(const t of S(this,oo))if(!(t.phase==="settled"||t.submissionId===void 0)){if(C(this,w,qp).call(this,t)||C(this,w,Pp).call(this,t)){C(this,w,Qs).call(this,t);continue}if(t.conversationId!==void 0&&t.submissionId!==void 0&&t.admitted&&(t.entry!==void 0||!C(this,w,Pp).call(this,t))){const n=xl(t.conversationId),s=(S(this,lo).get(n)??0)+(S(this,lo).get(wf("pi.inbox",t.conversationId))??0);S(this,Cr).has(n)&&t.checkedVersion!==s&&(t.checkedVersion=s,C(this,w,Jk).call(this,t))}}},Up=function(t,n=!1){if(!Ze(S(this,Re),"submission"))return Promise.reject(new Error("The host is too old for submission receipts (needs protocol 5.25); run `pinomad upgrade` on the host"));if(t.conversationId===void 0)return Promise.reject(new Error("No conversation selected"));const s={conversationId:t.conversationId,requestId:t.requestId};return n?C(this,w,Vp).call(this,"submission",s):C(this,w,Le).call(this,"submission",s)},Jk=async function(t){if(!(t.confirming||t.phase==="settled"||!Ze(S(this,Re),"submission"))){t.confirming=!0;try{const n=await C(this,w,Up).call(this,t);if(S(this,De)||C(this,w,Hp).call(this,t))return;n!==null?C(this,w,hu).call(this,t,n):t.admitted&&t.entry===void 0&&(C(this,w,Qs).call(this,t),C(this,w,xn).call(this))}catch{}finally{t.confirming=!1}}},e4=function(t){const n=t.conversationId;if(n===void 0)throw new Error("No conversation selected");return{conversationId:n,text:t.text,whenBusy:t.whenBusy,requestId:t.requestId,...t.images.length===0?{}:{images:t.images},...C(this,w,s4).call(this,t.skills),...t.attachments.length===0?{}:{attachments:t.attachments}}},vN=function(t){if(t.images.length>0&&!Yt(S(this,Re),"images"))throw new Error("The host is too old for images (needs protocol 5.5); run `pinomad upgrade` on the host");if(dw(t.images)&&!Yt(S(this,Re),"imageRefs"))throw new Error("The host is too old for image refs (needs protocol 5.15); run `pinomad upgrade` on the host");if(t.attachments.length>Ri)throw new Error("At most "+Ri+" attachments per message");if(t.attachments.length>0&&!Yt(S(this,Re),"attachments"))throw new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host")},kN=function(t,n){S(this,De)||(C(this,w,yi).call(this,t),t.admitted=!0,t.submissionId=n.submissionId,n.entry!==void 0&&(t.entry=n.entry),Yt(S(this,Re),"submitEntry")?t.entry!==void 0?(t.phase="inFlight",C(this,w,qp).call(this,t)&&C(this,w,Qs).call(this,t)):(t.phase="inFlight",t.conversationId!==void 0&&(t.checkedVersion=(S(this,lo).get(xl(t.conversationId))??0)+(S(this,lo).get(wf("pi.inbox",t.conversationId))??0)),C(this,w,Jk).call(this,t)):C(this,w,Qs).call(this,t),C(this,w,xn).call(this))},bN=function(t,n){S(this,De)||(C(this,w,yi).call(this,t),n instanceof Pn||n instanceof Error&&n.message==="Not connected to the host"?t.phase="unknown":(t.phase="failed",t.error=n instanceof Error?n.message:String(n)),C(this,w,xn).call(this))},Fp=async function(t,n,s){if(t.phase==="settled"||S(this,De))return;if(s!==void 0&&t.timer===void 0){t.phase!=="failed"&&(t.phase="unknown",C(this,w,xn).call(this));return}t.phase="inFlight",t.error=void 0;const r=n?C(this,w,Vp).call(this,"submit",C(this,w,e4).call(this,t)):C(this,w,Le).call(this,"submit",C(this,w,e4).call(this,t)),i=s??C(this,w,Bp).call(this,t);C(this,w,xn).call(this);const a=(async()=>{try{const l=await r;C(this,w,kN).call(this,t,l)}catch(l){C(this,w,bN).call(this,t,l)}})();await Promise.race([a,i])},wN=async function(t){if(!(t.phase==="settled"||S(this,De))){try{C(this,w,vN).call(this,t)}catch(n){if(S(this,De))return;t.phase="failed",t.error=n instanceof Error?n.message:String(n),C(this,w,xn).call(this);return}if(!t.fixed){const n=S(this,cn);if(n===void 0){t.phase="failed",t.error="No conversation selected",C(this,w,xn).call(this);return}t.conversationId=n,t.fixed=!0}await C(this,w,Fp).call(this,t,!1)}},jN=async function(){const t=S(this,oo).filter(n=>n.phase==="unknown");S(this,os)===void 0&&t.some(n=>n.fixed)&&Ze(S(this,Re),"submission")&&W(this,os,{entries:[]});for(const n of t)if(!(S(this,De)||n.phase!=="unknown"||!n.fixed))try{if(!Ze(S(this,Re),"submission"))continue;const s=C(this,w,Bp).call(this,n),r=await C(this,w,t4).call(this,n,!0,s);if(r==="deadline")continue;if(r!==null){C(this,w,hu).call(this,n,r);continue}if(n.phase!=="unknown"||n.timer===void 0)continue;await C(this,w,Fp).call(this,n,!0,s)}catch(s){if(S(this,De)||(C(this,w,yi).call(this,n),n.phase="unknown",C(this,w,xn).call(this),s instanceof Pn||s instanceof Error&&s.message==="Not connected to the host"))return}},Xf=function(t,n=t.images){return{text:t.text,whenBusy:t.whenBusy,images:n,skills:t.skills??[],attachments:t.attachments,...t.attachmentDetails===void 0?{}:{attachmentDetails:t.attachmentDetails}}},SN=async function(t){const n=t.imageViews??t.images,s=[];for(const r of n)if("data"in r)s.push(r);else{const i=await C(this,w,Le).call(this,"image",{ref:r.ref});s.push({data:i.data,mimeType:i.mimeType})}return s},t4=async function(t,n,s){const r=C(this,w,Up).call(this,t,n),i=await Promise.race([r.then(a=>({kind:"found",found:a}),a=>({kind:"error",error:a})),s.then(()=>({kind:"deadline"}))]);if(i.kind==="deadline")return r.then(a=>{S(this,De)||a===null||t.phase==="settled"||C(this,w,hu).call(this,t,a)},()=>{}),"deadline";if(i.kind==="error")throw i.error;return i.found},CN=async function(t){if(t.phase!=="unknown"&&t.phase!=="failed")return;const n=C(this,w,Bp).call(this,t);try{if(t.phase==="unknown"&&Ze(S(this,Re),"submission")){const s=await C(this,w,t4).call(this,t,!1,n);if(s==="deadline")return;if(s!==null){C(this,w,hu).call(this,t,s);return}if(t.phase!=="unknown"||t.timer===void 0)return}await C(this,w,Fp).call(this,t,!1,n)}catch(s){if(S(this,De))return;if(C(this,w,yi).call(this,t),s instanceof Pn||s instanceof Error&&s.message==="Not connected to the host"){t.phase="unknown",t.error=void 0,C(this,w,xn).call(this);return}throw t.phase="failed",t.error=s instanceof Error?s.message:String(s),C(this,w,xn).call(this),s}},EN=async function(t){let n;const s=async()=>{if(n!==void 0)return n;try{return n=await C(this,w,SN).call(this,t),n}catch{throw new Error("Couldn't load the original images — try again")}};if(t.phase==="queued"||t.phase==="failed"){const l=await s();return C(this,w,Qs).call(this,t),C(this,w,xn).call(this),C(this,w,Xf).call(this,t,l)}if(t.phase!=="unknown"&&!(t.phase==="inFlight"&&t.submissionId!==void 0)||!Ze(S(this,Re),"submission"))return;const r=await C(this,w,Up).call(this,t);if(r===null){const l=await s();return C(this,w,Qs).call(this,t),C(this,w,xn).call(this),C(this,w,Xf).call(this,t,l)}if(C(this,w,hu).call(this,t,r),C(this,w,Hp).call(this,t)||r.status==="placed"||r.status==="done"||r.entry!==void 0)return;if(r.status==="unanswered"){const l=await s();return C(this,w,Qs).call(this,t),C(this,w,xn).call(this),C(this,w,Xf).call(this,t,l)}if(t.conversationId===void 0)return;const i=await s(),{outcome:a}=await C(this,w,Le).call(this,"withdrawQueued",{conversationId:t.conversationId,submissionId:r.submissionId});if(a==="sent"){C(this,w,Qs).call(this,t),C(this,w,xn).call(this);return}return C(this,w,Qs).call(this,t),C(this,w,xn).call(this),C(this,w,Xf).call(this,t,i)},n4=function(t){return S(this,Ju).flatMap(n=>{const s=wf(n.kind,t);return S(this,Nt).has(s)?[{kind:n.kind,presentation:n.presentation,value:S(this,Nt).get(s)}]:[]})},Js=function(){var c;if(S(this,Zt)===void 0)return;C(this,w,yN).call(this);const t=S(this,cn),n=S(this,as),s=t===void 0?void 0:S(this,Nt).get(xl(t)),r=C(this,w,Ys).call(this,"conversations")??[],i=C(this,w,Ys).call(this,"index")??{projects:[],conversations:[]},a=((c=C(this,w,Ys).call(this,"devices"))==null?void 0:c.devices)??[],l=S(this,ut).has("tasks")?S(this,Nt).get("tasks"):void 0;C(this,w,Un).call(this,{conversation:s,models:C(this,w,Ys).call(this,"models")??S(this,dh),organized:QK(i,r),home:t===void 0?void 0:eX(i,r,t),checkout:t===void 0?void 0:JK(i,r,t),tasks:l,docs:t===void 0?[]:C(this,w,n4).call(this,t),submissions:C(this,w,xN).call(this),side:n===void 0?void 0:{id:n,conversation:S(this,Nt).get(xl(n)),docs:C(this,w,n4).call(this,n)},devices:a,mcp:C(this,w,Ys).call(this,"mcp")??null,auth:C(this,w,Ys).call(this,"auth")??null,providers:C(this,w,Ys).call(this,"providers")??null,settings:C(this,w,Ys).call(this,"settings")??null,agents:C(this,w,Ys).call(this,"agents")??null,defaults:C(this,w,Qk).call(this,S(this,fh))})},Un=function(t){S(this,Zt)!==void 0&&(W(this,Zt,{...S(this,Zt),...t}),!S(this,dd)&&(W(this,dd,!0),queueMicrotask(()=>{W(this,dd,!1);for(const n of S(this,Qu))n()})))},s4=function(t){return t===void 0||!Yt(S(this,Re),"boundSkills")?{}:{skills:t}},vi=function(t,n){S(this,Zt)!==void 0&&C(this,w,Un).call(this,{notices:[...S(this,Zt).notices,{id:Cn(this,hg)._++,level:t,message:n}].slice(-20)})},Ml=function(){if(!Ze(S(this,Re),"beginLogin"))throw new Error("The host is too old for this (needs protocol 5.21); run `pinomad upgrade` on the host")},Le=function(t,n){var r,i;const s=S(this,Ct);if(s!==void 0||S(this,os)!==void 0){const a=Cn(this,Mi)._++,l={type:"call",id:a,method:t,args:n},c=(s==null?void 0:s.entries)??S(this,os).entries;return new Promise((u,d)=>{c.push({id:a,frame:l,resolve:u,reject:d})})}return((r=S(this,Ae))==null?void 0:r.phase)!=="ready"||((i=S(this,Zt))==null?void 0:i.connection)!=="connected"?Promise.reject(new Error("Not connected to the host")):C(this,w,r4).call(this,S(this,Ae),Cn(this,Mi)._++,t,n)},Vp=function(t,n){var s,r;return((s=S(this,Ae))==null?void 0:s.phase)!=="ready"||((r=S(this,Zt))==null?void 0:r.connection)!=="connected"?Promise.reject(new Error("Not connected to the host")):C(this,w,r4).call(this,S(this,Ae),Cn(this,Mi)._++,t,n)},r4=function(t,n,s,r){return!C(this,w,vs).call(this,t)||t.phase!=="ready"||t.connection===void 0?Promise.reject(new Error("Not connected to the host")):new Promise((i,a)=>{S(this,is).set(n,{resolve:i,reject:a});try{t.connection.send(JSON.stringify({type:"call",id:n,method:s,args:r}))}catch(l){S(this,is).delete(n),a(_s(l))}})},Mn=function(t){return W(this,ba,S(this,ba).then(t).then(()=>{},n=>C(this,w,vi).call(this,"error",n instanceof Error?n.message:String(n)))),S(this,ba)},on=function(t){const n=S(this,ba).then(t);return W(this,ba,n.then(()=>{},()=>{})),n},$N=function(){return{current:()=>S(this,Zt),subscribe:t=>(S(this,Qu).add(t),()=>S(this,Qu).delete(t))}},AN=function(){const t=()=>Array.from(crypto.getRandomValues(new Uint8Array(16)),s=>s.toString(16).padStart(2,"0")).join(""),n=()=>{if(S(this,cn)===void 0)throw new Error("No conversation selected");return S(this,cn)};return{addProject:s=>C(this,w,on).call(this,()=>C(this,w,Le).call(this,"addProject",{path:s})),listFolders:s=>C(this,w,on).call(this,()=>{if(!Ze(S(this,Re),"listFolders"))throw new Error("The host is too old for this (needs protocol 5.3); run `pinomad upgrade` on the host");return C(this,w,Le).call(this,"listFolders",s===void 0?{}:{path:s})}),removeProject:s=>C(this,w,Mn).call(this,()=>C(this,w,Le).call(this,"removeProject",{path:s})),renameConversation:(s,r)=>C(this,w,on).call(this,async()=>{if(!Ze(S(this,Re),"renameConversation"))throw new Error("The host is too old for this (needs protocol 5.4); run `pinomad upgrade` on the host");await C(this,w,Le).call(this,"renameConversation",{conversationId:s,title:r})}),createConversation:(s,r,i)=>C(this,w,Mn).call(this,async()=>{const a=(i==null?void 0:i.images)??[];if(a.length>0&&!Yt(S(this,Re),"images"))throw new Error("The host is too old for images (needs protocol 5.5); run `pinomad upgrade` on the host");if(dw(a)&&!Yt(S(this,Re),"imageRefs"))throw new Error("The host is too old for image refs (needs protocol 5.15); run `pinomad upgrade` on the host");const l=(i==null?void 0:i.attachments)??[];if(l.length>Ri)throw new Error(`At most ${Ri} attachments per message`);if(l.length>0&&!Yt(S(this,Re),"attachments"))throw new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host");if((i==null?void 0:i.agent)!==void 0&&!Yt(S(this,Re),"agentConversations"))throw new Error("The host is too old for named agents (needs protocol 5.10); run `pinomad upgrade` on the host");const{conversationId:c}=await C(this,w,Le).call(this,"createConversation",{home:s,text:r,requestId:t(),...(i==null?void 0:i.checkout)===void 0?{}:{checkout:i.checkout},...(i==null?void 0:i.model)===void 0?{}:{model:i.model},...(i==null?void 0:i.thinkingLevel)===void 0?{}:{thinkingLevel:i.thinkingLevel},...(i==null?void 0:i.agent)===void 0?{}:{agent:i.agent},...a.length===0?{}:{images:a},...C(this,w,s4).call(this,i==null?void 0:i.skills),...l.length===0?{}:{attachments:l}});await C(this,w,Gp).call(this,c)}),archive:(s,r)=>C(this,w,Mn).call(this,async()=>{await C(this,w,Le).call(this,"archive",{conversationId:s,archived:r}),r&&s===S(this,cn)&&C(this,w,Wp).call(this),r&&S(this,as)!==void 0&&C(this,w,hN).call(this,S(this,as),s)&&await C(this,w,Zf).call(this,void 0)}),submit:(s,r,i)=>{const a=(i==null?void 0:i.requestId)??t();if(S(this,ic).has(a))return Promise.resolve();const l=(i==null?void 0:i.target)??S(this,cn),c=l===void 0?void 0:S(this,Nt).get(xl(l)),u={requestId:a,text:s,whenBusy:r,placement:c!==void 0&&ig(c)?"queue":"conversation",images:(i==null?void 0:i.images)??[],...(i==null?void 0:i.imageViews)===void 0?{}:{imageViews:i.imageViews},...(i==null?void 0:i.skills)===void 0?{}:{skills:i.skills},attachments:(i==null?void 0:i.attachments)??[],...(i==null?void 0:i.attachmentDetails)===void 0?{}:{attachmentDetails:i.attachmentDetails},phase:"queued",...l===void 0?{}:{conversationId:l},fixed:(i==null?void 0:i.target)!==void 0,admitted:!1,confirming:!1};return S(this,ic).set(a,u),S(this,oo).push(u),C(this,w,xn).call(this),C(this,w,on).call(this,()=>C(this,w,wN).call(this,u)).then(()=>{},()=>{})},retrySubmission:s=>{const r=S(this,ic).get(s);return r===void 0||S(this,ao).has(s)?Promise.resolve():(S(this,ao).add(s),C(this,w,on).call(this,()=>C(this,w,CN).call(this,r)).finally(()=>S(this,ao).delete(s)))},takeBackSubmission:s=>{const r=S(this,ic).get(s);return r===void 0||S(this,ao).has(s)?Promise.resolve(void 0):(S(this,ao).add(s),C(this,w,on).call(this,()=>C(this,w,EN).call(this,r)).finally(()=>S(this,ao).delete(s)))},compact:s=>C(this,w,Mn).call(this,()=>C(this,w,Le).call(this,"compact",{conversationId:n(),...s===void 0?{}:{instructions:s}})),runCommand:(s,r,i)=>C(this,w,Mn).call(this,()=>{if(!Ze(S(this,Re),"runCommand"))throw new Error("The host is too old for this (needs protocol 5.17); run `pinomad upgrade` on the host");return C(this,w,Le).call(this,"runCommand",{conversationId:i??n(),name:s,...r===void 0?{}:{args:r}})}),abort:s=>{const r=s??S(this,cn);return r===void 0?(C(this,w,vi).call(this,"error","No conversation selected"),Promise.resolve()):C(this,w,Le).call(this,"abort",{conversationId:r}).then(()=>{},i=>C(this,w,vi).call(this,"error",i instanceof Error?i.message:String(i)))},withdrawQueued:(s,r)=>C(this,w,on).call(this,async()=>{if(!Ze(S(this,Re),"withdrawQueued"))throw new Error("The host is too old for this (needs protocol 5.14); run `pinomad upgrade` on the host");const{outcome:i}=await C(this,w,Le).call(this,"withdrawQueued",{conversationId:r??n(),submissionId:s});return i}),steerQueued:(s,r)=>C(this,w,on).call(this,async()=>{if(!Ze(S(this,Re),"steerQueued"))throw new Error("The host is too old for this (needs protocol 5.14); run `pinomad upgrade` on the host");const{outcome:i}=await C(this,w,Le).call(this,"steerQueued",{conversationId:r??n(),submissionId:s});return i}),setThinkingLevel:s=>C(this,w,Mn).call(this,()=>C(this,w,Le).call(this,"setThinkingLevel",{conversationId:n(),level:s})),setModel:s=>C(this,w,Mn).call(this,()=>C(this,w,Le).call(this,"setModel",{conversationId:n(),model:s})),setAgent:s=>C(this,w,Mn).call(this,()=>{if(!Ze(S(this,Re),"setAgent"))throw new Error("The host is too old for this (needs protocol 5.18); run `pinomad upgrade` on the host");return C(this,w,Le).call(this,"setAgent",{conversationId:n(),agent:s})}),toggleTasks:()=>C(this,w,Mn).call(this,async()=>{if(S(this,ut).delete("tasks")){C(this,w,sa).call(this,{type:"unsubscribe",stream:"tasks"}),S(this,Nt).delete("tasks"),C(this,w,Js).call(this);return}S(this,ut).add("tasks");const s=C(this,w,Gf).call(this,"tasks");C(this,w,sa).call(this,{type:"subscribe",stream:"tasks"}),await s}),switchConversation:s=>C(this,w,Mn).call(this,()=>C(this,w,Gp).call(this,s)),showSide:s=>C(this,w,Mn).call(this,()=>C(this,w,Zf).call(this,s)),clearConversation:()=>C(this,w,Mn).call(this,()=>C(this,w,MN).call(this)),fork:(s,r,i,a)=>C(this,w,Mn).call(this,async()=>{const{conversationId:l}=await C(this,w,Le).call(this,"fork",{conversationId:n(),entryId:s,...i===void 0?{}:{removeTools:i}});(a==null?void 0:a.show)==="side"?await C(this,w,Zf).call(this,l):await C(this,w,Gp).call(this,l),await C(this,w,Le).call(this,"submit",{conversationId:l,text:r,whenBusy:"followUp",requestId:t()})}),answer:(s,r,i,a)=>C(this,w,Mn).call(this,()=>C(this,w,Le).call(this,"answer",{conversationId:a??n(),kind:s,requestId:r,answers:i})),changes:()=>C(this,w,on).call(this,()=>C(this,w,Le).call(this,"changes",{conversationId:n()})),listFiles:(s,r)=>Ze(S(this,Re),"listFiles")?C(this,w,Le).call(this,"listFiles",{scope:s,query:r}):Promise.reject(new Error("The host is too old for this (needs protocol 5.10); run `pinomad upgrade` on the host")),beginAttachment:(s,r)=>Ze(S(this,Re),"beginAttachment")?C(this,w,Le).call(this,"beginAttachment",{name:s,size:r}).then(({attachmentId:i})=>i):Promise.reject(new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host")),appendAttachment:(s,r,i)=>Ze(S(this,Re),"appendAttachment")?C(this,w,Le).call(this,"appendAttachment",{attachmentId:s,offset:r,data:i}):Promise.reject(new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host")),image:(s,r="original")=>{if(!Ze(S(this,Re),"image"))return Promise.reject(new Error("The host is too old for this (needs protocol 5.15); run `pinomad upgrade` on the host"));const i=r!=="original"&&Yt(S(this,Re),"imageVariants");return C(this,w,Le).call(this,"image",{ref:s,...i?{variant:r}:{}})},listSkills:s=>Ze(S(this,Re),"listSkills")?C(this,w,Le).call(this,"listSkills",{scope:s}):Promise.reject(new Error("The host is too old for this (needs protocol 5.13); run `pinomad upgrade` on the host")),listCommands:s=>Ze(S(this,Re),"listCommands")?C(this,w,Le).call(this,"listCommands",{conversationId:s}):Promise.reject(new Error("The host is too old for this (needs protocol 5.17); run `pinomad upgrade` on the host")),createPairing:()=>C(this,w,on).call(this,()=>C(this,w,Le).call(this,"createPairing",{})),revokeDevice:s=>C(this,w,Mn).call(this,()=>C(this,w,Le).call(this,"revokeDevice",{publicKey:s})),logout:s=>C(this,w,Mn).call(this,()=>{if(!Ze(S(this,Re),"logout"))throw new Error("The host is too old for this (needs protocol 5.1); run `pinomad upgrade` on the host");return C(this,w,Le).call(this,"logout",{providerId:s})}),beginLogin:(s,r)=>C(this,w,on).call(this,async()=>(C(this,w,Ml).call(this),(await C(this,w,Le).call(this,"beginLogin",{providerId:s,method:r})).loginId)),answerLogin:(s,r,i)=>C(this,w,on).call(this,async()=>{C(this,w,Ml).call(this),await C(this,w,Le).call(this,"answerLogin",{loginId:s,promptId:r,value:i})}),cancelLogin:s=>C(this,w,on).call(this,async()=>{C(this,w,Ml).call(this),await C(this,w,Le).call(this,"cancelLogin",{loginId:s})}),saveCustomProvider:(s,r)=>C(this,w,on).call(this,async()=>{C(this,w,Ml).call(this),await C(this,w,Le).call(this,"saveCustomProvider",r===void 0?{provider:s}:{provider:s,apiKey:r})}),removeCustomProvider:s=>C(this,w,on).call(this,async()=>{C(this,w,Ml).call(this),await C(this,w,Le).call(this,"removeCustomProvider",{providerId:s})}),listEndpointModels:async s=>(C(this,w,Ml).call(this),(await C(this,w,Le).call(this,"listEndpointModels",s)).models),updateSettings:s=>C(this,w,Mn).call(this,()=>{if(!Ze(S(this,Re),"updateSettings"))throw new Error("The host is too old for this (needs protocol 5.2); run `pinomad upgrade` on the host");if(s.acceptAccountDevices!==void 0&&!Yt(S(this,Re),"acceptAccountDevices"))throw new Error("The host is too old for this (needs protocol 5.8); run `pinomad upgrade` on the host");if(s.hostName!==void 0&&!Yt(S(this,Re),"hostName"))throw new Error("The host is too old for this (needs protocol 5.12); run `pinomad upgrade` on the host");return C(this,w,Le).call(this,"updateSettings",{patch:s})}),createAgent:s=>C(this,w,on).call(this,async()=>{if(!Ze(S(this,Re),"createAgent"))throw new Error("The host is too old for this (needs protocol 5.6); run `pinomad upgrade` on the host");await C(this,w,Le).call(this,"createAgent",{role:s})}),updateAgent:s=>C(this,w,on).call(this,async()=>{if(!Ze(S(this,Re),"updateAgent"))throw new Error("The host is too old for this (needs protocol 5.6); run `pinomad upgrade` on the host");await C(this,w,Le).call(this,"updateAgent",{role:s})}),deleteAgent:s=>C(this,w,on).call(this,async()=>{if(!Ze(S(this,Re),"deleteAgent"))throw new Error("The host is too old for this (needs protocol 5.6); run `pinomad upgrade` on the host");await C(this,w,Le).call(this,"deleteAgent",{name:s})}),setPushToken:s=>C(this,w,on).call(this,async()=>{if(!Ze(S(this,Re),"setPushToken"))throw new Error("The host is too old for this (needs protocol 5.7); run `pinomad upgrade` on the host");if(s!==null&&typeof s!="string"&&!Yt(S(this,Re),"apnsPush"))throw new Error("The host is too old for this (needs protocol 5.9); run `pinomad upgrade` on the host");await C(this,w,Le).call(this,"setPushToken",{token:s})})}},Gp=async function(t){const n=S(this,cn);t!==n&&(await C(this,w,Xk).call(this,t),W(this,cn,t),n!==void 0&&C(this,w,Op).call(this,n,S(this,as)),C(this,w,Js).call(this))},Wp=function(){const t=S(this,cn);t!==void 0&&(W(this,cn,void 0),C(this,w,Op).call(this,t,S(this,as)),C(this,w,Js).call(this))},MN=async function(){C(this,w,Wp).call(this),await C(this,w,Zf).call(this,void 0)},Zf=async function(t){const n=S(this,as);t!==n&&(t!==void 0&&await C(this,w,Xk).call(this,t),W(this,as,t),n!==void 0&&C(this,w,Op).call(this,n,S(this,cn)),C(this,w,Js).call(this))},TN=function(){S(this,De)||(W(this,De,!0),C(this,w,ta).call(this),C(this,w,Lp).call(this),C(this,w,na).call(this),C(this,w,ea).call(this),C(this,w,bl).call(this),C(this,w,wl).call(this,new Pn),C(this,w,Un).call(this,{connection:"closed"}))};const Kp={width:"var(--spacing-4)",height:"var(--spacing-4)"},i4=e=>e instanceof Error?e.message:String(e),zN=e=>void window.open(e,"_blank","noopener,noreferrer");function kse({providerId:e,method:t,logins:n,remote:s,connected:r,intro:i,signIn:a,onDone:l,onCancel:c}){const[u,d]=h.useState(),[f,p]=h.useState(!1),[x,g]=h.useState(!1),[v,y]=h.useState(),m=u===void 0?void 0:n.find(R=>R.id===u),k=h.useRef(void 0),b=h.useRef(0),j=h.useRef(!1),A=()=>{const R=++b.current;p(!0),g(!1),y(void 0),s.controller.beginLogin(e,t).then(B=>{if(R!==b.current){s.controller.cancelLogin(B).catch(()=>{});return}k.current=B,d(B),p(!1)},B=>{R===b.current&&(g(B instanceof Pn),y(i4(B)),p(!1))})};h.useEffect(()=>(j.current=!0,t==="api_key"&&b.current===0&&A(),()=>{j.current=!1,queueMicrotask(()=>{if(j.current)return;b.current++;const R=k.current;k.current=void 0,R!==void 0&&s.controller.cancelLogin(R).catch(()=>{})})}),[]);const M=x&&!f&&u===void 0?n.find(R=>R.providerId===e&&R.method===t&&R.state==="running"):void 0;h.useEffect(()=>{M!==void 0&&(k.current=M.id,d(M.id),y(void 0))},[M==null?void 0:M.id]);const T=h.useRef(!1);m!==void 0&&(T.current=!0);const z=u!==void 0&&m===void 0&&T.current;h.useEffect(()=>{z&&(k.current=void 0,c())},[z]);const $=m==null?void 0:m.state;h.useEffect(()=>{$===void 0||$==="running"||(k.current=void 0,$==="succeeded"?l():$==="cancelled"&&c())},[$]);const[E,N]=h.useState(),_=()=>{const R=k.current;if(R===void 0)return c();k.current=void 0,N(void 0),s.controller.cancelLogin(R).then(c,B=>{k.current=R,N(i4(B))})};return u===void 0?t==="api_key"&&v===void 0?o.jsx(P0,{label:"Starting…"}):o.jsxs(re,{gap:3,children:[i,v===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't start the login",description:v}),o.jsxs(ke,{gap:2,wrap:"wrap",children:[o.jsx(Q,{label:t==="api_key"?"Try again":a??"Sign in",variant:"primary",isLoading:f,isDisabled:!r,onClick:A}),o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:c})]})]}):m===void 0?o.jsx(P0,{label:"Starting…"}):m.state==="failed"?o.jsx(Oe,{status:"error",title:t==="api_key"?"The key wasn't saved":"Sign-in failed",description:m.error,endContent:o.jsx(Q,{label:"Try again",size:"sm",isDisabled:!r,isLoading:f,onClick:A})}):m.state!=="running"?o.jsx(P0,{label:m.state==="succeeded"?"Saved":"Cancelled"}):o.jsxs(re,{gap:4,children:[o.jsx(jse,{events:m.events}),m.prompt===void 0?o.jsxs(re,{gap:3,children:[o.jsx(P0,{label:bse(m.events)}),o.jsx(wse,{error:E,onCancel:_})]}):o.jsx($se,{prompt:m.prompt,connected:r,onAnswer:R=>s.controller.answerLogin(m.id,m.prompt.id,R),cancelError:E,onCancel:_},m.prompt.id)]})}const bse=e=>{const t=e.findLast(n=>n.type==="progress"||n.type==="device_code");return(t==null?void 0:t.type)==="progress"?t.message:(t==null?void 0:t.type)==="device_code"?"Waiting for you to approve…":"Working…"};function P0({label:e}){return o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Vt,{size:"sm"}),o.jsx(K,{type:"supporting",role:"status",children:e})]})}function wse({error:e,onCancel:t}){return o.jsxs(ke,{gap:2,vAlign:"center",wrap:"wrap",children:[o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:t}),e===void 0?null:o.jsx(Y1,{message:e})]})}function Y1({message:e}){return o.jsx(K,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:e})}function jse({events:e}){const t=e.findLastIndex(r=>r.type==="auth_url"),n=e.findLastIndex(r=>r.type==="device_code"),s=e.map((r,i)=>({event:r,index:i})).filter(({event:r,index:i})=>r.type==="info"||r.type==="auth_url"&&i===t||r.type==="device_code"&&i===n);return s.length===0?null:o.jsx(re,{gap:4,children:s.map(({event:r,index:i})=>o.jsx(Sse,{event:r},i))})}function Sse({event:e}){switch(e.type){case"info":return o.jsxs(re,{gap:1,children:[o.jsx(K,{as:"p",type:"supporting",children:e.message}),e.links===void 0||e.links.length===0?null:o.jsx(ke,{gap:3,wrap:"wrap",children:e.links.map(t=>o.jsx(Hg,{href:t.url,isExternalLink:!0,children:t.label??t.url},t.url))})]});case"auth_url":return o.jsxs(re,{gap:2,children:[o.jsx(K,{as:"p",children:e.instructions??"Open the sign-in page and approve access."}),o.jsx(ke,{gap:2,children:o.jsx(Q,{label:"Open sign-in page",icon:o.jsx(NT,{"aria-hidden":"true",style:Kp}),size:"sm",onClick:()=>zN(e.url)})})]});case"device_code":return o.jsx(Ese,{code:e.userCode,url:e.verificationUri});case"progress":return null}}const Cse=e=>{try{const t=new URL(e);return{host:t.host,display:`${t.host}${t.pathname==="/"?"":t.pathname}`}}catch{return{host:e,display:e}}};function Ese({code:e,url:t}){const[n,s]=h.useState(!1),{host:r,display:i}=Cse(t);return o.jsxs("ol",{className:"providers-steps",children:[o.jsx("li",{children:o.jsxs(re,{gap:2,children:[o.jsx(K,{children:"Copy this code."}),o.jsxs(ke,{gap:3,vAlign:"center",wrap:"wrap",children:[o.jsx("span",{className:"providers-code",children:e}),o.jsx(Q,{label:n?"Copied":"Copy",size:"sm",icon:n?o.jsx(oa,{"aria-hidden":"true",style:Kp}):o.jsx(K3,{"aria-hidden":"true",style:Kp}),onClick:()=>{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>s(!0),()=>{})}})]})]})}),o.jsx("li",{children:o.jsxs(re,{gap:2,children:[o.jsxs(K,{children:["Enter it at ",o.jsx("span",{className:"providers-mono",children:i})]}),o.jsx(ke,{gap:2,children:o.jsx(Q,{label:`Open ${r}`,icon:o.jsx(NT,{"aria-hidden":"true",style:Kp}),size:"sm",onClick:()=>zN(t)})})]})})]})}const fw=e=>e.message.replace(/:\s*$/,"");function $se({prompt:e,connected:t,onAnswer:n,cancelError:s,onCancel:r}){var v;const[i,a]=h.useState(e.type==="select"?((v=e.options[0])==null?void 0:v.id)??"":""),[l,c]=h.useState(!1),[u,d]=h.useState(),f=e.type==="secret"||e.type==="manual_code"||e.type==="select",p=t&&!l&&(!f||i.trim()!==""),x=y=>{y.preventDefault(),p&&(c(!0),d(void 0),n(e.type==="text"?i:i.trim()).catch(m=>{d(i4(m)),c(!1)}))},g=u===void 0?void 0:{type:"error",message:u};return o.jsx("form",{onSubmit:x,autoComplete:"off",children:o.jsxs(re,{gap:3,children:[e.type==="select"?o.jsx(j5,{label:fw(e),value:i,onChange:a,isDisabled:!t,status:g,children:e.options.map(y=>o.jsx(hx,{value:y.id,label:y.label,description:y.description},y.id))}):o.jsx(st,{label:fw(e),type:e.type==="secret"?"password":"text",value:i,onChange:y=>{a(y),d(void 0)},placeholder:e.placeholder,hasAutoFocus:!0,isDisabled:!t,status:g,width:"100%"}),o.jsxs(ke,{gap:2,vAlign:"center",wrap:"wrap",children:[o.jsx(Q,{label:"Continue",variant:"primary",type:"submit",isLoading:l,isDisabled:!p}),o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:r}),s===void 0?null:o.jsx(Y1,{message:s})]})]})})}const Ase={"openai-completions":"OpenAI Chat Completions","openai-responses":"OpenAI Responses","anthropic-messages":"Anthropic Messages","google-generative-ai":"Google Gemini"},py=e=>e instanceof Error?e.message:String(e),Mse=e=>e.toLowerCase().normalize("NFKD").replace(new RegExp("\\p{M}","gu"),"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),Tse=e=>{if(e.trim()==="")return"Enter the base URL";try{const t=new URL(e.trim());if(t.protocol!=="http:"&&t.protocol!=="https:")return"Use an http:// or https:// URL"}catch{return"Enter a full URL, like http://localhost:11434/v1"}},U0=(e,t)=>[...e,...t.filter((n,s)=>!e.includes(n)&&t.indexOf(n)===s)];function zse({existing:e,providers:t,remote:n,connected:s,onDone:r,onCancel:i,onRemoved:a}){const l=e==null?void 0:e.custom,[c,u]=h.useState((e==null?void 0:e.name)??""),[d,f]=h.useState((l==null?void 0:l.api)??"openai-completions"),[p,x]=h.useState((l==null?void 0:l.baseUrl)??""),[g,v]=h.useState(!1),[y,m]=h.useState(""),[k,b]=h.useState([...(l==null?void 0:l.models)??[]]),[j,A]=h.useState([...(l==null?void 0:l.models)??[]]),[M,T]=h.useState(""),[z,$]=h.useState(!1),[E,N]=h.useState(),[_,R]=h.useState(!1),[B,D]=h.useState(),[I,O]=h.useState(!1),[L,H]=h.useState(!1),[q,U]=h.useState(!1),[X,Z]=h.useState(),ie=(e==null?void 0:e.id)??Mse(c),ae=Tse(p),xe=E!==void 0?{type:"warning",message:E}:I&&j.length===0?{type:"error",message:"Add at least one model"}:void 0,fe=c.trim()===""?I?"Name it so it's recognizable in the model picker":void 0:e!==void 0?void 0:ie===""?"Use at least one letter or digit (a–z, 0–9) in the name":t.some(F=>F.id===ie)?`“${ie}” is already a provider on this host; choose another name`:void 0,se=h.useRef({api:d,baseUrl:p,apiKey:y,checked:j});se.current={api:d,baseUrl:p,apiKey:y,checked:j};const ye=h.useRef(0),me=async F=>{if(v(!0),ae!==void 0)return;const le=++ye.current,ce=se.current,ge=()=>{const ve=se.current;return le===ye.current&&ve.api===ce.api&&ve.baseUrl===ce.baseUrl&&ve.apiKey===ce.apiKey};$(!0),N(void 0);try{const ve=await n.controller.listEndpointModels({api:d,baseUrl:p.trim(),...y===""?{}:{apiKey:y},...e===void 0?{}:{providerId:e.id}});if(!ge())return;if(ve.length===0){F&&N("The endpoint listed no models. Add model IDs by hand.");return}b(pe=>U0(pe,ve)),se.current.checked.length===0&&A(U0([],ve))}catch(ve){F&&ge()&&N(`${py(ve)} Add model IDs by hand.`)}finally{le===ye.current&&$(!1)}},P=h.useRef(!1);h.useEffect(()=>{e===void 0||!s||P.current||(P.current=!0,me(!1))},[s]);const V=()=>{const F=M.trim();F!==""&&(b(le=>U0(le,[F])),A(le=>U0(le,[F])),T(""))},Y=async F=>{if(F.preventDefault(),O(!0),v(!0),!(c.trim()===""||fe!==void 0||ae!==void 0||j.length===0)){R(!0),D(void 0);try{await n.controller.saveCustomProvider({id:ie,name:c.trim(),api:d,baseUrl:p.trim(),models:k.filter(le=>j.includes(le))},y===""?void 0:y),r()}catch(le){D(py(le)),R(!1)}}},oe=async F=>{U(!0),Z(void 0);try{await n.controller.removeCustomProvider(F),a()}catch(le){Z(py(le)),H(!1),U(!1)}};return o.jsxs("form",{onSubmit:F=>void Y(F),autoComplete:"off",children:[o.jsxs(re,{gap:3,children:[o.jsx(st,{label:"Name",value:c,onChange:u,placeholder:"Ollama on studio",hasAutoFocus:e===void 0,isDisabled:!s,width:"100%",status:fe===void 0?void 0:{type:"error",message:fe}}),o.jsx(xc,{label:"API format",options:qJ.map(F=>({value:F,label:Ase[F]})),value:d,onChange:F=>f(F),description:"Ollama, LM Studio, vLLM and most gateways speak OpenAI Chat Completions.",isDisabled:!s,width:"100%"}),o.jsx("div",{onBlur:()=>v(!0),children:o.jsx(st,{label:"Base URL",value:p,onChange:x,placeholder:"http://localhost:11434/v1",isDisabled:!s,width:"100%",status:g&&ae!==void 0?{type:"error",message:ae}:void 0})}),o.jsx(st,{label:"API key",type:"password",isOptional:!0,value:y,onChange:m,placeholder:(e==null?void 0:e.stored)===void 0?"Not needed for local servers":"Leave empty to keep the stored key",isDisabled:!s,width:"100%"}),o.jsxs("div",{className:"endpoint-models",children:[o.jsx(GC,{label:"Models",description:"Checked models appear in the model picker.",options:k,value:j,onChange:A,placeholder:z?"Fetching models…":"No models yet",hasSearch:!0,hasSelectAll:!0,isLoading:z,isDisabled:!s,width:"100%",status:xe===void 0?void 0:{type:xe.type}}),o.jsx(Bt,{label:"Fetch models",tooltip:"Fetch models from the endpoint",icon:o.jsx(Hh,{}),isLoading:z,isDisabled:!s,onClick:()=>void me(!0)}),xe===void 0?null:o.jsx("div",{className:"endpoint-models__status",children:o.jsx(jh,{type:xe.type,message:xe.message})}),o.jsx("div",{className:"endpoint-models__add",onKeyDown:F=>{F.key==="Enter"&&(F.preventDefault(),V())},children:o.jsx(st,{label:"Add model ID",isLabelHidden:!0,value:M,onChange:T,placeholder:"Add a model ID the endpoint doesn't list",isDisabled:!s,width:"100%"})}),o.jsx(Bt,{label:"Add model",icon:o.jsx(X1,{}),isDisabled:!s||M.trim()==="",onClick:V})]}),o.jsxs(ke,{gap:2,vAlign:"center",wrap:"wrap",children:[e===void 0?null:o.jsx(Q,{label:"Remove endpoint…",variant:"secondary",isDisabled:!s,onClick:()=>H(!0)}),X===void 0?null:o.jsx(Y1,{message:X}),o.jsx("div",{style:{marginInlineStart:"auto"},children:o.jsxs(ke,{gap:2,vAlign:"center",wrap:"wrap",children:[B===void 0?null:o.jsx(Y1,{message:B}),o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:i}),o.jsx(Q,{label:e===void 0?"Add endpoint":"Save changes",variant:"primary",type:"submit",isLoading:_,isDisabled:!s})]})})]})]}),e===void 0?null:o.jsx(T5,{isOpen:L,onOpenChange:H,title:`Remove ${e.name}?`,description:"Its models disappear from the model picker, and conversations using them stop.",actionLabel:"Remove endpoint",isActionLoading:q,onAction:()=>void oe(e.id)})]})}const ef=e=>{const t=/^(.*?)\s*\((.+)\)\s*$/.exec(e.name);if(t===null)return e.name;const n=t[2].replace(/\s*subscription$/i,"").trim();return n===""?t[1]:n},NN=e=>{const t=ef(e.oauth);return t===e.name?"Subscription":t},_N=e=>{const t=e.custom;if(t!==void 0)return`${t.models.length} model${t.models.length===1?"":"s"} · ${t.baseUrl}`;const n=e.stored;return n===void 0?`From the host's environment · ${e.ambient??""}`:n.kind==="api_key"?"API key":n.subscription&&e.oauth!==void 0?`${ef(e.oauth)} subscription`:"Signed in"},RN=e=>e.stored!==void 0||e.ambient!==void 0||e.custom!==void 0,Xp={at:"home"},Nse=o.jsx(Zi,{"aria-hidden":"true",style:{width:"var(--spacing-4)",height:"var(--spacing-4)",color:"var(--color-text-secondary)"}});function _se({view:e,remote:t}){var s;const n=e.connection==="connected";return e.providers!==null?o.jsx(Rse,{providers:e.providers,remote:t,connected:n}):e.auth===null?o.jsx(Oe,{status:"warning",title:"This host is too old for logins",description:"Run `pinomad upgrade` on the host."}):Ze(((s=e.host)==null?void 0:s.protocol.minor)??0,"beginLogin")?o.jsx(K,{as:"p",type:"supporting",children:"Loading…"}):o.jsxs(re,{gap:3,children:[o.jsx(Oe,{status:"warning",title:"Run `pinomad upgrade` on the host to add providers here"}),e.auth.logins.length===0?o.jsx(K,{as:"p",type:"supporting",children:"No stored logins."}):e.auth.logins.map(r=>o.jsx(Fse,{login:r,connected:n,remote:t},r.providerId))]})}function Rse({providers:e,remote:t,connected:n}){const[s,r]=h.useState(Xp),i=()=>r(Xp),a=h.useRef(null),l=h.useRef(!0);h.useEffect(()=>{var f;if(l.current){l.current=!1;return}(f=a.current)==null||f.scrollIntoView({block:"nearest"})},[s]);const c=f=>f===void 0?void 0:e.providers.find(p=>p.id===f),u=(s.at==="provider"||s.at==="custom"&&s.id!==void 0)&&c(s.id)===void 0;h.useEffect(()=>{u&&r(Xp)},[u]);let d;switch(u?"home":s.at){case"home":d=o.jsx(Ise,{providers:e.providers,connected:n,go:r});break;case"subscription":d=o.jsx(Lse,{providers:e.providers,connected:n,onBack:i,onPick:f=>r({at:"provider",id:f,method:"oauth",from:s})});break;case"key":d=o.jsx(Ose,{providers:e.providers,connected:n,onBack:i,onPick:f=>r({at:"provider",id:f,method:"api_key",from:s})});break;case"custom":{const f=s.at==="custom"?c(s.id):void 0;d=o.jsx(ub,{title:f===void 0?"Custom endpoint":`Edit ${f.name}`,onBack:i,children:o.jsx(zse,{existing:f,providers:e.providers,remote:t,connected:n,onDone:i,onCancel:i,onRemoved:i})});break}case"provider":{const f=s;d=o.jsx(Bse,{provider:c(f.id),method:f.method,providers:e,remote:t,connected:n,onBack:()=>r(f.from),onHome:i},`${f.id}:${f.method??"manage"}`);break}}return o.jsx("div",{ref:a,style:{scrollMarginBlockStart:"var(--spacing-6)"},children:d})}function ub({title:e,onBack:t,children:n}){return o.jsxs(re,{gap:4,children:[o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Bt,{label:"Back",icon:o.jsx(pm,{}),variant:"ghost",size:"sm",onClick:t}),o.jsx(Jn,{level:3,children:e})]}),n]})}function Ise({providers:e,connected:t,go:n}){const s=e.filter(RN),r=e.filter(c=>{var u;return((u=c.oauth)==null?void 0:u.subscription)===!0}).slice(0,5),i=e.filter(c=>c.apiKey!==void 0&&c.custom===void 0),a=["google","deepseek","mistral","groq","openrouter"].map(c=>i.find(u=>u.id===c)).filter(c=>c!==void 0),l=a.length>0?a:i.slice(0,5);return o.jsxs(re,{gap:6,children:[s.length>0?o.jsx(Jt,{density:"compact",header:o.jsx(K,{type:"supporting",weight:"semibold",children:"Connected"}),children:s.map(c=>{var u;return o.jsx(Je,{label:c.name,description:_N(c),startContent:o.jsx(ua,{providerId:c.id,name:c.name,baseUrl:(u=c.custom)==null?void 0:u.baseUrl}),endContent:Nse,onClick:()=>n(c.custom===void 0?{at:"provider",id:c.id,from:Xp}:{at:"custom",id:c.id})},c.id)})}):null,o.jsxs(re,{gap:2,children:[o.jsx(K,{type:"supporting",weight:"semibold",children:s.length>0?"Add another":"Connect a model provider"}),o.jsxs("div",{className:"providers-paths",children:[o.jsx(xy,{title:"Subscription",body:"Use a plan you already pay for.",foot:[...new Set(r.map(c=>ef(c.oauth).split(/[\s/]/)[0]))].join(", "),logos:r.map(c=>o.jsx(ua,{providerId:c.id,name:c.name,size:28},c.id)),disabled:!t,onClick:()=>n({at:"subscription"})}),o.jsx(xy,{title:"API key",body:"Pay per token with a key from the provider.",foot:`${i.length} providers`,logos:l.map(c=>o.jsx(ua,{providerId:c.id,name:c.name,size:28},c.id)),disabled:!t,onClick:()=>n({at:"key"})}),o.jsx(xy,{title:"Custom endpoint",body:"Your own server or gateway.",foot:"Ollama, LM Studio, vLLM, any OpenAI- or Anthropic-compatible URL",logos:[o.jsx(ua,{providerId:"ollama",name:"Ollama",size:28},"ollama"),o.jsx(ua,{providerId:"lmstudio",name:"LM Studio",size:28},"lmstudio")],disabled:!t,onClick:()=>n({at:"custom"})})]})]})]})}function xy({title:e,body:t,foot:n,logos:s,disabled:r,onClick:i}){return o.jsxs("button",{type:"button",className:"providers-tile providers-path",onClick:i,disabled:r,children:[o.jsx("span",{className:"providers-logo-stack",children:s}),o.jsxs("span",{className:"providers-path__text",children:[o.jsx("span",{className:"providers-path__title",children:e}),o.jsx("span",{className:"providers-path__body",children:t}),o.jsx("span",{className:"providers-tile__sub",children:n})]})]})}function IN({provider:e,sub:t,connectedBy:n,disabled:s,onClick:r}){var i;return o.jsxs("button",{type:"button",className:"providers-tile",onClick:r,disabled:s,children:[o.jsxs("span",{className:"providers-tile__top",children:[o.jsx(ua,{providerId:e.id,name:e.name,size:36}),((i=e.stored)==null?void 0:i.kind)===n?o.jsx(Ln,{label:"Connected",color:"green",size:"sm"}):null]}),o.jsx("span",{className:"providers-tile__name",children:e.name}),t===void 0?null:o.jsx("span",{className:"providers-tile__sub",children:t})]})}function Lse({providers:e,connected:t,onBack:n,onPick:s}){const r=e.filter(a=>a.oauth!==void 0),i=[...r.filter(a=>a.oauth.subscription),...r.filter(a=>!a.oauth.subscription)];return o.jsxs(ub,{title:"Sign in with an account",onBack:n,children:[o.jsx(K,{as:"p",type:"supporting",children:"Use a plan you already pay for. Requests count against the plan instead of per-token billing."}),o.jsx("div",{className:"providers-tiles",children:i.map(a=>o.jsx(IN,{provider:a,sub:a.oauth.subscription?NN(a):"Account sign-in",connectedBy:"oauth",disabled:!t,onClick:()=>s(a.id)},a.id))})]})}function Ose({providers:e,connected:t,onBack:n,onPick:s}){const[r,i]=h.useState(""),a=e.filter(u=>u.apiKey!==void 0&&u.custom===void 0),l=r.trim().toLowerCase(),c=a.filter(u=>l===""||`${u.name} ${u.id}`.toLowerCase().includes(l));return o.jsxs(ub,{title:"API key",onBack:n,children:[o.jsx(st,{label:"Filter providers",isLabelHidden:!0,placeholder:`Filter ${a.length} providers`,value:r,onChange:i,hasClear:!0,width:"100%"}),c.length===0?o.jsx(K,{as:"p",type:"supporting",children:`No provider matches “${r.trim()}”. If it speaks an OpenAI- or Anthropic-compatible API, add it as a custom endpoint.`}):o.jsx("div",{className:"providers-tiles",children:c.map(u=>o.jsx(IN,{provider:u,connectedBy:"api_key",disabled:!t,onClick:()=>s(u.id)},u.id))})]})}const Dse=(e,t)=>{var n;return t==="api_key"?"API key":((n=e.oauth)==null?void 0:n.subscription)===!0?NN(e):"Account sign-in"};function Bse({provider:e,method:t,providers:n,remote:s,connected:r,onBack:i,onHome:a}){var f,p;const l=((f=e.oauth)==null?void 0:f.subscription)===!0||e.apiKey===void 0?"oauth":"api_key",[c,u]=h.useState(t??(RN(e)?void 0:l)),d=t===void 0?()=>u(void 0):i;return o.jsxs(re,{gap:5,children:[o.jsxs(ke,{gap:3,vAlign:"center",children:[o.jsx(Bt,{label:"Back",icon:o.jsx(pm,{}),variant:"ghost",size:"sm",onClick:i}),o.jsx(ua,{providerId:e.id,name:e.name,size:40}),o.jsxs(re,{gap:0,style:{minInlineSize:0},children:[o.jsx(Jn,{level:3,children:e.name}),o.jsx(K,{type:"supporting",children:c===void 0?_N(e):Dse(e,c)})]})]}),c===void 0?o.jsx(Pse,{provider:e,remote:s,connected:r,onLogin:u,onRemoved:a}):o.jsxs(re,{gap:4,children:[o.jsx(qse,{provider:e,method:c}),o.jsx(kse,{providerId:e.id,method:c,logins:n.logins,remote:s,connected:r,intro:c==="oauth"?o.jsx(K,{as:"p",children:Hse(e.oauth)}):void 0,signIn:((p=e.oauth)==null?void 0:p.loginLabel)??(e.oauth===void 0?void 0:`Sign in with ${ef(e.oauth)}`),onDone:a,onCancel:d},c)]})]})}const hw=e=>e.subscription?`Use ${ef(e)} instead`:"Sign in to your account instead",Hse=e=>(e==null?void 0:e.subscription)===!0?`Use your ${ef(e)} plan. Requests count against the plan, not per-token billing.`:"Sign in to your account; there's no key to copy.";function qse({provider:e,method:t}){const n=e.stored;if(n===void 0)return e.ambient===void 0?null:o.jsx(K,{as:"p",type:"supporting",children:`${e.ambient} is set in the host's environment. A credential saved here takes precedence over it.`});const s=n.kind==="api_key"?"the stored API key":"the stored sign-in";return o.jsx(K,{as:"p",type:"supporting",children:n.kind===t?`Replaces ${s}.`:`Replaces ${s}; a provider keeps one credential.`})}function Pse({provider:e,remote:t,connected:n,onLogin:s,onRemoved:r}){const[i,a]=h.useState(!1),[l,c]=h.useState(),u=e.stored,d=e.oauth;if(u===void 0)return o.jsxs(re,{gap:3,children:[o.jsx(K,{as:"p",type:"supporting",children:`Set as ${e.ambient??"an environment variable"} where the host runs. Remove it there, or save a credential here to override it.`}),o.jsxs(ke,{gap:2,wrap:"wrap",children:[e.apiKey===void 0?null:o.jsx(Q,{label:"Save a key here",size:"sm",isDisabled:!n,onClick:()=>s("api_key")}),d===void 0?null:o.jsx(Q,{label:hw(d),variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>s("oauth")})]})]});const f=u.kind==="api_key";if(i)return o.jsxs(re,{gap:2,children:[o.jsx(K,{as:"p",type:"supporting",children:f?`Removes the key from this host. Conversations using ${e.name} models stop until you add another.`:`Signs this host out of ${e.name}. Conversations using its models stop until you sign in again.`}),o.jsxs(ke,{gap:2,vAlign:"center",wrap:"wrap",children:[o.jsx(Q,{label:f?"Remove key":"Log out",variant:"destructive",size:"sm",isDisabled:!n,clickAction:()=>t.controller.logout(e.id).then(r,g=>{c(g instanceof Error?g.message:String(g))})}),o.jsx(Q,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>a(!1)}),l===void 0?null:o.jsx(Y1,{message:l})]})]});const p=f?"oauth":"api_key",x=p==="oauth"?d!==void 0:e.apiKey!==void 0;return o.jsxs(re,{gap:3,children:[e.ambient===void 0?null:o.jsx(K,{as:"p",type:"supporting",children:`${e.ambient} is also set where the host runs; the stored credential takes precedence.`}),o.jsxs(ke,{gap:2,wrap:"wrap",children:[o.jsx(Q,{label:f?"Replace key":"Sign in again",size:"sm",isDisabled:!n,onClick:()=>s(u.kind)}),o.jsx(Q,{label:f?"Remove key…":"Log out…",variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>a(!0)})]}),x?o.jsx("div",{children:o.jsx(Q,{label:p==="api_key"||d===void 0?"Use an API key instead":hw(d),variant:"ghost",size:"sm",isDisabled:!n,onClick:()=>s(p)})}):null]})}const Use=e=>e.subscription?"Subscription connected":e.kind==="api_key"?"API key configured":"OAuth connected";function Fse({login:e,connected:t,remote:n}){const[s,r]=h.useState(!1);return o.jsxs(Tg,{padding:4,children:[o.jsxs(ke,{gap:3,vAlign:"start",children:[o.jsx(ua,{providerId:e.providerId,name:e.name}),o.jsxs(re,{gap:1,style:{flex:1,minInlineSize:0},children:[o.jsx(Jn,{level:3,children:e.name}),o.jsx(K,{as:"p",type:"supporting",children:Use(e)})]}),s?null:o.jsx(qg,{icon:o.jsx(Jd,{"aria-hidden":"true"}),label:`${e.name} actions`,size:"sm",variant:"ghost",isDisabled:!t,items:[{label:"Log out…",onClick:()=>r(!0)}]})]}),s?o.jsxs(re,{gap:2,style:{marginBlockStart:"var(--spacing-4)"},children:[o.jsx(K,{as:"p",type:"supporting",children:`Removes the stored ${e.name} credential from the host.`}),o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Q,{label:"Log out",variant:"destructive",size:"sm",isDisabled:!t,onClick:()=>void n.controller.logout(e.providerId)}),o.jsx(Q,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>r(!1)})]})]}):null]})}function LN({update:e}){if(e===void 0)return o.jsx(K,{type:"supporting",children:"Checking for updates…"});const{status:t}=e;switch(t.state){case"checking":return o.jsx(K,{type:"supporting",children:"Checking for updates…"});case"available":case"downloading":{const n=t.progressPercent===void 0?"":` ${Math.round(t.progressPercent)}%`;return o.jsx(K,{type:"supporting",children:`Downloading PiNomad ${t.availableVersion??""}…${n}`})}case"ready":return o.jsx(Q,{label:"Restart to update",variant:"primary",onClick:()=>e.install()});case"error":return o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(K,{type:"supporting",children:t.message}),o.jsx(Q,{label:"Retry",variant:"secondary",onClick:()=>e.check()})]});case"disabled":return o.jsx(K,{type:"supporting",children:t.reason??"Updates are unavailable in this build."});default:return o.jsx(K,{type:"supporting",children:`PiNomad ${t.currentVersion} is up to date; no newer release found.`})}}function Vse(){const e=Y3();return e===void 0?null:o.jsxs(re,{gap:3,children:[o.jsx(K,{children:`PiNomad ${e.status.currentVersion}`}),e.status.state==="idle"?o.jsx("div",{children:o.jsx(Q,{label:"Check for updates",variant:"secondary",onClick:()=>e.check()})}):o.jsx(LN,{update:e})]})}const og=[{id:"hosts",title:"Hosts",icon:W1,group:"device"},{id:"this-mac",title:"This Mac",icon:bQ,group:"device"},{id:"updates",title:"Updates",icon:Hh,group:"device"},{id:"providers",title:"Providers",icon:vQ,group:"host"},{id:"models",title:"Models",icon:gm,group:"host"},{id:"agents",title:"Agents",icon:Yd,group:"host"},{id:"mcp",title:"MCP",icon:jQ,group:"host"},{id:"chats",title:"Chats",icon:vk,group:"host"},{id:"devices",title:"Devices",icon:kQ,group:"host"},{id:"archived",title:"Archived",icon:lQ,group:"host"},{id:"about",title:"About",icon:yQ,group:"host"}],ON=e=>og.find(t=>t.id===e).title,Gse=e=>{var t;return((t=og.find(n=>n.id===e))==null?void 0:t.group)==="host"},pw=e=>o.jsx(e,{"aria-hidden":"true",style:{width:"var(--spacing-4)",height:"var(--spacing-4)"}});function Wse({machines:e,initialKey:t,onClose:n}){var M,T,z;const s=Ya("(max-width: 640px)"),[r,i]=h.useState(void 0),[a,l]=h.useState(t),c=e.find($=>$.key===a)??e[0],u=c==null?void 0:c.view,d=c==null?void 0:c.remote,f=u!==void 0&&d!==void 0,p=(u==null?void 0:u.connection)==="connected",x=((M=window.pinomadDesktop)==null?void 0:M.updates)!==void 0,g=((T=window.pinomadDesktop)==null?void 0:T.localHost)!==void 0,v=e.length>1,y=r??(p?"providers":"hosts"),m=((z=u==null?void 0:u.settings)==null?void 0:z.hostName)??(c==null?void 0:c.label)??"This host",k=[{title:"This device",sections:og.filter($=>$.group==="device"&&($.id!=="updates"||x)&&($.id!=="this-mac"||g))},...f||v?[{title:v?"Host":m,sections:og.filter($=>$.group==="host")}]:[]],b=!v||c===void 0?null:o.jsx(xc,{label:"Host",isLabelHidden:!0,size:"sm",variant:"ghost",placement:"below",startIcon:o.jsx(W1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),value:c.key,options:e.map($=>({value:$.key,label:$.label})),onChange:l}),j=o.jsx(O4,{padding:2,width:"calc(var(--spacing-10) * 7)",hasDivider:!0,children:o.jsx(_5,{"aria-label":"Settings sections",style:{width:"100%"},children:o.jsx(re,{gap:3,children:k.map($=>{var E;return o.jsxs(Ug,{title:$.title,children:[((E=$.sections[0])==null?void 0:E.group)==="host"?b:null,$.sections.map(N=>o.jsx(Ni,{label:N.title,icon:pw(N.icon),isSelected:N.id===y,onClick:()=>i(N.id)},N.id))]},$.title)})})})}),A=o.jsx(re,{gap:4,children:k.map($=>{var E;return o.jsxs(re,{gap:1,children:[o.jsx(K,{type:"supporting",weight:"semibold",children:$.title}),((E=$.sections[0])==null?void 0:E.group)==="host"?b:null,o.jsx(Jt,{density:"compact","aria-label":$.title,children:$.sections.map(N=>o.jsx(Je,{label:N.title,startContent:pw(N.icon),endContent:o.jsx(Zi,{"aria-hidden":"true",style:{width:"var(--spacing-4)",height:"var(--spacing-4)"}}),onClick:()=>i(N.id)},N.id))})]},$.title)})});return o.jsx(Us,{"aria-label":"Settings",isOpen:!0,onOpenChange:$=>$?void 0:n(),purpose:"form",width:"calc(var(--spacing-10) * 22)",maxHeight:"90dvh",variant:s?"fullscreen":"standard",padding:4,children:o.jsx(Cs,{padding:4,style:{height:s?"100dvh":"min(85dvh, calc(var(--spacing-10) * 17))"},header:o.jsx(Hr,{title:s&&r!==void 0?ON(r):"Settings",startContent:s&&r!==void 0?o.jsx(Bt,{label:"Back",icon:o.jsx(pm,{}),variant:"ghost",style:{marginBlock:"calc(-1 * var(--spacing-2))"},onClick:()=>i(void 0)}):void 0,onOpenChange:()=>n(),hasDivider:!0}),start:s?void 0:j,content:o.jsx(Es,{padding:s?4:6,children:s&&r===void 0?A:o.jsx(Kse,{...u===void 0?{}:{view:u},...d===void 0?{}:{remote:d},...(c==null?void 0:c.device)===void 0?{}:{device:c.device},...(c==null?void 0:c.hostKey)===void 0?{}:{hostKey:c.hostKey},connected:p,...(c==null?void 0:c.retry)===void 0?{}:{onReconnect:c.retry},section:y,showTitle:!s},Gse(y)?`host:${(c==null?void 0:c.key)??"none"}`:void 0)})})})}function Kse({view:e,remote:t,device:n,hostKey:s,connected:r,onReconnect:i,section:a,showTitle:l}){const{title:c,supporting:u,body:d}=Xse(e,t,n,s,r,i,a),f=`settings-${a}-heading`;return o.jsxs(re,{as:"section",...l?{"aria-labelledby":f}:{"aria-label":c},gap:3,children:[o.jsxs(re,{gap:2,children:[l?o.jsx(Jn,{level:2,id:f,children:c}):null,u]}),d]})}function Xse(e,t,n,s,r,i,a){if(a==="hosts")return{title:"Hosts",supporting:o.jsx(K,{as:"p",type:"supporting",children:"The hosts this device has paired with. It stays connected to all of them."}),body:o.jsx(bz,{})};if(a==="updates")return{title:"Updates",body:o.jsx(Vse,{})};if(a==="this-mac")return{title:"This Mac",supporting:o.jsx(K,{as:"p",type:"supporting",children:"Run a PiNomad host here so your other devices can use this Mac. It runs on its own: quitting the app doesn't stop it."}),body:o.jsx(_ne,{})};if(e===void 0||t===void 0)return{title:ON(a),body:o.jsx(K,{as:"p",type:"supporting",children:"This host isn't connected. Its settings appear once it is."})};switch(a){case"devices":return{title:"Devices",supporting:o.jsx(K,{as:"p",type:"supporting",children:"Paired devices can reach this host over the secure channel."}),body:o.jsx(Cne,{view:e,remote:t,self:n,...s===void 0?{}:{hostKey:s}})};case"providers":return{title:"Providers",supporting:o.jsxs(K,{as:"p",type:"supporting",children:["Credentials are stored on the host in"," ",o.jsxs("span",{style:{wordBreak:"break-all",userSelect:"all"},children:[e.session.directory,"/auth.json"]})," and shared by every paired device."]}),body:o.jsx(_se,{view:e,remote:t})};case"models":return{title:"Models",supporting:o.jsx(K,{as:"p",type:"supporting",children:"Used when a new conversation doesn't pick its own model."}),body:o.jsx(Zse,{view:e,remote:t,connected:r})};case"agents":return{title:"Agents",supporting:o.jsxs(K,{as:"p",type:"supporting",children:["Named agents the model can delegate to with ",o.jsx("code",{children:"subagent"})," — mention one with ",o.jsx("code",{children:"@name"}),"."," ","Each is a Markdown file in"," ",o.jsxs("span",{style:{wordBreak:"break-all",userSelect:"all"},children:[e.session.directory,"/agents/"]}),"; edits to those files apply immediately."]}),body:o.jsx(nre,{view:e,remote:t,connected:r})};case"mcp":return{title:"MCP",body:o.jsx(Jse,{view:e})};case"chats":return{title:"Chats",supporting:o.jsx(K,{as:"p",type:"supporting",children:"How queued messages are delivered when the agent reaches the next turn."}),body:o.jsx(Yse,{view:e,remote:t,connected:r})};case"archived":return{title:"Archived",supporting:o.jsx(K,{as:"p",type:"supporting",children:"Archived conversations are hidden from the sidebar. Restoring one brings it back with its forks and subagents; a worktree removed on archive is checked out again from its branch."}),body:o.jsx(Qse,{view:e,remote:t,connected:r})};case"about":return{title:"About",body:o.jsx(ere,{view:e,remote:t,connected:r})}}}function Zse({view:e,remote:t,connected:n}){const s=e.settings;return s===null?o.jsx(Oe,{status:"warning",title:"This host is too old for settings",description:"Run `pinomad upgrade` on the host."}):o.jsxs(ke,{gap:2,vAlign:"center",wrap:"wrap",children:[o.jsx(ob,{models:e.models,selected:{model:s.defaultModel??void 0,level:s.defaultThinkingLevel??"off"},isDisabled:!n,onModelChange:r=>void t.controller.updateSettings({defaultModel:r}),onLevelChange:r=>void t.controller.updateSettings({defaultThinkingLevel:r})}),s.custom.includes("defaultModel")||s.custom.includes("defaultThinkingLevel")?o.jsx(Q,{label:"Use pi's defaults",variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>void t.controller.updateSettings({defaultModel:null,defaultThinkingLevel:null})}):null]})}function Yse({view:e,remote:t,connected:n}){const s=e.settings;return s===null?o.jsx(Oe,{status:"warning",title:"This host is too old for settings",description:"Run `pinomad upgrade` on the host."}):o.jsxs(re,{gap:4,children:[o.jsx(xw,{title:"Steer messages",value:s.steeringMode,customized:s.custom.includes("steeringMode"),disabled:!n,onChange:r=>void t.controller.updateSettings({steeringMode:r}),onReset:()=>void t.controller.updateSettings({steeringMode:null})}),o.jsx(xw,{title:"Follow-up messages",value:s.followUpMode,customized:s.custom.includes("followUpMode"),disabled:!n,onChange:r=>void t.controller.updateSettings({followUpMode:r}),onReset:()=>void t.controller.updateSettings({followUpMode:null})})]})}function Qse({view:e,remote:t,connected:n}){const s=Bo(6e4),r=e.organized.archived;return r.length===0?o.jsx(K,{as:"p",type:"supporting",children:"No archived conversations."}):o.jsx(Jt,{density:"compact",children:r.map(({node:i,project:a})=>{const l=i.summary.title??"New conversation",c=nX(i);return o.jsx(Je,{label:l,description:[(a==null?void 0:a.name)??"Chat",c===void 0?void 0:Zd(c,s)].filter(u=>u!==void 0).join(" · "),endContent:o.jsx(Q,{label:`Restore ${l}`,icon:o.jsx(cQ,{"aria-hidden":"true"}),variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>void t.controller.archive(i.summary.id,!1),children:"Restore"})},i.summary.id)})})}function Jse({view:e}){const t=e.mcp;return t===null?o.jsx(K,{as:"p",type:"supporting",children:"Loading…"}):o.jsxs(re,{gap:3,children:[o.jsx(K,{as:"p",type:"supporting",style:{userSelect:"all"},children:t.configPath}),t.servers.length===0?o.jsx(K,{as:"p",type:"supporting",children:"No servers configured."}):o.jsx(Jt,{density:"compact",children:t.servers.map(n=>o.jsx(Je,{label:n.name,endContent:o.jsx(Ln,{label:n.state,size:"sm"})},n.name))})]})}function ere({view:e,remote:t,connected:n}){const s=e.host,r=e.settings,i=r!==null&&Yt((s==null?void 0:s.protocol.minor)??0,"hostName");return o.jsxs(re,{gap:3,children:[i?o.jsx(tre,{settings:r,remote:t,connected:n}):null,o.jsxs(Jt,{density:"compact",children:[o.jsx(Je,{label:"Host version",description:(s==null?void 0:s.version)??"Source checkout"}),o.jsx(Je,{label:"Protocol",description:s===void 0?"—":`${s.protocol.major}.${s.protocol.minor}`}),o.jsx(Je,{label:"Data directory",description:o.jsx("span",{style:{wordBreak:"break-all",userSelect:"all"},children:e.session.directory})}),o.jsx(Je,{label:"Settings file",description:o.jsxs("span",{style:{wordBreak:"break-all",userSelect:"all"},children:[e.session.directory,"/settings.json"]})})]}),o.jsx(K,{as:"p",type:"supporting",children:"Edit the settings file by hand only while the host is stopped."})]})}function tre({settings:e,remote:t,connected:n}){const s=e.hostName??"",[r,i]=h.useState(s);h.useEffect(()=>i(s),[s]);const a=VJ(r),l=n&&a!==""&&a!==s,c=()=>void t.controller.updateSettings({hostName:a});return o.jsxs(re,{gap:1,children:[o.jsx(st,{label:"Host name",value:r,onChange:i,onEnter:l?c:void 0,isDisabled:!n,description:"How paired devices name this machine. Without a custom name the hostname is used.",status:r!==""&&a===""?{type:"error",message:"The name needs at least one displayable character"}:void 0,width:"100%"}),o.jsxs(ke,{gap:2,hAlign:"end",children:[e.custom.includes("hostName")?o.jsx(Q,{label:"Use machine name",variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>void t.controller.updateSettings({hostName:null})}):null,o.jsx(Q,{label:"Save",variant:"secondary",size:"sm",isDisabled:!l,onClick:c})]})]})}function xw({title:e,value:t,customized:n,disabled:s,onChange:r,onReset:i}){return o.jsxs(re,{gap:1,children:[o.jsx(K,{children:e}),o.jsxs(ke,{gap:2,vAlign:"center",wrap:"wrap",children:[o.jsxs(A5,{className:"shrink-0",value:t,onChange:a=>r(a),label:e,size:"sm",isDisabled:s,children:[o.jsx(zu,{value:"one-at-a-time",label:"One at a time"}),o.jsx(zu,{value:"all",label:"All at once"})]}),n?o.jsx(Q,{label:"Use pi's default",variant:"secondary",size:"sm",isDisabled:s,onClick:i}):null]})]})}function nre({view:e,remote:t,connected:n}){const s=e.agents,[r,i]=h.useState(void 0);return s===null?o.jsx(Oe,{status:"warning",title:"This host is too old for named agents",description:"Run `pinomad upgrade` on the host."}):o.jsxs(re,{gap:3,children:[o.jsx(ke,{gap:2,vAlign:"center",children:o.jsx(Q,{label:"New agent",variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>i({mode:"create"})})}),s.roles.length===0&&s.problems.length===0?o.jsx(K,{as:"p",type:"supporting",children:"No named agents yet."}):null,s.roles.map(a=>o.jsx(rre,{role:a,view:e,remote:t,connected:n,onEdit:()=>i({mode:"edit",role:a})},a.name)),s.problems.map(a=>o.jsx(ire,{problem:a,remote:t,connected:n},a.file)),r===void 0?null:o.jsx(rne,{view:e,remote:t,connected:n,...r.mode==="edit"?{role:r.role}:{},onClose:()=>i(void 0)})]})}const sre=e=>{const t=e.indexOf("/");return{provider:e.slice(0,t),modelId:e.slice(t+1)}};function rre({role:e,view:t,remote:n,connected:s,onEdit:r}){const[i,a]=h.useState(!1),[l,c]=h.useState(void 0),u=e.model===void 0?void 0:xr(t.models,sre(e.model)),d=()=>{n.controller.deleteAgent(e.name).catch(f=>{c(f instanceof Error?f.message:String(f))})};return o.jsxs(Tg,{padding:4,children:[o.jsxs(ke,{gap:3,vAlign:"start",children:[o.jsxs(re,{gap:1,style:{flex:1,minInlineSize:0},children:[o.jsx(Jn,{level:3,children:e.name}),o.jsx(K,{as:"p",type:"supporting",children:e.description}),e.model===void 0&&e.thinkingLevel===void 0?null:o.jsxs(ke,{gap:1,wrap:"wrap",children:[e.model===void 0?null:o.jsx(Ln,{label:(u==null?void 0:u.name)??e.model,size:"sm"}),e.thinkingLevel===void 0?null:o.jsx(Ln,{label:Z1[e.thinkingLevel],size:"sm"}),e.model!==void 0&&u===void 0?o.jsx(Ln,{label:"Model not available",color:"orange",size:"sm"}):null]})]}),i?null:o.jsx(ke,{gap:1,vAlign:"center",children:o.jsx(qg,{icon:o.jsx(Jd,{"aria-hidden":"true"}),label:`${e.name} actions`,size:"sm",variant:"ghost",isDisabled:!s,items:[{label:"Edit…",onClick:r},{label:"Delete…",onClick:()=>a(!0)}]})})]}),i?o.jsxs(re,{gap:2,style:{marginBlockStart:"var(--spacing-4)"},children:[o.jsx(K,{as:"p",type:"supporting",children:"Conversations already using this agent keep their copy."}),o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Q,{label:"Delete",variant:"destructive",size:"sm",isDisabled:!s,onClick:d}),o.jsx(Q,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>a(!1)})]})]}):null,l===void 0?null:o.jsx(K,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:l})]})}function ire({problem:e,remote:t,connected:n}){const[s,r]=h.useState(!1),[i,a]=h.useState(void 0),l=Cz(e.file.slice(0,-3))===void 0,c=()=>{t.controller.deleteAgent(e.file.slice(0,-3)).catch(u=>{a(u instanceof Error?u.message:String(u))})};return o.jsxs(Tg,{padding:4,children:[o.jsxs(ke,{gap:3,vAlign:"start",children:[o.jsxs(re,{gap:1,style:{flex:1,minInlineSize:0},children:[o.jsx(Jn,{level:3,children:e.file}),o.jsx(ke,{gap:1,wrap:"wrap",children:o.jsx(Ln,{label:"Not loaded",color:"orange",size:"sm"})}),o.jsx(K,{as:"p",type:"supporting",children:e.reason}),o.jsx(K,{as:"p",type:"supporting",children:"Fix this file on the host."})]}),s||!l?null:o.jsx(ke,{gap:1,vAlign:"center",children:o.jsx(qg,{icon:o.jsx(Jd,{"aria-hidden":"true"}),label:`${e.file} actions`,size:"sm",variant:"ghost",isDisabled:!n,items:[{label:"Delete…",onClick:()=>r(!0)}]})})]}),s?o.jsx(re,{gap:2,style:{marginBlockStart:"var(--spacing-4)"},children:o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Q,{label:"Delete",variant:"destructive",size:"sm",isDisabled:!n,onClick:c}),o.jsx(Q,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>r(!1)})]})}):null,i===void 0?null:o.jsx(K,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:i})]})}const DN="pinomad.sidebar.open",ore=()=>typeof window>"u"||window.localStorage.getItem(DN)!=="false",are={sidebarOpen:!0,toggleSidebar:()=>{},openNav:()=>{}},BN=h.createContext(are),lre=()=>h.useContext(BN);function HN({machines:e,focusKey:t,draftingChat:n,shownId:s,onDraft:r,onOpen:i,onNewChat:a,onShowMachine:l,narrow:c,children:u}){const[d,f]=h.useState(ore),[p,x]=h.useState(!1),[g,v]=h.useState(!1),[y,m]=h.useState(!1),[k,b]=h.useState(),j=e.find(N=>N.key===t),A=W3(),M=A.reserveMacTrafficLights&&!c&&d,T=h.useCallback(()=>{f(N=>(window.localStorage.setItem(DN,String(!N)),!N))},[]),z=h.useCallback(()=>x(!0),[]),$=N=>{const _=e.find(R=>R.hostKey===N);_!==void 0&&b(R=>({key:_.key,seq:((R==null?void 0:R.seq)??0)+1}))},E=o.jsx(Xte,{machines:e,focusKey:t,draftingChat:n,shownId:s,...k===void 0?{}:{locate:k},onDraft:r,...a===void 0?{}:{onNewChat:a},onOpen:i,...l===void 0?{}:{onShowMachine:l},onSelect:()=>x(!1)});return o.jsx(Ng,{position:"topEnd",inset:{top:48},isTopLayer:!0,children:o.jsxs(BN.Provider,{value:{sidebarOpen:d,toggleSidebar:T,openNav:z},children:[o.jsx(CS,{className:"pigui-app-layout text-foreground",contentPadding:0,mobileNav:!1,variant:"elevated",sideNav:c||!d?void 0:o.jsx(_5,{resizable:{defaultWidth:260,minWidth:240,maxWidth:320,autoSaveId:"pinomad-app-shell"},header:o.jsx(Vte,{onCollapse:T,safeLeft:M?A.safeLeft:void 0}),footer:o.jsx(V9,{onOpenSettings:()=>v(!0),onOpenAccount:()=>m(!0),onLocateHost:$}),children:E}),children:u}),(c||!d)&&((j==null?void 0:j.view)===void 0||j.view.unauthorized===!0)?o.jsxs("div",{className:"pinomad-drag fixed inset-x-0 top-0 z-30 flex h-10 items-center gap-1 px-3",style:A.reserveMacTrafficLights?{paddingLeft:A.safeLeft}:void 0,children:[o.jsx(Bt,{icon:o.jsx(ng,{className:"size-4"}),label:c?"Open navigation":"Expand sidebar",size:"sm",variant:"ghost",onClick:c?z:T}),o.jsx("span",{className:"text-sm font-semibold",children:"PiNomad"})]}):null,c?o.jsxs(z5,{className:"pigui-app-layout text-foreground",isOpen:p,onOpenChange:x,header:o.jsx("span",{className:"text-sm font-semibold",children:"PiNomad"}),children:[E,o.jsx(V9,{onOpenSettings:()=>v(!0),onOpenAccount:()=>m(!0),onLocateHost:$,onSelect:()=>x(!1)})]}):null,g?o.jsx(Wse,{machines:e,...t===void 0?{}:{initialKey:t},onClose:()=>v(!1)}):null,y?o.jsx(ym,{onClose:()=>m(!1)}):null,e.map(N=>N.view===void 0?null:o.jsx(ure,{machineKey:N.key,source:e.length>1?N.label:void 0,notices:N.view.notices},N.key))]})})}function cre({narrow:e,title:t,agent:n,parentSummary:s,onBackToParent:r,showOverview:i,overviewOpen:a,onOverviewChange:l,panelControls:c}){const{sidebarOpen:u,toggleSidebar:d,openNav:f}=lre(),p=W3(),x=p.reserveMacTrafficLights&&!e&&u,g=p.reserveMacTrafficLights&&!x?p.safeLeft:void 0;return o.jsxs("div",{className:"pinomad-drag flex h-10 shrink-0 items-center gap-1 border-b border-border px-3",style:g===void 0?void 0:{paddingLeft:g},children:[e?o.jsx(Bt,{icon:o.jsx(ng,{className:"size-4"}),label:"Open navigation",size:"sm",variant:"ghost",onClick:f}):u?null:o.jsx(Bt,{icon:o.jsx(ng,{className:"size-4"}),label:"Expand sidebar",size:"sm",variant:"ghost",onClick:d}),o.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-normal",children:s===void 0?o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"truncate",children:t}),n===void 0?null:o.jsxs("span",{className:"shrink-0 text-muted",children:["@",n]})]}):o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Q,{label:Dr(s),"aria-label":`Back to ${Dr(s)}`,variant:"ghost",size:"sm",onClick:()=>r(s.id)}),o.jsx("span",{"aria-hidden":"true",className:"text-muted",children:"›"}),o.jsx("span",{className:"truncate",children:t}),n===void 0?null:o.jsxs("span",{className:"shrink-0 text-muted",children:["@",n]})]})}),i?o.jsx(Bt,{"aria-pressed":a,className:a?"bg-[var(--color-overlay-pressed)]":void 0,icon:o.jsx(aQ,{className:"size-4"}),label:"Overview",size:"sm",tooltip:a?"Hide overview":"Show overview",variant:"ghost",onClick:()=>l(!a)}):null,c]})}function ure({machineKey:e,source:t,notices:n}){const s=Xd(),r=h.useRef(void 0);return h.useEffect(()=>{var a;const i=(a=n[n.length-1])==null?void 0:a.id;if(r.current===void 0){r.current=i??-1;return}for(const l of n)l.id<=r.current||s({body:t===void 0?l.message:`${t}: ${l.message}`,type:l.level==="error"?"error":"info",uniqueID:`${e}:${l.id}`});i!==void 0&&(r.current=i)},[e,n,t,s]),null}const dre=new RegExp("\\p{White_Space}","u"),fre=/[\p{Alphabetic}\p{N}_$]/u,hre=e=>e>=48&&e<=57||e>=97&&e<=122||e===45;function qN(e,t){const n=new Set(t),s=[];for(let r=0;r<e.length;r+=1){if(e.charCodeAt(r)!==36||r>0&&!dre.test(e[r-1]))continue;let i=r+1;for(;i<e.length&&hre(e.charCodeAt(i));)i+=1;n.has(e.slice(r+1,i))&&(i<e.length&&fre.test(String.fromCodePoint(e.codePointAt(i)))||s.push({start:r,end:i}))}return s}const pre={text:"",bindings:[]},PN=(e,t,n)=>t>=0&&e.startsWith(`$${n}`,t);function o4(e,t){const n=[];let s=0;for(const r of[...t].sort((i,a)=>i.start-a.start))r.start<s||!PN(e,r.start,r.name)||(n.push(r),s=r.end);return n}function xre(e,t,n){const s=e.text;if(t===s&&n===void 0)return e;let r=0;for(;r<s.length&&r<t.length&&s[r]===t[r];)r+=1;let i=0;for(;i<s.length-r&&i<t.length-r&&s[s.length-1-i]===t[t.length-1-i];)i+=1;const a=s.length-i,l=t.length-s.length,c=[];for(const u of e.bindings){let d;u.end<=r?d=u.start:u.start>=a?d=u.start+l:(u.start<r||u.end>a)&&(d=u.start),d!==void 0&&PN(t,d,u.name)&&c.push({start:d,end:d+1+u.name.length,name:u.name})}if(n!==void 0){const u=n.length+1,d=t.length-i;let f=-1;for(let p=t.indexOf(`$${n}`);p!==-1&&p<=d;p=t.indexOf(`$${n}`,p+1))p+u>=r&&(f=p);if(f!==-1){const p={start:f,end:f+u,name:n},x=c.filter(g=>g.end<=p.start||g.start>=p.end);return{text:t,bindings:o4(t,[...x,p])}}}return{text:t,bindings:o4(t,c)}}function gre(e,t){return t.length===0?{text:e,bindings:[]}:{text:e,bindings:qN(e,t).map(({start:n,end:s})=>({start:n,end:s,name:e.slice(n+1,s)}))}}const mre=new RegExp("\\p{White_Space}","u"),yre=/[\p{Alphabetic}\p{N}_$-]/u;function UN(e){const{text:t}=e,n=[];let s="",r=0;for(const i of o4(t,e.bindings))s+=t.slice(r,i.start),s!==""&&!mre.test(s.at(-1))&&(s+=" "),s+=t.slice(i.start,i.end),r=i.end,r<t.length&&yre.test(String.fromCodePoint(t.codePointAt(r)))&&(s+=" "),n.includes(i.name)||n.push(i.name);return s+=t.slice(r),{text:s,skills:n}}function FN(e){const t=[],n=[];for(const s of e)s.type.startsWith("image/")?t.push(s):n.push(s);return{images:t,others:n}}function VN(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(e<10*1024?1:0)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function vre(e){let t="";for(let s=0;s<e.length;s+=32768)t+=String.fromCharCode(...e.subarray(s,s+32768));return btoa(t)}function kre(e){return Math.max(0,Ri-e)}function bre(e){return Kne(e.name,e.size)}class GN extends Error{constructor(){super("Upload cancelled"),this.name="UploadCancelled"}}async function wre(e,t,n,s){let r=n.attachmentId,i=n.received;if(r===void 0&&(r=await e.beginAttachment(t.name,t.size),s.onId(r)),t.size===0)return s.onProgress(0,!0),{attachmentId:r,received:0};for(;i<t.size;){if(s.isCancelled())throw new GN;const a=Math.min(i+Fne,t.size),l=vre(new Uint8Array(await t.slice(i,a).arrayBuffer())),c=await e.appendAttachment(r,i,l);if(c.complete)return s.onProgress(t.size,!0),{attachmentId:r,received:t.size};if(c.received<=i)throw new Error("Upload made no progress");i=c.received,s.onProgress(i,!1)}return s.onProgress(t.size,!0),{attachmentId:r,received:t.size}}const jre=1568;function Sre(e){const t=new Uint8Array(e);let n="";for(let s=0;s<t.length;s+=32768)n+=String.fromCharCode(...t.subarray(s,s+32768));return btoa(n)}async function Cre(e){let t;try{t=await createImageBitmap(e)}catch{throw new Error(`Couldn't read ${e.name}`)}const n=Math.min(1,jre/Math.max(t.width,t.height)),s=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),i=document.createElement("canvas");i.width=s,i.height=r;const a=i.getContext("2d");a.fillStyle="#ffffff",a.fillRect(0,0,s,r),a.drawImage(t,0,0,s,r),t.close();const l=await new Promise((d,f)=>i.toBlob(p=>p===null?f(new Error(`Couldn't read ${e.name}`)):d(p),"image/jpeg",.85)),c={data:Sre(await l.arrayBuffer()),mimeType:"image/jpeg"},u=YK([c]);if(u!==void 0)throw new Error(u);return c}const Ere=()=>({draft:pre,images:[],preparing:0,imageError:null,fileEntries:[],fileError:null,home:{kind:"chat"},checkoutMode:"worktree",agent:void 0,overrides:{},submitting:!1});var fd,hd,_t,uo,fo,xh,Pe,vt,Tl,a4;class $re{constructor(t){ue(this,Pe);ue(this,fd);ue(this,hd,new Set);ue(this,_t,Ere());ue(this,uo,0);ue(this,fo,0);ue(this,xh,1);be(this,"subscribe",t=>(S(this,hd).add(t),()=>{S(this,hd).delete(t)}));be(this,"snapshot",()=>S(this,_t));W(this,fd,t)}attachRemote(t){S(this,fd).setRemote(t)}setDraft(t){C(this,Pe,vt).call(this,{draft:t})}restoreDraft(t,n){this.setDraft(gre(t,n))}setHome(t){C(this,Pe,vt).call(this,{home:t})}setCheckoutMode(t){C(this,Pe,vt).call(this,{checkoutMode:t})}setAgent(t){C(this,Pe,vt).call(this,{agent:t,overrides:{}})}setOverrides(t){C(this,Pe,vt).call(this,{overrides:t})}beginSubmit(){return S(this,_t).submitting?!1:(C(this,Pe,vt).call(this,{submitting:!0}),!0)}endSubmit(){S(this,_t).submitting&&C(this,Pe,vt).call(this,{submitting:!1})}addImages(t,n){if(!n){C(this,Pe,vt).call(this,{imageError:"This model doesn't accept images"});return}const s=t.filter(l=>l.type.startsWith("image/")),r=Math.max(0,f1-S(this,fo)),i=s.slice(0,r);if(s.length>r?C(this,Pe,vt).call(this,{imageError:"At most 4 images per message"}):s.length<t.length?C(this,Pe,vt).call(this,{imageError:"Only images can be attached"}):C(this,Pe,vt).call(this,{imageError:null}),i.length===0)return;W(this,fo,S(this,fo)+i.length);const a=S(this,uo);C(this,Pe,vt).call(this,{preparing:S(this,_t).preparing+i.length}),Promise.all(i.map(l=>Cre(l))).then(async l=>{S(this,uo)===a&&(await bT(l),S(this,uo)===a&&C(this,Pe,vt).call(this,{images:[...S(this,_t).images,...l],preparing:S(this,_t).preparing-i.length}))},l=>{S(this,uo)===a&&(W(this,fo,S(this,fo)-i.length),C(this,Pe,vt).call(this,{imageError:l instanceof Error?l.message:String(l),preparing:S(this,_t).preparing-i.length}))})}restoreImages(t){const n=t.slice(0,f1);W(this,uo,S(this,uo)+1),W(this,fo,n.length),C(this,Pe,vt).call(this,{images:[...n],preparing:0,imageError:t.length>f1?"At most 4 images per message":null})}removeImage(t){W(this,fo,S(this,fo)-1),C(this,Pe,vt).call(this,{images:S(this,_t).images.filter((n,s)=>s!==t)})}clearImages(){W(this,uo,S(this,uo)+1),W(this,fo,0),C(this,Pe,vt).call(this,{images:[],preparing:0,imageError:null})}addFiles(t,n){if(!n){C(this,Pe,vt).call(this,{fileError:"Attaching files needs a host on protocol 5.19; run `pinomad upgrade` on the host"});return}const s=t.filter(c=>!c.type.startsWith("image/"));if(s.length===0)return;s.length<t.length&&C(this,Pe,vt).call(this,{fileError:"Images are attached from Add images…"});const r=kre(S(this,_t).fileEntries.length);if(r===0){C(this,Pe,vt).call(this,{fileError:`At most ${Ri} files per message`});return}const i=[];let a=s.length>r?`At most ${Ri} files per message`:void 0;for(const c of s.slice(0,r)){const u=bre(c);if(u!==void 0){a=`${c.name}: ${u}`;continue}i.push(c)}if(C(this,Pe,vt).call(this,{fileError:a??null}),i.length===0)return;const l=i.map(c=>({key:`file-${Cn(this,xh)._++}`,name:c.name,size:c.size,status:"uploading",received:0,file:c}));C(this,Pe,vt).call(this,{fileEntries:[...S(this,_t).fileEntries,...l]});for(const c of l)C(this,Pe,a4).call(this,c.key,c.file,void 0,0)}retryFile(t){const n=S(this,_t).fileEntries.find(s=>s.key===t);(n==null?void 0:n.file)!==void 0&&(C(this,Pe,Tl).call(this,t,{status:"uploading",error:void 0}),C(this,Pe,a4).call(this,t,n.file,n.attachmentId,n.received))}removeFile(t){C(this,Pe,vt).call(this,{fileEntries:S(this,_t).fileEntries.filter(n=>n.key!==t)})}restoreFiles(t){C(this,Pe,vt).call(this,{fileEntries:t.slice(0,Ri).map(n=>({key:`file-${Cn(this,xh)._++}`,name:n.name,size:n.size,status:"done",attachmentId:n.id,received:n.size})),fileError:t.length>Ri?`At most ${Ri} files per message`:null})}clearFiles(){C(this,Pe,vt).call(this,{fileEntries:[],fileError:null})}get uploading(){return S(this,_t).fileEntries.some(t=>t.status==="uploading")}get failed(){return S(this,_t).fileEntries.some(t=>t.status==="failed")}ids(){return S(this,_t).fileEntries.flatMap(t=>t.status==="done"&&t.attachmentId!==void 0?[t.attachmentId]:[])}details(){return S(this,_t).fileEntries.flatMap(t=>t.status==="done"&&t.attachmentId!==void 0?[{id:t.attachmentId,name:t.name,size:t.size}]:[])}}fd=new WeakMap,hd=new WeakMap,_t=new WeakMap,uo=new WeakMap,fo=new WeakMap,xh=new WeakMap,Pe=new WeakSet,vt=function(t){W(this,_t,{...S(this,_t),...t});for(const n of S(this,hd))n()},Tl=function(t,n){C(this,Pe,vt).call(this,{fileEntries:S(this,_t).fileEntries.map(s=>s.key===t?{...s,...n}:s)})},a4=async function(t,n,s,r){const i=S(this,fd).remote;if(i===void 0){C(this,Pe,Tl).call(this,t,{status:"failed",error:"Host is not connected"});return}try{await wre(i.controller,n,{...s===void 0?{}:{attachmentId:s},received:r},{onId:a=>C(this,Pe,Tl).call(this,t,{attachmentId:a}),onProgress:(a,l)=>C(this,Pe,Tl).call(this,t,{received:a,...l?{status:"done"}:{}}),isCancelled:()=>!S(this,_t).fileEntries.some(a=>a.key===t)}),S(this,_t).fileEntries.some(a=>a.key===t)&&C(this,Pe,Tl).call(this,t,{status:"done"})}catch(a){if(a instanceof GN||!S(this,_t).fileEntries.some(u=>u.key===t))return;const l=a instanceof Error?a.message:String(a),c=/expired|not found/i.test(l);C(this,Pe,Tl).call(this,t,{status:"failed",error:l,...c?{attachmentId:void 0,received:0}:{}})}};var gh,mh;class db{constructor(){ue(this,gh,new Map);ue(this,mh)}setRemote(t){W(this,mh,t)}get remote(){return S(this,mh)}slot(t){let n=S(this,gh).get(t);return n===void 0&&(n=new $re(this),S(this,gh).set(t,n)),n}}gh=new WeakMap,mh=new WeakMap;const l4="new",Are=e=>`conversation:${e}`,c4=h.createContext(void 0);function fb(e=l4){const t=h.useContext(c4),n=h.useRef(void 0);n.current??(n.current=new db);const s=t??n.current;return h.useMemo(()=>s.slot(e),[e,s])}function tf(e){return h.useSyncExternalStore(e.subscribe,e.snapshot)}const Mre=()=>()=>{},Tre=()=>{};function zre(e){return h.useSyncExternalStore((e==null?void 0:e.subscribe)??Mre,(e==null?void 0:e.snapshot)??Tre)}function vm(){const e=h.useRef(void 0);return e.current??(e.current=new db),h.useMemo(()=>e.current.slot("local"),[])}const WN="pinomad.lastNewHost";function Nre(e){const t=e.getItem(WN);return t===null||t===""?void 0:t}function _re(e,t){e.setItem(WN,t)}function Rre({hosts:e,lastNewHost:t,connected:n}){if(e.length===0)return;const s=new Set(e.map(a=>a.hostKey)),r=t!==void 0&&s.has(t)?t:void 0;if(r!==void 0&&n(r))return r;const i=e.find(a=>n(a.hostKey));return i!==void 0?i.hostKey:r??e[0].hostKey}function Ire({children:e}){var v;const{hosts:t,focus:n,focusConversation:s,focusDraft:r,focusHost:i}=As(),a=sz(),l=Ya("(max-width: 1023px)"),c=n===null?void 0:a.get(n.hostKey),u=(v=zre(c==null?void 0:c.composer.slot(l4)))==null?void 0:v.home,d=h.useMemo(()=>new Map(t.map(y=>[y.hostKey,Td(Vi(y.privateKey))])),[t]),f=Bh(t),p=t.map(y=>{const m=a.get(y.hostKey),k=(m==null?void 0:m.phase)==="ready"?m:void 0,b=d.get(y.hostKey);return{key:y.hostKey,hostKey:y.hostKey,label:f.get(y.hostKey)??y.url,...k===void 0?{}:{view:k.view,remote:k.remote},...b===void 0?{}:{device:b},...m===void 0?{}:{retry:m.retry},...nb(m)==="rejected"?{rejected:!0}:{}}}),x=(y,m)=>{var k;(k=a.get(y))==null||k.composer.slot(l4).setHome(m),r(y)},g=()=>{const y=Rre({hosts:t,lastNewHost:Nre(window.localStorage),connected:m=>ko(a.get(m))==="connected"});y!==void 0&&x(y,{kind:"chat"})};return o.jsx(HN,{machines:p,focusKey:n==null?void 0:n.hostKey,draftingChat:(n===null||n.conversationId===void 0)&&(u==null?void 0:u.kind)==="chat",shownId:n==null?void 0:n.conversationId,onDraft:x,onOpen:(y,m)=>s({hostKey:y,conversationId:m}),onNewChat:g,onShowMachine:i,narrow:l,children:e})}function Lre({value:e,onChange:t,isDisabled:n=!1}){return o.jsx("div",{className:"inline-flex max-w-full shrink-0","data-testid":"checkout-strategy-picker",children:o.jsx(Wi,{content:"Use a Git worktree; when off, work in the project folder.",isEnabled:!n,children:o.jsx(Sh,{isDisabled:n,label:"worktree",size:"sm",value:e==="worktree",onChange:s=>t(s?"worktree":"local")})})})}const Ore=150,Dre=(e,t)=>`${e}${t}`;function Bre(e){let t=0,n;const s=new Map,r=a=>s.get(a)===t,i=(a,l)=>{s.get(a)===l&&s.delete(a)};return{request(a,l,c){if(n!==void 0&&(clearTimeout(n.timer),n=void 0),r(a))return;const u=t;n={cacheKey:a,timer:setTimeout(()=>{n=void 0,!(u!==t||r(a))&&(s.set(a,u),c().then(d=>{i(a,u),u===t&&e(a,l,d.files)},()=>{i(a,u)}))},Ore)}},cancel(){t+=1,n!==void 0&&(clearTimeout(n.timer),n=void 0)}}}const gw=5e3,Hre=e=>({id:`agent:${e.name}`,label:e.name,auxiliaryData:{kind:"agent",group:"Agents",description:e.description,insert:`@${e.name} `}}),mw=e=>({id:`file:${e}`,label:e,auxiliaryData:{kind:"file",group:"Files",insert:`@./${e} `}}),yw=e=>e.auxiliaryData;function KN(e,t,n){const s=(e==null?void 0:e.roles)??[],[r,i]=h.useState({byKey:{}}),a=h.useRef(n);a.current=n;const l=h.useRef(void 0);l.current??(l.current=Bre((u,d,f)=>{i(p=>{const x=Date.now(),g={};for(const[v,y]of Object.entries(p.byKey))x-y.at<gw&&(g[v]=y);return g[u]={files:f,at:x},{byKey:g,latest:{scope:d,files:f}}})})),h.useEffect(()=>()=>{var u;return(u=l.current)==null?void 0:u.cancel()},[]),h.useEffect(()=>{var u;r.latest!==void 0&&((u=t.current)==null||u.emitInput())},[r]);const c=n!==void 0;return h.useMemo(()=>{if(s.length===0&&!c)return;const u=l.current,d={bootstrap:()=>[],search:p=>{const x=p.toLowerCase(),g=s.filter(b=>b.name.includes(x)).map(Hre),v=a.current;if(v===void 0)return g;const y=p.startsWith("./")?p.slice(2):p,m=Dre(v.key,y),k=r.byKey[m];return k!==void 0&&Date.now()-k.at<gw?[...g,...k.files.map(mw)]:(u.request(m,v.key,()=>v.list(y)),r.latest!==void 0&&r.latest.scope===v.key?[...g,...r.latest.files.map(mw)]:g)},cancel:()=>u.cancel()},f=s.length>0&&c?"Agents and files":s.length>0?"Named agents":"Files";return[{character:"@",searchSource:d,menuLabel:f,emptySearchResultsText:`No matching ${s.length>0&&c?"agents or files":s.length>0?"agents":"files"}`,renderItem:p=>{const x=yw(p),g=(x==null?void 0:x.kind)==="file"?Qd:Yd;return o.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(g,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),o.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[o.jsx("span",{className:`truncate ${(x==null?void 0:x.description)===void 0?"min-w-0":"max-w-[60%] shrink-0"}`,children:p.label}),(x==null?void 0:x.description)===void 0?null:o.jsx("span",{className:"min-w-0 truncate text-xs text-muted",children:x.description})]})]})},onSelect:p=>{var x;return((x=yw(p))==null?void 0:x.insert)??""}}]},[s,r,c])}const qre=5e3,Pre=64;var yh,ja,vh,pd,kh,ho,bh,u4;class XN{constructor(t,n,s,r={}){ue(this,bh);ue(this,yh);ue(this,ja);ue(this,vh);ue(this,pd);ue(this,kh);ue(this,ho,new Map);W(this,yh,t),W(this,ja,n),W(this,vh,s),W(this,pd,r.now??Date.now),W(this,kh,r.ttlMs??qre)}keyOf(t){return S(this,ja).call(this,t)}snapshot(t){var n;return(n=S(this,ho).get(S(this,ja).call(this,t)))==null?void 0:n.items}request(t,n=!1){const s=C(this,bh,u4).call(this,S(this,ja).call(this,t));if(s.inflight!==void 0||!n&&s.items!==void 0&&S(this,pd).call(this)-s.at<S(this,kh))return;const r=S(this,yh).call(this,t);s.inflight=r,r.then(i=>{if(s.inflight===r){s.items=S(this,vh).call(this,i),s.at=S(this,pd).call(this);for(const a of s.listeners)a()}},()=>{}).finally(()=>{s.inflight===r&&(s.inflight=void 0)})}subscribe(t,n){const s=C(this,bh,u4).call(this,S(this,ja).call(this,t)).listeners;return s.add(n),()=>s.delete(n)}}yh=new WeakMap,ja=new WeakMap,vh=new WeakMap,pd=new WeakMap,kh=new WeakMap,ho=new WeakMap,bh=new WeakSet,u4=function(t){let n=S(this,ho).get(t);if(n===void 0&&(n={at:0,listeners:new Set},S(this,ho).set(t,n),S(this,ho).size>Pre)){for(const[s,r]of S(this,ho))if(s!==t&&r.inflight===void 0&&r.listeners.size===0){S(this,ho).delete(s);break}}return n};const Ure=()=>()=>{};function ZN(e,t,n){const s=t===void 0?void 0:e.keyOf(t),r=h.useSyncExternalStore(h.useCallback(u=>s===void 0?Ure:e.subscribe(t,u),[e,s]),h.useCallback(()=>s===void 0?void 0:e.snapshot(t),[e,s])),i=h.useRef(t);i.current=t;const a=h.useRef(n);a.current=n;const l=h.useCallback((u=!1)=>{const d=i.current;a.current&&d!==void 0&&e.request(d,u)},[e]),c=h.useRef(!1);return h.useEffect(()=>{if(!n){c.current=!0;return}const u=i.current;u!==void 0&&e.request(u,c.current),c.current=!1},[e,n,s]),{items:n?r:void 0,request:l}}const Fre="pinomad-skill-mention",Vre=()=>typeof CSS<"u"&&typeof Highlight=="function"&&"highlights"in CSS;let gy;const Gre=()=>(gy??(gy=new Highlight),CSS.highlights.set(Fre,gy),gy);function Wre(e){const t=[];let n=0;const s=r=>{var i;for(const a of r.childNodes)if(a.nodeType===Node.TEXT_NODE){const l=a.data.length;t.push({node:a,start:n,end:n+l}),n+=l}else if(a instanceof HTMLElement)if(a.hasAttribute("data-astryx-token")){const l=((i=a.getAttribute("data-astryx-token-value"))==null?void 0:i.length)??0;t.push({start:n,end:n+l}),n+=l}else a.tagName==="BR"?(t.push({start:n,end:n+1}),n+=1):s(a)};return s(e),t}function Kre(e,t){if(t.length===0)return[];const n=Wre(e),s=[];for(const{start:r,end:i}of t){const a=n.find(u=>u.node!==void 0&&u.start<=r&&r<u.end),l=n.find(u=>u.node!==void 0&&u.start<i&&i<=u.end);if((a==null?void 0:a.node)===void 0||(l==null?void 0:l.node)===void 0)continue;const c=document.createRange();c.setStart(a.node,r-a.start),c.setEnd(l.node,i-l.start),s.push(c)}return s}function Xre(e,t){if(!Vre())return()=>{};const n=Kre(e,t);if(n.length===0)return()=>{};const s=Gre();for(const r of n)s.add(r);return()=>{for(const r of n)s.delete(r)}}const YN=e=>e.kind==="conversation"?`conversation:${e.conversationId}`:e.kind==="project"?`project:${e.path}:${e.checkout}`:"chat";class Zre extends XN{constructor(t,n={}){super(t,YN,s=>s.skills,n)}}const vw=new WeakMap;function QN(e){let t=vw.get(e);return t===void 0&&(t=new Zre(n=>e.controller.listSkills(n)),vw.set(e,t)),t}function Yre(e,t,n){const{items:s,request:r}=ZN(QN(e),t,n);return{skills:s,request:r}}const Qre=e=>({id:`skill:${e.name}`,label:e.name,auxiliaryData:{group:e.source==="project"?"Project":"User",description:e.description}});function Jre(e,t){const n=t.toLowerCase();return e.flatMap((s,r)=>{const i=s.name.toLowerCase(),a=i.startsWith(n)?0:i.includes(n)?1:s.description.toLowerCase().includes(n)?2:-1;return a<0?[]:[{skill:s,index:r,tier:a}]}).sort((s,r)=>s.tier-r.tier||s.index-r.index).map(({skill:s})=>Qre(s))}function JN(e,t,n,s,r){const i=QN(e),a=t===void 0?void 0:YN(t),{skills:l,request:c}=Yre(e,t,s);h.useEffect(()=>{var x;l!==void 0&&((x=n.current)==null||x.emitInput())},[l,n]);const u=h.useRef(l);u.current=l;const d=h.useRef(t);d.current=t;const f=h.useRef(r);return f.current=r,{trigger:h.useMemo(()=>!s||t===void 0?void 0:{character:"$",searchSource:{bootstrap:()=>[],search:g=>{const v=d.current;return v!==void 0&&i.request(v),Jre(u.current??[],g)},cancel:()=>{}},menuLabel:"Skills",emptySearchResultsText:"No matching skills",renderItem:g=>{const v=g.auxiliaryData;return o.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(gm,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),o.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[o.jsx("span",{className:`truncate ${(v==null?void 0:v.description)===void 0?"min-w-0":"max-w-[60%] shrink-0"}`,children:g.label}),(v==null?void 0:v.description)===void 0?null:o.jsx("span",{className:"min-w-0 truncate text-xs text-muted",children:v.description})]})]})},onSelect:g=>(f.current(g.label),`$${g.label} `)},[s,i,a,l]),request:c}}function e_(e){const t=vm(),n=e??t,s=tf(n).draft,r=h.useRef(void 0),i=h.useCallback(c=>{const u=r.current;r.current=void 0,n.setDraft(xre(n.snapshot().draft,c,u))},[n]),a=h.useCallback(c=>{r.current=c},[]),l=h.useCallback((c,u)=>{r.current=void 0,n.restoreDraft(c,u)},[n]);return{value:s.text,draft:s,setValue:i,pick:a,restore:l}}function t_(e,t){h.useEffect(()=>{var s;const n=(s=e.current)==null?void 0:s.editable();if(!(n==null||t.bindings.length===0))return Xre(n,t.bindings)},[e,t])}function eie({text:e,names:t}){const n=h.useMemo(()=>t.length===0?[]:qN(e,t),[e,t]);if(n.length===0)return o.jsx(o.Fragment,{children:e});const s=[];let r=0;return n.forEach((i,a)=>{i.start>r&&s.push(e.slice(r,i.start)),s.push(o.jsx("mark",{className:"chat-skill-mention",children:e.slice(i.start,i.end)},a)),r=i.end}),r<e.length&&s.push(e.slice(r)),o.jsx(o.Fragment,{children:s})}function n_({entry:e,onRetry:t,onRemove:n}){const s=e.size===0?100:Math.min(100,Math.round(e.received/e.size*100));return o.jsxs("div",{className:"file-chip","data-status":e.status,"data-testid":"file-attachment-chip",title:e.error??e.name,children:[o.jsx(Qd,{"aria-hidden":"true",className:"file-chip__icon"}),o.jsx("span",{className:"file-chip__name",children:e.name}),o.jsx("span",{className:"file-chip__size",children:e.status==="failed"?"Failed":e.status==="uploading"?`${s}%`:VN(e.size)}),e.status==="failed"&&t!==void 0?o.jsx("button",{type:"button",className:"file-chip__action","aria-label":`Retry ${e.name}`,title:"Retry upload",onClick:()=>t(e.key),children:o.jsx(Hh,{"aria-hidden":"true"})}):null,n===void 0?null:o.jsx("button",{type:"button",className:"file-chip__action","aria-label":`Remove ${e.name}`,title:"Remove",onClick:()=>n(e.key),children:o.jsx(AT,{"aria-hidden":"true"})}),e.status==="uploading"?o.jsx("span",{className:"file-chip__bar","aria-hidden":"true",children:o.jsx("span",{style:{width:`${s}%`}})}):null]})}function tie({attachments:e,testId:t="message-attachments"}){return e.length===0?null:o.jsx("div",{className:"flex flex-wrap justify-end gap-2","data-testid":t,children:e.map((n,s)=>o.jsxs("div",{className:"file-chip","data-status":"done",title:n.name,children:[o.jsx(Qd,{"aria-hidden":"true",className:"file-chip__icon"}),o.jsx("span",{className:"file-chip__name",children:n.name}),o.jsx("span",{className:"file-chip__size",children:VN(n.size)})]},`${n.id}:${s}`))})}function s_(e,t,n){const s=vm(),r=n??s;h.useEffect(()=>{r.attachRemote(e)},[r,e]);const i=tf(r);return{entries:i.fileEntries,get uploading(){return i.fileEntries.some(a=>a.status==="uploading")},get failed(){return i.fileEntries.some(a=>a.status==="failed")},error:i.fileError,add:a=>r.addFiles(a,t),retry:a=>r.retryFile(a),remove:a=>r.removeFile(a),restore:a=>r.restoreFiles(a),clear:()=>r.clearFiles(),ids:()=>r.ids(),details:()=>r.details()}}function hb({inputRef:e,onFiles:t,accept:n}){return o.jsx("input",{ref:e,type:"file",multiple:!0,hidden:!0,"aria-hidden":!0,tabIndex:-1,...n===void 0?{}:{accept:n},onChange:s=>{t([...s.target.files??[]]),s.target.value=""}})}function r_({inputRef:e,onFiles:t}){return o.jsx(hb,{inputRef:e,onFiles:t,accept:"image/*"})}function i_({images:e,pending:t,onRemove:n,files:s}){if(!(e.length===0&&!t&&s===void 0))return o.jsxs("div",{className:"flex flex-wrap gap-2","data-testid":"composer-attachments",children:[e.map((r,i)=>o.jsx(px,{src:Gu(r),alt:`Image ${i+1}`,onRemove:()=>n(i)},i)),t?o.jsx(px,{isLoading:!0,alt:"Preparing image"}):null,s]})}function o_(e,t){const n=vm(),s=t??n,r=tf(s),i=h.useRef(e);return i.current=e,{images:r.images,pending:r.preparing>0,error:r.imageError,add:a=>s.addImages(a,i.current),restore:a=>s.restoreImages(a),remove:a=>s.removeImage(a),clear:()=>s.clearImages()}}const kw="pinomad.draft.model";function a_(e){return e===void 0?kw:`${kw}.${e}`}function nie(e,t){try{const n=localStorage.getItem(a_(t));if(n===null)return;const s=JSON.parse(n);if(typeof s.provider=="string"&&typeof s.modelId=="string"&&typeof s.thinkingLevel=="string"&&e.some(r=>r.provider===s.provider&&r.modelId===s.modelId))return s}catch{}}function sie(e,t,n){const[s,r]=h.useState(()=>{var b;const v=nie(e.models,t),y=v!==void 0?{provider:v.provider,modelId:v.modelId}:e.defaults.model??(e.models[0]===void 0?void 0:{provider:e.models[0].provider,modelId:e.models[0].modelId}),m=((b=xr(e.models,y))==null?void 0:b.thinkingLevels)??["off"],k=(v==null?void 0:v.thinkingLevel)??e.defaults.thinkingLevel??"off";return{model:y,level:rg(m,k)}}),i=vm(),a=n??i,l=tf(a),c=l.agent,u=l.overrides,d=(v,y)=>{localStorage.setItem(a_(t),JSON.stringify({...v,thinkingLevel:y}))},f=c===void 0?void 0:sne(c,e.agents,e.models,e.defaults,u),p=tne(e.models,e.defaults,s),x=f??p,g=x.level;return{pick:x,agent:c,resolution:f,setModel:v=>{var m;if(c!==void 0){a.setOverrides({...u,model:v});return}const y=rg(((m=xr(e.models,v))==null?void 0:m.thinkingLevels)??["off"],g);r({model:v,level:y}),d(v,y)},setLevel:v=>{if(c!==void 0){a.setOverrides({...u,level:v});return}r(y=>({...y,level:v})),x.model!==void 0&&d(x.model,v)},setAgent:v=>{a.setAgent(v)}}}function l_({isDisabled:e=!1,onOpenChange:t,children:n}){return o.jsx(Rc,{button:{label:"More actions",variant:"ghost",size:"sm",isIconOnly:!0,icon:o.jsx(X1,{"aria-hidden":"true"}),isDisabled:e},hasChevron:!1,menuWidth:288,onOpenChange:t,placement:"above",children:n})}function zi({icon:e,label:t,hint:n,isDisabled:s,onClick:r}){return o.jsx(k1,{icon:o.jsx(e,{"aria-hidden":"true",className:"size-4 text-muted"}),label:o.jsxs("span",{className:"flex min-w-0 items-baseline gap-3",children:[o.jsx("span",{className:"shrink-0",children:t}),n===void 0?null:o.jsx("span",{className:"ml-auto min-w-0 truncate text-xs text-muted",children:n})]}),isDisabled:s,onClick:r})}function Ef(e){return(e==null?void 0:e.querySelector('[aria-multiline="true"]'))??null}function bw(e){var i;const t=window.getSelection();if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let s=null;for(let a=n.nextNode();a!==null;a=n.nextNode())s=a;const r=document.createRange();s===null?(r.selectNodeContents(e),r.collapse(!1)):(r.setStart(s,((i=s.textContent)==null?void 0:i.length)??0),r.collapse(!0)),t.removeAllRanges(),t.addRange(r)}function rie({disabled:e=!1,placeholder:t,inputRef:n,onSubmitRequest:s,value:r,onValueChange:i,onFiles:a,triggers:l}){const c=h.useRef(null),u=h.useRef(null),d=h.useRef(r);d.current=r,h.useEffect(()=>{if(n)return n.current={focus:()=>{var p;return(p=u.current)==null?void 0:p.focus()},focusAtEnd:()=>{const p=Ef(c.current);p&&(p.focus(),bw(p))},emitInput:()=>{const p=Ef(c.current);p!==null&&(document.activeElement===p||p.contains(document.activeElement))&&p.dispatchEvent(new Event("input",{bubbles:!0}))},editable:()=>Ef(c.current),openTrigger:p=>{requestAnimationFrame(()=>{const x=Ef(c.current);if(!x)return;x.focus(),bw(x);const g=d.current,v=g===""||/[ \n]$/.test(g)?p:` ${p}`;document.execCommand("insertText",!1,v)})}},()=>{n.current=null}},[n]),h.useEffect(()=>{const p=Ef(c.current);p&&(t?p.setAttribute("aria-placeholder",t):p.removeAttribute("aria-placeholder"),e?p.setAttribute("aria-disabled","true"):p.removeAttribute("aria-disabled"))},[t,e]);const f=p=>{p.nativeEvent.isComposing||p.nativeEvent.keyCode===229||p.key==="Enter"&&(p.shiftKey||(p.preventDefault(),s()))};return o.jsx(u5,{ref:c,className:"prompt-input__input",handleRef:u,hasHistory:!1,isDisabled:e,label:"Prompt",pasteAsToken:!1,placeholder:t,value:r,onChange:p=>i==null?void 0:i(p),onKeyDown:f,...a===void 0?{}:{onFiles:a},...l===void 0?{}:{triggers:[...l]}})}function c_({value:e,status:t="ready",className:n="",placeholder:s,inputRef:r,isDisabled:i=!1,submitDisabled:a=!1,attachments:l,hasAttachments:c,onFiles:u,triggers:d,startActions:f,endActions:p,footer:x,error:g,onSubmit:v,onStop:y,onValueChange:m,...k}){const j=(t==="streaming"||t==="submitted")&&!e.trim()&&c!==!0&&!!y,A=!a&&(!!e.trim()||c===!0),M=()=>{A&&(v==null||v())},T=$=>{u===void 0||!$.dataTransfer.types.includes("Files")||$.preventDefault()},z=$=>{if(u===void 0||!$.dataTransfer.types.includes("Files"))return;$.preventDefault();const E=[...$.dataTransfer.files];E.length>0&&u(E)};return o.jsxs("div",{className:`prompt-input ${n}`.trim(),"data-slot":"prompt-input","data-status":t,onDragOver:T,onDrop:z,...k,children:[o.jsx(gC,{elevation:"low",...l===void 0?{}:{drawer:o.jsx(mC,{children:l})},footerActions:f,input:o.jsx(rie,{disabled:i,inputRef:r,placeholder:s,value:e,onValueChange:m,onSubmitRequest:M,onFiles:u,triggers:d}),isStopShown:j&&!i,placeholder:s,sendActions:p,sendButton:o.jsx(d5,{className:"pigui-pressable",isDisabled:i||!j&&!A,onSend:M}),status:g?{type:"error",message:g}:void 0,value:e,onChange:$=>m==null?void 0:m($),onStop:y,onSubmit:M}),x?o.jsx("div",{className:"prompt-input__footer","data-slot":"prompt-input-footer",children:x}):null]})}function u_(e,t){const s=[t.agents&&t.files?"@ agent or file":t.agents?"@ agent":t.files?"@ file":void 0,t.commands?"/ command":void 0,t.skills?"$ skill":void 0].filter(r=>r!==void 0);return[e,...s].join(" · ")}function iie(e){return o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"138 138 310 270",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M 368 244 C 384 278 372 326 348 353 C 322 382 287 398 255 396 C 234 395 221 387 228 368 C 230 362 223 365 215 366 C 185 369 165 359 159 346 C 154 337 157 337 168 335 C 197 332 211 308 221 282 C 231 254 253 244 283 233 C 318 219 350 212 362 232 Z",stroke:"currentColor",strokeWidth:"13",strokeLinejoin:"round"}),o.jsxs("g",{fill:"currentColor",children:[o.jsx("path",{d:"M 214 234 C 213 199 224 176 246 165 C 267 153 282 147 296 149 C 317 151 333 172 343 194 C 300 201 254 226 214 234 Z"}),o.jsx("path",{d:"M 195 239 C 229 241 262 226 306 209 C 347 193 385 177 410 185 C 437 191 438 210 425 229 C 414 244 397 257 377 267 C 373 246 365 227 350 223 C 331 217 311 226 285 236 C 255 246 238 251 227 271 C 216 291 215 305 200 312 C 172 311 153 302 149 287 C 142 264 164 244 195 239 Z"}),o.jsx("ellipse",{cx:"304",cy:"272",rx:"9.5",ry:"15.5"}),o.jsx("ellipse",{cx:"343",cy:"269",rx:"9.5",ry:"15.5"})]})]})}function oie(e){switch(e.kind){case"agent-missing":return{label:`@${e.agent} unavailable`,title:`Agent @${e.agent} is not defined on this host${e.reason===void 0?"":` — ${e.reason}`}`};case"model-missing":return{label:`No model for @${e.agent}`,title:`Agent @${e.agent} pins no model and the host has no default`};case"model-unavailable":{const t=`${e.model.provider}/${e.model.modelId}`,n=e.source==="agent"?`@${e.agent}'s model`:e.source==="default"?"the host default":"the picked model";return{label:`${t} unavailable`,title:`${t} (${n}) is not in the host's model list`}}}}function aie({view:e,remote:t,hostKey:n,draft:s,onDraft:r,onCreated:i,connected:a,machine:l}){var V,Y,oe;const c=fb(),u=tf(c),d=e_(c),{value:f,setValue:p}=d,x=u.submitting,g=u.checkoutMode,v=F=>c.setCheckoutMode(F),y=h.useRef(null),{pick:m,setModel:k,setLevel:b,agent:j,setAgent:A,resolution:M}=sie(e,n,c),T=xr(e.models,m.model),z=(T==null?void 0:T.images)===!0,{images:$,pending:E,error:N,add:_,remove:R,clear:B}=o_(z,c),D=h.useRef(null),I=(V=e.host)==null?void 0:V.protocol.minor,O=I!==void 0&&Yt(I,"attachments")&&Ze(I,"beginAttachment"),L=s_(t,O,c),H=h.useRef(null),[q,U]=h.useState(void 0),X=F=>{const{images:le,others:ce}=FN(F);U(void 0),le.length>0&&_(le),ce.length>0&&L.add(ce)},Z=((Y=e.agents)==null?void 0:Y.roles)??[],ie=I!==void 0&&Yt(I,"agentConversations")&&(Z.length>0||j!==void 0),ae=s.kind==="project"&&I!==void 0&&Ze(I,"listFiles")?{key:`project:${s.path}:${g}`,list:F=>t.controller.listFiles({kind:"project",path:s.path,checkout:g==="local"?"project":"worktree"},F)}:void 0,xe=KN(e.agents,y,ae),fe=JN(t,s.kind==="project"?{kind:"project",path:s.path,checkout:g==="local"?"project":"worktree"}:{kind:"chat"},y,a&&I!==void 0&&Ze(I,"listSkills"),d.pick);t_(y,d.draft);const se=[...xe??[],...fe.trigger===void 0?[]:[fe.trigger]],ye=M==null?void 0:M.problem,me=j===void 0||M===void 0?void 0:M.modelFrom!=="override"&&M.levelFrom!=="override"?`from @${j}`:M.modelFrom!=="override"?`model from @${j}`:M.levelFrom!=="override"?`level from @${j}`:void 0,P=z||!a?void 0:`${(T==null?void 0:T.name)??((oe=m.model)==null?void 0:oe.modelId)??"This model"} can't see images`;return o.jsx("section",{className:"flex h-full min-h-0 flex-col items-center overflow-y-auto px-6 py-8","data-testid":"draft-home",children:o.jsxs("div",{className:"mx-auto my-auto flex w-full max-w-[44rem] flex-col items-center justify-center gap-6",children:[o.jsx(iie,{className:"size-14 text-foreground"}),o.jsx("h2",{className:"text-center text-3xl font-normal tracking-tight text-foreground max-lg:text-2xl",children:"Build something useful with PiNomad"}),o.jsxs("div",{className:"flex w-full flex-col gap-3",children:[o.jsx(r_,{inputRef:D,onFiles:_}),o.jsx(hb,{inputRef:H,onFiles:X}),L.uploading?o.jsx(K,{type:"supporting",children:"Uploading files…"}):null,o.jsx(c_,{value:f,inputRef:y,onValueChange:p,onFocus:fe.request,triggers:se.length===0?void 0:se,status:x?"submitted":"ready",onSubmit:()=>{var pe;const F=UN(d.draft),le=F.text.trim();if(le===""&&$.length===0&&L.entries.length===0||L.uploading||L.failed||E||x||ye!==void 0||!c.beginSubmit())return;hm();const ce=(pe=t.view.current().conversation)==null?void 0:pe.conversation.id,ge=$,ve=L.ids();t.controller.createConversation(s,le,{...s.kind==="project"&&g==="local"?{checkout:"project"}:{},...M===void 0?{...m.model===void 0?{}:{model:m.model},thinkingLevel:m.level}:M.send,...ge.length===0?{}:{images:ge},skills:F.skills,...ve.length===0?{}:{attachments:ve}}).then(()=>{var Ye;const Ve=(Ye=t.view.current().conversation)==null?void 0:Ye.conversation.id;Ve!==void 0&&Ve!==ce&&(d.restore("",[]),B(),L.clear(),i())}).finally(()=>c.endSubmit())},isDisabled:!a,submitDisabled:ye!==void 0||L.uploading||L.failed,placeholder:u_("Do anything with Pi",{agents:Z.length>0,files:ae!==void 0,commands:!1,skills:fe.trigger!==void 0}),attachments:i_({images:$,pending:E,onRemove:R,...L.entries.length===0?{}:{files:o.jsx(o.Fragment,{children:L.entries.map(F=>o.jsx(n_,{entry:F,onRetry:L.retry,onRemove:L.remove},F.key))})}}),hasAttachments:$.length>0||L.entries.length>0,onFiles:X,error:N??L.error??q,startActions:o.jsxs(o.Fragment,{children:[o.jsxs(l_,{isDisabled:!a,children:[o.jsx(zi,{icon:X3,label:"Add images…",hint:P??"Or paste or drop",isDisabled:!z,onClick:()=>{var F;return(F=D.current)==null?void 0:F.click()}}),O?o.jsx(zi,{icon:Qd,label:"Attach files…",hint:"Up to 10 · 10 MB each",onClick:()=>{var F;return(F=H.current)==null?void 0:F.click()}}):null,fe.trigger===void 0?null:o.jsx(zi,{icon:gm,label:"Use a skill…",hint:"Or type $",onClick:()=>{var F;return(F=y.current)==null?void 0:F.openTrigger("$")}}),Z.length===0?null:o.jsx(zi,{icon:Yd,label:"Mention an agent…",hint:"Or type @",onClick:()=>{var F;return(F=y.current)==null?void 0:F.openTrigger("@")}})]}),o.jsx(ob,{models:e.models,selected:{model:m.model,level:m.level},isDisabled:!a,agent:ie?{kind:"pick",roles:Z,value:j,onChange:A}:void 0,sourceHint:me,...ye===void 0?{}:{problem:oie(ye)},onModelChange:k,onLevelChange:b})]}),footer:o.jsxs("span",{className:"pigui-draft-footer flex w-full min-w-0 flex-wrap items-center gap-y-1",children:[l===void 0||l.options.length<2?null:o.jsx(xc,{isLabelHidden:!0,label:"Machine",placement:"below",variant:"ghost",size:"sm",value:l.value,startIcon:o.jsx(W1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),options:l.options.map(F=>({...F,icon:o.jsx(W1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"})})),onChange:F=>{F!==l.value&&l.onChange(F)}}),o.jsx(xc,{isLabelHidden:!0,label:"Project",placeholder:"No project",placement:"below",variant:"ghost",size:"sm",isDisabled:!a,value:s.kind==="chat"?"chat":s.path,startIcon:s.kind==="chat"?o.jsx(C9,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}):o.jsx(K1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),options:[{value:"chat",label:"No project",icon:o.jsx(C9,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"})},...e.organized.projects.map(F=>({value:F.project.path,label:F.project.name,icon:o.jsx(K1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"})}))],onChange:F=>r(F==="chat"?{kind:"chat"}:{kind:"project",path:F})}),s.kind==="project"?o.jsx(Lre,{value:g,onChange:v,isDisabled:!a}):null]})})]})]})})}const ww=new WeakMap;function lie(e){let t=ww.get(e);return t===void 0&&(t=new XN(n=>e.controller.listCommands(n),n=>`conversation:${n}`,n=>n.commands),ww.set(e,t)),t}const cie=e=>new RegExp("^\\/\\P{White_Space}*$","u").test(e);function uie(e,t){return e.filter(n=>n.name.startsWith(t)).map(n=>({id:`command:${n.name}`,label:n.name,auxiliaryData:n}))}function die(e,t,n,s,r){const{items:i,request:a}=ZN(lie(e),t,s),l=h.useRef(i);l.current=i;const c=h.useRef(a);c.current=a;const u=s&&cie(r),d=h.useMemo(()=>{if(!u)return;let f="";return{character:"/",searchSource:{bootstrap:()=>[],search:x=>(f=x,c.current(),uie(l.current??[],x)),cancel:()=>{}},menuLabel:"Commands",emptySearchResultsText:"No matching commands",renderItem:x=>{const g=x.auxiliaryData;return o.jsxs("span",{"aria-disabled":g.disabled===void 0?void 0:!0,className:`flex w-full min-w-0 items-center gap-2 ${g.disabled===void 0?"":"opacity-50"}`,children:[o.jsx(xm,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),o.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[o.jsxs("span",{className:"max-w-[60%] shrink-0 truncate",children:["/",g.name,g.argumentHint===void 0?null:o.jsxs("span",{className:"text-muted",children:[" ",g.argumentHint]})]}),o.jsx("span",{className:"min-w-0 truncate text-xs text-muted",children:g.disabled??g.description})]})]})},onSelect:x=>{const g=x.auxiliaryData;return g.disabled===void 0?`/${g.name} `:`/${f}`}}},[u,i]);return h.useEffect(()=>{var f;d!==void 0&&((f=n.current)==null||f.emitInput())},[d,n]),{trigger:d,commands:i,request:a}}const ag='<skill name="',jw='" location="',Sw=`">
|
|
387
|
-
References are relative to `,Cw=`
|
|
388
|
-
</skill>`,my=`
|
|
389
|
-
|
|
390
|
-
`,fie=e=>e>=48&&e<=57||e>=97&&e<=122||e===45;function hie(e,t){if(!e.startsWith(ag,t))return-1;let n=t+ag.length;const s=n;for(;n<e.length&&fie(e.charCodeAt(n));)n+=1;if(n===s||!e.startsWith(jw,n))return-1;n+=jw.length;const r=n;for(;n<e.length&&e[n]!=='"'&&e[n]!==`
|
|
391
|
-
`;)n+=1;if(n===r||!e.startsWith(Sw,n))return-1;n+=Sw.length;const i=e.indexOf(`
|
|
392
|
-
`,n);if(i-n<2||e[i-1]!=="."||e[i+1]!==`
|
|
393
|
-
`)return-1;const a=e.indexOf(Cw,i+1);return a===-1?-1:a+Cw.length}function pie(e){const t=[];let n=0;for(;;){const s=hie(e,n);if(s===-1||!e.startsWith(my,s)||s+my.length===e.length)return{text:e.slice(n),skills:t};t.push(e.slice(n+ag.length,e.indexOf('"',n+ag.length))),n=s+my.length}}function pb(e){const t=[];let n="";if(typeof e=="string")n=e;else for(const r of e){if(r.type!=="text"||typeof r.text!="string")continue;const i=nse(r.text);i!==void 0?t.push(...i):n+=r.text}const s=pie(n);return{text:s.text,skills:s.skills,attachments:t}}function xie(e){return typeof e=="string"||!Array.isArray(e)?0:e.filter(t=>t.type==="image").length}function gie(e){return typeof e=="string"||!Array.isArray(e)?[]:e.flatMap(t=>{if(t.type!=="image"||t.mimeType===void 0)return[];const n=t.mimeType;return typeof t.data=="string"&&t.data!==""?[{data:t.data,mimeType:n}]:typeof t.ref=="string"&&t.ref!==""?[{ref:t.ref,mimeType:n}]:[]})}const mie=e=>e.docs["pi.live"]??{},xb=e=>e.docs["pi.agent"]??{};function yie(e){var r;const t=mie(e),n=t.generation,s=(r=t.compactions)==null?void 0:r[0];return(n==null?void 0:n.retry)!==void 0?`Retrying (attempt ${n.attempt+1}): ${n.retry.error}`:(n==null?void 0:n.deferred)!==void 0?"Waiting for deferred response...":s!==void 0?s.retry?`Retrying ${s.reason} compaction (attempt ${s.attempt+1})...`:`Compacting (${s.reason})...`:""}function vie(e,t=[]){const s=(e.docs["pi.inbox"]??{items:[]}).items.map(a=>{const l=a.mode==="write"?void 0:pb(a.content);return{id:a.id,mode:a.mode,text:a.mode==="write"?`<${String(a.entry.kind)}>`:l.text,imageCount:a.mode==="write"?0:xie(a.content),attachmentCount:(l==null?void 0:l.attachments.length)??0,status:"sent"}}),r=new Set(s.map(a=>String(a.id))),i=t.flatMap(a=>{if(a.phase==="settled"||a.placement!=="queue")return[];if(a.conversationId!==void 0&&a.conversationId!==e.conversation.id)return[];if(a.submissionId!==void 0&&r.has(String(a.submissionId)))return[];const l=a.phase==="unknown"?"unknown":a.phase==="failed"?"failed":"sending";return[{requestId:a.requestId,mode:a.whenBusy,text:a.text,imageCount:a.images.length,attachmentCount:(a.attachmentDetails??a.attachments).length,status:l,local:{...a.error===void 0?{}:{error:a.error}}}]});return[...s,...i]}function kie(e,t){const s=(e.docs["pi.inbox"]??{items:[]}).items.find(i=>i.id===t);if(s===void 0||s.mode!=="steer"&&s.mode!=="followUp")return;const r=pb(s.content);return{text:r.text,images:gie(s.content),skills:r.skills,attachments:r.attachments}}function bie(e){const t=e.docs["pi.usage"];return t===void 0?[]:[...Object.entries(t.models),...Object.entries(t.tools)].map(([n,s])=>({key:n,input:s.input,output:s.output,cost:s.cost.total}))}const wie=new RegExp("\\p{White_Space}","u"),yy=(e,t)=>wie.test(e[t]);function jie(e,t){if(e.charCodeAt(0)!==47)return;let n=1;for(;n<e.length&&!yy(e,n);)n+=1;const s=e.slice(1,n);if(s===""||!t.some(a=>a.name===s))return;let r=n,i=e.length;for(;r<i&&yy(e,r);)r+=1;for(;i>r&&yy(e,i-1);)i-=1;return r===i?{name:s}:{name:s,args:e.slice(r,i)}}function Sie({body:e,tag:t,narrow:n=!1,isPending:s=!1,isEditDisabled:r=!1,editTooltip:i,status:a,isLocal:l=!1,onSteer:c,onRetry:u,onEdit:d,onWithdraw:f,className:p,...x}){return o.jsxs("div",{className:`chat-queued-message flex min-w-0 items-center gap-2 rounded-lg border border-border bg-surface py-1.5 pl-3 pr-2 text-sm ${n?"flex-wrap":""} ${p??""}`.trim(),"data-testid":"chat-queued-message",...x,children:[o.jsx("p",{className:"chat-queued-message__body min-w-0 flex-1 truncate","data-slot":"queued-message-body",title:e,children:e}),a===void 0?null:o.jsx("span",{className:"shrink-0","data-slot":"queued-message-status",children:a}),o.jsx("span",{className:"shrink-0 text-xs font-medium text-muted","data-slot":"queued-message-tag",children:t}),c===void 0&&u===void 0&&d===void 0&&f===void 0?null:o.jsxs("div",{className:`flex shrink-0 items-center gap-1${n?" w-full justify-end":""}`,children:[c===void 0?null:o.jsx(Q,{label:"Steer the run with this message",variant:"secondary",size:"sm",isDisabled:s,onClick:c,children:"Steer"}),u===void 0?null:o.jsx(Q,{label:"Retry this message",variant:"secondary",size:"sm",isDisabled:s,onClick:u,children:"Retry"}),d===void 0?null:o.jsx(Q,{label:l?"Edit this message":"Edit queued message",variant:"ghost",size:"sm",isDisabled:s||r,tooltip:r?i:void 0,onClick:d,children:"Edit"}),f===void 0?null:o.jsx(Q,{label:"Withdraw queued message",variant:"ghost",size:"sm",isDisabled:s,onClick:f,children:"Withdraw"})]})]})}const Cie={steer:"Steer",followUp:"Follow-up",write:"Write"};function Eie({status:e}){const t=e==="failed"?"error":e==="unknown"?"sending":e,n=o.jsx(Og,{status:t});return e!=="unknown"?n:o.jsx(F4,{locale:"en",overrides:{en:{"@astryx.chat.status.sending":"Not confirmed"}},children:n})}function $ie({items:e,canAct:t,busy:n,editDisabled:s,editTooltip:r,editRetryId:i,narrow:a,pendingIds:l,pendingRequestIds:c,onSteer:u,onRetry:d,onEdit:f,onWithdraw:p}){if(e.length===0)return null;const x=g=>{const v=[...g.imageCount===0?[]:[`${g.imageCount} ${g.imageCount===1?"image":"images"}`],...g.attachmentCount===0?[]:[`${g.attachmentCount} ${g.attachmentCount===1?"file":"files"}`]];if(v.length===0)return g.text;const y=v.join(" · ");return g.text===""?y:`${g.text} · ${y}`};return o.jsx("div",{className:"mx-auto mb-3 grid w-full gap-1.5","data-testid":"queued-message-list",children:e.map(g=>{const v=g.id===void 0,y=!v&&t&&g.mode!=="write",m=v&&(g.status==="unknown"||g.status==="failed"),k=v?g.status==="failed":y,b=v?g.requestId!==void 0&&c.has(g.requestId):l.has(g.id);return o.jsx(Sie,{"data-testid":v?"local-queued-message":"chat-queued-message",body:x(g),tag:Cie[g.mode],status:o.jsx(Eie,{status:g.status}),isLocal:v,narrow:a,isPending:b,isEditDisabled:k&&s&&(v||g.id!==i),editTooltip:s?r:void 0,onSteer:y&&g.mode==="followUp"&&n?()=>u(g):void 0,onRetry:m?()=>d(g):void 0,onEdit:k?()=>f(g):void 0,onWithdraw:y?()=>p(g):void 0},v?`local:${g.requestId}`:g.id)})})}async function Aie(e,t,n){try{return await Promise.all(e.map(s=>sY(s,t,n)))}catch{return}}function Mie({view:e,remote:t,conversation:n,busy:s,narrow:r,takeBack:i,onTakeBack:a,externalEditLocked:l=!1,onEditorStateChange:c,source:u}){var Vs,ci,hs,ui,Ur,Gs,di,Se,It,ts,he,ee,je;const d=fb(Are(n.conversation.id)),f=e_(d),{value:p,setValue:x}=f,[g,v]=h.useState(0),[y,m]=h.useState(!1),k=h.useRef(e.connection);k.current=e.connection;const b=Xd(),j=xb(n),A=yie(n),M=e.connection!=="connected",T=n.conversation.id,z=h.useRef(null),$=((Vs=e.home)==null?void 0:Vs.kind)!=="chat"&&Ze(((ci=e.host)==null?void 0:ci.protocol.minor)??0,"listFiles")?{key:`conversation:${n.conversation.id}`,list:te=>t.controller.listFiles({kind:"conversation",conversationId:n.conversation.id},te)}:void 0,E=KN(e.agents,z,$),N=JN(t,{kind:"conversation",conversationId:n.conversation.id},z,!M&&Ze(((hs=e.host)==null?void 0:hs.protocol.minor)??0,"listSkills"),f.pick);t_(z,f.draft);const _=Ze(((ui=e.host)==null?void 0:ui.protocol.minor)??0,"listCommands"),R=die(t,n.conversation.id,z,!M&&_,p),B=[...E??[],...N.trigger===void 0?[]:[N.trigger],...R.trigger===void 0?[]:[R.trigger]],D=vie(n,e.submissions??[]),I=((Ur=e.agents)==null?void 0:Ur.roles)??[],O=(Gs=ei(e.organized,n.conversation.id))==null?void 0:Gs.summary,L=O==null?void 0:O.role,H=RM(O),q=O!==void 0&&O.kind!=="subagent"&&e.agents!==null&&Ze(((di=e.host)==null?void 0:di.protocol.minor)??0,"setAgent"),U=xr(e.models,j.model),X=(U==null?void 0:U.images)===!0,{images:Z,pending:ie,error:ae,add:xe,restore:fe,remove:se,clear:ye}=o_(X,d),me=Yt(((Se=e.host)==null?void 0:Se.protocol.minor)??0,"attachments")&&Ze(((It=e.host)==null?void 0:It.protocol.minor)??0,"beginAttachment"),P=s_(t,me,d),V=h.useRef(null),[Y,oe]=h.useState(void 0),F=te=>{const{images:we,others:Ce}=FN(te);oe(void 0),we.length>0&&xe(we),Ce.length>0&&P.add(Ce)},[le,ce]=h.useState(void 0);h.useEffect(()=>ce(void 0),[p,Z.length,P.entries.length]);const ge=R.commands===void 0?"Loading…":R.commands.length===0?"None on this host":p.trim()!==""||Z.length>0||P.entries.length>0||ie||P.uploading?"Clear the message first":void 0,ve=h.useRef(null),pe=X||M?void 0:`${(U==null?void 0:U.name)??((ts=j.model)==null?void 0:ts.modelId)??"This model"} can't see images`,[Ve,Ye]=h.useState([]),ot=h.useRef(new Set),[at,Mt]=h.useState([]),Dn=h.useRef(new Set),[nt,Tt]=h.useState(!1),wn=(te,we)=>ot.current.has(te)?!1:(ot.current.add(te),Ye(Ce=>[...Ce,{id:te,kind:we}]),!0),Ms=te=>{ot.current.delete(te),Ye(we=>we.filter(Ce=>Ce.id!==te))},Fs=new Set(Ve.map(te=>te.id)),yt=Ve.some(te=>te.kind==="edit"),jt=p.trim()!==""||Z.length>0||P.entries.length>0||ie,Fe=jt||yt||y||nt||l,ai=jt?"Clear the composer to edit":Fe?"Finish the current edit first":void 0,Ts=yt||y||nt||l;h.useEffect(()=>{c==null||c({occupied:jt,locked:yt||y||nt})},[jt,yt,y,nt,c]);const Ho=!M&&Ze(((he=e.host)==null?void 0:he.protocol.minor)??0,"withdrawQueued"),zs=te=>{b({body:te instanceof Error?te.message:String(te),type:"error"})},Bn=async(te,we)=>{if(!Dn.current.has(te)){Dn.current.add(te),Mt(Ce=>[...Ce,te]);try{await we()}catch(Ce){zs(Ce)}finally{Dn.current.delete(te),Mt(Ce=>Ce.filter(He=>He!==te))}}},Pr=te=>{Bn(te,()=>t.controller.retrySubmission(te))},Yi=te=>{Fe||(Tt(!0),Bn(te,async()=>{const we=await t.controller.takeBackSubmission(te);we!==void 0&&(f.restore(we.text,we.skills),fe(we.images.flatMap(Ce=>"data"in Ce?[Ce]:[])),P.restore(we.attachmentDetails??[]),v(Ce=>Ce+1))}).finally(()=>Tt(!1)))},jn=async te=>{const we=te.id;if(!(we===void 0||!wn(we,"withdraw")))try{await t.controller.withdrawQueued(we,T)==="sent"&&b({body:"Already sent — can't withdraw"})}catch(Ce){zs(Ce)}finally{Ms(we)}},Ns=async te=>{const we=te.id;if(!(we===void 0||!wn(we,"steer")))try{await t.controller.steerQueued(we,T)}catch(Ce){zs(Ce)}finally{Ms(we)}},Sn=h.useRef(null),tn=async te=>{if(wn(te.id,"edit"))try{const we=await Aie(te.input.images,Ce=>t.controller.image(Ce),u);if(we===void 0){Sn.current=null,m(!1),b({body:"Couldn't load the original images — try again",type:"error"});return}await bT(we),te.input={...te.input,images:we},await t.controller.withdrawQueued(te.id,te.conversationId)==="withdrawn"?(f.restore(te.input.text,te.input.skills),fe(we),P.restore(te.input.attachments),Sn.current=null,m(!1),v(Ce=>Ce+1)):(Sn.current=null,m(!1),b({body:"Already sent — can't withdraw"}))}catch(we){zs(we),k.current=t.view.current().connection,k.current==="connected"?(Sn.current=null,m(!1)):m(!0)}finally{Ms(te.id)}},es=async te=>{var lt;if(te.id===void 0){te.requestId!==void 0&&Yi(te.requestId);return}const Ce=(((lt=Sn.current)==null?void 0:lt.id)===te.id&&Sn.current.conversationId===T?Sn.current.input:void 0)??kie(n,te.id);if(Ce===void 0)return;const He={conversationId:T,id:te.id,input:Ce};Sn.current=He,await tn(He)};h.useEffect(()=>{if(e.connection!=="connected"||!y)return;const te=Sn.current;te===null||te.conversationId!==T||ot.current.has(te.id)||tn(te)},[e.connection,y,T]),h.useEffect(()=>{var te;g>0&&((te=z.current)==null||te.focusAtEnd())},[g]),h.useEffect(()=>{i!==void 0&&(f.restore(i.text,i.skills),fe(i.images.flatMap(te=>"data"in te?[te]:[])),P.restore(i.attachmentDetails??[]),v(te=>te+1),a==null||a())},[i]);const li=te=>{var fi,of;const we=UN(f.draft),Ce=we.text.trim();if(Ts||P.uploading||Ce===""&&Z.length===0&&P.entries.length===0||ie)return;const He=R.commands===void 0?void 0:jie(we.text,R.commands);if(He!==void 0){const rl=(of=(fi=R.commands)==null?void 0:fi.find(Uh=>Uh.name===He.name))==null?void 0:of.disabled;if(rl!==void 0){ce(rl);return}if(Z.length>0){ce("Commands can't include images");return}if(P.entries.length>0){ce("Commands can't include files");return}t.controller.runCommand(He.name,He.args),x("");return}if(hm(),P.failed){oe("Some files failed to upload — retry or remove them");return}const lt=Z,ps=P.ids(),qo=P.details();t.controller.submit(Ce,te,{images:lt,...lt.some(rl=>!("data"in rl))?{imageViews:lt}:{},skills:we.skills,...ps.length===0?{}:{attachments:ps},...qo.length===0?{}:{attachmentDetails:qo}}),x(""),ye(),P.clear(),oe(void 0)};return o.jsxs(o.Fragment,{children:[A===""&&!P.uploading?null:o.jsx(K,{type:"supporting",children:P.uploading?"Uploading files…":A}),o.jsx($ie,{items:D,canAct:Ho,busy:s,editDisabled:Fe,editTooltip:ai,editRetryId:y?(ee=Sn.current)==null?void 0:ee.id:void 0,narrow:r,pendingIds:Fs,pendingRequestIds:new Set(at),onSteer:te=>void Ns(te),onRetry:te=>{te.requestId!==void 0&&Pr(te.requestId)},onEdit:te=>void es(te),onWithdraw:te=>void jn(te)}),o.jsx(r_,{inputRef:ve,onFiles:Ts?()=>{}:xe}),o.jsx(hb,{inputRef:V,onFiles:Ts?()=>{}:F}),o.jsx(c_,{value:p,inputRef:z,status:s?"streaming":"ready",isDisabled:M||Ts,placeholder:s?"Steer the running turn…":u_("Ask",{agents:I.length>0,files:$!==void 0,commands:_,skills:N.trigger!==void 0}),onValueChange:x,onSubmit:()=>li("steer"),onFocus:()=>{N.request(),R.request()},triggers:B.length===0?void 0:B,onStop:s?()=>void t.controller.abort():void 0,attachments:i_({images:Z,pending:ie,onRemove:se,...P.entries.length===0?{}:{files:o.jsx(o.Fragment,{children:P.entries.map(te=>o.jsx(n_,{entry:te,onRetry:P.retry,onRemove:P.remove},te.key))})}}),hasAttachments:Z.length>0||P.entries.length>0,onFiles:Ts?void 0:F,error:le??ae??P.error??Y,submitDisabled:P.uploading||P.failed,startActions:o.jsxs(o.Fragment,{children:[o.jsxs(l_,{isDisabled:M||Ts,onOpenChange:te=>{te&&R.request(!0)},children:[o.jsx(zi,{icon:X3,label:"Add images…",hint:pe??"Or paste or drop",isDisabled:!X,onClick:()=>{var te;return(te=ve.current)==null?void 0:te.click()}}),me?o.jsx(zi,{icon:Qd,label:"Attach files…",hint:"Up to 10 · 10 MB each",onClick:()=>{var te;return(te=V.current)==null?void 0:te.click()}}):null,N.trigger===void 0?null:o.jsx(zi,{icon:gm,label:"Use a skill…",hint:"Or type $",onClick:()=>{var te;return(te=z.current)==null?void 0:te.openTrigger("$")}}),I.length===0?null:o.jsx(zi,{icon:Yd,label:"Mention an agent…",hint:"Or type @",onClick:()=>{var te;return(te=z.current)==null?void 0:te.openTrigger("@")}}),_?o.jsx(zi,{icon:xm,label:"Run a command…",hint:ge??"Or type /",isDisabled:ge!==void 0,onClick:()=>{var te;return(te=z.current)==null?void 0:te.openTrigger("/")}}):o.jsx(zi,{icon:$T,label:"Compact conversation",hint:"Frees up context",onClick:()=>void t.controller.compact(void 0)})]}),o.jsx(ob,{models:e.models,selected:{model:j.model,level:j.thinkingLevel??"off"},isDisabled:M,agent:q?{kind:"pick",roles:I,value:H,onChange:te=>{t.controller.setAgent(te??null).catch(zs)}}:L===void 0?void 0:{kind:"fixed",name:L,description:(je=I.find(te=>te.name===L))==null?void 0:je.description},onModelChange:te=>void t.controller.setModel(te),onLevelChange:te=>void t.controller.setThinkingLevel(te)})]}),endActions:s&&(p.trim()!==""||Z.length>0||P.entries.length>0)?o.jsx(Q,{label:"Follow-up",variant:"ghost",size:r?"md":"sm",tooltip:"Queue after the running turn",isDisabled:M||ie||Ts||P.uploading||P.failed,onClick:()=>li("followUp")}):null})]})}function Tie(e,t){return e!==void 0&&e.conversationId===t?e.draft:void 0}function Hl(e,t,n){return e>=t&&e<=n}function d_(e){return e===8205}function zie(e){return Hl(e,55296,56319)}function Ew(e){return Hl(e,127462,127487)}function f_(e){return Hl(e,65024,65039)}function h_(e){return Hl(e,768,879)||Hl(e,6832,6911)||Hl(e,7616,7679)||Hl(e,65056,65071)}function Zp(e){return e>65535?2:1}function $w(e,t){for(;t<e.length;){const n=e.codePointAt(t);if(h_(n)||f_(n))t+=Zp(n);else break}return t}function p_(e,t){const n=e.codePointAt(t);let s=t+Zp(n);for(s=$w(e,s);s<e.length-1&&d_(e.codePointAt(s));){const r=e.codePointAt(s+1);s+=1+Zp(r),s=$w(e,s)}return Ew(n)&&s<e.length&&Ew(e.codePointAt(s))&&(s+=Zp(e.codePointAt(s))),s}function x_(e){return e>=768&&(zie(e)||h_(e)||f_(e)||d_(e))}function Nie(e,t){let n=0,s=0;for(;s<e.length;)if(s=p_(e,s),++n>=t)return!0;return!1}function _ie(e,t){let n=0,s=0;for(;s<e.length;)if(s=p_(e,s),++n>t)return!1;return!0}function Rie(e,t){if(t===0)return!0;if(e.length<t)return!1;let n=0;for(;;){if(x_(e.charCodeAt(n)))return Nie(e,t);if(++n>=t)return!0}}function Iie(e,t){if(e.length<=t)return!0;let n=0;for(;;){if(x_(e.charCodeAt(n)))return _ie(e,t);if(++n>t)return!1}}function pt(e){return Array.isArray(e)}function Br(e){return $e(typeof e,"bigint")}function Hc(e){return $e(typeof e,"boolean")}function g_(e){if(hn(e)||!Q1(e))return!1;const t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Q1(e){return $e(typeof e,"function")}function m_(e){return Number.isInteger(e)}function qh(e){return $e(e,null)}function On(e){return Number.isFinite(e)}function Lie(e){return en(e)&&!pt(e)}function en(e){return $e(typeof e,"object")&&!qh(e)}function vn(e){return $e(typeof e,"string")}function y_(e){return $e(typeof e,"symbol")}function hn(e){return $e(e,void 0)}function $e(e,t){return e===t}function v_(e,t){return e>t}function k_(e,t){return e<t}function nf(e,t){return e<=t}function km(e,t){return e>=t}function Oie(e,t){if(Br(e)||Br(t))return BigInt(e)%BigInt(t)===0n;const n=1e-10;if(!On(e)||m_(e)&&1/t%1===0)return!0;const s=e%t;return Math.min(Math.abs(s),Math.abs(s-t),Math.abs(s+t))<n}function Die(e){if(!en(e))return!1;const t=globalThis.Object.getPrototypeOf(e);return qh(t)?!1:$e(typeof t.constructor,"function")&&!($e(t.constructor,globalThis.Object)||$e(t.constructor.name,"Object"))}function b_(e){return Br(e)||Hc(e)||qh(e)||On(e)||vn(e)||hn(e)}function Bie(e,t){return Iie(e,t)}function Hie(e,t){return Rie(e,t)}function Qn(e,t,n){return e.every((s,r)=>r<t||n(s,r))}function w_(e,t){return e.some((n,s)=>t(n,s))}function qie(e,t){let n=!1;return e.forEach((s,r)=>{t(s,r)&&(n=!0)}),n}function j_(e,t){return e.reduce((n,s,r)=>t(s,r)?++n:n,0)}function bm(e){return $e(e,"__proto__")||$e(e,"constructor")||$e(e,"prototype")}function Ee(e,t){return bm(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function Cc(e){return Object.entries(e)}function kn(e){return Object.getOwnPropertyNames(e)}function Pie(e){return Object.getOwnPropertySymbols(e)}function Uie(e,t){if(!en(t))return!1;const n=kn(e);return $e(n.length,kn(t).length)&&n.every(s=>wm(e[s],t[s]))}function Fie(e,t){return pt(t)&&$e(e.length,t.length)&&e.every((n,s)=>wm(e[s],t[s]))}function wm(e,t){return pt(e)?Fie(e,t):en(e)?Uie(e,t):$e(e,t)}function Vie(e){return e instanceof Boolean}function Gie(e){return e instanceof Number}function Wie(e){return e instanceof String}function S_(e){return globalThis.ArrayBuffer.isView(e)}function C_(e){return e instanceof globalThis.RegExp}function Kie(e){return e instanceof globalThis.Date}function Xie(e){return e instanceof globalThis.Set}function Zie(e){return e instanceof globalThis.Map}const Yie={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function E_(){return Yie}function Qie(e){return Ee(e,"~kind")||Ee(e,"~unsafe")}function Jie(e){const t={};for(const n of kn(e)){if(bm(n))continue;const s=Object.getOwnPropertyDescriptor(e,n);s.value=Ec(s.value),$e(s.enumerable,!0)?t[n]=s.value:Object.defineProperty(t,n,s)}return t}function eoe(e){const t={};for(const n of kn(e))bm(n)||(t[n]=Ec(e[n]));for(const n of Pie(e))t[n]=Ec(e[n]);return t}function toe(e){return Die(e)?e:Qie(e)?Jie(e):eoe(e)}function noe(e){return e.map(t=>Ec(t))}function soe(e){return e.slice()}function roe(e){return new RegExp(e.source,e.flags)}function ioe(e){return new Map(Ec([...e.entries()]))}function ooe(e){return new Set(Ec([...e.values()]))}function Ec(e){return S_(e)?soe(e):C_(e)?roe(e):Zie(e)?ioe(e):Xie(e)?ooe(e):pt(e)?noe(e):en(e)?toe(e):e}function aoe(e){return Ec(e)}function loe(e,t){for(const n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function coe(e,t){return{...e,...t}}function sl(e,t,n={}){const s=coe(t,n),r=loe(s,e);return r}function $_(e,t,n){const s=E_(),r=aoe(e);for(const i of Object.keys(t))Object.defineProperty(r,i,{configurable:!0,writable:!0,enumerable:s.enumerableKind,value:t[i]});for(const i of Object.keys(n))Object.defineProperty(r,i,{configurable:!0,enumerable:!0,writable:!0,value:n[i]});return r}function uoe(e){return en(e)}function doe(e){return $_(e,{"~optional":!0},{})}function foe(e,t){return $_(doe(e),{},t)}function qc(e,t){return sl({"~kind":"Array"},{type:"array",items:e},t)}function hoe(e,t={}){return foe(e,t)}function bo(e){return hoe(e)}function poe(e){return uoe(e)&&Ee(e,"~optional")}function xoe(e){return kn(e).filter(t=>!poe(e[t]))}function js(e,t={}){const n=xoe(e),s=n.length>0?{required:n}:{};return sl({"~kind":"Object"},{type:"object",...s,properties:e},t)}function gb(e){return sl({"~kind":"Unknown"},{},e)}function A_(e,t){var n;return((n=t[e.length])==null?void 0:n.call(t,...e))??(()=>{throw Error("Invalid Arguments")})()}function goe(){throw new Error("Unreachable")}function moe(e){const t=new Set;let n=e;for(;n&&n!==Object.prototype;){for(const s of Reflect.ownKeys(n))s!=="constructor"&&typeof s!="symbol"&&t.add(s);n=Object.getPrototypeOf(n)}return[...t]}function yoe(e){return typeof e=="number"}var ds;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(ds||(ds={}));let $u=BigInt("14695981039346656037");const[voe,koe]=[BigInt("1099511628211"),BigInt("18446744073709551616")],boe=Array.from({length:256}).map((e,t)=>BigInt(t)),M_=new Float64Array(1),T_=new DataView(M_.buffer),z_=new Uint8Array(M_.buffer);function bn(e){$u=$u^boe[e],$u=$u*voe%koe}function woe(e){bn(ds.Array);for(const t of e)Za(t)}function joe(e){bn(ds.BigInt),T_.setBigInt64(0,e);for(const t of z_)bn(t)}function Aw(e){bn(ds.Boolean),bn(e?1:0)}function Soe(e){bn(ds.Constructor),Za(e.toString())}function Coe(e){bn(ds.Date),Za(e.getTime())}function Eoe(e){bn(ds.Function),Za(e.toString())}function $oe(e){bn(ds.Null)}function Mw(e){bn(ds.Number),T_.setFloat64(0,e,!0);for(const t of z_)bn(t)}function Aoe(e){bn(ds.Object);for(const t of moe(e).sort())Za(t),Za(e[t])}function Moe(e){bn(ds.RegExp),d4(e.toString())}const Toe=new TextEncoder;function d4(e){bn(ds.String);for(const t of Toe.encode(e))bn(t)}function zoe(e){bn(ds.Symbol),Za(e.toString())}function Noe(e){bn(ds.TypeArray);const t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)bn(t[n])}function _oe(e){return bn(ds.Undefined)}function Za(e){return S_(e)?Noe(e):Kie(e)?Coe(e):C_(e)?Moe(e):Vie(e)?Aw(e.valueOf()):Wie(e)?d4(e.valueOf()):Gie(e)?Mw(e.valueOf()):yoe(e)?Mw(e):pt(e)?woe(e):Hc(e)?Aw(e):Br(e)?joe(e):g_(e)?Soe(e):qh(e)?$oe():en(e)?Aoe(e):vn(e)?d4(e):y_(e)?zoe(e):hn(e)?_oe():Q1(e)?Eoe(e):goe()}function Roe(e){return $u=BigInt("14695981039346656037"),Za(e),$u}function Ioe(e){return Roe(e).toString(16).padStart(16,"0")}function Loe(e){return sl({"~kind":"Boolean"},{type:"boolean"},e)}class Ooe extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}}function Doe(e){return Br(e)?"bigint":Hc(e)?"boolean":On(e)?"number":vn(e)?"string":(()=>{throw new Ooe(e)})()}function cr(e,t){return sl({"~kind":"Literal"},{type:Doe(e),const:e},t)}function Ku(e){return sl({"~kind":"Number"},{type:"number"},e)}function cs(e){return sl({"~kind":"String"},{type:"string"},e)}function jm(e,t={}){return sl({"~kind":"Union"},{anyOf:e},t)}function f4(e,t){return Array.from({length:t-e+1},(n,s)=>String.fromCharCode(e+s))}[...f4(97,122),...f4(65,90)];const Boe="0",Hoe=f4(49,57);[...Hoe];function qoe(e){return Ee(e,"~refine")&&pt(e["~refine"])&&Qn(e["~refine"],0,t=>en(t)&&Ee(t,"check")&&Ee(t,"error")&&Q1(t.check)&&Q1(t.error))}function mr(e){return en(e)&&!pt(e)}function lg(e){return Hc(e)}function Gt(e){return mr(e)||lg(e)}function Poe(e){return Ee(e,"additionalItems")&&Gt(e.additionalItems)}function Uoe(e){return Ee(e,"additionalProperties")&&Gt(e.additionalProperties)}function Foe(e){return Ee(e,"allOf")&&pt(e.allOf)&&e.allOf.every(t=>Gt(t))}function h4(e){return Ee(e,"$anchor")&&vn(e.$anchor)}function Voe(e){return Ee(e,"anyOf")&&pt(e.anyOf)&&e.anyOf.every(t=>Gt(t))}function Goe(e){return Ee(e,"const")}function mb(e){return Ee(e,"contains")&&Gt(e.contains)}function Woe(e){return Ee(e,"dependencies")&&en(e.dependencies)&&Object.values(e.dependencies).every(t=>Gt(t)||pt(t)&&t.every(n=>vn(n)))}function Koe(e){return Ee(e,"dependentRequired")&&en(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>pt(t)&&t.every(n=>vn(n)))}function Xoe(e){return Ee(e,"dependentSchemas")&&en(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>Gt(t))}function $c(e){return Ee(e,"$dynamicAnchor")&&vn(e.$dynamicAnchor)}function Zoe(e){return Ee(e,"$dynamicRef")&&vn(e.$dynamicRef)}function Yoe(e){return Ee(e,"else")&&Gt(e.else)}function Qoe(e){return Ee(e,"enum")&&pt(e.enum)}function Joe(e){return Ee(e,"exclusiveMaximum")&&(On(e.exclusiveMaximum)||Br(e.exclusiveMaximum))}function eae(e){return Ee(e,"exclusiveMinimum")&&(On(e.exclusiveMinimum)||Br(e.exclusiveMinimum))}function tae(e){return Ee(e,"format")&&vn(e.format)}function ii(e){return Ee(e,"$id")&&vn(e.$id)}function nae(e){return Ee(e,"if")&&Gt(e.if)}function yb(e){return Ee(e,"items")&&(Gt(e.items)||pt(e.items)&&e.items.every(t=>Gt(t)))}function sae(e){return yb(e)&&pt(e.items)}function rae(e){return Ee(e,"maximum")&&(On(e.maximum)||Br(e.maximum))}function iae(e){return Ee(e,"maxContains")&&On(e.maxContains)}function oae(e){return Ee(e,"maxItems")&&On(e.maxItems)}function aae(e){return Ee(e,"maxLength")&&On(e.maxLength)}function lae(e){return Ee(e,"maxProperties")&&On(e.maxProperties)}function cae(e){return Ee(e,"minimum")&&(On(e.minimum)||Br(e.minimum))}function N_(e){return Ee(e,"minContains")&&On(e.minContains)}function uae(e){return Ee(e,"minItems")&&On(e.minItems)}function dae(e){return Ee(e,"minLength")&&On(e.minLength)}function fae(e){return Ee(e,"minProperties")&&On(e.minProperties)}function hae(e){return Ee(e,"multipleOf")&&(On(e.multipleOf)||Br(e.multipleOf))}function pae(e){return Ee(e,"not")&&Gt(e.not)}function xae(e){return Ee(e,"oneOf")&&pt(e.oneOf)&&e.oneOf.every(t=>Gt(t))}function gae(e){return Ee(e,"pattern")&&(vn(e.pattern)||e.pattern instanceof RegExp)}function __(e){return Ee(e,"patternProperties")&&en(e.patternProperties)&&Object.values(e.patternProperties).every(t=>Gt(t))}function R_(e){return Ee(e,"prefixItems")&&pt(e.prefixItems)&&e.prefixItems.every(t=>Gt(t))}function I_(e){return Ee(e,"properties")&&en(e.properties)&&Object.values(e.properties).every(t=>Gt(t))}function mae(e){return Ee(e,"propertyNames")&&(en(e.propertyNames)||Gt(e.propertyNames))}function yae(e){return Ee(e,"$recursiveAnchor")&&Hc(e.$recursiveAnchor)}function p4(e){return yae(e)&&$e(e.$recursiveAnchor,!0)}function vae(e){return Ee(e,"$recursiveRef")&&vn(e.$recursiveRef)}function kae(e){return Ee(e,"$ref")&&vn(e.$ref)}function L_(e){return Ee(e,"required")&&pt(e.required)&&e.required.every(t=>vn(t))}function bae(e){return Ee(e,"then")&&Gt(e.then)}function wae(e){return Ee(e,"type")&&(vn(e.type)||pt(e.type)&&e.type.every(t=>vn(t)))}function jae(e){return Ee(e,"uniqueItems")&&Hc(e.uniqueItems)}function Sae(e){return Ee(e,"unevaluatedItems")&&Gt(e.unevaluatedItems)}function Cae(e){return Ee(e,"unevaluatedProperties")&&Gt(e.unevaluatedProperties)}class sf{constructor(){const t=new Set,n=new Set;this.stack=[{indices:t,keys:n}]}Push(){const t=new Set,n=new Set;return this.stack.push({indices:t,keys:n}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(const n of t)n.GetIndices().forEach(s=>this.GetIndices().add(s)),n.GetKeys().forEach(s=>this.GetKeys().add(s));return!0}}function Eae(e,t,n,s){return Qn(n["~refine"],0,(r,i)=>r.check(s))}function $ae(e){return yb(e)&&pt(e.items)}function Aae(e,t,n,s){return $ae(n)?Qn(s,0,(i,a)=>k_(a,n.items.length)||Pc(e,t,n.additionalItems,i)&&t.AddIndex(a)):!0}function vb(e){return new RegExp(e,"u")}function Mae(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Tae(e){const t=[];return __(e)&&t.push(...kn(e.patternProperties)),I_(e)&&t.push(...kn(e.properties).map(Mae)),$e(t.length,0)?"(?!)":`(${t.join("|")})`}function zae(e,t,n,s){const r=vb(Tae(n));return Qn(kn(s),0,(a,l)=>r.test(a)||Pc(e,t,n.additionalProperties,s[a])&&t.AddKey(a))}function Nae(e,t,n,s){const r=n.allOf.reduce((i,a)=>{const l=new sf;return pn(e,l,a,s)?[...i,l]:i},[]);return $e(r.length,n.allOf.length)&&t.Merge(r)}function _ae(e,t,n,s){const r=n.anyOf.reduce((i,a)=>{const l=new sf;return pn(e,l,a,s)?[...i,l]:i},[]);return v_(r.length,0)&&t.Merge(r)}function Rae(e,t,n,s){return n}function Iae(e,t,n,s){return b_(n.const)?$e(s,n.const):wm(s,n.const)}function Lae(e){return!(N_(e)&&$e(e.minContains,0))}function Oae(e,t,n,s){return Lae(n)?!$e(s.length,0)&&qie(s,(r,i)=>pn(e,t,n.contains,r)&&t.AddIndex(i)):!0}function Dae(e,t,n,s){const r=$e(kn(s).length,0),i=Qn(Cc(n.dependencies),0,([a,l])=>!Ee(s,a)||(pt(l)?l.every(c=>Ee(s,c)):pn(e,t,l,s)));return r||i}function Bae(e,t,n,s){const r=$e(kn(s).length,0),i=Qn(Cc(n.dependentRequired),0,([a,l])=>!Ee(s,a)||l.every(c=>Ee(s,c)));return r||i}function Hae(e,t,n,s){const r=$e(kn(s).length,0),i=Qn(Cc(n.dependentSchemas),0,([a,l])=>!Ee(s,a)||pn(e,t,l,s));return r||i}function qae(e,t,n,s){const r=e.DynamicRef(n)??!1;return Gt(r)&&pn(e,t,r,s)}function Pae(e,t,n,s){return w_(n.enum,r=>b_(r)?$e(s,r):wm(s,r))}function Uae(e,t,n,s){return k_(s,n.exclusiveMaximum)}function Fae(e,t,n,s){return v_(s,n.exclusiveMinimum)}const Vae=[0,31,28,31,30,31,30,31,31,30,31,30,31],Gae=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Wae(e){return e%4===0&&(e%100!==0||e%400===0)}function O_(e){const t=Gae.exec(e);if(!t)return!1;const n=+t[1],s=+t[2],r=+t[3];return s>=1&&s<=12&&r>=1&&r<=(s===2&&Wae(n)?29:Vae[s])}const Kae=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function D_(e,t=!0){const n=Kae.exec(e);if(!n||t&&!n[4]&&!n[5])return!1;const s=+n[1],r=+n[2],i=+n[3];if(s>23||r>59||i>60)return!1;if(n[5]){const d=+n[6],f=+n[7];if(d>23||f>59)return!1}if(i<60)return!0;const a=n[5]==="-"?-1:1,l=+(n[6]||0),c=+(n[7]||0);return((s*60+r-a*(l*60+c))%1440+1440)%1440===1439}function Xae(e){const t=e.split(/T/i);return t.length===2&&O_(t[0])&&D_(t[1])}const Zae=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function Yae(e){return Zae.test(e)}const Qae=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function Jae(e){return Qae.test(e)}const ele=new RegExp("^(?!-).*(?<!-)$"),tle=/^(?!..--)/,nle=/^[a-zA-Z0-9-]*$/,kb=/[^\p{ASCII}]/u,sle=/[0-9]/,rle=/[\u{0660}-\u{0669}]/u,ile=/[\u{06f0}-\u{06f9}]/u,ole=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,ale=/[\u{002d}\u{002b}]/u,B_=new RegExp("\\p{Mn}","u"),lle=new RegExp("\\p{Mc}","u"),cle=/[\p{Mn}\p{Mc}\p{Me}]/u,H_=new RegExp("\\p{L}","u"),ule=new RegExp("\\p{Nd}","u"),dle=new RegExp("\\p{Script=Greek}","u"),q_=new RegExp("\\p{Script=Hebrew}","u"),fle=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,hle=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,Tw=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,ple=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,xle=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,gle=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,mle=new RegExp([sle,ile].map(e=>e.source).join("|"),"u"),yle=new RegExp([H_,ale,ole,ule,B_,lle,xle,gle].map(e=>e.source).join("|"),"u");function vle(e){return ele.test(e)&&tle.test(e)&&nle.test(e)}const ni=36,m1=1,J1=26,kle=38,ble=700,P_=72,U_=128;function vy(){throw null}function F_(e){return e.toLowerCase().startsWith("xn--")}function V_(e,t,n){e=n?Math.floor(e/ble):e>>1,e+=Math.floor(e/t);let s=0;for(;e>(ni-m1)*J1>>1;)e=Math.floor(e/(ni-m1)),s+=ni;return s+Math.floor((ni-m1+1)*e/(e+kle))}function G_(e){const t=[];let n=U_,s=0,r=P_;const i=e.lastIndexOf("-");if(i>0)for(let l=0;l<i;l++){const c=e.charCodeAt(l);c>=128&&vy(),t.push(c)}let a=i<0?0:i+1;for(;a<e.length;){const l=s;let c=1,u=ni;for(;;){a>=e.length&&vy();const f=e.charCodeAt(a++);let p;f>=97&&f<=122?p=f-97:f>=48&&f<=57?p=f-48+26:vy(),s+=p*c;const x=u<=r?m1:u>=r+J1?J1:u-r;if(p<x)break;c*=ni-x,u+=ni}const d=t.length+1;r=V_(s-l,d,l===0),n+=Math.floor(s/d),s%=d,t.splice(s,0,n),s++}return String.fromCodePoint(...t)}function zw(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}const wle=new RegExp(kb.source,"gu");function jle(e){const t=e.replace(wle,""),n=t.length,s=n>0?[t,"-"]:[],r=Array.from(e,u=>u.codePointAt(0));let i=U_,a=0,l=P_,c=n;for(;c<r.length;){let u=1/0;for(const d of r)d>=i&&d<u&&(u=d);a+=(u-i)*(c+1),i=u;for(const d of r)if(d<i&&a++,d===i){let f=a;for(let p=ni;;p+=ni){const x=p<=l?m1:p>=l+J1?J1:p-l;if(f<x)break;const g=x+(f-x)%(ni-x);s.push(zw(g)),f=Math.floor((f-x)/(ni-x))}s.push(zw(f)),l=V_(a,c+1,c===n),a=0,c++}a++,i++}return s.join("")}const Sle=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,Nw=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,Cle=/^(?:R|AL|AN)$/;function Ele(e){if(F_(e))try{return x4(G_(e.slice(4).toLowerCase()))}catch{return!1}return x4(e)}function W_(e){const t=String.fromCodePoint(e);return mle.test(t)?"EN":rle.test(t)?"AN":B_.test(t)?"NSM":q_.test(t)?"R":hle.test(t)?"AL":H_.test(t)?"L":"ON"}function x4(e){for(const t of e)if(Cle.test(W_(t.codePointAt(0))))return!0;return!1}function K_(e){let t=!1,n=Nw,s=!1,r=!1,i=!0;for(const a of e){const l=W_(a.codePointAt(0));if(i){if(l!=="L"&&l!=="R"&&l!=="AL")return!1;t=l==="R"||l==="AL",n=t?Sle:Nw,i=!1}if(!n.test(l))return!1;l==="EN"?s=!0:l==="AN"&&(r=!0)}return!(t&&s&&r)}function $le(e){return kb.test(e)&&jle(e).length+4>63}function Ale(e){return e[0]==="-"||e[e.length-1]==="-"?!0:e.slice(2).join("").startsWith("--")}function X_(e){if($le(e)||x4(e)&&!K_(e))return!1;const t=[...e],n=t.map(i=>i.codePointAt(0)),s=n.length;if(Ale(t)||cle.test(t[0]))return!1;let r=!1;for(let i=0;i<s;i++){const a=n[i],l=t[i];if(ple.test(l)||!yle.test(l))return!1;fle.test(l)&&(r=!0);const c=n[i-1],u=n[i+1];switch(a){case 183:if(c!==108||u!==108)return!1;break;case 885:if(!u||!dle.test(t[i+1]))return!1;break;case 1523:case 1524:if(!c||!q_.test(t[i-1]))return!1;break;case 8204:if(!c||c<128&&!Tw.test(t[i-1]))return!1;break;case 8205:if(!c||!Tw.test(t[i-1]))return!1;break}}return!(e.includes("・")&&!r)}function Z_(e){if(!F_(e))return!1;try{const t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;const n=G_(t);return kb.test(n)?X_(n):!1}catch{return!1}}function Mle(e){return e.length>0&&e.length<=63}function Tle(e){return Mle(e)&&(Z_(e)||vle(e))}function zle(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(".").every(t=>Tle(t))}function Nle(e){return e.length>0&&e.length<=63}function _le(e){return Nle(e)&&(Z_(e)||X_(e))}function Rle(e){return e.replace(/[\uff01-\uff5e]/g,t=>String.fromCharCode(t.charCodeAt(0)-65248)).normalize("NFC").replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,"").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".")}function Ile(e){if(e.length===0||e.includes(" "))return!1;const t=Rle(e);if(t.length>253)return!1;const n=t.split("."),s=n.some(r=>Ele(r));return n.every(r=>_le(r)&&(!s||K_(r)))}function Lle(e){return zle(e)}const Ole=new RegExp('^(?:[A-Za-z0-9!#$%&\'*+\\/=?^_`{|}~\\u{0080}-\\u{10FFFF}-]+(?:\\.[A-Za-z0-9!#$%&\'*+\\/=?^_`{|}~\\u{0080}-\\u{10FFFF}-]+)*|"(?:[^"\\\\]|\\\\.)*")@[\\p{L}\\p{N}](?:[\\p{L}\\p{N}-]{0,62})(?<!-)(?:\\.[\\p{L}\\p{N}](?:[\\p{L}\\p{N}-]{0,62})(?<!-))*$',"iu");function Dle(e){return Ole.test(e.normalize("NFC"))}function Ble(e){return Ile(e)}const Hle=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function qle(e){return Hle.test(e)}const Ple=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function Ule(e){return Ple.test(e)}const Fle=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,Vle=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function Gle(e){return!Fle.test(e)&&!Vle.test(e)&&URL.canParse(e,"http://example.com")}const Wle=2048,Kle=/\[[vV][0-9a-fA-F]+\.[^\]]+\]/,Xle=/[\x00-\x20<>\^`{|}\\]/,Zle=/%(?![0-9a-fA-F]{2})/;function Yle(e){return e.length<Wle?e.replace(Kle,"[::1]"):e}function Qle(e){return Xle.test(e)||Zle.test(e)?!1:URL.canParse(Yle(e))}const Jle=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function ece(e){return Jle.test(e)}const tce=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function nce(e){return tce.test(e)}function sce(e){try{return new RegExp(e,"u"),!0}catch{return!1}}const rce=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function ice(e){return rce.test(e)}const oce=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function ace(e){return oce.test(e)}const lce=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function cce(e){return lce.test(e)}const uce=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function dce(e){return uce.test(e)}function fce(e){return URL.canParse(e)}const hce=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function pce(e){return hce.test(e)}const Pt=new Map;function xce(){Pt.clear()}function gce(e,t){var n;return((n=Pt.get(e))==null?void 0:n(t))??!0}function mce(){xce(),Pt.set("date-time",Xae),Pt.set("date",O_),Pt.set("duration",Yae),Pt.set("email",Jae),Pt.set("hostname",Lle),Pt.set("idn-email",Dle),Pt.set("idn-hostname",Ble),Pt.set("ipv4",qle),Pt.set("ipv6",Ule),Pt.set("iri-reference",Gle),Pt.set("iri",Qle),Pt.set("json-pointer-uri-fragment",ece),Pt.set("json-pointer",nce),Pt.set("regex",sce),Pt.set("relative-json-pointer",ice),Pt.set("time",D_),Pt.set("uri-reference",ace),Pt.set("uri-template",cce),Pt.set("uri",dce),Pt.set("url",fce),Pt.set("uuid",pce)}mce();function yce(e,t,n,s){return gce(n.format,s)}function vce(e,t,n,s){const r=bae(n)?n.then:!0,i=Yoe(n)?n.else:!0;return pn(e,t,n.if,s)?pn(e,t,r,s):pn(e,t,i,s)}function kce(e,t,n,s){return Qn(n.items,0,(r,i)=>nf(s.length,i)||Pc(e,t,r,s[i])&&t.AddIndex(i))}function bce(e,t,n,s){const r=R_(n)?n.prefixItems.length:0;return Qn(s,r,(i,a)=>Pc(e,t,n.items,i)&&t.AddIndex(a))}function wce(e,t,n,s){return sae(n)?kce(e,t,n,s):bce(e,t,n,s)}function jce(e){return mb(e)}function Sce(e,t,n,s){if(!jce(n))return!0;const r=j_(s,i=>pn(e,t,n.contains,i));return nf(r,n.maxContains)}function Cce(e,t,n,s){return nf(s,n.maximum)}function Ece(e,t,n,s){return nf(s.length,n.maxItems)}function $ce(e,t,n,s){return Bie(s,n.maxLength)}function Ace(e,t,n,s){return nf(kn(s).length,n.maxProperties)}function Mce(e){return mb(e)}function Tce(e,t,n,s){if(!Mce(n))return!0;const r=j_(s,(i,a)=>pn(e,t,n.contains,i)&&t.AddIndex(a));return km(r,n.minContains)}function zce(e,t,n,s){return km(s,n.minimum)}function Nce(e,t,n,s){return km(s.length,n.minItems)}function _ce(e,t,n,s){return Hie(s,n.minLength)}function Rce(e,t,n,s){return km(kn(s).length,n.minProperties)}function Ice(e,t,n,s){return Oie(s,n.multipleOf)}function Lce(e,t,n,s){const r=new sf;return!pn(e,r,n.not,s)&&t.Merge([r])}function Oce(e,t,n,s){const r=n.oneOf.reduce((i,a)=>{const l=new sf;return pn(e,l,a,s)?[...i,l]:i},[]);return $e(r.length,1)&&t.Merge(r)}function Dce(e,t,n,s){return(vn(n.pattern)?vb(n.pattern):n.pattern).test(s)}function Bce(e,t,n,s){return Qn(Cc(n.patternProperties),0,([r,i])=>{const a=vb(r);return Qn(Cc(s),0,([l,c])=>!a.test(l)||Pc(e,t,i,c)&&t.AddKey(l))})}function Hce(e,t,n,s){return $e(s.length,0)||Qn(n.prefixItems,0,(r,i)=>nf(s.length,i)||Pc(e,t,r,s[i])&&t.AddIndex(i))}function qce(e,t){return e.includes(t)||E_().exactOptionalPropertyTypes}function Pce(e,t){return hn(e[t])}function Uce(e,t,n,s){const r=L_(n)?n.required:[];return Qn(Cc(n.properties),0,([a,l])=>{const c=!Ee(s,a)||Pc(e,t,l,s[a])&&t.AddKey(a);return qce(r,a)?c:Pce(s,a)||c})}function Fce(e,t,n,s){return Qn(kn(s),0,(r,i)=>pn(e,t,n.propertyNames,r))}function Vce(e,t,n,s){const r=e.RecursiveRef(n)??!1;return Gt(r)&&pn(e,t,r,s)}function Gce(e,t,n,s){const r=e.Ref(n)??!1,i=new sf,a=Gt(r)&&pn(e,i,r,s);return a&&t.Merge([i]),a}function Wce(e,t,n,s){return Qn(n.required,0,r=>Ee(s,r))}function Y_(e,t,n,s,r){return $e(n,"object")?Lie(r):$e(n,"array")?pt(r):$e(n,"boolean")?Hc(r):$e(n,"integer")?m_(r):$e(n,"number")?On(r):$e(n,"null")?qh(r):$e(n,"string")?vn(r):$e(n,"bigint")?Br(r):$e(n,"constructor")?g_(r):$e(n,"function")?Q1(r):$e(n,"symbol")?y_(r):$e(n,"undefined")||$e(n,"void")?hn(r):!0}function Kce(e,t,n,s,r){return w_(n,i=>Y_(e,t,i,s,r))}function Xce(e,t,n,s){return pt(n.type)?Kce(e,t,n.type,n,s):Y_(e,t,n.type,n,s)}function Zce(e,t,n,s){const r=t.GetIndices();return Qn(s,0,(i,a)=>(r.has(a)||pn(e,t,n.unevaluatedItems,i))&&t.AddIndex(a))}function Yce(e,t,n,s){const r=t.GetKeys();return Qn(Cc(s),0,([i,a])=>r.has(i)||pn(e,t,n.unevaluatedProperties,a)&&t.AddKey(i))}function Qce(e){return!$e(e.uniqueItems,!1)}function Jce(e,t,n,s){if(!Qce(n))return!0;const r=new Set(s.map(Ioe)).size,i=s.length;return $e(r,i)}function Pc(e,t,n,s){return t.Push()&&pn(e,t,n,s)&&t.Pop()}function pn(e,t,n,s){e.Push(n);const r=lg(n)?Rae(e,t,n):(!wae(n)||Xce(e,t,n,s))&&(!(en(s)&&!pt(s))||(!L_(n)||Wce(e,t,n,s))&&(!Uoe(n)||zae(e,t,n,s))&&(!Woe(n)||Dae(e,t,n,s))&&(!Koe(n)||Bae(e,t,n,s))&&(!Xoe(n)||Hae(e,t,n,s))&&(!__(n)||Bce(e,t,n,s))&&(!I_(n)||Uce(e,t,n,s))&&(!mae(n)||Fce(e,t,n,s))&&(!fae(n)||Rce(e,t,n,s))&&(!lae(n)||Ace(e,t,n,s)))&&(!pt(s)||(!Poe(n)||Aae(e,t,n,s))&&(!mb(n)||Oae(e,t,n,s))&&(!yb(n)||wce(e,t,n,s))&&(!iae(n)||Sce(e,t,n,s))&&(!oae(n)||Ece(e,t,n,s))&&(!N_(n)||Tce(e,t,n,s))&&(!uae(n)||Nce(e,t,n,s))&&(!R_(n)||Hce(e,t,n,s))&&(!jae(n)||Jce(e,t,n,s)))&&(!vn(s)||(!aae(n)||$ce(e,t,n,s))&&(!dae(n)||_ce(e,t,n,s))&&(!tae(n)||yce(e,t,n,s))&&(!gae(n)||Dce(e,t,n,s)))&&(!(On(s)||Br(s))||(!Joe(n)||Uae(e,t,n,s))&&(!eae(n)||Fae(e,t,n,s))&&(!rae(n)||Cce(e,t,n,s))&&(!cae(n)||zce(e,t,n,s))&&(!hae(n)||Ice(e,t,n,s)))&&(!kae(n)||Gce(e,t,n,s))&&(!vae(n)||Vce(e,t,n,s))&&(!Zoe(n)||qae(e,t,n,s))&&(!Goe(n)||Iae(e,t,n,s))&&(!Qoe(n)||Pae(e,t,n,s))&&(!nae(n)||vce(e,t,n,s))&&(!pae(n)||Lce(e,t,n,s))&&(!Foe(n)||Nae(e,t,n,s))&&(!Voe(n)||_ae(e,t,n,s))&&(!xae(n)||Oce(e,t,n,s))&&(!Sae(n)||!pt(s)||Zce(e,t,n,s))&&(!Cae(n)||!en(s)||Yce(e,t,n,s))&&(!qoe(n)||Eae(e,t,n,s));return e.Pop(n),r}function eue(e,t){return en(t)&&!bm(e)?t[e]:void 0}function tue(e,t){return e.reduce((n,s)=>eue(s,n),t)}function nue(e){if($e(e.length,0))return[];const t=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function sue(e,t){const n=nue(t);return tue(n,e)}const Sm="https://json-schema.org";function Q_(e,t){if(en(e)&&$c(e)&&$e(e.$dynamicAnchor,t))return e;if(en(e))for(const n of kn(e)){const s=Q_(e[n],t);if(s)return s}}function g4(e,t,n){if($e(e,n))return t.href;const s=mr(e)&&ii(e)?new URL(e.$id,t.href):t;if(pt(e))for(const r of e){const i=g4(r,s,n);if(!hn(i))return i}else if(en(e))for(const r of kn(e)){const i=g4(e[r],s,n);if(!hn(i))return i}}function rue(e,t,n){if($e(e.$id,n.hash))return e;const s=new URL(n.href,t.href);if($e(t.pathname,s.pathname))return n.hash.startsWith("#")?J_(e,n):e}function iue(e,t,n){const s=new URL(`#${e.$anchor}`,t.href),r=new URL(n.href,t.href);return $e(s.href,r.href)?e:void 0}function oue(e,t,n){const s=new URL(`#${e.$dynamicAnchor}`,t.href),r=new URL(n.href,t.href);return $e(s.href,r.href)?e:void 0}function J_(e,t){if(t.href.endsWith("#"))return e;if(!t.hash.startsWith("#"))return;const n=decodeURIComponent(t.hash.slice(1));return n.startsWith("/")?sue(e,n):void 0}function aue(e,t,n){if(ii(e)){const s=rue(e,t,n);if(!hn(s))return s}if(h4(e)){const s=iue(e,t,n);if(!hn(s))return s}if($c(e)){const s=oue(e,t,n);if(!hn(s))return s}return J_(e,n)}function lue(e,t,n){return e.reduce((s,r)=>{const i=Cm(r,t,n);return hn(i)?s:i},void 0)}function cue(e){return $e(e,"const")||$e(e,"enum")}function uue(e,t,n){return kn(e).reduce((s,r)=>{if(cue(r))return s;const i=Cm(e[r],t,n);return hn(i)?s:i},void 0)}function Cm(e,t,n){const s=mr(e)&&ii(e)?new URL(e.$id,t.href):t;if(mr(e)){const r=aue(e,s,n);if(!hn(r))return r}if(pt(e))return lue(e,s,n);if(en(e))return uue(e,s,n)}function due(e,t,n){return g4(e,new URL(t||".",Sm),n)}function fue(e,t,n,s){const r=Em(e,t,n,s,!1);return mr(r)&&ii(r)?r:void 0}function _w(e){return e.href.split("#")[0]}function hue(e,t){return Ee(e,t)?e[t]:void 0}function pue(e,t,n){return Cm(e,t,n)}function xue(e,t,n){const s=_w(n);if($e(s,_w(t))||!Ee(e,s))return;const r=e[s],i=mr(r)&&ii(r)?new URL(r.$id,s):new URL(s);return $e(n.hash,"")?r:Cm(r,i,n)}function gue(e,t,n,s,r){if(!s.$ref.startsWith("#")||Ee(e,"$schema"))return;const i=due(t,n,r);if(!(hn(i)||$e(i,n)))return{target:r,base:i,root:t}}function mue(e,t,n){const s=e[t];if(mr(s))return{target:n,base:t,root:s}}function yue(e,t,n,s,r){const i=r?mue(e.context,s,n):void 0;return hn(i)?gue(e.root,e.lexicalSchema,e.referenceBase,t,n):i}function vue(e,t,n,s,r,i){if(ii(r))return;const a=fue(e,t,n,s);if(!(!a||i.includes(a)))return{target:r,resource:a}}function Em(e,t,n,s,r=!0){const i=new URL(n||".",Sm),a=r&&ii(t)?new URL(t.$id,i):i,l=new URL(s,a.href);return hue(e,s)??pue(t,a,l)??xue(e,a,l)}function kue(e,t,n,s,r,i){const a=new URL(n||".",Sm),l=r.$dynamicRef.startsWith("#")?s:t,c=Em(e,l,n,r.$dynamicRef,!1);if(hn(c)){const f=new URL(r.$dynamicRef,a).hash;if(!f.startsWith("#/")&&f.startsWith("#")){const p=decodeURIComponent(f.slice(1));return i.find(g=>$e(g.$dynamicAnchor,p))??Q_(t,p)}return}return!mr(c)||!$c(c)||new URL(r.$dynamicRef,a).hash.startsWith("#/")?c:i.find(f=>$e(f.$dynamicAnchor,c.$dynamicAnchor))??c}function bue(e,t){const n=e.inRetrievedFrame?e.lexicalSchema:e.root,s=t.$ref.startsWith("#")?e.lexicalSchema:n,r=Em(e.context,s,e.referenceBase,t.$ref,!1);if(!r||!mr(r))return{schema:r};const i=new URL(t.$ref,e.referenceBase).href.split("#")[0],a=!$e(i,e.resourceBase),l=yue(e,t,r,i,a),c=a?vue(e.context,e.root,e.referenceBase,i,r,e.ids):void 0;return{schema:r,retrievedResource:l,resolvedResource:c}}function wue(e,t){const n=p4(e.lexicalSchema)?e.recursiveAnchors[0]:e.lexicalSchema;return Em(e.context,n,e.lexicalBase,t.$recursiveRef,!1)}function jue(e,t){return kue(e.context,e.root,e.lexicalBase,e.lexicalSchema,t,e.dynamicAnchors)}var Rt=function(e,t,n,s){if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)},kt,Yp,eR,m4,F0,Rw,Iw,Lw,Ow,ky,by,y4,v4,Dw,tR;class Sue{constructor(t,n){kt.add(this),this.context=t,this.schema=n,this.ids=[],this.resourceIds=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[],this.retrievedResources=new Map,this.retrievedFrames=[],this.resolvedResources=new Map,this.pendingResource=!0}LexicalBaseURL(){return Rt(this,kt,"m",m4).call(this,this.ids)}Push(t){if(!mr(t))return;ii(t)&&Rt(this,kt,"m",y4).call(this,t),h4(t)&&this.anchors.push(t),p4(t)&&this.recursiveAnchors.push(t),$c(t)&&this.dynamicAnchors.push(t);const n=this.retrievedResources.get(t);n&&this.retrievedFrames.push({schema:n.root,base:n.base,idDepth:this.ids.length,resourceDepth:this.resourceIds.length})}Pop(t){mr(t)&&(ii(t)&&Rt(this,kt,"m",v4).call(this,t),h4(t)&&this.anchors.pop(),p4(t)&&this.recursiveAnchors.pop(),$c(t)&&this.dynamicAnchors.pop(),this.retrievedResources.has(t)&&this.retrievedFrames.pop(),Rt(this,kt,"m",tR).call(this,t))}Ref(t){const n=bue(Rt(this,kt,"m",Yp).call(this),t);return Rt(this,kt,"m",eR).call(this,n),n.schema}RecursiveRef(t){const n=wue(Rt(this,kt,"m",Yp).call(this),t);return n&&(this.pendingResource=!0),n}DynamicRef(t){const n=jue(Rt(this,kt,"m",Yp).call(this),t);return n&&(this.pendingResource=!0),n}}kt=new WeakSet,Yp=function(){return{context:this.context,root:this.schema,ids:this.ids,lexicalSchema:Rt(this,kt,"m",Iw).call(this),lexicalBase:this.LexicalBaseURL(),referenceBase:Rt(this,kt,"m",Rw).call(this),resourceBase:Rt(this,kt,"m",F0).call(this),recursiveAnchors:this.recursiveAnchors,dynamicAnchors:this.dynamicAnchors,inRetrievedFrame:this.retrievedFrames.length>0}},eR=function(t){hn(t.schema)||(this.pendingResource=!0),hn(t.resolvedResource)||Rt(this,kt,"m",Dw).call(this,t.resolvedResource.target,t.resolvedResource.resource),hn(t.retrievedResource)||this.retrievedResources.set(t.retrievedResource.target,{base:t.retrievedResource.base,root:t.retrievedResource.root})},m4=function(t){const n=this.retrievedFrames[this.retrievedFrames.length-1],s=n?new URL(n.base):new URL(Sm);return(n?t.slice(n.idDepth):t).reduce((i,a)=>new URL(a.$id,i),s).href},F0=function(){const t=this.retrievedFrames[this.retrievedFrames.length-1];return t?this.resourceIds.slice(t.resourceDepth).reduce((n,s)=>new URL(s.$id,n),new URL(t.base)).href:Rt(this,kt,"m",m4).call(this,this.resourceIds)},Rw=function(){if(this.retrievedFrames.length>0)return Rt(this,kt,"m",F0).call(this);const t=this.ids[this.ids.length-1];return t&&!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t.$id)?this.LexicalBaseURL():Rt(this,kt,"m",F0).call(this)},Iw=function(){const t=this.retrievedFrames[this.retrievedFrames.length-1];return t?this.ids.length>t.idDepth?this.ids[this.ids.length-1]:t.schema:this.ids.length>0?this.ids[this.ids.length-1]:this.schema},Lw=function(t){t.forEach(n=>Rt(this,kt,"m",ky).call(this,n,!1))},Ow=function(t){t.forEach(n=>Rt(this,kt,"m",by).call(this,n,!1))},ky=function e(t,n=!0){if(lg(t))return;if(pt(t))return Rt(this,kt,"m",Lw).call(this,t);if(!mr(t))return;const s=t;if(!(!n&&ii(s))){!n&&$c(s)&&this.dynamicAnchors.push(s);for(const r of kn(s))Rt(this,kt,"m",e).call(this,s[r],!1)}},by=function e(t,n=!0){if(lg(t))return;if(pt(t))return Rt(this,kt,"m",Ow).call(this,t);if(!mr(t))return;const s=t;if(!(!n&&ii(s))){!n&&$c(s)&&this.dynamicAnchors.pop();for(const r of kn(s))Rt(this,kt,"m",e).call(this,s[r],!1)}},y4=function(t){this.ids.push(t);const n=this.pendingResource;this.pendingResource=!1,n&&this.resourceIds.push(t),Rt(this,kt,"m",ky).call(this,t,!0)},v4=function(t){this.ids.pop(),this.resourceIds.length>0&&$e(this.resourceIds[this.resourceIds.length-1],t)&&this.resourceIds.pop(),Rt(this,kt,"m",by).call(this,t,!0)},Dw=function(t,n){Rt(this,kt,"m",y4).call(this,n),this.resolvedResources.set(t,n)},tR=function(t){if(!this.resolvedResources.has(t))return;const n=this.resolvedResources.get(t);Rt(this,kt,"m",v4).call(this,n),this.resolvedResources.delete(t)};function Cue(...e){const[t,n,s]=A_(e,{3:(a,l,c)=>[a,l,c],2:(a,l)=>[{},a,l]}),r=new Sue(t,n),i=new sf;return pn(r,i,n,s)}function V0(...e){const[t,n,s]=A_(e,{3:(r,i,a)=>[r,i,a],2:(r,i)=>[{},r,i]});return Cue(t,n,s)}BigInt(Number.MAX_SAFE_INTEGER);BigInt(Number.MIN_SAFE_INTEGER);const Eue=js({type:cr("insert"),path:cs(),value:gb()}),$ue=Object({type:cr("update"),path:cs(),value:gb()}),Aue=js({type:cr("delete"),path:cs()});jm([Eue,$ue,Aue]);const Mue=js({text:cs({minLength:1}),status:jm([cr("pending"),cr("in_progress"),cr("completed")])}),Tue=js({items:qc(Mue)}),zue=js({label:cs({minLength:1}),description:bo(cs())}),Nue=js({question:cs({minLength:1}),header:cs({minLength:1,maxLength:16}),options:qc(zue,{minItems:2,maxItems:4}),multiSelect:bo(Loe())}),_ue=js({selected:qc(cs()),other:bo(cs())}),Rue=jm([js({outcome:cr("answered"),answers:qc(_ue),at:Ku()}),js({outcome:cr("dismissed"),at:Ku()}),js({outcome:cr("cancelled"),at:Ku()})]),Iue=js({id:cs({minLength:1}),questions:qc(Nue,{minItems:1,maxItems:4}),askedAt:Ku(),resolution:bo(Rue)}),Lue=js({requests:qc(Iue)}),Oue=js({patch:cs()}),Due=js({id:bo(Ku()),name:cs(),args:cs(),status:jm([cr("running"),cr("ok"),cr("error"),cr("cancelled")]),durationMs:bo(Ku()),error:bo(cs()),details:bo(gb())}),Bue=js({code:bo(cs()),calls:qc(Due)});function rf(e,t){return e==="pinomad.todo"&&V0(Tue,t)?{type:"pinomad.todo",value:t}:e==="pinomad.question"&&V0(Lue,t)?{type:"pinomad.question",value:t}:e==="pinomad.diff"&&V0(Oue,t)?{type:"pinomad.diff",value:t}:e==="pinomad.codemode"&&V0(Bue,t)?{type:"pinomad.codemode",value:t}:{type:"fallback",value:t}}const Hue=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,que=/^\+\s*\d+ /,Pue=/^-\s*\d+ /;function Uue(e){let t=0,n=0,s=0,r=0,i=!1;for(const a of e.split(`
|
|
394
|
-
`)){const l=Hue.exec(a);if(l){s=Number.parseInt(l[2]??"1",10),r=Number.parseInt(l[4]??"1",10),i=!0;continue}if(!i)continue;if(s===0&&r===0){i=!1;continue}const c=a.charAt(0);c===" "?(s-=1,r-=1):c==="-"?(s-=1,n+=1):c==="+"&&(r-=1,t+=1)}return{additions:t,deletions:n}}function Fue(e){let t=0,n=0;for(const s of e.split(`
|
|
395
|
-
`))que.test(s)?t+=1:Pue.test(s)&&(n+=1);return{additions:t,deletions:n}}function Vue(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return}if(typeof t!="object"||t===null)return;const n=t.details;if(typeof n!="object"||n===null)return;const{patch:s,diff:r}=n,i=typeof s=="string"?Uue(s):typeof r=="string"?Fue(r):void 0;return i!==void 0&&(i.additions>0||i.deletions>0)?i:void 0}function bb(e){return e.pinomad}function Gue(e){var n;const t=(n=e.pinomad)==null?void 0:n.answerStartedAt;if(!(typeof t!="number"||!Number.isFinite(t))&&!(typeof e.timestamp!="number"||t<e.timestamp))return t}function Qp(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Wue(e){return typeof e=="string"?e:e.flatMap(t=>t.type==="text"&&t.text!==void 0?[t.text]:[]).join("")}function nR(e){return typeof e=="string"?[]:e.flatMap(t=>{if(t.type!=="image"||t.mimeType===void 0)return[];const n=t.mimeType;return typeof t.data=="string"&&t.data!==""?[{data:t.data,mimeType:n}]:typeof t.ref=="string"&&t.ref!==""?[{ref:t.ref,mimeType:n}]:[]})}const ql=e=>e.type==="toolCall"&&e.id!==void 0;function Kue(e,t){if(e!==void 0){if(t==="codemode"&&typeof e=="object"&&e!==null){const n=e.code;if(typeof n=="string")return n}return JSON.stringify(e)}}function Xue(e){if(typeof e!="object"||e===null)return;const t=e.conversationId;return typeof t=="number"?t:void 0}function Zue(e,t){const n=e.status==="ok"?"output-available":(e.status==="error","output-error"),s=e.status==="error"?e.error:n==="output-error"?"Cancelled":void 0,r=e.details===void 0?void 0:rf(t[e.name],e.details),i=(r==null?void 0:r.type)==="pinomad.diff"?{kind:"diff",patch:r.value.patch}:void 0;return{state:n,toolName:e.name,argsText:e.args,...s===void 0?{}:{output:s},...e.durationMs===void 0?{}:{durationMs:e.durationMs},...i===void 0?{}:{pinomad:i}}}function Yue(e){const t=e.summary;return{state:e.status!=="done"?"input-available":t===void 0||t.isError?"output-error":"output-available",toolCallId:e.callId,toolName:e.name,argsText:JSON.stringify(e.arguments),...(t==null?void 0:t.error)===void 0?{}:{output:t.error},...(t==null?void 0:t.durationMs)===void 0?{}:{durationMs:t.durationMs}}}function Que(e,t,n,s,r){const i=e.id,a=t.results.get(i),l=t.partial?void 0:n.get(i),c=(l==null?void 0:l.name)??e.name,u=Kue(e.arguments,c);let d,f;a!==void 0?(d=a.isError===!0?"output-error":"output-available",f=Wue(a.content)):(l==null?void 0:l.status)==="running"?(d="input-available",f=l.output):t.partial===!0?d="input-streaming":t.msg.stopReason!=="toolUse"?(d="output-error",f="Not run: the answer was interrupted."):(d="input-available",f=l==null?void 0:l.output);const p=(a==null?void 0:a.details)??(l==null?void 0:l.details),x=p===void 0?void 0:rf(r[c??""],p),g=a!==void 0&&a.isError!==!0?Vue({details:a.details}):void 0,v=a===void 0?[]:nR(a.content),y=Xue(p);let m,k;if((x==null?void 0:x.type)==="pinomad.diff")m={kind:"diff",patch:x.value.patch};else if(y!==void 0){const b=p;m={kind:"subagent",conversationId:y,...f===void 0?{}:{output:f},...typeof b.model=="string"?{model:b.model}:{},...typeof b.startedAt=="number"?{startedAt:b.startedAt}:{},...typeof(a==null?void 0:a.timestamp)=="number"?{endedAt:a.timestamp}:{}}}return c==="codemode"&&a===void 0?k=(s.get(i)??[]).map(Yue):(x==null?void 0:x.type)==="pinomad.codemode"&&(k=x.value.calls.map(b=>Zue(b,r))),{state:d,toolCallId:i,...c===void 0?{}:{toolName:c},...u===void 0?{}:{argsText:u},...f===void 0?{}:{output:f},...g===void 0?{}:{diffStat:g},...v.length===0?{}:{images:v},...k===void 0||k.length===0?{}:{children:k},...m===void 0?{}:{pinomad:m}}}function Jue(e){const t=e==null?void 0:e.calls;return Array.isArray(t)&&t.some(n=>n.name==="todo_write"&&n.status==="ok")}function ede(e){const t=[];for(const n of e)if(ql(n)){const s=t[t.length-1];(s==null?void 0:s.kind)==="tools"?s.blocks.push(n):t.push({kind:"tools",blocks:[n]})}else n.type==="thinking"?t.push({kind:"thinking",block:n}):n.type==="text"&&t.push({kind:"text",block:n});return t}function tde(e,t,n,s,r){var I,O,L;const i=new Map(((I=s?n.tools:void 0)==null?void 0:I.map(H=>[H.callId,H]))??[]),a=new Map;if(s)for(const H of n.nestedTools??[]){if(H.name.startsWith("pi."))continue;const q=a.get(H.parentCallId);q===void 0?a.set(H.parentCallId,[H]):q.push(H)}const l=s?(O=n.generation)==null?void 0:O.message:void 0,c=new Map,u=[...t.assistants.map(({id:H,msg:q,results:U})=>({id:H,msg:q,results:U})),...l===void 0?[]:[{id:"live",msg:l,partial:!0,results:c}]],d=u[u.length-1],f=t.assistants[t.assistants.length-1],p=!s,g=(d===void 0?[]:d.msg.content.filter(H=>H.type==="text")).map(H=>H.text??"").join(""),v=(d==null?void 0:d.msg.content.some(ql))===!0,y=g!==""&&(p||!v),m=(H,q)=>ql(q)&&!H.results.has(q.id)&&(H.partial===!0||H.msg.stopReason==="toolUse"),k=u.some(H=>H.msg.content.some(q=>m(H,q))),b=d==null?void 0:d.msg.content[d.msg.content.length-1];let j;p?j="settled":y?j="answering":k||b!==void 0&&ql(b)?j="acting":u.length>0?j="thinking":j="hidden";const A=j==="thinking"||j==="acting",M=[];for(const H of u){const q=H===d,U=H.msg.content;ede(U).forEach((X,Z)=>{if(X.kind==="tools"){const ae=X.blocks.filter(fe=>m(H,fe)),xe=A&&ae.length>0;M.push({kind:"tools",id:`${H.id}-tools-${Z}`,tools:X.blocks.map(fe=>Que(fe,H,i,a,r)),live:xe,...xe&&ae[0]!==void 0?{activeToolCallId:ae[0].id}:{}});return}if(X.kind==="text"){q&&y||M.push({kind:"interim",id:`${H.id}-text-${Z}`,text:X.block.text??""});return}const ie=U.indexOf(X.block);M.push({kind:"thinking",id:`${H.id}-thinking-${Z}`,text:X.block.thinking??"",live:A&&H.partial===!0&&ie===U.length-1})})}let T;for(const H of u)for(const q of H.msg.content){if(!ql(q))continue;const U=H.results.get(q.id);U===void 0||typeof U.timestamp!="number"||(q.name==="todo_write"?U.isError!==!0:q.name==="codemode"&&Jue(U.details))&&(T=U.timestamp)}const z=(f==null?void 0:f.msg.stopReason)==="aborted",$=p&&(f==null?void 0:f.msg.stopReason)==="error",E=f===void 0?void 0:Qp(f.msg.timestamp),N=f===void 0?void 0:Qp(f.msg.durationMs),_=p&&E!==void 0?Qp(E+(N??0)):void 0,R=(L=u[0])==null?void 0:L.msg.timestamp,B=typeof(d==null?void 0:d.msg.provider)=="string"&&typeof d.msg.model=="string"?{provider:d.msg.provider,modelId:d.msg.model}:void 0;let D;if(p&&R!==void 0){let H;y?H=(d===void 0?void 0:Gue(d.msg))??(d===u[0]||d==null?void 0:d.msg.timestamp):H=t.lastTs??(d==null?void 0:d.msg.timestamp),D=H===void 0?void 0:H-R}return{kind:"run",id:e,cot:{phase:j,...$===!0?{outcome:"failed"}:{},...R===void 0?{}:{anchorMs:R},...D===void 0?{}:{elapsedMs:D},...T===void 0?{}:{todoWrittenAtMs:T},...B===void 0?{}:{model:B},steps:M,...y?{answer:{text:g,streaming:(d==null?void 0:d.partial)===!0}}:{}},interrupted:z,...p&&!z&&$!==!0&&f!==void 0?{forkEntryId:f.id}:{},...$===!0?{failure:(f==null?void 0:f.msg.errorMessage)??"The run failed."}:{},..._===void 0?{}:{endedAt:_}}}function nde(e,t,n,s=[],r={}){var p;const i=[],a=e.docs["pi.live"]??{};let l,c=0;const u=x=>{var g;if(l!==void 0){if(l.assistants.length>0||l.orphans.size>0||x){const v=((g=l.assistants[0])==null?void 0:g.id)??`open-${c++}`;i.push(tde(`run-${v}`,l,a,x,t))}l=void 0}};for(const x of e.entries){const g=(p=x.model)==null?void 0:p[0],v=String(x.id);if(x.kind==="pi.user"&&(g==null?void 0:g.role)==="user"){u(!1);const y=pb(g.content),m=Qp(g.timestamp);i.push({kind:"user",id:v,text:y.text,images:nR(g.content),skills:y.skills,attachments:y.attachments,...m===void 0?{}:{timestamp:m}})}else if(x.kind==="pi.compaction")u(!1),i.push({kind:"compaction",id:v});else if(x.kind==="pi.reset")u(!1),i.push({kind:"reset",id:v});else if(x.kind==="pi.assistant"&&(g==null?void 0:g.role)==="assistant"){l??(l={assistants:[],orphans:new Map});const y=new Map;for(const m of g.content){if(!ql(m))continue;const k=l.orphans.get(m.id);k!==void 0&&(l.orphans.delete(m.id),y.set(m.id,k))}l.assistants.push({id:v,msg:g,results:y}),l.lastTs=g.timestamp??l.lastTs}else if(x.kind==="pi.tool-result"&&(g==null?void 0:g.role)==="toolResult"&&g.toolCallId!==void 0){l??(l={assistants:[],orphans:new Map});const y=l.assistants.findLast(m=>!m.results.has(g.toolCallId)&&m.msg.content.some(k=>ql(k)&&k.id===g.toolCallId));y===void 0?l.orphans.set(g.toolCallId,g):y.results.set(g.toolCallId,g),l.lastTs=g.timestamp??l.lastTs}}l??(l=n?{assistants:[],orphans:new Map}:void 0),u(n);let d;for(const x of i)x.kind==="user"&&x.local===void 0&&(d=x);d!==void 0&&(d.status="delivered");const f=e.conversation.id;for(const x of s){const g=x.placement==="conversation"||r.mergeQueuedSubmissions===!0&&x.placement==="queue";if(x.phase==="settled"||!g||x.conversationId!==void 0&&x.conversationId!==f)continue;const v=x.phase==="unknown"?"unknown":x.phase==="failed"?"failed":"sending";i.push({kind:"user",id:`local:${x.requestId}`,text:x.text,images:x.imageViews??x.images.flatMap(y=>"data"in y?[y]:[]),attachments:x.attachmentDetails??[],skills:x.skills,status:v,local:{requestId:x.requestId,...x.error===void 0?{}:{error:x.error}}})}return i}function sde(e){const t=e[e.length-1];if(!((t==null?void 0:t.kind)!=="run"||t.failure===void 0))for(let n=e.length-2;n>=0;n--){const s=e[n];if(s.kind!=="compaction")return s.kind!=="user"||s.text.trim()===""&&s.images.length===0&&s.attachments.length===0?void 0:{text:s.text,images:s.images,skills:s.skills,attachments:s.attachments,requestId:`retry:${t.id}`}}}function rde(e){const t=[],n=[];for(const s of e.steps){if(s.kind!=="tools"){n.push(s);continue}const r=[];if(s.tools.forEach((i,a)=>{if(i.toolName!=="subagent"){r.push(i);return}t.push({key:`${s.id}/${i.toolCallId??a}`,tool:i})}),r.length!==0)if(s.activeToolCallId!==void 0&&!r.some(i=>i.toolCallId===s.activeToolCallId)){const i=r.find(a=>a.state==="input-streaming"||a.state==="input-available");if(i===void 0){const{activeToolCallId:a,...l}=s;n.push({...l,tools:r,live:!1})}else n.push({...s,tools:r,...i.toolCallId===void 0?{}:{activeToolCallId:i.toolCallId}})}else n.push({...s,tools:r})}return{view:{...e,steps:n},subagents:t}}const Bw={};function Ph(e,t){const n=h.useRef(Bw);return n.current===Bw&&(n.current=e(t)),n}const wy=zj[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ide=wy&&wy!==h.useLayoutEffect?wy:e=>e();function Ac(e){const t=Ph(ode).current;return t.next=e,ide(t.effect),t.trampoline}function ode(){const e={next:void 0,callback:ade,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function ade(){}function wb(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(s=>n.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${n} for the full message.`}function k4(e,t,n,s){const r=Ph(sR).current;return cde(r,e,t,n,s)&&rR(r,[e,t,n,s]),r.callback}function lde(e){const t=Ph(sR).current;return ude(t,e)&&rR(t,e),t.callback}function sR(){return{callback:null,cleanup:null,refs:[]}}function cde(e,t,n,s,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==r}function ude(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function rR(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const s=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const i=t[r];if(i!=null)switch(typeof i){case"function":{const a=i(n);typeof a=="function"&&(s[r]=a);break}case"object":{i.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const i=t[r];if(i!=null)switch(typeof i){case"function":{const a=s[r];typeof a=="function"?a():i(null);break}case"object":{i.current=null;break}}}}}}}const dde=parseInt(h.version,10);function fde(e){return dde>=e}function Hw(e){if(!h.isValidElement(e))return null;const t=e,n=t.props;return(fde(19)?n==null?void 0:n.ref:t.ref)??null}function b4(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function hde(e,t){const n={};for(const s in e){const r=e[s];if(t!=null&&t.hasOwnProperty(s)){const i=t[s](r);i!=null&&Object.assign(n,i);continue}r===!0?n[`data-${s.toLowerCase()}`]="":r&&(n[`data-${s.toLowerCase()}`]=r.toString())}return n}function pde(e,t){return typeof e=="function"?e(t):e}function xde(e,t){return typeof e=="function"?e(t):e}const y1={};function iR(e,t,n,s,r){let i={...w4(e,y1)};return t&&(i=Jp(i,t)),n&&(i=Jp(i,n)),s&&(i=Jp(i,s)),i}function gde(e){if(e.length===0)return y1;if(e.length===1)return w4(e[0],y1);let t={...w4(e[0],y1)};for(let n=1;n<e.length;n+=1)t=Jp(t,e[n]);return t}function Jp(e,t){return oR(t)?t(e):mde(e,t)}function mde(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=b4(e.style,s);break}case"className":{e[n]=aR(e.className,s);break}default:yde(n,s)?e[n]=vde(e[n],s):e[n]=s}}return e}function yde(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&s===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function oR(e){return typeof e=="function"}function w4(e,t){return oR(e)?e(t):e??y1}function vde(e,t){return t?e?n=>{if(kde(n)){const r=n;j4(r);const i=t(r);return r.baseUIHandlerPrevented||e==null||e(r),i}const s=t(n);return e==null||e(n),s}:t:e}function j4(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function aR(e,t){return t?e?t+" "+e:t:e}function kde(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const _l=Object.freeze({});function jb(e,t,n={}){const s=t.render,r=bde(t,n);if(n.enabled===!1)return null;const i=n.state??_l;return wde(e,s,r,i)}function bde(e,t={}){const{className:n,style:s,render:r}=e,{state:i=_l,ref:a,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?pde(n,i):void 0,f=u?xde(s,i):void 0,p=u?hde(i,c):_l,x=u?b4(p,Array.isArray(l)?gde(l):l)??_l:_l;return typeof document<"u"&&(u?Array.isArray(a)?x.ref=lde([x.ref,Hw(r),...a]):x.ref=k4(x.ref,Hw(r),a):k4(null,null)),u?(d!==void 0&&(x.className=aR(x.className,d)),f!==void 0&&(x.style=b4(x.style,f)),x):_l}function wde(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const r=iR(n,t.props);return r.ref=n.ref,h.cloneElement(t,r)}if(e&&typeof e=="string")return jde(e,n);throw new Error(wb(8))}function jde(e,t){return e==="button"?h.createElement("button",{type:"button",...t,key:t.key}):e==="img"?h.createElement("img",{alt:"",...t,key:t.key}):h.createElement(e,t)}function Sde({controlled:e,default:t,name:n,state:s="value"}){const{current:r}=h.useRef(e!==void 0),[i,a]=h.useState(t),l=r?e:i,c=h.useCallback(u=>{r||a(u)},[]);return[l,c]}const Cde=()=>{},ur=typeof document<"u"?h.useLayoutEffect:Cde,Ede={...zj};let qw=0;function $de(e,t="mui"){const[n,s]=h.useState(e),r=e||n;return h.useEffect(()=>{n==null&&(qw+=1,s(`${t}-${qw}`))},[n,t]),r}const Pw=Ede.useId;function Ade(e,t){if(Pw!==void 0){const n=Pw();return`${t}-${n}`}return $de(e,t)}function Mde(e){return Ade(e,"base-ui")}const Tde="none",zde="trigger-press";function lR(e,t,n,s){let r=!1,i=!1;const a=_l;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){i=!0},get isCanceled(){return r},get isPropagationAllowed(){return i},trigger:n,...a}}const Nde=[];function cR(e){h.useEffect(e,Nde)}const G0=null;class _de{constructor(){be(this,"callbacks",[]);be(this,"callbacksCount",0);be(this,"nextId",1);be(this,"startId",1);be(this,"isScheduled",!1);be(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let i=0;i<n.length;i+=1)(r=n[i])==null||r.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const W0=new _de;class sn{constructor(){be(this,"currentId",G0);be(this,"cancel",()=>{this.currentId!==G0&&(W0.cancel(this.currentId),this.currentId=G0)});be(this,"disposeEffect",()=>this.cancel)}static create(){return new sn}static request(t){return W0.request(t)}static cancel(t){return W0.cancel(t)}request(t){this.cancel(),this.currentId=W0.request(()=>{this.currentId=G0,t()})}}function uR(){const e=Ph(sn.create).current;return cR(e.disposeEffect),e}function Rde(e){return e==null?e:"current"in e?e.current:e}function dR(e,t=!1,n=!0){const s=uR();return Ac((r,i=null)=>{s.cancel();const a=Rde(e);a!=null&&(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?r():s.request(()=>{function l(){a&&Promise.all(a.getAnimations().map(c=>c.finished)).then(()=>{i!=null&&i.aborted||b1.flushSync(r)}).catch(()=>{if(n){if(i!=null&&i.aborted)return;b1.flushSync(r)}else a.getAnimations().length>0&&a.getAnimations().some(c=>c.pending||c.playState!=="finished")&&l()})}t?s.request(l):l()}))})}function Ide(e,t=!1,n=!1){const[s,r]=h.useState(e&&t?"idle":void 0),[i,a]=h.useState(e);return e&&!i&&(a(!0),r("starting")),!e&&i&&s!=="ending"&&!n&&r("ending"),!e&&!i&&s==="ending"&&r(void 0),ur(()=>{if(!e&&i&&s!=="ending"&&n){const l=sn.request(()=>{r("ending")});return()=>{sn.cancel(l)}}},[e,i,s,n]),ur(()=>{if(!e||t)return;const l=sn.request(()=>{b1.flushSync(()=>{r(void 0)})});return()=>{sn.cancel(l)}},[t,e]),ur(()=>{if(!e||!t)return;e&&i&&s!=="idle"&&r("starting");const l=sn.request(()=>{r("idle")});return()=>{sn.cancel(l)}},[t,e,i,r,s]),h.useMemo(()=>({mounted:i,setMounted:a,transitionStatus:s}),[i,s])}function Lde(e){const{open:t,defaultOpen:n,onOpenChange:s,disabled:r}=e,i=t!==void 0,[a,l]=Sde({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:c,setMounted:u,transitionStatus:d}=Ide(a,!0,!0),[f,p]=h.useState(a),[{height:x,width:g},v]=h.useState({height:void 0,width:void 0}),y=Mde(),[m,k]=h.useState(),b=m??y,[j,A]=h.useState(!1),[M,T]=h.useState(!1),z=h.useRef(null),$=h.useRef(null),E=h.useRef(null),N=h.useRef(null),_=dR(N,!1),R=Ac(B=>{const D=!a,I=lR(zde,B.nativeEvent);if(s(D,I),I.isCanceled)return;const O=N.current;$.current==="css-animation"&&O!=null&&O.style.removeProperty("animation-name"),!j&&!M&&($.current!=null&&$.current!=="css-animation"&&!c&&D&&u(!0),$.current==="css-animation"&&(!f&&D&&p(!0),!c&&D&&u(!0))),l(D),$.current==="none"&&c&&!D&&u(!1)});return ur(()=>{i&&$.current==="none"&&!M&&!a&&u(!1)},[i,M,a,t,u]),h.useMemo(()=>({abortControllerRef:z,animationTypeRef:$,disabled:r,handleTrigger:R,height:x,mounted:c,open:a,panelId:b,panelRef:N,runOnceAnimationsFinish:_,setDimensions:v,setHiddenUntilFound:A,setKeepMounted:T,setMounted:u,setOpen:l,setPanelIdState:k,setVisible:p,transitionDimensionRef:E,transitionStatus:d,visible:f,width:g}),[z,$,r,R,x,c,a,b,N,_,v,A,T,u,l,p,E,d,f,g])}const fR=h.createContext(void 0);function hR(){const e=h.useContext(fR);if(e===void 0)throw new Error(wb(15));return e}let cg=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Ode={[cg.startingStyle]:""},Dde={[cg.endingStyle]:""},pR={transitionStatus(e){return e==="starting"?Ode:e==="ending"?Dde:null}};let v1=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=cg.startingStyle]="startingStyle",e[e.endingStyle=cg.endingStyle]="endingStyle",e}({}),Bde=function(e){return e.panelOpen="data-panel-open",e}({});const Hde={[v1.open]:""},qde={[v1.closed]:""},Pde={open(e){return e?{[Bde.panelOpen]:""}:null}},Ude={open(e){return e?Hde:qde}},xR={...Ude,...pR},$m=h.forwardRef(function(t,n){const{render:s,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:l,open:c,...u}=t,d=Ac(l),f=Lde({open:c,defaultOpen:i,onOpenChange:d,disabled:a}),p=h.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),x=h.useMemo(()=>({...f,onOpenChange:d,state:p}),[f,d,p]),g=jb("div",t,{state:p,ref:n,props:u,stateAttributesMapping:xR});return o.jsx(fR.Provider,{value:x,children:g})});function Fde(){return typeof window<"u"}function Vde(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gde(e){return Fde()?e instanceof HTMLElement||e instanceof Vde(e).HTMLElement:!1}const Wde=h.createContext(void 0);function Kde(e=!1){const t=h.useContext(Wde);if(t===void 0&&!e)throw new Error(wb(16));return t}function Xde(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:r=0,isNativeButton:i}=e,a=s&&t!==!1,l=s&&t===!1;return{props:h.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return s||(u.tabIndex=r,!i&&n&&(u.tabIndex=t?r:-1)),(i&&(t||a)||!i&&n)&&(u["aria-disabled"]=n),i&&(!t||l)&&(u.disabled=n),u},[s,n,t,a,l,i,r])}}function Zde(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:r=!0}=e,i=h.useRef(null),a=Kde(!0)!==void 0,l=Ac(()=>{const p=i.current;return!!((p==null?void 0:p.tagName)==="A"&&(p!=null&&p.href))}),{props:c}=Xde({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:s,isNativeButton:r}),u=h.useCallback(()=>{const p=i.current;Yde(p)&&a&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,a]);ur(u,[u]);const d=h.useCallback((p={})=>{const{onClick:x,onMouseDown:g,onKeyUp:v,onKeyDown:y,onPointerDown:m,...k}=p;return iR({type:r?"button":void 0,onClick(j){if(t){j.preventDefault();return}x==null||x(j)},onMouseDown(j){t||g==null||g(j)},onKeyDown(j){if(t||(j4(j),y==null||y(j)),j.baseUIHandlerPrevented)return;const A=j.target===j.currentTarget&&!r&&!l()&&!t,M=j.key==="Enter",T=j.key===" ";A&&((T||M)&&j.preventDefault(),M&&(x==null||x(j)))},onKeyUp(j){t||(j4(j),v==null||v(j)),!j.baseUIHandlerPrevented&&j.target===j.currentTarget&&!r&&!t&&j.key===" "&&(x==null||x(j))},onPointerDown(j){if(t){j.preventDefault();return}m==null||m(j)}},r?void 0:{role:"button"},c,k)},[t,c,r,l]),f=Ac(p=>{i.current=p,u()});return{getButtonProps:d,buttonRef:f}}function Yde(e){return Gde(e)&&e.tagName==="BUTTON"}const Qde={...Pde,...pR},Am=h.forwardRef(function(t,n){const{panelId:s,open:r,handleTrigger:i,state:a,disabled:l}=hR(),{className:c,disabled:u=l,id:d,render:f,nativeButton:p=!0,...x}=t,{getButtonProps:g,buttonRef:v}=Zde({disabled:u,focusableWhenDisabled:!0,native:p}),y=h.useMemo(()=>({"aria-controls":r?s:void 0,"aria-expanded":r,disabled:u,onClick:i}),[s,u,r,i]);return jb("button",t,{state:a,ref:[n,v],props:[y,x,g],stateAttributesMapping:Qde})});let Jde=function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e}({});function efe(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:s,height:r,hiddenUntilFound:i,keepMounted:a,id:l,mounted:c,onOpenChange:u,open:d,panelRef:f,runOnceAnimationsFinish:p,setDimensions:x,setMounted:g,setOpen:v,setVisible:y,transitionDimensionRef:m,visible:k,width:b}=e,j=h.useRef(!1),A=h.useRef(null),M=h.useRef(d),T=h.useRef(d),z=uR(),$=h.useMemo(()=>n.current==="css-animation"?!k:!d&&!c,[d,c,k,n]),E=Ac(_=>{if(!_)return;if(n.current==null||m.current==null){const D=getComputedStyle(_),I=D.animationName!=="none"&&D.animationName!=="",O=D.transitionDuration!=="0s"&&D.transitionDuration!=="";I&&O||(D.animationName==="none"&&D.transitionDuration!=="0s"?n.current="css-transition":D.animationName!=="none"&&D.transitionDuration==="0s"?n.current="css-animation":n.current="none"),_.getAttribute(Jde.orientation)==="horizontal"||D.transitionProperty.indexOf("width")>-1?m.current="width":m.current="height"}if(n.current!=="css-transition")return;(r===void 0||b===void 0)&&(x({height:_.scrollHeight,width:_.scrollWidth}),T.current&&_.style.setProperty("transition-duration","0s"));let R=-1,B=-1;return R=sn.request(()=>{T.current=!1,B=sn.request(()=>{setTimeout(()=>{_.style.removeProperty("transition-duration")})})}),()=>{sn.cancel(R),sn.cancel(B)}}),N=k4(s,f,E);return ur(()=>{if(n.current!=="css-transition")return;const _=f.current;if(!_)return;let R=-1;if(t.current!=null&&(t.current.abort(),t.current=null),d){const B={"justify-content":_.style.justifyContent,"align-items":_.style.alignItems,"align-content":_.style.alignContent,"justify-items":_.style.justifyItems};Object.keys(B).forEach(D=>{_.style.setProperty(D,"initial","important")}),!T.current&&!a&&_.setAttribute(v1.startingStyle,""),x({height:_.scrollHeight,width:_.scrollWidth}),R=sn.request(()=>{Object.entries(B).forEach(([D,I])=>{I===""?_.style.removeProperty(D):_.style.setProperty(D,I)})})}else{if(_.scrollHeight===0&&_.scrollWidth===0)return;x({height:_.scrollHeight,width:_.scrollWidth});const B=new AbortController;t.current=B;const D=B.signal;let I=null;const O=v1.endingStyle;return I=new MutationObserver(L=>{L.some(q=>q.type==="attributes"&&q.attributeName===O)&&(I==null||I.disconnect(),I=null,p(()=>{x({height:0,width:0}),_.style.removeProperty("content-visibility"),g(!1),t.current===B&&(t.current=null)},D))}),I.observe(_,{attributes:!0,attributeFilter:[O]}),()=>{I==null||I.disconnect(),z.cancel(),t.current===B&&(B.abort(),t.current=null)}}return()=>{sn.cancel(R)}},[t,n,z,i,a,c,d,f,p,x,g]),ur(()=>{if(n.current!=="css-animation")return;const _=f.current;_&&(A.current=_.style.animationName||A.current,_.style.setProperty("animation-name","none"),x({height:_.scrollHeight,width:_.scrollWidth}),!M.current&&!j.current&&_.style.removeProperty("animation-name"),d?(t.current!=null&&(t.current.abort(),t.current=null),g(!0),y(!0)):(t.current=new AbortController,p(()=>{g(!1),y(!1),t.current=null},t.current.signal)))},[t,n,d,f,p,x,g,y,k]),cR(()=>{const _=sn.request(()=>{M.current=!1});return()=>sn.cancel(_)}),ur(()=>{if(!i)return;const _=f.current;if(!_)return;let R=-1,B=-1;return d&&j.current&&(_.style.transitionDuration="0s",x({height:_.scrollHeight,width:_.scrollWidth}),R=sn.request(()=>{j.current=!1,B=sn.request(()=>{setTimeout(()=>{_.style.removeProperty("transition-duration")})})})),()=>{sn.cancel(R),sn.cancel(B)}},[i,d,f,x]),ur(()=>{const _=f.current;_&&i&&$&&(_.setAttribute("hidden","until-found"),n.current==="css-transition"&&_.setAttribute(v1.startingStyle,""))},[i,$,n,f]),h.useEffect(function(){const R=f.current;if(!R)return;function B(D){j.current=!0,v(!0),u(!0,lR(Tde,D))}return R.addEventListener("beforematch",B),()=>{R.removeEventListener("beforematch",B)}},[u,f,v]),h.useMemo(()=>({props:{hidden:$,id:l,ref:N}}),[$,l,N])}let Uw=function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e}({});function tfe(e){const t=Ph(nfe,e).current;return t.next=e,ur(t.effect),t}function nfe(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function sfe(e){const{enabled:t=!0,open:n,ref:s,onComplete:r}=e,i=tfe(n),a=Ac(r),l=dR(s,n);h.useEffect(()=>{t&&l(()=>{n===i.current&&a()})},[t,n,a,l,i])}const Mm=h.forwardRef(function(t,n){const{className:s,hiddenUntilFound:r,keepMounted:i,render:a,id:l,...c}=t,{abortControllerRef:u,animationTypeRef:d,height:f,mounted:p,onOpenChange:x,open:g,panelId:v,panelRef:y,runOnceAnimationsFinish:m,setDimensions:k,setHiddenUntilFound:b,setKeepMounted:j,setMounted:A,setPanelIdState:M,setOpen:T,setVisible:z,state:$,transitionDimensionRef:E,visible:N,width:_,transitionStatus:R}=hR(),B=r??!1,D=i??!1;ur(()=>{if(l)return M(l),()=>{M(void 0)}},[l,M]),ur(()=>{b(B)},[b,B]),ur(()=>{j(D)},[j,D]);const{props:I}=efe({abortControllerRef:u,animationTypeRef:d,externalRef:n,height:f,hiddenUntilFound:B,id:v,keepMounted:D,mounted:p,onOpenChange:x,open:g,panelRef:y,runOnceAnimationsFinish:m,setDimensions:k,setMounted:A,setOpen:T,setVisible:z,transitionDimensionRef:E,visible:N,width:_});sfe({open:g&&R==="idle",ref:y,onComplete(){g&&k({height:void 0,width:void 0})}});const O=h.useMemo(()=>({...$,transitionStatus:R}),[$,R]),L=jb("div",t,{state:O,ref:[n,y],props:[I,{style:{[Uw.collapsiblePanelHeight]:f===void 0?"auto":`${f}px`,[Uw.collapsiblePanelWidth]:_===void 0?"auto":`${_}px`}},c],stateAttributesMapping:xR});return D||B||!D&&p?L:null});function rfe(e){const t=Math.floor(Math.max(0,e)/6e4);if(t<1)return"Updated just now";if(t<60)return`Updated ${t}m ago`;const n=Math.floor(t/60);return n<24?`Updated ${n}h ago`:`Updated ${Math.floor(n/24)}d ago`}function ife({atMs:e}){const t=Bo(3e4);return o.jsx("span",{className:"todo-card__updated",children:rfe(t-e)})}const ofe={pending:"Not started",in_progress:"In progress",completed:"Done"};function afe({status:e}){const t={"aria-label":ofe[e],role:"img",className:"todo-card__status"};return e==="completed"?o.jsx(MT,{...t}):e==="in_progress"?o.jsx(wQ,{...t}):o.jsx(dQ,{...t})}function lfe(e){let t;for(const n of e){const s=n.kind==="run"?n.cot.todoWrittenAtMs:void 0;s!==void 0&&(t===void 0||s>t)&&(t=s)}return t}function cfe({todo:e,writtenThisRun:t,updatedAtMs:n}){const s=(e==null?void 0:e.items)??[],r=s.length,i=s.filter(f=>f.status==="completed").length,a=i===r,[l,c]=h.useState();if(r===0||!t&&a)return null;const u=l??!a,d=s.find(f=>f.status==="in_progress")??s.find(f=>f.status==="pending");return o.jsx("section",{className:"todo-card","data-slot":"todo-card","aria-label":"Todo",children:o.jsxs($m,{open:u,onOpenChange:c,children:[o.jsxs("div",{className:"todo-card__header",children:[o.jsxs(Am,{className:"todo-card__trigger",children:[a?o.jsx(MT,{"aria-label":"All done",role:"img",className:"todo-card__done"}):null,o.jsxs("span",{className:"todo-card__title",children:["Todo ",i,"/",r]}),!u&&d!==void 0?o.jsxs(o.Fragment,{children:[" ",o.jsxs("span",{className:"todo-card__current",children:["· ",d.text]})]}):null,o.jsx(Zi,{"aria-hidden":"true",className:"chat-step__chevron"})]}),n===void 0?null:o.jsx(ife,{atMs:n})]}),o.jsx(Mm,{className:"todo-card__panel",children:o.jsx("ol",{className:"todo-card__items",children:s.map((f,p)=>o.jsxs("li",{className:"todo-card__item","data-status":f.status,children:[o.jsx(afe,{status:f.status}),f.status==="completed"?o.jsx("s",{children:f.text}):o.jsx("span",{children:f.text})]},p))})})]})})}function ufe(e){return e.toolName==="todo_write"&&e.state==="output-available"}function dfe(e){const t=[];let n;for(const s of e){if(s.kind==="interim"){n=void 0,t.push({kind:"interim",key:`segment-${t.length}`,text:s.text});continue}n===void 0&&(n={kind:"trace",key:`segment-${t.length}`,steps:[],counted:[],live:!1},t.push(n)),n.steps.push(s),n.live||(n.live=s.live),s.kind==="tools"&&n.counted.push(...s.tools.filter(r=>!ufe(r)))}return t}const ffe=300,hfe=700;function pfe(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function gR({children:e,className:t="",dwellMs:n=hfe,pageKey:s="",...r}){const i=Math.max(n,ffe),[a,l]=h.useState({key:s,node:e}),[c,u]=h.useState(null),d=h.useRef({key:s,node:e}),f=h.useRef({key:s,node:e}),p=h.useRef(Date.now()),x=h.useRef(null);return h.useEffect(()=>{if(f.current={key:s,node:e},s===d.current.key){d.current=f.current;return}const g=()=>{const y=d.current;d.current=f.current,p.current=Date.now(),l(f.current),u(pfe()?null:y.node)};if(x.current!==null)return;const v=i-(Date.now()-p.current);if(v<=0){g();return}x.current=window.setTimeout(()=>{x.current=null,f.current.key!==d.current.key&&g()},v)},[e,i,s]),h.useEffect(()=>()=>{x.current!==null&&window.clearTimeout(x.current)},[]),o.jsx("span",{className:`chat-inline-pager ${t}`.trim(),"data-slot":"chat-inline-pager",...r,children:o.jsxs("span",{className:"chat-inline-pager__flip",children:[c?o.jsx("span",{className:"chat-inline-pager__page","data-motion":"out",children:c}):null,o.jsx("span",{className:"chat-inline-pager__page","data-motion":c?"in":void 0,onAnimationEnd:g=>{g.target===g.currentTarget&&u(null)},children:s===a.key?e:a.node})]})})}const xfe=/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g;function gfe(e){if(/^\*{1,2}$/.test(e))return"";const t=e.split("**");return t.length%2===0?t.slice(0,-1).join("**")+t[t.length-1]:e}function mfe(e){return e.replace(/(^|\n)\*\*([^*\n]+)\*\*(?=\n|$)/g,"$1$2")}function yfe(e){return e.split(xfe).map((t,n)=>t.startsWith("**")&&t.endsWith("**")&&t.length>4?o.jsx("strong",{children:t.slice(2,-2)},n):t.startsWith("*")&&t.endsWith("*")&&t.length>2&&!t.startsWith("**")?o.jsx("em",{children:t.slice(1,-1)},n):t.startsWith("`")&&t.endsWith("`")&&t.length>2?o.jsx("code",{children:t.slice(1,-1)},n):t)}function vfe({text:e,unwrapLines:t=!1,className:n,...s}){let r=gfe(e);return t&&(r=mfe(r)),o.jsx("span",{className:`chat-thought-md ${n??""}`.trim(),...s,children:yfe(r)})}function Sb({children:e,className:t="",...n}){return o.jsx("span",{className:`text-shimmer ${t}`.trim(),"data-slot":"text-shimmer",...n,children:e})}function kfe(e){if(!(e===void 0||!Number.isFinite(e)||e<0))return e<1e3?"briefly":`${Math.round(e/1e3)}s`}function bfe({className:e="",dwellMs:t,step:n,...s}){const r=n.text.trim(),i=kfe(n.durationMs),a=o.jsx(gR,{dwellMs:t,pageKey:n.live?"live":"settled",children:n.live?o.jsx(Sb,{className:"chat-step__label",children:"Thinking…"}):o.jsx("span",{className:"chat-step__label",children:i?o.jsxs(o.Fragment,{children:["Thought ",o.jsx("span",{className:"chat-step__meta",children:i})]}):"Thought"})}),l=o.jsx("span",{"aria-hidden":"true",className:"chat-tool-kind","data-kind":"thinking","data-slot":"chat-tool-kind",children:o.jsx(uQ,{})});return r?o.jsxs($m,{className:`chat-step ${e}`.trim(),"data-slot":"chat-thought-step",...s,children:[o.jsxs(Am,{className:"chat-step__trigger",children:[l,a,o.jsx(Zi,{"aria-hidden":"true",className:"chat-step__chevron"})]}),o.jsx(Mm,{keepMounted:!0,className:"chat-step__panel",children:o.jsx("div",{className:"chat-step__body",children:o.jsx(vfe,{text:n.text})})})]}):o.jsxs("p",{className:`chat-step chat-step--plain ${e}`.trim(),"data-slot":"chat-thought-step",...s,children:[l,a]})}const wfe=["path","file_path","filePath","command","cmd","query","pattern","url","name","description","task"],Fw=120;function jfe(e){if(!(typeof e!="object"||e===null))for(const t of wfe){const n=e[t];if(typeof n=="string"&&n.length>0)return n.length>Fw?`${n.slice(0,Fw)}…`:n}}function Eo(e){if(!(e!=null&&e.startsWith("mcp__")))return e;const t=e.slice(5),n=t.indexOf("__");return n===-1?t:`${t.slice(0,n)}/${t.slice(n+2)}`}function Cb(e){if(!e)return;let t;try{t=JSON.parse(e)}catch{return}return jfe(t)}function mR(e){if(!(e===void 0||!Number.isFinite(e)||e<0))return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}const Sfe={bash:"shell",shell:"shell",sh:"shell",terminal:"shell",cmd:"shell",grep:"search",find:"search",glob:"search",ls:"search",search:"search",web_search:"web",websearch:"web",webfetch:"web",web_fetch:"web",web:"web",browser:"web",read:"file",read_file:"file",cat:"file",edit:"edit",write:"edit",write_file:"edit",str_replace:"edit"};function yR(e){return(e??"").trim().toLowerCase().replace(/-/g,"_")}function ug(e){return Sfe[yR(e)]??"tool"}function Cfe(e){const t=new Set(e.map(n=>ug(n.toolName)));return t.size===1?[...t][0]:"tool"}function Efe({images:e,testId:t="message-images"}){const[n,s]=h.useState(void 0);return e.length===0?null:o.jsxs("div",{className:"flex flex-wrap justify-end gap-2","data-testid":t,children:[e.map((r,i)=>o.jsx($fe,{image:r,index:i,onOpen:()=>s(i)},i)),n===void 0?null:o.jsx(vR,{images:e,index:n,onIndexChange:s,onClose:()=>s(void 0)})]})}function $fe({image:e,index:t,onOpen:n}){const[s,r]=jT(),i=G3(e,r,"thumbnail");return o.jsx("div",{ref:s,children:o.jsx(px,{src:i.status==="ready"?i.src:void 0,isLoading:i.status==="loading",alt:`Image ${t+1}`,onClick:n})})}const Afe="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";function vR({images:e,index:t,onIndexChange:n,onClose:s}){const[r,i]=h.useState(0),a=e[t],l=G3(a,!0,"original",r);if(l.status==="error")return o.jsx(Us,{isOpen:!0,width:420,onOpenChange:u=>u?void 0:s(),children:o.jsx(Cs,{header:o.jsx(Hr,{title:"Image unavailable",onOpenChange:()=>s()}),content:o.jsx(Es,{children:o.jsxs(re,{gap:3,padding:3,children:[o.jsx("div",{role:"alert",children:o.jsx(K,{children:"Couldn't load the original image."})}),o.jsx("div",{children:o.jsx(Q,{label:"Try again",onClick:()=>i(u=>u+1)})})]})})})});const c=e.map((u,d)=>({src:d===t&&l.status==="ready"?l.src:S9(u,"thumbnail")??S9(u,"preview")??Afe,alt:`Image ${d+1}`}));return o.jsx(FC,{isOpen:!0,media:c,index:t,onIndexChange:n,onOpenChange:u=>{u||s()}})}const Mfe={shell:xm,search:SQ,web:gQ,file:fQ,edit:oQ,tool:mQ};function ex({className:e="",kind:t,...n}){const s=Mfe[t];return o.jsx("span",{"aria-hidden":"true",className:`chat-tool-kind ${e}`.trim(),"data-kind":t,"data-slot":"chat-tool-kind",...n,children:o.jsx(s,{})})}const Tfe={"input-streaming":"running","input-available":"running","output-available":"complete","output-error":"error"};function kR(e){var t,n;return e.argsText!=null||e.output!=null||(((t=e.children)==null?void 0:t.length)??0)>0||e.detail!=null||(((n=e.images)==null?void 0:n.length)??0)>0}function bR({tool:e,className:t,...n}){var s,r;return o.jsxs("div",{className:t,...n,children:[e.detail!==void 0&&e.detail!==null?e.detail:o.jsxs(o.Fragment,{children:[e.argsText!=null?o.jsx("pre",{className:"chat-tool__section","data-slot":"chat-tool-args",children:e.argsText}):null,e.output!==void 0?o.jsx("pre",{className:"chat-tool__section","data-slot":"chat-tool-result",children:e.output}):null]}),(s=e.children)!=null&&s.length?o.jsx("ol",{className:"chat-tool-step__list","data-slot":"chat-tool-children",children:e.children.map((i,a)=>o.jsxs("li",{className:"chat-tool-step__item",children:[o.jsx(ex,{kind:ug(i.toolName)}),o.jsx(wR,{tools:[i]})]},i.toolCallId??a))}):null,(r=e.images)==null?void 0:r.map((i,a)=>o.jsx(zfe,{image:i},a))]})}function zfe({image:e}){const[t,n]=jT(),[s,r]=h.useState(!1),i=G3(e,n,"preview");return i.status==="loading"?o.jsx("div",{ref:t,"data-testid":"tool-image-loading",children:o.jsx(gc,{height:160,width:"100%"})}):i.status==="error"?o.jsx("div",{ref:t,role:"img","aria-label":"Image unavailable",className:"flex h-40 w-full items-center justify-center text-muted",children:o.jsx(X3,{"aria-hidden":"true",className:"size-6"})}):o.jsxs("div",{ref:t,children:[o.jsx("button",{type:"button","aria-label":"View image",className:"block min-h-11 min-w-11 max-w-full cursor-zoom-in",onClick:()=>r(!0),children:o.jsx("img",{src:i.src,alt:"",style:{maxWidth:"100%"}})}),s?o.jsx(vR,{images:[e],index:0,onIndexChange:()=>{},onClose:()=>r(!1)}):null]})}function Nfe(e,t){const n=kR(e)?o.jsx(bR,{tool:e}):void 0;return{name:Eo(e.toolName)??"tool",status:Tfe[e.state],target:Cb(e.argsText),...e.diffStat?{additions:e.diffStat.additions,deletions:e.diffStat.deletions}:{},duration:mR(e.durationMs),errorMessage:e.state==="output-error"?e.output:void 0,key:e.toolCallId??`tool-${t}`,resultDetail:n}}function wR({tools:e,className:t="",...n}){return e.length?o.jsx("div",{className:`chat-tool ${t}`.trim(),"data-slot":"chat-tool-group","data-tool-count":e.length,"data-state":e.length===1?e[0].state:void 0,...n,children:o.jsx(wC,{calls:e.map(Nfe)})}):null}const $f={past:"Ran",noun:["command","commands"]},jy={past:"Read",noun:["file","files"]},Vw={past:"Edited",noun:["file","files"]},Gw={past:"Wrote",noun:["file","files"]},Ww={past:"Searched",noun:["pattern","patterns"]},Kw={past:"Searched",noun:["path","paths"]},_fe={past:"Listed",noun:["directory","directories"]},Xw={past:"Searched",noun:["web page","web pages"]},K0={past:"Fetched",noun:["page","pages"]},Rfe={bash:$f,shell:$f,sh:$f,terminal:$f,cmd:$f,read:jy,read_file:jy,cat:jy,edit:Vw,str_replace:Vw,write:Gw,write_file:Gw,grep:Ww,find:Kw,glob:Kw,ls:_fe,search:Ww,web_search:Xw,websearch:Xw,webfetch:K0,web_fetch:K0,web:K0,browser:K0},jR={past:"Used",noun:["tool","tools"]};function Zw(e){return Rfe[yR(e)]??jR}const Yw=72;function Ife(e){return e.length<=Yw?e:e.includes("/")&&!e.includes(" ")?`…${e.slice(-71)}`:`${e.slice(0,Yw-1)}…`}function Qw(e,[t,n]){return e!==1?`${e} ${n}`:`${t==="tool"?"a":"1"} ${t}`}function SR(e){if(e.length===1){const[n]=e,s=Zw(n.toolName),r=Cb(n.argsText);return r?`${s.past} ${Ife(r)}`:s===jR?`Used ${Eo(n.toolName)??"a tool"}`:`${s.past} ${Qw(1,s.noun)}`}const t=new Map;for(const n of e){const s=Zw(n.toolName),r=`${s.past}:${s.noun[1]}`,i=t.get(r)??{verb:s,count:0};i.count+=1,t.set(r,i)}return[...t.values()].map(({verb:n,count:s},r)=>{const i=`${n.past} ${Qw(s,n.noun)}`;return r===0?i:i.charAt(0).toLowerCase()+i.slice(1)}).join(", ")}function CR(e){const t=e.filter(s=>s.state==="output-error").length,n=e.reduce((s,r)=>r.diffStat?{additions:((s==null?void 0:s.additions)??0)+r.diffStat.additions,deletions:((s==null?void 0:s.deletions)??0)+r.diffStat.deletions}:s,void 0);return{failed:t,diffStat:n}}function ER({failed:e,diffStat:t}){return o.jsxs(o.Fragment,{children:[t?o.jsxs(o.Fragment,{children:[" ",o.jsxs("span",{className:"chat-step__meta","data-slot":"chat-tool-diff-stat",children:[o.jsxs("span",{className:"text-success",children:["+",t.additions]})," ",o.jsxs("span",{className:"text-danger",children:["-",t.deletions]})]})]}):null,e>0?o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"chat-step__meta chat-step__meta--error",children:e===1?"1 failed":`${e} failed`})]}):null]})}function $R(e){const t=[];for(const n of e.children??[])t.push(n,...$R(n));return t}function Lfe({className:e="",dwellMs:t,step:n,...s}){const{tools:r}=n,{failed:i,diffStat:a}=CR(r),l=r.flatMap($R),c=l.length,u=l.filter(y=>y.state==="output-error").length,d=r.reduce((y,m)=>y+(m.durationMs??0),0),f=r.find(y=>y.toolCallId===n.activeToolCallId)??r[r.length-1];let p,x=f;for(;x;){const y=(x.children??[]).filter(k=>k.state==="input-available"),m=y[y.length-1];if(!m)break;p=m,x=m}const g=n.live?ug(f==null?void 0:f.toolName):Cfe(r),v=n.live?`running:${(f==null?void 0:f.toolCallId)??"none"}`:"settled";return o.jsxs($m,{className:`chat-step chat-tool-step ${e}`.trim(),"data-slot":"chat-tool-step",...s,children:[o.jsxs(Am,{className:"chat-step__trigger",children:[o.jsx(gR,{dwellMs:t,pageKey:v,children:n.live?o.jsxs("span",{className:"chat-tool-step__page",children:[o.jsx(ex,{kind:g}),o.jsx(Sb,{className:"chat-step__label",children:f!=null&&f.toolName?p!=null&&p.toolName?`Running ${Eo(f.toolName)} › ${Eo(p.toolName)}…`:`Running ${Eo(f.toolName)}…`:"Running…"})]}):o.jsxs("span",{className:"chat-tool-step__page",children:[o.jsx(ex,{kind:g}),o.jsx("span",{className:"chat-step__label",children:SR(r)}),c>0?o.jsx("span",{className:"chat-step__meta","data-slot":"chat-tool-nested-count",children:c===1?"1 nested call":`${c} nested calls`}):null,u>0?o.jsx("span",{className:"chat-step__meta chat-step__meta--error","data-slot":"chat-tool-nested-failed",children:u===1?"1 nested failed":`${u} nested failed`}):null,o.jsx(ER,{failed:i,diffStat:a}),d>0?o.jsx("span",{className:"chat-step__meta",children:mR(d)}):null]})}),o.jsx(Zi,{"aria-hidden":"true",className:"chat-step__chevron"})]}),o.jsx(Mm,{keepMounted:!0,className:"chat-step__panel",children:r.length===1?kR(r[0])?o.jsx("div",{className:"chat-tool-step__detail","data-slot":"chat-tool-step-detail",children:o.jsx(bR,{tool:r[0]})}):null:o.jsx("ol",{className:"chat-tool-step__list",children:r.map((y,m)=>o.jsxs("li",{className:"chat-tool-step__item",children:[o.jsx(ex,{kind:ug(y.toolName)}),o.jsx(wR,{tools:[y]})]},y.toolCallId??m))})})]})}function Ofe(e){if(e===void 0||!Number.isFinite(e)||e<0)return;const t=Math.max(1,Math.round(e/1e3));if(t<60)return`${t}s`;if(t<3600){const i=Math.floor(t/60),a=t%60;return`${i}m ${a}s`}const n=Math.floor(t/3600),s=Math.floor(t%3600/60),r=t%60;return`${n}h ${s}m ${r}s`}function Dfe(e){const t=Math.max(0,e)/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${(t%60).toFixed(1)}s`}function Bfe({children:e,className:t="",phase:n,...s}){return n==="hidden"?null:o.jsx("div",{className:`chain-of-thought ${t}`.trim(),"data-phase":n,"data-slot":"chain-of-thought",...s,children:e})}function Hfe({startedAtMs:e,running:t}){const[n,s]=h.useState(()=>Date.now()),[r,i]=h.useState(t);return t&&!r&&i(!0),h.useEffect(()=>{if(!t)return;s(Date.now());const a=window.setInterval(()=>s(Date.now()),100);return()=>{window.clearInterval(a),s(Date.now())}},[t]),e===void 0||!r?null:o.jsxs(o.Fragment,{children:[" ",o.jsxs("span",{className:"chat-step__meta","data-slot":"chat-trace-clock",children:["· ",Dfe(n-e)]})]})}function qfe(e){const t=e.findLast(s=>s.live);if((t==null?void 0:t.kind)==="thinking")return"Thinking…";if((t==null?void 0:t.kind)!=="tools")return;const n=t.tools.find(s=>s.toolCallId===t.activeToolCallId)??t.tools[t.tools.length-1];return n!=null&&n.toolName?`Running ${Eo(n.toolName)}…`:"Running…"}function Jw({className:e="",clock:t,counted:n,live:s=!1,steps:r,tail:i,waiting:a,...l}){const c=n.filter(x=>x.state==="output-available"||x.state==="output-error"),u=s?qfe(r)??a:void 0,d=r.some(x=>x.kind==="thinking"&&!x.live),f=c.length>0?SR(c):u!==void 0?void 0:d?"Thought":"Updated the todo list",p=o.jsxs(o.Fragment,{children:[f===void 0?null:o.jsx("span",{className:"chat-trace__label",children:f}),o.jsx(ER,{...CR(c)}),u===void 0?null:o.jsxs(o.Fragment,{children:[f===void 0?null:o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"chat-step__meta",children:"·"})," "]}),o.jsx(Sb,{className:"chat-trace__label","data-slot":"chat-trace-current",children:u})]}),i===void 0?null:o.jsxs(o.Fragment,{children:[" ",o.jsxs("span",{className:"chat-step__meta","data-slot":"chat-trace-tail",children:["· ",i]})]}),t===void 0?null:o.jsx(Hfe,{...t})]});return r.length===0?o.jsx("div",{className:`chat-trace ${e}`.trim(),"data-slot":"chat-trace",...l,children:o.jsx("p",{className:"chain-of-thought__label",children:p})}):o.jsxs($m,{className:`chat-trace ${e}`.trim(),"data-slot":"chat-trace",...l,children:[o.jsxs(Am,{className:"chain-of-thought__trigger","data-slot":"chat-trace-trigger",children:[p,o.jsx(Zi,{"aria-hidden":"true",className:"chat-step__chevron"})]}),o.jsx(Mm,{keepMounted:!0,className:"chain-of-thought__content","data-slot":"chain-of-thought-content",children:o.jsx("ol",{className:"chain-of-thought__steps","data-slot":"chain-of-thought-steps",children:r.map(x=>o.jsx("li",{className:"chain-of-thought__step","data-slot":"chain-of-thought-step",children:x.kind==="thinking"?o.jsx(bfe,{step:x}):o.jsx(Lfe,{step:x})},x.id))})})]})}const S4=h.createContext(!1);function Pfe(e){var l;if(!e||/^[#?]/.test(e)||e.startsWith("//")||e.includes("\\")||/^(mailto|tel|data|javascript):/i.test(e)||/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(e))return null;const[t,n=""]=e.split("#",2),s=/:(\d+)(?::\d+)?$/.exec(t??""),r=s?t.slice(0,s.index):t??"";if(!r||r.endsWith("/"))return null;const i=Number(((l=/^L(\d+)(?:-L?\d+)?$/.exec(n))==null?void 0:l[1])??(s==null?void 0:s[1])),a=r.slice(r.lastIndexOf("/")+1);return{path:r,name:a,...Number.isSafeInteger(i)&&i>0?{line:i}:{}}}function Ufe(e){return typeof e=="string"?e:Array.isArray(e)&&e.every(t=>typeof t=="string")?e.join(""):null}function Ffe({href:e,children:t}){const n=Pfe(e);if(!n){const i=/^https?:\/\//.test(e);return o.jsx(Hg,{color:"accent",hasUnderline:!0,href:e,type:"inherit",...i?{target:"_blank",rel:"noopener noreferrer"}:{},children:o.jsx(S4.Provider,{value:!0,children:t})})}const s=Ufe(t),r=s!==null&&(s===e||s===n.path||n.line!==void 0&&s===`${n.path}:${n.line}`);return o.jsxs("a",{className:"chat-file-link","data-slot":"chat-file-link",href:e,title:n.line?`${n.path}:${n.line}`:n.path,children:[o.jsx(Qd,{"aria-hidden":!0,className:"chat-file-link__icon"}),o.jsx(S4.Provider,{value:!0,children:r?n.line?`${n.name}:${n.line}`:n.name:t})]})}const AR=3,MR=h.createContext(void 0);function TR({children:e}){const t=h.useContext(MR),n=h.useContext(S4),s=o.jsx(t5,{className:"chat-inline-code","data-slot":"chat-inline-code",children:e}),r=typeof e=="string"?e.trim():e;return!n&&typeof r=="string"&&(t!=null&&t.has(r))?o.jsx("a",{href:r,className:"chat-inline-code-link","data-slot":"chat-inline-code-link",title:r,children:s}):s}const zR={inlineCode:TR},NR={inlineCode:TR,link:Ffe};function _R({children:e,fileLinks:t=!1,linkedInlineCode:n,className:s="",...r}){return o.jsx("div",{className:`chat-markdown ${s}`.trim(),"data-slot":"chat-markdown","data-testid":"markdown-renderer",...r,children:o.jsx(MR.Provider,{value:t?n:void 0,children:o.jsx(b5,{components:t?NR:zR,density:"compact",headingLevelStart:AR,children:e})})})}function Vfe({children:e,isStreaming:t=!1,fileLinks:n=!1,className:s="",...r}){return o.jsx("div",{className:`chat-markdown chat-markdown--stream ${s}`.trim(),"data-is-streaming":String(!!t),"data-slot":"chat-stream-markdown","data-testid":"stream-markdown-renderer",...r,children:o.jsx(b5,{components:n?NR:zR,density:"compact",headingLevelStart:AR,isStreaming:t,children:e})})}function Gfe({children:e,className:t="",...n}){return o.jsx(f5,{className:`chat-message ${t}`.trim(),"data-slot":"chat-message-user",sender:"user",...n,children:e})}function Wfe({children:e,className:t="",...n}){return o.jsx(f5,{className:`chat-message ${t}`.trim(),"data-slot":"chat-message-assistant",sender:"assistant",...n,children:e})}function Kfe({children:e,className:t="",...n}){return o.jsx(vC,{className:t||void 0,"data-slot":"chat-message-bubble",...n,children:e})}function Xfe({children:e,className:t="",...n}){return o.jsx("div",{className:`chat-message__body ${t}`.trim(),"data-slot":"chat-message-body",...n,children:e})}function Zfe({children:e,className:t="",...n}){return o.jsx("div",{className:`chat-message__content ${t}`.trim(),"data-slot":"chat-message-content",...n,children:e})}function Tm({"aria-label":e,tooltip:t,onPress:n,children:s,className:r="",...i}){return o.jsx("button",{"aria-label":e,className:`chat-message__action ${r}`.trim(),"data-slot":"chat-message-action",title:t,type:"button",onClick:n,...i,children:s})}function Mc({children:e,className:t="",...n}){return o.jsx("div",{className:`chat-message__actions ${t}`.trim(),"data-slot":"chat-message-actions",...n,children:e})}function Yfe(e){return o.jsx(Tm,{...e,children:o.jsx(K3,{"aria-hidden":"true",size:16})})}function Qfe(e){return o.jsx(Tm,{...e,children:o.jsx($Q,{"aria-hidden":"true",size:16})})}function Jfe(e){return o.jsx(Tm,{...e,children:o.jsx(EQ,{"aria-hidden":"true",size:16})})}Mc.Copy=Yfe;Mc.ThumbsUp=Qfe;Mc.ThumbsDown=Jfe;const za={User:Gfe,Assistant:Wfe,Bubble:Kfe,Body:Xfe,Content:Zfe,Action:Tm},e1e=new Set(["ECONNREFUSED","ETIMEDOUT","ENOTFOUND","EAI_AGAIN","ECONNRESET","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_SOCKET"]);function t1e(e){if(typeof e=="string")return e;if(e instanceof Error)return e.message;if(e&&typeof e=="object"&&"message"in e){const t=e.message;if(typeof t=="string")return t}return""}function RR(e,t=0){if(t>4)return{message:""};const n=t1e(e);if(!e||typeof e!="object")return{message:n};const s=e,r=n1e(s),i=typeof s.code=="string"&&e1e.has(s.code)?s.code:void 0,a=RR(s.cause,t+1),l=a.message&&!n.includes(a.message)?a.message:"";return{status:r??a.status,networkCode:i??a.networkCode,message:[n,l].filter(Boolean).join(" ")}}function n1e(e){if(typeof e.statusCode=="number")return e.statusCode;if(typeof e.status=="number")return e.status;const t=e.$metadata;if(ej(t)&&typeof t.httpStatusCode=="number")return t.httpStatusCode;const n=e.$response;if(ej(n)&&typeof n.statusCode=="number")return n.statusCode}function ej(e){return typeof e=="object"&&e!==null}const s1e=/network.?error|connection.?error|connection.?refused|connection.?lost|other side closed|fetch failed|getaddrinfo|ENOTFOUND|EAI_AGAIN|upstream.?connect|reset before headers|socket hang up|socket connection was closed|timed? out|timeout|terminated|websocket.?closed|websocket.?error|ended without|stream ended before message_stop|stream ended before a terminal response event|http2 request did not get a response|ECONNREFUSED|ETIMEDOUT|ECONNRESET|UND_ERR_/i,r1e=/invalid_grant|oauth refresh failed|refresh.?token/i;function i1e(e){return e.status===401||/\b401\b/.test(e.message)?"auth":e.status===403||/\b403\b/.test(e.message)||/\b(?:plan|subscription|entitlement)\b/i.test(e.message)?"entitlement":e.networkCode||s1e.test(e.message)?"network":/invalid.?api.?key|authentication_error|unauthorized/i.test(e.message)||r1e.test(e.message)?"auth":"unknown"}function o1e(e){return i1e(RR(e))}function a1e(e){const t=o1e(e);return t==="auth"?{title:"Provider authentication failed",description:"The provider rejected the credentials. Sign in again or update them in Provider settings, then retry. You can also choose another model."}:t==="entitlement"?{title:"This model is not included in your subscription plan",description:"Test the connection in Settings → Providers."}:/\b429\b|rate.?limit|quota.?exceeded/i.test(e)?{title:"Provider limit reached",description:"Wait a moment, or choose another model and retry."}:{title:"Run failed",description:/[{}\n]/.test(e)?"The provider could not complete this request. Check the error details, then retry or choose another model.":e}}function l1e({error:e,onRetry:t,onOpenProviderSettings:n,modelControl:s,className:r,...i}){const[a,l]=h.useState(!1),[c,u]=h.useState(!1),d=h.useRef(!1),[f,p]=h.useState(null),x=a1e(e),g=async()=>{if(!(!t||d.current)){d.current=!0,l(!0),p(null);try{await t()}catch(v){p(v instanceof Error?v.message:"Retry could not start.")}finally{d.current=!1,l(!1)}}};return o.jsxs(re,{className:r,gap:2,...i,children:[o.jsx(Oe,{status:"error",title:x.title,description:x.description}),o.jsxs(ke,{gap:2,wrap:"wrap",children:[n?o.jsx(Q,{label:"Provider settings",size:"sm",variant:"secondary",onClick:n}):null,s,t?o.jsx(Q,{label:"Retry request",size:"sm",variant:"secondary",isDisabled:a,onClick:()=>void g()}):null]}),f?o.jsx(K,{role:"alert",style:{color:"var(--danger)"},children:f}):null,o.jsx(Bg,{trigger:o.jsx(K,{type:"body",size:"sm",color:"secondary",children:"Error details"}),isOpen:c,onOpenChange:u,children:c?o.jsx(K,{as:"div",type:"body",size:"sm",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:e}):null})]})}const c1e={time:{hour:"numeric",minute:"2-digit"},date:{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},year:{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},full:{dateStyle:"full",timeStyle:"long"}},tj=new Map;function nj(e,t,n){const s=`\0${n}`;let r=tj.get(s);return r===void 0&&(r=new Intl.DateTimeFormat(t,c1e[n]),tj.set(s,r)),r.format(e)}function u1e(e,t=Date.now(),n){if(!Number.isFinite(e))return;const s=new Date(e),r=new Date(t);if(Number.isNaN(s.getTime())||Number.isNaN(r.getTime()))return;const i=s.getFullYear()===r.getFullYear()&&s.getMonth()===r.getMonth()&&s.getDate()===r.getDate(),a=s.getFullYear()===r.getFullYear();return{label:nj(s,n,i?"time":a?"date":"year"),full:nj(s,n,"full"),iso:s.toISOString()}}const sj={done:"Done",failed:"Failed",running:"Running"};function IR(e){const t=Math.max(0,Math.floor(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function d1e({startedAt:e}){const t=Bo(1e3);return o.jsx(o.Fragment,{children:IR(t-e)})}function f1e({tool:e,summary:t,openInPanel:n}){const s=bb(e),r=(s==null?void 0:s.kind)==="subagent"?s:void 0,i=e.state==="output-available"?"done":e.state==="output-error"?"failed":"running",a=t!==void 0?Dr(t):Cb(e.argsText)??"Subagent",l=r==null?void 0:r.startedAt,c=r==null?void 0:r.endedAt,u=[sj[i],(t==null?void 0:t.role)===void 0?void 0:`@${t.role}`,r==null?void 0:r.model,l===void 0?void 0:i==="running"?o.jsx(d1e,{startedAt:l},"elapsed"):c===void 0?void 0:IR(c-l)];return o.jsxs(re,{className:"pigui-subagent-card rounded-lg border border-border p-3",gap:1,"data-slot":"subagent-card","data-status":i,children:[o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Fi,{variant:i==="failed"?"error":i==="running"?"success":"neutral",label:sj[i],isPulsing:i==="running"}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:a}),r===void 0?null:o.jsx(Q,{label:"View",variant:"secondary",size:"sm",onClick:()=>n(r.conversationId)})]}),o.jsx("div",{className:"text-xs text-muted",children:u.map((d,f)=>d===void 0||d===""?null:f===0?o.jsx("span",{children:d},f):o.jsxs("span",{children:[" · ",d]},f))}),i==="running"&&(t==null?void 0:t.activity)!==void 0?o.jsxs("div",{className:"text-xs text-muted",children:["→ ",Eo(t.activity.tool)??t.activity.tool,t.activity.target===void 0?"":` ${t.activity.target}`]}):null,i==="failed"&&e.output!==void 0&&e.output!==""?o.jsx("div",{className:"text-xs text-muted",children:e.output}):null]})}function h1e({tools:e,summaryOf:t,openInPanel:n}){return e.length===0?null:o.jsx(re,{gap:2,className:"pigui-subagent-cards",children:e.map(({key:s,tool:r})=>{const i=bb(r);return o.jsx(f1e,{tool:r,summary:(i==null?void 0:i.kind)==="subagent"?t==null?void 0:t(i.conversationId):void 0,openInPanel:n},s)})})}const Sy=(e,t,n)=>e.startsWith(`${t} ${n}`)?e.slice(t.length+1+n.length):e.slice(t.length+1);function LR(e){const t=[];let n,s=0,r=0,i=!1;const a=c=>({path:c,isNew:!1,isDeleted:!1,binary:!1,additions:0,deletions:0,lines:[]}),l=()=>{n!==void 0&&(n.path===""&&n.oldPath!==void 0&&(n.path=n.oldPath),t.push(n))};for(const c of e.split(`
|
|
396
|
-
`)){if((s>0||r>0)&&n!==void 0){c.startsWith("\\")?n.lines.push({kind:"ctx",text:c}):c.startsWith("+")?(n.additions+=1,n.lines.push({kind:"add",text:c}),r-=1):c.startsWith("-")?(n.deletions+=1,n.lines.push({kind:"del",text:c}),s-=1):(n.lines.push({kind:"ctx",text:c}),s-=1,r-=1);continue}if(c.startsWith("@@")){const u=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/.exec(c);n!==void 0&&u!==null&&(s=u[2]===void 0?1:Number(u[2]),r=u[4]===void 0?1:Number(u[4]),n.lines.push({kind:"meta",text:c}));continue}if(c.startsWith("diff --git ")){l();const u=/^diff --git a\/(\S+) b\/(\S+)$/.exec(c);n=a((u==null?void 0:u[2])??c.slice(11)),i=!0;continue}if(c.startsWith("--- ")){n!==void 0&&i?(i=!1,c==="--- /dev/null"?n.isNew=!0:n.oldPath=Sy(c,"---","a/")):(l(),n=a(""),c==="--- /dev/null"?n.isNew=!0:n.oldPath=Sy(c,"---","a/"));continue}n!==void 0&&(c.startsWith("+++ ")?c==="+++ /dev/null"?n.isDeleted=!0:n.path=Sy(c,"+++","b/"):c.startsWith("new file mode")?n.isNew=!0:c.startsWith("deleted file mode")?n.isDeleted=!0:c.startsWith("rename from ")?n.oldPath=c.slice(12):c.startsWith("rename to ")?n.path=c.slice(10):c.startsWith("copy from ")?n.oldPath=c.slice(10):c.startsWith("copy to ")?n.path=c.slice(8):(c.startsWith("Binary files")||c.startsWith("GIT binary patch"))&&(n.binary=!0))}return l(),t}const p1e=h.lazy(()=>jg(()=>import("./highlighted-diff-Dn5ifsvK.js").then(e=>e.j),[]).catch(()=>({default:({fallback:e})=>e}))),x1e={fontFamily:"var(--font-family-code)",fontSize:"var(--font-size-sm)",lineHeight:"var(--line-height-sm, 1.5)",overflowX:"auto",whiteSpace:"pre",borderRadius:"var(--radius-sm, 6px)"},g1e={add:{backgroundColor:"var(--color-success-muted)",color:"var(--color-text-primary)"},del:{backgroundColor:"var(--color-error-muted)",color:"var(--color-text-primary)"},ctx:{color:"var(--color-text-secondary)"},meta:{color:"var(--color-text-accent)",backgroundColor:"var(--color-background-muted)"}},m1e=400;function OR({patch:e,collapsible:t=!1}){const n=h.useMemo(()=>LR(e),[e]),s=t&&n.reduce((a,l)=>a+l.lines.length,0)>m1e,[r,i]=h.useState(new Map);return n.length===0?o.jsx(K,{type:"supporting",children:"No changes."}):o.jsx(re,{gap:2,children:n.map((a,l)=>{const c=r.get(a.path)??!s,u=o.jsxs(o.Fragment,{children:[o.jsx(K,{type:"supporting",weight:"semibold",maxLines:1,children:a.oldPath!==void 0&&a.oldPath!==a.path?`${a.oldPath} → ${a.path}`:a.path}),a.isNew?o.jsx(Ln,{label:"new",color:"green",size:"sm"}):null,a.isDeleted?o.jsx(Ln,{label:"deleted",color:"red",size:"sm"}):null,o.jsxs(K,{type:"supporting",children:["+",a.additions," −",a.deletions]})]});return o.jsxs(re,{gap:0,children:[t?o.jsx(y1e,{open:c,onToggle:()=>i(d=>new Map(d).set(a.path,!c)),children:u}):o.jsx(ke,{gap:2,vAlign:"center",padding:1,children:u}),c?a.binary===!0?o.jsx(K,{type:"supporting",children:"Binary file"}):a.lines.length===0?null:o.jsx(h.Suspense,{fallback:o.jsx(rj,{lines:a.lines}),children:o.jsx(p1e,{patch:e,path:a.path,fallback:o.jsx(rj,{lines:a.lines})})}):null]},`${a.path}-${l}`)})})}function rj({lines:e}){return o.jsx("div",{style:x1e,children:e.map((t,n)=>o.jsx("div",{style:g1e[t.kind],children:t.text},n))})}function y1e({open:e,onToggle:t,children:n}){return o.jsxs("button",{type:"button","aria-expanded":e,className:"flex min-w-0 items-center gap-2 rounded-[var(--radius-sm,6px)] p-1 text-left hover:bg-[var(--color-overlay-hover)] focus-visible:outline-2 focus-visible:outline-[var(--color-border-emphasized)]",onClick:t,children:[o.jsx(Zi,{className:`size-3.5 shrink-0 text-muted ${e?"rotate-90":""}`,"aria-hidden":"true"}),n]})}function v1e(e){return e.kind==="diff"?o.jsx(OR,{patch:e.patch}):void 0}function k1e(e){const t=n=>{var a;const s=bb(n),r=s===void 0?void 0:v1e(s),i=(a=n.children)==null?void 0:a.map(t);return r===void 0&&i===void 0?n:{...n,...r===void 0?{}:{detail:r},...i===void 0?{}:{children:i}}};return{...e,steps:e.steps.map(n=>n.kind==="tools"?{...n,tools:n.tools.map(t)}:n)}}function b1e({entry:e,connected:t,openInPanel:n,onOpenFork:s,onFork:r,canFork:i=!0,forkDisabled:a=!1,forksAt:l,summaryOf:c,onRetry:u,onRetrySubmission:d,onEditSubmission:f,submissionEditDisabled:p,submissionEditTooltip:x,todo:g,today:v}){switch(e.kind){case"user":return o.jsx(w1e,{entry:e,onRetrySubmission:d,onEditSubmission:f,submissionEditDisabled:p,submissionEditTooltip:x,today:v});case"run":return o.jsx(j1e,{entry:e,connected:t,openInPanel:n,onOpenFork:s,onFork:r,canFork:i,forkDisabled:a,forksAt:l,summaryOf:c,onRetry:u,todo:g,today:v});case"compaction":return o.jsx(Uy,{variant:"divider",children:"Earlier context summarized"});case"reset":return o.jsx(Uy,{variant:"divider",children:"New context"})}}function w1e({entry:e,onRetrySubmission:t,onEditSubmission:n,submissionEditDisabled:s=!1,submissionEditTooltip:r,today:i}){const a=e.local,l=a!==void 0&&(e.status==="unknown"||e.status==="failed"),c=a!==void 0&&e.status==="failed",u=s,d=e.status==="failed"?"error":e.status==="unknown"?"sending":e.status,f=e.text===""?null:o.jsx(Mc,{className:"chat-message__copy",children:o.jsx(Mc.Copy,{"aria-label":"Copy",tooltip:"Copy",onPress:()=>{var g;(g=navigator.clipboard)==null||g.writeText(e.text)}})}),p=o.jsx(Og,{...e.timestamp===void 0?{}:{timestamp:o.jsx(DR,{timestamp:e.timestamp,today:i})},footer:d==="delivered"?o.jsx("span",{title:"Delivered",children:o.jsx(Te,{icon:"checkDouble",size:"xsm",label:"Delivered"})}):void 0,status:d==="delivered"?void 0:d,className:"chat-message__metadata"}),x=a!==void 0||f===null;return o.jsx(za.User,{"data-slot":a===void 0?"chat-message-user":"chat-message-local",children:o.jsxs("div",{className:"flex flex-col items-end gap-1",children:[e.attachments.length===0?null:o.jsx(tie,{attachments:e.attachments,...a===void 0?{}:{testId:"local-message-attachments"}}),e.images.length===0?null:o.jsx(Efe,{images:e.images,...a===void 0?{}:{testId:"local-message-images"}}),e.text===""?null:o.jsx(za.Bubble,{children:o.jsx(za.Content,{children:o.jsx(eie,{text:e.text,names:e.skills})})}),o.jsxs("div",{className:`chat-message__metadata-row${x?" chat-message__metadata-row--persistent":""}`,children:[f,e.status==="unknown"?o.jsx(F4,{locale:"en",overrides:{en:{"@astryx.chat.status.sending":"Not confirmed"}},children:p}):p,(a==null?void 0:a.error)===void 0?null:o.jsx("span",{className:"chat-message__local-error",title:a.error,children:a.error}),a===void 0||!l||t===void 0?null:o.jsx(Q,{label:"Retry",variant:"ghost",size:"sm",className:"chat-message__local-action",onClick:()=>t(a.requestId)}),a===void 0||!c||n===void 0?null:o.jsx(Q,{label:"Edit",variant:"ghost",size:"sm",className:"chat-message__local-action",isDisabled:u,...u&&r!==void 0?{tooltip:r}:{},onClick:()=>n(a.requestId)})]})]})})}function DR({timestamp:e,today:t}){const n=u1e(e,t);return n===void 0?null:o.jsx("time",{className:"chat-message__time","data-slot":"chat-message-time",dateTime:n.iso,title:n.full,children:n.label})}function j1e({entry:e,connected:t,openInPanel:n,onOpenFork:s,onFork:r,canFork:i=!0,forkDisabled:a=!1,forksAt:l,summaryOf:c,onRetry:u,todo:d,today:f}){const{view:p,subagents:x}=h.useMemo(()=>rde(e.cot),[e.cot]),g=h.useMemo(()=>k1e(p),[p]),v=g.answer,y=e.forkEntryId===void 0?[]:(l==null?void 0:l(e.forkEntryId))??[],m=g.phase==="settled"?e.endedAt:void 0,k=g.phase==="settled"&&(m!==void 0||v!==void 0||e.forkEntryId!==void 0&&(i||y.length>0));return o.jsx(za.Assistant,{children:o.jsxs(za.Body,{children:[e.interrupted?o.jsx("p",{className:"mb-1",children:o.jsx(Ln,{label:"interrupted",color:"orange",size:"sm"})}):null,o.jsx(S1e,{view:g}),o.jsx(h1e,{tools:x,summaryOf:c,openInPanel:n}),v===void 0?null:o.jsx(za.Content,{children:v.streaming?o.jsx(Vfe,{isStreaming:!0,children:v.text}):o.jsx(_R,{children:v.text})}),e.failure===void 0?null:o.jsx(l1e,{error:e.failure,onRetry:u}),k?o.jsxs(Mc,{children:[m===void 0?null:o.jsx(Og,{timestamp:o.jsx(DR,{timestamp:m,today:f})}),v===void 0?null:o.jsx(Mc.Copy,{"aria-label":"Copy",tooltip:"Copy",onPress:()=>{var b;(b=navigator.clipboard)==null||b.writeText(v.text)}}),e.forkEntryId===void 0?null:y.length>0?o.jsxs("button",{type:"button",className:"pigui-fork-chip","aria-label":`${y.length} ${y.length===1?"fork":"forks"}`,title:"Open fork",disabled:!t,onClick:()=>s(y[0]),children:[o.jsx(E9,{"aria-hidden":"true"}),y.length," ",y.length===1?"fork":"forks"]}):i?o.jsx(za.Action,{"aria-label":"Fork",tooltip:a?"Creating fork…":"Continue from here in a new conversation",disabled:!t||a,onPress:()=>r(e.forkEntryId),children:o.jsx(E9,{"aria-hidden":"true",className:"size-4"})}):null]}):null,o.jsx(cfe,{todo:d==null?void 0:d.state,writtenThisRun:g.todoWrittenAtMs!==void 0,...(d==null?void 0:d.updatedAtMs)===void 0?{}:{updatedAtMs:d.updatedAtMs}})]})})}function S1e({view:e}){var d;const t=h.useMemo(()=>dfe(e.steps),[e.steps]);if(e.phase==="hidden")return null;const n=e.phase==="thinking"||e.phase==="acting";if(!n&&t.length===0)return null;const s=e.phase==="settled"?Ofe(e.elapsedMs):void 0,r=s===void 0?void 0:e.outcome==="failed"?`Failed after ${s}`:s,i=n||e.phase==="answering"?{startedAtMs:e.anchorMs,running:n}:void 0,a=e.phase==="thinking"?"Thinking…":"Working…",l=n&&((d=t.at(-1))==null?void 0:d.kind)!=="trace",c=l?t.length:t.findLastIndex(f=>f.kind==="trace"),u={...n?{live:!0,waiting:a}:{},...r===void 0?{}:{tail:r},...i===void 0?{}:{clock:i}};return o.jsxs(Bfe,{phase:e.phase,children:[t.map((f,p)=>f.kind==="interim"?o.jsx(za.Content,{"data-slot":"chat-interim-output",children:o.jsx(_R,{children:f.text})},f.key):o.jsx(Jw,{steps:f.steps,counted:f.counted,...p===c?u:{}},f.key)),l?o.jsx(Jw,{steps:[],counted:[],...u},`segment-${c}`):null]})}const BR=typeof window<"u"&&typeof document<"u";function Eb(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function C1e(e){const t=new Date(e);return t.setHours(24,0,0,0),Math.max(1,t.getTime()-e)}const Au=new Set;let eh=Eb(Date.now()),Pl;function HR(){const e=Eb(Date.now());if(e!==eh){eh=e;for(const t of Au)t()}qR()}function qR(){Pl!==void 0&&clearTimeout(Pl),Pl=void 0,!(!BR||Au.size===0)&&(Pl=window.setTimeout(HR,C1e(Date.now())))}function ij(){document.visibilityState==="visible"&&HR()}function E1e(e){return BR?(Au.add(e),Au.size===1&&(eh=Eb(Date.now()),document.addEventListener("visibilitychange",ij),qR()),()=>{Au.delete(e),Au.size===0&&(Pl!==void 0&&clearTimeout(Pl),Pl=void 0,document.removeEventListener("visibilitychange",ij))}):()=>{}}function $1e(){return eh}function A1e(){return eh}function M1e(){return h.useSyncExternalStore(E1e,$1e,A1e)}function PR({conversation:e,toolPresentations:t,connected:n,canFork:s,openInPanel:r,onOpenFork:i,onFork:a,forkDisabled:l,forksAt:c,summaryOf:u,onRetry:d,onRetrySubmission:f,onEditSubmission:p,submissionEditDisabled:x,submissionEditTooltip:g,docs:v,submissions:y,mergeQueuedSubmissions:m}){const k=ig(e),b=M1e(),j=h.useMemo(()=>nde(e,t,k,y??[],{mergeQueuedSubmissions:m}),[e,t,k,y,m]),A=h.useMemo(()=>sde(j),[j]),M=h.useMemo(()=>T1e(v),[v]),T=h.useMemo(()=>lfe(j),[j]),z=h.useMemo(()=>M===void 0?void 0:{state:M,...T===void 0?{}:{updatedAtMs:T}},[M,T]),$=j.findLastIndex(E=>E.kind==="run");return j.length===0?null:o.jsx(yC,{isStreaming:k,gap:0,children:o.jsx("div",{className:"mx-auto flex w-full max-w-[44rem] flex-col gap-8 px-4 pb-6 pt-2",children:j.map((E,N)=>o.jsx(b1e,{entry:E,connected:n,openInPanel:r,onOpenFork:i,onFork:a,canFork:s,forkDisabled:l,forksAt:c,summaryOf:u,onRetrySubmission:f,onEditSubmission:p,submissionEditDisabled:x,submissionEditTooltip:g,today:b,...N===$&&z!==void 0?{todo:z}:{},onRetry:d!==void 0&&n&&A!==void 0&&N===j.length-1?()=>d(A):void 0},E.id))})})}function T1e(e){for(const t of e??[]){if(t.value===null)continue;const n=rf(t.presentation,t.value);if(n.type==="pinomad.todo")return n.value}}function UR(){return o.jsxs("div",{role:"status",className:"chat-skeleton mx-auto mt-auto flex w-full max-w-[44rem] flex-col gap-8 px-4 pb-6 pt-2",children:[o.jsx("span",{className:"sr-only",children:"Loading conversation…"}),o.jsx(oj,{width:200,index:0}),o.jsx(aj,{lines:["100%","100%",220],index:1}),o.jsx(oj,{width:150,index:5}),o.jsx(aj,{lines:["100%","100%","100%",160],index:6})]})}function oj({width:e,index:t}){return o.jsx("div",{"aria-hidden":"true",className:"flex justify-end",children:o.jsx(gc,{width:e,height:40,radius:4,index:t})})}function aj({lines:e,index:t}){return o.jsxs("div",{"aria-hidden":"true",className:"flex flex-col gap-2.5",children:[o.jsx("div",{className:"pb-1",children:o.jsx(gc,{width:128,height:28,radius:"rounded",index:t})}),e.map((n,s)=>o.jsx(gc,{width:n,height:12,radius:"rounded",index:t+s+1},s))]})}function z1e(){return o.jsx("div",{"aria-hidden":"true",className:"chat-skeleton",children:o.jsx(gc,{height:92,radius:4})})}function N1e({missing:e,connected:t,onRetry:n}){return e?o.jsx(Pi,{title:"Conversation not found",description:"It was archived or deleted on another device."}):o.jsx(Pi,{title:"Couldn't open this conversation",description:t?"The host didn't send it.":"The connection dropped before it arrived.",actions:o.jsx(Q,{label:"Try again",variant:"secondary",onClick:n,isDisabled:!t})})}const _1e=new Set(["running","needs-answer"]);function FR(e){const t=e.filter(s=>_1e.has(s.status)),n=e.filter(s=>s.status==="failed").length;return{active:t,done:e.length-t.length-n,failed:n}}function VR(e){if(!e.available)return{kind:"unavailable",branch:e.branch};const t=LR(e.patch);return{kind:"ready",files:t.length,additions:t.reduce((n,s)=>n+s.additions,0),deletions:t.reduce((n,s)=>n+s.deletions,0),truncated:e.truncated,branch:e.branch}}function GR(e,t){var s,r;const n=(s=e.host)==null?void 0:s.protocol.minor;return n!==void 0&&Yt(n,"liveBranch")?t.kind==="ready"||t.kind==="unavailable"?t.branch:void 0:(r=e.checkout)==null?void 0:r.branch}const X0=e=>e.toLocaleString("en-US");function $b({stat:e}){return e.kind==="loading"?o.jsx("span",{className:"text-muted",children:"…"}):e.kind==="failed"?o.jsx("span",{className:"text-muted",children:"—"}):e.files===0?o.jsx("span",{className:"text-muted",children:"None"}):e.additions===0&&e.deletions===0?o.jsxs("span",{className:"text-muted",children:[e.files," file",e.files===1?"":"s"]}):o.jsxs("span",{"aria-label":`${X0(e.additions)} added, ${X0(e.deletions)} removed${e.truncated?" at least":""}`,children:[o.jsxs("span",{className:"text-success",children:["+",X0(e.additions),e.truncated?"+":""]})," ",o.jsxs("span",{className:"text-danger",children:["−",X0(e.deletions),e.truncated?"+":""]})]})}function th({start:e,end:t,children:n}){return o.jsxs("div",{className:"pinomad-drag flex h-10 shrink-0 items-center gap-1 border-b border-border px-3",children:[e,o.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:n}),t]})}function R1e({view:e,remote:t,shownId:n,busy:s,barStart:r,barEnd:i}){var y;const a=(y=e.conversation)==null?void 0:y.conversation.id,l=a!==void 0&&a===n?a:void 0,c=e.connection==="connected",[u,d]=h.useState(),f=h.useRef(0),p=h.useCallback(()=>{const m=++f.current;t.controller.changes().then(k=>{m===f.current&&d(k)},()=>{m===f.current&&d("failed")})},[t]);h.useEffect(()=>d(void 0),[l]),h.useEffect(()=>{l!==void 0&&c&&p()},[l,c,p]);const x=h.useRef(s);h.useEffect(()=>{x.current&&!s&&c&&p(),x.current=s},[s,c,p]);const g=u===void 0?{kind:"loading"}:u==="failed"?{kind:"failed"}:VR(u),v=GR(e,g);return o.jsxs(re,{className:"h-full min-h-0",gap:0,children:[o.jsxs(th,{start:r,end:o.jsxs(o.Fragment,{children:[o.jsx(Bt,{icon:o.jsx(Hh,{className:"size-4","aria-hidden":"true"}),label:"Refresh changes",size:"sm",variant:"ghost",isDisabled:!c||l===void 0,onClick:p}),i]}),children:[v===void 0?null:o.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx(zT,{className:"size-4 shrink-0 text-muted","aria-hidden":"true"}),o.jsx("span",{className:"truncate",children:v})]}),g.kind==="unavailable"?null:o.jsxs("span",{className:"shrink-0 text-sm",children:[o.jsx($b,{stat:g}),g.kind==="ready"&&g.files>0&&(g.additions>0||g.deletions>0)?o.jsxs("span",{className:"text-muted",children:[" ","· ",g.files," file",g.files===1?"":"s"]}):null]})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o.jsx(re,{gap:2,padding:3,children:n===void 0?o.jsx(K,{type:"supporting",children:"Open a conversation to see what it changed."}):l===void 0||u===void 0?o.jsx(K,{type:"supporting",children:"Loading…"}):u==="failed"?o.jsx(K,{type:"supporting",children:"Couldn't load the changes. Refresh to try again."}):u.available?o.jsxs(o.Fragment,{children:[e.checkout===void 0?o.jsx(K,{type:"supporting",children:"These are the project directory's uncommitted changes, shared with other conversations working there."}):null,u.truncated?o.jsx(K,{type:"supporting",children:"The diff is truncated; the rest is not shown."}):null,o.jsx(OR,{patch:u.patch,collapsible:!0})]}):o.jsx(K,{type:"supporting",children:u.reason})})})]})}function Cy(e){return e.code!==null?`exit ${e.code}`:e.signal===void 0?"exited":`signal ${e.signal}`}function I1e(e,t,n){var r,i;if(n!==void 0&&t.some(a=>a.id===n))return n;const s=e.findIndex(a=>a.id===n);return s===-1?(r=t[0])==null?void 0:r.id:(i=t[Math.min(s,t.length-1)])==null?void 0:i.id}function L1e(e,t){const n=(e==null?void 0:e.pending)!==void 0&&t.some(i=>i.id===e.pending),s=n?e.pending:I1e((e==null?void 0:e.seen)??[],t,e==null?void 0:e.selected),r=n||e==null?void 0:e.pending;return{selected:s,memory:{...s===void 0?{}:{selected:s},...r===void 0?{}:{pending:r},seen:t}}}function O1e(e,t,n){const s=Math.max(n,1),r=new Set(e.slice(0,s).map(i=>i.id));if(t!==void 0&&!r.has(t)&&e.some(i=>i.id===t)){const i=e.slice(0,s).at(-1);i!==void 0&&r.delete(i.id),r.add(t)}return{inline:e.filter(i=>r.has(i.id)),overflow:e.filter(i=>!r.has(i.id))}}function D1e({terminal:e,terminals:t,connected:n,onClose:s}){const r=e.renamed?e.name:"",[i,a]=h.useState(r),[l,c]=h.useState(!1),[u,d]=h.useState(),f=h.useRef(null);h.useEffect(()=>{var g;return(g=f.current)==null?void 0:g.select()},[]);const p=i.trim(),x=()=>{p===r||l||(c(!0),d(void 0),t.rename(e.id,p===""?null:p).then(()=>s(),g=>{c(!1),d(g instanceof Error?g.message:String(g))}))};return o.jsx(Us,{isOpen:!0,onOpenChange:g=>g?void 0:s(),purpose:"form",width:480,children:o.jsx(Cs,{header:o.jsx(Hr,{title:"Rename terminal",onOpenChange:()=>s()}),content:o.jsxs(Es,{children:[o.jsx(st,{ref:f,label:"Name",description:"Leave empty to use the shell's window title.",placeholder:e.renamed?void 0:e.name,value:i,onChange:a,onEnter:x,hasAutoFocus:!0,isDisabled:l}),u===void 0?null:o.jsx(K,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:u})]}),footer:o.jsx(el,{children:o.jsxs(ke,{gap:2,hAlign:"end",children:[o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:s}),o.jsx(Q,{label:"Save",variant:"primary",isDisabled:!n||l||p===r,onClick:x})]})})})})}const B1e=h.lazy(()=>jg(()=>import("./xterm-view-ZsuzJb2C.js"),__vite__mapDeps([0,1])).catch(()=>({default:()=>o.jsx(K,{type:"supporting",className:"p-3",children:"Couldn't load the terminal. Reload the page to try again."})}))),H1e={cols:80,rows:24},lj=new WeakMap;function q1e(e){let t=lj.get(e);return t===void 0&&lj.set(e,t=new Map),t}function P1e(e,t){const[n,s]=h.useState();return h.useEffect(()=>{if(t!==void 0)return e.watch(t,r=>s(i=>r.kind==="loading"&&(i==null?void 0:i.state.kind)==="ready"?i:{conversationId:t,state:r}))},[e,t]),t===void 0?{state:void 0,confirmed:!1}:{state:n==null?void 0:n.state,confirmed:(n==null?void 0:n.conversationId)===t}}function U1e(e,t,n){const[s,r]=h.useState(0),i=`${t}\0${s}\0${n}`,[a,l]=h.useState({key:i,fit:t}),[,c]=h.useState(0),u=a.key===i?a.fit:t;return h.useLayoutEffect(()=>{const d=e.current;d!==null&&d.scrollWidth>d.clientWidth&&u>1&&l({key:i,fit:u-1})}),h.useEffect(()=>{const d=e.current;if(d===null)return;const f=new ResizeObserver(()=>{r(d.clientWidth),c(p=>p+1)});return f.observe(d),d.firstElementChild!==null&&f.observe(d.firstElementChild),()=>f.disconnect()},[e]),u}function F1e({terminals:e,conversationId:t,connected:n,stacked:s,barStart:r,barEnd:i}){const{state:a,confirmed:l}=P1e(e,t),c=(a==null?void 0:a.kind)==="ready"?a.list:void 0,u=n&&l,[,d]=h.useState(0),[f,p]=h.useState(),[x,g]=h.useState(),v=q1e(e),y=c===void 0?void 0:v.get(c.owner),m=c===void 0?void 0:L1e(y,c.terminals);h.useEffect(()=>{c!==void 0&&m!==void 0&&v.get(c.owner)===y&&v.set(c.owner,m.memory)});const k=m==null?void 0:m.selected,b=c==null?void 0:c.terminals.find(E=>E.id===k),j=(E,N=!1)=>{c!==void 0&&(v.set(c.owner,{...N?{selected:k,pending:E}:{selected:E},seen:c.terminals}),d(_=>_+1))},A=E=>{g(void 0),E.catch(N=>g(N instanceof Error?N.message:String(N)))},M=()=>{t!==void 0&&(g(void 0),e.open(t,H1e).then(E=>j(E,!0),E=>g(E instanceof Error?E.message:String(E))))},T=c===void 0||c.terminals.length===0?null:o.jsx(V1e,{list:c,selectedId:k,onSelect:E=>j(E)}),z=c!==void 0&&c.terminals.length>=c.limit,$=c===void 0||c.terminals.length===0?null:o.jsxs(o.Fragment,{children:[o.jsx(Bt,{icon:o.jsx(X1,{className:"size-4","aria-hidden":"true"}),label:"New terminal",size:"sm",variant:"ghost",tooltip:z?`Terminal limit reached (${c.limit})`:"New terminal",isDisabled:!u||z,onClick:M}),b===void 0?null:o.jsx(Rc,{hasChevron:!1,button:{icon:o.jsx(Jd,{"aria-hidden":"true"}),isIconOnly:!0,label:"Terminal actions",size:"sm",variant:"ghost",isDisabled:!u},items:[{label:"Rename…",icon:o.jsx(_T,{"aria-hidden":"true",size:16}),onClick:()=>p(b)},{label:"Restart",icon:o.jsx(Hh,{"aria-hidden":"true",size:16}),onClick:()=>A(e.restart(b.id,{cols:b.cols,rows:b.rows}))},{label:"Close",icon:o.jsx(RT,{"aria-hidden":"true",size:16}),onClick:()=>A(e.close(b.id))}]})]});return o.jsxs(re,{className:"h-full min-h-0",gap:0,children:[s?o.jsxs(o.Fragment,{children:[o.jsx(th,{start:r,end:i,children:null}),o.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-3",children:[o.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:T}),$]})]}):o.jsx(th,{start:r,end:o.jsxs(o.Fragment,{children:[$,i]}),children:T}),!n&&c!==void 0?o.jsx("div",{className:"shrink-0 border-b border-border px-3 py-1 text-xs text-muted",role:"status",children:"Reconnecting…"}):null,x===void 0?null:o.jsx(K,{type:"supporting",className:"shrink-0 px-3 py-2",role:"alert",children:x}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:t===void 0?o.jsx(Ey,{children:"Open a conversation to use its terminals."}):a===void 0||a.kind==="loading"?o.jsx(Ey,{children:"Loading…"}):a.kind==="unavailable"?o.jsx(Ey,{children:a.reason}):b===void 0?o.jsx("div",{className:"flex flex-1 items-center justify-center",children:o.jsx(Q,{label:"New terminal",variant:"secondary",isDisabled:!u,onClick:M})}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(h.Suspense,{fallback:null,children:o.jsx(B1e,{terminals:e,terminalId:b.id,enabled:u&&b.exit===void 0},b.id)})}),b.exit===void 0?null:o.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-t border-border px-3 py-2",children:[o.jsx(K,{type:"supporting",className:"min-w-0 flex-1",children:b.exit.code===null?"The process exited.":`The process exited with code ${b.exit.code}.`}),o.jsx(Q,{label:"Restart",variant:"secondary",size:"sm",isDisabled:!u,onClick:()=>A(e.restart(b.id,{cols:b.cols,rows:b.rows}))})]})]})}),f===void 0?null:o.jsx(D1e,{terminal:f,terminals:e,connected:u,onClose:()=>p(void 0)})]})}function Ey({children:e}){return o.jsx(K,{type:"supporting",className:"p-3",children:e})}function V1e({list:e,selectedId:t,onSelect:n}){const s=h.useRef(null),r=U1e(s,e.terminals.length,e.terminals.map(l=>`${l.name}\0${l.exit===void 0?"":Cy(l.exit)}`).join("")),{inline:i,overflow:a}=O1e(e.terminals,t,r);return o.jsx("div",{ref:s,className:"min-w-0 flex-1 overflow-hidden",children:o.jsxs(KC,{size:"sm",value:t??"",onChange:n,children:[i.map(l=>o.jsx(ZC,{value:l.id,label:l.name,className:l.exit===void 0?"pinomad-terminal-tab":"pinomad-terminal-tab text-muted",endContent:l.exit===void 0?void 0:o.jsx("span",{className:"text-xs text-muted",children:Cy(l.exit)})},l.id)),a.length===0?null:o.jsx(YC,{label:`${a.length} more`,options:a.map(l=>({value:l.id,label:l.exit===void 0?l.name:`${l.name} (${Cy(l.exit)})`}))})]})})}const WR=[{id:"tasks",label:"Tasks",icon:o.jsx(Yd,{className:"size-4","aria-hidden":"true"})},{id:"changes",label:"Changes",icon:o.jsx(TT,{className:"size-4","aria-hidden":"true"})},{id:"terminal",label:"Terminal",icon:o.jsx(xm,{className:"size-4","aria-hidden":"true"})}];function G1e(e){var t;return((t=WR.find(n=>n.id===e))==null?void 0:t.id)??"tasks"}function cj(){return o.jsx("span",{"aria-label":"Live activity",className:"pointer-events-none absolute right-1 top-1 size-2 rounded-full bg-primary",role:"img"})}function KR({narrow:e,open:t,surface:n,liveActivity:s,onSelect:r}){return e?o.jsxs("span",{className:"relative",children:[o.jsx(Bt,{icon:o.jsx(TQ,{className:"size-4"}),label:"Side panel",size:"sm",tooltip:"Show side panel",variant:"ghost",onClick:()=>r(n)}),!t&&s?o.jsx(cj,{}):null]}):o.jsx(o.Fragment,{children:WR.map(i=>{const a=t&&n===i.id;return o.jsxs("span",{className:"relative",children:[o.jsx(Bt,{"aria-pressed":a,className:a?"bg-[var(--color-overlay-pressed)]":void 0,icon:i.icon,label:i.label,size:"sm",tooltip:a?`Hide ${i.label}`:`Show ${i.label}`,variant:"ghost",onClick:()=>r(i.id)}),i.id==="tasks"&&!a&&s?o.jsx(cj,{}):null]},i.id)})})}const W1e={"needs-answer":"warning",failed:"error",running:"success"},K1e={"needs-answer":"Waiting for your answer",failed:"Failed",running:"Running"};function XR({status:e}){return e===void 0?null:o.jsx("span",{"aria-hidden":"true",children:o.jsx(Fi,{variant:W1e[e],label:K1e[e],isPulsing:e!=="failed"})})}function X1e({view:e,remote:t,shownId:n,barStart:s,barEnd:r,openInPanel:i,onOpenInMain:a}){var k,b;const l=Bo(6e4),c=n===void 0?void 0:q1(e.organized,n),u=e.side!==void 0&&c!==void 0&&((k=q1(e.organized,e.side.id))==null?void 0:k.summary.id)===c.summary.id?e.side:void 0,d=u===void 0||(b=ei(e.organized,u.id))==null?void 0:b.summary,f=c===void 0?[]:I3(c),p=()=>void t.controller.showSide(void 0),x=(d==null?void 0:d.kind)==="subagent"&&d.lifecycle==="background"?d.id:void 0;if(h.useEffect(()=>{x!==void 0&&a(x)},[x,a]),u!==void 0&&(d==null?void 0:d.kind)==="subagent"&&d.lifecycle!=="background")return o.jsxs(re,{className:"h-full min-h-0",gap:0,children:[o.jsxs(th,{start:s,end:r,children:[o.jsx(Bt,{icon:o.jsx(pm,{className:"size-4","aria-hidden":"true"}),label:"Back to tasks",size:"sm",variant:"ghost",onClick:p}),o.jsx(XR,{status:d.status}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:Dr(d)})]}),o.jsx(Q1e,{view:e,side:u,openInPanel:i,onOpenInMain:a})]});const{active:g,done:v,failed:y}=FR(f.flatMap(j=>j.tasks.map(A=>A.summary))),m=[g.length>0?`${g.length} running`:void 0,v>0?`${v} done`:void 0,y>0?`${y} failed`:void 0].filter(j=>j!==void 0);return o.jsxs(re,{className:"h-full min-h-0",gap:0,children:[o.jsx(th,{start:s,end:r,children:o.jsx("span",{className:"truncate text-sm text-muted",children:m.join(" · ")})}),o.jsx(Z1e,{children:f.length===0?o.jsx(K,{type:"supporting",className:"p-3 text-muted",children:"No tasks yet"}):f.map(j=>o.jsx(Jt,{density:"compact",header:o.jsx("div",{className:"px-3 pt-2",children:o.jsx(K,{type:"label",weight:"semibold",children:j.label})}),children:j.tasks.map(A=>o.jsx(Y1e,{summary:A.summary,now:l,onOpen:()=>i(A.summary.id)},A.summary.id))},j.owner.id))})]})}function Z1e({children:e}){return o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e})}function Y1e({summary:e,now:t,onOpen:n}){return o.jsx(Je,{label:Dr(e),description:e.status==="running"&&e.activity!==void 0?`→ ${Eo(e.activity.tool)??e.activity.tool}${e.activity.target===void 0?"":` ${e.activity.target}`}`:void 0,startContent:o.jsx(XR,{status:e.status}),endContent:e.updatedAt===void 0?void 0:o.jsx("span",{"aria-hidden":"true",className:"text-xs text-muted",children:Zd(e.updatedAt,t)}),onClick:n})}function Q1e({view:e,side:t,openInPanel:n,onOpenInMain:s}){return o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t.conversation===void 0?o.jsx(UR,{}):o.jsx(PR,{conversation:t.conversation,docs:t.docs,submissions:e.submissions,mergeQueuedSubmissions:!0,toolPresentations:e.toolPresentations,connected:e.connection==="connected",canFork:!1,openInPanel:n,onOpenFork:s,onFork:()=>{},summaryOf:r=>{var i;return(i=ei(e.organized,r))==null?void 0:i.summary},forksAt:r=>IM(e.organized,t.id,r)})}),o.jsx("div",{className:"shrink-0 border-t border-border p-2 text-center text-xs text-muted",children:"Read-only · subagent"})]})}function uj({view:e,remote:t,shownId:n,narrow:s,open:r,surface:i,busy:a,liveActivity:l,onOpenChange:c,onSelectSurface:u,openInPanel:d,onOpenInMain:f}){const p=UC({defaultSize:440,minSizePx:360,maxSizePx:720,autoSaveId:"pinomad-side-panel"}),x=(g,v)=>i==="changes"?o.jsx(R1e,{view:e,remote:t,shownId:n,busy:a,barStart:g,barEnd:v}):i==="terminal"?o.jsx(F1e,{terminals:t.terminals,conversationId:n,connected:e.connection==="connected",stacked:s,barStart:g,barEnd:v}):o.jsx(X1e,{view:e,remote:t,shownId:n,barStart:g,barEnd:v,openInPanel:d,onOpenInMain:f});return s?o.jsx(Us,{isOpen:r,onOpenChange:c,variant:"fullscreen","aria-label":"Side panel",children:o.jsx(Cs,{content:o.jsx(Es,{padding:0,children:x(o.jsx(KR,{narrow:!1,open:!0,surface:i,liveActivity:l,onSelect:u}),o.jsx(Bt,{icon:o.jsx(AT,{className:"size-4","aria-hidden":"true"}),label:"Close side panel",size:"sm",variant:"ghost",onClick:()=>c(!1)}))})})}):r?o.jsxs("div",{className:"relative h-full min-w-[360px] border-l border-border",style:{width:p.size},"aria-label":"Side panel",role:"complementary",children:[o.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:x()}),o.jsx(S5,{direction:"horizontal",position:"overlay",isReversed:!0,label:"Resize side panel",resizable:p.props})]}):null}const J1e=e=>e.totalTokens||e.input+e.output+e.cacheRead+e.cacheWrite;function ehe(e,t){var n;if(!(t===void 0||!(t>0)))for(let s=e.entries.length-1;s>=0;s-=1){const r=e.entries[s];if(r.kind==="pi.compaction"||r.kind==="pi.reset")return;if(r.kind!=="pi.assistant")continue;const i=(n=r.model)==null?void 0:n[0];if((i==null?void 0:i.role)!=="assistant"||i.stopReason==="aborted"||i.stopReason==="error")continue;const a=i.usage?J1e(i.usage):0;if(a>0)return{used:a,window:t}}}const the=80,Z0=e=>e>=1e6?`${+(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:`${Math.round(e)}`,dj=e=>e<.01?"<$0.01":`$${e.toFixed(2)}`,fj=2*Math.PI*6;function nhe({usage:e}){const t=e===void 0?void 0:Math.round(e.used/e.window*100),n=t!==void 0&&t>=the,s=t===void 0?"—":`${t}%`,r=e===void 0?"Context usage unknown":`Context ${t}% used, ${Z0(e.used)} of ${Z0(e.window)} tokens`,i=e===void 0?"No usage data yet":`${Z0(e.used)} / ${Z0(e.window)}`,a=e===void 0?0:Math.min(1,e.used/e.window);return o.jsx(Wi,{content:i,placement:"above",alignment:"end",children:o.jsxs("span",{className:`inline-flex h-7 items-center gap-1.5 px-1 text-xs ${n?"text-warning":"text-muted"}`,...t===void 0?{"aria-label":r}:{role:"meter","aria-label":r,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,t)},tabIndex:0,"data-testid":"context-meter",children:[o.jsxs("svg",{"aria-hidden":"true",className:"size-4 -rotate-90",viewBox:"0 0 16 16",children:[o.jsx("circle",{className:"stroke-current opacity-25",cx:"8",cy:"8",fill:"none",r:"6",strokeWidth:"2"}),o.jsx("circle",{className:"stroke-current",cx:"8",cy:"8",fill:"none",r:"6",strokeDasharray:fj,strokeDashoffset:fj*(1-a),strokeWidth:"2"})]}),o.jsx("span",{className:"tabular-nums",children:s})]})})}const she={pending:"pending",in_progress:"in progress",completed:"completed"};function rhe({doc:e}){if(e.value===null)return null;const t=rf(e.presentation,e.value),n=t.type==="pinomad.todo"?"Todo":t.type==="pinomad.question"?"Questions":e.kind,s=t.type==="pinomad.todo"?o.jsx(ihe,{doc:t.value}):t.type==="pinomad.question"?o.jsx(ahe,{doc:t.value}):o.jsx(lhe,{value:t.value});return o.jsxs(re,{gap:1,children:[o.jsx(K,{type:"label",weight:"semibold",children:n}),s]})}function ihe({doc:e}){return o.jsx(Jt,{density:"compact",children:e.items.length===0?o.jsx(Je,{label:"Empty"}):e.items.map((t,n)=>o.jsx(Je,{label:t.text,startContent:o.jsx(Ln,{label:she[t.status],size:"sm"})},n))})}function ohe(e,t){const n=e.resolution;if(n===void 0)return{label:"pending"};if(n.outcome==="dismissed")return{label:"answered in chat",color:"gray"};if(n.outcome==="cancelled")return{label:"cancelled",color:"gray"};const s=n.answers[t];if(s===void 0||s.selected.length===0&&s.other===void 0)return{label:"skipped",color:"gray"};const r=[s.selected.join(", "),...s.other===void 0?[]:[`other: "${s.other}"`]].filter(i=>i!=="").join("; ");return{label:r===""?"skipped":r,color:"green"}}function ahe({doc:e}){return o.jsx(Jt,{density:"compact",children:e.requests.length===0?o.jsx(Je,{label:"Empty"}):e.requests.flatMap(t=>t.questions.map((n,s)=>{const r=ohe(t,s);return o.jsx(Je,{label:n.question,description:r.label,startContent:o.jsx(Ln,{label:n.header,size:"sm"})},`${t.id}-${s}`)}))})}function lhe({value:e}){const t=typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.entries(e):[["value",e]];return o.jsx(Jt,{density:"compact",children:t.map(([n,s])=>o.jsx(Je,{label:n,description:che(s)},n))})}function che(e){const t=JSON.stringify(e);return t.length<=120?t:`${t.slice(0,117)}...`}const hj=3;function uhe(e,t,n,s,r){const[i,a]=h.useState({kind:"loading"}),l=h.useRef(0);return h.useEffect(()=>{if(!r||n||!s)return;const c=++l.current;e.controller.changes().then(u=>{c===l.current&&a(VR(u))},()=>{c===l.current&&a({kind:"failed"})})},[e,t,n,s,r]),h.useEffect(()=>a({kind:"loading"}),[t]),i}const ZR="pinomad.overview.collapsed";function pj(){try{return JSON.parse(window.localStorage.getItem(ZR)??"{}")}catch{return{}}}const YR="flex shrink-0 flex-col gap-0.5 rounded-[var(--radius-element)] bg-[var(--color-background-popover)] px-2.5 shadow-[var(--pigui-overview-card-elevation)]";function zm({section:e,title:t,summary:n,children:s}){const[r,i]=h.useState(()=>pj()[e]===!0),[a,l]=h.useState(!1),c=h.useId(),u=()=>{window.localStorage.setItem(ZR,JSON.stringify({...pj(),[e]:!r})),i(!r),l(!0)};return o.jsxs("section",{className:`${YR} pt-1 ${r?"pb-1":"pb-1.5"}`,children:[o.jsx("h2",{className:"-mx-1.5",children:o.jsxs("button",{type:"button","aria-expanded":!r,"aria-controls":c,className:"flex h-7 w-full items-center gap-2 rounded-md px-1.5 text-xs font-medium text-muted hover:bg-surface-hover hover:text-foreground focus-visible:bg-surface-hover",onClick:u,children:[o.jsx("span",{className:"shrink-0",children:t}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-end font-normal tabular-nums",children:r?n:null}),o.jsx(Zi,{"aria-hidden":!0,className:`size-3.5 shrink-0 motion-safe:transition-transform motion-safe:duration-150 motion-safe:ease-out ${r?"":"rotate-90"}`})]})}),o.jsx("div",{id:c,hidden:r,className:`flex flex-col gap-0.5 ${a?"motion-safe:animate-[pigui-overview-reveal_150ms_ease-out]":""}`,children:s})]})}function Io({icon:e,iconLabel:t,children:n,end:s,title:r,onClick:i}){const a=o.jsxs(o.Fragment,{children:[e===void 0?null:o.jsx("span",{...t===void 0?{"aria-hidden":!0}:{role:"img","aria-label":t},className:"flex size-4 shrink-0 items-center justify-center text-muted",children:e}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:n}),s===void 0?null:o.jsx("span",{className:"shrink-0 tabular-nums",children:s})]}),l="-mx-1.5 flex h-8 items-center gap-2.5 rounded-md px-1.5 text-sm";return i===void 0?o.jsx("div",{className:l,title:r,children:a}):o.jsx("button",{type:"button",className:`${l} hover:bg-surface-hover focus-visible:bg-surface-hover`,title:r,onClick:i,children:a})}function dhe({view:e,remote:t,conversation:n,busy:s,onOpenChanges:r}){var p;const i=xb(n).cwd,a=e.home,l=(a==null?void 0:a.kind)==="chat",c=e.checkout!==void 0,u=(a==null?void 0:a.kind)==="project"?((p=e.organized.projects.find(x=>x.project.path===a.path))==null?void 0:p.project.name)??a.path.split("/").at(-1):l?"Chat folder":i==null?void 0:i.split("/").at(-1),d=uhe(t,n.conversation.id,s,e.connection==="connected",!l),f=GR(e,d);return o.jsxs(zm,{section:"workspace",title:"Workspace",summary:l||d.kind==="unavailable"?f:o.jsx($b,{stat:d}),children:[i===void 0?null:o.jsx(Io,{icon:c?o.jsx(pQ,{className:"size-4"}):o.jsx(K1,{className:"size-4"}),iconLabel:l?void 0:c?"Git worktree":"Project folder",title:i,children:o.jsxs("span",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"min-w-0 truncate",children:u}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-right text-muted [direction:rtl]",children:`${i}`})]})}),f===void 0?null:o.jsx(Io,{icon:o.jsx(zT,{className:"size-4"}),children:f}),l?null:o.jsx(fhe,{stat:d,onOpen:r})]})}function fhe({stat:e,onOpen:t}){return e.kind==="unavailable"?null:o.jsx(Io,{icon:o.jsx(TT,{className:"size-4"}),end:o.jsx($b,{stat:e}),onClick:t,children:"Changes"})}function hhe({view:e,conversation:t}){const n=xr(e.models,xb(t).model),s=ehe(t,n==null?void 0:n.contextWindow),r=bie(t).reduce((a,l)=>a+l.cost,0),i=s===void 0?"—":`${Math.round(s.used/s.window*100)}%`;return o.jsxs(zm,{section:"usage",title:"Usage",summary:r>0?`${i} · ${dj(r)}`:i,children:[o.jsx(Io,{end:o.jsx(nhe,{usage:s}),children:"Context"}),r>0?o.jsx(Io,{end:o.jsx("span",{className:"text-muted",children:dj(r)}),children:"Spent"}):null]})}function phe({view:e,conversation:t,onOpenTasks:n}){const s=q1(e.organized,t.conversation.id),r=s===void 0?[]:I3(s).flatMap(d=>d.tasks.map(f=>f.summary));if(r.length===0)return null;const{active:i,done:a,failed:l}=FR(r),c=i.length-hj,u=[c>0?`${c} more running`:void 0,a>0?`${a} done`:void 0,l>0?`${l} failed`:void 0].filter(d=>d!==void 0);return o.jsxs(zm,{section:"subagents",title:"Subagents",summary:i.length>0?`${i.length} running`:u.join(" · "),children:[i.slice(0,hj).map(d=>o.jsx(Io,{icon:o.jsx(Fi,{variant:d.status==="needs-answer"?"warning":"success",label:d.status==="needs-answer"?"Waiting for your answer":"Running",isPulsing:!0}),end:d.activity===void 0?void 0:o.jsx("span",{className:"text-xs text-muted",children:Eo(d.activity.tool)??d.activity.tool}),onClick:()=>n(d.id),children:Dr(d)},d.id)),u.length===0?null:o.jsx(Io,{icon:null,onClick:()=>n(),children:o.jsx("span",{className:"text-muted",children:u.join(" · ")})})]})}const xhe={connecting:"warning",connected:"success",failed:"error",disabled:"neutral"};function ghe({view:e}){const t=e.mcp;if(t===null||t.servers.length===0&&t.errors.length===0)return null;const n=t.servers.filter(r=>r.state==="failed").length+t.errors.length,s=t.servers.filter(r=>r.state==="connected").length;return o.jsxs(zm,{section:"sources",title:"Sources",summary:n>0?o.jsxs("span",{className:"text-danger",children:[n," problem",n===1?"":"s"]}):`${s} connected`,children:[t.servers.map(r=>o.jsx(Io,{icon:o.jsx(Fi,{variant:xhe[r.state],label:r.state,isPulsing:r.state==="connecting"}),title:r.error,end:o.jsx("span",{className:"text-xs text-muted",children:r.state==="connected"?`${r.tools} tool${r.tools===1?"":"s"}`:r.state}),children:r.name},r.name)),t.errors.map((r,i)=>o.jsx(Io,{icon:o.jsx(Fi,{variant:"error",label:"config error"}),title:r,children:o.jsx("span",{className:"text-danger",children:r})},i))]})}function mhe({view:e,remote:t}){const n=e.docs.filter(s=>{if(s.value===null)return!1;const r=rf(s.presentation,s.value).type;return r!=="pinomad.todo"&&r!=="pinomad.question"});return n.length===0?null:o.jsx(o.Fragment,{children:n.map(s=>o.jsx("section",{className:`${YR} py-2`,children:o.jsx(rhe,{doc:s,remote:t,connected:e.connection==="connected"})},s.kind))})}function yhe({view:e,remote:t,conversation:n,narrow:s,busy:r,onOpenChanges:i,onOpenTasks:a,onClose:l}){return o.jsxs("aside",{"aria-label":"Overview",className:`pigui-overview absolute end-3 top-3 z-20 flex max-h-[calc(100%-1.5rem)] ${s?"w-[min(20rem,calc(100%-1.5rem))]":"w-[var(--pigui-overview-width)]"} flex-col gap-[var(--pigui-overview-gap)] overflow-y-auto rounded-[calc(var(--radius-element)+var(--pigui-overview-gap))] bg-[var(--color-background-muted)] p-[var(--pigui-overview-gap)] shadow-[var(--pigui-overview-elevation)]`,onKeyDown:c=>{c.key==="Escape"&&(c.stopPropagation(),l())},children:[o.jsx(dhe,{view:e,remote:t,conversation:n,busy:r,onOpenChanges:i}),o.jsx(hhe,{view:e,conversation:n}),o.jsx(phe,{view:e,conversation:n,onOpenTasks:a}),o.jsx(ghe,{view:e}),o.jsx(mhe,{view:e,remote:t})]})}function vhe(e){return e.flatMap(t=>{const n=rf(t.presentation,t.value);return n.type!=="pinomad.question"?[]:n.value.requests.filter(s=>s.resolution===void 0).map(s=>({kind:t.kind,request:s}))})}function khe(e,t,n){return Array.from({length:e},(s,r)=>({selected:t[r]??[],...n[r]===void 0||n[r].trim()===""?{}:{other:n[r]}}))}const xj="cubic-bezier(0.32, 0.72, 0, 1)",gj=280,Yf=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches;function bhe(e){const t=h.useRef(null),[n,s]=h.useState(0),r=h.useRef(n);r.current=n;const i=h.useRef(!1),a=h.useRef(null),l=h.useRef(!1),c=h.useRef(void 0),u=h.useCallback(v=>{var y,m;return((m=(y=t.current)==null?void 0:y.children[v])==null?void 0:m.offsetHeight)??0},[]),d=h.useCallback((v,y)=>{if(Yf()||Math.abs(v.offsetHeight-y)<1){v.style.transition="",v.style.height=`${y}px`;return}v.style.height=`${v.offsetHeight}px`,v.style.transition=`height ${gj}ms ${xj}`,v.style.height=`${y}px`},[]),f=h.useCallback((v=!1)=>{const y=t.current;if(y===null||y.clientWidth===0||i.current)return;const m=Math.min(e-1,Math.max(0,y.scrollLeft/y.clientWidth)),k=Math.floor(m),b=u(k),j=u(Math.min(k+1,e-1)),A=b+(j-b)*(m-k);if(v&&l.current&&m===k){d(y,A);return}y.style.transition="",y.style.height=`${A}px`},[e,u,d]),p=h.useCallback(()=>{const v=t.current;a.current=null,v!==null&&!i.current&&s(Math.min(e-1,Math.max(0,Math.round(v.scrollLeft/Math.max(v.clientWidth,1)))))},[e]),x=h.useCallback(()=>{const v=t.current;if(v===null||v.clientWidth===0)return;window.clearTimeout(c.current),c.current=window.setTimeout(p,150),v.scrollTop!==0&&(v.scrollTop=0),f();const y=v.scrollLeft/v.clientWidth;if(a.current!==null){if(Math.abs(y-a.current)>.01)return;a.current=null}i.current||s(Math.min(e-1,Math.max(0,Math.round(y))))},[e,f,p]),g=h.useCallback(v=>{var j,A;const y=t.current;if(y===null)return;const m=Math.min(e-1,Math.max(0,v)),k=Math.abs(m-r.current);if(k<=1||Yf()){k>0&&!Yf()&&(a.current=m),y.scrollTo({left:m*y.clientWidth,behavior:Yf()?"instant":"smooth"}),s(m);return}const b=Math.sign(m-r.current);i.current=!0,y.style.height=`${y.offsetHeight}px`,y.scrollTo({left:m*y.clientWidth,behavior:"instant"}),s(m),d(y,u(m)),(A=(j=y.children[m])==null?void 0:j.firstElementChild)==null||A.animate([{opacity:0,transform:`translateX(${b*24}px)`},{opacity:1,transform:"none"}],{duration:220,easing:xj}),window.setTimeout(()=>{i.current=!1,f(!0)},gj)},[e,u,d,f]);return h.useLayoutEffect(()=>f(),[f]),h.useEffect(()=>{let v=!0;return document.fonts.ready.then(()=>requestAnimationFrame(()=>{v&&(l.current=!0)})),()=>{v=!1}},[]),h.useEffect(()=>{const v=t.current;if(v===null)return;let y=v.clientWidth;const m=new ResizeObserver(()=>{if(v.clientWidth!==y){y=v.clientWidth,v.scrollTo({left:r.current*y,behavior:"instant"}),f();return}f(!0)});for(const k of v.children)m.observe(k);return v.addEventListener("scrollend",p),()=>{m.disconnect(),v.removeEventListener("scrollend",p),window.clearTimeout(c.current)}},[f,p]),{ref:t,index:n,go:g,onScroll:x}}const ki="\0other",whe=250;function jhe({docs:e,remote:t,connected:n,target:s}){const r=vhe(e);return r.length===0?null:o.jsx(re,{gap:2,padding:2,"data-testid":"pending-questions",children:r.map(({kind:i,request:a})=>o.jsx(She,{kind:i,request:a,remote:t,connected:n,target:s},a.id))})}function She({kind:e,request:t,remote:n,connected:s,target:r}){const i=t.questions.length,[a,l]=h.useState(()=>t.questions.map(()=>[])),[c,u]=h.useState(()=>t.questions.map(()=>"")),[d,f]=h.useState(()=>t.questions.map(()=>!1)),[p,x]=h.useState(!1),g=h.useRef(!1),v=(O,L)=>l(H=>H.map((q,U)=>U===O?L:q)),y=(O,L)=>u(H=>H.map((q,U)=>U===O?L:q)),m=(O,L)=>f(H=>H.map((q,U)=>U===O?L:q)),k=O=>{var L;return(((L=a[O])==null?void 0:L.length)??0)>0||d[O]===!0&&(c[O]??"").trim()!==""},b=bhe(i),j=h.useRef(void 0);h.useEffect(()=>()=>window.clearTimeout(j.current),[]);const[A,M]=h.useState(null),T=b.index===i-1,z=t.questions.every((O,L)=>k(L)),$=T||z?"submit":k(b.index)?"next":"skip",E=A??$,N=()=>{window.clearTimeout(j.current),M(null)},_=O=>{N(),b.go(O)},R=h.useRef(null),B=()=>_(b.index+1),D=()=>{if(g.current||!s)return;g.current=!0,x(!0);const O=khe(i,a,c.map((L,H)=>d[H]===!0?L:""));n.controller.answer(e,t.id,O,r).catch(()=>{g.current=!1,x(!1)})},I=O=>(L,H)=>{var q;if(H||((q=t.questions[O])==null?void 0:q.multiSelect)===!0||L===ki||O+1>=i){N();return}window.clearTimeout(j.current),M(U=>U??$),j.current=window.setTimeout(()=>{b.go(O+1),M(null)},Yf()?0:whe)};return o.jsxs("section",{className:"question-card","aria-label":"The agent asks",onKeyDown:Ehe(b.index,_),children:[o.jsx("div",{ref:b.ref,className:"question-card__pager",onScroll:b.onScroll,onWheel:O=>{Math.abs(O.deltaX)>Math.abs(O.deltaY)&&N()},onTouchStart:O=>{var L;R.current=((L=O.touches[0])==null?void 0:L.clientX)??null},onTouchMove:O=>{var H;const L=(H=O.touches[0])==null?void 0:H.clientX;R.current!==null&&L!==void 0&&Math.abs(L-R.current)>8&&N()},children:t.questions.map((O,L)=>o.jsx("div",{className:"question-card__page",role:"group","aria-roledescription":"question","aria-label":`${L+1} of ${i}: ${O.header}`,inert:L!==b.index,children:o.jsx(Che,{question:O,selected:a[L]??[],other:c[L]??"",otherOn:d[L]===!0,onSelect:H=>v(L,H),onOther:H=>y(L,H),onOtherOn:H=>m(L,H),onPointerPick:I(L),onOtherEnter:L+1<i?B:D})},L))}),o.jsxs("div",{className:"question-card__footer",children:[o.jsx("div",{className:"question-card__back",children:b.index>0?o.jsx(Q,{label:"Back",variant:"secondary",onClick:()=>_(b.index-1)}):null}),i>1?o.jsx("div",{className:"question-card__segments",role:"tablist","aria-label":"Questions",children:t.questions.map((O,L)=>o.jsx("button",{type:"button",role:"tab",className:"question-card__segment","aria-selected":L===b.index,"aria-label":`${O.header}, ${k(L)?"answered":"not answered"}`,"data-current":L===b.index||void 0,"data-answered":k(L)||void 0,tabIndex:L===b.index?0:-1,onClick:()=>_(L)},L))}):o.jsx("span",{}),o.jsx("div",{className:"question-card__action",children:E==="submit"?o.jsx(Q,{label:"Submit",variant:"primary",isDisabled:!s||p,onClick:D}):E==="next"?o.jsx(Q,{label:"Next",variant:"secondary",onClick:B}):o.jsx(Q,{label:"Skip",variant:"secondary",onClick:B})})]})]})}function Che({question:e,selected:t,other:n,otherOn:s,onSelect:r,onOther:i,onOtherOn:a,onPointerPick:l,onOtherEnter:c}){const u=e.multiSelect===!0,d=h.useRef(Number.NEGATIVE_INFINITY),f=h.useRef(null),p=g=>{a(g),g&&requestAnimationFrame(()=>{var y;const v=(y=f.current)==null?void 0:y.querySelector("input");v==null||v.focus({preventScroll:!0}),v==null||v.setSelectionRange(v.value.length,v.value.length)})},x=g=>g.description===void 0||g.description===""?{}:{description:g.description};return o.jsxs(re,{gap:1,children:[o.jsx(K,{type:"body",weight:"medium",className:"question-card__question",children:e.question}),o.jsx("div",{className:"question-card__options",onPointerDown:()=>{d.current=performance.now()},onClick:g=>{const v=g.target;if(!(v instanceof HTMLInputElement)||v.type!=="radio"||performance.now()-d.current>1e3)return;d.current=Number.NEGATIVE_INFINITY;const y=v.value===ki?s:t[0]===v.value;y&&(v.value===ki?a(!1):r([])),l(v.value,y)},children:u?o.jsxs(h5,{label:e.header,isLabelHidden:!0,density:"compact",value:s?[...t,ki]:t,onChange:g=>{r(g.filter(v=>v!==ki)),g.includes(ki)!==s&&p(!s)},children:[e.options.map(g=>o.jsx(dx,{label:g.label,value:g.label,...x(g)},g.label)),o.jsx(dx,{label:"Other",value:ki})]}):o.jsxs(j5,{label:e.header,isLabelHidden:!0,size:"sm",value:s?ki:t[0]??"",onChange:g=>{if(g===ki){r([]),p(!0);return}r([g]),a(!1)},children:[e.options.map(g=>o.jsx(hx,{label:g.label,value:g.label,...x(g)},g.label)),o.jsx(hx,{label:"Other",value:ki})]})}),s?o.jsx("div",{ref:f,className:"question-card__other",onKeyDown:g=>{g.key==="Enter"&&!g.nativeEvent.isComposing&&(g.preventDefault(),c())},children:o.jsx(st,{label:"Other answer",isLabelHidden:!0,value:n,onChange:i,placeholder:"Your answer…"})}):null]})}function Ehe(e,t){return n=>{if(!(n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement)&&!(n.metaKey||n.ctrlKey||n.altKey)){if(n.key==="ArrowRight")t(e+1);else if(n.key==="ArrowLeft")t(e-1);else return;n.preventDefault()}}}const dg="pinomad.focus",mj="pinomad.activeHost",$he=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0,Ahe=e=>{let t;try{t=JSON.parse(e)}catch{return}if(typeof t!="object"||t===null)return;const n=t;if(!(typeof n.hostKey!="string"||n.hostKey===""))return n.conversationId===void 0?{hostKey:n.hostKey}:$he(n.conversationId)?{hostKey:n.hostKey,conversationId:n.conversationId}:void 0};function Mhe(e,t){if(t.length===0)return;const n=new Set(t.map(i=>i.hostKey)),s=e.getItem(dg);if(s!==null){const i=Ahe(s);if(i!==void 0&&n.has(i.hostKey))return i}const r=e.getItem(mj);return r!==null&&n.has(r)?(e.setItem(dg,JSON.stringify({hostKey:r})),e.removeItem(mj),{hostKey:r}):{hostKey:t[0].hostKey}}function The(e,t){(t==null?void 0:t.conversationId)!==void 0&&e.set(t.hostKey,t.conversationId)}function zhe(e,t){const n=e.get(t);return n===void 0?{hostKey:t}:{hostKey:t,conversationId:n}}function Nhe(e,t,n){if((t==null?void 0:t.conversationId)!==void 0&&e.set(t.hostKey,t.conversationId),(t==null?void 0:t.hostKey)===n){const s=t.conversationId??e.get(n);return s===void 0?{hostKey:n}:{hostKey:n,conversationId:s}}return e.delete(n),{hostKey:n}}function _he(e,t){if(t===void 0){e.removeItem(dg);return}e.setItem(dg,JSON.stringify(t.conversationId===void 0?{hostKey:t.hostKey}:{hostKey:t.hostKey,conversationId:t.conversationId}))}function Rhe({hostKey:e}){const t=qr(),{focusHost:n}=As(),[s,r]=h.useState(!1),[i,a]=h.useState();h.useEffect(()=>t.hostRejected(e),[t,e]);const l=QR(t.state,e);if(l===void 0)return null;const c=()=>{r(!0),a(void 0),t.pairHost(l.host.hostId).then(u=>{r(!1),u.ok?n(u.value.hostKey):a(u.error)})};return o.jsxs(re,{gap:2,hAlign:"start",children:[o.jsx(Q,{label:"Pair again with your account",variant:"primary",isLoading:s,isDisabled:l.host.pairing!=="available",onClick:c}),i===void 0?null:o.jsx(Oe,{status:"error",title:"Couldn't pair",description:us(i)})]})}function QR(e,t){return e.status==="signed-in"?e.hosts.find(n=>{var s;return((s=n.stored)==null?void 0:s.hostKey)===t}):void 0}function Ab({hostKey:e}){const{hosts:t,forget:n}=As(),s=qr(),[r,i]=h.useState(!1),a=Bh(t).get(e),l=QR(s.state,e)!==void 0;return o.jsxs(re,{gap:6,className:"w-full max-w-md",children:[o.jsxs(re,{gap:2,children:[o.jsx(Jn,{level:2,children:`${a??"This host"} no longer accepts this device`}),o.jsx(K,{type:"supporting",children:"This device was unpaired from it, or its pairing was never accepted. Pair again to keep using it."})]}),o.jsx(Rhe,{hostKey:e}),o.jsxs(re,{gap:2,children:[o.jsx(K,{weight:"semibold",children:l?"Or pair with a link":"Pair with a link"}),o.jsx(K,{type:"supporting",children:`Run pinomad pair on ${a??"the host"}, or open Settings → Devices → Pair a device on a device still paired with it.`}),o.jsx(zd,{connectVariant:l?"secondary":"primary"})]}),o.jsxs(ke,{gap:2,hAlign:"between",vAlign:"center",children:[s.state.status==="signed-out"?o.jsx(Q,{label:"Sign in to pair through your account",variant:"ghost",size:"sm",onClick:()=>i(!0)}):o.jsx("span",{}),o.jsx(Q,{label:a===void 0?"Unpair":`Unpair ${a}`,variant:"secondary",size:"sm",onClick:()=>void n(e)})]}),r?o.jsx(ym,{onClose:()=>i(!1)}):null]})}const Ihe="https://pinomad.si/docs/";function Lhe({state:e}){const[t,n]=h.useState(!1),[s,r]=h.useState(!1);return o.jsxs(re,{gap:6,style:{width:"100%",maxWidth:520},children:[o.jsxs(re,{gap:2,children:[o.jsx(Jn,{level:2,children:"Add your first host"}),o.jsx(K,{type:"supporting",children:"A host is the computer that runs your agents: a Mac or Linux machine. The command installs PiNomad with its own Node, joins the host to your account and keeps it running as a service. The host then shows up here and connects on its own."})]}),o.jsx(xz,{serverOrigin:e.serverOrigin}),e.hostsError===void 0?null:o.jsx(Oe,{status:"warning",title:"Couldn't check for new hosts",description:us(e.hostsError)}),o.jsxs(re,{gap:2,children:[o.jsxs(K,{type:"supporting",children:["Not using an account?"," ",o.jsx(Hg,{href:Ihe,isExternalLink:!0,children:"Pair a host directly"})]}),s?o.jsxs(re,{gap:2,children:[o.jsx(K,{type:"supporting",children:"Paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),o.jsx(zd,{})]}):o.jsx(ke,{children:o.jsx(Q,{label:"Have a pairing link?",variant:"ghost",size:"sm",onClick:()=>r(!0)})}),o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsxs(K,{type:"supporting",children:["Signed in as ",e.user," on ",new URL(e.serverOrigin).host]}),o.jsx(Q,{label:"Account…",variant:"secondary",size:"sm",onClick:()=>n(!0)})]})]}),t?o.jsx(ym,{onClose:()=>n(!1)}):null]})}const Ohe=1e4;function Dhe(){const e=qr(),t=e.state.status==="signed-in";return h.useEffect(()=>{if(!t)return;const n=setInterval(()=>{document.visibilityState==="visible"&&e.refreshHosts()},Ohe);return()=>clearInterval(n)},[e,t]),e.state.status==="signed-in"&&e.state.hosts.length===0?o.jsx(Lhe,{state:e.state}):e.state.status==="unavailable"?o.jsxs(re,{gap:4,hAlign:"center",style:{width:"100%",maxWidth:420},children:[o.jsx(Pi,{title:"No host link",description:"Paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),o.jsx(zd,{})]}):o.jsxs(re,{gap:6,style:{width:"100%",maxWidth:420},children:[o.jsx(ib,{}),o.jsxs(re,{gap:2,children:[o.jsx(K,{type:"supporting",children:"Or paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),o.jsx(zd,{})]})]})}const JR="/host-link",Bhe=e=>{const t=new URLSearchParams(e).get("request");return t!==null&&/^[A-Za-z0-9_-]{1,64}$/.test(t)?t:void 0},yj=()=>{window.location.pathname===JR&&history.replaceState(null,"","/")};function Hhe({navigate:e=t=>window.location.assign(t)}){const[t,n]=h.useState(()=>window.location.pathname===JR),[s]=h.useState(()=>t?Bhe(window.location.search):void 0);if(!t)return null;const r=()=>{yj(),n(!1)};return o.jsx(Us,{isOpen:!0,onOpenChange:i=>i?void 0:r(),width:480,children:o.jsx(Cs,{header:o.jsx(Hr,{title:"Add a host",onOpenChange:r}),content:o.jsx(Es,{children:o.jsx("div",{style:{padding:"var(--spacing-2)"},children:o.jsx(qhe,{requestId:s,navigate:e,onSettled:yj,onClose:r})})})})})}function qhe({requestId:e,navigate:t,onSettled:n,onClose:s}){const{state:r}=qr();switch(r.status){case"checking":return o.jsxs(ke,{gap:2,vAlign:"center",children:[o.jsx(Vt,{size:"sm"}),o.jsx(K,{type:"supporting",children:"Checking for an account…"})]});case"unavailable":return o.jsxs(re,{gap:3,children:[o.jsx(K,{children:"Confirm a host on the server it's joining: open the address its terminal printed."}),o.jsx(ke,{children:o.jsx(Q,{label:"Close",variant:"secondary",onClick:s})})]});case"signed-out":return o.jsxs(re,{gap:3,children:[o.jsx(K,{type:"supporting",children:e===void 0?"Sign in to the account the host is joining, then enter the code from its terminal.":"Sign in to the account the host is joining to confirm it."}),o.jsx(ib,{})]});case"signed-in":return e!==void 0?o.jsx(nte,{requestId:e,navigate:t,onSettled:n,onClose:s}):o.jsxs(re,{gap:3,children:[o.jsxs(K,{type:"supporting",children:["Enter the code the host's terminal shows to add it to ",r.user,"'s account."]}),o.jsx(rb,{onSettled:n,onClose:s})]})}}function Phe({knownHosts:e=sb}){const t=qr(),{state:n}=t,s=Xd(),[r,i]=h.useState(),a=h.useRef(new Map);return h.useEffect(()=>{var c;if(n.status!=="signed-in"||n.hostsError!==void 0)return;const l=e.arrivals({serverOrigin:n.serverOrigin,user:n.user},n.hosts.map(u=>u.host.hostId));for(const u of l){const d=((c=n.hosts.find(p=>p.host.hostId===u))==null?void 0:c.host.name)??"A host",f=s({body:`New host ${d} joined your account. Didn't add it? Remove it.`,uniqueID:`new-host:${u}`,isAutoHide:!1,endContent:o.jsx(Q,{label:"Remove",variant:"secondary",size:"sm",onClick:()=>i({hostId:u,name:d})}),onHide:()=>a.current.delete(u)});a.current.set(u,f)}},[e,n,s]),r===void 0||n.status!=="signed-in"?null:o.jsx(cte,{account:t,hostId:r.hostId,name:r.name,serverOrigin:n.serverOrigin,onClose:l=>{var c;l&&((c=a.current.get(r.hostId))==null||c()),i(void 0)}})}const Uhe=15e3,Fhe={subscribe(e){return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}}},Vhe={subscribe(e){if(typeof document>"u")return()=>{};const t=()=>e(document.visibilityState==="hidden"?"background":"foreground");return document.addEventListener("visibilitychange",t),document.visibilityState==="hidden"&&e("background"),()=>document.removeEventListener("visibilitychange",t)}};function eI(e,t,n){const[s,r]=h.useState({status:"connecting"});return h.useEffect(()=>{let i,a=!1;r({status:"connecting"});const l=new AbortController,c="candidates"in e;let u,d;const f=new Set,p=()=>{for(const m of f)m.close();f.clear()};if(!c){u="transport"in e?e.transport:Bz(e.url,e.token);const m=u;d={label:m.label,open(k){let b;b=m.open({message:k.message,opened:k.opened,authenticated:k.authenticated,closed:(A,M)=>{b!==void 0&&f.delete(b),k.closed(A,M)}});const j=b;return f.add(j),{send:A=>j.send(A),close:()=>{f.delete(j)&&j.close()}}}}}const x=(n==null?void 0:n.connect)??yse,g=(n==null?void 0:n.timeoutMs)??Uhe;let v;if(!c&&u!==void 0){const m=u.label;v=setTimeout(()=>{a=!0,l.abort(),p(),r({status:"failed",error:`No response from ${m} within ${g/1e3} seconds. Check that the host is running and that this device can reach it (same network, or Tailscale connected).`,unauthorized:!1})},g)}const y=c?{...e,signal:l.signal,network:e.network??Fhe,lifecycle:e.lifecycle??Vhe,...(n==null?void 0:n.timeoutMs)===void 0?{}:{roundTimeoutMs:n.timeoutMs}}:{...e,transport:d,signal:l.signal,candidateTimeouts:{socketOpenMs:g+1e3,noiseMs:g+1e3,helloMs:g+1e3,syncMs:g+1e3},roundTimeoutMs:g+1e3};return x({reconnectDelayMs:{min:200,max:2e3},...y}).then(m=>{if(v!==void 0&&clearTimeout(v),a){m.close();return}i=m,r({status:"ready",remote:m})},m=>{v!==void 0&&clearTimeout(v),a||r({status:"failed",error:m instanceof Error?m.message:String(m),unauthorized:m instanceof Sp,...m instanceof qz?{mismatch:m}:{},...m instanceof Hz?{direct:m}:{}})}),()=>{a=!0,v!==void 0&&clearTimeout(v),l.abort(),p(),i==null||i.close()}},[t]),s}function tI(e){return h.useSyncExternalStore(e.view.subscribe,e.view.current)}function nI({hostKey:e,device:t,target:n,candidates:s,stored:r,pairing:i,rtcPlatform:a,onPaired:l,onEndpointSet:c,setConnection:u}){const d=Vi(e),f=a===void 0?void 0:{platform:a,hostKey:d,device:t,signalOnlyHint:(r==null?void 0:r.rtcSignalOnly)===!0,openSignalTransport:p=>gk({url:p.url,hostKey:d,device:t,prologue:XZ}),onSignalOnly:p=>{u(e,{rtcSignalOnly:p}).catch(x=>console.error("Could not store the host's RTC hint",x))},onSignalOnlyError:p=>console.error("Could not store the host's RTC hint",p)};return{candidates:s,legacyUrl:n.url,pageProtocol:window.location.protocol,...(r==null?void 0:r.connectionMode)===void 0?{}:{connectionMode:r.connectionMode},...i===void 0?{}:{pairing:i},...f===void 0?{}:{rtc:f},...l===void 0?{}:{onPaired:l},openTransport:(p,x)=>gk({url:p.url,hostKey:d,device:t,...x===void 0?{}:{pairing:x}}),onEndpointSet:c}}const Ghe={height:"100dvh",width:"100%",backgroundColor:"var(--color-background-body)",color:"var(--color-text-primary)"};function ri({children:e}){const t=W3().reserveMacTrafficLights;return o.jsxs(re,{style:Ghe,isScrollable:!0,children:[t?o.jsx("div",{"aria-hidden":"true",className:"pinomad-drag fixed inset-x-0 top-0 h-10"}):null,o.jsx(re,{minHeight:"100%",style:{flexShrink:0},hAlign:"center",vAlign:"center",padding:6,children:e})]})}const vj="pinomad.reloadedForProtocol";function sI(e){return e===void 0?vj:`${vj}.${e}`}function Mb({wsUrl:e,mismatch:t,hostKey:n}){var c;const s=sI(n),r=Y3(),i=((c=window.pinomadDesktop)==null?void 0:c.updates)!==void 0,[a]=h.useState(()=>t.direction==="client-older"&&i||!oee(e,window.location)||sessionStorage.getItem(s)===String(t.hostMajor)?!1:(sessionStorage.setItem(s,String(t.hostMajor)),window.location.reload(),!0));if(h.useEffect(()=>{var u,d;t.direction==="client-older"&&((d=(u=window.pinomadDesktop)==null?void 0:u.updates)==null||d.check())},[t.direction]),a)return null;const l=t.hostVersion===void 0?"":` Host version: ${t.hostVersion}.`;return t.direction==="client-older"?o.jsxs(re,{gap:4,children:[o.jsx(Oe,{status:"error",container:"section",title:"Client out of date",description:`The host speaks a newer protocol. ${i?"Update the app.":"Reload the page, or update the app."}${l}`}),i?o.jsx(LN,{update:r}):null]}):o.jsx(Oe,{status:"error",container:"section",title:"Host out of date",description:`This client speaks a newer protocol. Upgrade the host (pinomad upgrade).${l}`})}function Whe(e,t,n,s={}){var f,p;const{open:r,cancel:i,onUnavailable:a}=s,l=t.connection==="connected",c=(f=t.conversation)==null?void 0:f.conversation.id,u=(p=t.side)==null?void 0:p.id,d=h.useRef(void 0);h.useEffect(()=>{if(l){if(n===void 0){d.current=void 0,i==null||i(),(c!==void 0||u!==void 0)&&e.controller.clearConversation();return}if(c===n){d.current=n;return}if(d.current===n&&c===void 0){d.current=void 0,a==null||a();return}r!==void 0?r(n):e.controller.switchConversation(n)}},[i,l,a,r,e,c,u,n])}function Khe({hosts:e,focus:t,connect:n,renderWorkbench:s}){return o.jsx(o.Fragment,{children:e.map(r=>o.jsx(Xhe,{host:r,focused:(t==null?void 0:t.hostKey)===r.hostKey,focusTarget:(t==null?void 0:t.hostKey)===r.hostKey?t.conversationId:void 0,renderWorkbench:s,...n===void 0?{}:{connect:n}},r.hostKey))})}function Xhe({host:e,focused:t,focusTarget:n,connect:s,renderWorkbench:r}){const{endpoints:i,setConnection:a}=As(),l=h.useContext(mm),[c,u]=h.useState(0),d=h.useCallback(()=>u(k=>k+1),[]),f=h.useMemo(()=>new db,[]),p=h.useMemo(()=>Td(Vi(e.privateKey)),[e.privateKey]),x=h.useMemo(()=>({url:e.url,endpointSet:e.endpointSet}),[e.url,e.endpointSet]),g=h.useMemo(()=>U1(x.url,x.endpointSet,{pageProtocol:window.location.protocol}),[x]),v=h.useMemo(()=>nz(),[]),y=h.useMemo(()=>nI({hostKey:e.hostKey,device:p,target:x,candidates:g,stored:e,rtcPlatform:v,setConnection:a,onEndpointSet:k=>{i(e.hostKey,k).catch(b=>console.error("Could not store the host's remote endpoints",b))}}),[g,p,i,e,v,a,x]),m=eI(y,`${e.hostKey} ${e.privateKey} ${c}`,s===void 0?void 0:{connect:s});return h.useEffect(()=>{if(!(l===void 0||m.status==="ready")){if(m.status==="connecting"){l.publish(e.hostKey,{phase:"connecting",retry:d,composer:f});return}l.publish(e.hostKey,{phase:"failed",error:m.error,unauthorized:m.unauthorized,...m.mismatch===void 0?{}:{mismatch:m.mismatch},retry:d,composer:f})}},[f,e.hostKey,l,d,m]),h.useEffect(()=>()=>{l==null||l.remove(e.hostKey)},[e.hostKey,l]),h.useEffect(()=>{f.setRemote(m.status==="ready"?m.remote:void 0)},[f,m]),m.status==="ready"?o.jsx(c4.Provider,{value:f,children:o.jsx(Qhe,{host:e,remote:m.remote,device:p,composer:f,focused:t,focusTarget:n,retry:d,renderWorkbench:r})}):t?o.jsx(c4.Provider,{value:f,children:m.status==="connecting"?o.jsx(ri,{children:o.jsx(Pi,{title:"Connecting",description:e.url})}):o.jsx(Zhe,{host:e,state:m,retry:d})}):null}function Zhe({host:e,state:t,retry:n}){return t.mismatch!==void 0?o.jsxs(ri,{children:[o.jsx(Mb,{wsUrl:e.url,mismatch:t.mismatch,hostKey:e.hostKey}),o.jsx($k,{})]}):t.unauthorized?o.jsx(ri,{children:o.jsx(Ab,{hostKey:e.hostKey})}):o.jsxs(ri,{children:[o.jsx(re,{gap:4,hAlign:"center",children:o.jsx(Yhe,{state:t,retry:n})}),o.jsx($k,{})]})}function Yhe({state:e,retry:t}){return o.jsxs(o.Fragment,{children:[o.jsx(Oe,{status:"error",title:e.direct===void 0?"Could not connect to the host":"Direct connection unavailable",description:e.direct===void 0?e.error:"This host can't be reached without the relay, and the peer-to-peer link didn't connect."}),e.direct===void 0?null:o.jsx(K,{type:"supporting",style:{textAlign:"center"},children:`Details: ${e.direct.reason}`}),o.jsx(Q,{label:"Retry",variant:"secondary",onClick:t})]})}function Qhe({host:e,remote:t,device:n,composer:s,focused:r,focusTarget:i,retry:a,renderWorkbench:l}){var m;const c=tI(t),u=h.useContext(mm),{focusConversation:d,focusDraft:f}=As();h.useEffect(()=>{u==null||u.publish(e.hostKey,{phase:"ready",remote:t,view:c,retry:a,composer:s})},[s,e.hostKey,u,t,a,c]),h.useEffect(()=>()=>{u==null||u.remove(e.hostKey)},[e.hostKey,u]),WT(e.hostKey,c.settings);const{opening:p,open:x,cancel:g}=CT(t),v=h.useCallback(()=>f(e.hostKey),[f,e.hostKey]);if(Whe(t,c,i,{open:x,cancel:g,onUnavailable:v}),ST(c,e.hostKey,r&&i!==void 0?(m=c.conversation)==null?void 0:m.conversation.id:void 0,d),!r)return null;const y=o.jsx(Ab,{hostKey:e.hostKey});return l({host:e,remote:t,device:n,rejected:y,retry:a,opening:p,cancelOpening:g,openConversation:x})}const Jhe={flex:1,minHeight:0},rI=e=>e.some(t=>t.summary.status==="running"||t.summary.status==="needs-answer"||rI(t.children)),iI="pinomad.overview.open",e0e=()=>typeof window<"u"&&window.localStorage.getItem(iI)==="true",oI="pinomad.side-panel.surface",t0e=()=>G1e(typeof window>"u"?null:window.localStorage.getItem(oI));function n0e(){const[e]=h.useState(dee),t=h.useMemo(Xee,[]),n=h.useRef(new Map),s=h.useRef(new Map),r=h.useRef(new Set),[i,a]=h.useState();h.useEffect(()=>{let $=!0;return e.list().catch(E=>(console.error("Could not load the paired-host list",E),[])).then(E=>{if(!$)return;let N=[...E];for(const R of s.current.values()){const B=N.find(D=>D.hostKey===R.hostKey);N=[...N.filter(D=>D.hostKey!==R.hostKey),B===void 0?R:x1(B,R)]}s.current.clear();const _=Mhe(localStorage,N)??null;The(n.current,_),a({hosts:N,focus:_,address:iee(window.location.hash,window.location,N,(_==null?void 0:_.hostKey)??null)})}),()=>{$=!1}},[e]),h.useEffect(()=>{const $=()=>{window.location.hash!==""&&window.location.reload()};return window.addEventListener("hashchange",$),()=>window.removeEventListener("hashchange",$)},[]);const l=h.useCallback($=>zhe(n.current,$),[]),c=h.useCallback($=>{history.replaceState(null,"",window.location.pathname+window.location.search),a(E=>E===void 0?E:{...E,address:void 0,focus:l($)})},[l]),u=h.useCallback($=>{a(E=>E===void 0||!E.hosts.some(N=>N.hostKey===$.hostKey)?E:(n.current.set($.hostKey,$.conversationId),{...E,focus:{...$}}))},[]),d=h.useCallback($=>{a(E=>(E===void 0||!E.hosts.some(N=>N.hostKey===$.hostKey)||n.current.set($.hostKey,$.conversationId),E))},[]),f=h.useCallback($=>{n.current.delete($),a(E=>E===void 0?E:{...E,focus:{hostKey:$}})},[]),p=h.useCallback(($,E)=>{n.current.delete($),E&&history.replaceState(null,"",window.location.pathname+window.location.search),a(N=>{var B;if(N===void 0)return N;const _=N.hosts.filter(D=>D.hostKey!==$),R=E?void 0:N.address;return((B=N.focus)==null?void 0:B.hostKey)!==$?{...N,hosts:_,address:R}:{...N,hosts:_,address:R,focus:_[0]===void 0?null:l(_[0].hostKey)}})},[l]),x=h.useCallback($=>e.remove($).catch(E=>{console.error("Could not remove the host",E)}),[e]),g=h.useCallback(async $=>{await x($),p($,!1)},[p,x]),v=h.useCallback(async $=>{const E=e.list().catch(()=>(i==null?void 0:i.hosts)??[]);r.current.add($),p($,!0);try{const _=(await E).find(R=>R.hostKey===$)??(i==null?void 0:i.hosts.find(R=>R.hostKey===$));(_==null?void 0:_.account)!==void 0&&(XT.add(_.account),Sk(_.account.hostId)),await x($)}finally{r.current.delete($)}},[p,i==null?void 0:i.hosts,x,e]),y=h.useCallback(async $=>{r.current.has($.hostKey)||(await e.save($),!r.current.has($.hostKey)&&a(E=>{if(E===void 0){const _=s.current.get($.hostKey);return s.current.set($.hostKey,_===void 0?$:x1(_,$)),E}const N=E.hosts.find(_=>_.hostKey===$.hostKey);return{...E,focus:E.focus??{hostKey:$.hostKey},hosts:[...E.hosts.filter(_=>_.hostKey!==$.hostKey),N===void 0?$:x1(N,$)]}}))},[e]),m=h.useCallback(async($,E)=>{await e.setName($,E),a(N=>N===void 0?N:{...N,hosts:N.hosts.map(_=>_.hostKey===$?{..._,name:E}:_)})},[e]),k=h.useCallback(async($,E)=>{await e.updateEndpoints($,E),a(N=>N===void 0?N:{...N,hosts:N.hosts.map(_=>_.hostKey===$?vT(_,E):_)})},[e]),b=h.useCallback(async($,E)=>{await e.updateConnection($,E),a(N=>N===void 0?N:{...N,hosts:N.hosts.map(_=>_.hostKey===$?kT(_,E):_)})},[e]),j=h.useMemo(()=>i===void 0?{store:e,hosts:[],focus:null,paired:()=>Promise.resolve(),setName:()=>Promise.resolve(),endpoints:()=>Promise.resolve(),setConnection:()=>Promise.resolve(),focusHost:()=>{},focusConversation:()=>{},rememberConversation:()=>{},focusDraft:()=>{},forget:()=>Promise.resolve(),dropHost:()=>Promise.resolve()}:{store:e,hosts:i.hosts,focus:i.focus,paired:y,setName:m,endpoints:k,setConnection:b,focusHost:c,focusConversation:u,rememberConversation:d,focusDraft:f,forget:v,dropHost:g},[g,k,u,f,c,v,i,y,d,b,m,e]);if(h.useEffect(()=>{i!==void 0&&_he(localStorage,i.focus??void 0)},[i==null?void 0:i.focus]),i===void 0)return o.jsx(ri,{children:null});const{address:A,focus:M,hosts:T}=i,z=$=>{history.replaceState(null,"",window.location.pathname+window.location.search),a(E=>E===void 0?E:{...E,address:void 0,focus:Nhe(n.current,E.focus,$.hostKey)})};return o.jsx(GT.Provider,{value:j,children:o.jsx(mm.Provider,{value:t,children:o.jsxs(Eee,{children:[(A==null?void 0:A.kind)==="token"?o.jsx(aI,{options:A,connectionKey:`${A.url} ${A.token}`,label:A.url}):(A==null?void 0:A.kind)==="pair"?o.jsx(s0e,{address:A,onPairedHost:z}):T.length===0?o.jsx(ri,{children:o.jsx(Dhe,{})}):o.jsx(Ire,{children:o.jsx(Khe,{hosts:T,focus:M,renderWorkbench:({host:$,remote:E,device:N,rejected:_,retry:R,opening:B,cancelOpening:D,openConversation:I})=>o.jsx(lI,{remote:E,wsUrl:$.url,rejected:_,device:N,hostKey:$.hostKey,onReconnect:R,notify:!1,framed:!1,hostOpening:B,hostOpen:I,hostCancelOpening:D})})}),o.jsx(Hhe,{}),o.jsx(Ng,{position:"topEnd",inset:{top:48},isTopLayer:!0,children:o.jsx(Phe,{})})]})})})}function s0e({address:e,onPairedHost:t}){const[n,s]=h.useState(!1),r=()=>{history.replaceState(null,"",window.location.pathname+window.location.search),window.location.reload()};if(n)return o.jsx(r0e,{address:e,...t===void 0?{}:{onPairedHost:t}});const i=new URL(e.url);return o.jsx(ri,{children:o.jsxs(re,{gap:4,hAlign:"center",style:{maxWidth:420},children:[o.jsx(Pi,{title:"Pair with this host?",description:`This device will pair with ${i.host}.`}),o.jsx(K,{type:"supporting",style:{wordBreak:"break-all"},children:e.url}),o.jsxs(ke,{gap:2,children:[o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:r}),o.jsx(Q,{label:"Pair",variant:"primary",onClick:()=>s(!0)})]})]})})}function r0e({address:e,connect:t,onPairedHost:n}){const{hosts:s,paired:r,endpoints:i,setConnection:a}=As(),l=h.useMemo(()=>s.find(T=>T.hostKey===e.hostKey),[s,e]),[c,u]=h.useState(),d=h.useRef(!1),[f,p]=h.useState(!1),x=h.useMemo(()=>e.kind==="pair"&&l!==void 0?Td(Vi(l.privateKey)):e.kind==="device"?Td(Vi(e.privateKey)):V3(),[e,l]),[g,v]=h.useState();h.useEffect(()=>{if(e.kind!=="pair")return;let T=!0;return tb().then(z=>{T&&v(z)}),()=>{T=!1}},[e]);const y=h.useMemo(()=>({url:(l==null?void 0:l.url)??e.url,endpointSet:(l==null?void 0:l.endpointSet)??e.endpointSet}),[e,l]),m=h.useMemo(()=>U1(y.url,y.endpointSet,{pageProtocol:window.location.protocol}),[y]),k=e.kind==="pair"&&!f&&g!==void 0?{secret:e.secret,name:g}:void 0,b=h.useMemo(()=>nz(),[]),j=h.useMemo(()=>{if(!(e.kind==="pair"&&g===void 0))return nI({hostKey:e.hostKey,device:x,target:y,candidates:m,stored:l,rtcPlatform:b,...k===void 0?{}:{pairing:k},setConnection:a,onPaired:()=>{if(d.current)return;d.current=!0,p(!0);const T=e.endpointSet,z={url:T===void 0?e.url:L3(e.url,T),hostKey:e.hostKey,privateKey:Dh(x.privateKey),...T===void 0?{}:{endpointSet:T}},$=l===void 0?z:x1(l,z);r($).then(()=>n==null?void 0:n($),E=>{console.error("Could not save the paired host",E),u($)}),history.replaceState(null,"",window.location.pathname+window.location.search)},onEndpointSet:T=>{i(e.hostKey,T).catch(z=>console.error("Could not store the host's remote endpoints",z))}})},[e,m,x,i,n,r,g,k,b,a,l,y]);if(j===void 0)return o.jsx(ri,{children:null});const A=e.kind==="pair"?o.jsxs(re,{gap:4,hAlign:"center",children:[o.jsx(Pi,{title:"This pairing code was used or has expired",description:"Generate a new QR on the host: run pinomad pair, or open Settings → Devices → Pair a device."}),o.jsx("div",{className:"w-full max-w-md",children:o.jsx(zd,{})}),s.length===0?null:o.jsx(Q,{label:"Use saved pairing",variant:"secondary",onClick:()=>{history.replaceState(null,"",window.location.pathname+window.location.search),window.location.reload()}})]}):o.jsx(Ab,{hostKey:e.hostKey}),M=c===void 0?void 0:o.jsx(Oe,{status:"warning",container:"section",title:"This pairing wasn't saved",description:"It will be lost when the app restarts.",endContent:o.jsx(Q,{label:"Retry",variant:"secondary",onClick:()=>{r(c).then(()=>{u(void 0),n==null||n(c)},T=>console.error("Could not save the paired host",T))}})});return o.jsx(aI,{options:j,connectionKey:e.hostKey,label:y.url,rejected:A,device:x,notice:M,hostKey:e.hostKey,...t===void 0?{}:{connect:t}})}function aI({options:e,connectionKey:t,label:n,rejected:s,device:r,notice:i,hostKey:a,connect:l}){const[c,u]=h.useState(0),d=eI(e,`${t} ${c}`,l===void 0?void 0:{connect:l});return d.status==="connecting"?o.jsx(ri,{children:o.jsx(Pi,{title:"Connecting",description:n})}):d.status==="failed"?o.jsxs(ri,{children:[i===void 0?null:o.jsx("div",{className:"w-full max-w-md",children:i}),d.mismatch!==void 0?o.jsx(Mb,{wsUrl:n,mismatch:d.mismatch,...a===void 0?{}:{hostKey:a}}):s!==void 0&&d.unauthorized?s:o.jsxs(re,{gap:4,hAlign:"center",children:[o.jsx(Oe,{status:"error",title:d.direct===void 0?"Could not connect to the host":"Direct connection unavailable",description:d.direct===void 0?d.error:"This host can't be reached without the relay, and the peer-to-peer link didn't connect."}),d.direct===void 0?null:o.jsx(K,{type:"supporting",style:{textAlign:"center"},children:`Details: ${d.direct.reason}`}),d.direct===void 0?null:o.jsx(K,{type:"supporting",style:{textAlign:"center"},children:"Change this host's connection mode under Hosts below, then retry."}),o.jsx(Q,{label:"Retry",variant:"secondary",onClick:()=>u(c+1)})]}),s!==void 0&&d.unauthorized?null:o.jsx($k,{})]}):o.jsx(lI,{remote:d.remote,wsUrl:n,rejected:s,device:r,notice:i,hostKey:a,onReconnect:()=>u(c+1)})}function lI({remote:e,wsUrl:t,rejected:n,device:s,notice:r,hostKey:i,onReconnect:a,notify:l=!0,framed:c=!0,hostOpening:u,hostOpen:d,hostCancelOpening:f}){var ui,Ur,Gs,di,Se,It,ts,he;const p=tI(e),{hosts:x,focus:g,focusConversation:v,focusDraft:y,rememberConversation:m}=As(),k=h.useRef(g);k.current=g;const b=h.useRef(!0);h.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]);const j=h.useRef(null),[A,M]=h.useState(!1),T=h.useCallback(ee=>{j.current===ee&&(j.current=null,b.current&&M(!1))},[]),z=h.useCallback(ee=>{if(j.current!==ee||!ee.commandSettled)return;if(ee.confirmed||ee.cancelled){T(ee);return}const je=e.view.current().side;je!==void 0&&je.id!==ee.sideBeforeId||T(ee)},[T,e]);WT(i,p.settings);const[$,E]=h.useState(!0),N=c?$:g!==null&&g.hostKey===i&&g.conversationId===void 0,_=fb(),R=tf(_).home;h.useEffect(()=>{c&&E(p.conversation===void 0)},[c,(ui=p.conversation)==null?void 0:ui.conversation.id]);const B=CT(e),D=u??B.opening,I=d??B.open,O=f??B.cancel,L=h.useCallback(ee=>{c&&E(!1),d!==void 0&&i!==void 0?v({hostKey:i,conversationId:ee}):I(ee)},[v,c,i,d,I]);h.useEffect(()=>{var qo,fi,of,rl;const ee=j.current;if(ee===null||ee.confirmed||ee.cancelled)return;const je=()=>{var Uh;ee.cancelled=!0,ee.stagedId!==void 0&&((Uh=e.view.current().side)==null?void 0:Uh.id)===ee.stagedId&&e.controller.showSide(void 0),z(ee)},te=(qo=p.conversation)==null?void 0:qo.conversation.id;if(te!==void 0&&te!==ee.parentId){je();return}if(d!==void 0&&i!==void 0&&((g==null?void 0:g.hostKey)!==i||g.conversationId!==ee.parentId)){je();return}const we=p.side;if(!ee.commandSettled&&(we===void 0||we.id===ee.sideBeforeId))return;if(we===void 0||we.id===ee.sideBeforeId){je();return}if(ee.stagedId!==void 0&&we.id!==ee.stagedId){je();return}const Ce=(fi=ei(p.organized,we.id))==null?void 0:fi.summary,He=(Ce==null?void 0:Ce.kind)==="fork"&&Ce.parent===ee.parentId&&Ce.forkedAt===ee.entryId,lt=(of=we.conversation)==null?void 0:of.conversation.parent,ps=(lt==null?void 0:lt.conversationId)===ee.parentId&&String(lt.at)===ee.entryId;if(!He&&!ps){if(Ce===void 0&&we.conversation===void 0)return;je();return}if(ee.stagedId=we.id,!He){Ce!==void 0&&je();return}ee.confirmed=!0,L(we.id),((rl=e.view.current().side)==null?void 0:rl.id)===we.id&&e.controller.showSide(void 0),z(ee)},[g,i,d,L,e,z,p.conversation,p.organized,p.side]),ST(p,i,N||(Ur=p.conversation)==null?void 0:Ur.conversation.id,ee=>{i===void 0?(E(!1),I(ee.conversationId)):v(ee)},l);const H=!N&&D!==void 0&&((Gs=p.conversation)==null?void 0:Gs.conversation.id)!==D.id,q=H&&D.failed,U=N||H?void 0:p.conversation;h.useEffect(()=>{q&&p.connection==="connected"&&I(D.id)},[q,I,D==null?void 0:D.id,p.connection]);const X=N?void 0:H?D.id:!c&&i!==void 0?g==null?void 0:g.conversationId:(di=p.conversation)==null?void 0:di.conversation.id,Z=U!==void 0&&ig(U),ie=Ya("(max-width: 1023px)"),[ae,xe]=h.useState(e0e),fe=ee=>{window.localStorage.setItem(iI,String(ee)),xe(ee)},[se,ye]=h.useState(!1),[me,P]=h.useState(t0e),V=h.useCallback(ee=>{window.localStorage.setItem(oI,ee),P(ee),ye(!0)},[]),Y=ee=>{se&&ee===me?ye(!1):V(ee)},[oe,F]=h.useState(),[le,ce]=h.useState(),[ge,ve]=h.useState({occupied:!1,locked:!1}),pe=Xd(),Ve=h.useCallback(async(ee,je)=>{var He,lt;if(j.current!==null)return;const te=e.view.current(),we=(He=te.conversation)==null?void 0:He.conversation.id;if(we===void 0)return;const Ce={parentId:we,entryId:ee,sideBeforeId:(lt=te.side)==null?void 0:lt.id,stagedId:void 0,confirmed:!1,cancelled:!1,commandSettled:!1};j.current=Ce,M(!0);try{await e.controller.fork(ee,je,void 0,{show:"side"})}catch(ps){if(j.current!==Ce)return;Ce.cancelled=!0,b.current&&pe({body:ps instanceof Error?ps.message:String(ps),type:"error"})}finally{j.current===Ce&&(Ce.commandSettled=!0,z(Ce))}},[e,z,pe]),Ye=U==null?void 0:U.conversation.id,ot=Tie(oe,Ye),at=le!==void 0&&le===Ye,Mt=ge.occupied||ge.locked||le!==void 0,Dn=ge.occupied?"Clear the composer to edit":Mt?"Finish the current edit first":void 0,nt=h.useCallback(ee=>{L(ee),e.controller.showSide(void 0),ie&&ye(!1)},[e,ie,L]),Tt=h.useCallback(ee=>{var te;const je=(te=ei(p.organized,ee))==null?void 0:te.summary;if((je==null?void 0:je.kind)==="subagent"&&je.lifecycle==="background"){nt(ee);return}V("tasks"),e.controller.showSide(ee)},[e,p.organized,nt,V]),wn=ee=>{if(ee!==void 0)return Tt(ee);e.controller.showSide(void 0),V("tasks")},Ms=X===void 0||(Se=q1(p.organized,X))==null?void 0:Se.summary.id;h.useEffect(()=>{e.controller.showSide(void 0)},[Ms]);const Fs=Bh(x),yt=i===void 0||c?void 0:{value:i,options:x.map(ee=>({value:ee.hostKey,label:Fs.get(ee.hostKey)??ee.url})),onChange:y},jt=R.kind==="chat"?"New chat":`New conversation in ${a0e(p.organized,R.path)}`,Fe=X===void 0||(It=ei(p.organized,X))==null?void 0:It.summary,ai=Fe===void 0?void 0:Fe.kind==="subagent"?Fe.role:RM(Fe),Ts=X===void 0?void 0:q1(p.organized,X),Ho=Ts===void 0?[]:I3(Ts).flatMap(ee=>ee.tasks),zs=rI(Ho),Bn=Fe==null?void 0:Fe.parent,Pr=Bn===void 0||(ts=ei(p.organized,Bn))==null?void 0:ts.summary,Yi=h.useMemo(()=>(ee,je="original")=>e.controller.image(ee,je),[e]),jn=iY(p),Ns=(Fe==null?void 0:Fe.kind)==="conversation",Sn=h.useCallback(ee=>Fe===void 0?[]:IM(p.organized,Fe.id,ee),[p.organized,Fe]),tn=h.useCallback(ee=>{var je;return(je=ei(p.organized,ee))==null?void 0:je.summary},[p.organized]),es=ee=>{O(),i!==void 0&&y(i),_.setHome(ee),c&&E(!0)},[li,Vs]=h.useState();if(h.useEffect(()=>{p.connection==="connected"&&sessionStorage.removeItem(sI(i))},[i,p.connection]),p.unauthorized===!0&&n!==void 0)return o.jsx(ri,{children:n});const ci=o.jsxs("div",{className:"flex h-full min-h-0 min-w-0",children:[o.jsxs("div",{className:"flex min-h-0 min-w-[20rem] flex-1 flex-col",children:[o.jsx(cre,{narrow:ie,title:N?jt:Dr(Fe),...ai===void 0?{}:{agent:ai},parentSummary:Pr,onBackToParent:L,showOverview:X!==void 0,overviewOpen:ae,onOverviewChange:fe,panelControls:o.jsx(KR,{narrow:ie,open:se,surface:me,liveActivity:zs,onSelect:Y})}),r,o.jsx(o0e,{view:p,wsUrl:t,hostKey:i}),o.jsxs("div",{className:"@container relative flex min-h-0 min-w-0 flex-1 flex-col",children:[X===void 0?o.jsx(aie,{view:p,remote:e,hostKey:i,draft:R,onDraft:es,...yt===void 0?{}:{machine:yt},onCreated:()=>{var we,Ce,He;const ee=(we=e.view.current().conversation)==null?void 0:we.conversation.id;if(ee===void 0)return;i!==void 0&&_re(window.localStorage,i);const je=i===void 0||((Ce=k.current)==null?void 0:Ce.hostKey)===i&&k.current.conversationId===void 0;if(!b.current){i!==void 0&&m({hostKey:i,conversationId:ee});return}if(je){L(ee),ie||fe(!0);return}const te=((He=k.current)==null?void 0:He.hostKey)===i&&k.current.conversationId!==void 0;i!==void 0&&!te&&m({hostKey:i,conversationId:ee})},connected:p.connection==="connected"}):o.jsx(SC,{className:`motion-safe:transition-[padding] motion-safe:duration-200 motion-safe:ease-out${ae&&!ie?" pigui-overview-clearance":""}`,style:Jhe,composer:o.jsx("div",{className:"mx-auto w-full max-w-[44rem]",children:(Fe==null?void 0:Fe.kind)==="subagent"?o.jsx("div",{className:"border-t border-border py-2 text-center text-xs text-muted",children:"Read-only · subagent"}):U===void 0?q?null:o.jsx(z1e,{}):o.jsxs(re,{gap:1,children:[o.jsx(jhe,{docs:p.docs,remote:e,connected:p.connection==="connected"}),o.jsx(Mie,{view:p,remote:e,conversation:U,busy:Z,narrow:ie,takeBack:ot,externalEditLocked:at,onEditorStateChange:ve,source:i,onTakeBack:()=>{F(void 0),ce(void 0)}})]})}),emptyState:q?o.jsx(N1e,{missing:Fe===void 0,connected:p.connection==="connected",onRetry:()=>I(D.id)}):o.jsx(Pi,{title:"Nothing here yet",description:"Ask the agent something. Every client sees it."}),children:U===void 0?q?null:o.jsx(UR,{}):o.jsx(PR,{conversation:U,docs:p.docs,submissions:p.submissions,toolPresentations:p.toolPresentations,connected:p.connection==="connected",canFork:Ns,forkDisabled:A,openInPanel:Tt,onOpenFork:nt,onFork:Vs,forksAt:Sn,summaryOf:tn,submissionEditDisabled:Mt,submissionEditTooltip:Dn,onRetry:(Fe==null?void 0:Fe.kind)==="subagent"?void 0:async({text:ee,images:je,skills:te,attachments:we,requestId:Ce})=>{hm(),await e.controller.submit(ee,"followUp",{requestId:Ce,images:je.map(GK),...je.some(He=>!("data"in He))?{imageViews:je}:{},skills:te,...we.length===0?{}:{attachments:we.map(He=>He.id)},...we.length===0?{}:{attachmentDetails:we}})},onRetrySubmission:(Fe==null?void 0:Fe.kind)==="subagent"?void 0:ee=>{e.controller.retrySubmission(ee).catch(()=>{})},onEditSubmission:(Fe==null?void 0:Fe.kind)==="subagent"?void 0:ee=>{const je=Ye;Mt||je===void 0||(ce(je),e.controller.takeBackSubmission(ee).then(te=>{te!==void 0?F({conversationId:je,draft:te}):ce(void 0)}).catch(te=>{ce(void 0),pe({body:te instanceof Error?te.message:String(te),type:"error"})}))}})},`${i??"local"}:${X}`),ae&&U!==void 0?o.jsx(yhe,{view:p,remote:e,conversation:U,narrow:ie,busy:ig(U),onOpenChanges:()=>V("changes"),onOpenTasks:wn,onClose:()=>fe(!1)}):null]})]}),ie?null:o.jsx(uj,{view:p,remote:e,shownId:X,narrow:!1,open:se,surface:me,busy:Z,liveActivity:zs,onOpenChange:ye,onSelectSurface:Y,openInPanel:Tt,onOpenInMain:nt})]}),hs=o.jsxs(o.Fragment,{children:[ie?o.jsx(uj,{view:p,remote:e,shownId:X,narrow:!0,open:se,surface:me,busy:Z,liveActivity:zs,onOpenChange:ye,onSelectSurface:Y,openInPanel:Tt,onOpenInMain:nt}):null,li===void 0?null:o.jsx(i0e,{entryId:li,connected:p.connection==="connected",busy:A,onClose:()=>Vs(void 0),onCreate:Ve})]});return o.jsx(rY,{load:Yi,retryKey:jn,...i===void 0?{}:{source:i},children:c?o.jsxs(HN,{machines:[{key:i??"local",label:((he=p.settings)==null?void 0:he.hostName)??t,view:p,remote:e,...i===void 0?{}:{hostKey:i},...s===void 0?{}:{device:s},...a===void 0?{}:{retry:a}}],focusKey:i??"local",draftingChat:N&&R.kind==="chat",shownId:X,onDraft:(ee,je)=>es(je),onOpen:(ee,je)=>L(je),onNewChat:()=>es({kind:"chat"}),narrow:ie,children:[ci,hs]}):o.jsxs(o.Fragment,{children:[ci,hs]})})}function i0e({entryId:e,connected:t,busy:n,onClose:s,onCreate:r}){const[i,a]=h.useState("Continue from here."),l=()=>{hm(),r(e,i.trim()),s()};return o.jsx(Us,{isOpen:!0,onOpenChange:c=>c?void 0:s(),purpose:"form",width:480,children:o.jsx(Cs,{header:o.jsx(Hr,{title:"Fork from this answer",subtitle:"The fork sees the conversation up to here and works in the same files.",onOpenChange:()=>s()}),content:o.jsx(Es,{children:o.jsx(st,{label:"First message",value:i,onChange:a})}),footer:o.jsx(el,{children:o.jsxs(ke,{gap:2,hAlign:"end",children:[o.jsx(Q,{label:"Cancel",variant:"secondary",onClick:s}),o.jsx(Q,{label:n?"Forking…":"Fork",variant:"primary",isDisabled:!t||n||i.trim()==="",onClick:l})]})})})})}function o0e({view:e,wsUrl:t,hostKey:n}){return e.connection==="outdated"?e.protocolMismatch===void 0?null:o.jsx(Mb,{wsUrl:t,mismatch:e.protocolMismatch,...n===void 0?{}:{hostKey:n}}):e.connection==="reconnecting"?o.jsx(Oe,{status:"warning",container:"section",title:"Host connection lost",description:"Reconnecting… the view keeps the last state the host sent."}):e.connection==="closed"?o.jsx(Oe,{status:"error",container:"section",title:"Disconnected from the host"}):null}function a0e(e,t){var n;return((n=e.projects.find(s=>s.project.path===t))==null?void 0:n.project.name)??t.split("/").at(-1)??t}iM.createRoot(document.getElementById("root")).render(o.jsx(h.StrictMode,{children:o.jsx(GS,{theme:FK,children:o.jsx(n0e,{})})}));export{jg as _,o as j,h as r};
|