pinomad 0.13.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.
Files changed (41) hide show
  1. package/dist/chunk-0dh2k3er.js +43 -0
  2. package/dist/{chunk-kmzzjv53.js → chunk-1mjbt2z2.js} +143 -10
  3. package/dist/{chunk-s0h7c7da.js → chunk-1rdbnvy6.js} +1 -1
  4. package/dist/{chunk-53xv3fny.js → chunk-35szq73k.js} +2446 -416
  5. package/dist/{chunk-aapsc9g0.js → chunk-5j7ybhjj.js} +1952 -295
  6. package/dist/{chunk-m51mq8vh.js → chunk-5pv0g1nj.js} +12 -10
  7. package/dist/{chunk-7mn38n4f.js → chunk-63ymn5c9.js} +2 -2
  8. package/dist/{chunk-563fnad9.js → chunk-6j6hkfbj.js} +8 -4
  9. package/dist/{chunk-pqe7q1s7.js → chunk-6vbp1vva.js} +2 -1
  10. package/dist/{chunk-g3ahp7b9.js → chunk-9trbbz4r.js} +1 -1
  11. package/dist/{chunk-d9mq5d46.js → chunk-b0nwq1dt.js} +10 -8
  12. package/dist/chunk-dsr19q5h.js +23 -0
  13. package/dist/{chunk-6th9xv39.js → chunk-e53c0s8z.js} +9 -7
  14. package/dist/{chunk-4fferbxw.js → chunk-e59k3bmz.js} +213 -30
  15. package/dist/chunk-eerpgvy9.js +315 -0
  16. package/dist/chunk-eewxy4cp.js +240 -0
  17. package/dist/{chunk-maqv34cs.js → chunk-evbv1fkn.js} +3 -3
  18. package/dist/{chunk-ra86wjp5.js → chunk-ex5yr09h.js} +11 -6
  19. package/dist/{chunk-t91zt5f0.js → chunk-hg9gs396.js} +1 -1
  20. package/dist/{chunk-90g1cg9n.js → chunk-mtkvft88.js} +1 -1
  21. package/dist/{chunk-wd7aracm.js → chunk-mxwcnnkg.js} +1 -303
  22. package/dist/{chunk-d4tq62yr.js → chunk-w927q9m1.js} +12 -11
  23. package/dist/pinomad.js +12 -12
  24. package/package.json +5 -1
  25. package/web/assets/{core-BHm2gdHL.js → core-BWHGsFpV.js} +1 -1
  26. package/web/assets/{highlighted-diff-DrHvSLK9.js → highlighted-diff-DJ7KZCpS.js} +2 -2
  27. package/web/assets/{highlights-1aLwssz-.js → highlights-CyEmo6OI.js} +1 -1
  28. package/web/assets/{highlights-themes-C1p4pFYS.js → highlights-themes-CSNkBojy.js} +1 -1
  29. package/web/assets/index-C_qkbyL7.css +1 -0
  30. package/web/assets/index-DefQtCI2.js +396 -0
  31. package/web/assets/{shiki-BwyCm3kZ.js → shiki-BzCmRG-v.js} +2 -2
  32. package/web/assets/{shiki-langs-CMlALLSg.js → shiki-langs-DOkjyV4d.js} +1 -1
  33. package/web/assets/{stream-tokenizer-BlgIhw0y.js → stream-tokenizer-CBPqFe4Z.js} +1 -1
  34. package/web/assets/{theming-themes-DDvoqEqT.js → theming-themes-wKVca0aB.js} +1 -1
  35. package/web/assets/{xterm-view-BnKOnF3C.js → xterm-view-CKa1-QCM.js} +12 -12
  36. package/web/index.html +3 -2
  37. package/web/theme-boot.js +11 -0
  38. package/dist/chunk-sd640dt7.js +0 -22
  39. package/dist/chunk-t6fw0wa9.js +0 -96
  40. package/web/assets/index-A_AUJoO6.css +0 -1
  41. package/web/assets/index-BafYMKiN.js +0 -396
@@ -0,0 +1,396 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/xterm-view-CKa1-QCM.js","assets/xterm-view-6GBZ9nXN.css"])))=>i.map(i=>d[i]);
2
+ var rO=Object.defineProperty;var q6=e=>{throw TypeError(e)};var oO=(e,t,n)=>t in e?rO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ve=(e,t,n)=>oO(e,typeof t!="symbol"?t+"":t,n),j2=(e,t,n)=>t.has(e)||q6("Cannot "+n);var j=(e,t,n)=>(j2(e,t,"read from private field"),n?n.call(e):t.get(e)),oe=(e,t,n)=>t.has(e)?q6("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),V=(e,t,n,s)=>(j2(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),C=(e,t,n)=>(j2(e,t,"access private method"),n);var Xn=(e,t,n,s)=>({set _(i){V(e,t,i,n)},get _(){return j(e,t,s)}});function aO(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const r=Object.getOwnPropertyDescriptor(s,i);r&&Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>s[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}})();function lO(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var GS={exports:{}},dm={};/**
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 cO=Symbol.for("react.transitional.element"),uO=Symbol.for("react.fragment");function WS(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 i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:cO,type:e,key:s,ref:t!==void 0?t:null,props:n}}dm.Fragment=uO;dm.jsx=WS;dm.jsxs=WS;GS.exports=dm;var o=GS.exports,KS={exports:{}},We={};/**
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 $4=Symbol.for("react.transitional.element"),dO=Symbol.for("react.portal"),fO=Symbol.for("react.fragment"),hO=Symbol.for("react.strict_mode"),pO=Symbol.for("react.profiler"),xO=Symbol.for("react.consumer"),gO=Symbol.for("react.context"),mO=Symbol.for("react.forward_ref"),vO=Symbol.for("react.suspense"),yO=Symbol.for("react.memo"),XS=Symbol.for("react.lazy"),kO=Symbol.for("react.activity"),bO=Symbol.for("react.view_transition"),P6=Symbol.iterator;function wO(e){return e===null||typeof e!="object"?null:(e=P6&&e[P6]||e["@@iterator"],typeof e=="function"?e:null)}var ZS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},YS=Object.assign,QS={};function xf(e,t,n){this.props=e,this.context=t,this.refs=QS,this.updater=n||ZS}xf.prototype.isReactComponent={};xf.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")};xf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function JS(){}JS.prototype=xf.prototype;function A4(e,t,n){this.props=e,this.context=t,this.refs=QS,this.updater=n||ZS}var M4=A4.prototype=new JS;M4.constructor=A4;YS(M4,xf.prototype);M4.isPureReactComponent=!0;var U6=Array.isArray;function wy(){}var Ft={H:null,A:null,T:null,S:null},eC=Object.prototype.hasOwnProperty;function T4(e,t,n){var s=n.ref;return{$$typeof:$4,type:e,key:t,ref:s!==void 0?s:null,props:n}}function jO(e,t){return T4(e.type,t,e.props)}function z4(e){return typeof e=="object"&&e!==null&&e.$$typeof===$4}function SO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var F6=/\/+/g;function S2(e,t){return typeof e=="object"&&e!==null&&e.key!=null?SO(""+e.key):t.toString(36)}function CO(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(wy,wy):(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 Tu(e,t,n,s,i){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(r){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case $4:case dO:a=!0;break;case XS:return a=e._init,Tu(a(e._payload),t,n,s,i)}}if(a)return i=i(e),a=s===""?"."+S2(e,0):s,U6(i)?(n="",a!=null&&(n=a.replace(F6,"$&/")+"/"),Tu(i,t,n,"",function(u){return u})):i!=null&&(z4(i)&&(i=jO(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(F6,"$&/")+"/")+a)),t.push(i)),1;a=0;var l=s===""?".":s+":";if(U6(e))for(var c=0;c<e.length;c++)s=e[c],r=l+S2(s,c),a+=Tu(s,t,n,r,i);else if(c=wO(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,r=l+S2(s,c++),a+=Tu(s,t,n,r,i);else if(r==="object"){if(typeof e.then=="function")return Tu(CO(e),t,n,s,i);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 _0(e,t,n){if(e==null)return e;var s=[],i=0;return Tu(e,s,"","",function(r){return t.call(n,r,i++)}),s}function EO(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 V6=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 tC(e){var t=Ft.T,n={};n.types=t!==null?t.types:null,Ft.T=n;try{var s=e(),i=Ft.S;i!==null&&i(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(wy,V6)}catch(r){V6(r)}finally{t!==null&&n.types!==null&&(t.types=n.types),Ft.T=t}}function nC(e){var t=Ft.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else tC(nC.bind(null,e))}var $O={map:_0,forEach:function(e,t,n){_0(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return _0(e,function(){t++}),t},toArray:function(e){return _0(e,function(t){return t})||[]},only:function(e){if(!z4(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};We.Activity=kO;We.Children=$O;We.Component=xf;We.Fragment=fO;We.Profiler=pO;We.PureComponent=A4;We.StrictMode=hO;We.Suspense=vO;We.ViewTransition=bO;We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ft;We.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ft.H.useMemoCache(e)}};We.addTransitionType=nC;We.cache=function(e){return function(){return e.apply(null,arguments)}};We.cacheSignal=function(){return null};We.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=YS({},e.props),i=e.key;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)!eC.call(t,r)||r==="key"||r==="__self"||r==="__source"||r==="ref"&&t.ref===void 0||(s[r]=t[r]);var r=arguments.length-2;if(r===1)s.children=n;else if(1<r){for(var a=Array(r),l=0;l<r;l++)a[l]=arguments[l+2];s.children=a}return T4(e.type,i,s)};We.createContext=function(e){return e={$$typeof:gO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:xO,_context:e},e};We.createElement=function(e,t,n){var s,i={},r=null;if(t!=null)for(s in t.key!==void 0&&(r=""+t.key),t)eC.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(i[s]=t[s]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(s in a=e.defaultProps,a)i[s]===void 0&&(i[s]=a[s]);return T4(e,r,i)};We.createRef=function(){return{current:null}};We.forwardRef=function(e){return{$$typeof:mO,render:e}};We.isValidElement=z4;We.lazy=function(e){return{$$typeof:XS,_payload:{_status:-1,_result:e},_init:EO}};We.memo=function(e,t){return{$$typeof:yO,type:e,compare:t===void 0?null:t}};We.startTransition=tC;We.unstable_useCacheRefresh=function(){return Ft.H.useCacheRefresh()};We.use=function(e){return Ft.H.use(e)};We.useActionState=function(e,t,n){return Ft.H.useActionState(e,t,n)};We.useCallback=function(e,t){return Ft.H.useCallback(e,t)};We.useContext=function(e){return Ft.H.useContext(e)};We.useDebugValue=function(){};We.useDeferredValue=function(e,t){return Ft.H.useDeferredValue(e,t)};We.useEffect=function(e,t){return Ft.H.useEffect(e,t)};We.useEffectEvent=function(e){return Ft.H.useEffectEvent(e)};We.useId=function(){return Ft.H.useId()};We.useImperativeHandle=function(e,t,n){return Ft.H.useImperativeHandle(e,t,n)};We.useInsertionEffect=function(e,t){return Ft.H.useInsertionEffect(e,t)};We.useLayoutEffect=function(e,t){return Ft.H.useLayoutEffect(e,t)};We.useMemo=function(e,t){return Ft.H.useMemo(e,t)};We.useOptimistic=function(e,t){return Ft.H.useOptimistic(e,t)};We.useReducer=function(e,t,n){return Ft.H.useReducer(e,t,n)};We.useRef=function(e){return Ft.H.useRef(e)};We.useState=function(e){return Ft.H.useState(e)};We.useSyncExternalStore=function(e,t,n){return Ft.H.useSyncExternalStore(e,t,n)};We.useTransition=function(){return Ft.H.useTransition()};We.version="19.3.1";KS.exports=We;var h=KS.exports;const fm=lO(h),sC=aO({__proto__:null,default:fm},[h]);var Hf={},G6;function AO(){if(G6)return Hf;G6=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.styleq=void 0;var e=new WeakMap,t="$$css";function n(i){var r,a,l;return i!=null&&(r=i.disableCache===!0,a=i.disableMix===!0,l=i.transform),function(){for(var u=[],d="",f=null,p="",x=r?null:e,g=new Array(arguments.length),y=0;y<arguments.length;y++)g[y]=arguments[y];for(;g.length>0;){var v=g.pop();if(!(v==null||v===!1)){if(Array.isArray(v)){for(var m=0;m<v.length;m++)g.push(v[m]);continue}var k=l!=null?l(v):v;if(k.$$css!=null){var w="";if(x!=null&&x.has(k)){var S=x.get(k);S!=null&&(w=S[0],p=S[2],u.push.apply(u,S[1]),x=S[3])}else{var E=[];for(var A in k){var z=k[A];if(A===t){var N=k[A];N!==!0&&(p=p?N+"; "+p:N);continue}typeof z=="string"||z===null?u.includes(A)||(u.push(A),x!=null&&E.push(A),typeof z=="string"&&(w+=w?" "+z:z)):console.error("styleq: ".concat(A," typeof ").concat(String(z),' is not "string" or "null".'))}if(x!=null){var M=new WeakMap;x.set(k,[w,E,p,M]),x=M}}w&&(d=d?w+" "+d:w)}else if(a)f==null&&(f={}),f=Object.assign({},k,f);else{var $=null;for(var R in k){var _=k[R];_!==void 0&&(u.includes(R)||(_!=null&&(f==null&&(f={}),$==null&&($={}),$[R]=_),u.push(R),x=null))}$!=null&&(f=Object.assign($,f))}}}var T=[d,f,p];return T}}var s=Hf.styleq=n();return s.factory=n,Hf}var MO=AO();function G(...e){const[t,n,s]=MO.styleq(e),i={};return t!=null&&t!==""&&(i.className=t),n!=null&&Object.keys(n).length>0&&(i.style=n),s!=null&&s!==""&&(i["data-style-src"]=s),i}const TO={"--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)"},zO={"--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"},Ri={"--spacing-1":"var(--spacing-1)","--spacing-2":"var(--spacing-2)"},NO={"--size-element-sm":"28px","--size-element-md":"32px","--size-element-lg":"36px"},_O={"--radius-none":"0px","--radius-inner":"4px","--radius-element":"8px","--radius-container":"12px","--radius-page":"28px","--radius-chat":"28px","--radius-full":"9999px"},RO={"--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)"},IO={"--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"},LO={"--ease-standard":"cubic-bezier(0.24, 1, 0.4, 1)"},OO={"--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'},DO={"--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"},BO={"--font-weight-normal":"400","--font-weight-medium":"500","--font-weight-semibold":"600","--font-weight-bold":"700"},HO={"--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"},N4=h.createContext(null);N4.displayName="LayoutAreaContext";const qO={hasHeader:!1,hasFooter:!1,hasStart:!1,hasEnd:!1},hm=h.createContext(qO);hm.displayName="LayoutSlotsContext";const pm=h.createContext(null);pm.displayName="LayoutDividerContext";const PO={center:{kGNEyG:"x6s0dn4",$$css:!0},end:{kGNEyG:"xuk3077",$$css:!0},start:{kGNEyG:"x1cy8zhl",$$css:!0},stretch:{kGNEyG:"x1qjc9v5",$$css:!0}},UO={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}},FO={horizontal:{kXwgrk:"x1q0g3np",$$css:!0},vertical:{kXwgrk:"xdt5ytf",$$css:!0}},VO={nowrap:{kwnvtZ:"xozqiw3",$$css:!0},wrap:{kwnvtZ:"x1a02dak",$$css:!0},"wrap-reverse":{kwnvtZ:"x8hhl5t",$$css:!0}},GO={stack:{k1xSpc:"x78zum5",$$css:!0}},WO={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 jy({crossAlign:e,direction:t,gap:n,mainAlign:s,wrap:i}){return[GO.stack,FO[t],n!=null&&WO[n],e!=null&&PO[e],s!=null&&UO[s],i!=null&&VO[i]]}const KO={reset:{kAzted:"x2lwn1j",k7Eaqz:"xeuugli",$$css:!0}},XO={center:{kSGwAc:"xamitd3",$$css:!0},end:{kSGwAc:"xpvyfi4",$$css:!0},start:{kSGwAc:"xqcrz7y",$$css:!0},stretch:{kSGwAc:"xkh2ocl",$$css:!0}},ZO={fill:{kzQI83:"x1iyjqo2",$$css:!0},static:{kzQI83:"x1c4vz4f",kmuXW:"x2lah0s",$$css:!0}};function YO({crossAlignSelf:e,size:t}={}){return[KO.reset,ZO[t??"static"],e!=null&&XO[e]]}function _4(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 QO(e,t){return e!=null?`id:${e}`:`fallback:${typeof t=="function"?t():t}`}function R0(e,t){const n={...e,...t},s=[e.className,t.className].filter(Boolean).join(" ");s?n.className=s:delete n.className;const i=t.style&&e.style?{...e.style,...t.style}:t.style||e.style;return i?n.style=i:delete n.style,n}function ie(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=R0(e,typeof t=="string"?{className:t}:t??{});return typeof n=="string"?a=R0(a,{className:n}):n!=null&&(a=R0(a,{style:n})),s!=null&&(a=R0(a,{style:s})),a}function pn(...e){return t=>{const n=[];for(const s of e)if(typeof s=="function"){const i=s(t);typeof i=="function"&&n.push(i)}else s!=null&&(s.current=t);if(n.length>0)return()=>{for(const s of n)s()}}}function xm(...e){return t=>{for(const n of e)if(n==null||n(t),t.defaultPrevented)return}}const R4="astryx",iC=R4,gm=R4,JO=R4;function Sy(e){return`${iC}-${e}`}function ei(e){return`data-${gm}-${e}`}function eD(e){return`--${JO}-${e}`}function tD(e){return`data-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`}function nD(e,t){return/^\d/.test(t)?`${e}-${t}`:t}function sD(e,t){const n=[Sy(e)];if(t)for(const[s,i]of Object.entries(t))i!=null&&n.push(nD(s,String(i)));return n.join(" ")}function iD(e){const t={};if(e)for(const[n,s]of Object.entries(e))s!=null&&(t[tD(n)]=String(s));return t}function se(e,t){return{className:sD(e,t),...iD(t)}}function W6(e){const t=e.auxiliaryData;return typeof(t==null?void 0:t.group)=="string"?t.group:void 0}function rD(e){var a;if(!e.some(l=>W6(l)!=null))return[{heading:null,items:e}];const n=[],s=new Map,i=[];for(const l of e){const c=W6(l);c!=null?(s.has(c)||(n.push(c),s.set(c,[])),(a=s.get(c))==null||a.push(l)):i.push(l)}const r=n.map(l=>({heading:l,items:s.get(l)??[]}));return i.length>0&&r.push({heading:null,items:i}),r}let sc=null;const Vx=new Map;function oD(){return sc||(sc=new ResizeObserver(e=>{for(const t of e){const n=Vx.get(t.target);n&&n(t)}})),sc}function I4(e,t){Vx.set(e,t),oD().observe(e),t({target:e})}function L4(e){Vx.delete(e),sc&&(sc.unobserve(e),Vx.size===0&&(sc.disconnect(),sc=null))}function C2(e){return e!=null&&typeof e!="boolean"&&e!==""}function K6(...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 O4(e,t=[],n){return{ariaLabelledBy:n?K6(n.labelID,e):void 0,ariaDescribedBy:K6(n==null?void 0:n.describedByIDs,...t)}}const aD={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}},Gx=(e,t,n)=>Math.max(t,Math.min(n,e));function lD(e){return e.split("").map(t=>t+t).join("")}function cD(e){if(typeof e!="string")return null;const t=e.trim().replace(/^#/,""),n=t.length===3||t.length===4?lD(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 uD(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 i=u=>{const d=u.endsWith("%")?parseFloat(u)/100*255:parseFloat(u);return Gx(d,0,255)},r=i(s[0]),a=i(s[1]),l=i(s[2]);if([r,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=Gx(c,0,1)}return{r,g:a,b:l,a:c}}function X6(e){const t=e.trim(),n=aD[t.toLowerCase()];return n?{...n}:t.startsWith("#")?cD(t):/^rgba?\(/i.test(t)?uD(t):null}function dD(e,t,n){const s=i=>Gx(Math.round(i),0,255).toString(16).padStart(2,"0").toUpperCase();return`#${s(e)}${s(t)}${s(n)}`}function fD({r:e,g:t,b:n,a:s}){if(s>=1)return dD(e,t,n);const i=r=>Gx(Math.round(r),0,255);return`rgba(${i(e)}, ${i(t)}, ${i(n)}, ${parseFloat(s.toFixed(4))})`}function hD(e,t){return`${e}: ${t}`}function Tc(e,t,...n){}function rC(e,t,...n){console.error(hD(e,t),...n)}function D4(e,t,n,...s){}const pD={kbCHJM:"x1nrll8i",k3aq6I:"xsqj5wx",$$css:!0},Fd={mirror:{k3aq6I:"xgtlewx",$$css:!0},centerInline:e=>[pD,{"--x-transform":`translate(-50%, ${e})`!=null?`translate(-50%, ${e})`:void 0}]},oC={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"},gf={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}},mf={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}},vf={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}},yf={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}},xD={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}},gD={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}},mD={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}},vD={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}},ca={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}},yD={kzqmXN:"xh8yej3",kUOVxO:"xvueqy4",$$css:!0},Z6={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=>[yD,{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 qf({area:e,children:t}){return t==null?null:o.jsx(N4,{value:e,children:t})}const kD={"x-default-marker":"x-default-marker",$$css:!0};function Wn({children:e,content:t,contentWidth:n,defaultHasDividers:s,end:i,footer:r,header:a,height:l="fill",padding:c,ref:u,start:d,xstyle:f,className:p,style:x}){const g=l==="fill",y=t??e,v=h.useMemo(()=>s!=null?{defaultHasDividers:s}:null,[s]),m=a!=null,k=r!=null,w=d!=null,S=i!=null,E=h.useMemo(()=>({hasHeader:m,hasFooter:k,hasStart:w,hasEnd:S}),[m,k,w,S]),A=o.jsx(hm,{value:E,children:o.jsx("div",{ref:u,...ie(se("layout",{height:l}),G(ca.layoutOuter,g?ca.fill:ca.auto,f),p,x),children:o.jsxs("div",{...G(kD,ca.layoutInner,...jy({direction:"vertical"}),g?ca.fill:ca.auto,c===0&&ca.fullBleed,c!=null&&xD[c],c!=null&&gD[c],n!=null&&Z6.contentWidthVar(n)),children:[o.jsx(qf,{area:"header",children:a}),o.jsxs("div",{...G(...jy({direction:"horizontal"}),ca.middle,n!=null&&Z6.contentWidth(n)),children:[o.jsx(qf,{area:"start",children:d}),o.jsx("div",{...G(...YO({size:"fill"})),children:o.jsx(qf,{area:"content",children:y})}),o.jsx(qf,{area:"end",children:i})]}),o.jsx(qf,{area:"footer",children:r})]})})});return v!=null?o.jsx(pm,{value:v,children:A}):A}Wn.displayName="Layout";const I0={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}},bD={sizing:e=>[{kZKoxP:e!=null?"x16ye13r":e,$$css:!0},{"--x-height":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function Wx({children:e,hasDivider:t,height:n,label:s,padding:i,role:r,xstyle:a,className:l,style:c,ref:u,...d}){const f=h.use(pm),p=t??(f==null?void 0:f.defaultHasDividers)??!1,x=i===0;return o.jsx("div",{ref:u,role:r,"aria-label":s,"data-divider":p||void 0,...ie(se("layout-header"),G(I0.header,bD.sizing(n??null),p&&I0.divider,a),l,c),...d,children:o.jsx("div",{...G(I0.inner,x&&I0.fullBleed,i!=null&&gf[i],i!=null&&mf[i],i!=null&&vf[i],i!=null&&yf[i]),children:e})})}Wx.displayName="LayoutHeader";const rr={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}},wD={sizing:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function aC({children:e,hasDivider:t=!1,isScrollable:n=!0,label:s,padding:i,role:r,width:a,resizable:l,xstyle:c,className:u,style:d,ref:f,...p}){const x=h.use(N4),{hasHeader:g,hasFooter:y}=h.use(hm),v=l?l._size:a,m=x==="start",k=x==="end",w=i===0,S=!t&&!w&&i==null,E=m?rr.dividerEnd:k?rr.dividerStart:null,A=m?rr.collapseEnd:k?rr.collapseStart:null;return o.jsx("div",{ref:f,role:r,"aria-label":s,...ie(se("layout-panel"),G(rr.panel,wD.sizing(v??null),m&&!w&&i==null&&rr.startPanel,k&&!w&&i==null&&rr.endPanel,!g&&!w&&i==null&&rr.noHeader,!y&&!w&&i==null&&rr.noFooter,n&&rr.scrollable,w&&rr.fullBleed,i!=null&&gf[i],i!=null&&mf[i],i!=null&&vf[i],i!=null&&yf[i],t&&E,S&&A,c),u,d),...p,children:e})}aC.displayName="LayoutPanel";const Cl={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 Kn({children:e,isScrollable:t=!0,padding:n,label:s,role:i,xstyle:r,className:a,style:l,ref:c,...u}){const{hasHeader:d,hasFooter:f,hasStart:p,hasEnd:x}=h.use(hm),g=n===0;return o.jsx("div",{ref:c,role:i,"aria-label":s,...ie(se("layout-content"),G(Cl.content,!p&&!g&&n==null&&Cl.noStart,!x&&!g&&n==null&&Cl.noEnd,!d&&!g&&n==null&&Cl.noHeader,!f&&!g&&n==null&&Cl.noFooter,t&&Cl.scrollable,g&&Cl.fullBleed,n!=null&&gf[n],n!=null&&mf[n],n!=null&&vf[n],n!=null&&yf[n],r),a,l),...u,children:e})}Kn.displayName="LayoutContent";function lC(e){return(e.style.anchorName??"").split(",").map(n=>n.trim()).filter(Boolean)}function cC(e,t){e.style.anchorName=t.join(", ")}function jD(e,t){const n=lC(e);n.includes(t)||(n.push(t),cC(e,n))}function SD(e,t){cC(e,lC(e).filter(n=>n!==t))}const E2={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 CD(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 ED(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[r,a]=e==="above"?["top","bottom"]:["bottom","top"];return`${n}, ${r} span-left, ${r} span-right, ${a} span-left, ${a} span-right`}const[s,i]=e==="start"?["left","right"]:["right","left"];return`${n}, ${s} span-top, ${s} span-bottom, ${i} span-top, ${i} span-bottom`}function kf(e){const{mode:t,onShow:n,onHide:s,lightDismiss:i=!1}=e,r=h.useId(),a=`--astryx-layer-${r.replace(/:/g,"")}`,[l,c]=h.useState(!1),u=h.useRef(null),d=h.useRef(null),f=h.useRef(!1),p=h.useCallback(()=>{const A=u.current;A&&!f.current&&(typeof A.showPopover=="function"?A.showPopover():A.style.display="block",f.current=!0,c(!0),n==null||n())},[n]),x=h.useCallback(()=>{if(f.current){const A=u.current;A&&(typeof A.hidePopover=="function"?A.hidePopover():A.style.display="none"),f.current=!1,c(!1),s==null||s()}},[s]),g=t==="context"?A=>{d.current&&d.current!==A&&SD(d.current,a),A&&jD(A,a),d.current=A}:void 0,y=h.useCallback(A=>{A.newState==="closed"&&f.current&&(f.current=!1,c(!1),s==null||s())},[s]),v=h.useRef(null),m=h.useRef(null),k=h.useCallback((A,z)=>{v.current&&m.current&&(v.current!==A||m.current!==z)&&(v.current.removeEventListener("toggle",m.current),v.current=null,m.current=null),A&&v.current!==A&&(A.addEventListener("toggle",z),v.current=A,m.current=z)},[]),w=h.useCallback(A=>{u.current=A,k(A,y)},[y,k]);h.useEffect(()=>(u.current&&k(u.current,y),()=>{v.current&&m.current&&(v.current.removeEventListener("toggle",m.current),v.current=null,m.current=null)}),[y,k]);const S=h.useCallback((A,z)=>{const{placement:N="above",alignment:M="center",positioning:$="anchor",role:R,"aria-label":_,xstyle:T,className:O,style:H,as:L="div",onMouseEnter:B,onMouseLeave:I}=z||{},D=$==="custom"?{positionAnchor:a}:{positionAnchor:a,positionArea:CD(N,M),positionTryFallbacks:ED(N,M)},q=G(E2.base,T),U=O?`${O} ${q.className??""}`:q.className;return o.jsx(L,{ref:w,id:r,role:R,"aria-label":_,popover:i?"auto":"manual",className:U,style:{...q.style,...D,...H},onMouseEnter:B,onMouseLeave:I,children:A})},[a,r,i,w]),E=h.useCallback((A,z)=>{const{x:N,y:M,xstyle:$,className:R,style:_}=z,T={top:M,left:N},O=G(E2.base,E2.fixed,$),H=R?`${R} ${O.className??""}`:O.className;return o.jsx("div",{ref:w,id:r,popover:i?"auto":"manual",className:H,style:{...O.style,...T,..._},children:A})},[w,r,i]);return t==="context"?{ref:g,anchorId:a,show:p,hide:x,isOpen:l,id:r,render:S}:{ref:void 0,show:p,hide:x,isOpen:l,id:r,render:E}}const qo={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}},$D=100,$2={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 AD(e){return e.hasAttribute("tabindex")?e.tabIndex>=0:["A","BUTTON","INPUT","SELECT","TEXTAREA"].includes(e.tagName)?!e.disabled:!!e.isContentEditable}function Fs(e={}){const{placement:t="above",alignment:n="center",delay:s=200,hideDelay:i=0,focusTrigger:r="auto",isEnabled:a=!0,isOpen:l,isDefaultOpen:c=!1,onShow:u,onHide:d}=e,f=t==="above"||t==="below"?$2.marginBlock:$2.marginInline,p=kf({mode:"context",onShow:u,onHide:d}),x=h.useMemo(()=>[$2.container,f],[f]),g=h.useRef(null),y=h.useRef(null),v=h.useRef(null),m=h.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null),y.current&&(clearTimeout(y.current),y.current=null)},[]),k=h.useCallback(()=>{!a||l===!1||(m(),g.current=setTimeout(()=>{p.show()},s))},[a,l,m,p,s]),w=h.useCallback(()=>{if(l===!0)return;m();const T=i>0?i:$D;y.current=setTimeout(()=>{p.hide()},T)},[l,m,p,i]),S=h.useCallback(()=>{y.current&&(clearTimeout(y.current),y.current=null)},[]),E=h.useCallback(()=>{typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: none)").matches||k()},[k]),A=h.useCallback(()=>{w()},[w]),z=h.useCallback(T=>{!a||!T.target.matches(":focus-visible")||(m(),p.show())},[a,m,p]),N=h.useCallback(()=>{w()},[w]),M=h.useCallback(()=>{l===void 0&&(m(),p.hide())},[l,m,p]),$=h.useCallback(T=>{v.current&&(v.current.removeEventListener("mouseenter",E),v.current.removeEventListener("mouseleave",A),v.current.removeEventListener("focusin",z),v.current.removeEventListener("focusout",N),v.current.removeEventListener("pointerdown",M)),T&&(T.addEventListener("mouseenter",E),T.addEventListener("mouseleave",A),T.addEventListener("pointerdown",M),(r==="always"||r==="auto"&&AD(T))&&(T.addEventListener("focusin",z),T.addEventListener("focusout",N))),v.current=T},[r,E,A,z,N,M]),R=h.useCallback(T=>{p.ref(T),$(T)},[p,$]);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 T=O=>{O.key==="Escape"&&(O.isComposing||O.keyCode===229||(m(),p.hide()))};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[l,p,m]);const _=h.useCallback((T,O)=>{const H=(O==null?void 0:O.placement)??t,L={placement:H,alignment:(O==null?void 0:O.alignment)??n,role:"tooltip",xstyle:[x,qo[H]],className:se("tooltip").className,onMouseEnter:S,onMouseLeave:w};return p.render(o.jsx("div",{className:"xfsso4q xy143xn x12gdq22 x1djylfy xw5ewwj x13faqbe",children:T}),L)},[p,t,n,x,S,w]);return{ref:R,positionRef:p.ref,interactionRef:$,anchorId:p.anchorId,describedBy:p.id,renderTooltip:_}}const B4={"--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)"},MD={"--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)"},TD={...B4,...MD},uC=new Map;function zD(e){uC.set(e.name,e)}function dC(e){return e==null||e===""?null:uC.get(e)??null}const ND={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 Y6(e,t){const n=ND[e];return n?n.filter(s=>s.property===t):[]}function fC(e){return`[data-${gm}-theme="${e}"]`}const hC=`[data-${gm}-theme]`;function Q6(e){return`[data-${gm}-media="${e}"]`}function id(e,t){return`.${iC}-${e}${t}`}function pC(e,t){const n=[];let s=0,i=0;for(let r=0;r<e.length;r++){const a=e[r];a==="("?s++:a===")"?s=Math.max(0,s-1):a===","&&s===0&&(n.push(e.slice(i,r).trim()),i=r+1)}return n.push(e.slice(i).trim()),n.map(r=>`${r}${t}`).join(", ")}function Kx(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const L0=new Set(["padding","paddingBlock","paddingInline","paddingBlockStart","paddingBlockEnd","paddingInlineStart","paddingInlineEnd"]);function _D(e){const t={};for(const[n,s]of e)switch(n){case"padding":{const i=s.trim().split(/\s+/);i.length===1?(t.blockStart=i[0],t.blockEnd=i[0],t.inline=i[0]):i.length===2?(t.blockStart=i[0],t.blockEnd=i[0],t.inline=i[1]):i.length>=3&&(t.blockStart=i[0],t.inline=i[1],t.blockEnd=i[2]);break}case"paddingBlock":{const i=s.trim().split(/\s+/);t.blockStart=i[0],t.blockEnd=i[1]??i[0];break}case"paddingInline":{const i=s.trim().split(/\s+/);i.length===1?t.inline=i[0]:(t.inlineStart=i[0],t.inlineEnd=i[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 RD(e,t){const n=eD(`${e}-padding`),s=[],i=t.inlineStart??t.inline,r=t.inlineEnd??t.inline;return i!=null&&r!=null&&i===r&&t.blockStart!=null&&t.blockEnd!=null&&i===t.blockStart&&t.blockStart===t.blockEnd?(s.push([n,i??""]),s):(t.inlineStart!=null||t.inlineEnd!=null?(i!=null&&s.push([`${n}-inline-start`,i]),r!=null&&s.push([`${n}-inline-end`,r])):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 ID(e){const t=[],n=e.tokens,s=r=>n[r]||`var(${r})`,i=Object.entries(n);if(i.length>0){const r=i.map(([a,l])=>` ${a}: ${l};`).join(`
19
+ `);t.push(` :scope {
20
+ ${r}
21
+ }`)}return e.components&&LD(e.components,t),OD(s,t),DD(e.components||{},t),HD(e.components||{},t),t}function LD(e,t){for(const[n,s]of Object.entries(e))for(const[i,r]of Object.entries(s)){const a=Object.entries(r);if(a.length===0)continue;const l=_4(i),c=id(n,l),u=[],d=[];for(const[g,y]of a)g.startsWith(":")&&typeof y=="object"?d.push([g,y]):u.push([g,y]);let f=u;const p=[];let x=!1;for(const[g,y]of u){const v=Y6(n,g),m=L0.has(g)&&g!=="padding"?Y6(n,"padding"):[];for(const k of[...v,...m])if(k.expand==="container"&&L0.has(g)&&(x=!0),k.vars)for(const w of k.vars)p.push([w,y])}if(x){const g=u.filter(([k])=>L0.has(k)),y=u.filter(([k])=>!L0.has(k)),v=_D(g),m=RD(n,v);f=[...y,...m]}if(p.length>0&&(f=[...f,...p]),f.length>0){const g=f.map(([y,v])=>` ${Kx(y)}: ${v};`).join(`
22
+ `);t.push(` ${c} {
23
+ ${g}
24
+ }`)}for(const[g,y]of d){const v=Object.entries(y);if(v.length>0){const m=v.map(([k,w])=>` ${Kx(k)}: ${w};`).join(`
25
+ `);t.push(` ${pC(c,g)} {
26
+ ${m}
27
+ }`)}}}}function OD(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 DD(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,i="heading"in e,r="link"in e;if(s||i||r)for(const[a,l]of Object.entries(n))s&&t.push(` ${id("text",`.${a}`)} { color: ${l}; }`),i&&t.push(` ${id("heading",`.${a}`)} { color: ${l}; }`),r&&t.push(` ${id("link",`.${a}`)} { color: ${l}; }`)}const BD={"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 HD(e,t){if("text"in e)for(const[n,s]of Object.entries(BD)){const i=_4(`size:${n}`);t.push(` ${id("text",i)} { font-size: ${s}; }`)}}function qD(e){const t=ID(e),n=[],s=[];for(const i of t)i.trimStart().startsWith(":where(")?n.push(i):s.push(i);return{component:s,prose:n}}function PD(e){const t=[],n=fC(e.name);for(const i of["dark","light"]){const r=i==="dark"?e.__onDark:e.__onLight;if(!r)continue;const a=Object.entries(r.tokens);if(a.length>0){const l=a.map(([c,u])=>` ${c}: ${u};`).join(`
53
+ `);t.push(` ${Q6(i)} {
54
+ ${l}
55
+ }`)}if(r.components)for(const[l,c]of Object.entries(r.components))for(const[u,d]of Object.entries(c)){const f=Object.entries(d);if(f.length===0)continue;const p=_4(u),x=`:is(${Q6(i)}) :is(${id(l,p)})`,g=[],y=[];for(const[v,m]of f)v.startsWith(":")&&typeof m=="object"?y.push([v,m]):g.push([v,m]);if(g.length>0){const v=g.map(([m,k])=>` ${Kx(m)}: ${k};`).join(`
56
+ `);t.push(` ${x} {
57
+ ${v}
58
+ }`)}for(const[v,m]of y){const k=Object.entries(m);if(k.length>0){const w=k.map(([S,E])=>` ${Kx(S)}: ${E};`).join(`
59
+ `);t.push(` ${pC(x,v)} {
60
+ ${w}
61
+ }`)}}}}if(t.length===0)return"";const s=t.join(`
62
+
63
+ `);return`@scope (${n}) to (${hC}) {
64
+ ${s}
65
+ }`}function UD(e){const{component:t,prose:n}=qD(e),s=fC(e.name),i=hC;let r="";if(n.length>0){const c=n.join(`
66
+
67
+ `);r=`@scope (${s}) to (${i}) {
68
+ ${c}
69
+ }`}let a="";if(t.length>0){const c=t.join(`
70
+
71
+ `);a=`@scope (${s}) to (${i}) {
72
+ ${c}
73
+ }`}const l=PD(e);return l&&(a=a?`${a}
74
+
75
+ ${l}`:l),{prose:r,component:a}}const xC={...TO,...zO,...NO,..._O,...RO,...IO,...LO,...OO,...DO,...BO,...HO,...TD};function FD(e){return`var(${e})`}Object.fromEntries(Object.keys(xC).map(e=>[e,FD(e)]));function H4(e){let t=0,n=null,s=!1;for(let i=0;i<e.length;i++){const r=e[i];if(n!==null){s?s=!1:r==="\\"?s=!0:r===n&&(n=null);continue}if(r==='"'||r==="'"){n=r;continue}if(r==="("){t++;continue}if(r===")"){t=Math.max(0,t-1);continue}if(r===","&&t===0)return[e.slice(0,i).trim(),e.slice(i+1).trim()]}return null}function VD(e){const t=e.trim(),n="light-dark(";if(!t.startsWith(n)||!t.endsWith(")"))return null;const s=t.slice(n.length,-1);return H4(s)}function A2(e,t){if(Array.isArray(e))return t==="dark"?e[1]:e[0];const n=VD(e);return n!==null?t==="dark"?n[1]:n[0]:e}function gC(e,t){let n=0;for(let s=t;s<e.length;s++){const i=e[s];if(i==="(")n++;else if(i===")"&&(n--,n===0))return s}return-1}function J6(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 GD(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 i=H4(s);if(i===null)return null;const r=J6(i[0]),a=J6(i[1]);if(r===null||a===null)return null;const l=X6(r.color),c=X6(a.color);if(l===null||c===null)return null;let u,d;r.percentage!==null&&a.percentage!==null?(u=r.percentage,d=a.percentage):r.percentage!==null?(u=r.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,y=p*l.a+x*c.a,v=(E,A)=>p*E*l.a+x*A*c.a,m=v(l.r,c.r),k=v(l.g,c.g),w=v(l.b,c.b),S=y===0?{r:0,g:0,b:0}:{r:m/y,g:k/y,b:w/y};return fD({...S,a:y*g})}function Cy(e){const t=e.indexOf("color-mix(");if(t===-1)return e;const n=t+9,s=gC(e,n);if(s===-1)return e;const i=Cy(e.slice(n+1,s)),a=GD(i)??`color-mix(${i})`;return e.slice(0,t)+a+Cy(e.slice(s+1))}function Ey(e,t,n,s){const i=e.indexOf("var(");if(i===-1)return e;const r=i+3,a=gC(e,r);if(a===-1)return e;const l=e.slice(r+1,a),c=H4(l),u=(c?c[0]:l).trim(),d=c?c[1]:null;let f;s.has(u)?f=e.slice(i,a+1):u in t?(s.add(u),f=mC(u,t,n,s),s.delete(u)):d!==null?f=Ey(d.trim(),t,n,s):f=e.slice(i,a+1);const p=Ey(e.slice(a+1),t,n,s);return e.slice(0,i)+f+p}function WD(e,t,n,s){if(!e.includes("var(")&&!e.includes("color-mix("))return e;const i=Ey(e,t,n,s);return Cy(i)}function mC(e,t,n,s){if(e in n)return n[e];const i=t[e];if(i===void 0)return"";const r=WD(i,t,n,s);return n[e]=r,r}function e7(e){const t={};for(const n of Object.keys(e))mC(n,e,t,new Set);return t}function KD(e,t){const{mode:n}=t,s={};for(const[i,r]of Object.entries(xC))s[i]=A2(r,n);if(e==null)return e7(s);for(const[i,r]of Object.entries(e.tokens))s[i]=A2(r,n);if(e.__inputTokens)for(const[i,r]of Object.entries(e.__inputTokens))r!==void 0&&(s[i]=A2(r,n));return e7(s)}function tu(e,t=!1){const n=h.useCallback(r=>{const a=window.matchMedia(e);return a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[e]),s=h.useCallback(()=>window.matchMedia(e).matches,[e]),i=h.useCallback(()=>t,[t]);return h.useSyncExternalStore(n,s,i)}const mm=h.createContext(null);mm.displayName="ThemeContext";function XD(){if(typeof document>"u")return null;const e=document.documentElement.getAttribute("data-theme");return e==="light"||e==="dark"?e:null}function ZD(){return null}function YD(){return typeof document>"u"?null:document.documentElement.getAttribute(ei("theme"))}function QD(){return null}function vC(){return null}const ah=new Set;let Pf=null;const lh=new Set;let Uf=null;function JD(){for(const e of ah)e()}function eB(e){return ah.add(e),ah.size===1&&typeof MutationObserver<"u"&&(Pf=new MutationObserver(JD),Pf.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})),()=>{ah.delete(e),ah.size===0&&Pf&&(Pf.disconnect(),Pf=null)}}function tB(){for(const e of lh)e()}function nB(e){return lh.add(e),lh.size===1&&typeof MutationObserver<"u"&&(Uf=new MutationObserver(tB),Uf.observe(document.documentElement,{attributes:!0,attributeFilter:[ei("theme")]})),()=>{lh.delete(e),lh.size===0&&Uf&&(Uf.disconnect(),Uf=null)}}function yC(){return()=>{}}function sB(e){return h.useSyncExternalStore(e?yC:eB,e?vC:XD,ZD)}function kC(e){return h.useSyncExternalStore(e?yC:nB,e?vC:YD,QD)}function bC(){const e=h.use(mm),t=e!=null,n=kC(t);return(e==null?void 0:e.theme.name)??n}function vm(){const e=h.use(mm),t=e!=null,n=sB(t),s=kC(t),i=tu("(prefers-color-scheme: dark)"),r=(e==null?void 0:e.mode)??n??"system",a=(e==null?void 0:e.theme)??dC(s),l=r==="system"?i?"dark":"light":r,c=h.useMemo(()=>KD(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 iB="modulepreload",rB=function(e){return"/"+e},t7={},ym=function(t,n,s){let i=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"));i=Promise.allSettled(n.map(c=>{if(c=rB(c),c in t7)return;t7[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":iB,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 r(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})},q4={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}},oB={normal:{k63SB2:"x1sodnla",$$css:!0},medium:{k63SB2:"x1e4wzip",$$css:!0},semibold:{k63SB2:"x2mo6ok",$$css:!0},bold:{k63SB2:"x1lvx875",$$css:!0}},wC={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}},P4={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}},aB={"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}},lB={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}},jC={inline:{k1xSpc:"xt0psk2",$$css:!0},block:{k1xSpc:"x1lliihq",$$css:!0}},Xx={singleLine:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",k1xSpc:"x1lliihq",$$css:!0},multiLine:{kVQacm:"xb3r6kr",k1xSpc:"x104kibb",kgKLqz:"x1ua5tub",$$css:!0}},SC={"break-word":{kTgw9:"x1lldw8n",kHjlTd:"x1mzt3pk",$$css:!0},"break-all":{kTgw9:"x1yn0g08",$$css:!0}},CC={wrap:{kN2L0X:"xk4td0m",$$css:!0},nowrap:{kN2L0X:"xebhuq6",$$css:!0},balance:{kN2L0X:"x1w2vvpw",$$css:!0},pretty:{kN2L0X:"x1fzhlzt",$$css:!0}},EC={enabled:{kxwWH2:"x1b2iylo",kzeHkT:"xwgcxoh",k1xSpc:"x1lliihq",$$css:!0}},$C={strikethrough:{kybGjl:"xmqliwb",$$css:!0}},cB={enabled:{kcqcaj:"xss6m8b",$$css:!0}},AC={start:{k9WMMc:"x1yc453h",$$css:!0},center:{k9WMMc:"x2b8uid",$$css:!0},end:{k9WMMc:"xp4054r",$$css:!0}},MC={content:{ks0D6T:"xw5ewwj",kTgw9:"x13faqbe",$$css:!0}};function TC(e){const{maxLines:t}=e,[n,s]=h.useState(!1),[i,r]=h.useState(""),a=h.useRef(null),l=h.useCallback(u=>{if(t===0){s(!1);return}if(r(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&&L4(a.current),a.current=u,u&&t>0?typeof ResizeObserver<"u"?I4(u,()=>{l(u)}):l(u):(s(!1),r(""))},[t,l]),isTruncated:n,fullText:i}}const uB=h.lazy(async()=>ym(()=>Promise.resolve().then(()=>uE),void 0).then(e=>({default:e.Tooltip}))),dB={body:"primary",large:"primary",label:"primary",supporting:"secondary",code:"primary","display-1":"primary","display-2":"primary","display-3":"primary",inherit:"inherit"};function fB(e){return e in P4?e:"body"}function zC(e){return e in q4?e:"primary"}function W({type:e="body",size:t,color:n,weight:s,display:i="inline",maxLines:r=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:y,as:v="span",children:m,ref:k,...w}){const S=n??dB[e]??"primary",E=fB(e),A=zC(S),z=l??(r===1?"break-all":"break-word"),N=r>0||d?"block":i,M=TC({maxLines:r}),$=typeof a=="string"?a:"above",R=r>0&&a!==!1&&M.isTruncated,_=h.useRef(null),T=r>1?{WebkitLineClamp:r}:void 0;return o.jsxs(o.Fragment,{children:[o.jsx(v,{ref:pn(k,M.ref,_),...ie(se("text",{type:e,size:t,color:S}),G(q4[A],P4[E],t&&aB[t],wC[E],s&&oB[s],r===1?Xx.singleLine:r>1?Xx.multiLine:jC[N],r>0&&SC[z],c&&CC[c],u!=="start"&&AC[u],d&&EC.enabled,f&&$C.strikethrough,p&&cB.enabled,x),g,{...y,...T}),title:R?M.fullText:void 0,...w,children:m}),R&&o.jsx(h.Suspense,{fallback:null,children:o.jsx(uB,{anchorRef:_,content:o.jsx("span",{...G(MC.content),children:M.fullText}),placement:$})})]})}W.displayName="Text";const hB=.75,n7=1.5,s7={sm:{diameter:10,border:2},md:{diameter:14,border:3},lg:{diameter:18,border:3},xl:{diameter:28,border:4}},i7={wrapper:{k1xSpc:"x3nfvp2",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},spinner:{k1xSpc:"xwz0xwf",kgQiWS:"x1ku5rj1",kVQacm:"xb3r6kr",kXLuUW:"xxymvpz",$$css:!0}};function Tt({size:e="md",shade:t="default",label:n,xstyle:s,className:i,style:r,"aria-label":a,"data-testid":l,ref:c,...u}){const d=h.useRef(null),{tokens:f}=vm();h.useEffect(()=>{const S=d.current;if(S==null)return;const E=S.getContext("2d");if(!E)return;const{border:A,diameter:z}=s7[e],N=window.devicePixelRatio||1,M=t==="inherit"?getComputedStyle(S).color:null,$=t==="inherit"?M:t==="onMedia"?f["--color-on-dark"]:t==="subtle"?f["--color-text-secondary"]:f["--color-accent"],R=t==="inherit"?M:t==="onMedia"?`${f["--color-on-dark"]}4D`:f["--color-track"],_=z+A*2,T=Math.round(_*N),O=T+T%2,H=O/_,L=z/2*H,B=A*H;S.height=S.width=O,S.style.width=S.style.height=_+"px",E.lineCap="round",E.lineWidth=B;const I=O/2;E.beginPath(),E.arc(I,I,L,0,2*Math.PI),E.strokeStyle=R,t==="inherit"&&(E.globalAlpha=.3),E.stroke(),E.globalAlpha=1,E.beginPath(),E.arc(I,I,L,n7*Math.PI,(n7+hB)%2*Math.PI),E.strokeStyle=$,E.stroke()},[t,e,f]);const{border:p,diameter:x}=s7[e],g=x+p*2,y=n!=null,v=h.useId(),m=y&&typeof n=="string"&&a==null,k=a??(typeof n=="string"?n:void 0)??"Loading",w=o.jsx("span",{ref:y?void 0:c,role:"status","aria-label":m?void 0:k,"aria-labelledby":m?v:void 0,"data-testid":y?void 0:l,...y?{}:u,...ie(y?"":se("spinner",{size:e,shade:t}),G(i7.spinner,!y&&s),y?void 0:i,{...y?{}:r,width:g,height:g}),children:o.jsx("canvas",{ref:d,className:"xlp1x4z x1lliihq x1so62im x14qxm4i xnh0sag xa4qsjk x1ka1v4i x1esw782"})});return y?o.jsxs("div",{ref:c,"data-testid":l,...u,...ie(se("spinner",{size:e,shade:t}),G(i7.wrapper,s),i,r),children:[w,typeof n=="string"?o.jsx(W,{id:v,type:"body",weight:"bold",children:n}):n]}):w}Tt.displayName="Spinner";function lo({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)}lo.displayName="VisuallyHidden";const Zx="data-astryx-edge-comp",pB={keTefX:"x1kftj4p",k71WvV:"x92e2el",$$css:!0},xB={inset:e=>[pB,{"--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})`)}]},U4=h.createContext(null);U4.displayName="SizeContext";function ml(e,t="md"){const n=h.use(U4);return e??n??t}U4.Provider;const NC=h.createContext(null);NC.displayName="ButtonGroupContext";function gB(){return h.use(NC)}const _C=h.createContext(null);_C.displayName="LinkContext";function mB(e){function t({href:n,ref:s,...i}){return h.createElement(e,{ref:s,href:n,to:n,...i})}return t.displayName=`LinkWithTo(${typeof e=="string"?e:e.displayName||e.name||"Component"})`,t}function vl(e){const t=h.use(_C),n=e??(t==null?void 0:t.component)??"a";return h.useMemo(()=>n==="a"?"a":mB(n),[n])}const F4=h.createContext({locale:"en",direction:"ltr",messages:{}});F4.displayName="InternationalizationContext";function vB(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 RC({locale:e,messages:t,overrides:n,dir:s,children:i}){const r=s??vB(e),a=h.useMemo(()=>({locale:e,direction:r,messages:t??{},overrides:n}),[e,r,t,n]);return o.jsx(F4,{value:a,children:i})}RC.displayName="InternationalizationProvider";function M2(e,t){const n=t&&t.cache?t.cache:CB,s=t&&t.serializer?t.serializer:jB;return(t&&t.strategy?t.strategy:bB)(e,{cache:n,serializer:s})}function yB(e){return e==null||typeof e=="number"||typeof e=="boolean"}function kB(e,t,n,s){const i=yB(s)?s:n(s);let r=t.get(i);return typeof r>"u"&&(r=e.call(this,s),t.set(i,r)),r}function IC(e,t,n){const s=Array.prototype.slice.call(arguments,3),i=n(s);let r=t.get(i);return typeof r>"u"&&(r=e.apply(this,s),t.set(i,r)),r}function LC(e,t,n,s,i){return n.bind(t,e,s,i)}function bB(e,t){const n=e.length===1?kB:IC;return LC(e,this,n,t.cache.create(),t.serializer)}function wB(e,t){return LC(e,this,IC,t.cache.create(),t.serializer)}const jB=function(){return JSON.stringify(arguments)};var SB=class{constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}};const CB={create:function(){return new SB}},T2={variadic:wB},EB=/(?:[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 $B(e){const t={};return e.replace(EB,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 AB=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function MB(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");const t=e.split(AB).filter(s=>s.length>0),n=[];for(const s of t){let i=s.split("/");if(i.length===0)throw new Error("Invalid number skeleton");const[r,...a]=i;for(const l of a)if(l.length===0)throw new Error("Invalid number skeleton");n.push({stem:r,options:a})}return n}function TB(e){return e.replace(/^(.*?)-/,"")}const r7=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,OC=/^(@+)?(\+|#+)?[rs]?$/g,zB=/(\*)(0+)|(#+)(0+)|(0+)/g,DC=/^(0+)$/;function o7(e){const t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(OC,function(n,s,i){return typeof i!="string"?(t.minimumSignificantDigits=s.length,t.maximumSignificantDigits=s.length):i==="+"?t.minimumSignificantDigits=s.length:s[0]==="#"?t.maximumSignificantDigits=s.length:(t.minimumSignificantDigits=s.length,t.maximumSignificantDigits=s.length+(typeof i=="string"?i.length:0)),""}),t}function BC(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 NB(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)),!DC.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function a7(e){const t={},n=BC(e);return n||t}function _B(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=TB(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((r,a)=>({...r,...a7(a)}),{})};continue;case"engineering":t={...t,notation:"engineering",...n.options.reduce((r,a)=>({...r,...a7(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(zB,function(r,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(DC.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(r7.test(n.stem)){if(n.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");n.stem.replace(r7,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 r=n.options[0];r==="w"?t={...t,trailingZeroDisplay:"stripIfInteger"}:r&&(t={...t,...o7(r)});continue}if(OC.test(n.stem)){t={...t,...o7(n.stem)};continue}const s=BC(n.stem);s&&(t={...t,...s});const i=NB(n.stem);i&&(t={...t,...i})}return t}let RB=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 l7(e){return e.type===0}function IB(e){return e.type===1}function HC(e){return e.type===2}function qC(e){return e.type===3}function PC(e){return e.type===4}function UC(e){return e.type===5}function FC(e){return e.type===6}function LB(e){return e.type===7}function VC(e){return e.type===8}function GC(e){return!!(e&&typeof e=="object"&&e.type===0)}function $y(e){return!!(e&&typeof e=="object"&&e.type===1)}const WC=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Ff={"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 OB(e,t){let n="";for(let s=0;s<e.length;s++){const i=e.charAt(s);if(i==="j"){let r=0;for(;s+1<e.length&&e.charAt(s+1)===i;)r++,s++;let a=1+(r&1),l=r<2?1:3+(r>>1),c="a",u=DB(t);for((u=="H"||u=="k")&&(l=0);l-- >0;)n+=c;for(;a-- >0;)n=u+n}else i==="J"?n+="H":n+=i}return n}function DB(e){var i,r;let t=e.hourCycle;if(t===void 0){const a=e;t=((i=a.getHourCycles)==null?void 0:i.call(a)[0])??((r=a.hourCycles)==null?void 0:r[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),(Ff[`${n}-${s}`]||Ff[s||""]||Ff[n||""]||Ff[`${n}-001`]||Ff["001"])[0].charAt(0)}const BB=new RegExp(`^${WC.source}*`),HB=new RegExp(`${WC.source}*$`);function lt(e,t){return{start:e,end:t}}const qB=!!Object.fromEntries,PB=!!String.prototype.trimStart,UB=!!String.prototype.trimEnd,c7=qB?Object.fromEntries:function(t){const n={};for(const[s,i]of t)n[s]=i;return n},FB=PB?function(t){return t.trimStart()}:function(t){return t.replace(BB,"")},VB=UB?function(t){return t.trimEnd()}:function(t){return t.replace(HB,"")},u7=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");function GB(e,t){return u7.lastIndex=t,u7.exec(e)[1]??""}function WB(e){if(e.length===0)return null;let t=1,n=1;for(let s=0;s<e.length;){const i=e.charCodeAt(s);switch(i){case 35:case 39:case 60:case 123:case 125:return null}if(i===10)t++,n=1,s++;else if(n++,i>=55296&&i<=56319&&s+1<e.length){const r=e.charCodeAt(s+1);s+=r>=56320&&r<=57343?2:1}else s++}return{offset:e.length,line:t,column:n}}var KB=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=WB(this.message);if(t){const n=this.clonePosition();return this.position=t,{val:[{type:0,value:this.message,location:lt(n,this.clonePosition())}],err:null}}}}return this.parseMessage(0,"",!1)}parseMessage(e,t,n){let s=[];for(;!this.isEOF();){const i=this.char();if(i===123){const r=this.parseArgument(e,n);if(r.err)return r;s.push(r.val)}else{if(i===125&&e>0)break;if(i===35&&(t==="plural"||t==="selectordinal")){const r=this.clonePosition();this.bump(),s.push({type:7,location:lt(r,this.clonePosition())})}else if(i===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(26,lt(this.clonePosition(),this.clonePosition()))}else if(i===60&&!this.ignoreTag&&Ay(this.peek()||0)){const r=this.parseTag(e,t);if(r.err)return r;s.push(r.val)}else{const r=this.parseLiteral(e,t);if(r.err)return r;s.push(r.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:lt(n,this.clonePosition())},err:null};if(this.bumpIf(">")){const i=this.parseMessage(e+1,t,!0);if(i.err)return i;const r=i.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Ay(this.char()))return this.error(23,lt(a,this.clonePosition()));const l=this.clonePosition();return s!==this.parseTagName()?this.error(26,lt(l,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:8,value:s,children:r,location:lt(n,this.clonePosition())},err:null}:this.error(23,lt(a,this.clonePosition())))}else return this.error(27,lt(n,this.clonePosition()))}else return this.error(23,lt(n,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&ZB(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const n=this.clonePosition();let s="";for(;;){const r=this.tryParseQuote(t);if(r){s+=r;continue}const a=this.tryParseUnquoted(e,t);if(a){s+=a;continue}const l=this.tryParseLeftAngleBracket();if(l){s+=l;continue}break}const i=lt(n,this.clonePosition());return{val:{type:0,value:s,location:i},err:null}}tryParseLeftAngleBracket(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!XB(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,lt(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(2,lt(n,this.clonePosition()));let s=this.parseIdentifierIfPossible().value;if(!s)return this.error(3,lt(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(1,lt(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:1,value:s,location:lt(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(1,lt(n,this.clonePosition())):this.parseArgumentOptions(e,t,s,n);default:return this.error(3,lt(n,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),n=GB(this.message,t),s=t+n.length;return this.bumpTo(s),{value:n,location:lt(e,this.clonePosition())}}parseArgumentOptions(e,t,n,s){let i=this.clonePosition(),r=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(r){case"":return this.error(4,lt(i,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=VB(f.val);if(p.length===0)return this.error(6,lt(this.clonePosition(),this.clonePosition()));l={style:p,styleLocation:lt(d,this.clonePosition())}}const c=this.tryParseArgumentClose(s);if(c.err)return c;const u=lt(s,this.clonePosition());if(l&&l.style.startsWith("::")){let d=FB(l.style.slice(2));if(r==="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=OB(d,this.locale));const p={type:1,pattern:f,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?$B(f):{}};return{val:{type:r==="date"?3:4,value:n,location:u,style:p},err:null}}}return{val:{type:r==="number"?2:r==="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,lt(l,{...l}));this.bumpSpace();let c=this.parseIdentifierIfPossible(),u=0;if(r!=="select"&&c.value==="offset"){if(!this.bumpIf(":"))return this.error(13,lt(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,r,t,c);if(d.err)return d;const f=this.tryParseArgumentClose(s);if(f.err)return f;const p=lt(s,this.clonePosition());return r==="select"?{val:{type:5,value:n,options:c7(d.val),location:p},err:null}:{val:{type:6,value:n,options:c7(d.val),offset:u,pluralType:r==="plural"?"cardinal":"ordinal",location:p},err:null}}default:return this.error(5,lt(i,a))}}tryParseArgumentClose(e){return this.isEOF()||this.char()!==125?this.error(1,lt(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,lt(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=MB(e)}catch{return this.error(7,t)}return{val:{type:0,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?_B(n):{}},err:null}}tryParsePluralOrSelectOptions(e,t,n,s){let i=!1;const r=[],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=lt(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"&&(i=!0),this.bumpSpace();const u=this.clonePosition();if(!this.bumpIf("{"))return this.error(t==="select"?17:18,lt(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;r.push([l,{value:d.val,location:lt(u,this.clonePosition())}]),a.add(l),this.bumpSpace(),{value:l,location:c}=this.parseIdentifierIfPossible()}return r.length===0?this.error(t==="select"?15:16,lt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(22,lt(this.clonePosition(),this.clonePosition())):{val:r,err:null}}tryParseDecimalInteger(e,t){let n=1;const s=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);let i=!1,r=0;for(;!this.isEOF();){const l=this.char();if(l>=48&&l<=57)i=!0,r=r*10+(l-48),this.bump();else break}const a=lt(s,this.clonePosition());return i?(r*=n,Number.isSafeInteger(r)?{val:r,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()&&YB(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 Ay(e){return e>=97&&e<=122||e>=65&&e<=90}function XB(e){return Ay(e)||e===47}function ZB(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 YB(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function My(e){e.forEach(t=>{if(delete t.location,UC(t)||FC(t))for(const n in t.options)delete t.options[n].location,My(t.options[n].value);else HC(t)&&GC(t.style)||(qC(t)||PC(t))&&$y(t.style)?delete t.style.location:VC(t)&&My(t.children)})}function QB(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const n=new KB(e,t).parse();if(n.err){const s=SyntaxError(RB[n.err.kind]);throw s.location=n.err.location,s.originalMessage=n.err.message,s}return t!=null&&t.captureLocation||My(n.val),n.val}var km=class extends Error{constructor(e,t,n){super(e),this.code=t,this.originalMessage=n}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}},d7=class extends km{constructor(e,t,n,s){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(n).join('", "')}"`,"INVALID_VALUE",s)}},JB=class extends km{constructor(e,t,n){super(`Value for "${e}" must be of type ${t}`,"INVALID_VALUE",n)}},eH=class extends km{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,"MISSING_VALUE",t)}};function tH(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 nH(e){return typeof e=="function"}function Dp(e,t,n,s,i,r,a){if(e.length===1&&l7(e[0]))return[{type:0,value:e[0].value}];const l=[];for(const c of e){if(l7(c)){l.push({type:0,value:c.value});continue}if(LB(c)){typeof r=="number"&&l.push({type:0,value:n.getNumberFormat(t).format(r)});continue}const{value:u}=c;if(!(i&&u in i))throw new eH(u,a);let d=i[u];if(IB(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(qC(c)){const f=typeof c.style=="string"?s.date[c.style]:$y(c.style)?c.style.parsedOptions:void 0;l.push({type:0,value:n.getDateTimeFormat(t,f).format(d)});continue}if(PC(c)){const f=typeof c.style=="string"?s.time[c.style]:$y(c.style)?c.style.parsedOptions:s.time.medium;l.push({type:0,value:n.getDateTimeFormat(t,f).format(d)});continue}if(HC(c)){const f=typeof c.style=="string"?s.number[c.style]:GC(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(VC(c)){const{children:f,value:p}=c,x=i[p];if(!nH(x))throw new JB(p,"function",a);let g=x(Dp(f,t,n,s,i,r).map(y=>y.value));Array.isArray(g)||(g=[g]),l.push(...g.map(y=>({type:typeof y=="string"?0:1,value:y})))}if(UC(c)){const f=d,p=(Object.prototype.hasOwnProperty.call(c.options,f)?c.options[f]:void 0)||c.options.other;if(!p)throw new d7(c.value,d,Object.keys(c.options),a);l.push(...Dp(p.value,t,n,s,i));continue}if(FC(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 km(`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,y=n.getPluralRules(t,{type:c.pluralType}).select(g-(c.offset||0));p=(Object.prototype.hasOwnProperty.call(c.options,y)?c.options[y]:void 0)||c.options.other}if(!p)throw new d7(c.value,d,Object.keys(c.options),a);const x=typeof d=="bigint"?Number(d):d;l.push(...Dp(p.value,t,n,s,i,x-(c.offset||0)));continue}}return tH(l)}function sH(e,t){return t?{...e,...t,...Object.keys(e).reduce((n,s)=>(n[s]={...e[s],...t[s]},n),{})}:e}function iH(e,t){return t?Object.keys(e).reduce((n,s)=>(n[s]=sH(e[s],t[s]),n),{...e}):e}function z2(e){return{create(){return{get(t){return e[t]},set(t,n){e[t]=n}}}}}function rH(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:M2((...t)=>new Intl.NumberFormat(...t),{cache:z2(e.number),strategy:T2.variadic}),getDateTimeFormat:M2((...t)=>new Intl.DateTimeFormat(...t),{cache:z2(e.dateTime),strategy:T2.variadic}),getPluralRules:M2((...t)=>new Intl.PluralRules(...t),{cache:z2(e.pluralRules),strategy:T2.variadic})}}var fs,oH=(fs=class{constructor(t,n=fs.defaultLocale,s,i){if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=r=>{const a=this.formatToParts(r);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=r=>Dp(this.ast,this.locales,this.formatters,this.formats,r,void 0,this.message),this.resolvedOptions=()=>{var r;return{locale:((r=this.resolvedLocale)==null?void 0:r.toString())||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}},this.getAst=()=>this.ast,this.locales=n,this.resolvedLocale=fs.resolveLocale(n),typeof t=="string"){if(this.message=t,!fs.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...r}=i||{};this.ast=fs.__parse(t,{...r,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=iH(fs.formats,s),this.formatters=i&&i.formatters||rH(this.formatterCache)}static get defaultLocale(){return fs.memoizedDefaultLocale||(fs.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),fs.memoizedDefaultLocale}},fs.memoizedDefaultLocale=null,fs.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])},fs.__parse=QB,fs.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"}}},fs),aH=oH;const lH={"@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.'}},cH=lH,f7=new Map;function uH(e,t){const n=`${t}::${e}`;let s=f7.get(n);return s===void 0&&(s=new aH(e,t),f7.set(n,s)),s}function dH(e){let t;try{t=new Intl.Locale(e).baseName}catch{t=e}const n=t.split("-"),s=[];for(let i=n.length;i>0;i--)s.push(n.slice(0,i).join("-"));return s}function fH(e,t,n,s){var a,l;const i=dH(t);if(s!==void 0)for(const c of i){const u=(a=s[c])==null?void 0:a[e];if(u!==void 0)return u}for(const c of i){const u=(l=n[c])==null?void 0:l[e];if(u!==void 0)return u.defaultMessage}const r=cH[e];return r!==void 0?r.defaultMessage:null}function hH(e,t,n,s,i){const r=fH(e,n,s,i);return r===null?(D4(),e):t===void 0?r:uH(r,n).format(t)}function Fe(){const e=h.use(F4);return h.useCallback((t,n)=>hH(t,n,e.locale,e.messages,e.overrides),[e.locale,e.messages,e.overrides])}const ua={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}},pH={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]},xH={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},gH={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}},mH={none:{kGVxlE:"x1gnnqk1",$$css:!0},low:{kGVxlE:"x1i5ehqx",$$css:!0},med:{kGVxlE:"x14hfi27",$$css:!0},high:{kGVxlE:"x1kcpxr7",$$css:!0}},vH={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}},h7={hiddenContent:{kMwMTN:"x19co3pv",$$css:!0},hiddenContentDelayed:{kKVMdj:"x1ffowhz",k44tkh:"xjlvqhv",kWV6AL:"x10e4vud",kKxzle:"x17yabm6 x14q22ui",$$css:!0}},O0={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 K({label:e,variant:t="secondary",size:n,type:s="button",isDisabled:i=!1,isLoading:r=!1,isInterruptible:a=!1,clickAction:l,icon:c,isIconOnly:u=!1,width:d,elevation:f="none",children:p,endContent:x,tooltip:g,href:y,as:v,target:m,rel:k,xstyle:w,className:S,style:E,ref:A,...z}){const N=Fe(),M=ml(n,"md"),$=gB(),[R,_]=h.useTransition(),T=h.useRef(!1),O=r||R,H=R||a,L=($==null?void 0:$.isDisabled)??!1,B=i||L||O&&!a,I=vl(v),D=y!=null&&!B,q=g!=null&&B,U=Fs({placement:"above",isEnabled:g!=null}),X=ye=>{var J;if(B||T.current&&!a){ye.preventDefault();return}(J=z.onClick)==null||J.call(z,ye),l&&!ye.defaultPrevented&&(T.current=!0,_(async()=>{try{await l(ye)}finally{T.current=!1}}))},Z=q?ye=>{var J;ye.key==="Enter"||ye.key===" "?ye.preventDefault():(J=z.onKeyDown)==null||J.call(z,ye)}:void 0,Y=t==="ghost"?{[Zx]:""}:null,ae=G(ua.base,xH[M],vH[t],u&&ua.iconOnly,B&&ua.disabled,q&&ua.ariaDisabled,D&&ua.link,!$&&ua.pressable,$&&($.orientation==="horizontal"?O0.horizontal:O0.vertical),$&&(t==="primary"||t==="destructive")&&($.orientation==="horizontal"?O0.onSolidHorizontal:O0.onSolidVertical),!$&&mH[f],d!=null&&pH.width(d),w),le=ie(se("button",{variant:t,size:M}),ae,S,E),re=o.jsxs(o.Fragment,{children:[O&&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"}}[!!H<<0],"aria-hidden":"true",children:o.jsx(Tt,{size:"sm",shade:"inherit"})}),o.jsxs("span",{...G(ua.contentWrapper,O&&(H?h7.hiddenContentDelayed:h7.hiddenContent)),"aria-hidden":O||void 0,children:[c&&o.jsx("span",{...G(ua.iconWrapper,gH[M]),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(lo,{role:"status","aria-live":"polite",children:O?N("@astryx.button.loading"):""})]}),be=u&&e!==""||O&&!u||p!=null&&p!==e?{"aria-label":e}:null,me=g!=null?{"aria-describedby":[z["aria-describedby"],U.describedBy].filter(Boolean).join(" ")||void 0}:null,je=pn(A,g!=null?U.ref:void 0);let we;return D?we=o.jsx(I,{ref:je,href:y,target:m,rel:k,...le,...z,...be,...me,...Y,"aria-busy":O||void 0,onClick:X,children:re}):we=o.jsx("button",{ref:je,type:s,disabled:q?void 0:B,...le,...z,...be,...me,...Y,"aria-busy":O||void 0,"aria-disabled":q||void 0,onClick:X,...Z?{onKeyDown:Z}:null,children:re}),g?o.jsxs(o.Fragment,{children:[we,U.renderTooltip(g)]}):we}K.displayName="Button";const mn={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},xu={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em","aria-hidden":!0},yH={close:o.jsx("svg",{...mn,children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6"})}),chevronDown:o.jsx("svg",{...mn,children:o.jsx("path",{d:"M6 9l6 6 6-6"})}),chevronLeft:o.jsx("svg",{...mn,children:o.jsx("path",{d:"M15 6l-6 6 6 6"})}),chevronRight:o.jsx("svg",{...mn,children:o.jsx("path",{d:"M9 6l6 6-6 6"})}),chevronsLeft:o.jsx("svg",{...mn,children:o.jsx("path",{d:"M18 6l-6 6 6 6M11 6l-6 6 6 6"})}),chevronsRight:o.jsx("svg",{...mn,children:o.jsx("path",{d:"M6 6l6 6-6 6M13 6l6 6-6 6"})}),check:o.jsx("svg",{...mn,children:o.jsx("path",{d:"M5 13l4 4L19 7"})}),success:o.jsx("svg",{...xu,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",{...xu,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",{...xu,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",{...xu,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",{...mn,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",{...mn,children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"M12 7v5l3 3"})]}),externalLink:o.jsxs("svg",{...mn,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",{...mn,strokeWidth:2,children:o.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})}),moreHorizontal:o.jsxs("svg",{...xu,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",{...mn,children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"M21 21l-4.35-4.35"})]}),arrowUp:o.jsx("svg",{...mn,children:o.jsx("path",{d:"M12 19V5m0 0l-7 7m7-7l7 7"})}),arrowDown:o.jsx("svg",{...mn,children:o.jsx("path",{d:"M12 5v14m0 0l7-7m-7 7l-7-7"})}),arrowsUpDown:o.jsx("svg",{...mn,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",{...mn,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",{...mn,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",{...mn,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",{...mn,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",{...mn,children:[o.jsx("path",{d:"M2 13l4 4L14 7"}),o.jsx("path",{d:"M9 13l4 4L21 7"})]}),wrench:o.jsx("svg",{...mn,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",{...xu,children:o.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),microphone:o.jsxs("svg",{...mn,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 kH={};function bH(e){var t;return e==null?null:typeof e=="string"?((t=dC(e))==null?void 0:t.icons)??null:e.icons??null}function KC(e,t){const n=bH(t);return(n==null?void 0:n[e])??kH[e]??yH[e]}const XC={root:{kmuXW:"x2lah0s",$$css:!0},span:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kjj79g:"xl56j7k",kmuXW:"x2lah0s",$$css:!0}},ZC={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}},wH={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}},jH={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 SH(e){return e!=null&&e!==""?{role:"img","aria-label":e}:{"aria-hidden":"true"}}function Pe({icon:e,color:t="inherit",size:n="md",label:s,ref:i,className:r,style:a,xstyle:l,...c}){const u=SH(s);if(typeof e=="string")return o.jsx(CH,{name:e,color:t,size:n,a11yProps:u,className:r,style:a,xstyle:l,spanProps:c});const d=e;return o.jsx(d,{ref:i,...u,...ie(se("icon",{size:n,color:t}),G(XC.root,ZC[t],wH[n],l),r??void 0,a),...c})}Pe.displayName="Icon";function CH({name:e,color:t,size:n,a11yProps:s,className:i,style:r,xstyle:a,spanProps:l}){const c=bC(),u=KC(e,c);if(u==null)return null;const d=l??{};return o.jsx("span",{...s,...d,...ie(se("icon",{size:n,color:t}),G(XC.span,ZC[t],jH[n],a),i??void 0,r),children:u})}function Ji(e,t){return typeof e=="string"?o.jsx(Pe,{icon:e,...t}):typeof e=="function"||typeof e=="object"&&e!==null&&"render"in e?o.jsx(Pe,{icon:e,...t}):e}function Vd(e){const t=bC();return KC(e,t)}const EH={isMobile:!1,isMobileNavOpen:!1,toggleMobileNav:()=>{},openMobileNav:()=>{},closeMobileNav:()=>{},isMobileNavEnabled:!1,hasAutoToggle:!0},V4=h.createContext(EH);V4.displayName="AppShellMobileContext";function bm(){return h.use(V4)}function YC({ref:e,children:t,label:n,"data-testid":s,xstyle:i,className:r,style:a}){const l=Fe(),c=n??l("@astryx.mobileNav.toggle.open"),{isMobile:u,isMobileNavEnabled:d,isMobileNavOpen:f,mobileNavId:p,toggleMobileNav:x}=bm();return!u||!d?null:o.jsx(K,{ref:e,variant:"ghost",label:c,icon:t??o.jsx(Pe,{icon:"menu",color:"inherit"}),onClick:x,"aria-expanded":f,"aria-controls":p||void 0,"data-testid":s??"mobile-nav-toggle",xstyle:i,className:r,style:a,isIconOnly:!0})}YC.displayName="MobileNavToggle";const Uu=h.createContext("default");Uu.displayName="SideNavRenderContext";function QC(){return h.use(Uu)}const Ty=h.createContext("default");Ty.displayName="TopNavRenderContext";const zy=h.createContext(null);zy.displayName="TopNavMobileContentContext";const $H=typeof fm.Activity<"u",AH=$H?({mode:e,children:t})=>o.jsx(fm.Activity,{mode:e,children:t}):({children:e})=>o.jsx(o.Fragment,{children:e}),MH={sm:640,md:768,lg:1024,none:0},N2="astryx-app-shell-main",Zn={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 JC({variant:e="elevated",banner:t,children:n,contentPadding:s,"data-testid":i,height:r="fill",mobileNav:a,sideNav:l,topNav:c,xstyle:u,className:d,style:f,ref:p,...x}){const g=Fe(),y=a===!1,v=a!=null&&a!==!1&&typeof a=="object"&&!h.isValidElement(a)?a:null,m=(v==null?void 0:v.breakpoint)??"md",k=a!=null&&a!==!1&&(h.isValidElement(a)||typeof a=="string")?a:null,w=(v==null?void 0:v.content)??null,S=(v==null?void 0:v.hasToggle)!==!1,E=(v==null?void 0:v.isOpen)!==void 0,A=m==="none"?"(max-width: 0px)":`(max-width: ${MH[m]}px)`,z=tu(A,v==null?void 0:v.defaultIsMobile),[N,M]=h.useState(!1),$=(v==null?void 0:v.isOpen)??N,R=h.useCallback(Wt=>{var Jt;E||M(Wt),(Jt=v==null?void 0:v.onOpenChange)==null||Jt.call(v,Wt)},[E,v]),_=h.useCallback(()=>{var Wt;(Wt=document.getElementById(N2))==null||Wt.focus()},[]),T=r==="fill",O=r==="auto",H=C2(t),L=C2(c),B=C2(l),D=!y&&(L||B)&&k==null,q=e==="section",U=e==="elevated",X=e==="wash"||e==="elevated"?Zn.navAreaWash:e==="surface"?Zn.navAreaSurface:void 0,Z=e==="wash"?Zn.contentBgWash:e==="elevated"&&L&&B&&!z?Zn.contentBgTransparent:e==="surface"||e==="elevated"?Zn.contentBgSurface:void 0,ne=X??Zn.navAreaSurface,Y=h.useRef(null),ae=h.useRef(null);h.useEffect(()=>{if(!O||!Y.current||!ae.current)return;const Wt=Y.current,Jt=ae.current,_s=()=>{const Rt=Wt.getBoundingClientRect().height;Jt.style.setProperty("--appshell-header-height",`${Rt}px`)};return I4(Wt,()=>_s()),()=>L4(Wt)},[O]);const le=B&&!z,re=k!=null,ge=D&&w!=null&&z,be=h.useId(),me=h.useMemo(()=>({isMobile:z,isMobileNavOpen:$,mobileNavId:be,toggleMobileNav:()=>D&&R(!$),openMobileNav:()=>D&&R(!0),closeMobileNav:()=>R(!1),isMobileNavEnabled:D,hasAutoToggle:S}),[z,$,be,R,D,S]),je=B&&S?o.jsx(Uu,{value:"drawer-content",children:l}):null,we=B?o.jsx(Uu,{value:"drawer-content",children:l}):null,ye=L?z&&!y&&k==null?o.jsx(zy,{value:je,children:o.jsx(Ty,{value:"mobile-bar",children:c})}):c:null,J=L||H?o.jsxs(Wx,{padding:0,hasDivider:q&&L,children:[H&&o.jsx("div",{...G(Zn.banner,X),children:t}),L&&ye]}):void 0,Se=J!=null?o.jsx("div",{ref:Y,role:"banner",...ie(se("app-shell-header",{variant:e}),G(X,O&&Zn.headerSticky)),children:J}):void 0,ke=le?o.jsx(aC,{padding:0,hasDivider:q,isScrollable:T,...se("app-shell-sidenav",{variant:e}),xstyle:[X,O&&ne,O&&Zn.panelAutoFill],children:l}):void 0,Ce=ke!=null&&O?o.jsx("div",{className:"x2lah0s x7giv3 x7wzq59 xepuwc7 x16zugyo x78zum5 xdt5ytf",children:ke}):ke,Ee=U&&L&&le,xe=o.jsx(Kn,{padding:s??0,role:"main",id:N2,tabIndex:-1,isScrollable:T,xstyle:[Z,Zn.mainFocusTarget],children:n}),xt=Ee?o.jsxs("div",{className:"x1n2onr6 x78zum5 x98rzlu x2lwn1j x5yr21d",children:[o.jsx("div",{className:"x10l6tqk x10a8y8t x10xzikg x183tx6i x47corl"}),xe]}):xe,Gt=!y&&S&&z&&!L&&B?o.jsx("div",{...ie(se("app-shell-header",{variant:e}),G(X,O&&Zn.headerSticky)),children:o.jsx(Wx,{padding:0,hasDivider:q,children:o.jsxs("div",{className:"x78zum5 x6s0dn4 x1k15mir xf314gf",role:"navigation","aria-label":g("@astryx.appShell.mobileNavigation"),children:[o.jsx(Uu,{value:"topbar",children:l}),o.jsx(YC,{})]})})}):void 0;return o.jsx(V4,{value:me,children:o.jsxs("div",{...x,ref:pn(p,ae),"data-testid":i,...ie(se("app-shell",{variant:e}),G(Zn.root,e==="wash"?Zn.variantWash:e==="surface"?Zn.variantSurface:e==="section"?Zn.variantSection:Zn.variantElevated,T?Zn.rootFill:Zn.rootAuto,u),d,f),children:[o.jsx("a",{href:`#${N2}`,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(Wn,{height:r,padding:0,header:o.jsxs(o.Fragment,{children:[Se,Gt]}),start:Ce,content:xt}),re&&k,ge&&w,z&&!y&&k==null&&!w&&o.jsxs(AH,{mode:$?"visible":"hidden",children:[B&&!L&&o.jsx(Uu,{value:"drawer",children:l}),L&&o.jsx(zy,{value:we,children:o.jsx(Ty,{value:"drawer",children:c})})]})]})})}JC.displayName="AppShell";const eE=h.createContext(36);eE.displayName="AvatarSizeContext";const tE=h.createContext(null);tE.displayName="AvatarGroupContext";function TH(){return h.use(tE)}const p7=(1-1/Math.SQRT2)/2,zH=.4;function NH(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 gu={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}},_H={kGuDYH:"xdmh292",$$css:!0},RH={krVfgx:"x1nqzi6q",kt4wiu:"xqxgn94",k3aq6I:"x4v1no5 xqgnvz5",$$css:!0},_2={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=>[_H,{"--x-fontSize":(t=>typeof t=="number"?t+"px":t??void 0)(`var(--_avatar-fallback-font-size, ${e*zH}px)`)}],statusPosition:e=>[RH,{"--x-bottom":(t=>typeof t=="number"?t+"px":t??void 0)(e*p7),"--x-insetInlineEnd":(t=>typeof t=="number"?t+"px":t??void 0)(e*p7)}]},x7={ring:{kaIpWk:"xjspbzw",kMzoRj:"xdh2fpr",ksu8eU:"x1y0btm7",kVAM5u:"x1touxvs",kWkggS:"x10xzikg",kB7OPa:"x1afcbsf",$$css:!0},overlap:{keTefX:"x1sik18w",$$css:!0}},IH={"--_avatar-group-overlap":"xlz5hwt",$$css:!0},LH={overlap:e=>[IH,{"--x---_avatar-group-overlap":`${e}px`!=null?`${e}px`:void 0}]};function OH(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 DH(e){if(!h.isValidElement(e))return;const{label:t}=e.props;return typeof t=="string"&&t!==""?t:void 0}function BH({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 G4({alt:e,"data-testid":t,fallbackSrc:n,name:s,size:i="md",src:r,status:a,tooltip:l=!0,href:c,as:u,target:d,rel:f,onClick:p,xstyle:x,className:g,style:y,ref:v,...m}){const[k,w]=h.useState(void 0),[S,E]=h.useState(void 0),A=r&&k!==r,z=!A&&n&&S!==n,N=!A&&!z&&s,M=!A&&!z&&!s,$=Fe(),R=e||s,_=DH(a),T=R&&_?$("@astryx.avatar.nameWithStatus",{name:R,status:_}):R||_,O=!T,H=TH(),L=(H==null?void 0:H.size)??i,B=h.useMemo(()=>NH(L),[L]),I=l===!1?void 0:typeof l=="string"?l:s,D=I==null?void 0:I.trim(),q=D!=null&&D!=="",U=typeof l=="string",X=Fs({placement:"above",isEnabled:q}),Z=pn(v,q?X.ref:void 0),ne=q&&U?{"aria-describedby":[m["aria-describedby"],X.describedBy].filter(Boolean).join(" ")||void 0}:null,Y=c!=null,ae=!Y&&p!=null,le=Y||ae,re=vl(u);le&&!T&&console.warn("Avatar: an interactive avatar (with `href` or `onClick`) needs a meaningful accessible name. Pass `alt` or `name`.");const ge=o.jsxs(o.Fragment,{children:[o.jsxs("div",{...G(gu.content,_2.size(B)),children:[A&&o.jsx("img",{src:r,alt:"",onError:()=>w(r),className:"xh8yej3 x5yr21d xl1xv1r"}),z&&o.jsx("img",{src:n,alt:"",onError:()=>E(n),className:"xh8yej3 x5yr21d xl1xv1r"}),N&&o.jsx("div",{...G(gu.fallback,_2.fontSize(B)),children:OH(s)}),M&&o.jsx("div",{className:"x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xelv01g xicfil x9ynric xi08x9w xtvhhri",children:o.jsx(BH,{size:B})})]}),a&&o.jsx("div",{...G(gu.status,_2.statusPosition(B)),children:a})]}),be=ie(se("avatar",{size:L}),G(gu.wrapper,le&&gu.interactive,!le&&q&&!H&&gu.focusable,H&&x7.ring,H&&x7.overlap,H&&LH.overlap(-H.overlap),x),g,y);let me;const je=m;Y?me=o.jsx(re,{...je,...ne,ref:Z,href:c,target:d,rel:f,"aria-label":T,"data-avatar-item":"","data-testid":t,onClick:p,...be,children:ge}):ae?me=o.jsx("button",{...je,...ne,ref:Z,type:"button","aria-label":T,"data-avatar-item":"","data-testid":t,onClick:p,...be,children:ge}):me=o.jsx("div",{...m,ref:Z,role:O?"presentation":"img","aria-label":O?void 0:T,"aria-hidden":O||void 0,tabIndex:q&&!H?0:void 0,"data-testid":t,...ne,...be,children:ge});const we=o.jsx(eE,{value:B,children:me});return o.jsxs(o.Fragment,{children:[we,q?X.renderTooltip(D):null]})}G4.displayName="Avatar";function HH(e){return!e||typeof window>"u"?!1:window.getComputedStyle(e).direction==="rtl"}const no=typeof window<"u"?h.useLayoutEffect:h.useEffect,qH=new Set(["text","search","url","tel","email","password","number"]);function PH(e){if(e.isContentEditable)return e;const t=e.closest("[contenteditable]");return t&&t.getAttribute("contenteditable")!=="false"?t:null}function g7(e,t){if(!(e instanceof HTMLElement))return!1;const n=PH(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",i=e.tagName==="INPUT"&&qH.has(e.type);if(!s&&!i)return!1;const r=e,{selectionStart:a,selectionEnd:l,value:c}=r;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 nu(e={}){const{itemSelector:t='[role="menuitem"]',boundarySelector:n,wrap:s=!0,onEscape:i,orientation:r="vertical",hasHomeEnd:a=!0,isRtl:l,hasRovingTabIndex:c=!1,hasCaretGuard:u=!1}=e,d=h.useRef(null),f=h.useCallback(N=>N.getAttribute("aria-disabled")==="true"||N.disabled===!0||N.hasAttribute("disabled"),[]),p=h.useCallback(()=>{const N=d.current;if(!N)return[];const M=Array.from(N.querySelectorAll(t));return n?M.filter($=>$.closest(n)===N):M},[t,n]),x=h.useCallback(N=>{const M=d.current;if(!M||!n)return!0;const $=N.target;return $?$.closest(n)===M:!0},[n]),g=h.useCallback((N,M,$,R)=>{const _=N.length;if(_===0)return-1;let T=M;for(let O=0;O<_;O++){if(T<0||T>=_){if(!R)return-1;T=(T+_)%_}const H=N[T];if(H&&!f(H))return T;T+=$}return-1},[f]),y=h.useCallback(()=>{const N=p(),M=document.activeElement;return N.findIndex($=>$===M||$.contains(M))},[p]),v=h.useCallback((N,M)=>{N.getAttribute("tabindex")!==String(M)&&N.setAttribute("tabindex",String(M))},[]),m=h.useCallback(()=>{const N=p(),M=N.filter(_=>!f(_));if(M.length===0)return;const R=M.find(_=>_.getAttribute("tabindex")==="0")??M[0];for(const _ of N)v(_,_===R?0:-1)},[p,f,v]);no(()=>{c&&m()});const k=h.useCallback((N,M)=>{const $=N[M];if($){if(c)for(const R of N)v(R,R===$?0:-1);$.focus()}},[c,v]),w=h.useCallback(N=>{const M=p();if(M.length===0)return;const $=Math.max(0,Math.min(N,M.length-1));k(M,$)},[p,k]),S=h.useCallback(()=>{const N=p(),M=g(N,0,1,!1);return M!==-1?(k(N,M),!0):!1},[p,g,k]),E=h.useCallback(()=>{const N=p(),M=g(N,N.length-1,-1,!1);return M!==-1?(k(N,M),!0):!1},[p,g,k]),A=h.useCallback(()=>{c&&m()},[c,m]),z=h.useCallback(N=>{if(N.ctrlKey||N.metaKey||N.altKey||!x(N))return;if(N.key==="Escape"){N.preventDefault(),i==null||i();return}const M=r==="horizontal"||r==="both",$=r==="vertical"||r==="both",R=[],_=[];if(M){const D=N.key==="ArrowLeft"||N.key==="ArrowRight"?l??HH(d.current):!1;R.push(D?"ArrowLeft":"ArrowRight"),_.push(D?"ArrowRight":"ArrowLeft")}$&&(R.push("ArrowDown"),_.push("ArrowUp"));const T=R.includes(N.key),O=_.includes(N.key),H=a&&N.key==="Home",L=a&&N.key==="End";if(!T&&!O&&!H&&!L||u&&(g7(N.target,N.key)||g7(document.activeElement,N.key)))return;const B=y(),I=p();if(T){const D=B===-1?0:B+1,q=g(I,D,1,s);q!==-1&&k(I,q)}else if(O){const D=B===-1?I.length-1:B-1,q=g(I,D,-1,s);q!==-1&&k(I,q)}else H?S():L&&E();N.preventDefault()},[y,p,s,r,l,a,u,g,k,S,E,i,x]);return{listRef:d,handleKeyDown:z,handleFocus:A,focusItem:w,focusFirst:S,focusLast:E,ownsEvent:x,getItems:p}}const UH={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}},FH={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 bf({variant:e="neutral",label:t,icon:n,xstyle:s,className:i,style:r,ref:a,...l}){return o.jsxs("span",{ref:a,...ie(se("badge",{variant:e}),G(UH.base,FH[e],s),i,r),...l,children:[n,t]})}bf.displayName="Badge";const VH={info:"info",warning:"warning",error:"error",success:"success"},GH={info:"status",warning:"alert",error:"alert",success:"status"},WH={info:"accent",warning:"warning",error:"error",success:"success"},El={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}},KH={info:{kWkggS:"xgcxg3y",$$css:!0},warning:{kWkggS:"x24i8r5",$$css:!0},error:{kWkggS:"x1pritpl",$$css:!0},success:{kWkggS:"xu13z74",$$css:!0}},XH={none:{kGVxlE:"x1gnnqk1",$$css:!0},low:{kGVxlE:"x1i5ehqx",$$css:!0},med:{kGVxlE:"x14hfi27",$$css:!0},high:{kGVxlE:"x1kcpxr7",$$css:!0}};function Ie({status:e,title:t,description:n,icon:s,isDismissable:i=!1,onDismiss:r,endContent:a,container:l="card",elevation:c="none",defaultIsExpanded:u=!1,children:d,xstyle:f,className:p,style:x,ref:g,...y}){const v=Fe(),[m,k]=h.useState(!1),[w,S]=h.useState(u),E=h.useId(),A=VH[e],z=GH[e],N=WH[e],M=d!=null;if(m)return null;const $=()=>{k(!0),r==null||r()},R=()=>{S(B=>!B)},_=a!=null||i||M,T=a!=null||i,O=n==null&&T,H=M&&w,L=l==="card";return o.jsxs("div",{ref:g,role:z,...ie(G(El.root,XH[c],L&&c!=="none"&&El.rootElevatedCard,f),p,x),...y,children:[o.jsxs("div",{...ie(se("banner",{container:l,status:e}),G(El.header,O&&El.headerCentered,KH[e],L&&(H?El.headerCardWithContent:El.headerCardStandalone))),children:[o.jsx("div",{...ie(se("banner-icon",{status:e}),{className:"x78zum5 x6s0dn4 x2lah0s"}),"aria-hidden":"true",children:s??o.jsx(Pe,{icon:A,size:"md",color:N})}),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(El.endArea,xB.inset(Ri["--spacing-2"])),children:[a,M&&o.jsx(K,{variant:"ghost",size:"sm",label:v(w?"@astryx.banner.collapse":"@astryx.banner.expand"),tooltip:v(w?"@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"}}[!!w<<0],children:o.jsx(Pe,{icon:"chevronDown",size:"sm",color:"inherit"})}),onClick:R,"aria-expanded":w,"aria-controls":H?E:void 0,isIconOnly:!0}),i&&o.jsx(K,{variant:"ghost",size:"sm",label:v("@astryx.banner.dismiss"),tooltip:v("@astryx.banner.dismiss"),icon:o.jsx(Pe,{icon:"close",size:"sm",color:"inherit"}),onClick:$,isIconOnly:!0})]})]}),H&&o.jsx("div",{id:E,...ie(se("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"}}[!!L<<0]),children:d})]})}Ie.displayName="Banner";const ZH={root:{k2ei4v:"xtpqe59",kVhnKS:"x1t7ytsu",kGJrpR:"x14ydlgx",kZCmMZ:"x1rey3nv",kMwMTN:"xv1l7n4",keTefX:"x1lziwak",k71WvV:"x14z9mp",keoZOQ:"xdj266r",k1K539:"xat24cr",$$css:!0}};function nE({children:e,cite:t,xstyle:n,className:s,style:i,ref:r,...a}){return o.jsxs("blockquote",{ref:r,...ie(se("blockquote"),G(ZH.root,n),s,i),...a,children:[e,t!=null&&o.jsx("footer",{children:o.jsx("cite",{className:"x1lliihq xtbrsbv x141an7d x1ltkj2j x1j61x8r",children:t})})]})}nE.displayName="Blockquote";const YH='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',Lo=[];function QH(e){Lo.push(e)}function JH(e){for(let t=Lo.length-1;t>=0;t--)if(Lo[t].handler===e){Lo.splice(t,1);return}}function eq(e){if(Lo.length===0)return!1;let t=Lo[0];for(let n=1;n<Lo.length;n++){const s=Lo[n],i=t.getContainer(),r=s.getContainer();i!=null&&r!=null&&r!==i&&r.contains(i)||(t=s)}return t.handler===e}function m7(){return Lo.length>0}function sE(e){return e.isComposing===!0||e.keyCode===229}function tq(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 W4(e){return Array.from(e.querySelectorAll(YH)).filter(tq)}function iE(e){try{e.focus()}catch{}return document.activeElement===e}function v7(e){const t=W4(e);for(const n of t)if(iE(n))return!0;return!1}function nq(e){const t=W4(e);for(let n=t.length-1;n>=0;n--)if(iE(t[n]))return!0;return!1}function sq(e){const{isActive:t,onEscape:n}=e,s=h.useRef(null),i=h.useRef(null),r=h.useRef(!1),a=h.useCallback(()=>{s.current&&v7(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)?i.current=d:r.current&&(v7(u),i.current===document.activeElement&&nq(u),i.current=document.activeElement),r.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&&QH({handler:l,getContainer:()=>s.current});const c=u=>{const d=s.current;if(d){if(u.key==="Escape"&&n){if(u.defaultPrevented||sE(u)||!eq(l))return;u.preventDefault(),u.stopPropagation(),n();return}if(u.key==="Tab"){r.current=!0;const f=W4(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&&JH(l)}},[t,n]),{containerRef:s,focusFirst:a}}function wf(e,t,n=!0){const s=h.useRef(!1);h.useEffect(()=>{n&&!s.current&&(s.current=!0,Tc())},[e,t,n])}const R2={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 su(e={}){const{onShow:t,onHide:n,xstyle:s,hasLightDismiss:i=!0,hasEscapeDismiss:r=!0,hasAutoFocus:a=!0,hasSurface:l=!0,hasCloseButton:c=!0,closeButtonLabel:u,dialogLabel:d,role:f="dialog",isModal:p=!0}=e,x=Fe(),g=u??x("@astryx.popover.close"),y=h.useRef(null),v=h.useRef(!1),m=kf({mode:"context",lightDismiss:i,onShow:t,onHide:n}),{containerRef:k,focusFirst:w}=sq({isActive:m.isOpen,onEscape:r||i?m.hide:void 0});h.useEffect(()=>{m.isOpen&&a&&!v.current&&requestAnimationFrame(()=>{w()}),m.isOpen||(v.current=!1)},[m.isOpen,a,w]);const S=h.useCallback(M=>{y.current=M,m.ref(M)},[m]),E=h.useCallback(M=>{v.current=(M==null?void 0:M.skipAutoFocus)??!1,m.show()},[m]),A=h.useCallback(()=>{m.isOpen?m.hide():E()},[m,E]),z={"aria-haspopup":f==="dialog"?"dialog":"true","aria-expanded":m.isOpen,"aria-controls":m.id};wf("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 N=h.useCallback((M,$)=>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(R2.contentWrapper,l&&R2.surface,s),children:[M,c&&o.jsx("div",{...G(R2.closeButtonWrapper,Fd.centerInline("100%")),children:o.jsx(K,{variant:"secondary",label:g,onClick:m.hide})})]}),{...$,xstyle:$==null?void 0:$.xstyle}),[m,c,l,g,k,d,f,p,s]);return{triggerRef:S,contentRef:k,anchorId:m.anchorId,show:E,hide:m.hide,toggle:A,isOpen:m.isOpen,id:m.id,render:N,triggerProps:z}}function iq(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key!==" "}function K4(e){const{getItemLabels:t,onMatch:n,getCurrentIndex:s,resetMs:i=750,isDisabled:r}=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},i)},[i]);return{onKeyDown:h.useCallback(f=>{const p=f.key===" "&&a.current.length>0;if(!iq(f)&&!p)return!1;const x=t();if(x.length===0)return!1;const g=f.key.toLowerCase(),y=a.current.length>0&&a.current.split("").every(S=>S===g),v=y?g:a.current+g;a.current=v,u();const m=(s==null?void 0:s())??-1,k=x.length,w=y?1:0;for(let S=0;S<k;S++){const E=(m+w+S+k)%k;if(r!=null&&r(E))continue;const A=x[E];if(A!=null&&A.trim().toLowerCase().startsWith(v))return n(E),!0}return!0},[t,n,s,u,r]),reset:c}}const y7={horizontal:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kzqmXN:"xh8yej3",$$css:!0},vertical:{k1xSpc:"x3nfvp2",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kZKoxP:"x5yr21d",$$css:!0}},mu={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}},k7={horizontal:{keTefX:"xojxgvx",k71WvV:"x1fcf3bl",kzqmXN:"xx6qvi6",$$css:!0},vertical:{keoZOQ:"x1sa9bsh",k1K539:"x6h7pi7",kZKoxP:"x12qplqi",$$css:!0}};function Po({orientation:e="horizontal",label:t,variant:n="subtle",isFullBleed:s=!1,xstyle:i,className:r,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,...ie(se("divider",{variant:n,orientation:e}),G(f?y7.horizontal:y7.vertical,s&&(f?k7.horizontal:k7.vertical),i),r,a),children:[o.jsx("div",{...G(f?mu.horizontalLine:mu.verticalLine,mu[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?mu.horizontalLine:mu.verticalLine,mu[n])})]})}Po.displayName="Divider";const rq=["noopener","noreferrer"];function rE(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 rq)n.includes(s)||n.push(s);return{target:e,rel:n.join(" ")}}const oE=["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(","),oq='[aria-readonly="true"]';function b7(e,t){let n=e;for(;n!=null&&n!==t&&n!==document.body;){if(n.matches(oE)&&!n.matches(oq))return!0;n=n.parentElement}return!1}function aq(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 X4({containerRef:e,interactiveRef:t,onClick:n,href:s,target:i,disabled:r=!1}){h.useEffect(()=>{const c=e.current;c&&c.setAttribute("data-pressable-container","true")},[e]);const a=h.useCallback(c=>{if(r)return;const u=e.current;if(!u||aq(u))return;const d=c.target;if(d instanceof Element&&!(d!==c.currentTarget&&b7(d,u))&&(n==null||n(c),!c.defaultPrevented&&(s!=null&&(i==="_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,i,r]),l=h.useCallback(c=>{if(r)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||!b7(d,u))&&window.open(s,"_blank","noopener")},[e,s,r]);return{onClick:a,onMouseUp:l}}const lq=new Set(["option","tab","row","gridcell","columnheader","rowheader","treeitem"]),Is={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}},w7={lineClamp:e=>[{kJFfOR:e!=null?"x1yhjpo9":e,$$css:!0},{"--x-WebkitLineClamp":e??void 0}]},cq={compact:{k8WAf4:"xu0wf1k",$$css:!0},balanced:{k8WAf4:"xce4md1",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"xrrkdod",$$css:!0}};function yl({as:e="div",marker:t,startContent:n,label:s,description:i,endContent:r,align:a="center",density:l="balanced",labelLines:c,descriptionLines:u,onClick:d,interactiveRef:f,href:p,target:x,rel:g,isHighlighted:y=!1,isSelected:v=!1,isDisabled:m=!1,xstyle:k,className:w,style:S,ref:E,role:A,...z}){const N=vl(),M=f!=null,$=h.useRef(null),{onClick:R}=X4({containerRef:$,interactiveRef:f??void 0,disabled:m});wf("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.",M&&(d!=null||p!=null));const _=d!=null||p!=null||M,{target:T,rel:O}=rE(x,g),H=A!=null,L=A!=null&&lq.has(A),B=typeof s=="string",I=typeof i=="string",D=c!=null?c===1?Is.labelSingleTruncate:Is.labelMultiTruncate:B?Is.labelSingleTruncate:null,q=u!=null?u===1?Is.descriptionSingleTruncate:Is.descriptionMultiTruncate:I?Is.descriptionSingleTruncate:null,U=o.jsxs(o.Fragment,{children:[o.jsx("span",{...G(Is.label,D,c!=null&&c>1&&w7.lineClamp(c)),children:s}),i!=null&&o.jsx("span",{...G(Is.description,q,u!=null&&u>1&&w7.lineClamp(u)),children:i})]}),X=ne=>{m||ne.target.closest("button, a, input, select, textarea")||d==null||d(ne)},Z=o.jsxs(o.Fragment,{children:[t,n!=null&&o.jsx("span",{className:"x3psx0u x78zum5",children:n}),H||M?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(N,{href:p,target:T,rel:O,"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}),r!=null&&o.jsx("span",{...{0:{className:"x3psx0u x78zum5 xvc5jky"},1:{className:"x3psx0u x78zum5 xvc5jky xbyyjgo"}}[!!m<<0],children:r})]});return o.jsx(e,{ref:M?pn(E,$):E,...z,"aria-selected":L&&v||void 0,"aria-current":z["aria-current"]??(v&&!L?!0:void 0),"aria-disabled":m||void 0,...ie(se("item",{density:l,align:a}),G(Is.root,cq[l],a==="start"&&Is.alignStart,_&&Is.interactive,_&&Is.focusVisibleOutline,y&&Is.highlighted,v&&Is.selected,m&&!H&&Is.disabled,k),w,S),role:A,onClick:M?R:H?d:_?X:void 0,children:Z})}yl.displayName="Item";const e0=h.createContext(null);e0.displayName="DropdownMenuContext";function aE(){return h.use(e0)}const uq=h.createContext(null);uq.displayName="DropdownMenuRadioGroupContext";function lE(e,t){if(t||e.pointerType!=="mouse")return;const n=e.currentTarget;n!==n.ownerDocument.activeElement&&n.focus()}const j7={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}},dq={sm:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},md:{k8WAf4:"x1vofgu7",$$css:!0},lg:{$$css:!0}};function t1({icon:e,label:t,description:n,onClick:s,isDisabled:i=!1,endContent:r,xstyle:a,className:l,style:c}){const u=aE(),d=(u==null?void 0:u.menuSize)??"md",f=h.useCallback(()=>{i||!s||(s(),u==null||u.closeMenu())},[i,s,u]),p=h.useCallback(x=>lE(x,i),[i]);return o.jsx(yl,{role:"menuitem",tabIndex:i?void 0:-1,onPointerMove:p,startContent:e?Ji(e,{size:"sm",color:"secondary"}):void 0,label:t,description:n,endContent:r,onClick:f,isDisabled:i,xstyle:[j7.root,dq[d],i&&j7.disabled,a],...ie(se("dropdown-menu-item",{size:d}),{className:l,style:c})})}t1.displayName="DropdownMenuItem";function fq(e){const{show:t,hide:n,isOpen:s,isEnabled:i,showDelay:r=150,hideDelay:a=200}=e,l=tu("(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:y,handleKeyDown:v,focusFirst:m}=nu({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]),w=h.useCallback(()=>{if(l){if(p.current){p.current=!1;return}f.current=!0,g(),r>0?c.current=setTimeout(()=>{t({skipAutoFocus:!0})},r):t({skipAutoFocus:!0})}},[l,g,t,r]),S=h.useCallback(()=>{f.current&&(g(),u.current=setTimeout(()=>{n()},a))},[g,n,a]),E=h.useCallback(()=>{g()},[g]),A=h.useCallback($=>{d.current=$},[]),z=h.useCallback(()=>{},[]),N=h.useCallback($=>{},[]),M=h.useCallback($=>{},[]);return i?{triggerProps:{onClick:k,onMouseEnter:w,onMouseLeave:S},contentProps:{onMouseEnter:E,onMouseLeave:S,onKeyDown:v},menuRef:y,focusFirst:m,setTriggerEl:A}:{triggerProps:{onClick:z,onMouseEnter:z,onMouseLeave:z},contentProps:{onMouseEnter:z,onMouseLeave:z,onKeyDown:M},menuRef:y,focusFirst:m,setTriggerEl:N}}const wm=new Set(["menuitem","menuitemradio","menuitemcheckbox"]),jm=[...wm].map(e=>`[role="${e}"]:not([aria-disabled="true"])`).join(","),Z4='[role="menu"]',I2={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}},hq={sm:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},md:{k8WAf4:"x1vofgu7",$$css:!0},lg:{$$css:!0}},pq={keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0},S7={popover:{k7Eaqz:"x5w4yej",keTefX:"x11g1kdw",k71WvV:"xnur1sd",$$css:!0},popoverCustomWidth:e=>[pq,{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 cE(e){const{icon:t,label:n,description:s,isDisabled:i=!1,hasSpinner:r=!1,menuWidth:a,onOpenChange:l,children:c,xstyle:u,className:d,style:f,"data-testid":p,menuDataTestId:x}=e,g=aE(),y=(g==null?void 0:g.menuSize)??"md",v=!i,m=h.useId(),k=h.useId(),w=h.useRef(null),[S,E]=h.useState(!1),A=kf({mode:"context",lightDismiss:!1,onShow:h.useCallback(()=>{E(!0),l==null||l(!0)},[l]),onHide:h.useCallback(()=>{E(!1),l==null||l(!1)},[l])}),z=h.useCallback(()=>{v&&A.show()},[v,A]),N=h.useCallback(()=>{A.hide()},[A]),{listRef:M,handleKeyDown:$,focusFirst:R,focusItem:_,ownsEvent:T,getItems:O}=nu({itemSelector:jm,boundarySelector:Z4,wrap:!1,onEscape:()=>D({focusTrigger:!0})}),H=K4({getItemLabels:()=>O().map(re=>re.textContent),onMatch:_,getCurrentIndex:()=>O().findIndex(re=>re===document.activeElement||re.contains(document.activeElement))}),{triggerProps:L,contentProps:B}=fq({show:z,hide:N,isOpen:S,isEnabled:v}),I=h.useCallback(re=>{v&&(A.show(),re!=null&&re.focusFirst&&requestAnimationFrame(()=>{var be;R()||(be=M.current)==null||be.focus()}))},[v,A,R,M]),D=h.useCallback(re=>{var ge;A.hide(),(re==null?void 0:re.focusTrigger)!==!1&&((ge=w.current)==null||ge.focus())},[A]),q=h.useCallback(re=>{w.current=re,A.ref(re)},[A]),U=h.useCallback(()=>{i||(S?D({focusTrigger:!0}):I({focusFirst:!0}))},[i,S,I,D]),X=h.useCallback(re=>{if(i)return;const be=(typeof window<"u"&&w.current?window.getComputedStyle(w.current).direction==="rtl":!1)?"ArrowLeft":"ArrowRight";(re.key===be||re.key==="Enter"||re.key===" ")&&(re.preventDefault(),re.stopPropagation(),I({focusFirst:!0}))},[i,I]),Z=h.useCallback(re=>lE(re,i),[i]),ne=h.useCallback(re=>{if(!T(re))return;if(re.key==="Escape"){re.preventDefault(),re.stopPropagation(),D({focusTrigger:!0});return}if(re.key==="Enter"||re.key===" "){re.preventDefault();const me=document.activeElement;me&&wm.has(me.getAttribute("role")??"")&&me.click();return}const be=(typeof window<"u"&&M.current?window.getComputedStyle(M.current).direction==="rtl":!1)?"ArrowRight":"ArrowLeft";if(re.key===be){re.preventDefault(),D({focusTrigger:!0});return}if(H.onKeyDown(re)){re.preventDefault();return}$(re)},[T,D,$,H,M]),Y=h.useMemo(()=>({menuSize:y,closeMenu:()=>{D({focusTrigger:!1}),g==null||g.closeMenu()}}),[y,D,g]),ae=r?o.jsx("span",{...ie(se("dropdown-menu-indicator-icon"),{className:"x78zum5 x6s0dn4"}),children:o.jsx(Tt,{size:"sm"})}):o.jsx("span",{...ie(se("dropdown-menu-indicator-icon"),{className:"x78zum5 x6s0dn4"}),children:o.jsx(Pe,{icon:"chevronRight",size:"sm",color:"secondary"})}),le=a?S7.popoverCustomWidth(a):S7.popover;return o.jsxs(o.Fragment,{children:[o.jsx(yl,{ref:re=>q(re),id:k,role:"menuitem",tabIndex:i?void 0:-1,"aria-haspopup":"menu","aria-expanded":S,"aria-controls":S?m:void 0,"aria-disabled":i||void 0,"data-testid":p,onMouseEnter:L.onMouseEnter,onMouseLeave:L.onMouseLeave,onPointerMove:Z,startContent:t?Ji(t,{size:"sm",color:"secondary"}):void 0,label:n,description:s,endContent:ae,onClick:U,onKeyDown:X,isDisabled:i,xstyle:[I2.root,hq[y],S&&I2.open,i&&I2.disabled,u],...ie(se("dropdown-menu-item",{size:y}),{className:d,style:f})}),A.render(o.jsx("div",{ref:M,id:m,role:"menu",tabIndex:-1,"aria-labelledby":k,onKeyDown:ne,onMouseEnter:B.onMouseEnter,onMouseLeave:B.onMouseLeave,"data-testid":x,...ie(se("dropdown-menu"),{className:"x9f619 x78zum5 xdt5ytf x1lsbc85 xuyqlj2 x1odjw0f x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92"}),children:o.jsx(e0,{value:Y,children:c})}),{placement:"end",alignment:"start",xstyle:[le,qo.end]})]})}cE.displayName="DropdownMenuSubMenu";const xq={divider:{kqGvvJ:"xsq74q5",$$css:!0}};function L2(e){return`item-${e.label}`}function gq(e,t){return`section-${e.title??t}`}function Y4(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(Po,{xstyle:xq.divider,...se("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",...ie(se("dropdown-menu-section-heading"),{className:"xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o"}),children:s.title}),s.items.map(i=>o.jsx(t1,{icon:i.icon,label:i.label,onClick:i.onClick,isDisabled:i.isDisabled},L2(i)))]},gq(s,n))):"type"in s||(s.items&&s.items.length>0?t.push(o.jsx(cE,{icon:s.icon,label:s.label,isDisabled:s.isDisabled,children:Y4(s.items)},L2(s))):t.push(o.jsx(t1,{icon:s.icon,label:s.label,onClick:s.onClick,isDisabled:s.isDisabled},L2(s))))}return t}function mq(e){return typeof e=="string"||typeof e=="number"}function C7(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function ia({children:e,anchorRef:t,content:n,placement:s="above",alignment:i="center",delay:r=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?mq(e):!1,y=d===!0||d==="auto"&&g,v=h.useCallback(()=>{u==null||u(!0)},[u]),m=h.useCallback(()=>{u==null||u(!1)},[u]),k=Fs({placement:s,alignment:i,delay:r,hideDelay:a,focusTrigger:l,isEnabled:c,isOpen:f,isDefaultOpen:p,onShow:v,onHide:m});return no(()=>{if(!t)return;const w=t.current;if(!w)return;k.ref(w);const S=w.getAttribute("aria-describedby");return w.setAttribute("aria-describedby",C7(S,k.describedBy)??""),()=>{k.ref(null),S?w.setAttribute("aria-describedby",S):w.removeAttribute("aria-describedby")}},[t,k.ref,k.describedBy]),no(()=>{if(t||g)return;const w=x.current;if(!w)return;const S=w.firstElementChild;if(!S)return;k.ref(S);const E=S.getAttribute("aria-describedby");return S.setAttribute("aria-describedby",C7(E,k.describedBy)??""),()=>{k.ref(null),E?S.setAttribute("aria-describedby",E):S.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"}}[!!y<<0],children:e}),k.renderTooltip(n)]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:x,className:"xjp7ctv",children:e}),k.renderTooltip(n)]})}ia.displayName="Tooltip";const uE=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:ia},Symbol.toStringTag,{value:"Module"})),vq="data-astryx-live-region",yq="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;",kq=2e3,Yx={polite:null,assertive:null};function dE(e){const t=Yx[e];t!=null&&(clearTimeout(t),Yx[e]=null)}function bq(e,t){dE(e),Yx[e]=setTimeout(()=>{Yx[e]=null,t.textContent=""},kq)}let dr=null;function E7(e){const t=document.createElement("div");return t.setAttribute(vq,e),t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.setAttribute("role",e==="assertive"?"alert":"status"),t.style.cssText=yq,document.body.appendChild(t),t}function wq(){return typeof document>"u"?null:dr?(dr.polite.isConnected||document.body.appendChild(dr.polite),dr.assertive.isConnected||document.body.appendChild(dr.assertive),dr):(dr={polite:E7("polite"),assertive:E7("assertive")},dr)}function jq(e,t){const n=wq();if(!n)return;const s=t==="assertive"?n.assertive:n.polite;s.textContent="",requestAnimationFrame(()=>{s.textContent=e}),bq(t,s)}function Sq(e){if(dE(e),!dr)return;const t=e==="assertive"?dr.assertive:dr.polite;t.textContent=""}function iu(){return h.useCallback((e,t="polite")=>{if(!e){Sq(t);return}jq(e,t)},[])}const Cq={wrapper:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"xzye2dw",kmuXW:"x2lah0s",$$css:!0}},Eq={ctrl:"⌃",alt:"⌥",shift:"⇧",enter:"↵",backspace:"⌫",escape:"Esc",tab:"⇥",up:"↑",down:"↓",left:"←",right:"→",plus:"+"};function $q(e,t){return e==="mod"?t?"⌘":"Ctrl":Eq[e]??e.toUpperCase()}const Aq={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 Mq(e,t){return e==="mod"?t?"Command":"Control":Aq[e]??e.toUpperCase()}function Tq(){return()=>{}}function zq(){return!1}function Nq(){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 fE({keys:e,ref:t,xstyle:n,className:s,style:i,...r}){const a=h.useSyncExternalStore(Tq,Nq,zq),l=e.split("+").map(u=>u.trim().toLowerCase()),c=l.map(u=>Mq(u,a)).join(" + ");return o.jsx("span",{...r,ref:t,role:"img","aria-label":c,...ie(se("kbd"),G(Cq.wrapper,n),s,i),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:$q(u,a)},u))})}fE.displayName="Kbd";const _q=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),Rq={horizontal:["left","right"],vertical:["up","down"],both:["left","right","up","down"]},Iq={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 hE(e={}){const{orientation:t="horizontal",dismissAfterMs:n=3e3,isEnabled:s=!0}=e,i=Fe(),r=h.useRef(null),a=h.useRef(!1),l=h.useRef(!1),c=h.useRef(()=>{}),u=h.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),d=h.useCallback(()=>{l.current=!0},[]),f=h.useCallback(()=>{l.current=!1,u(),c.current(null)},[u]),p=kf({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(S=>{a.current||!s||(c.current(S),p.show(),u(),r.current=setTimeout(()=>{x()},n))},[u,x,n,s,p]);h.useEffect(()=>()=>{u(),c.current(null)},[u]);const y=h.useCallback(S=>{if(a.current||!s)return;const E=S.target;if(!E.matches(":focus-visible"))return;const A=S.currentTarget;S.relatedTarget instanceof Node&&A.contains(S.relatedTarget)||g(E)},[g,s]),v=h.useCallback(S=>{if(!l.current)return;const E=S.currentTarget;if(S.relatedTarget instanceof Node&&E.contains(S.relatedTarget)){!a.current&&S.relatedTarget instanceof HTMLElement&&c.current(S.relatedTarget);return}x()},[x]),m=h.useCallback(S=>{l.current&&_q.has(S.key)&&x()},[x]),k=o.jsx("span",{className:"x3nfvp2 x6s0dn4 xzye2dw",children:Rq[t].map(S=>o.jsx(fE,{keys:S},S))});return{hintElement:p.render(o.jsxs("span",{"aria-hidden":"true",children:[k,o.jsx("span",{className:"x11g1kdw",children:i("@astryx.keyboardHint.toNavigate")})]}),{placement:"below",alignment:"start",xstyle:Iq.hint,style:{marginBlockStart:Ri["--spacing-2"]}}),onFocus:y,onBlur:v,onKeyDown:m}}function pE(e){h.useEffect(()=>{if(!e)return;const t=window.scrollX,n=window.scrollY,{body:s}=document,i=s.style.overflow,r=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=i,s.style.position=r,s.style.top=a,s.style.left=l,s.style.right=c,window.scrollTo(t,n)}},[e])}let xE=!1;typeof window<"u"&&requestAnimationFrame(()=>{xE=!0});const Lq={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 Oq(e="slideDown"){const[t]=h.useState(()=>xE);return t?Lq[e]:null}const Dq=50;function Bq(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 Hq={natural:10,fast:4,instant:1/0};function qq(e,t,n){const s="natural",i=Hq[s],{token:r}=vm(),a=h.useMemo(()=>{const v=Bq(r("--duration-fast-min"));if(v==null)return Dq;const m=v/10;return Math.max(4,Math.round(m))},[r,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 y=tu("(prefers-reduced-motion: reduce)");return h.useEffect(()=>{if(!t||s==="instant"||y)return;function v(m){if(m-f.current>=a){f.current=m;const w=u.current,S=d.current;if(S<w.length){const E=Math.min(S+i,w.length);d.current=E,c(E)}}p.current=requestAnimationFrame(v)}return p.current=requestAnimationFrame(v),()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null)}},[t,i,a,s,y]),!t||s==="instant"||y?e:e.slice(0,l)}const Pq=new Set(["text","password","email","number","search","tel","url","date","datetime-local","month","time","week"]),Uq=new Set(["true","menu","listbox","tree","grid","dialog"]);function Fq(e){if(e.getAttribute("role")==="combobox")return!0;const t=e.getAttribute("aria-haspopup");return t!=null&&Uq.has(t)}function Q4({containerRef:e,inputRef:t,disabled:n=!1}){const s=h.useCallback(()=>{const i=t.current;i!=null&&(i instanceof HTMLElement&&Fq(i)?i.click():i instanceof HTMLInputElement&&Pq.has(i.type)||i instanceof HTMLTextAreaElement?i.focus():i instanceof HTMLElement?i.click():"focus"in i&&i.focus())},[t]);return X4({containerRef:e,interactiveRef:t,onClick:s,disabled:n})}const Vq={warning:"warning",error:"error",success:"success"},Gq={warning:"@astryx.input.statusButton.warning",error:"@astryx.input.statusButton.error",success:"@astryx.input.statusButton.success"};function gE({status:e,statusVariant:t="attached",isInGroup:n=!1,size:s="md"}){const i=Fe(),a=t==="tooltip"&&!!(e!=null&&e.message),[l,c]=h.useState(void 0),u=Fs({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=y=>{y.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(Pe,{icon:Vq[e.type],size:s,color:e.type,...se("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":i(Gq[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 J4=h.createContext(null);J4.displayName="InteractiveRoleContext";function Wq(){return h.use(J4)}function mE({href:e,onClick:t,isDisabled:n=!1}){const s=Wq();return e!=null&&!n?"link":t!=null?"button":s??"inert"}const Kq=500,Xq=10;function Zq(e){const{onLongPress:t,disabled:n=!1,delayMs:s=Kq,moveCancelPx:i=Xq}=e,r=h.useRef(null),a=h.useRef(null),l=h.useRef(t);l.current=t;const c=h.useCallback(()=>{r.current!=null&&(clearTimeout(r.current),r.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},r.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)>i||Math.abs(x.clientY-p.y)>i)&&c()},[i,c]);return h.useEffect(()=>c,[c]),{onTouchStart:u,onTouchMove:d,onTouchEnd:c,onTouchCancel:c}}const e3=6,Yq={x177fznd:"x177fznd",$$css:!0},D0={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}},Qq={x1e36hu2:"x1e36hu2",$$css:!0},B0={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}},Jq={x10zkftw:"x10zkftw",$$css:!0},H0={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}},eP={xbjq1vy:"xbjq1vy",$$css:!0},q0={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}},tP={x3z7t8n:"x3z7t8n",$$css:!0},P0={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}},nP={x6dglqq:"x6dglqq",$$css:!0},U0={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}},sP=[{marker:Yq,reveal:D0.reveal,revealLayoutPreserved:D0.revealLayoutPreserved,conceal:D0.conceal,concealLayoutPreserved:D0.concealLayoutPreserved},{marker:Qq,reveal:B0.reveal,revealLayoutPreserved:B0.revealLayoutPreserved,conceal:B0.conceal,concealLayoutPreserved:B0.concealLayoutPreserved},{marker:Jq,reveal:H0.reveal,revealLayoutPreserved:H0.revealLayoutPreserved,conceal:H0.conceal,concealLayoutPreserved:H0.concealLayoutPreserved},{marker:eP,reveal:q0.reveal,revealLayoutPreserved:q0.revealLayoutPreserved,conceal:q0.conceal,concealLayoutPreserved:q0.concealLayoutPreserved},{marker:tP,reveal:P0.reveal,revealLayoutPreserved:P0.revealLayoutPreserved,conceal:P0.conceal,concealLayoutPreserved:P0.concealLayoutPreserved},{marker:nP,reveal:U0.reveal,revealLayoutPreserved:U0.revealLayoutPreserved,conceal:U0.conceal,concealLayoutPreserved:U0.concealLayoutPreserved}],Ny=new Array(e3).fill(!1);function iP(){for(let e=0;e<e3;e++)if(!Ny[e])return Ny[e]=!0,{index:e,isExhausted:!1};return{index:0,isExhausted:!0}}function rP(e,t){t||(Ny[e]=!1)}const $7=Object.freeze({});function oP(e={}){const{isEnabled:t=!0}=e,[n]=h.useState(()=>t?iP():null);if(h.useEffect(()=>{if(n!=null)return()=>rP(n.index,n.isExhausted)},[n]),wf("useContainerReveal",`More than ${e3} 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:()=>$7,getContentRevealProps:()=>$7};const s=sP[n.index];return{getContainerProps:()=>G(s.marker),getContentRevealProps:(i={})=>{const{isRevealInverted:r=!1,isLayoutPreserved:a=!1}=i,l=r?a?s.concealLayoutPreserved:s.conceal:a?s.revealLayoutPreserved:s.reveal;return G(l)}}}const O2={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 Sm({label:e,inputID:t,labelID:n,isGroupLabel:s=!1,isLabelHidden:i=!1,isDisabled:r=!1,isOptional:a=!1,isRequired:l=!1,labelIcon:c,labelTooltip:u,description:d,descriptionID:f,className:p,style:x,xstyle:g,ref:y,...v}){const m=Fe(),k=a?m("@astryx.field.optional"):l?m("@astryx.field.required"):null,w=s?"span":"label",S=!s&&t!=null,E=h.useRef(null),A=h.useMemo(()=>({get current(){var M;return t==null?null:((M=E.current)==null?void 0:M.ownerDocument.getElementById(t))??null},set current(M){}}),[t]),z=Q4({containerRef:E,inputRef:A,disabled:!S}),N=o.jsxs(o.Fragment,{children:[c&&Ji(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(ia,{content:u,placement:"above",children:o.jsx(Pe,{icon:"info",size:"sm",color:"inherit"})})]});return o.jsxs(o.Fragment,{children:[o.jsx(w,{ref:y,id:n,htmlFor:s?void 0:t,...v,...ie(se("field-label"),G(O2.label,r&&O2.labelDisabled,i&&O2.srOnly,g),p,x),children:N}),d&&o.jsx("span",{ref:S?E:void 0,id:f,...S?z: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"}}[!!S<<1|!!i<<0],children:d})]})}Sm.displayName="FieldLabel";const aP={warning:"warning",error:"error",success:"success"},D2={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}},lP={warning:{kWkggS:"x24i8r5",kMwMTN:"xdhq94a",$$css:!0},error:{kWkggS:"x1pritpl",kMwMTN:"x1joocv1",$$css:!0},success:{kWkggS:"xu13z74",kMwMTN:"xltfdvo",$$css:!0}};function t0({ref:e,type:t,message:n,id:s,variant:i="attached",xstyle:r,className:a,style:l,...c}){const u=Oq("slideDown"),d=iu();return h.useEffect(()=>{n&&d(n,t==="error"?"assertive":"polite")},[d,n,t]),o.jsx("div",{ref:e,id:s,...c,...ie(se("field-status",{type:t,variant:i}),G(D2.base,u,i==="attached"?D2.attached:D2.detached,lP[t],r),a,l),children:i==="detached"?o.jsxs("span",{className:"x78zum5 x1cy8zhl xzye2dw",children:[o.jsx("span",{className:"x3nfvp2 x6s0dn4 x14o5nre x2lah0s",children:o.jsx(Pe,{icon:aP[t],size:"sm",color:"inherit",...se("field-status-icon",{type:t})})}),o.jsx("span",{children:n})]}):n})}t0.displayName="FieldStatus";const cP={x1tspnpo:"x1tspnpo",$$css:!0},Cm=h.createContext(null);Cm.displayName="CheckboxListContext";const Ls={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}},A7={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},uP={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},dP={sm:{kzqmXN:"xsmyaan",kZKoxP:"x1kpxq89",$$css:!0},md:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",$$css:!0}},fP={sm:{kzqmXN:"x1fsd2vl",kZKoxP:"x36qwtl",$$css:!0},md:{kzqmXN:"xsmyaan",kZKoxP:"x36qwtl",$$css:!0}},hP={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function n0({label:e,isLabelHidden:t=!1,description:n,onChange:s,changeAction:i,isLoading:r=!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:y,labelIcon:v,status:m,width:k,xstyle:w,className:S,style:E,ref:A,...z}){const N=h.useId(),M=h.useId(),$=h.useId(),[,R]=h.useTransition(),[_,T]=h.useOptimistic(a),O=r||_!==a,H=l&&!!u,L=h.use(Cm),B=l&&(H||((L==null?void 0:L.hasDisabledMessage)??!1)),I=Fs({placement:"above",focusTrigger:"always",isEnabled:H}),D=_==="indeterminate",q=_===!0,U=q||D,X=h.useCallback(Y=>{Y&&(Y.indeterminate=D)},[D]),Z=[];n&&Z.push(M),m!=null&&m.message&&Z.push($),H&&Z.push(I.describedBy);const ne=Z.length>0?Z.join(" "):void 0;return o.jsxs("div",{...ie(se("checkbox-input",{size:x}),G(k!=null&&hP.width(k),w),S,E),children:[o.jsxs("div",{ref:Y=>{I.interactionRef(Y)},...G(Ls.container,t&&Ls.containerLabelHidden,!l&&cP),children:[o.jsxs("div",{...G(Ls.checkboxWrapper,A7[x]),children:[o.jsx("input",{...z,ref:pn(A,X,I.positionRef),id:N,type:"checkbox",name:l?void 0:c,checked:q,disabled:l&&!B,"aria-disabled":B?"true":void 0,readOnly:d,required:p,onChange:Y=>{if(l||O||d)return;const ae=Y.target.checked;s==null||s(ae,Y),i&&!Y.defaultPrevented&&R(async()=>{T(ae),await i(ae,Y)})},onFocus:g,onBlur:y,"aria-readonly":d||void 0,"aria-describedby":ne,"aria-invalid":(m==null?void 0:m.type)==="error"?!0:void 0,"aria-busy":O||void 0,...G(Ls.input,A7[x],l&&Ls.inputDisabled)}),o.jsx("div",{"aria-hidden":"true",...ie(se("checkbox",{size:x,checked:q?"checked":D?"indeterminate":null,disabled:l?"disabled":null}),G(Ls.checkbox,uP[x],!l&&Ls.checkboxFocus,U?Ls.checkboxChecked:Ls.checkboxUnchecked,l&&Ls.checkboxDisabled,l&&!U&&Ls.checkboxDisabledUnchecked)),children:O?o.jsx(Tt,{size:"sm",shade:"inherit"}):o.jsxs(o.Fragment,{children:[o.jsx("svg",{viewBox:"0 0 10 10",...G(Ls.checkmark,dP[x],q&&Ls.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(Ls.indeterminateMark,fP[x],D&&Ls.indeterminateMarkVisible)})]})})]}),o.jsx("div",{className:"x78zum5 xdt5ytf x1lsbc85",children:o.jsx(Sm,{label:e,inputID:N,isLabelHidden:t,isDisabled:l,isOptional:f,isRequired:p,labelIcon:v,description:n,descriptionID:M})})]}),(m==null?void 0:m.message)&&o.jsx(t0,{type:m.type,message:m.message,id:$,variant:"detached"}),H&&I.renderTooltip(u)]})}n0.displayName="CheckboxInput";function ht({icon:e,...t}){return o.jsx(K,{...t,icon:e,isIconOnly:!0})}ht.displayName="IconButton";const M7={container:{kB7OPa:"x9f619",kZCmMZ:"x1c35znw",kwRFfy:"x64h4k7",kLKAdn:"x14m0hsi",kGO01o:"xc1wllq",$$css:!0}},pP={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}},xP={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}},gP={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}},mP={card:pP,section:xP,dialog:gP},vP={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}},yP={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}},kP={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}},bP={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}},wP={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}},jP={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}},SP={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}},CP={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}},EP={containerMaxHeight:e=>[{"--container-max-height":e!=null?"x18nyedi":e,$$css:!0},{"--x---container-max-height":e??void 0}]};function vE({padding:e="spacing4",paddingOuterX:t,paddingOuterY:n,paddingInnerX:s,paddingInnerY:i,useThemeDefault:r,maxHeight:a}){const l=t??e,c=n??e,u=s??e,d=i??e,f=a?EP.containerMaxHeight(a):null;if(r){const p=mP[r];return[M7.container,p.containerPaddingInlineStart,p.containerPaddingInlineEnd,p.containerPaddingBlockStart,p.containerPaddingBlockEnd,p.layoutPaddingOuterX,p.layoutPaddingOuterY,p.layoutPaddingInnerX,p.layoutPaddingInnerY,f]}return[M7.container,vP[l],yP[l],kP[c],bP[c],wP[l],jP[c],SP[u],CP[d],f]}const B2={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}},$P={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}},AP={none:{"--_card-elevation":"xw28qpl",$$css:!0},low:{"--_card-elevation":"x1nn8khe",$$css:!0},med:{"--_card-elevation":"x1ovzxg0",$$css:!0},high:{"--_card-elevation":"xnpe7fx",$$css:!0}},MP={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":(i=>typeof i=="number"?i+"px":i??void 0)(e),"--x-height":(i=>typeof i=="number"?i+"px":i??void 0)(t),"--x-maxWidth":(i=>typeof i=="number"?i+"px":i??void 0)(n),"--x-minHeight":(i=>typeof i=="number"?i+"px":i??void 0)(s)}]};function s0({width:e,height:t,maxWidth:n,minHeight:s,children:i,padding:r,variant:a="default",elevation:l="none",xstyle:c,className:u,style:d,ref:f,...p}){const x=t!=null&&t!=="auto",g=r==null,y=r??4,v=oC[y];return o.jsx("div",{ref:f,...ie(se("card",{variant:a}),G(B2.card,$P[a],AP[l],x&&B2.scrollable,MP.sizing(e??null,t??null,n??null,s??null),...vE(g?{useThemeDefault:"card"}:{paddingInnerX:v,paddingInnerY:v,paddingOuterX:v,paddingOuterY:v}),!g&&y!==4&&gf[y],!g&&y!==4&&mf[y],!g&&y!==4&&vf[y],!g&&y!==4&&yf[y],a==="default"&&B2.withBorder,c),u,d),...p,children:i})}s0.displayName="Card";const F0={base:{k1xSpc:"xjp7ctv",kMwMTN:"x1tgivj0",kMv6JI:"x9ynric",$$css:!0},light:{kQNsl9:"x19aimcq",$$css:!0},dark:{kQNsl9:"xntwwlm",$$css:!0},system:{kQNsl9:"x108lcm5",$$css:!0}},_y=fm.createContext(!1);_y.displayName="ThemeNestingContext";const H2=new Set;function TP(e){const t=h.useId();h.useInsertionEffect(()=>{if(e.__built)return;const n=`astryx-theme-${e.name}`;if(H2.has(n))return;D4(`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:i}=UD(e);if(!(!s&&!i)){if(s){const r=document.createElement("style");r.setAttribute(ei("theme-prose"),e.name),r.setAttribute(ei("id"),t),r.textContent=`@layer reset {
83
+ ${s}
84
+ }`,document.head.appendChild(r)}if(i){const r=document.createElement("style");r.setAttribute(ei("theme"),e.name),r.setAttribute(ei("id"),t),r.textContent=`@layer astryx-theme {
85
+ ${i}
86
+ }`,document.head.appendChild(r)}return H2.add(n),()=>{const r=document.querySelector(`style[${ei("theme-prose")}="${e.name}"][${ei("id")}="${t}"]`),a=document.querySelector(`style[${ei("theme")}="${e.name}"][${ei("id")}="${t}"]`);r==null||r.remove(),a==null||a.remove(),H2.delete(n)}}},[e,t])}function zP(e,t,n){no(()=>{if(!e&&!(typeof document>"u"))return t==="light"||t==="dark"?document.documentElement.setAttribute("data-theme",t):document.documentElement.removeAttribute("data-theme"),document.documentElement.setAttribute(ei("theme"),n),()=>{document.documentElement.removeAttribute("data-theme"),document.documentElement.removeAttribute(ei("theme"))}},[e,t,n])}function yE({theme:e,mode:t="system",children:n}){const s=h.use(_y);zD(e),TP(e),zP(s,t,e.name);const i=t==="dark"?F0.dark:t==="light"?F0.light:F0.system,r=h.useMemo(()=>({theme:e,mode:t}),[e,t]);return o.jsx(mm,{value:r,children:o.jsx(_y,{value:!0,children:o.jsx("div",{...G(F0.base,i),"data-astryx-theme":e.name,"data-theme":t==="system"?void 0:t,children:n})})})}yE.displayName="Theme";function kE({mode:e,children:t}){return o.jsx("div",{[ei("media")]:e,className:"xjp7ctv x1tgivj0",children:t})}kE.displayName="MediaTheme";const bE="--color-syntax-";function NP(e){return bE+e}const _P=Object.keys(B4).map(e=>e.replace(bE,""));function RP(e){const t={};for(const n of _P)t[NP(n)]=e.tokens[n];return t}const wE=h.createContext(null);wE.displayName="SyntaxThemeContext";function jE({theme:e,children:t}){const n=h.useMemo(()=>RP(e),[e]),s=h.useMemo(()=>({theme:e}),[e]);return o.jsx(wE,{value:s,children:o.jsx("div",{style:n,"data-astryx-syntax-theme":e.name,children:t})})}jE.displayName="SyntaxTheme";function SE({type:e,body:t,endContent:n,isAutoHide:s,autoHideDuration:i,isExiting:r=!1,onDismiss:a}){const l=Fe(),c=h.useRef(null),u=h.useRef(!1),d=h.useRef(i),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 S=Date.now()-f.current;d.current=Math.max(d.current-S,1e3)}},[s]),y=h.useCallback(()=>{!s||!u.current||(u.current=!1,x())},[s,x]);h.useEffect(()=>(d.current=i,x(),()=>{c.current&&clearTimeout(c.current)}),[i,x]),h.useEffect(()=>{if(s)return window.addEventListener("blur",g),window.addEventListener("focus",y),()=>{window.removeEventListener("blur",g),window.removeEventListener("focus",y)}},[s,g,y]);const v=h.useCallback(()=>{a("manual")},[a]),m=e==="error",{mode:k}=vm(),w=m||k==="light"?"dark":"light";return o.jsx("div",{role:m?"alert":"status","aria-live":m?"assertive":"polite","aria-atomic":"true",onMouseEnter:g,onMouseLeave:y,onFocusCapture:g,onBlurCapture:y,...ie(se("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|!!r<<0]),children:o.jsx(kE,{mode:w,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(K,{variant:"ghost",size:"sm",icon:o.jsx(Pe,{icon:"close",size:"sm",color:"inherit"}),label:l("@astryx.toast.dismiss"),onClick:v,isIconOnly:!0})]})]})})})}SE.displayName="Toast";const Em=h.createContext(null);Em.displayName="ToastContext";const Vf={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 Ry(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(Ry).filter(Boolean).join(" ");if(h.isValidElement(e)){const{children:t}=e.props;return Ry(t)}return""}function $m({position:e="bottomEnd",maxVisible:t=5,inset:n,isTopLayer:s=!0,children:i}){const r=Fe(),[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),y=h.useRef(null),v=h.useCallback(R=>{if(!R)return null;const _=R.querySelectorAll(oE);for(const T of _)if(!(T.getAttribute("tabindex")==="-1"||T.hasAttribute("disabled")||T.getAttribute("aria-disabled")==="true"))return T;return null},[]),m=iu(),k=h.useCallback(R=>{const{uniqueID:_,collisionBehavior:T="overwrite"}=R.options;if(_&&T==="ignore"&&d.current.some(H=>H.options.uniqueID===_))return;const O=Ry(R.options.body);O&&m(O,R.options.type==="error"?"assertive":"polite"),l(H=>_&&H.find(B=>B.options.uniqueID===_)?H.map(B=>B.options.uniqueID===_?R:B):[...H,R])},[m]),w=h.useCallback((R,_)=>{var B,I;if(p.current.has(R))return;p.current.add(R);const T=d.current.find(D=>D.id===R);T&&((I=(B=T.options).onHide)==null||I.call(B,_));const O=f.current,H=document.activeElement,L=(O==null?void 0:O.querySelector(`[data-toast-id="${R}"]`))??null;if(L&&H instanceof Node&&L.contains(H))if(g.current=R,d.current.filter(q=>q.id!==R).length>0){const q=d.current.findIndex(X=>X.id===R),U=d.current[q+1]??d.current[q-1];y.current=U?U.id:"restore"}else y.current="restore";u(D=>D.has(R)?D:new Set(D).add(R))},[]),S=h.useCallback(R=>{p.current.delete(R),u(_=>{if(!_.has(R))return _;const T=new Set(_);return T.delete(R),T}),l(_=>_.filter(T=>T.id!==R))},[]);h.useLayoutEffect(()=>{const R=g.current,_=y.current;if(R==null||_==null||a.some(H=>H.id===R))return;g.current=null,y.current=null;const T=f.current;if(_!=="restore"&&T){const H=T.querySelector(`[data-toast-id="${_}"]`),L=v(H)??H;if(L){L.focus();return}}const O=x.current;x.current=null,O&&O.isConnected?O.focus():T&&T.focus()},[a,v]);const E=h.useCallback(R=>d.current.find(_=>_.options.uniqueID===R),[]),A=h.useMemo(()=>({addToast:k,removeToast:w,findByUniqueID:E}),[k,w,E]),z=a.slice(-t),N={};n!=null&&n.top&&(N.top=n.top),n!=null&&n.bottom&&(N.bottom=n.bottom),n!=null&&n.start&&(N.insetInlineStart=n.start),n!=null&&n.end&&(N.insetInlineEnd=n.end),h.useEffect(()=>{if(!s)return;const R=f.current;if(R&&typeof R.showPopover=="function")try{R.showPopover()}catch{}},[s]);const M=a.length>0;h.useEffect(()=>{if(!M)return;const R=_=>{if(_.key!=="F6")return;const T=f.current;if(!T)return;const O=document.activeElement;if(O instanceof Node&&T.contains(O))return;_.preventDefault(),O instanceof HTMLElement&&(x.current=O);const H=T.querySelectorAll("[data-toast-id]"),L=H[H.length-1]??null;(v(L)??L??T).focus()};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[M,v]);const $=e==="topEnd"?Vf.topEnd:e==="topStart"?Vf.topStart:e==="bottomStart"?Vf.bottomStart:Vf.bottomEnd;return o.jsxs(Em,{value:A,children:[i,o.jsx("div",{ref:f,role:"region","aria-label":r("@astryx.toast.viewport"),tabIndex:-1,popover:s?"manual":void 0,...ie(G(Vf.viewport,$),{style:Object.keys(N).length>0?N:void 0}),children:z.map(R=>{const _=R.options,T=_.type??"info",O=_.isAutoHide??T!=="error",H=_.autoHideDuration??5e3,L=c.has(R.id);return o.jsx("div",{"data-toast-id":R.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"}}[!!L<<0],onTransitionEnd:L?B=>{B.propertyName==="grid-template-rows"&&S(R.id)}:void 0,children:o.jsx("div",{className:"xb3r6kr",children:o.jsx(SE,{type:T,body:_.body,endContent:_.endContent,isAutoHide:O,autoHideDuration:H,isExiting:L,onDismiss:B=>w(R.id,B)})})},R.id)})})]})}$m.displayName="ToastViewport";const T7='button, [role="button"]';function z7(e){return e.matches(T7)?e:e.querySelector(T7)}const da={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 CE({children:e,anchorRef:t,content:n,placement:s="below",alignment:i="start",isOpen:r,onOpenChange:a,isEnabled:l=!0,width:c,label:u,role:d="dialog",isModal:f,hasCloseButton:p,closeButtonLabel:x,hasAutoFocus:g,hasLightDismiss:y=!0,hasEscapeDismiss:v=!0,xstyle:m,className:k,style:w,"data-testid":S}){const E=h.useRef(null),A=r!==void 0,z=h.useRef(0),N=h.useCallback(()=>{a==null||a(!0)},[a]),M=h.useCallback(()=>{z.current=Date.now(),a==null||a(!1)},[a]),$=su({dialogLabel:u,role:d,isModal:f,hasLightDismiss:y,hasEscapeDismiss:v,hasCloseButton:p,closeButtonLabel:x,hasAutoFocus:g,onShow:N,onHide:M}),R=h.useCallback(()=>{l&&(Date.now()-z.current<50||$.toggle())},[l,$]),_=h.useCallback(L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),R())},[R]),T=h.useCallback(L=>{L.setAttribute("aria-haspopup",$.triggerProps["aria-haspopup"]),L.setAttribute("aria-expanded",String($.triggerProps["aria-expanded"])),L.setAttribute("aria-controls",$.triggerProps["aria-controls"]),L.addEventListener("click",R);const B=L.tagName!=="BUTTON"&&L.getAttribute("role")==="button";return B&&L.addEventListener("keydown",_),()=>{L.removeAttribute("aria-haspopup"),L.removeAttribute("aria-expanded"),L.removeAttribute("aria-controls"),L.removeEventListener("click",R),B&&L.removeEventListener("keydown",_)}},[$,R,_]);no(()=>{if(!t)return;const L=t.current;if(!L)return;const B=z7(L);if(B||Tc(),!B)return;$.triggerRef(L);const I=T(B);return()=>{$.triggerRef(null),I()}},[t,$,T]),no(()=>{if(t||typeof e=="function")return;const L=E.current;if(!L)return;$.triggerRef(L);const B=z7(L);if(B||Tc(),!B)return;const I=T(B);return()=>{$.triggerRef(null),I()}},[t,$,T]),no(()=>{A&&(r&&!$.isOpen?$.show():!r&&$.isOpen&&$.hide())},[r,A,$]);const O=c?da.customWidth(c):da.matchTrigger;if(t&&e==null)return o.jsx(o.Fragment,{children:$.render(o.jsx("div",{"data-testid":S,...ie(se("popover"),G(da.contentPadding,m),k,w),children:n}),{placement:s,alignment:i,xstyle:[O,da.gap,qo[s]]})});if(typeof e=="function"){const L={ref:$.triggerRef,onClick:R,"aria-haspopup":"dialog","aria-expanded":$.isOpen,"aria-controls":$.id};return o.jsxs(o.Fragment,{children:[e(L),$.render(o.jsx("div",{"data-testid":S,...ie(se("popover"),G(da.contentPadding,m),k,w),children:n}),{placement:s,alignment:i,xstyle:[O,da.gap,qo[s]]})]})}return o.jsxs(o.Fragment,{children:[o.jsx(J4,{value:"button",children:o.jsx("div",{ref:E,className:"x3nfvp2",children:e})}),$.render(o.jsx("div",{"data-testid":S,...ie(se("popover"),G(da.contentPadding,m),k,w),children:n}),{placement:s,alignment:i,xstyle:[O,da.gap,qo[s]]})]})}CE.displayName="Popover";const q2={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 IP(e){return e.hasAttribute("tabindex")?e.tabIndex>=0:["A","BUTTON","INPUT","SELECT","TEXTAREA"].includes(e.tagName)?!e.disabled:!!e.isContentEditable}function LP(e={}){const{placement:t="above",alignment:n="center",delay:s=300,hideDelay:i=200,focusTrigger:r="auto",isEnabled:a=!0,label:l,isOpen:c,isDefaultOpen:u=!1,onShow:d,onHide:f}=e,p=t==="above"||t==="below"?q2.marginBlock:q2.marginInline,x=kf({mode:"context",onShow:d,onHide:f}),g=h.useMemo(()=>[q2.container,p],[p]),y=h.useRef(null),v=h.useRef(null),m=h.useRef(null),k=h.useRef(!1),w=h.useRef(!1),S=h.useCallback(()=>{y.current&&(clearTimeout(y.current),y.current=null),v.current&&(clearTimeout(v.current),v.current=null)},[]),E=h.useCallback(()=>{!a||c===!1||(S(),y.current=setTimeout(()=>{x.show()},s))},[a,c,S,x,s]),A=h.useCallback(()=>{c!==!0&&(S(),v.current=setTimeout(()=>{k.current||x.hide()},i))},[c,S,x,i]),z=h.useCallback(()=>{E()},[E]),N=h.useCallback(()=>{A()},[A]),M=h.useCallback(()=>{if(a){if(w.current){w.current=!1;return}S(),x.show()}},[a,S,x]),$=h.useCallback(H=>{const L=H.relatedTarget,B=document.getElementById(x.id);B!=null&&B.contains(L)||A()},[x.id,A]),R=h.useCallback(H=>{H.key==="Escape"&&(H.stopPropagation(),S(),x.hide())},[S,x]),_=h.useCallback(H=>{m.current&&(m.current.removeEventListener("mouseenter",z),m.current.removeEventListener("mouseleave",N),m.current.removeEventListener("focusin",M),m.current.removeEventListener("focusout",$),m.current.removeEventListener("keydown",R)),H&&(H.addEventListener("mouseenter",z),H.addEventListener("mouseleave",N),(r==="always"||r==="auto"&&IP(H))&&(H.addEventListener("focusin",M),H.addEventListener("focusout",$)),H.addEventListener("keydown",R)),m.current=H},[r,z,N,M,$,R]),T=h.useCallback(H=>{x.ref(H),_(H)},[x,_]);h.useEffect(()=>()=>{S()},[S]),h.useEffect(()=>{u&&x.show()},[]),h.useEffect(()=>{c!==void 0&&(c?(S(),x.show()):(S(),x.hide()))},[c,S,x]);const O=h.useCallback((H,L)=>{const B=(L==null?void 0:L.placement)??t,I=se("hovercard").className,D={placement:B,alignment:(L==null?void 0:L.alignment)??n,role:l?"dialog":"group","aria-label":l||void 0,xstyle:[g,qo[B],L==null?void 0:L.xstyle],className:L!=null&&L.className?`${I} ${L.className}`:I,style:L==null?void 0:L.style,as:"span"};return x.render(o.jsx("span",{className:"x1lliihq x1vlblms xvmdzux x126nfab x1t818jl",onMouseEnter:()=>{k.current=!0,S()},onMouseLeave:()=>{k.current=!1,A()},onKeyDown:q=>{var U;q.key==="Escape"&&(q.stopPropagation(),w.current=!0,S(),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)||A()},children:H}),D)},[x,t,n,l,S,A,g]);return{ref:T,positionRef:x.ref,interactionRef:_,anchorId:x.anchorId,describedBy:x.id,renderHoverCard:O,show:x.show,hide:x.hide}}function OP(e){return typeof e=="string"||typeof e=="number"}function DP(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function EE({children:e,content:t,placement:n="above",alignment:s="center",delay:i=300,hideDelay:r=200,focusTrigger:a="auto",isEnabled:l=!0,label:c,onOpenChange:u,hasHoverIndication:d="auto",isOpen:f,isDefaultOpen:p,xstyle:x,className:g,style:y}){const v=h.useRef(null),m=OP(e),k=d===!0||d==="auto"&&m,w=h.useCallback(()=>{u==null||u(!0)},[u]),S=h.useCallback(()=>{u==null||u(!1)},[u]),E=LP({placement:n,alignment:s,delay:i,hideDelay:r,focusTrigger:a,isEnabled:l,label:c,isOpen:f,isDefaultOpen:p,onShow:w,onHide:S});no(()=>{if(m)return;const z=v.current;if(!z)return;const N=z.firstElementChild;if(!N)return;E.ref(N);const M=N.getAttribute("aria-describedby");return N.setAttribute("aria-describedby",DP(M,E.describedBy)??""),()=>{E.ref(null),M?N.setAttribute("aria-describedby",M):N.removeAttribute("aria-describedby")}},[m,E.ref,E.describedBy]);const A=E.renderHoverCard(t,{xstyle:x,className:g,style:y});return m?o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:E.ref,tabIndex:0,"aria-describedby":E.describedBy,...{0:{className:"xt0psk2"},1:{className:"xt0psk2 xujl8zx xev0dqp xycaml9 x11b3rvo"}}[!!k<<0],children:e}),A]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:v,className:"xjp7ctv",children:e}),A]})}EE.displayName="HoverCard";const N7=new Map,BP=/\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/,HP=/\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/,qP=/\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/,PP=/\b(important|inherit|initial|unset|revert|auto|none)\b/,UP=/\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/,FP=/\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 $E(e){const t=N7.get(e);if(t!==void 0)return t;const n=VP(e);return N7.set(e,n),n}function VP(e){const t=GP(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 GP(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:BP},{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:PP},{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:HP},{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:qP},{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:UP},{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:FP},{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 _7=2e3,WP=800;async function KP(){return typeof scheduler<"u"&&typeof scheduler.yield=="function"?scheduler.yield():new Promise(e=>setTimeout(e,0))}function AE(e,t,n,s){const i=[];let r=n;const a=Math.min(s,e.length);for(;r<a;){let l=!1;for(const c of t.patterns){c.anchored.lastIndex=r;const u=c.anchored.exec(e);if(u&&u.index===r&&u[0].length>0){c.type!==t.defaultType&&i.push({type:c.type,start:r-n,end:r-n+u[0].length}),r+=u[0].length,l=!0;break}}l||r++}return i}function XP(e,t){const n=$E(t);if(!n)return[];const s=[];let i=0;for(let r=0;r<=e.length;r++)(r===e.length||e[r]===`
87
+ `)&&(s.push(AE(e,n,i,r)),i=r+1);return s}async function ZP(e,t,n){const s=$E(t);if(!s)return[];const i=[];let r=0,a=0;for(let l=0;l<=e.length;l++)if((l===e.length||e[l]===`
88
+ `)&&(i.push(AE(e,s,r,l)),a+=l-r+1,r=l+1,a>=WP&&l<e.length)){if(n!=null&&n.aborted)return i;a=0,await KP()}return i}function YP(e,t){const n=[0];for(let r=0;r<t.length;r++)t[r]===`
89
+ `&&n.push(r+1);const s=Array.from({length:n.length},()=>[]);let i=0;for(const r of e){for(;i<n.length-1&&r.start>=n[i+1];)i++;const a=n[i];s[i].push({type:r.type,start:r.start-a,end:r.end-a})}return s}const QP=`:root {
90
+ ${Object.entries(B4).map(([e,t])=>` ${e}: ${t};`).join(`
91
+ `)}
92
+ }`,JP=`
93
+ ${QP}
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 R7=!1;function Am(){if(R7||typeof document>"u")return;const e=document.createElement("style");e.setAttribute("data-astryx-highlight-styles",""),e.textContent=JP,document.head.appendChild(e),R7=!0}const eU=["keyword","string","comment","number","function","type","tag","attribute","property","operator","constant","punctuation","variable"],I7=new Set(eU);let V0=null;function tU(e){if(I7.has(e)||(I7.add(e),Am(),typeof document>"u"))return;if(!V0){const s=document.createElement("style");if(s.setAttribute("data-astryx-highlight-dynamic",""),document.head.appendChild(s),V0=s.sheet??null,!V0)return}const t=`astryx-${e}`,n=`var(--color-syntax-${e}, currentColor)`;V0.insertRule(`.astryx-codeblock code::highlight(${t}), .astryx-codeeditor code::highlight(${t}) { color: ${n}; }`)}function nU(){const e=new Map;return t=>{let n=e.get(t);if(n)return n;tU(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 ME(e,t,n,s){if(t.length===0)return;const i=e.firstChild;if(!i||i.nodeType!==Node.TEXT_NODE)return;const r=i.length;for(const a of t){if(a.start>=r||a.end<=0)continue;const l=Math.min(a.start,r),c=Math.min(a.end,r),u=s(a.type);try{const d=new Range;d.setStart(i,l),d.setEnd(i,c),u.add(d),n.push({range:d,highlight:u})}catch{}}}function P2(e){for(const{range:t,highlight:n}of e)n.delete(t)}function sU(e,t,n,s){const i=[],r=e.querySelectorAll("[data-line]");for(let a=0;a<r.length;a++){const l=n+a,c=t[l];c&&c.length>0&&ME(r[a],c,i,s)}return i}function iU(e,t){Am();const n=nU(),s=[],i=[];let r=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),i.push(r),r+=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&&ME(f[p],x,d,n)}return()=>P2(d)}const a=new Map,l=new Map;function c(d,f){if(a.has(d))return;const p=sU(d,t,i[f],n);a.set(d,p)}function u(d){const f=a.get(d);f&&(P2(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())P2(f);a.clear()}}const rU={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}},oU={"--_codeblock-gutter-width":"xtk08jq",$$css:!0},t3={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=>[oU,{"--x---_codeblock-gutter-width":`${e}ch`!=null?`${e}ch`:void 0}]},Uo={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}},aU=20,lU=100,L7=h.memo(function({lines:t,startIndex:n,highlightSet:s,renderLineContent:i,lineNumbers:r}){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"}}[!!r<<1|!!((s==null?void 0:s.has(c+1))??!1)<<0],children:i(a,c)},c)})})});function TE(e,t,n,s,i=aU){if(i=Math.max(1,Math.floor(i)),e.length<lU)return o.jsx(L7,{lines:e,startIndex:0,highlightSet:t,renderLineContent:n,lineNumbers:s});const r=[];for(let a=0;a<e.length;a+=i){const l=Math.min(a+i,e.length),c=e.slice(a,l),u=`${c.length}lh`;r.push(o.jsx("div",{...ie({className:"xb5mbof"},{style:{containIntrinsicBlockSize:`auto ${u}`}}),children:o.jsx(L7,{lines:c,startIndex:a,highlightSet:t,renderLineContent:n,lineNumbers:s})},a))}return r}function zE(){return typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u"}function cU(){if(typeof navigator>"u")return!1;const e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}function uU(e,t,n){const[s,i]=h.useState(null),r=h.useMemo(()=>n?YP(n(e,t),e):e.length>=_7?null:XP(e,t),[e,t,n]);return h.useEffect(()=>{if(e.length<_7||n)return;const a=new AbortController;async function l(){try{const c=await ZP(e,t,a.signal);a.signal.aborted||i({code:e,language:t,tokens:c})}catch{a.signal.aborted||i({code:e,language:t,tokens:[]})}}return l(),()=>{a.abort()}},[e,t,n]),r??((s==null?void 0:s.code)===e&&s.language===t?s.tokens:[])}function dU(e,t){if(t.length===0)return e||"​";const n=[];let s=0;for(const i of t){i.start>s&&n.push(e.slice(s,i.start));const r=Math.min(i.end,e.length);n.push(o.jsx("span",{className:`astryx-token-${i.type} xds-token-${i.type}`,children:e.slice(i.start,r)},`${i.start}-${i.type}`)),s=r}return s<e.length&&n.push(e.slice(s)),n.length>0?n:"​"}function fU({lines:e,tokenLines:t,highlightSet:n,isWrapped:s,sizeStyle:i,hasLineNumbers:r,maxDigits:a}){h.useInsertionEffect(()=>{Am()},[]);const l=h.useCallback((c,u)=>{const d=t[u]??[];return o.jsx("span",{className:"xeuugli",children:dU(c,d)})},[t]);return o.jsx("code",{...G(Uo.code,i,s&&Uo.codeWrapped,r&&Uo.codeNumbered,r&&t3.gutterWidth(a)),children:TE(e,n,l,r)})}function hU({lines:e,tokenLines:t,highlightSet:n,isWrapped:s,sizeStyle:i,hasLineNumbers:r,maxDigits:a}){const l=h.useRef(null);h.useEffect(()=>{if(!zE())return;Am();const u=l.current;if(!(!u||t.length===0))return iU(u,t)},[t]);const c=h.useCallback(u=>u||"​",[]);return o.jsx("code",{ref:l,...G(Uo.code,i,s&&Uo.codeWrapped,r&&Uo.codeNumbered,r&&t3.gutterWidth(a)),children:TE(e,n,c,r)})}function i0({code:e,language:t="plaintext",title:n,hasLanguageLabel:s=!0,hasLineNumbers:i=!1,highlightLines:r,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:y,highlightMode:v="auto",syntaxTheme:m,xstyle:k,className:w,style:S,ref:E,...A}){const z=Fe(),[N,M]=h.useState(!1),$=h.useRef(null),R=iu();h.useEffect(()=>()=>{$.current!=null&&clearTimeout($.current)},[]);const _=v==="spans"||v==="auto"&&!zE()||v==="auto"&&cU(),T=h.useMemo(()=>{const je=e.split(`
138
+ `);return je.length>1&&je[je.length-1]===""&&je.pop(),je},[e]),O=uU(e,t,y),H=h.useMemo(()=>r?new Set(r):null,[r]),L=h.useCallback(async()=>{try{await navigator.clipboard.writeText(e),M(!0),R(z("@astryx.codeBlock.copied")),l==null||l(),$.current!=null&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,M(!1)},2e3)}catch{}},[e,l,R,z]),B=p==="sm"?Uo.sizeSm:Uo.sizeMd,I=String(T.length).length,D=s&&t!=="plaintext"?t:null,q=n!=null||D!=null,U=d&&T.length>=f,[X,Z]=h.useState(!1),ne=h.useId(),Y=h.useRef(null),ae=u?{maxHeight:typeof u=="number"?`${u}px`:u}:void 0,le=o.jsx(Pe,{icon:N?"check":"copy",size:"sm",color:"inherit"}),re=a?o.jsx("button",{type:"button",onClick:je=>{je.stopPropagation(),L()},"aria-label":z(N?"@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:le}):null,ge=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"}}[!!i<<0],children:[o.jsx("div",{role:U?"button":void 0,tabIndex:U?0:void 0,"aria-expanded":U?!X:void 0,"aria-controls":U?ne:void 0,onClick:U?()=>Z(je=>!je):void 0,onKeyDown:U?je=>{(je.key==="Enter"||je.key===" ")&&(je.preventDefault(),Z(we=>!we))}: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(Pe,{icon:"chevronRight",size:"xsm",color:"inherit"})}),n,n&&D?" — ":"",D]})}),re]}):null,be=o.jsx("div",{ref:Y,tabIndex:0,role:"group","aria-label":D??z("@astryx.codeBlock.code"),...ie({className:"xw2csxc x1odjw0f"},{style:ae}),children:o.jsx("div",{...{0:{className:"x78zum5 x1pshirs"},1:{className:"x78zum5 x1pshirs x1ajqlyv"}}[!!(q&&!i)<<0],children:_?o.jsx(fU,{lines:T,tokenLines:O,highlightSet:H,isWrapped:c,sizeStyle:B,hasLineNumbers:i,maxDigits:I}):o.jsx(hU,{lines:T,tokenLines:O,highlightSet:H,isWrapped:c,sizeStyle:B,hasLineNumbers:i,maxDigits:I})})}),me=o.jsxs("pre",{ref:E,...ie(se("codeblock",{size:p,language:t,container:g}),G(Uo.root,t3.width(x),rU[g],k),w,S),...A,children:[ge,U?o.jsx("div",{id:ne,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:be})}):be,!q&&re]});return m?o.jsx(jE,{theme:m,children:me}):me}i0.displayName="CodeBlock";const pU={base:{kMv6JI:"x9m5x89",kGuDYH:"xp03k98",kLWn49:"x15bjb6t",kWkggS:"xwmxj5m",kg3NbH:"x7a5moj",k8WAf4:"x1hp7d8q",kaIpWk:"xx3sua9",kHjlTd:"x1mzt3pk",kTgw9:"x13faqbe",$$css:!0}},xU={primary:{kMwMTN:"x1tgivj0",$$css:!0},secondary:{kMwMTN:"xv1l7n4",$$css:!0},inherit:{kMwMTN:"x1heor9g",$$css:!0}},gU={inherit:{kGuDYH:"x1qlqyl8",kLWn49:"x15bjb6t",$$css:!0}};function n3({children:e,color:t="primary",size:n,xstyle:s,className:i,style:r,ref:a,...l}){return o.jsx("code",{ref:a,...l,...ie(se("code",{color:t}),G(pU.base,xU[t],n&&gU[n],s),i,r),children:e})}n3.displayName="Code";const s3=h.createContext(null);s3.displayName="DialogContext";function mU(){return h.use(s3)}function vU(e,t=16){const n=e.getBoundingClientRect(),s=n.left+n.width/2-window.innerWidth/2,i=n.top+n.height/2-window.innerHeight/2,r=Math.sqrt(s*s+i*i)||1;return{x:Math.round(s/r*t),y:Math.round(i/r*t)}}const $l={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}},yU={ks0D6T:"x95b5qq",$$css:!0},kU={kogj98:"x1ghz6dp",$$css:!0},U2={sizing:(e,t)=>[yU,{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)=>[kU,{k87sOh:e!=null?"xjbys53":e,kLqNvP:t!=null?"x1lxsm33":t,kt4wiu:n!=null?"xqxgn94":n,krVfgx:s!=null?"x1nqzi6q":s,$$css:!0},{"--x-top":(i=>typeof i=="number"?i+"px":i??void 0)(e),"--x-insetInlineStart":(i=>typeof i=="number"?i+"px":i??void 0)(t),"--x-insetInlineEnd":(i=>typeof i=="number"?i+"px":i??void 0)(n),"--x-bottom":(i=>typeof i=="number"?i+"px":i??void 0)(s)}]};function G0(e){return typeof e=="number"?`${e}px`:e}function bU(e){const{top:t,bottom:n,start:s,end:i}=e;return{top:t!==void 0?G0(t):"auto",bottom:n!==void 0?G0(n):"auto",insetInlineStart:s!==void 0?G0(s):"auto",insetInlineEnd:i!==void 0?G0(i):"auto"}}function os({isOpen:e,isInline:t=!1,onOpenChange:n,width:s=400,maxHeight:i="75vh",position:r,variant:a="standard",purpose:l="info",padding:c,children:u,xstyle:d,className:f,style:p,ref:x,...g}){const y=c==null,v=c??4,m=oC[v],k=a==="fullscreen",w=h.useId(),S=h.useMemo(()=>({isInline:t,titleId:w}),[t,w]),E=g["aria-label"]!=null||g["aria-labelledby"]!=null,A=h.useRef(null),z=h.useCallback(I=>{if(A.current=I,!I||E)return;I.querySelector(`#${CSS.escape(w)}`)!=null?I.setAttribute("aria-labelledby",w):I.removeAttribute("aria-labelledby")},[w,E]),N=h.useRef(null),M=l!=="required",$=l==="info";h.useEffect(()=>{var D;if(t)return;const I=A.current;if(I)if(e){N.current=document.activeElement;const q=N.current;if(q&&q!==document.body){const U=vU(q);I.style.setProperty("--dialog-dir-x",`${U.x}px`),I.style.setProperty("--dialog-dir-y",`${U.y}px`)}else I.style.setProperty("--dialog-dir-x","0px"),I.style.setProperty("--dialog-dir-y","16px");if(!I.open){I.showModal();const U=I.querySelector("[data-autofocus]");U&&U.focus()}}else I.open&&I.close(),(D=N.current)==null||D.focus(),N.current=null},[e,t]),pE(e&&!t),h.useEffect(()=>{if(t)return;const I=A.current;if(!I||!e)return;const D=q=>{if(q.key==="Escape"){if(sE(q)||m7())return;q.preventDefault(),M&&n(!1)}};return I.addEventListener("keydown",D),()=>I.removeEventListener("keydown",D)},[e,t,M,n]);const R=h.useRef(!1);h.useEffect(()=>{var D;const I=((D=A.current)==null?void 0:D.querySelector(`#${CSS.escape(w)}`))!=null;e&&!t&&!E&&!I&&!R.current&&(R.current=!0,Tc())},[e,t,E,w]);const _=I=>{I.target===I.currentTarget&&$&&n(!1)},T=I=>{I.preventDefault(),!m7()&&M&&n(!1)},O=o.jsx("div",{...G($l.inner,...vE(y?{useThemeDefault:"dialog",maxHeight:k?void 0:typeof i=="number"?`${i}px`:i}:{paddingInnerX:m,paddingInnerY:m,paddingOuterX:m,paddingOuterY:m,maxHeight:k?void 0:typeof i=="number"?`${i}px`:i}),!y&&v!==4&&gf[v],!y&&v!==4&&mf[v],!y&&v!==4&&vf[v],!y&&v!==4&&yf[v]),children:o.jsx(s3,{value:S,children:u})}),H=r!=null&&!k,{open:L,...B}=g;return t?e?o.jsx("div",{...B,...ie(se("dialog",{variant:a}),G($l.inlineWrapper,!k&&U2.sizing(s,i),k&&$l.fullscreen,d),f,p),"data-testid":g["data-testid"],children:O}):null:o.jsx("dialog",{ref:pn(x,z),...B,...ie(se("dialog",{variant:a}),G($l.dialog,e&&$l.open,$l.backdrop,!k&&U2.sizing(s,i),H&&(()=>{const I=bU(r);return U2.position(I.top,I.insetInlineStart,I.insetInlineEnd,I.bottom)})(),k&&$l.fullscreen,d),f,p),onClick:_,onCancel:T,"aria-modal":"true",...l==="required"?{role:"alertdialog"}:void 0,children:O})}os.displayName="Dialog";const wU=h.lazy(async()=>ym(()=>Promise.resolve().then(()=>uE),void 0).then(e=>({default:e.Tooltip}))),jU={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"};function xn({level:e,type:t,accessibilityLevel:n,color:s="primary",display:i="block",maxLines:r=0,hasTruncateTooltip:a=!0,wordBreak:l,textWrap:c,justify:u="start",hasCapsize:d=!1,hasStrikethrough:f=!1,xstyle:p,className:x,style:g,children:y,ref:v,...m}){const k=jU[e],w=n&&n!==e?{"aria-level":n}:{},S=l??(r===1?"break-all":"break-word"),E=r>0||d?"block":i,A=TC({maxLines:r}),z=typeof a=="string"?a:"above",N=r>0&&a!==!1&&A.isTruncated,M=h.useRef(null),$=r>1?{WebkitLineClamp:r}:void 0;return o.jsxs(o.Fragment,{children:[o.jsx(k,{ref:pn(v,A.ref,M),...ie(se("heading",{level:e,color:s,...t&&{type:t}}),G(q4[zC(s)],t?P4[t]:lB[e],t&&wC[t],r===1?Xx.singleLine:r>1?Xx.multiLine:jC[E],r>0&&SC[S],c&&CC[c],u!=="start"&&AC[u],d&&EC.enabled,f&&$C.strikethrough,p),x,{...g,...$}),title:N?A.fullText:void 0,...w,...m,children:y}),N&&o.jsx(h.Suspense,{fallback:null,children:o.jsx(wU,{anchorRef:M,content:o.jsx("span",{...G(MC.content),children:A.fullText}),placement:z})})]})}xn.displayName="Heading";const SU={titleFocusable:{kI3sdo:"x1a2a7pz",$$css:!0}};function Ts({title:e,subtitle:t,onOpenChange:n,startContent:s,endContent:i,hasDivider:r,xstyle:a,className:l,style:c,ref:u,...d}){const f=Fe(),p=h.useRef(null),x=mU(),g=(x==null?void 0:x.isInline)!==!0,y=x==null?void 0:x.titleId;return h.useEffect(()=>{g&&p.current&&p.current.focus()},[g]),o.jsx(Wx,{ref:u,hasDivider:r,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(xn,{ref:p,id:y,level:2,tabIndex:-1,xstyle:SU.titleFocusable,children:e}),t&&o.jsx(W,{type:"body",size:"sm",color:"secondary",children:t})]}),(i||n)&&o.jsxs("div",{...{0:{className:"x78zum5 x6s0dn4 x1txdalj x2lah0s"},1:{className:"x78zum5 x6s0dn4 x1txdalj x2lah0s xhzvc8f x3kzqx6"}}[!!n<<0],children:[i,n&&o.jsx(K,{variant:"ghost",label:f("@astryx.dialog.close"),tooltip:f("@astryx.dialog.close"),icon:o.jsx(Pe,{icon:"close",color:"inherit"}),onClick:()=>{n==null||n(!1)},isIconOnly:!0})]})]})})}Ts.displayName="DialogHeader";const CU={scrollable:{kVQacm:"xysyzu8",$$css:!0}};function i3({direction:e="vertical",hAlign:t,vAlign:n,justify:s,align:i,gap:r,padding:a,paddingInline:l,paddingBlock:c,isScrollable:u,width:d,height:f,maxWidth:p,minHeight:x,wrap:g,as:y="div",xstyle:v,className:m,style:k,children:w,ref:S,...E}){const A=t??(e==="horizontal"?s:i),z=n??(e==="horizontal"?i:s),N=e==="horizontal"?A:z,M=e==="horizontal"?z:A,$=l??a,R=c??a,_=G(...jy({direction:e,crossAlign:M,mainAlign:N,gap:r,wrap:g}),$!=null&&mD[$],R!=null&&vD[R],u&&CU.scrollable,v),T={...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(y,{ref:S,...ie(se("stack",{direction:e,gap:r,wrap:g}),_,m,{...k,...T}),...E},w)}i3.displayName="Stack";function pe({ref:e,justify:t,align:n,hAlign:s,vAlign:i,...r}){return o.jsx(i3,{...r,direction:"horizontal",hAlign:s??t,vAlign:i??n,ref:e})}pe.displayName="HStack";function te({ref:e,justify:t,align:n,hAlign:s,vAlign:i,...r}){return o.jsx(i3,{...r,direction:"vertical",hAlign:s??n,vAlign:i??t,ref:e})}te.displayName="VStack";const W0={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}},EU={sizing:e=>[{kZKoxP:e!=null?"x16ye13r":e,$$css:!0},{"--x-height":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function jr({children:e,hasDivider:t,height:n,label:s,padding:i,role:r,xstyle:a,className:l,style:c,ref:u,...d}){const f=h.use(pm),p=t??(f==null?void 0:f.defaultHasDividers)??!1,x=i===0;return o.jsx("div",{ref:u,role:r,"aria-label":s,"data-divider":p||void 0,...ie(se("layout-footer"),G(W0.footer,EU.sizing(n??null),p&&W0.divider,a),l,c),...d,children:o.jsx("div",{...G(W0.inner,x&&W0.fullBleed,i!=null&&gf[i],i!=null&&mf[i],i!=null&&vf[i],i!=null&&yf[i]),children:e})})}jr.displayName="LayoutFooter";const NE=h.createContext({direction:"vertical"});NE.displayName="FormLayoutContext";const F2={container:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",$$css:!0},containerGap:{kOIVth:"xzye2dw",$$css:!0},horizontalLabels:{k1xSpc:"xjp7ctv",$$css:!0}},$U={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function ru({label:e,isLabelHidden:t=!1,description:n,inputID:s,labelID:i,isGroupLabel:r=!1,descriptionID:a,isOptional:l=!1,isRequired:c=!1,isDisabled:u=!1,labelIcon:d,status:f,labelTooltip:p,statusVariant:x="attached",width:g,xstyle:y,children:v,className:m,style:k,ref:w,...S}){const{direction:E}=h.use(NE),A=E==="horizontal-labels",z=a??(n?`${s}-desc`:void 0),N=(f==null?void 0:f.messageID)??(f!=null&&f.message?`${s}-status`:void 0);wf("Field","isOptional and isRequired are mutually exclusive. isOptional takes precedence.",l&&c);const M=o.jsx(Sm,{label:e,inputID:s,labelID:i,isGroupLabel:r,isLabelHidden:t,isDisabled:u,isOptional:l,isRequired:c,labelIcon:d,labelTooltip:p,description:A?void 0:n,descriptionID:A?void 0:z}),$=f!=null&&f.message&&x!=="tooltip"?o.jsx(t0,{type:f.type,message:f.message,id:N,variant:x}):null;return A?o.jsxs("div",{ref:w,...ie(se("field",{layout:"horizontal-labels"}),G(F2.horizontalLabels,y),m,k),...S,children:[o.jsx("div",{className:"x1enrzb7",children:M}),o.jsxs("div",{className:"x78zum5 xdt5ytf xc8icb0",children:[n&&o.jsx(W,{type:"supporting",display:"block",id:z,children:n}),v,$]})]}):o.jsxs("div",{ref:w,...ie(se("field"),G(F2.container,!t&&F2.containerGap,g!=null&&$U.width(g),y),m,k),...S,children:[M,x==="attached"?o.jsxs("div",{className:"x78zum5 xdt5ytf xc8icb0",children:[v,$]}):o.jsxs(o.Fragment,{children:[v,$]})]})}ru.displayName="Field";const ul={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}},Mm={warning:{kVAM5u:"x8wg1ba",$$css:!0},error:{kVAM5u:"x1ofxpqo",$$css:!0},success:{kVAM5u:"x16m2moy",$$css:!0}},Tm={warning:{kGVxlE:"x1gnnqk1 xnoa3fc",$$css:!0},error:{kGVxlE:"x1gnnqk1 xl68szm",$$css:!0},success:{kGVxlE:"x1gnnqk1 xig9bu2",$$css:!0}},_E={warning:{kVAM5u:"x8wg1ba xa1yw2k",$$css:!0},error:{kVAM5u:"x1ofxpqo xk2sxw7",$$css:!0},success:{kVAM5u:"x16m2moy xyq33ac",$$css:!0}},r3={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}},RE=h.createContext(null);RE.displayName="InputGroupContext";function o3(){return h.use(RE)}const AU={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}};function pt({type:e="text",label:t,isLabelHidden:n=!1,description:s,isOptional:i=!1,isRequired:r=!1,isDisabled:a=!1,disabledMessage:l,startIcon:c,status:u,statusVariant:d="attached",size:f,onChange:p,changeAction:x,isLoading:g=!1,value:y,placeholder:v,labelTooltip:m,hasClear:k=!1,hasAutoFocus:w=!1,htmlName:S,onEnter:E,onKeyDown:A,width:z,xstyle:N,className:M,style:$,ref:R,..._}){const T=Fe(),O=ml(f,"md"),H=h.useId(),L=h.useId(),B=h.useId(),I=h.useId(),D=h.useRef(null),q=h.useRef(null),U=o3(),[,X]=h.useTransition(),[Z,ne]=h.useOptimistic(y),Y=g||Z!==y,ae=a&&!!l,le=Fs({placement:"above",focusTrigger:"always",isEnabled:ae}),{statusIcon:re,describedBy:ge}=gE({status:u,statusVariant:d,isInGroup:!!U}),{ariaLabelledBy:be,ariaDescribedBy:me}=O4(L,[s?B:null,!U&&d!=="tooltip"&&(u!=null&&u.message)?I:null,ge,ae?le.describedBy:null],U),je=ke=>{if(a)return;const Ce=ke.target.value;p==null||p(Ce,ke),x&&!ke.defaultPrevented&&X(async()=>{ne(Ce),await x(Ce,ke)})},we=h.useCallback(()=>{var ke;p==null||p("",null),(ke=D.current)==null||ke.focus()},[p]),{onClick:ye,onMouseUp:J}=Q4({containerRef:q,inputRef:D,disabled:a}),Se=o.jsxs("div",{ref:ke=>{q.current=ke,le.ref(ke)},onClick:ye,onMouseUp:J,...ie(se("text-input",{size:O,status:(u==null?void 0:u.type)??null}),G(ul.base,AU[O],a&&ul.disabled,u&&Mm[u.type],u&&!a&&Tm[u.type],u&&_E[u.type],U&&r3.inGroup,N),M,$),children:[c&&Ji(c,{size:"sm",color:"secondary"}),U&&o.jsx(lo,{id:L,children:t}),o.jsx("input",{..._,ref:pn(R,D),id:H,name:S,type:e,value:Z,onChange:je,onKeyDown:E||A?ke=>{ke.key==="Enter"&&(E==null||E()),A==null||A(ke)}:void 0,placeholder:v,disabled:a&&!ae,"aria-disabled":ae?"true":void 0,readOnly:ae||void 0,autoFocus:w,"data-autofocus":w||void 0,"aria-describedby":me,"aria-required":r===!0?"true":void 0,"aria-invalid":(u==null?void 0:u.type)==="error"?"true":void 0,"aria-busy":Y||void 0,"aria-labelledby":be,...{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&&y!==""&&!a&&o.jsx("button",{type:"button",onClick:we,"aria-label":T("@astryx.textInput.clearLabel",{label:t}),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:o.jsx(Pe,{icon:"close",size:"sm",color:"secondary"})}),Y&&o.jsx(Tt,{size:"sm"}),re]});return U?o.jsxs(o.Fragment,{children:[Se,ae&&le.renderTooltip(l)]}):o.jsxs(ru,{label:t,isLabelHidden:n,description:s,inputID:H,descriptionID:s?B:void 0,isOptional:i,isRequired:r,isDisabled:a,status:u?{type:u.type,message:u.message,messageID:u.message?I:void 0}:void 0,statusVariant:d,labelTooltip:m,width:z,children:[Se,ae&&le.renderTooltip(l)]})}pt.displayName="TextInput";function Qx(e){return typeof e=="string"?!0:!("type"in e)}function Iy(e){return typeof e=="object"&&"type"in e&&e.type==="divider"}function Jx(e){return typeof e=="object"&&"type"in e&&e.type==="section"}function Va(e){return typeof e=="string"?{value:e,label:e}:{...e,label:e.label??e.value}}function IE(e){const t=[];for(const n of e)if(Qx(n))t.push(Va(n));else if(Jx(n))for(const s of n.options)t.push(Va(s));return t}function MU({isOpen:e,selectedItemIndex:t,listboxId:n,listboxRef:s,triggerRef:i}){const[r,a]=h.useState(0),[l,c]=h.useState(!1),u=h.useCallback((d,f)=>{a(d),c(f)},[]);return no(()=>{if(!e){u(0,!1);return}if(!s.current||!i.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(),y=i.current.getBoundingClientRect(),v=x.height;if(v<=0){u(0,!0);return}const m=g.top-x.top+g.height/2,w=y.top+y.height/2-m,S=window.innerHeight,E=Math.max(0,S-v),A=Math.min(Math.max(w,0),E),z=Math.max(0,y.bottom-A);u(z,!0)},[e,t,n,s,i,u]),{offset:r,isPositioned:l}}function TU({selectableItems:e,value:t,isDisabled:n=!1,isOpen:s,hasSearch:i=!1,onOpen:r,onClose:a,onSelect:l,onClear:c,listboxId:u}){const[d,f]=h.useState(-1),[p,x]=h.useState(""),g=h.useRef(void 0),y=h.useCallback(z=>`${u}-item-${z}`,[u]),v=h.useCallback(()=>e.map((z,N)=>z.disabled?-1:N).filter(z=>z>=0),[e]),m=h.useCallback(()=>e.findIndex(z=>z.value===t),[e,t]),k=h.useCallback(()=>{f(-1),a()},[a]),w=h.useCallback(z=>{z.disabled||(l==null||l(z.value),k())},[l,k]),S=h.useCallback(()=>{if(!n){if(s)k();else if(r(),!i){const z=m();f(z>=0?z:0)}}},[n,s,r,k,m,i]),E=h.useCallback((z,N)=>{z.disabled||f(N)},[]),A=h.useCallback(z=>{if(n)return;const N=v();switch(z.key){case"ArrowDown":if(z.preventDefault(),!s)r(),f(0);else{const M=N.indexOf(d),$=Math.min(M+1,N.length-1);f(N[$]??d)}break;case"ArrowUp":if(z.preventDefault(),!s)r(),f(e.length-1);else{const M=N.indexOf(d),$=Math.max(M-1,0);f(N[$]??d)}break;case" ":if(i)break;case"Enter":if(z.preventDefault(),s&&d>=0){const M=e[d];M&&!M.disabled&&w(M)}else if(!s&&(r(),!i)){const M=m();f(M>=0?M:0)}break;case"Escape":s&&(z.preventDefault(),k());break;case"Tab":s&&k();break;case"Home":z.preventDefault(),s&&N.length>0&&f(N[0]);break;case"End":z.preventDefault(),s&&N.length>0&&f(N[N.length-1]);break;case"PageUp":z.preventDefault(),s&&N.length>0&&f(N[0]);break;case"PageDown":z.preventDefault(),s&&N.length>0&&f(N[N.length-1]);break;case"Delete":case"Backspace":!i&&!s&&c!=null&&t!=null&&(z.preventDefault(),c());break;default:if(!i&&z.key.length===1&&!z.ctrlKey&&!z.metaKey){const M=p+z.key.toLowerCase();x(M),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{x("")},500);const $=e.findIndex(R=>{var _;return!R.disabled&&((_=R.label)==null?void 0:_.toLowerCase().startsWith(M))});$>=0&&(s||r(),f($))}break}},[n,s,r,k,e,d,w,m,v,p,i,c,t]);return{highlightedIndex:d,setHighlightedIndex:f,getItemId:y,onTriggerClick:S,onKeyDown:A,onItemSelect:w,onItemMouseEnter:E}}const zU={root:{k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kaIpWk:"x2u8bby",$$css:!0}};function LE({icon:e,label:t,description:n,endContent:s,xstyle:i,className:r,style:a}){return o.jsx(yl,{startContent:e?Ji(e,{size:"sm",color:"secondary"}):void 0,label:t,description:n,endContent:s,xstyle:[zU.root,i],...ie(se("selector-option"),{className:r,style:a})})}LE.displayName="SelectorOption";const or={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}},NU={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},_U={sm:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},md:{k8WAf4:"x1vofgu7",$$css:!0},lg:{$$css:!0}},O7={warning:"warning",error:"error",success:"success"},D7={warning:"warning",error:"error",success:"success"},RU={warning:"@astryx.input.statusButton.warning",error:"@astryx.input.statusButton.error",success:"@astryx.input.statusButton.success"};function IU({option:e}){return o.jsx(LE,{icon:e.icon,label:e.label??e.value})}function Ly(e,t){return t?(e.label??e.value).toLowerCase().includes(t.toLowerCase()):!0}function B7(e,t){return t?e.filter(n=>Ly(n,t)):e}function Ko(e){const t=Fe(),{label:n,isLabelHidden:s=!1,description:i,isOptional:r=!1,isRequired:a=!1,isDisabled:l=!1,disabledMessage:c,options:u,value:d,onChange:f,changeAction:p,isLoading:x=!1,placeholder:g,size:y,variant:v="input",status:m,statusVariant:k="attached",labelTooltip:w,startIcon:S,htmlName:E,renderOption:A,hasSearch:z=!1,searchPlaceholder:N,placement:M,isDefaultOpen:$=!1,"data-testid":R,width:_,xstyle:T,className:O,style:H,hasClear:L,...B}=e,I=g??t("@astryx.selector.placeholder"),D=N??t("@astryx.selector.searchPlaceholder"),q=L===!0,U=ml(y,"md"),X=v==="ghost"&&k==="attached"?"detached":k,Z=d===null?void 0:d,ne=h.useId(),Y=h.useId(),ae=h.useId(),le=h.useId(),re=h.useId(),ge=h.useId(),be=h.useRef(null),me=h.useRef(null),je=o3(),[we,ye]=h.useState(""),J=we.length>0,[,Se]=h.useTransition(),[ke,Ce]=h.useOptimistic(Z),Ee=x||ke!==Z,xe=l&&!!c,xt=Fs({placement:"above",focusTrigger:"always",isEnabled:xe}),st=Fs({placement:"above",isEnabled:X==="tooltip"&&!!(m!=null&&m.message)}),{ariaLabelledBy:Gt,ariaDescribedBy:Wt}=O4(re,[i?ae:null,!je&&X!=="tooltip"&&(m!=null&&m.message)?le:null,X==="tooltip"&&(m!=null&&m.message)?st.describedBy:null,xe?xt.describedBy:null],je),Jt=h.useMemo(()=>IE(u),[u]),_s=h.useMemo(()=>B7(Jt,we),[Jt,we]),Rt=h.useMemo(()=>Jt.findIndex(Te=>Te.value===ke),[Jt,ke]),Ke=h.useMemo(()=>Rt>=0?Jt[Rt]:void 0,[Jt,Rt]),Mn=h.useRef(null),P=iu(),F=h.useCallback(()=>{var Te;ye(""),P(""),(Te=be.current)==null||Te.focus()},[P]),Q=su({onHide:F,hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none"});h.useEffect(()=>{$&&Q.show()},[]);const de=h.useCallback(Te=>{if(ye(Te),Te.length===0){P("");return}const tn=B7(Jt,Te).length;P(tn===0?"No results found":`${tn} result${tn===1?"":"s"}`)},[P,Jt]),fe=M==null&&!z,{offset:$e,isPositioned:Ae}=MU({isOpen:Q.isOpen&&fe,selectedItemIndex:Rt,listboxId:Y,listboxRef:Mn,triggerRef:be}),Ue=fe?$e:0,St=fe?Ae:!0,He=M??"below",at=Ue>0?{marginBlockStart:`-${Ue}px`}:void 0,ln=h.useCallback(()=>{f==null||f(null),p&&Se(async()=>{Ce(void 0),await p(null)})},[f,p,Se,Ce]),{highlightedIndex:Le,getItemId:gt,onTriggerClick:Gs,onKeyDown:en,onItemSelect:It,onItemMouseEnter:Ti}=TU({selectableItems:_s,value:Z,isDisabled:l,isOpen:Q.isOpen,hasSearch:z,onOpen:h.useCallback(()=>{Q.show(),z&&requestAnimationFrame(()=>{var Te;(Te=me.current)==null||Te.focus()})},[Q,z]),onClose:Q.hide,onSelect:h.useCallback(Te=>{f==null||f(Te),p&&Se(async()=>{Ce(Te),await p(Te)})},[f,p,Se,Ce]),onClear:q?ln:void 0,listboxId:Y});h.useEffect(()=>{var Te,tn;!Q.isOpen||Le<0||(tn=(Te=document.getElementById(gt(Le)))==null?void 0:Te.scrollIntoView)==null||tn.call(Te,{block:"nearest"})},[Q.isOpen,Le,gt]);const oi=h.useCallback(Te=>{Te.stopPropagation(),ln()},[ln]),sr=h.useCallback(()=>z?o.jsx("div",{className:"x78zum5 x6s0dn4 xf314gf xu0wf1k",onKeyDown:Te=>{Te.target!==me.current&&Te.key==="Tab"&&!Te.shiftKey&&en(Te)},children:o.jsx(pt,{ref:me,id:ge,label:t("@astryx.selector.searchOptions"),isLabelHidden:!0,startIcon:"search",hasClear:!0,size:"sm",width:"100%",role:"combobox","aria-expanded":Q.isOpen,"aria-controls":Y,"aria-autocomplete":"list","aria-activedescendant":Q.isOpen&&Le>=0?gt(Le):void 0,value:we,onChange:de,onKeyDown:Te=>{if(Te.key==="ArrowDown"||Te.key==="ArrowUp"||Te.key==="PageUp"||Te.key==="PageDown"||Te.key==="Enter"||Te.key==="Escape"){en(Te);return}Te.key==="Tab"&&(Te.shiftKey||!J)&&en(Te)},placeholder:D})}):null,[z,ge,Y,we,J,D,de,en,Q.isOpen,Le,gt,t]),Rs=h.useCallback((Te,tn)=>{const bs=tn===Le,ue=Te.value===Z;return o.jsxs("div",{id:gt(tn),role:"option","aria-selected":ue,"aria-disabled":Te.disabled,onClick:()=>It(Te),onMouseEnter:()=>Ti(Te,tn),...G(or.item,_U[U],bs&&or.itemHighlighted,ue&&or.itemSelected,Te.disabled&&or.itemDisabled),children:[o.jsx("span",{className:"x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli",children:A?A(Te):o.jsx(IU,{option:Te})}),ue&&o.jsx(Pe,{icon:"check",size:"sm",color:"accent"})]},Te.value)},[A,Le,U,Z,gt,It,Ti]),Cr=h.useCallback(()=>{const Te=z&&!!we;if(Te&&_s.length===0)return[o.jsx("div",{role:"presentation",className:"x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib",children:"No results found"},"empty")];let tn=0;const bs=[];for(let ue=0;ue<u.length;ue++){const _e=u[ue];if(Iy(_e)){if(Te)continue;bs.push(o.jsx(Po,{xstyle:or.divider},`divider-${ue}`))}else if(Jx(_e)){const Ye=[];for(const Kt of _e.options){const cn=Va(Kt);Te&&!Ly(cn,we)||(Ye.push(Rs(cn,tn)),tn++)}if(Ye.length===0)continue;_e.title&&bs.push(o.jsx(Po,{label:_e.title,xstyle:or.sectionDivider},`section-divider-${ue}`)),bs.push(o.jsx("div",{role:"group","aria-label":_e.title,children:Ye},`section-${ue}`))}else if(Qx(_e)){const Ye=Va(_e);if(Te&&!Ly(Ye,we))continue;bs.push(Rs(Ye,tn)),tn++}}return bs},[u,Rs,z,we,_s]),ir=m!=null&&X!=="detached",ai=m!=null&&X==="tooltip"&&!!m.message,Er=o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:Te=>{Q.triggerRef(Te),xt.ref(Te)},onClick:Gs,"data-testid":R,...ie(se("selector",{variant:v,size:U,status:(m==null?void 0:m.type)??null}),G(ul.base,or.triggerContainer,NU[U],v==="ghost"&&or.triggerGhost,l&&ul.disabled,v==="ghost"&&l&&or.triggerGhostDisabled,!Ke&&or.triggerPlaceholder,v!=="ghost"&&m&&Mm[m.type],v!=="ghost"&&m&&!l&&Tm[m.type],v!=="ghost"&&je&&r3.inGroup,T),O,H),children:[S&&Ji(S,{size:"sm",color:"secondary"}),je&&o.jsx(lo,{id:re,children:n}),o.jsx("button",{ref:be,id:ne,type:"button",role:z?void 0:"combobox",...B,"aria-haspopup":"listbox","aria-expanded":Q.isOpen,"aria-controls":Y,"aria-activedescendant":!z&&Q.isOpen&&Le>=0?gt(Le):void 0,"aria-describedby":Wt,"aria-labelledby":Gt,"aria-required":a?"true":void 0,"aria-invalid":(m==null?void 0:m.type)==="error"?"true":void 0,"aria-busy":Ee||void 0,disabled:l&&!xe,"aria-disabled":xe?"true":void 0,onKeyDown:en,tabIndex:l&&!xe?-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:(Ke==null?void 0:Ke.label)??I})}),E!=null&&o.jsx("input",{type:"hidden",name:E,value:d??"",disabled:l}),Ee&&o.jsx(Tt,{size:"sm"}),q&&d!=null&&!l&&o.jsx("button",{type:"button",onClick:oi,"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(Pe,{icon:"close",size:"sm",color:"secondary",...se("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"}}[!!(!ir&&Q.isOpen)<<1|!!ir<<0],children:ir?ai?o.jsx("button",{ref:st.ref,type:"button","aria-label":t(RU[m.type]),"aria-describedby":st.describedBy,onClick:Te=>Te.stopPropagation(),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:o.jsx(Pe,{icon:O7[m.type],size:"sm",color:D7[m.type]})}):o.jsx(Pe,{icon:O7[m.type],size:"sm",color:D7[m.type]}):o.jsx(Pe,{icon:"chevronDown",size:"sm",color:"inherit",...se("selector-indicator-icon",{state:Q.isOpen?"expanded":"collapsed"})})})]}),Q.render(z?o.jsxs("div",{children:[sr(),o.jsx("div",{ref:Mn,id:Y,role:"listbox","aria-labelledby":ne,className:"x9f619 xuyqlj2 x1odjw0f x9epnlk x1hc1fzr x1ey1afo",children:Cr()})]}):o.jsx("div",{ref:Mn,id:Y,role:"listbox","aria-labelledby":ne,...{0:{className:"x9f619 xuyqlj2 x1odjw0f x9epnlk x1hc1fzr x1ey1afo"},1:{className:"x9f619 xuyqlj2 x1odjw0f x9epnlk xg01cxk xq2gx43"}}[!St<<0],children:Cr()}),{placement:He,alignment:"start",xstyle:[or.popover,qo[He]],style:at}),ai&&st.renderTooltip((m==null?void 0:m.message)??""),xe&&xt.renderTooltip(c)]});return je?Er:o.jsx(ru,{label:n,isLabelHidden:s,description:i,inputID:ne,descriptionID:i?ae:void 0,isOptional:r,isRequired:a,isDisabled:l,status:m?{type:m.type,message:m.message,messageID:m.message?le:void 0}:void 0,statusVariant:X,labelTooltip:w,width:_,children:Er})}Ko.displayName="Selector";var OE={exports:{}},zs={};/**
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 LU=h;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 fa(){}var Us={d:{f:fa,r:function(){throw Error(DE(522))},D:fa,C:fa,L:fa,m:fa,X:fa,S:fa,M:fa},p:0,findDOMNode:null},OU=Symbol.for("react.portal"),DU=Symbol.for("react.recoverable"),H7=Symbol.for("react.optimistic_key");function BU(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:OU,key:s==null?null:s===H7?H7:""+s,children:e,containerInfo:t,implementation:n}}var _h=LU.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function zm(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}zs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Us;zs.browser=function(e){return{$$typeof:DU,_reason:e}};zs.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(DE(299));return BU(e,t,null,n)};zs.flushSync=function(e){var t=_h.T,n=Us.p;try{if(_h.T=null,Us.p=2,e)return e()}finally{_h.T=t,Us.p=n,Us.d.f()}};zs.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Us.d.C(e,t))};zs.prefetchDNS=function(e){typeof e=="string"&&Us.d.D(e)};zs.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,s=zm(n,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,r=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Us.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:i,fetchPriority:r}):n==="script"&&Us.d.X(e,{crossOrigin:s,integrity:i,fetchPriority:r,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};zs.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=zm(t.as,t.crossOrigin);Us.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&&Us.d.M(e)};zs.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,s=zm(n,t.crossOrigin);Us.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})}};zs.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=zm(t.as,t.crossOrigin);Us.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 Us.d.m(e)};zs.requestFormReset=function(e){Us.d.r(e)};zs.unstable_batchedUpdates=function(e,t){return e(t)};zs.useFormState=function(e,t,n){return _h.H.useFormState(e,t,n)};zs.useFormStatus=function(){return _h.H.useHostTransitionStatus()};zs.version="19.3.1";function BE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(BE)}catch(e){console.error(e)}}BE(),OE.exports=zs;var Gd=OE.exports;const q7={popoverSurface:{k7Eaqz:"xfb3i0g",$$css:!0},popoverGap:{keoZOQ:"xcsaf9d",k1K539:"x14cgwvg",$$css:!0}};function HU(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 qU(e,t){for(let n=e.length-1;n>=0;n--){const s=e[n];if(s===" "||s===`
147
+ `)return null;for(const i of t)if(s===i.character){const r=n>0?e[n-1]:null;if(r===null||r===" "||r===`
148
+ `){const a=e.slice(n+1);return{trigger:i,query:a,triggerStart:n}}}}return null}function PU(e,t){const n=window.getSelection();if(!n||n.rangeCount===0)return;const s=n.getRangeAt(0),i=s.startContainer;if(i.nodeType!==Node.TEXT_NODE)return;const r=i.textContent??"",a=s.startOffset,l=r.slice(0,t),c=r.slice(a);i.textContent=l+c;const u=document.createRange();u.setStart(i,t),u.collapse(!0),n.removeAllRanges(),n.addRange(u)}function UU(e){const t=Fe(),{triggers:n,editableRef:s,onInsertToken:i,onInsertText:r,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)},[]),y=su({onHide:h.useCallback(()=>{g(),d($=>({...$,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 v=h.useCallback(()=>{var R,_;p.current&&(clearTimeout(p.current),p.current=null);const $=u.activeTrigger;$!=null&&$.searchSource&&((_=(R=$.searchSource).cancel)==null||_.call(R)),g(),y.hide(),f.current=-1},[y,u.activeTrigger,g]),m=h.useCallback(()=>{const $=s.current;if(!$)return;const R=window.getSelection();if(!R||R.rangeCount===0){y.triggerRef($);return}g();const _=R.getRangeAt(0).cloneRange();_.collapse(!0);const T=typeof _.getBoundingClientRect=="function"?_.getBoundingClientRect():null;if(!T||T.width===0&&T.height===0&&T.top===0&&T.left===0){y.triggerRef($);return}const O=document.createElement("span");O.setAttribute("aria-hidden","true"),O.setAttribute("data-astryx-trigger-anchor",""),O.style.position="fixed",O.style.left=`${T.left}px`,O.style.top=`${T.top}px`,O.style.width=`${Math.max(T.width,1)}px`,O.style.height=`${T.height}px`,O.style.pointerEvents="none",O.style.opacity="0",document.body.appendChild(O),x.current=O,y.triggerRef(O)},[s,y,g]),k=h.useCallback(($,R)=>{p.current&&(clearTimeout(p.current),p.current=null);const _=()=>{var T,O;if($.searchSource){(O=(T=$.searchSource).cancel)==null||O.call(T),d(L=>({...L,isLoading:!0}));const H=$.searchSource.search(R);Promise.resolve(H).then(L=>{d(B=>({...B,items:L,highlightedIndex:L.length>0?0:-1,isLoading:!1}))},()=>{d(L=>({...L,items:[],highlightedIndex:-1,isLoading:!1}))})}};$.searchSource&&($.searchSource.search("")instanceof Promise&&l>0?(d(H=>({...H,isLoading:!0})),p.current=setTimeout(_,l)):_())},[l]),w=h.useCallback($=>{const R=u.activeTrigger;if(!R)return;const _=s.current;if(!_)return;g(),PU(_,f.current);const T=R.onSelect($);typeof T=="string"?r(T):i(T),a(),v()},[u.activeTrigger,s,g,r,i,a,v]),S=h.useCallback(()=>{if(!n||n.length===0)return;const $=s.current;if(!$)return;const R=HU($);if(R===null){u.isActive&&v();return}const _=qU(R,n);if(!_){u.isActive&&v();return}const{trigger:T,query:O,triggerStart:H}=_;!u.isActive||u.activeTrigger!==T?(f.current=H,d(L=>({...L,isActive:!0,activeTrigger:T,query:O,highlightedIndex:0})),m(),k(T,O),y.show()):u.query!==O&&(d(L=>({...L,query:O})),k(T,O))},[n,s,u.isActive,u.activeTrigger,u.query,v,m,k,y]),E=h.useCallback($=>{if(!u.isActive||!y.isOpen)return!1;switch($.key){case"ArrowDown":return $.preventDefault(),d(R=>({...R,highlightedIndex:R.highlightedIndex<R.items.length-1?R.highlightedIndex+1:0})),!0;case"ArrowUp":return $.preventDefault(),d(R=>({...R,highlightedIndex:R.highlightedIndex>0?R.highlightedIndex-1:R.items.length-1})),!0;case"Enter":case"Tab":return u.highlightedIndex>=0&&u.highlightedIndex<u.items.length?($.preventDefault(),w(u.items[u.highlightedIndex]),!0):!1;case"Escape":return $.preventDefault(),v(),!0;default:return!1}},[u.isActive,u.highlightedIndex,u.items,y.isOpen,w,v]),A=h.useCallback($=>`${c}-option-${$}`,[c]);h.useEffect(()=>{if(!y.isOpen||u.highlightedIndex<0)return;const $=document.getElementById(A(u.highlightedIndex));$==null||$.scrollIntoView({block:"nearest"})},[u.highlightedIndex,y.isOpen,A]);const N=((n==null?void 0:n.length)??0)>0?u.isActive&&y.isOpen?{role:"combobox","aria-expanded":!0,"aria-controls":c,"aria-activedescendant":u.highlightedIndex>=0?A(u.highlightedIndex):void 0,"aria-haspopup":"listbox"}:{role:"combobox","aria-expanded":!1,"aria-haspopup":"listbox"}:{role:"textbox"},M=h.useCallback(()=>{const $=u.activeTrigger,R=($==null?void 0:$.emptySearchResultsText)??"No results",_=($==null?void 0:$.loadingText)??"Searching…";let T;if(u.isLoading)T=o.jsx("div",{role:"status",className:"x1b2ylru x2b8uid x141an7d xv1l7n4",children:_});else if(u.items.length===0&&u.isActive)T=o.jsx("div",{className:"x1b2ylru x2b8uid x141an7d xv1l7n4",children:R});else{const O=rD(u.items);let H=0;T=O.map(L=>{const B=L.items.map(I=>{const D=H++;return o.jsx("div",{id:A(D),role:"option","aria-selected":D===u.highlightedIndex,tabIndex:-1,onMouseDown:q=>{q.preventDefault(),w(I)},onMouseEnter:()=>d(q=>({...q,highlightedIndex:D})),...{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"}}[(D===u.highlightedIndex)<<0],children:$!=null&&$.renderItem?$.renderItem(I):o.jsx("span",{className:"x98rzlu xeuugli xb3r6kr xlyipyv xuxw1ft",children:I.label})},I.id)});return L.heading?o.jsxs("div",{role:"group","aria-label":L.heading,children:[o.jsx("div",{"aria-hidden":"true",className:"xf314gf x1xye8es xy143xn x141an7d x1ltkj2j xv1l7n4 x87ps6o",children:L.heading}),B]},`group-${L.heading}`):B})}return y.render(o.jsx("div",{id:c,role:"listbox","aria-label":($==null?void 0:$.menuLabel)??t("@astryx.chatTriggerMenu.suggestions"),...ie(se("trigger-menu"),{className:"x9f619 x1xiyphd x1odjw0f x9epnlk xfb3i0g"}),children:T}),{placement:"above",alignment:"start",xstyle:[q7.popoverSurface,q7.popoverGap]})},[y,c,u,w,A,t]);return{state:u,handleInput:S,handleKeyDown:E,renderMenu:M,reset:v,ariaProps:N}}function eg(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 Oy(e,t){const n=eg(e);if(!n||n.rangeCount===0)return!1;const s=n.getRangeAt(0);s.deleteContents();const i=document.createTextNode(t);return s.insertNode(i),s.setStartAfter(i),s.collapse(!0),n.removeAllRanges(),n.addRange(s),!0}function FU(e){return"render"in e&&typeof e.render=="function"}function VU(e){let t=e;for(;t;){if(t instanceof HTMLElement&&t.hasAttribute("data-astryx-token"))return t;t=t.parentNode}return null}function GU({editableRef:e,onEmitChange:t}){const[n,s]=h.useState([]),i=h.useCallback(u=>{const d=e.current;if(!d)return;const f=eg(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 y=document.createTextNode(" ");x.after(y);const v=document.createRange();return v.setStartAfter(y),v.collapse(!0),f.removeAllRanges(),f.addRange(v),s(m=>[...m,{id:g,span:x,token:u}]),g},[e]),r=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,y=p.parentNode;return y&&(y.removeChild(p),y.removeChild(g)),t(),!0}return!1},[t]),a=h.useCallback(u=>{const d=e.current;if(!d)return!1;const f=eg(d);if(!f||f.rangeCount===0)return!1;const p=f.getRangeAt(0),x=VU(p.startContainer);if(x){u.preventDefault();const g=u.clipboardData.getData("text/plain"),y=x.nextSibling,v=document.createRange();return y&&y.nodeType===Node.TEXT_NODE?v.setStartAfter(y):v.setStartAfter(x),v.collapse(!0),f.removeAllRanges(),f.addRange(v),Oy(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),y=p.nextSibling;(y==null?void 0:y.nodeType)===Node.TEXT_NODE&&y.textContent===" "&&y.remove(),p.replaceWith(g);const v=window.getSelection();if(v){const m=document.createRange();m.setStartAfter(g),m.collapse(!0),v.removeAllRanges(),v.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:i,handleKeyDown:r,handlePaste:a,cleanupPortals:c}}function WU(e){const t=e.split(`
149
+ `).length,n=e.length;return t>1?`${t} lines, ${n} chars`:`${n} chars`}function HE({text:e,onExpand:t}){const n=Fe(),s=WU(e),i=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(K,{label:n("@astryx.chat.pastedText.expand"),variant:"ghost",size:"sm",onClick:t})]})]});return o.jsx(EE,{content:i,placement:"above",alignment:"start",hasHoverIndication:!1,children:o.jsx(bf,{label:s,variant:"neutral"})})}HE.displayName="ChatPastedTextToken";function KU(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 XU({inputRef:e,threshold:t=200,toToken:n=KU}){return{onPaste:h.useCallback((i,r)=>{var l;if(r.length<=t)return!1;const a=n(r);return(l=e.current)==null||l.insertToken(a),!0},[e,t,n])}}const a3=h.createContext(null);a3.displayName="ChatMessageContext";function qE(){return h.use(a3)}const l3=h.createContext(null);l3.displayName="ChatListContext";function ZU(){return h.use(l3)}const c3=h.createContext(null);c3.displayName="ChatComposerContext";function PE(){return h.use(c3)}const u3=h.createContext(null);u3.displayName="ChatLayoutContext";function YU(){return h.use(u3)}const QU=22,P7={root:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kAzted:"xe0957l",$$css:!0},disabled:{kSiTet:"xbyyjgo",kfzvcC:"x47corl",$$css:!0}};function V2(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}function zu(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+=zu(n));return t}function d3(e){const t=Fe(),n=PE(),s=e.value!==void 0,{ref:i,handleRef:r,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:y,pasteAsToken:v,onFiles:m,onSubmit:k=n==null?void 0:n.onSubmit,onKeyDown:w,xstyle:S,className:E,style:A,...z}=e,N=x??t("@astryx.chat.composerInput.label"),M=c??(n==null?void 0:n.placeholder)??t("@astryx.chat.composer.placeholder"),$=n==null?void 0:n.onChange,R=h.useCallback(J=>{if(s){l==null||l(J);return}$==null||$(J),l!==$&&(l==null||l(J))},[$,s,l]),_=h.useRef(null),T=h.useRef(null),[O,H]=h.useState(!0),L=h.useRef([]),B=h.useRef(-1),I=h.useRef(""),D=h.useRef(void 0),q=h.useRef(()=>{}),U=h.useRef(()=>{}),X={insertToken:J=>q.current(J),expandToken:J=>ae.expandToken(J),insertText:J=>U.current(J),focus:()=>{var J;return(J=_.current)==null?void 0:J.focus()},getValue:()=>zu(_.current??document.createElement("div"))};T.current=X,h.useImperativeHandle(r,()=>X);const Z=n==null?void 0:n.inputControlRef;h.useEffect(()=>{if(Z)return Z.current={focus:()=>{var J;return(J=_.current)==null?void 0:J.focus()}},()=>{Z.current=null}},[Z]),h.useEffect(()=>{if(a===void 0||!_.current)return;if(a===D.current){D.current=void 0;return}const J=_.current;if(zu(J)!==a){D.current=void 0;const Se=document.activeElement===J;if(J.textContent=a,Se){const ke=window.getSelection();if(ke){const Ce=document.createRange();Ce.selectNodeContents(J),Ce.collapse(!1),ke.removeAllRanges(),ke.addRange(Ce)}}H(a.length===0)}else D.current=void 0},[a]);const ne=h.useRef(null),Y=h.useCallback(()=>{var Ee;if(!_.current)return;const J=zu(_.current),Se=_.current.querySelector("[data-astryx-token], [data-astryx-dictation-interim]")!=null,ke=J.trim().length===0&&!Se,Ce=ke?"":J;D.current=Ce,H(ke),R==null||R(Ce),(Ee=ne.current)==null||Ee.call(ne)},[R]),ae=GU({editableRef:_,onEmitChange:Y});ne.current=ae.cleanupPortals;const le=XU({inputRef:T}),re=v===!1?null:v??le,ge=h.useCallback(J=>{const Se=_.current;Se&&Oy(Se,J)},[]);q.current=ae.insertToken,U.current=ge;const be=UU({triggers:d,editableRef:_,onInsertToken:ae.insertToken,onInsertText:ge,onEmitChange:Y,debounceMs:f}),me=h.useCallback(()=>{Y(),be.handleInput()},[Y,be]),je=h.useCallback(J=>{if(!be.handleKeyDown(J)&&(w==null||w(J),!J.defaultPrevented)){if(J.key==="Backspace"){const Se=window.getSelection();if(Se&&Se.isCollapsed&&Se.rangeCount>0){const ke=Se.getRangeAt(0),{startContainer:Ce,startOffset:Ee}=ke;if(!(Ce.nodeType===Node.TEXT_NODE&&Ee===0&&Ce.previousSibling instanceof HTMLElement&&Ce.previousSibling.hasAttribute("data-astryx-token"))){if(Ce.nodeType===Node.TEXT_NODE&&Ce.textContent===" "&&Ee<=1&&Ce.previousSibling instanceof HTMLElement&&Ce.previousSibling.hasAttribute("data-astryx-token")){J.preventDefault();const xe=Ce.previousSibling,xt=Ce.parentNode;xt&&(xt.removeChild(Ce),xt.removeChild(xe)),Y();return}}}}if(J.key==="Enter"&&!J.shiftKey){if(J.nativeEvent.isComposing||J.nativeEvent.keyCode===229||(J.preventDefault(),!_.current))return;const Se=zu(_.current).trim();if(!Se)return;p&&(L.current.push(Se),B.current=-1,I.current=""),k==null||k(Se),_.current.textContent="",H(!0),R==null||R("");return}if(p&&(J.key==="ArrowUp"||J.key==="ArrowDown")){if(!_.current)return;const Se=zu(_.current),ke=L.current;if(ke.length===0)return;if(J.key==="ArrowUp"){B.current===-1&&(I.current=Se);const Ce=B.current===-1?ke.length-1:Math.max(0,B.current-1);B.current=Ce,_.current.textContent=ke[Ce],V2(_.current),Y(),J.preventDefault()}else if(J.key==="ArrowDown"&&B.current!==-1){const Ce=B.current+1;Ce>=ke.length?(B.current=-1,_.current.textContent=I.current,I.current&&V2(_.current)):(B.current=Ce,_.current.textContent=ke[Ce],V2(_.current)),Y(),J.preventDefault()}}}},[p,k,R,Y,be,w]),we=h.useCallback(J=>{const Se=_.current;if(!Se||(eg(Se),ae.handlePaste(J)))return;const ke=Array.from(J.clipboardData.files);if(ke.length>0){J.preventDefault(),m==null||m(ke);return}J.preventDefault();const Ce=J.clipboardData.getData("text/plain");if(re!=null&&re.onPaste(J,Ce)){Y();return}if(y==null?void 0:y(J,Ce)){Y();return}Oy(Se,Ce),Y()},[m,y,Y,ae,re]),ye=u*QU;return o.jsxs("div",{ref:i,...ie(se("chat-composer-input"),G(P7.root,g&&P7.disabled,S),E,A),...z,children:[O&&o.jsx("div",{className:"x10l6tqk x13vifvy x1o0tod xtijo5x x47corl xv1l7n4 xjm74w1 x6pjikd x19v9tvf x9ynric x87ps6o x9epnlk","aria-hidden":"true",children:M}),o.jsx("div",{ref:_,"aria-multiline":"true","aria-label":N,contentEditable:!g,suppressContentEditableWarning:!0,onInput:me,onKeyDown:je,onPaste:we,...be.ariaProps,...ie({className:"x1a2a7pz x126k92a x13faqbe x1odjw0f xjm74w1 x6pjikd x19v9tvf x9ynric x1tgivj0 xxugrtn x9epnlk"},{style:{maxHeight:`${ye}px`}})}),be.renderMenu(),ae.tokenPortals.filter(({span:J})=>J.isConnected).map(({id:J,span:Se,token:ke})=>Gd.createPortal(FU(ke)?o.jsx("span",{children:ke.render()},J):ke.value.length>(re===null?1/0:200)?o.jsx(HE,{text:ke.value,onExpand:()=>ae.expandToken(J)},J):o.jsx(bf,{label:ke.label,variant:ke.variant,icon:ke.icon},J),Se))]})}d3.displayName="ChatComposerInput";const JU={root:{kaIpWk:"xy0xnkn",kmuXW:"x2lah0s",$$css:!0}};function f3(e){const t=Fe(),n=PE(),{isStopShown:s=(n==null?void 0:n.isStopShown)??!1,isDisabled:i=!((n==null?void 0:n.canSend)??!1),onSend:r,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,y=r??(()=>n==null?void 0:n.onSubmit("")),v=Vd("stop"),m=Vd("arrowUp");return o.jsx(K,{ref:x,label:t(s?"@astryx.chatSendButton.stop":"@astryx.chatSendButton.send"),variant:s?"secondary":"primary",size:u,icon:s?c??v:l??m,isIconOnly:!0,isDisabled:!s&&i,onClick:s?a:y,...g,...se("chat-send-button"),className:f,style:p,xstyle:[JU.root,d]})}f3.displayName="ChatSendButton";const U7={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}},eF={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 UE(e){const t=Fe(),{ref:n,onSubmit:s,onStop:i,isStopShown:r=!1,value:a,onChange:l,placeholder:c,isDisabled:u=!1,density:d="balanced",elevation:f="low",drawer:p,headerActions:x,headerContext:g,input:y,footerActions:v,sendActions:m,sendButton:k,status:w,statusPosition:S="bottom",xstyle:E,className:A,style:z,...N}=e,M=c??t("@astryx.chat.composer.placeholder"),[$,R]=h.useState(""),_=a!==void 0,T=_?a:$,O=h.useCallback(X=>{_||R(X),l==null||l(X)},[_,l]),H=h.useCallback(()=>{const X=T.trim();!X||u||(s(X),O(""))},[T,u,s,O]),L=T.trim().length>0&&!u,B=h.useRef(null),I=h.useRef(null),D=h.useCallback(X=>{var Y;if(X.target.closest('button, a, [role="button"], [contenteditable="true"], [data-astryx-token]'))return;if(I.current){I.current.focus();return}const ne=(Y=B.current)==null?void 0:Y.querySelector('[contenteditable="true"], textarea');ne==null||ne.focus()},[]),q=w?o.jsxs("div",{role:w.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"}}[(S==="top")<<2|(w.type==="error")<<1|(w.type==="warning")<<0],children:[o.jsx(Pe,{icon:w.type==="error"?"error":"warning",size:"md",color:w.type==="error"?"error":"warning"}),w.message]}):null,U=h.useMemo(()=>({value:T,onChange:O,onSubmit:H,placeholder:M,isDisabled:u,isStopShown:r,canSend:L,onStop:i,inputControlRef:I}),[T,O,H,M,u,r,L,i]);return o.jsx(c3,{value:U,children:o.jsxs("div",{ref:n,...ie(se("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],A,z),...N,children:[S==="top"&&q,p,o.jsxs("div",{ref:B,onClick:D,...G(U7.body,eF[f],d==="compact"&&U7.compact,E),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:y??o.jsx(d3,{})}),o.jsxs("div",{className:"x78zum5 x6s0dn4 x1qughib x1txdalj x21xpn4",children:[o.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:v}),o.jsxs("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:[m,k??o.jsx(f3,{})]})]})]}),S==="bottom"&&q]})})}UE.displayName="ChatComposer";const tF={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 FE({ref:e,children:t,count:n,label:s,isCollapsed:i,defaultIsCollapsed:r=!1,onCollapsedChange:a,xstyle:l,className:c,style:u,"data-testid":d,...f}){const p=Fe(),x=s??p("@astryx.chat.composerDrawer.label"),[g,y]=h.useState(r),v=i!==void 0,m=v?i:g,k=n!=null,w=h.useId(),S=()=>{const E=!m;v||y(E),a==null||a(E)};return o.jsxs("div",{ref:e,"data-testid":d,...ie(se("chat-composer-drawer",{collapsed:m?"collapsed":null}),G(tF.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":w,"aria-label":m?p("@astryx.chatComposerDrawer.expand",{label:x}):p("@astryx.chatComposerDrawer.collapse",{label:x}),onClick:S,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),S())},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(bf,{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:w,...{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})})]})}FE.displayName="ChatComposerDrawer";const Gf={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}},nF={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 VE({children:e,emptyState:t,scrollToTopAction:n,density:s="balanced",gap:i,isStreaming:r=!1,xstyle:a,className:l,style:c,"data-testid":u,ref:d,...f}){const p=YU(),x=h.useRef(null),g=h.useRef(null),[y,v]=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 z;const E=(z=p==null?void 0:p.scrollContainerRef)==null?void 0:z.current;if(!n||!x.current)return;const A=new IntersectionObserver(N=>{var M;(M=N[0])!=null&&M.isIntersecting&&v(async()=>{await n()})},{root:E??null,threshold:0});return A.observe(x.current),()=>A.disconnect()},[n,p]);const k=h.useMemo(()=>({density:s}),[s]),w=s==="compact"?Gf.gapCompact:s==="spacious"?Gf.gapSpacious:Gf.gapBalanced,S=i==null?null:nF[i];return o.jsx(l3,{value:k,children:o.jsx("div",{...f,ref:d,role:"log","aria-live":"polite","aria-busy":r||void 0,tabIndex:0,"data-testid":u,...ie(se("chat-message-list",{density:s}),G(Gf.root,a),l,c),children:o.jsxs("div",{ref:g,...G(Gf.inner,w,S),children:[n&&o.jsx("div",{ref:x,"aria-hidden":!0}),y&&o.jsx("div",{className:"x78zum5 xl56j7k x8o8v82",children:o.jsx(Tt,{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]})})})}VE.displayName="ChatMessageList";const Yn={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 h3({sender:e,children:t,avatar:n,name:s,metadata:i,density:r,xstyle:a,className:l,style:c,"data-testid":u,ref:d,...f}){const p=Fe(),x=ZU(),g=r??(x==null?void 0:x.density)??"balanced",y=h.useMemo(()=>({sender:e,density:g}),[e,g]),v=g==="compact"?Yn.rootGapCompact:g==="spacious"?Yn.rootGapSpacious:Yn.rootGapBalanced,m=g==="compact"?Yn.childrenGapCompact:g==="spacious"?Yn.childrenGapSpacious:Yn.childrenGapBalanced,k=e==="system"?Yn.rootSystem:e==="user"?Yn.rootUser:Yn.rootAssistant,w=e==="system"?Yn.contentColumnSystem:e==="user"?Yn.contentColumnUser:Yn.contentColumnAssistant,S=e==="system"?Yn.childrenSystem:e==="user"?Yn.childrenUser:Yn.childrenAssistant,E=e==="system",A=n!=null&&!E,z=s!=null&&!E,N=h.useId();return o.jsx(a3,{value:y,children:o.jsxs("article",{...f,ref:d,"data-testid":u,"aria-label":z?void 0:p("@astryx.chatMessage.messageFrom",{sender:e}),"aria-labelledby":z?N:void 0,...ie(se("chat-message",{sender:e,density:g}),G(Yn.root,k,A&&v,a),l,c),children:[A&&o.jsx("div",{className:"x2lah0s x5du68j",children:n}),o.jsxs("div",{...G(Yn.contentColumn,w),children:[z&&o.jsx("div",{id:N,className:"x141an7d x2mo6ok xv1l7n4 x1ltkj2j x14cgwvg",children:s}),o.jsx("div",{...G(Yn.childrenWrap,S,m),children:t}),i!=null&&!E&&o.jsx("div",{children:i})]})]})})}h3.displayName="ChatMessage";const un={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 GE({children:e,variant:t="filled",name:n,metadata:s,group:i,xstyle:r,className:a,style:l,"data-testid":c,ref:u,...d}){const f=qE(),p=(f==null?void 0:f.sender)??"assistant",x=(f==null?void 0:f.density)??"balanced",g=x==="compact"?un.paddingCompact:x==="spacious"?un.paddingSpacious:un.paddingBalanced,y=p==="user",v=t==="ghost"?un.ghost:y?un.user:un.assistant,m=i==="first"?y?un.groupFirstUser:un.groupFirstAssistant:i==="middle"?y?un.groupMiddleUser:un.groupMiddleAssistant:i==="last"?y?un.groupLastUser:un.groupLastAssistant:null,k=x==="compact"?un.metadataPaddingCompact:x==="spacious"?un.metadataPaddingSpacious:un.metadataPaddingBalanced;return o.jsxs(o.Fragment,{children:[n&&o.jsx("div",{"data-chat-name":!0,...G(k,un.nameRow,un.headerReducedGap,y&&un.alignEnd),children:n}),o.jsx("div",{...d,ref:u,"data-testid":c,...ie(se("chat-message-bubble",{sender:p,variant:t,density:x}),G(un.content,x==="compact"&&un.radiusCompact,v,g,t==="ghost"&&un.paddingBlockNone,m,r),a,l),children:e}),s&&o.jsx("div",{...G(k,un.metadataReducedGap,y&&un.alignEnd),children:s})]})}GE.displayName="ChatMessageBubble";const sF={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"}},G2={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 p3({ref:e,timestamp:t,footer:n,status:s,xstyle:i,className:r,style:a,...l}){const c=Fe(),u=qE(),d=(u==null?void 0:u.sender)??"assistant",f=s!=null?sF[s]:null,p=f!=null?c(f.i18nKey):"";return t!=null||n!=null||f!=null?o.jsxs("div",{ref:e,...ie(se("chat-message-metadata"),G(G2.meta,d==="user"?G2.metaUser:G2.metaAssistant,i),r,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(Pe,{icon:f.icon,size:"xsm",color:"inherit"}),o.jsx("span",{children:p})]})]}):null}p3.displayName="ChatMessageMetadata";const F7={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 Dy({children:e,variant:t="default",icon:n,xstyle:s,className:i,style:r,ref:a,...l}){return t==="divider"?o.jsx("div",{ref:a,...ie(se("chat-system-message",{variant:t}),G(F7.dividerWrap,s),i,r),...l,role:"status",children:o.jsx(Po,{label:e})}):o.jsx("div",{ref:a,...ie(se("chat-system-message",{variant:t}),G(F7.root,s),i,r),...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]})})}Dy.displayName="ChatSystemMessage";const iF=1e3/60;function rF({scrollRef:e,enabled:t=!0,lockThreshold:n=10,buttonThreshold:s=100,damping:i=.7,stiffness:r=.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),y=h.useRef(void 0),v=h.useRef(0),m=h.useRef(0),k=h.useRef(0),w=h.useCallback(()=>{const T=e.current;if(!T||!f.current){g.current=!1,y.current=void 0,x.current=0;return}if(T.scrollHeight<=T.clientHeight){g.current=!1,y.current=void 0,x.current=0;return}const O=T.scrollHeight-T.clientHeight,H=O-T.scrollTop;if(Math.abs(H)<.5&&Math.abs(x.current)<.1){T.scrollTop=O,g.current=!1,y.current=void 0,x.current=0;return}const L=performance.now(),B=y.current?(L-y.current)/iF:1;y.current=L,x.current=(i*x.current+r*H)/a,T.scrollTop+=x.current*B,requestAnimationFrame(w)},[e,i,r,a]),S=h.useCallback(()=>{const T=e.current;T&&(g.current=!1,x.current=0,y.current=void 0,T.scrollTop=T.scrollHeight-T.clientHeight,v.current=T.scrollTop)},[e]),E=tu("(prefers-reduced-motion: reduce)"),A=h.useCallback(()=>{if(f.current){if(E){S();return}g.current||(g.current=!0,y.current=void 0,requestAnimationFrame(w))}},[w,S,E]),z=h.useCallback(T=>{if(f.current=!0,d(!0),c(!1),p.current=!1,(T==null?void 0:T.behavior)==="instant"){S();return}A()},[A,S]),N=h.useCallback(T=>{const O=e.current;if(!O)return;const H=O.getBoundingClientRect(),B=T.getBoundingClientRect().top-H.top+O.scrollTop;O.scrollTo({top:B,behavior:"instant"}),v.current=O.scrollTop},[e]),M=h.useCallback(()=>{const T=e.current;if(!T)return;const O=T.getElementsByClassName("astryx-chat-message"),H=O[O.length-1];H instanceof HTMLElement&&N(H)},[e,N]),$=h.useCallback(()=>{f.current=!0,d(!0),c(!1),A()},[A]),R=h.useCallback(()=>{f.current=!1,g.current=!1,d(!1)},[]),_=h.useCallback(()=>{if(!t||!f.current)return;const T=e.current;if(p.current&&T&&T.scrollHeight>T.clientHeight){p.current=!1,S();return}A()},[t,A,S,e]);return h.useEffect(()=>{const T=e.current;if(!T||!t)return;v.current=T.scrollTop,m.current=T.scrollHeight,k.current=T.offsetHeight;const O=()=>{const{scrollTop:I,scrollHeight:D,offsetHeight:q}=T,U=D-I-q;c(U>s);const X=D!==m.current,Z=q!==k.current;if(m.current=D,k.current=q,X||Z){v.current=I;return}const ne=I<v.current;v.current=I,ne&&f.current&&(f.current=!1,g.current=!1,d(!1))},H=()=>{T.scrollHeight-T.scrollTop-T.offsetHeight<=n&&(f.current=!0,d(!0))},L=I=>{I.deltaY<0&&g.current&&(f.current=!1,g.current=!1,d(!1))},B=()=>{g.current&&(f.current=!1,g.current=!1,d(!1))};return T.addEventListener("scroll",O,{passive:!0}),T.addEventListener("scrollend",H),T.addEventListener("wheel",L,{passive:!0}),T.addEventListener("touchmove",B,{passive:!0}),requestAnimationFrame(()=>{T.scrollHeight>T.clientHeight&&(T.scrollTop=T.scrollHeight-T.clientHeight,v.current=T.scrollTop,p.current=!1)}),()=>{T.removeEventListener("scroll",O),T.removeEventListener("scrollend",H),T.removeEventListener("wheel",L),T.removeEventListener("touchmove",B)}},[e,t,n,s]),{isScrolledUp:l,isLocked:u,scrollToBottom:z,scrollToMessage:N,lock:$,unlock:R,scrollIfLocked:_,scrollToLastMessage:M}}function oF({isLocked:e,onResize:t}){const[n,s]=h.useState(!1),i=h.useRef(null),r=h.useRef(e);r.current=e;const a=h.useRef(t);a.current=t;const l=h.useRef(null),c=h.useRef(null),u=h.useCallback(x=>{I4(x,()=>{var v;(v=a.current)==null||v.call(a);const g=x.getElementsByClassName("astryx-chat-message"),y=g.length>0?g[g.length-1]:null;y&&y!==i.current&&(i.current=y,r.current||s(!0))}),c.current=()=>L4(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 Oo={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}},WE={pending:"clock",running:null,complete:"check",error:"close"},KE={pending:Oo.colorPending,running:Oo.colorRunning,complete:Oo.colorComplete,error:Oo.colorError};function aF(e){return QO(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 V7({call:e}){const t=Fe(),n=e.status??"complete",s=e.resultDetail!=null,[i,r]=h.useState(!1),a=h.useId(),l=s?()=>r(u=>!u):void 0,c=o.jsxs("div",{role:s?"button":void 0,tabIndex:s?0:void 0,"aria-expanded":s?i:void 0,"aria-controls":s&&i?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(Oo.statusIcon,KE[n]),children:[n==="running"?o.jsx(Tt,{size:"sm",shade:"subtle"}):n==="pending"?o.jsx(Tt,{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(Pe,{icon:WE[n]??"check",size:"xsm",color:"inherit"})})]}),n==="error"&&e.errorMessage!=null&&o.jsx(lo,{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(bf,{label:e.node,variant:"neutral",xstyle:Oo.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"}}[!!i<<0],children:o.jsx(Pe,{icon:"chevronDown",size:"xsm",color:"inherit"})})]});return s?o.jsxs("div",{children:[c,i&&o.jsx("div",{id:a,className:"x1f43n9v x1wesfrj",children:e.resultDetail})]}):c}function XE(e){const t=Fe(),{calls:n,label:s,isExpanded:i,defaultIsExpanded:r,onExpandedChange:a,xstyle:l,className:c,style:u,ref:d,...f}=e,p=r??!1,[x,g]=h.useState(p),y=h.useId(),v=i!==void 0,m=v?i:x,k=h.useCallback(()=>{const E=!m;v||g(E),a==null||a(E)},[m,v,a]);if(n.length===0)return null;if(n.length===1)return o.jsx("div",{ref:d,...ie(se("chat-tool-calls"),G(Oo.root,l),c,u),...f,children:o.jsx(V7,{call:n[0]})});const w=n[n.length-1],S=w.status??"complete";return o.jsxs("div",{ref:d,...ie(se("chat-tool-calls"),G(Oo.root,l),c,u),...f,children:[o.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,"aria-controls":y,onClick:k,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.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(Pe,{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(Oo.statusIcon,KE[S]),children:S==="running"?o.jsx(Tt,{size:"sm",shade:"subtle"}):S==="pending"?o.jsx(Tt,{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(Pe,{icon:WE[S]??"check",size:"xsm",color:"inherit"})})]})}),o.jsx("span",{className:"x141an7d x1ltkj2j x9m5x89 x1e4wzip xv1l7n4 xuxw1ft xb3r6kr xlyipyv xs83m0k x13n9wmd",children:w.name}),w.target!=null&&o.jsx("span",{className:"x141an7d x1ltkj2j x9ynric xnbbluu xuxw1ft xb3r6kr xlyipyv x1g3ib7 xeuugli",children:w.target})]}),o.jsx("span",{className:"x3nfvp2 x6s0dn4 x1lsbc85 x141an7d x1ltkj2j x9ynric xnbbluu x2lah0s",children:!m&&o.jsxs(o.Fragment,{children:[o.jsx(Pe,{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(Pe,{icon:"chevronDown",size:"xsm",color:"inherit"})})]}),o.jsx("div",{id:y,...{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(E=>o.jsx(V7,{call:E},aF(E)))})})})]})}XE.displayName="ChatToolCalls";const W2={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 ZE({ref:e,isVisible:t,label:n,onClick:s,xstyle:i,className:r,style:a,...l}){const c=Fe();return o.jsx("div",{ref:e,...ie(G(W2.wrapper,i),r,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(K,{label:n??c("@astryx.chatLayoutScrollButton.scrollToBottom"),"aria-label":n??c("@astryx.chatLayoutScrollButton.scrollToBottom"),icon:o.jsx(Pe,{icon:"chevronDown",size:"md"}),variant:"ghost",size:"md",onClick:s,xstyle:[W2.button,n?W2.buttonWithLabel:null],children:n??void 0})})})}ZE.displayName="ChatLayoutScrollButton";const Qn={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 lF(e){return!(e==null||e===!1||Array.isArray(e)&&e.length===0)}function YE({children:e,composer:t,density:n="balanced",emptyState:s,scrollButton:i,scrollRef:r,xstyle:a,className:l,style:c,"data-testid":u,ref:d,...f}){const p=Fe(),x=h.useRef(null),g=r??x,y=!r,v=rF({scrollRef:g}),m=oF({isLocked:v.isLocked,onResize:v.scrollIfLocked}),k=o.jsx(ZE,{isVisible:v.isScrolledUp||m.hasNewMessages,label:m.hasNewMessages?p("@astryx.chatLayout.newMessages"):void 0,onClick:()=>{m.dismiss(),v.scrollToBottom()}}),w=h.useMemo(()=>({scrollContainerRef:g,contentRef:m.contentRef}),[g,m.contentRef]),S=!lF(e),A={compact:{messageArea:Qn.messageAreaCompact,blurLayer:Qn.blurLayerCompact,dock:Qn.dockCompact,dockInner:Qn.dockInnerCompact},balanced:{messageArea:Qn.messageAreaBalanced,blurLayer:Qn.blurLayerBalanced,dock:Qn.dockBalanced,dockInner:Qn.dockInnerBalanced},spacious:{messageArea:Qn.messageAreaSpacious,blurLayer:Qn.blurLayerSpacious,dock:Qn.dockSpacious,dockInner:Qn.dockInnerSpacious}}[n];return o.jsx(u3,{value:w,children:o.jsxs("div",{...f,ref:pn(d,x),"data-testid":u,...ie(se("chat-layout",{density:n}),G(Qn.root,y&&Qn.rootScrollable,a),l,c),children:[o.jsx("div",{...G(Qn.messageArea,A.messageArea),children:S&&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"}}[!!y<<0],children:[i===void 0?k:i,o.jsx("div",{...G(Qn.blurLayer,A.blurLayer)}),o.jsx("div",{...G(Qn.dock,A.dock),children:o.jsx("div",{...G(Qn.dockInner,A.dockInner),children:t})})]})]})})}YE.displayName="ChatLayout";const n1=h.createContext(null);n1.displayName="ListContext";const K2={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}},cF={kt6KFK:"x1khind5",$$css:!0},uF={counterStart:e=>[cF,{"--x-counterReset":`astryx-list ${e}`!=null?`astryx-list ${e}`:void 0}]};function wn({children:e,density:t="balanced",hasDividers:n=!1,header:s,listStyle:i="none",start:r,xstyle:a,className:l,style:c,"data-testid":u,ref:d}){const f=h.useId(),p=i==="decimal",x=p?"ol":"ul",g=h.useMemo(()=>({density:t,hasDividers:n,listStyle:i}),[t,n,i]),y=o.jsx(x,{ref:d,"data-testid":u,"aria-labelledby":s!=null?f:void 0,...p&&r!=null&&r!==1?{start:r}:{},role:"list",...ie(se("list",{density:t,listStyle:i}),G(K2.list,n&&K2.withDividers,i!=="none"&&(r!=null&&r!==1?uF.counterStart(r-1):K2.withCounter),a),l,c),children:e});return s==null?o.jsx(n1,{value:g,children:y}):o.jsx(n1,{value:g,children:o.jsxs("div",{className:"x78zum5 xdt5ytf",children:[o.jsx("div",{id:f,className:"x1p37lm5",children:s}),y]})})}wn.displayName="List";const dF=[];function x3({label:e,isLabelHidden:t=!1,description:n,status:s,value:i,onChange:r,changeAction:a,density:l="balanced",hasDividers:c=!1,isDisabled:u=!1,disabledMessage:d,isReadOnly:f=!1,children:p,ref:x,width:g,xstyle:y,className:v,style:m,"data-testid":k,...w}){const S=h.useId(),E=h.useId(),A=h.useId(),z=h.useId(),[,N]=h.useTransition(),M=i!==void 0,$=i??dF,[R,_]=h.useOptimistic($),[T,O]=h.useOptimistic(null),H=u&&!!d,L=Fs({placement:"above",focusTrigger:"always",isEnabled:H}),B=h.useCallback((D,q)=>{r==null||r(D),a&&N(async()=>{_(D),q!==void 0&&O(q),await a(D)})},[r,a,N,_,O]),I=h.useMemo(()=>({value:M?R:void 0,onChange:M?B:void 0,isDisabled:u,hasDisabledMessage:H,isReadOnly:f,loadingValue:T}),[M,R,B,u,H,f,T]);return o.jsxs(ru,{...w,ref:x,"data-testid":k,label:e,isLabelHidden:t,description:n,inputID:S,labelID:E,isGroupLabel:!0,descriptionID:n?A:void 0,isDisabled:u,status:s?{type:s.type,message:s.message,messageID:s.message?z:void 0}:void 0,statusVariant:"detached",width:g,xstyle:y,...ie(se("checkbox-list"),{className:v,style:m}),children:[o.jsx(Cm,{value:I,children:o.jsx("div",{ref:D=>{L.ref(D)},role:"group","aria-labelledby":E,"aria-describedby":[n?A:null,s!=null&&s.message?z:null,H?L.describedBy:null].filter(Boolean).join(" ")||void 0,children:o.jsx(wn,{density:l,hasDividers:c,children:p})})}),H&&L.renderTooltip(d)]})}x3.displayName="CheckboxList";const G7={withCounter:{kAmcRD:"xfrknyr",$$css:!0},withDivider:{kt9PQ7:"x92x3c3",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},fF={noRadius:{kaIpWk:"x2u8bby",$$css:!0}};function yt({label:e,description:t,startContent:n,endContent:s,onClick:i,interactiveRef:r,href:a,target:l,rel:c,isDisabled:u=!1,isSelected:d=!1,xstyle:f,className:p,style:x,ref:g,...y}){const v=h.use(n1),m=(v==null?void 0:v.density)??"balanced",k=(v==null?void 0:v.hasDividers)??!1,w=(v==null?void 0:v.listStyle)??"none",S=w!=="none",E=w==="disc"?o.jsx("span",{className:"xoi2r2e x9f619 x78zum5 x6s0dn4 xl56j7k x2lah0s x12xnipv x1233pnv",children:o.jsx("span",{className:"x1v4s8kt xols6we x16rqkct x19aspcf"})}):w==="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"})}):w==="decimal"?o.jsx("span",{className:"xoi2r2e x2lah0s x1tgivj0 xjm74w1 xw6l6zx x12xnipv xc2ndz5"}):null;return o.jsx(yl,{as:"li",ref:g,marker:E,startContent:n,label:e,description:t,endContent:s,onClick:i,interactiveRef:r,href:a,target:l,rel:c,isDisabled:u,isSelected:d,density:m,xstyle:[S&&G7.withCounter,k&&G7.withDivider,k&&fF.noRadius,f],...ie(se("list-item"),{className:p,style:x}),...y})}yt.displayName="ListItem";const hF={selected:{kWkggS:"xgcxg3y",$$css:!0}};function tg({label:e,"aria-label":t,value:n,description:s,endContent:i,isDisabled:r=!1,isLoading:a=!1,isChecked:l,onCheck:c,ref:u,xstyle:d,className:f,style:p,onClick:x,...g}){const y=Fe(),v=h.use(Cm);if(v&&v.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:y("@astryx.checkboxList.item.checkbox"));wf("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(n1),S=((k==null?void 0:k.density)??"balanced")==="compact"?"sm":"md",E=((v==null?void 0:v.isDisabled)??!1)||r,A=(v==null?void 0:v.isReadOnly)??!1,z=a||((v==null?void 0:v.loadingValue)!=null&&n!==void 0?v.loadingValue===n:!1);let N=!1;v&&v.value!==void 0&&n!==void 0?N=v.value.includes(n):l!==void 0&&(N=l);const M=!A&&(v!=null||c!=null),$=h.useRef(null),R=M||x!=null,_=()=>{var T,O;if(!(E||A||z))if(v&&v.value!==void 0&&n!==void 0)v.value.includes(n)?(T=v.onChange)==null||T.call(v,v.value.filter(L=>L!==n),n):(O=v.onChange)==null||O.call(v,[...v.value,n],n);else{const H=N!==!0;c==null||c(H)}};return o.jsx(yt,{...g,ref:u,label:e,description:s,endContent:i,isDisabled:E,interactiveRef:R?$:void 0,"aria-busy":z||void 0,xstyle:[N===!0&&!E&&!A&&hF.selected,d],className:f,style:p,startContent:o.jsx(n0,{ref:$,label:m,isLabelHidden:!0,value:N,onChange:()=>_(),onClick:x,isDisabled:E,isReadOnly:A,isLoading:z,size:S})})}tg.displayName="CheckboxListItem";const By=120;function pF(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??By:0;t+=u,s.push({key:l.key,proportion:u,minWidth:d})}}let i=0;if(t>0)for(const l of s){const c=l.minWidth*t/l.proportion;c>i&&(i=c)}const r=n+i,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??By;u.minWidth=`${f}px`}}a.set(l.key,{style:u})}return{columns:a,tableMinWidth:r}}function xF(e=1,t){return{type:"proportional",value:e,minWidth:(t==null?void 0:t.minWidth)??By}}function W7(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function gF(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 mF(e){return e==null?0:typeof e=="string"?e.length:typeof e=="number"||typeof e=="boolean"?String(e).length:0}function vF(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 i=0;i<=t.length;i++)i===t.length||t[i]===" "||t[i]===" "||t[i]===`
152
+ `?(s>n&&(n=s),s=0):s++;return n}const yF=60,kF=8;function bF(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(r=>{const a=W7(r).length;let l=a,c=a;for(const u of s){const d=mF(u[r]);d>l&&(l=d);const f=vF(u[r]);f>c&&(c=f)}return{key:r,headerLen:a,maxContentLen:l,maxWordLen:c}}).map(r=>{const a=r.maxContentLen<=6?1:r.maxContentLen<=15?2:3,l=Math.max(Math.max(r.headerLen,r.maxWordLen)*kF,yF);return{key:r.key,header:W7(r.key),width:xF(a,{minWidth:l})}})}const K7={x139im0d:"x139im0d",$$css:!0},QE={cell:{kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",ks0D6T:"x1m189uc",$$css:!0}},wF={cell:{kVQacm:"xb3r6kr",kHjlTd:"x1mzt3pk",kTgw9:"x13faqbe",ks0D6T:"x1m189uc",$$css:!0}},JE={compact:{kZCmMZ:"x5uh4xs",kwRFfy:"xbg7gas",$$css:!0},balanced:{kZCmMZ:"x9bi00s",kwRFfy:"xpilulx",$$css:!0},spacious:{kZCmMZ:"x18c6q21",kwRFfy:"x1wzlfcn",$$css:!0}},Nm=h.createContext(null);Nm.displayName="TableContext";const jF={row:{kWkggS:"x1dnou9g","--table-row-overlay":"x1rht92",$$css:!0}},SF={row:{kWkggS:"xe9uy6x","--table-row-overlay":"x1pkcbo2",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0}},CF={row:{kWkggS:"x1dnou9g xe9uy6x","--table-row-overlay":"x1rht92 x1pkcbo2",k1ekBW:"x15406qy",kIyJzY:"xuedmi6",kAMwcw:"xlr8y92",$$css:!0}};function ng({children:e,xstyle:t,ref:n,isHeaderRow:s=!1,...i}){const r=h.use(Nm);if(!r)return o.jsx("tr",{ref:n,...i,...ie(se("table-row"),G(K7,t)),children:e});const a=[];return s||(r.isStriped&&r.hasHover?a.push(CF.row):r.isStriped?a.push(jF.row):r.hasHover&&a.push(SF.row)),r.dividers==="rows"||r.dividers,t&&a.push(...t),o.jsx("tr",{ref:n,...i,...ie(se("table-row"),G(K7,...a)),children:e})}ng.displayName="TableRow";const K0={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 _m({children:e,menuWidth:t,size:n="md",label:s,isDisabled:i=!1,onOpenChange:r,ref:a,className:l,style:c,xstyle:u,triggerXstyle:d,"data-testid":f,...p}){const x=Fe(),g=s??x("@astryx.contextMenu.label"),{items:y,menuContent:v,...m}=p,k=y??[],w=v,S=h.useId(),E=h.useRef({x:0,y:0}),A=h.useRef(null),z=h.useRef(null),N=h.useRef(null),[M,$]=h.useState(!1),R=kf({mode:"context",onHide:h.useCallback(()=>{$(!1),r==null||r(!1);const le=N.current;N.current=null,le&&document.contains(le)&&le.focus()},[r]),onShow:h.useCallback(()=>{$(!0),r==null||r(!0)},[r]),lightDismiss:!1}),_=h.useCallback(()=>{R.hide()},[R]),{listRef:T,handleKeyDown:O,focusFirst:H,focusItem:L,ownsEvent:B,getItems:I}=nu({itemSelector:jm,boundarySelector:Z4,wrap:!1,onEscape:_}),D=K4({getItemLabels:()=>I().map(le=>le.textContent),onMatch:L,getCurrentIndex:()=>I().findIndex(le=>le===document.activeElement||le.contains(document.activeElement))});h.useEffect(()=>{if(!M)return;const le=re=>{const ge=T.current;ge&&!ge.contains(re.target)&&_()};return document.addEventListener("mousedown",le),()=>{document.removeEventListener("mousedown",le)}},[M,_,T]),h.useEffect(()=>{if(!M)return;const le=re=>{re.key==="Escape"&&(re.isComposing||re.keyCode===229||(re.preventDefault(),_()))};return document.addEventListener("keydown",le),()=>{document.removeEventListener("keydown",le)}},[M,_]);const q=h.useCallback(le=>{if(B(le)){if(le.key==="Enter"||le.key===" "){le.preventDefault();const re=document.activeElement;re&&wm.has(re.getAttribute("role")??"")&&re.click();return}if(le.key==="Tab"){_();return}if(D.onKeyDown(le)){le.preventDefault();return}O(le)}},[O,_,D,B]),U=h.useCallback((le,re,ge)=>{E.current={x:le,y:re};const be=A.current;be&&(be.style.left=`${le}px`,be.style.top=`${re}px`),N.current=document.activeElement instanceof HTMLElement?document.activeElement:ge,R.show(),requestAnimationFrame(()=>H())},[R,H]),X=h.useCallback(le=>{if(i)return;le.preventDefault();const re=z.current,ge=re==null?void 0:re.getBoundingClientRect(),be=le.clientX===0&&le.clientY===0&&le.detail===0,me=be||!ge?0:le.clientX-ge.left,je=be||!ge?(ge==null?void 0:ge.height)??0:le.clientY-ge.top;U(me,je,le.currentTarget)},[i,U]),Z=Zq({disabled:i,onLongPress:h.useCallback(le=>{var ge;const re=(ge=z.current)==null?void 0:ge.getBoundingClientRect();U(re?le.x-re.left:le.x,re?le.y-re.top:le.y,z.current)},[U])}),ne=t?K0.popoverCustomWidth(t):K0.popover,Y=h.useMemo(()=>({closeMenu:_,menuSize:n}),[_,n]),ae=y!==void 0?Y4(k):w;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:pn(a,z),onContextMenu:X,...Z,...m,"data-testid":f,...G(K0.trigger,...d?Array.isArray(d)?d:[d]:[]),children:[e,o.jsx("span",{ref:pn(A,R.ref),"aria-hidden":"true",...ie({className:"x10l6tqk xnalus7 xqtp20y x47corl"},{style:{left:`${E.current.x}px`,top:`${E.current.y}px`}})})]}),R.render(o.jsx("div",{ref:T,id:S,role:"menu","aria-label":g,onKeyDown:q,onContextMenu:le=>le.preventDefault(),...ie(se("context-menu"),G(K0.menu,u),l,c),children:o.jsx(e0,{value:Y,children:ae})}),{placement:"below",alignment:"start",xstyle:[ne,qo.below]})]})}_m.displayName="ContextMenu";function e$(e){const t=[],n=new Map;for(const i of e){const r=i.group??"__ungrouped__";let a=n.get(r);a||(a=[],n.set(r,a),t.push(r)),a.push(i)}const s=[];return t.forEach((i,r)=>{r>0&&s.push({type:"divider"});for(const a of n.get(i)??[])s.push({label:typeof a.label=="string"?a.label:a.id,icon:a.checked?o.jsx(Pe,{icon:"check",size:"xsm","aria-hidden":!0}):a.icon,isDisabled:a.disabled,onClick:a.onSelect})}),s}function EF({element:e,getActions:t,triggerXstyle:n}){const[s,i]=h.useState(null);return o.jsx(_m,{items:s??[],triggerXstyle:n,onOpenChange:r=>{i(r?e$(t()):null)},children:e})}function t$(e,t,n){return typeof t=="function"?o.jsx(EF,{element:e,getActions:t,triggerXstyle:n}):!t||t.length===0?e:o.jsx(_m,{items:e$(t),triggerXstyle:n,children:e})}function $F(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 n$(e,t){return t?Array.isArray(t)?[...e,...t]:[...e,t]:e}function s$(){return h.use(Nm)}const AF={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}},MF={compact:{kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0},balanced:{kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0},spacious:{kGuDYH:"xjm74w1",kB7OPa:"x9f619",$$css:!0}},TF={compact:{k8WAf4:"xu0wf1k",kg3NbH:"xf314gf",$$css:!0},balanced:{k8WAf4:"xce4md1",kg3NbH:"xrrkdod",$$css:!0},spacious:{k8WAf4:"x8o8v82",kg3NbH:"x1pzlopt",$$css:!0}},X7={fill:{k1xSpc:"x1lliihq",kB7OPa:"x9f619",kZKoxP:"x5yr21d",kzqmXN:"xh8yej3",$$css:!0}},zF={cell:{kZKoxP:"x5yr21d",$$css:!0}},NF={cell:{kt9PQ7:"x92x3c3 x1wp2rvj",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},_F={cell:{ke9TFa:"xw8tdv1 x1qlsc9e",k8ry5P:"x18b5jzi",kBCPoo:"x1gejf6u",$$css:!0}},RF={middle:{kXLuUW:"xxymvpz",$$css:!0},top:{kXLuUW:"x16dsc37",$$css:!0},bottom:{kXLuUW:"x3ajldb",$$css:!0}};function g3({children:e,xstyle:t,ref:n,className:s,style:i,contextMenuActions:r,...a}){const l=s$(),c=typeof r=="function"||Array.isArray(r)&&r.length>0,u=l?[c?MF[l.density]:AF[l.density],l.textOverflow==="truncate"?QE.cell:wF.cell,JE[l.density],RF[l.verticalAlign],...$F(l,NF.cell,_F.cell),...c?[zF.cell]:[]]:[],d=c&&l?[X7.fill,TF[l.density]]:c?X7.fill:void 0,f=t$(e,r,d);return o.jsx("td",{ref:n,...a,...ie(se("table-cell",{density:l==null?void 0:l.density}),G(...n$(u,t)),s,i),children:f})}g3.displayName="TableCell";const IF={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}},LF={cell:{k63SB2:"x2mo6ok",kMwMTN:"xv1l7n4",k9WMMc:"x1yc453h",$$css:!0}},OF={cell:{kt9PQ7:"x92x3c3",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},DF={cell:{ke9TFa:"xw8tdv1 x1qlsc9e",k8ry5P:"x18b5jzi",kBCPoo:"x1gejf6u",$$css:!0}};function m3({children:e,xstyle:t,ref:n,className:s,style:i,contextMenuActions:r,...a}){const l=s$(),c=[];l&&(c.push(LF.cell,IF[l.density],OF.cell,QE.cell,JE[l.density]),(l.dividers==="columns"||l.dividers==="grid")&&c.push(DF.cell));const u=t$(e,r);return o.jsx("th",{ref:n,...a,...ie(se("table-header-cell",{density:l==null?void 0:l.density}),G(...n$(c,t)),s,i),children:u})}m3.displayName="TableHeaderCell";function v3({ref:e,children:t,xstyle:n,className:s,style:i,...r}){return o.jsx("thead",{ref:e,...ie(se("table-header"),G(n),s,i),...r,children:t})}v3.displayName="TableHeader";function y3({ref:e,children:t,xstyle:n,className:s,style:i,...r}){return o.jsx("tbody",{ref:e,...ie(se("table-body"),G(n),s,i),...r,children:t})}y3.displayName="TableBody";const Z7={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 ro({title:e,description:t,icon:n,actions:s,headingLevel:i=3,isCompact:r=!1,xstyle:a,className:l,style:c,ref:u,...d}){const f=`h${i}`;return o.jsxs("div",{ref:u,role:"status",...ie(se("empty-state",{variant:r?"compact":null}),G(Z7.container,r&&Z7.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"}}[!!r<<0],e),t!=null&&o.jsx("div",{...{0:{className:"x1ghz6dp xjb2p0i xjm74w1 x1sodnla xw6l6zx xv1l7n4"},1:{className:"x1ghz6dp xjb2p0i x1sodnla xw6l6zx xv1l7n4 x141an7d"}}[!!r<<0],children:t})]}),s!=null&&o.jsx("div",{...{0:{className:"x78zum5 x1q0g3np x6s0dn4 x1txdalj xcsaf9d"},1:{className:"x78zum5 x6s0dn4 x1txdalj xcsaf9d xdt5ytf"}}[!!r<<0],children:s})]})}ro.displayName="EmptyState";const X2={table:{kzqmXN:"xh8yej3",kLvRdT:"x1mwwwfo",kheTzg:"x1gukg7c",kPzzVL:"x140o2bo",$$css:!0},tableAutoLayout:{kPzzVL:"x1drmoe9",$$css:!0}};function Jl(e,t,n,...s){return e.reduce((i,r,a)=>{const l=t(r);if(!l)return i;try{return l(i,...s)}catch(c){return rC("Table",`Plugin at index ${a} threw in transform:`,c),i}},n)}const BF=[];function HF(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 qF({item:e,rowIndex:t,rowKey:n,columns:s,plugins:i,textOverflow:r,RowComponent:a,CellComponent:l,ariaRowIndex:c}){const u=s.map((p,x)=>{var S;const g={};p.align&&(g.style={textAlign:p.align});const v=Jl(i,E=>E.transformBodyCell,{htmlProps:g,xstyle:[],columnIndex:x,columns:s},p,e,x,s),m=!p.renderCell,k=m?gF(e,p.key):((S=p.renderCell)==null?void 0:S.call(p,e))??null;let w;return m&&r==="truncate"&&typeof k=="string"&&k.length>0?w=o.jsx(W,{type:"body",maxLines:1,children:k}):w=k,o.jsx(l,{...v.htmlProps,contextMenuActions:v.contextMenuActions,xstyle:v.xstyle,children:w},p.key)}),d=Jl(i,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 PF(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,i=Object.keys(s);if(Object.keys(n).length!==i.length)return!1;for(const r of i)if(n[r]!==s[r])return!1;return!0}const UF=h.memo(qF,PF);function FF({data:e,columns:t,idKey:n,plugins:s,children:i,textOverflow:r="wrap",scrollWrapper:a,emptyState:l,rowIndexStart:c,rowCount:u,xstyle:d,className:f,style:p,ref:x,...g}){const y=Fe(),v=s??BF,m=c!=null||u!=null,k=c??1,w=m?u??-1:void 0,S=ng,E=g3,A=m3,z=t??(e?bF(e):[]),N=Jl(v,D=>D.transformColumns,z),M=h.useRef(N);HF(M.current,N)||(M.current=N);const $=M.current,R=pF($),_=Jl(v,D=>D.transformTable,{htmlProps:{},xstyle:i?[X2.table,X2.tableAutoLayout]:[X2.table]}),T=$.map((D,q)=>{var Se;const U=D.header??D.key,X={"data-column-key":D.key,scope:"col"};D.align&&(X.style={textAlign:D.align});const ne=Jl(v,ke=>ke.transformHeaderCell,{htmlProps:X,xstyle:[],content:U,columnIndex:q,columns:$},D,q,$),Y=((Se=R.columns.get(D.key))==null?void 0:Se.style)??{},ae=ne.htmlProps.style,le={...ne.htmlProps,style:ae?{...Y,...ae}:Y},re=ne.content??U,ge=typeof re=="string"&&re.length>0?{title:re}:{},{before:be,after:me,overlay:je,below:we}=ne,J=be!=null||me!=null||je!=null||we!=null?o.jsxs(o.Fragment,{children:[be,me!=null?o.jsxs("div",{className:"x3nfvp2 x6s0dn4 xzye2dw xeuugli",children:[re,me]}):re,je,we]}):re;return o.jsx(A,{...le,...ge,contextMenuActions:ne.contextMenuActions,xstyle:ne.xstyle,children:J},D.key)}),O=Jl(v,D=>D.transformHeaderRow,{htmlProps:{},xstyle:[],children:o.jsx(o.Fragment,{children:T})}),H=e!=null&&e.length>0,L=$.length>0,B={..._.htmlProps.style,...p,...R.tableMinWidth>0?{minWidth:`${R.tableMinWidth}px`}:null};let I=o.jsx("table",{ref:x,...w!=null?{"aria-rowcount":w}:null,..._.htmlProps,...ie(se("base-table"),G(..._.xstyle,d),[_.htmlProps.className,f].filter(Boolean).join(" ")||void 0,B),...g,children:i||o.jsxs(o.Fragment,{children:[L&&o.jsx(v3,{children:o.jsx(S,{...O.htmlProps,isHeaderRow:!0,xstyle:O.xstyle,children:O.children})}),o.jsx(y3,{children:H?e.map((D,q)=>{const U=n==null?q:typeof n=="function"?n(D):String(D[n]);return o.jsx(UF,{item:D,rowIndex:q,rowKey:U,columns:$,plugins:v,textOverflow:r,RowComponent:S,CellComponent:E,ariaRowIndex:m?k+q:void 0},U)}):e!=null&&l!==!1&&o.jsx("tr",{children:o.jsx("td",{colSpan:$.length,children:l??o.jsx(ro,{title:y("@astryx.table.noData"),isCompact:!0})})})})]})});if(a){const D=Jl(v,q=>q.transformScrollWrapper,{htmlProps:{},xstyle:[]});I=o.jsx(a,{htmlProps:D.htmlProps,xstyle:D.xstyle,beforeTable:D.beforeTable,afterTable:D.afterTable,children:I})}for(let D=v.length-1;D>=0;D--){const q=v[D];if(q.transformTableContext)try{I=q.transformTableContext(I)}catch(U){rC("Table","Plugin threw in transformTableContext:",U)}}return I}const i$=FF;i$.displayName="BaseTable";const r$=["columnSettings","sort","tree","selection","pagination"],Y7=new Map(r$.map((e,t)=>[e,t]));function VF(e){const t=r$.length;return e.sort(([n],[s])=>{const i=Y7.get(n)??t,r=Y7.get(s)??t;return i-r})}const X0=new Set(["transformColumns","transformTable","transformHeaderRow","transformHeaderCell","transformBodyRow","transformBodyCell","transformScrollWrapper","transformTableContext"]);function GF(e,t){const n=Object.keys(t);for(const i of n)X0.has(i)||Tc("Table",`Plugin "${e}" has unknown key "${i}". Valid keys: ${[...X0].join(", ")}. This key will be ignored.`);for(const i of n)if(X0.has(i)){const r=t[i];r!=null&&typeof r!="function"&&Tc()}n.some(i=>X0.has(i)&&typeof t[i]=="function")||Tc()}function WF(e,t){const n=h.useRef(null);if(n.current!=null){const r=n.current;if(r.basePlugins===e&&r.userPlugins===t)return r.result;if(r.basePlugins===e&&KF(r.userPlugins,t))return r.userPlugins=t,r.result}const s=t?VF(Object.entries(t)).map(([,r])=>r):[],i=[...e,...s];if(t)for(const[r,a]of Object.entries(t))GF(r,a);return n.current={basePlugins:e,userPlugins:t,result:i},i}function KF(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 i of n)if(e[i]!==t[i])return!1;return!0}const XF={base:{kMv6JI:"xjb2p0i",kMwMTN:"x1tgivj0",$$css:!0}},Q7={base:{kXHlph:"xw2csxc",kuHK5b:"x5lxg6s",$$css:!0},containerBleed:{keTefX:"xojxgvx",k71WvV:"x1fcf3bl",kzqmXN:"xx6qvi6",keoZOQ:"xkibk3",k1K539:"xlayyun",$$css:!0}};function ZF({children:e,htmlProps:t,xstyle:n,beforeTable:s,afterTable:i}){const r=Fe(),{ref:a,...l}=t??{};return o.jsxs("div",{ref:a,tabIndex:0,role:"group","aria-label":r("@astryx.table.label"),...l,...ie(se("table-scroll-wrapper"),G(Q7.base,Q7.containerBleed,...n??[])),children:[s,e,i]})}function YF(){return{transformTable(e){const t=e.htmlProps.className??"",n=se("table").className;return{...e,htmlProps:{...e.htmlProps,className:t?`${t} ${n}`:n},xstyle:[...e.xstyle,XF.base]}}}}function QF({density:e="balanced",dividers:t="rows",isStriped:n=!1,hasHover:s=!1,verticalAlign:i="middle",textOverflow:r="wrap",plugins:a,columns:l,data:c,ref:u,...d}){const f=h.useMemo(()=>YF(),[]),p=h.useMemo(()=>[f],[f]),x=WF(p,a),g=h.useMemo(()=>({density:e,dividers:t,isStriped:n,hasHover:s,verticalAlign:i,textOverflow:r}),[e,t,n,s,i,r]);return o.jsx(Nm,{value:g,children:o.jsx(i$,{ref:u,data:c,columns:l,plugins:x,textOverflow:r,scrollWrapper:ZF,...d})})}const o$=QF;o$.displayName="Table";function JF(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 eV(e,t,n,s){const i=t+e.length;if(n.length===0)return null;const r=n[0];if(i<=r)return null;const a=[];let l=t;l<r&&r<i&&(a.push({key:`settled-${s}`,text:e.slice(0,r-t),fading:!1}),l=r);for(let c=0;c<n.length;c++){const u=n[c],d=c+1<n.length?n[c+1]:i;if(u>=i||d<=l)continue;const f=Math.max(u,l),p=Math.min(d,i);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 Al={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 a$({ref:e,source:t,number:n,variant:s="label",xstyle:i,className:r,style:a,"data-testid":l,...c}){const u=Fe(),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,y=f?"a":"span",v=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(y,{...c,ref:k,role:v,"aria-label":u("@astryx.citation.label",{number:n,title:d}),"data-testid":l,...m,...ie(se("citation",{variant:s}),G(Al.number,f!=null&&Al.numberHover,f!=null&&Al.numberInteractive,i),r,a),children:n}):o.jsxs(y,{...c,ref:k,role:v,"aria-label":u("@astryx.citation.label",{number:n,title:d}),"data-testid":l,...m,...ie(se("citation",{variant:s}),G(Al.label,g&&Al.labelWithIcon,f!=null&&Al.labelHover,f!=null&&Al.labelInteractive,i),r,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?Ji(p,{size:"sm"}):o.jsx("img",{src:x,alt:"",className:"x1ad1g3v x9gl9lo"})}),o.jsx("span",{className:"xb3r6kr xlyipyv xuxw1ft xeuugli",children:d})]})}a$.displayName="Citation";const tV={sourceIds:void 0,autolink:void 0};function k3(e){if(e==null)return tV;if(typeof e.has=="function")return{sourceIds:e,autolink:void 0};const t=e;return{sourceIds:t.sourceIds,autolink:t.autolink}}const nV=/^ {0,3}\[([^\]^](?:\\.|[^\]\\])*)\]:[ \t]*(?:<([^<>\n]*)>|(\S+))([ \t]+(?:"[^"\n]*"|'[^'\n]*'|\([^()\n]*\)))?[ \t]*$/,sV=/^ {0,3}(?:"[^"\n]*"|'[^'\n]*'|\([^()\n]*\))[ \t]*$/;function s1(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function iV(e){const t=nV.exec(e);if(t==null)return null;const n=s1(t[1]),s=t[2]!=null?t[2]:t[3];return n===""||s==null?null:{label:n,destination:s,hasTitle:t[4]!=null}}function l$(e){const t=e.split(`
153
+ `),n=new Map,s=new Array(t.length).fill(!0);let i=!0,r=!1,a="";for(let c=0;c<t.length;c++){const u=t[c];if(r){u.startsWith(a)?(r=!1,a="",i=!0):i=!1;continue}const d=u.match(/^(`{3,}|~{3,})/);if(d){r=!0,a=d[1],i=!1;continue}if(u.trim()===""){i=!0;continue}if(i){const f=iV(u);if(f!=null){n.has(f.label)||n.set(f.label,f.destination),s[c]=!1,!f.hasTitle&&c+1<t.length&&sV.test(t[c+1])&&(s[c+1]=!1,c++);continue}}i=/^ {0,3}#{1,6}(?: |\t|$)/.test(u)||b3(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 rV(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 oV(e,t,n,s){const i=e.indexOf("]",t+1);if(i===-1)return null;const r=e.slice(t+1,i);if(e[i+1]==="["){const l=e.indexOf("]",i+2);if(l!==-1){const c=e.slice(i+2,l),u=c===""?r:c,d=n.get(s1(u));if(d!=null)return{node:{type:"link",href:d,children:$a(r,s)},end:l+1}}}if(r.trim()==="")return null;const a=n.get(s1(r));return a==null?null:{node:{type:"link",href:a,children:$a(r,s)},end:i+1}}function aV(e,t,n){const s=e.indexOf("]",t+2);if(s===-1)return null;const i=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===""?i:l,u=n.get(s1(c));if(u!=null)return{node:{type:"image",src:u,alt:i},end:a+1}}}if(i.trim()==="")return null;const r=n.get(s1(i));return r==null?null:{node:{type:"image",src:r,alt:i},end:s+1}}function J7(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 vu(e){return e==null?!1:/\w/.test(e)}function lV(e,t,n){if(!n.sourceIds||e[t]!=="【")return null;const s=e.indexOf("】",t+1);if(s===-1)return null;const i=e.slice(t+1,s);return i.length===0||!n.sourceIds.has(i)?null:{sourceId:i,end:s+1}}function cV(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 i=e.slice(t+1,s);return i.length===0||!n.sourceIds.has(i)?null:{sourceId:i,end:s+1}}function uV(e,t){return i1(e,k3(t))}function i1(e,t){const n=$a(e,t);return t.autolink==="gfm"?f$(n):n}function $a(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=lV(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=J7(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=aV(e,s,t.linkDefs);if(l){n.push(l.node),s=l.end;continue}}{const l=cV(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=J7(e,l+2);if(c!==-1){n.push({type:"link",href:e.slice(l+2,c),children:$a(e.slice(s+1,l),t)}),s=c+1;continue}}}if(t.linkDefs!=null&&e[s]==="["){const l=oV(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&&vu(e[s-1]))){const u=e.indexOf(l,s+3);if(u!==-1&&(!c||!vu(e[u+3]))){n.push({type:"bold",children:[{type:"italic",children:$a(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&&vu(e[s-1]))){const u=e.indexOf(l,s+2);if(u!==-1&&(!c||!vu(e[u+2]))){n.push({type:"bold",children:$a(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:$a(e.slice(s+2,l),t)}),s=l+2;continue}}if(e[s]==="*"||e[s]==="_"){const l=e[s]==="_";if(!(l&&vu(e[s-1]))){const c=e.indexOf(e[s],s+1);if(c!==-1&&c>s+1&&(!l||!vu(e[c+1]))){n.push({type:"italic",children:$a(e.slice(s+1,c),t)}),s=c+1;continue}}}let i=s+1;for(;i<e.length&&!"*_~`[!\\\n【".includes(e[i]);)i++;const r=e.slice(s,i);if(i<e.length&&e[i]===`
155
+ `){const l=r.replace(/ +$/,"");if(r.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=i+1;continue}}const a=n[n.length-1];(a==null?void 0:a.type)==="text"?a.content+=r:n.push({type:"text",content:r}),s=i}return n}const c$="[^\\s<]+",dV="https?:\\/\\/",u$="[A-Za-z0-9._%+-]+",e8="[A-Za-z0-9-]+",d$=`${e8}(?:\\.${e8})+`,fV="[a-zA-Z][a-zA-Z0-9+.-]*",hV="[^<>\\s]*",pV=new RegExp(`${dV}${c$}`,"g"),xV=new RegExp(`www\\.${c$}`,"g"),gV=new RegExp(`${u$}@${d$}`,"g"),mV=new RegExp(`<(${fV}:${hV})>`,"g"),vV=new RegExp(`<(${u$}@${d$})>`,"g"),t8=new Set("?!.,:*_~"),yV=new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._%+-@");function n8(e){let t=e;for(;t.length>0;){if(t8.has(t[t.length-1])){let n=t.length-1;for(;n>0&&t8.has(t[n-1]);)n--;t=t.slice(0,n);continue}if(t.endsWith(")")){let n=0,s=0;for(let i=0;i<t.length;i++)t[i]==="("?n++:t[i]===")"&&s++;if(s>n){t=t.slice(0,-1);continue}}break}return t}const kV=new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/=");function s8(e){return e==null?!0:!kV.has(e)}function bV(e){const t=[];{const i=new RegExp(mV.source,"g");let r;for(;(r=i.exec(e))!==null;){const a=r[1];t.push({start:r.index,end:r.index+r[0].length,href:a,display:a})}}{const i=new RegExp(vV.source,"g");let r;for(;(r=i.exec(e))!==null;){const a=r[1];t.push({start:r.index,end:r.index+r[0].length,href:`mailto:${a}`,display:a})}}{const i=new RegExp(pV.source,"g");let r;for(;(r=i.exec(e))!==null;){const a=e[r.index-1];if(!s8(a)||e.slice(r.index-2,r.index)==="](")continue;const l=n8(r[0]);l.length!==0&&t.push({start:r.index,end:r.index+l.length,href:l,display:l})}}{const i=new RegExp(xV.source,"g");let r;for(;(r=i.exec(e))!==null;){const a=e[r.index-1];if(!s8(a)||e.slice(r.index-3,r.index)==="://")continue;const l=n8(r[0]);l.length!==0&&t.push({start:r.index,end:r.index+l.length,href:`http://${l}`,display:l})}}{const i=new RegExp(gV.source,"g");let r;for(;(r=i.exec(e))!==null;){const a=e[r.index-1];a!=null&&yV.has(a)||e.slice(Math.max(0,r.index-7),r.index)!=="mailto:"&&t.push({start:r.index,end:r.index+r[0].length,href:`mailto:${r[0]}`,display:r[0]})}}t.sort((i,r)=>i.start-r.start);const n=[];let s=0;for(const i of t)i.start>=s&&(n.push(i),s=i.end);return n}function wV(e){const t=bV(e);if(t.length===0)return[{type:"text",content:e}];const n=[];let s=0;for(const i of t)i.start>s&&n.push({type:"text",content:e.slice(s,i.start)}),n.push({type:"link",href:i.href,children:[{type:"text",content:i.display}]}),s=i.end;return s<e.length&&n.push({type:"text",content:e.slice(s)}),n}function f$(e){const t=[];for(const n of e)if(n.type==="text"){const s=wV(n.content);for(const i of s){const r=t[t.length-1];i.type==="text"&&(r==null?void 0:r.type)==="text"?r.content+=i.content:t.push(i)}}else n.type==="bold"||n.type==="italic"||n.type==="strikethrough"?t.push({...n,children:f$(n.children)}):t.push(n);return t}function Z2(e){let t=0;for(;t<e.length&&e[t]===" ";)t++;return t}function b3(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 i=1;i<n.length;i++)if(n[i]!==s)return!1;return!0}function Bp(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 jV(e){return!!(/^#{1,6} /.test(e)||/^(`{3,}|~{3,})/.test(e)||b3(e)||e.startsWith("> ")||e===">"||/^ {0,9}[-*+] /.test(e)||/^ {0,9}0*1[.)] /.test(e)||e.includes("|"))}function Y2(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),i=[];let r="";for(let a=0;a<s.length;a++)s[a]==="\\"&&a+1<s.length&&s[a+1]==="|"?(r+="\\|",a++):s[a]==="|"?(i.push(r.trim()),r=""):r+=s[a];return i.push(r.trim()),i}function SV(e,t,n){const s=Y2(e[t]).map(l=>({children:i1(l,n)})),i=Y2(e[t+1]).map(l=>{const c=l.trim(),u=c.startsWith(":"),d=c.endsWith(":");return u&&d?"center":d?"right":u?"left":null}),r=[];let a=t+2;for(;a<e.length&&e[a].includes("|")&&e[a].trim()!=="";)r.push(Y2(e[a]).map(l=>({children:i1(l,n)}))),a++;return{node:{type:"table",headers:s,alignments:i,rows:r},nextIndex:a}}function i8(e,t,n,s){const i=[],r=Z2(e[t]),a=n?e[t].match(/^ *(\d+)([.)]) /):null,l=a?a[2]:".",c=`\\${l}`,u=n?new RegExp(`^ {${r}}\\d+${c} `):new RegExp(`^ {${r}}[-*+] `),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 y,v;g?(y=g[1].toLowerCase()==="x",v=g[2]):v=x,p++;const m=[];for(;p<e.length&&e[p].trim()!==""&&Z2(e[p])>r;)m.push(e[p]),p++;if(m.length>0){const w=Math.min(...m.map(E=>Z2(E))),S=m.map(E=>E.slice(w));v+=`
156
+ `+S.join(`
157
+ `)}i.push({checked:y,children:ic(v,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:i},nextIndex:p}}function CV(e,t){return ic(e,k3(t))}function ic(e,t){const{defs:n,cleaned:s}=l$(e),i=t.linkDefs;let r;n.size===0?r=i:i==null?r=n:r=new Map([...n,...i]);const a=r!=null?{...t,linkDefs:r}: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 y=f[1],v=f[2]||"plaintext",m=[];for(u++;u<l.length&&!l[u].startsWith(y);)m.push(l[u]),u++;u++,c.push({type:"codeblock",language:v,content:m.join(`
159
+ `)});continue}const p=d.match(/^(#{1,6}) +(.*)/);if(p){c.push({type:"heading",level:p[1].length,children:i1(p[2],a)}),u++;continue}if(b3(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("|")&&Bp(l[u+1])){const y=SV(l,u,a);c.push(y.node),u=y.nextIndex;continue}if(d.startsWith("> ")||d===">"){const y=[];for(;u<l.length&&(l[u].startsWith("> ")||l[u]===">");)y.push(l[u].replace(/^> ?/,"")),u++;c.push({type:"blockquote",children:ic(y.join(`
160
+ `),a)});continue}if(/^ {0,9}[-*+] /.test(d)){const y=i8(l,u,!1,a);c.push(y.node),u=y.nextIndex;continue}if(/^ {0,9}\d+[.)] /.test(d)){const y=i8(l,u,!0,a);c.push(y.node),u=y.nextIndex;continue}const g=[d];for(u++;u<l.length&&!jV(l[u])&&l[u].trim()!=="";)g.push(l[u]),u++;c.push({type:"paragraph",children:i1(g.join(`
161
+ `),a)})}return c}function Q2(){return{prevInput:"",settledText:"",settledBlocks:[],settledUpTo:0}}function EV(e){let t=!1,n="",s=-1;for(let i=0;i<e.length;i++){const r=e[i],a=r.match(/^(`{3,}|~{3,})/);a&&(t?a[1].startsWith(n[0])&&a[1].length>=n.length&&(t=!1,n=""):(t=!0,n=a[1])),!t&&r.trim()===""&&i>0&&(s=i)}return t?-1:s}function r8(e){const t=e.lastIndexOf(`
162
+ `),n=t===-1?"":e.slice(0,t+1);let s=t===-1?e:e.slice(t+1);const i=s.lastIndexOf("[");if(i!==-1){const a=s.slice(i);if(!(a.includes("](")&&a.includes(")"))){const c=i>0&&s[i-1]==="!"?i-1:i;s=s.slice(0,c)}}let r=s.length;for(;r>0&&s[r-1]==="`";)r--;if(r<s.length&&r>0){const a=s.length-r;s.lastIndexOf("`".repeat(a),r-1)===-1&&(s=s.slice(0,r))}for(r=s.length;r>0&&s[r-1]==="*";)r--;if(r<s.length&&r>0){const a=s.length-r;a<=3&&s.lastIndexOf("*".repeat(a),r-1)===-1&&(s=s.slice(0,r))}{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 $V(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("|")&&!Bp(n)){let i=!1;for(let r=t.length-2;r>=1;r--)if(Bp(t[r])&&t[r-1].includes("|")){i=!0;break}if(!i){t.pop();continue}}if(Bp(n)&&(t.length<2||!t[t.length-2].includes("|"))){t.pop();continue}break}return t.join(`
164
+ `)}function o8(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 i={type:"list",ordered:n.ordered,start:n.start,delimiter:n.delimiter,loose:!0,items:[...n.items,...s.items]};return[...e.slice(0,-1),i,...t.slice(1)]}return[...e,...t]}function AV(e,t,n){const s=k3(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:i}=l$(e),r=rV(i);t.linkDefsKey!==r&&(t.prevInput="",t.settledText="",t.settledBlocks=[],t.settledUpTo=0,t.linkDefsKey=r);const a=i.size>0?{...s,linkDefs:i}:s,l=e.split(`
165
+ `),c=EV(l);if(c<0)return t.prevInput=e,ic(e,a);const u=l.slice(0,c).join(`
166
+ `),d=l.slice(c).join(`
167
+ `).trim(),f=$V(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),y=ic(g,a);p=o8(t.settledBlocks,y)}else p=ic(u,a);const x=f?ic(f,a):[];return t.settledText=u,t.settledBlocks=p,t.settledUpTo=c,t.prevInput=e,o8(p,x)}const Z0={start:"0",center:"auto"},J2={start:null,center:"auto"},MV={k7Eaqz:"xkj4a21",$$css:!0},li={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=>[MV,{"--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)}]},Y0={center:{k9WMMc:"x2b8uid",$$css:!0},end:{k9WMMc:"xp4054r",$$css:!0}},De={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 a8(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 zc(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+=zc(n.children);break;case"break":t+=1;break;case"citation":t+=1;break}return t}function Hy(e){let t=0;for(const n of e)switch(n.type){case"heading":case"paragraph":t+=zc(n.children);break;case"codeblock":t+=n.content.length;break;case"blockquote":t+=Hy(n.children);break;case"list":for(const s of n.items)t+=Hy(s.children);break;case"table":for(const s of n.headers)t+=zc(s.children);for(const s of n.rows)for(const i of s)t+=zc(i.children);break;case"hr":break;case"image":t+=n.alt.length;break}return t}const TV={1:De.h1,2:De.h2,3:De.h3,4:De.h4,5:De.h5,6:De.h6},zV=/^(javascript|data|vbscript):/i;function qy(e){const t=e.trim();return t.length===0||zV.test(t)?null:t}function NV(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 i=0;for(const l of n)l.start>=i&&(s.push(l),i=l.end);if(s.length===0)return[{type:"text",content:e}];const r=[];let a=0;for(let l=0;l<s.length;l++){const c=s[l];c.start>a&&r.push({type:"text",content:e.slice(a,c.start)}),r.push({type:"plugin",element:c.plugin.render(c.match,`plugin-${l}`),matchLength:c.end-c.start}),a=c.end}return a<e.length&&r.push({type:"text",content:e.slice(a)}),r}function l8(e,t,n){const s=t.offset;if(t.offset+=e.length,!t.active)return e;const i=eV(e,s,t.boundaries,n);if(i==null)return e;const r=i.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:r},`wrap-${n}`)}function _V(e,t){let n=e.numberMap.get(t);return n==null&&(n=e.nextNumber++,e.numberMap.set(t,n)),n}function mi(e,t,n,s,i,r="a",a,l){switch(e.type){case"text":{if(a&&a.length>0){const c=NV(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(l8(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 l8(e.content,s,t)}case"bold":return o.jsx("strong",{className:"x2mo6ok",children:e.children.map((c,u)=>mi(c,u,n,s,i,r,a,l))},t);case"italic":return o.jsx("em",{children:e.children.map((c,u)=>mi(c,u,n,s,i,r,a,l))},t);case"strikethrough":return o.jsx("del",{className:"xv1l7n4",children:e.children.map((c,u)=>mi(c,u,n,s,i,r,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(n3,{children:e.content},t)}case"link":{const c=qy(e.href);if(c==null)return o.jsx("span",{children:e.children.map((x,g)=>mi(x,g,n,s,i,r,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)=>mi(x,g,n,s,i,r,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":r;return o.jsx(p,{href:c,onClick:f,...d?{target:"_blank",rel:"noopener noreferrer"}:{},className:"xjse4m1 x1bvjpef",children:e.children.map((x,g)=>mi(x,g,n,s,i,r,a,l))},t)}case"image":{const c=qy(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,!i)return o.jsxs("span",{children:["[",e.sourceId,"]"]},t);const c=_V(i,e.sourceId),u=i.sources[e.sourceId]??{title:e.sourceId},d=i.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(a$,{source:u,number:c,variant:d},t)}}}function RV(e,t){const n=t==="compact";switch(e.type){case"heading":return e.level<=3?n?De.spacingHeadingMajorCompact:De.spacingHeadingMajorDefault:n?De.spacingHeadingMinorCompact:De.spacingHeadingMinorDefault;case"paragraph":return n?De.spacingParagraphCompact:De.spacingParagraphDefault;case"codeblock":return n?De.spacingCodeblockCompact:De.spacingCodeblockDefault;case"blockquote":return n?De.spacingBlockquoteCompact:De.spacingBlockquoteDefault;case"list":return n?De.spacingListCompact:De.spacingListDefault;case"table":return n?De.spacingTableCompact:De.spacingTableDefault;case"hr":return n?De.spacingHrCompact:De.spacingHrDefault;case"image":return n?De.spacingImageCompact:De.spacingImageDefault}}function IV(e){return e.headers.map((t,n)=>{let s=zc(t.children);for(const i of e.rows)if(i[n]){const r=zc(i[n].children);r>s&&(s=r)}return s<=6?60:s<=15?80:120})}function ch(e,t,n,s,i,r,a,l,c,u,d="a",f,p,x){const g=J2[u],y=g!=null?li.blockAlign(g):null,v=RV(e,s),m=t===0,k=t===n-1;switch(e.type){case"heading":{const w=Math.min(e.level+i-1,6),S=e.children.map((z,N)=>mi(z,N,r,a,l,d,f,p)),E=p==null?void 0:p.heading;if(E)return o.jsx(E,{level:w,children:S},t);const A=`h${w}`;return o.jsx(A,{...ie(se("markdown-heading",{density:s,level:w}),G(De.headingBase,TV[w],v,c!=null?li.proseWidth(c):null,u!=="start"?li.proseAlign(Z0[u]):null,m&&De.noMarginBlockStart,k&&De.noMarginBlockEnd)),children:S},t)}case"paragraph":{const w=e.children.map((E,A)=>mi(E,A,r,a,l,d,f,p)),S=p==null?void 0:p.paragraph;return S?o.jsx(S,{children:w},t):o.jsx("div",{role:"paragraph",...ie(se("markdown-paragraph",{density:s}),G(v,c!=null?li.proseWidth(c):null,u!=="start"?li.proseAlign(Z0[u]):null,m&&De.noMarginBlockStart,k&&De.noMarginBlockEnd)),children:w},t)}case"codeblock":{a.offset+=e.content.length;const w=p==null?void 0:p.code;return w?o.jsx(w,{code:e.content,language:e.language},t):o.jsx("div",{...ie(se("markdown-codeblock",{density:s}),G(v,De.codeBlockWrapper,m&&De.noMarginBlockStart,k&&De.noMarginBlockEnd)),children:o.jsx(i0,{code:e.content,language:e.language,isCollapsible:!0,xstyle:[c!=null?li.blockWidth(c):void 0,y]})},t)}case"blockquote":{const w=p==null?void 0:p.blockquote;if(w){const S=e.children.map((E,A)=>ch(E,A,e.children.length,s,i,r,a,l,c,u,d,f,p,x));return o.jsx(w,{children:S},t)}return o.jsx(nE,{...se("markdown-blockquote",{density:s}),xstyle:[v,c!=null?li.proseWidth(c):void 0,u!=="start"?li.proseAlign(Z0[u]):void 0,m&&De.noMarginBlockStart,k&&De.noMarginBlockEnd],children:e.children.map((S,E)=>ch(S,E,e.children.length,s,i,r,a,l,c,u,d,f,p,x))},t)}case"list":{if(e.items.length>0&&e.items.every(S=>S.checked!=null)){const S=e.items.map((E,A)=>({item:E,key:`task-${A}`})).filter(({item:E})=>E.checked).map(({key:E})=>E);return o.jsx("div",{...ie(se("markdown-list",{density:s}),G(v,m&&De.noMarginBlockStart,k&&De.noMarginBlockEnd)),children:o.jsx(x3,{label:x("@astryx.markdown.taskList"),isLabelHidden:!0,value:S,xstyle:De.blockIndent,isReadOnly:!0,density:"compact",children:e.items.map((E,A)=>{const z=E.children[0],M=E.children.length===1&&(z==null?void 0:z.type)==="paragraph"?o.jsx(o.Fragment,{children:z.children.map(($,R)=>mi($,R,r,a,l,d,f,p))}):o.jsx(o.Fragment,{children:E.children.map(($,R)=>ch($,R,E.children.length,s,i,r,a,l,c,u,d,f,p,x))});return o.jsx(tg,{value:`task-${A}`,label:M},A)})})},t)}return o.jsx("div",{...ie(se("markdown-list",{density:s}),G(v,c!=null?li.proseWidth(c):null,u!=="start"?li.proseAlign(Z0[u]):null,m&&De.noMarginBlockStart,k&&De.noMarginBlockEnd)),children:o.jsx(wn,{listStyle:e.ordered?"decimal":"disc",density:"compact",start:e.ordered?e.start:void 0,xstyle:De.blockIndent,children:e.items.map((S,E)=>{const A=S.children[0],N=S.children.length===1&&(A==null?void 0:A.type)==="paragraph"?o.jsx(o.Fragment,{children:A.children.map((M,$)=>mi(M,$,r,a,l,d,f,p))}):o.jsx(o.Fragment,{children:S.children.map((M,$)=>ch(M,$,S.children.length,s,i,r,a,l,c,u,d,f,p,x))});return o.jsx(yt,{label:N},E)})})},t)}case"table":{const w=IV(e);return o.jsx("div",{tabIndex:0,role:"group","aria-label":x("@astryx.markdown.table"),...ie(se("markdown-table",{density:s}),G(De.tableWrapper,v,c!=null?li.blockWidth(c):null,J2[u]!=null?li.blockAlign(J2[u]):null,m&&De.noMarginBlockStart,k&&De.noMarginBlockEnd)),children:o.jsxs(o$,{dividers:"rows",textOverflow:"wrap",children:[o.jsx(v3,{children:o.jsx(ng,{children:e.headers.map((S,E)=>o.jsx(m3,{xstyle:[li.cellMinWidth(`${w[E]}px`),e.alignments[E]==="center"&&Y0.center,e.alignments[E]==="right"&&Y0.end],children:S.children.map((A,z)=>mi(A,z,r,a,l,d,f,p))},E))})}),o.jsx(y3,{children:e.rows.map((S,E)=>{const A=S.map((z,N)=>o.jsx(g3,{xstyle:[e.alignments[N]==="center"&&Y0.center,e.alignments[N]==="right"&&Y0.end],children:z.children.map((M,$)=>mi(M,$,r,a,l,d,f,p))},N));return o.jsx(ng,{children:A},E)})})]})},t)}case"hr":{const w=p==null?void 0:p.hr;return w?o.jsx(w,{},t):o.jsx("hr",{...ie(se("markdown-hr",{density:s}),G(De.hr,v,m&&De.noMarginBlockStart,k&&De.noMarginBlockEnd))},t)}case"image":{const w=qy(e.src);if(w==null)return o.jsxs("div",{...ie(se("markdown-image",{density:s}),G(v,m&&De.noMarginBlockStart,k&&De.noMarginBlockEnd)),children:["[",e.alt,"]"]},t);const S=p==null?void 0:p.image;return S?o.jsx(S,{src:w,alt:e.alt},t):o.jsx("div",{...ie(se("markdown-image",{density:s}),G(v,m&&De.noMarginBlockStart,k&&De.noMarginBlockEnd)),children:o.jsx("img",{src:w,alt:e.alt,className:"x193iq5w xh6dtrn"})},t)}}}function w3({ref:e,children:t,display:n="block",density:s="default",headingLevelStart:i=1,isStreaming:r=!1,onLinkClick:a,sources:l,citationStyle:c="label",contentWidth:u=680,contentAlign:d="start",components:f,inlinePlugins:p,autolink:x,xstyle:g,className:y,style:v,"data-testid":m}){const k=Fe(),w=vl(),S=h.useMemo(()=>l?new Set(Object.keys(l)):void 0,[l]),E=h.useMemo(()=>({sourceIds:S,autolink:x}),[S,x]),A=qq(t,r),z=h.useRef(Q2()),N=h.useRef(x);N.current!==x&&(z.current=Q2(),N.current=x);const M=h.useMemo(()=>{if(n==="inline")return[];if(r){if(A==="")return z.current=Q2(),[];const U=r8(A);return AV(U,z.current,E)}return CV(t,E)},[n,A,t,r,E]),$=h.useMemo(()=>{if(n!=="inline")return[];const U=r?r8(A):t;return uV(U,E)},[n,A,t,r,E]),{token:R}=vm(),_=h.useMemo(()=>{const U=a8(R("--duration-fast-max"))??230,X=a8(R("--duration-fast-min")),Z=X!=null?Math.max(4,Math.round(X/10)):50;return Math.min(Math.ceil(U/Z),12)},[R]),T=h.useRef([]),O=h.useRef([]),H=h.useRef([]),L=A.length,I={offset:0,boundaries:h.useMemo(()=>{const U=n==="inline"?zc(O.current):Hy(T.current),X=JF(H.current,U,_);return H.current=X,X},[n,L,_]),active:r},D=l?{sources:l,numberMap:new Map,nextNumber:1,style:c}:null;if(n==="inline"){const U=o.jsx("span",{ref:e,"data-testid":m,...ie(se("markdown",{density:s}),G(De.root,De.inlineRoot,g),y,v),children:$.map((X,Z)=>mi(X,Z,a,I,D,w,p,f))});return O.current=$,T.current=[],U}const q=o.jsx("div",{role:"document",ref:e,"data-testid":m,...ie(se("markdown",{density:s}),G(De.root,g),y,v),children:M.map((U,X)=>ch(U,X,M.length,s,i,a,I,D,u?typeof u=="number"?`${u}px`:u:null,d,w,p,f,k))});return T.current=M,O.current=[],q}w3.displayName="Markdown";const h$=h.createContext(null);h$.displayName="CollapsibleGroupContext";const Py=h.createContext(null);Py.displayName="CollapsibleGroupPresentationContext";function LV(e){const{isCollapsible:t,value:n}=e,s=h.use(h$),i=s!=null&&n!=null,r=t===!0?{}:t||null,a=r!=null,[l,c]=h.useState(()=>i?!0:(r==null?void 0:r.isOpen)!==void 0?r.isOpen:(r==null?void 0:r.defaultIsOpen)??!0);let u;return i&&n!=null?u=s.isOpen(n):(r==null?void 0:r.isOpen)!==void 0?u=r.isOpen:u=l,{isEnabled:a,isOpen:u,toggle:()=>{var p;if(i&&n!=null){s.toggle(n);return}const f=!u;(r==null?void 0:r.isOpen)===void 0&&c(f),(p=r==null?void 0:r.onOpenChange)==null||p.call(r,f)}}}const yu={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}},rd={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}},OV={compact:rd.triggerCompact,balanced:rd.triggerBalanced,spacious:rd.triggerSpacious},DV={compact:rd.contentCompact,balanced:rd.contentBalanced,spacious:rd.contentSpacious};function Rm({trigger:e,children:t,defaultIsOpen:n,isOpen:s,isDisabled:i=!1,onOpenChange:r,value:a,ref:l,xstyle:c,className:u,style:d,...f}){const p=s!==void 0?{isOpen:s,onOpenChange:r}:{defaultIsOpen:n??!0,onOpenChange:r},{isOpen:x,toggle:g}=LV({isCollapsible:p,value:a}),y=()=>{i||g()},v=h.use(Py),m=(v==null?void 0:v.hasDividers)??!1,k=(v==null?void 0:v.density)??null,w=Vd("chevronDown"),S=h.useId();return o.jsxs("div",{ref:l,...ie(se("collapsible",{density:k??void 0}),G(yu.root,m&&yu.divided,c),u,d),...f,children:[o.jsxs("button",{type:"button",onClick:y,"aria-disabled":i||void 0,"aria-expanded":x,"aria-controls":S,tabIndex:i?-1:void 0,...ie(se("collapsible-trigger",{density:k??void 0}),G(yu.trigger,k!=null&&OV[k],i&&yu.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:w})]}),o.jsx("div",{id:S,...ie(se("collapsible-content",{density:k??void 0}),G(yu.content,k!=null&&DV[k],!x&&yu.contentHidden)),children:v!=null?o.jsx(Py,{value:null,children:t}):t})]})}Rm.displayName="Collapsible";const j3=h.createContext(null);j3.displayName="RadioListContext";function S3({ref:e,label:t,isLabelHidden:n=!1,description:s,value:i,onChange:r,orientation:a="vertical",isDisabled:l=!1,disabledMessage:c,isRequired:u=!1,isOptional:d=!1,size:f="md",status:p,labelTooltip:x,width:g,xstyle:y,className:v,style:m,"data-testid":k,htmlName:w,children:S}){const E=h.useId(),A=w??E,z=h.useId(),N=h.useId(),M=h.useId(),$=h.useId(),R=h.useRef(null),_=l&&!!c,T=Fs({placement:"above",focusTrigger:"always",isEnabled:_}),O=h.useMemo(()=>({name:A,value:i,onChange:r,isDisabled:l,hasDisabledMessage:_,isRequired:u,size:f,status:p}),[A,i,r,l,_,u,f,p]),H=h.useCallback(L=>{if(i!=="")return;const B=R.current;if(!B)return;const I=L.relatedTarget;if(I){if(B.contains(I))return}else if(document.activeElement&&document.activeElement!==L.target&&B.contains(document.activeElement))return;const D=Array.from(B.querySelectorAll('input[type="radio"]:not([disabled])'));if(D.length===0)return;const q=L.target,U=D.findIndex(ne=>ne===q);if(U===-1)return;const Z=U===D.length-1?D[D.length-1]:D[0];q!==Z&&Z.focus()},[i]);return o.jsxs(ru,{ref:e,"data-testid":k,label:t,isLabelHidden:n,description:s,inputID:z,labelID:N,isGroupLabel:!0,descriptionID:s?M:void 0,isOptional:d,isRequired:u,isDisabled:l,status:p?{type:p.type,message:p.message,messageID:p.message?$:void 0}:void 0,labelTooltip:x,statusVariant:"detached",width:g,xstyle:y,className:v,style:m,children:[o.jsx("div",{ref:L=>{R.current=L,T.ref(L)},role:"radiogroup","aria-labelledby":N,onFocus:H,"aria-describedby":[s?M:null,p!=null&&p.message?$:null,_?T.describedBy:null].filter(Boolean).join(" ")||void 0,"aria-invalid":(p==null?void 0:p.type)==="error"?!0:void 0,"aria-required":u||void 0,...ie(se("radio-list",{orientation:a,size:f}),{0:{className:"x78zum5 x1q0g3np x9mgr7n"},1:{className:"x78zum5 xdt5ytf x1txdalj"}}[(a==="vertical")<<0]),children:o.jsx(j3,{value:O,children:S})}),_&&T.renderTooltip(c)]})}S3.displayName="RadioList";const BV={xklqth5:"xklqth5",$$css:!0},ar={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}},c8={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},HV={sm:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"xvy4d1p",kZKoxP:"xxk0z11",$$css:!0}},qV={sm:{kzqmXN:"x1xc55vz",kZKoxP:"xdk7pt",$$css:!0},md:{kzqmXN:"x1fsd2vl",kZKoxP:"x170jfvy",$$css:!0}},PV={root:{k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kaIpWk:"x2u8bby",kUk6DE:"x98rzlu",k7Eaqz:"xeuugli",$$css:!0}};function sg({ref:e,label:t,value:n,description:s,isDisabled:i=!1,startContent:r,endContent:a,xstyle:l,className:c,style:u,...d}){const f=h.use(j3);if(!f)throw new Error("RadioListItem must be used within an RadioList");const p=h.useId(),x=h.useId(),g=f.isDisabled||i,y=f.hasDisabledMessage&&!i,v=f.value===n,m=f.size,k=o.jsxs("div",{...G(ar.radioWrapper,c8[m],!g&&ar.radioWrapperFocus),children:[o.jsx("input",{id:p,type:"radio",name:f.name,value:n,checked:v,disabled:g&&!y,"aria-disabled":y?"true":void 0,form:y?"":void 0,required:f.isRequired,onChange:()=>{g||f.onChange(n)},"aria-describedby":s?x:void 0,...G(ar.input,c8[m],g&&ar.inputDisabled)}),o.jsx("div",{"aria-hidden":"true",...ie(se("radio",{size:m,checked:v?"checked":null,disabled:g?"disabled":null}),G(ar.radio,HV[m],v?ar.radioChecked:ar.radioUnchecked,g&&ar.radioDisabled,g&&!v&&ar.radioDisabledUnchecked)),children:v&&o.jsx("div",{...ie(se("radio-dot",{size:m}),G(ar.innerDot,qV[m]))})})]}),w=r!=null?o.jsxs(o.Fragment,{children:[k,r]}):k;return o.jsx("div",{ref:e,...ie(se("radio-list-item"),G(ar.container,!g&&BV,l),c,u),...d,children:o.jsx(yl,{startContent:w,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:PV.root})})}sg.displayName="RadioListItem";const UV=50,FV=40,p$="astryx-resizable:";function Q0(e,t,n,s){const i=Math.min(n,Math.max(t,e));if(s.length>0){let r=s[0],a=Math.abs(i-r);for(let l=1;l<s.length;l++){const c=Math.abs(i-s[l]);c<a&&(r=s[l],a=c)}return Math.min(n,Math.max(t,r))}return i}function VV(e){if(typeof window>"u")return null;try{const t=localStorage.getItem(p$+e);if(t!=null){const n=JSON.parse(t);if(typeof n=="number")return n}}catch{}return null}function GV(e,t){if(!(typeof window>"u"))try{localStorage.setItem(p$+e,JSON.stringify(t))}catch{}}function WV(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 x$(e){const{defaultSize:t,minSizePx:n=UV,maxSizePx:s=1/0,collapsible:i=!1,collapsedSize:r=FV,snaps:a=[],autoSaveId:l,onSizeChange:c,onCollapseChange:u}=e,d=WV(t),f=l?VV(l):null,p=f??d,[x,g]=h.useState(()=>Q0(p,n,s,a)),[y,v]=h.useState(()=>f===0&&i),m=h.useRef(x),k=h.useRef(x);h.useEffect(()=>{l&&GV(l,y?0:x)},[x,y,l]);const w=h.useCallback(()=>{i&&(m.current=x,v(!0),g(0),u==null||u(!0),c==null||c(0))},[i,x,u,c]),S=h.useCallback(()=>{v(!1);const $=m.current||d,R=Q0($,n,s,a);g(R),u==null||u(!1),c==null||c(R)},[d,n,s,a,u,c]),E=h.useCallback($=>{const R=Q0($,n,s,a);g(R),v(!1),c==null||c(R)},[n,s,a,c]),A=h.useCallback(()=>{k.current=y?0:x},[x,y]),z=h.useCallback($=>{const R=k.current+$;if(i&&R<r){y||(m.current=x,u==null||u(!0)),v(!0),g(0),c==null||c(0);return}y&&R>=r&&(v(!1),u==null||u(!1));const _=Q0(R,n,s,a);g(_),c==null||c(_)},[i,r,y,x,n,s,a,c,u]),N=h.useCallback(()=>{},[]);return{size:y?0:x,isCollapsed:y,collapse:w,expand:S,resize:E,props:{_size:y?0:x,_isCollapsed:y,_onResizeStart:A,_onResizeMove:z,_onResizeEnd:N,_minSizePx:n,_maxSizePx:s,_snaps:a,_collapsedSize:r,_collapsible:i,_isResizableProps:!0}}}function KV(e){const{regions:t,autoSaveId:n}=e,s=Object.entries(t),i=s.map(([a,l])=>x$({...l,autoSaveId:n?`${n}:${a}`:void 0})),r={};return s.forEach(([a],l)=>{r[a]=i[l]}),r}function g$(e){return"regions"in e?KV(e):x$(e)}const XV=10,ZV=50;function YV(e,t,n){if(e!=="auto")return e;const s=t?"end":"start";return n?s==="start"?"end":"start":s}function QV(e){return e==="center"?null:e==="start"?-1:1}const dn={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}},JV={kLqNvP:"x1o0tod",k3aq6I:"x11wx31z x75qhwu",$$css:!0},eG={k87sOh:"x13vifvy",k3aq6I:"xsqj5wx",$$css:!0},tG={kLqNvP:"x1o0tod",k3aq6I:"xsqj5wx",$$css:!0},nG={k87sOh:"x13vifvy",k3aq6I:"xsqj5wx",$$css:!0},J0={hitAreaOffsetX:e=>[JV,{"--x-qthpiu":`translate(calc(${e} * (3px + ${Ri["--spacing-1"]}) - 6.5px), -50%)`!=null?`translate(calc(${e} * (3px + ${Ri["--spacing-1"]}) - 6.5px), -50%)`:void 0,"--x-sj6hyi":`translate(calc(${e} * (3px + ${Ri["--spacing-1"]}) + 6.5px), -50%)`!=null?`translate(calc(${e} * (3px + ${Ri["--spacing-1"]}) + 6.5px), -50%)`:void 0}],hitAreaOffsetY:e=>[eG,{"--x-transform":`translate(-50%, calc(${e} * (3px + ${Ri["--spacing-1"]}) - 6.5px))`!=null?`translate(-50%, calc(${e} * (3px + ${Ri["--spacing-1"]}) - 6.5px))`:void 0}],pillOffsetX:e=>[tG,{"--x-transform":`translate(calc(${e} * (100% + ${Ri["--spacing-1"]})), -50%)`!=null?`translate(calc(${e} * (100% + ${Ri["--spacing-1"]})), -50%)`:void 0}],pillOffsetY:e=>[nG,{"--x-transform":`translate(-50%, calc(${e} * (100% + ${Ri["--spacing-1"]})))`!=null?`translate(-50%, calc(${e} * (100% + ${Ri["--spacing-1"]})))`:void 0}]};function C3({direction:e="horizontal",position:t="inline",isReversed:n=!1,isDisabled:s=!1,hasDivider:i=!1,isAlwaysVisible:r=!0,pillPlacement:a="auto",label:l,resizable:c,children:u,xstyle:d,className:f,ref:p,...x}){const g=Fe(),y=l??g("@astryx.resizable.handle.label"),v=h.useRef(null),m=h.useRef(null),[k,w]=h.useState(!1),[S,E]=h.useState(!1),[A,z]=h.useState(!1),N=e==="horizontal",M=t==="overlay",$=n?-1:1,R=YV(a,n,(c==null?void 0:c._isCollapsed)??!1),_=QV(R),T=h.useCallback(()=>{const Z=v.current;return Z&&getComputedStyle(Z).direction==="rtl"?-1:1},[]),O=S||A,H=h.useCallback(Z=>{if(s||!c)return;Z.preventDefault(),Z.stopPropagation(),w(!0),c._onResizeStart();const ne=N?Z.clientX:Z.clientY,Y=N?T():1;document.body.style.cursor=N?"col-resize":"row-resize",document.body.style.userSelect="none";const ae=be=>{const je=((N?be.clientX:be.clientY)-ne)*Y*$;c._onResizeMove(je)},le=()=>{ge(),w(!1),c._onResizeEnd(),document.body.style.cursor="",document.body.style.userSelect=""},re=()=>{ge(),w(!1),document.body.style.cursor="",document.body.style.userSelect=""};function ge(){window.removeEventListener("pointermove",ae),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",re),m.current=null}window.addEventListener("pointermove",ae),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",re),m.current=ge},[s,c,N,T,$]),L=h.useCallback(Z=>{if(s||!c)return;const ne=Z.shiftKey?ZV:XV,Y=N?T():1;switch(Z.key){case"ArrowRight":case"ArrowDown":{Z.preventDefault(),c._onResizeStart(),c._onResizeMove(ne*(N?Y:1)*$),c._onResizeEnd();break}case"ArrowLeft":case"ArrowUp":{Z.preventDefault(),c._onResizeStart(),c._onResizeMove(-ne*(N?Y:1)*$),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,N,T,$]),B=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 I=(c==null?void 0:c._isCollapsed)??!1,D=c?I?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&&I?g("@astryx.resizable.collapsed"):void 0;return o.jsxs("div",{ref:pn(p,v),role:"separator","aria-orientation":N?"vertical":"horizontal","aria-valuenow":D,"aria-valuemin":q,"aria-valuemax":U,"aria-valuetext":X,"aria-label":y,"aria-disabled":s||void 0,tabIndex:s?-1:0,onDoubleClick:B,onFocus:()=>z(!0),onBlur:()=>z(!1),"data-resizing":k||void 0,...ie(se("resize-handle"),G(dn.handle,M&&dn.overlay,M&&(N?dn.overlayHorizontal:dn.overlayVertical),!M&&(N?dn.horizontal:dn.vertical),!M&&!i&&(N?dn.noDividerHorizontal:dn.noDividerVertical),!M&&i&&O&&!k&&dn.handleHover,!M&&i&&k&&dn.handleActive,s&&dn.disabled,d),f),...x,onKeyDown:Z=>{var ne;(ne=x.onKeyDown)==null||ne.call(x,Z),L(Z)},children:[o.jsx("div",{...G(dn.hitArea,N?dn.hitAreaHorizontal:dn.hitAreaVertical,_==null?N?Fd.centerInline("0px"):dn.hitAreaCenteredY:N?J0.hitAreaOffsetX(_):J0.hitAreaOffsetY(_),s&&dn.disabled),onPointerDown:H,onPointerEnter:()=>E(!0),onPointerLeave:()=>{k||E(!1)}}),u??o.jsx("div",{...ie(se("resize-handle-pill"),G(dn.pill,N?dn.pillHorizontal:dn.pillVertical,R==="center"?Fd.centerInline("-50%"):N?J0.pillOffsetX(R==="start"?-1:1):J0.pillOffsetY(R==="start"?-1:1),r?dn.pillVisible:dn.pillHidden,O&&!k&&dn.pillHover,k&&dn.pillActive))})]})}C3.displayName="ResizeHandle";const ku={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}},sG={imageTransform:e=>[{k3aq6I:e!=null?"xsqj5wx":e,$$css:!0},{"--x-transform":e??void 0}]},ep=50,u8={ArrowLeft:[ep,0],ArrowRight:[-ep,0],ArrowUp:[0,ep],ArrowDown:[0,-ep]};function m$({isOpen:e,onOpenChange:t,media:n,index:s,defaultIndex:i=0,onIndexChange:r,hasZoom:a=!1,hasAutoPlay:l=!1,xstyle:c,className:u,style:d,ref:f,onClick:p,onKeyDown:x,...g}){const y=Fe(),v=h.useRef(null),m=h.useRef(null),k=h.useRef(null),w=h.useRef(null),S=s!==void 0,[E,A]=h.useState(i),z=S?s:E,N=h.useCallback(xe=>{S||A(xe),r==null||r(xe)},[S,r,A]),[M,$]=h.useState(1),[R,_]=h.useState({x:0,y:0}),[T,O]=h.useState(!1),H=h.useRef({x:0,y:0,panX:0,panY:0}),L=h.useMemo(()=>Array.isArray(n)?n:[n],[n]),B=L.length>1,I=L.length>0?L[Math.min(z,L.length-1)]:null,q=((I==null?void 0:I.type)??"image")==="video",U=B&&z>0,X=B&&z<L.length-1;pE(e),h.useEffect(()=>{$(1),_({x:0,y:0})},[z,I==null?void 0:I.src]);const Z=iu(),ne=h.useRef(z),Y=h.useRef(e);h.useEffect(()=>{const xe=ne.current!==z,xt=Y.current;if(ne.current=z,Y.current=e,!xe||!e||!xt)return;const st=L[Math.min(z,L.length-1)],Gt=`${z+1} of ${L.length}`;Z(st!=null&&st.alt?`${st.alt}, ${Gt}`:`Image ${Gt}`)},[z,e,Z,L]),no(()=>{const xe=v.current;xe&&(e&&!xe.open?(w.current=document.activeElement,xe.showModal()):!e&&xe.open&&(xe.close(),w.current instanceof HTMLElement&&w.current.focus()))},[e]);const ae=h.useCallback(()=>{t(!1)},[t]),le=h.useCallback(xe=>{xe.preventDefault(),ae()},[ae]),re=h.useRef(!1),ge=h.useCallback(xe=>{if(re.current){re.current=!1;return}(xe.target===xe.currentTarget||xe.target===m.current)&&ae()},[ae]),be=h.useCallback(()=>{U&&N(z-1)},[U,z,N]),me=h.useCallback(()=>{X&&N(z+1)},[X,z,N]),je=h.useCallback(xe=>{!a||q||xe===M||($(xe),_({x:0,y:0}),Z(xe>1?y("@astryx.lightbox.zoomedIn"):y("@astryx.lightbox.zoomedOut")))},[a,q,M,Z,y]),we=h.useCallback(()=>{je(M===1?2:1)},[je,M]),ye=h.useCallback(xe=>{if(a&&!q){if(xe.key==="+"||xe.key==="="){xe.preventDefault(),je(2);return}if(xe.key==="-"){xe.preventDefault(),je(1);return}if(M>1&&u8[xe.key]!==void 0){xe.preventDefault();const[xt,st]=u8[xe.key];_(Gt=>({x:Gt.x+xt,y:Gt.y+st}));return}}xe.key==="ArrowLeft"?(xe.preventDefault(),be()):xe.key==="ArrowRight"&&(xe.preventDefault(),me())},[a,q,M,je,be,me]),J=h.useCallback(xe=>{(xe.key==="Enter"||xe.key===" ")&&(xe.preventDefault(),we())},[we]),Se=h.useCallback(xe=>{M<=1||!a||(O(!0),re.current=!1,H.current={x:xe.clientX,y:xe.clientY,panX:R.x,panY:R.y})},[M,a,R]);h.useEffect(()=>{if(!T)return;const xe=st=>{re.current=!0;const Gt=st.clientX-H.current.x,Wt=st.clientY-H.current.y;_({x:H.current.panX+Gt,y:H.current.panY+Wt})},xt=()=>{O(!1)};return window.addEventListener("pointermove",xe),window.addEventListener("pointerup",xt),()=>{window.removeEventListener("pointermove",xe),window.removeEventListener("pointerup",xt)}},[T]);const ke=M>1,Ce=a&&!q,Ee=M===1?null:`scale(${M}) translate(${R.x/M}px, ${R.y/M}px)`;return I?o.jsx("dialog",{ref:pn(f,v),onCancel:le,onClick:xe=>{ge(xe),p==null||p(xe)},onKeyDown:xe=>{ye(xe),x==null||x(xe)},"aria-label":I.alt||y("@astryx.lightbox.mediaViewer"),...ie(se("lightbox"),G(ku.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(ht,{icon:o.jsx(Pe,{icon:"close",size:"sm",color:"inherit"}),label:y("@astryx.lightbox.close"),variant:"ghost",onClick:ae,xstyle:ku.controlButton})}),B&&o.jsx("div",{className:"x10l6tqk xwa60dl x1cb1t30 x1vjfegm x1ybfrjj",children:o.jsx(ht,{icon:o.jsx("span",{...G(Fd.mirror),children:o.jsx(Pe,{icon:"chevronLeft",size:"sm",color:"inherit"})}),label:y("@astryx.lightbox.previous"),variant:"ghost",isDisabled:!U,onClick:be,xstyle:ku.controlButton})}),o.jsxs("div",{className:"x78zum5 xdt5ytf x6s0dn4 x193iq5w xmz0i5r xb3r6kr",children:[o.jsx("div",{ref:k,role:Ce?"button":void 0,tabIndex:Ce?0:void 0,"aria-pressed":Ce?ke:void 0,"aria-label":Ce?y("@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"}}[!!Ce<<3|!!(!q&&a&&!ke)<<2|!!(!q&&ke)<<1|!!(!q&&T)<<0],onDoubleClick:q?void 0:we,onKeyDown:Ce?J:void 0,onPointerDown:q?void 0:Se,children:q?o.jsx("video",{src:I.src,"aria-label":I.alt,controls:!0,autoPlay:l,className:"x193iq5w xmz0i5r x19kjcj4 x1a2a7pz"}):o.jsx("img",{src:I.src,alt:I.alt,draggable:!1,...G(ku.image,T&&ku.imageDragging,Ee!=null&&sG.imageTransform(Ee))})}),I.caption&&o.jsx("div",{className:"x9e3rv5 x18juvz8 xf74fhv x2b8uid x1xye8es x18d9i69 xrrkdod xrlsmeg x2lah0s",children:I.caption})]}),B&&o.jsx("div",{className:"x10l6tqk xwa60dl x1cb1t30 x1vjfegm x1mcfs9z",children:o.jsx(ht,{icon:o.jsx("span",{...G(Fd.mirror),children:o.jsx(Pe,{icon:"chevronRight",size:"sm",color:"inherit"})}),label:y("@astryx.lightbox.next"),variant:"ghost",isDisabled:!X,onClick:me,xstyle:ku.controlButton})}),B&&L.length>1&&o.jsxs("div",{className:"x10l6tqk xyx6v2t x1ybfrjj x9e3rv5 xjm74w1 xw6l6zx x1vjfegm",children:[z+1," / ",L.length]})]})}):null}m$.displayName="Lightbox";const ci={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}},ev={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 iG(e){e.preventDefault()}function r0({as:e,label:t,href:n,hasUnderline:s=!1,isDisabled:i=!1,isExternalLink:r=!1,newTabLabel:a,target:l,onClick:c,tooltip:u,isStandalone:d=!1,type:f="body",size:p,weight:x,color:g="accent",display:y="inline",maxLines:v=0,children:m,rel:k,xstyle:w,className:S,style:E,ref:A,...z}){const N=Fe(),M=a??N("@astryx.link.newTab"),$=vl(e),R=mE({href:n,onClick:c,isDisabled:i}),{target:_,rel:T}=rE(r?"_blank":l,k),O=R==="button"||R==="inert"&&n==null,H=o.jsxs(o.Fragment,{children:[o.jsx(W,{type:f,size:p,weight:x,color:g,display:y,maxLines:v,children:m}),r&&!O&&o.jsxs(o.Fragment,{children:[o.jsx(Pe,{icon:"externalLink",size:"xsm",color:"inherit"}),o.jsx(lo,{children:M})]})]});let L;return O?L=o.jsx("button",{ref:A,type:"button",onClick:c,"aria-label":t||void 0,"aria-disabled":i||void 0,tabIndex:i?-1:void 0,disabled:i,...ie(se("link",{color:g}),G(ci.base,ci.buttonReset,ev[g],s&&ci.hasUnderline,d&&ci.standalone,i&&ci.disabled,w),S,E),...z,children:H}):i?L=o.jsx("a",{ref:A,onClick:iG,"aria-label":t||void 0,"aria-disabled":!0,tabIndex:-1,...ie(se("link",{color:g}),G(ci.base,ev[g],s&&ci.hasUnderline,d&&ci.standalone,ci.disabled,w),S,E),...z,children:H}):L=o.jsx($,{ref:A,href:n,target:_,rel:T,onClick:c,"aria-label":t||void 0,"aria-disabled":i||void 0,tabIndex:i?-1:void 0,...ie(se("link",{color:g}),G(ci.base,ev[g],s&&ci.hasUnderline,d&&ci.standalone,i&&ci.disabled,w),S,E),...z,children:H}),u?o.jsx(ia,{content:u,placement:"above",children:L}):L}r0.displayName="Link";const E3=h.createContext(null);E3.displayName="MetadataListContext";const Ml={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}},rG={gridTemplate:e=>[{kumcoG:e!=null?"xqketvx":e,$$css:!0},{"--x-gridTemplateColumns":e??void 0}]},oG={position:"start"},d8={position:"top"};function v$({children:e,columns:t="single",label:n,maxNumOfItems:s,orientation:i="vertical",title:r,xstyle:a,className:l,style:c,"data-testid":u,ref:d}){const f=t==="multi"||typeof t=="number"&&t>1,p=n??(f?d8:oG),[x,g]=h.useState(!1),y=h.useId(),v=Fe(),m=h.useMemo(()=>({labelConfig:i==="horizontal"?d8:p,orientation:i}),[p,i]),k=h.Children.toArray(e),w=i==="horizontal",S=w?void 0:s,E=S!=null&&k.length>S,A=E&&!x?k.slice(0,S):k,z=r!=null?o.jsx("div",{className:"xep27e5",children:r}):null,N=()=>w?Ml.horizontal:p.position==="top"?t==="single"||t===1?Ml.gridStackedSingle:Ml.gridStackedMulti:t==="single"||t===1?Ml.gridSingle:Ml.gridMulti,$=(()=>{if(w)return null;const R=p.position==="top";return typeof t=="number"&&t>1?R?`repeat(${t}, 1fr)`:`repeat(${t}, auto 1fr)`:!R&&p.width!=null?`${typeof p.width=="number"?`${p.width}px`:p.width} 1fr`:null})();return o.jsx(E3,{value:m,children:o.jsxs("div",{ref:d,"data-testid":u,...ie(se("metadata-list",{columns:String(t),orientation:i}),G(Ml.root,a),l,c),children:[z,o.jsx("dl",{id:y,...G(Ml.dl,N(),$!=null&&rG.gridTemplate($)),children:A}),E&&o.jsx("button",{type:"button","aria-controls":y,"aria-expanded":x,onClick:()=>g(R=>!R),className:"xjyslct x15nmkw0 x1ypdohk xqwr325 xjm74w1 xw6l6zx x1e4wzip xjb2p0i x1yc453h xqcrz7y",children:v(x?"@astryx.metadataList.showLess":"@astryx.metadataList.showMore")})]})})}v$.displayName="MetadataList";const f8={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 uh({children:e,icon:t,label:n,xstyle:s,className:i,style:r,"data-testid":a,ref:l}){const c=h.use(E3),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,...ie(se("metadata-list-item"),G(f8.stackedWrapper,s),i,r),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,...ie(se("metadata-list-item"),G(f8.label,s),i,r),children:f}),o.jsx("dd",{"data-testid":a?`${a}-value`:void 0,className:"x1tgivj0 xjm74w1 xw6l6zx x1ghz6dp x1717udv xjwf9q1 x13faqbe",children:e})]})}uh.displayName="MetadataListItem";const aG={x1iwu4tg:"x1iwu4tg",$$css:!0},lG={sm:{kzqmXN:"x1td3qas",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"x100vrsf",kZKoxP:"xxk0z11",$$css:!0}},cG={sm:{kzqmXN:"x1td3qas",kZKoxP:"x1qx5ct2",$$css:!0},md:{kzqmXN:"x100vrsf",kZKoxP:"xxk0z11",$$css:!0}},uG={sm:{kzqmXN:"x1td3qas",kZKoxP:"x1qx5ct2",kmVPX3:"x1i3ajwb",$$css:!0},md:{kzqmXN:"x100vrsf",kZKoxP:"xxk0z11",kmVPX3:"xfawy5m",$$css:!0}},dG={sm:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",k3aq6I:"xbryuvx",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",k3aq6I:"xbryuvx",$$css:!0}},fG={sm:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",k3aq6I:"xv5t66b xi9aj42",$$css:!0},md:{kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",k3aq6I:"x15481yp x12xz5k6",$$css:!0}},hG={sm:{kAzted:"xisnujt",$$css:!0},md:{kAzted:"xjwf9q1",$$css:!0}},ws={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}},pG={width:e=>[{kzqmXN:e!=null?"x5lhr3w":e,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(e)}]};function $3({label:e,isLabelHidden:t=!1,description:n,onChange:s,changeAction:i,isLoading:r=!1,value:a,isDisabled:l=!1,htmlName:c,disabledMessage:u,isOptional:d=!1,isRequired:f=!1,onFocus:p,onBlur:x,labelIcon:g,labelTooltip:y,labelPosition:v="end",labelSpacing:m="hug",status:k,size:w="md",width:S,xstyle:E,className:A,style:z,ref:N,...M}){const $=h.useId(),R=h.useId(),_=h.useId(),[,T]=h.useTransition(),[O,H]=h.useOptimistic(a),L=r||O!==a,B=O===!0,I=l&&!!u,D=Fs({placement:"above",focusTrigger:"always",isEnabled:I}),q=[];n&&q.push(R),k!=null&&k.message&&q.push(_),I&&q.push(D.describedBy);const U=q.length>0?q.join(" "):void 0,X=o.jsxs("div",{...G(ws.switchWrapper,lG[w]),children:[o.jsx("input",{ref:pn(N,D.positionRef),id:$,type:"checkbox",role:"switch",name:l?void 0:c,checked:B,disabled:l&&!I,"aria-disabled":I?"true":void 0,required:f,onChange:ne=>{if(l||L)return;const Y=ne.target.checked;s==null||s(Y,ne),i&&!ne.defaultPrevented&&T(async()=>{H(Y),await i(Y,ne)})},onFocus:p,onBlur:x,"aria-describedby":U,"aria-invalid":(k==null?void 0:k.type)==="error"?!0:void 0,"aria-busy":L||void 0,...G(ws.input,cG[w],l&&ws.inputDisabled,L&&ws.inputBusy)}),o.jsx("div",{"aria-hidden":"true",...ie(se("switch",{checked:B?"checked":null,disabled:l?"disabled":null,size:w}),G(ws.track,uG[w],B?ws.trackOn:ws.trackOff,!l&&ws.trackFocus,l&&ws.trackDisabled,l&&!B&&ws.trackDisabledOff)),children:o.jsx("div",{...ie(se("switch-thumb",{checked:B?"checked":null,size:w}),G(ws.thumb,B?fG[w]:dG[w],B?ws.thumbOn:ws.thumbOff)),children:L&&o.jsx(Tt,{size:"sm"})})}),L&&o.jsx(lo,{role:"status",children:"Loading"})]}),Z=o.jsx("div",{...G(ws.labelWrapper,hG[w]),children:o.jsx(Sm,{label:e,inputID:$,isLabelHidden:t,isDisabled:l,isOptional:d,isRequired:f,labelIcon:g,labelTooltip:y,description:n,descriptionID:R})});return o.jsxs("div",{...ie(se("switch-field",{labelPosition:v!=="end"?v:void 0,labelSpacing:m!=="hug"?m:void 0}),G(S!=null&&pG.width(S),E),A,z),...M,children:[o.jsxs("div",{ref:ne=>{D.interactionRef(ne)},...G(ws.container,m==="spread"&&ws.containerSpread,!l&&aG),children:[" ",v==="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(t0,{type:k.type,message:k.message,id:_,variant:"detached"})}),I&&D.renderTooltip(u)]})}$3.displayName="Switch";const A3=h.createContext(null);A3.displayName="SegmentedControlContext";function xG(){const e=h.use(A3);if(e==null)throw new Error("useSegmentedControlContext must be used within SegmentedControl. Wrap your SegmentedControlItem in <SegmentedControl>.");return e}const tp={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}},gG={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 o0({ref:e,value:t,onChange:n,label:s,size:i,layout:r="hug",isDisabled:a=!1,disabledMessage:l,children:c,xstyle:u,className:d,style:f,onKeyDown:p,onFocus:x,onBlur:g,...y}){const v=ml(i,"md"),m=a&&!!l,k=Fs({placement:"above",focusTrigger:"always",isEnabled:m}),{listRef:w,handleKeyDown:S,handleFocus:E}=nu({itemSelector:'[role="radio"]:not([aria-disabled="true"])',hasRovingTabIndex:!0,wrap:!0,orientation:"horizontal"}),A=hE({orientation:"horizontal",isEnabled:!a}),z=h.useCallback($=>{p==null||p($),!$.defaultPrevented&&(A.onKeyDown($),S($))},[p,A,S]),N=h.useCallback($=>{var T;if(x==null||x($),$.defaultPrevented||(A.onFocus($),E($),a)||!$.currentTarget.contains($.relatedTarget))return;const R=(T=$.target)==null?void 0:T.closest('[role="radio"][data-value]');if(!R||R.getAttribute("aria-disabled")==="true")return;const _=R.dataset.value;_!=null&&_!==t&&n(_)},[x,A,E,a,n,t]),M=h.useMemo(()=>({value:t,onChange:n,size:v,layout:r,isDisabled:a,hasDisabledMessage:m}),[t,n,v,r,a,m]);return o.jsxs(A3,{value:M,children:[o.jsxs("div",{ref:pn(e,w,k.ref),...y,role:"radiogroup","aria-label":s,"aria-disabled":a||void 0,"aria-describedby":m?k.describedBy:void 0,onKeyDown:z,onFocus:N,onBlur:xm(g,A.onBlur),...ie(se("segmented-control",{size:v}),G(tp.container,gG[v],r==="fill"&&tp.fill,a&&(m?tp.disabledWithMessage:tp.disabled),u),d,f),children:[c,A.hintElement]}),m&&k.renderTooltip(l)]})}o0.displayName="SegmentedControl";const bu={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}},mG={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}},vG={sm:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",$$css:!0},lg:{kzqmXN:"x1xp8n7a",kZKoxP:"xmix8c7",$$css:!0}};function Xi({ref:e,value:t,label:n,isLabelHidden:s=!1,icon:i,isDisabled:r=!1,onClick:a,xstyle:l,...c}){const u=xG(),d=u.value===t,f=r||u.isDisabled,p=d&&(u.hasDisabledMessage??!1)&&!r,x=u.size,g=u.layout==="fill",y=xm(a,()=>{!f&&!d&&u.onChange(t)}),v=i?o.jsx("span",{...G(bu.icon,vG[x]),children:i}):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:y,...ie(se("segmented-control-item",{size:x,selected:d?"selected":null,disabled:f?"disabled":null}),G(bu.base,mG[x],g&&bu.fill,d&&bu.selected,!d&&!f&&bu.hover,f&&bu.disabled,l)),children:[v,!s&&o.jsx("span",{children:n})]})}Xi.displayName="SegmentedControlItem";function yG({selectableItems:e,isDisabled:t=!1,isOpen:n,hasSearch:s=!1,onOpen:i,onClose:r,onToggle:a,onClear:l,hasValue:c=!1,listboxId:u}){const[d,f]=h.useState(-1),[p,x]=h.useState(""),g=h.useRef(void 0),y=h.useCallback(E=>`${u}-item-${E}`,[u]),v=h.useCallback(()=>e.map((E,A)=>E.disabled?-1:A).filter(E=>E>=0),[e]),m=h.useCallback(()=>{f(-1),r()},[r]),k=h.useCallback(()=>{t||(n?m():(i(),s||f(0)))},[t,n,i,m,s]),w=h.useCallback((E,A)=>{E.disabled||f(A)},[]),S=h.useCallback(E=>{if(t)return;const A=v();switch(E.key){case"ArrowDown":if(E.preventDefault(),!n)i(),f(0);else{const z=A.indexOf(d),N=Math.min(z+1,A.length-1);f(A[N]??d)}break;case"ArrowUp":if(E.preventDefault(),!n)i(),f(e.length-1);else{const z=A.indexOf(d),N=Math.max(z-1,0);f(A[N]??d)}break;case"Enter":case" ":if(E.key===" "&&s)break;if(E.preventDefault(),n&&d>=0){const z=e[d];z&&!z.disabled&&a(z.value)}else n||(i(),s||f(0));break;case"Tab":n&&m();break;case"Escape":n&&(E.preventDefault(),m());break;case"Home":E.preventDefault(),n&&A.length>0&&f(A[0]);break;case"End":E.preventDefault(),n&&A.length>0&&f(A[A.length-1]);break;case"PageUp":E.preventDefault(),n&&A.length>0&&f(A[0]);break;case"PageDown":E.preventDefault(),n&&A.length>0&&f(A[A.length-1]);break;case"Delete":case"Backspace":!s&&!n&&l!=null&&c&&(E.preventDefault(),l());break;default:if(!s&&E.key.length===1&&!E.ctrlKey&&!E.metaKey){const z=p+E.key.toLowerCase();x(z),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{x("")},500);const N=e.findIndex(M=>{var $;return!M.disabled&&(($=M.label)==null?void 0:$.toLowerCase().startsWith(z))});N>=0&&(n||i(),f(N))}break}},[t,n,i,m,e,d,a,v,p,s,l,c]);return{highlightedIndex:d,setHighlightedIndex:f,getItemId:y,onTriggerClick:k,onKeyDown:S,onItemMouseEnter:w}}const tv="__xds_select_all__",zi={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}},kG={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},bG={sm:{kmVPX3:"x9epnlk",$$css:!0},md:{k8WAf4:"x1vofgu7",kg3NbH:"xf314gf",$$css:!0},lg:{kmVPX3:"xlsj2fj",$$css:!0}},wG={sm:{kg3NbH:"x7a5moj",k8WAf4:"x13f7esw",$$css:!0},md:{kg3NbH:"xf314gf",k8WAf4:"xu0wf1k",$$css:!0},lg:{kg3NbH:"xf314gf",k8WAf4:"xu0wf1k",$$css:!0}},h8={warning:"warning",error:"error",success:"success"},p8={warning:"warning",error:"error",success:"success"},jG={warning:"@astryx.input.statusButton.warning",error:"@astryx.input.statusButton.error",success:"@astryx.input.statusButton.success"};function dh(e,t){return t?(e.label??e.value).toLowerCase().includes(t.toLowerCase()):!0}function x8(e,t){return t?e.filter(n=>dh(n,t)):e}function y$({label:e,isLabelHidden:t=!1,description:n,isOptional:s=!1,isRequired:i=!1,isDisabled:r=!1,disabledMessage:a,options:l,value:c,onChange:u,changeAction:d,isLoading:f=!1,placeholder:p,size:x,variant:g="input",status:y,statusVariant:v="attached",labelTooltip:m,startIcon:k,hasClear:w=!1,hasSelectAll:S=!1,selectAllLabel:E,hasSearch:A=!1,searchPlaceholder:z,triggerDisplay:N="count",maxBadges:M=3,renderOption:$,isDefaultOpen:R=!1,"data-testid":_,htmlName:T,width:O,xstyle:H,className:L,style:B}){const I=Fe(),D=p??I("@astryx.multiSelector.selectPlaceholder"),q=E??I("@astryx.multiSelector.selectAll"),U=z??I("@astryx.multiSelector.searchPlaceholder"),X=ml(x,"md"),Z=g==="ghost"&&v==="attached"?"detached":v,ne=h.useId(),Y=h.useId(),ae=h.useId(),le=h.useId(),re=h.useId(),ge=h.useId(),be=h.useRef(null),me=h.useRef(null),je=o3(),[we,ye]=h.useState(""),J=we.length>0,[Se,ke]=h.useState(null),[,Ce]=h.useTransition(),[Ee,xe]=h.useOptimistic(c),xt=f||Ee!==c,st=r&&!!a,Gt=Fs({placement:"above",focusTrigger:"always",isEnabled:st}),Wt=Fs({placement:"above",isEnabled:Z==="tooltip"&&!!(y!=null&&y.message)}),{ariaLabelledBy:Jt,ariaDescribedBy:_s}=O4(re,[n?ae:null,!je&&Z!=="tooltip"&&(y!=null&&y.message)?le:null,Z==="tooltip"&&(y!=null&&y.message)?Wt.describedBy:null,st?Gt.describedBy:null],je),Rt=h.useMemo(()=>IE(l),[l]),Ke=iu(),Mn=h.useCallback(ue=>{const _e=Rt.length,Ye=new Set(Rt.map(cn=>cn.value)),Kt=ue.filter(cn=>Ye.has(cn)).length;Kt===0?Ke("Selection cleared"):_e>0&&Kt===_e?Ke("All selected"):Ke(`${Kt} of ${_e} selected`)},[Ke,Rt]),P=h.useMemo(()=>x8(Rt,we),[Rt,we]),F=h.useMemo(()=>{const ue=Se??new Set,_e=[];let Ye=[];const Kt=he=>{const ee=he.filter(ze=>ue.has(ze.value)),Me=he.filter(ze=>!ue.has(ze.value));return[...ee,...Me]},cn=()=>{Ye.length!==0&&(_e.push(...Kt(Ye)),Ye=[])};for(const he of l)if(Iy(he))cn();else if(Jx(he)){cn();const ee=he.options.map(Me=>Va(Me)).filter(Me=>dh(Me,we));_e.push(...Kt(ee))}else if(Qx(he)){const ee=Va(he);dh(ee,we)&&Ye.push(ee)}return cn(),S?[{value:tv,label:q},..._e]:_e},[we,l,Se,S,q]),Q=h.useCallback(()=>{var ue;ye(""),ke(null),Ke(""),(ue=be.current)==null||ue.focus()},[Ke]),de=su({hasLightDismiss:!0,onHide:Q,hasCloseButton:!1,hasAutoFocus:!1,role:"none"});h.useEffect(()=>{R&&de.show()},[]);const fe=h.useCallback(ue=>{if(ye(ue),ue.length===0){Ke("");return}const _e=x8(Rt,ue).length;Ke(_e===0?"No results found":`${_e} result${_e===1?"":"s"}`)},[Ke,Rt]),$e=h.useCallback(()=>{u([]),Mn([]),d&&Ce(async()=>{xe([]),await d([])})},[u,d,Ce,xe,Mn]),Ae=Ee.length>0,Ue=h.useCallback(ue=>{ue.stopPropagation(),$e()},[$e]),St=h.useCallback(ue=>{const _e=Ee.includes(ue)?Ee.filter(Ye=>Ye!==ue):[...Ee,ue];u(_e),Mn(_e),d&&Ce(async()=>{xe(_e),await d(_e)})},[Ee,u,d,Ce,xe,Mn]),He=h.useMemo(()=>P.filter(ue=>!ue.disabled),[P]),at=h.useMemo(()=>He.length>0&&He.every(ue=>Ee.includes(ue.value)),[He,Ee]),ln=h.useMemo(()=>He.some(ue=>Ee.includes(ue.value)),[He,Ee]),Le=at?!0:ln?"indeterminate":!1,gt=h.useCallback(()=>{let ue;if(at){const _e=new Set(He.map(Ye=>Ye.value));ue=Ee.filter(Ye=>!_e.has(Ye))}else{const _e=new Set(Ee);ue=[...Ee];for(const Ye of He)_e.has(Ye.value)||ue.push(Ye.value)}u(ue),Mn(ue),d&&Ce(async()=>{xe(ue),await d(ue)})},[at,He,Ee,u,d,Ce,xe,Mn]),Gs=h.useCallback(ue=>{ue===tv?gt():St(ue)},[gt,St]),{highlightedIndex:en,getItemId:It,onTriggerClick:Ti,onKeyDown:oi,onItemMouseEnter:sr}=yG({selectableItems:F,isDisabled:r,isOpen:de.isOpen,hasSearch:A,onOpen:h.useCallback(()=>{ke(new Set(Ee)),de.show(),A&&requestAnimationFrame(()=>{var ue;(ue=me.current)==null||ue.focus()})},[de,A,Ee]),onClose:de.hide,onToggle:Gs,onClear:w?$e:void 0,hasValue:Ae,listboxId:Y});h.useEffect(()=>{var ue,_e;!de.isOpen||en<0||(_e=(ue=document.getElementById(It(en)))==null?void 0:ue.scrollIntoView)==null||_e.call(ue,{block:"nearest"})},[de.isOpen,en,It]);const Rs=h.useMemo(()=>Ee.map(ue=>{const _e=Rt.find(Ye=>Ye.value===ue);return(_e==null?void 0:_e.label)??ue}),[Ee,Rt]),Cr=h.useCallback(()=>{if(Ee.length===0)return o.jsx("span",{className:"xb3r6kr xlyipyv xuxw1ft",children:D});switch(N){case"count":return o.jsxs("span",{className:"xb3r6kr xlyipyv xuxw1ft",children:[Ee.length," selected"]});case"labels":{const ue=Rs.slice(0,3),_e=Rs.length-ue.length,Ye=_e>0?`${ue.join(", ")}, +${_e}`:ue.join(", ");return o.jsx("span",{className:"xb3r6kr xlyipyv xuxw1ft",children:Ye})}case"badges":{const ue=Rs.slice(0,M),_e=Rs.length-ue.length;return o.jsxs("span",{className:"x78zum5 x1a02dak xzye2dw x6s0dn4",children:[ue.map(Ye=>o.jsx(bf,{label:Ye,variant:"neutral"},Ye)),_e>0&&o.jsxs("span",{className:"x2lah0s xcr08ib xv1l7n4 x1e4wzip",children:["+",_e]})]})}}},[Ee,N,Rs,D,M]),ir=h.useCallback(()=>A?o.jsx("div",{className:"x78zum5 x6s0dn4 xf314gf xu0wf1k",onKeyDown:ue=>{ue.target!==me.current&&ue.key==="Tab"&&!ue.shiftKey&&oi(ue)},children:o.jsx(pt,{ref:me,id:ge,label:I("@astryx.multiSelector.searchOptions"),isLabelHidden:!0,startIcon:"search",hasClear:!0,size:"sm",width:"100%",role:"combobox","aria-expanded":de.isOpen,"aria-controls":Y,"aria-autocomplete":"list","aria-activedescendant":de.isOpen&&en>=0?It(en):void 0,value:we,onChange:fe,onKeyDown:ue=>{if(ue.key==="ArrowDown"||ue.key==="ArrowUp"||ue.key==="PageUp"||ue.key==="PageDown"||ue.key==="Enter"||ue.key==="Escape"){oi(ue);return}ue.key==="Tab"&&(ue.shiftKey||!J)&&oi(ue)},placeholder:U})}):null,[A,ge,Y,we,J,U,fe,oi,de.isOpen,en,It,I]),ai=h.useCallback((ue,_e)=>{const Ye=_e===en,Kt=ue.value===tv,cn=Kt?at:Ee.includes(ue.value),he=Kt?Le:cn,ee=Kt&&Le==="indeterminate";return o.jsxs("div",{id:It(_e),role:"option","aria-selected":cn,"aria-label":ee?I("@astryx.multiSelector.selectAllPartiallySelected",{label:q}):void 0,"aria-disabled":ue.disabled,onClick:()=>{ue.disabled||Gs(ue.value)},onMouseEnter:()=>sr(ue,_e),...G(zi.item,Kt?wG[X]:bG[X],Kt&&zi.selectAllWrapper,Ye&&zi.itemHighlighted,ue.disabled&&zi.itemDisabled),children:[o.jsx("div",{inert:!0,className:"x47corl x78zum5 x2lah0s",children:o.jsx(n0,{label:"",isLabelHidden:!0,value:he,onChange:()=>{},isDisabled:ue.disabled,size:X==="lg"?"md":X})}),$&&!Kt?$(ue):o.jsx("span",{...{0:{className:"x9ynric xcr08ib x1e4wzip x1tgivj0 xeuugli xb3r6kr xlyipyv xuxw1ft"},1:{className:"x9ynric xcr08ib x1e4wzip xeuugli xb3r6kr xlyipyv xuxw1ft xnbbluu"}}[!!ue.disabled<<0],children:ue.label??ue.value})]},ue.value)},[$,en,Ee,at,Le,q,It,Gs,sr,X,I]),Er=h.useCallback(()=>{const ue=[];let _e=0;const Ye=S?F.length-1:F.length;if(S&&Ye>0?(ue.push(ai(F[0],0)),ue.push(o.jsx(Po,{xstyle:zi.divider},"select-all-divider")),_e=1):S&&(_e=1),Ye===0)return ue.push(o.jsx("div",{role:"presentation",className:"x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib",children:"No results found"},"empty")),ue;const Kt=!!we;let cn=0;const he=()=>{for(let ee=0;ee<cn;ee++)ue.push(ai(F[_e],_e)),_e++;cn=0};for(let ee=0;ee<l.length;ee++){const Me=l[ee];if(Iy(Me))he(),Kt||ue.push(o.jsx(Po,{xstyle:zi.divider},`divider-${ee}`));else if(Jx(Me)){he();const ze=Kt?Me.options.filter(nn=>dh(Va(nn),we)).length:Me.options.length;if(ze===0)continue;const dt=[];for(let nn=0;nn<ze;nn++)dt.push(ai(F[_e],_e)),_e++;Me.title&&ue.push(o.jsx(Po,{label:Me.title,xstyle:zi.sectionDivider},`section-divider-${ee}`)),ue.push(o.jsx("div",{role:"group","aria-label":Me.title,children:dt},`section-${ee}`))}else Qx(Me)&&(!Kt||dh(Va(Me),we))&&cn++}return he(),ue},[l,ai,F,we,S]),Te=y!=null&&Z!=="detached",tn=y!=null&&Z==="tooltip"&&!!y.message,bs=o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:ue=>{de.triggerRef(ue),Gt.ref(ue)},onClick:Ti,"data-testid":_,...ie(se("multi-selector",{variant:g,size:X,status:(y==null?void 0:y.type)??null}),G(ul.base,zi.triggerContainer,kG[X],g==="ghost"&&zi.triggerGhost,r&&ul.disabled,g==="ghost"&&r&&zi.triggerGhostDisabled,Ee.length===0&&zi.triggerPlaceholder,g!=="ghost"&&y&&Mm[y.type],g!=="ghost"&&y&&!r&&Tm[y.type],g!=="ghost"&&je&&r3.inGroup,H),L,B),children:[k&&Ji(k,{size:"sm",color:"secondary"}),je&&o.jsx(lo,{id:re,children:e}),o.jsx("button",{ref:be,id:ne,type:"button",role:A?void 0:"combobox","aria-haspopup":"listbox","aria-expanded":de.isOpen,"aria-controls":Y,"aria-activedescendant":!A&&de.isOpen&&en>=0?It(en):void 0,"aria-describedby":_s,"aria-labelledby":Jt,"aria-required":i?"true":void 0,"aria-invalid":(y==null?void 0:y.type)==="error"?"true":void 0,"aria-busy":xt||void 0,disabled:r&&!st,"aria-disabled":st?"true":void 0,onKeyDown:oi,tabIndex:r&&!st?-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:Cr()})}),T!=null&&c.map(ue=>o.jsx("input",{type:"hidden",name:T,value:ue,disabled:r},ue)),xt&&o.jsx(Tt,{size:"sm"}),w&&c.length>0&&!r&&o.jsx("button",{type:"button",onClick:Ue,"aria-label":I("@astryx.multiSelector.clearAll",{label:e}),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:o.jsx(Pe,{icon:"close",size:"sm",color:"secondary",...se("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"}}[!!(!Te&&de.isOpen)<<1|!!Te<<0],children:Te?tn?o.jsx("button",{ref:Wt.ref,type:"button","aria-label":I(jG[y.type]),"aria-describedby":Wt.describedBy,onClick:ue=>ue.stopPropagation(),className:"x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto",children:o.jsx(Pe,{icon:h8[y.type],size:"sm",color:p8[y.type]})}):o.jsx(Pe,{icon:h8[y.type],size:"sm",color:p8[y.type]}):o.jsx(Pe,{icon:"chevronDown",size:"sm",color:"inherit",...se("multi-selector-indicator-icon",{state:de.isOpen?"expanded":"collapsed"})})})]}),de.render(o.jsxs("div",{className:"x9f619 xuyqlj2 x1odjw0f x9epnlk",children:[ir(),o.jsx("div",{id:Y,role:"listbox","aria-multiselectable":"true","aria-labelledby":ne,children:Er()})]}),{placement:"below",alignment:"start",xstyle:zi.popover}),tn&&Wt.renderTooltip((y==null?void 0:y.message)??""),st&&Gt.renderTooltip(a)]});return je?bs:o.jsx(ru,{label:e,isLabelHidden:t,description:n,inputID:ne,descriptionID:n?ae:void 0,isOptional:s,isRequired:i,isDisabled:r,status:y?{type:y.type,message:y.message,messageID:y.message?le:void 0}:void 0,statusVariant:Z,labelTooltip:m,width:O,children:bs})}y$.displayName="MultiSelector";const M3=h.createContext(null);M3.displayName="TabListContext";function k$(){const e=h.use(M3);if(e==null)throw new Error("useTabListContext must be used within TabList. Wrap your Tab/TabMenu in <TabList>.");return e}const SG="[data-tab-value],[data-tab-menu]",nv={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 b$({ref:e,value:t,onChange:n,size:s,layout:i="hug",hasDivider:r=!1,xstyle:a,className:l,style:c,children:u,onKeyDown:d,onFocus:f,onBlur:p,"aria-label":x,"aria-orientation":g,[Zx]:y,...v}){const m=Fe(),k=x??m("@astryx.tabList.label"),w=ml(s,"md"),{listRef:S,handleKeyDown:E,handleFocus:A}=nu({itemSelector:SG,orientation:"both",hasRovingTabIndex:!0}),{hintElement:z,onKeyDown:N,onFocus:M,onBlur:$}=hE(),R=h.useMemo(()=>({value:t,onChange:n,size:w,layout:i}),[t,n,w,i]),_=h.useCallback(H=>{d==null||d(H),!H.defaultPrevented&&(N(H),E(H))},[d,N,E]),T=h.useCallback(H=>{f==null||f(H),!H.defaultPrevented&&(M(H),A(H))},[f,M,A]),O=h.useCallback(H=>{p==null||p(H),!H.defaultPrevented&&$(H)},[p,$]);return o.jsx(M3,{value:R,children:o.jsxs("nav",{ref:pn(e,S),...v,"aria-label":k,onKeyDown:_,onFocus:T,onBlur:O,[Zx]:"",...ie(se("tab-list",{size:w}),G(nv.nav,i==="fill"&&nv.fill,r&&nv.divider,a),l,c),children:[u,z]})})}b$.displayName="TabList";const w$={x1u3b27q:"x1u3b27q",$$css:!0},np={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}},CG={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},EG={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},$G={fill:{kUk6DE:"x98rzlu",kjj79g:"xl56j7k",$$css:!0}},AG={sm:{kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",$$css:!0},md:{kzqmXN:"x1kky2od",kZKoxP:"xlup9mm",$$css:!0},lg:{kzqmXN:"x1xp8n7a",kZKoxP:"xmix8c7",$$css:!0}};function j$({as:e,ref:t,value:n,label:s,isLabelHidden:i=!1,href:r,icon:a,selectedIcon:l,endContent:c,xstyle:u,className:d,style:f,...p}){const x=k$(),g=vl(e),y=x.value===n,v=x.size,m=x.layout==="fill",k=y&&l?l:a,w=!i&&s!=="",S=h.useCallback(()=>{x.onChange(n)},[x,n]),E=k?o.jsx("span",{...G(np.icon,AG[v]),children:k}):null,A={...p,...i?{"aria-label":s}:{},[Zx]:"","data-tab-value":n,"aria-current":y?"page":void 0,tabIndex:y?0:-1,...ie(se("tab",{selected:y?"selected":null}),G(np.base,CG[v],y&&np.selected,m&&$G.fill,w$,u),d,f)},z=o.jsx("span",{"aria-hidden":"true",...G(np.hoverBg,EG[v])}),N=o.jsx("span",{...ie(se("tab-indicator",{selected:y?"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"}}[!!y<<0])}),M=w?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,$=c?o.jsx("span",{className:"x3nfvp2 x6s0dn4 x2lah0s",children:c}):null;return r!=null?o.jsxs(g,{ref:t,href:r,onClick:S,...A,children:[z,E,M,$,N]}):o.jsxs("button",{ref:t,type:"button",onClick:S,...A,children:[z,E,M,$,N]})}j$.displayName="Tab";const sv={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}},MG={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}},TG={sm:{kZKoxP:"x6k0iem",$$css:!0},md:{kZKoxP:"x1ueg155",$$css:!0},lg:{kZKoxP:"xssyfek",$$css:!0}};function S$({ref:e,label:t,options:n,xstyle:s,className:i,style:r}){const a=k$(),l=h.useId(),c=h.useRef(null),u=su({hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none",onHide:h.useCallback(()=>{var A;(A=c.current)==null||A.focus()},[])}),{listRef:d,handleKeyDown:f,handleFocus:p,focusFirst:x}=nu({hasRovingTabIndex:!0,itemSelector:jm,onEscape:()=>u.hide()}),g=h.useCallback(()=>{u.isOpen?u.hide():(u.show(),requestAnimationFrame(()=>x()))},[u,x]),y=h.useCallback(A=>{if(A.key==="Tab"){u.hide();return}f(A)},[f,u]),v=n.find(A=>A.value===a.value),m=(v==null?void 0:v.label)??t,k=v!=null,w=a.size,S=h.useCallback(A=>{a.onChange(A),u.hide()},[a,u]),E=pn(u.triggerRef,c,e);return o.jsxs(o.Fragment,{children:[o.jsxs("button",{ref:E,type:"button","aria-haspopup":"menu","aria-expanded":u.isOpen,"aria-controls":l,"data-tab-menu":"",tabIndex:k?0:-1,onClick:g,...ie(se("tab-menu"),G(sv.trigger,MG[w],k&&sv.triggerSelected,w$,s),i,r),children:[o.jsx("span",{"aria-hidden":"true",...G(sv.hoverBg,TG[w])}),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(Pe,{icon:"chevronDown",size:"sm",color:"inherit"})}),k&&o.jsx("span",{...ie(se("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:y,onFocus:p,...ie(se("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(A=>{const z=a.value===A.value;return o.jsxs("div",{role:"menuitemradio",tabIndex:-1,"aria-checked":z,onClick:()=>S(A.value),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),S(A.value))},...ie(se("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"}}[!!z<<0]),children:[o.jsxs("span",{className:"x78zum5 x6s0dn4 x1txdalj",children:[A.icon&&Ji(A.icon,{size:"sm",color:"secondary"}),A.label]}),z&&o.jsx(Pe,{icon:"check",size:"sm",color:"accent"})]},A.value)})]}),{placement:"below",alignment:"start"})]})}S$.displayName="TabMenu";const zG=.8,Tl={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}},NG={sm:{$$css:!0},md:{$$css:!0},lg:{k8WAf4:"xce4md1",$$css:!0}};function C$({label:e,isLabelHidden:t=!1,description:n,isOptional:s=!1,isRequired:i=!1,onChange:r,changeAction:a,isLoading:l=!1,value:c,placeholder:u,rows:d=3,isDisabled:f=!1,disabledMessage:p,status:x,statusVariant:g="attached",labelTooltip:y,startIcon:v,hasSpellCheck:m=!0,onPaste:k,maxLength:w,hasAutoFocus:S=!1,size:E,htmlName:A,onFocus:z,onBlur:N,width:M,xstyle:$,className:R,style:_,ref:T,...O}){const H=ml(E,"md"),L=Fe(),B=iu(),I=h.useId(),D=h.useId(),q=h.useId(),U=h.useId(),X=h.useRef(null),Z=h.useRef(null),ne=h.useRef(null),[,Y]=h.useTransition(),[ae,le]=h.useOptimistic(c),re=l||ae!==c,ge=f&&!!p,be=Fs({placement:"above",focusTrigger:"always",isEnabled:ge}),{statusIcon:me,describedBy:je}=gE({status:x,statusVariant:g}),we=[n?D:null,g!=="tooltip"&&(x!=null&&x.message)?q:null,je,w!=null?U:null,ge?be.describedBy:null].filter(Boolean).join(" ")||void 0,ye=h.useCallback(Ee=>{if(w==null)return;const xe=Ee>w?"over":Ee>=w*zG?"near":"under";xe!==ne.current&&(ne.current=xe,xe==="over"?B(L("@astryx.textArea.charactersOverLimit",{count:Ee-w}),"assertive"):xe==="near"&&B(L("@astryx.textArea.charactersRemaining",{count:w-Ee})))},[B,L,w]),J=Ee=>{if(f)return;const xe=Ee.target.value;ye(xe.length),r==null||r(xe,Ee),a&&!Ee.defaultPrevented&&Y(async()=>{le(xe),await a(xe,Ee)})},Se=f||re,{onClick:ke,onMouseUp:Ce}=Q4({containerRef:Z,inputRef:X,disabled:Se});return o.jsxs(ru,{label:e,isLabelHidden:t,description:n,inputID:I,descriptionID:n?D:void 0,isOptional:s,isRequired:i,isDisabled:f,status:x?{type:x.type,message:x.message,messageID:x.message?q:void 0}:void 0,statusVariant:g,labelTooltip:y,width:M,children:[o.jsxs("div",{ref:Ee=>{Z.current=Ee,be.ref(Ee)},onClick:ke,onMouseUp:Ce,...ie(se("textarea",{size:H,status:(x==null?void 0:x.type)??null}),G(ul.base,Tl.wrapper,f&&ul.disabled,x&&Mm[x.type],x&&!f&&Tm[x.type],x&&_E[x.type],$),R,_),children:[v&&o.jsx("span",{className:"x10l6tqk xctzyg x1kiyvbf x47corl x78zum5",children:Ji(v,{size:"sm",color:"secondary"})}),o.jsx("textarea",{...O,ref:pn(T,X),id:I,name:A,value:ae,onChange:J,onPaste:k,onFocus:z,onBlur:N,placeholder:u,rows:d,disabled:f&&!ge,"aria-disabled":ge?"true":void 0,readOnly:ge||void 0,spellCheck:m,autoFocus:S,"data-autofocus":S||void 0,"aria-describedby":we,"aria-required":i&&!s?"true":void 0,"aria-invalid":(x==null?void 0:x.type)==="error"||w!=null&&ae.length>w?"true":void 0,"aria-busy":re||void 0,...G(Tl.textarea,NG[H],f&&Tl.textareaDisabled,!!v&&Tl.textareaWithStartIcon,(x||re)&&Tl.textareaWithStatus,re&&!!me&&Tl.textareaWithBusyStatus,w!=null&&Tl.textareaWithCounter)}),(re||me)&&o.jsxs("span",{className:"x10l6tqk xctzyg x13oyzgk x47corl x78zum5 x6s0dn4 x1txdalj",children:[re&&o.jsx(Tt,{size:"sm"}),me]}),w!=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"}}[(ae.length>w)<<0],children:[ae.length>w&&o.jsx(Pe,{icon:"warning",size:"sm"}),ae.length,"/",w]})]}),ge&&be.renderTooltip(p)]})}C$.displayName="TextArea";function E$({ref:e,href:t,isDisabled:n,LinkComponent:s,linkStyleProps:i,labelContent:r,icon:a,endContent:l,removeButton:c,...u}){const d=h.useRef(null),f=h.useRef(null),{onClick:p,onMouseUp:x}=X4({containerRef:d,interactiveRef:f,href:t,disabled:n});return o.jsxs("span",{ref:pn(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,...i,children:r}),l,c]})}E$.displayName="TokenLink";const ui={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}},sp={sm:{kZKoxP:"xzydfjl",kGuDYH:"x141an7d",kg3NbH:"xf314gf",$$css:!0},md:{kZKoxP:"xrmxcn7",kg3NbH:"xf314gf",$$css:!0},lg:{kZKoxP:"x102lyln",kg3NbH:"xf314gf",$$css:!0}},ip={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 $s({label:e,size:t="md",color:n="default",icon:s,isDisabled:i=!1,onRemove:r,onClick:a,href:l,description:c,endContent:u,isLabelHidden:d=!1,xstyle:f,className:p,style:x,"data-testid":g,ref:y}){const v=Fe(),m=vl(),k=mE({href:l,onClick:a,isDisabled:i}),w=a??(k==="button"?()=>{}:null),S=r!=null&&o.jsx("button",{type:"button","aria-label":v("@astryx.token.remove",{label:e}),onClick:z=>{z.stopPropagation(),r(z)},disabled:i,className:"x3nfvp2 x6s0dn4 xl56j7k x1n2onr6 x1717udv xkd40ry x1ypdohk xjspbzw x1kky2od xlup9mm x1heor9g x17nn4n9 x1s928wv x1j6awrg x1xsm0q9",children:o.jsx(Pe,{icon:"close",size:"xsm",color:"inherit"})}),E=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,S]}),A={"data-testid":g,"aria-label":d?e:void 0,"aria-description":c};if(k==="link")return r==null?o.jsx(m,{ref:y,href:l,"aria-disabled":i||void 0,...A,...ie(se("token",{color:n,size:t}),G(ui.base,sp[t],ip[n],ui.interactive,i&&ui.disabled,f),p,x),children:E}):o.jsx(E$,{ref:y,href:l,isDisabled:i,LinkComponent:m,icon:s,endContent:u,removeButton:S,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}),...A,...ie(se("token",{color:n,size:t}),G(ui.base,sp[t],ip[n],ui.interactive,ui.focusVisibleOutline,i&&ui.disabled,f),p,x)});if(w!=null){const z=N=>{N.target.closest("button, a")||w(N)};return o.jsxs("span",{ref:y,onClick:i?void 0:z,...A,...ie(se("token",{color:n,size:t}),G(ui.base,sp[t],ip[n],ui.interactive,ui.focusVisibleOutline,i&&ui.disabled,f),p,x),children:[s,o.jsx("button",{type:"button",onClick:w,disabled:i,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,S]})}return o.jsx("span",{ref:y,...A,...ie(se("token",{color:n,size:t}),G(ui.base,sp[t],ip[n],i&&ui.disabled,f),p,x),children:E})}$s.displayName="Token";const _G=1e3,RG=100,g8={root:{kWkggS:"xprdx6m x1j0df82 x1o55y2u",kSiTet:"xvpkmg4 x1tbh5bv",$$css:!0},animate:{kILWW9:"xpz12be",k44tkh:"xqgcaz",ko0y90:"xa4qsjk",kKVMdj:"xeuoslp x1aquc0h",kyAemX:"x193epu2",$$css:!0}},IG={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}},LG={kKxzle:"xvo38ju",$$css:!0},m8={animationDelay:e=>[LG,{"--x-animationDelay":(t=>typeof t=="number"?t+"ms":t??void 0)(`${_G+RG*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 Hc({width:e="100%",height:t="100%",radius:n=3,index:s=0,"data-testid":i,xstyle:r,className:a,style:l,ref:c,...u}){return o.jsx("div",{ref:c,"aria-hidden":"true","data-testid":i,...ie(se("skeleton"),G(g8.root,g8.animate,IG[n],m8.dimensions(e,t),m8.animationDelay(s),r),a,l),...u})}Hc.displayName="Skeleton";const iv={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 OG(){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 ig({src:e,alt:t,label:n,onRemove:s,onClick:i,isLoading:r=!1,isDisabled:a=!1,showRemoveOn:l="hover",xstyle:c,className:u,style:d,"data-testid":f,ref:p,...x}){const g=Fe(),[y,v]=h.useState(void 0),m=e!=null,k=m&&y===e,w=r&&!m,S=m&&!w&&!k,E=r&&m,A=!r&&!m||k,z=i!=null&&!a&&!r,N=s!=null&&!a,M=N&&l==="hover",{getContainerProps:$,getContentRevealProps:R}=oP({isEnabled:M}),_=n&&t?`${n} — ${t}`:n??t??g("@astryx.thumbnail.fallbackName"),T=!t,O=t!=null||n!=null||x["aria-label"]!=null||x["aria-labelledby"]!=null;wf("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&&!O);const H=o.jsxs(o.Fragment,{children:[S&&o.jsx("img",{src:e,alt:t??"",role:T?"presentation":void 0,"aria-hidden":T||void 0,onError:()=>v(e),className:"xh8yej3 x5yr21d xl1xv1r x1lliihq"}),w&&o.jsx(Hc,{radius:2}),A&&o.jsx("div",{className:"x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xv9yike",children:o.jsx(OG,{})})]}),L=N?o.jsx("div",{...ie({className:"x10l6tqk x8d4r5l xy3asu9 x1vjfegm x14ju556"},M?R({isLayoutPreserved:!0}):{}),children:o.jsx(K,{icon:o.jsx(Pe,{icon:"close",size:"xsm"}),label:g("@astryx.thumbnail.remove",{accessibleName:_}),variant:"secondary",size:"sm",isIconOnly:!0,onClick:I=>{I.stopPropagation(),s(I)},xstyle:iv.removeButtonOverrides})}):null,B=o.jsx("div",{ref:p,"data-testid":f,role:"group","aria-label":_,...ie(se("thumbnail"),G(iv.root,a&&iv.disabled,c),u,d),...x,children:o.jsxs("div",{...ie({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"}}[!!z<<2|!!z<<1|!!z<<0],M?$():{}),children:[z?o.jsx("button",{type:"button",onClick:i,"aria-label":g("@astryx.thumbnail.open",{accessibleName:_}),className:"x1ypdohk x1lliihq xh8yej3 x5yr21d xh6dtrn xb3r6kr",children:H}):H,S&&o.jsx("div",{className:"x10l6tqk x10a8y8t x1pjcqnp x1er153n x47corl"}),E&&o.jsx("div",{className:"x10l6tqk x10a8y8t x78zum5 x6s0dn4 xl56j7k x1u4601x x1pjcqnp x1vjfegm x14ju556",children:o.jsx(Tt,{size:"sm",shade:"onMedia"})}),L]})});return n!=null?o.jsx(ia,{content:n,children:B}):B}ig.displayName="Thumbnail";function T3({ref:e,isOpen:t,isInline:n,onOpenChange:s,title:i,description:r,cancelLabel:a,actionLabel:l,actionVariant:c="destructive",isActionLoading:u,onAction:d,width:f=400,xstyle:p,className:x,style:g,"data-testid":y,...v}){const m=Fe(),k=a??m("@astryx.alertDialog.cancel"),w=h.useId(),S=h.useId(),E=h.useCallback(()=>{s(!1)},[s]);return o.jsx(os,{...v,ref:e,isOpen:t,isInline:n,onOpenChange:s,width:f,purpose:"form",role:"alertdialog","aria-labelledby":w,"aria-describedby":S,...ie(se("alert-dialog"),{className:x,style:g}),xstyle:p,"data-testid":y,children:o.jsx(Wn,{content:o.jsxs(Kn,{children:[o.jsx(xn,{level:2,id:w,children:i}),o.jsx(W,{type:"body",color:"secondary",id:S,children:r})]}),footer:o.jsx(jr,{children:o.jsxs(pe,{gap:2,hAlign:"end",children:[o.jsx(K,{variant:"ghost",label:k,onClick:E}),o.jsx(K,{variant:c,label:l,onClick:d,isLoading:u})]})})})})}T3.displayName="AlertDialog";const Wf={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)}]},DG="@astryx.dropdownMenu.label";function jf({button:e,isMenuOpen:t,onOpenChange:n,menuWidth:s,onClick:i,hasChevron:r=!0,placement:a="below",alignment:l="start",className:c,style:u,xstyle:d,"data-testid":f,...p}){const x=Fe(),g=e??{label:x(DG)},y=("items"in p?p.items:void 0)??[],v=p.children,{items:m,children:k,...w}=p,S=h.useId(),E=g.size??"md",A=h.useRef(null),[z,N]=h.useState(!1),M=t!==void 0,$=M?t:z,R=h.useRef(0),_=h.useCallback(()=>{var ye;R.current=Date.now(),n==null||n(!1),M||N(!1),(ye=A.current)==null||ye.focus()},[M,n]),T=h.useRef(!1),O=h.useCallback(()=>{n==null||n(!0),M||N(!0)},[M,n]),H=su({onHide:_,onShow:O,hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:"none"}),L=h.useCallback(()=>{H.hide()},[H]),{listRef:B,handleKeyDown:I,focusFirst:D,focusItem:q,ownsEvent:U,getItems:X}=nu({itemSelector:jm,boundarySelector:Z4,wrap:!1,onEscape:L}),Z=K4({getItemLabels:()=>X().map(ye=>ye.textContent),onMatch:q,getCurrentIndex:()=>X().findIndex(ye=>ye===document.activeElement||ye.contains(document.activeElement))});h.useEffect(()=>{M&&(t&&!H.isOpen?(T.current=!0,H.show()):!t&&H.isOpen&&H.hide())},[t,M,H]),h.useEffect(()=>{!H.isOpen||!T.current||(T.current=!1,requestAnimationFrame(()=>D()))},[H.isOpen,D]);const ne=h.useCallback(ye=>{if(U(ye)){if(ye.key==="Enter"||ye.key===" "){ye.preventDefault();const J=document.activeElement;J&&wm.has(J.getAttribute("role")??"")&&J.click();return}if(ye.key==="Tab"){L();return}if(Z.onKeyDown(ye)){ye.preventDefault();return}I(ye)}},[I,L,Z,U]),Y=h.useCallback(()=>{T.current=!0,H.show()},[H]),ae=h.useCallback(()=>{Date.now()-R.current<50||(i==null||i(),M?n==null||n(!t):H.isOpen?H.hide():Y())},[i,M,n,t,H,Y]),le=h.useCallback(ye=>{H.isOpen||(ye.key==="ArrowDown"||ye.key==="Enter"||ye.key===" ")&&(ye.preventDefault(),Y())},[H.isOpen,Y]),re=g.isIconOnly===!0,ge=g.endContent??(r&&!re?o.jsx(Pe,{icon:"chevronDown",size:"sm",color:"inherit"}):void 0),be=s?Wf.popoverCustomWidth(s):Wf.popover,me=a==="above"||a==="below"?Wf.popoverBlockGap:Wf.popoverInlineGap,je=h.useMemo(()=>({closeMenu:L,menuSize:E}),[L,E]),we=p.items!==void 0?Y4(y):v;return o.jsxs(o.Fragment,{children:[o.jsx(K,{...g,ref:ye=>{A.current=ye,H.triggerRef(ye);const J=g.ref;typeof J=="function"?J(ye):J&&(J.current=ye)},tooltip:$?void 0:g.tooltip,endContent:ge,onClick:ae,onKeyDown:le,"aria-haspopup":"menu","aria-expanded":$,"aria-controls":S,"data-testid":f}),H.render(o.jsx("div",{...w,ref:B,id:S,role:"menu","aria-label":g.label,onKeyDown:ne,...ie(se("dropdown-menu"),G(Wf.dropdown,d),c,u),children:o.jsx(e0,{value:je,children:we})}),{placement:a,alignment:l,xstyle:[be,me,qo[a]]})]})}jf.displayName="DropdownMenu";function ou({items:e,label:t,variant:n="ghost",size:s,icon:i,isDisabled:r=!1,isMenuOpen:a,onOpenChange:l,xstyle:c,className:u,style:d,"data-testid":f,ref:p}){const x=Fe(),g=t??x("@astryx.moreMenu.label"),y=ml(s,"md"),v=Vd("moreHorizontal");return o.jsx(jf,{className:u?`${Sy("more-menu")} ${u}`:Sy("more-menu"),xstyle:c,style:d,isMenuOpen:a,onOpenChange:l,button:{label:g,icon:i??v,variant:n,size:y,isDisabled:r,tooltip:g,isIconOnly:!0,ref:p},items:e,hasChevron:!1,"data-testid":f})}ou.displayName="MoreMenu";const po={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}},BG={kzqmXN:"xn9wirt",ks0D6T:"xf68679",$$css:!0},HG={width:e=>[BG,{"--x-maxWidth":(t=>typeof t=="number"?t+"px":t??void 0)(`${e}px`)}]};function z3({isOpen:e,onOpenChange:t,children:n,header:s,width:i=320,side:r="auto",label:a,"data-testid":l,xstyle:c,className:u,style:d,onClick:f,ref:p,...x}){const g=Fe(),y=bm(),v=e??y.isMobileNavOpen,m=h.useId(),k=y.mobileNavId||m,w=h.useMemo(()=>t??(R=>{R?y.openMobileNav():y.closeMobileNav()}),[t,y]),S=h.useRef(null),E=h.useRef(null),[A,z]=h.useState(r==="auto"?"end":r);h.useEffect(()=>{const R=S.current;if(R){if(E.current&&(clearTimeout(E.current),E.current=null),v){if(r==="auto"){const _=document.activeElement;if(_&&_!==document.body){const T=_.getBoundingClientRect(),O=T.left+T.width/2;z(O<window.innerWidth/2?"start":"end")}}else z(r);R.open||R.showModal(),document.documentElement.style.overflow="clip"}else if(R.open){document.documentElement.style.overflow="";const _=window.matchMedia("(prefers-reduced-motion: reduce)").matches?10:250;E.current=setTimeout(()=>{R.close()},_)}return()=>{E.current&&(clearTimeout(E.current),E.current=null),document.documentElement.style.overflow="",R.open&&R.close()}}},[v,r]);const N=h.useCallback(R=>{R.preventDefault(),w(!1)},[w]),M=h.useCallback(R=>{R.target===R.currentTarget&&w(!1)},[w]),$=A==="start";return o.jsx("dialog",{ref:pn(p,S),id:k,...ie(se("mobile-nav",{side:A}),G(po.dialog,v&&po.open,po.backdrop,v&&po.backdropOpen,c),u,d),...x,"data-testid":l,"aria-label":a??(typeof s=="string"?s:g("@astryx.mobileNav.navigation")),onClick:xm(f,M),onCancel:N,children:o.jsxs("div",{tabIndex:-1,...G(po.drawer,HG.width(i),$&&po.drawerStart,$&&v&&po.drawerStartOpen,!$&&po.drawerEnd,!$&&v&&po.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(xn,{level:2,children:s})}):s??null,o.jsx(K,{variant:"ghost",label:g("@astryx.mobileNav.closeNavigation"),icon:o.jsx(Pe,{icon:"close",color:"inherit"}),onClick:()=>w(!1),isIconOnly:!0})]}),o.jsx("div",{className:"x98rzlu x1odjw0f x6ikm8r xish69e xx69xxh xf314gf xce4md1",children:n})]})})}z3.displayName="MobileNav";const ha={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}},Im=h.createContext({isCollapsed:!1,toggle:()=>{},isCollapsible:!1});Im.displayName="SideNavCollapseContext";function N3(){return h.use(Im)}function $$({ref:e,handleRef:t,label:n,children:s,onClick:i,...r}){const a=Fe(),l=Vd("chevronLeft"),{isCollapsed:c,toggle:u,isCollapsible:d}=qG(t),{isMobile:f}=bm();return!d||f?null:o.jsx(K,{ref:e,label:n??a(c?"@astryx.sideNavCollapseButton.expandSidebar":"@astryx.sideNavCollapseButton.collapseSidebar"),variant:"ghost",...r,onClick:xm(i,u),icon:s??o.jsx("span",{...G(Fd.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})}$$.displayName="SideNavCollapseButton";function qG(e){var s;const t=N3();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 i,r;(r=(i=e.current)==null?void 0:i.getCollapseState())==null||r.toggle()},isCollapsible:(n==null?void 0:n.isCollapsible)??!0}}const PG=160,rv={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 _3({header:e,topContent:t,children:n,footer:s,footerIcons:i,collapsible:r=!1,resizable:a=!1,xstyle:l,className:c,style:u,"data-testid":d,ref:f,handleRef:p,...x}){const g=Fe(),y=typeof r=="object"?r:{},v=!!r,m=y.hasButton??!0,k=y.defaultIsCollapsed??!1,w=y.isCollapsed,S=y.onCollapsedChange,E=typeof a=="object"?a:{},A=!!a,z=w!==void 0,[N,M]=h.useState(k),$=z?w:N,R=h.useRef(null),_=h.useRef({isCollapsed:$,toggle:()=>{},isCollapsible:v}),T=h.useCallback(ae=>{z||M(ae),S==null||S(ae)},[z,S]),O=g$({defaultSize:E.defaultWidth??260,minSizePx:E.minWidth??180,maxSizePx:E.maxWidth??480,collapsible:v,collapsedSize:PG,autoSaveId:E.autoSaveId,onSizeChange:E.onWidthChange,onCollapseChange:v?T:void 0}),H=h.useCallback(()=>{const ae=!$;_.current={..._.current,isCollapsed:ae},T(ae),A&&(ae?O.collapse():O.expand())},[$,T,A,O]),L=A&&!$;_.current={isCollapsed:$,toggle:H,isCollapsible:v};const B={isCollapsed:$,toggle:H,isCollapsible:v};h.useImperativeHandle(p,()=>({getCollapseState:()=>_.current}),[]);const I=QC();if(I==="topbar")return o.jsxs("div",{"data-testid":d,...ie(se("side-nav",{mode:"topbar"}),G(rv.topbar,l),c,u),children:[e,o.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw xvc5jky",children:i})]});const D=!!(s||i);if(I==="drawer")return o.jsxs(z3,{header:e,"data-testid":d,children:[t,n,D&&o.jsxs("div",{className:"x78zum5 xdt5ytf xr1yuqi x1txdalj x1xye8es",children:[s,i&&o.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:i})]})]});if(I==="drawer-content")return o.jsxs(o.Fragment,{children:[t,n,D&&o.jsxs("div",{className:"x78zum5 xdt5ytf xr1yuqi x1txdalj x1xye8es",children:[s,i&&o.jsx("div",{className:"x78zum5 x6s0dn4 xzye2dw",children:i})]})]});const q=!!(e||t),U=!!(s||i),X=v&&m,Z=A?{...u??{},width:$?void 0:O.size}:u,ne=o.jsxs("nav",{ref:pn(f,R),role:"navigation","aria-label":g("@astryx.sideNav.label"),"data-testid":d,...ie(se("side-nav"),G(rv.root,$&&rv.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"}}[!!$<<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"}}[!!$<<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"}}[!!$<<0],children:[s,o.jsxs("div",{...{0:{className:"x78zum5 x6s0dn4 xzye2dw"},1:{className:"x78zum5 x6s0dn4 xzye2dw x3ieub6"}}[!!$<<0],children:[X&&o.jsx($$,{}),i]})]})]}),Y=L?o.jsxs("div",{className:"x1n2onr6 x78zum5 x2lah0s x5yr21d",children:[ne,o.jsx(C3,{"data-testid":"astryx-sidenav-resize-handle",direction:"horizontal",position:"overlay",pillPlacement:"end",isAlwaysVisible:!1,resizable:O.props,label:g("@astryx.sideNav.resizeSidebar")})]}):ne;return v?o.jsx(Im,{value:B,children:Y}):Y}_3.displayName="SideNav";const wu={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}},UG={isCollapsed:!1,toggle:()=>{},isCollapsible:!1};function ov({href:e,as:t,isDisabled:n,onClick:s,ref:i,children:r,...a}){const l=vl(t);return e&&!n?o.jsx(l,{ref:i,href:e,onClick:s,...a,children:r}):o.jsx("button",{ref:i,type:"button",onClick:s,disabled:n,...a,children:r})}function _o({as:e,label:t,icon:n,selectedIcon:s,isSelected:i=!1,isDisabled:r=!1,href:a,onClick:l,endContent:c,children:u,collapsible:d,size:f="md","data-testid":p,ref:x,xstyle:g}){const y=Fe(),v=Vd("chevronDown"),{isCollapsed:m}=N3(),k=QC(),{closeMobileNav:w}=bm(),S=k==="drawer"||k==="drawer-content",E=h.useId(),A=!!u,z=h.useRef(null),N=su({hasLightDismiss:!0,hasAutoFocus:!0,hasCloseButton:!1,dialogLabel:`${t} submenu`}),M=h.useMemo(()=>typeof d=="object"?d:{},[d]),$=A&&d!==!1,R=M.isCollapsed,_=R!==void 0,[T,O]=h.useState(M.defaultIsCollapsed??!1),H=_?R:T,L=h.useCallback(()=>{var ye;const we=!H;_||O(we),(ye=M.onCollapsedChange)==null||ye.call(M,we)},[H,_,M]),B=i&&s?s:n,D=$&&(!!a||!!l)&&!m,q=we=>{if(r){we.preventDefault();return}if($&&!D&&!m){we.preventDefault(),L();return}l==null||l(we),S&&w()},U=we=>{we.preventDefault(),we.stopPropagation(),L()},X=h.useRef(null),Z=h.useRef(null),ne=h.useCallback(()=>{X.current&&(clearTimeout(X.current),X.current=null),Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),Y=h.useCallback(()=>{ne(),X.current=setTimeout(()=>{N.show({skipAutoFocus:!0})},150)},[ne,N]),ae=h.useCallback(()=>{ne(),Z.current=setTimeout(()=>{N.hide()},200)},[ne,N]),le=h.useCallback(()=>{Y()},[Y]),re=h.useCallback(()=>{ae()},[ae]);if(m&&!n)return null;if(m){const we=B&&Ji(B,{size:"sm",color:i?"primary":r?"disabled":"secondary"}),ye=ie(se("side-nav-item",{size:f,selected:i?"selected":null}),G(ha.item,ha[f],wu.itemCollapsed,f==="sm"&&wu.itemCollapsedSm,f==="lg"&&wu.itemCollapsedLg,i&&ha.selected,r&&ha.disabled));if(A)return o.jsxs("div",{...G(wu.root,g),children:[o.jsx("button",{ref:pn(x,N.triggerRef),type:"button",onClick:N.toggle,onMouseEnter:le,onMouseLeave:re,"aria-label":t,"data-testid":p,...N.triggerProps,...ye,children:we}),N.render(o.jsxs("div",{className:"x1litavf x1y0btm7 x14i3s5s xu0wf1k x7a5moj x11g1kdw xfb3i0g",onMouseEnter:le,onMouseLeave:re,onClick:()=>N.hide(),children:[o.jsx("div",{className:"xf314gf xu0wf1k x141an7d x2mo6ok xv1l7n4 x1ltkj2j",children:t}),o.jsx(Im,{value:UG,children:u})]}),{placement:"end",alignment:"start"})]});const J={"aria-current":i?"page":void 0,"aria-disabled":r||void 0,"aria-label":t,"data-testid":p},Se=o.jsx(ov,{ref:x,href:a,as:e,isDisabled:r,onClick:q,...J,...ye,children:we});return o.jsxs("div",{ref:z,...G(wu.root,g),children:[Se,o.jsx(ia,{content:t,placement:"end",anchorRef:z})]})}const ge=o.jsxs(o.Fragment,{children:[B&&Ji(B,{size:"sm",color:i?"primary":r?"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&&$&&!D&&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"}}[!H<<0],children:v})]}),be=ie(se("side-nav-item",{size:f,selected:i?"selected":null}),G(ha.item,ha[f],i&&ha.selected,r&&ha.disabled));let me;if(D)me=o.jsxs("div",{"data-testid":p,...be,children:[o.jsx(ov,{ref:x,href:a,as:e,isDisabled:r,onClick:q,"aria-current":i?"page":void 0,className:"x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli x1heor9g x1hl2dhg x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x1pd3egz x15bjb6t x1yc453h x1ypdohk",children:ge}),o.jsx("button",{type:"button",onClick:U,"aria-label":H?y("@astryx.sideNavItem.expand",{label:t}):y("@astryx.sideNavItem.collapse",{label:t}),"aria-expanded":!H,"aria-controls":`${E}-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"}}[!H<<0],children:v})})]});else{const we={"aria-current":i?"page":void 0,"aria-disabled":r||void 0,"aria-expanded":$?!H:void 0,"aria-controls":$?`${E}-children`:void 0,"data-testid":p};me=o.jsx(ov,{ref:x,href:a,as:e,isDisabled:r,onClick:q,...we,...be,children:ge})}return o.jsxs("div",{ref:z,...G(wu.root,g),children:[me,A&&!m&&o.jsx("div",{id:`${E}-children`,role:"group","aria-labelledby":`${E}-label`,"aria-hidden":H,inert:H?!0:void 0,...{0:{className:"xrvj5dj x1tu4anv x1qn9uv2 x80gvsz xlr8y92"},1:{className:"xrvj5dj x1qn9uv2 x80gvsz xlr8y92 xihq33y"}}[!!H<<0],children:o.jsxs("div",{className:"xb3r6kr x2lwn1j x31w388",children:[o.jsx("span",{id:`${E}-label`,hidden:!0,children:t}),u]})})]})}_o.displayName="SideNavItem";const FG={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",k8WAf4:"xu0wf1k",$$css:!0}};function Lm({ref:e,title:t,subtitle:n,children:s,endContent:i,isHeaderHidden:r=!1,xstyle:a,className:l,style:c,"data-testid":u,...d}){const{isCollapsed:f}=N3(),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})]}),i&&o.jsx("span",{className:"x2lah0s x78zum5 x6s0dn4",children:i})]}),y=r||f,v=y?{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,...ie(se("side-nav-section"),G(FG.root,a),l,c),...d,role:"group","aria-labelledby":x,"data-testid":u,children:[o.jsx("div",{...ie({className:"x78zum5 x6s0dn4 x1txdalj xf314gf xu0wf1k xt0e3qv x87ps6o"},{style:y?v:void 0}),children:g}),o.jsx("div",{className:"x78zum5 xdt5ytf x1lsbc85",children:s})]})}Lm.displayName="SideNavSection";var A$={exports:{}},Om={},M$={exports:{}},T$={};/**
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(L,B){var I=L.length;L.push(B);e:for(;0<I;){var D=I-1>>>1,q=L[D];if(0<i(q,B))L[D]=B,L[I]=q,I=D;else break e}}function n(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var B=L[0],I=L.pop();if(I!==B){L[0]=I;e:for(var D=0,q=L.length,U=q>>>1;D<U;){var X=2*(D+1)-1,Z=L[X],ne=X+1,Y=L[ne];if(0>i(Z,I))ne<q&&0>i(Y,Z)?(L[D]=Y,L[ne]=I,D=ne):(L[D]=Z,L[X]=I,D=X);else if(ne<q&&0>i(Y,I))L[D]=Y,L[ne]=I,D=ne;else break e}}return B}function i(L,B){var I=L.sortIndex-B.sortIndex;return I!==0?I:L.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;e.unstable_now=function(){return r.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,y=!1,v=!1,m=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function S(L){for(var B=n(u);B!==null;){if(B.callback===null)s(u);else if(B.startTime<=L)s(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=n(u)}}function E(L){if(y=!1,S(L),!g)if(n(c)!==null)g=!0,A||(A=!0,_());else{var B=n(u);B!==null&&H(E,B.startTime-L)}}var A=!1,z=-1,N=5,M=-1;function $(){return v?!0:!(e.unstable_now()-M<N)}function R(){if(v=!1,A){var L=e.unstable_now();M=L;var B=!0;try{e:{g=!1,y&&(y=!1,k(z),z=-1),x=!0;var I=p;try{t:{for(S(L),f=n(c);f!==null&&!(f.expirationTime>L&&$());){var D=f.callback;if(typeof D=="function"){f.callback=null,p=f.priorityLevel;var q=D(f.expirationTime<=L);if(L=e.unstable_now(),typeof q=="function"){f.callback=q,S(L),B=!0;break t}f===n(c)&&s(c),S(L)}else s(c);f=n(c)}if(f!==null)B=!0;else{var U=n(u);U!==null&&H(E,U.startTime-L),B=!1}}break e}finally{f=null,p=I,x=!1}B=void 0}}finally{B?_():A=!1}}}var _;if(typeof w=="function")_=function(){w(R)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,O=T.port2;T.port1.onmessage=R,_=function(){O.postMessage(null)}}else _=function(){m(R,0)};function H(L,B){z=m(function(){L(e.unstable_now())},B)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(L){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var I=p;p=B;try{return L()}finally{p=I}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(L,B){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var I=p;p=L;try{return B()}finally{p=I}},e.unstable_scheduleCallback=function(L,B,I){var D=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?D+I:D):I=D,L){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=I+q,L={id:d++,callback:B,priorityLevel:L,startTime:I,expirationTime:q,sortIndex:-1},I>D?(L.sortIndex=I,t(u,L),n(c)===null&&L===n(u)&&(y?(k(z),z=-1):y=!0,H(E,I-D))):(L.sortIndex=q,t(c,L),g||x||(g=!0,A||(A=!0,_()))),L},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(L){var B=p;return function(){var I=p;p=B;try{return L.apply(this,arguments)}finally{p=I}}}})(T$);M$.exports=T$;var VG=M$.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 Un=VG,z$=h,GG=Gd;function ce(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 N$(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function a0(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 _$(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 R$(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 v8(e){if(a0(e)!==e)throw Error(ce(188))}function WG(e){var t=e.alternate;if(!t){if(t=a0(e),t===null)throw Error(ce(188));return t!==e?null:e}for(var n=e,s=t;;){var i=n.return;if(i===null)break;var r=i.alternate;if(r===null){if(s=i.return,s!==null){n=s;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===n)return v8(i),e;if(r===s)return v8(i),t;r=r.sibling}throw Error(ce(188))}if(n.return!==s.return)n=i,s=r;else{for(var a=!1,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){for(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)throw Error(ce(189))}}if(n.alternate!==s)throw Error(ce(190))}if(n.tag!==3)throw Error(ce(188));return n.stateNode.current===n?e:t}function I$(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=I$(e),t!==null)return t;e=e.sibling}return null}function ii(e,t,n,s,i,r){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,s,i,r)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&ii(e.child,t,n,s,i,r))return!0;e=e.sibling}return!1}function au(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 y8(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 L$(e){var t=[null,null],n=au(e);return n===null||O$(t,e,n.child,{foundSelf:!1}),t}function O$(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)&&O$(e,t,n.child,s))return!0;n=n.sibling}return!1}function qn(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(ce(559))}}var Fu=null,Uy=null;function KG(e,t,n){return e===n?!0:e===t?(Fu=e,!0):!1}function XG(e,t,n){return e===n?(Uy=e,!1):e===t?(Uy!==null&&(Fu=e),!0):!1}function k8(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 Fy(e,t,n){for(var s=0,i=e;i;i=n(i))s++;i=0;for(var r=t;r;r=n(r))i++;for(;0<s-i;)e=n(e),s--;for(;0<i-s;)t=n(t),i--;for(;s--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var Bt=Object.assign,ZG=Symbol.for("react.element"),rp=Symbol.for("react.transitional.element"),fh=Symbol.for("react.portal"),Vu=Symbol.for("react.fragment"),D$=Symbol.for("react.strict_mode"),Vy=Symbol.for("react.profiler"),B$=Symbol.for("react.consumer"),Yr=Symbol.for("react.context"),R3=Symbol.for("react.forward_ref"),Gy=Symbol.for("react.suspense"),Wy=Symbol.for("react.suspense_list"),I3=Symbol.for("react.memo"),Sa=Symbol.for("react.lazy"),Ky=Symbol.for("react.activity"),YG=Symbol.for("react.legacy_hidden"),QG=Symbol.for("react.memo_cache_sentinel"),Xy=Symbol.for("react.view_transition"),JG=Symbol.for("react.recoverable"),b8=Symbol.iterator;function Kf(e){return e===null||typeof e!="object"?null:(e=b8&&e[b8]||e["@@iterator"],typeof e=="function"?e:null)}var eW=Symbol.for("react.client.reference");function Zy(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===eW?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Vu:return"Fragment";case Vy:return"Profiler";case D$:return"StrictMode";case Gy:return"Suspense";case Wy:return"SuspenseList";case Ky:return"Activity";case Xy:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case fh:return"Portal";case Yr:return e.displayName||"Context";case B$:return(e._context.displayName||"Context")+".Consumer";case R3:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I3:return t=e.displayName||null,t!==null?t:Zy(e.type)||"Memo";case Sa:t=e._payload,e=e._init;try{return Zy(e(t))}catch{}}return null}var hh=Array.isArray,Ve=z$.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,wt=GG.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Nc={pending:!1,data:null,method:null,action:null},Yy=[],Gu=-1;function co(e){return{current:e}}function gs(e){0>Gu||(e.current=Yy[Gu],Yy[Gu]=null,Gu--)}function Vt(e,t){Gu++,Yy[Gu]=e.current,e.current=t}var so=co(null),r1=co(null),Ja=co(null),rg=co(null);function og(e,t){switch(Vt(Ja,t),Vt(r1,e),Vt(so,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?R9(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=R9(t),e=aT(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}gs(so),Vt(so,e)}function Wd(){gs(so),gs(r1),gs(Ja)}function Qy(e){var t=e.memoizedState;t!==null&&(sf._currentValue=t.memoizedState,Vt(rg,e)),t=so.current;var n=aT(t,e.type);t!==n&&(Vt(r1,e),Vt(so,n))}function ag(e){r1.current===e&&(gs(so),gs(r1)),rg.current===e&&(gs(rg),sf._currentValue=Nc)}var av,w8;function ma(e){if(av===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);av=t&&t[1]||"",w8=-1<n.stack.indexOf(`
184
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
185
+ `+av+e+w8}var lv=!1;function cv(e,t){if(!e||lv)return"";lv=!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 i=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=s.DetermineComponentFrameRoot(),a=r[0],l=r[1];if(a&&l){var c=a.split(`
186
+ `),u=l.split(`
187
+ `);for(i=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;i<u.length&&!u[i].includes("DetermineComponentFrameRoot");)i++;if(s===c.length||i===u.length)for(s=c.length-1,i=u.length-1;1<=s&&0<=i&&c[s]!==u[i];)i--;for(;1<=s&&0<=i;s--,i--)if(c[s]!==u[i]){if(s!==1||i!==1)do if(s--,i--,0>i||c[s]!==u[i]){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<=i);break}}}finally{lv=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ma(n):""}function tW(e,t){switch(e.tag){case 26:case 27:case 5:return ma(e.type);case 16:return ma("Lazy");case 13:return e.child!==t&&t!==null?ma("Suspense Fallback"):ma("Suspense");case 19:return ma("SuspenseList");case 0:case 15:return cv(e.type,!1);case 11:return cv(e.type.render,!1);case 1:return cv(e.type,!0);case 31:return ma("Activity");case 30:return ma("ViewTransition");default:return""}}function j8(e){try{var t="",n=null;do t+=tW(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
189
+ Error generating stack: `+s.message+`
190
+ `+s.stack}}var Jy=Object.prototype.hasOwnProperty,L3=Un.unstable_scheduleCallback,uv=Un.unstable_cancelCallback,nW=Un.unstable_shouldYield,sW=Un.unstable_requestPaint,wi=Un.unstable_now,iW=Un.unstable_getCurrentPriorityLevel,H$=Un.unstable_ImmediatePriority,q$=Un.unstable_UserBlockingPriority,lg=Un.unstable_NormalPriority,rW=Un.unstable_LowPriority,P$=Un.unstable_IdlePriority,oW=Un.log,aW=Un.unstable_setDisableYieldValue,l0=null,ji=null;function Ga(e){if(typeof oW=="function"&&aW(e),ji&&typeof ji.setStrictMode=="function")try{ji.setStrictMode(l0,e)}catch{}}var Si=Math.clz32?Math.clz32:uW,lW=Math.log,cW=Math.LN2;function uW(e){return e>>>=0,e===0?32:31-(lW(e)/cW|0)|0}var op=256,ap=262144,lp=4194304;function Ll(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 Dm(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var i=0,r=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~r,s!==0?i=Ll(s):(a&=l,a!==0?i=Ll(a):n||(n=l&~e,n!==0&&(i=Ll(n))))):(l=s&~r,l!==0?i=Ll(l):a!==0?i=Ll(a):n||(n=s&~e,n!==0&&(i=Ll(n)))),i===0?0:t!==0&&t!==i&&!(t&r)&&(r=i&-i,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:i}function c0(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function U$(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-Si(n),i=1<<s;t|=e[s],n&=~i}return t}function dW(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 F$(){var e=lp;return lp<<=1,!(lp&62914560)&&(lp=4194304),e}function dv(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function u0(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function fW(e,t,n,s,i,r){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-Si(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&&V$(e,s,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(a&~t))}function V$(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Si(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function G$(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Si(n),i=1<<s;i&t|e[s]&t&&(e[s]|=t),n&=~i}}function W$(e,t){var n=t&-t;return n=n&42?1:O3(n),n&(e.suspendedLanes|t)?0:n}function O3(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 D3(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function K$(){var e=wt.p;return e!==0?e:(e=window.event,e===void 0?32:AT(e.type))}function S8(e,t){var n=wt.p;try{return wt.p=e,t()}finally{wt.p=n}}var ra=Math.random().toString(36).slice(2),ps="__reactFiber$"+ra,ri="__reactProps$"+ra,Sf="__reactContainer$"+ra,C8="__reactEvents$"+ra,hW="__reactListeners$"+ra,pW="__reactHandles$"+ra,E8="__reactResources$"+ra,d0="__reactMarker$"+ra,cg="__reactLoad$"+ra;function Bm(e){delete e[ps],delete e[ri],delete e[hW],delete e[pW]}function rc(e){var t;if(t=e[ps])return t;for(var n=e.parentNode;n;){if(t=n[Sf]||n[ps]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=P9(e);e!==null;){if(n=e[ps])return n;e=P9(e)}return t}e=n,n=e.parentNode}return null}function Cf(e){if(e=e[ps]||e[Sf]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ph(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(ce(33))}function od(e){var t=e[E8];return t||(t=e[E8]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ns(e){e[d0]=!0}function X$(e){e[cg]=void 0}var Z$=new Set,Y$={};function lu(e,t){Kd(e,t),Kd(e+"Capture",t)}function Kd(e,t){for(Y$[e]=t,e=0;e<t.length;e++)Z$.add(t[e])}var xW=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]*$"),$8={},A8={};function gW(e){return Jy.call(A8,e)?!0:Jy.call($8,e)?!1:xW.test(e)?A8[e]=!0:($8[e]=!0,!1)}var vt=!1;function M8(){var e=vt;return vt=!1,e}function Hp(e,t,n){if(gW(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 cp(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 xo(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 gi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Q$(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mW(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 i=s.get,r=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,r.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 ek(e){if(!e._valueTracker){var t=Q$(e)?"checked":"value";e._valueTracker=mW(e,t,""+e[t])}}function J$(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Q$(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}var vW=/[\n"\\]/g;function Fi(e){return e.replace(vW,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function tk(e,t,n,s,i,r,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=""+gi(t)):e.value!==""+gi(t)&&(e.value=""+gi(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?a==="number"&&e.value==t?fv(e,gi(e.value)):fv(e,gi(t)):n!=null?fv(e,gi(n)):s!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+gi(l):e.removeAttribute("name")}function eA(e,t,n,s,i,r,a,l){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){ek(e);return}n=n!=null?""+gi(n):"",t=t!=null?""+gi(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??i,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),ek(e)}function fv(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function ad(e,t,n,s){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&s&&(e[n].defaultSelected=!0)}else{for(n=""+gi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,s&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function tA(e,t,n){if(t!=null&&(t=""+gi(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+gi(n):""}function nA(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(ce(92));if(hh(s)){if(1<s.length)throw Error(ce(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=gi(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),ek(e)}function Xd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yW=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 T8(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||yW.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function sA(e,t,n){if(t!=null&&typeof t!="object")throw Error(ce(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]="",vt=!0);for(var i in t)s=t[i],t.hasOwnProperty(i)&&n[i]!==s&&(T8(e,i,s),vt=!0)}else for(var r in t)t.hasOwnProperty(r)&&T8(e,r,t[r])}function B3(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 kW=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"]]),bW=/^[\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 qp(e){return bW.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Qr(){}var nk=null;function H3(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wu=null,ld=null;function z8(e){var t=Cf(e);if(t&&(e=t.stateNode)){var n=e[ri]||null;e:switch(e=t.stateNode,t.type){case"input":if(tk(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="'+Fi(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var i=s[ri]||null;if(!i)throw Error(ce(90));tk(s,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&J$(s)}break e;case"textarea":tA(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ad(e,!!n.multiple,t,!1)}}}var hv=!1;function iA(e,t,n){if(hv)return e(t,n);hv=!0;try{var s=e(t);return s}finally{if(hv=!1,(Wu!==null||ld!==null)&&(Jm(),Wu&&(t=Wu,e=ld,ld=Wu=null,z8(t),e)))for(t=0;t<e.length;t++)z8(e[t])}}function o1(e,t){var n=e.stateNode;if(n===null)return null;var s=n[ri]||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(ce(231,t,typeof n));return n}var Xo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sk=!1;if(Xo)try{var Xf={};Object.defineProperty(Xf,"passive",{get:function(){sk=!0}}),window.addEventListener("test",Xf,Xf),window.removeEventListener("test",Xf,Xf)}catch{sk=!1}var Wa=null,q3=null,Pp=null;function rA(){if(Pp)return Pp;var e,t=q3,n=t.length,s,i="value"in Wa?Wa.value:Wa.textContent,r=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(s=1;s<=a&&t[n-s]===i[r-s];s++);return Pp=i.slice(e,1<s?1-s:void 0)}function Up(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 up(){return!0}function N8(){return!1}function Vs(e){function t(n,s,i,r,a){this._reactName=n,this._targetInst=i,this.type=s,this.nativeEvent=r,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(r):r[l]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?up:N8,this.isPropagationStopped=N8,this}return Bt(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=up)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=up)},persist:function(){},isPersistent:up}),t}var kl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hm=Vs(kl),f0=Bt({},kl,{view:0,detail:0}),wW=Vs(f0),pv,xv,Zf,qm=Bt({},f0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:P3,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!==Zf&&(Zf&&e.type==="mousemove"?(pv=e.screenX-Zf.screenX,xv=e.screenY-Zf.screenY):xv=pv=0,Zf=e),pv)},movementY:function(e){return"movementY"in e?e.movementY:xv}}),_8=Vs(qm),jW=Bt({},qm,{dataTransfer:0}),SW=Vs(jW),CW=Bt({},f0,{relatedTarget:0}),gv=Vs(CW),EW=Bt({},kl,{animationName:0,elapsedTime:0,pseudoElement:0}),$W=Vs(EW),AW=Bt({},kl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),MW=Vs(AW),TW=Bt({},kl,{data:0}),R8=Vs(TW),zW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NW={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"},_W={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RW(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_W[e])?!!t[e]:!1}function P3(){return RW}var IW=Bt({},f0,{key:function(e){if(e.key){var t=zW[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Up(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?NW[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:P3,charCode:function(e){return e.type==="keypress"?Up(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Up(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),LW=Vs(IW),OW=Bt({},qm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),I8=Vs(OW),DW=Bt({},kl,{submitter:0}),BW=Vs(DW),HW=Bt({},f0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:P3}),qW=Vs(HW),PW=Bt({},kl,{propertyName:0,elapsedTime:0,pseudoElement:0}),UW=Vs(PW),FW=Bt({},qm,{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}),VW=Vs(FW),GW=Bt({},kl,{newState:0,oldState:0,source:0}),WW=Vs(GW),KW=[9,13,27,32],U3=Xo&&"CompositionEvent"in window,Rh=null;Xo&&"documentMode"in document&&(Rh=document.documentMode);var XW=Xo&&"TextEvent"in window&&!Rh,oA=Xo&&(!U3||Rh&&8<Rh&&11>=Rh),L8=" ",O8=!1;function aA(e,t){switch(e){case"keyup":return KW.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ku=!1;function ZW(e,t){switch(e){case"compositionend":return lA(t);case"keypress":return t.which!==32?null:(O8=!0,L8);case"textInput":return e=t.data,e===L8&&O8?null:e;default:return null}}function YW(e,t){if(Ku)return e==="compositionend"||!U3&&aA(e,t)?(e=rA(),Pp=q3=Wa=null,Ku=!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 oA&&t.locale!=="ko"?null:t.data;default:return null}}var QW={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 D8(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!QW[e.type]:t==="textarea"}function cA(e,t,n,s){Wu?ld?ld.push(s):ld=[s]:Wu=s,t=zg(t,"onChange"),0<t.length&&(n=new Hm("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Ih=null,a1=null;function JW(e){iT(e,0)}function Pm(e){var t=ph(e);if(J$(t))return e}function B8(e,t){if(e==="change")return t}var uA=!1;if(Xo){var mv;if(Xo){var vv="oninput"in document;if(!vv){var H8=document.createElement("div");H8.setAttribute("oninput","return;"),vv=typeof H8.oninput=="function"}mv=vv}else mv=!1;uA=mv&&(!document.documentMode||9<document.documentMode)}function q8(){Ih&&(Ih.detachEvent("onpropertychange",dA),a1=Ih=null)}function dA(e){if(e.propertyName==="value"&&Pm(a1)){var t=[];cA(t,a1,e,H3(e)),iA(JW,t)}}function eK(e,t,n){e==="focusin"?(q8(),Ih=t,a1=n,Ih.attachEvent("onpropertychange",dA)):e==="focusout"&&q8()}function tK(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pm(a1)}function nK(e,t){if(e==="click")return Pm(t)}function sK(e,t){if(e==="input"||e==="change")return Pm(t)}function iK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $i=typeof Object.is=="function"?Object.is:iK;function l1(e,t){if($i(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 i=n[s];if(!Jy.call(t,i)||!$i(e[i],t[i]))return!1}return!0}function ik(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 P8(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function U8(e,t){var n=P8(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=P8(n)}}function fA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hA(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ik(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=ik(e.document)}return t}function F3(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 rK=Xo&&"documentMode"in document&&11>=document.documentMode,Xu=null,rk=null,Lh=null,ok=!1;function F8(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ok||Xu==null||Xu!==ik(s)||(s=Xu,"selectionStart"in s&&F3(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}),Lh&&l1(Lh,s)||(Lh=s,s=zg(rk,"onSelect"),0<s.length&&(t=new Hm("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Xu)))}function zl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zu={animationend:zl("Animation","AnimationEnd"),animationiteration:zl("Animation","AnimationIteration"),animationstart:zl("Animation","AnimationStart"),transitionrun:zl("Transition","TransitionRun"),transitionstart:zl("Transition","TransitionStart"),transitioncancel:zl("Transition","TransitionCancel"),transitionend:zl("Transition","TransitionEnd")},yv={},pA={};Xo&&(pA=document.createElement("div").style,"AnimationEvent"in window||(delete Zu.animationend.animation,delete Zu.animationiteration.animation,delete Zu.animationstart.animation),"TransitionEvent"in window||delete Zu.transitionend.transition);function cu(e){if(yv[e])return yv[e];if(!Zu[e])return e;var t=Zu[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pA)return yv[e]=t[n];return e}var xA=cu("animationend"),gA=cu("animationiteration"),mA=cu("animationstart"),oK=cu("transitionrun"),aK=cu("transitionstart"),lK=cu("transitioncancel"),vA=cu("transitionend"),yA=new Map,ak="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(" ");ak.push("scrollEnd");function Sr(e,t){yA.set(e,t),lu(t,[e])}var cK=0;function Zo(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=kr.identifierPrefix;var n=cK++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function V8(e){if(e==null||typeof e=="string")return e;var t=null,n=xd;if(n!==null)for(var s=0;s<n.length;s++){var i=e[n[s]];if(i!=null){if(i==="none")return"none";t=t==null?i:t+(" "+i)}}return t??e.default}function oa(e,t){return e=V8(e),t=V8(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var ug=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)},qi=[],Yu=0,V3=0;function Um(){for(var e=Yu,t=V3=Yu=0;t<e;){var n=qi[t];qi[t++]=null;var s=qi[t];qi[t++]=null;var i=qi[t];qi[t++]=null;var r=qi[t];if(qi[t++]=null,s!==null&&i!==null){var a=s.pending;a===null?i.next=i:(i.next=a.next,a.next=i),s.pending=i}r!==0&&kA(n,i,r)}}function Fm(e,t,n,s){qi[Yu++]=e,qi[Yu++]=t,qi[Yu++]=n,qi[Yu++]=s,V3|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function G3(e,t,n,s){return Fm(e,t,n,s),dg(e)}function uu(e,t){return Fm(e,null,null,t),dg(e)}function kA(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var i=!1,r=e.return;r!==null;)r.childLanes|=n,s=r.alternate,s!==null&&(s.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-Si(n),e=r.hiddenUpdates,s=e[i],s===null?e[i]=[t]:s.push(t),t.lane=n|536870912),r):null}function dg(e){if(50<Gh)throw Gh=0,Jp=null,Error(ce(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qu={};function uK(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 ni(e,t,n,s){return new uK(e,t,n,s)}function W3(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fo(e,t){var n=e.alternate;return n===null?(n=ni(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 bA(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 Fp(e,t,n,s,i,r){var a=0;if(s=e,typeof s=="function")W3(s)&&(a=1);else if(typeof s=="string")a=DX(e,n,so.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Ky:return e=ni(31,n,t,i),e.elementType=Ky,e.lanes=r,e;case Vu:return _c(n.children,i,r,t);case D$:a=8,i|=24;break;case Vy:return e=ni(12,n,t,i|2),e.elementType=Vy,e.lanes=r,e;case Gy:return e=ni(13,n,t,i),e.elementType=Gy,e.lanes=r,e;case Wy:return e=ni(19,n,t,i),e.elementType=Wy,e.lanes=r,e;case YG:case Xy:return e=i|32,e=ni(30,n,t,e),e.elementType=Xy,e.lanes=r,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case Yr:a=10;break e;case B$:a=9;break e;case R3:a=11;break e;case I3:a=14;break e;case Sa:a=16,s=null;break e}a=29,n=Error(ce(130,e===null?"null":typeof e,"")),s=null}return t=ni(a,n,t,i),t.elementType=e,t.type=s,t.lanes=r,t}function _c(e,t,n,s){return e=ni(7,e,s,t),e.lanes=n,e}function kv(e,t,n){return e=ni(6,e,null,t),e.lanes=n,e}function wA(e){var t=ni(18,null,null,0);return t.stateNode=e,t}function bv(e,t,n){return t=ni(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var G8=new WeakMap;function Vi(e,t){if(typeof e=="object"&&e!==null){var n=G8.get(e);return n!==void 0?n:(t={value:e,source:t,stack:j8(t)},G8.set(e,t),t)}return{value:e,source:t,stack:j8(t)}}var Ju=[],ed=0,fg=null,c1=0,Pi=[],Ui=0,dl=null,Jr=1,eo="";function ko(e,t){Ju[ed++]=c1,Ju[ed++]=fg,fg=e,c1=t}function jA(e,t,n){Pi[Ui++]=Jr,Pi[Ui++]=eo,Pi[Ui++]=dl,dl=e;var s=Jr;e=eo;var i=32-Si(s)-1;s&=~(1<<i),n+=1;var r=32-Si(t)+i;if(30<r){var a=i-i%5;r=(s&(1<<a)-1).toString(32),s>>=a,i-=a,Jr=1<<32-Si(t)+i|n<<i|s,eo=r+e}else Jr=1<<r|n<<i|s,eo=e}function Vm(e){e.return!==null&&(ko(e,1),jA(e,1,0))}function K3(e){for(;e===fg;)fg=Ju[--ed],Ju[ed]=null,c1=Ju[--ed],Ju[ed]=null;for(;e===dl;)dl=Pi[--Ui],Pi[Ui]=null,eo=Pi[--Ui],Pi[Ui]=null,Jr=Pi[--Ui],Pi[Ui]=null}function SA(e,t){Pi[Ui++]=Jr,Pi[Ui++]=eo,Pi[Ui++]=dl,Jr=t.id,eo=t.overflow,dl=e}var is=null,Ut=null,tt=!1,el=null,Gi=!1,lk=Error(ce(519));function fl(e){var t=Error(ce(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw u1(Vi(t,e)),lk}function W8(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[ps]=e,t[ri]=s,n){case"dialog":it("cancel",t),it("close",t);break;case"iframe":case"object":case"embed":it("load",t);break;case"video":case"audio":for(n=0;n<p1.length;n++)it(p1[n],t);break;case"source":it("error",t);break;case"img":case"image":case"link":it("error",t),it("load",t);break;case"details":it("toggle",t);break;case"input":it("invalid",t),eA(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":it("invalid",t);break;case"textarea":it("invalid",t),nA(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||oT(t.textContent,n)?(s.popover!=null&&(it("beforetoggle",t),it("toggle",t)),s.onScroll!=null&&it("scroll",t),s.onScrollEnd!=null&&it("scrollend",t),s.onClick!=null&&(t.onclick=Qr),t=!0):t=!1,t||fl(e,!0)}function hg(e){for(is=e.return;is;)switch(is.tag){case 5:case 31:case 13:Gi=!1;return;case 27:case 3:Gi=!0;return;default:is=is.return}}function ju(e){if(e!==is)return!1;if(!tt)return hg(e),tt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Gk(e.type,e.memoizedProps)),n=!n),n&&Ut&&fl(e),hg(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ce(317));Ut=q9(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ce(317));Ut=q9(e)}else t===27?(t=Ut,bl(e.type)?(e=Zk,Zk=null,Ut=e):Ut=t):Ut=is?Zi(e.stateNode.nextSibling):null;return!0}function qc(){Ut=is=null,tt=!1}function wv(){var e=el;return e!==null&&(Js===null?Js=e:Js.push.apply(Js,e),el=null),e}function u1(e){el===null?el=[e]:el.push(e)}var ck=co(null),du=null,Do=null;function Ka(e,t,n){Vt(ck,t._currentValue),t._currentValue=n}function Vo(e){e._currentValue=ck.current,gs(ck)}function Vp(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 uk(e,t,n,s){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var r=i.dependencies;if(r!==null){var a=i.child;r=r.firstContext;e:for(;r!==null;){var l=r;r=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){r.lanes|=n,l=r.alternate,l!==null&&(l.lanes|=n),Vp(r.return,n,e),s||(a=null);break e}r=l.next}}else if(i.tag===18){if(a=i.return,a===null)throw Error(ce(341));a.lanes|=n,r=a.alternate,r!==null&&(r.lanes|=n),Vp(a,n,e),a=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Vp(i.return,n,e),a=i.child,a=a!==null?a.sibling:null):a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}}function Pc(e,t,n,s){e=null;for(var i=t,r=!1;i!==null;){if(!r){if(i.flags&524288)r=!0;else if(i.flags&262144)break}if(i.tag===10){var a=i.alternate;if(a===null)throw Error(ce(387));if(a=a.memoizedProps,a!==null){var l=i.type;$i(i.pendingProps.value,a.value)||(e!==null?e.push(l):e=[l])}}else if(i===rg.current){if(a=i.alternate,a===null)throw Error(ce(387));a.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(sf):e=[sf])}i=i.return}return e!==null&&uk(t,e,n,s),t.flags|=262144,e!==null}function pg(e){for(e=e.firstContext;e!==null;){if(!$i(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Uc(e){du=e,Do=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xs(e){return CA(du,e)}function dp(e,t){return du===null&&Uc(e),CA(e,t)}function CA(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Do===null){if(e===null)throw Error(ce(308));Do=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Do=Do.next=t;return n}var dK=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()})}},fK=Un.unstable_scheduleCallback,hK=Un.unstable_NormalPriority,Rn={$$typeof:Yr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function X3(){return{controller:new dK,data:new Map,refCount:0}}function h0(e){e.refCount--,e.refCount===0&&fK(hK,function(){e.controller.abort()})}function K8(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 xh=null;function pK(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Oh=null,dk=0,Fc=0,cd=null;function xK(e,t){if(Oh===null){var n=Oh=[];dk=0,Fc=jb(),cd={status:"pending",value:void 0,then:function(s){n.push(s)}}}return dk++,t.then(X8,X8),t}function X8(){if(--dk===0&&(xh=null,Oh!==null)){cd!==null&&(cd.status="fulfilled");var e=Oh;Oh=null,Fc=0,cd=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function gK(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(s.status="rejected",s.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),s}var Z8=Ve.S;Ve.S=function(e,t){if(UM=wi(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&xK(e,t),xh!==null)for(var n=ef;n!==null;)K8(n,xh),n=n.next;if(n=e.types,n!==null){for(var s=ef;s!==null;)K8(s,n),s=s.next;if(Fc!==0){s=xh,s===null&&(s=xh=[]);for(var i=0;i<n.length;i++){var r=n[i];s.indexOf(r)===-1&&s.push(r)}}}Z8!==null&&Z8(e,t)};var Rc=co(null);function Z3(){var e=Rc.current;return e!==null?e:Dt.pooledCache}function Gp(e,t){t===null?Vt(Rc,Rc.current):Vt(Rc,t.pool)}function EA(){var e=Z3();return e===null?null:{parent:Rn._currentValue,pool:e}}var Ef=Error(ce(460)),Y3=Error(ce(474)),Gm=Error(ce(542)),xg={then:function(){}};function Y8(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $A(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Qr,Qr),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,J8(e),e===void 0&&!("reason"in t)?Error(ce(600)):e;default:if(typeof t.status=="string")t.then(Qr,Qr);else{if(e=Dt,e!==null&&100<e.shellSuspendCounter)throw Error(ce(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=s}},function(s){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,J8(e),e}throw Ic=t,Ef}}function Ol(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ic=n,Ef):n}}var Ic=null;function Q8(){if(Ic===null)throw Error(ce(459));var e=Ic;return Ic=null,e}function J8(e){if(e===Ef||e===Gm)throw Error(ce(483))}var ud=null,d1=0;function fp(e){var t=d1;return d1+=1,ud===null&&(ud=[]),$A(ud,e,t)}function pa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function hp(e,t){throw t.$$typeof===ZG?Error(ce(525)):(e=Object.prototype.toString.call(t),Error(ce(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function AA(e){function t(m,k){if(e){var w=m.deletions;w===null?(m.deletions=[k],m.flags|=16):w.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 i(m,k){return m=Fo(m,k),m.index=0,m.sibling=null,m}function r(m,k,w){return m.index=w,e?(w=m.alternate,w!==null?(w=w.index,w<k?(m.flags|=2,k):w):(m.flags|=134217730,k)):(m.flags|=1048576,k)}function a(m){return e&&m.alternate===null&&(m.flags|=134217730),m}function l(m,k,w,S){return k===null||k.tag!==6?(k=kv(w,m.mode,S),k.return=m,k):(k=i(k,w),k.return=m,k)}function c(m,k,w,S){var E=w.type;return E===Vu?(m=d(m,k,w.props.children,S,w.key),pa(m,w),m):k!==null&&(k.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Sa&&Ol(E)===k.type)?(k=i(k,w.props),pa(k,w),k.return=m,k):(k=Fp(w.type,w.key,w.props,null,m.mode,S),pa(k,w),k.return=m,k)}function u(m,k,w,S){return k===null||k.tag!==4||k.stateNode.containerInfo!==w.containerInfo||k.stateNode.implementation!==w.implementation?(k=bv(w,m.mode,S),k.return=m,k):(k=i(k,w.children||[]),k.return=m,k)}function d(m,k,w,S,E){return k===null||k.tag!==7?(k=_c(w,m.mode,S,E),k.return=m,k):(k=i(k,w),k.return=m,k)}function f(m,k,w){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=kv(""+k,m.mode,w),k.return=m,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case rp:return w=Fp(k.type,k.key,k.props,null,m.mode,w),pa(w,k),w.return=m,w;case fh:return k=bv(k,m.mode,w),k.return=m,k;case Sa:return k=Ol(k),f(m,k,w)}if(hh(k)||Kf(k))return k=_c(k,m.mode,w,null),k.return=m,k;if(typeof k.then=="function")return f(m,fp(k),w);if(k.$$typeof===Yr)return f(m,dp(m,k),w);hp(m,k)}return null}function p(m,k,w,S){var E=k!==null?k.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return E!==null?null:l(m,k,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case rp:return w.key===E?c(m,k,w,S):null;case fh:return w.key===E?u(m,k,w,S):null;case Sa:return w=Ol(w),p(m,k,w,S)}if(hh(w)||Kf(w))return E!==null?null:d(m,k,w,S,null);if(typeof w.then=="function")return p(m,k,fp(w),S);if(w.$$typeof===Yr)return p(m,k,dp(m,w),S);hp(m,w)}return null}function x(m,k,w,S,E){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return m=m.get(w)||null,l(k,m,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case rp:return m=m.get(S.key===null?w:S.key)||null,c(k,m,S,E);case fh:return m=m.get(S.key===null?w:S.key)||null,u(k,m,S,E);case Sa:return S=Ol(S),x(m,k,w,S,E)}if(hh(S)||Kf(S))return m=m.get(w)||null,d(k,m,S,E,null);if(typeof S.then=="function")return x(m,k,w,fp(S),E);if(S.$$typeof===Yr)return x(m,k,w,dp(k,S),E);hp(k,S)}return null}function g(m,k,w,S){for(var E=null,A=null,z=k,N=k=0,M=null;z!==null&&N<w.length;N++){z.index>N?(M=z,z=null):M=z.sibling;var $=p(m,z,w[N],S);if($===null){z===null&&(z=M);break}e&&z&&$.alternate===null&&t(m,z),k=r($,k,N),A===null?E=$:A.sibling=$,A=$,z=M}if(N===w.length)return n(m,z),tt&&ko(m,N),E;if(z===null){for(;N<w.length;N++)z=f(m,w[N],S),z!==null&&(k=r(z,k,N),A===null?E=z:A.sibling=z,A=z);return tt&&ko(m,N),E}for(z=s(z);N<w.length;N++)M=x(z,m,N,w[N],S),M!==null&&(e&&($=M.alternate,$!==null&&z.delete($.key===null?N:$.key)),k=r(M,k,N),A===null?E=M:A.sibling=M,A=M);return e&&z.forEach(function(R){return t(m,R)}),tt&&ko(m,N),E}function y(m,k,w,S){if(w==null)throw Error(ce(151));for(var E=null,A=null,z=k,N=k=0,M=null,$=w.next();z!==null&&!$.done;N++,$=w.next()){z.index>N?(M=z,z=null):M=z.sibling;var R=p(m,z,$.value,S);if(R===null){z===null&&(z=M);break}e&&z&&R.alternate===null&&t(m,z),k=r(R,k,N),A===null?E=R:A.sibling=R,A=R,z=M}if($.done)return n(m,z),tt&&ko(m,N),E;if(z===null){for(;!$.done;N++,$=w.next())$=f(m,$.value,S),$!==null&&(k=r($,k,N),A===null?E=$:A.sibling=$,A=$);return tt&&ko(m,N),E}for(z=s(z);!$.done;N++,$=w.next())$=x(z,m,N,$.value,S),$!==null&&(e&&(M=$.alternate,M!==null&&z.delete(M.key===null?N:M.key)),k=r($,k,N),A===null?E=$:A.sibling=$,A=$);return e&&z.forEach(function(_){return t(m,_)}),tt&&ko(m,N),E}function v(m,k,w,S){if(typeof w=="object"&&w!==null&&w.type===Vu&&w.key===null&&w.props.ref===void 0&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case rp:e:{for(var E=w.key;k!==null;){if(k.key===E){if(E=w.type,E===Vu){if(k.tag===7){n(m,k.sibling),S=i(k,w.props.children),pa(S,w),S.return=m,m=S;break e}}else if(k.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Sa&&Ol(E)===k.type){n(m,k.sibling),S=i(k,w.props),pa(S,w),S.return=m,m=S;break e}n(m,k);break}else t(m,k);k=k.sibling}w.type===Vu?(S=_c(w.props.children,m.mode,S,w.key),pa(S,w),S.return=m,m=S):(S=Fp(w.type,w.key,w.props,null,m.mode,S),pa(S,w),S.return=m,m=S)}return a(m);case fh:e:{for(E=w.key;k!==null;){if(k.key===E)if(k.tag===4&&k.stateNode.containerInfo===w.containerInfo&&k.stateNode.implementation===w.implementation){n(m,k.sibling),S=i(k,w.children||[]),S.return=m,m=S;break e}else{n(m,k);break}else t(m,k);k=k.sibling}S=bv(w,m.mode,S),S.return=m,m=S}return a(m);case Sa:return w=Ol(w),v(m,k,w,S)}if(hh(w))return g(m,k,w,S);if(Kf(w)){if(E=Kf(w),typeof E!="function")throw Error(ce(150));return w=E.call(w),y(m,k,w,S)}if(typeof w.then=="function")return v(m,k,fp(w),S);if(w.$$typeof===Yr)return v(m,k,dp(m,w),S);hp(m,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,k!==null&&k.tag===6?(n(m,k.sibling),S=i(k,w),S.return=m,m=S):(n(m,k),S=kv(w,m.mode,S),S.return=m,m=S),a(m)):n(m,k)}return function(m,k,w,S){try{d1=0;var E=v(m,k,w,S);return ud=null,E}catch(z){if(z===Ef||z===Gm)throw z;var A=ni(29,z,null,m.mode);return A.lanes=S,A.return=m,A}finally{}}}var Vc=AA(!0),MA=AA(!1),Ca=!1;function Q3(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fk(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 tl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function nl(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,bt&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,t=dg(e),kA(e,null,n),t}return Fm(e,s,t,n),dg(e)}function Dh(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,G$(e,n)}}function jv(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=a:r=r.next=a,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:r,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 hk=!1;function Bh(){if(hk){var e=cd;if(e!==null)throw e}}function Hh(e,t,n,s){hk=!1;var i=e.updateQueue;Ca=!1;var r=i.firstBaseUpdate,a=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?r=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(r!==null){var f=i.baseState;a=0,d=u=c=null,l=r;do{var p=l.lane&-536870913,x=p!==l.lane;if(x?(ot&p)===p:(s&p)===p){p!==0&&p===Fc&&(hk=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,y=l;p=t;var v=n;switch(y.tag){case 1:if(g=y.payload,typeof g=="function"){f=g.call(v,f,p);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,p=typeof g=="function"?g.call(v,f,p):g,p==null)break e;f=Bt({},f,p);break e;case 2:Ca=!0}}p=l.callback,p!==null&&(e.flags|=64,x&&(e.flags|=8192),x=i.callbacks,x===null?i.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=i.shared.pending,l===null)break;x=l,l=x.next,x.next=null,i.lastBaseUpdate=x,i.shared.pending=null}}while(!0);d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,r===null&&(i.shared.lanes=0),xl|=a,e.lanes=a,e.memoizedState=f}}function TA(e,t){if(typeof e!="function")throw Error(ce(191,e));e.call(t)}function zA(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)TA(n[e],t)}var hl=co(null),gg=co(0);function e9(e,t){e=ea,Vt(gg,e),Vt(hl,t),ea=e|t.baseLanes}function pk(){Vt(gg,ea),Vt(hl,hl.current)}function J3(){ea=gg.current,gs(hl),gs(gg)}var ys=co(null),As=null;function sl(e){var t=e.alternate;Vt(ms,ms.current&1),Vt(ys,e),As===null&&(t===null||hl.current!==null||t.memoizedState!==null)&&(As=e)}function xk(e){Vt(ms,ms.current),Vt(ys,e),As===null&&(As=e)}function NA(e){e.tag===22?(Vt(ms,ms.current),Vt(ys,e),As===null&&(As=e)):il()}function il(){Vt(ms,ms.current),Vt(ys,ys.current)}function vi(e){gs(ys),As===e&&(As=null),gs(ms)}var ms=co(0);function f1(e,t){Vt(ys,ys.current),Vt(ms,t)}function eb(e){gs(ms),gs(ys),As===e&&(As=null)}function mg(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Xk(n)||$b(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 Yo=0,Ze=null,Nt=null,_n=null,vg=!1,dd=!1,Gc=!1,yg=0,h1=0,fd=null,mK=0;function vn(){throw Error(ce(321))}function tb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!$i(e[n],t[n]))return!1;return!0}function nb(e,t,n,s,i,r){return Yo=r,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ve.H=e===null||e.memoizedState===null?cM:uM,Gc=!1,r=n(s,i),Gc=!1,dd&&(r=RA(t,n,s,i)),_A(e),r}function _A(e){Ve.H=kg;var t=Nt!==null&&Nt.next!==null;if(Yo=0,_n=Nt=Ze=null,vg=!1,h1=0,fd=null,t)throw Error(ce(300));e===null||Ln||(e=e.dependencies,e!==null&&pg(e)&&(Ln=!0))}function RA(e,t,n,s){Ze=e;var i=0;do{if(dd&&(fd=null),h1=0,dd=!1,25<=i)throw Error(ce(301));if(i+=1,_n=Nt=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}Ve.H=CK,r=t(n,s)}while(dd);return r}function vK(){var e=Ve.H,t=e.useState()[0];return t=typeof t.then=="function"?p0(t):t,e=e.useState()[0],(Nt!==null?Nt.memoizedState:null)!==e&&(Ze.flags|=1024),t}function sb(){var e=yg!==0;return yg=0,e}function ib(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rb(e){if(vg){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vg=!1}Yo=0,_n=Nt=Ze=null,dd=!1,h1=yg=0,fd=null}function Ps(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _n===null?Ze.memoizedState=_n=e:_n=_n.next=e,_n}function En(){if(Nt===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=Nt.next;var t=_n===null?Ze.memoizedState:_n.next;if(t!==null)_n=t,Nt=e;else{if(e===null)throw Ze.alternate===null?Error(ce(467)):Error(ce(310));Nt=e,e={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},_n===null?Ze.memoizedState=_n=e:_n=_n.next=e}return _n}function Wm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function p0(e){var t=h1;return h1+=1,fd===null&&(fd=[]),e=$A(fd,e,t),t=Ze,(_n===null?t.memoizedState:_n.next)===null&&(t=t.alternate,Ve.H=t===null||t.memoizedState===null?cM:uM),e}function Km(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return p0(e);if(e.$$typeof===JG)return;if(e.$$typeof===Yr)return xs(e)}throw Error(ce(438,String(e)))}function ob(e){var t=null,n=Ze.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Ze.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Wm(),Ze.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]=QG;return t.index++,n}function Qo(e,t){return typeof t=="function"?t(e):t}function Wp(e){var t=En();return ab(t,Nt,e)}function ab(e,t,n){var s=e.queue;if(s===null)throw Error(ce(311));s.lastRenderedReducer=n;var i=e.baseQueue,r=s.pending;if(r!==null){if(i!==null){var a=i.next;i.next=r.next,r.next=a}t.baseQueue=i=r,s.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var l=a=null,c=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(ot&f)===f:(Yo&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===Fc&&(d=!0);else if((Yo&p)===p){u=u.next,p===Fc&&(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=r):c=c.next=f,Ze.lanes|=p,xl|=p;f=u.action,Gc&&n(r,f),r=u.hasEagerState?u.eagerState:n(r,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=r):c=c.next=p,Ze.lanes|=f,xl|=f;u=u.next}while(u!==null&&u!==t);if(c===null?a=r:c.next=l,!$i(r,e.memoizedState)&&(Ln=!0,d&&(n=cd,n!==null)))throw n;e.memoizedState=r,e.baseState=a,e.baseQueue=c,s.lastRenderedState=r}return i===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Sv(e){var t=En(),n=t.queue;if(n===null)throw Error(ce(311));n.lastRenderedReducer=e;var s=n.dispatch,i=n.pending,r=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do r=e(r,a.action),a=a.next;while(a!==i);$i(r,t.memoizedState)||(Ln=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,s]}function IA(e,t,n){var s=Ze,i=En(),r=tt;if(r){if(n===void 0)throw Error(ce(407));n=n()}else n=t();var a=!$i((Nt||i).memoizedState,n);if(a&&(i.memoizedState=n,Ln=!0),i=i.queue,lb(DA.bind(null,s,i,e),[e]),e=i.getSnapshot!==t||a||_n!==null&&(_n.memoizedState.tag&1)!==0,Zd(e?9:8,{destroy:void 0},OA.bind(null,s,i,n,t),null),e){if(s.flags|=2048,Dt===null)throw Error(ce(349));r||Yo&127||LA(s,t,n)}return n}function LA(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t=Wm(),Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function OA(e,t,n,s){t.value=n,t.getSnapshot=s,BA(t)&&HA(e)}function DA(e,t,n){return n(function(){BA(t)&&HA(e)})}function BA(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$i(e,n)}catch{return!0}}function HA(e){var t=uu(e,2);t!==null&&si(t,e,2)}function gk(e){var t=Ps();if(typeof e=="function"){var n=e;if(e=n(),Gc){Ga(!0);try{n()}finally{Ga(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:e},t}function qA(e,t,n,s){return e.baseState=n,ab(e,Nt,typeof s=="function"?s:Qo)}function yK(e,t,n,s,i){if(Zm(e))throw Error(ce(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){r.listeners.push(a)}};Ve.T!==null?n(!0):r.isTransition=!1,s(r),n=t.pending,n===null?(r.next=t.pending=r,PA(t,r)):(r.next=n.next,t.pending=n.next=r)}}function PA(e,t){var n=t.action,s=t.payload,i=e.state;if(t.isTransition){var r=Ve.T,a={};a.types=r!==null?r.types:null,Ve.T=a;try{var l=n(i,s),c=Ve.S;c!==null&&c(a,l),t9(e,t,l)}catch(u){mk(e,t,u)}finally{r!==null&&a.types!==null&&(r.types=a.types),Ve.T=r}}else try{r=n(i,s),t9(e,t,r)}catch(u){mk(e,t,u)}}function t9(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){n9(e,t,s)},function(s){return mk(e,t,s)}):n9(e,t,n)}function n9(e,t,n){t.status="fulfilled",t.value=n,UA(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,PA(e,n)))}function mk(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,UA(t),t=t.next;while(t!==s)}e.action=null}function UA(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function FA(e,t){return t}function s9(e,t){if(tt){var n=Dt.formState;if(n!==null){e:{var s=Ze;if(tt){if(Ut){t:{for(var i=Ut,r=Gi;i.nodeType!==8;){if(!r){i=null;break t}if(i=Zi(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){Ut=Zi(i.nextSibling),s=i.data==="F!";break e}}fl(s)}s=!1}s&&(t=n[0])}}return n=Ps(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:FA,lastRenderedState:t},n.queue=s,n=oM.bind(null,Ze,s),s.dispatch=n,s=gk(!1),r=fb.bind(null,Ze,!1,s.queue),s=Ps(),i={state:t,dispatch:null,action:e,pending:null},s.queue=i,n=yK.bind(null,Ze,i,r,n),i.dispatch=n,s.memoizedState=e,[t,n,!1]}function i9(e){var t=En();return VA(t,Nt,e)}function VA(e,t,n){if(t=ab(e,t,FA)[0],e=Wp(Qo)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=p0(t)}catch(a){throw a===Ef?Gm:a}else s=t;t=En();var i=t.queue,r=i.dispatch;return n!==t.memoizedState&&(Ze.flags|=2048,Zd(9,{destroy:void 0},kK.bind(null,i,n),null)),[s,r,e]}function kK(e,t){e.action=t}function r9(e){var t=En(),n=Nt;if(n!==null)return VA(t,n,e);En(),t=t.memoizedState,n=En();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function Zd(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Ze.updateQueue,t===null&&(t=Wm(),Ze.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 GA(){return En().memoizedState}function Kp(e,t,n,s){var i=Ps();Ze.flags|=e,i.memoizedState=Zd(1|t,{destroy:void 0},n,s===void 0?null:s)}function Xm(e,t,n,s){var i=En();s=s===void 0?null:s;var r=i.memoizedState.inst;Nt!==null&&s!==null&&tb(s,Nt.memoizedState.deps)?i.memoizedState=Zd(t,r,n,s):(Ze.flags|=e,i.memoizedState=Zd(1|t,r,n,s))}function o9(e,t){Kp(8390656,8,e,t)}function lb(e,t){Xm(2048,8,e,t)}function bK(e){Ze.flags|=4;var t=Ze.updateQueue;if(t===null)t=Wm(),Ze.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function WA(e){var t=En().memoizedState;return bK({ref:t,nextImpl:e}),function(){if(bt&2)throw Error(ce(440));return t.impl.apply(void 0,arguments)}}function KA(e,t){return Xm(4,2,e,t)}function XA(e,t){return Xm(4,4,e,t)}function ZA(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 YA(e,t,n){n=n!=null?n.concat([e]):null,Xm(4,4,ZA.bind(null,t,e),n)}function cb(){}function QA(e,t){var n=En();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&tb(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function JA(e,t){var n=En();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&tb(t,s[1]))return s[0];if(s=e(),Gc){Ga(!0);try{e()}finally{Ga(!1)}}return n.memoizedState=[s,t],s}function ub(e,t,n){return n===void 0||Yo&1073741824&&!(ot&261930)?e.memoizedState=t:(e.memoizedState=n,e=VM(),Ze.lanes|=e,xl|=e,n)}function eM(e,t,n,s){return $i(n,t)?n:hl.current!==null?(e=ub(e,n,s),$i(e,t)||(Ln=!0),e):!(Yo&106)||Yo&1073741824&&!(ot&261930)?(Ln=!0,e.memoizedState=n):(e=VM(),Ze.lanes|=e,xl|=e,t)}function tM(e,t,n,s,i){var r=wt.p;wt.p=r!==0&&8>r?r:8;var a=Ve.T,l={};l.types=a!==null?a.types:null,Ve.T=l,fb(e,!1,t,n);try{var c=i(),u=Ve.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=gK(c,s);qh(e,t,d,Ci(e))}else qh(e,t,s,Ci(e))}catch(f){qh(e,t,{then:function(){},status:"rejected",reason:f},Ci())}finally{wt.p=r,a!==null&&l.types!==null&&(a.types=l.types),Ve.T=a}}function wK(){}function vk(e,t,n,s){if(e.tag!==5)throw Error(ce(476));var i=nM(e).queue;tM(e,i,t,Nc,n===null?wK:function(){return sM(e),n(s)})}function nM(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Nc,baseState:Nc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:Nc},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sM(e){var t=nM(e);t.next===null&&(t=e.alternate.memoizedState),qh(e,t.next.queue,{},Ci())}function db(){return xs(sf)}function iM(){return En().memoizedState}function rM(){return En().memoizedState}function jK(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ci();e=tl(n);var s=nl(t,e,n);s!==null&&(si(s,t,n),Dh(s,t,n)),t={cache:X3()},e.payload=t;return}t=t.return}}function SK(e,t,n){var s=Ci();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Zm(e)?aM(t,n):(n=G3(e,t,n,s),n!==null&&(si(n,e,s),lM(n,t,s)))}function oM(e,t,n){var s=Ci();qh(e,t,n,s)}function qh(e,t,n,s){var i={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zm(e))aM(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var a=t.lastRenderedState,l=r(a,n);if(i.hasEagerState=!0,i.eagerState=l,$i(l,a))return Fm(e,t,i,0),Dt===null&&Um(),!1}catch{}finally{}if(n=G3(e,t,i,s),n!==null)return si(n,e,s),lM(n,t,s),!0}return!1}function fb(e,t,n,s){if(s={lane:2,revertLane:jb(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Zm(e)){if(t)throw Error(ce(479))}else t=G3(e,n,s,2),t!==null&&si(t,e,2)}function Zm(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function aM(e,t){dd=vg=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lM(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,G$(e,n)}}var kg={readContext:xs,use:Km,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useLayoutEffect:vn,useInsertionEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useSyncExternalStore:vn,useId:vn,useHostTransitionStatus:vn,useFormState:vn,useActionState:vn,useOptimistic:vn,useMemoCache:vn,useCacheRefresh:vn,useEffectEvent:vn},cM={readContext:xs,use:Km,useCallback:function(e,t){return Ps().memoizedState=[e,t===void 0?null:t],e},useContext:xs,useEffect:o9,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Kp(4194308,4,ZA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Kp(4194308,4,e,t)},useInsertionEffect:function(e,t){Kp(4,2,e,t)},useMemo:function(e,t){var n=Ps();t=t===void 0?null:t;var s=e();if(Gc){Ga(!0);try{e()}finally{Ga(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=Ps();if(n!==void 0){var i=n(t);if(Gc){Ga(!0);try{n(t)}finally{Ga(!1)}}}else i=t;return s.memoizedState=s.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},s.queue=e,e=e.dispatch=SK.bind(null,Ze,e),[s.memoizedState,e]},useRef:function(e){var t=Ps();return e={current:e},t.memoizedState=e},useState:function(e){e=gk(e);var t=e.queue,n=oM.bind(null,Ze,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:cb,useDeferredValue:function(e,t){var n=Ps();return ub(n,e,t)},useTransition:function(){var e=gk(!1);return e=tM.bind(null,Ze,e.queue,!0,!1),Ps().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Ze,i=Ps();if(tt){if(n===void 0)throw Error(ce(407));n=n()}else{if(n=t(),Dt===null)throw Error(ce(349));ot&127||LA(s,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,o9(DA.bind(null,s,r,e),[e]),s.flags|=2048,Zd(9,{destroy:void 0},OA.bind(null,s,r,n,t),null),n},useId:function(){var e=Ps(),t=Dt.identifierPrefix;if(tt){var n=eo,s=Jr;n=(s&~(1<<32-Si(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=yg++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=mK++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:db,useFormState:s9,useActionState:s9,useOptimistic:function(e){var t=Ps();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fb.bind(null,Ze,!0,n),n.dispatch=t,[e,t]},useMemoCache:ob,useCacheRefresh:function(){return Ps().memoizedState=jK.bind(null,Ze)},useEffectEvent:function(e){var t=Ps(),n={impl:e};return t.memoizedState=n,function(){if(bt&2)throw Error(ce(440));return n.impl.apply(void 0,arguments)}}},uM={readContext:xs,use:Km,useCallback:QA,useContext:xs,useEffect:lb,useImperativeHandle:YA,useInsertionEffect:KA,useLayoutEffect:XA,useMemo:JA,useReducer:Wp,useRef:GA,useState:function(){return Wp(Qo)},useDebugValue:cb,useDeferredValue:function(e,t){var n=En();return eM(n,Nt.memoizedState,e,t)},useTransition:function(){var e=Wp(Qo)[0],t=En().memoizedState;return[typeof e=="boolean"?e:p0(e),t]},useSyncExternalStore:IA,useId:iM,useHostTransitionStatus:db,useFormState:i9,useActionState:i9,useOptimistic:function(e,t){var n=En();return qA(n,Nt,e,t)},useMemoCache:ob,useCacheRefresh:rM,useEffectEvent:WA},CK={readContext:xs,use:Km,useCallback:QA,useContext:xs,useEffect:lb,useImperativeHandle:YA,useInsertionEffect:KA,useLayoutEffect:XA,useMemo:JA,useReducer:Sv,useRef:GA,useState:function(){return Sv(Qo)},useDebugValue:cb,useDeferredValue:function(e,t){var n=En();return Nt===null?ub(n,e,t):eM(n,Nt.memoizedState,e,t)},useTransition:function(){var e=Sv(Qo)[0],t=En().memoizedState;return[typeof e=="boolean"?e:p0(e),t]},useSyncExternalStore:IA,useId:iM,useHostTransitionStatus:db,useFormState:r9,useActionState:r9,useOptimistic:function(e,t){var n=En();return Nt!==null?qA(n,Nt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:ob,useCacheRefresh:rM,useEffectEvent:WA};function Cv(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:Bt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yk={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Ci(),i=tl(s);i.payload=t,n!=null&&(i.callback=n),t=nl(e,i,s),t!==null&&(si(t,e,s),Dh(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Ci(),i=tl(s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=nl(e,i,s),t!==null&&(si(t,e,s),Dh(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ci(),s=tl(n);s.tag=2,t!=null&&(s.callback=t),t=nl(e,s,n),t!==null&&(si(t,e,n),Dh(t,e,n))}};function a9(e,t,n,s,i,r,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,r,a):t.prototype&&t.prototype.isPureReactComponent?!l1(n,s)||!l1(i,r):!0}function l9(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&&yk.enqueueReplaceState(t,t.state,null)}function Wc(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=Bt({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function dM(e){ug(e)}function fM(e){console.error(e)}function hM(e){ug(e)}function bg(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function c9(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function kk(e,t,n){return n=tl(n),n.tag=3,n.payload={element:null},n.callback=function(){bg(e,t)},n}function pM(e){return e=tl(e),e.tag=3,e}function xM(e,t,n,s){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=s.value;e.payload=function(){return i(r)},e.callback=function(){c9(t,n,s)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){c9(t,n,s),typeof i!="function"&&(rl===null?rl=new Set([this]):rl.add(this));var l=s.stack;this.componentDidCatch(s.value,{componentStack:l!==null?l:""})})}function EK(e,t,n,s,i){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Pc(t,n,i,!0),n=ys.current,n!==null){switch(n.tag){case 31:case 13:case 19:return As===null?Mg():n.alternate===null&&bn===0&&(bn=3),n.flags&=-257,n.flags|=65536,n.lanes=i,s===xg?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),Nv(e,s,i)),!1;case 22:return n.flags|=65536,s===xg?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)),Nv(e,s,i)),!1}throw Error(ce(435,n.tag))}return Nv(e,s,i),Mg(),!1}if(tt)return t=ys.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,s!==lk&&(e=Error(ce(422),{cause:s}),u1(Vi(e,n)))):(s!==lk&&(t=Error(ce(423),{cause:s}),u1(Vi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,s=Vi(s,n),i=kk(e.stateNode,s,i),jv(e,i),bn!==4&&(bn=2)),!1;var r=Error(ce(520),{cause:s});if(r=Vi(r,n),Vh===null?Vh=[r]:Vh.push(r),bn!==4&&(bn=2),t===null)return!0;s=Vi(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=kk(n.stateNode,s,e),jv(n,e),!1;case 1:if(t=n.type,r=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(rl===null||!rl.has(r))))return n.flags|=65536,i&=-i,n.lanes|=i,i=pM(i),xM(i,e,n,s),jv(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var hb=Error(ce(461)),Ln=!1;function Hn(e,t,n,s){t.child=e===null?MA(t,null,n,s):Vc(t,e.child,n,s)}function u9(e,t,n,s,i){n=n.render;var r=t.ref;if("ref"in s){var a={};for(var l in s)l!=="ref"&&(a[l]=s[l])}else a=s;return Uc(t),s=nb(e,t,n,a,r,i),l=sb(),e!==null&&!Ln?(ib(e,t,i),Jo(e,t,i)):(tt&&l&&Vm(t),t.flags|=1,Hn(e,t,s,i),t.child)}function d9(e,t,n,s,i){if(e===null){var r=n.type;return typeof r=="function"&&!W3(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,gM(e,t,r,s,i)):(e=Fp(n.type,null,s,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!xb(e,i)){var a=r.memoizedProps;if(n=n.compare,n=n!==null?n:l1,n(a,s)&&e.ref===t.ref)return Jo(e,t,i)}return t.flags|=1,e=Fo(r,s),e.ref=t.ref,e.return=t,t.child=e}function gM(e,t,n,s,i){if(e!==null){var r=e.memoizedProps;if(l1(r,s)&&e.ref===t.ref)if(Ln=!1,t.pendingProps=s=r,xb(e,i))e.flags&131072&&(Ln=!0);else return t.lanes=e.lanes,Jo(e,t,i)}return bk(e,t,n,s,i)}function mM(e,t,n,s){var i=s.children,r=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(r=r!==null?r.baseLanes|n:n,e!==null){for(s=t.child=e.child,i=0;s!==null;)i=i|s.lanes|s.childLanes,s=s.sibling;s=i&~r}else s=0,t.child=null;return f9(e,t,r,n,s)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Gp(t,r!==null?r.cachePool:null),r!==null?e9(t,r):pk(),NA(t);else return s=t.lanes=536870912,f9(e,t,r!==null?r.baseLanes|n:n,n,s)}else r!==null?(Gp(t,r.cachePool),e9(t,r),il(),t.memoizedState=null):(e!==null&&Gp(t,null),pk(),il());return Hn(e,t,i,n),t.child}function Ph(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function f9(e,t,n,s,i){var r=Z3();return r=r===null?null:{parent:Rn._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Gp(t,null),pk(),NA(t),e!==null&&Pc(e,t,s,!0),t.childLanes=i,null}function Xp(e,t){return t=Ym({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function h9(e,t,n){return Vc(t,e.child,null,n),e=Xp(t,t.pendingProps),e.flags|=2,vi(t),t.memoizedState=null,e}function $K(e,t,n){var s=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(tt){if(s.mode==="hidden")return e=Xp(t,s),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ph(null,e);if(xk(t),(e=Ut)?(e=gT(e,Gi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:dl!==null?{id:Jr,overflow:eo}:null,retryLane:536870912,hydrationErrors:null},n=wA(e),n.return=t,t.child=n,is=t,Ut=null)):e=null,e===null)throw fl(t);return t.lanes=536870912,null}return Xp(t,s)}var r=e.memoizedState;if(r!==null){var a=r.dehydrated;if(xk(t),i)if(t.flags&256)t.flags&=-257,t=h9(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(ce(558));else if(Ln||Pc(e,t,n,!1),i=(n&e.childLanes)!==0,Ln||i){if(hl.current===null){if(s=Dt,s!==null&&(a=W$(s,n),a!==0&&a!==r.retryLane))throw r.retryLane=a,uu(e,a),si(s,e,a),hb;Mg()}t=h9(e,t,n)}else e=r.treeContext,Ut=Zi(a.nextSibling),is=t,tt=!0,el=null,Gi=!1,e!==null&&SA(t,e),t=Xp(t,s),t.flags|=134221824;return t}return e=Fo(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Nu(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(ce(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function bk(e,t,n,s,i){return Uc(t),n=nb(e,t,n,s,void 0,i),s=sb(),e!==null&&!Ln?(ib(e,t,i),Jo(e,t,i)):(tt&&s&&Vm(t),t.flags|=1,Hn(e,t,n,i),t.child)}function p9(e,t,n,s,i,r){return Uc(t),t.updateQueue=null,n=RA(t,s,n,i),_A(e),s=sb(),e!==null&&!Ln?(ib(e,t,r),Jo(e,t,r)):(tt&&s&&Vm(t),t.flags|=1,Hn(e,t,n,r),t.child)}function x9(e,t,n,s,i){if(Uc(t),t.stateNode===null){var r=Qu,a=n.contextType;typeof a=="object"&&a!==null&&(r=xs(a)),r=new n(s,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=yk,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=s,r.state=t.memoizedState,r.refs={},Q3(t),a=n.contextType,r.context=typeof a=="object"&&a!==null?xs(a):Qu,r.state=t.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(Cv(t,n,a,s),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(a=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),a!==r.state&&yk.enqueueReplaceState(r,r.state,null),Hh(t,s,r,i),Bh(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){r=t.stateNode;var l=t.memoizedProps,c=Wc(n,l);r.props=c;var u=r.context,d=n.contextType;a=Qu,typeof d=="object"&&d!==null&&(a=xs(d));var f=n.getDerivedStateFromProps;d=typeof f=="function"||typeof r.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(l||u!==a)&&l9(t,r,s,a),Ca=!1;var p=t.memoizedState;r.state=p,Hh(t,s,r,i),Bh(),u=t.memoizedState,l||p!==u||Ca?(typeof f=="function"&&(Cv(t,n,f,s),u=t.memoizedState),(c=Ca||a9(t,n,c,s,p,u,a))?(d||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=u),r.props=s,r.state=u,r.context=a,s=c):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{r=t.stateNode,fk(e,t),a=t.memoizedProps,d=Wc(n,a),r.props=d,f=t.pendingProps,p=r.context,u=n.contextType,c=Qu,typeof u=="object"&&u!==null&&(c=xs(u)),l=n.getDerivedStateFromProps,(u=typeof l=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(a!==f||p!==c)&&l9(t,r,s,c),Ca=!1,p=t.memoizedState,r.state=p,Hh(t,s,r,i),Bh();var x=t.memoizedState;a!==f||p!==x||Ca||e!==null&&e.dependencies!==null&&pg(e.dependencies)?(typeof l=="function"&&(Cv(t,n,l,s),x=t.memoizedState),(d=Ca||a9(t,n,d,s,p,x,c)||e!==null&&e.dependencies!==null&&pg(e.dependencies))?(u||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(s,x,c),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(s,x,c)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=x),r.props=s,r.state=x,r.context=c,s=d):(typeof r.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),s=!1)}return r=s,Nu(e,t),s=(t.flags&128)!==0,r||s?(r=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&s?(t.child=Vc(t,e.child,null,i),t.child=Vc(t,null,n,i)):Hn(e,t,n,i),t.memoizedState=r.state,e=t.child):e=Jo(e,t,i),e}function g9(e,t,n,s){return qc(),t.flags|=256,Hn(e,t,n,s),t.child}var wk={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jk(e){return{baseLanes:e,cachePool:EA()}}function Sk(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=ki),e}function vM(e,t,n){var s=t.pendingProps,i=!1,r=(t.flags&128)!==0,a;if((a=r)||(a=e!==null&&e.memoizedState===null?!1:(ms.current&2)!==0),a&&(i=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(tt){if(i?sl(t):il(),(e=Ut)?(e=gT(e,Gi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:dl!==null?{id:Jr,overflow:eo}:null,retryLane:536870912,hydrationErrors:null},n=wA(e),n.return=t,t.child=n,is=t,Ut=null)):e=null,e===null)throw fl(t);return $b(e)?t.lanes=32:t.lanes=536870912,null}return r=s.children,s=s.fallback,i?(il(),i=t.mode,r=Ym({mode:"hidden",children:r},i),s=_c(s,i,n,null),r.return=t,s.return=t,r.sibling=s,t.child=r,s=t.child,s.memoizedState=jk(n),s.childLanes=Sk(e,a,n),t.memoizedState=wk,Ph(null,s)):(sl(t),pb(t,r))}var l=e.memoizedState;if(l!==null){var c=l.dehydrated;if(c!==null)return AK(e,t,r,a,s,c,l,n)}return i?(il(),i=s.fallback,r=t.mode,l=e.child,c=l.sibling,s=Fo(l,{mode:"hidden",children:s.children}),s.subtreeFlags=l.subtreeFlags&1206910976,c!==null?i=Fo(c,i):(i=_c(i,r,n,null),i.flags|=2),i.return=t,s.return=t,s.sibling=i,t.child=s,Ph(null,s),s=t.child,i=e.child.memoizedState,i===null?i=jk(n):(r=i.cachePool,r!==null?(l=Rn._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=EA(),i={baseLanes:i.baseLanes|n,cachePool:r}),s.memoizedState=i,s.childLanes=Sk(e,a,n),t.memoizedState=wk,Ph(e.child,s)):(sl(t),n=e.child,e=n.sibling,n=Fo(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 pb(e,t){return t=Ym({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ym(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function pp(e,t,n){return Vc(t,e.child,null,n),e=pb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function AK(e,t,n,s,i,r,a,l){if(n)return t.flags&256?(sl(t),t.flags&=-257,pp(e,t,l)):t.memoizedState!==null?(il(),t.child=e.child,t.flags|=128,null):(il(),r=i.fallback,a=t.mode,i=Ym({mode:"visible",children:i.children},a),r=_c(r,a,l,null),r.flags|=2,i.return=t,r.return=t,i.sibling=r,t.child=i,Vc(t,e.child,null,l),i=t.child,i.memoizedState=jk(l),i.childLanes=Sk(e,s,l),t.memoizedState=wk,Ph(null,i));if(sl(t),$b(r)){if(s=r.nextSibling&&r.nextSibling.dataset,s)var c=s.dgst;return s=c,s!==""&&(i=Error(ce(419)),i.stack="",i.digest=s,u1({value:i,source:null,stack:null})),pp(e,t,l)}if(Ln||Pc(e,t,l,!1),s=(l&e.childLanes)!==0,Ln||s){if(hl.current!==null)return pp(e,t,l);if(s=Dt,s!==null&&(i=W$(s,l),i!==0&&i!==a.retryLane))throw a.retryLane=i,uu(e,i),si(s,e,i),hb;return Xk(r)||Mg(),pp(e,t,l)}return Xk(r)?(t.flags|=192,t.child=e.child,null):(e=a.treeContext,Ut=Zi(r.nextSibling),is=t,tt=!0,el=null,Gi=!1,e!==null&&SA(t,e),t=pb(t,i.children),t.flags|=134221824,t)}function m9(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Vp(e.return,t,n)}function v9(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&mg(n)===null&&(t=e),e=e.sibling}return t}function xp(e,t,n,s,i,r){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:i,treeForkCount:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=i,a.treeForkCount=r)}function Ev(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 Ck(e,t,n){var s=t.pendingProps,i=s.revealOrder,r=s.tail;s=s.children;var a=ms.current;if(t.flags&128)return f1(t,a),null;var l=(a&2)!==0;if(l?(a=a&1|2,t.flags|=128):a&=1,f1(t,a),i==="backwards"&&e!==null?(Ev(e),Hn(e,t,s,n),Ev(e)):Hn(e,t,s,n),s=tt?c1:0,!l&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&m9(e,n,t);else if(e.tag===19)m9(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(i){case"backwards":n=v9(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,Ev(t)),xp(t,!0,i,null,r,s);break;case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&mg(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xp(t,!0,n,null,r,s);break;case"together":xp(t,!1,null,null,void 0,s);break;case"independent":t.memoizedState=null;break;default:n=v9(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xp(t,!1,i,n,r,s)}return t.child}function y9(e,t,n){var s=t.pendingProps;return Ka(t,t.type,s.value),Hn(e,t,s.children,n),t.child}function Jo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xl|=t.lanes,!(n&t.childLanes))if(e!==null){if(Pc(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(ce(153));if(t.child!==null){for(e=t.child,n=Fo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xb(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&pg(e)))}function MK(e,t,n){switch(t.tag){case 3:og(t,t.stateNode.containerInfo),Ka(t,Rn,e.memoizedState.cache),qc();break;case 27:case 5:Qy(t);break;case 4:og(t,t.stateNode.containerInfo);break;case 10:Ka(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,xk(t),null;break;case 13:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return sl(t),t.flags|=128,null;s=Pc(e,t,n,!1);var i=t.child.childLanes;return s||n&i?vM(e,t,n):(sl(t),e=Jo(e,t,n),e!==null?e.sibling:null)}sl(t);break;case 19:if(t.flags&128)return Ck(e,t,n);if(i=(e.flags&128)!==0,s=(n&t.childLanes)!==0,s||(Pc(e,t,n,!1),s=(n&t.childLanes)!==0),i){if(s)return Ck(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),f1(t,ms.current),s)break;return null;case 22:return t.lanes=0,mM(e,t,n,t.pendingProps);case 24:Ka(t,Rn,e.memoizedState.cache)}return Jo(e,t,n)}function yM(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ln=!0;else{if(!xb(e,n)&&!(t.flags&128))return Ln=!1,MK(e,t,n);Ln=!!(e.flags&131072)}else Ln=!1,tt&&t.flags&1048576&&jA(t,c1,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Ol(t.elementType),t.type=e,typeof e=="function")W3(e)?(s=Wc(e,s),t.tag=1,t=x9(null,t,e,s,n)):(t.tag=0,t=bk(null,t,e,s,n));else{if(e!=null){var i=e.$$typeof;if(i===R3){t.tag=11,t=u9(null,t,e,s,n);break e}else if(i===I3){t.tag=14,t=d9(null,t,e,s,n);break e}else if(i===Yr){t.tag=10,t.type=e,t=y9(null,t,n);break e}}throw t=Zy(e)||e,Error(ce(306,t,""))}}return t;case 0:return bk(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,i=Wc(s,t.pendingProps),x9(e,t,s,i,n);case 3:e:{if(og(t,t.stateNode.containerInfo),e===null)throw Error(ce(387));s=t.pendingProps;var r=t.memoizedState;i=r.element,fk(e,t),Hh(t,s,null,n);var a=t.memoizedState;if(s=a.cache,Ka(t,Rn,s),s!==r.cache&&uk(t,[Rn],n,!0),Bh(),s=a.element,r.isDehydrated)if(r={element:s,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=g9(e,t,s,n);break e}else if(s!==i){i=Vi(Error(ce(424)),t),u1(i),t=g9(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(Ut=Zi(e.firstChild),is=t,tt=!0,el=null,Gi=!0,n=MA(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(qc(),s===i){t=Jo(e,t,n);break e}Hn(e,t,s,n)}t=t.child}return t;case 26:return Nu(e,t),e===null?(n=F9(t.type,null,t.pendingProps,null))?t.memoizedState=n:tt||(t.stateNode=lT(t.type,t.pendingProps,Ja.current,t)):t.memoizedState=F9(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Qy(t),e===null&&tt&&(s=t.stateNode=mT(t.type,t.pendingProps,Ja.current),is=t,Gi=!0,i=Ut,bl(t.type)?(Zk=i,Ut=Zi(s.firstChild)):Ut=i),Hn(e,t,t.pendingProps.children,n),Nu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&tt&&((i=s=Ut)&&(s=jX(s,t.type,t.pendingProps,Gi),s!==null?(t.stateNode=s,is=t,Ut=Zi(s.firstChild),Gi=!1,i=!0):i=!1),i||fl(t)),Qy(t),i=t.type,r=t.pendingProps,a=e!==null?e.memoizedProps:null,s=r.children,Gk(i,r)?s=null:a!==null&&Gk(i,a)&&(t.flags|=32),t.memoizedState!==null&&(i=nb(e,t,vK,null,null,n),sf._currentValue=i),Nu(e,t),Hn(e,t,s,n),t.child;case 6:return e===null&&tt&&((e=n=Ut)&&(n=SX(n,t.pendingProps,Gi),n!==null?(t.stateNode=n,is=t,Ut=null,e=!0):e=!1),e||fl(t)),null;case 13:return vM(e,t,n);case 4:return og(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Vc(t,null,s,n):Hn(e,t,s,n),t.child;case 11:return u9(e,t,t.type,t.pendingProps,n);case 7:return s=t.pendingProps,Nu(e,t),Hn(e,t,s,n),t.child;case 8:return Hn(e,t,t.pendingProps.children,n),t.child;case 12:return Hn(e,t,t.pendingProps.children,n),t.child;case 10:return y9(e,t,n);case 9:return i=t.type._context,s=t.pendingProps.children,Uc(t),i=xs(i),s=s(i),t.flags|=1,Hn(e,t,s,n),t.child;case 14:return d9(e,t,t.type,t.pendingProps,n);case 15:return gM(e,t,t.type,t.pendingProps,n);case 19:return Ck(e,t,n);case 31:return $K(e,t,n);case 22:return mM(e,t,n,t.pendingProps);case 24:return Uc(t),s=xs(Rn),e===null?(i=Z3(),i===null&&(i=Dt,r=X3(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=n),i=r),t.memoizedState={parent:s,cache:i},Q3(t),Ka(t,Rn,i)):(e.lanes&n&&(fk(e,t),Hh(t,null,null,n),Bh()),i=e.memoizedState,r=t.memoizedState,i.parent!==s?(i={parent:s,cache:s},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ka(t,Rn,s)):(s=r.cache,Ka(t,Rn,s),s!==i.cache&&uk(t,[Rn],n,!0))),Hn(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:tt&&Vm(t),e!==null&&e.memoizedProps.name!==s.name?t.flags|=4194816:Nu(e,t),Hn(e,t,s.children,n),t.child;case 29:throw t.pendingProps}throw Error(ce(156,t.tag))}function go(e){e.flags|=4}function $v(e,t,n,s,i){var r;if((r=(e.mode&32)!==0)&&(r=n===null?W9(t,s):W9(t,s)&&(s.src!==n.src||s.srcSet!==n.srcSet)),r){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(KM())e.flags|=8192;else throw Ic=xg,Y3}else e.flags&=-16777217}function k9(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!bT(t))if(KM())e.flags|=8192;else throw Ic=xg,Y3}function gp(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?F$():536870912,e.lanes|=t,Yd|=t)}function Yf(e,t){if(!tt)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 Ht(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags&1206910976,s|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags,s|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function TK(e,t,n){var s=t.pendingProps;switch(K3(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(t),null;case 1:return Ht(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Vo(Rn),Wd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ju(t)?go(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,wv())),Ht(t),null;case 26:var i=t.type,r=t.memoizedState;return e===null?(go(t),r!==null?(Ht(t),k9(t,r)):(Ht(t),$v(t,i,null,s,n))):r?r!==e.memoizedState?(go(t),Ht(t),k9(t,r)):(Ht(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&go(t),Ht(t),$v(t,i,e,s,n)),null;case 27:if(ag(t),n=Ja.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&go(t);else{if(!s){if(t.stateNode===null)throw Error(ce(166));return Ht(t),t.subtreeFlags&=-33554433,null}e=so.current,ju(t)?W8(t):(e=mT(i,s,n),t.stateNode=e,go(t))}return Ht(t),t.subtreeFlags&=-33554433,null;case 5:if(ag(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&go(t);else{if(!s){if(t.stateNode===null)throw Error(ce(166));return Ht(t),t.subtreeFlags&=-33554433,null}if(r=so.current,ju(t))W8(t);else{var a=g1(Ja.current);switch(r){case 1:r=a.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=a.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=a.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=a.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=a.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof s.is=="string"?a.createElement("select",{is:s.is}):a.createElement("select"),s.multiple?r.multiple=!0:s.size&&(r.size=s.size);break;default:r=typeof s.is=="string"?a.createElement(i,{is:s.is}):a.createElement(i)}}r[ps]=t,r[ri]=s;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)r.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=r;e:switch(vs(r,i,s),i){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&go(t)}}return Ht(t),t.subtreeFlags&=-33554433,$v(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&go(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(ce(166));if(e=Ja.current,ju(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,i=is,i!==null)switch(i.tag){case 27:case 5:s=i.memoizedProps}e[ps]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||oT(e.nodeValue,n)),e||fl(t,!0)}else e=g1(e).createTextNode(s),e[ps]=t,t.stateNode=e}return Ht(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=ju(t),n!==null){if(e===null){if(!s)throw Error(ce(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ce(557));e[ps]=t}else qc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ht(t),e=!1}else n=wv(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(vi(t),t):(vi(t),null);if(t.flags&128)throw Error(ce(558))}return Ht(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ju(t),s!==null&&s.dehydrated!==null){if(e===null){if(!i)throw Error(ce(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ce(317));i[ps]=t}else qc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ht(t),i=!1}else i=wv(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(vi(t),t):(vi(t),null)}return vi(t),t.flags&128?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,i=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(i=s.alternate.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==i&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),gp(t,t.updateQueue),Ht(t),null);case 4:return Wd(),e===null&&Sb(t.stateNode.containerInfo),t.flags|=67108864,Ht(t),null;case 10:return Vo(t.type),Ht(t),null;case 19:if(eb(t),s=t.memoizedState,s===null)return Ht(t),null;if(i=(t.flags&128)!==0,r=s.rendering,r===null)if(i)Yf(s,!1);else{if(bn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(r=mg(e),r!==null){for(t.flags|=128,Yf(s,!1),e=r.updateQueue,t.updateQueue=e,gp(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)bA(n,e),n=n.sibling;return f1(t,ms.current&1|2),tt&&ko(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&wi()>$g&&(t.flags|=128,i=!0,Yf(s,!1),t.lanes=4194304)}else{if(!i)if(e=mg(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,gp(t,e),Yf(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!r.alternate&&!tt)return Ht(t),null}else 2*wi()-s.renderingStartTime>$g&&n!==536870912&&(t.flags|=128,i=!0,Yf(s,!1),t.lanes=4194304);s.isBackwards?(r.sibling=t.child,t.child=r):(e=s.last,e!==null?e.sibling=r:t.child=r,s.last=r)}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=wi(),e.sibling=null,r=ms.current,r=i?r&1|2:r&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!n||tt?f1(t,r):(n=r,Vt(ys,t),Vt(ms,n),As===null&&(As=t)),tt&&ko(t,s.treeForkCount),e}return Ht(t),null;case 22:case 23:return vi(t),J3(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&(Ht(t),t.subtreeFlags&6&&(t.flags|=8192)):Ht(t),n=t.updateQueue,n!==null&&gp(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&&gs(Rc),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vo(Rn),Ht(t),null;case 25:return null;case 30:return t.flags|=33554432,Ht(t),null}throw Error(ce(156,t.tag))}function zK(e,t){switch(K3(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vo(Rn),Wd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ag(t),null;case 31:if(t.memoizedState!==null){if(vi(t),t.alternate===null)throw Error(ce(340));qc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(vi(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ce(340));qc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return eb(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 Wd(),null;case 10:return Vo(t.type),null;case 22:case 23:return vi(t),J3(),e!==null&&gs(Rc),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vo(Rn),null;case 25:return null;default:return null}}function kM(e,t){switch(K3(t),t.tag){case 3:Vo(Rn),Wd();break;case 26:case 27:case 5:ag(t);break;case 4:Wd();break;case 31:t.memoizedState!==null&&vi(t);break;case 13:vi(t);break;case 19:eb(t);break;case 10:Vo(t.type);break;case 22:case 23:vi(t),J3(),e!==null&&gs(Rc);break;case 24:Vo(Rn)}}function x0(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){s=void 0;var r=n.create,a=n.inst;s=r(),a.destroy=s}n=n.next}while(n!==i)}}catch(l){At(t,t.return,l)}}function pl(e,t,n){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var r=i.next;s=r;do{if((s.tag&e)===e){var a=s.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,i=t;var c=n,u=l;try{u()}catch(d){At(i,c,d)}}}s=s.next}while(s!==r)}}catch(d){At(t,t.return,d)}}function bM(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{zA(t,n)}catch(s){At(e,e.return,s)}}}function wM(e,t,n){n.props=Wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){At(e,t,s)}}function Wr(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 i=e.stateNode,r=Zo(e.memoizedProps,i);(i.ref===null||i.ref.name!==r)&&(i.ref=dT(r)),s=i.ref;break;case 7:if(e.stateNode===null){var a=new Mi(e);ii(e.child,!1,bX,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){At(e,t,l)}}function hs(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(i){At(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){At(e,t,i)}else n.current=null}function wg(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++)xT(e.stateNode,t[n])}function b9(e){for(var t=e.return;t!==null&&(mb(t)&&xT(e.stateNode,t.stateNode),!gb(t));)t=t.return}function Uh(e){for(var t=e.return;t!==null&&(mb(t)&&wX(e.stateNode,t.stateNode),!gb(t));)t=t.return}function gb(e){return e.tag===5||e.tag===3||e.tag===27}function mb(e){return e&&e.tag===7&&e.stateNode!==null}function Ek(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(i){At(e,e.return,i)}}function Av(e,t,n){try{var s=e.stateNode;sX(s,e.type,n,t),s[ri]=t}catch(i){At(e,e.return,i)}}function jM(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bl(e.type)||e.tag===4}function Mv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jM(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&&bl(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 $k(e,t,n,s){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qr)),wg(e,s),vt=!0;else if(i!==4&&(i===27&&(wg(e,s),s=null,bl(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for($k(e,t,n,s),e=e.sibling;e!==null;)$k(e,t,n,s),e=e.sibling}function jg(e,t,n,s){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),wg(e,s),vt=!0;else if(i!==4&&(i===27&&(wg(e,s),s=null,bl(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jg(e,t,n,s),e=e.sibling;e!==null;)jg(e,t,n,s),e=e.sibling}function SM(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);vs(t,s,n),t[ps]=e,t[ri]=n}catch(r){At(e,e.return,r)}}var Sg=!1,yi=null;function w9(e){(e.tag===30||e.subtreeFlags&33554432)&&(Sg=!0)}var Xr=null;function j9(){var e=Xr;return Xr=null,e}var ti=0;function $f(e,t,n,s,i){return ti=0,CM(e.child,t,n,s,i)}function CM(e,t,n,s,i){for(var r=!1;e!==null;){if(e.tag===5){var a=e.stateNode;if(s!==null){var l=Wk(a);s.push(l),l.view&&(r=!0)}else r||Wk(a).view&&(r=!0);Sg=!0,cT(a,ti===0?t:t+"_"+ti,n),ti++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||CM(e.child,t,n,s,i)&&(r=!0));e=e.sibling}return r}function oo(e,t){for(;e!==null;)e.tag===5?uT(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||oo(e.child,t)),e=e.sibling}function Zp(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Zp(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(ce(544));var n=t.name;t=oa(t.default,t.share),t!=="none"&&($f(e,n,t,null,!1)||oo(e.child,!1))}e=e.sibling}}function Ak(e,t){if(e.tag===30){var n=e.stateNode,s=e.memoizedProps,i=Zo(s,n),r=oa(s.default,n.paired?s.share:s.enter);r!=="none"?$f(e,i,r,null,!1)?(Zp(e),n.paired||t||Qd(e,s.onEnter)):oo(e.child,!1):Zp(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ak(e,t),e=e.sibling;else Zp(e)}function Mk(e){if(yi!==null&&yi.size!==0){var t=yi;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 i=t.get(s);if(i!==void 0){var r=oa(n.default,n.share);if(r!=="none"&&($f(e,s,r,null,!1)?(r=e.stateNode,i.paired=r,r.paired=i,Qd(e,n.onShare)):oo(e.child,!1)),t.delete(s),t.size===0)break}}}Mk(e)}e=e.sibling}}}function Tk(e){if(e.tag===30){var t=e.memoizedProps,n=Zo(t,e.stateNode),s=yi!==null?yi.get(n):void 0,i=oa(t.default,s!==void 0?t.share:t.exit);i!=="none"&&($f(e,n,i,null,!1)?s!==void 0?(i=e.stateNode,s.paired=i,i.paired=s,yi.delete(n),Qd(e,t.onShare)):Qd(e,t.onExit):oo(e.child,!1)),yi!==null&&Mk(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Tk(e),e=e.sibling;else yi!==null&&Mk(e)}function EM(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Zo(t,e.stateNode);t=oa(t.default,t.update),e.flags&=-5,t!=="none"&&$f(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&EM(e);e=e.sibling}}function zk(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,oo(e.child,!1))}zk(e)}e=e.sibling}}function Yp(e){if(e.tag===30)e.stateNode.paired=null,oo(e.child,!1),zk(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yp(e),e=e.sibling;else zk(e)}function $M(e){for(e=e.child;e!==null;)e.tag===30?oo(e.child,!1):e.subtreeFlags&33554432&&$M(e),e=e.sibling}function vb(e,t,n,s,i,r,a){for(var l=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(r!==null&&ti<r.length){var u=r[ti],d=Wk(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&&cT(c,ti===0?n:n+"_"+ti,i),l&&e.flags&4||(Xr===null&&(Xr=[]),Xr.push(c,ti===0?s:s+"_"+ti,t.memoizedProps)),ti++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&a?e.flags|=t.flags&32:vb(e,t.child,n,s,i,r,a)&&(l=!0));t=t.sibling}return l}function AM(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,s=e.stateNode,i=Zo(n,s),r=oa(n.default,n.update),a;a=e.memoizedState,e.memoizedState=null,s=e;var l=e.child;ti=0,i=vb(s,l,i,i,r,a,!1),e.flags&4&&i&&Qd(e,n.onUpdate)}else e.subtreeFlags&33554432&&AM(e);e=e.sibling}}var es=!1,jt=!1,Ar=!1,Tv=!1,S9=typeof WeakSet=="function"?WeakSet:Set,ts=null,Mr=!1,gh=!1,Cg=!1,Nk=!1;function NK(e,t,n){if(e=e.containerInfo,Fk=rf,e=hA(e),F3(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var r=i.anchorOffset,a=i.focusNode;i=i.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||r!==0&&p.nodeType!==3||(c=l+r),p!==a||i!==0&&p.nodeType!==3||(u=l+i),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===r&&(c=l),x===a&&++f===i&&(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(Vk={focusedElem:e,selectionRange:s},rf=!1,n=(n&335544064)===n,ts=t,t=n?9270:1024;ts!==null;){if(e=ts,n&&(s=e.deletions,s!==null))for(r=0;r<s.length;r++)n&&Tk(s[r]);if(e.alternate===null&&e.flags&2)n&&w9(e),mp(n);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&n&&Tk(s),mp(n);continue}else if(s!==null&&s.memoizedState!==null){n&&w9(e),mp(n);continue}}s=e.child,e.subtreeFlags&t&&s!==null?(s.return=e,ts=s):(n&&EM(e),mp(n))}}yi=null}function mp(e){for(;ts!==null;){var t=ts,n=e,s=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&s!==null){n=void 0,i=s.memoizedProps,s=s.memoizedState;var r=t.stateNode;try{var a=Wc(t.type,i);n=r.getSnapshotBeforeUpdate(a,s),r.__reactInternalSnapshotBeforeUpdate=n}catch(l){At(t,t.return,l)}}break;case 3:if(i&1024){if(s=t.stateNode.containerInfo,n=s.nodeType,n===9)Kk(s);else if(n===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Kk(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=Zo(s.memoizedProps,s.stateNode),i=t.memoizedProps,i=oa(i.default,i.update),i!=="none"&&$f(s,n,i,s.memoizedState=[],!0));break;default:if(i&1024)throw Error(ce(163))}if(s=t.sibling,s!==null){s.return=t.return,ts=s;break}ts=t.return}}function MM(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:Tr(e,n),s&4&&x0(5,n);break;case 1:if(Tr(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(a){At(n,n.return,a)}else{var i=Wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){At(n,n.return,a)}}s&64&&bM(n),s&512&&Wr(n,n.return);break;case 3:if(Tr(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{zA(e,t)}catch(a){At(n,n.return,a)}}break;case 27:t===null&&s&4&&SM(n);case 26:case 5:Tr(e,n),t===null&&s&4&&Ek(n),s&512&&Wr(n,n.return);break;case 12:Tr(e,n);break;case 31:Tr(e,n),s&4&&_M(e,n);break;case 13:Tr(e,n),s&4&&RM(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=FK.bind(null,n),CX(e,n))));break;case 22:if(s=n.memoizedState!==null||es,!s){var r=t!==null&&t.memoizedState!==null||jt;t=es,i=jt,es=s,(jt=r)&&!i?(s=2,n.subtreeFlags&8772&&(s|=1),cr(e,n,s)):Tr(e,n),es=t,jt=i}break;case 30:Tr(e,n),s&512&&Wr(n,n.return);break;case 7:s&512&&Wr(n,n.return);default:Tr(e,n)}}function _k(e,t){for(e=e.child;e!==null;)TM(e,t),e=e.sibling}function TM(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 i=e.stateNode,r=e.memoizedProps.style,a=r!=null&&r.hasOwnProperty("display")?r.display:null;i.style.display=a==null||typeof a=="boolean"?"":(""+a).trim()}}catch(c){At(e,e.return,c)}Rk(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,vt=!0}catch(c){At(e,e.return,c)}break;case 18:try{var l=e.stateNode;t?D9(l,!0):D9(e.stateNode,!1)}catch(c){At(e,e.return,c)}break;case 22:case 23:e.memoizedState===null&&_k(e,t);break;default:_k(e,t)}}function Rk(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,s=t;switch(n.tag){case 4:TM(n,s);break e;case 22:n.memoizedState===null&&Rk(n,s);break e;default:Rk(n,s)}}e=e.sibling}}function zM(e){var t=e.alternate;t!==null&&(e.alternate=null,zM(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Bm(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 sn=null,Qs=!1;function lr(e,t,n){for(n=n.child;n!==null;)NM(e,t,n),n=n.sibling}function NM(e,t,n){if(ji&&typeof ji.onCommitFiberUnmount=="function")try{ji.onCommitFiberUnmount(l0,n)}catch{}switch(n.tag){case 26:jt||hs(n,t),lr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!jt&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:jt||hs(n,t),Uh(n);var s=sn,i=Qs;bl(n.type)&&(sn=n.stateNode,Qs=!1),lr(e,t,n),vT(n.stateNode,n.type,n.memoizedProps),sn=s,Qs=i;break;case 5:jt||hs(n,t),Uh(n);case 6:if(n.tag===6&&Uh(n),s=sn,i=Qs,sn=null,lr(e,t,n),sn=s,Qs=i,sn!==null)if(Qs)try{(sn.nodeType===9?sn.body:sn.nodeName==="HTML"?sn.ownerDocument.body:sn).removeChild(n.stateNode),vt=!0}catch(r){At(n,t,r)}else try{sn.removeChild(n.stateNode),vt=!0}catch(r){At(n,t,r)}break;case 18:sn!==null&&(Qs?(e=sn,O9(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),of(e)):O9(sn,n.stateNode));break;case 4:s=sn,i=Qs,sn=n.stateNode.containerInfo,Qs=!0,lr(e,t,n),sn=s,Qs=i;break;case 0:case 11:case 14:case 15:pl(2,n,t),jt||pl(4,n,t),lr(e,t,n);break;case 1:jt||(hs(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&wM(n,t,s)),lr(e,t,n);break;case 21:lr(e,t,n);break;case 22:jt=(s=jt)||n.memoizedState!==null,lr(e,t,n),jt=s;break;case 30:hs(n,t),lr(e,t,n);break;case 7:jt||hs(n,t),lr(e,t,n);break;default:lr(e,t,n)}}function _M(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{of(e)}catch(n){At(t,t.return,n)}}}function RM(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{of(e)}catch(n){At(t,t.return,n)}}function _K(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new S9),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new S9),t;default:throw Error(ce(435,e.tag))}}function vp(e,t){var n=_K(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var i=VK.bind(null,e,s);s.then(i,i)}})}function Os(e,t,n){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var r=s[i],a=e,l=t,c=l;e:for(;c!==null;){switch(c.tag){case 27:if(bl(c.type)){sn=c.stateNode,Qs=!1;break e}break;case 5:sn=c.stateNode,Qs=!1;break e;case 3:case 4:sn=c.stateNode.containerInfo,Qs=!0;break e}c=c.return}if(sn===null)throw Error(ce(160));NM(a,l,r),sn=null,Qs=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)IM(t,e,n),t=t.sibling}var gr=null;function IM(e,t,n){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(s=e.updateQueue,s=s!==null?s.events:null,s!==null))for(var r=0;r<s.length;r++){var a=s[r];a.ref.impl=a.nextImpl}Os(t,e,n),Ds(e),i&4&&(pl(3,e,e.return),x0(3,e),pl(5,e,e.return));break;case 1:Os(t,e,n),Ds(e),i&512&&(jt||s===null||hs(s,s.return)),i&64&&es&&(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(r=gr,Os(t,e,n),Ds(e),i&512&&(jt||s===null||hs(s,s.return)),i&4)if(i=s!==null?s.memoizedState:null,n=e.memoizedState,s===null)if(n===null)if(e.stateNode===null)if(es)e.stateNode=lT(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,i=r.ownerDocument||r;t:switch(t){case"title":s=i.getElementsByTagName("title")[0],(!s||s[d0]||s[ps]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(t),i.head.insertBefore(s,i.querySelector("head > title"))),vs(s,t,n),s[ps]=e,ns(s),t=s;break e;case"link":if(r=G9("link","href",i).get(t+(n.href||""))){for(a=0;a<r.length;a++)if(s=r[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)){r.splice(a,1);break t}}s=i.createElement(t),vs(s,t,n),i.head.appendChild(s);break;case"meta":if(r=G9("meta","content",i).get(t+(n.content||""))){for(a=0;a<r.length;a++)if(s=r[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)){r.splice(a,1);break t}}s=i.createElement(t),vs(s,t,n),i.head.appendChild(s);break;default:throw Error(ce(468,t))}s[ps]=e,ns(s),t=s}e.stateNode=t}else es||Yk(r,e.type,e.stateNode);else e.stateNode=V9(r,n,e.memoizedProps);else i!==n?(i===null?(t=s.stateNode,t===null||jt||t.parentNode.removeChild(t)):i.count--,n===null?es||Yk(r,e.type,e.stateNode):V9(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Av(e,e.memoizedProps,s.memoizedProps);break;case 27:Os(t,e,n),Ds(e),i&512&&(jt||s===null||hs(s,s.return)),s!==null&&i&4&&Av(e,e.memoizedProps,s.memoizedProps);break;case 5:if(r=Ar,Ar=!1,Os(t,e,n),Ar=r,Ds(e),i&512&&(jt||s===null||hs(s,s.return)),e.flags&32){t=e.stateNode;try{Xd(t,""),vt=!0}catch(d){At(e,e.return,d)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Av(e,t,s!==null?s.memoizedProps:t)),i&1024&&(Tv=!0);break;case 6:if(Os(t,e,n),Ds(e),i&4){if(e.stateNode===null)throw Error(ce(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,vt=!0}catch(d){At(e,e.return,d)}}break;case 3:if(vt=!1,tx=null,r=gr,gr=m1(t.containerInfo),Os(t,e,n),gr=r,Ds(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{of(t.containerInfo)}catch(d){At(e,e.return,d)}Tv&&(Tv=!1,LM(e)),vt=!1;break;case 4:i=Ar,Ar=es,s=M8(),r=gr,gr=m1(e.stateNode.containerInfo),Os(t,e,n),Ds(e),gr=r,vt&&gh&&(Cg=!0),vt=s,Ar=i;break;case 12:Os(t,e,n),Ds(e);break;case 31:Os(t,e,n),Ds(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,vp(e,t)));break;case 13:Os(t,e,n),Ds(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Qm=wi()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,vp(e,t)));break;case 22:r=e.memoizedState!==null,a=s!==null&&s.memoizedState!==null;var l=es,c=jt,u=Ar;es=l||r,Ar=u||r,jt=c||a,Os(t,e,n),jt=c,Ar=u,es=l,Ds(e),i&8192&&(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,!r||s===null||a||es||jt||(t=a||jt,n=es,s=jt,es=r||es,jt=t,va(e,2),es=n,jt=s),!r&&Ar||_k(e,r)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,vp(e,n))));break;case 19:Os(t,e,n),Ds(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,vp(e,t)));break;case 30:i&512&&(jt||s===null||hs(s,s.return)),i=M8(),r=gh,a=(n&335544064)===n,l=e.memoizedProps,gh=a&&oa(l.default,l.update)!=="none",Os(t,e,n),Ds(e),a&&s!==null&&vt&&(e.flags|=4),gh=r,vt=i;break;case 21:break;case 7:i&512&&(jt||s===null||hs(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:Os(t,e,n),Ds(e)}}function Ds(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(jM(s)){n=s;break}s=s.return}s=null;for(var i=e.return;i!==null;){if(mb(i)){var r=i.stateNode;s===null?s=[r]:s.push(r)}if(gb(i))break;i=i.return}var a=s;if(n==null)throw Error(ce(160));switch(n.tag){case 27:var l=n.stateNode,c=Mv(e);jg(e,c,l,a);break;case 5:var u=n.stateNode;n.flags&32&&(Xd(u,""),n.flags&=-33);var d=Mv(e);jg(e,d,u,a);break;case 3:case 4:var f=n.stateNode.containerInfo,p=Mv(e);$k(e,p,f,a);break;default:throw Error(ce(161))}}catch(x){At(e,e.return,x)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function LM(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;LM(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,rf=!0,t.reset(),rf=!1),e=e.sibling}}function Su(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)OM(t,e),t=t.sibling;else AM(t)}function OM(e,t){var n=e.alternate;if(n===null)Ak(e,!1);else switch(e.tag){case 3:if(Nk=Mr=!1,j9(),Su(t,e),!Mr&&!Cg){if(e=Xr,e!==null)for(var s=0;s<e.length;s+=3){n=e[s];var i=e[s+1];uT(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("+i+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Nk=!0}Xr=null;break;case 5:Su(t,e);break;case 4:s=Mr,Mr=!1,Su(t,e),Mr&&(Cg=!0),Mr=s;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?Ak(e,!1):Su(t,e));break;case 30:s=Mr,i=j9(),Mr=!1,Su(t,e),Mr&&(e.flags|=4);var r=e.memoizedProps,a=e.stateNode;t=Zo(r,a),a=Zo(n.memoizedProps,a);var l=oa(r.default,r.update);l==="none"?t=!1:(r=n.memoizedState,n.memoizedState=null,n=e.child,ti=0,t=vb(e,n,t,a,l,r,!0),ti!==(r===null?0:r.length)&&(e.flags|=32)),e.flags&4&&t?(Qd(e,e.memoizedProps.onUpdate),Xr=i):i!==null&&(i.push.apply(i,Xr),Xr=i),Mr=e.flags&32?!0:s;break;default:Su(t,e)}}function Tr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)MM(e,t.alternate,t),t=t.sibling}function va(e,t){for(e=e.child;e!==null;){var n=e,s=t;switch(n.tag){case 0:case 11:case 14:case 15:pl(4,n,n.return),va(n,s);break;case 1:hs(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&wM(n,n.return,i),va(n,s);break;case 27:s&2&&vT(n.stateNode,n.type,n.memoizedProps);case 5:hs(n,n.return),n.tag!==5&&n.tag!==27||Uh(n),va(n,s);break;case 6:Uh(n);break;case 26:hs(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||jt||i.parentNode.removeChild(i),va(n,s);break;case 22:n.memoizedState===null&&va(n,s);break;case 30:hs(n,n.return),va(n,s);break;case 7:hs(n,n.return);default:va(n,s)}e=e.sibling}}function cr(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var s=t.alternate,i=e,r=t,a=r.flags,l=(n&1)!==0;switch(r.tag){case 0:case 11:case 15:cr(i,r,n),x0(4,r);break;case 1:if(cr(i,r,n),s=r,i=s.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(d){At(s,s.return,d)}if(s=r,i=s.updateQueue,i!==null){var c=s.stateNode;try{var u=i.shared.hiddenCallbacks;if(u!==null)for(i.shared.hiddenCallbacks=null,i=0;i<u.length;i++)TA(u[i],c)}catch(d){At(s,s.return,d)}}l&&a&64&&bM(r),Wr(r,r.return);break;case 27:n&2&&SM(r);case 5:r.tag!==5&&r.tag!==27||b9(r),cr(i,r,n),l&&s===null&&a&4&&Ek(r),Wr(r,r.return);break;case 6:b9(r);break;case 26:c=r.stateNode,r.memoizedState!==null||c===null||es||Yk(m1(c.ownerDocument),r.type,c),cr(i,r,n),l&&s===null&&a&4&&Ek(r),Wr(r,r.return);break;case 12:cr(i,r,n);break;case 31:cr(i,r,n),l&&a&4&&_M(i,r);break;case 13:cr(i,r,n),l&&a&4&&RM(i,r);break;case 22:r.memoizedState===null&&cr(i,r,n),Wr(r,r.return);break;case 30:cr(i,r,n),Wr(r,r.return);break;case 7:Wr(r,r.return);default:cr(i,r,n)}t=t.sibling}}function yb(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&&h0(n))}function kb(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&h0(e))}function Ni(e,t,n,s){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)DM(e,t,n,s),t=t.sibling;else i&&$M(t)}function DM(e,t,n,s){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Yp(t);var r=t.flags;switch(t.tag){case 0:case 11:case 15:Ni(e,t,n,s),r&2048&&x0(9,t);break;case 1:Ni(e,t,n,s);break;case 3:Ni(e,t,n,s),i&&Nk&&(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="")),r&2048&&(r=null,t.alternate!==null&&(r=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==r&&(t.refCount++,r!=null&&h0(r)));break;case 12:if(r&2048){Ni(e,t,n,s),r=t.stateNode;try{var a=t.memoizedProps,l=a.id,c=a.onPostCommit;typeof c=="function"&&c(l,t.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(u){At(t,t.return,u)}}else Ni(e,t,n,s);break;case 31:Ni(e,t,n,s);break;case 13:Ni(e,t,n,s);break;case 23:break;case 22:a=t.stateNode,l=t.alternate,t.memoizedState!==null?(i&&l!==null&&l.memoizedState===null&&Yp(l),a._visibility&2?Ni(e,t,n,s):Fh(e,t)):(i&&l!==null&&l.memoizedState!==null&&Yp(t),a._visibility&2?Ni(e,t,n,s):(a._visibility|=2,_u(e,t,n,s,(t.subtreeFlags&10256)!==0||!1))),r&2048&&yb(l,t);break;case 24:Ni(e,t,n,s),r&2048&&kb(t.alternate,t);break;case 30:i&&(r=t.alternate,r!==null&&(oo(r.child,!0),oo(t.child,!0))),Ni(e,t,n,s);break;default:Ni(e,t,n,s)}}function _u(e,t,n,s,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,a=t,l=n,c=s,u=a.flags;switch(a.tag){case 0:case 11:case 15:_u(r,a,l,c,i),x0(8,a);break;case 23:break;case 22:var d=a.stateNode;a.memoizedState!==null?d._visibility&2?_u(r,a,l,c,i):Fh(r,a):(d._visibility|=2,_u(r,a,l,c,i)),i&&u&2048&&yb(a.alternate,a);break;case 24:_u(r,a,l,c,i),i&&u&2048&&kb(a.alternate,a);break;default:_u(r,a,l,c,i)}t=t.sibling}}function Fh(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,i=s.flags;switch(s.tag){case 22:Fh(n,s),i&2048&&yb(s.alternate,s);break;case 24:Fh(n,s),i&2048&&kb(s.alternate,s);break;default:Fh(n,s)}t=t.sibling}}var Dl=8192;function Nl(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)BM(e,t,n),e=e.sibling}function BM(e,t,n){switch(e.tag){case 26:Nl(e,t,n),e.flags&Dl&&(e.memoizedState!==null?BX(n,gr,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&K9(n,e)));break;case 5:Nl(e,t,n),e.flags&Dl&&(e=e.stateNode,(t&335544128)===t&&K9(n,e));break;case 3:case 4:var s=gr;gr=m1(e.stateNode.containerInfo),Nl(e,t,n),gr=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Dl,Dl=16777216,Nl(e,t,n),Dl=s):Nl(e,t,n));break;case 30:if(e.flags&Dl&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var i=e.stateNode;i.paired=null,yi===null&&(yi=new Map),yi.set(s,i)}Nl(e,t,n);break;default:Nl(e,t,n)}}function HM(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 Qf(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];ts=s,PM(s,e)}HM(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qM(e),e=e.sibling}function qM(e){switch(e.tag){case 0:case 11:case 15:Qf(e),e.flags&2048&&pl(9,e,e.return);break;case 3:Qf(e);break;case 12:Qf(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qp(e)):Qf(e);break;default:Qf(e)}}function Qp(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];ts=s,PM(s,e)}HM(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:pl(8,t,t.return),Qp(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qp(t));break;default:Qp(t)}e=e.sibling}}function PM(e,t){for(;ts!==null;){var n=ts;switch(n.tag){case 0:case 11:case 15:pl(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:h0(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,ts=s;else e:for(n=e;ts!==null;){s=ts;var i=s.sibling,r=s.return;if(zM(s),s===n){ts=null;break e}if(i!==null){i.return=r,ts=i;break e}ts=r}}}var RK={getCacheForType:function(e){var t=xs(Rn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xs(Rn).controller.signal}},IK=typeof WeakMap=="function"?WeakMap:Map,bt=0,Dt=null,rt=null,ot=0,Et=0,pi=null,Xa=!1,Af=!1,bb=!1,ea=0,bn=0,xl=0,Lc=0,Eg=0,ki=0,Yd=0,Vh=null,Js=null,Ik=!1,Qm=0,UM=0,$g=1/0,Ag=null,rl=null,hn=0,kr=null,Kc=null,io=0,Lk=0,Ok=null,FM=null,hd=null,pd=null,xd=null,Gh=0,Jp=null;function Ci(){return bt&2&&ot!==0?ot&-ot:Ve.T!==null?jb():K$()}function VM(){if(ki===0)if(!(ot&536870912)||tt){var e=ap;ap<<=1,!(ap&3932160)&&(ap=262144),ki=e}else ki=536870912;return e=ys.current,e!==null&&(e.flags|=32),ki}function Qd(e,t){if(t!=null){var n=e.stateNode,s=n.ref;s===null&&(s=n.ref=dT(Zo(e.memoizedProps,n))),pd===null&&(pd=[]),pd.push(t.bind(null,s))}}function si(e,t,n){(e===Dt&&(Et===2||Et===9)||e.cancelPendingCommit!==null)&&(Jd(e,0),Za(e,ot,ki,!1)),u0(e,n),(!(bt&2)||e!==Dt)&&(e===Dt&&(!(bt&2)&&(Lc|=n),bn===4&&Za(e,ot,ki,!1)),uo(e))}function GM(e,t,n){if(bt&6)throw Error(ce(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||c0(e,t),i=s?DK(e,t):zv(e,t,!0),r=s;do{if(i===0){Af&&!s&&Za(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!LK(n)){i=zv(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)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;i=Vh;var c=l.current.memoizedState.isDehydrated;if(c&&(Jd(l,a).flags|=256),a=zv(l,a,!1),a!==2&&a!==6){if(bb&&!c){l.errorRecoveryDisabledLanes|=r,Lc|=r,i=4;break e}r=Js,Js=i,r!==null&&(Js===null?Js=r:Js.push.apply(Js,r))}i=a}if(r=!1,i!==2)continue}}if(i===1){Jd(e,0),Za(e,t,0,!0);break}e:{switch(s=e,r=i,r){case 0:case 1:throw Error(ce(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Za(s,t,ki,!Xa);break e;case 2:Js=null;break;case 3:case 5:break;default:throw Error(ce(329))}if((t&62914560)===t&&(i=Qm+300-wi(),10<i)){if(Za(s,t,ki,!Xa),Dm(s,0,!0)!==0)break e;io=t,s.timeoutHandle=Cb(C9.bind(null,s,n,Js,Ag,Ik,t,ki,Lc,Yd,Xa,r,"Throttled",-0,0),i);break e}C9(s,n,Js,Ag,Ik,t,ki,Lc,Yd,Xa,r,null,-0,0)}}break}while(!0);uo(e)}function C9(e,t,n,s,i,r,a,l,c,u,d,f,p,x){e.timeoutHandle=-1;var g=t.subtreeFlags,y=(r&335544064)===r;if(f=null,(y||g&8192||(g&16785408)===16785408)&&(f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qr},yi=null,BM(t,r,f),y&&(g=f,y=e.containerInfo,y=(y.nodeType===9?y:y.ownerDocument).__reactViewTransition,y!=null&&(g.count++,g.waitingForViewTransition=!0,g=v1.bind(g),y.finished.then(g,g))),g=(r&62914560)===r?Qm-wi():(r&4194048)===r?UM-wi():0,g=HX(f,g),g!==null)){io=r,e.cancelPendingCommit=g($9.bind(null,e,t,r,n,s,i,a,l,c,u,d,f,null,p,x)),Za(e,r,a,!u);return}$9(e,t,r,n,s,i,a,l,c,u,d,f)}function LK(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 i=n[s],r=i.getSnapshot;i=i.value;try{if(!$i(r(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Za(e,t,n,s){t=U$(e,t),t&=~Eg,t&=~Lc,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var i=t;0<i;){var r=31-Si(i),a=1<<r;s[r]=-1,i&=~a}n!==0&&V$(e,n,t)}function Jm(){return bt&6?!0:(g0(0),!1)}function wb(){if(rt!==null){if(Et===0)var e=rt.return;else e=rt,Do=du=null,rb(e),ud=null,d1=0,e=rt;for(;e!==null;)kM(e.alternate,e),e=e.return;rt=null}}function Jd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,oX(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),io=0,wb(),Dt=e,rt=n=Fo(e.current,null),ot=t,Et=0,pi=null,Xa=!1,Af=c0(e,t),bb=!1,Yd=ki=Eg=Lc=xl=bn=0,Js=Vh=null,Ik=!1,ea=U$(e,t),Um(),n}function WM(e,t){Ze=null,Ve.H=kg,t===Ef||t===Gm?(t=Q8(),Et=3):t===Y3?(t=Q8(),Et=4):Et=t===hb?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,pi=t,rt===null&&(bn=1,bg(e,Vi(t,e.current)))}function KM(){var e=ys.current;return e===null?!0:(ot&4194048)===ot?As===null:(ot&62914560)===ot||ot&536870912?e===As:!1}function XM(){var e=Ve.H;return Ve.H=kg,e===null?kg:e}function ZM(){var e=Ve.A;return Ve.A=RK,e}function Mg(){bn=4,Xa||(ot&4194048)!==ot&&ys.current!==null||(Af=!0),!(xl&134217727)&&!(Lc&134217727)||Dt===null||Za(Dt,ot,ki,!1)}function zv(e,t,n){var s=bt;bt|=2;var i=XM(),r=ZM();(Dt!==e||ot!==t)&&(Ag=null,Jd(e,t)),t=!1;var a=bn;e:do try{if(Et!==0&&rt!==null){var l=rt,c=pi;switch(Et){case 8:wb(),a=6;break e;case 3:case 2:case 9:case 6:ys.current===null&&(t=!0);var u=Et;if(Et=0,pi=null,td(e,l,c,u),n&&Af){a=0;break e}break;default:u=Et,Et=0,pi=null,td(e,l,c,u)}}OK(),a=bn;break}catch(d){WM(e,d)}while(!0);return t&&e.shellSuspendCounter++,Do=du=null,bt=s,Ve.H=i,Ve.A=r,rt===null&&(Dt=null,ot=0,Um()),a}function OK(){for(;rt!==null;)YM(rt)}function DK(e,t){var n=bt;bt|=2;var s=XM(),i=ZM();Dt!==e||ot!==t?(Ag=null,$g=wi()+500,Jd(e,t)):Af=c0(e,t);e:do try{if(Et!==0&&rt!==null){t=rt;var r=pi;t:switch(Et){case 1:Et=0,pi=null,td(e,t,r,1);break;case 2:case 9:if(Y8(r)){Et=0,pi=null,E9(t);break}t=function(){Et!==2&&Et!==9||Dt!==e||(Et=7),uo(e)},r.then(t,t);break e;case 3:Et=7;break e;case 4:Et=5;break e;case 7:Y8(r)?(Et=0,pi=null,E9(t)):(Et=0,pi=null,td(e,t,r,7));break;case 5:var a=null;switch(rt.tag){case 26:a=rt.memoizedState;case 5:case 27:var l=rt;if(a?bT(a):l.stateNode.complete){Et=0,pi=null;var c=l.sibling;if(c!==null)rt=c;else{var u=l.return;u!==null?(rt=u,e2(u)):rt=null}break t}}Et=0,pi=null,td(e,t,r,5);break;case 6:Et=0,pi=null,td(e,t,r,6);break;case 8:wb(),bn=6;break e;default:throw Error(ce(462))}}BK();break}catch(d){WM(e,d)}while(!0);return Do=du=null,Ve.H=s,Ve.A=i,bt=n,rt!==null?0:(Dt=null,ot=0,Um(),bn)}function BK(){for(;rt!==null&&!nW();)YM(rt)}function YM(e){var t=yM(e.alternate,e,ea);e.memoizedProps=e.pendingProps,t===null?e2(e):rt=t}function E9(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=p9(n,t,t.pendingProps,t.type,void 0,ot);break;case 11:t=p9(n,t,t.pendingProps,t.type.render,t.ref,ot);break;case 5:rb(t);var s=t;s===is&&(tt?(hg(s),s.tag===5&&s.stateNode!=null&&(Ut=s.stateNode)):(hg(s),tt=!0));default:kM(n,t),t=rt=bA(t,ea),t=yM(n,t,ea)}e.memoizedProps=e.pendingProps,t===null?e2(e):rt=t}function td(e,t,n,s){Do=du=null,rb(t),ud=null,d1=0;var i=t.return;try{if(EK(e,i,t,n,ot)){bn=1,bg(e,Vi(n,e.current)),rt=null;return}}catch(r){if(i!==null)throw rt=i,r;bn=1,bg(e,Vi(n,e.current)),rt=null;return}t.flags&32768?(tt||s===1?e=!0:Af||ot&536870912?e=!1:(Xa=e=!0,(s===2||s===9||s===3||s===6)&&(s=ys.current,s!==null&&s.tag===13&&(s.flags|=16384))),QM(t,e)):e2(t)}function e2(e){var t=e;do{if(t.flags&32768){QM(t,Xa);return}e=t.return;var n=TK(t.alternate,t,ea);if(n!==null){rt=n;return}if(t=t.sibling,t!==null){rt=t;return}rt=t=e}while(t!==null);bn===0&&(bn=5)}function QM(e,t){do{var n=zK(e.alternate,e);if(n!==null){n.flags&=32767,rt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){rt=e;return}rt=e=n}while(e!==null);bn=6,rt=null}function $9(e,t,n,s,i,r,a,l,c,u,d,f){e.cancelPendingCommit=null;do t2();while(hn!==0);if(bt&6)throw Error(ce(327));if(t!==null){if(t===e.current)throw Error(ce(177));e===Dt&&(rt=Dt=null,ot=0),Kc=t,kr=e,io=n,Ok=i,FM=s,HK(e,t,n,a,l,c,f)}}function HK(e,t,n,s,i,r,a){var l=t.lanes|t.childLanes;if(Lk=l,l|=V3,fW(e,n,l,s,i,r),pd=null,(n&335544064)===n?(xd=pK(e),s=10262):(xd=null,s=10256),t.subtreeFlags&s||t.flags&s?(e.callbackNode=null,e.callbackPriority=0,GK(lg,function(){return qk(),null})):(e.callbackNode=null,e.callbackPriority=0),Sg=!1,s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=Ve.T,Ve.T=null,i=wt.p,wt.p=2,r=bt,bt|=4;try{NK(e,t,n)}finally{bt=r,wt.p=i,Ve.T=s}}hn=1,Sg?hd=fX(a,e.containerInfo,xd,Dk,Bk,PK,Hk,qk,qK):(Dk(),Bk(),Hk())}function qK(e){if(hn!==0){var t=kr.onRecoverableError;t(e,{componentStack:null})}}function PK(){hn===3&&(hn=0,OM(Kc,kr),hn=4)}function Dk(){if(hn===1){hn=0;var e=kr,t=Kc,n=io,s=(t.flags&13878)!==0;if(t.subtreeFlags&13878||s){s=Ve.T,Ve.T=null;var i=wt.p;wt.p=2;var r=bt;bt|=4;try{gh=Cg=!1,IM(t,e,n),n=Vk;var a=hA(e.containerInfo),l=n.focusedElem,c=n.selectionRange;if(a!==l&&l&&l.ownerDocument&&fA(l.ownerDocument.documentElement,l)){if(c!==null&&F3(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,y=Math.min(c.start,g),v=c.end===void 0?y:Math.min(c.end,g);!x.extend&&y>v&&(a=v,v=y,y=a);var m=U8(l,y),k=U8(l,v);if(m&&k&&(x.rangeCount!==1||x.anchorNode!==m.node||x.anchorOffset!==m.offset||x.focusNode!==k.node||x.focusOffset!==k.offset)){var w=f.createRange();w.setStart(m.node,m.offset),x.removeAllRanges(),y>v?(x.addRange(w),x.extend(k.node,k.offset)):(w.setEnd(k.node,k.offset),x.addRange(w))}}}}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 S=f[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}rf=!!Fk,Vk=Fk=null}finally{bt=r,wt.p=i,Ve.T=s}}e.current=t,hn=2}}function Bk(){if(hn===2){hn=0;var e=kr,t=Kc,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Ve.T,Ve.T=null;var s=wt.p;wt.p=2;var i=bt;bt|=4;try{MM(e,t.alternate,t)}finally{bt=i,wt.p=s,Ve.T=n}}hn=3}}function Hk(){if(hn===4||hn===3){hn=0;var e=hd;hd=null,sW();var t=kr,n=Kc,s=io,i=FM,r=(s&335544064)===s?10262:10256;if(n.subtreeFlags&r||n.flags&r?hn=5:(hn=0,Kc=kr=null,JM(t,t.pendingLanes)),r=t.pendingLanes,r===0&&(rl=null),D3(s),n=n.stateNode,ji&&typeof ji.onCommitFiberRoot=="function")try{ji.onCommitFiberRoot(l0,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=Ve.T,r=wt.p,wt.p=2,Ve.T=null;try{for(var a=t.onRecoverableError,l=0;l<i.length;l++){var c=i[l];a(c.value,{componentStack:c.stack})}}finally{Ve.T=n,wt.p=r}}if(i=pd,a=xd,xd=null,i!==null&&(pd=null,a===null&&(a=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(a),n!==void 0&&e.finished.finally(n);io&3&&t2(),uo(t),r=t.pendingLanes,s&261930&&r&42?t===Jp?Gh++:(Gh=0,Jp=t):(Gh=0,Jp=null),g0(0)}}function JM(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,h0(t)))}function t2(){return hd!==null&&(hd.skipTransition(),hd=null),Dk(),Bk(),Hk(),qk()}function qk(){if(hn!==5)return!1;var e=kr,t=Lk;Lk=0;var n=D3(io),s=Ve.T,i=wt.p;try{wt.p=32>n?32:n,Ve.T=null,n=Ok,Ok=null;var r=kr,a=io;if(hn=0,Kc=kr=null,io=0,bt&6)throw Error(ce(331));var l=bt;if(bt|=4,qM(r.current),DM(r,r.current,a,n),bt=l,g0(0,!1),ji&&typeof ji.onPostCommitFiberRoot=="function")try{ji.onPostCommitFiberRoot(l0,r)}catch{}return!0}finally{wt.p=i,Ve.T=s,JM(e,t)}}function A9(e,t,n){t=Vi(n,t),t=kk(e.stateNode,t,2),e=nl(e,t,2),e!==null&&(u0(e,2),uo(e))}function At(e,t,n){if(e.tag===3)A9(e,e,n);else for(;t!==null;){if(t.tag===3){A9(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(rl===null||!rl.has(s))){e=Vi(n,e),n=pM(2),s=nl(t,n,2),s!==null&&(xM(n,s,t,e),u0(s,2),uo(s));break}}t=t.return}}function Nv(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new IK;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(n)||(bb=!0,i.add(n),e=UK.bind(null,e,t,n),t.then(e,e))}function UK(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Dt===e&&(ot&n)===n&&(bn===4||bn===3&&(ot&62914560)===ot&&300>wi()-Qm?bt&2?Eg|=n:Jd(e,0):Eg|=n,Yd===ot&&(Yd=0)),uo(e)}function eT(e,t){t===0&&(t=F$()),e=uu(e,t),e!==null&&(u0(e,t),uo(e))}function FK(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),eT(e,n)}function VK(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(ce(314))}s!==null&&s.delete(t),eT(e,n)}function GK(e,t){return L3(e,t)}var ef=null,Ru=null,Pk=!1,Tg=!1,_v=!1,Ya=0;function uo(e){e!==Ru&&e.next===null&&(Ru===null?ef=Ru=e:Ru=Ru.next=e),Tg=!0,Pk||(Pk=!0,KK())}function g0(e,t){if(!_v&&Tg){_v=!0;do for(var n=!1,s=ef;s!==null;){if(e!==0){var i=s.pendingLanes;if(i===0)var r=0;else{var a=s.suspendedLanes,l=s.pingedLanes;r=(1<<31-Si(42|e)+1)-1,r&=i&~(a&~l),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,M9(s,r))}else r=ot,r=Dm(s,s===Dt?r:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(r&3)||c0(s,r)||(n=!0,M9(s,r));s=s.next}while(n);_v=!1}}function WK(){tT()}function tT(){Tg=Pk=!1;var e=0;Ya!==0&&rX()&&(e=Ya);for(var t=wi(),n=null,s=ef;s!==null;){var i=s.next,r=nT(s,t);r===0?(s.next=null,n===null?ef=i:n.next=i,i===null&&(Ru=n)):(n=s,(e!==0||r&3)&&(Tg=!0)),s=i}hn!==0&&hn!==5||g0(e),Ya!==0&&(Ya=0)}function nT(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var a=31-Si(r),l=1<<a,c=i[a];c===-1?(!(l&n)||l&s)&&(i[a]=dW(l,t)):c<=t&&(e.expiredLanes|=l),r&=~l}if(t=Dt,n=ot,n=Dm(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(Et===2||Et===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&uv(s),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||c0(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&uv(s),D3(n)){case 2:case 8:n=q$;break;case 32:n=lg;break;case 268435456:n=P$;break;default:n=lg}return s=sT.bind(null,e),n=L3(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&uv(s),e.callbackPriority=2,e.callbackNode=null,2}function sT(e,t){if(hn!==0&&hn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(t2()&&e.callbackNode!==n)return null;var s=ot;return s=Dm(e,e===Dt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(GM(e,s,t),nT(e,wi()),e.callbackNode!=null&&e.callbackNode===n?sT.bind(null,e):null)}function M9(e,t){if(t2())return null;GM(e,t,!0)}function KK(){aX(function(){bt&6?L3(H$,WK):tT()})}function jb(){if(Ya===0){var e=Fc;e===0&&(e=op,op<<=1,!(op&261888)&&(op=256)),Ya=e}return Ya}function T9(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qp(e)}function XK(e,t,n,s,i){if(t==="submit"&&n&&n.stateNode===i){var r=T9((i[ri]||null).action),a=s.submitter;a&&(t=(t=a[ri]||null)?T9(t.formAction):a.getAttribute("formAction"),t!==null&&(r=t,a=null));var l=new Hm("action","action",null,s,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ya!==0){var c=new FormData(i,a);vk(n,{pending:!0,data:c,method:i.method,action:r},null,c)}}else typeof r=="function"&&(l.preventDefault(),c=new FormData(i,a),vk(n,{pending:!0,data:c,method:i.method,action:r},r,c))},currentTarget:i}]})}}for(var Rv=0;Rv<ak.length;Rv++){var Iv=ak[Rv],ZK=Iv.toLowerCase(),YK=Iv[0].toUpperCase()+Iv.slice(1);Sr(ZK,"on"+YK)}Sr(xA,"onAnimationEnd");Sr(gA,"onAnimationIteration");Sr(mA,"onAnimationStart");Sr("dblclick","onDoubleClick");Sr("focusin","onFocus");Sr("focusout","onBlur");Sr(oK,"onTransitionRun");Sr(aK,"onTransitionStart");Sr(lK,"onTransitionCancel");Sr(vA,"onTransitionEnd");Kd("onMouseEnter",["mouseout","mouseover"]);Kd("onMouseLeave",["mouseout","mouseover"]);Kd("onPointerEnter",["pointerout","pointerover"]);Kd("onPointerLeave",["pointerout","pointerover"]);lu("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));lu("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));lu("onBeforeInput",["compositionend","keypress","textInput","paste"]);lu("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));lu("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));lu("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var p1="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(" "),QK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(p1));function iT(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],i=s.event;s=s.listeners;e:{var r=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!==r&&i.isPropagationStopped())break e;r=l,i.currentTarget=u;try{r(i)}catch(d){ug(d)}i.currentTarget=null,r=c}else for(a=0;a<s.length;a++){if(l=s[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==r&&i.isPropagationStopped())break e;r=l,i.currentTarget=u;try{r(i)}catch(d){ug(d)}i.currentTarget=null,r=c}}}}function it(e,t){var n=t[C8];n===void 0&&(n=t[C8]=new Set);var s=e+"__bubble";n.has(s)||(rT(t,e,2,!1),n.add(s))}function Lv(e,t,n){var s=0;t&&(s|=4),rT(n,e,s,t)}var yp="_reactListening"+Math.random().toString(36).slice(2);function Sb(e){if(!e[yp]){e[yp]=!0,Z$.forEach(function(n){n!=="selectionchange"&&(QK.has(n)||Lv(n,!1,e),Lv(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[yp]||(t[yp]=!0,Lv("selectionchange",!1,t))}}function rT(e,t,n,s){switch(AT(t)){case 2:var i=FX;break;case 8:i=VX;break;default:i=zb}n=i.bind(null,t,n,e),i=void 0,!sk||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),s?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ov(e,t,n,s,i){var r=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===i)break;if(a===4)for(a=s.return;a!==null;){var c=a.tag;if((c===3||c===4)&&a.stateNode.containerInfo===i)return;a=a.return}for(;l!==null;){if(a=rc(l),a===null)return;if(c=a.tag,c===5||c===6||c===26||c===27){s=r=a;continue e}l=l.parentNode}}s=s.return}iA(function(){var u=r,d=H3(n),f=[];e:{var p=yA.get(e);if(p!==void 0){var x=Hm,g=e;switch(e){case"keypress":if(Up(n)===0)break e;case"keydown":case"keyup":x=LW;break;case"focusin":g="focus",x=gv;break;case"focusout":g="blur",x=gv;break;case"beforeblur":case"afterblur":x=gv;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=_8;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=SW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=qW;break;case xA:case gA:case mA:x=$W;break;case vA:x=UW;break;case"scroll":case"scrollend":x=wW;break;case"wheel":x=VW;break;case"copy":case"cut":case"paste":x=MW;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=I8;break;case"submit":x=BW;break;case"toggle":case"beforetoggle":x=WW}var y=(t&4)!==0,v=!y&&(e==="scroll"||e==="scrollend"),m=y?p!==null?p+"Capture":null:p;y=[];for(var k=u,w;k!==null;){var S=k;if(w=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||w===null||m===null||(S=o1(k,m),S!=null&&y.push(x1(k,S,w))),v)break;k=k.return}0<y.length&&(p=new x(p,g,null,n,d),f.push({event:p,listeners:y}))}}if(!(t&7)){e:{if(x=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",x&&n!==nk&&(g=n.relatedTarget||n.fromElement)&&(rc(g)||g[Sf]))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?rc(x):null,x!==null&&(v=a0(x),y=x.tag,x!==v||y!==5&&y!==27&&y!==6)&&(x=null)):(p=null,x=u),p!==x&&(y=_8,S="onMouseLeave",m="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(y=I8,S="onPointerLeave",m="onPointerEnter",k="pointer"),v=p==null?g:ph(p),w=x==null?g:ph(x),g=new y(S,k+"leave",p,n,d),g.target=v,g.relatedTarget=w,S=null,rc(d)===u&&(y=new y(m,k+"enter",x,n,d),y.target=w,y.relatedTarget=v,S=y),v=S,y=p&&x?Fy(p,x,JK):null,p!==null&&z9(f,g,p,y,!1),x!==null&&v!==null&&z9(f,v,x,y,!0)))}e:{if(p=u?ph(u):window,x=p.nodeName&&p.nodeName.toLowerCase(),x==="select"||x==="input"&&p.type==="file")var E=B8;else if(D8(p))if(uA)E=sK;else{E=tK;var A=eK}else x=p.nodeName,!x||x.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?u&&B3(u.elementType)&&(E=B8):E=nK;if(E&&(E=E(e,u))){cA(f,E,n,d);break e}A&&A(e,p,u)}switch(A=u?ph(u):window,e){case"focusin":(D8(A)||A.contentEditable==="true")&&(Xu=A,rk=u,Lh=null);break;case"focusout":Lh=rk=Xu=null;break;case"mousedown":ok=!0;break;case"contextmenu":case"mouseup":case"dragend":ok=!1,F8(f,n,d);break;case"selectionchange":if(rK)break;case"keydown":case"keyup":F8(f,n,d)}var z;if(U3)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Ku?aA(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(oA&&n.locale!=="ko"&&(Ku||N!=="onCompositionStart"?N==="onCompositionEnd"&&Ku&&(z=rA()):(Wa=d,q3="value"in Wa?Wa.value:Wa.textContent,Ku=!0)),A=zg(u,N),0<A.length&&(N=new R8(N,e,null,n,d),f.push({event:N,listeners:A}),z?N.data=z:(z=lA(n),z!==null&&(N.data=z)))),(z=XW?ZW(e,n):YW(e,n))&&(N=zg(u,"onBeforeInput"),0<N.length&&(A=new R8("onBeforeInput","beforeinput",null,n,d),f.push({event:A,listeners:N}),A.data=z)),XK(f,e,u,n,d)}iT(f,t)})}function x1(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zg(e,t){for(var n=t+"Capture",s=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=o1(e,n),i!=null&&s.unshift(x1(e,i,r)),i=o1(e,t),i!=null&&s.push(x1(e,i,r))),e.tag===3)return s;e=e.return}return[]}function JK(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function z9(e,t,n,s,i){for(var r=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,i?(u=o1(n,r),u!=null&&a.unshift(x1(n,u,c))):i||(u=o1(n,r),u!=null&&a.push(x1(n,u,c)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var eX=/\r\n?/g,tX=/\u0000|\uFFFD/g;function N9(e){return(typeof e=="string"?e:""+e).replace(eX,`
191
+ `).replace(tX,"")}function oT(e,t){return t=N9(t),N9(e)===t}function $t(e,t,n,s,i,r){switch(n){case"children":if(typeof s=="string")t==="body"||t==="textarea"&&s===""||Xd(e,s);else if(typeof s=="number"||typeof s=="bigint")t!=="body"&&Xd(e,""+s);else return;break;case"className":cp(e,"class",s);break;case"tabIndex":cp(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":cp(e,n,s);break;case"style":sA(e,s,r);return;case"data":if(t!=="object"){cp(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=qp(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 r=="function"&&(n==="formAction"?(t!=="input"&&$t(e,t,"name",i.name,i,null),$t(e,t,"formEncType",i.formEncType,i,null),$t(e,t,"formMethod",i.formMethod,i,null),$t(e,t,"formTarget",i.formTarget,i,null)):($t(e,t,"encType",i.encType,i,null),$t(e,t,"method",i.method,i,null),$t(e,t,"target",i.target,i,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=qp(s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Qr);return;case"onScroll":s!=null&&it("scroll",e);return;case"onScrollEnd":s!=null&&it("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(ce(61));if(n=s.__html,n!=null){if(i.children!=null)throw Error(ce(60));(r!=null?r.__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=qp(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":it("beforetoggle",e),it("toggle",e),Hp(e,"popover",s);break;case"xlinkActuate":xo(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":xo(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":xo(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":xo(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":xo(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":xo(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":xo(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":xo(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":xo(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Hp(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=kW.get(n)||n,Hp(e,n,s);else return}vt=!0}function Uk(e,t,n,s,i,r){switch(n){case"style":sA(e,s,r);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(ce(61));if(n=s.__html,n!=null){if(i.children!=null)throw Error(ce(60));(r!=null?r.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof s=="string")Xd(e,s);else if(typeof s=="number"||typeof s=="bigint")Xd(e,""+s);else return;break;case"onScroll":s!=null&&it("scroll",e);return;case"onScrollEnd":s!=null&&it("scrollend",e);return;case"onClick":s!=null&&(e.onclick=Qr);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Y$.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),r=n.slice(2,i?n.length-7:void 0),t=e[ri]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(r,t,i),typeof s=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(r,s,i);break e}vt=!0,n in e?e[n]=s:s===!0?e.setAttribute(n,""):Hp(e,n,s)}return}vt=!0}function vs(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",e),it("load",e);var s=!1,i=!1,r;for(r in n)if(n.hasOwnProperty(r)){var a=n[r];if(a!=null)switch(r){case"src":s=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(ce(137,t));default:$t(e,t,r,a,n,null)}}i&&$t(e,t,"srcSet",n.srcSet,n,null),s&&$t(e,t,"src",n.src,n,null);return;case"input":it("invalid",e);var l=r=a=i=null,c=null,u=null;for(s in n)if(n.hasOwnProperty(s)){var d=n[s];if(d!=null)switch(s){case"name":i=d;break;case"type":a=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":r=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(ce(137,t));break;default:$t(e,t,s,d,n,null)}}eA(e,r,l,c,u,a,i,!1);return;case"select":it("invalid",e),s=a=r=null;for(i in n)if(n.hasOwnProperty(i)&&(l=n[i],l!=null))switch(i){case"value":r=l;break;case"defaultValue":a=l;break;case"multiple":s=l;default:$t(e,t,i,l,n,null)}t=r,n=a,e.multiple=!!s,t!=null?ad(e,!!s,t,!1):n!=null&&ad(e,!!s,n,!0);return;case"textarea":it("invalid",e),r=i=s=null;for(a in n)if(n.hasOwnProperty(a)&&(l=n[a],l!=null))switch(a){case"value":s=l;break;case"defaultValue":i=l;break;case"children":r=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(ce(91));break;default:$t(e,t,a,l,n,null)}nA(e,s,i,r);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:$t(e,t,c,s,n,null)}return;case"dialog":it("beforetoggle",e),it("toggle",e),it("cancel",e),it("close",e);break;case"iframe":case"object":it("load",e);break;case"video":case"audio":for(s=0;s<p1.length;s++)it(p1[s],e);break;case"image":it("error",e),it("load",e);break;case"details":it("toggle",e);break;case"embed":case"source":case"link":it("error",e),it("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(ce(137,t));default:$t(e,t,u,s,n,null)}return;default:if(B3(t)){for(d in n)n.hasOwnProperty(d)&&(s=n[d],s!==void 0&&Uk(e,t,d,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(s=n[l],s!=null&&$t(e,t,l,s,n,null))}var nX={};function sX(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 i=null,r=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)||$t(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&&(vt=!0),r=x;break;case"name":x!==f&&(vt=!0),i=x;break;case"checked":x!==f&&(vt=!0),u=x;break;case"defaultChecked":x!==f&&(vt=!0),d=x;break;case"value":x!==f&&(vt=!0),a=x;break;case"defaultValue":x!==f&&(vt=!0),l=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(ce(137,t));break;default:x!==f&&$t(e,t,p,x,s,f)}}tk(e,a,l,c,u,d,r,i);return;case"select":x=a=l=p=null;for(r in n)if(c=n[r],n.hasOwnProperty(r)&&c!=null)switch(r){case"value":break;case"multiple":x=c;default:s.hasOwnProperty(r)||$t(e,t,r,null,s,c)}for(i in s)if(r=s[i],c=n[i],s.hasOwnProperty(i)&&(r!=null||c!=null))switch(i){case"value":r!==c&&(vt=!0),p=r;break;case"defaultValue":r!==c&&(vt=!0),l=r;break;case"multiple":r!==c&&(vt=!0),a=r;default:r!==c&&$t(e,t,i,r,s,c)}t=l,n=a,s=x,p!=null?ad(e,!!n,p,!1):!!s!=!!n&&(t!=null?ad(e,!!n,t,!0):ad(e,!!n,n?[]:"",!1));return;case"textarea":x=p=null;for(l in n)if(i=n[l],n.hasOwnProperty(l)&&i!=null&&!s.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:$t(e,t,l,null,s,i)}for(a in s)if(i=s[a],r=n[a],s.hasOwnProperty(a)&&(i!=null||r!=null))switch(a){case"value":i!==r&&(vt=!0),p=i;break;case"defaultValue":i!==r&&(vt=!0),x=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(ce(91));break;default:i!==r&&$t(e,t,a,i,s,r)}tA(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:$t(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&&(vt=!0),e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:$t(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 y in n)p=n[y],n.hasOwnProperty(y)&&p!=null&&!s.hasOwnProperty(y)&&$t(e,t,y,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(ce(137,t));break;default:$t(e,t,u,p,s,x)}return;default:if(B3(t)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!==void 0&&!s.hasOwnProperty(v)&&Uk(e,t,v,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||Uk(e,t,d,p,s,x);return}}for(var m in n)p=n[m],n.hasOwnProperty(m)&&p!=null&&!s.hasOwnProperty(m)&&$t(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||$t(e,t,f,p,s,x)}function _9(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iX(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var i=n[s],r=i.transferSize,a=i.initiatorType,l=i.duration;if(r&&l&&_9(a)){for(a=0,l=i.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&&_9(f)&&(c=c.responseEnd,a+=d*(c<l?1:(l-u)/(c-u)))}if(--s,t+=8*(r+a)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Fk=null,Vk=null;function g1(e){return e.nodeType===9?e:e.ownerDocument}function R9(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 aT(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 lT(e,t,n,s){return n=g1(n).createElement(e),n[ps]=s,n[ri]=t,vs(n,e,t),ns(n),n}function Gk(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 Dv=null;function rX(){var e=window.event;return e&&e.type==="popstate"?e===Dv?!1:(Dv=e,!0):(Dv=null,!1)}var Cb=typeof setTimeout=="function"?setTimeout:void 0,oX=typeof clearTimeout=="function"?clearTimeout:void 0,I9=typeof Promise=="function"?Promise:void 0,L9=typeof requestAnimationFrame=="function"?requestAnimationFrame:Cb,aX=typeof queueMicrotask=="function"?queueMicrotask:typeof I9<"u"?function(e){return I9.resolve(null).then(e).catch(lX)}:Cb;function lX(e){setTimeout(function(){throw e})}function bl(e){return e==="head"}function O9(e,t){var n=t,s=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(i),of(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")Hv(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Hv(n);for(var r=n.firstChild;r;){var a=r.nextSibling,l=r.nodeName;r[d0]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=a}}else n==="body"&&Hv(e.ownerDocument.body);n=i}while(n);of(t)}function D9(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 cT(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 i=s=0;i<t.length;i++){var r=t[i];0<r.width&&0<r.height&&s++}s===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function uT(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 cX(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 Wk(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return cX(t,n,e)}function uX(e){return e.documentElement.clientHeight}function dX(e){this.addEventListener("load",e),this.addEventListener("error",e)}function fX(e,t,n,s,i,r,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 y=[];if(g==="loaded"&&(uX(u),u.fonts.status==="loading"&&y.push(u.fonts.ready)),g=y.length,e!==null)for(var v=e.suspenseyImages,m=0,k=0;k<v.length;k++){var w=v[k];if(!w.complete){var S=w.getBoundingClientRect();if(0<S.bottom&&0<S.right&&S.top<p.innerHeight&&S.left<p.innerWidth){if(m+=wT(w),m>nx){y.length=g;break}w=new Promise(dX.bind(w)),y.push(w)}}}if(0<y.length)return p=Promise.race([Promise.all(y),new Promise(function(E){return setTimeout(E,500)})]).then(i,i),(x?Promise.allSettled([x.finished,p]):p).then(r,r);if(i(),x)return x.finished.then(r,r);r()},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],y=g.effect,v=y.pseudoElement;if(v!=null&&v.startsWith("::view-transition")){f.push(g),g=y.getKeyframes();for(var m=v=void 0,k=!0,w=0;w<g.length;w++){var S=g[w],E=S.width;if(v===void 0)v=E;else if(v!==E){k=!1;break}if(E=S.height,m===void 0)m=E;else if(m!==E){k=!1;break}delete S.width,delete S.height,S.transform==="none"&&delete S.transform}k&&v!==void 0&&m!==void 0&&(y.setKeyframes(g),k=getComputedStyle(y.target,y.pseudoElement),k.width!==v||k.height!==m)&&(k=g[0],k.width=v,k.height=m,k=g[g.length-1],k.width=v,k.height=m,y.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(),i(),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(),i(),a(),null}}function oc(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}oc.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:Bt({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};oc.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),s=[],i=0;i<n.length;i++){var r=n[i].effect;r!==null&&r.target===e&&r.pseudoElement===t&&s.push(n[i])}return s};oc.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function dT(e){return{name:e,group:new oc("group",e),imagePair:new oc("image-pair",e),old:new oc("old",e),new:new oc("new",e)}}function Mi(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Mi.prototype.addEventListener=function(e,t,n){var s=null,i=null;if(!(n!=null&&typeof n!="boolean"&&(s=n.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var r=this._eventListeners;if(fT(r,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&&(i=a.removeEventListener.bind(a,e,t,n),s.addEventListener("abort",i,{once:!0}),i=s.removeEventListener.bind(s,"abort",i)),s=tf(n),r.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:l,cleanup:i}),ii(this._fragmentFiber.child,!1,hX,e,l,s)}this._eventListeners=r}};function hX(e,t,n,s){return qn(e).addEventListener(t,n,s),!1}Mi.prototype.removeEventListener=function(e,t,n){var s=this._eventListeners;if(s!==null&&(t=fT(s,e,t,n),t!==-1)){var i=s[t];n=i.attachedListener;var r=i.cleanup;i=tf(i.optionsOrUseCapture),ii(this._fragmentFiber.child,!1,pX,e,n,i),s.splice(t,1),r!==null&&r()}};function pX(e,t,n,s){return qn(e).removeEventListener(t,n,s),!1}function tf(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function B9(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function fT(e,t,n,s){if(e.length===0)return-1;s=B9(s);for(var i=0;i<e.length;i++){var r=e[i];if(r.type===t&&r.listener===n&&B9(r.optionsOrUseCapture)===s)return i}return-1}Mi.prototype.dispatchEvent=function(e){var t=au(this._fragmentFiber);if(t===null)return!0;t=qn(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 i=0;i<n.length;i++){var r=n[i];s.addEventListener(r.type,r.attachedListener,tf(r.optionsOrUseCapture))}if(t.appendChild(s),e=s.dispatchEvent(e),n)for(i=0;i<n.length;i++)r=n[i],s.removeEventListener(r.type,r.attachedListener,tf(r.optionsOrUseCapture));return t.removeChild(s),e}return t.dispatchEvent(e)};Mi.prototype.focus=function(e){ii(this._fragmentFiber.child,!0,hT,e,void 0,void 0)};function hT(e,t){return e.tag===6?!1:(e=qn(e),EX(e,t))}Mi.prototype.focusLast=function(e){var t=[];ii(this._fragmentFiber.child,!0,Eb,t,void 0,void 0);for(var n=t.length-1;0<=n&&!hT(t[n],e);n--);};function Eb(e,t){return t.push(e),!1}Mi.prototype.blur=function(){var e=au(this._fragmentFiber);e!==null&&(e=qn(e),e=g1(e).activeElement,e!==null&&ii(this._fragmentFiber.child,!1,xX,e,void 0,void 0))};function xX(e,t){return e.tag===6?!1:(e=qn(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Mi.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),ii(this._fragmentFiber.child,!1,gX,e,void 0,void 0)};function gX(e,t){return e.tag===6||(e=qn(e),t.observe(e)),!1}Mi.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),ii(this._fragmentFiber.child,!1,mX,e,void 0,void 0);for(var n=t=0;n<mr.length;n++){var s=mr[n];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):mr[t++]=s}mr.length=t}};function mX(e,t){return e.tag===6||(e=qn(e),t.unobserve(e)),!1}var mr=[],Bv=!1;function vX(e,t,n){mr.push({fragmentInstance:e,observer:t,instance:n}),Bv||(Bv=!0,$X(function(){Bv=!1;var s=mr;mr=[];for(var i=0;i<s.length;i++){var r=s[i];r.observer.unobserve(r.instance)}}))}Mi.prototype.getClientRects=function(){var e=[];return ii(this._fragmentFiber.child,!1,yX,e,void 0,void 0),e};function yX(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=qn(e),t.push.apply(t,e.getClientRects());return!1}Mi.prototype.getRootNode=function(e){var t=au(this._fragmentFiber);return t===null?this:qn(t).getRootNode(e)};Mi.prototype.compareDocumentPosition=function(e){var t=au(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];ii(this._fragmentFiber.child,!1,Eb,n,void 0,void 0);var s=qn(t);if(n.length===0){if(n=s,y8(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=s=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=L$(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=qn(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=qn(n[0]),i=qn(n[n.length-1]);var r=y8(this._fragmentFiber)?t.parentElement:s;if(r==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,r=r.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var a=t.compareDocumentPosition(e),l=i.compareDocumentPosition(e),c=a&Node.DOCUMENT_POSITION_CONTAINED_BY||l&Node.DOCUMENT_POSITION_CONTAINED_BY;return l=s&&r&&a&Node.DOCUMENT_POSITION_FOLLOWING&&l&Node.DOCUMENT_POSITION_PRECEDING,t=s&&t===e||r&&i===e||c||l?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&t===e||!r&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:a,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||kX(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function kX(e,t,n,s,i){var r=rc(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!r)e:{for(;r!==null;){if(r.tag===7&&(r===t||r.alternate===t)){n=!0;break e}r=r.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(r===null)return r=i.ownerDocument,i===r||i===r.documentElement||i===r.body;e:{for(r=t,t=au(t);r!==null;){if(!(r.tag!==5&&r.tag!==3&&r.tag!==27||r!==t&&r.alternate!==t)){r=!0;break e}r=r.return}r=!1}return r}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!r)&&!(t=r===n)&&(t=Fy(n,r,k8),t===null?t=!1:(ii(t,!0,KG,r,n),r=Fu,Fu=null,t=r!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!r)&&!(t=r===s)&&(t=Fy(s,r,k8),t===null?t=!1:(ii(t,!0,XG,r,s),r=Fu,Uy=Fu=null,t=r!==null)),t):!1}function H9(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)}Mi.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(ce(566));var t=[];ii(this._fragmentFiber.child,!1,Eb,t,void 0,void 0);var n=e!==!1;if(t.length===0){var s=L$(this._fragmentFiber);if(s=n?s[1]||s[0]||au(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=qn(s),H9(e,n);return}if(s=qn(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 i=t[s];i.tag===6?(i=qn(i),H9(i,n)):qn(i).scrollIntoView(e),s+=n?-1:1}};function bX(e,t){return e=qn(e),pT(e,t),!1}function pT(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function xT(e,t){var n=t._eventListeners;if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];e.addEventListener(i.type,i.attachedListener,tf(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(r){for(var a=0,l=0;l<mr.length;l++){var c=mr[l];(c.fragmentInstance!==t||c.observer!==r||c.instance!==e)&&(mr[a++]=c)}mr.length=a,r.observe(e)}),pT(e,t))}function wX(e,t){var n=t._eventListeners;if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];e.removeEventListener(i.type,i.attachedListener,tf(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(r){typeof r.rootMargin=="string"?vX(t,r,e):r.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Kk(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":Kk(n),Bm(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function jX(e,t,n,s){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[d0])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Zi(e.nextSibling),e===null)break}return null}function SX(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Zi(e.nextSibling),e===null))return null;return e}function gT(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Zi(e.nextSibling),e===null))return null;return e}function Xk(e){return e.data==="$?"||e.data==="$~"}function $b(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function CX(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 Zi(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 Zk=null;function q9(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Zi(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function P9(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 EX(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 $X(e){L9(function(){L9(function(t){return e(t)})})}function mT(e,t,n){switch(t=g1(n),e){case"html":if(e=t.documentElement,!e)throw Error(ce(452));return e;case"head":if(e=t.head,!e)throw Error(ce(453));return e;case"body":if(e=t.body,!e)throw Error(ce(454));return e;default:throw Error(ce(451))}}function vT(e,t,n){for(var s in n){var i=n[s];n.hasOwnProperty(s)&&i!=null&&$t(e,t,s,null,nX,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Qr&&(e.onclick=null),Bm(e)}function Hv(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Bm(e)}var er=new Map,U9=new Set;function m1(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 aa=wt.d;wt.d={f:AX,r:MX,D:TX,C:zX,L:NX,m:_X,X:IX,S:RX,M:LX};function AX(){var e=aa.f(),t=Jm();return e||t}function MX(e){var t=Cf(e);t!==null&&t.tag===5&&t.type==="form"?sM(t):aa.r(e)}var Mf=typeof document>"u"?null:document;function yT(e,t,n){var s=Mf;if(s&&typeof t=="string"&&t){var i=Fi(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),U9.has(i)||(U9.add(i),e={rel:e,crossOrigin:n,href:t},s.querySelector(i)===null&&(t=s.createElement("link"),vs(t,"link",e),ns(t),s.head.appendChild(t)))}}function TX(e){aa.D(e),yT("dns-prefetch",e,null)}function zX(e,t){aa.C(e,t),yT("preconnect",e,t)}function NX(e,t,n){aa.L(e,t,n);var s=Mf;if(s&&e&&t){var i='link[rel="preload"][as="'+Fi(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Fi(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Fi(n.imageSizes)+'"]')):i+='[href="'+Fi(e)+'"]';var r=i;switch(t){case"style":r=nf(e);break;case"script":r=Tf(e)}if(!(er.has(r)||(e=Bt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),er.set(r,e),s.querySelector(i)!==null||t==="style"&&s.querySelector(m0(r))||t==="script"&&s.querySelector(v0(r))))){var a=s.createElement("link");vs(a,"link",e),t==="style"&&(a[cg]=!0,a.onload=a.onerror=function(){X$(a)}),ns(a),s.head.appendChild(a)}}}function _X(e,t){aa.m(e,t);var n=Mf;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Fi(s)+'"][href="'+Fi(e)+'"]',r=i;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=Tf(e)}if(!er.has(r)&&(e=Bt({rel:"modulepreload",href:e},t),er.set(r,e),n.querySelector(i)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(v0(r)))return}s=n.createElement("link"),vs(s,"link",e),ns(s),n.head.appendChild(s)}}}function RX(e,t,n){aa.S(e,t,n);var s=Mf;if(s&&e){var i=od(s).hoistableStyles,r=nf(e);t=t||"default";var a=i.get(r);if(!a){var l={loading:0,preload:null};if(a=s.querySelector(m0(r)))l.loading=5;else{e=Bt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=er.get(r))&&Ab(e,n);var c=a=s.createElement("link");ns(c),vs(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,ex(a,t,s)}a={type:"stylesheet",instance:a,count:1,state:l},i.set(r,a)}}}function IX(e,t){aa.X(e,t);var n=Mf;if(n&&e){var s=od(n).hoistableScripts,i=Tf(e),r=s.get(i);r||(r=n.querySelector(v0(i)),r||(e=Bt({src:e,async:!0},t),(t=er.get(i))&&Mb(e,t),r=n.createElement("script"),ns(r),vs(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(i,r))}}function LX(e,t){aa.M(e,t);var n=Mf;if(n&&e){var s=od(n).hoistableScripts,i=Tf(e),r=s.get(i);r||(r=n.querySelector(v0(i)),r||(e=Bt({src:e,async:!0,type:"module"},t),(t=er.get(i))&&Mb(e,t),r=n.createElement("script"),ns(r),vs(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(i,r))}}function F9(e,t,n,s){var i=(i=Ja.current)?m1(i):null;if(!i)throw Error(ce(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=nf(n.href),t=od(i).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=nf(n.href);var r=od(i).hoistableStyles,a=r.get(e);if(a||(i=i.ownerDocument||i,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,a),(r=i.querySelector(m0(e)))?r._p||(a.instance=r,a.state.loading=5):(r=er.get(e),r||(r={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},er.set(e,r)),OX(i,e,r,a.state))),t&&s===null)throw Error(ce(528,""));return a}if(t&&s!==null)throw Error(ce(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=Tf(n),t=od(i).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(ce(444,e))}}function nf(e){return'href="'+Fi(e)+'"'}function m0(e){return'link[rel="stylesheet"]['+e+"]"}function kT(e){return Bt({},e,{"data-precedence":e.precedence,precedence:null})}function OX(e,t,n,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[cg]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[cg]=!0,t.onload=t.onerror=X$.bind(null,t),vs(t,"link",n),ns(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 Tf(e){return'[src="'+Fi(e)+'"]'}function v0(e){return"script[async]"+e}function V9(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Fi(n.href)+'"]');if(s)return t.instance=s,ns(s),s;var i=Bt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ns(s),vs(s,"style",i),ex(s,n.precedence,e),t.instance=s;case"stylesheet":i=nf(n.href);var r=e.querySelector(m0(i));if(r)return t.state.loading|=4,t.instance=r,ns(r),r;s=kT(n),(i=er.get(i))&&Ab(s,i),r=(e.ownerDocument||e).createElement("link"),ns(r);var a=r;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),vs(r,"link",s),t.state.loading|=4,ex(r,n.precedence,e),t.instance=r;case"script":return r=Tf(n.src),(i=e.querySelector(v0(r)))?(t.instance=i,ns(i),i):(s=n,(i=er.get(r))&&(s=Bt({},n),Mb(s,i)),e=e.ownerDocument||e,i=e.createElement("script"),ns(i),vs(i,"link",s),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(ce(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,ex(s,n.precedence,e));return t.instance}function ex(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=s.length?s[s.length-1]:null,r=i,a=0;a<s.length;a++){var l=s[a];if(l.dataset.precedence===t)r=l;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Ab(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Mb(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var tx=null;function G9(e,t,n){if(tx===null){var s=new Map,i=tx=new Map;i.set(n,s)}else i=tx,s=i.get(n),s||(s=new Map,i.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var r=n[i];if(!(r[d0]||r[ps]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var a=r.getAttribute(t)||"";a=e+a;var l=s.get(a);l?l.push(r):s.set(a,[r])}}return s}function Yk(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function DX(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 W9(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function bT(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function wT(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function K9(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=wT(t),e.suspenseyImages.push(t)),e=qX.bind(e),t.decode().then(e,e))}function BX(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 i=nf(s.href),r=t.querySelector(m0(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=v1.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,ns(r);return}r=t.ownerDocument||t,s=kT(s),(i=er.get(i))&&Ab(s,i),r=r.createElement("link"),ns(r);var a=r;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),vs(r,"link",s),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=v1.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var nx=0;function HX(e,t){return e.stylesheets&&e.count===0&&sx(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&sx(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&nx===0&&(nx=62500*iX());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sx(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>nx?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(i)}}:null}function jT(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)sx(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function v1(){this.count--,jT(this)}function qX(){this.imgCount--,jT(this)}var Ng=null;function sx(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ng=new Map,t.forEach(PX,e),Ng=null,v1.call(e))}function PX(e,t){if(!(t.state.loading&4)){var n=Ng.get(e);if(n)var s=n.get(null);else{n=new Map,Ng.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var a=i[r];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),s=a)}s&&n.set(null,s)}i=t.instance,a=i.getAttribute("data-precedence"),r=n.get(a)||s,r===s&&n.set(null,i),n.set(a,i),this.count++,s=v1.bind(this),i.addEventListener("load",s),i.addEventListener("error",s),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sf={$$typeof:Yr,Provider:null,Consumer:null,_currentValue:Nc,_currentValue2:Nc,_threadCount:0};function UX(e,t,n,s,i,r,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=dv(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dv(0),this.hiddenUpdates=dv(null),this.identifierPrefix=s,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function ST(e,t,n,s,i,r,a,l,c,u,d,f){return e=new UX(e,t,n,a,c,u,d,f,l),t=1,r===!0&&(t|=24),r=ni(3,null,null,t),e.current=r,r.stateNode=e,t=X3(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:s,isDehydrated:n,cache:t},Q3(r),e}function CT(e){return e?(e=Qu,e):Qu}function ET(e,t,n,s,i,r){i=CT(i),s.context===null?s.context=i:s.pendingContext=i,s=tl(t),s.payload={element:n},r=r===void 0?null:r,r!==null&&(s.callback=r),n=nl(e,s,t),n!==null&&(si(n,e,t),Dh(n,e,t))}function X9(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Tb(e,t){X9(e,t),(e=e.alternate)&&X9(e,t)}function $T(e){if(e.tag===13||e.tag===31){var t=uu(e,67108864);t!==null&&si(t,e,67108864),Tb(e,67108864)}}function Z9(e){if(e.tag===13||e.tag===31){var t=Ci();t=O3(t);var n=uu(e,t);n!==null&&si(n,e,t),Tb(e,t)}}var rf=!0;function FX(e,t,n,s){var i=Ve.T;Ve.T=null;var r=wt.p;try{wt.p=2,zb(e,t,n,s)}finally{wt.p=r,Ve.T=i}}function VX(e,t,n,s){var i=Ve.T;Ve.T=null;var r=wt.p;try{wt.p=8,zb(e,t,n,s)}finally{wt.p=r,Ve.T=i}}function zb(e,t,n,s){if(rf){var i=Qk(s);if(i===null)Ov(e,t,s,_g,n),Y9(e,s);else if(WX(i,e,t,n,s))s.stopPropagation();else if(Y9(e,s),t&4&&-1<GX.indexOf(e)){for(;i!==null;){var r=Cf(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var a=Ll(r.pendingLanes);if(a!==0){var l=r;for(l.pendingLanes|=2,l.entangledLanes|=2;a;){var c=1<<31-Si(a);l.entanglements[1]|=c,a&=~c}uo(r),!(bt&6)&&($g=wi()+500,g0(0))}}break;case 31:case 13:l=uu(r,2),l!==null&&si(l,r,2),Jm(),Tb(r,2)}if(r=Qk(s),r===null&&Ov(e,t,s,_g,n),r===i)break;i=r}i!==null&&s.stopPropagation()}else Ov(e,t,s,null,n)}}function Qk(e){return e=H3(e),Nb(e)}var _g=null;function Nb(e){if(_g=null,e=rc(e),e!==null){var t=a0(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=_$(t),e!==null)return e;e=null}else if(n===31){if(e=R$(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 _g=e,null}function AT(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(iW()){case H$:return 2;case q$:return 8;case lg:case rW:return 32;case P$:return 268435456;default:return 32}default:return 32}}var Jk=!1,ol=null,al=null,ll=null,y1=new Map,k1=new Map,Aa=[],GX="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 Y9(e,t){switch(e){case"focusin":case"focusout":ol=null;break;case"dragenter":case"dragleave":al=null;break;case"mouseover":case"mouseout":ll=null;break;case"pointerover":case"pointerout":y1.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":k1.delete(t.pointerId)}}function Jf(e,t,n,s,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:r,targetContainers:[i]},t!==null&&(t=Cf(t),t!==null&&$T(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function WX(e,t,n,s,i){switch(t){case"focusin":return ol=Jf(ol,e,t,n,s,i),!0;case"dragenter":return al=Jf(al,e,t,n,s,i),!0;case"mouseover":return ll=Jf(ll,e,t,n,s,i),!0;case"pointerover":var r=i.pointerId;return y1.set(r,Jf(y1.get(r)||null,e,t,n,s,i)),!0;case"gotpointercapture":return r=i.pointerId,k1.set(r,Jf(k1.get(r)||null,e,t,n,s,i)),!0}return!1}function MT(e){var t=rc(e.target);if(t!==null){var n=a0(t);if(n!==null){if(t=n.tag,t===13){if(t=_$(n),t!==null){e.blockedOn=t,S8(e.priority,function(){Z9(n)});return}}else if(t===31){if(t=R$(n),t!==null){e.blockedOn=t,S8(e.priority,function(){Z9(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 ix(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qk(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);nk=s,n.target.dispatchEvent(s),nk=null}else return t=Cf(n),t!==null&&$T(t),e.blockedOn=n,!1;t.shift()}return!0}function Q9(e,t,n){ix(e)&&n.delete(t)}function KX(){Jk=!1,ol!==null&&ix(ol)&&(ol=null),al!==null&&ix(al)&&(al=null),ll!==null&&ix(ll)&&(ll=null),y1.forEach(Q9),k1.forEach(Q9)}function kp(e,t){e.blockedOn===t&&(e.blockedOn=null,Jk||(Jk=!0,Un.unstable_scheduleCallback(Un.unstable_NormalPriority,KX)))}var bp=null;function J9(e){bp!==e&&(bp=e,Un.unstable_scheduleCallback(Un.unstable_NormalPriority,function(){bp===e&&(bp=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],i=e[t+2];if(typeof s!="function"){if(Nb(s||n)===null)continue;break}var r=Cf(n);r!==null&&(e.splice(t,3),t-=3,vk(r,{pending:!0,data:i,method:n.method,action:s},s,i))}}))}function of(e){function t(c){return kp(c,e)}ol!==null&&kp(ol,e),al!==null&&kp(al,e),ll!==null&&kp(ll,e),y1.forEach(t),k1.forEach(t);for(var n=0;n<Aa.length;n++){var s=Aa[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Aa.length&&(n=Aa[0],n.blockedOn===null);)MT(n),n.blockedOn===null&&Aa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var i=n[s],r=n[s+1],a=i[ri]||null;if(typeof r=="function")a||J9(n);else if(a){var l=null;if(r&&r.hasAttribute("formAction")){if(i=r,a=r[ri]||null)l=a.formAction;else if(Nb(i)!==null)continue}else l=a.action;typeof l=="function"?n[s+1]=l:(n.splice(s,3),s-=3),J9(n)}}}function TT(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(a){return i=a})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,i=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),i!==null&&(i(),i=null)}}}function _b(e){this._internalRoot=e}n2.prototype.render=_b.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ce(409));var n=t.current,s=Ci();ET(n,s,e,t,null,null)};n2.prototype.unmount=_b.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ET(e.current,2,null,e,null,null),Jm(),t[Sf]=null}};function n2(e){this._internalRoot=e}n2.prototype.unstable_scheduleHydration=function(e){if(e){var t=K$();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Aa.length&&t!==0&&t<Aa[n].priority;n++);Aa.splice(n,0,e),n===0&&MT(e)}};var ew=z$.version;if(ew!=="19.3.1")throw Error(ce(527,ew,"19.3.1"));wt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ce(188)):(e=Object.keys(e).join(","),Error(ce(268,e)));return e=WG(t),e=e!==null?I$(e):null,e=e===null?null:e.stateNode,e};var XX={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:Ve,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wp.isDisabled&&wp.supportsFiber)try{l0=wp.inject(XX),ji=wp}catch{}}Om.createRoot=function(e,t){if(!N$(e))throw Error(ce(299));var n=!1,s="",i=dM,r=fM,a=hM;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=ST(e,1,!1,null,null,n,s,null,i,r,a,TT),e[Sf]=t.current,Sb(e),new _b(t)};Om.hydrateRoot=function(e,t,n){if(!N$(e))throw Error(ce(299));var s=!1,i="",r=dM,a=fM,l=hM,c=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(c=n.formState)),t=ST(e,1,!0,t,n??null,s,i,c,r,a,l,TT),t.context=CT(null),n=t.current,s=Ci(),s=O3(s),i=tl(s),i.callback=null,nl(n,i,s),n=s,t.current.lanes=n,u0(t,n),uo(t),e[Sf]=t.current,Sb(e),new n2(t)};Om.version="19.3.1";function zT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(zT)}catch(e){console.error(e)}}zT(),A$.exports=Om;var NT=A$.exports;let di=null,tw=null;const nw=["data-theme",ei("theme")];function ZX(e){const t=()=>{let s=null;for(const i of nw){const r=document.documentElement.getAttribute(i);r==null?e.removeAttribute(i):(e.setAttribute(i,r),i==="data-theme"&&(s=r))}s==="light"||s==="dark"?e.style.colorScheme=s:e.style.removeProperty("color-scheme")};t(),new MutationObserver(t).observe(document.documentElement,{attributes:!0,attributeFilter:[...nw]})}function YX(){if(di)return di;if(typeof document>"u")throw new Error("useToast: Cannot create fallback viewport during SSR. Wrap your app with <LayerProvider> or <AppShell>.");D4();const e=document.createElement("div");e.setAttribute("data-astryx-toast-fallback",""),document.body.appendChild(e),ZX(e);let t;const n=new Promise(a=>{t=a}),s=()=>{const a=h.use(Em),l=h.useRef(!1);return h.useEffect(()=>{a&&!l.current&&(l.current=!0,di=a,t==null||t(a))},[a]),null};tw=NT.createRoot(e),tw.render(o.jsx($m,{children:o.jsx(s,{})}));const i=[],r={addToast:a=>{di&&di!==r?di.addToast(a):(i.push(a),n.then(l=>{for(const c of i)l.addToast(c);i.length=0}))},removeToast:(a,l)=>{di&&di!==r&&di.removeToast(a,l)},findByUniqueID:a=>{if(di&&di!==r)return di.findByUniqueID(a)}};return di=r,r}let QX=0;function JX(){return`astryx-toast-${++QX}`}function zf(){const e=h.use(Em);return h.useCallback(n=>{const s=e??YX(),i=JX(),r={id:i,options:n,createdAt:Date.now()};return s.addToast(r),()=>s.removeToast(i,"manual")},[e])}const qv={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}},eZ={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 br({variant:e,label:t,isPulsing:n=!1,tooltip:s,xstyle:i,className:r,style:a,ref:l,...c}){const u=o.jsx("span",{ref:l,role:"img","aria-label":t,...ie(se("statusdot",{variant:e}),G(qv.base,eZ[e],n&&qv.pulsing,n&&qv.reducedMotion,i),r,a),...c});return s?o.jsx(ia,{content:s,children:u}):u}br.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 tZ=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 nZ(e,t,n=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:tZ(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 sZ=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 iZ=e=>{const t=sZ(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 e5=(...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 _l={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 Pv(e){return e!=null}function rZ(e,t={}){var p,x;const n=t.attributeNames??{},s=g=>n[g]??g,i=e.size??e.width??_l.width,r=e.size??e.height??_l.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?e5(...c):e5("lucide",...l,...c),d=t.absoluteStrokeWidth?Number(t.strokeWidth??_l["stroke-width"])*Number(e.size??e.width??_l.width)/Number(t.size??t.width??_l.width):t.strokeWidth??_l["stroke-width"];return["svg",{...Object.entries(_l).reduce((g,[y,v])=>(g[s(y)]=v,g),{}),..."color"in t&&t.color&&{[s("stroke")]:t.color},..."size"in t&&Pv(t.size)&&{[s("width")]:t.size,[s("height")]:t.size},..."width"in t&&Pv(t.width)&&{[s("width")]:t.width},..."height"in t&&Pv(t.height)&&{[s("height")]:t.height},[s("stroke-width")]:d,...u&&{[s("class")]:u},[s("viewBox")]:`0 0 ${i} ${r}`,...t.hasA11yProp===!1?{[s("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(g=>{const[y,v,m]=g,k=t.nonScalingStroke?{[s("vector-effect")]:"non-scaling-stroke",...v}:v;return m?[y,k,m]:[y,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 oZ(e,t={}){return rZ(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 aZ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},lZ=h.createContext({}),cZ=()=>h.useContext(lZ),uZ=h.forwardRef(({color:e,size:t,width:n,height:s,strokeWidth:i,absoluteStrokeWidth:r,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:y=!1,nonScalingStroke:v=!1,color:m="currentColor",className:k=""}=cZ()??{},w=!!c||aZ(f),[S,E,A=[]]=oZ(d,{color:e??m,width:n??t??x,height:s??t??x,strokeWidth:i??g,absoluteStrokeWidth:r??y,nonScalingStroke:a??v,className:e5(k,l),hasA11yProp:w,attributes:f});return h.createElement(S,{ref:p,...E},[...A.map(([z,N])=>h.createElement(z,N)),...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 _t(e,t=[],n=[]){const s=typeof e=="string"?nZ(e,t,n):e,i=h.forwardRef(({className:r,...a},l)=>h.createElement(uZ,{ref:l,icon:s,className:r,...a}));return s.name&&(i.displayName=iZ(s.name)),i}/**
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 _T={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};_T.node;const dZ=_t(_T);/**
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 RT={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"}]]};RT.node;const fZ=_t(RT);/**
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 IT={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};IT.node;const hZ=_t(IT);/**
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 LT={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"}]]};LT.node;const pZ=_t(LT);/**
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 OT={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"}]]};OT.node;const xZ=_t(OT);/**
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 DT={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};DT.node;const gZ=_t(DT);/**
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 BT={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};BT.node;const mZ=_t(BT);/**
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 HT={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};HT.node;const vZ=_t(HT);/**
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 qT={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};qT.node;const yZ=_t(qT);/**
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 PT={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"}]]};PT.node;const kZ=_t(PT);/**
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 UT={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"}]]};UT.node;const bZ=_t(UT);/**
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 FT={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"]};FT.node;const wZ=_t(FT);/**
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 VT={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"]};VT.node;const jZ=_t(VT);/**
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 GT={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};GT.node;const SZ=_t(GT);/**
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 WT={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"]};WT.node;const CZ=_t(WT);/**
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 KT={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"}]]};KT.node;const EZ=_t(KT);/**
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 XT={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"]};XT.node;const $Z=_t(XT);/**
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 ZT={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"}]]};ZT.node;const AZ=_t(ZT);/**
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 YT={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"}]]};YT.node;const MZ=_t(YT);/**
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 QT={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"]};QT.node;const TZ=_t(QT);/**
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 JT={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"}]]};JT.node;const zZ=_t(JT);/**
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 ez={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};ez.node;const NZ=_t(ez);/**
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 tz={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"}]]};tz.node;const _Z=_t(tz);/**
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 nz={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};nz.node;const RZ=_t(nz);/**
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 sz={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};sz.node;const IZ=_t(sz);/**
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 iz={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"]};iz.node;const LZ=_t(iz);/**
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 rz={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"}]]};rz.node;const OZ=_t(rz);/**
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 oz={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};oz.node;const DZ=_t(oz);var zt={size:"1em","aria-hidden":!0},BZ={close:o.jsx(DZ,{...zt}),chevronDown:o.jsx(mZ,{...zt}),chevronLeft:o.jsx(vZ,{...zt}),chevronRight:o.jsx(yZ,{...zt}),chevronsLeft:o.jsx(kZ,{...zt}),chevronsRight:o.jsx(bZ,{...zt}),check:o.jsx(gZ,{...zt}),success:o.jsx(wZ,{...zt}),error:o.jsx(jZ,{...zt}),warning:o.jsx(LZ,{...zt}),info:o.jsx(zZ,{...zt}),calendar:o.jsx(pZ,{...zt}),clock:o.jsx(SZ,{...zt}),externalLink:o.jsx(AZ,{...zt}),menu:o.jsx(NZ,{...zt}),moreHorizontal:o.jsx($Z,{...zt}),search:o.jsx(RZ,{...zt}),arrowUp:o.jsx(hZ,{...zt}),arrowDown:o.jsx(dZ,{...zt}),arrowsUpDown:o.jsx(fZ,{...zt}),funnel:o.jsx(TZ,{...zt}),eyeSlash:o.jsx(MZ,{...zt}),viewColumns:o.jsx(CZ,{...zt}),copy:o.jsx(EZ,{...zt}),checkDouble:o.jsx(xZ,{...zt}),wrench:o.jsx(OZ,{...zt}),stop:o.jsx(IZ,{...zt}),microphone:o.jsx(_Z,{...zt})};const HZ={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:BZ},qZ=["image/jpeg","image/png","image/gif","image/webp"];function PZ(e){return"data"in e?e:{ref:e.ref}}const UZ=new TextEncoder;async function FZ(e){const t=await globalThis.crypto.subtle.digest("SHA-256",UZ.encode(`${e.mimeType}
382
+ ${e.data}`));return Array.from(new Uint8Array(t),n=>n.toString(16).padStart(2,"0")).join("")}const Wh=4,VZ=5*1024*1024,GZ=/^[A-Za-z0-9+/]*={0,2}$/;function WZ(e){if(e.length>Wh)return`At most ${Wh} images per message`;for(let t=0;t<e.length;t++){const n=e[t];if(!qZ.includes(n.mimeType))return`Unsupported image type: ${n.mimeType} (use JPEG, PNG, GIF or WebP)`;if(n.data===""||n.data.length%4!==0||!GZ.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>VZ)return`Image ${t+1} is larger than 5 MB`}}function KZ(e,t){const n=new Map(t.map(d=>[d.id,d])),s=new Map,i=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&&(i.set(d.id,d),s.set(d.id,{summary:p,children:[]}))}for(const d of t){const f=[d];let p=d;for(;!i.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(i.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 y=s.get(f[x+1].id),v=s.get(g.id);y.children.includes(v)||y.children.push(v)}}}const r=(d,f)=>d.summary.id-f.summary.id,a=d=>l(s.get(d.id)),l=d=>({summary:d.summary,children:[...d.children].sort(r).map(l)}),c=[...i.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 to(e,t){const n=s=>{for(const i of s){if(i.summary.id===t)return i;const r=n(i.children);if(r!==void 0)return r}};return n([...e.chats,...e.projects.flatMap(s=>s.conversations)])}function XZ(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 i=new Map(t.map(u=>[u.id,u])),r=new Set;let a=i.get(n);for(;a!==void 0&&!r.has(a.id);){r.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:i.get(a.parent)}}function ZZ(e,t,n){const s=e.conversations.find(l=>l.id===n);if(s!==void 0)return s.home;const i=new Map(t.map(l=>[l.id,l])),r=new Set;let a=i.get(n);for(;a!==void 0&&!r.has(a.id);){r.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:i.get(a.parent)}}function az(e){if(e!==void 0)return e.currentAgent===void 0?e.role:e.currentAgent??void 0}const YZ=["openai-completions","openai-responses","anthropic-messages","google-generative-ai"],QZ="Host is upgrading",lz={off:!0,minimal:!0,low:!0,medium:!0,high:!0,xhigh:!0,max:!0},t5=Object.keys(lz),JZ=e=>typeof e=="string"&&Object.prototype.hasOwnProperty.call(lz,e),eY=64,tY=e=>e<32||e>=127&&e<=159;function nY(e){let t=e;for(;;){const s=[...(t.endsWith(".local")?t.slice(0,-6):t).trim()].filter(i=>!tY(i.codePointAt(0))).join("").slice(0,eY);if(s===t)return s;t=s}}const cz={conversations:0,index:0,devices:0,mcp:0,models:1,auth:1,settings:2,agents:6,providers:21,upgrade:30},Rb=Object.keys(cz);function Uv(e){return Rb.filter(t=>cz[t]<=e)}const mo=e=>`conversation:${e}`,Fv=(e,t)=>`doc:${e}:${t}`,rx=4401,Vv={major:5},sY={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,reorderQueued:29,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,earlierEntries:28,beginAttachment:19,appendAttachment:19,rtcOffer:23,ping:23,openTerminal:27,terminalInput:27,resizeTerminal:27,renameTerminal:27,restartTerminal:27,closeTerminal:27,stopProcess:32,startUpgrade:30,cancelUpgrade:30,checkUpgrade:30};function Je(e,t){return e>=sY[t]}const iY={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,transcriptPaging:28,autoUpgrade:30,processes:32,subagentStop:33};function Ct(e,t){return e>=iY[t]}[...Rb];const sw={"needs-answer":3,failed:2,running:1};function rY(e){let t;const n=s=>{const i=s.summary.status;i!==void 0&&(t===void 0||sw[i]>sw[t])&&(t=i);for(const r of s.children)n(r)};return n(e),t}function oY(e){let t;const n=s=>{const i=s.summary.updatedAt;i!==void 0&&(t===void 0||i>t)&&(t=i);for(const r of s.children)n(r)};return n(e),t}function y0(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 i=Math.floor(s/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}const aY=/^\s*in the working directory\s+\S+,\s*/i;function Xc(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(aY,"").trim();return t===void 0||t===""?"Subagent":t}function b1(e,t){let n=to(e,t);for(let s=0;n!==void 0&&n.summary.parent!==void 0&&s<4;s++)n=to(e,n.summary.parent);return n}function Ib(e){const t=[],n=s=>{for(const i of s.children)i.summary.kind==="fork"&&(t.push(i),n(i))};return n(e),t}function iw(e){const t=e.children.filter(s=>s.summary.kind==="subagent"),n=s=>s.summary.status==="running"||s.summary.status==="needs-answer";return[...t.filter(n),...t.filter(s=>!n(s))]}function Lb(e){const t=[],n=iw(e);n.length>0&&t.push({owner:e.summary,label:"This conversation",tasks:n});for(const s of Ib(e)){const i=iw(s);i.length>0&&t.push({owner:s.summary,label:Xc(s.summary),tasks:i})}return t}function uz(e,t,n){var s;return(((s=to(e,t))==null?void 0:s.children)??[]).filter(i=>i.summary.forkedAt===n).map(i=>i.summary.id)}function k0(e){return(e==null?void 0:e.kind)==="subagent"&&e.name!==void 0?e.name:Xc(e)}function dz(e,t){return Ct(t,"subagentStop")&&e.name!==void 0&&e.status==="running"}function lY(e){return e==="auto"||e==="directOnly"||e==="relayOnly"?e:void 0}const rw=1,cY=4,uY=1024;function dY(e){const t=e.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,"");return t==="localhost"||t.endsWith(".localhost")||t==="::1"||/^127(?:\.\d{1,3}){3}$/.test(t)}function w1(e){try{return dY(new URL(e).hostname)}catch{return!1}}const ow=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),fY=e=>{if(e.length===0)return!1;try{const t=new URL(e).protocol;return t==="ws:"||t==="wss:"}catch{return!1}};function s2(e){if(e===void 0)return{kind:"absent"};if(!ow(e))return{kind:"malformed"};const t=e.schemaVersion;if(typeof t!="number")return{kind:"malformed"};if(t!==rw)return{kind:"unsupported"};const n=e.endpoints;if(!Array.isArray(n))return{kind:"malformed"};if(n.length>cY)return{kind:"malformed"};const s=[],i=new Map;for(const r of n){if(!ow(r))return{kind:"malformed"};const a=r.transport;if(typeof a!="string")return{kind:"malformed"};if(a!=="webSocket")continue;const l=r.role;if(l!=="direct"&&l!=="relay")return{kind:"malformed"};const c=r.url;if(typeof c!="string"||c.length>uY)return{kind:"malformed"};if(!fY(c))return{kind:"malformed"};const u=i.get(c);if(u!==void 0){if(u!==l)return{kind:"malformed"};continue}i.set(c,l),s.push({transport:"webSocket",role:l,url:c})}return s.length===0&&n.length>0?{kind:"unsupported"}:{kind:"valid",endpointSet:{schemaVersion:rw,endpoints:s}}}function fz(e){return encodeURIComponent(JSON.stringify(e))}function hY(e){try{return s2(JSON.parse(e))}catch{return{kind:"malformed"}}}const pY="mixed content: this HTTPS page blocks the insecure ws:// connection";function ox(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 xY(e){return e.filter(t=>t.role==="relay"||t.role==="legacy")}const hz="Direct connection unavailable: this host cannot be reached without the relay and WebRTC did not connect.",gY=e=>{try{return new URL(e).protocol==="ws:"&&!w1(e)}catch{return!1}},mY=(e,t)=>t.pageProtocol==="https:"&&gY(e)?pY:void 0;function af(e,t,n={}){const s=[],i=new Set,r=(a,l)=>{if(i.has(a))return;i.add(a);const c=mY(a,n);s.push({url:a,role:l,...c===void 0?{}:{unsupported:c}})};if(w1(e)&&r(e,"loopback"),t!==void 0){for(const a of t.endpoints)a.role==="relay"&&r(a.url,"relay");for(const a of t.endpoints)a.role==="direct"&&r(a.url,"direct")}else w1(e)||r(e,"legacy");return s}const aw=(e,t)=>{var n;return(n=e.find(s=>s.role===t))==null?void 0:n.url};function Ob(e,t){if(w1(e))return e;const n=aw(t.endpoints,"relay");return n!==void 0?n:aw(t.endpoints,"direct")??e}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function n5(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const Rg=e=>e?`"${e}" `:"";function s5(e,t=""){if(typeof e!="boolean")throw new TypeError(Rg(t)+"expected boolean, got type="+typeof e);return e}function gd(e,t=""){if(typeof e!="number")throw new TypeError(Rg(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(Rg(t)+"expected integer >= 0, got "+e);return e}function ss(e,t,n=""){if(n5(e)&&(t===void 0||e.length===t))return e;t!==void 0&&gd(t,"length");const s=n5(e),i=t!==void 0?` of length ${t}`:"",r=s?`length=${e.length}`:`type=${typeof e}`,a=Rg(n)+"expected Uint8Array"+i+", got "+r;throw s?new RangeError(a):new TypeError(a)}const lw=(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 cw(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function vY(e,t){ss(e,void 0,"output");const n=t.outputLen;if(!(e.length>=n))throw new RangeError('"output" expected length >= '+n)}function Bo(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function cl(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function yY(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}const md=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function kY(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function bY(e){for(let t=0;t<e.length;t++)e[t]=kY(e[t]);return e}const ac=md?e=>e:bY;function wY(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 jY(e,t){if(wY(e,t)&&e.byteOffset<t.byteOffset)throw new Error("complex overlap of input and output is not supported")}function SY(e,t){return lw(e,"defaults"),lw(t,"opts"),Object.assign(e,t)}function CY(e,t){if(e=ss(e),t=ss(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 EY(e,t,n){const s=t,i=()=>[],r=(l,c)=>s(c,...i(l)).update(l).digest(),a=s(new Uint8Array(e),...i(new Uint8Array(0)));return r.outputLen=a.outputLen,r.blockLen=a.blockLen,r.create=(l,...c)=>s(l,...c),r}const $Y=(e,t)=>{function n(s,...i){if(ss(s,void 0,"key"),e.nonceLength!==void 0){const f=i[0];ss(f,e.varSizeNonce?void 0:e.nonceLength,"nonce")}const r=e.tagLength,a=e.nonceLength!==void 0?1:0;if(!e.withAAD){for(let f=a;f<i.length;f++)if(n5(i[f]))throw new Error("AAD not supported")}e.withAAD&&i[a]!==void 0&&ss(i[a],void 0,"AAD");const l=t(s,...i),c=(f,p)=>{if(p!==void 0){if(f!==2)throw new Error("cipher output not supported");ss(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,ss(f,void 0,"data"),c(l.encrypt.length,p),l.encrypt(f,p)},decrypt(f,p){if(ss(f,void 0,"data"),r&&f.length<r)throw new Error('"ciphertext" expected length >= tagLength='+r);return c(l.decrypt.length,p),l.decrypt(f,p)}}}return Object.assign(n,e),n};function i5(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(ss(t,e,"output"),n&&!Ig(t))throw new Error("invalid output, must be aligned");return t}function AY(e,t,n){gd(e),gd(t),s5(n);const s=new Uint8Array(16),i=yY(s);return i.setBigUint64(0,BigInt(t),n),i.setBigUint64(8,BigInt(e),n),s}function Ig(e){return e.byteOffset%4===0}function Lg(e){return Uint8Array.from(ss(e))}const pz=e=>Uint8Array.from(e.split(""),t=>t.charCodeAt(0)),MY=ac(Bo(pz("expand 16-byte k"))),TY=ac(Bo(pz("expand 32-byte k")));function mt(e,t){return e<<t|e>>>32-t}const eh=64,zY=16,r5=2**32-1,uw=Uint32Array.of();function NY(e,t,n,s,i,r,a,l){const c=i.length,u=new Uint8Array(eh),d=Bo(u),f=md&&Ig(i)&&Ig(r),p=f?Bo(i):uw,x=f?Bo(r):uw;if(!md){for(let g=0;g<c;a++){if(e(t,n,s,d,a,l),ac(d),a>=r5)throw new Error("arx: counter overflow");const y=Math.min(eh,c-g);for(let v=0,m;v<y;v++)m=g+v,r[m]=i[m]^u[v];g+=y}return}for(let g=0;g<c;a++){if(e(t,n,s,d,a,l),a>=r5)throw new Error("arx: counter overflow");const y=Math.min(eh,c-g);if(f&&y===eh){const v=g/4;if(g%4!==0)throw new Error("arx: invalid block position");for(let m=0,k;m<zY;m++)k=v+m,x[k]=p[k]^d[m];g+=eh;continue}for(let v=0,m;v<y;v++)m=g+v,r[m]=i[m]^u[v];g+=y}}function _Y(e,t){const{allowShortKeys:n,extendNonceFn:s,counterLength:i,counterRight:r,rounds:a}=SY({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!="function")throw new Error("core must be a function");return gd(i),gd(a),s5(r),s5(n),(l,c,u,d,f=0)=>{ss(l,void 0,"key"),ss(c,void 0,"nonce"),ss(u,void 0,"data");const p=u.length,x=d!==void 0;if(d=i5(p,d,!1),x&&jY(u,d),gd(f),f<0||f>=r5)throw new Error("arx: counter overflow");const g=[];let y=l.length,v,m;if(y===32)g.push(v=Lg(l)),m=TY;else if(y===16&&n)v=new Uint8Array(32),v.set(l),v.set(l,16),m=MY,g.push(v);else throw ss(l,32,"arx key"),new Error("invalid key size");(!md||!Ig(c))&&g.push(c=Lg(c));let k=Bo(v);if(s){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const E=c.subarray(0,16);if(md)s(m,k,Bo(E),k);else{const A=ac(Uint32Array.from(m));s(A,k,Bo(E),k),cl(A),ac(k)}c=c.subarray(16)}else md||ac(k);const w=16-i;if(w!==c.length)throw new Error(`arx: nonce must be ${w} or 16 bytes`);if(w!==12){const E=new Uint8Array(12);E.set(c,r?0:12-c.length),c=E,g.push(c)}const S=ac(Bo(c));try{return NY(e,m,k,S,u,d,f,a),d}finally{cl(...g)}}}function ls(e,t){return e[t++]&255|(e[t++]&255)<<8}class RY{constructor(t){ve(this,"blockLen",16);ve(this,"outputLen",16);ve(this,"buffer",new Uint8Array(16));ve(this,"r",new Uint16Array(10));ve(this,"h",new Uint16Array(10));ve(this,"pad",new Uint16Array(8));ve(this,"pos",0);ve(this,"finished",!1);ve(this,"destroyed",!1);t=Lg(ss(t,32,"key"));const n=ls(t,0),s=ls(t,2),i=ls(t,4),r=ls(t,6),a=ls(t,8),l=ls(t,10),c=ls(t,12),u=ls(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|s<<3)&8191,this.r[2]=(s>>>10|i<<6)&7939,this.r[3]=(i>>>7|r<<9)&8191,this.r[4]=(r>>>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]=ls(t,16+2*d)}process(t,n,s=!1){const i=s?0:2048,{h:r,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],y=a[8],v=a[9],m=ls(t,n+0),k=ls(t,n+2),w=ls(t,n+4),S=ls(t,n+6),E=ls(t,n+8),A=ls(t,n+10),z=ls(t,n+12),N=ls(t,n+14);let M=r[0]+(m&8191),$=r[1]+((m>>>13|k<<3)&8191),R=r[2]+((k>>>10|w<<6)&8191),_=r[3]+((w>>>7|S<<9)&8191),T=r[4]+((S>>>4|E<<12)&8191),O=r[5]+(E>>>1&8191),H=r[6]+((E>>>14|A<<2)&8191),L=r[7]+((A>>>11|z<<5)&8191),B=r[8]+((z>>>8|N<<8)&8191),I=r[9]+(N>>>5|i),D=0,q=D+M*l+$*(5*v)+R*(5*y)+_*(5*g)+T*(5*x);D=q>>>13,q&=8191,q+=O*(5*p)+H*(5*f)+L*(5*d)+B*(5*u)+I*(5*c),D+=q>>>13,q&=8191;let U=D+M*c+$*l+R*(5*v)+_*(5*y)+T*(5*g);D=U>>>13,U&=8191,U+=O*(5*x)+H*(5*p)+L*(5*f)+B*(5*d)+I*(5*u),D+=U>>>13,U&=8191;let X=D+M*u+$*c+R*l+_*(5*v)+T*(5*y);D=X>>>13,X&=8191,X+=O*(5*g)+H*(5*x)+L*(5*p)+B*(5*f)+I*(5*d),D+=X>>>13,X&=8191;let Z=D+M*d+$*u+R*c+_*l+T*(5*v);D=Z>>>13,Z&=8191,Z+=O*(5*y)+H*(5*g)+L*(5*x)+B*(5*p)+I*(5*f),D+=Z>>>13,Z&=8191;let ne=D+M*f+$*d+R*u+_*c+T*l;D=ne>>>13,ne&=8191,ne+=O*(5*v)+H*(5*y)+L*(5*g)+B*(5*x)+I*(5*p),D+=ne>>>13,ne&=8191;let Y=D+M*p+$*f+R*d+_*u+T*c;D=Y>>>13,Y&=8191,Y+=O*l+H*(5*v)+L*(5*y)+B*(5*g)+I*(5*x),D+=Y>>>13,Y&=8191;let ae=D+M*x+$*p+R*f+_*d+T*u;D=ae>>>13,ae&=8191,ae+=O*c+H*l+L*(5*v)+B*(5*y)+I*(5*g),D+=ae>>>13,ae&=8191;let le=D+M*g+$*x+R*p+_*f+T*d;D=le>>>13,le&=8191,le+=O*u+H*c+L*l+B*(5*v)+I*(5*y),D+=le>>>13,le&=8191;let re=D+M*y+$*g+R*x+_*p+T*f;D=re>>>13,re&=8191,re+=O*d+H*u+L*c+B*l+I*(5*v),D+=re>>>13,re&=8191;let ge=D+M*v+$*y+R*g+_*x+T*p;D=ge>>>13,ge&=8191,ge+=O*f+H*d+L*u+B*c+I*l,D+=ge>>>13,ge&=8191,D=(D<<2)+D|0,D=D+q|0,q=D&8191,D=D>>>13,U+=D,r[0]=q,r[1]=U,r[2]=X,r[3]=Z,r[4]=ne,r[5]=Y,r[6]=ae,r[7]=le,r[8]=re,r[9]=ge}finalize(){const{h:t,pad:n}=this,s=new Uint16Array(10);let i=t[1]>>>13;t[1]&=8191;for(let l=2;l<10;l++)t[l]+=i,i=t[l]>>>13,t[l]&=8191;t[0]+=i*5,i=t[0]>>>13,t[0]&=8191,t[1]+=i,i=t[1]>>>13,t[1]&=8191,t[2]+=i,s[0]=t[0]+5,i=s[0]>>>13,s[0]&=8191;for(let l=1;l<10;l++)s[l]=t[l]+i,i=s[l]>>>13,s[l]&=8191;s[9]-=8192;let r=(i^1)-1;for(let l=0;l<10;l++)s[l]&=r;r=~r;for(let l=0;l<10;l++)t[l]=t[l]&r|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;cl(s)}update(t){cw(this),ss(t),t=Lg(t);const{buffer:n,blockLen:s}=this,i=t.length;for(let r=0;r<i;){const a=Math.min(s-this.pos,i-r);if(a===s){for(;s<=i-r;r+=s)this.process(t,r);continue}n.set(t.subarray(r,r+a),this.pos),this.pos+=a,r+=a,this.pos===s&&(this.process(n,0,!1),this.pos=0)}return this}destroy(){this.destroyed=!0,cl(this.h,this.r,this.buffer,this.pad)}digestInto(t){cw(this),vY(t,this),this.finished=!0;const{buffer:n,h:s}=this;let{pos:i}=this;if(i){for(n[i++]=1;i<16;i++)n[i]=0;this.process(n,0,!0)}this.finalize();let r=0;for(let a=0;a<8;a++)t[r++]=s[a]>>>0,t[r++]=s[a]>>>8}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}}const IY=EY(32,e=>new RY(e));function LY(e,t,n,s,i,r=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],y=t[5],v=t[6],m=t[7],k=i,w=n[0],S=n[1],E=n[2],A=a,z=l,N=c,M=u,$=d,R=f,_=p,T=x,O=g,H=y,L=v,B=m,I=k,D=w,q=S,U=E;for(let Z=0;Z<r;Z+=2)A=A+$|0,I=mt(I^A,16),O=O+I|0,$=mt($^O,12),A=A+$|0,I=mt(I^A,8),O=O+I|0,$=mt($^O,7),z=z+R|0,D=mt(D^z,16),H=H+D|0,R=mt(R^H,12),z=z+R|0,D=mt(D^z,8),H=H+D|0,R=mt(R^H,7),N=N+_|0,q=mt(q^N,16),L=L+q|0,_=mt(_^L,12),N=N+_|0,q=mt(q^N,8),L=L+q|0,_=mt(_^L,7),M=M+T|0,U=mt(U^M,16),B=B+U|0,T=mt(T^B,12),M=M+T|0,U=mt(U^M,8),B=B+U|0,T=mt(T^B,7),A=A+R|0,U=mt(U^A,16),L=L+U|0,R=mt(R^L,12),A=A+R|0,U=mt(U^A,8),L=L+U|0,R=mt(R^L,7),z=z+_|0,I=mt(I^z,16),B=B+I|0,_=mt(_^B,12),z=z+_|0,I=mt(I^z,8),B=B+I|0,_=mt(_^B,7),N=N+T|0,D=mt(D^N,16),O=O+D|0,T=mt(T^O,12),N=N+T|0,D=mt(D^N,8),O=O+D|0,T=mt(T^O,7),M=M+$|0,q=mt(q^M,16),H=H+q|0,$=mt($^H,12),M=M+$|0,q=mt(q^M,8),H=H+q|0,$=mt($^H,7);let X=0;s[X++]=a+A|0,s[X++]=l+z|0,s[X++]=c+N|0,s[X++]=u+M|0,s[X++]=d+$|0,s[X++]=f+R|0,s[X++]=p+_|0,s[X++]=x+T|0,s[X++]=g+O|0,s[X++]=y+H|0,s[X++]=v+L|0,s[X++]=m+B|0,s[X++]=k+I|0,s[X++]=w+D|0,s[X++]=S+q|0,s[X++]=E+U|0}const OY=_Y(LY,{counterRight:!1,counterLength:4,allowShortKeys:!1}),DY=new Uint8Array(16),dw=(e,t)=>{e.update(t);const n=t.length%16;n&&e.update(DY.subarray(n))},BY=new Uint8Array(32);function fw(e,t,n,s,i){i!==void 0&&ss(i,void 0,"AAD");const r=e(t,n,BY),a=AY(s.length,i?i.length:0,!0),l=IY.create(r);i&&dw(l,i),dw(l,s),l.update(a);const c=l.digest();return cl(r,a),c}const HY=e=>(t,n,s)=>({encrypt(r,a){const l=r.length;a=i5(l+16,a,!1),a.set(r);const c=a.subarray(0,-16);e(t,n,c,c,1);const u=fw(e,t,n,c,s);return a.set(u,l),cl(u),a},decrypt(r,a){a=i5(r.length-16,a,!1);const l=r.subarray(0,-16),c=r.subarray(-16),u=fw(e,t,n,l,s);if(!CY(c,u))throw cl(u),new Error("invalid tag");return a.set(r.subarray(0,-16)),e(t,n,a,a,1),cl(u),a}}),hw=$Y({blockSize:64,nonceLength:12,tagLength:16,withAAD:!0},HY(OY)),qY=e=>e/2**32|0,PY=e=>e>>>0;function o5(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const a5=e=>e?`"${e}" `:"";function ta(e,t=""){if(typeof e!="number")throw new TypeError(a5(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(a5(t)+"expected integer >= 0, got "+e);return e}function Yi(e,t,n=""){if(o5(e)&&(t===void 0||e.length===t))return e;t!==void 0&&ta(t,"length");const s=o5(e),i=t!==void 0?` of length ${t}`:"",r=s?`length=${e.length}`:`type=${typeof e}`,a=a5(n)+"expected Uint8Array"+i+", got "+r;throw s?new RangeError(a):new TypeError(a)}function pw(e){return Uint8Array.from(Yi(e))}function UY(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("expected hash wrapped by utils.createHasher");if(ta(e.outputLen),ta(e.blockLen),e.outputLen<1||e.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}const FY=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},xw=(e,t)=>{FY(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 Og(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function xz(e,t){Yi(e,void 0,"output");const n=t.outputLen;if(!(e.length>=n))throw new RangeError('"output" expected length >= '+n)}function Dg(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function l5(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Bg(e,t){return e<<32-t|e>>>t}const gz=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function mz(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const mh=gz?e=>e:e=>mz(e)>>>0;function VY(e){for(let t=0;t<e.length;t++)e[t]=mz(e[t]);return e}const Cu=gz?e=>e:VY,vz=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",GY=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Db(e){if(Yi(e),vz)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=GY[e[n]];return t}function gw(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function yz(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);if(vz)try{return Uint8Array.fromHex(e)}catch(i){throw i instanceof SyntaxError?new RangeError(i.message):i}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 i=0,r=0;i<n;i++,r+=2){const a=gw(e.charCodeAt(r)),l=gw(e.charCodeAt(r+1));if(a===void 0||l===void 0){const c=e[r]+e[r+1];throw new RangeError('hex string expected, got non-hex character "'+c+'" at index '+r)}s[i]=a*16+l}return s}function kz(e,t,n="opts"){return xw(e,"defaults"),t!==void 0&&xw(t,n),Object.assign(Object.create(null),e,t)}function WY(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=kz({},t,"info");const n=(i,r)=>e(r).update(i).digest(),s=e(void 0);return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.canXOF=s.canXOF,n.create=i=>e(i),Object.assign(n,t),Object.freeze(n)}function KY(e=32){ta(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 XY=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function bz(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 vd=(e,t,n)=>Yi(e,t,n),wz=ta;function yd(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 Kh(e,t){if(typeof e!="function")throw new TypeError(`"${t}" is invalid: expected function, got ${typeof e}`);return e}const ZY=Db,YY=e=>yz(e),jz=o5,Sz=e=>KY(e),Hg=BigInt(0),mw=BigInt(1),QY=e=>e?`"${e}" `:"";function i2(e,t=""){if(typeof e!="boolean")throw new TypeError(QY(t)+"expected boolean, got type="+typeof e);return e}function JY(e){if(typeof e=="bigint"){if(!Oc(e))throw new RangeError("positive bigint expected, got "+e)}else wz(e);return e}function c5(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 Cz(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?Hg:BigInt("0x"+e)}function Ez(e){return Cz(Db(e))}function qg(e){return Cz(Db(j1(Yi(e)).reverse()))}function $z(e,t){if(ta(t),t===0)throw new Error("zero output length is invalid");e=JY(e);const n=t*2,s=e.toString(16);if(s.length>n)throw new RangeError("number is too large");return yz(s.padStart(n,"0"))}function Az(e,t){return $z(e,t).reverse()}function j1(e){return Uint8Array.from(vd(e))}function Oc(e){return typeof e=="bigint"&&Hg<=e}function Mz(e,t,n){return Oc(e)&&Oc(t)&&Oc(n)&&t<=e&&e<n}function Xh(e,t,n,s){if(!Mz(t,n,s))throw new RangeError("expected valid "+e+": "+n+" <= n < "+s+", got "+t)}function eQ(e){if(e<Hg)throw new Error("expected non-negative bigint, got "+e);return e===Hg?0:e.toString(2).length}const tQ=e=>(c5(e,"n"),(mw<<BigInt(e))-mw);function Pg(e,t={},n={},s="object"){yd(e,s),yd(t,"fields"),yd(n,"optFields");function i(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 r=(a,l)=>Object.entries(a).forEach(([c,u])=>i(c,u,l));r(t,!1),r(n,!0)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rs=BigInt(0),on=BigInt(1),lc=BigInt(2),Tz=BigInt(3),Bb=BigInt(4),zz=BigInt(5),nQ=BigInt(7),Nz=BigInt(8),sQ=BigInt(9),iQ=BigInt(15),_z=BigInt(16),rQ=BigInt("0x10000000000000000");function rn(e,t){if(t<=rs)throw new Error("mod: expected positive modulus, got "+t);const n=e%t;return n>=rs?n:t+n}function oQ(e,t,n){if(n<=on)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<rs)throw new Error("invalid exponent, negatives unsupported");if(t===rs)return on;if(t===on)return e;let s=e%n;if(s<rs&&(s+=n),t<rQ){let l=on;for(;t>rs;)t&on&&(l=l*s%n),s=s*s%n,t>>=on;return l}const i=[];for(;t>rs;)i.push(Number(t&iQ)),t>>=Bb;const r=new Array(16);r[0]=on,r[1]=s;for(let l=2;l<16;l++)r[l]=r[l-1]*s%n;let a=r[i[i.length-1]];for(let l=i.length-2;l>=0;l--){a=a*a%n,a=a*a%n,a=a*a%n,a=a*a%n;const c=i[l];c!==0&&(a=a*r[c]%n)}return a}function ur(e,t,n){if(n<=on)throw new Error("pow2: expected modulus > 1, got "+n);if(t<rs)throw new Error("pow2: expected non-negative exponent, got "+t);let s=e;for(;t-- >rs;)s*=s,s%=n;return s}function vw(e,t){if(e===rs)throw new Error("invert: expected non-zero number");if(t<=on)throw new Error("invert: expected modulus > 1, got "+t);let n=rn(e,t),s=t,i=rs,r=on;for(;n!==rs;){const l=s/n,c=s-n*l,u=i-r*l;s=n,n=c,i=r,r=u}if(s!==on)throw new Error("invert: does not exist");return rn(i,t)}function Hb(e,t,n){const s=e;if(!s.eql(s.sqr(t),n))throw new Error("Cannot find square root")}function qb(e,t){if((e&on)===rs)throw new Error(t+": expected odd modulus, got "+e)}function Rz(e,t){const n=e,s=(n.ORDER+on)/Bb,i=n.pow(t,s);return Hb(n,i,t),i}function aQ(e,t){const n=e,s=(n.ORDER-zz)/Nz,i=n.mul(t,lc),r=n.pow(i,s),a=n.mul(t,r),l=n.mul(n.mul(a,lc),r),c=n.mul(a,n.sub(l,n.ONE));return Hb(n,c,t),c}function lQ(e){const t=Pb(e),n=Iz(e),s=n(t,t.neg(t.ONE)),i=n(t,s),r=n(t,t.neg(s)),a=(e+nQ)/_z;return(l,c)=>{const u=l;let d=u.pow(c,a),f=u.mul(d,s);const p=u.mul(d,i),x=u.mul(d,r),g=u.eql(u.sqr(f),c),y=u.eql(u.sqr(p),c);d=u.cmov(d,f,g),f=u.cmov(x,p,y);const v=u.eql(u.sqr(f),c),m=u.cmov(d,f,v);return Hb(u,m,c),m}}function Iz(e){if(e<Tz)throw new Error("sqrt is not defined for small field");qb(e,"tonelliShanks");let t=e-on,n=0;for(;t%lc===rs;)t/=lc,n++;let s=lc;const i=Pb(e);for(;Ug(i,s)===1;)if(s++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Rz;let r=i.pow(s,t);const a=(t+on)/lc;return function(c,u){const d=c;if(d.is0(u))return u;if(Ug(d,u)!==1)throw new Error("Cannot find square root");let f=n,p=d.mul(d.ONE,r),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 y=1,v=d.sqr(x);for(;!d.eql(v,d.ONE);)if(y++,v=d.sqr(v),y===f)throw new Error("Cannot find square root");const m=on<<BigInt(f-y-1),k=d.pow(p,m);f=y,p=d.sqr(k),x=d.mul(x,p),g=d.mul(g,k)}return g}}function cQ(e){return qb(e,"Fp.sqrt"),e%Bb===Tz?Rz:e%Nz===zz?aQ:e%_z===sQ?lQ(e):Iz(e)}const uQ=(e,t)=>(rn(e,t)&on)===on,dQ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function S1(e){if(yd(e,"field"),typeof e.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof e.ORDER);c5(e.BYTES,"BYTES"),c5(e.BITS,"BITS");for(const t of dQ)Kh(e[t],"field."+t);if(e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=on)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function Lz(e,t,n=!1){S1(e),bz(t,"nums"),i2(n,"passZero");const s=e,i=new Array(t.length).fill(n?s.ZERO:void 0),r=t.reduce((l,c,u)=>s.is0(c)?l:(i[u]=l,s.mul(l,c)),s.ONE),a=s.inv(r);return t.reduceRight((l,c,u)=>s.is0(c)?l:(i[u]=s.mul(l,i[u]),s.mul(l,c)),a),i}function Ug(e,t){S1(e);const n=e;qb(n.ORDER,"FpLegendre");const s=(n.ORDER-on)/lc,i=n.pow(t,s),r=n.eql(i,n.ONE),a=n.eql(i,n.ZERO),l=n.eql(i,n.neg(n.ONE));if(!r&&!a&&!l)throw new Error("invalid Legendre symbol result");return r?1:a?0:-1}function fQ(e,t){if(t!==void 0&&wz(t),e<=rs)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=eQ(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,i=Math.ceil(s/8);return{nBitLength:s,nByteLength:i}}const yw=new WeakMap;class kw{constructor(t,n={}){ve(this,"ORDER");ve(this,"BITS");ve(this,"BYTES");ve(this,"isLE");ve(this,"ZERO",rs);ve(this,"ONE",on);ve(this,"_lengths");ve(this,"_mod");if(t<=on)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:i,nByteLength:r}=fQ(t,s);if(r>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=i,this.BYTES=r,Object.freeze(this)}create(t){return rn(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof t);return rs<=t&&t<this.ORDER}is0(t){return t===rs}isValidNot0(t){return!this.is0(t)&&this.isValid(t)}isOdd(t){return(t&on)===on}neg(t){return rn(-t,this.ORDER)}eql(t,n){return t===n}sqr(t){return rn(t*t,this.ORDER)}add(t,n){return rn(t+n,this.ORDER)}sub(t,n){return rn(t-n,this.ORDER)}mul(t,n){return rn(t*n,this.ORDER)}pow(t,n){return oQ(t,n,this.ORDER)}div(t,n){return rn(t*vw(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 vw(t,this.ORDER)}sqrt(t){let n=yw.get(this);return n||yw.set(this,n=cQ(this.ORDER)),n(this,t)}toBytes(t){return this.isLE?Az(t,this.BYTES):$z(t,this.BYTES)}fromBytes(t,n=!1){vd(t);const{_lengths:s,BYTES:i,isLE:r,ORDER:a,_mod:l}=this;if(s){if(t.length<1||!s.includes(t.length)||t.length>i)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+t.length);const u=new Uint8Array(i);u.set(t,r?0:u.length-t.length),t=u}if(t.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);let c=r?qg(t):Ez(t);if(l&&(c=rn(c,a)),!n&&!this.isValid(c))throw new Error("invalid field element: outside of range 0..ORDER");return c}invertBatch(t){return Lz(this,t,!0)}cmov(t,n,s){return i2(s,"condition"),s?n:t}}function Pb(e,t={}){return Object.freeze(kw.prototype),new kw(e,t)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ub=BigInt(0),C1=BigInt(1),hQ=BigInt(4),Gv=16,bw=128,pQ=5,ww=2**31;function Fb(e){const t=e;if(typeof t!="function")throw new TypeError('"Point" expected constructor, got type='+typeof e);Kh(t.fromAffine,"Point.fromAffine"),Kh(t.fromBytes,"Point.fromBytes"),Kh(t.fromHex,"Point.fromHex"),yd(t.BASE,"Point.BASE"),yd(t.ZERO,"Point.ZERO"),S1(t.Fp),S1(t.Fn)}function xQ(e,t){Fb(e),Oz(t,e);const n=Lz(e.Fp,t.map(s=>s.Z));return t.map((s,i)=>e.fromAffine(s.toAffine(n[i])))}function gQ(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 mQ(e,t){const n=e*(4*t+128);if(n>ww)throw new Error("invalid window size: table would need ~"+Math.ceil(n/2**20)+" MiB, max "+ww/2**20+" MiB")}function vQ(e,t){if(e!==void 0){Kh(e,"randomBytes");try{const n=e(t);if(!jz(n)||n.length!==t)return}catch{return}return e}}function Oz(e,t){bz(e,"points"),e.forEach((n,s)=>{if(!(n instanceof t))throw new Error("invalid point at index "+s)})}function yQ(e,t,n){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((s,i)=>{if(!(n===void 0?t.isValid(s):Oc(s)&&s<n))throw new Error("invalid scalar at index "+i)})}const Dz=new WeakMap;function Wv(e){return Dz.get(e)||1}function kQ(e,t){const n=e.double(),s=[e];for(let i=1;i<t;i++)s.push(s[i-1].add(n));return s}function bQ(e,t){const n=2**t,s=n/2,i=BigInt(n-1),r=[];for(;e>Ub;){let a=0;e&C1&&(a=Number(e&i),a>=s&&(a-=n),e-=BigInt(a)),r.push(a),e>>=C1}return r}function wQ(e,t,n){const s=2**t,i=s/2,r=BigInt(s-1),a=BigInt(t),l=[];for(let c=0;c<n;c++){let u=Number(e&r);e>>=a,u>i&&(u-=s,e+=C1),l.push(u)}if(e!==Ub)throw new Error("invalid wnaf");return l}function jQ(e,t,n){let s=0;for(const r of n)s=Math.max(s,r.length);let i=e;for(let r=s-1;r>=0;r--){r!==s-1&&(i=i.double());for(let a=0;a<n.length;a++){const l=n[a][r];if(l){const c=t[a][Math.abs(l)-1>>1];i=i.add(l<0?c.negate():c)}}}return i}class SQ{constructor(t,n){ve(this,"Point");ve(this,"BASE");ve(this,"ZERO");ve(this,"randomBytes");ve(this,"wnafPrecomputes",new WeakMap);ve(this,"baseCanBeBlinded");ve(this,"bits");Fb(t),this.randomBytes=vQ(n,Gv),this.Point=t,this.BASE=t.BASE,this.ZERO=t.ZERO,this.bits=t.Fn.BITS}buildWnafTable(t,n,s){const i=Math.ceil(s/n)+1,r=2**(n-1),a=[];let l=t;for(let c=0;c<i;c++){let u=l;for(let d=0;d<r;d++)a.push(u),u=u.add(l);l=a[a.length-1].double()}return{W:n,bits:s,windows:i,comp:a}}wnafCachedCT(t,n){const{W:s,windows:i,comp:r}=t,a=2**(s-1),l=wQ(n,s,i);let c=this.ZERO,u=this.BASE;for(let d=0;d<i;d++){const f=l[d],p=d*a,x=Math.abs(f)-1;let g=r[p];for(let v=1;v<a;v++)g=v===x?r[p+v]:g;const y=g.negate();f===0?u=u.add(r[p]):c=c.add(f<0?y:g)}return{p:c,f:u}}getWnafPrecomputes(t,n,s,i){let r=this.wnafPrecomputes.get(n),a=r==null?void 0:r.find(l=>l.W===t&&l.bits===s);return a||(a=this.buildWnafTable(n,t,s),typeof i=="function"&&(a={...a,comp:i(a.comp)}),r||(r=[],this.wnafPrecomputes.set(n,r)),r.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),!Mz(n,C1,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(t,n,s,i){const r=Wv(t);return r===1?this.fixedWindowCT(t,n,s):this.wnafCachedCT(this.getWnafPrecomputes(r,t,s,i),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 i=this.Point.Fn.BITS+bw,r=this.randomBytes(Gv);if(!jz(r)||r.length!==Gv)throw new Error("randomBytes returned invalid byte array");r[0]=r[0]&63|128;const a=n+Ez(r)*this.Point.Fn.ORDER;return this.runCT(t,a,i,s)}fixedWindowCT(t,n,s){const i=pQ,r=1<<i,a=tQ(i),l=new Array(r);l[0]=this.ZERO;for(let d=1;d<r;d++)l[d]=l[d-1].add(t);const c=Math.ceil(s/i);let u=this.ZERO;for(let d=c-1;d>=0;d--){if(d!==c-1)for(let x=0;x<i;x++)u=u.double();const f=Number(n>>BigInt(d*i)&a);let p=l[0];for(let x=1;x<r;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===C1?!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,i){return this.shouldBlind(t,s)?this.mulCTBlinded(t,n,i):this.mulCT(t,n,i)}mulUnsafe(t,n,s){if(this.assertPoint(t),!Oc(n))throw new Error("invalid scalar");const i=Wv(t);if(i===1||n>=this.Point.Fn.ORDER)return CQ(this.Point,[t],[n],!0);const r=this.getWnafPrecomputes(i,t,this.bits,s);return this.wnafCachedCT(r,n).p}setWindowSize(t,n){this.assertPoint(t),gQ(n,this.bits);const s=Math.ceil((this.bits+bw)/n)+1;mQ(s*2**(n-1),this.Point.Fp.BYTES),Dz.set(t,n),this.wnafPrecomputes.delete(t)}hasWindowSize(t){return Wv(t)!==1}}function CQ(e,t,n,s=!1){if(Fb(e),Oz(t,e),i2(s,"allowOversized"),yQ(n,e.Fn,s?e.Fn.ORDER**hQ:void 0),t.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.map(a=>kQ(a,4)),r=n.map(a=>bQ(a,4));return jQ(e.ZERO,i,r)}function jw(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return S1(t),t}else return Pb(e,{isLE:n})}function EQ(e,t,n={},s){if(s===void 0&&(s=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);Pg(n);for(const c of["p","n","h"]){const u=t[c];if(!(Oc(u)&&u!==Ub))throw new Error(`CURVE.${c} must be positive bigint`)}const i=jw(t.p,n.Fp,s),r=jw(t.n,n.Fn,s),l=["Gx","Gy","a","d"];for(const c of l)if(!i.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:i,Fn:r}}function $Q(e,t){return function(s){const i=e(s);return{secretKey:i,publicKey:t(i)}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const jp=BigInt(0),Sp=BigInt(1),Cp=BigInt(2),AQ=BigInt(4),Sw=BigInt(8);function MQ(e,t,n,s){const i=e.sqr(n),r=e.sqr(s),a=e.add(e.mul(t.a,i),r),l=e.add(e.ONE,e.mul(t.d,e.mul(i,r)));return e.eql(a,l)}function TQ(e,t={}){Pg(t,{},{},"extraOpts");const n=t,s=EQ("edwards",e,n,n.FpFnLE),{Fp:i,Fn:r}=s;let a=s.CURVE;const{h:l}=a;if(Ug(i,a.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(Ug(i,a.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");Pg(n,{},{uvRatio:"function",randomBytes:"function"});const c=n.randomBytes===void 0?Sz:n.randomBytes,u=Cp<<BigInt(i.BYTES*8)-Sp;function d(w){if(!i.isOdd)throw new Error("Field does not have .isOdd()");return i.isOdd(w)}const f=n.uvRatio===void 0?(w,S)=>{try{return{isValid:!0,value:i.sqrt(i.div(w,S))}}catch{return{isValid:!1,value:jp}}}:n.uvRatio;if(!MQ(i,a,a.Gx,a.Gy))throw new Error("bad curve params: generator point");const p=i.eql(a.a,i.neg(i.ONE))?w=>i.neg(w):i.eql(a.a,i.ONE)?w=>w:w=>i.mul(a.a,w);function x(w,S,E=!1){const A=E?Sp:jp;return Xh("coordinate "+w,S,A,u),S}function g(w){if(!(w instanceof y))throw new Error("EdwardsPoint expected")}const k=class k{constructor(S,E,A,z){ve(this,"X");ve(this,"Y");ve(this,"Z");ve(this,"T");this.X=x("x",S),this.Y=x("y",E),this.Z=x("z",A,!0),this.T=x("t",z),Object.freeze(this)}static CURVE(){return a}static fromAffine(S){if(S instanceof k)throw new Error("extended point not allowed");const{x:E,y:A}=S||{};return x("x",E),x("y",A),new k(E,A,i.ONE,i.mul(E,A))}static fromBytes(S,E=!1){const A=i.BYTES,{a:z,d:N}=a;S=j1(vd(S,A,"point")),i2(E,"zip215");const M=j1(S),$=S[A-1];M[A-1]=$&-129;const R=qg(M),_=E?u:i.ORDER;Xh("point.y",R,jp,_);const T=i.sqr(R),O=i.sub(T,i.ONE),H=i.sub(i.mulN(N,T),z);let{isValid:L,value:B}=f(O,H);if(!L)throw new Error("bad point: invalid y coordinate");const I=d(B),D=($&128)!==0;if(!E&&i.is0(B)&&D)throw new Error("bad point: x=0 and x_0=1");return D!==I&&(B=i.neg(B)),k.fromAffine({x:B,y:R})}static fromHex(S,E=!1){return k.fromBytes(YY(S),E)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(S=6,E=!0){return m.setWindowSize(this,S),E||this.multiply(Cp),this}assertValidity(){const S=this,{a:E,d:A}=a;if(S.is0())throw new Error("bad point: ZERO");const{X:z,Y:N,Z:M,T:$}=S,R=i.sqr(z),_=i.sqr(N),T=i.sqr(M),O=i.sqr(T),H=i.mul(R,E),L=i.mul(i.add(H,_),T),B=i.add(O,i.mul(A,i.mul(R,_)));if(!i.eql(L,B))throw new Error("bad point: equation left != right (1)");const I=i.mul(z,N),D=i.mul(M,$);if(!i.eql(I,D))throw new Error("bad point: equation left != right (2)")}equals(S){g(S);const{X:E,Y:A,Z:z}=this,{X:N,Y:M,Z:$}=S,R=i.mul(E,$),_=i.mul(N,z),T=i.mul(A,$),O=i.mul(M,z);return i.eql(R,_)&&i.eql(T,O)}is0(){return this.equals(k.ZERO)}negate(){return new k(i.neg(this.X),this.Y,this.Z,i.neg(this.T))}double(){const{X:S,Y:E,Z:A}=this,z=i.sqr(S),N=i.sqr(E),M=i.mul(i.sqr(A),Cp),$=p(z),R=i.addN(S,E),_=i.sub(i.subN(i.sqr(R),z),N),T=i.addN($,N),O=i.subN(T,M),H=i.subN($,N),L=i.mul(_,O),B=i.mul(T,H),I=i.mul(_,H),D=i.mul(O,T);return new k(L,B,D,I)}add(S){g(S);const{d:E}=a,{X:A,Y:z,Z:N,T:M}=this,{X:$,Y:R,Z:_,T}=S,O=i.mul(A,$),H=i.mul(z,R),L=i.mul(i.mulN(M,E),T),B=i.mul(N,_),I=i.sub(i.subN(i.mulN(i.addN(A,z),i.addN($,R)),O),H),D=i.subN(B,L),q=i.addN(B,L),U=i.sub(H,p(O)),X=i.mul(I,D),Z=i.mul(q,U),ne=i.mul(I,U),Y=i.mul(D,q);return new k(X,Z,Y,ne)}subtract(S){return g(S),this.add(S.negate())}multiply(S){if(!r.isValidNot0(S))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:E,f:A}=m.mulSecret(this,S,l,v);return v([E,A])[0]}multiplyUnsafe(S){if(!r.isValid(S))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return S===jp?k.ZERO:this.is0()||S===Sp?this:m.mulUnsafe(this,S,v)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return m.mulUnsafe(this,a.n).is0()}toAffine(S){const E=this;let A=S;if(A!=null&&typeof A!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof A);const{X:z,Y:N,Z:M}=E,$=E.is0();A==null&&(A=$?i.create(Sw):i.inv(M));const R=i.mul(z,A),_=i.mul(N,A),T=i.mul(M,A);if($)return{x:i.ZERO,y:i.ONE};if(!i.eql(T,i.ONE))throw new Error("invZ was invalid");return{x:R,y:_}}clearCofactor(){return l===Sp?this:l===Cp?this.double():l===AQ?this.double().double():l===Sw?this.double().double().double():this.multiplyUnsafe(l)}toBytes(){const{x:S,y:E}=this.toAffine(),A=i.toBytes(E);return A[A.length-1]|=d(S)?128:0,A}toHex(){return ZY(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}};ve(k,"BASE",new k(a.Gx,a.Gy,i.ONE,i.mul(a.Gx,a.Gy))),ve(k,"ZERO",new k(i.ZERO,i.ONE,i.ONE,i.ZERO)),ve(k,"Fp",i),ve(k,"Fn",r);let y=k;const v=w=>xQ(y,w),m=new SQ(y,c);return m.bits>=6&&y.BASE.precompute(6),Object.freeze(y.prototype),Object.freeze(y),y}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rl=BigInt(0),Ii=BigInt(1),Ep=BigInt(2);function Cw(e,t){return e+t-(t>>Ii<<Ii)}function zQ(e){const t=BigInt(6)*e;return(n,s,i)=>{const r=s+i,l=((t+i-s)*n+s)%e;return{x_2:l,x_3:r-l}}}function NQ(e){return Pg(e,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function",scalarMultBase:"function"}),Object.freeze({...e})}function _Q(e){const t=NQ(e),{P:n,type:s,adjustScalarBytes:i,powPminus2:r,randomBytes:a}=t,l=t.scalarMultBase,c=s==="x25519";if(!c&&s!=="x448")throw new Error("invalid type");const u=a===void 0?Sz:a,d=c?255:448,f=zQ(n),p=c?32:56,x=BigInt(c?9:5),g=BigInt(c?121665:39081),y=c?Ep**BigInt(254):Ep**BigInt(447),v=c?BigInt(8)*(Ep**BigInt(251)-Ii):BigInt(4)*(Ep**BigInt(445)-Ii),m=y+v+Ii,k=L=>rn(L,n),w=S(x);function S(L){return Az(k(L),p)}function E(L){const B=j1(vd(L,p,"uCoordinate"));return c&&(B[31]&=127),k(qg(B))}function A(L){return qg(i(j1(vd(L,p,"scalar"))))}const z=new Set(c?[Rl,Ii,n-Ii,BigInt("325606250916557431795983626356110631294008115727848805560023387167927233504"),BigInt("39382357235489614581723060781553021112529911719440698176882885853963445705823")]:[Rl,Ii,n-Ii]);function N(L,B){const I=E(B);if(z.has(I))throw new Error("invalid private or public key received");const D=_(I,A(L));if(D===Rl)throw new Error("invalid private or public key received");return S(D)}function M(L){if(l===void 0)return N(L,w);const B=A(L);Xh("scalar",B,y,m);const I=k(l(B));if(I===Rl)throw new Error("invalid private or public key received");return S(I)}const $=M,R=N;function _(L,B){Xh("u",L,Rl,n),Xh("scalar",B,y,m);const I=B,D=L;let q=Ii,U=Rl,X=L,Z=Ii;const ne=I^I>>Ii;for(let le=BigInt(d-1);le>=Rl;le--){const re=Cw(n,ne>>le);({x_2:q,x_3:X}=f(re,q,X)),{x_2:U,x_3:Z}=f(re,U,Z);const ge=q+U,be=k(ge*ge),me=q-U,je=k(me*me),we=be-je,ye=X+Z,J=X-Z,Se=k(J*ge),ke=k(ye*me),Ce=Se+ke,Ee=Se-ke;X=k(Ce*Ce),Z=k(D*k(Ee*Ee)),q=k(be*je),U=k(we*(be+k(g*we)))}const Y=Cw(n,I);({x_2:q,x_3:X}=f(Y,q,X)),{x_2:U,x_3:Z}=f(Y,U,Z);const ae=r(U);return k(q*ae)}const T={secretKey:p,publicKey:p,seed:p},O=L=>(L=L===void 0?u(p):L,vd(L,T.seed,"seed"),L),H={randomSecretKey:O};return Object.freeze(T),Object.freeze(H),Object.freeze({keygen:$Q(O,$),getSharedSecret:R,getPublicKey:$,scalarMult:N,scalarMultBase:M,utils:H,GuBytes:w.slice(),lengths:T})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ew=BigInt(0),RQ=BigInt(1),$w=BigInt(2),IQ=BigInt(3),LQ=BigInt(5),OQ=BigInt(8),r2=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),DQ={p:r2,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:OQ,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Bz(e){const t=BigInt(10),n=BigInt(20),s=BigInt(40),i=BigInt(80),r=r2,l=e*e%r*e%r,c=ur(l,$w,r)*l%r,u=ur(c,RQ,r)*e%r,d=ur(u,LQ,r)*u%r,f=ur(d,t,r)*d%r,p=ur(f,n,r)*f%r,x=ur(p,s,r)*p%r,g=ur(x,i,r)*x%r,y=ur(g,i,r)*x%r,v=ur(y,t,r)*d%r;return{pow_p_5_8:ur(v,$w,r)*e%r,b2:l}}function BQ(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const Aw=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function HQ(e,t){const n=r2,s=rn(t*t*t,n),i=rn(s*s*t,n),r=Bz(e*i).pow_p_5_8;let a=rn(e*s*r,n);const l=rn(t*a*a,n),c=a,u=rn(a*Aw,n),d=l===e,f=l===rn(-e,n),p=l===rn(-e*Aw,n);return d&&(a=c),(f||p)&&(a=u),uQ(a,n)&&(a=rn(-a,n)),{isValid:d||f,value:a}}const Mw=TQ(DQ,{uvRatio:HQ}),Vb=(()=>{const e=r2,t=n=>{const{pow_p_5_8:s,b2:i}=Bz(n);return rn(ur(s,IQ,e)*i,e)};return _Q({P:e,type:"x25519",powPminus2:t,adjustScalarBytes:BQ,scalarMultBase:n=>{const s=rn(n,Mw.Fn.ORDER);if(s===Ew)return Ew;const i=Mw.BASE.multiply(s);return rn((i.Z+i.Y)*t(rn(i.Z-i.Y,e)),e)}})})(),qQ=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 xa(e,t,n,s,i){return e=e+t+i|0,s=Bg(s^e,16),n=n+s|0,t=Bg(t^n,12),{a:e,b:t,c:n,d:s}}function ga(e,t,n,s,i){return e=e+t+i|0,s=Bg(s^e,8),n=n+s|0,t=Bg(t^n,7),{a:e,b:t,c:n,d:s}}function PQ(e,t={},n,s,i){if(ta(n),e<=0||e>n)throw new Error('"dkLen" must be 1..'+n+", got "+e);const{key:r,salt:a,personalization:l}=t;if(r!==void 0&&(r.length<1||r.length>n))throw new Error('"key" expected to be undefined or of length=1..'+n);a!==void 0&&Yi(a,s,"salt"),l!==void 0&&Yi(l,i,"personalization")}class UQ{constructor(t,n){ve(this,"buffer");ve(this,"buffer32");ve(this,"finished",!1);ve(this,"destroyed",!1);ve(this,"length",0);ve(this,"pos",0);ve(this,"blockLen");ve(this,"outputLen");ve(this,"canXOF",!1);ta(t),ta(n),this.blockLen=t,this.outputLen=n,this.buffer=new Uint8Array(t),this.buffer32=Dg(this.buffer)}update(t){Og(this),Yi(t);const{blockLen:n,buffer:s,buffer32:i}=this,r=t.length,a=t.byteOffset,l=t.buffer;for(let c=0;c<r;){this.pos===n&&(Cu(i),this.compress(i,0,!1),Cu(i),this.pos=0);const u=Math.min(n-this.pos,r-c),d=a+c;if(u===n&&!(d%4)&&c+u<r){const f=new Uint32Array(l,d,Math.floor((r-c)/4));Cu(f);for(let p=0;c+n<r;p+=i.length,c+=n)this.length+=n,this.compress(f,p,!1);Cu(f);continue}s.set(c===0&&u===r?t:t.subarray(c,c+u),this.pos),this.pos+=u,this.length+=u,c+=u}return this}digestInto(t){if(Og(this),xz(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),Cu(s),this.compress(s,0,!0),Cu(s);const i=this.get(),r=t===this.buffer?s:Dg(t),a=Math.floor(this.outputLen/4);for(let d=0;d<a;d++)r[d]=mh(i[d]);const l=this.outputLen%4;if(!l)return;const c=a*4,u=i[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:i,destroyed:r,outputLen:a,pos:l}=this;return t||(t=new this.constructor({dkLen:a})),t.set(...this.get()),t.buffer.set(n),t.destroyed=r,t.finished=i,t.length=s,t.pos=l,t.outputLen=a,t}clone(){return this._cloneInto()}}function FQ(e,t,n,s,i,r,a,l,c,u,d,f,p,x,g,y,v,m,k,w){let S=0;for(let E=0;E<s;E++)({a:i,b:c,c:p,d:v}=xa(i,c,p,v,n[t+e[S++]])),{a:i,b:c,c:p,d:v}=ga(i,c,p,v,n[t+e[S++]]),{a:r,b:u,c:x,d:m}=xa(r,u,x,m,n[t+e[S++]]),{a:r,b:u,c:x,d:m}=ga(r,u,x,m,n[t+e[S++]]),{a,b:d,c:g,d:k}=xa(a,d,g,k,n[t+e[S++]]),{a,b:d,c:g,d:k}=ga(a,d,g,k,n[t+e[S++]]),{a:l,b:f,c:y,d:w}=xa(l,f,y,w,n[t+e[S++]]),{a:l,b:f,c:y,d:w}=ga(l,f,y,w,n[t+e[S++]]),{a:i,b:u,c:g,d:w}=xa(i,u,g,w,n[t+e[S++]]),{a:i,b:u,c:g,d:w}=ga(i,u,g,w,n[t+e[S++]]),{a:r,b:d,c:y,d:v}=xa(r,d,y,v,n[t+e[S++]]),{a:r,b:d,c:y,d:v}=ga(r,d,y,v,n[t+e[S++]]),{a,b:f,c:p,d:m}=xa(a,f,p,m,n[t+e[S++]]),{a,b:f,c:p,d:m}=ga(a,f,p,m,n[t+e[S++]]),{a:l,b:c,c:x,d:k}=xa(l,c,x,k,n[t+e[S++]]),{a:l,b:c,c:x,d:k}=ga(l,c,x,k,n[t+e[S++]]);return{v0:i,v1:r,v2:a,v3:l,v4:c,v5:u,v6:d,v7:f,v8:p,v9:x,v10:g,v11:y,v12:v,v13:m,v14:k,v15:w}}const cs=XY.slice();class VQ extends UQ{constructor(n={}){n=kz({},n);const s=n.dkLen===void 0?32:n.dkLen;super(64,s);ve(this,"v0",cs[0]|0);ve(this,"v1",cs[1]|0);ve(this,"v2",cs[2]|0);ve(this,"v3",cs[3]|0);ve(this,"v4",cs[4]|0);ve(this,"v5",cs[5]|0);ve(this,"v6",cs[6]|0);ve(this,"v7",cs[7]|0);PQ(s,n,32,8,8);let{key:i,personalization:r,salt:a}=n,l=0;if(i!==void 0&&(Yi(i,void 0,"key"),l=i.length),this.v0^=this.outputLen|l<<8|65536|1<<24,a!==void 0){Yi(a,void 0,"salt");const c=Dg(pw(a));this.v4^=mh(c[0]),this.v5^=mh(c[1])}if(r!==void 0){Yi(r,void 0,"personalization");const c=Dg(pw(r));this.v6^=mh(c[0]),this.v7^=mh(c[1])}if(i!==void 0){const c=new Uint8Array(this.blockLen);c.set(i),this.update(c),l5(c)}}get(){const{v0:n,v1:s,v2:i,v3:r,v4:a,v5:l,v6:c,v7:u}=this;return[n,s,i,r,a,l,c,u]}set(n,s,i,r,a,l,c,u){this.v0=n|0,this.v1=s|0,this.v2=i|0,this.v3=r|0,this.v4=a|0,this.v5=l|0,this.v6=c|0,this.v7=u|0}compress(n,s,i){const r=PY(this.length),a=qY(this.length),{v0:l,v1:c,v2:u,v3:d,v4:f,v5:p,v6:x,v7:g,v8:y,v9:v,v10:m,v11:k,v12:w,v13:S,v14:E,v15:A}=FQ(qQ,s,n,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,cs[0],cs[1],cs[2],cs[3],r^cs[4],a^cs[5],i?~cs[6]:cs[6],cs[7]);this.v0^=l^y,this.v1^=c^v,this.v2^=u^m,this.v3^=d^k,this.v4^=f^w,this.v5^=p^S,this.v6^=x^E,this.v7^=g^A}destroy(){this.destroyed=!0,l5(this.buffer32),this.set(0,0,0,0,0,0,0,0)}}const ax=WY(e=>new VQ(e));class Tw{constructor(t,n){ve(this,"oHash");ve(this,"iHash");ve(this,"blockLen");ve(this,"outputLen");ve(this,"canXOF",!1);ve(this,"finished",!1);ve(this,"destroyed",!1);if(UY(t),Yi(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,i=new Uint8Array(s);i.set(n.length>s?t.create().update(n).digest():n);for(let r=0;r<i.length;r++)i[r]^=54;this.iHash.update(i),this.oHash=t.create();for(let r=0;r<i.length;r++)i[r]^=106;this.oHash.update(i),l5(i)}update(t){return Og(this),this.iHash.update(t),this}digestInto(t){Og(this),xz(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:i,destroyed:r,blockLen:a,outputLen:l,canXOF:c}=this;return t=t,t.finished=i,t.destroyed=r,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 Kv=(()=>{const e=(t,n,s)=>new Tw(t,n).update(s).digest();return e.create=(t,n)=>new Tw(t,n),e})(),GQ=new TextEncoder().encode("Noise_IK_25519_ChaChaPoly_BLAKE2s"),Ro=32,zw=65535,WQ=2n**64n-1n,Nw=e=>ax(e,{dkLen:Ro}),Fg=(...e)=>{const t=new Uint8Array(e.reduce((s,i)=>s+i.length,0));let n=0;for(const s of e)t.set(s,n),n+=s.length;return t};function _w(e,t,n){const s=Kv(ax,e,t),i=Kv(ax,s,new Uint8Array([1])),r=Kv(ax,s,Fg(i,new Uint8Array([2])));return[i,r]}function Gb(){return lf(Vb.utils.randomSecretKey())}function lf(e){if(e.length!==Ro)throw new Error(`X25519 private key must be ${Ro} bytes`);return{publicKey:Vb.getPublicKey(e),privateKey:e}}const Vg=(e,t)=>Vb.getSharedSecret(e.privateKey,t);var jd,fc,_1,u5;class Xv{constructor(){oe(this,_1);oe(this,jd);oe(this,fc,0n)}setKey(t){V(this,jd,t),V(this,fc,0n)}encrypt(t,n=new Uint8Array(0)){const s=j(this,jd);return s===void 0?t:hw(s,C(this,_1,u5).call(this),n).encrypt(t)}decrypt(t,n=new Uint8Array(0)){const s=j(this,jd);return s===void 0?t:hw(s,C(this,_1,u5).call(this),n).decrypt(t)}}jd=new WeakMap,fc=new WeakMap,_1=new WeakSet,u5=function(){if(j(this,fc)===WQ)throw new Error("nonce exhausted");const t=new Uint8Array(12);return new DataView(t.buffer).setBigUint64(4,j(this,fc),!0),V(this,fc,j(this,fc)+1n),t};var hc,Or;class KQ{constructor(){oe(this,hc);oe(this,Or);ve(this,"cipher",new Xv);const t=GQ;V(this,Or,t.length<=Ro?Fg(t,new Uint8Array(Ro-t.length)):Nw(t)),V(this,hc,j(this,Or).slice())}mixKey(t){const[n,s]=_w(j(this,hc),t);V(this,hc,n),this.cipher.setKey(s.subarray(0,Ro))}mixHash(t){V(this,Or,Nw(Fg(j(this,Or),t)))}encryptAndHash(t){const n=this.cipher.encrypt(t,j(this,Or));return this.mixHash(n),n}decryptAndHash(t){const n=this.cipher.decrypt(t,j(this,Or));return this.mixHash(t),n}get handshakeHash(){return j(this,Or)}split(){const[t,n]=_w(j(this,hc),new Uint8Array(0)),s=new Xv;s.setKey(t.subarray(0,Ro));const i=new Xv;return i.setKey(n.subarray(0,Ro)),[s,i]}}hc=new WeakMap,Or=new WeakMap;function Hz(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 XQ(e,t,n,s){t.push(n.ephemeral.publicKey),e.mixHash(n.ephemeral.publicKey),e.mixKey(Vg(n.ephemeral,s)),t.push(e.encryptAndHash(n.static.publicKey)),e.mixKey(Vg(n.static,s))}function ZQ(e,t,n){const s=Hz(t,Ro).slice();return e.mixHash(s),e.mixKey(Vg(n.ephemeral,s)),e.mixKey(Vg(n.static,s)),s}const Rw=(e,t)=>{if(e.length>zw)throw new Error(`${t} exceeds ${zw} bytes`)};function YQ(e,t){const n=new KQ;return n.mixHash(e),n.mixHash(t),n}function qz(e){const t=e.ephemeral??Gb(),n=YQ(e.prologue,e.remoteStatic);return{writeMessage1(s){const i=[];XQ(n,i,{static:e.static,ephemeral:t},e.remoteStatic),i.push(n.encryptAndHash(s));const r=Fg(...i);return Rw(r,"handshake message"),r},readMessage2(s){Rw(s,"handshake message");const i={buffer:s,offset:0};ZQ(n,i,{ephemeral:t,static:e.static});const r=n.decryptAndHash(Hz(i,s.length-i.offset)),[a,l]=n.split();return{payload:r,result:{send:a,receive:l,handshakeHash:n.handshakeHash}}}}}const Pz=new TextEncoder().encode("pinomad/1"),QQ=new TextEncoder().encode("pinomad-signal/1"),Uz=new TextEncoder,Fz=new TextDecoder("utf-8",{fatal:!0}),Vz=e=>Uz.encode(JSON.stringify(e));function JQ(e){try{return JSON.parse(Fz.decode(e))}catch{throw new Error("handshake payload is not JSON")}}function Gz(e){const t=JQ(e);if((t==null?void 0:t.v)!==1)throw new Error("unsupported host hello");return{v:1}}const vh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Ho(e){let t="";for(let n=0;n<e.length;n+=3){const s=e[n],i=e[n+1],r=e[n+2];t+=vh[s>>2]+vh[(s&3)<<4|(i??0)>>4],i!==void 0&&(t+=vh[(i&15)<<2|(r??0)>>6]),r!==void 0&&(t+=vh[r&63])}return t}function ao(e){if(e.length%4===1)throw new Error("invalid base64url");const t=new Map(Array.from(vh,(s,i)=>[s,i])),n=[];for(let s=0;s<e.length;s+=4){const r=[...e.slice(s,s+4)].map(l=>{const c=t.get(l);if(c===void 0)throw new Error("invalid base64url");return c}),a=r.reduce((l,c,u)=>l|c<<18-u*6,0);n.push(a>>16&255),r.length>2&&n.push(a>>8&255),r.length>3&&n.push(a&255)}return new Uint8Array(n)}const $p=65518;var R1,I1,Sd;class Wz{constructor(t){oe(this,R1);oe(this,I1);oe(this,Sd,[]);V(this,R1,t.send),V(this,I1,t.receive)}seal(t){const n=Uz.encode(t),s=[];for(let i=0;i<=n.length;i+=$p){const r=i+$p>=n.length,a=new Uint8Array(1+Math.min($p,n.length-i));if(a[0]=r?0:1,a.set(n.subarray(i,i+$p),1),s.push(j(this,R1).encrypt(a)),r)break}return s}open(t){const n=j(this,I1).decrypt(t),s=n[0];if(s!==0&&s!==1)throw new Error("bad record flag");if(j(this,Sd).push(n.subarray(1)),s===1)return;const i=eJ(j(this,Sd));return V(this,Sd,[]),Fz.decode(i)}}R1=new WeakMap,I1=new WeakMap,Sd=new WeakMap;function eJ(e){const t=new Uint8Array(e.reduce((s,i)=>s+i.length,0));let n=0;for(const s of e)t.set(s,n),n+=s.length;return t}function d5(e){let t=e.pairing;return{label:e.url,open(n){const s=new WebSocket(e.url);s.binaryType="arraybuffer";const i=qz({prologue:e.prologue??Pz,static:e.device,remoteStatic:e.hostKey});let r,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(i.writeMessage1(Vz(f)))},s.onmessage=f=>{var p,x;try{const g=f.data instanceof ArrayBuffer?new Uint8Array(f.data):new Uint8Array(f.data);if(r===void 0){const{payload:y,result:v}=i.readMessage2(g);Gz(y),r=new Wz(v),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 w of r.seal(k))s.send(w)}else{const y=r.open(g);y!==void 0&&n.message(y)}}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(r===void 0){a.push(f);return}for(const p of r.seal(f))s.send(p)},close(){s.close()}}}}}const f5=e=>{if(typeof e!="string")return!1;try{return ao(e).length===32}catch{return!1}},tJ=e=>{if(typeof e!="string")return!1;try{const t=new URL(e).protocol;return t==="ws:"||t==="wss:"}catch{return!1}},nJ=e=>{if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.serverOrigin=="string"&&t.serverOrigin!==""&&f5(t.hostId)};function Kz(e){if(typeof e!="object"||e===null)return;const t=e;if(!tJ(t.url)||!f5(t.hostKey)||!f5(t.privateKey))return;const n=nJ(t.account)?t.account:void 0,s=typeof t.name=="string"&&t.name!==""?t.name:void 0,i=s2(t.endpointSet),r=lY(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},...i.kind==="valid"?{endpointSet:i.endpointSet}:{},...r===void 0?{}:{connectionMode:r},...a===void 0?{}:{rtcSignalOnly:a}}}function Zh(e,t){const n=t.endpointSet??e.endpointSet,s=t.connectionMode??e.connectionMode,i=t.rtcSignalOnly??e.rtcSignalOnly,r=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}:{},...r===void 0?{}:{account:r},...n===void 0?{}:{endpointSet:n},...s===void 0?{}:{connectionMode:s},...i===void 0?{}:{rtcSignalOnly:i}}}function Xz(e,t){return{...e,endpointSet:t,url:Ob(e.url,t)}}function Zz(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 b0(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),i=new Map;for(const l of n)i.set(l,(i.get(l)??0)+1);n.forEach((l,c)=>{i.get(l)>1&&(s[c]=6)});const r=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(r(f));p===void 0?l.set(r(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,r(c))),a}function o2(){typeof Notification>"u"||Notification.permission!=="default"||Notification.requestPermission()}const sJ=100*1024*1024,iJ=4,Iu=(e,t)=>`${t}:${e}`,Iw=(e,t,n)=>`${e??""}\0${Iu(t,n)}`;var L1,Ss,za,pc,Na,Dr,Wo,h5,lx;class rJ{constructor(t=sJ){oe(this,Wo);oe(this,L1);oe(this,Ss,new Map);oe(this,za,new Map);oe(this,pc,[]);oe(this,Na,0);oe(this,Dr,new Map);V(this,L1,t)}peek(t,n="original"){const s=j(this,Ss).get(Iu(t,n));return s!==void 0||n==="original"?s:j(this,Ss).get(Iu(t,"original"))}get(t,n="original"){let s=Iu(t,n);!j(this,Ss).has(s)&&n!=="original"&&(s=Iu(t,"original"));const i=j(this,Ss).get(s);if(i!==void 0)return j(this,Ss).delete(s),j(this,Ss).set(s,i),i}prime(t,n,s="original"){const i=Iu(t,s),r=j(this,Ss).get(i);for(r!==void 0&&V(this,Na,j(this,Na)-r.data.length),j(this,Ss).delete(i),j(this,Ss).set(i,n),V(this,Na,j(this,Na)+n.data.length);j(this,Na)>j(this,L1);){const a=j(this,Ss).keys().next().value;if(a===void 0)break;const l=j(this,Ss).get(a);j(this,Ss).delete(a),V(this,Na,j(this,Na)-l.data.length)}}load(t,n,s="original",i){const r=this.get(t,s);if(r!==void 0)return Promise.resolve(r);const a=i??"",l=Iw(i,t,s),c=j(this,za).get(l)??(s==="original"?void 0:j(this,za).get(Iw(i,t,"original")));if(c!==void 0)return c;const u=new Promise((d,f)=>{j(this,pc).push({key:l,source:a,ref:t,variant:s,loader:n,resolve:d,reject:f})});return j(this,za).set(l,u),C(this,Wo,h5).call(this),u}clear(){j(this,Ss).clear(),j(this,za).clear(),j(this,pc).length=0,V(this,Na,0),j(this,Dr).clear()}}L1=new WeakMap,Ss=new WeakMap,za=new WeakMap,pc=new WeakMap,Na=new WeakMap,Dr=new WeakMap,Wo=new WeakSet,h5=function(){for(;;){const t=j(this,pc).findIndex(i=>(j(this,Dr).get(i.source)??0)<iJ);if(t===-1)return;const[n]=j(this,pc).splice(t,1);if(n===void 0)return;j(this,Dr).set(n.source,(j(this,Dr).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(i){C(this,Wo,lx).call(this,n),n.reject(i instanceof Error?i:new Error(String(i)));continue}s.then(i=>{this.prime(n.ref,i,i.variant??"original"),C(this,Wo,lx).call(this,n),n.resolve(i)},i=>{C(this,Wo,lx).call(this,n),n.reject(i instanceof Error?i:new Error(String(i)))})}},lx=function(t){j(this,za).delete(t.key);const n=(j(this,Dr).get(t.source)??1)-1;n<=0?j(this,Dr).delete(t.source):j(this,Dr).set(t.source,n),C(this,Wo,h5).call(this)};const Ma=new rJ;async function oJ(e,t,n){return"data"in e?e:Ma.load(e.ref,t,"original",n)}async function Yz(e){await Promise.all(e.map(async t=>{if("data"in t)try{Ma.prime(await FZ(t),t)}catch{}}))}const kd=e=>`data:${e.mimeType};base64,${e.data}`,Qz=h.createContext(void 0);function aJ({load:e,retryKey:t=0,source:n,children:s}){const i=h.useMemo(()=>({load:e,retryKey:t,...n===void 0?{}:{source:n}}),[e,t,n]);return o.jsx(Qz.Provider,{value:i,children:s})}function lJ(e){var a;const[t,n]=h.useState(0),s=h.useRef(e.connection),i=h.useRef(void 0),r=h.useRef(void 0);return h.useEffect(()=>{if(e.connection==="connected"&&s.current!=="connected"){const l=i.current;l!==void 0&&(l.main!==void 0||l.side!==void 0)?r.current={...l}:r.current=void 0}e.connection!=="connected"&&(r.current=void 0),s.current=e.connection},[e.connection]),h.useEffect(()=>{var c,u;if(e.connection!=="connected")return;const l=r.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&&(r.current=void 0),n(f=>f+1)}r.current===void 0&&(i.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 Wb(e,t,n="original",s=0){const i=h.useContext(Qz),r=e!==void 0&&"ref"in e?e.ref:void 0,a=r===void 0?void 0:`${(i==null?void 0:i.source)??""}:${n}:${r}`,[l,c]=h.useState(void 0),u=(i==null?void 0:i.retryKey)??0,d=i==null?void 0:i.load,f=i==null?void 0:i.source;if(h.useEffect(()=>{if(r===void 0||a===void 0)return;const g=Ma.get(r,n);if(g!==void 0){c({key:a,image:g});return}if(!t||d===void 0)return;let y=!1;return c(void 0),(n==="original"?Ma.load(r,d,"original",f):Ma.load(r,d,n,f).catch(()=>Ma.load(r,d,"original",f))).then(m=>{y||c({key:a,image:m})},()=>{y||c({key:a,failed:!0})}),()=>{y=!0}},[r,a,t,u,d,f,n,s]),e===void 0)return{status:"loading"};if("data"in e)return{status:"ready",src:kd(e)};const p=(l==null?void 0:l.key)===a?l:void 0;if(p!==void 0)return"image"in p?{status:"ready",src:kd(p.image)}:{status:"error"};if(r===void 0)return{status:"loading"};const x=Ma.peek(r,n);return x!==void 0?{status:"ready",src:kd(x)}:{status:"loading"}}function Jz(){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 i=new IntersectionObserver(r=>{r.some(a=>a.isIntersecting)&&(s(!0),i.disconnect())},{rootMargin:"100% 0px"});return i.observe(e),()=>i.disconnect()},[e]),[t,n]}function Lw(e,t="original"){if("data"in e)return kd(e);const n=Ma.peek(e.ref,t);return n===void 0?void 0:kd(n)}const cJ=e=>{const t=[],n=s=>{t.push(s.summary);for(const i of s.children)n(i)};for(const s of[...e.chats,...e.projects.flatMap(i=>i.conversations)])n(s);return t};function uJ(e,t){const n=[],s=[],i=new Map;for(const r of cJ(t)){if(i.set(r.id,r.status),e===void 0)continue;const a=e.get(r.id);if(a!==r.status&&s.push(r.id),r.status==="needs-answer"&&a!=="needs-answer"){n.push({id:r.id,title:Xc(r),body:"Waiting for your answer"});continue}(a==="running"||a==="needs-answer")&&(r.status===void 0||r.status==="failed")&&r.kind!=="subagent"&&n.push({id:r.id,title:Xc(r),body:r.status==="failed"?"Failed":"Finished"})}if(e!==void 0)for(const r of e.keys())i.has(r)||s.push(r);return{notices:n,changed:s,baseline:i}}function eN(e,t,n,s,i=!0){const r=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(!i||e.connection!=="connected")return;const{notices:c,changed:u,baseline:d}=uJ(r.current,e.organized);r.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)}}},[i,t,n,e.connection,e.organized])}function tN(e){const[t,n]=h.useState(),s=h.useRef(0),i=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]),r=h.useCallback(()=>{s.current++,n(void 0)},[]);return{opening:t,open:i,cancel:r}}const dJ="92px";function fJ(e){var n;return(typeof document>"u"||(n=document.documentElement)==null?void 0:n.dataset.pinomadPlatform)==="darwin"?"darwin":"other"}function Kb(e=fJ()){return e==="darwin"?{platform:e,reserveMacTrafficLights:!0,safeLeft:dJ}:{platform:e,reserveMacTrafficLights:!1,safeLeft:"0px"}}const hJ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},nN=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n,absoluteStrokeWidth:s=!1,className:i="",altIcon:r,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"}:{},y={ref:p,...hJ,width:t,height:t,color:c||e,className:i,...g,...f},m=[...a&&r?r:l].sort(([,k],[,w])=>{const S=k.opacity!==void 0;return w.opacity!==void 0?1:S?-1:0}).map(([k,w])=>{const S=w.opacity!==void 0,E=S&&!d?w.opacity:void 0,A=u?{...w.stroke!==void 0?{stroke:S?u:c||e}:{fill:S?u:c||e}}:{};return h.createElement(k,{...w,...g,...A,opacity:E,key:w.key})});return h.createElement("svg",y,m)});nN.displayName="HugeiconsIcon";const pJ=[["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"}]],xJ=[["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"}]],gJ=[["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"}]],mJ=[["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"}]],vJ=[["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"}]],yJ=[["path",{d:"M9 21H15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.9351 5.27643L17.3928 7.99539C19.335 10.1441 20.3061 11.2184 19.9143 12.1092C19.5225 13 18.0788 13 15.1915 13H15V14C15 15.4142 15 16.1213 14.5607 16.5607C14.1213 17 13.4142 17 12 17C10.5858 17 9.87868 17 9.43934 16.5607C9 16.1213 9 15.4142 9 14V13H8.80852C5.92117 13 4.47749 13 4.08568 12.1092C3.69387 11.2184 4.66499 10.1441 6.60724 7.99538L9.06495 5.27642C10.4367 3.75881 11.1226 3 12 3C12.8774 3 13.5633 3.75881 14.9351 5.27643Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],kJ=[["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"}]],bJ=[["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"}]],wJ=[["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"}]],jJ=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],SJ=[["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"}]],CJ=[["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"}]],EJ=[["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"}]],$J=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],AJ=[["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"}]],MJ=[["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"}]],TJ=[["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"}]],zJ=[["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"}]],NJ=[["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"}]],_J=[["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"}]],RJ=[["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"}]],IJ=[["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"}]],LJ=[["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"}]],OJ=[["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"}]],DJ=[["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"}]],BJ=[["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"}]],HJ=[["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"}]],qJ=[["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"}]],PJ=[["path",{d:"M8.5 19.5V20M9.5 20C9.5 20.5523 9.05228 21 8.5 21C7.94772 21 7.5 20.5523 7.5 20C7.5 19.4477 7.94772 19 8.5 19C9.05228 19 9.5 19.4477 9.5 20Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5 19.5V20M16.5 20C16.5 20.5523 16.0523 21 15.5 21C14.9477 21 14.5 20.5523 14.5 20C14.5 19.4477 14.9477 19 15.5 19C16.0523 19 16.5 19.4477 16.5 20Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M8.5 3.5V4M9.5 4C9.5 4.55228 9.05228 5 8.5 5C7.94772 5 7.5 4.55228 7.5 4C7.5 3.44772 7.94772 3 8.5 3C9.05228 3 9.5 3.44772 9.5 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M8.5 11.5V12M9.5 12C9.5 12.5523 9.05228 13 8.5 13C7.94772 13 7.5 12.5523 7.5 12C7.5 11.4477 7.94772 11 8.5 11C9.05228 11 9.5 11.4477 9.5 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M15.5 3.5V4M16.5 4C16.5 4.55228 16.0523 5 15.5 5C14.9477 5 14.5 4.55228 14.5 4C14.5 3.44772 14.9477 3 15.5 3C16.0523 3 16.5 3.44772 16.5 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M15.5 11.5V12M16.5 12C16.5 12.5523 16.0523 13 15.5 13C14.9477 13 14.5 12.5523 14.5 12C14.5 11.4477 14.9477 11 15.5 11C16.0523 11 16.5 11.4477 16.5 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}]],UJ=[["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"}]],FJ=[["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"}]],VJ=[["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"}]],GJ=[["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"}]],WJ=[["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"}]],KJ=[["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"}]],XJ=[["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"}]],ZJ=[["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"}]],YJ=[["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"}]],QJ=[["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"}]],JJ=[["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"}]],eee=[["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"}]],tee=[["path",{d:"M3.99963 5.00055L9.99963 5.00031",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12.9996 5.00031L19.9996 5.00031",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.9996 9.00031L15.9996 15.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M9.99963 2.00031L9.99963 8.00031",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M11.9996 16.0003L11.9996 22.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M15.9996 12.0001L19.9996 12.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M3.99963 12.0005L12.9996 12.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M11.9996 19.0003L19.9996 19.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}],["path",{d:"M3.99963 19.0005L8.99963 19.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"8"}]],nee=[["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"}]],see=[["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"}]],iee=[["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"}]],ree=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],oee=[["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"}]],aee=1.75;function Ge(e){return function(n){return o.jsx(nN,{color:"currentColor",icon:e,strokeWidth:aee,...n})}}const lee=Ge(xJ),cee=Ge(gJ),sN=Ge(mJ),uee=Ge(vJ),Ow=Ge(yJ),fu=Ge(kJ),w0=Ge(QJ),dee=Ge(bJ),j0=Ge(jJ),Dw=Ge(SJ),p5=Ge(wJ),tr=Ge(EJ),Ea=Ge(ree),iN=Ge(CJ),fee=Ge($J),a2=Ge(AJ),Gg=Ge(MJ),Xb=Ge(TJ),Nf=Ge(NJ),rN=Ge(_J),hee=Ge(RJ),pee=Ge(OJ),E1=Ge(IJ),xee=Ge(DJ),gee=Ge(LJ),oN=Ge(BJ),Bw=Ge(HJ),mee=Ge(PJ),vee=Ge(qJ),yee=Ge(UJ),Zb=Ge(FJ),kee=Ge(VJ),aN=Ge(GJ),bee=Ge(WJ),lN=Ge(KJ),S0=Ge(XJ),Yb=Ge(ZJ),cf=Ge(pJ),C0=Ge(YJ),wee=Ge(JJ),jee=Ge(eee),See=Ge(tee),l2=Ge(nee),Cee=Ge(see),Eee=Ge(iee),cN=Ge(zJ),uN=Ge(oee);function Qb(e,t){return function({size:s=24,isAnimated:i=!0,className:r,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(!i||!u||!d)return;let f=d.matches(":hover");const p=y=>{y.relatedTarget instanceof Node&&!y.relatedTarget.isConnected&&(f=!0)},x=y=>{f||y.pointerType!=="mouse"||y.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")}},[i]),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 ${r??""}`.trim(),"data-icon-motion":i?e:void 0,...l,children:t})}}const $ee=Qb("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"})]})),dN=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"})]}),Wg=Qb("sidebar",dN),Aee=Qb("sidebar",o.jsx("g",{transform:"translate(24 0) scale(-1 1)",children:dN}));function Jb(){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 i=!0;e.status().then(a=>{i&&n(a)});const r=e.onStatus(a=>{i&&n(a)});return()=>{i=!1,r()}},[e]),!(e===void 0||t===void 0))return{status:t,check:()=>void e.check(),install:()=>void e.install()}}function Mee(e,t){const n=t!=="/"&&(e===t||e.startsWith(`${t}/`)),s=n?t:"/",i=[{label:n?"~":"/",path:s}];let r=s==="/"?"":s;for(const a of e.slice(s.length).split("/"))a!==""&&(r=`${r}/${a}`,i.push({label:a,path:r}));return i}function Hw(e){if(e==="/")return;const t=e.lastIndexOf("/");return t===0?"/":e.slice(0,t)}const Zv=e=>e instanceof Error?e.message:String(e),x5=e=>`add-project-folder-${e}`;function Tee(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 zee({remote:e,connected:t,onAdded:n,onClose:s}){const[i,r]=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 y=h.useRef(new Set),v=h.useRef(void 0),m=h.useRef(null),k=h.useCallback(B=>{y.current.has(B)||(y.current.add(B),l(I=>({...I,[B]:{status:"loading"}})),e.controller.listFolders(B).then(I=>{g.current&&l(D=>({...D,[B]:{status:"ok",folders:I.folders}}))},I=>{y.current.delete(B),g.current&&l(D=>({...D,[B]:{status:"error",message:Zv(I)}}))}))},[e]),w=h.useCallback(()=>{r({status:"loading"}),e.controller.listFolders().then(B=>{g.current&&(y.current.add(B.path),l(I=>({...I,[B.path]:{status:"ok",folders:B.folders}})),r({status:"ok",home:B.home}),u(B.path))},B=>{g.current&&r({status:"error",message:Zv(B)})})},[e]);h.useEffect(()=>w(),[w]),h.useEffect(()=>{const B=v.current;if(B===void 0||B!==c)return;const I=a[B];I===void 0||I.status==="loading"||(v.current=void 0,I.status==="ok"&&I.folders.length>0&&u(I.folders[0].path))},[a,c]),h.useEffect(()=>{if(i.status!=="ok"||!window.matchMedia("(pointer: fine)").matches)return;const B=requestAnimationFrame(()=>{var I;return(I=m.current)==null?void 0:I.focus()});return()=>cancelAnimationFrame(B)},[i.status]),h.useLayoutEffect(()=>{var I;const B=m.current;B===null||c===void 0||(B.scrollLeft=B.scrollWidth,(I=document.getElementById(x5(c)))==null||I.scrollIntoView({block:"nearest",inline:"nearest"}))},[c]);const S=i.status==="ok"?i.home:void 0,E=c===void 0||S===void 0?[]:Mee(c,S),A=E.map(B=>B.path),z=A[0],N=z===void 0||z==="/"?E:[{label:"/",path:"/"},...E],M=A.join("\0");h.useEffect(()=>{for(const B of M.split("\0"))B!==""&&k(B)},[M,k]);const $=B=>{d||(v.current=void 0,x(void 0),u(B))},R=B=>{const I=B===void 0?void 0:a[B];return(I==null?void 0:I.status)==="ok"?I.folders:void 0},_=c===void 0?void 0:c===z?z:Hw(c),T=Tee(B=>{var D;const I=(D=R(_))==null?void 0:D.find(q=>q.name.toLowerCase().startsWith(B));I!==void 0&&$(I.path)}),O=()=>{c!==void 0&&(f(!0),x(void 0),e.controller.addProject(c).then(B=>{g.current&&n(B)},B=>{g.current&&(f(!1),x(Zv(B)))}))},H=B=>{if(B.target!==B.currentTarget||c===void 0||d)return;const I=R(_)??[],D=I.findIndex(q=>q.path===c);switch(B.key){case"ArrowDown":I.length>0&&$(I[Math.min(D+1,I.length-1)].path);break;case"ArrowUp":D>0&&$(I[D-1].path);break;case"Home":I.length>0&&$(I[0].path);break;case"End":I.length>0&&$(I.at(-1).path);break;case"ArrowRight":{const q=R(c);q===void 0?v.current=c:q.length>0&&$(q[0].path);break}case"ArrowLeft":{const q=Hw(c);q!==void 0&&$(q);break}case"Enter":t&&O();break;default:if(!T(B))return}B.preventDefault()},L=B=>{var I;$(B),(I=m.current)==null||I.focus()};return o.jsx(os,{isOpen:!0,onOpenChange:B=>B?void 0:s(),purpose:"form",width:"min(780px, calc(100vw - 32px))",children:o.jsx(Wn,{header:o.jsx(Ts,{title:"Add project",subtitle:"Choose a folder on the host.",onOpenChange:()=>s()}),content:o.jsx(Kn,{children:i.status!=="ok"?o.jsx("div",{className:"flex h-[24rem] items-center justify-center",children:i.status==="loading"?o.jsx(Tt,{"aria-label":"Loading folders"}):o.jsxs(te,{gap:2,hAlign:"center",children:[o.jsx(W,{type:"supporting",children:i.message}),o.jsx(K,{label:"Try again",variant:"secondary",onClick:w})]})}):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===z?void 0:x5(c),onKeyDown:H,className:"group flex h-[22rem] overflow-x-auto overflow-y-hidden outline-none",children:A.map((B,I)=>o.jsx(Nee,{path:B,label:E[I].label,listing:a[B],next:A[I+1],selected:c,disabled:d,onPick:L,onRetry:()=>k(B)},B))}),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:N.map((B,I)=>{const D=I===N.length-1;return o.jsxs("span",{className:`flex min-w-0 items-center gap-0.5 ${D?"shrink-0":""}`,children:[I===0?null:o.jsx(tr,{"aria-hidden":"true",className:"size-3 shrink-0 opacity-60"}),o.jsx("button",{type:"button",disabled:d,"aria-current":D?"location":void 0,onClick:()=>L(B.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)] ${D?"text-[var(--color-text-primary)]":""}`,children:B.label})]},B.path)})})]})}),footer:o.jsx(jr,{children:o.jsxs(pe,{gap:2,vAlign:"center",hAlign:"between",children:[o.jsx("div",{className:"min-w-0 flex-1",children:p!==void 0?o.jsx(W,{type:"supporting",role:"alert",maxLines:1,style:{color:"var(--danger)"},children:p}):o.jsx("div",{className:"hidden pointer-fine:block",children:o.jsx(W,{type:"supporting",maxLines:1,children:"Arrow keys to browse, Enter to add"})})}),o.jsxs(pe,{gap:2,hAlign:"end",children:[o.jsx(K,{label:"Cancel",variant:"secondary",onClick:s}),o.jsx(K,{label:d?"Adding…":"Add project",variant:"primary",isDisabled:!t||c===void 0||d,onClick:O})]})]})})})})}function Nee({path:e,label:t,listing:n,next:s,selected:i,disabled:r,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(Tt,{"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(W,{type:"supporting",children:n.message}),o.jsx(K,{label:"Try again",size:"sm",variant:"secondary",isDisabled:r,onClick:l})]}):n.folders.length===0?o.jsx("div",{className:"flex flex-1 items-center justify-center",children:o.jsx(W,{type:"supporting",children:"No subfolders"})}):n.folders.map(u=>{const d=u.path===i;return o.jsxs("div",{id:x5(u.path),role:"option","aria-selected":d,"aria-disabled":r||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(E1,{"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(tr,{"aria-hidden":"true",className:"size-3 shrink-0 opacity-50"})]},u.path)})})}function _ee({project:e,remote:t,connected:n,onClose:s}){const i=()=>{t.controller.removeProject(e.path),s()};return o.jsx(os,{isOpen:!0,onOpenChange:r=>r?void 0:s(),purpose:"form",width:480,children:o.jsx(Wn,{header:o.jsx(Ts,{title:`Remove project ${e.name}?`,subtitle:"The directory and its conversations are kept; only the registration is removed.",onOpenChange:()=>s()}),content:o.jsx(Kn,{}),footer:o.jsx(jr,{children:o.jsxs(pe,{gap:2,hAlign:"end",children:[o.jsx(K,{label:"Cancel",variant:"secondary",onClick:s}),o.jsx(K,{label:"Remove project",variant:"primary",isDisabled:!n,onClick:i})]})})})})}function Ree({summary:e,remote:t,connected:n,onClose:s}){const i=Xc(e),[r,a]=h.useState(i),[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=r.trim(),x=()=>{p===""||p===i||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(os,{isOpen:!0,onOpenChange:g=>g?void 0:s(),purpose:"form",width:480,children:o.jsx(Wn,{header:o.jsx(Ts,{title:"Rename conversation",onOpenChange:()=>s()}),content:o.jsxs(Kn,{children:[o.jsx(pt,{ref:f,label:"Title",value:r,onChange:a,onEnter:x,hasAutoFocus:!0,isDisabled:l}),u===void 0?null:o.jsx(W,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:u})]}),footer:o.jsx(jr,{children:o.jsxs(pe,{gap:2,hAlign:"end",children:[o.jsx(K,{label:"Cancel",variant:"secondary",onClick:s}),o.jsx(K,{label:"Save",variant:"primary",isDisabled:!n||l||p===""||p===i,onClick:x})]})})})})}function e6(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(ao(n).length!==32||ao(s).length===0)return}catch{return}return{hostKey:n,secret:s}}function fN(e){const t=e.getAll("endpointSet");if(t.length>1)return!1;if(t.length===0)return;const n=hY(t[0]);if(n.kind==="malformed")return!1;if(n.kind==="valid")return n.endpointSet.endpoints.length===0?!1:n.endpointSet}function Iee(e){let t;try{t=new URL(e.trim())}catch{return}const n=new URLSearchParams(t.hash.replace(/^#/,"")),s=n.get("pair"),i=s===null?void 0:e6(s);if(i===void 0)return;let r=n.get("url");if(r===null||r==="")if(t.protocol==="http:")r=`ws://${t.host}/`;else if(t.protocol==="https:")r=`wss://${t.host}/`;else return;else try{const l=new URL(r).protocol;if(l!=="ws:"&&l!=="wss:")return}catch{return}const a=fN(n);if(a!==!1)return{hostKey:i.hostKey,secret:i.secret,url:r,...a===void 0?{}:{endpointSet:a}}}function hN(e){const t=Iee(e);if(t===void 0)return;const n=t.endpointSet===void 0?"":`&endpointSet=${fz(t.endpointSet)}`;return`pair=${t.hostKey}.${t.secret}&url=${encodeURIComponent(t.url)}${n}`}const pN=(e,t)=>fetch(e,t),ut=e=>({ok:!0,value:e}),qt=(e,t)=>({ok:!1,error:{code:e,...t===void 0?{}:{status:t}}}),qw=e=>{const t=e.filter(r=>r.outcome!=="unsupported"),n=t.length>0&&t.every(r=>r.outcome==="rejected"),s=r=>t.some(a=>a.outcome===r);return{ok:!1,error:{code:n?"pair_rejected":s("timeout")?"pair_timeout":s("unreachable")?"pair_unreachable":e.some(r=>r.outcome==="unsupported")?"pair_unsupported":"pair_unreachable",...e.length===0?{}:{candidates:e}}}},th=e=>e.code==="unauthenticated";async function Lee(e,t=pN){const n=new AbortController,s=setTimeout(()=>n.abort(),5e3);try{const i=await t(`${e.replace(/\/+$/,"")}/api/me`,{signal:n.signal,redirect:"manual"});if(i.status===401)return"enabled";if(i.status===200){const r=await i.text();let a;try{a=JSON.parse(r)}catch{return"disabled"}return typeof(a==null?void 0:a.user)=="object"&&a.user!==null?"enabled":"disabled"}return i.status===404?"disabled":"unreachable"}catch{return"unreachable"}finally{clearTimeout(s)}}function xN(e){let t;try{t=new URL(e)}catch{return!1}const n=t.hostname,s=/^127(?:\.\d{1,3}){3}$/.test(n),i=n==="localhost"||n.endsWith(".localhost")||s||n==="::1"||n==="[::1]";return t.protocol==="https:"||t.protocol==="http:"&&i}function kn(e){try{return new URL(e).origin}catch{return e.replace(/\/+$/,"")}}const Il=e=>typeof e=="string"?{password:e}:{reauth:e.reauth},Pw=e=>"reauth"in e?{reauth:e.reauth}:{password:e.password},Nn=e=>typeof e=="object"&&e!==null,Uw=e=>Nn(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,g5=e=>{if(!(!Nn(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}},Fw=e=>{if(!(!Nn(e)||typeof e.redirect!="string"))try{const t=new URL(e.redirect);return t.protocol==="pinomad:"&&t.host==="auth"&&(t.pathname===""||t.pathname==="/")||g5(e)!==void 0?e.redirect:void 0}catch{return}},Yv=e=>{if(!Nn(e)||!Nn(e.user)||typeof e.user.username!="string")return;const{username:t,email:n}=e.user;return{user:{username:t,...typeof n=="string"?{email:n}:{}},...e.needsEmail===!0?{needsEmail:!0}:{}}},Oee=new Set(["registered","revoking","revoked"]),Dee=e=>Nn(e)&&typeof e.hostId=="string"&&typeof e.name=="string"&&typeof e.state=="string"&&Oee.has(e.state),Bee=e=>Nn(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(Dee),nh=e=>e===void 0?{}:{device:{id:e.id,...e.name===void 0?{}:{name:e.name}}};function sh(e){const t=e.fetch??pN,n=kn(e.origin),s=e.credentials.mode==="bearer"?e.credentials.token:void 0,i={redirect:"manual",...e.credentials.mode==="cookie"?{credentials:"same-origin"}:{}},r=async(u,d,f)=>{let p;try{p=await t(`${n}${u}`,{...i,method:d,headers:{...s===void 0?{}:{authorization:`Bearer ${s}`},...f===void 0?{}:{"content-type":"application/json"}},...f===void 0?{}:{body:JSON.stringify(f)}})}catch{return qt("network")}if(p.status===0)return qt("network");const x=await p.json().catch(()=>{});if(p.status>=200&&p.status<300)return ut(x);const g=Nn(x)&&typeof x.error=="string"?x.error:p.status===401?"unauthenticated":"unknown";return{...qt(g,p.status),body:x}},a=async(u,d,f)=>{const p=await r(u,d,f);return p.ok?p:{ok:!1,error:p.error}},l=u=>u.ok?ut(void 0):u,c=u=>{if(!u.ok)return u;const d=Yv(u.value);if(d===void 0||!Nn(u.value)||typeof u.value.expiresAt!="number")return qt("invalid_response");const f=u.value.token;return ut({...d,expiresAt:u.value.expiresAt,...typeof f=="string"?{token:f}:{}})};return{origin:n,login:async(u,d,f)=>c(await a("/api/login","POST",{username:u,password:d,...nh(f)})),authMethods:async()=>{const u=await a("/api/auth/methods","GET");if(!u.ok)return u;const d=u.value;return!Nn(d)||typeof d.registration!="boolean"||typeof d.email!="boolean"||!Array.isArray(d.providers)||!d.providers.every(f=>typeof f=="string")?qt("invalid_response"):ut({registration:d.registration,email:d.email,providers:d.providers})},requestSignupCode:async u=>{const d=await a("/api/register/code","POST",{email:u});return d.ok?ut(void 0):d},register:async({email:u,code:d,password:f,device:p})=>c(await a("/api/register","POST",{email:u,code:d,password:f,...nh(p)})),requestPasswordReset:async u=>{const d=await a("/api/password/reset/code","POST",{email:u});return d.ok?ut(void 0):d},resetPassword:async({email:u,code:d,password:f})=>{const p=await a("/api/password/reset","POST",{email:u,code:d,password:f});return p.ok?ut(void 0):p},requestEmailCode:async u=>{const d=await a("/api/me/email/code","POST",{email:u.email,...Pw(u)});return d.ok?ut(void 0):d},setEmail:async u=>{const d=await a("/api/me/email","POST",{email:u.email,code:u.code,...Pw(u)});if(!d.ok)return d;const f=Yv(d.value);return f===void 0?qt("invalid_response"):ut(f)},me:async()=>{const u=await a("/api/me","GET");if(!u.ok)return u;const d=Yv(u.value);return d===void 0?qt("invalid_response"):ut(d)},logout:async u=>{const d=await a("/api/logout","POST",(u==null?void 0:u.revoke)===!0?{revoke:!0}:void 0);return d.ok?ut(void 0):d},revokeAllSessions:async()=>{const u=await a("/api/sessions/revoke-all","POST");return u.ok?ut(void 0):u},changePassword:async(u,d)=>{const f=typeof u=="string"?{currentPassword:u}:{reauth:u.reauth};return l(await a("/api/password","POST",{...f,newPassword:d}))},deleteAccount:async u=>l(await a("/api/me/delete","POST",Il(u))),requestReauthCode:async()=>l(await a("/api/reauth/code","POST",{})),reauth:async u=>{const d=await a("/api/reauth","POST",u);if(!d.ok)return d;const f=d.value;return Nn(f)&&typeof f.reauth=="string"&&typeof f.expiresAt=="number"?ut({reauth:f.reauth,expiresAt:f.expiresAt}):qt("invalid_response")},identities:async()=>{const u=await a("/api/me/identities","GET");if(!u.ok)return u;const d=u.value;return Nn(d)&&typeof d.hasPassword=="boolean"&&Array.isArray(d.identities)&&d.identities.every(p=>Nn(p)&&typeof p.provider=="string"&&(p.email===void 0||typeof p.email=="string")&&typeof p.createdAt=="number")?ut({hasPassword:d.hasPassword,identities:d.identities.map(p=>({provider:p.provider,...p.email===void 0?{}:{email:p.email},createdAt:p.createdAt}))}):qt("invalid_response")},linkProvider:async(u,d,f)=>{const p=await a(`/api/oauth/${encodeURIComponent(u)}/link`,"POST",{...Il(d),...f===void 0?{}:{client:"native",redirect_uri:f.redirectUri,code_challenge:f.codeChallenge,state:f.state}});if(!p.ok)return p;const x=Nn(p.value)?p.value.url:void 0;return typeof x=="string"&&/^https?:\/\//.test(x)?ut(x):qt("invalid_response")},unlinkProvider:async(u,d)=>l(await a(`/api/me/identities/${encodeURIComponent(u)}/remove`,"POST",Il(d))),pendingSignIn:async u=>{const d=await a(`/api/oauth/pending/${encodeURIComponent(u)}`,"GET");if(!d.ok)return d;const f=d.value;return!Nn(f)||typeof f.provider!="string"||f.email!==void 0&&typeof f.email!="string"||f.name!==void 0&&typeof f.name!="string"?qt("invalid_response"):ut({provider:f.provider,...f.email===void 0?{}:{email:f.email},...f.name===void 0?{}:{name:f.name}})},createFromPending:async(u,d)=>{const f=await a(`/api/oauth/pending/${encodeURIComponent(u)}/create`,"POST",{...(d==null?void 0:d.password)===void 0?{}:{password:d.password},...nh(d==null?void 0:d.device)});if(!f.ok)return f;if(Nn(f.value)&&"redirect"in f.value){const x=Fw(f.value);return x===void 0?qt("invalid_response"):ut({kind:"redirect",url:x})}const p=c(f);return p.ok?ut({kind:"signedIn",session:p.value}):p},linkPending:async(u,d)=>{const f=await a(`/api/oauth/pending/${encodeURIComponent(u)}/link`,"POST",Il(d));if(!f.ok)return f;if(f.value===void 0)return ut(void 0);const p=Fw(f.value);return p===void 0?qt("invalid_response"):ut(p)},exchangeOAuthCode:async(u,d,f)=>c(await a("/api/oauth/token","POST",{code:u,code_verifier:d,...nh(f)})),appleNative:async({identityToken:u,authorizationCode:d,nonce:f,name:p,device:x})=>{const g=await r("/api/oauth/apple/native","POST",{identityToken:u,authorizationCode:d,...f===void 0?{}:{nonce:f},...p===void 0?{}:{name:p},...nh(x)});if(!g.ok){const v="body"in g?g.body:void 0;return g.error.code==="no_account"&&Nn(v)&&typeof v.pending=="string"?ut({kind:"noAccount",pending:v.pending,...typeof v.email=="string"?{email:v.email}:{}}):{ok:!1,error:g.error}}const y=c(g);return y.ok?ut({kind:"signedIn",session:y.value}):y},completeLink:async(u,d)=>l(await a("/api/oauth/link/complete","POST",{code:u,code_verifier:d})),linkAppleNative:async({identityToken:u,authorizationCode:d,nonce:f,name:p},x)=>l(await a("/api/oauth/apple/native","POST",{identityToken:u,authorizationCode:d,...f===void 0?{}:{nonce:f},...p===void 0?{}:{name:p},...Il(x)})),createJoinToken:async()=>{const u=await a("/api/join-tokens","POST");if(!u.ok)return u;const d=u.value;return!Nn(d)||typeof d.token!="string"||typeof d.expiresAt!="number"||typeof d.command!="string"?qt("invalid_response"):ut({token:d.token,expiresAt:d.expiresAt,command:d.command})},lookupHostLink:async u=>{const d=await a("/api/host-link/lookup","POST",{userCode:u});if(!d.ok)return d;const f=Uw(d.value);return f===void 0?qt("invalid_response"):ut(f)},confirmHostLink:async u=>{const d=await a("/api/host-link/confirm","POST",{userCode:u});return d.ok?ut(void 0):d},denyHostLink:async u=>{const d=await a("/api/host-link/deny","POST",{userCode:u});return d.ok?ut(void 0):d},lookupHostLinkRequest:async u=>{const d=await a("/api/host-link/lookup","POST",{requestId:u});if(!d.ok)return d;const f=Uw(d.value);return f===void 0?qt("invalid_response"):ut(f)},confirmHostLinkRequest:async u=>{const d=await a("/api/host-link/confirm","POST",{requestId:u});if(!d.ok)return d;const f=g5(d.value);return f===void 0?qt("invalid_response"):ut(f)},denyHostLinkRequest:async u=>{const d=await a("/api/host-link/deny","POST",{requestId:u});if(!d.ok)return d;const f=g5(d.value);return f===void 0?qt("invalid_response"):ut(f)},listHosts:async()=>{const u=await a("/api/hosts","GET");if(!u.ok)return u;if(!Array.isArray(u.value))return qt("invalid_response");const d=[];for(const f of u.value){if(!Nn(f)||typeof f.hostId!="string"||typeof f.name!="string"||typeof f.noisePublicKey!="string"||typeof f.online!="boolean"||typeof f.lastSeenAt!="number"||f.pairing!=="available"&&f.pairing!=="offline"&&f.pairing!=="host_too_old"&&f.pairing!=="key_mismatch"||f.deviceReports!==void 0&&typeof f.deviceReports!="boolean")return qt("invalid_response");d.push({hostId:f.hostId,name:f.name,noisePublicKey:f.noisePublicKey,online:f.online,lastSeenAt:f.lastSeenAt,pairing:f.pairing,...f.deviceReports===void 0?{}:{deviceReports:f.deviceReports}})}return ut(d)},listDevices:async()=>{const u=await a("/api/devices","GET");return u.ok?!Array.isArray(u.value)||!u.value.every(Bee)?qt("invalid_response"):ut(u.value.map(d=>({id:d.id,...d.name===void 0?{}:{name:d.name},createdAt:d.createdAt,lastSeenAt:d.lastSeenAt,current:d.current,...d.kickedAt===void 0?{}:{kickedAt:d.kickedAt},hosts:d.hosts.map(f=>({hostId:f.hostId,name:f.name,state:f.state}))}))):u},removeHost:async(u,d)=>l(await a(`/api/hosts/${encodeURIComponent(u)}/remove`,"POST",Il(d))),kickDevice:async(u,d)=>l(await a(`/api/devices/${u}/kick`,"POST",Il(d))),requestPairing:async u=>{const d=await a(`/api/hosts/${encodeURIComponent(u)}/pairing`,"POST");if(!d.ok)return d;const f=d.value;if(!Nn(f)||typeof f.url!="string"||typeof f.hostKey!="string"||typeof f.secret!="string"||typeof f.expiresAt!="number")return qt("invalid_response");let p;if(f.endpointSet!==void 0){const x=s2(f.endpointSet);if(x.kind==="malformed")return qt("invalid_response");if(x.kind==="valid"){if(x.endpointSet.endpoints.length===0)return qt("invalid_response");p=x.endpointSet}}return ut({url:f.url,hostKey:f.hostKey,secret:f.secret,expiresAt:f.expiresAt,...p===void 0?{}:{endpointSet:p}})},registerPushToken:async u=>{const d=await a("/api/push-tokens","POST",{apns:u.apns,environment:u.environment});return d.ok?ut(void 0):d},removePushToken:async u=>{const d=await a("/api/push-tokens/remove","POST",{apns:u.apns,environment:u.environment});return d.ok?ut(void 0):d}}}function Hee(e){const t=e.endpointSet===void 0?"":`&endpointSet=${fz(e.endpointSet)}`;return hN(`https://server.invalid/#pair=${e.hostKey}.${e.secret}&url=${encodeURIComponent(e.url)}${t}`)}function Vw(e,t,n,s,i){const r=kn(e),a=new Set(s.map(l=>`${kn(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:i&&p==="unpaired"&&!a.has(`${r}\0${l.hostId}`)}),u=n.filter(p=>p.account!==void 0&&kn(p.account.serverOrigin)===r&&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 gN extends Error{constructor(n){super(n===void 0?"pairing connection closed":`pairing connection closed (${n})`);ve(this,"code");this.name="PairingHandshakeError",n!==void 0&&(this.code=n)}}const qee=e=>{if(e instanceof gN)return e.code===rx?{code:e.code}:void 0;if(typeof e=="object"&&e!==null){const n=e.code;if(n===rx)return{code:n}}const t=e instanceof Error?e.message:String(e);return/\b4401\b/.test(t)?{code:rx}:void 0};function Pee(e){return new Promise((t,n)=>{let s,i=!1;const r=e.signal,a=()=>r==null?void 0:r.removeEventListener("abort",c),l=d=>{i||(i=!0,a(),s==null||s.close(),d===void 0?t():n(d))},c=()=>l(new Error("pairing attempt aborted"));if(r!=null&&r.aborted){l(new Error("pairing attempt aborted"));return}r==null||r.addEventListener("abort",c,{once:!0});const u=d5({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 gN(d))}),i&&s.close()}catch(d){l(d instanceof Error?d:new Error(String(d)))}})}async function Gw(e,t,n,s=Pee,i={}){const r=await e.requestPairing(t);if(!r.ok)return r;const a=Hee(r.value);if(a===void 0)return qt("invalid_offer");const l=new URLSearchParams(a),c=e6(l.get("pair")),u=l.get("url");if(c===void 0||u===null)return qt("invalid_offer");const d=ao(c.hostKey),f=Gb(),p=af(u,r.value.endpointSet,{pageProtocol:i.pageProtocol}),x=p.map(w=>w.unsupported===void 0?void 0:{url:w.url,role:w.role,outcome:"unsupported",reason:w.unsupported}),g=p.filter(w=>w.unsupported===void 0),y=()=>x.filter(w=>w!==void 0);if(g.length===0)return qw(y());const v=i.attemptTimeoutMs??1e4;let m=!1;for(let w=0;w<p.length;w++){const S=p[w];if(S.unsupported!==void 0)continue;const E=new AbortController;let A,z=!1;const N=new Promise(($,R)=>{E.signal.addEventListener("abort",()=>R(new Error("pairing attempt aborted")),{once:!0})}),M=new Promise(($,R)=>{A=setTimeout(()=>{z=!0,E.abort(),R(new Error("pairing attempt timed out"))},v)});try{await Promise.race([s({url:S.url,hostKey:d,device:f,secret:c.secret,name:n,signal:E.signal}),N,M]),m=!0;break}catch($){if(z)x[w]={url:S.url,role:S.role,outcome:"timeout",reason:`no answer within ${v}ms`};else{const R=qee($),_=$ instanceof Error?$.message:String($);x[w]=R===void 0?{url:S.url,role:S.role,outcome:"unreachable",reason:_}:{url:S.url,role:S.role,outcome:"rejected",reason:_,...R.code===void 0?{}:{code:R.code}}}}finally{A!==void 0&&clearTimeout(A),E.abort()}}if(!m)return qw(y());const k=r.value.endpointSet;return ut({url:k===void 0?u:Ob(u,k),hostKey:c.hostKey,privateKey:Ho(f.privateKey),account:{serverOrigin:e.origin,hostId:t,vouched:!0},...k===void 0?{}:{endpointSet:k}})}const Uee="ws://127.0.0.1:7420",Dc="pinomad.device";function t6(e){if(e!==null)try{return Kz(JSON.parse(e))}catch{return}}function Fee(e,t,n,s){const i=new URLSearchParams(e.replace(/^#/,"")),r=i.get("token");if(r!==null&&r!=="")return{kind:"token",url:i.get("url")??Uee,token:r};const a=i.get("pair");if(a!==null){const c=e6(a);if(c===void 0)return;const u=fN(i);return u===!1?void 0:{kind:"pair",url:i.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 Vee(e,t){return new URL(e).host===t.host}function mN(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(i=>i!==void 0).join(" ");return s===""?"Browser":s}async function n6(){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 mN(navigator.userAgent)}const Gee={darwin:"Mac",win32:"Windows",linux:"Linux"};function Wee(e,t){if(t===void 0)return mN(e);const n=Gee[t];return n===void 0?"Desktop":`${n} Desktop`}const vN="pinomad.hosts",Kee=()=>{const e=localStorage.getItem(vN);if(e===null)return[];let t;try{t=JSON.parse(e)}catch{return[]}return Array.isArray(t)?t.flatMap(n=>{const s=Kz(n);return s===void 0?[]:[s]}):[]},Lu=e=>{localStorage.setItem(vN,JSON.stringify(e))};function Eu(){const e=Kee(),t=t6(localStorage.getItem(Dc));if(t===void 0)return e;if(e.some(n=>n.hostKey===t.hostKey))return localStorage.removeItem(Dc),e;try{Lu([...e,t]),localStorage.removeItem(Dc)}catch{}return[...e,t]}const ya={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:Zh(n,e)]),Promise.resolve()},remove:e=>{Lu(Eu().filter(n=>n.hostKey!==e));const t=t6(localStorage.getItem(Dc));return t!==void 0&&t.hostKey===e&&localStorage.removeItem(Dc),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(r=>r.hostKey===e);if(s===-1)return Promise.resolve();const i=[...n];return i[s]=Xz(n[s],t),Lu(i),Promise.resolve()},updateConnection:(e,t)=>{const n=Eu(),s=n.findIndex(r=>r.hostKey===e);if(s===-1)return Promise.resolve();const i=[...n];return i[s]=Zz(n[s],t),Lu(i),Promise.resolve()}};function Xee(e){let t;const n=async()=>{const s=t6(localStorage.getItem(Dc));if(s!==void 0)try{(await e.hosts.list()).some(r=>r.hostKey===s.hostKey)||await e.hosts.save(s),localStorage.removeItem(Dc);return}catch(i){return console.error("Could not migrate the stored device into the desktop host list",i),s}};return{list:async()=>{const s=await(t??(t=n())),i=await e.hosts.list();return s===void 0||i.some(r=>r.hostKey===s.hostKey)?i:[...i,s]},save:s=>e.hosts.save(s),remove:s=>e.hosts.remove(s),setName:(s,i)=>e.hosts.setName(s,i),updateEndpoints:(s,i)=>e.hosts.updateEndpoints(s,i),updateConnection:(s,i)=>e.hosts.updateConnection(s,i)}}function Zee(){const e=window.pinomadDesktop;return e===void 0?ya:Xee(e)}const Yee={store:ya,hosts:[],focus:null,paired:e=>ya.save(e),setName:(e,t)=>ya.setName(e,t),endpoints:(e,t)=>ya.updateEndpoints(e,t),setConnection:(e,t)=>ya.updateConnection(e,t),focusHost:()=>{},focusConversation:()=>{},rememberConversation:()=>{},focusDraft:()=>{},forget:e=>ya.remove(e),dropHost:e=>ya.remove(e)},yN=h.createContext(Yee),Ns=()=>h.useContext(yN);function kN(e,t){const{hosts:n,setName:s}=Ns(),i=t==null?void 0:t.hostName;h.useEffect(()=>{if(e===void 0||i===void 0)return;const r=n.find(a=>a.hostKey===e);r===void 0||r.name===i||s(e,i).catch(a=>console.error("Could not store the host name",a))},[e,i,n,s])}const bN="pinomad.declinedAccountHosts",yh=e=>`${kn(e.serverOrigin)}\0${e.hostId}`,Qee=e=>{let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];const n=new Set,s=[];for(const i of t){if(typeof i!="object"||i===null)continue;const r=i;if(typeof r.serverOrigin!="string"||typeof r.hostId!="string")continue;const a={serverOrigin:kn(r.serverOrigin),hostId:r.hostId},l=yh(a);n.has(l)||(n.add(l),s.push(a))}return s};function Qv(e){const t=e.getItem(bN);return t===null?[]:Qee(t)}function Jee(e=localStorage){const t=new Set,n=()=>{for(const i of t)i()},s=i=>{e.setItem(bN,JSON.stringify(i)),n()};return{list:()=>Qv(e),add:i=>{const r={serverOrigin:kn(i.serverOrigin),hostId:i.hostId},a=Qv(e),l=yh(r);a.some(c=>yh(c)===l)||s([...a,r])},remove:i=>{const r=yh(i),a=Qv(e),l=a.filter(c=>yh(c)!==r);l.length!==a.length&&s(l)},subscribe:i=>(t.add(i),()=>{t.delete(i)})}}const wN=Jee(),m5=new Set;function cx(e){for(const t of m5)t(e)}function ete(e){return m5.add(e),()=>{m5.delete(e)}}const Ww="pinomad.accountDeviceId",tte=/^[A-Za-z0-9_-]{22,64}$/;function nte(e){let t;return()=>{let n;try{n=e();const s=n.getItem(Ww);if(s!==null&&tte.test(s))return s}catch{}t??(t=Ho(crypto.getRandomValues(new Uint8Array(16))));try{n==null||n.setItem(Ww,t)}catch{}return t}}const ste=nte(()=>localStorage),ite={subscribe(e){if(typeof document>"u")return()=>{};const t=()=>{document.visibilityState==="visible"&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},rte=()=>{if(typeof window>"u"||window.BroadcastChannel===void 0)return;const e=new window.BroadcastChannel("pinomad.account");return{post:t=>e.postMessage(t),subscribe:t=>{const n=s=>t(s.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)}}},kt=e=>({ok:!1,error:{code:e}}),jN=5e3,ote=12e4/jN,ate=new Set(["pair_rejected","disabled"]),lte=typeof navigator<"u"&&navigator.locks!==void 0?{request:async(e,t)=>await navigator.locks.request(e,()=>t())}:void 0,Ou=(e,t)=>`${kn(e)}\0${t}`,ih=e=>e.account===void 0?e.hostKey:Ou(e.account.serverOrigin,e.account.hostId);function cte(e){var Mn;const t=new Set;let n={status:"checking"},s,i=e.bridge===void 0?"cookie":"bearer";const r=i==="cookie"?"redirect":((Mn=e.bridge)==null?void 0:Mn.oauthSignIn)!==void 0?"loopback":void 0,a=e.channel??rte();let l,c={};const u=P=>{c={...P.user.email===void 0?{}:{email:P.user.email},...P.needsEmail===!0?{needsEmail:!0}:{}}},d=new Set,f=e.declined??wN,p=e.autoRegister!==!1,x=new Map;let g=0,y=0,v;const m=new Map;let k;const w=new Map,S=new Map,E=(P,F)=>({slot:w.get(F),origin:S.get(kn(P))}),A=(P,F,Q)=>w.get(F)!==Q.slot||S.get(kn(P))!==Q.origin;let z=0;const N=new Map;ete(P=>{for(const[F,Q]of m)P!==void 0&&!F.endsWith(`\0${P}`)||(Q.cancelled=!0,m.delete(F))});const M=P=>{n=P;for(const F of t)F()},$=()=>{n.status==="signed-in"&&M({...n,unsavedHosts:[...x.values()]})},R=P=>{x.set(ih(P),P),$()},_=P=>{x.delete(ih(P))&&$()},T=()=>{k==null||k(),k=void 0},O=()=>{s=void 0,y+=1,c={},g+=1;for(const P of m.values())P.cancelled=!0;m.clear(),x.clear(),T();for(const{timer:P}of N.values())clearTimeout(P);N.clear()},H=()=>M({status:"signed-out",mode:i,...l===void 0?{}:{serverOrigin:l}}),L=()=>{O(),H()},B=(P,F,Q,de)=>({status:"signed-in",mode:i,user:F,...c,serverOrigin:P.origin,hosts:Q,rejectedHostKeys:[...d],unsavedHosts:[...x.values()],...de}),I=(P,F)=>s===P&&F===g,D=async(P,F)=>{var $e;let Q;try{Q=await e.hosts.list()}catch(Ae){return console.error("Could not read the paired hosts to forget them",Ae),{forgotten:!1,hostKeys:[]}}const de=Ae=>{var Ue;return((Ue=Ae.account)==null?void 0:Ue.vouched)===!0&&kn(Ae.account.serverOrigin)===P&&(F===void 0||Ae.account.hostId===F)},fe=Q.filter(de).map(Ae=>Ae.hostKey);for(const Ae of fe)await((($e=e.removeHost)==null?void 0:$e.call(e,Ae))??e.hosts.remove(Ae)).catch(Ue=>console.error("Could not forget a host",Ue));try{return{forgotten:!(await e.hosts.list()).some(de),hostKeys:fe}}catch(Ae){return console.error("Could not check the forgotten hosts",Ae),{forgotten:!1,hostKeys:fe}}},q=async P=>{var F;for(const Q of P)await(((F=e.removeHost)==null?void 0:F.call(e,Q))??e.hosts.remove(Q)).catch(de=>console.error("Could not close a removed host",de))},U=async(P,F)=>{var de;const Q=Ou(P,F);return w.set(Q,(w.get(Q)??0)+1),cx(F),x.delete(Q)&&$(),clearTimeout((de=N.get(F))==null?void 0:de.timer),N.delete(F),D(P,F)},X=async(P,F)=>{const Q=kn(P);S.set(Q,(S.get(Q)??0)+1),cx();let de=!1;for(const[Ae,Ue]of x)Ue.account!==void 0&&kn(Ue.account.serverOrigin)===Q&&(x.delete(Ae),de=!0);de&&$();const{forgotten:fe,hostKeys:$e}=await D(P);return F&&(a==null||a.post({kind:"account-hosts-left",serverOrigin:P,hostKeys:[...$e]})),fe},Z=async P=>{P.kind==="host-removed"?await U(P.serverOrigin,P.hostId):await X(P.serverOrigin,!1),await q(P.hostKeys)};a==null||a.subscribe(P=>{const F=(s==null?void 0:s.origin)??l;F===void 0||kn(F)!==kn(P.serverOrigin)||Z(P).catch(Q=>{console.error("Could not apply an account change from another tab",Q)})});const ne=async()=>(e.name??(()=>"This device"))(),Y=P=>{d.delete(P)&&n.status==="signed-in"&&M({...n,rejectedHostKeys:[...d]})},ae=()=>{k===void 0&&(k=(e.visibility??ite).subscribe(()=>{s!==void 0&&n.status==="signed-in"&&ye(s,n.user)}))},le=P=>P.account!==void 0&&f.list().some(F=>kn(F.serverOrigin)===kn(P.account.serverOrigin)&&F.hostId===P.account.hostId),re=async(P,F)=>{const Q=g;if(s!==P)return!1;if(le(F))return x.delete(ih(F)),$(),!1;const de=ih(F),fe=E(P.origin,de);try{await e.paired(F)}catch{return!1}return F.account!==void 0&&A(P.origin,de,fe)?(await D(P.origin,F.account.hostId),!1):I(P,Q)?(Y(F.hostKey),_(F),!0):!1},ge=async P=>{let F=0;for(const Q of[...x.values()])if(x.get(ih(Q))===Q){if(!await re(P,Q))return F;F+=1}return F},be=(P,F,Q)=>{if(I(P,g)!==!1){if(th(Q)){L();return}ate.has(Q.code)&&f.add({serverOrigin:P.origin,hostId:F})}},me=P=>{var F;return n.status==="signed-in"?(F=n.hosts.find(Q=>Q.host.hostId===P))==null?void 0:F.host.name:void 0},je=(P,F)=>{const Q=me(P);return Q===void 0||Q===""?F:{...F,name:Q}},we=async(P,F,Q,de)=>{if(!p||!de)return;const fe=await ge(P);if(I(P,g)){if(fe>0){await ye(P,F);return}for(const $e of Q){if(!$e.autoRegister)continue;const Ae=Ou(P.origin,$e.host.hostId);if(m.has(Ae))continue;const Ue=g,St=E(P.origin,Ae),He={cancelled:!1,promise:Promise.resolve()},at=async()=>{if(He.cancelled||!I(P,Ue))return;const Le=await e.hosts.list().catch(()=>{});if(Le===void 0||He.cancelled||!I(P,Ue))return;const gt=Vw(P.origin,[$e.host],Le,f.list(),!0)[0];if((gt==null?void 0:gt.autoRegister)!==!0){if((gt==null?void 0:gt.stored)!==void 0){let Ti=!0;await e.paired(gt.stored).catch(oi=>{Ti=!1,console.error("Could not sync a host paired by another tab",oi)}),Ti&&s===P&&await ye(P,F)}return}const Gs=x.get(Ou(P.origin,$e.host.hostId));if(Gs!==void 0){await re(P,Gs)&&s===P&&await ye(P,F);return}const en=await Gw(P,$e.host.hostId,await ne(),e.connect,{pageProtocol:window.location.protocol});if(He.cancelled||!I(P,Ue))return;if(!en.ok){be(P,$e.host.hostId,en.error);return}const It=je($e.host.hostId,en.value);Y(It.hostKey);try{await e.paired(It)}catch{A(P.origin,Ae,St)||R(It);return}if(A(P.origin,Ae,St)){await D(P.origin,$e.host.hostId);return}s===P&&await ye(P,F)},ln=(async()=>{const Le=e.locks??lte;Le===void 0?await at():await Le.request(`pinomad.autoRegister:${kn(P.origin)}:${$e.host.hostId}`,at)})().catch(Le=>{console.error("Could not auto-register an account host",Le)}).finally(()=>{m.get(Ae)===He&&m.delete(Ae)});He.promise=ln,m.set(Ae,He)}}},ye=async(P,F)=>{var at,ln;const Q=z+=1,de=await P.listHosts();if(s!==P)return{ok:!1,error:{code:"stale"}};if(!de.ok){if(th(de.error))return i==="bearer"&&((ln=(at=e.bridge)==null?void 0:at.account)==null||ln.clear().catch(()=>{})),L(),de;const Le=n.status==="signed-in"?n.hosts:[];return M(B(P,F,Le,{hostsError:de.error})),ae(),de}let fe,$e=!0;try{fe=await e.hosts.list()}catch{fe=[],$e=!1}if(s!==P)return{ok:!1,error:{code:"stale"}};const Ae=Vw(P.origin,de.value,fe,f.list(),$e);for(const Le of Ae)if(Le.linkable&&Le.stored!==void 0){const gt=Le.stored;e.paired({...gt,account:{serverOrigin:P.origin,hostId:Le.host.hostId}}).catch(()=>{})}const Ue=new Set(de.value.map(Le=>Le.hostId)),St=n.status==="signed-in"&&n.serverOrigin===P.origin?n.hosts:[],He=new Set([...St.map(Le=>Le.host.hostId),...fe.flatMap(Le=>{var gt;return((gt=Le.account)==null?void 0:gt.vouched)===!0&&kn(Le.account.serverOrigin)===P.origin?[Le.account.hostId]:[]})].filter(Le=>!Ue.has(Le)));if(M(B(P,F,Ae)),ae(),we(P,F,Ae,$e),Q===z)for(const Le of He)await Ce(P.origin,Le);return{ok:!0,value:Ae}};(async()=>{var de,fe;const P=e.bridge;if(P!==void 0){const $e=await((de=P.account)==null?void 0:de.get().catch(()=>{}));if($e===void 0){L();return}l=$e.serverOrigin;const Ae=sh({origin:$e.serverOrigin,credentials:{mode:"bearer",token:$e.token},fetch:e.fetch}),Ue=await Ae.me();if(!Ue.ok){th(Ue.error)&&((fe=P.account)==null||fe.clear().catch(()=>{})),L();return}s=Ae,u(Ue.value),await ye(Ae,Ue.value.user.username);return}if(await Lee(e.origin,e.fetch)!=="enabled"){M({status:"unavailable"});return}const F=sh({origin:e.origin,credentials:{mode:"cookie"},fetch:e.fetch}),Q=await F.me();if(!Q.ok){l=e.origin,L();return}s=F,l=e.origin,u(Q.value),await ye(F,Q.value.user.username)})();const Se=async P=>{var He;if(s===void 0)return kt("unauthenticated");const F=s,Q=g,de=Ou(F.origin,P),fe=E(F.origin,de);f.remove({serverOrigin:F.origin,hostId:P}),cx(P);const $e=x.get(de);if($e!==void 0)return await re(F,$e)?{ok:!0,value:$e}:kt("pairing_not_saved");const Ae=await Gw(F,P,await ne(),e.connect,{pageProtocol:window.location.protocol});if(!Ae.ok)return be(F,P,Ae.error),Ae;if(!I(F,Q))return kt("stale");if(A(F.origin,de,fe))return kt("host_removed");const Ue=je(P,Ae.value);Y(Ue.hostKey);try{await e.paired(Ue)}catch{return A(F.origin,de,fe)?kt("host_removed"):(R(Ue),kt("pairing_not_saved"))}if(A(F.origin,de,fe))return await D(F.origin,P),kt("host_removed");_(Ue);const St=await e.hosts.list().catch(()=>[]);for(const at of St)at.account!==void 0&&kn(at.account.serverOrigin)===F.origin&&at.account.hostId===P&&at.hostKey!==Ue.hostKey&&(((He=e.removeHost)==null?void 0:He.call(e,at.hostKey))??e.hosts.remove(at.hostKey)).catch(()=>{});return n.status==="signed-in"&&s!==void 0&&await ye(s,n.user),{ok:!0,value:Ue}},ke=P=>{if(s===void 0)return;const F=s,Q=g,de={},fe=N.get(P);fe!==void 0&&clearTimeout(fe.timer),N.set(P,{watch:de});const $e=()=>{var He;return I(F,Q)&&((He=N.get(P))==null?void 0:He.watch)===de},Ae=()=>n.status==="signed-in"&&n.hosts.some(He=>He.host.hostId===P&&He.status==="paired"),Ue=()=>{var He;((He=N.get(P))==null?void 0:He.watch)===de&&N.delete(P)},St=async He=>{if(!$e()||n.status!=="signed-in"||Ae())return Ue();if(await ye(F,n.user),!!$e()){if(Ae()||He===0)return Ue();N.set(P,{watch:de,timer:setTimeout(()=>void St(He-1),jN)})}};St(ote)},Ce=async(P,F)=>{const{hostKeys:Q}=await U(P,F);a==null||a.post({kind:"host-removed",serverOrigin:P,hostId:F,hostKeys:[...Q]})},Ee=async({hostId:P,confirmation:F})=>{if(s===void 0||n.status!=="signed-in")return kt("unauthenticated");const Q=s,de=g,fe=n.user,$e=await Q.removeHost(P,F);if(!I(Q,de))return $e;if(!$e.ok){if(th($e.error))L();else if($e.error.code==="not_found"){const Ae=await ye(Q,fe);return Ae.ok?Ae.value.some(Ue=>Ue.host.hostId===P)?kt("remove_unsupported"):(await Ce(Q.origin,P),{ok:!0,value:void 0}):Ae}return $e}return await Ce(Q.origin,P),I(Q,de)&&await ye(Q,fe),{ok:!0,value:void 0}},xe=P=>{if(i==="cookie")return{ok:!0,value:sh({origin:e.origin,credentials:{mode:"cookie"},fetch:e.fetch})};const F=P??l;return F===void 0?kt("origin_required"):xN(F)?{ok:!0,value:sh({origin:F,credentials:{mode:"bearer"},fetch:e.fetch})}:kt("insecure_origin")},xt=async(P,F)=>{const Q=xe(P);return Q.ok?F(Q.value):Q},st=async(P,F,Q=++y)=>{const de=s;i==="cookie"&&await v;const fe=xe(P);if(!fe.ok)return fe;const $e=await F(fe.value);return $e.ok?Gt(Q,de)?kt("superseded"):Wt(fe.value,$e.value):$e},Gt=(P,F)=>y!==P||s!==F,Wt=async(P,F)=>{var de,fe;let Q=P;if(i==="bearer"){if(F.token===void 0)return kt("invalid_response");Q=sh({origin:Q.origin,credentials:{mode:"bearer",token:F.token},fetch:e.fetch}),l=Q.origin,(fe=(de=e.bridge)==null?void 0:de.account)==null||fe.save({serverOrigin:Q.origin,token:F.token}).catch($e=>console.error("Could not persist the account session",$e))}return s!==void 0&&O(),s=Q,u(F),await ye(Q,F.user.username),{ok:!0,value:void 0}},Jt=async(P,F)=>{var ln;const Q=(ln=e.bridge)==null?void 0:ln.oauthSignIn;if(Q===void 0)return kt("unsupported");const de=++y,fe=s,$e=xe(F);if(!$e.ok)return $e;const Ae=Le=>Ho(crypto.getRandomValues(new Uint8Array(Le))),Ue=Ae(32),St=Ae(16),He=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(Ue)),at=await Q({serverOrigin:$e.value.origin,provider:P,codeChallenge:Ho(new Uint8Array(He)),state:St}).catch(()=>({error:"loopback_failed"}));return"error"in at?kt(at.error):Gt(de,fe)?kt("superseded"):st($e.value.origin,Le=>{var gt;return Le.exchangeOAuthCode(at.code,Ue,(gt=e.device)==null?void 0:gt.call(e))},de)},_s=async(P,F,Q,de)=>{var gt;const fe=(gt=e.bridge)==null?void 0:gt.oauthLink;if(fe===void 0)return kt("unsupported");const $e=Gs=>Ho(crypto.getRandomValues(new Uint8Array(Gs))),Ae=$e(16),Ue=$e(32),St=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(Ue)),He=await fe.listen({serverOrigin:P.origin,state:Ae}).catch(()=>({error:"loopback_failed"}));if("error"in He)return kt(He.error);const at=await P.linkProvider(F,Q,{redirectUri:He.redirectUri,codeChallenge:Ho(new Uint8Array(St)),state:Ae});if(!at.ok)return at;const ln=await fe.open({state:Ae,url:at.value}).catch(()=>({error:"loopback_failed"}));if("error"in ln)return kt(ln.error);if(!de())return kt("session_ended");const Le=await P.completeLink(ln.code,Ue);return Le.ok?{ok:!0,value:{}}:Le},Rt=async(P,F)=>{if(!P.ok)return P;if(P.value.kind==="redirect")return{ok:!0,value:{redirect:P.value.url}};const Q=await Wt(F,P.value.session);return Q.ok?{ok:!0,value:{}}:Q},Ke=async(P,F)=>{if(s===void 0)return kt("unauthenticated");const Q=s,de=g,fe=await P(Q);return I(Q,de)&&(fe.ok?F==null||F(fe.value):th(fe.error)&&L()),fe};return{get state(){return n},subscribe:P=>(t.add(P),()=>{t.delete(P)}),login:({username:P,password:F,serverOrigin:Q})=>st(Q,de=>{var fe;return de.login(P,F,(fe=e.device)==null?void 0:fe.call(e))}),providerFlow:r,authMethods:P=>xt(P,F=>F.authMethods()),requestSignupCode:({email:P,serverOrigin:F})=>xt(F,Q=>Q.requestSignupCode(P)),register:({email:P,code:F,password:Q,serverOrigin:de})=>st(de,fe=>{var $e;return fe.register({email:P,code:F,password:Q,device:($e=e.device)==null?void 0:$e.call(e)})}),requestPasswordReset:({email:P,serverOrigin:F})=>xt(F,Q=>Q.requestPasswordReset(P)),resetPassword:({email:P,code:F,password:Q,serverOrigin:de})=>xt(de,fe=>fe.resetPassword({email:P,code:F,password:Q})),providerSignIn:async({provider:P,serverOrigin:F})=>r==="loopback"?Jt(P,F):r===void 0?kt("unsupported"):((e.navigate??(Q=>window.location.assign(Q)))(`${kn(e.origin)}/api/oauth/${encodeURIComponent(P)}/start?client=web`),new Promise(()=>{})),requestEmailCode:P=>Ke(F=>F.requestEmailCode(P)),setEmail:async P=>{const F=await Ke(Q=>Q.setEmail(P),Q=>{if(u(Q),n.status!=="signed-in")return;const{needsEmail:de,...fe}=n;M({...fe,user:Q.user.username,...c})});return F.ok?{ok:!0,value:void 0}:F},identities:()=>Ke(P=>P.identities()),requestReauthCode:()=>Ke(P=>P.requestReauthCode()),reauth:P=>Ke(F=>F.reauth(P)),linkProvider:async(P,F)=>{if(r==="loopback")return Ke(async de=>{const fe=g,$e=()=>I(de,fe),Ae=await _s(de,P,F,$e);return Ae.ok&&!$e()?kt("session_ended"):Ae});const Q=await Ke(de=>de.linkProvider(P,F));return Q.ok?{ok:!0,value:{redirect:Q.value}}:Q},unlinkProvider:(P,F)=>Ke(Q=>Q.unlinkProvider(P,F)),pendingSignIn:P=>xt(void 0,F=>F.pendingSignIn(P)),createFromPending:async(P,F)=>{var de;y+=1,i==="cookie"&&await v;const Q=xe(void 0);return Q.ok?Rt(await Q.value.createFromPending(P,{...(F==null?void 0:F.password)===void 0?{}:{password:F.password},device:(de=e.device)==null?void 0:de.call(e)}),Q.value):Q},linkPending:async(P,F)=>{const Q=await Ke(de=>de.linkPending(P,F));return Q.ok?{ok:!0,value:Q.value===void 0?{}:{redirect:Q.value}}:Q},signInAndLinkPending:async(P,{username:F,password:Q})=>{const de=await st(void 0,$e=>{var Ae;return $e.login(F,Q,(Ae=e.device)==null?void 0:Ae.call(e))});if(!de.ok)return de;const fe=await Ke($e=>$e.linkPending(P,Q));return fe.ok?{ok:!0,value:fe.value===void 0?{}:{redirect:fe.value}}:fe},logout:async P=>{var Ue,St;if(s===void 0)return kt("unauthenticated");const F=s,Q=(P==null?void 0:P.revoke)===!0;O(),i==="bearer"?((St=(Ue=e.bridge)==null?void 0:Ue.account)==null||St.clear().catch(()=>{}),H()):M({status:"checking"});const de=(async()=>({forgotten:Q?await X(F.origin,!0):!0,result:await F.logout(Q?{revoke:!0}:void 0)}))(),fe=de.then(()=>{});i==="cookie"&&(v=fe);const{forgotten:$e,result:Ae}=await de;return v===fe&&(v=void 0),i==="cookie"&&s===void 0&&n.status==="checking"&&H(),$e?Ae.ok?{ok:!0,value:void 0}:Ae:kt("hosts_not_forgotten")},revokeAll:async()=>{var F,Q;if(s===void 0)return kt("unauthenticated");const P=await s.revokeAllSessions();return i==="bearer"&&((Q=(F=e.bridge)==null?void 0:F.account)==null||Q.clear().catch(()=>{})),L(),P.ok?{ok:!0,value:void 0}:P},refreshHosts:async()=>s===void 0||n.status!=="signed-in"?kt("unauthenticated"):ye(s,n.user),changePassword:({confirmation:P,newPassword:F})=>Ke(Q=>Q.changePassword(P,F)),deleteAccount:({confirmation:P})=>Ke(F=>F.deleteAccount(P),()=>{var F,Q;i==="bearer"&&((Q=(F=e.bridge)==null?void 0:F.account)==null||Q.clear().catch(()=>{})),L()}),listDevices:()=>Ke(P=>P.listDevices()),kickDevice:({id:P,confirmation:F})=>Ke(Q=>Q.kickDevice(P,F)),removeHost:Ee,createJoinToken:()=>Ke(P=>P.createJoinToken()),lookupHostLink:P=>Ke(F=>F.lookupHostLink(P)),confirmHostLink:P=>Ke(F=>F.confirmHostLink(P)),denyHostLink:P=>Ke(F=>F.denyHostLink(P)),lookupHostLinkRequest:P=>Ke(F=>F.lookupHostLinkRequest(P)),confirmHostLinkRequest:P=>Ke(F=>F.confirmHostLinkRequest(P)),denyHostLinkRequest:P=>Ke(F=>F.denyHostLinkRequest(P)),watchForHost:ke,pairHost:Se,retryUnsavedHost:async P=>{if(n.status!=="signed-in")return kt("nothing_pending");const F=P===void 0?[...x.values()]:[x.get(Ou(n.serverOrigin,P))].filter(de=>de!==void 0);if(F.length===0)return kt("nothing_pending");const Q=s;if(Q===void 0)return kt("unauthenticated");for(const de of F)if(!await re(Q,de))return kt("pairing_not_saved");return{ok:!0,value:void 0}},hostRejected:P=>{d.add(P),n.status==="signed-in"&&M({...n,rejectedHostKeys:[...d]})}}}function ute(){const{store:e,paired:t,dropHost:n}=Ns(),[s]=h.useState(()=>cte({origin:window.location.origin,bridge:window.pinomadDesktop,hosts:e,paired:t,removeHost:n,name:n6,device:()=>({id:ste(),name:Wee(navigator.userAgent,document.documentElement.dataset.pinomadPlatform)})}));return h.useSyncExternalStore(s.subscribe,()=>s.state),s}const ct=()=>Promise.reject(new Error("no AccountProvider")),dte={state:{status:"unavailable"},subscribe:()=>()=>{},login:ct,logout:ct,revokeAll:ct,changePassword:ct,deleteAccount:ct,refreshHosts:ct,listDevices:ct,kickDevice:ct,removeHost:ct,createJoinToken:ct,lookupHostLink:ct,confirmHostLink:ct,denyHostLink:ct,lookupHostLinkRequest:ct,confirmHostLinkRequest:ct,denyHostLinkRequest:ct,watchForHost:()=>{},pairHost:ct,retryUnsavedHost:ct,hostRejected:()=>{},providerFlow:void 0,authMethods:ct,requestSignupCode:ct,register:ct,requestPasswordReset:ct,resetPassword:ct,providerSignIn:ct,requestEmailCode:ct,setEmail:ct,identities:ct,requestReauthCode:ct,reauth:ct,linkProvider:ct,unlinkProvider:ct,pendingSignIn:ct,createFromPending:ct,linkPending:ct,signInAndLinkPending:ct},SN=h.createContext(dte);function fte({children:e}){const t=ute();return o.jsx(SN.Provider,{value:t,children:e})}function an(){const e=h.useContext(SN);return h.useSyncExternalStore(e.subscribe,()=>e.state),e}function CN(e){const t=pte(e);if(t===void 0)return"unknown";if(t.family===4)return Xw(t.octets);const n=gte(t.segments);return n===void 0?mte(t.segments):Xw(n)}function Kw(e){return{...e.type===void 0?{}:{type:e.type},...e.address===void 0?{}:{address:e.address},scope:CN(e.address)}}function hte(e,t){return{local:Kw(e),remote:Kw(t)}}function pte(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 i=EN(n);if(i!==void 0)return{family:4,octets:i};const r=xte(n);return r===void 0?void 0:{family:6,segments:r}}function EN(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 i=Number(s);if(i>255)return;n.push(i)}return n}function xte(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=EN(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),i=n(t[1],!0);if(s===void 0||i===void 0)return;const r=8-s.length-i.length;if(!(r<1))return[...s,...new Array(r).fill(0),...i]}function gte(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 Xw(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 mte(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 $N="pinomad",vte=65535,yte=65536,Zw=vte;function kte(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 bte(e){return e.split(/\r?\n/).filter(t=>t.startsWith("a=candidate:")).map(t=>t.slice(2))}function wte(e,t){const n=e.split(/\r?\n/).filter(i=>i!==""&&!i.startsWith("a=candidate:")&&i!=="a=end-of-candidates"),s=[...new Set(t.map(i=>i.replace(/^a=/,"")))];return[...n,...s.map(i=>`a=${i}`),"a=end-of-candidates",""].join(`\r
383
+ `)}function jte(e){const t=e.split(/\r?\n/).find(i=>i.startsWith("a=max-message-size:"));if(t===void 0)return{kind:"bounded",bytes:yte};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<Zw?{kind:"invalid",reason:`a=max-message-size ${s} cannot carry a ${Zw}-byte record`}:{kind:"bounded",bytes:s}:{kind:"invalid",reason:`a=max-message-size is not a safe integer: ${n}`}}const Ste=256*1024,Cte=64*1024,Ete=1e4,$te=2e3,AN={now:()=>typeof performance>"u"?Date.now():performance.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)};function Ate(e){return{label:`webrtc:${$N}`,open(t){const n=e.clock??AN,s=e.stallMs??Ete,i=e.prologue??Pz,r=qz({prologue:i,static:e.device,remoteStatic:e.hostKey}),a=[],l=[];let c,u,d,f=!1,p=!1,x=n.now(),g,y,v=!1;const m=()=>{g!==void 0&&n.clearTimeout(g),g=void 0},k=()=>{y!==void 0&&n.clearTimeout(y),y=void 0},w=M=>{if(!p){p=!0,m(),k();try{c==null||c.close()}catch{}t.closed(1006,M)}},S=()=>{p||l.length===0||g!==void 0||(g=n.setTimeout(()=>{if(g=void 0,!p&&l.length!==0){if(n.now()-x<s){S();return}w(`the DataChannel made no progress for ${s}ms`)}},s))},E=()=>{if(p||u===void 0)return;if(l.length===0){m(),k();return}if(u.bufferedAmount>=Ste)return;let M;try{M=u.send(l[0])}catch($){w($ instanceof Error?$.message:"the DataChannel send failed");return}if(M==="rejected"){y===void 0&&(y=n.setTimeout(()=>{y=void 0,E()},50));return}k(),l.shift(),x=n.now(),S(),queueMicrotask(E)},A=M=>{p||M.length===0||(l.push(...M),x=n.now(),S(),E())},z=()=>{if(d!==void 0)for(const M of a.splice(0))A(d.seal(M))},N=M=>{var $;if(!p)try{if(d===void 0){const{payload:_,result:T}=r.readMessage2(M);Gz(_),d=new Wz(T),($=t.authenticated)==null||$.call(t),z();return}const R=d.open(M);R!==void 0&&t.message(R)}catch(R){w(R instanceof Error?R.message:"secure DataChannel failure")}};return e.platform.createPeer(e.stun).then(M=>{if(p){M.close();return}c=M,u=M.channel,u.onOpen(()=>{var R,_,T;p||f||(f=!0,(_=e.onSelectedPair)==null||_.call(e,(R=M.selectedPair)==null?void 0:R.call(M)),(T=t.opened)==null||T.call(t),v||(v=!0,A([r.writeMessage1(Vz({v:1}))])))}),u.onMessage(N),u.onClosed(R=>{p||w(R===void 0?"the DataChannel closed":`the DataChannel closed: ${R}`)}),u.onBufferedAmountLow(E);let $;return e.offer(M.offerSdp).then(R=>{var T;if(p)return;const _=jte(R);if(_.kind==="invalid")throw new Error(_.reason);$=R,M.acceptAnswer($),(T=t.signaled)==null||T.call(t)})},M=>w(M instanceof Error?M.message:String(M))).catch(M=>w(M instanceof Error?M.message:String(M))),{send(M){if(!p){if(d===void 0){a.push(M);return}A(d.seal(M))}},close(){if(!p){p=!0,m(),k();try{c==null||c.close()}catch{}}}}}}}function MN(){return typeof RTCPeerConnection<"u"}function Yw(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 Mte(e){try{const t=await e.getStats(),n=new Map;t.forEach(i=>n.set(i.id,i));let s;return t.forEach(i=>{if(i.type!=="transport")return;const r=i.selectedCandidatePairId;if(r===void 0)return;const a=n.get(r);(a==null?void 0:a.type)==="candidate-pair"&&(s=a)}),s===void 0&&t.forEach(i=>{if(i.type!=="candidate-pair")return;const r=i;(r.selected===!0||r.state==="succeeded"&&r.nominated===!0)&&(s=r)}),s===void 0?void 0:{local:Yw(s.localCandidateId===void 0?void 0:n.get(s.localCandidateId)),remote:Yw(s.remoteCandidateId===void 0?void 0:n.get(s.remoteCandidateId))}}catch{return}}function Tte(e,t,n,s,i,r){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=Cte,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){r("the DataChannel delivered a non-binary message");return}for(const f of n.message)f(d)},e.onopen=()=>{Mte(t).then(c=>{c!==void 0&&(s.selectedPair=c),a()})},e.onclose=c=>{if(s.locallyClosed||s.closed)return;const u=c.reason;i(u===""||u===void 0?"the DataChannel closed":u)},e.onerror=c=>{var d;const u=(d=c.error)==null?void 0:d.message;r(u===void 0||u===""?"the DataChannel failed":u)},t.onconnectionstatechange=()=>{t.connectionState==="failed"?r("the PeerConnection failed"):t.connectionState==="closed"&&!s.locallyClosed&&i("the PeerConnection closed")},t.oniceconnectionstatechange=()=>{t.iceConnectionState==="failed"&&r("the ICE connection failed")},l}async function zte(e){const t=[];let n,s=!1,i,r;const a=new Promise((d,f)=>{i=d,r=f}),l=()=>{n!==void 0&&clearTimeout(n),n=void 0,e.onicecandidate=null,e.onicegatheringstatechange=null},c=d=>{s||(s=!0,l(),r(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,...bte(d.sdp)])];if(f.length===0){c("the browser gathered no ICE candidates");return}s=!0,l(),i(wte(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,$te);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 Nte(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)}},i=()=>{try{a.close()}catch{}try{e.close()}catch{}},r=u=>{n.closed||n.locallyClosed||(s(u),i())},a=e.createDataChannel($N,{ordered:!0}),l=Tte(a,e,t,n,s,r);let c;try{c=await zte(e)}catch(u){throw n.locallyClosed=!0,i(),u}return{offerSdp:c,acceptAnswer(u){n.locallyClosed||e.setRemoteDescription({type:"answer",sdp:u}).catch(d=>{r(d instanceof Error?d.message:String(d))})},channel:l,selectedPair:()=>n.selectedPair,close(){n.locallyClosed||(n.locallyClosed=!0,i())}}}function TN(){if(MN())return{createPeer(e){const t=new RTCPeerConnection({iceServers:e.map(n=>({urls:n}))});return Nte(t)}}}function na(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 s6(e){if(!(e===void 0||na(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 xc,gc,Cd;class _te{constructor(){oe(this,xc,new Map);oe(this,gc,new Set);oe(this,Cd,0);ve(this,"subscribe",t=>(j(this,gc).add(t),()=>{j(this,gc).delete(t)}));ve(this,"snapshot",()=>j(this,Cd))}publish(t,n){j(this,xc).set(t,n),V(this,Cd,j(this,Cd)+1);for(const s of j(this,gc))s()}remove(t){if(j(this,xc).delete(t)){V(this,Cd,j(this,Cd)+1);for(const n of j(this,gc))n()}}get(t){return j(this,xc).get(t)}all(){return j(this,xc)}}xc=new WeakMap,gc=new WeakMap,Cd=new WeakMap;function Rte(){return new _te}const c2=h.createContext(void 0);function Ite(){return h.useContext(c2)}function zN(){const e=Ite();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 v5(e){switch(na(e)){case"connected":return"Connected";case"connecting":return"Connecting";case"offline":return"Offline";case"terminal":{const t=s6(e);return t==="rejected"?"Not paired":t==="protocol_mismatch"?"Protocol mismatch":"Disconnected"}}}const Lte=5e3;async function NN({host:e,remote:t,forget:n}){let s=!1;if(t!==void 0){let i;s=await Promise.race([t.controller.revokeDevice(Ho(lf(ao(e.privateKey)).publicKey)).then(()=>!0),new Promise(r=>{i=setTimeout(()=>r(!1),Lte)})]),clearTimeout(i)}return await n(e.hostKey),{hostAnswered:s}}function _N(e){return{body:`${e} didn't answer, so only this device forgot it. Unpair this device under Settings → Devices on ${e}.`,type:"info"}}const Ote=["oauth_error","oauth_pending","oauth_linked"],Dte=/^[A-Za-z0-9_-]{1,64}$/;function Bte(e){const t=new URLSearchParams(e),n=a=>{const l=t.get(a);return l!==null&&Dte.test(l)?l:void 0},s=n("oauth_error"),i=n("oauth_pending"),r=n("oauth_linked");return{...s===void 0?{}:{error:s},...i===void 0?{}:{pending:i},...r===void 0?{}:{linked:r}}}let ec;function E0(){if(ec!==void 0)return ec;if(ec=typeof window>"u"?{}:Bte(window.location.search),typeof window<"u"&&Object.keys(ec).length>0){const e=new URL(window.location.href);for(const t of Ote)e.searchParams.delete(t);history.replaceState(history.state,"",e.pathname+e.search+e.hash)}return ec}function Kg(e){const t=E0();if(e===void 0)ec={};else{const{[e]:n,...s}=t;ec=s}}const Hte='<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>',qte='<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>Apple</title><path d="M11.932 6.908c.95 0 2.727-1.291 4.595-1.1.782.032 2.976.316 4.388 2.38-.113.069-2.622 1.528-2.593 4.565.034 3.617 3.166 4.828 3.221 4.85-.029.086-.506 1.723-1.658 3.416-1.002 1.463-2.039 2.919-3.675 2.95-1.606.03-2.125-.955-3.96-.955s-2.409.923-3.931.984c-1.581.06-2.78-1.58-3.79-3.037-2.065-2.98-3.64-8.422-1.527-12.087 1.051-1.824 2.93-2.98 4.969-3.009 1.549-.032 3.011 1.043 3.96 1.043zM16.552 0c.153 1.407-.411 2.817-1.251 3.833-.837 1.013-2.214 1.804-3.555 1.7-.185-1.378.495-2.814 1.27-3.712C13.883.805 15.346.05 16.553 0z"></path></svg>',Pte='<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>',Ute='<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>',Fte='<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>',Vte='<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>',Gte='<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>',Wte='<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>',Kte='<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>',Xte='<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>',Zte='<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>',Yte='<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>',Qte='<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>',Jte='<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>',ene='<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>',tne='<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>',nne='<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>Github</title><path d="M12 0c6.63 0 12 5.276 12 11.79-.001 5.067-3.29 9.567-8.175 11.187-.6.118-.825-.25-.825-.56 0-.398.015-1.665.015-3.242 0-1.105-.375-1.813-.81-2.181 2.67-.295 5.475-1.297 5.475-5.822 0-1.297-.465-2.344-1.23-3.169.12-.295.54-1.503-.12-3.125 0 0-1.005-.324-3.3 1.209a11.32 11.32 0 00-3-.398c-1.02 0-2.04.133-3 .398-2.295-1.518-3.3-1.209-3.3-1.209-.66 1.622-.24 2.83-.12 3.125-.765.825-1.23 1.887-1.23 3.169 0 4.51 2.79 5.527 5.46 5.822-.345.294-.66.81-.765 1.577-.69.31-2.415.81-3.495-.973-.225-.354-.9-1.223-1.845-1.209-1.005.015-.405.56.015.781.51.28 1.095 1.327 1.23 1.666.24.663 1.02 1.93 4.035 1.385 0 .988.015 1.916.015 2.196 0 .31-.225.664-.825.56C3.303 21.374-.003 16.867 0 11.791 0 5.276 5.37 0 12 0z"></path></svg>',sne='<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>',ine='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Google</title><path d="M23 12.245c0-.905-.075-1.565-.236-2.25h-10.54v4.083h6.186c-.124 1.014-.797 2.542-2.294 3.569l-.021.136 3.332 2.53.23.022C21.779 18.417 23 15.593 23 12.245z" fill="#4285F4"></path><path d="M12.225 23c3.03 0 5.574-.978 7.433-2.665l-3.542-2.688c-.948.648-2.22 1.1-3.891 1.1a6.745 6.745 0 01-6.386-4.572l-.132.011-3.465 2.628-.045.124C4.043 20.531 7.835 23 12.225 23z" fill="#34A853"></path><path d="M5.84 14.175A6.65 6.65 0 015.463 12c0-.758.138-1.491.361-2.175l-.006-.147-3.508-2.67-.115.054A10.831 10.831 0 001 12c0 1.772.436 3.447 1.197 4.938l3.642-2.763z" fill="#FBBC05"></path><path d="M12.225 5.253c2.108 0 3.529.892 4.34 1.638l3.167-3.031C17.787 2.088 15.255 1 12.225 1 7.834 1 4.043 3.469 2.197 7.062l3.63 2.763a6.77 6.77 0 016.398-4.572z" fill="#EB4335"></path></svg>',rne='<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>',one='<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>',ane='<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>',lne='<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>',cne='<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>',une='<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>',dne='<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>',fne='<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>',hne='<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>',pne='<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>',xne='<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>',gne='<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>',mne='<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>',vne='<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>',yne='<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>',kne='<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>',bne='<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>',wne='<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>',jne='<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>',Sne='<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>',Cne='<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>',Ene='<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>',$ne='<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>',Ane='<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>',Mne='<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>',Tne='<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>',zne='<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>',Nne='<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>',_ne='<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>',Rne='<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>',Ine='<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>',Lne='<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>',One='<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>',Dne='<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>',Bne='<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>',Hne=Object.assign({"./logos/anthropic.svg":Hte,"./logos/apple.svg":qte,"./logos/arcee-color.svg":Pte,"./logos/azure-color.svg":Ute,"./logos/baseten.svg":Fte,"./logos/bedrock-color.svg":Vte,"./logos/bytedance-color.svg":Gte,"./logos/cerebras-color.svg":Wte,"./logos/claude-color.svg":Kte,"./logos/cloudflare-color.svg":Xte,"./logos/codex-color.svg":Zte,"./logos/cohere-color.svg":Yte,"./logos/deepseek-color.svg":Qte,"./logos/fireworks-color.svg":Jte,"./logos/gemini-color.svg":ene,"./logos/gemma-color.svg":tne,"./logos/github.svg":nne,"./logos/githubcopilot.svg":sne,"./logos/google-color.svg":ine,"./logos/grok.svg":rne,"./logos/groq.svg":one,"./logos/huggingface-color.svg":ane,"./logos/hunyuan-color.svg":lne,"./logos/ibm.svg":cne,"./logos/inception.svg":une,"./logos/kimi-color.svg":dne,"./logos/kwaipilot-color.svg":fne,"./logos/ling-color.svg":hne,"./logos/liquid.svg":pne,"./logos/lmstudio.svg":xne,"./logos/longcat-color.svg":gne,"./logos/meta-color.svg":mne,"./logos/microsoft-color.svg":vne,"./logos/minimax-color.svg":yne,"./logos/mistral-color.svg":kne,"./logos/moonshot.svg":bne,"./logos/nova-color.svg":wne,"./logos/nvidia-color.svg":jne,"./logos/ollama.svg":Sne,"./logos/openai.svg":Cne,"./logos/opencode.svg":Ene,"./logos/openrouter.svg":$ne,"./logos/poolside-color.svg":Ane,"./logos/qwen-color.svg":Mne,"./logos/reka.svg":Tne,"./logos/sakana-color.svg":zne,"./logos/stepfun-color.svg":Nne,"./logos/together-color.svg":_ne,"./logos/upstage-color.svg":Rne,"./logos/vercel.svg":Ine,"./logos/vertexai-color.svg":Lne,"./logos/xai.svg":One,"./logos/xiaomimimo.svg":Dne,"./logos/zai.svg":Bne}),qne=[["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"]],RN=e=>{var t;return(t=qne.find(([n])=>e===n||e.startsWith(`${n}-`)))==null?void 0:t[1]},i6=e=>{var t;return(t=Hne[`./logos/${e}.svg`])==null?void 0:t.replace(/<title>.*?<\/title>/,"")},Qw=e=>{const t=RN(e);return t===void 0?void 0:i6(t)},Pne="11434",Une=e=>{try{return new URL(e).port}catch{return}},Fne=e=>e.split(/\s+/).filter(t=>t!=="").slice(0,2).map(t=>t[0].toUpperCase()).join("");function Ta({providerId:e,name:t,baseUrl:n,size:s=32}){const i=n===void 0?Qw(e):Une(n)===Pne?Qw("ollama"):void 0,r={"--provider-logo-size":`${s}px`};return i===void 0?o.jsx("span",{className:"provider-logo","data-initials":"",style:r,"aria-hidden":"true",children:Fne(t)}):o.jsx("span",{className:"provider-logo",style:r,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:i}})}const r6=[{id:"google",name:"Google",logo:"google-color"},{id:"github",name:"GitHub",logo:"github"},{id:"apple",name:"Apple",logo:"apple"}],Ys=e=>{var t;return((t=r6.find(n=>n.id===e))==null?void 0:t.name)??e},IN=e=>r6.filter(t=>e.includes(t.id));function Xg({provider:e,size:t=16}){const n=r6.find(r=>r.id===e),s=n===void 0?void 0:i6(n.logo);if(s===void 0)return null;const i={display:"inline-flex",inlineSize:t,blockSize:t,flex:"none"};return o.jsx("span",{className:"sign-in-provider-mark",style:i,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:s.replace(/(width|height)="1em"/g,'$1="100%"')}})}const LN="https://app.pinomad.si";function Pn({title:e,tone:t="default",children:n}){return o.jsxs(te,{gap:2,style:{width:"100%"},children:[e===void 0?null:t==="danger"?o.jsx(xn,{level:4,color:"inherit",style:{color:"var(--color-error)"},children:e}):o.jsx(xn,{level:4,children:e}),o.jsx(s0,{padding:0,style:{overflow:"hidden"},children:n})]})}const $0="m-0 flex list-none flex-col p-0 divide-y divide-[var(--color-border)]";function Zg({label:e,description:t,children:n}){return o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-6 gap-y-2 px-4 py-3",children:[o.jsxs("div",{className:"flex min-w-0 flex-[1_1_14rem] flex-col gap-0.5",children:[o.jsx(W,{children:e}),t===void 0?null:o.jsx(W,{type:"supporting",children:t})]}),o.jsx("div",{className:"flex min-w-0 max-w-full flex-wrap items-center gap-2",children:n})]})}function fo(e){const[t,n]=h.useState(()=>Date.now());return h.useEffect(()=>{const s=setInterval(()=>n(Date.now()),e);return()=>clearInterval(s)},[e]),t}function Qt(e){switch(e.code){case"invalid_credentials":return"Wrong email 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"weak_password":return"Use a password of at least 12 characters.";case"wrong_password":return"The password is wrong.";case"invalid_code":return"That code is wrong or has expired. Check the latest email, or send a new code.";case"invalid_email":return"Enter a valid email address.";case"registration_closed":return"This server isn't taking new accounts.";case"email_unavailable":return"This server can't send email right now. Try again later.";case"email_taken":return"Another account already uses that email.";case"password_required":return"Choose a password for the account.";case"invalid_reauth":return"The confirmation expired. Confirm again.";case"last_method":return"This is the only way to sign in to your account. Add another before removing it.";case"identity_taken":return"That account is already linked to another PiNomad account.";case"session_ended":return"You were signed out before linking finished. Sign in and try again.";case"no_email":return"Your account has no email to send a code to.";case"no_verified_email":return"The provider didn't give a verified email. Sign in another way, or verify your email there first.";case"superseded":return"You signed in another way while this sign-in was waiting.";case"access_denied":return"Sign-in was cancelled.";case"invalid_state":return"This sign-in expired or was started in another browser. Start again.";case"exchange_failed":case"invalid_token":return"The provider's answer couldn't be checked. Try again.";case"not_found":return"This sign-in expired. Start again.";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.";default:return`Something went wrong (${e.code}).`}}const o6={autoComplete:"one-time-code",inputMode:"numeric",maxLength:12},a6={autoComplete:"new-password"},l6=e=>[...e].length,c6=12;function _f(e,t){const[n,s]=h.useState("loading"),[i,r]=h.useState(""),[a,l]=h.useState(""),[c,u]=h.useState(!1),[d,f]=h.useState(!1),[p,x]=h.useState(),g=h.useRef(void 0);h.useEffect(()=>{let k=!0;return e.identities().then(w=>{k&&s(w.ok&&!w.value.hasPassword?"code":"password")}),()=>{k=!1}},[e]);const y=e.state.status==="signed-in"?e.state.email:void 0,v=()=>{d||(f(!0),x(void 0),e.requestReauthCode().then(k=>{f(!1),k.ok?u(!0):x(k.error)}))};return{field:o.jsx(Vne,{method:n,email:y,password:i,onPassword:r,code:a,onCode:k=>{g.current=void 0,l(k)},sent:c,sending:d,sendError:p,onSend:v,onEnter:t}),ready:n==="password"?i!=="":n==="code"&&c&&a.trim()!=="",confirm:async()=>{if(n==="password")return{ok:!0,value:i};if(g.current!==void 0)return{ok:!0,value:g.current};const k=await e.reauth({code:a.trim()});return k.ok?(g.current={reauth:k.value.reauth},{ok:!0,value:g.current}):k},reset:()=>{g.current=void 0,l(""),u(!1)}}}function Vne({method:e,email:t,password:n,onPassword:s,code:i,onCode:r,sent:a,sending:l,sendError:c,onSend:u,onEnter:d}){return e==="loading"?o.jsx(Tt,{size:"sm"}):e==="password"?o.jsx(pt,{label:"Password",type:"password",value:n,onChange:s,onEnter:d,width:"100%",autoComplete:"current-password"}):o.jsxs(te,{gap:2,children:[o.jsxs(W,{type:"supporting",children:["We'll email a code to ",t??"your account's email","."]}),a?o.jsx(pt,{label:"Confirmation code",value:i,onChange:r,onEnter:d,width:"100%",...o6}):null,c===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't send the code",description:Qt(c)}),o.jsx(pe,{gap:2,children:o.jsx(K,{label:a?"Resend code":"Send code",variant:"secondary",size:"sm",isLoading:l,onClick:u})})]})}const Gne=e=>typeof e=="string"?{password:e}:e;function ON({account:e,submitLabel:t,onSaved:n,onCancel:s}){const[i,r]=h.useState(""),[a,l]=h.useState(),[c,u]=h.useState(""),[d,f]=h.useState(!1),[p,x]=h.useState(),[g,y]=h.useState(!1),v=h.useRef(!0);h.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]);const m=(A,z)=>{f(!0),x(void 0),(async()=>{const N=await S.confirm(),M=N.ok?await A(Gne(N.value)):N;v.current&&(f(!1),M.ok?z():(M.error.code==="invalid_reauth"&&(S.reset(),y(!0)),x(M.error)))})()},k=()=>{const A=i.trim();A===""||!S.ready||d||m(z=>e.requestEmailCode({email:A,...z}),()=>l(A))},w=()=>{a===void 0||c.trim()===""||!S.ready||d||m(A=>e.setEmail({email:a,code:c.trim(),...A}),n)},S=_f(e,a===void 0?k:w),E=s===void 0?null:o.jsx(K,{label:"Cancel",variant:"secondary",onClick:s});return a===void 0?o.jsxs(te,{gap:2,children:[o.jsx(pt,{label:"Email",type:"email",value:i,onChange:r,onEnter:k,width:"100%",autoComplete:"email"}),S.field,p===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't send the code",description:Qt(p)}),o.jsxs(pe,{gap:2,children:[o.jsx(K,{label:"Send code to new email",variant:"primary",isLoading:d,isDisabled:i.trim()===""||!S.ready,onClick:k}),E]})]}):o.jsxs(te,{gap:2,children:[o.jsxs(W,{children:["Enter the 6-digit code we sent to ",a,"."]}),o.jsx(pt,{label:"Code",value:c,onChange:u,onEnter:w,width:"100%",...o6}),g?S.field:null,p===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't save the email",description:Qt(p)}),o.jsxs(pe,{gap:2,children:[o.jsx(K,{label:t,variant:"primary",isLoading:d,isDisabled:c.trim()===""||!S.ready,onClick:w}),o.jsx(K,{label:"Use a different email",variant:"ghost",onClick:()=>{l(void 0),u(""),x(void 0),y(!1)}})]})]})}function Wne({account:e,email:t}){const[n,s]=h.useState(!1),[i,r]=h.useState(!1),a=t===void 0?"Add email":"Change email";return o.jsxs(te,{gap:2,children:[o.jsx(Pn,{title:"Email",children:o.jsx(wn,{"aria-label":"Email",children:o.jsx(yt,{label:t??"None yet",...i?{description:"Email saved."}:{},endContent:o.jsx(K,{label:t===void 0?"Add":"Change","aria-label":a,variant:"secondary",size:"sm",onClick:()=>{r(!1),s(!0)}})})})}),n?o.jsx(os,{"aria-label":a,isOpen:!0,onOpenChange:l=>l?void 0:s(!1),purpose:"form",width:460,children:o.jsx(Wn,{header:o.jsx(Ts,{title:a,onOpenChange:()=>s(!1)}),content:o.jsx(Kn,{children:o.jsx("div",{style:{padding:"var(--spacing-2)"},children:o.jsx(ON,{account:e,submitLabel:"Save",onSaved:()=>{s(!1),r(!0)},onCancel:()=>s(!1)})})})})}):null]})}function Kne({account:e,hostId:t,name:n,serverOrigin:s,onClose:i}){const[r,a]=h.useState(!1),[l,c]=h.useState(),u=()=>{!d.ready||r||(a(!0),c(void 0),(async()=>{const f=await d.confirm(),p=f.ok?await e.removeHost({hostId:t,confirmation:f.value}):f;a(!1),p.ok?i(!0):(p.error.code==="invalid_reauth"&&d.reset(),c(p.error))})())},d=_f(e,u);return o.jsxs(te,{gap:2,children:[o.jsxs(W,{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."]}),d.field,l===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't remove the host",description:Qt(l)}),o.jsxs(pe,{gap:2,children:[o.jsx(K,{label:"Remove host",variant:"destructive",isLoading:r,isDisabled:!d.ready,onClick:u}),o.jsx(K,{label:"Cancel",variant:"secondary",onClick:()=>i(!1)})]})]})}function u6(e){return o.jsx(os,{"aria-label":`Remove ${e.name}`,isOpen:!0,purpose:"form",onOpenChange:t=>t?void 0:e.onClose(!1),width:440,children:o.jsx(Wn,{header:o.jsx(Ts,{title:`Remove ${e.name}`,onOpenChange:()=>e.onClose(!1)}),content:o.jsx(Kn,{children:o.jsx("div",{style:{padding:"var(--spacing-2)"},children:o.jsx(Kne,{...e})})})})})}function DN(){const e=an(),{focusHost:t}=Ns(),[n,s]=h.useState(),[i,r]=h.useState();return{pairing:n,error:i,pair:a=>{s(a),r(void 0),e.pairHost(a).then(l=>{s(void 0),l.ok?t(l.value.hostKey):r(l.error)})},retrySave:a=>{var l;r(void 0),e.retryUnsavedHost((l=a.account)==null?void 0:l.hostId).then(c=>{c.ok?t(a.hostKey):r(c.error)})}}}function Xne(e,t){if(e.status!=="signed-in")return;const n=e.hosts.find(s=>{var i;return((i=s.stored)==null?void 0:i.hostKey)===t});if(n!==void 0){if(e.rejectedHostKeys.includes(t))return{match:n,kind:"refused"};if(n.status==="key_changed")return{match:n,kind:"key_changed"}}}const Zne={refused:"This host refused this device.",key_changed:"The host's identity changed. Pair again only if you reinstalled it."};function BN(e,t){const n=new Set(t.map(s=>s.hostKey));return e.hosts.filter(s=>s.stored===void 0||!n.has(s.stored.hostKey))}const Yne={offline:"Offline",host_too_old:"Needs pinomad upgrade",key_mismatch:"Run pinomad join again"};function HN({state:e,pairing:t}){const n=an();return o.jsxs(o.Fragment,{children:[e.unsavedHosts.map(s=>o.jsx(Ie,{status:"warning",title:"This pairing wasn't saved",description:`${s.name??s.url} will be lost when the app restarts.`,endContent:o.jsx(K,{label:"Retry",variant:"secondary",size:"sm",onClick:()=>t.retrySave(s)})},s.hostKey)),e.hostsError===void 0?null:o.jsx(Ie,{status:"warning",title:"Couldn't refresh hosts",description:Qt(e.hostsError),endContent:o.jsx(K,{label:"Retry",variant:"secondary",size:"sm",onClick:()=>void n.refreshHosts()})}),t.error===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't pair",description:Qt(t.error)})]})}function qN({state:e,hosts:t,pairing:n,label:s}){const i=fo(3e4),[r,a]=h.useState(),l=an();return o.jsxs(o.Fragment,{children:[o.jsx("ul",{"aria-label":s,className:$0,children:t.map(({host:c})=>{const u=c.online?"Online":`Last seen ${y0(c.lastSeenAt,i)}`,d=c.pairing==="available";return o.jsx("li",{children:o.jsx(yl,{as:"div",startContent:o.jsx("span",{"aria-hidden":"true",className:"inline-flex",children:o.jsx(br,{variant:c.online?"success":"neutral",label:c.online?"Online":"Offline"})}),label:c.name,descriptionLines:2,description:d?u:`${u} · ${Yne[c.pairing]}`,endContent:o.jsxs(pe,{gap:1,vAlign:"center",children:[d?o.jsx(K,{label:"Pair",variant:"secondary",size:"sm",isLoading:n.pairing===c.hostId,isDisabled:n.pairing!==void 0,onClick:()=>n.pair(c.hostId)}):null,o.jsx(ou,{label:`More for ${c.name}`,size:"sm",isDisabled:r!==void 0||n.pairing===c.hostId,items:[{label:"Remove from account",onClick:()=>a(c)}]})]})})},c.hostId)})}),r===void 0?null:o.jsx(u6,{account:l,hostId:r.hostId,name:r.name,serverOrigin:e.serverOrigin,onClose:()=>a(void 0)})]})}function uf({connectVariant:e="primary"}={}){const[t,n]=h.useState(""),[s,i]=h.useState(),r=()=>{const a=hN(t);if(a===void 0){i(/[#?&]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(pe,{gap:2,vAlign:"end",style:{width:"100%"},children:[o.jsx("div",{className:"min-w-0 flex-1",children:o.jsx(pt,{label:"Pairing link",isLabelHidden:!0,placeholder:"http://…/#pair=… or pinomad://pair#…",value:t,onChange:a=>{i(void 0),n(a)},onEnter:r,width:"100%"})}),o.jsx(K,{label:"Connect",variant:e,isDisabled:t.trim()==="",onClick:r})]}),s===void 0?null:o.jsx(Ie,{status:"error",title:"Not a pairing link",description:s})]})}const PN=()=>{var e;return(e=window.pinomadDesktop)==null?void 0:e.localHost},Qne=12e4;function UN(e,t=2e3){const[n,s]=h.useState(),[i,r]=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(i===void 0||!c)return;if(Date.now()>=i){r(void 0);return}const d=setTimeout(()=>void l(),t);return()=>clearTimeout(d)},[n,c,i,t,l]);const u=h.useCallback(()=>r(Date.now()+Qne),[]);return{state:n,refresh:l,pollUntilInstalled:u}}const FN=8;function Jne(e){return e.toUpperCase().replace(/[^A-Z]/g,"").slice(0,FN)}function VN(e){return e.length>4?`${e.slice(0,4)}-${e.slice(4)}`:e}function GN(e){return e.length===FN}const WN="pinomad.knownAccountHosts",Jv=e=>`${kn(e.serverOrigin)}\0${e.user}`,Jw=e=>{let t;try{t=e.getItem(WN)}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[i,r]of Object.entries(n))Array.isArray(r)&&(s[i]=r.filter(a=>typeof a=="string"));return s},ey=(e,t)=>{try{e.setItem(WN,JSON.stringify(t))}catch(n){console.error("Could not save the known account hosts",n)}};function ese(e=localStorage){return{arrivals:(t,n)=>{const s=Jw(e);if(s===void 0)return[];const i=Jv(t),r=s[i];if(r===void 0)return ey(e,{...s,[i]:[...n]}),[];const a=n.filter(l=>!r.includes(l));return a.length>0&&ey(e,{...s,[i]:[...r,...a]}),a},add:(t,n)=>{const s=Jw(e),i=s==null?void 0:s[Jv(t)];s===void 0||i===void 0||i.includes(n)||ey(e,{...s,[Jv(t)]:[...i,n]})}}}const d6=ese();function KN(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 Qt(e)}}function XN({knownHosts:e=d6,onSettled:t,onClose:n}){const s=an(),[i,r]=h.useState(""),[a,l]=h.useState({kind:"entry"}),[c,u]=h.useState(),d=()=>{r(""),l({kind:"entry"})},f=()=>{if(!GN(i)||c!==void 0)return;const x=VN(i);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:y}=a;u(x?"confirm":"deny"),(x?s.confirmHostLink(g):s.denyHostLink(g)).then(v=>{if(u(void 0),!v.ok){l({...a,error:v.error});return}x&&s.state.status==="signed-in"&&(e.add({serverOrigin:s.state.serverOrigin,user:s.state.user},y.hostId),s.watchForHost(y.hostId)),l({kind:x?"confirmed":"denied",name:y.name}),t==null||t(x?"confirmed":"denied")})};switch(a.kind){case"entry":return o.jsx(nse,{code:i,error:a.error,isBusy:c==="lookup",onChange:x=>r(Jne(x)),onSubmit:f,...n===void 0?{}:{onCancel:n}});case"confirm":return o.jsx(ZN,{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(ise,{outcome:a.kind,name:a.name,onDone:n??d})}}function tse({requestId:e,navigate:t,knownHosts:n=d6,onSettled:s,onClose:i}){const r=an(),[a,l]=h.useState({kind:"looking"}),[c,u]=h.useState();h.useEffect(()=>{let f=!0;return r.lookupHostLinkRequest(e).then(p=>{f&&l(p.ok?{kind:"confirm",request:p.value}:{kind:"missing",error:p.error})}),()=>{f=!1}},[r,e]);const d=f=>{if(a.kind!=="confirm"||c!==void 0)return;const{request:p}=a;u(f?"confirm":"deny"),(f?r.confirmHostLinkRequest(e):r.denyHostLinkRequest(e)).then(x=>{if(u(void 0),!x.ok){l({...a,error:x.error});return}f&&r.state.status==="signed-in"&&(n.add({serverOrigin:r.state.serverOrigin,user:r.state.user},p.hostId),r.watchForHost(p.hostId)),l({kind:"leaving"}),s==null||s(),t(x.value)})};switch(a.kind){case"looking":case"leaving":return o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(Tt,{size:"sm"}),o.jsx(W,{type:"supporting",children:a.kind==="looking"?"Looking up the host…":"Handing the answer back to the host…"})]});case"missing":return o.jsxs(te,{gap:3,style:{width:"100%"},children:[o.jsx(Ie,{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.":Qt(a.error)}),i===void 0?null:o.jsx(pe,{children:o.jsx(K,{label:"Close",variant:"secondary",onClick:i})})]});case"confirm":return o.jsx(ZN,{request:a.request,error:a.error,busy:c,onConfirm:()=>d(!0),onDeny:()=>d(!1)})}}function nse({code:e,error:t,isBusy:n=!1,onChange:s,onSubmit:i,onCancel:r}){return o.jsxs(te,{gap:3,style:{width:"100%"},children:[o.jsx(pt,{label:"Code from the host",description:"The host's terminal shows it, like KXHN-BWCV.",placeholder:"XXXX-XXXX",value:VN(e),onChange:s,onEnter:i,width:"100%"}),t===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't find that host",description:KN(t,"lookup")}),o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(K,{label:"Continue",variant:"primary",isLoading:n,isDisabled:!GN(e),onClick:i}),r===void 0?null:o.jsx(K,{label:"Cancel",variant:"secondary",onClick:r})]})]})}const ej={width:"var(--spacing-4)",height:"var(--spacing-4)"},sse=e=>e.length>16?`${e.slice(0,8)}…${e.slice(-6)}`:e;function ZN({request:e,error:t,busy:n,onConfirm:s,onDeny:i,onBack:r}){const a=fo(1e3),[l,c]=h.useState(!1),u=Math.max(0,Math.ceil((e.expiresAt-a)/1e3)),d=u===0;return o.jsxs(te,{gap:4,style:{width:"100%"},children:[o.jsxs(te,{gap:1,children:[o.jsx(xn,{level:3,children:"Add this host to your account?"}),o.jsx(W,{type:"supporting",children:"Only confirm a computer you are setting up yourself right now."})]}),e.ipDiffers?o.jsx(Ie,{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(v$,{children:[o.jsx(uh,{label:"Name",children:o.jsx(W,{weight:"semibold",children:e.name})}),o.jsx(uh,{label:"System",children:o.jsx(W,{children:e.os})}),o.jsx(uh,{label:"Asked from",children:o.jsx(W,{type:"code",children:e.sourceIp})}),o.jsx(uh,{label:"Host ID",children:o.jsxs(pe,{gap:2,vAlign:"center",wrap:"wrap",children:[o.jsx(ia,{content:e.hostId,children:o.jsx("span",{tabIndex:0,"aria-label":`Host ID ${e.hostId}`,children:o.jsx(W,{type:"code",children:sse(e.hostId)})})}),o.jsx(K,{label:l?"Copied":"Copy",variant:"secondary",size:"sm",icon:l?o.jsx(Ea,{"aria-hidden":"true",style:ej}):o.jsx(Xb,{"aria-hidden":"true",style:ej}),onClick:()=>{var f;(f=navigator.clipboard)==null||f.writeText(e.hostId).then(()=>c(!0),()=>{})}})]})})]}),d?o.jsx(Ie,{status:"warning",title:"This request has expired",description:"Run pinomad up on the host again."}):o.jsxs(W,{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(Ie,{status:"error",title:"Couldn't answer the host",description:KN(t,"answer")}),o.jsxs(pe,{gap:2,vAlign:"center",hAlign:"between",wrap:"wrap",children:[o.jsxs(pe,{gap:2,children:[o.jsx(K,{label:"Confirm",variant:"primary",isLoading:n==="confirm",isDisabled:d||n==="deny",onClick:s}),o.jsx(K,{label:"Deny",variant:"secondary",isLoading:n==="deny",isDisabled:n==="confirm",onClick:i})]}),r===void 0?null:o.jsx(K,{label:"Enter another code",variant:"ghost",isDisabled:n!==void 0,onClick:r})]})]})}function ise({outcome:e,name:t,onDone:n}){return o.jsxs(te,{gap:3,style:{width:"100%"},children:[e==="confirmed"?o.jsx(Ie,{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(Ie,{status:"info",title:`Turned ${t} away`,description:"Its terminal will say the join was denied."}),o.jsx(pe,{children:o.jsx(K,{label:"Done",variant:"secondary",onClick:n})})]})}const YN=e=>`curl -fsSL https://pinomad.si/install.sh | sh -s -- up --origin ${e.replace(/\/+$/,"")}`,ty=e=>e instanceof Error?e.message:String(e);var Br,Ed,$d,_a,xi,yo,QN;class rse{constructor(t){oe(this,xi);oe(this,Br,{phase:{kind:"idle"},finished:0});oe(this,Ed,new Set);oe(this,$d);oe(this,_a);ve(this,"snapshot",()=>j(this,Br));ve(this,"subscribe",t=>(j(this,Ed).add(t),()=>j(this,Ed).delete(t)));V(this,_a,t)}start(t,n){return j(this,$d)??V(this,$d,C(this,xi,QN).call(this,t,n).finally(()=>V(this,$d,void 0))),j(this,$d)}cancel(){j(this,Br).phase.kind==="installing"&&j(this,_a).cancelInstall()}}Br=new WeakMap,Ed=new WeakMap,$d=new WeakMap,_a=new WeakMap,xi=new WeakSet,yo=function(t,n=j(this,Br).finished){V(this,Br,{phase:t,finished:n});for(const s of j(this,Ed))s()},QN=async function(t,n){const s=j(this,Br).phase;let i=s.kind==="failed"&&s.step==="join"?s.lines:[];if(!(s.kind==="failed"&&s.step==="join")){C(this,xi,yo).call(this,{kind:"installing",lines:i});const l=j(this,_a).onSetupLines(u=>{i=u,j(this,Br).phase.kind==="installing"&&C(this,xi,yo).call(this,{kind:"installing",lines:i})}),c=await j(this,_a).install().catch(u=>({outcome:"failed",message:ty(u)})).finally(l);if(c.outcome==="cancelled")return C(this,xi,yo).call(this,{kind:"idle"});if(c.outcome==="failed")return C(this,xi,yo).call(this,{kind:"failed",step:"install",message:c.message,lines:i})}C(this,xi,yo).call(this,{kind:"joining"});const r=await n().catch(l=>({ok:!1,message:ty(l)}));if(!r.ok)return C(this,xi,yo).call(this,{kind:"failed",step:"join",message:r.message,lines:i});const a=await j(this,_a).join(t,r.token).catch(l=>({ok:!1,message:ty(l)}));if(!a.ok)return C(this,xi,yo).call(this,{kind:"failed",step:"join",message:a.message,lines:i});C(this,xi,yo).call(this,{kind:"idle"},j(this,Br).finished+1)};const tj=new WeakMap;function ose(e){let t=tj.get(e);return t===void 0&&tj.set(e,t=new rse(e)),t}function ase(e){const t=ose(e),n=h.useSyncExternalStore(t.subscribe,t.snapshot),s=h.useCallback((r,a)=>void t.start(r,a),[t]),i=h.useCallback(()=>t.cancel(),[t]);return{...n,start:s,cancel:i}}const nj=6;function JN({bridge:e,serverOrigin:t,onFinished:n}){const s=an(),{phase:i,finished:r,start:a,cancel:l}=ase(e),[c,u]=h.useState(!1),d=h.useRef(r);h.useEffect(()=>{r!==d.current&&(d.current=r,u(!0),n())},[r,n]);const f=async()=>{const x=await s.createJoinToken();return x.ok?{ok:!0,token:x.value.token}:{ok:!1,message:Qt(x.error)}},p=()=>a(t,f);switch(i.kind){case"idle":return c?o.jsx(ny,{label:"Starting the host…"}):o.jsx(pe,{children:o.jsx(K,{label:"Set up this Mac",variant:"secondary",onClick:p})});case"installing":return o.jsxs(te,{gap:2,children:[o.jsx(ny,{label:"Installing PiNomad…"}),o.jsx(sj,{lines:i.lines}),o.jsx(pe,{children:o.jsx(K,{label:"Cancel",variant:"secondary",size:"sm",onClick:l})})]});case"joining":return o.jsx(ny,{label:"Adding this Mac to your account…"});case"failed":return o.jsxs(te,{gap:3,children:[o.jsx(Ie,{status:"error",title:i.step==="install"?"Couldn't install PiNomad":"Couldn't add this Mac to your account",description:i.message,endContent:o.jsx(K,{label:"Try again",variant:"secondary",onClick:p})}),o.jsx(sj,{lines:i.lines}),o.jsxs(te,{gap:2,children:[o.jsx(W,{type:"supporting",children:"Or run it in your own terminal:"}),o.jsx(i0,{code:YN(t),hasCopyButton:!0,isWrapped:!0,width:"100%"})]})]})}}function ny({label:e}){return o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(Tt,{size:"sm"}),o.jsx(W,{type:"supporting",children:e})]})}const lse={fontFamily:"var(--font-family-code)",fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)",whiteSpace:"pre-wrap",overflowWrap:"anywhere"};function sj({lines:e}){return e.length===0?null:o.jsx("div",{role:"log","aria-label":"Install progress",style:lse,children:e.slice(-nj).map((t,n)=>o.jsx("div",{children:t},Math.max(0,e.length-nj)+n))})}function e_({serverOrigin:e}){const t=PN(),{state:n,pollUntilInstalled:s}=UN(t);return o.jsxs(te,{gap:4,style:{width:"100%"},children:[o.jsxs(te,{gap:2,children:[o.jsx(W,{type:"supporting",children:"On the computer you want to add, open a terminal and run:"}),o.jsx(i0,{code:YN(e),hasCopyButton:!0,isWrapped:!0,width:"100%"})]}),t!==void 0&&(n==null?void 0:n.kind)==="not-installed"?o.jsxs(te,{gap:2,children:[o.jsx(W,{type:"supporting",children:"Or set up this Mac, with no terminal:"}),o.jsx(JN,{bridge:t,serverOrigin:e,onFinished:s})]}):null,o.jsxs(te,{gap:2,children:[o.jsx(W,{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(XN,{onSettled:i=>i==="confirmed"&&s()})]}),o.jsx(cse,{})]})}function cse(){const e=an(),[t,n]=h.useState(!1),[s,i]=h.useState(),[r,a]=h.useState(),[l,c]=h.useState(!1),u=()=>{c(!0),a(void 0),e.createJoinToken().then(f=>{c(!1),f.ok?i(f.value):a(f.error)})},d=f=>{n(f),f&&s===void 0&&!l&&u()};return o.jsx(Rm,{trigger:o.jsx(W,{type:"supporting",children:"Advanced: join with a one-time token"}),isOpen:t,onOpenChange:d,children:o.jsxs(te,{gap:2,children:[o.jsx(W,{type:"supporting",children:"For scripts: this command joins without a code to confirm. Anyone who has it can add a host."}),s===void 0?r===void 0?o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(Tt,{size:"sm"}),o.jsx(W,{type:"supporting",children:"Creating a command…"})]}):o.jsx(Ie,{status:"error",title:"Couldn't create a join command",description:Qt(r),endContent:o.jsx(K,{label:"Try again",variant:"secondary",isLoading:l,onClick:u})}):o.jsx(use,{token:s,onRenew:u}),s!==void 0&&r!==void 0?o.jsx(Ie,{status:"error",title:"Couldn't create a new command",description:Qt(r)}):null]})})}function use({token:e,onRenew:t}){const n=fo(1e3),s=Math.max(0,Math.ceil((e.expiresAt-n)/1e3));return o.jsxs(te,{gap:2,children:[o.jsx(i0,{code:e.command,hasCopyButton:!0,isWrapped:!0,width:"100%"}),s===0?o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(W,{type:"supporting",children:"Expired"}),o.jsx(K,{label:"New command",variant:"secondary",size:"sm",onClick:t})]}):o.jsxs(W,{type:"supporting",hasTabularNumbers:!0,children:["Works once · expires in ",Math.floor(s/60),":",String(s%60).padStart(2,"0")]})]})}function t_({onClose:e}){const t=an(),n=t.state,[s,i]=h.useState(!1),r=()=>{n.status==="signed-in"&&t.refreshHosts(),e()},a=o.jsxs(te,{gap:2,children:[o.jsx(W,{type:"supporting",children:"Paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),o.jsx(uf,{})]});return o.jsx(os,{"aria-label":"Add a host",isOpen:!0,onOpenChange:l=>l?void 0:r(),purpose:"form",width:520,children:o.jsx(Wn,{header:o.jsx(Ts,{title:"Add a host",onOpenChange:()=>r()}),content:o.jsx(Kn,{children:o.jsx("div",{style:{padding:"var(--spacing-2)"},children:n.status!=="signed-in"?a:o.jsxs(te,{gap:4,children:[o.jsx(e_,{serverOrigin:n.serverOrigin}),s?a:o.jsx(pe,{children:o.jsx(K,{label:"Have a pairing link?",variant:"ghost",size:"sm",onClick:()=>i(!0)})})]})})}),footer:o.jsx(jr,{children:o.jsx(pe,{gap:2,hAlign:"end",children:o.jsx(K,{label:"Done",variant:"secondary",onClick:r})})})})})}function A0({title:e,description:t,children:n,action:s,onClose:i}){return o.jsx(os,{"aria-label":e,isOpen:!0,onOpenChange:r=>r?void 0:i(),purpose:"form",width:460,children:o.jsx(Wn,{header:o.jsx(Ts,{title:e,...t===void 0?{}:{subtitle:t},onOpenChange:()=>i()}),content:o.jsx(Kn,{children:n===void 0?null:o.jsx(te,{gap:3,style:{padding:"var(--spacing-2)"},children:n})}),footer:o.jsx(jr,{children:o.jsxs(pe,{gap:2,hAlign:"end",children:[o.jsx(K,{label:"Cancel",variant:"secondary",onClick:i}),s]})})})})}function dse({account:e,navigate:t=n=>window.location.assign(n)}){const[n,s]=h.useState(),[i,r]=h.useState([]),[a,l]=h.useState(!1),[c,u]=h.useState(),[d,f]=h.useState(),p=()=>{e.identities().then(k=>{k.ok?s(k.value):k.error.status===404&&l(!0)})};if(h.useEffect(()=>{if(p(),e.providerFlow===void 0)return;let k=!0;return e.authMethods().then(w=>{k&&w.ok&&r(w.value.providers)}),()=>{k=!1}},[e]),a)return o.jsx(fse,{account:e});if(n===void 0)return o.jsxs(te,{gap:2,children:[o.jsx(W,{weight:"semibold",children:"Sign-in methods"}),o.jsx(Tt,{size:"sm"})]});const x=new Set(n.identities.map(k=>k.provider)),g=e.providerFlow===void 0?[]:IN(i).filter(k=>!x.has(k.id)),y=k=>{u(void 0),f(k),k!==void 0&&p()},v=c!==void 0,m=k=>{f(void 0),u(k)};return o.jsxs(te,{gap:2,children:[o.jsx(Pn,{title:"Sign-in methods",children:o.jsxs(wn,{hasDividers:!0,"aria-label":"Sign-in methods",children:[o.jsx(yt,{label:"Password",startContent:o.jsx(sy,{children:o.jsx(aN,{"aria-hidden":"true",style:{width:18,height:18}})}),description:n.hasPassword?"Set":"Not set",endContent:o.jsx(K,{label:n.hasPassword?"Change password":"Set password",variant:"secondary",size:"sm",isDisabled:v,onClick:()=>m({kind:"password"})})}),n.identities.map(k=>o.jsx(yt,{label:Ys(k.provider),description:k.email,startContent:o.jsx(sy,{children:o.jsx(Xg,{provider:k.provider,size:20})}),endContent:o.jsx(ou,{label:`More for ${Ys(k.provider)}`,size:"sm",isDisabled:v,items:[{label:"Remove",onClick:()=>m({kind:"remove",provider:k.provider})}]})},k.provider)),g.map(k=>o.jsx(yt,{label:k.name,description:"Not linked",startContent:o.jsx(sy,{children:o.jsx(Xg,{provider:k.id,size:20})}),endContent:o.jsx(K,{label:"Link","aria-label":`Link ${k.name}`,variant:"secondary",size:"sm",isDisabled:v,onClick:()=>m({kind:"link",provider:k.id})})},k.id))]})}),d===void 0?null:o.jsx(W,{type:"supporting",children:d}),(c==null?void 0:c.kind)==="password"?o.jsx(n_,{account:e,hasPassword:n.hasPassword,onClose:y}):(c==null?void 0:c.kind)==="remove"?o.jsx(y5,{account:e,title:`Remove ${Ys(c.provider)}?`,description:`You won't be able to sign in with ${Ys(c.provider)} until you link it again.`,label:`Remove ${Ys(c.provider)}`,variant:"destructive",errorTitle:"Couldn't remove it",action:k=>e.unlinkProvider(c.provider,k),onDone:()=>y(`${Ys(c.provider)} removed.`),onCancel:()=>y()}):(c==null?void 0:c.kind)==="link"?o.jsx(y5,{account:e,title:`Link ${Ys(c.provider)}`,description:e.providerFlow==="loopback"?`Your browser opens ${Ys(c.provider)} to choose the account. Come back here when it's done.`:`You'll go to ${Ys(c.provider)} to choose the account, then come back here.`,label:`Continue to ${Ys(c.provider)}`,variant:"primary",errorTitle:"Couldn't start linking",action:async k=>{const w=await e.linkProvider(c.provider,k);return!w.ok||w.value.redirect===void 0?w:(t(w.value.redirect),new Promise(()=>{}))},onDone:()=>y(`${Ys(c.provider)} linked.`),onCancel:()=>y()}):null]})}function y5({account:e,title:t,description:n,label:s,variant:i,errorTitle:r,action:a,onDone:l,onCancel:c,extra:u,isReady:d=!0}){const[f,p]=h.useState(!1),[x,g]=h.useState(),y=h.useRef(!0);h.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]);const v=()=>{!m.ready||!d||f||(p(!0),g(void 0),(async()=>{const k=await m.confirm(),w=k.ok?await a(k.value):k;y.current&&(p(!1),w.ok?l():(w.error.code==="invalid_reauth"&&m.reset(),g(w.error)))})())},m=_f(e,v);return o.jsxs(A0,{title:t,...n===void 0?{}:{description:n},onClose:c,action:o.jsx(K,{label:s,variant:i,isLoading:f,isDisabled:!m.ready||!d,onClick:v}),children:[m.field,u==null?void 0:u(v),x===void 0?null:o.jsx(Ie,{status:"error",title:r,description:Qt(x)})]})}function n_({account:e,hasPassword:t,onClose:n}){const[s,i]=h.useState(""),r=t?"Change password":"Set password";return o.jsx(y5,{account:e,title:r,label:r,variant:"primary",errorTitle:t?"Couldn't change the password":"Couldn't set the password",isReady:s!=="",action:async a=>l6(s)<c6?{ok:!1,error:{code:"weak_password"}}:e.changePassword({confirmation:a,newPassword:s}),onDone:()=>n(t?"Password changed. Your other devices were signed out.":"Password set."),onCancel:()=>n(),extra:a=>o.jsx(pt,{label:"New password",description:"Your other devices will be signed out.",type:"password",value:s,onChange:i,onEnter:a,width:"100%",...a6})})}function fse({account:e}){const[t,n]=h.useState(!1),[s,i]=h.useState();return t?o.jsx(n_,{account:e,hasPassword:!0,onClose:r=>{n(!1),i(r)}}):o.jsxs(te,{gap:1,children:[o.jsx(pe,{gap:2,children:o.jsx(K,{label:"Change password",variant:"secondary",size:"sm",onClick:()=>{i(void 0),n(!0)}})}),s===void 0?null:o.jsx(W,{type:"supporting",children:s})]})}function sy({children:e}){return o.jsx("span",{"aria-hidden":"true",className:"inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-[var(--color-border)]",children:e})}const ij=3e4;function hse(e,t){const[n,s]=h.useState(),i=(t==null?void 0:t.trim())??"",r=t===void 0||xN(i);return h.useEffect(()=>{if(!r)return;let a=!0;const l=setTimeout(()=>{e.authMethods(t===void 0?void 0:i).then(c=>{a&&c.ok&&s({key:i,methods:c.value})})},t===void 0?0:400);return()=>{a=!1,clearTimeout(l)}},[e,r,i,t]),(n==null?void 0:n.key)===i?n.methods:void 0}function pse({account:e,server:t,initialError:n}){const[s,i]=h.useState("sign-in"),[r,a]=h.useState(""),[l,c]=h.useState(()=>n===void 0?void 0:{status:"error",title:"Couldn't sign in",description:Qt({code:n})}),u=hse(e,t==null?void 0:t.origin),d=t===void 0?void 0:t.origin.trim(),f=d===void 0?{}:{serverOrigin:d},p=g=>{c(void 0),i(g)},x={"sign-in":"Sign in",create:"Create an account",reset:"Reset your password"}[s];return o.jsxs(te,{gap:3,style:{width:"100%"},children:[o.jsxs(te,{gap:1,children:[o.jsx(xn,{level:3,children:x}),s==="sign-in"?o.jsx(W,{type:"supporting",children:"See the hosts on your account and connect without a QR code."}):null]}),l===void 0?null:o.jsx(Ie,{status:l.status,title:l.title,description:l.description}),t===void 0?null:o.jsx(pt,{label:"Server",placeholder:"https://nomad.example.com",value:t.origin,onChange:t.setOrigin,width:"100%",autoComplete:"url"}),s==="sign-in"?o.jsx(xse,{account:e,methods:u,email:r,onEmail:a,target:f,onStep:p,onError:g=>c(g===void 0?void 0:{status:"error",title:"Couldn't sign in",description:Qt(g)})}):o.jsx(gse,{kind:s,email:r,onEmail:a,send:g=>s==="create"?e.requestSignupCode({email:g,...f}):e.requestPasswordReset({email:g,...f}),finish:(g,y,v)=>s==="create"?e.register({email:g,code:y,password:v,...f}):e.resetPassword({email:g,code:y,password:v,...f}),onDone:()=>{s==="reset"&&(i("sign-in"),c({status:"success",title:"Password reset",description:"Password reset. Sign in with your new password."}))},onBack:()=>p("sign-in")},s)]})}function xse({account:e,methods:t,email:n,onEmail:s,target:i,onStep:r,onError:a}){const[l,c]=h.useState(""),[u,d]=h.useState(),f=e.providerFlow===void 0?[]:IN((t==null?void 0:t.providers)??[]),p="serverOrigin"in i&&i.serverOrigin==="",x=n.trim()!==""&&l!==""&&!p,g=m=>{d(void 0),m.ok||a(m.error)},y=()=>{!x||u!==void 0||(d("password"),a(void 0),e.login({username:n.trim(),password:l,...i}).then(g))},v=m=>{u===void 0&&(d(m),a(void 0),e.providerSignIn({provider:m,...i}).then(g))};return o.jsxs(te,{gap:3,children:[f.length===0?null:o.jsxs(te,{gap:2,children:[f.map(m=>o.jsx(K,{label:`Continue with ${m.name}`,variant:"secondary",width:"100%",icon:o.jsx(Xg,{provider:m.id}),isLoading:u===m.id,isDisabled:u!==void 0&&u!==m.id,onClick:()=>v(m.id)},m.id)),o.jsx(Po,{label:"or"})]}),o.jsx(pt,{label:"Email",value:n,onChange:s,onEnter:y,width:"100%",autoComplete:"username"}),o.jsx(pt,{label:"Password",type:"password",value:l,onChange:c,onEnter:y,width:"100%",autoComplete:"current-password"}),o.jsx(K,{label:"Sign in",variant:"primary",width:"100%",isLoading:u==="password",isDisabled:!x,onClick:y}),(t==null?void 0:t.email)!==!0?null:o.jsxs(pe,{gap:2,hAlign:"between",children:[o.jsx(K,{label:"Forgot password?",variant:"ghost",size:"sm",onClick:()=>r("reset")}),t.registration?o.jsx(K,{label:"Create an account",variant:"ghost",size:"sm",onClick:()=>r("create")}):null]})]})}function gse({kind:e,email:t,onEmail:n,send:s,finish:i,onDone:r,onBack:a}){const[l,c]=h.useState(),[u,d]=h.useState(0),[f,p]=h.useState(""),[x,g]=h.useState(""),[y,v]=h.useState(!1),[m,k]=h.useState(),w=mse(l!==void 0&&Date.now()-u<ij),S=Math.max(0,Math.ceil((u+ij-w)/1e3)),E=N=>{N===""||y||(v(!0),k(void 0),s(N).then(M=>{if(v(!1),!M.ok){k(M.error);return}c(N),d(Date.now())}))},A=()=>{if(!(l===void 0||f.trim()===""||x===""||y)){if(l6(x)<c6){k({code:"weak_password"});return}v(!0),k(void 0),i(l,f.trim(),x).then(N=>{v(!1),N.ok?r():k(N.error)})}},z=m===void 0?null:o.jsx(Ie,{status:"error",title:l===void 0?"Couldn't send the code":e==="create"?"Couldn't create the account":"Couldn't reset the password",description:Qt(m)});return l===void 0?o.jsxs(te,{gap:3,children:[o.jsx(pt,{label:"Email",type:"email",value:t,onChange:n,onEnter:()=>E(t.trim()),width:"100%",autoComplete:"email"}),z,o.jsx(K,{label:"Send code",variant:"primary",width:"100%",isLoading:y,isDisabled:t.trim()==="",onClick:()=>E(t.trim())}),o.jsx(pe,{children:o.jsx(K,{label:"Sign in instead",variant:"ghost",size:"sm",onClick:a})})]}):o.jsxs(te,{gap:3,children:[o.jsxs(W,{children:["Enter the 6-digit code we sent to ",l,"."]}),o.jsx(pt,{label:"Code",value:f,onChange:p,onEnter:A,width:"100%",...o6}),o.jsx(pt,{label:"New password",type:"password",value:x,onChange:g,onEnter:A,width:"100%",...a6}),z,o.jsx(K,{label:e==="create"?"Create account":"Reset password",variant:"primary",width:"100%",isLoading:y,isDisabled:f.trim()===""||x==="",onClick:A}),o.jsxs(pe,{gap:2,hAlign:"between",children:[o.jsx(K,{label:S>0?`Resend code (${S}s)`:"Resend code",variant:"ghost",size:"sm",isDisabled:S>0||y,onClick:()=>E(l)}),o.jsx(K,{label:"Use a different email",variant:"ghost",size:"sm",onClick:()=>{c(void 0),p(""),k(void 0)}})]})]})}function mse(e){const[t,n]=h.useState(Date.now);return h.useEffect(()=>{if(!e)return;n(Date.now());const s=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(s)},[e]),t}const vse={overview:"Account",hosts:"Hosts on this account"};function u2({initialPage:e="overview",page:t}){const n=an(),{state:s}=n,[i,r]=h.useState(e),[a,l]=h.useState();switch(h.useEffect(()=>{s.status==="signed-in"&&l(void 0)},[s.status]),s.status){case"unavailable":return null;case"checking":return o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(Tt,{size:"sm"}),o.jsx(W,{type:"supporting",children:"Checking for an account…"})]});case"signed-out":return o.jsxs(te,{gap:3,style:{width:"100%"},children:[a===void 0?null:o.jsx(Ie,{...a}),o.jsx(yse,{account:n,state:s})]});case"signed-in":{const c=t??i,u=o.jsx(kse,{page:c,account:n,state:s,onNotice:l});return t!==void 0||c==="overview"?u:o.jsxs(te,{gap:4,style:{width:"100%"},children:[o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(ht,{label:"Back to account",icon:o.jsx(fu,{"aria-hidden":"true"}),variant:"ghost",size:"sm",onClick:()=>r("overview")}),o.jsx(xn,{level:3,children:vse[c]})]}),u]})}}}function yse({account:e,state:t}){const[n,s]=h.useState(t.serverOrigin??LN),i=t.mode==="bearer"?{origin:n,setOrigin:s}:void 0,[r]=h.useState(()=>E0().error);return h.useEffect(()=>{r!==void 0&&Kg("error")},[r]),o.jsx(pse,{account:e,server:i,initialError:r})}function kse({page:e,account:t,state:n,onNotice:s}){switch(e){case"overview":return o.jsx(bse,{account:t,state:n,onNotice:s});case"hosts":return o.jsx(Ese,{state:n})}}function s_(){const[e]=h.useState(()=>{const{linked:t,error:n}=E0();return t!==void 0||n!==void 0?{linked:t,error:n}:void 0});return h.useEffect(()=>{e!==void 0&&(Kg("linked"),Kg("error"))},[e]),(e==null?void 0:e.linked)!==void 0?o.jsx(Ie,{status:"success",title:`${Ys(e.linked)} linked`,description:`You can sign in with ${Ys(e.linked)} now.`}):(e==null?void 0:e.error)!==void 0?o.jsx(Ie,{status:"error",title:"Couldn't link the account",description:Qt({code:e.error})}):null}function bse({account:e,state:t,onNotice:n}){const s=new URL(t.serverOrigin).host,[i,r]=h.useState();return o.jsxs(te,{gap:6,style:{width:"100%"},children:[o.jsx(s_,{}),o.jsxs(pe,{gap:3,vAlign:"center",children:[o.jsx(G4,{name:t.user,size:"lg",tooltip:!1}),o.jsxs(te,{gap:0,className:"min-w-0 flex-1",children:[o.jsx(xn,{level:3,style:{overflowWrap:"anywhere"},children:t.user}),o.jsx(W,{type:"supporting",children:s})]}),o.jsx(K,{label:"Sign out",variant:"secondary",size:"sm",onClick:()=>r("sign-out")})]}),o.jsx(Wne,{account:e,email:t.email}),o.jsx(dse,{account:e}),o.jsx(Ase,{account:e,hosts:t.hosts}),o.jsx(Pn,{title:"Danger zone",tone:"danger",children:o.jsxs("ul",{"aria-label":"Danger zone",className:$0,children:[o.jsx(rj,{title:"Sign out everywhere",description:"Ends every session on every device, including this one.",action:o.jsx(K,{label:"Sign out everywhere",variant:"secondary",size:"sm",onClick:()=>r("everywhere")})}),o.jsx(rj,{title:"Delete account",description:`Removes your account from ${s}. Devices stay registered on your hosts.`,action:o.jsx(K,{label:"Delete account",variant:"secondary",size:"sm",onClick:()=>r("delete")})})]})}),i==="sign-out"?o.jsx(jse,{account:e,server:s,onNotice:n,onClose:()=>r(void 0)}):i==="everywhere"?o.jsx(Sse,{account:e,onNotice:n,onClose:()=>r(void 0)}):i==="delete"?o.jsx(Cse,{account:e,server:s,onNotice:n,onClose:()=>r(void 0)}):null]})}function rj({title:e,description:t,action:n}){return o.jsxs("li",{className:"flex flex-wrap items-center gap-x-6 gap-y-2 px-4 py-3",children:[o.jsxs(te,{gap:0,className:"min-w-[14rem] flex-1",children:[o.jsx(W,{children:e}),o.jsx(W,{type:"supporting",children:t})]}),n]})}function wse(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."}const i_=e=>e===void 0?void 0:{status:"warning",title:"Sign-out not confirmed",description:e};function jse({account:e,server:t,onNotice:n,onClose:s}){const[i,r]=h.useState(!1);return o.jsx(A0,{title:`Sign out of ${t}?`,description:"This device stays paired with its hosts, unless it's a shared computer.",onClose:s,action:o.jsx(K,{label:"Sign out",variant:"destructive",onClick:()=>{s(),n(void 0),e.logout({revoke:i}).then(a=>n(i_(wse(a,i))))}}),children:o.jsx(n0,{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:i,onChange:r})})}function Sse({account:e,onNotice:t,onClose:n}){return o.jsx(A0,{title:"Sign out everywhere?",description:"Every session on every device ends, including this one. Devices stay paired with their hosts.",onClose:n,action:o.jsx(K,{label:"Sign out everywhere",variant:"destructive",onClick:()=>{n(),t(void 0),e.revokeAll().then(s=>{s.ok||t(i_("Other devices may still be signed in. Sign in and try Sign out everywhere again."))})}})})}function Cse({account:e,server:t,onNotice:n,onClose:s}){const[i,r]=h.useState(!1),[a,l]=h.useState(),c=()=>{!u.ready||i||(r(!0),l(void 0),(async()=>{const d=await u.confirm();return d.ok?e.deleteAccount({confirmation:d.value}):d})().then(d=>{if(d.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}r(!1),d.error.code==="invalid_reauth"&&u.reset(),l(d.error)}))},u=_f(e,c);return o.jsxs(A0,{title:"Delete your account?",description:`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.`,onClose:s,action:o.jsx(K,{label:"Delete account",variant:"destructive",isLoading:i,isDisabled:!u.ready,onClick:c}),children:[u.field,a===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't delete the account",description:Qt(a)})]})}function Ese({state:e}){const t=DN(),[n,s]=h.useState(!1),{hosts:i}=Ns(),r=BN(e,i);return o.jsxs(te,{gap:3,style:{width:"100%"},children:[o.jsx(s_,{}),o.jsx(HN,{state:e,pairing:t}),e.hosts.length===0?o.jsx(W,{type:"supporting",children:"No hosts yet."}):r.length===0?o.jsx(W,{type:"supporting",children:"Every host on your account is paired with this device."}):o.jsx(Pn,{children:o.jsx(qN,{state:e,hosts:r,pairing:t,label:"Hosts on your account"})}),o.jsx(pe,{children:o.jsx(K,{label:"Add a host",variant:"secondary",size:"sm",onClick:()=>s(!0)})}),n?o.jsx(t_,{onClose:()=>s(!1)}):null]})}const oj=(e,t)=>{const n=y0(e,t);return n==="now"?"just now":`${n} ago`},$se={registered:"registered",revoking:"waiting for the host to revoke",revoked:"revoked"};function Ase({account:e,hosts:t}){const n=fo(6e4),[s,i]=h.useState(),[r,a]=h.useState(),[l,c]=h.useState(!1),[u,d]=h.useState(),f=()=>e.listDevices().then(p=>{p.ok?(i(p.value),a(void 0)):p.error.status===404?c(!0):a(p.error)});return h.useEffect(()=>{f()},[e]),l?null:o.jsxs(te,{gap:2,style:{width:"100%"},children:[r===void 0?null:o.jsx(Ie,{status:"warning",title:"Couldn't load devices",description:Qt(r),endContent:o.jsx(K,{label:"Retry",variant:"secondary",size:"sm",onClick:()=>void f()})}),s===void 0?r===void 0?o.jsx(Pn,{title:"Signed-in devices",children:o.jsx(pe,{style:{padding:"var(--spacing-3)"},children:o.jsx(Tt,{size:"sm"})})}):null:o.jsx(Pn,{title:"Signed-in devices",children:o.jsx(wn,{hasDividers:!0,"aria-label":"Signed-in devices",children:s.map(p=>o.jsx(Mse,{device:p,now:n,isBusy:u!==void 0,onRemove:()=>d(p)},p.id))})}),u===void 0?null:o.jsx(zse,{account:e,device:u,hosts:t,onClose:p=>{d(void 0),p&&f()}})]})}function Mse({device:e,now:t,isBusy:n,onRemove:s}){const i=e.name??"Unknown device",r=`Last sign-in ${oj(e.lastSeenAt,t)}`,a=e.current?o.jsx($s,{label:"This device",size:"sm"}):e.kickedAt!==void 0?o.jsx($s,{label:"Removed",color:"gray",size:"sm"}):o.jsx(ou,{label:`More for ${i}`,size:"sm",isDisabled:n,items:[{label:"Remove",onClick:s}]});return o.jsx(yt,{label:i,description:o.jsxs(te,{gap:0,children:[o.jsx(W,{type:"inherit",children:e.kickedAt===void 0?r:`${r} · removed ${oj(e.kickedAt,t)}`}),e.hosts.length===0?null:o.jsx(W,{type:"inherit",children:e.hosts.map(l=>`${l.name}: ${$se[l.state]}`).join(" · ")})]}),endContent:a})}const Tse=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function zse({account:e,device:t,hosts:n,onClose:s}){const[i,r]=h.useState(!1),[a,l]=h.useState(),c=t.name??"this device",u=n.filter(x=>x.host.deviceReports===!1).map(x=>x.host.name),d=()=>{!f.ready||i||(r(!0),l(void 0),(async()=>{const x=await f.confirm(),g=x.ok?await e.kickDevice({id:t.id,confirmation:x.value}):x;r(!1),g.ok||g.error.code==="not_found"?s(!0):(g.error.code==="invalid_reauth"&&f.reset(),l(g.error))})())},f=_f(e,d),p=`This signs ${c} 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.`+(u.length===0?"":u.length===1?` The host ${u[0]} can't be asked. If ${c} joined it, revoke it in that host's Devices.`:` The hosts ${Tse(u)} can't be asked. If ${c} joined them, revoke it in each one's Devices.`);return o.jsxs(A0,{title:`Remove ${c}?`,description:p,onClose:()=>s(!1),action:o.jsx(K,{label:"Remove device",variant:"destructive",isLoading:i,isDisabled:!f.ready,onClick:d}),children:[f.field,a===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't remove the device",description:Qt(a)})]})}function M0({initialPage:e,onClose:t}){return o.jsx(os,{isOpen:!0,onOpenChange:n=>n?void 0:t(),width:480,children:o.jsx(Wn,{header:o.jsx(Ts,{title:"Account",onOpenChange:()=>t()}),content:o.jsx(Kn,{children:o.jsx("div",{style:{padding:"var(--spacing-2)"},children:o.jsx(u2,{...e===void 0?{}:{initialPage:e}})})})})})}function Nse({stayClosed:e}){const[t,n]=h.useState(()=>{const{linked:s,error:i}=E0();return!e&&(s!==void 0||i!==void 0)});return t?o.jsx(M0,{onClose:()=>n(!1)}):null}function _se({hostKey:e}){const t=an(),{focusHost:n}=Ns(),[s,i]=h.useState(!1),[r,a]=h.useState();h.useEffect(()=>t.hostRejected(e),[t,e]);const l=f6(t.state,e);if(l===void 0)return null;const c=()=>{i(!0),a(void 0),t.pairHost(l.host.hostId).then(u=>{i(!1),u.ok?n(u.value.hostKey):a(u.error)})};return o.jsxs(te,{gap:2,hAlign:"start",children:[o.jsx(K,{label:"Pair again with your account",variant:"primary",isLoading:s,isDisabled:l.host.pairing!=="available",onClick:c}),r===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't pair",description:Qt(r)})]})}function f6(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}const r_={p2p:"P2P",relay:"Relay",direct:"Direct",loopback:"Local"},$1={loopback:"Local",lan:"LAN",tailnet:"Tailnet",public:"Internet",unknown:"Unknown"},Rse={signal:"Signal",ice:"ICE",noise:"Noise",warm:"Warm-up",commit:"Switch",liveness:"Liveness"};function Ise(e){if(e!==void 0){if(e.remote.scope!=="unknown")return e.remote.scope;if(e.local.scope!=="unknown")return e.local.scope}}function o_(e){const t=Ise(e);return t===void 0?void 0:$1[t]}function Lse(e){if(e.path!=="p2p")return r_[e.path];const t=o_(e.selectedPair);return t===void 0?"P2P":`P2P · ${t}`}function Ose(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 Dse(e){const t=Rse[e.stage],n=e.reason===void 0?t:`${t} — ${e.reason}`,s=o_(e.pair);return[n,Ose(e.agoMs),...s===void 0?[]:[`on ${s}`]].join(" · ")}function Bse(e){const t=[e.type,e.address].filter(n=>n!==void 0&&n.trim()!=="").join(" · ");return t===""?$1[e.scope]:`${t} (${$1[e.scope]})`}const h6=e=>{try{return new URL(e).hostname.toLowerCase()}catch{return}},a_=e=>{try{return new URL(e).host}catch{return e}};function Hse(e){const t=CN(a_(e));if(t!=="unknown")return t;const n=h6(e)??"";return n.endsWith(".ts.net")?"tailnet":n.endsWith(".local")?"lan":"unknown"}function qse(e,t){const n=t!==void 0&&h6(e.url)===t;if(e.role==="relay")return n?"Account relay":"Relay";if(e.role==="loopback")return $1.loopback;if(e.role==="legacy"&&n)return"Account relay";const s=Hse(e.url);return s==="unknown"?"Direct":$1[s]}function Pse(e,t={}){const n=af(e.url,e.endpointSet,t.pageProtocol===void 0?{}:{pageProtocol:t.pageProtocol}),s=new Set(ox(n,e.connectionMode??"auto").map(a=>a.url)),i=e.account===void 0?void 0:h6(e.account.serverOrigin),r=a=>a.unsupported!==void 0?"blocked":s.has(a.url)?"available":"off";return n.map(a=>({url:a.url,label:qse(a,i),address:a_(a.url),state:r(a)}))}const l_=h.createContext(void 0);function Use(e){const t=h.useContext(l_),n=e==null?void 0:e.title,s=e==null?void 0:e.back;return h.useEffect(()=>{if(!(t===void 0||n===void 0||s===void 0))return t.set({title:n,back:s}),()=>t.set(void 0)},[t,n,s]),(t==null?void 0:t.ownsBack)===!0}const Fse={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 Vse(e){const t=Math.max(1,Math.ceil(e/1e3));return t>=60?`${Math.ceil(t/60)}m`:`${t}s`}function Gse(e,t){const[n,s]=h.useState();return h.useEffect(()=>{if(!t||e===void 0){s(void 0);return}const i=()=>s(e.rtcDiagnostics());i();const r=setInterval(i,1e3);return()=>clearInterval(r)},[t,e]),n}function Wse({diagnostics:e,mode:t,hostMinor:n,rtcAvailable:s,connectedSince:i}){return s?n!==void 0&&!Ct(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 ${Vse(e.cooldownRemainingMs)}`:e.phase!=="idle"?"Preparing…":e.lastFailure!==void 0?"Idle":Date.now()-i>2500?"Not available on this host":"Preparing…":"Not available in this browser"}function aj({label:e,end:t}){return o.jsxs(pe,{gap:2,style:{alignItems:"baseline"},children:[o.jsx(W,{type:"supporting",className:"w-20 shrink-0",children:e}),o.jsx(W,{type:"code",size:"sm",color:"secondary",hasTabularNumbers:!0,style:{wordBreak:"break-all",userSelect:"all"},children:Bse(t)})]})}const Kse={auto:"Auto",directOnly:"Direct only",relayOnly:"Relay only"};function Xse(e,t){if(e.state==="blocked")return"Blocked on HTTPS";if(e.state==="off")return`Off in ${Kse[t]}`}function Zse({host:e,routes:t}){return t.length===0?o.jsx(W,{type:"supporting",children:"No published address"}):o.jsx("ul",{"aria-label":"Routes",className:"m-0 flex list-none flex-col gap-0.5 p-0",children:t.map(n=>{const s=Xse(n,e.connectionMode??"auto");return o.jsxs("li",{className:n.state==="available"?"flex gap-2":"flex gap-2 opacity-60",children:[o.jsx(W,{type:"supporting",className:"w-24 shrink-0",children:n.label}),o.jsx(W,{type:"code",size:"sm",color:"secondary",className:"min-w-0",style:{wordBreak:"break-all"},children:n.address}),s===void 0?null:o.jsx(W,{type:"supporting",className:"shrink-0",children:s})]},n.url)})})}function p6(){const{hosts:e,focus:t,focusHost:n}=Ns(),s=zN(),i=b0(e),r=a=>s.get(a.hostKey);return{hosts:e,focusHost:n,label:a=>i.get(a.hostKey)??a.url,isCurrent:a=>(t==null?void 0:t.hostKey)===a.hostKey,isConnected:a=>na(r(a))==="connected",info:r,infoOf:a=>a===void 0?void 0:s.get(a)}}function bd({connected:e}){return o.jsx("span",{"aria-hidden":"true",className:"inline-flex",children:e?o.jsx(br,{variant:"success",label:"Connected",isPulsing:!0}):o.jsx(br,{variant:"neutral",label:"Not connected"})})}function Yse({onLocate:e}){const t=p6();return o.jsx(jf,{hasChevron:!1,placement:"above",alignment:"end",menuWidth:"max-content",button:{icon:o.jsx(Gg,{"aria-hidden":"true"}),isIconOnly:!0,label:"Hosts",tooltip:"Hosts",size:"sm",variant:"ghost"},children:t.hosts.map(n=>o.jsx(t1,{icon:o.jsx(bd,{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:v5(t.info(n))}),o.jsx(lo,{children:`(${v5(t.info(n)).toLowerCase()})`})]}),...e===void 0?{}:{onClick:()=>e(n.hostKey)}},n.hostKey))})}function c_({rtcAvailable:e=MN(),canSwitch:t=!1,thisMac:n}){const s=p6(),{focus:i}=Ns(),r=an(),a=DN(),[l,c]=h.useState(),[u,d]=h.useState(!1),f=r.state.status==="signed-in";h.useEffect(()=>{f&&r.refreshHosts()},[r,f]);const p=s.hosts.find(E=>E.hostKey===l),x=h.useCallback(()=>c(void 0),[]),g=Use(p===void 0?void 0:{title:s.label(p),back:x}),y=(p==null?void 0:p.hostKey)??(i==null?void 0:i.hostKey),v=s.infoOf(y),m=Gse((v==null?void 0:v.phase)==="ready"?v.remote:void 0,na(v)==="connected"),k=E=>{const A=s.info(E);if(na(A)!=="connected")return v5(A);const z=y===E.hostKey?m==null?void 0:m.path:void 0;return z===void 0?"Connected":`Connected · ${r_[z]}`};if(p!==void 0)return o.jsx(Jse,{host:p,status:k(p),diagnostics:m,rtcAvailable:e,hasBack:!g,onBack:x});const w=r.state.status==="signed-in"?r.state:void 0,S=w===void 0?[]:BN(w,s.hosts);return o.jsxs(te,{gap:4,children:[n,o.jsx(pe,{hAlign:"end",children:o.jsx(K,{label:"Add a host",variant:"secondary",size:"sm",onClick:()=>d(!0)})}),w===void 0?null:o.jsx(HN,{state:w,pairing:a}),s.hosts.length===0?o.jsx(W,{type:"supporting",children:"No paired hosts."}):o.jsx(Pn,{...S.length===0&&n===void 0?{}:{title:"Paired with this device"},children:o.jsx("ul",{"aria-label":"Paired with this device",className:$0,children:s.hosts.map(E=>o.jsx(Qse,{label:s.label(E),status:k(E),connected:s.isConnected(E),isCurrent:s.isCurrent(E),issue:Xne(r.state,E.hostKey),pairing:a,onSwitch:t?()=>s.focusHost(E.hostKey):void 0,onDetails:()=>c(E.hostKey)},E.hostKey))})}),w===void 0||S.length===0?null:o.jsx(Pn,{title:"On your account",children:o.jsx(qN,{state:w,hosts:S,pairing:a,label:"On your account"})}),u?o.jsx(t_,{onClose:()=>d(!1)}):null]})}function Qse({label:e,status:t,connected:n,isCurrent:s,issue:i,pairing:r,onSwitch:a,onDetails:l}){const c=i==null?void 0:i.match.host.hostId,u=i!==void 0?o.jsx(K,{label:"Pair again",variant:"secondary",size:"sm",isLoading:r.pairing===c,isDisabled:i.match.host.pairing!=="available"||r.pairing!==void 0,onClick:()=>r.pair(i.match.host.hostId)}):a!==void 0?o.jsx(K,{label:"Switch","aria-label":`Switch to ${e}`,variant:"secondary",size:"sm",onClick:a}):s?o.jsx($s,{label:"Current",size:"sm"}):null;return o.jsx("li",{"aria-label":e,children:o.jsx(yl,{as:"div",startContent:o.jsx(bd,{connected:n}),descriptionLines:2,label:e,description:i===void 0?t:Zne[i.kind],endContent:o.jsxs(pe,{gap:1,vAlign:"center",children:[u,o.jsx(ht,{label:`${e} details`,icon:o.jsx(tr,{"aria-hidden":"true"}),variant:"ghost",size:"sm",onClick:l})]})})})}function Jse({host:e,status:t,diagnostics:n,rtcAvailable:s,hasBack:i,onBack:r}){var N;const a=p6(),{setConnection:l}=Ns(),c=an(),[u,d]=h.useState(),[f,p]=h.useState(!1),[x,g]=h.useState(!1),y=a.label(e),v=a.info(e),m=na(v)==="connected",k=(v==null?void 0:v.phase)==="ready"?(N=v.view.host)==null?void 0:N.protocol.minor:void 0,w=e.connectionMode??"auto",S=(v==null?void 0:v.phase)==="ready"?v.remote:void 0,E=h.useRef(Date.now());h.useEffect(()=>{E.current=Date.now()},[S]);const A=c.state.status==="signed-in"?f6(c.state,e.hostKey):void 0,z=M=>{d(void 0),l(e.hostKey,{connectionMode:M}).then(()=>{const $=a.info(e);if($!==void 0){if($.phase!=="ready"){$.retry();return}$.view.connection==="closed"||$.view.connection==="outdated"?$.retry():$.remote.setConnectionMode(M)}},$=>{const R=$ instanceof Error?$.message:String($);console.error("Could not store the host connection mode",$),d(R)})};return o.jsxs(te,{gap:5,role:"group","aria-label":y,children:[o.jsxs(pe,{gap:2,vAlign:"center",children:[i?o.jsx(ht,{label:"Back to hosts",icon:o.jsx(fu,{"aria-hidden":"true"}),variant:"ghost",size:"sm",onClick:r}):null,o.jsx(bd,{connected:m}),o.jsxs(te,{gap:0,className:"min-w-0",children:[i?o.jsx(xn,{level:3,children:y}):null,o.jsx(W,{type:"supporting",children:t})]})]}),o.jsxs(te,{gap:1,children:[o.jsx(W,{weight:"semibold",children:"Connection"}),o.jsx(pe,{gap:2,vAlign:"center",wrap:"wrap",children:o.jsxs(o0,{className:"shrink-0",value:w,onChange:M=>z(M),label:"Connection mode",size:"sm",children:[o.jsx(Xi,{value:"auto",label:"Auto"}),o.jsx(Xi,{value:"directOnly",label:"Direct only"}),o.jsx(Xi,{value:"relayOnly",label:"Relay only"})]})}),o.jsx(W,{type:"supporting",children:Fse[w]}),u===void 0?null:o.jsx(W,{type:"supporting",children:`Could not save the connection mode: ${u}`})]}),m?o.jsx(Pn,{title:"Status",children:o.jsxs(wn,{hasDividers:!0,"aria-label":"Status",children:[o.jsx(yt,{label:"Path",description:o.jsxs(te,{gap:1,children:[o.jsx(W,{type:"inherit",children:n===void 0?"—":Lse(n)}),(n==null?void 0:n.path)==="p2p"&&n.selectedPair!==void 0?o.jsx(Rm,{defaultIsOpen:!1,trigger:o.jsx(W,{type:"body",size:"sm",color:"secondary",className:"block min-h-11 py-3",children:"Show addresses"}),children:o.jsxs(te,{gap:1,children:[o.jsx(aj,{label:"This device",end:n.selectedPair.local}),o.jsx(aj,{label:"Host",end:n.selectedPair.remote})]})}):null]})}),o.jsx(yt,{label:"Peer-to-peer",description:Wse({diagnostics:n,mode:w,hostMinor:k,rtcAvailable:s,connectedSince:E.current})}),(n==null?void 0:n.lastFailure)===void 0?null:o.jsx(yt,{label:"Last failure",description:o.jsx(W,{type:"inherit",hasTabularNumbers:!0,children:Dse(n.lastFailure)})})]})}):null,o.jsxs(te,{gap:1,children:[o.jsx(W,{weight:"semibold",children:"Routes"}),o.jsx(Zse,{host:e,routes:Pse(e,{pageProtocol:window.location.protocol})})]}),o.jsxs(pe,{gap:2,wrap:"wrap",children:[o.jsx(K,{label:"Unpair",variant:"secondary",size:"sm",onClick:()=>p(!0)}),A===void 0?null:o.jsx(K,{label:"Remove from account",variant:"secondary",size:"sm",onClick:()=>g(!0)})]}),f?o.jsx(eie,{host:e,label:y,info:v,onClose:M=>{p(!1),M&&r()}}):null,x&&A!==void 0&&c.state.status==="signed-in"?o.jsx(u6,{account:c,hostId:A.host.hostId,name:A.host.name,serverOrigin:c.state.serverOrigin,onClose:M=>{g(!1),M&&r()}}):null]})}function eie({host:e,label:t,info:n,onClose:s}){const{forget:i}=Ns(),r=zf(),a=`Unpair ${t}?`,l=()=>{const c=(n==null?void 0:n.phase)==="ready"&&na(n)==="connected"?n.remote:void 0;s(!0),NN({host:e,remote:c,forget:i}).then(({hostAnswered:u})=>{c!==void 0&&!u&&r(_N(t))},u=>console.error("Could not unpair the host",u))};return o.jsx(os,{"aria-label":a,isOpen:!0,onOpenChange:c=>c?void 0:s(!1),purpose:"form",width:440,children:o.jsx(Wn,{header:o.jsx(Ts,{title:a,subtitle:tie(t,n),onOpenChange:()=>s(!1)}),content:o.jsx(Kn,{}),footer:o.jsx(jr,{children:o.jsxs(pe,{gap:2,hAlign:"end",children:[o.jsx(K,{label:"Cancel",variant:"secondary",onClick:()=>s(!1)}),o.jsx(K,{label:"Unpair",variant:"destructive",onClick:l})]})})})})}function tie(e,t){return na(t)==="connected"?`${e} will stop accepting this device, and this device forgets it. Connecting again needs a new pairing link.`:s6(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 k5({canSwitch:e=!1}){const t=an(),[n,s]=h.useState(!1);return o.jsxs(te,{gap:3,className:"mt-4 w-full max-w-md",children:[o.jsx(c_,{canSwitch:e}),t.state.status==="unavailable"?null:o.jsx("div",{children:o.jsx(K,{label:"Account",variant:"secondary",size:"sm",onClick:()=>s(!0)})}),n?o.jsx(M0,{onClose:()=>s(!1)}):null]})}const nie="pinomad.projectSidebar.expanded",u_=e=>`${nie}.${e}`,sie=e=>{const t=window.localStorage.getItem(u_(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{}}},lj=(e,t)=>{window.localStorage.setItem(u_(e),JSON.stringify(t))},Yg=e=>e.flatMap(t=>[t,...Yg(t.children)]);function iie({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(ht,{icon:o.jsx(Wg,{className:"size-4"}),label:"Collapse sidebar",size:"sm",variant:"ghost",onClick:e})})}function cj({onOpenSettings:e,onOpenAccount:t,onLocateHost:n,onSelect:s}){const i=Jb();return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("div",{className:"min-w-0 flex-1",children:o.jsx(rie,{onOpenAccount:()=>{s==null||s(),t()}})}),o.jsx(Yse,{...n===void 0?{}:{onLocate:n}}),o.jsxs("span",{className:"relative inline-flex",children:[o.jsx(ht,{icon:o.jsx(jee,{"aria-hidden":"true"}),label:"Settings",tooltip:"Settings",size:"sm",variant:"ghost",onClick:()=>{s==null||s(),e()}}),(i==null?void 0:i.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 rie({onOpenAccount:e}){const t=an(),n=t.state.status,[s,i]=h.useState();if(h.useEffect(()=>{if(n!=="unavailable")return;let r=!0;return n6().then(a=>{r&&i(a)}),()=>{r=!1}},[n]),t.state.status==="signed-in"){const{user:r}=t.state;return o.jsx(K,{label:r,icon:o.jsx(G4,{name:r,size:"xsm",tooltip:!1}),variant:"ghost",size:"sm",onClick:e})}return n==="signed-out"?o.jsx(K,{label:"Sign in",icon:o.jsx(uN,{"aria-hidden":"true"}),variant:"ghost",size:"sm",onClick:e}):o.jsx("span",{className:"block truncate px-2 text-sm text-muted",children:s})}function oie({title:e,expanded:t,contentId:n,onToggle:s,actions:i,pinnedActions:r=!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(Pe,{icon:"chevronRight",size:"sm",color:"inherit"})})]}),o.jsx(pe,{className:r?void 0:"pigui-sidenav-hover-actions",gap:.5,vAlign:"center",children:i})]})}function ux(){return o.jsx("span",{className:"pigui-session-glyph","data-testid":"session-glyph"})}const d_={"needs-answer":"Waiting for your answer",failed:"Failed",running:"Running"};function aie({status:e}){const t=e==="needs-answer"?"warning":e==="failed"?"error":"success",n=d_[e];return o.jsx("span",{className:"pigui-session-glyph","aria-hidden":"true",children:o.jsx(br,{variant:t,label:n,tooltip:n,isPulsing:e!=="failed"})})}function uj({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(Pe,{icon:"chevronRight",size:"sm",color:"inherit"})})]})}function dj({node:e,shown:t,disabled:n,remote:s,kind:i="root",onOpen:r,onSelect:a}){const{summary:l}=e,c=i==="fork",u=c?l.status:rY(e),d=!c&&Ib(e).some(y=>y.summary.id===t),f=c?l.id===t:l.id===t||t!==void 0&&!d&&Yg([e]).some(y=>y.summary.id===t),[p,x]=h.useState(!1),g=o.jsx(_o,{icon:u===void 0?o.jsx(ux,{}):o.jsx(aie,{status:u}),label:l.title??"New conversation",isSelected:f,isDisabled:n,endContent:o.jsx("span",{"aria-hidden":"true",className:"pigui-sidenav-actions-spacer pigui-sidenav-actions-spacer--single"}),onClick:()=>{r(l.id),a==null||a()}});return o.jsxs("div",{className:"pigui-sidenav-row-with-actions pigui-sidenav-session-row","data-kind":c?"fork":"root",...u===void 0?{}:{"data-status":u},children:[g,u===void 0?null:o.jsx(lo,{children:d_[u]}),o.jsx(pe,{className:"pigui-sidenav-row-actions pigui-sidenav-hover-actions",gap:.5,vAlign:"center",children:o.jsx(jf,{hasChevron:!1,button:{icon:o.jsx(S0,{"aria-hidden":"true"}),isIconOnly:!0,label:"Conversation actions",size:"sm",variant:"ghost",isDisabled:n},items:[{label:"Rename",icon:o.jsx(Yb,{"aria-hidden":"true",size:16}),onClick:()=>x(!0)},...c?[]:[{label:"Archive",icon:o.jsx(sN,{"aria-hidden":"true",size:16}),onClick:()=>void s.controller.archive(l.id,!0)}]]})}),p?o.jsx(Ree,{summary:l,remote:s,connected:!n,onClose:()=>x(!1)}):null]})}const fj=e=>`pinomad.sidebarMachine.${e}.expanded`,iy=":chats";function lie({machines:e,focusKey:t,draftingChat:n,shownId:s,locate:i,onNewChat:r,onDraft:a,onOpen:l,onShowMachine:c,onSelect:u}){return o.jsxs(o.Fragment,{children:[o.jsx(Lm,{isHeaderHidden:!0,title:"New chat",children:o.jsx(_o,{icon:o.jsx($ee,{className:"size-4"}),label:"New chat",isSelected:n,isDisabled:r===void 0,onClick:()=>{r==null||r(),u==null||u()}})}),e.map(d=>o.jsx(cie,{machine:d,shownId:d.key===t?s:void 0,locateSeq:(i==null?void 0:i.key)===d.key?i.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 cie({machine:e,shownId:t,locateSeq:n,onDraft:s,onOpen:i,onShow:r,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),[y,v]=h.useState(()=>window.localStorage.getItem(fj(l))!=="false"),m=O=>{window.localStorage.setItem(fj(l),String(O)),v(O)},[k,w]=h.useState(!1),[S,E]=h.useState(),[A,z]=h.useState(()=>sie(l)),N=f||u==null?void 0:u.organized,M=O=>{s(O),a==null||a()},$=h.useMemo(()=>{var O;if(!(t===void 0||N===void 0))return Yg(N.chats).some(H=>H.summary.id===t)?iy:(O=N.projects.find(({conversations:H})=>Yg(H).some(L=>L.summary.id===t)))==null?void 0:O.project.path},[N,t]);h.useEffect(()=>{$!==void 0&&(y||m(!0),z(O=>{if(O[$]!==!1)return O;const H={...O,[$]:!0};return lj(l,H),H}))},[l,$]),h.useEffect(()=>{var O,H;n!==void 0&&(m(!0),(H=(O=g.current)==null?void 0:O.scrollIntoView)==null||H.call(O,{block:"nearest"}))},[n]);const R=O=>z(H=>{const L={...H,[O]:!(H[O]??!0)};return lj(l,L),L}),_=O=>d===void 0?null:o.jsxs(h.Fragment,{children:[o.jsx(dj,{node:O,shown:t,disabled:p,remote:d,onOpen:i,onSelect:a}),Ib(O).map(H=>o.jsx(dj,{node:H,shown:t,disabled:p,remote:d,kind:"fork",onOpen:i,onSelect:a},H.summary.id))]},O.summary.id),T=A[iy]??!0;return o.jsxs(Lm,{isHeaderHidden:!0,title:c,children:[o.jsx("div",{ref:g,children:o.jsx(oie,{title:c,expanded:y,contentId:x,onToggle:()=>m(!y),actions:o.jsxs(o.Fragment,{children:[o.jsx(ht,{icon:o.jsx(cf,{"aria-hidden":"true"}),label:`New chat on ${c}`,tooltip:"New chat",size:"sm",variant:"ghost",isDisabled:p,onClick:()=>M({kind:"chat"})}),o.jsx(ht,{icon:o.jsx(pee,{"aria-hidden":"true"}),label:`Add project on ${c}`,tooltip:"Add project",size:"sm",variant:"ghost",isDisabled:p,onClick:()=>w(!0)})]})})}),o.jsx(te,{id:x,gap:.5,children:y?N===void 0?o.jsx(_o,{icon:o.jsx(ux,{}),label:f?"Not paired":"No conversations available",isDisabled:r===void 0,onClick:()=>{r==null||r(),a==null||a()}}):N.chats.length===0&&N.projects.length===0?o.jsx(_o,{icon:o.jsx(ux,{}),isDisabled:!0,label:"No conversations"}):o.jsxs(o.Fragment,{children:[N.chats.length===0?null:o.jsx("div",{className:"pigui-sidenav-row-with-actions",children:o.jsx(_o,{collapsible:{isCollapsed:!T,onCollapsedChange:()=>R(iy)},icon:o.jsx(uj,{expanded:T,closed:p5,open:p5}),label:"Chats",isDisabled:p,children:N.chats.map(_)})}),N.projects.map(({project:O,conversations:H})=>{const L=A[O.path]??!0;return o.jsxs("div",{className:"pigui-sidenav-row-with-actions",children:[o.jsx(_o,{collapsible:{isCollapsed:!L,onCollapsedChange:()=>R(O.path)},icon:o.jsx(uj,{expanded:L,closed:E1,open:gee}),label:O.name,isDisabled:p,endContent:o.jsx("span",{"aria-hidden":"true",className:"pigui-sidenav-actions-spacer"}),children:H.length===0?o.jsx(_o,{icon:o.jsx(ux,{}),isDisabled:!0,label:"No conversations"}):H.map(_)}),o.jsx(pe,{className:"pigui-sidenav-row-actions",gap:.5,vAlign:"center",children:o.jsxs(pe,{className:"pigui-sidenav-hover-actions",gap:.5,vAlign:"center",children:[o.jsx(ht,{icon:o.jsx(cf,{"aria-hidden":"true"}),label:`New conversation in ${O.name}`,size:"sm",variant:"ghost",isDisabled:p,onClick:()=>M({kind:"project",path:O.path})}),o.jsx(jf,{hasChevron:!1,button:{icon:o.jsx(S0,{"aria-hidden":"true"}),isIconOnly:!0,label:`Project actions for ${O.name}`,size:"sm",variant:"ghost",isDisabled:p},items:[{label:"Remove project",icon:o.jsx(cN,{"aria-hidden":"true",size:16}),onClick:()=>E(O)}]})]})})]},O.path)})]}):null}),k&&d!==void 0?o.jsx(zee,{remote:d,connected:!p,onAdded:O=>{w(!1),M({kind:"project",path:O.path})},onClose:()=>w(!1)}):null,S===void 0||d===void 0?null:o.jsx(_ee,{project:S,remote:d,connected:!p,onClose:()=>E(void 0)})]})}const hj=32,pj=1024,uie=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function f_(e){return e.length>hj||!uie.test(e)?`Name must be lowercase letters, digits and hyphens (max ${hj})`:void 0}function die(e){const t=f_(e.name);if(t!==void 0)return t;const n=e.description.trim();if(n==="")return"description is required";if(n.length>pj)return`description is too long (max ${pj})`;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&&!JZ(e.thinkingLevel))return`thinkingLevel must be one of ${t5.join(", ")}`}const df={off:"Off",minimal:"Minimal",low:"Low",medium:"Medium",high:"High",xhigh:"X-High",max:"Max"},dx=(e,t)=>e!==void 0&&t!==void 0&&e.provider===t.provider&&e.modelId===t.modelId,xj=["off","minimal","low","medium","high","xhigh","max"],Qg=(e,t)=>{if(e.includes(t))return t;const n=xj.indexOf(t);return e.filter(s=>xj.indexOf(s)<=n).at(-1)??e[0]??"off"},Ei=(e,t)=>t===void 0?void 0:e.find(n=>n.provider===t.provider&&n.modelId===t.modelId);function fie(e,t){var r;const n=Ei(e,t.model),s=(n==null?void 0:n.thinkingLevels)??["off"],i=(n==null?void 0:n.name)??((r=t.model)==null?void 0:r.modelId)??"No model";return s.length>1?`${i} · ${df[t.level]}`:i}function hie(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 pie(e,t,n){var r;const s=n.model!==void 0&&Ei(e,n.model)!==void 0?n.model:Ei(e,t.model)!==void 0?t.model:e[0]===void 0?void 0:{provider:e[0].provider,modelId:e[0].modelId},i=Qg(((r=Ei(e,s))==null?void 0:r.thinkingLevels)??["off"],n.level);return{model:s,level:i}}const xie=e=>{const t=e.indexOf("/");return{provider:e.slice(0,t),modelId:e.slice(t+1)}};function gie(e,t,n,s,i){var y;const r=t==null?void 0:t.roles.find(v=>v.name===e),a=r===void 0||r.model===void 0?void 0:xie(r.model),l=i.model??a??s.model,c=i.model!==void 0?"override":a!==void 0?"agent":s.model!==void 0?"default":void 0,u=i.level!==void 0?"override":(r==null?void 0:r.thinkingLevel)!==void 0?"agent":"default",d=i.level??(r==null?void 0:r.thinkingLevel)??s.thinkingLevel??"off",f=Ei(n,l),p=f===void 0?d:Qg(f.thinkingLevels,d),x=(y=t==null?void 0:t.problems.find(v=>v.file===`${e}.md`))==null?void 0:y.reason,g=r===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,...i.model===void 0?{}:{model:i.model},...i.level===void 0?{}:{thinkingLevel:i.level}},...g===void 0?{}:{problem:g}}}const mie=[[/^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"]],vie=e=>{var t;for(const n of e.modelId.toLowerCase().split(/[^a-z0-9]+/)){const s=(t=mie.find(([i])=>i.test(n)))==null?void 0:t[1];if(s!==void 0)return s}return RN(e.provider)};function Jg({model:e,size:t=16,reserve:n=!1}){const s=vie(e),i=s===void 0?void 0:i6(s);if(i===void 0&&!n)return null;const r={"--model-logo-size":`${t}px`};return o.jsx("span",{className:"model-logo",style:r,"aria-hidden":"true",...i===void 0?{}:{dangerouslySetInnerHTML:{__html:i}}})}const _i="",gj=e=>`${e.provider}/${e.modelId}`,mj=e=>{const t=e.indexOf("/");if(!(t<=0||t===e.length-1))return{provider:e.slice(0,t),modelId:e.slice(t+1)}};function yie({view:e,remote:t,connected:n,role:s,onClose:i}){const r=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)??_i),[p,x]=h.useState((s==null?void 0:s.thinkingLevel)??_i),[g,y]=h.useState((s==null?void 0:s.prompt)??""),[v,m]=h.useState(!1),[k,w]=h.useState(void 0),S=d===_i?void 0:Ei(e.models,mj(d)),E=[{value:_i,label:"Don't pin — use the caller's model"},...e.models.map($=>({value:gj($),label:`${$.name} (${gj($)})`})),...d!==_i&&S===void 0?[{value:d,label:`${d} (not available)`}]:[]],A=S===void 0?t5:S.thinkingLevels,z=[{value:_i,label:"Don't pin"},...A.map($=>({value:$,label:df[$]})),...p!==_i&&!A.includes(p)?[{value:p,label:`${df[p]} (not supported by this model)`}]:[]],N=$=>{f($);const R=$===_i?void 0:Ei(e.models,mj($)),_=R===void 0?t5:R.thinkingLevels;p!==_i&&!_.includes(p)&&x(_i)},M=()=>{const $={name:a.trim(),description:c.trim(),...d===_i?{}:{model:d},...p===_i?{}:{thinkingLevel:p},prompt:g.trim()},R=die($);if(R!==void 0){w(R);return}m(!0),w(void 0),(r?t.controller.updateAgent($):t.controller.createAgent($)).then(()=>i(),_=>{m(!1),w(_ instanceof Error?_.message:String(_))})};return o.jsx(os,{isOpen:!0,onOpenChange:$=>$?void 0:i(),purpose:"form",width:480,"aria-label":r?`Edit ${s.name}`:"New agent",children:o.jsx(Wn,{header:o.jsx(Ts,{title:r?`Edit ${s.name}`:"New agent",onOpenChange:()=>i()}),content:o.jsx(Kn,{children:o.jsxs(te,{gap:4,children:[o.jsx(te,{gap:1,children:o.jsx(pt,{label:"Name",value:a,onChange:l,isDisabled:v||r,hasAutoFocus:!r,description:r?"The name is the file name and can't be changed.":void 0})}),o.jsx(pt,{label:"Description",value:c,onChange:u,isDisabled:v}),o.jsx(Ko,{label:"Model",value:d,options:E,onChange:N,isDisabled:v}),o.jsx(Ko,{label:"Thinking level",value:p,options:z,onChange:$=>x($),isDisabled:v}),o.jsx(C$,{label:"Prompt",value:g,onChange:y,isDisabled:v,rows:4}),k===void 0?null:o.jsx(W,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:k})]})}),footer:o.jsx(jr,{children:o.jsxs(pe,{gap:2,hAlign:"end",children:[o.jsx(K,{label:"Cancel",variant:"secondary",onClick:i}),o.jsx(K,{label:"Save",variant:"primary",isDisabled:!n||v,onClick:M})]})})})})}const em="pinomad.appearance",b5=new Set,kie=e=>e==="light"||e==="dark"?e:"system";function bie(){try{return kie(localStorage.getItem(em))}catch{return"system"}}function wie(e){e==="system"?localStorage.removeItem(em):localStorage.setItem(em,e);for(const t of b5)t()}function jie(e){const t=n=>{(n.key===em||n.key===null)&&e()};return b5.add(e),window.addEventListener("storage",t),()=>{b5.delete(e),window.removeEventListener("storage",t)}}function h_(){return h.useSyncExternalStore(jie,bie,()=>"system")}function Sie(){const e=h_();return o.jsx(Pn,{children:o.jsx(Zg,{label:"Theme",description:"Remembered on this device only",children:o.jsxs(o0,{label:"Theme",size:"sm",value:e,onChange:t=>wie(t),children:[o.jsx(Xi,{value:"light",label:"Light"}),o.jsx(Xi,{value:"dark",label:"Dark"}),o.jsx(Xi,{value:"system",label:"System"})]})})})}var tc=(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))(tc||{});const Cie=[0,1],p_=[1,0],x_=[2,3],g_=[3,2],Eie={L:Cie,M:p_,Q:x_,H:g_},$ie=/^\d*$/,Aie=/^[A-Z0-9 $%*+./:-]*$/,ry="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",x6=1,g6=40,vj=3,Mie=3,Ap=40,Tie=10,m_=[[-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]],v_=[[-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 zie{constructor(t,n,s,i){ve(this,"size");ve(this,"mask");ve(this,"modules",[]);ve(this,"types",[]);if(this.version=t,this.ecc=n,t<x6||t>g6)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=t*4+17;const r=Array.from({length:this.size}).fill(!1);for(let l=0;l<this.size;l++)this.modules.push(r.slice()),this.types.push(r.map(()=>0));this.drawFunctionPatterns();const a=this.addEccAndInterleave(s);if(this.drawCodewords(a),i===-1){let l=1e9;for(let c=0;c<8;c++){this.applyMask(c),this.drawFormatBits(c);const u=this.getPenaltyScore();u<l&&(i=c,l=u),this.applyMask(c)}}this.mask=i,this.applyMask(i),this.drawFormatBits(i)}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,tc.Timing),this.setFunctionModule(s,6,s%2===0,tc.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 i=0;i<n;i++)s===0&&i===0||s===0&&i===n-1||s===n-1&&i===0||this.drawAlignmentPattern(t[s],t[i]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){const n=this.ecc[1]<<3|t;let s=n;for(let r=0;r<10;r++)s=s<<1^(s>>>9)*1335;const i=(n<<10|s)^21522;for(let r=0;r<=5;r++)this.setFunctionModule(8,r,vo(i,r));this.setFunctionModule(8,7,vo(i,6)),this.setFunctionModule(8,8,vo(i,7)),this.setFunctionModule(7,8,vo(i,8));for(let r=9;r<15;r++)this.setFunctionModule(14-r,8,vo(i,r));for(let r=0;r<8;r++)this.setFunctionModule(this.size-1-r,8,vo(i,r));for(let r=8;r<15;r++)this.setFunctionModule(8,this.size-15+r,vo(i,r));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 i=vo(n,s),r=this.size-11+s%3,a=Math.floor(s/3);this.setFunctionModule(r,a,i),this.setFunctionModule(a,r,i)}}drawFinderPattern(t,n){for(let s=-4;s<=4;s++)for(let i=-4;i<=4;i++){const r=Math.max(Math.abs(i),Math.abs(s)),a=t+i,l=n+s;a>=0&&a<this.size&&l>=0&&l<this.size&&this.setFunctionModule(a,l,r!==2&&r!==4,tc.Position)}}drawAlignmentPattern(t,n){for(let s=-2;s<=2;s++)for(let i=-2;i<=2;i++)this.setFunctionModule(t+i,n+s,Math.max(Math.abs(i),Math.abs(s))!==1,tc.Alignment)}setFunctionModule(t,n,s,i=tc.Function){this.modules[n][t]=s,this.types[n][t]=i}addEccAndInterleave(t){const n=this.version,s=this.ecc;if(t.length!==fx(n,s))throw new RangeError("Invalid argument");const i=v_[s[0]][n],r=m_[s[0]][n],a=Math.floor(w5(n)/8),l=i-a%i,c=Math.floor(a/i),u=[],d=Hie(r);for(let p=0,x=0;p<i;p++){const g=t.slice(x,x+c-r+(p<l?0:1));x+=g.length;const y=qie(g,d);p<l&&g.push(0),u.push(g.concat(y))}const f=[];for(let p=0;p<u[0].length;p++)u.forEach((x,g)=>{(p!==c-r||g>=l)&&f.push(x[p])});return f}drawCodewords(t){if(t.length!==Math.floor(w5(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 i=0;i<this.size;i++)for(let r=0;r<2;r++){const a=s-r,c=(s+1&2)===0?this.size-1-i:i;!this.types[c][a]&&n<t.length*8&&(this.modules[c][a]=vo(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 i;switch(t){case 0:i=(s+n)%2===0;break;case 1:i=n%2===0;break;case 2:i=s%3===0;break;case 3:i=(s+n)%3===0;break;case 4:i=(Math.floor(s/3)+Math.floor(n/2))%2===0;break;case 5:i=s*n%2+s*n%3===0;break;case 6:i=(s*n%2+s*n%3)%2===0;break;case 7:i=((s+n)%2+s*n%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[n][s]&&i&&(this.modules[n][s]=!this.modules[n][s])}}getPenaltyScore(){let t=0;for(let r=0;r<this.size;r++){let a=!1,l=0;const c=[0,0,0,0,0,0,0];for(let u=0;u<this.size;u++)this.modules[r][u]===a?(l++,l===5?t+=vj:l>5&&t++):(this.finderPenaltyAddHistory(l,c),a||(t+=this.finderPenaltyCountPatterns(c)*Ap),a=this.modules[r][u],l=1);t+=this.finderPenaltyTerminateAndCount(a,l,c)*Ap}for(let r=0;r<this.size;r++){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][r]===a?(l++,l===5?t+=vj:l>5&&t++):(this.finderPenaltyAddHistory(l,c),a||(t+=this.finderPenaltyCountPatterns(c)*Ap),a=this.modules[u][r],l=1);t+=this.finderPenaltyTerminateAndCount(a,l,c)*Ap}for(let r=0;r<this.size-1;r++)for(let a=0;a<this.size-1;a++){const l=this.modules[r][a];l===this.modules[r][a+1]&&l===this.modules[r+1][a]&&l===this.modules[r+1][a+1]&&(t+=Mie)}let n=0;for(const r of this.modules)n=r.reduce((a,l)=>a+(l?1:0),n);const s=this.size*this.size,i=Math.ceil(Math.abs(n*20-s*10)/s)-1;return t+=i*Tie,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 i=this.size-7;s.length<t;i-=n)s.splice(1,0,i);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 Io(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 vo(e,t){return(e>>>t&1)!==0}class m6{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 Nie=[1,10,12,14],_ie=[2,9,11,13],Rie=[4,8,16,16];function y_(e,t){return e[Math.floor((t+7)/17)+1]}function k_(e){const t=[];for(const n of e)Io(n,8,t);return new m6(Rie,e.length,t)}function Iie(e){if(!b_(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);Io(Number.parseInt(e.substring(n,n+s),10),s*3+1,t),n+=s}return new m6(Nie,e.length,t)}function Lie(e){if(!w_(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=ry.indexOf(e.charAt(n))*45;s+=ry.indexOf(e.charAt(n+1)),Io(s,11,t)}return n<e.length&&Io(ry.indexOf(e.charAt(n)),6,t),new m6(_ie,e.length,t)}function Oie(e){return e===""?[]:b_(e)?[Iie(e)]:w_(e)?[Lie(e)]:[k_(Bie(e))]}function b_(e){return $ie.test(e)}function w_(e){return Aie.test(e)}function Die(e,t){let n=0;for(const s of e){const i=y_(s.mode,t);if(s.numChars>=1<<i)return Number.POSITIVE_INFINITY;n+=4+i+s.bitData.length}return n}function Bie(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 w5(e){if(e<x6||e>g6)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 fx(e,t){return Math.floor(w5(e)/8)-m_[t[0]][e]*v_[t[0]][e]}function Hie(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 i=0;i<t.length;i++)t[i]=j5(t[i],n),i+1<t.length&&(t[i]^=t[i+1]);n=j5(n,2)}return t}function qie(e,t){const n=t.map(s=>0);for(const s of e){const i=s^n.shift();n.push(0),t.forEach((r,a)=>n[a]^=j5(r,i))}return n}function j5(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 Pie(e,t,n=1,s=40,i=-1,r=!0){if(!(x6<=n&&n<=s&&s<=g6)||i<-1||i>7)throw new RangeError("Invalid value");let a,l;for(a=n;;a++){const f=fx(a,t)*8,p=Die(e,a);if(p<=f){l=p;break}if(a>=s)throw new RangeError("Data too long")}for(const f of[p_,x_,g_])r&&l<=fx(a,f)*8&&(t=f);const c=[];for(const f of e){Io(f.mode[0],4,c),Io(f.numChars,y_(f.mode,a),c);for(const p of f.getData())c.push(p)}const u=fx(a,t)*8;Io(0,Math.min(4,u-c.length),c),Io(0,(8-c.length%8)%8,c);for(let f=236;c.length<u;f^=253)Io(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 zie(a,t,d,i)}function Uie(e,t){var f;const{ecc:n="L",boostEcc:s=!1,minVersion:i=1,maxVersion:r=40,maskPattern:a=-1,border:l=1}=t||{},c=typeof e=="string"?Oie(e):Array.isArray(e)?[k_(e)]:void 0;if(!c)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const u=Pie(c,Eie[n],i,r,a,s),d=Fie({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 Fie(e,t=1){if(!t)return e;const{size:n}=e,s=n+t*2;e.size=s,e.data.forEach(r=>{for(let a=0;a<t;a++)r.unshift(!1),r.push(!1)});for(let r=0;r<t;r++)e.data.unshift(Array.from({length:s},a=>!1)),e.data.push(Array.from({length:s},a=>!1));const i=tc.Border;e.types.forEach(r=>{for(let a=0;a<t;a++)r.unshift(i),r.push(i)});for(let r=0;r<t;r++)e.types.unshift(Array.from({length:s},a=>i)),e.types.push(Array.from({length:s},a=>i));return e}function Vie({view:e,remote:t,self:n,hostKey:s}){const{hosts:i,forget:r}=Ns(),a=e.connection==="connected",l=n===void 0?void 0:Ho(n.publicKey),[c,u]=h.useState(),d=zf(),[f,p]=h.useState(),[x,g]=h.useState(),y=()=>{g(void 0),t.controller.createPairing().then(p,v=>{g(v instanceof Error?v.message:String(v))})};return o.jsxs(te,{gap:4,children:[e.devices.length===0?o.jsx(W,{type:"supporting",children:"No paired devices."}):o.jsx(wn,{density:"compact",children:e.devices.map(v=>o.jsx(Xie,{device:v,isSelf:v.publicKey===l,connected:a,onUnpair:()=>u(v)},v.publicKey))}),c===void 0?null:o.jsx(Zie,{device:c,isSelf:c.publicKey===l,onCancel:()=>u(void 0),onConfirm:()=>{u(void 0);const v=c.publicKey===l?i.find(m=>m.hostKey===s):void 0;if(v===void 0){t.controller.revokeDevice(c.publicKey);return}NN({host:v,remote:t,forget:r}).then(({hostAnswered:m})=>{m||d(_N(b0(i).get(v.hostKey)??v.url))})}}),o.jsx(Gie,{view:e,remote:t}),x===void 0?null:o.jsx(Ie,{status:"error",title:"Could not create a pairing offer",description:x}),f===void 0?o.jsx(K,{label:"Pair a device",variant:"secondary",isDisabled:!a,onClick:y}):o.jsx(Yie,{url:f.url,expiresAt:f.expiresAt,onRenew:y})]})}function Gie({view:e,remote:t}){var s;const n=(s=e.host)==null?void 0:s.protocol.minor;return e.settings===null||n===void 0||!Ct(n,"acceptAccountDevices")?null:o.jsx($3,{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:i=>void t.controller.updateSettings({acceptAccountDevices:i})})}const Wie={account:"via account",qr:"via QR code",local:"on this machine"},Kie=new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"});function Xie({device:e,isSelf:t,connected:n,onUnpair:s}){const i=e.source===void 0?"":` ${Wie[e.source]}`;return o.jsx(yt,{label:e.name,description:`Paired ${Kie.format(e.pairedAt)}${i}`,endContent:o.jsxs(pe,{gap:2,vAlign:"center",children:[t?o.jsx($s,{label:"This device",size:"sm"}):null,o.jsx(K,{label:"Unpair","aria-label":`Unpair ${e.name}`,variant:"secondary",size:"sm",isDisabled:!n,onClick:s})]})})}function Zie({device:e,isSelf:t,onCancel:n,onConfirm:s}){const i=t?"Unpair this device?":`Unpair ${e.name}?`;return o.jsxs(te,{gap:2,role:"group","aria-label":i,children:[o.jsx(W,{weight:"semibold",children:i}),o.jsx(W,{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(pe,{gap:2,hAlign:"end",children:[o.jsx(K,{label:"Cancel",variant:"secondary",size:"sm",onClick:n}),o.jsx(K,{label:"Unpair",variant:"destructive",size:"sm",onClick:s})]})]})}function Yie({url:e,expiresAt:t,onRenew:n}){const[s,i]=h.useState(Date.now());h.useEffect(()=>{const l=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(l)},[]);const r=Math.max(0,Math.ceil((t-s)/1e3));if(r===0)return o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(W,{type:"supporting",children:"Expired"}),o.jsx(K,{label:"New code",variant:"secondary",size:"sm",onClick:n})]});const a=w1(e);return o.jsxs(te,{gap:3,hAlign:"center",children:[a?null:o.jsx(Qie,{text:e}),o.jsx(W,{type:"supporting",style:{wordBreak:"break-all",userSelect:"all"},children:e}),a?o.jsx(W,{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(W,{type:"supporting",children:["Expires in ",Math.floor(r/60),":",String(r%60).padStart(2,"0")]})]})}const oy=2;function Qie({text:e}){const t=h.useMemo(()=>{try{return Uie(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(W,{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+oy*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,i)=>s.map((r,a)=>r?`M${a+oy} ${i+oy}h1v1h-1z`:"")).filter(s=>s!=="").join("")})]})}const yj=(e,t)=>{const n=y0(e,t);return n==="now"?"just now":`${n} ago`},Jie=3e4;function ere(e,t){let n;const s=new Promise((i,r)=>{n=setTimeout(()=>r(new Error("The host didn't answer. It may still act on the request; this page updates when it does.")),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}const tre=e=>e instanceof Error?e.message:String(e),kj={source:{title:"This host runs from a source checkout",description:"Upgrade it there with `bun run upgrade`."},"no-service":{title:"This host isn't running as a service",description:"Nothing would start it again after an upgrade. Run `pinomad upgrade` on the host."},stopped:{title:"This host's service is stopped",description:"Run `pinomad upgrade` on the host; the service stays off until you start it."}},nre={off:"The host never checks for new releases.",notify:"The host checks every 6 hours and shows new releases here.",auto:"The host also installs a release once it's 3 days old and the host has been idle for 15 minutes. It never installs one that older apps can't connect to."};function sre({view:e,remote:t}){var a,l;const n=((a=e.host)==null?void 0:a.protocol.minor)??0,s=e.upgrade;if(!Je(n,"startUpgrade")||s===null)return o.jsx(Ie,{status:"warning",title:"This host is too old to upgrade from here",description:"Run `pinomad upgrade` on the host."});const i=e.connection==="connected",r=(l=e.settings)==null?void 0:l.autoUpgrade;return o.jsxs(te,{gap:4,children:[o.jsx(ire,{upgrade:s,remote:t,connected:i,checksOff:r==="off"}),r===void 0||!Ct(n,"autoUpgrade")?null:o.jsx(ore,{mode:r,disabled:!i,onChange:c=>void t.controller.updateSettings({autoUpgrade:c})})]})}function ire({upgrade:e,remote:t,connected:n,checksOff:s}){const i=fo(6e4),[r,a]=h.useState(!1),[l,c]=h.useState(),[u,d]=h.useState(),f=(E,A,z)=>{d(void 0),c(E),ere(A(),Jie).then(z,N=>d(tre(N))).finally(()=>c(void 0))},p=E=>f(E,()=>t.controller.startUpgrade(E),()=>a(!1)),{available:x,phase:g,target:y,failure:v,blocked:m}=e,k=e.current===null?"Source checkout":`pinomad ${e.current}`;let w;g==="waiting"?w=`Upgrading to pinomad ${y??""} once running tasks finish.`:g==="installing"?w=`Installing pinomad ${y??""}… The host restarts when it's done.`:x!==null?w=`pinomad ${x.version} is available, released ${yj(x.publishedAt,i)}.`:m==="source"?w="Releases aren't checked for a source checkout.":e.checkError!==null?w="Unknown: the last check failed.":e.checkedAt!==null?w=`Up to date. Checked ${yj(e.checkedAt,i)}.`:w=s?"Release checks are off.":"Not checked yet.";const S=n&&m===null&&g==="idle"&&x!==null;return o.jsxs(te,{gap:3,children:[o.jsxs(te,{gap:1,children:[o.jsx(W,{weight:"semibold",children:k}),o.jsx(W,{type:"supporting",children:w}),x!==null&&x.crossesMajor&&g==="idle"?o.jsx(W,{type:"supporting",children:"Apps that haven't updated yet can't connect to this release."}):null]}),e.checkError===null?null:o.jsx(Ie,{status:"warning",title:"Couldn't check for releases",description:e.checkError}),v===null||g!=="idle"?null:o.jsx(Ie,{status:"error",title:`Upgrading to pinomad ${v.version} failed`,description:o.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:v.message})}),m===null?null:o.jsx(Ie,{status:"info",title:kj[m].title,description:kj[m].description}),u===void 0?null:o.jsx(Ie,{status:"error",title:"That didn't go through",description:u}),r&&S?o.jsx(rre,{version:x.version,crossesMajor:x.crossesMajor,pending:l==="idle"||l==="now"?l:void 0,onCancel:()=>a(!1),onStart:p}):o.jsxs(pe,{gap:2,wrap:"wrap",children:[g==="waiting"?o.jsx(K,{label:"Cancel upgrade",variant:"secondary",size:"sm",isDisabled:!n||l!==void 0,isLoading:l==="cancel",onClick:()=>f("cancel",()=>t.controller.cancelUpgrade())}):null,S?o.jsx(K,{label:"Upgrade",variant:"secondary",size:"sm",onClick:()=>a(!0)}):null,g==="idle"&&m!=="source"?o.jsx(K,{label:"Check now",variant:"secondary",size:"sm",isDisabled:!n||s||e.checking||l!==void 0,isLoading:e.checking||l==="check",onClick:()=>f("check",()=>t.controller.checkUpgrade())}):null]})]})}function rre({version:e,crossesMajor:t,pending:n,onCancel:s,onStart:i}){const r=`Upgrade the host to pinomad ${e}?`;return o.jsxs(te,{gap:2,role:"group","aria-label":r,children:[o.jsx(W,{weight:"semibold",children:r}),o.jsxs(W,{type:"supporting",children:["The host restarts after installing, and every device reconnects. Open terminals close.",t?" Apps that haven't updated yet can't connect to this release.":""]}),o.jsx(W,{type:"supporting",children:"Upgrading now interrupts running tasks; they continue after the restart."}),o.jsxs(pe,{gap:2,hAlign:"end",wrap:"wrap",children:[o.jsx(K,{label:"Cancel",variant:"secondary",size:"sm",isDisabled:n!==void 0,onClick:s}),o.jsx(K,{label:"Upgrade now",variant:"secondary",size:"sm",isDisabled:n!==void 0,isLoading:n==="now",onClick:()=>i("now")}),o.jsx(K,{label:"Upgrade when idle",variant:"primary",size:"sm",isDisabled:n!==void 0,isLoading:n==="idle",onClick:()=>i("idle")})]})]})}function ore({mode:e,disabled:t,onChange:n}){return o.jsxs(te,{gap:1,children:[o.jsx(W,{children:"Automatic upgrades"}),o.jsx(pe,{children:o.jsxs(o0,{className:"shrink-0",value:e,onChange:s=>n(s),label:"Automatic upgrades",size:"sm",isDisabled:t,children:[o.jsx(Xi,{value:"off",label:"Off"}),o.jsx(Xi,{value:"notify",label:"Notify"}),o.jsx(Xi,{value:"auto",label:"When idle"})]})}),o.jsx(W,{type:"supporting",children:nre[e]})]})}function are({pollIntervalMs:e}){const t=PN();return t===void 0?null:o.jsx(lre,{bridge:t,pollIntervalMs:e})}function lre({bridge:e,pollIntervalMs:t}){const{state:n,refresh:s,pollUntilInstalled:i}=UN(e,t),[r,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:bj(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(w=>a(S=>(S==null?void 0:S.kind)==="stopping"?{...S,lines:w}:S)),m().catch(w=>({outcome:"failed",message:bj(w)})).then(async w=>{var S;(S=f.current)==null||S.call(f),f.current=void 0,(w==null?void 0:w.outcome)==="failed"&&d(w.message),await s(),a(void 0)})},g=()=>{c(!1),x(()=>e.stop())},y=(n==null?void 0:n.kind)==="installed"&&n.stopping&&r===void 0;if(h.useEffect(()=>{y&&x(()=>e.followStop())},[y]),n===void 0)return o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(Tt,{size:"sm"}),o.jsx(W,{type:"supporting",children:"Checking this Mac…"})]});const v=u===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't change the host",description:u});switch(n.kind){case"error":return o.jsx(Ie,{status:"error",title:"Couldn't check the host on this Mac",description:n.message,endContent:o.jsx(K,{label:"Try again",variant:"secondary",onClick:()=>void s()})});case"too-old":return o.jsx(W,{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(cre,{bridge:e,onFinished:i});case"installed":return o.jsxs(te,{gap:3,children:[o.jsx($3,{label:"Run the host on this Mac",description:n.detail,labelPosition:"start",labelSpacing:"spread",width:"100%",value:!n.stopped,isLoading:r!==void 0,isDisabled:r!==void 0,onChange:m=>m?p():c(!0)}),(r==null?void 0:r.kind)==="stopping"?o.jsxs(te,{gap:2,children:[o.jsx(W,{as:"p",type:"supporting",children:"Stopping…"}),r.lines.length===0?null:o.jsx("div",{role:"log","aria-label":"Stop progress",style:ure,children:r.lines.map((m,k)=>o.jsx("div",{children:m},k))}),o.jsx(pe,{children:o.jsx(K,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>void e.cancelStop()})})]}):null,v,o.jsx(T3,{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 cre({bridge:e,onFinished:t}){const n=an();return n.state.status!=="signed-in"?o.jsx(W,{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(te,{gap:3,children:[o.jsx(W,{as:"p",type:"supporting",children:"The PiNomad host isn't installed on this Mac. Setting it up downloads PiNomad with its own Node, joins it to your account, and adds the pinomad command to your shell profile."}),o.jsx(JN,{bridge:e,serverOrigin:n.state.serverOrigin,onFinished:t})]})}const ure={fontFamily:"var(--font-family-code)",fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)",whiteSpace:"pre-wrap"},bj=e=>e instanceof Error?e.message:String(e),wd=e=>e!==null&&typeof e=="object",j_=new Set(["__proto__","constructor","prototype"]);class ff extends Error{constructor(n){super(`unsafe path segment: ${String(n)}`);ve(this,"segment");this.segment=n,this.name="UnsafePathError"}}function S_(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");$u(e[1],!0);return;case"d":if(e.length!==2)throw new TypeError("d arity");$u(e[1],!0);return;case"a":if(e.length!==3||typeof e[2]!="string")throw new TypeError("a shape");$u(e[1],!0);return;case"t":if(e.length!==3||!Number.isInteger(e[2])||e[2]<0)throw new TypeError("t shape");$u(e[1],!0);return;case"p":{if(e.length!==5)throw new TypeError("p arity");if($u(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");$u(e[1]),dre(e[2]);return;default:throw new TypeError(`unknown op verb: ${String(e[0])}`)}}function $u(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");C_(e)}function dre(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 C_(e){for(const t of e)if(typeof t=="string"){if(j_.has(t))throw new ff(t)}else if(!Number.isInteger(t)||t<0)throw new ff(t)}function fre(e,t){if(t>e.length)throw new ff(t)}class Wi extends Error{constructor(n){super(`unresolvable path: ${JSON.stringify(n)}`);ve(this,"path");this.path=n,this.name="PathError"}}function hre(e,t){let n=e;for(const s of t){if(S_(s),s[0]==="r"){n=s[1];continue}const i=s[1];if(C_(i),s[0]==="p"){const u=i.length===0?n:hx(n,i);if(!Array.isArray(u))throw new Wi(i);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=i.length===0?n:hx(n,i);if(!Array.isArray(u)||u.length!==s[2].length)throw new Wi(i);const d=u.slice();for(let f=0;f<s[2].length;f++)u[f]=d[s[2][f]];continue}const r=hx(n,i.slice(0,-1)),a=i[i.length-1];if(Array.isArray(r)){if(typeof a!="number")throw new ff(a);fre(r,a)}const l=u=>{Object.defineProperty(r,a,{value:u,writable:!0,enumerable:!0,configurable:!0})},c=()=>Object.hasOwn(r,a)?r[a]:void 0;switch(s[0]){case"s":l(s[2]);break;case"d":if(Array.isArray(r)){if(typeof a!="number"||a>=r.length)throw new Wi(i);r.splice(a,1)}else delete r[a];break;case"a":{const u=c();if(typeof u!="string")throw new Wi(i);l(`${u}${s[2]}`);break}case"t":{const u=c();if(typeof u!="string")throw new Wi(i);l(u.slice(s[2]));break}}}return n}function pre(e,t){return xre(e,[t])}function xre(e,t){let n=e;const s=new WeakSet;for(const i of t)for(const r of i){if(S_(r),r[0]==="r"){n=r[1];continue}if(r[0]==="p"){const a=gre(n,r,s);if(a!==void 0){n=a;continue}}n=E_(n,r[0]==="p"||r[0]==="m"?r[1]:r[1].slice(0,-1),s),n=hre(n,[r])}return n}function gre(e,t,n){const[,s,i,r,a]=t;if(r!==0)return;let l=e;for(const f of s){if(!(typeof f=="string"?!j_.has(f)&&wd(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)||i!==l.length)return;const c=l.concat(a);if(n.add(c),s.length===0)return c;const u=s.slice(0,-1),d=E_(e,u,n);return Object.defineProperty(hx(d,u),s[s.length-1],{value:c,writable:!0,enumerable:!0,configurable:!0}),d}function E_(e,t,n){const s=a=>{if(Array.isArray(a))return a.slice();if(!wd(a))throw new Wi(t);return Object.getPrototypeOf(a)===null?Object.assign(Object.create(null),a):{...a}};if(!wd(e))throw new Wi(t);let i;n.has(e)?i=e:(i=s(e),n.add(i));let r=i;for(const a of t){if(!Object.hasOwn(r,a))throw new Wi(t);if(Array.isArray(r)&&typeof a!="number")throw new ff(a);const l=r[a];if(!wd(l))throw new Wi(t);if(n.has(l)){r=l;continue}const c=s(l);Object.defineProperty(r,a,{value:c,writable:!0,enumerable:!0,configurable:!0}),n.add(c),r=c}return i}function mre(e,t){let n=e;for(const s of t){if(!wd(n))throw new Wi(t);if(Array.isArray(n)&&typeof s!="number")throw new ff(s);if(!Object.hasOwn(n,s))throw new Wi(t);n=n[s]}return n}function hx(e,t){const n=mre(e,t);if(!wd(n))throw new Wi(t);return n}const wj=10*1024*1024,Zr=10,vre=512*1024,yre=/^[A-Za-z0-9_-]{22}$/;function kre(e){return yre.test(e)}const jj='<attachments v="1">',bre="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.",Sj="</attachments>";function wre(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>wj)return`Attachment is larger than ${wj/(1024*1024)} MB`}const jre='<file id="',Sre='" name="',Cre='" path="',Ere='" size="',Cj='"/>',$re=/^(?:0|[1-9][0-9]*)$/;function Are(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 Mp(e,t,n){if(!e.startsWith(n,t))return;const s=t+n.length,i=e.indexOf('"',s);if(i!==-1)return{value:e.slice(s,i),next:i}}function Mre(e){const t=Mp(e,0,jre);if(t===void 0)return;const n=Mp(e,t.next,Sre);if(n===void 0)return;const s=Mp(e,n.next,Cre);if(s===void 0)return;const i=Mp(e,s.next,Ere);if(i===void 0||!e.startsWith(Cj,i.next)||i.next+Cj.length!==e.length||!kre(t.value)||!$re.test(i.value))return;const r=Number(i.value);if(Number.isSafeInteger(r))return{id:t.value,name:Are(n.value),size:r}}function Tre(e){if(!e.startsWith(jj+`
384
+ `)||!e.endsWith(`
385
+ `+Sj))return;const t=e.slice(jj.length+1,-(Sj.length+1)).split(`
386
+ `);if(t[0]!==bre||t.length<2)return;const n=[];for(const s of t.slice(1)){const i=Mre(s);if(i===void 0)return;n.push(i)}return n}function cc(e,t,n){return e>=t&&e<=n}function $_(e){return e===8205}function zre(e){return cc(e,55296,56319)}function Ej(e){return cc(e,127462,127487)}function A_(e){return cc(e,65024,65039)}function M_(e){return cc(e,768,879)||cc(e,6832,6911)||cc(e,7616,7679)||cc(e,65056,65071)}function px(e){return e>65535?2:1}function $j(e,t){for(;t<e.length;){const n=e.codePointAt(t);if(M_(n)||A_(n))t+=px(n);else break}return t}function T_(e,t){const n=e.codePointAt(t);let s=t+px(n);for(s=$j(e,s);s<e.length-1&&$_(e.codePointAt(s));){const i=e.codePointAt(s+1);s+=1+px(i),s=$j(e,s)}return Ej(n)&&s<e.length&&Ej(e.codePointAt(s))&&(s+=px(e.codePointAt(s))),s}function z_(e){return e>=768&&(zre(e)||M_(e)||A_(e)||$_(e))}function Nre(e,t){let n=0,s=0;for(;s<e.length;)if(s=T_(e,s),++n>=t)return!0;return!1}function _re(e,t){let n=0,s=0;for(;s<e.length;)if(s=T_(e,s),++n>t)return!1;return!0}function Rre(e,t){if(t===0)return!0;if(e.length<t)return!1;let n=0;for(;;){if(z_(e.charCodeAt(n)))return Nre(e,t);if(++n>=t)return!0}}function Ire(e,t){if(e.length<=t)return!0;let n=0;for(;;){if(z_(e.charCodeAt(n)))return _re(e,t);if(++n>t)return!1}}function Mt(e){return Array.isArray(e)}function nr(e){return Re(typeof e,"bigint")}function hu(e){return Re(typeof e,"boolean")}function N_(e){if(On(e)||!A1(e))return!1;const t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function A1(e){return Re(typeof e,"function")}function __(e){return Number.isInteger(e)}function T0(e){return Re(e,null)}function as(e){return Number.isFinite(e)}function Lre(e){return jn(e)&&!Mt(e)}function jn(e){return Re(typeof e,"object")&&!T0(e)}function Fn(e){return Re(typeof e,"string")}function R_(e){return Re(typeof e,"symbol")}function On(e){return Re(e,void 0)}function Re(e,t){return e===t}function I_(e,t){return e>t}function L_(e,t){return e<t}function Rf(e,t){return e<=t}function d2(e,t){return e>=t}function Ore(e,t){if(nr(e)||nr(t))return BigInt(e)%BigInt(t)===0n;const n=1e-10;if(!as(e)||__(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 Dre(e){if(!jn(e))return!1;const t=globalThis.Object.getPrototypeOf(e);return T0(t)?!1:Re(typeof t.constructor,"function")&&!(Re(t.constructor,globalThis.Object)||Re(t.constructor.name,"Object"))}function O_(e){return nr(e)||hu(e)||T0(e)||as(e)||Fn(e)||On(e)}function Bre(e,t){return Ire(e,t)}function Hre(e,t){return Rre(e,t)}function ks(e,t,n){return e.every((s,i)=>i<t||n(s,i))}function D_(e,t){return e.some((n,s)=>t(n,s))}function qre(e,t){let n=!1;return e.forEach((s,i)=>{t(s,i)&&(n=!0)}),n}function B_(e,t){return e.reduce((n,s,i)=>t(s,i)?++n:n,0)}function f2(e){return Re(e,"__proto__")||Re(e,"constructor")||Re(e,"prototype")}function Ne(e,t){return f2(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function Zc(e){return Object.entries(e)}function Vn(e){return Object.getOwnPropertyNames(e)}function Pre(e){return Object.getOwnPropertySymbols(e)}function Ure(e,t){if(!jn(t))return!1;const n=Vn(e);return Re(n.length,Vn(t).length)&&n.every(s=>h2(e[s],t[s]))}function Fre(e,t){return Mt(t)&&Re(e.length,t.length)&&e.every((n,s)=>h2(e[s],t[s]))}function h2(e,t){return Mt(e)?Fre(e,t):jn(e)?Ure(e,t):Re(e,t)}function Vre(e){return e instanceof Boolean}function Gre(e){return e instanceof Number}function Wre(e){return e instanceof String}function H_(e){return globalThis.ArrayBuffer.isView(e)}function q_(e){return e instanceof globalThis.RegExp}function Kre(e){return e instanceof globalThis.Date}function Xre(e){return e instanceof globalThis.Set}function Zre(e){return e instanceof globalThis.Map}const Yre={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function P_(){return Yre}function Qre(e){return Ne(e,"~kind")||Ne(e,"~unsafe")}function Jre(e){const t={};for(const n of Vn(e)){if(f2(n))continue;const s=Object.getOwnPropertyDescriptor(e,n);s.value=Yc(s.value),Re(s.enumerable,!0)?t[n]=s.value:Object.defineProperty(t,n,s)}return t}function eoe(e){const t={};for(const n of Vn(e))f2(n)||(t[n]=Yc(e[n]));for(const n of Pre(e))t[n]=Yc(e[n]);return t}function toe(e){return Dre(e)?e:Qre(e)?Jre(e):eoe(e)}function noe(e){return e.map(t=>Yc(t))}function soe(e){return e.slice()}function ioe(e){return new RegExp(e.source,e.flags)}function roe(e){return new Map(Yc([...e.entries()]))}function ooe(e){return new Set(Yc([...e.values()]))}function Yc(e){return H_(e)?soe(e):q_(e)?ioe(e):Zre(e)?roe(e):Xre(e)?ooe(e):Mt(e)?noe(e):jn(e)?toe(e):e}function aoe(e){return Yc(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 ho(e,t,n={}){const s=coe(t,n),i=loe(s,e);return i}function U_(e,t,n){const s=P_(),i=aoe(e);for(const r of Object.keys(t))Object.defineProperty(i,r,{configurable:!0,writable:!0,enumerable:s.enumerableKind,value:t[r]});for(const r of Object.keys(n))Object.defineProperty(i,r,{configurable:!0,enumerable:!0,writable:!0,value:n[r]});return i}function uoe(e){return jn(e)}function doe(e){return U_(e,{"~optional":!0},{})}function foe(e,t){return U_(doe(e),{},t)}function wl(e,t){return ho({"~kind":"Array"},{type:"array",items:e},t)}function hoe(e,t={}){return foe(e,t)}function Ki(e){return hoe(e)}function poe(e){return uoe(e)&&Ne(e,"~optional")}function xoe(e){return Vn(e).filter(t=>!poe(e[t]))}function $n(e,t={}){const n=xoe(e),s=n.length>0?{required:n}:{};return ho({"~kind":"Object"},{type:"object",...s,properties:e},t)}function v6(e){return ho({"~kind":"Unknown"},{},e)}function F_(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 voe(e){return typeof e=="number"}var Ms;(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"})(Ms||(Ms={}));let nd=BigInt("14695981039346656037");const[yoe,koe]=[BigInt("1099511628211"),BigInt("18446744073709551616")],boe=Array.from({length:256}).map((e,t)=>BigInt(t)),V_=new Float64Array(1),G_=new DataView(V_.buffer),W_=new Uint8Array(V_.buffer);function Gn(e){nd=nd^boe[e],nd=nd*yoe%koe}function woe(e){Gn(Ms.Array);for(const t of e)gl(t)}function joe(e){Gn(Ms.BigInt),G_.setBigInt64(0,e);for(const t of W_)Gn(t)}function Aj(e){Gn(Ms.Boolean),Gn(e?1:0)}function Soe(e){Gn(Ms.Constructor),gl(e.toString())}function Coe(e){Gn(Ms.Date),gl(e.getTime())}function Eoe(e){Gn(Ms.Function),gl(e.toString())}function $oe(e){Gn(Ms.Null)}function Mj(e){Gn(Ms.Number),G_.setFloat64(0,e,!0);for(const t of W_)Gn(t)}function Aoe(e){Gn(Ms.Object);for(const t of moe(e).sort())gl(t),gl(e[t])}function Moe(e){Gn(Ms.RegExp),S5(e.toString())}const Toe=new TextEncoder;function S5(e){Gn(Ms.String);for(const t of Toe.encode(e))Gn(t)}function zoe(e){Gn(Ms.Symbol),gl(e.toString())}function Noe(e){Gn(Ms.TypeArray);const t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)Gn(t[n])}function _oe(e){return Gn(Ms.Undefined)}function gl(e){return H_(e)?Noe(e):Kre(e)?Coe(e):q_(e)?Moe(e):Vre(e)?Aj(e.valueOf()):Wre(e)?S5(e.valueOf()):Gre(e)?Mj(e.valueOf()):voe(e)?Mj(e):Mt(e)?woe(e):hu(e)?Aj(e):nr(e)?joe(e):N_(e)?Soe(e):T0(e)?$oe():jn(e)?Aoe(e):Fn(e)?S5(e):R_(e)?zoe(e):On(e)?_oe():A1(e)?Eoe(e):goe()}function Roe(e){return nd=BigInt("14695981039346656037"),gl(e),nd}function Ioe(e){return Roe(e).toString(16).padStart(16,"0")}function Loe(e){return ho({"~kind":"Boolean"},{type:"boolean"},e)}function Ooe(e){return ho({"~kind":"Integer"},{type:"integer"},e)}class Doe extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}}function Boe(e){return nr(e)?"bigint":hu(e)?"boolean":as(e)?"number":Fn(e)?"string":(()=>{throw new Doe(e)})()}function In(e,t){return ho({"~kind":"Literal"},{type:Boe(e),const:e},t)}function Hoe(e){return ho({"~kind":"Null"},{type:"null"},e)}function vr(e){return ho({"~kind":"Number"},{type:"number"},e)}function An(e){return ho({"~kind":"String"},{type:"string"},e)}function Bc(e,t={}){return ho({"~kind":"Union"},{anyOf:e},t)}function C5(e,t){return Array.from({length:t-e+1},(n,s)=>String.fromCharCode(e+s))}[...C5(97,122),...C5(65,90)];const qoe="0",Poe=C5(49,57);[...Poe];function Uoe(e){return Ne(e,"~refine")&&Mt(e["~refine"])&&ks(e["~refine"],0,t=>jn(t)&&Ne(t,"check")&&Ne(t,"error")&&A1(t.check)&&A1(t.error))}function Ai(e){return jn(e)&&!Mt(e)}function tm(e){return hu(e)}function gn(e){return Ai(e)||tm(e)}function Foe(e){return Ne(e,"additionalItems")&&gn(e.additionalItems)}function Voe(e){return Ne(e,"additionalProperties")&&gn(e.additionalProperties)}function Goe(e){return Ne(e,"allOf")&&Mt(e.allOf)&&e.allOf.every(t=>gn(t))}function E5(e){return Ne(e,"$anchor")&&Fn(e.$anchor)}function Woe(e){return Ne(e,"anyOf")&&Mt(e.anyOf)&&e.anyOf.every(t=>gn(t))}function Koe(e){return Ne(e,"const")}function y6(e){return Ne(e,"contains")&&gn(e.contains)}function Xoe(e){return Ne(e,"dependencies")&&jn(e.dependencies)&&Object.values(e.dependencies).every(t=>gn(t)||Mt(t)&&t.every(n=>Fn(n)))}function Zoe(e){return Ne(e,"dependentRequired")&&jn(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>Mt(t)&&t.every(n=>Fn(n)))}function Yoe(e){return Ne(e,"dependentSchemas")&&jn(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>gn(t))}function Qc(e){return Ne(e,"$dynamicAnchor")&&Fn(e.$dynamicAnchor)}function Qoe(e){return Ne(e,"$dynamicRef")&&Fn(e.$dynamicRef)}function Joe(e){return Ne(e,"else")&&gn(e.else)}function eae(e){return Ne(e,"enum")&&Mt(e.enum)}function tae(e){return Ne(e,"exclusiveMaximum")&&(as(e.exclusiveMaximum)||nr(e.exclusiveMaximum))}function nae(e){return Ne(e,"exclusiveMinimum")&&(as(e.exclusiveMinimum)||nr(e.exclusiveMinimum))}function sae(e){return Ne(e,"format")&&Fn(e.format)}function wr(e){return Ne(e,"$id")&&Fn(e.$id)}function iae(e){return Ne(e,"if")&&gn(e.if)}function k6(e){return Ne(e,"items")&&(gn(e.items)||Mt(e.items)&&e.items.every(t=>gn(t)))}function rae(e){return k6(e)&&Mt(e.items)}function oae(e){return Ne(e,"maximum")&&(as(e.maximum)||nr(e.maximum))}function aae(e){return Ne(e,"maxContains")&&as(e.maxContains)}function lae(e){return Ne(e,"maxItems")&&as(e.maxItems)}function cae(e){return Ne(e,"maxLength")&&as(e.maxLength)}function uae(e){return Ne(e,"maxProperties")&&as(e.maxProperties)}function dae(e){return Ne(e,"minimum")&&(as(e.minimum)||nr(e.minimum))}function K_(e){return Ne(e,"minContains")&&as(e.minContains)}function fae(e){return Ne(e,"minItems")&&as(e.minItems)}function hae(e){return Ne(e,"minLength")&&as(e.minLength)}function pae(e){return Ne(e,"minProperties")&&as(e.minProperties)}function xae(e){return Ne(e,"multipleOf")&&(as(e.multipleOf)||nr(e.multipleOf))}function gae(e){return Ne(e,"not")&&gn(e.not)}function mae(e){return Ne(e,"oneOf")&&Mt(e.oneOf)&&e.oneOf.every(t=>gn(t))}function vae(e){return Ne(e,"pattern")&&(Fn(e.pattern)||e.pattern instanceof RegExp)}function X_(e){return Ne(e,"patternProperties")&&jn(e.patternProperties)&&Object.values(e.patternProperties).every(t=>gn(t))}function Z_(e){return Ne(e,"prefixItems")&&Mt(e.prefixItems)&&e.prefixItems.every(t=>gn(t))}function Y_(e){return Ne(e,"properties")&&jn(e.properties)&&Object.values(e.properties).every(t=>gn(t))}function yae(e){return Ne(e,"propertyNames")&&(jn(e.propertyNames)||gn(e.propertyNames))}function kae(e){return Ne(e,"$recursiveAnchor")&&hu(e.$recursiveAnchor)}function $5(e){return kae(e)&&Re(e.$recursiveAnchor,!0)}function bae(e){return Ne(e,"$recursiveRef")&&Fn(e.$recursiveRef)}function wae(e){return Ne(e,"$ref")&&Fn(e.$ref)}function Q_(e){return Ne(e,"required")&&Mt(e.required)&&e.required.every(t=>Fn(t))}function jae(e){return Ne(e,"then")&&gn(e.then)}function Sae(e){return Ne(e,"type")&&(Fn(e.type)||Mt(e.type)&&e.type.every(t=>Fn(t)))}function Cae(e){return Ne(e,"uniqueItems")&&hu(e.uniqueItems)}function Eae(e){return Ne(e,"unevaluatedItems")&&gn(e.unevaluatedItems)}function $ae(e){return Ne(e,"unevaluatedProperties")&&gn(e.unevaluatedProperties)}class If{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 Aae(e,t,n,s){return ks(n["~refine"],0,(i,r)=>i.check(s))}function Mae(e){return k6(e)&&Mt(e.items)}function Tae(e,t,n,s){return Mae(n)?ks(s,0,(r,a)=>L_(a,n.items.length)||pu(e,t,n.additionalItems,r)&&t.AddIndex(a)):!0}function b6(e){return new RegExp(e,"u")}function zae(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Nae(e){const t=[];return X_(e)&&t.push(...Vn(e.patternProperties)),Y_(e)&&t.push(...Vn(e.properties).map(zae)),Re(t.length,0)?"(?!)":`(${t.join("|")})`}function _ae(e,t,n,s){const i=b6(Nae(n));return ks(Vn(s),0,(a,l)=>i.test(a)||pu(e,t,n.additionalProperties,s[a])&&t.AddKey(a))}function Rae(e,t,n,s){const i=n.allOf.reduce((r,a)=>{const l=new If;return Dn(e,l,a,s)?[...r,l]:r},[]);return Re(i.length,n.allOf.length)&&t.Merge(i)}function Iae(e,t,n,s){const i=n.anyOf.reduce((r,a)=>{const l=new If;return Dn(e,l,a,s)?[...r,l]:r},[]);return I_(i.length,0)&&t.Merge(i)}function Lae(e,t,n,s){return n}function Oae(e,t,n,s){return O_(n.const)?Re(s,n.const):h2(s,n.const)}function Dae(e){return!(K_(e)&&Re(e.minContains,0))}function Bae(e,t,n,s){return Dae(n)?!Re(s.length,0)&&qre(s,(i,r)=>Dn(e,t,n.contains,i)&&t.AddIndex(r)):!0}function Hae(e,t,n,s){const i=Re(Vn(s).length,0),r=ks(Zc(n.dependencies),0,([a,l])=>!Ne(s,a)||(Mt(l)?l.every(c=>Ne(s,c)):Dn(e,t,l,s)));return i||r}function qae(e,t,n,s){const i=Re(Vn(s).length,0),r=ks(Zc(n.dependentRequired),0,([a,l])=>!Ne(s,a)||l.every(c=>Ne(s,c)));return i||r}function Pae(e,t,n,s){const i=Re(Vn(s).length,0),r=ks(Zc(n.dependentSchemas),0,([a,l])=>!Ne(s,a)||Dn(e,t,l,s));return i||r}function Uae(e,t,n,s){const i=e.DynamicRef(n)??!1;return gn(i)&&Dn(e,t,i,s)}function Fae(e,t,n,s){return D_(n.enum,i=>O_(i)?Re(s,i):h2(s,i))}function Vae(e,t,n,s){return L_(s,n.exclusiveMaximum)}function Gae(e,t,n,s){return I_(s,n.exclusiveMinimum)}const Wae=[0,31,28,31,30,31,30,31,31,30,31,30,31],Kae=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Xae(e){return e%4===0&&(e%100!==0||e%400===0)}function J_(e){const t=Kae.exec(e);if(!t)return!1;const n=+t[1],s=+t[2],i=+t[3];return s>=1&&s<=12&&i>=1&&i<=(s===2&&Xae(n)?29:Wae[s])}const Zae=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function eR(e,t=!0){const n=Zae.exec(e);if(!n||t&&!n[4]&&!n[5])return!1;const s=+n[1],i=+n[2],r=+n[3];if(s>23||i>59||r>60)return!1;if(n[5]){const d=+n[6],f=+n[7];if(d>23||f>59)return!1}if(r<60)return!0;const a=n[5]==="-"?-1:1,l=+(n[6]||0),c=+(n[7]||0);return((s*60+i-a*(l*60+c))%1440+1440)%1440===1439}function Yae(e){const t=e.split(/T/i);return t.length===2&&J_(t[0])&&eR(t[1])}const Qae=/^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 Jae(e){return Qae.test(e)}const ele=/^(?:[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 tle(e){return ele.test(e)}const nle=new RegExp("^(?!-).*(?<!-)$"),sle=/^(?!..--)/,ile=/^[a-zA-Z0-9-]*$/,w6=/[^\p{ASCII}]/u,rle=/[0-9]/,ole=/[\u{0660}-\u{0669}]/u,ale=/[\u{06f0}-\u{06f9}]/u,lle=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,cle=/[\u{002d}\u{002b}]/u,tR=new RegExp("\\p{Mn}","u"),ule=new RegExp("\\p{Mc}","u"),dle=/[\p{Mn}\p{Mc}\p{Me}]/u,nR=new RegExp("\\p{L}","u"),fle=new RegExp("\\p{Nd}","u"),hle=new RegExp("\\p{Script=Greek}","u"),sR=new RegExp("\\p{Script=Hebrew}","u"),ple=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,xle=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,Tj=/[\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,gle=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,mle=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,vle=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,yle=new RegExp([rle,ale].map(e=>e.source).join("|"),"u"),kle=new RegExp([nR,cle,lle,fle,tR,ule,mle,vle].map(e=>e.source).join("|"),"u");function ble(e){return nle.test(e)&&sle.test(e)&&ile.test(e)}const yr=36,Yh=1,M1=26,wle=38,jle=700,iR=72,rR=128;function ay(){throw null}function oR(e){return e.toLowerCase().startsWith("xn--")}function aR(e,t,n){e=n?Math.floor(e/jle):e>>1,e+=Math.floor(e/t);let s=0;for(;e>(yr-Yh)*M1>>1;)e=Math.floor(e/(yr-Yh)),s+=yr;return s+Math.floor((yr-Yh+1)*e/(e+wle))}function lR(e){const t=[];let n=rR,s=0,i=iR;const r=e.lastIndexOf("-");if(r>0)for(let l=0;l<r;l++){const c=e.charCodeAt(l);c>=128&&ay(),t.push(c)}let a=r<0?0:r+1;for(;a<e.length;){const l=s;let c=1,u=yr;for(;;){a>=e.length&&ay();const f=e.charCodeAt(a++);let p;f>=97&&f<=122?p=f-97:f>=48&&f<=57?p=f-48+26:ay(),s+=p*c;const x=u<=i?Yh:u>=i+M1?M1:u-i;if(p<x)break;c*=yr-x,u+=yr}const d=t.length+1;i=aR(s-l,d,l===0),n+=Math.floor(s/d),s%=d,t.splice(s,0,n),s++}return String.fromCodePoint(...t)}function zj(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}const Sle=new RegExp(w6.source,"gu");function Cle(e){const t=e.replace(Sle,""),n=t.length,s=n>0?[t,"-"]:[],i=Array.from(e,u=>u.codePointAt(0));let r=rR,a=0,l=iR,c=n;for(;c<i.length;){let u=1/0;for(const d of i)d>=r&&d<u&&(u=d);a+=(u-r)*(c+1),r=u;for(const d of i)if(d<r&&a++,d===r){let f=a;for(let p=yr;;p+=yr){const x=p<=l?Yh:p>=l+M1?M1:p-l;if(f<x)break;const g=x+(f-x)%(yr-x);s.push(zj(g)),f=Math.floor((f-x)/(yr-x))}s.push(zj(f)),l=aR(a,c+1,c===n),a=0,c++}a++,r++}return s.join("")}const Ele=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,Nj=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,$le=/^(?:R|AL|AN)$/;function Ale(e){if(oR(e))try{return A5(lR(e.slice(4).toLowerCase()))}catch{return!1}return A5(e)}function cR(e){const t=String.fromCodePoint(e);return yle.test(t)?"EN":ole.test(t)?"AN":tR.test(t)?"NSM":sR.test(t)?"R":xle.test(t)?"AL":nR.test(t)?"L":"ON"}function A5(e){for(const t of e)if($le.test(cR(t.codePointAt(0))))return!0;return!1}function uR(e){let t=!1,n=Nj,s=!1,i=!1,r=!0;for(const a of e){const l=cR(a.codePointAt(0));if(r){if(l!=="L"&&l!=="R"&&l!=="AL")return!1;t=l==="R"||l==="AL",n=t?Ele:Nj,r=!1}if(!n.test(l))return!1;l==="EN"?s=!0:l==="AN"&&(i=!0)}return!(t&&s&&i)}function Mle(e){return w6.test(e)&&Cle(e).length+4>63}function Tle(e){return e[0]==="-"||e[e.length-1]==="-"?!0:e.slice(2).join("").startsWith("--")}function dR(e){if(Mle(e)||A5(e)&&!uR(e))return!1;const t=[...e],n=t.map(r=>r.codePointAt(0)),s=n.length;if(Tle(t)||dle.test(t[0]))return!1;let i=!1;for(let r=0;r<s;r++){const a=n[r],l=t[r];if(gle.test(l)||!kle.test(l))return!1;ple.test(l)&&(i=!0);const c=n[r-1],u=n[r+1];switch(a){case 183:if(c!==108||u!==108)return!1;break;case 885:if(!u||!hle.test(t[r+1]))return!1;break;case 1523:case 1524:if(!c||!sR.test(t[r-1]))return!1;break;case 8204:if(!c||c<128&&!Tj.test(t[r-1]))return!1;break;case 8205:if(!c||!Tj.test(t[r-1]))return!1;break}}return!(e.includes("・")&&!i)}function fR(e){if(!oR(e))return!1;try{const t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;const n=lR(t);return w6.test(n)?dR(n):!1}catch{return!1}}function zle(e){return e.length>0&&e.length<=63}function Nle(e){return zle(e)&&(fR(e)||ble(e))}function _le(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(".").every(t=>Nle(t))}function Rle(e){return e.length>0&&e.length<=63}function Ile(e){return Rle(e)&&(fR(e)||dR(e))}function Lle(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 Ole(e){if(e.length===0||e.includes(" "))return!1;const t=Lle(e);if(t.length>253)return!1;const n=t.split("."),s=n.some(i=>Ale(i));return n.every(i=>Ile(i)&&(!s||uR(i)))}function Dle(e){return _le(e)}const Ble=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 Hle(e){return Ble.test(e.normalize("NFC"))}function qle(e){return Ole(e)}const Ple=/^(?:(?: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 Ule(e){return Ple.test(e)}const Fle=/^(?:(?:(?:[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 Vle(e){return Fle.test(e)}const Gle=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,Wle=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function Kle(e){return!Gle.test(e)&&!Wle.test(e)&&URL.canParse(e,"http://example.com")}const Xle=2048,Zle=/\[[vV][0-9a-fA-F]+\.[^\]]+\]/,Yle=/[\x00-\x20<>\^`{|}\\]/,Qle=/%(?![0-9a-fA-F]{2})/;function Jle(e){return e.length<Xle?e.replace(Zle,"[::1]"):e}function ece(e){return Yle.test(e)||Qle.test(e)?!1:URL.canParse(Jle(e))}const tce=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function nce(e){return tce.test(e)}const sce=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function ice(e){return sce.test(e)}function rce(e){try{return new RegExp(e,"u"),!0}catch{return!1}}const oce=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function ace(e){return oce.test(e)}const lce=/^(?:[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 cce(e){return lce.test(e)}const uce=/^(?:(?:[^\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 dce(e){return uce.test(e)}const fce=/^[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 hce(e){return fce.test(e)}function pce(e){return URL.canParse(e)}const xce=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function gce(e){return xce.test(e)}const fn=new Map;function mce(){fn.clear()}function vce(e,t){var n;return((n=fn.get(e))==null?void 0:n(t))??!0}function yce(){mce(),fn.set("date-time",Yae),fn.set("date",J_),fn.set("duration",Jae),fn.set("email",tle),fn.set("hostname",Dle),fn.set("idn-email",Hle),fn.set("idn-hostname",qle),fn.set("ipv4",Ule),fn.set("ipv6",Vle),fn.set("iri-reference",Kle),fn.set("iri",ece),fn.set("json-pointer-uri-fragment",nce),fn.set("json-pointer",ice),fn.set("regex",rce),fn.set("relative-json-pointer",ace),fn.set("time",eR),fn.set("uri-reference",cce),fn.set("uri-template",dce),fn.set("uri",hce),fn.set("url",pce),fn.set("uuid",gce)}yce();function kce(e,t,n,s){return vce(n.format,s)}function bce(e,t,n,s){const i=jae(n)?n.then:!0,r=Joe(n)?n.else:!0;return Dn(e,t,n.if,s)?Dn(e,t,i,s):Dn(e,t,r,s)}function wce(e,t,n,s){return ks(n.items,0,(i,r)=>Rf(s.length,r)||pu(e,t,i,s[r])&&t.AddIndex(r))}function jce(e,t,n,s){const i=Z_(n)?n.prefixItems.length:0;return ks(s,i,(r,a)=>pu(e,t,n.items,r)&&t.AddIndex(a))}function Sce(e,t,n,s){return rae(n)?wce(e,t,n,s):jce(e,t,n,s)}function Cce(e){return y6(e)}function Ece(e,t,n,s){if(!Cce(n))return!0;const i=B_(s,r=>Dn(e,t,n.contains,r));return Rf(i,n.maxContains)}function $ce(e,t,n,s){return Rf(s,n.maximum)}function Ace(e,t,n,s){return Rf(s.length,n.maxItems)}function Mce(e,t,n,s){return Bre(s,n.maxLength)}function Tce(e,t,n,s){return Rf(Vn(s).length,n.maxProperties)}function zce(e){return y6(e)}function Nce(e,t,n,s){if(!zce(n))return!0;const i=B_(s,(r,a)=>Dn(e,t,n.contains,r)&&t.AddIndex(a));return d2(i,n.minContains)}function _ce(e,t,n,s){return d2(s,n.minimum)}function Rce(e,t,n,s){return d2(s.length,n.minItems)}function Ice(e,t,n,s){return Hre(s,n.minLength)}function Lce(e,t,n,s){return d2(Vn(s).length,n.minProperties)}function Oce(e,t,n,s){return Ore(s,n.multipleOf)}function Dce(e,t,n,s){const i=new If;return!Dn(e,i,n.not,s)&&t.Merge([i])}function Bce(e,t,n,s){const i=n.oneOf.reduce((r,a)=>{const l=new If;return Dn(e,l,a,s)?[...r,l]:r},[]);return Re(i.length,1)&&t.Merge(i)}function Hce(e,t,n,s){return(Fn(n.pattern)?b6(n.pattern):n.pattern).test(s)}function qce(e,t,n,s){return ks(Zc(n.patternProperties),0,([i,r])=>{const a=b6(i);return ks(Zc(s),0,([l,c])=>!a.test(l)||pu(e,t,r,c)&&t.AddKey(l))})}function Pce(e,t,n,s){return Re(s.length,0)||ks(n.prefixItems,0,(i,r)=>Rf(s.length,r)||pu(e,t,i,s[r])&&t.AddIndex(r))}function Uce(e,t){return e.includes(t)||P_().exactOptionalPropertyTypes}function Fce(e,t){return On(e[t])}function Vce(e,t,n,s){const i=Q_(n)?n.required:[];return ks(Zc(n.properties),0,([a,l])=>{const c=!Ne(s,a)||pu(e,t,l,s[a])&&t.AddKey(a);return Uce(i,a)?c:Fce(s,a)||c})}function Gce(e,t,n,s){return ks(Vn(s),0,(i,r)=>Dn(e,t,n.propertyNames,i))}function Wce(e,t,n,s){const i=e.RecursiveRef(n)??!1;return gn(i)&&Dn(e,t,i,s)}function Kce(e,t,n,s){const i=e.Ref(n)??!1,r=new If,a=gn(i)&&Dn(e,r,i,s);return a&&t.Merge([r]),a}function Xce(e,t,n,s){return ks(n.required,0,i=>Ne(s,i))}function hR(e,t,n,s,i){return Re(n,"object")?Lre(i):Re(n,"array")?Mt(i):Re(n,"boolean")?hu(i):Re(n,"integer")?__(i):Re(n,"number")?as(i):Re(n,"null")?T0(i):Re(n,"string")?Fn(i):Re(n,"bigint")?nr(i):Re(n,"constructor")?N_(i):Re(n,"function")?A1(i):Re(n,"symbol")?R_(i):Re(n,"undefined")||Re(n,"void")?On(i):!0}function Zce(e,t,n,s,i){return D_(n,r=>hR(e,t,r,s,i))}function Yce(e,t,n,s){return Mt(n.type)?Zce(e,t,n.type,n,s):hR(e,t,n.type,n,s)}function Qce(e,t,n,s){const i=t.GetIndices();return ks(s,0,(r,a)=>(i.has(a)||Dn(e,t,n.unevaluatedItems,r))&&t.AddIndex(a))}function Jce(e,t,n,s){const i=t.GetKeys();return ks(Zc(s),0,([r,a])=>i.has(r)||Dn(e,t,n.unevaluatedProperties,a)&&t.AddKey(r))}function eue(e){return!Re(e.uniqueItems,!1)}function tue(e,t,n,s){if(!eue(n))return!0;const i=new Set(s.map(Ioe)).size,r=s.length;return Re(i,r)}function pu(e,t,n,s){return t.Push()&&Dn(e,t,n,s)&&t.Pop()}function Dn(e,t,n,s){e.Push(n);const i=tm(n)?Lae(e,t,n):(!Sae(n)||Yce(e,t,n,s))&&(!(jn(s)&&!Mt(s))||(!Q_(n)||Xce(e,t,n,s))&&(!Voe(n)||_ae(e,t,n,s))&&(!Xoe(n)||Hae(e,t,n,s))&&(!Zoe(n)||qae(e,t,n,s))&&(!Yoe(n)||Pae(e,t,n,s))&&(!X_(n)||qce(e,t,n,s))&&(!Y_(n)||Vce(e,t,n,s))&&(!yae(n)||Gce(e,t,n,s))&&(!pae(n)||Lce(e,t,n,s))&&(!uae(n)||Tce(e,t,n,s)))&&(!Mt(s)||(!Foe(n)||Tae(e,t,n,s))&&(!y6(n)||Bae(e,t,n,s))&&(!k6(n)||Sce(e,t,n,s))&&(!aae(n)||Ece(e,t,n,s))&&(!lae(n)||Ace(e,t,n,s))&&(!K_(n)||Nce(e,t,n,s))&&(!fae(n)||Rce(e,t,n,s))&&(!Z_(n)||Pce(e,t,n,s))&&(!Cae(n)||tue(e,t,n,s)))&&(!Fn(s)||(!cae(n)||Mce(e,t,n,s))&&(!hae(n)||Ice(e,t,n,s))&&(!sae(n)||kce(e,t,n,s))&&(!vae(n)||Hce(e,t,n,s)))&&(!(as(s)||nr(s))||(!tae(n)||Vae(e,t,n,s))&&(!nae(n)||Gae(e,t,n,s))&&(!oae(n)||$ce(e,t,n,s))&&(!dae(n)||_ce(e,t,n,s))&&(!xae(n)||Oce(e,t,n,s)))&&(!wae(n)||Kce(e,t,n,s))&&(!bae(n)||Wce(e,t,n,s))&&(!Qoe(n)||Uae(e,t,n,s))&&(!Koe(n)||Oae(e,t,n,s))&&(!eae(n)||Fae(e,t,n,s))&&(!iae(n)||bce(e,t,n,s))&&(!gae(n)||Dce(e,t,n,s))&&(!Goe(n)||Rae(e,t,n,s))&&(!Woe(n)||Iae(e,t,n,s))&&(!mae(n)||Bce(e,t,n,s))&&(!Eae(n)||!Mt(s)||Qce(e,t,n,s))&&(!$ae(n)||!jn(s)||Jce(e,t,n,s))&&(!Uoe(n)||Aae(e,t,n,s));return e.Pop(n),i}function nue(e,t){return jn(t)&&!f2(e)?t[e]:void 0}function sue(e,t){return e.reduce((n,s)=>nue(s,n),t)}function iue(e){if(Re(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 rue(e,t){const n=iue(t);return sue(n,e)}const p2="https://json-schema.org";function pR(e,t){if(jn(e)&&Qc(e)&&Re(e.$dynamicAnchor,t))return e;if(jn(e))for(const n of Vn(e)){const s=pR(e[n],t);if(s)return s}}function M5(e,t,n){if(Re(e,n))return t.href;const s=Ai(e)&&wr(e)?new URL(e.$id,t.href):t;if(Mt(e))for(const i of e){const r=M5(i,s,n);if(!On(r))return r}else if(jn(e))for(const i of Vn(e)){const r=M5(e[i],s,n);if(!On(r))return r}}function oue(e,t,n){if(Re(e.$id,n.hash))return e;const s=new URL(n.href,t.href);if(Re(t.pathname,s.pathname))return n.hash.startsWith("#")?xR(e,n):e}function aue(e,t,n){const s=new URL(`#${e.$anchor}`,t.href),i=new URL(n.href,t.href);return Re(s.href,i.href)?e:void 0}function lue(e,t,n){const s=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(n.href,t.href);return Re(s.href,i.href)?e:void 0}function xR(e,t){if(t.href.endsWith("#"))return e;if(!t.hash.startsWith("#"))return;const n=decodeURIComponent(t.hash.slice(1));return n.startsWith("/")?rue(e,n):void 0}function cue(e,t,n){if(wr(e)){const s=oue(e,t,n);if(!On(s))return s}if(E5(e)){const s=aue(e,t,n);if(!On(s))return s}if(Qc(e)){const s=lue(e,t,n);if(!On(s))return s}return xR(e,n)}function uue(e,t,n){return e.reduce((s,i)=>{const r=x2(i,t,n);return On(r)?s:r},void 0)}function due(e){return Re(e,"const")||Re(e,"enum")}function fue(e,t,n){return Vn(e).reduce((s,i)=>{if(due(i))return s;const r=x2(e[i],t,n);return On(r)?s:r},void 0)}function x2(e,t,n){const s=Ai(e)&&wr(e)?new URL(e.$id,t.href):t;if(Ai(e)){const i=cue(e,s,n);if(!On(i))return i}if(Mt(e))return uue(e,s,n);if(jn(e))return fue(e,s,n)}function hue(e,t,n){return M5(e,new URL(t||".",p2),n)}function pue(e,t,n,s){const i=g2(e,t,n,s,!1);return Ai(i)&&wr(i)?i:void 0}function _j(e){return e.href.split("#")[0]}function xue(e,t){return Ne(e,t)?e[t]:void 0}function gue(e,t,n){return x2(e,t,n)}function mue(e,t,n){const s=_j(n);if(Re(s,_j(t))||!Ne(e,s))return;const i=e[s],r=Ai(i)&&wr(i)?new URL(i.$id,s):new URL(s);return Re(n.hash,"")?i:x2(i,r,n)}function vue(e,t,n,s,i){if(!s.$ref.startsWith("#")||Ne(e,"$schema"))return;const r=hue(t,n,i);if(!(On(r)||Re(r,n)))return{target:i,base:r,root:t}}function yue(e,t,n){const s=e[t];if(Ai(s))return{target:n,base:t,root:s}}function kue(e,t,n,s,i){const r=i?yue(e.context,s,n):void 0;return On(r)?vue(e.root,e.lexicalSchema,e.referenceBase,t,n):r}function bue(e,t,n,s,i,r){if(wr(i))return;const a=pue(e,t,n,s);if(!(!a||r.includes(a)))return{target:i,resource:a}}function g2(e,t,n,s,i=!0){const r=new URL(n||".",p2),a=i&&wr(t)?new URL(t.$id,r):r,l=new URL(s,a.href);return xue(e,s)??gue(t,a,l)??mue(e,a,l)}function wue(e,t,n,s,i,r){const a=new URL(n||".",p2),l=i.$dynamicRef.startsWith("#")?s:t,c=g2(e,l,n,i.$dynamicRef,!1);if(On(c)){const f=new URL(i.$dynamicRef,a).hash;if(!f.startsWith("#/")&&f.startsWith("#")){const p=decodeURIComponent(f.slice(1));return r.find(g=>Re(g.$dynamicAnchor,p))??pR(t,p)}return}return!Ai(c)||!Qc(c)||new URL(i.$dynamicRef,a).hash.startsWith("#/")?c:r.find(f=>Re(f.$dynamicAnchor,c.$dynamicAnchor))??c}function jue(e,t){const n=e.inRetrievedFrame?e.lexicalSchema:e.root,s=t.$ref.startsWith("#")?e.lexicalSchema:n,i=g2(e.context,s,e.referenceBase,t.$ref,!1);if(!i||!Ai(i))return{schema:i};const r=new URL(t.$ref,e.referenceBase).href.split("#")[0],a=!Re(r,e.resourceBase),l=kue(e,t,i,r,a),c=a?bue(e.context,e.root,e.referenceBase,r,i,e.ids):void 0;return{schema:i,retrievedResource:l,resolvedResource:c}}function Sue(e,t){const n=$5(e.lexicalSchema)?e.recursiveAnchors[0]:e.lexicalSchema;return g2(e.context,n,e.lexicalBase,t.$recursiveRef,!1)}function Cue(e,t){return wue(e.context,e.root,e.lexicalBase,e.lexicalSchema,t,e.dynamicAnchors)}var Yt=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)},Ot,xx,gR,T5,Tp,Rj,Ij,Lj,Oj,ly,cy,z5,N5,Dj,mR;class Eue{constructor(t,n){Ot.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 Yt(this,Ot,"m",T5).call(this,this.ids)}Push(t){if(!Ai(t))return;wr(t)&&Yt(this,Ot,"m",z5).call(this,t),E5(t)&&this.anchors.push(t),$5(t)&&this.recursiveAnchors.push(t),Qc(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){Ai(t)&&(wr(t)&&Yt(this,Ot,"m",N5).call(this,t),E5(t)&&this.anchors.pop(),$5(t)&&this.recursiveAnchors.pop(),Qc(t)&&this.dynamicAnchors.pop(),this.retrievedResources.has(t)&&this.retrievedFrames.pop(),Yt(this,Ot,"m",mR).call(this,t))}Ref(t){const n=jue(Yt(this,Ot,"m",xx).call(this),t);return Yt(this,Ot,"m",gR).call(this,n),n.schema}RecursiveRef(t){const n=Sue(Yt(this,Ot,"m",xx).call(this),t);return n&&(this.pendingResource=!0),n}DynamicRef(t){const n=Cue(Yt(this,Ot,"m",xx).call(this),t);return n&&(this.pendingResource=!0),n}}Ot=new WeakSet,xx=function(){return{context:this.context,root:this.schema,ids:this.ids,lexicalSchema:Yt(this,Ot,"m",Ij).call(this),lexicalBase:this.LexicalBaseURL(),referenceBase:Yt(this,Ot,"m",Rj).call(this),resourceBase:Yt(this,Ot,"m",Tp).call(this),recursiveAnchors:this.recursiveAnchors,dynamicAnchors:this.dynamicAnchors,inRetrievedFrame:this.retrievedFrames.length>0}},gR=function(t){On(t.schema)||(this.pendingResource=!0),On(t.resolvedResource)||Yt(this,Ot,"m",Dj).call(this,t.resolvedResource.target,t.resolvedResource.resource),On(t.retrievedResource)||this.retrievedResources.set(t.retrievedResource.target,{base:t.retrievedResource.base,root:t.retrievedResource.root})},T5=function(t){const n=this.retrievedFrames[this.retrievedFrames.length-1],s=n?new URL(n.base):new URL(p2);return(n?t.slice(n.idDepth):t).reduce((r,a)=>new URL(a.$id,r),s).href},Tp=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:Yt(this,Ot,"m",T5).call(this,this.resourceIds)},Rj=function(){if(this.retrievedFrames.length>0)return Yt(this,Ot,"m",Tp).call(this);const t=this.ids[this.ids.length-1];return t&&!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t.$id)?this.LexicalBaseURL():Yt(this,Ot,"m",Tp).call(this)},Ij=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},Lj=function(t){t.forEach(n=>Yt(this,Ot,"m",ly).call(this,n,!1))},Oj=function(t){t.forEach(n=>Yt(this,Ot,"m",cy).call(this,n,!1))},ly=function e(t,n=!0){if(tm(t))return;if(Mt(t))return Yt(this,Ot,"m",Lj).call(this,t);if(!Ai(t))return;const s=t;if(!(!n&&wr(s))){!n&&Qc(s)&&this.dynamicAnchors.push(s);for(const i of Vn(s))Yt(this,Ot,"m",e).call(this,s[i],!1)}},cy=function e(t,n=!0){if(tm(t))return;if(Mt(t))return Yt(this,Ot,"m",Oj).call(this,t);if(!Ai(t))return;const s=t;if(!(!n&&wr(s))){!n&&Qc(s)&&this.dynamicAnchors.pop();for(const i of Vn(s))Yt(this,Ot,"m",e).call(this,s[i],!1)}},z5=function(t){this.ids.push(t);const n=this.pendingResource;this.pendingResource=!1,n&&this.resourceIds.push(t),Yt(this,Ot,"m",ly).call(this,t,!0)},N5=function(t){this.ids.pop(),this.resourceIds.length>0&&Re(this.resourceIds[this.resourceIds.length-1],t)&&this.resourceIds.pop(),Yt(this,Ot,"m",cy).call(this,t,!0)},Dj=function(t,n){Yt(this,Ot,"m",z5).call(this,n),this.resolvedResources.set(t,n)},mR=function(t){if(!this.resolvedResources.has(t))return;const n=this.resolvedResources.get(t);Yt(this,Ot,"m",N5).call(this,n),this.resolvedResources.delete(t)};function $ue(...e){const[t,n,s]=F_(e,{3:(a,l,c)=>[a,l,c],2:(a,l)=>[{},a,l]}),i=new Eue(t,n),r=new If;return Dn(i,r,n,s)}function Au(...e){const[t,n,s]=F_(e,{3:(i,r,a)=>[i,r,a],2:(i,r)=>[{},i,r]});return $ue(t,n,s)}BigInt(Number.MAX_SAFE_INTEGER);BigInt(Number.MIN_SAFE_INTEGER);const Aue=$n({type:In("insert"),path:An(),value:v6()}),Mue=Object({type:In("update"),path:An(),value:v6()}),Tue=$n({type:In("delete"),path:An()});Bc([Aue,Mue,Tue]);const zue=$n({text:An({minLength:1}),status:Bc([In("pending"),In("in_progress"),In("completed")])}),Nue=$n({items:wl(zue)}),_ue=$n({label:An({minLength:1}),description:Ki(An())}),Rue=$n({question:An({minLength:1}),header:An({minLength:1,maxLength:16}),options:wl(_ue,{minItems:2,maxItems:4}),multiSelect:Ki(Loe())}),Iue=$n({selected:wl(An()),other:Ki(An())}),Lue=Bc([$n({outcome:In("answered"),answers:wl(Iue),at:vr()}),$n({outcome:In("dismissed"),at:vr()}),$n({outcome:In("cancelled"),at:vr()})]),Oue=$n({id:An({minLength:1}),questions:wl(Rue,{minItems:1,maxItems:4}),askedAt:vr(),resolution:Ki(Lue)}),Due=$n({requests:wl(Oue)}),Bue=$n({patch:An()}),Hue=$n({id:Ki(vr()),name:An(),args:An(),status:Bc([In("running"),In("ok"),In("error"),In("cancelled")]),durationMs:Ki(vr()),error:Ki(An()),details:Ki(v6())}),que=$n({code:Ki(An()),calls:wl(Hue)}),Mu=Ooe({minimum:0}),Pue=$n({used:Mu,system:Mu,skills:Mu,tools:Mu,mcp:Mu,messages:Mu}),Uue=Bc([In("starting"),In("running"),$n({exited:Bc([vr(),Hoe()]),signal:Ki(An())}),$n({stopped:Bc([In("agent"),In("user"),In("archive"),In("shutdown")])}),$n({failed:An()}),In("lost")]),Fue=$n({id:An({minLength:1}),owner:vr(),name:An(),command:An(),pid:Ki(vr()),startedAt:vr(),endedAt:Ki(vr()),state:Uue}),Vue=$n({processes:wl(Fue)});function jl(e,t){return e==="pinomad.todo"&&Au(Nue,t)?{type:"pinomad.todo",value:t}:e==="pinomad.question"&&Au(Due,t)?{type:"pinomad.question",value:t}:e==="pinomad.diff"&&Au(Bue,t)?{type:"pinomad.diff",value:t}:e==="pinomad.codemode"&&Au(que,t)?{type:"pinomad.codemode",value:t}:e==="pinomad.context"&&Au(Pue,t)?{type:"pinomad.context",value:t}:e==="pinomad.processes"&&Au(Vue,t)?{type:"pinomad.processes",value:t}:{type:"fallback",value:t}}function Gue(e){return e!==null&&typeof e=="object"&&typeof e.limit=="number"}function hf(e){return e==="starting"||e==="running"}const Wue=e=>`process:${e}`;function vR(e,t){return{label:e,open(n){const s=new URL(e);s.searchParams.set("token",t);const i=new WebSocket(s);return i.onopen=()=>{var r,a;(r=n.opened)==null||r.call(n),(a=n.authenticated)==null||a.call(n)},i.onmessage=r=>n.message(String(r.data)),i.onclose=r=>n.closed(r.code),{send:r=>i.send(r),close:()=>i.close()}}}}function Kue(e){return e!==null&&typeof e=="object"&&typeof e.limit=="number"}const Xue=e=>`terminals:${e}`,Bj=e=>`terminal:${e}`,uy=50;function Zue(e,t){if(t===void 0)return e;const{before:n,...s}=e;return{...s,entries:[...t.entries,...e.entries],...t.before===void 0?{}:{before:t.before}}}function Yue(e,t,n,s){return e.before!==n?t:{entries:[...s.entries,...(t==null?void 0:t.entries)??[]],...s.before===void 0?{}:{before:s.before}}}function nm(e){var n;const t=(n=e.docs)==null?void 0:n["pi.live"];return(t==null?void 0:t.run)!==void 0}const Que={socketOpenMs:5e3,noiseMs:5e3,helloMs:5e3,syncMs:1e4};class Jue extends Error{constructor(n){super(`Could not connect to the host: ${n.map(ude).join("; ")}`);ve(this,"failures");this.name="ConnectionFailedError",this.failures=n}}class yR extends Error{constructor(n){super(`${hz} (${n})`);ve(this,"reason");this.name="DirectUnavailableError",this.reason=n}}const dy="Remote access is unavailable: the host published no remote path and this device has no local entry.",zp=5e3,Hj=15e3,ede=3e3,tde=1e3,nde=300,qj=3e4,Pj=25e3,sde=1e3,ide=3e4,rde=10*6e4,ode=10*6e4,Uj=6e4,ade=6e4,lde=3e4,Ws=e=>e instanceof Error?e:new Error(String(e)),cde=e=>Array.from(crypto.getRandomValues(new Uint8Array(e)),t=>t.toString(16).padStart(2,"0")).join(""),ude=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 dde(e){return new fde(e).ready}class gx 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 us extends Error{constructor(){super("Disconnected from host"),this.name="DisconnectedError"}}class kR extends Error{constructor(n,s,i){const r=n>s?"client-older":"host-older";super(r==="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}`);ve(this,"hostMajor");ve(this,"clientMajor");ve(this,"hostVersion");ve(this,"direction");this.name="ProtocolMismatchError",this.hostMajor=n,this.clientMajor=s,i!==void 0&&(this.hostVersion=i),this.direction=r}}function Fj(e){return e.some(t=>{const n="data"in t?t.data:"",s="ref"in t?t.ref:"";return n===""&&s!==""})}var Li,Ad,Xt,bo,fr,nt,Oi,Ra,lm,hr,Cs,pr,mc,fi,Di,ft,Hr,qr,Qe,Tn,Pt,Es,wo,vc,yc,Ia,jo,O1,Pr,kc,Md,Ur,La,bc,So,Oa,xr,wc,jc,Sc,Cc,Hs,D1,B1,Ec,Oe,Td,zd,H1,Nd,Da,Ba,_d,Rd,Id,Ld,$c,Fr,q1,Od,yn,zn,qs,Co,Vr,cm,Ac,Eo,$o,Mc,Be,Gr,P1,U1,Dd,F1,V1,Ao,hi,Ha,qa,Bi,Hi,Mo,Bd,um,Xe,Hd,Pa,G1,Ua,b,Bs,Bl,mx,ka,vx,_5,bR,R5,I5,wR,L5,yx,Hl,ba,ql,Pl,O5,D5,kh,kx,B5,H5,js,jR,SR,bx,CR,Du,bh,ER,q5,$R,AR,MR,P5,wh,U5,F5,V5,jh,G5,TR,wx,Ul,Fl,zR,Vl,W5,jx,K5,NR,X5,Sx,_R,Cx,Gl,RR,IR,LR,Ex,zr,OR,Z5,Y5,$x,Bu,DR,BR,HR,Sh,Hu,Wl,wa,Ax,ja,qR,Nr,PR,Ch,UR,_r,Q5,J5,e4,Mx,Kl,FR,Xl,VR,Eh,GR,Tx,t4,Zl,WR,qu,n4,KR,$h,s4,i4,XR,ZR,Ks,r4,o4,YR,QR,JR,Bn,eI,zx,Rr,Ah,Xs,Nx,_x,Mh,a4,Pu,l4,Rx,c4,u4,tI,nI,sI,Ix,iI,rI,Th,oI,d4,aI,lI,f4,Zs,ds,h4,Ir,Yl,qe,Lx,p4,Ox,Jn,Sn,cI,uI,Dx,Bx,dI,zh,fI;class fde{constructor(t){oe(this,b);ve(this,"ready");oe(this,Li);oe(this,Ad,new Set);oe(this,Xt,new Map);oe(this,bo,new Map);oe(this,fr,new Map);oe(this,nt,new Set);oe(this,Oi,new Set);oe(this,Ra,[]);oe(this,lm,{});oe(this,hr,new Map);oe(this,Cs,new Map);oe(this,pr);oe(this,mc);oe(this,fi);oe(this,Di);oe(this,ft);oe(this,Hr);oe(this,qr);oe(this,Qe);oe(this,Tn);oe(this,Pt);oe(this,Es);oe(this,wo);oe(this,vc,0);oe(this,yc,0);oe(this,Ia,0);oe(this,jo,0);oe(this,O1,Number.NEGATIVE_INFINITY);oe(this,Pr);oe(this,kc,"loopback");oe(this,Md);oe(this,Ur);oe(this,La);oe(this,bc,0);oe(this,So,0);oe(this,Oa,!1);oe(this,xr,new Map);oe(this,wc,[]);oe(this,jc);oe(this,Sc);oe(this,Cc);oe(this,Hs);oe(this,D1);oe(this,B1);oe(this,Ec);oe(this,Oe);oe(this,Td,0);oe(this,zd,0);oe(this,H1,0);oe(this,Nd,[]);oe(this,Da);oe(this,Ba);oe(this,_d,0);oe(this,Rd);oe(this,Id);oe(this,Ld);oe(this,$c,!1);oe(this,Fr,!1);oe(this,q1,!1);oe(this,Od,!1);oe(this,yn);oe(this,zn);oe(this,qs);oe(this,Co,new Map);oe(this,Vr,1);oe(this,cm,1);oe(this,Ac,new Map);oe(this,Eo,[]);oe(this,$o,new Set);oe(this,Mc,new Map);oe(this,Be,0);oe(this,Gr,!1);oe(this,P1,[]);oe(this,U1,{});oe(this,Dd);oe(this,F1);oe(this,V1);oe(this,Ao,new Map);oe(this,hi,new Map);oe(this,Ha,new Map);oe(this,qa,new Map);oe(this,Bi,new Map);oe(this,Hi,new Map);oe(this,Mo,new Map);oe(this,Bd,0);oe(this,um,cde(8));oe(this,Xe,!1);oe(this,Hd,!1);oe(this,Pa,Promise.resolve());oe(this,G1);oe(this,Ua);var i,r,a,l;V(this,Li,t),V(this,fi,t.connectionMode??"auto"),V(this,Di,t.rtc),V(this,ft,t.clock??AN),V(this,qr,((i=t.rtc)==null?void 0:i.signalOnlyHint)===!0),V(this,B1,"candidates"in t),"candidates"in t?(V(this,pr,[...t.candidates]),V(this,jc,t.openTransport),V(this,Ec,t.pairing),V(this,Sc,t.legacyUrl??((r=t.candidates[0])==null?void 0:r.url)??""),V(this,Cc,t.pageProtocol)):"transport"in t?(V(this,pr,[{url:t.transport.label,role:"legacy"}]),V(this,jc,()=>t.transport),V(this,Sc,t.transport.label),V(this,Cc,void 0)):(V(this,pr,af(t.url,void 0)),V(this,jc,()=>vR(t.url,t.token)),V(this,Sc,t.url),V(this,Cc,void 0)),V(this,mc,ox(j(this,pr),j(this,fi))),V(this,Hs,{...Que,...t.candidateTimeouts}),V(this,D1,t.roundTimeoutMs),this.ready=new Promise((c,u)=>{V(this,G1,c),V(this,Ua,u)});const n=t.signal,s=(n==null?void 0:n.aborted)===!0;if(n!==void 0){const c=()=>C(this,b,qR).call(this);s?queueMicrotask(c):(n.addEventListener("abort",c,{once:!0}),V(this,Ld,()=>n.removeEventListener("abort",c)))}V(this,Rd,(a=t.network)==null?void 0:a.subscribe(()=>C(this,b,H5).call(this))),V(this,Id,(l=t.lifecycle)==null?void 0:l.subscribe(c=>{c==="background"?C(this,b,RR).call(this):C(this,b,IR).call(this)})),s||C(this,b,ka).call(this)}setConnectionMode(t){var n,s;if(t!==j(this,fi)){if(V(this,fi,t),V(this,mc,ox(j(this,pr),t)),C(this,b,bh).call(this),C(this,b,zr).call(this),C(this,b,Bu).call(this),j(this,Pt)!==void 0&&C(this,b,jh).call(this,new us),j(this,Qe)!==void 0){const i=j(this,Qe);V(this,Qe,void 0),C(this,b,Ul).call(this,i);try{(n=i.connection)==null||n.close()}catch{}}if(j(this,Tn)!==void 0){const i=j(this,Tn);V(this,Tn,void 0),i.timer!==void 0&&j(this,ft).clearTimeout(i.timer);try{(s=i.connection)==null||s.close()}catch{}}j(this,Xe)||(C(this,b,Hu).call(this),C(this,b,Wl).call(this),C(this,b,ba).call(this),C(this,b,ql).call(this),C(this,b,Pl).call(this,new us),j(this,yn)!==void 0&&C(this,b,ds).call(this,{connection:"reconnecting"}),C(this,b,ka).call(this))}}rtcDiagnostics(){var r;const t=j(this,Qe),n=C(this,b,jx).call(this);let s;t!==void 0?s=t.phase:((r=j(this,Oe))==null?void 0:r.p2p)===!0&&j(this,Oe).phase==="ready"?s="active":j(this,Pt)!==void 0?s="warm":n>0?s="cooldown":j(this,wo)!==void 0?s="scheduled":s="idle";const i=j(this,Md);return{path:j(this,kc),phase:s,...i===void 0?{}:{lastFailure:{stage:i.stage,...i.reason===void 0?{}:{reason:i.reason},agoMs:Math.max(0,C(this,b,js).call(this)-i.atMs),...i.pair===void 0?{}:{pair:i.pair}}},...j(this,Ur)===void 0?{}:{selectedPair:j(this,Ur)},cooldownRemainingMs:n}}}Li=new WeakMap,Ad=new WeakMap,Xt=new WeakMap,bo=new WeakMap,fr=new WeakMap,nt=new WeakMap,Oi=new WeakMap,Ra=new WeakMap,lm=new WeakMap,hr=new WeakMap,Cs=new WeakMap,pr=new WeakMap,mc=new WeakMap,fi=new WeakMap,Di=new WeakMap,ft=new WeakMap,Hr=new WeakMap,qr=new WeakMap,Qe=new WeakMap,Tn=new WeakMap,Pt=new WeakMap,Es=new WeakMap,wo=new WeakMap,vc=new WeakMap,yc=new WeakMap,Ia=new WeakMap,jo=new WeakMap,O1=new WeakMap,Pr=new WeakMap,kc=new WeakMap,Md=new WeakMap,Ur=new WeakMap,La=new WeakMap,bc=new WeakMap,So=new WeakMap,Oa=new WeakMap,xr=new WeakMap,wc=new WeakMap,jc=new WeakMap,Sc=new WeakMap,Cc=new WeakMap,Hs=new WeakMap,D1=new WeakMap,B1=new WeakMap,Ec=new WeakMap,Oe=new WeakMap,Td=new WeakMap,zd=new WeakMap,H1=new WeakMap,Nd=new WeakMap,Da=new WeakMap,Ba=new WeakMap,_d=new WeakMap,Rd=new WeakMap,Id=new WeakMap,Ld=new WeakMap,$c=new WeakMap,Fr=new WeakMap,q1=new WeakMap,Od=new WeakMap,yn=new WeakMap,zn=new WeakMap,qs=new WeakMap,Co=new WeakMap,Vr=new WeakMap,cm=new WeakMap,Ac=new WeakMap,Eo=new WeakMap,$o=new WeakMap,Mc=new WeakMap,Be=new WeakMap,Gr=new WeakMap,P1=new WeakMap,U1=new WeakMap,Dd=new WeakMap,F1=new WeakMap,V1=new WeakMap,Ao=new WeakMap,hi=new WeakMap,Ha=new WeakMap,qa=new WeakMap,Bi=new WeakMap,Hi=new WeakMap,Mo=new WeakMap,Bd=new WeakMap,um=new WeakMap,Xe=new WeakMap,Hd=new WeakMap,Pa=new WeakMap,G1=new WeakMap,Ua=new WeakMap,b=new WeakSet,Bs=function(t){return!j(this,Xe)&&j(this,Oe)===t&&!t.done&&t.generation===j(this,Td)},Bl=function(t){t.timer!==void 0&&(clearTimeout(t.timer),t.timer=void 0)},mx=function(t,n,s){C(this,b,Bl).call(this,t),t.timer=setTimeout(()=>{t.timer=void 0,C(this,b,Bs).call(this,t)&&C(this,b,Hl).call(this,t,n,void 0,`no progress within ${s}ms`)},Math.max(0,s))},ka=function(){if(j(this,Xe)||j(this,Oe)!==void 0)return;C(this,b,Hu).call(this),C(this,b,Wl).call(this),V(this,zd,j(this,zd)+1);const t=j(this,zd);V(this,wc,[...j(this,mc)]),V(this,H1,0),V(this,Nd,[]),V(this,$c,!1),V(this,Fr,!0);const n=j(this,Hs).socketOpenMs+j(this,Hs).noiseMs+j(this,Hs).helloMs+j(this,Hs).syncMs,s=j(this,D1)??j(this,wc).length*n+1e3;V(this,Da,setTimeout(()=>{if(V(this,Da,void 0),j(this,Xe)||!j(this,Fr)||j(this,zd)!==t)return;const i=j(this,Oe);V(this,$c,!0),i!==void 0&&(C(this,b,yx).call(this,i.candidate,"round",!1,void 0,`the connection round exceeded ${s}ms`),C(this,b,ba).call(this,i)),C(this,b,kh).call(this)},s)),C(this,b,vx).call(this)},vx=function(){if(j(this,Xe)||!j(this,Fr)||j(this,Oe)!==void 0)return;if(j(this,$c)){C(this,b,kh).call(this);return}const t=j(this,wc)[Xn(this,H1)._++];if(t===void 0){C(this,b,kh).call(this);return}if(t.unsupported!==void 0){C(this,b,yx).call(this,t,"unsupported",!1,void 0,t.unsupported),queueMicrotask(()=>C(this,b,vx).call(this));return}const n={candidate:t,generation:++Xn(this,Td)._,phase:"open",done:!1};V(this,Oe,n),V(this,Gr,!1),C(this,b,mx).call(this,n,"open",j(this,Hs).socketOpenMs);const s={opened:()=>{C(this,b,Bs).call(this,n)&&C(this,b,_5).call(this,n,"noise",j(this,Hs).noiseMs)},authenticated:()=>{C(this,b,Bs).call(this,n)&&(C(this,b,_5).call(this,n,"hello",j(this,Hs).helloMs),C(this,b,bR).call(this))},message:a=>{C(this,b,Bs).call(this,n)&&C(this,b,R5).call(this,n,a)},closed:(a,l)=>{C(this,b,Bs).call(this,n)&&C(this,b,Hl).call(this,n,n.phase==="ready"?"closed":n.phase,a,l)}};let i;try{i=j(this,jc).call(this,t,j(this,Ec))}catch(a){C(this,b,Hl).call(this,n,"open",void 0,Ws(a).message);return}let r;try{r=i.open(s)}catch(a){C(this,b,Hl).call(this,n,"open",void 0,Ws(a).message);return}if(!C(this,b,Bs).call(this,n)){r.close();return}n.connection=r},_5=function(t,n,s){C(this,b,Bs).call(this,t)&&(t.phase=n,C(this,b,mx).call(this,t,n,s))},bR=function(){if(j(this,Ec)===void 0||(V(this,Ec,void 0),j(this,Li).onPaired===void 0))return;const t=n=>{var s,i;try{(i=(s=j(this,Li)).onPairedError)==null||i.call(s,Ws(n))}catch{}};try{Promise.resolve(j(this,Li).onPaired()).catch(t)}catch(n){t(n)}},R5=function(t,n){let s;try{s=JSON.parse(n)}catch{C(this,b,Hl).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,b,I5).call(this,t,s);return}C(this,b,PR).call(this,s)}},I5=function(t,n){var l;const s=n.protocol,i=typeof s=="number"?s:s!==null&&typeof s=="object"?s.major:void 0;if(i!==Vv.major){const c=new kR(typeof i=="number"?i:Number.NaN,Vv.major,n.hostVersion);V(this,Xe,!0),C(this,b,wa).call(this),C(this,b,Ax).call(this),C(this,b,ja).call(this),C(this,b,ba).call(this),j(this,yn)===void 0?j(this,Ua).call(this,c):(C(this,b,ds).call(this,{connection:"outdated",protocolMismatch:{hostMajor:c.hostMajor,clientMajor:c.clientMajor,...c.hostVersion===void 0?{}:{hostVersion:c.hostVersion},direction:c.direction}}),C(this,b,Ir).call(this,"error",c.message));return}C(this,b,Bl).call(this,t),t.phase="sync",C(this,b,mx).call(this,t,"sync",j(this,Hs).syncMs);const r=s!==null&&typeof s=="object"&&typeof s.minor=="number"?s.minor:0;V(this,Be,r),V(this,Gr,!0),V(this,Hr,n.rtc!==void 0&&kte(n.rtc)?n.rtc:void 0),((l=j(this,Hr))==null?void 0:l.signalOnly)===!0&&!j(this,qr)&&(V(this,qr,!0),C(this,b,bx).call(this)),V(this,Ra,n.docs),V(this,lm,n.toolPresentations),V(this,P1,n.models),V(this,U1,n.defaults??{}),V(this,Dd,n.hostVersion),V(this,F1,Kue(n.terminals)?n.terminals:void 0),V(this,V1,Gue(n.processes)?n.processes:void 0),j(this,Oi).clear();const a=new Set(Uv(r));for(const c of Rb)a.has(c)?j(this,nt).add(c):(j(this,nt).delete(c),j(this,Xt).delete(c),j(this,Oi).delete(c));if(j(this,zn)!==void 0)for(const c of C(this,b,_r).call(this,j(this,zn)))j(this,nt).add(c);if(j(this,qs)!==void 0)for(const c of C(this,b,_r).call(this,j(this,qs)))j(this,nt).add(c);C(this,b,GR).call(this),C(this,b,KR).call(this);for(const c of j(this,nt))C(this,b,Kl).call(this,c);if(n.endpointSet!==void 0){const c=s2(n.endpointSet);if(c.kind==="valid"&&(j(this,B1)&&(V(this,pr,af(j(this,Sc),c.endpointSet,{pageProtocol:j(this,Cc)})),V(this,mc,ox(j(this,pr),j(this,fi)))),j(this,Li).onEndpointSet!==void 0)){const u=d=>{var f,p;try{(p=(f=j(this,Li)).onEndpointSetError)==null||p.call(f,Ws(d))}catch{}};try{Promise.resolve(j(this,Li).onEndpointSet(c.endpointSet)).catch(u)}catch(d){u(d)}}}j(this,yn)!==void 0&&(C(this,b,ds).call(this,{session:n.session,toolPresentations:n.toolPresentations,connection:"reconnecting",host:C(this,b,r4).call(this)}),C(this,b,Zs).call(this)),C(this,b,wR).call(this,t,n,r)},wR=async function(t,n,s){try{const i=C(this,b,UR).call(this,s),r=new Set(Uv(s)),a=i.filter(c=>r.has(c)&&!j(this,Oi).has(c));await Promise.all(a.map(c=>C(this,b,Ch).call(this,c,!0))),j(this,yn)!==void 0&&t.p2p!==!0&&(C(this,b,ds).call(this,{connection:"connected"}),C(this,b,Zs).call(this),C(this,b,Sh).call(this),V(this,Fr,!1),t.phase="ready");const l=i.filter(c=>!j(this,Oi).has(c));j(this,yn)!==void 0&&t.p2p!==!0&&l.length>0&&V(this,Es,{entries:[]}),await Promise.all(l.map(c=>C(this,b,Ch).call(this,c,!0)))}catch{return}if(C(this,b,Bs).call(this,t)){if(C(this,b,Bl).call(this,t),C(this,b,Sh).call(this),t.phase="ready",V(this,Fr,!1),V(this,Bd,0),V(this,q1,!0),V(this,Od,!1),V(this,kc,C(this,b,SR).call(this,t.candidate,t.p2p===!0)),j(this,yn)===void 0){V(this,yn,{session:n.session,organized:{chats:[],projects:[],archived:[]},models:C(this,b,Ks).call(this,"models")??n.models,defaults:C(this,b,o4).call(this,n.defaults??{}),notices:[],connection:"connected",docs:[],submissions:[],toolPresentations:n.toolPresentations,devices:[],mcp:null,auth:null,providers:null,settings:null,agents:null,upgrade:null,host:C(this,b,r4).call(this)}),C(this,b,Zs).call(this),j(this,G1).call(this,{view:C(this,b,cI).call(this),controller:C(this,b,uI).call(this),terminals:C(this,b,WR).call(this),processes:C(this,b,ZR).call(this),setConnectionMode:i=>this.setConnectionMode(i),rtcDiagnostics:()=>this.rtcDiagnostics(),close:()=>C(this,b,fI).call(this)}),C(this,b,G5).call(this),C(this,b,L5).call(this,t);return}if(C(this,b,ds).call(this,{session:n.session,connection:"connected"}),C(this,b,Zs).call(this),await C(this,b,rI).call(this),!!C(this,b,Bs).call(this,t)){for(const[i,r]of j(this,qa))C(this,b,Lx).call(this,"resizeTerminal",{terminalId:i,...r}).catch(()=>{});C(this,b,G5).call(this),C(this,b,L5).call(this,t)}}},L5=function(t){if(t.p2p===!0){C(this,b,TR).call(this),C(this,b,LR).call(this),C(this,b,K5).call(this);return}C(this,b,zr).call(this),C(this,b,Du).call(this,C(this,b,jR).call(this))},yx=function(t,n,s,i,r){var l,c;const a={candidate:t,stage:n,unauthorized:s,...i===void 0?{}:{code:i},...r===void 0?{}:{reason:r}};j(this,Nd).push(a);try{(c=(l=j(this,Li)).onCandidateFailure)==null||c.call(l,a)}catch{}},Hl=function(t,n,s,i){if(!C(this,b,Bs).call(this,t))return;const r=t.phase==="ready";if(t.p2p===!0&&(C(this,b,Vl).call(this,r?"liveness":"commit",i,j(this,Ur)),r&&(V(this,jo,C(this,b,js).call(this)+Uj),C(this,b,zr).call(this),C(this,b,Bu).call(this))),C(this,b,yx).call(this,t.candidate,n,s===rx,s,i),C(this,b,ba).call(this,t),C(this,b,QR).call(this),C(this,b,ql).call(this),j(this,Pt)!==void 0&&(j(this,Pt).old===t||j(this,Pt).standby.installed&&j(this,Pt).standby===j(this,Qe))&&C(this,b,jh).call(this,new us),!j(this,Xe)){if(t.p2p===!0&&!r){C(this,b,ds).call(this,{connection:"reconnecting"}),C(this,b,ka).call(this);return}if(r){C(this,b,ds).call(this,{connection:"reconnecting"}),C(this,b,ka).call(this);return}if(j(this,$c)){C(this,b,kh).call(this);return}queueMicrotask(()=>C(this,b,vx).call(this))}},ba=function(t){var s;const n=j(this,Oe);if(!(n===void 0||t!==void 0&&n!==t)){if(n.p2p===!0&&V(this,Ur,void 0),V(this,Oe,void 0),n.done=!0,C(this,b,Bl).call(this,n),j(this,Es)!==void 0){for(const i of j(this,Es).entries.splice(0))i.reject(new us);V(this,Es,void 0)}C(this,b,Pl).call(this,new us),(s=n.connection)==null||s.close()}},ql=function(){for(const t of j(this,Cs).values())t.reject(new us);j(this,Cs).clear()},Pl=function(t){for(const n of j(this,hr).values())for(const s of n.splice(0))s.reject(t)},O5=function(t){return t.filter(n=>n.stage!=="unsupported")},D5=function(t){const n=C(this,b,O5).call(this,t);return n.length>0&&n.every(s=>s.unauthorized)},kh=function(){if(!j(this,Fr))return;if(V(this,Fr,!1),C(this,b,Hu).call(this),C(this,b,Wl).call(this),j(this,Es)!==void 0){for(const r of j(this,Es).entries.splice(0))r.reject(new us);V(this,Es,void 0)}if(V(this,Oe,void 0),j(this,Xe))return;const t=[...j(this,Nd)],n=C(this,b,O5).call(this,t),s=C(this,b,D5).call(this,t),i=j(this,wc).length===0;if(!s&&j(this,fi)==="directOnly"&&j(this,Di)!==void 0&&(j(this,qr)||j(this,Hr)!==void 0)&&j(this,Tn)===void 0&&j(this,Qe)===void 0&&j(this,Oe)===void 0){C(this,b,X5).call(this);return}if(!j(this,q1)){V(this,Xe,!0),C(this,b,wa).call(this),C(this,b,ja).call(this),j(this,Ua).call(this,s?new gx:i?new Error(dy):C(this,b,kx).call(this,t));return}if(s){V(this,Xe,!0),C(this,b,wa).call(this),C(this,b,ja).call(this),C(this,b,ds).call(this,{connection:"closed",unauthorized:!0}),C(this,b,Ir).call(this,"error",new gx().message);return}if(n.length===0){V(this,Xe,!0),C(this,b,wa).call(this),C(this,b,ja).call(this),C(this,b,ds).call(this,{connection:"closed"}),C(this,b,Ir).call(this,"error",i?dy:C(this,b,kx).call(this,t).message);return}C(this,b,ds).call(this,{connection:"reconnecting"}),j(this,Od)||(V(this,Od,!0),C(this,b,Ir).call(this,"error",C(this,b,kx).call(this,t).message)),C(this,b,B5).call(this)},kx=function(t){return C(this,b,D5).call(this,t)?new gx:t.length===0?new Error(dy):new Jue(t)},B5=function(){C(this,b,Wl).call(this);const{min:t,max:n}=j(this,Li).reconnectDelayMs??{min:200,max:2e3},s=Math.min(n,t*2**Xn(this,Bd)._++),i=j(this,_d);V(this,Ba,setTimeout(()=>{j(this,_d)===i&&(V(this,Ba,void 0),j(this,Xe)||C(this,b,ka).call(this))},s))},H5=function(){var t,n;if(!j(this,Xe)){if(C(this,b,BR).call(this),((t=j(this,Oe))==null?void 0:t.p2p)===!0&&j(this,Oe).phase==="ready"){C(this,b,Z5).call(this);return}((n=j(this,Oe))==null?void 0:n.phase)!=="ready"&&(C(this,b,Wl).call(this),C(this,b,Hu).call(this),C(this,b,ba).call(this),V(this,Bd,0),C(this,b,ka).call(this))}},js=function(){return j(this,ft).now()},jR=function(){return tde},SR=function(t,n=!1){return n?"p2p":t.role==="legacy"?"relay":t.role},bx=function(t=!0){var s,i;const n=r=>{var a,l;try{(l=(a=j(this,Di))==null?void 0:a.onSignalOnlyError)==null||l.call(a,Ws(r))}catch{}};try{Promise.resolve((i=(s=j(this,Di))==null?void 0:s.onSignalOnly)==null?void 0:i.call(s,t)).catch(n)}catch(r){n(r)}},CR=function(){for(const t of j(this,hr).values())if(t.length>0)return!0;return!1},Du=function(t){if(j(this,Xe)||j(this,Di)===void 0||j(this,fi)==="relayOnly")return;C(this,b,bh).call(this);const n=++Xn(this,vc)._;V(this,wo,j(this,ft).setTimeout(()=>{V(this,wo,void 0),n===j(this,vc)&&C(this,b,ER).call(this)},Math.max(0,t)))},bh=function(){j(this,wo)!==void 0&&(j(this,ft).clearTimeout(j(this,wo)),V(this,wo,void 0))},ER=function(){var i;if(j(this,Xe)||j(this,Di)===void 0||j(this,fi)==="relayOnly"||j(this,Qe)!==void 0||j(this,Pt)!==void 0||j(this,Tn)!==void 0)return;const t=C(this,b,js).call(this),n=Math.max(j(this,Ia),j(this,jo));if(t<n){C(this,b,Du).call(this,n-t);return}const s=j(this,Oe);if((s==null?void 0:s.phase)==="ready"&&s.connection!==void 0&&((i=j(this,yn))==null?void 0:i.connection)==="connected"){if(j(this,Hr)===void 0)return;C(this,b,q5).call(this,s.connection,!1);return}j(this,fi)==="directOnly"&&(j(this,Hr)===void 0&&!j(this,qr)||C(this,b,X5).call(this))},q5=function(t,n){var u;const s=j(this,Di);if(s===void 0||j(this,Qe)!==void 0||j(this,Xe))return;const i=++Xn(this,vc)._,r={generation:i,phase:"signal",signal:t,signalOnly:n,installed:!1};V(this,Qe,r),V(this,Md,void 0),r.timer=j(this,ft).setTimeout(()=>{j(this,Qe)!==r||j(this,Pt)!==void 0||C(this,b,Fl).call(this,r,"warm",`WebRTC preparation exceeded ${Pj}ms`)},Pj);const a=`rtc-${j(this,um)}-${i}`,l=Ate({platform:s.platform,stun:((u=j(this,Hr))==null?void 0:u.stun)??[],hostKey:s.hostKey,device:s.device,clock:j(this,ft),offer:d=>C(this,b,$R).call(this,t,a,d),onSelectedPair:d=>{d!==void 0&&(r.selectedPair=hte(d.local,d.remote))}}),c={signaled:()=>{j(this,Qe)===r&&(r.phase="ice")},opened:()=>{j(this,Qe)===r&&(r.phase="noise")},authenticated:()=>{var d;if(j(this,Qe)===r&&(r.phase="noise",r.signalOnly)){try{(d=r.signal)==null||d.close()}catch{}r.signal=void 0}},message:d=>{var f;if(r.installed){const p=r.installed&&((f=j(this,Oe))==null?void 0:f.connection)===r.connection?j(this,Oe):void 0;p!==void 0&&C(this,b,Bs).call(this,p)&&C(this,b,R5).call(this,p,d);return}C(this,b,AR).call(this,r,d)},closed:(d,f)=>{var p;if(r.installed){const x=((p=j(this,Oe))==null?void 0:p.connection)===r.connection?j(this,Oe):void 0;x!==void 0&&C(this,b,Bs).call(this,x)&&C(this,b,Hl).call(this,x,x.phase==="ready"?"closed":x.phase,d,f);return}j(this,Qe)===r&&C(this,b,Fl).call(this,r,r.phase,f??`DataChannel closed (${d})`)}};try{r.connection=l.open(c)}catch(d){C(this,b,Fl).call(this,r,"signal",Ws(d).message)}},$R=function(t,n,s){const i=Xn(this,Vr)._++;return new Promise((r,a)=>{j(this,Cs).set(i,{resolve:r,reject:a});try{t.send(JSON.stringify({type:"call",id:i,method:"rtcOffer",args:{attempt:n,sdp:s}}))}catch(l){j(this,Cs).delete(i),a(Ws(l))}}).then(r=>{const a=r;if(a===null||typeof a!="object"||typeof a.sdp!="string")throw new Error("the host returned a malformed rtcOffer answer");return a.sdp})},AR=function(t,n){var i;if(j(this,Qe)!==t)return;let s;try{s=JSON.parse(n)}catch{C(this,b,Fl).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,b,MR).call(this,t);return}if(s.type==="result"&&((i=t.verify)==null?void 0:i.id)===s.id){const r=t.verify;t.verify=void 0,r.timer!==void 0&&j(this,ft).clearTimeout(r.timer),s.ok?r.resolve():r.reject(new Error(s.error));return}}},MR=function(t){if(j(this,Qe)!==t||t.hello===void 0)return;const n=Xn(this,Vr)._++;t.pingId=n,C(this,b,P5).call(this,t,n,5e3).then(()=>{j(this,Qe)!==t||t.installed||(t.phase="warm",t.warmAt=C(this,b,js).call(this),t.timer!==void 0&&j(this,ft).clearTimeout(t.timer),t.timer=j(this,ft).setTimeout(()=>{j(this,Qe)===t&&j(this,Pt)===void 0&&C(this,b,zR).call(this,t,`no idle window within ${qj}ms`)},qj),C(this,b,wh).call(this,t))},s=>{j(this,Qe)===t&&C(this,b,Fl).call(this,t,"warm",Ws(s).message)})},P5=function(t,n,s){return j(this,Qe)!==t||t.connection===void 0?Promise.reject(new Error("the RTC carrier is gone")):new Promise((i,r)=>{const a=j(this,ft).setTimeout(()=>{var l;((l=t.verify)==null?void 0:l.id)===n&&(t.verify=void 0,r(new Error(`the RTC carrier did not answer a ping within ${s}ms`)))},s);t.verify={id:n,resolve:i,reject:r,timer:a};try{t.connection.send(JSON.stringify({type:"call",id:n,method:"ping",args:{id:`rtc-${n}`}}))}catch(l){j(this,ft).clearTimeout(a),t.verify=void 0,r(Ws(l))}})},wh=function(t){var s;if(j(this,Qe)!==t||t.phase!=="warm"||t.installed||j(this,Pt)!==void 0)return;if(((s=j(this,Oe))==null?void 0:s.phase)!=="ready"){C(this,b,U5).call(this,t);return}if(j(this,Cs).size>0||C(this,b,CR).call(this))t.idleSince=void 0;else{const i=C(this,b,js).call(this);if(t.idleSince??(t.idleSince=i),i-t.idleSince>=nde){C(this,b,U5).call(this,t);return}}t.idleTimer!==void 0&&j(this,ft).clearTimeout(t.idleTimer),t.idleTimer=j(this,ft).setTimeout(()=>C(this,b,wh).call(this,t),100)},U5=function(t){var s;if(j(this,Qe)!==t||j(this,Pt)!==void 0||t.hello===void 0)return;t.idleTimer!==void 0&&j(this,ft).clearTimeout(t.idleTimer),t.idleTimer=void 0;const n={standby:t,old:j(this,Oe),entries:[],warmAt:t.warmAt??C(this,b,js).call(this),prepared:!1,released:!1};if(V(this,Pt,n),((s=n.old)==null?void 0:s.phase)==="ready"&&n.old.connection!==void 0){const i=Xn(this,Vr)._++;t.verify=void 0,C(this,b,P5).call(this,t,i,3e3).then(()=>{j(this,Pt)!==n||n.released||(n.prepared=!0,C(this,b,F5).call(this,n))},r=>{j(this,Pt)!==n||n.released||C(this,b,V5).call(this,n,Ws(r).message)})}else n.prepared=!0,C(this,b,F5).call(this,n)},F5=function(t){var a;if(j(this,Pt)!==t||t.released)return;const n=t.standby,s=n.hello;if(s===void 0||n.connection===void 0){C(this,b,jh).call(this,new Error("the RTC carrier lost its hello before handoff"));return}const i=t.old;if(i!==void 0){i.done=!0;try{(a=i.connection)==null||a.close()}catch{}}const r={candidate:{url:"webrtc",role:"direct"},generation:++Xn(this,Td)._,phase:"sync",connection:n.connection,done:!1,p2p:!0};V(this,Oe,r),n.installed=!0,V(this,kc,"p2p"),V(this,Ur,n.selectedPair),n.signalOnly&&(n.signal=void 0),C(this,b,I5).call(this,r,s)},V5=function(t,n){var i;V(this,Pt,void 0),V(this,Qe,void 0),C(this,b,Ul).call(this,t.standby);try{(i=t.standby.connection)==null||i.close()}catch{}if(t.standby.signalOnly&&t.standby.signal!==void 0)try{t.standby.signal.close()}catch{}C(this,b,Vl).call(this,"commit",n,t.standby.selectedPair),C(this,b,W5).call(this);const s=t.old;for(const r of t.entries.splice(0))s===void 0?r.reject(new Error("Not connected to the host")):C(this,b,wx).call(this,s,r);C(this,b,Du).call(this,C(this,b,jx).call(this))},jh=function(t){var s;const n=j(this,Pt);if(n!==void 0){V(this,Pt,void 0),V(this,Qe,void 0),C(this,b,Ul).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 i of n.entries.splice(0))i.reject(t)}},G5=function(){const t=j(this,Es);if(t===void 0)return;V(this,Es,void 0);const n=j(this,Oe);for(const s of t.entries.splice(0))n===void 0?s.reject(new us):C(this,b,wx).call(this,n,s)},TR=function(){const t=j(this,Pt);if(t===void 0||!t.standby.installed)return;V(this,Pt,void 0),V(this,Qe,void 0);const n=j(this,Oe);for(const s of t.entries.splice(0))n===void 0?s.reject(new Error("Not connected to the host")):C(this,b,wx).call(this,n,s);C(this,b,K5).call(this)},wx=function(t,n){if(!C(this,b,Bs).call(this,t)||t.phase!=="ready"||t.connection===void 0){n.reject(new Error("Not connected to the host"));return}j(this,Cs).set(n.id,{resolve:n.resolve,reject:n.reject});try{t.connection.send(JSON.stringify(n.frame))}catch(s){j(this,Cs).delete(n.id),n.reject(Ws(s))}},Ul=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&&j(this,ft).clearTimeout(s);t.timer=void 0,t.pingTimer=void 0,t.idleTimer=void 0,t.verify=void 0},Fl=function(t,n,s){var r;if(j(this,Qe)!==t)return;const i=j(this,Pt);if(i!==void 0&&i.standby===t){C(this,b,V5).call(this,i,s);return}V(this,Qe,void 0),C(this,b,Ul).call(this,t);try{(r=t.connection)==null||r.close()}catch{}if(t.signalOnly&&t.signal!==void 0)try{t.signal.close()}catch{}if(C(this,b,Vl).call(this,n,s,t.selectedPair),t.signalOnly&&n==="signal"&&(V(this,qr,!1),C(this,b,bx).call(this,!1)),C(this,b,W5).call(this),j(this,yn)===void 0&&j(this,fi)==="directOnly"&&j(this,Oe)===void 0){C(this,b,Gl).call(this,s);return}C(this,b,Du).call(this,C(this,b,jx).call(this))},zR=function(t,n){var s;if(j(this,Qe)===t){V(this,Qe,void 0),C(this,b,Ul).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,b,Vl).call(this,"commit",n,t.selectedPair),C(this,b,Du).call(this,sde)}},Vl=function(t,n,s){V(this,Md,{stage:t,...n===void 0?{}:{reason:n},atMs:C(this,b,js).call(this),...s===void 0?{}:{pair:s}})},W5=function(){V(this,yc,j(this,yc)+1);const t=Math.min(rde,ide*2**(j(this,yc)-1));V(this,Ia,C(this,b,js).call(this)+t)},jx=function(){return Math.max(0,Math.max(j(this,Ia),j(this,jo))-C(this,b,js).call(this))},K5=function(){j(this,Pr)!==void 0&&j(this,ft).clearTimeout(j(this,Pr)),V(this,Pr,j(this,ft).setTimeout(()=>{var t;V(this,Pr,void 0),j(this,kc)==="p2p"&&((t=j(this,Oe))==null?void 0:t.phase)==="ready"&&(V(this,yc,0),V(this,Ia,0),V(this,jo,0))},ode))},NR=function(){V(this,yc,0),V(this,Ia,0),V(this,jo,0)},X5=function(){const t=j(this,Di);if(t===void 0||j(this,Tn)!==void 0||j(this,Xe))return;if(t.openSignalTransport===void 0){C(this,b,Gl).call(this,"the platform has no signal-only transport");return}const n=xY(j(this,pr));if(n.length===0){C(this,b,Gl).call(this,"no relay candidate is available for signaling");return}const s={generation:++Xn(this,vc)._,index:0,token:0,done:!1};V(this,Tn,s),C(this,b,Sx).call(this,s,n)},Sx=function(t,n){var s;if(!(j(this,Tn)!==t||t.done||j(this,Xe))){for(t.timer!==void 0&&(j(this,ft).clearTimeout(t.timer),t.timer=void 0);t.index<n.length;){const i=n[t.index++];if(i.unsupported!==void 0)continue;const r=(s=j(this,Di))==null?void 0:s.openSignalTransport;if(r===void 0){C(this,b,Cx).call(this,t,"the platform has no signal-only transport");return}let a;try{a=r(i)}catch(d){C(this,b,Cx).call(this,t,Ws(d).message);return}const l=++t.token,c=j(this,Hs).socketOpenMs+j(this,Hs).noiseMs+j(this,Hs).helloMs;t.timer=j(this,ft).setTimeout(()=>{var d;if(!(j(this,Tn)!==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,b,Sx).call(this,t,n)}},c);const u={message:d=>C(this,b,_R).call(this,t,d),closed:(d,f)=>{if(t.token===l){if(j(this,Tn)!==t||t.done){const p=j(this,Qe);(p==null?void 0:p.signalOnly)===!0&&p.signal===t.connection&&!p.installed&&p.phase!=="noise"&&p.phase!=="warm"&&C(this,b,Fl).call(this,p,p.phase,"the signal-only connection closed");return}t.done=!0,t.connection=void 0,t.done=!1,C(this,b,Sx).call(this,t,n)}}};try{t.connection=a.open(u)}catch{continue}return}C(this,b,Cx).call(this,t,"every relay signal path failed")}},_R=function(t,n){let s;try{s=JSON.parse(n)}catch{return}if(s===null||typeof s!="object")return;if(s.type==="result"){const r=j(this,Cs).get(s.id);j(this,Cs).delete(s.id),s.ok?r==null||r.resolve(s.value):r==null||r.reject(new Error(s.error));return}if(s.type!=="signalHello"||j(this,Tn)!==t||t.done)return;if(t.done=!0,V(this,Tn,void 0),t.timer!==void 0&&j(this,ft).clearTimeout(t.timer),t.timer=void 0,s.rtc===void 0){C(this,b,Gl).call(this,"the host did not advertise WebRTC on its signal connection");return}V(this,Hr,s.rtc),s.rtc.signalOnly&&C(this,b,bx).call(this);const i=t.connection;if(i===void 0){C(this,b,Gl).call(this,"the signal-only connection vanished before its offer");return}C(this,b,q5).call(this,i,!0)},Cx=function(t,n){j(this,Tn)===t&&(V(this,Tn,void 0),t.timer!==void 0&&j(this,ft).clearTimeout(t.timer),t.timer=void 0,C(this,b,Vl).call(this,"signal",n),V(this,qr,!1),C(this,b,Gl).call(this,n))},Gl=function(t){if(!j(this,Xe)){if(j(this,yn)===void 0){V(this,Xe,!0),C(this,b,wa).call(this),C(this,b,ja).call(this),C(this,b,ql).call(this),C(this,b,Pl).call(this,new us),j(this,Ua).call(this,new yR(t));return}C(this,b,Ir).call(this,"error",`${hz} (${t})`),C(this,b,ds).call(this,{connection:"reconnecting"}),C(this,b,B5).call(this)}},RR=function(){j(this,Xe)||(V(this,Oa,!0),C(this,b,zr).call(this))},IR=function(){var t,n;if(!j(this,Xe)){if(V(this,Oa,!1),((t=j(this,Oe))==null?void 0:t.p2p)===!0&&j(this,Oe).phase==="ready"){C(this,b,Z5).call(this);return}((n=j(this,Oe))==null?void 0:n.phase)!=="ready"&&C(this,b,H5).call(this)}},LR=function(){var n;if(C(this,b,zr).call(this),j(this,Xe)||j(this,Oa)||((n=j(this,Oe))==null?void 0:n.p2p)!==!0||j(this,Oe).phase!=="ready")return;const t=C(this,b,js).call(this);V(this,bc,t+Hj),V(this,So,t+zp),C(this,b,Ex).call(this)},Ex=function(){var n;if(j(this,Xe)||j(this,Oa)||((n=j(this,Oe))==null?void 0:n.p2p)!==!0||j(this,Oe).phase!=="ready")return;const t=Math.max(0,j(this,So)-C(this,b,js).call(this));V(this,La,j(this,ft).setTimeout(()=>{V(this,La,void 0),C(this,b,OR).call(this)},t))},zr=function(){j(this,La)!==void 0&&j(this,ft).clearTimeout(j(this,La)),V(this,La,void 0);for(const t of j(this,xr).values())t.timer!==void 0&&j(this,ft).clearTimeout(t.timer);j(this,xr).clear()},OR=function(){const t=j(this,Oe);if(j(this,Xe)||j(this,Oa)||(t==null?void 0:t.p2p)!==!0||t.phase!=="ready")return;const n=C(this,b,js).call(this);if(n>=j(this,bc)){C(this,b,$x).call(this,"no pong within 15000ms");return}C(this,b,Y5).call(this,!1),V(this,So,j(this,So)+zp),j(this,So)<=n&&V(this,So,n+zp),C(this,b,Ex).call(this)},Z5=function(){var n;C(this,b,zr).call(this),!(((n=j(this,Oe))==null?void 0:n.p2p)!==!0||j(this,Oe).phase!=="ready"||C(this,b,Y5).call(this,!0)===void 0)&&(V(this,So,C(this,b,js).call(this)+zp),C(this,b,Ex).call(this))},Y5=function(t){const n=j(this,Oe);if((n==null?void 0:n.connection)===void 0||n.p2p!==!0)return;const s=Xn(this,Vr)._++,i={generation:n.generation};j(this,xr).set(s,i),t&&(i.timer=j(this,ft).setTimeout(()=>{j(this,xr).has(s)&&(j(this,xr).delete(s),C(this,b,$x).call(this,"the foreground verification ping did not answer within 3000ms"))},ede));try{n.connection.send(JSON.stringify({type:"call",id:s,method:"ping",args:{id:`probe-${s}`}}))}catch(r){j(this,xr).delete(s),i.timer!==void 0&&j(this,ft).clearTimeout(i.timer),C(this,b,$x).call(this,Ws(r).message);return}return s},$x=function(t){var s;const n=j(this,Oe);if((n==null?void 0:n.p2p)===!0){C(this,b,Vl).call(this,"liveness",t,j(this,Ur)),V(this,Ur,void 0),V(this,jo,C(this,b,js).call(this)+Uj),C(this,b,zr).call(this),C(this,b,Bu).call(this),n.done=!0;try{(s=n.connection)==null||s.close()}catch{}j(this,Oe)===n&&V(this,Oe,void 0),C(this,b,ql).call(this),C(this,b,Pl).call(this,new us),C(this,b,Hu).call(this),C(this,b,ds).call(this,{connection:"reconnecting"}),C(this,b,ka).call(this)}},Bu=function(){j(this,Pr)!==void 0&&(j(this,ft).clearTimeout(j(this,Pr)),V(this,Pr,void 0))},DR=function(){return Hj},BR=function(){const t=C(this,b,js).call(this);t-j(this,O1)<ade||(V(this,O1,t),C(this,b,NR).call(this))},HR=function(){j(this,Oe)!==void 0&&C(this,b,Bl).call(this,j(this,Oe))},Sh=function(){j(this,Da)!==void 0&&(clearTimeout(j(this,Da)),V(this,Da,void 0))},Hu=function(){C(this,b,Sh).call(this),C(this,b,HR).call(this)},Wl=function(){V(this,_d,j(this,_d)+1),j(this,Ba)!==void 0&&(clearTimeout(j(this,Ba)),V(this,Ba,void 0))},wa=function(){for(const t of j(this,Eo))C(this,b,Rr).call(this,t);C(this,b,Sh).call(this),C(this,b,Wl).call(this),C(this,b,bh).call(this),C(this,b,zr).call(this),C(this,b,Bu).call(this),j(this,Oe)!==void 0&&C(this,b,Bl).call(this,j(this,Oe))},Ax=function(){var t,n;if(C(this,b,bh).call(this),C(this,b,zr).call(this),C(this,b,Bu).call(this),j(this,Pt)!==void 0&&C(this,b,jh).call(this,new us),j(this,Qe)!==void 0){const s=j(this,Qe);V(this,Qe,void 0),C(this,b,Ul).call(this,s);try{(t=s.connection)==null||t.close()}catch{}if(s.signalOnly&&s.signal!==void 0)try{s.signal.close()}catch{}}if(j(this,Tn)!==void 0){const s=j(this,Tn);V(this,Tn,void 0),s.timer!==void 0&&j(this,ft).clearTimeout(s.timer);try{(n=s.connection)==null||n.close()}catch{}}},ja=function(){var t,n,s;(t=j(this,Rd))==null||t.call(this),V(this,Rd,void 0),(n=j(this,Id))==null||n.call(this),V(this,Id,void 0),(s=j(this,Ld))==null||s.call(this),V(this,Ld,void 0)},qR=function(){j(this,Xe)||(V(this,Xe,!0),C(this,b,wa).call(this),C(this,b,Ax).call(this),C(this,b,ja).call(this),C(this,b,ba).call(this),C(this,b,ql).call(this),C(this,b,Pl).call(this,new us),C(this,b,ds).call(this,{connection:"closed"}),j(this,Ua).call(this,new Error("Connection attempt aborted")))},Nr=function(t){var n,s;(s=(n=j(this,Oe))==null?void 0:n.connection)==null||s.send(JSON.stringify(t))},PR=function(t){var n,s,i,r,a;if(!(t===null||typeof t!="object"))switch(t.type){case"snapshot":if(!j(this,nt).has(t.stream))return;if(t.stream.startsWith("terminals:")){j(this,Xt).set(t.stream,t.value),C(this,b,Tx).call(this,t.stream,{kind:"ready",list:t.value});return}j(this,Xt).set(t.stream,t.value),j(this,bo).delete(t.stream),j(this,fr).delete(t.stream),j(this,Oi).add(t.stream),j(this,Mc).set(t.stream,(j(this,Mc).get(t.stream)??0)+1),C(this,b,Zs).call(this),j(this,Bi).has(t.stream)&&C(this,b,$h).call(this,t.stream);for(const l of((n=j(this,hr).get(t.stream))==null?void 0:n.splice(0))??[])l.resolve();return;case"ops":if(!j(this,nt).has(t.stream)||!j(this,Xt).has(t.stream))return;j(this,Xt).set(t.stream,pre(j(this,Xt).get(t.stream),t.ops)),C(this,b,Zs).call(this),j(this,Bi).has(t.stream)&&C(this,b,$h).call(this,t.stream);return;case"output":{const l=j(this,Hi).get(t.stream),c=l??j(this,hi).get(t.stream);if(c===void 0||!j(this,nt).has(t.stream))return;l===void 0?j(this,Ha).set(t.stream,t.seq):j(this,Mo).set(t.stream,t.seq),c.output(t.data,t.reset===!0);return}case"ended":{if(t.stream.startsWith("terminals:")||t.stream.startsWith("terminal:")){C(this,b,t4).call(this,t.stream,t.reason);return}if(t.stream.startsWith("process:")){C(this,b,i4).call(this,t.stream,t.reason);return}j(this,nt).delete(t.stream),j(this,Xt).delete(t.stream),j(this,bo).delete(t.stream),j(this,fr).delete(t.stream),j(this,Oi).delete(t.stream);const l=new Error(`Stream ${t.stream} ended: ${t.reason}`);for(const c of((s=j(this,hr).get(t.stream))==null?void 0:s.splice(0))??[])c.endSatisfies?c.resolve():c.reject(l);j(this,zn)!==void 0&&C(this,b,_r).call(this,j(this,zn)).includes(t.stream)?C(this,b,Bx).call(this):j(this,qs)!==void 0&&C(this,b,_r).call(this,j(this,qs)).includes(t.stream)&&V(this,qs,void 0),C(this,b,Zs).call(this),j(this,Bi).has(t.stream)&&C(this,b,$h).call(this,t.stream);return}case"result":{const l=j(this,xr).get(t.id);if(l!==void 0){j(this,xr).delete(t.id),l.timer!==void 0&&j(this,ft).clearTimeout(l.timer),t.ok&&((i=j(this,Oe))==null?void 0:i.generation)===l.generation&&V(this,bc,Math.max(j(this,bc),j(this,ft).now()+C(this,b,DR).call(this))),((r=j(this,Qe))==null?void 0:r.phase)==="warm"&&C(this,b,wh).call(this,j(this,Qe));return}const c=j(this,Cs).get(t.id);j(this,Cs).delete(t.id),t.ok?c==null||c.resolve(t.value):c==null||c.reject(new Error(t.error)),((a=j(this,Qe))==null?void 0:a.phase)==="warm"&&C(this,b,wh).call(this,j(this,Qe));return}case"notice":C(this,b,Ir).call(this,t.level,t.message);return}},Ch=function(t,n=!1){return j(this,nt).has(t)?new Promise((s,i)=>{const r=j(this,hr).get(t)??[];r.push({resolve:s,reject:i,endSatisfies:n}),j(this,hr).set(t,r)}):Promise.resolve()},UR=function(t){const n=new Set(Uv(t));for(const s of[j(this,zn),j(this,qs)])if(s!==void 0)for(const i of C(this,b,_r).call(this,s))n.add(i);return[...n]},_r=function(t){return[mo(t),...j(this,Ra).map(n=>Fv(n.kind,t))]},Q5=async function(t){j(this,Co).set(t,(j(this,Co).get(t)??0)+1);try{const n=C(this,b,_r).call(this,t).filter(r=>!j(this,nt).has(r)),s=C(this,b,_r).call(this,t).filter(r=>j(this,nt).has(r)&&!j(this,Oi).has(r));for(const r of n)j(this,nt).add(r);const i=Promise.all([...n,...s].map(r=>C(this,b,Ch).call(this,r)));for(const r of n)j(this,Gr)&&C(this,b,Kl).call(this,r);await i}finally{const n=(j(this,Co).get(t)??1)-1;n>0?j(this,Co).set(t,n):j(this,Co).delete(t)}},J5=function(t){if(j(this,Bi).has(t))return!0;for(const n of[j(this,zn),j(this,qs),...j(this,Co).keys()])if(n!==void 0&&C(this,b,_r).call(this,n).includes(t))return!0;return!1},e4=function(t){var n;j(this,nt).delete(t),j(this,Xt).delete(t),j(this,bo).delete(t),j(this,fr).delete(t),j(this,Oi).delete(t);for(const s of((n=j(this,hr).get(t))==null?void 0:n.splice(0))??[])s.resolve();C(this,b,Nr).call(this,{type:"unsubscribe",stream:t})},Mx=function(t){for(const n of C(this,b,_r).call(this,t))C(this,b,J5).call(this,n)||C(this,b,e4).call(this,n)},Kl=function(t){const n=t.startsWith("conversation:")&&Ct(j(this,Be),"imageRefs"),s=t.startsWith("process:")?j(this,Mo).get(t):j(this,Ha).get(t),i=C(this,b,FR).call(this,t);C(this,b,Nr).call(this,{type:"subscribe",stream:t,...n?{images:"ref"}:{},...s===void 0?{}:{since:s},...i===void 0?{}:{window:i}})},FR=function(t){var s,i;if(!t.startsWith("conversation:")||!Ct(j(this,Be),"transcriptPaging"))return;const n=(i=(s=C(this,b,Xl).call(this,t))==null?void 0:s.entries[0])==null?void 0:i.id;return n===void 0?{limit:uy}:{limit:uy,from:n}},Xl=function(t){const n=j(this,Xt).get(t);return n===void 0?void 0:Zue(n,j(this,bo).get(t))},VR=function(t){var a;const n=mo(t),s=j(this,fr).get(n);if(s!==void 0)return s;const i=(a=C(this,b,Xl).call(this,n))==null?void 0:a.before;if(i===void 0)return Promise.resolve();const r=C(this,b,qe).call(this,"earlierEntries",{conversationId:t,before:i,limit:uy}).then(l=>{if(j(this,fr).get(n)!==r)return;const c=C(this,b,Xl).call(this,n);if(c===void 0)return;const u=Yue(c,j(this,bo).get(n),i,l);u!==void 0&&(j(this,bo).set(n,u),C(this,b,Zs).call(this))}).finally(()=>{j(this,fr).get(n)===r&&j(this,fr).delete(n)});return j(this,fr).set(n,r),r},Eh=function(){if(!Ct(j(this,Be),"terminals"))return"The host is too old for terminals (needs protocol 5.27); run `pinomad upgrade` on the host";if(j(this,F1)===void 0)return"The host couldn't load its terminal module; its log says which package is missing"},GR=function(){const t=C(this,b,Eh).call(this);if(t===void 0){for(const n of j(this,Ao).keys())j(this,nt).add(n);for(const n of j(this,hi).keys())j(this,nt).add(n);return}for(const n of[...j(this,Ao).keys()])j(this,nt).delete(n),j(this,Xt).delete(n),C(this,b,Tx).call(this,n,{kind:"unavailable",reason:t});for(const n of[...j(this,hi).keys()])C(this,b,t4).call(this,n,t)},Tx=function(t,n){for(const s of[...j(this,Ao).get(t)??[]])s(n)},t4=function(t,n){if(j(this,nt).delete(t),j(this,Xt).delete(t),t.startsWith("terminals:")){C(this,b,Tx).call(this,t,{kind:"unavailable",reason:n});return}const s=j(this,hi).get(t);j(this,hi).delete(t),j(this,Ha).delete(t),j(this,qa).delete(t.slice(9)),s==null||s.ended(n)},Zl=function(t,n){const s=C(this,b,Eh).call(this);return s===void 0?C(this,b,qe).call(this,t,n):Promise.reject(new Error(s))},WR=function(){return{watch:(t,n)=>{const s=Xue(t);let i=j(this,Ao).get(s);const r=i===void 0;i===void 0&&j(this,Ao).set(s,i=new Set),i.add(n);const a=C(this,b,Eh).call(this),l=j(this,Xt).get(s);return n(a!==void 0?{kind:"unavailable",reason:a}:l!==void 0?{kind:"ready",list:l}:{kind:"loading"}),r&&a===void 0&&(j(this,nt).add(s),j(this,Gr)&&C(this,b,Kl).call(this,s)),()=>{!i.delete(n)||i.size>0||(j(this,Ao).delete(s),j(this,nt).delete(s)&&(j(this,Xt).delete(s),C(this,b,Nr).call(this,{type:"unsubscribe",stream:s})))}},attach:(t,n)=>{const s=Bj(t),i=C(this,b,Eh).call(this);return i!==void 0?(n.ended(i),()=>{}):(j(this,hi).has(s)&&j(this,nt).has(s)&&C(this,b,Nr).call(this,{type:"unsubscribe",stream:s}),j(this,hi).set(s,n),j(this,Ha).delete(s),j(this,nt).add(s),j(this,Gr)&&C(this,b,Kl).call(this,s),()=>{j(this,hi).get(s)===n&&(j(this,hi).delete(s),j(this,Ha).delete(s),j(this,qa).delete(t),j(this,nt).delete(s)&&C(this,b,Nr).call(this,{type:"unsubscribe",stream:s}))})},open:(t,n)=>C(this,b,Zl).call(this,"openTerminal",{conversationId:t,...n}).then(({terminalId:s})=>s),input:(t,n)=>{C(this,b,Zl).call(this,"terminalInput",{terminalId:t,data:n}).catch(()=>{})},resize:(t,n)=>{j(this,hi).has(Bj(t))&&j(this,qa).set(t,n),C(this,b,Zl).call(this,"resizeTerminal",{terminalId:t,...n}).catch(()=>{})},rename:(t,n)=>C(this,b,Zl).call(this,"renameTerminal",{terminalId:t,name:n}).then(()=>{}),restart:(t,n)=>C(this,b,Zl).call(this,"restartTerminal",{terminalId:t,...j(this,qa).get(t)??n}).then(()=>{}),close:t=>C(this,b,Zl).call(this,"closeTerminal",{terminalId:t}).then(()=>{})}},qu=function(){if(!Ct(j(this,Be),"processes"))return"The host is too old for background processes (needs protocol 5.32); run `pinomad upgrade` on the host";if(j(this,V1)===void 0)return"The host couldn't load its process module; its log says which package is missing"},n4=function(){return j(this,Ra).some(t=>t.kind==="pinomad.processes")},KR=function(){var s;const t=Ct(j(this,Be),"processes")&&C(this,b,n4).call(this);for(const i of[...j(this,Bi).keys()]){if(t)j(this,nt).add(i);else{j(this,nt).delete(i),j(this,Xt).delete(i);for(const r of((s=j(this,hr).get(i))==null?void 0:s.splice(0))??[])r.resolve()}C(this,b,$h).call(this,i)}const n=C(this,b,qu).call(this);if(n===void 0){for(const i of j(this,Hi).keys())j(this,nt).add(i);return}for(const i of[...j(this,Hi).keys()])C(this,b,i4).call(this,i,n)},$h=function(t){const n=C(this,b,s4).call(this,t);for(const s of[...j(this,Bi).get(t)??[]])s(n)},s4=function(t){var l;const n=j(this,Xt).get(t),s=((l=j(this,Ra).find(c=>c.kind==="pinomad.processes"))==null?void 0:l.presentation)??"pinomad.processes",i=jl(s,n),r=i.type==="pinomad.processes"?i.value.processes:[],a=C(this,b,qu).call(this);return{processes:[...r],...a===void 0?{}:{unavailable:a}}},i4=function(t,n){j(this,nt).delete(t);const s=j(this,Hi).get(t);j(this,Hi).delete(t),j(this,Mo).delete(t),s==null||s.ended(n)},XR=function(t,n){const s=C(this,b,qu).call(this);return s===void 0?C(this,b,qe).call(this,t,n):Promise.reject(new Error(s))},ZR=function(){return{watch:(t,n)=>{const s=Fv("pinomad.processes",t);let i=j(this,Bi).get(s);const r=i===void 0;return i===void 0&&j(this,Bi).set(s,i=new Set),i.add(n),n(C(this,b,s4).call(this,s)),r&&Ct(j(this,Be),"processes")&&C(this,b,n4).call(this)&&(j(this,nt).add(s),j(this,Gr)&&C(this,b,Kl).call(this,s)),()=>{!i.delete(n)||i.size>0||(j(this,Bi).delete(s),!C(this,b,J5).call(this,s)&&j(this,nt).has(s)&&C(this,b,e4).call(this,s))}},attach:(t,n,s)=>{const i=Wue(t),r=C(this,b,qu).call(this);return r!==void 0?(s.ended(r),()=>{}):(j(this,Hi).has(i)&&j(this,nt).has(i)&&C(this,b,Nr).call(this,{type:"unsubscribe",stream:i}),j(this,Hi).set(i,s),n===void 0?j(this,Mo).delete(i):j(this,Mo).set(i,n),j(this,nt).add(i),j(this,Gr)&&C(this,b,Kl).call(this,i),()=>{j(this,Hi).get(i)===s&&(j(this,Hi).delete(i),j(this,Mo).delete(i),j(this,nt).delete(i)&&C(this,b,Nr).call(this,{type:"unsubscribe",stream:i}))})},stop:(t,n)=>C(this,b,XR).call(this,"stopProcess",{conversationId:t,id:n}).then(({state:s})=>s),unavailable:()=>C(this,b,qu).call(this)}},Ks=function(t){return j(this,Xt).get(t)},r4=function(){return{protocol:{major:Vv.major,minor:j(this,Be)},...j(this,Dd)===void 0?{}:{version:j(this,Dd)}}},o4=function(t){const n=C(this,b,Ks).call(this,"settings");return n===void 0?t:{...n.defaultModel===null?{}:{model:n.defaultModel},...n.defaultThinkingLevel===null?{}:{thinkingLevel:n.defaultThinkingLevel}}},YR=function(t,n){const s=C(this,b,Ks).call(this,"conversations")??[],i=new Map(s.map(a=>[a.id,a.parent]));let r=t;for(let a=0;r!==void 0&&a<8;a++){if(r===n)return!0;r=i.get(r)}return!1},QR=function(){for(const t of j(this,Eo))t.phase!=="inFlight"||t.admitted||(t.phase="unknown",C(this,b,Rr).call(this,t))},JR=function(){return j(this,Eo).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}}))},Bn=function(){C(this,b,Zs).call(this)},eI=function(t){C(this,b,Rr).call(this,t),t.timer=setTimeout(()=>{if(t.timer=void 0,j(this,Xe)||t.phase==="settled"||t.admitted)return;t.phase==="inFlight"&&(t.phase="unknown");const n=t.timeoutResolve;t.timeoutResolve=void 0,C(this,b,Bn).call(this),n==null||n()},lde)},zx=function(t){C(this,b,eI).call(this,t);let n;const s=new Promise(i=>{n=i});return t.timeoutResolve=n,s},Rr=function(t){const n=t.timeoutResolve;t.timeoutResolve=void 0,t.timer!==void 0&&(clearTimeout(t.timer),t.timer=void 0),n==null||n()},Ah=function(t){return t.phase==="settled"},Xs=function(t){C(this,b,Ah).call(this,t)||(t.phase="settled",t.error=void 0,C(this,b,Rr).call(this,t))},Nx=function(t){if(t.entry===void 0||t.conversationId===void 0)return!1;const n=C(this,b,Xl).call(this,mo(t.conversationId));return n===void 0?!1:n.before!==void 0&&Number(t.entry)<=Number(n.before)?!0:n.entries.some(s=>String(s.id)===String(t.entry))},_x=function(t){var s;if(t===void 0)return;const n=j(this,Xt).get(mo(t));return(s=n==null?void 0:n.docs)==null?void 0:s["pi.inbox"]},Mh=function(t){var s;return t.submissionId===void 0?!1:(((s=C(this,b,_x).call(this,t.conversationId))==null?void 0:s.items)??[]).some(i=>String(i.id)===String(t.submissionId))},a4=function(t){t.conversationId!==void 0&&(t.checkedVersion=j(this,Mc).get(mo(t.conversationId))??0,t.checkedInbox=C(this,b,_x).call(this,t.conversationId))},Pu=function(t,n){t.admitted=!0,t.submissionId=n.submissionId,t.error=void 0,C(this,b,Rr).call(this,t),n.entry!==void 0&&(t.entry=n.entry),t.entry!==void 0?C(this,b,Nx).call(this,t)||n.status==="done"?C(this,b,Xs).call(this,t):t.phase="inFlight":C(this,b,Mh).call(this,t)?C(this,b,Xs).call(this,t):n.status==="placed"||n.status==="done"||n.status==="unanswered"?C(this,b,Xs).call(this,t):t.phase="inFlight",C(this,b,Bn).call(this)},l4=function(){for(const t of j(this,Eo))if(!(t.phase==="settled"||t.submissionId===void 0)){if(C(this,b,Nx).call(this,t)||C(this,b,Mh).call(this,t)){C(this,b,Xs).call(this,t);continue}if(t.conversationId!==void 0&&!t.confirming&&t.admitted&&(t.entry!==void 0||!C(this,b,Mh).call(this,t))){const n=mo(t.conversationId);j(this,Oi).has(n)&&(t.checkedVersion!==(j(this,Mc).get(n)??0)||t.checkedInbox!==C(this,b,_x).call(this,t.conversationId))&&(C(this,b,a4).call(this,t),C(this,b,c4).call(this,t))}}},Rx=function(t,n=!1){if(!Je(j(this,Be),"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,b,Lx).call(this,"submission",s):C(this,b,qe).call(this,"submission",s)},c4=async function(t){if(!(t.confirming||t.phase==="settled"||!Je(j(this,Be),"submission"))){t.confirming=!0;try{const n=await C(this,b,Rx).call(this,t);if(j(this,Xe)||C(this,b,Ah).call(this,t))return;n!==null?C(this,b,Pu).call(this,t,n):t.admitted&&t.entry===void 0&&(C(this,b,Xs).call(this,t),C(this,b,Bn).call(this))}catch{}finally{t.confirming=!1}!j(this,Xe)&&!C(this,b,Ah).call(this,t)&&C(this,b,l4).call(this)}},u4=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,b,h4).call(this,t.skills),...t.attachments.length===0?{}:{attachments:t.attachments}}},tI=function(t){if(t.images.length>0&&!Ct(j(this,Be),"images"))throw new Error("The host is too old for images (needs protocol 5.5); run `pinomad upgrade` on the host");if(Fj(t.images)&&!Ct(j(this,Be),"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>Zr)throw new Error("At most "+Zr+" attachments per message");if(t.attachments.length>0&&!Ct(j(this,Be),"attachments"))throw new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host")},nI=function(t,n){j(this,Xe)||(C(this,b,Rr).call(this,t),t.admitted=!0,t.submissionId=n.submissionId,n.entry!==void 0&&(t.entry=n.entry),Ct(j(this,Be),"submitEntry")?t.entry!==void 0?(t.phase="inFlight",C(this,b,Nx).call(this,t)&&C(this,b,Xs).call(this,t)):C(this,b,Mh).call(this,t)?C(this,b,Xs).call(this,t):(t.phase="inFlight",C(this,b,a4).call(this,t),C(this,b,c4).call(this,t)):C(this,b,Xs).call(this,t),C(this,b,Bn).call(this))},sI=function(t,n){j(this,Xe)||(C(this,b,Rr).call(this,t),n instanceof us||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,b,Bn).call(this))},Ix=async function(t,n,s){if(t.phase==="settled"||j(this,Xe))return;if(s!==void 0&&t.timer===void 0){t.phase!=="failed"&&(t.phase="unknown",C(this,b,Bn).call(this));return}t.phase="inFlight",t.error=void 0;const i=n?C(this,b,Lx).call(this,"submit",C(this,b,u4).call(this,t)):C(this,b,qe).call(this,"submit",C(this,b,u4).call(this,t)),r=s??C(this,b,zx).call(this,t);C(this,b,Bn).call(this);const a=(async()=>{try{const l=await i;C(this,b,nI).call(this,t,l)}catch(l){C(this,b,sI).call(this,t,l)}})();await Promise.race([a,r])},iI=async function(t){if(!(t.phase==="settled"||j(this,Xe))){try{C(this,b,tI).call(this,t)}catch(n){if(j(this,Xe))return;t.phase="failed",t.error=n instanceof Error?n.message:String(n),C(this,b,Bn).call(this);return}if(!t.fixed){const n=j(this,zn);if(n===void 0){t.phase="failed",t.error="No conversation selected",C(this,b,Bn).call(this);return}t.conversationId=n,t.fixed=!0}await C(this,b,Ix).call(this,t,!1)}},rI=async function(){const t=j(this,Eo).filter(n=>n.phase==="unknown");j(this,Es)===void 0&&t.some(n=>n.fixed)&&Je(j(this,Be),"submission")&&V(this,Es,{entries:[]});for(const n of t)if(!(j(this,Xe)||n.phase!=="unknown"||!n.fixed))try{if(!Je(j(this,Be),"submission"))continue;const s=C(this,b,zx).call(this,n),i=await C(this,b,d4).call(this,n,!0,s);if(i==="deadline")continue;if(i!==null){C(this,b,Pu).call(this,n,i);continue}if(n.phase!=="unknown"||n.timer===void 0)continue;await C(this,b,Ix).call(this,n,!0,s)}catch(s){if(j(this,Xe)||(C(this,b,Rr).call(this,n),n.phase="unknown",C(this,b,Bn).call(this),s instanceof us||s instanceof Error&&s.message==="Not connected to the host"))return}},Th=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}}},oI=async function(t){const n=t.imageViews??t.images,s=[];for(const i of n)if("data"in i)s.push(i);else{const r=await C(this,b,qe).call(this,"image",{ref:i.ref});s.push({data:r.data,mimeType:r.mimeType})}return s},d4=async function(t,n,s){const i=C(this,b,Rx).call(this,t,n),r=await Promise.race([i.then(a=>({kind:"found",found:a}),a=>({kind:"error",error:a})),s.then(()=>({kind:"deadline"}))]);if(r.kind==="deadline")return i.then(a=>{j(this,Xe)||a===null||t.phase==="settled"||C(this,b,Pu).call(this,t,a)},()=>{}),"deadline";if(r.kind==="error")throw r.error;return r.found},aI=async function(t){if(t.phase!=="unknown"&&t.phase!=="failed")return;const n=C(this,b,zx).call(this,t);try{if(t.phase==="unknown"&&Je(j(this,Be),"submission")){const s=await C(this,b,d4).call(this,t,!1,n);if(s==="deadline")return;if(s!==null){C(this,b,Pu).call(this,t,s);return}if(t.phase!=="unknown"||t.timer===void 0)return}await C(this,b,Ix).call(this,t,!1,n)}catch(s){if(j(this,Xe))return;if(C(this,b,Rr).call(this,t),s instanceof us||s instanceof Error&&s.message==="Not connected to the host"){t.phase="unknown",t.error=void 0,C(this,b,Bn).call(this);return}throw t.phase="failed",t.error=s instanceof Error?s.message:String(s),C(this,b,Bn).call(this),s}},lI=async function(t){let n;const s=async()=>{if(n!==void 0)return n;try{return n=await C(this,b,oI).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,b,Xs).call(this,t),C(this,b,Bn).call(this),C(this,b,Th).call(this,t,l)}if(t.phase!=="unknown"&&!(t.phase==="inFlight"&&t.submissionId!==void 0)||!Je(j(this,Be),"submission"))return;const i=await C(this,b,Rx).call(this,t);if(i===null){const l=await s();return C(this,b,Xs).call(this,t),C(this,b,Bn).call(this),C(this,b,Th).call(this,t,l)}if(C(this,b,Pu).call(this,t,i),C(this,b,Ah).call(this,t)||i.status==="placed"||i.status==="done"||i.entry!==void 0)return;if(i.status==="unanswered"){const l=await s();return C(this,b,Xs).call(this,t),C(this,b,Bn).call(this),C(this,b,Th).call(this,t,l)}if(t.conversationId===void 0)return;const r=await s(),{outcome:a}=await C(this,b,qe).call(this,"withdrawQueued",{conversationId:t.conversationId,submissionId:i.submissionId});if(a==="sent"){C(this,b,Xs).call(this,t),C(this,b,Bn).call(this);return}return C(this,b,Xs).call(this,t),C(this,b,Bn).call(this),C(this,b,Th).call(this,t,r)},f4=function(t){return j(this,Ra).flatMap(n=>{const s=Fv(n.kind,t);return j(this,Xt).has(s)?[{kind:n.kind,presentation:n.presentation,value:j(this,Xt).get(s)}]:[]})},Zs=function(){var c;if(j(this,yn)===void 0)return;C(this,b,l4).call(this);const t=j(this,zn),n=j(this,qs),s=t===void 0?void 0:C(this,b,Xl).call(this,mo(t)),i=C(this,b,Ks).call(this,"conversations")??[],r=C(this,b,Ks).call(this,"index")??{projects:[],conversations:[]},a=((c=C(this,b,Ks).call(this,"devices"))==null?void 0:c.devices)??[],l=j(this,nt).has("tasks")?j(this,Xt).get("tasks"):void 0;C(this,b,ds).call(this,{conversation:s,models:C(this,b,Ks).call(this,"models")??j(this,P1),organized:KZ(r,i),home:t===void 0?void 0:ZZ(r,i,t),checkout:t===void 0?void 0:XZ(r,i,t),tasks:l,docs:t===void 0?[]:C(this,b,f4).call(this,t),submissions:C(this,b,JR).call(this),side:n===void 0?void 0:{id:n,conversation:C(this,b,Xl).call(this,mo(n)),docs:C(this,b,f4).call(this,n)},devices:a,mcp:C(this,b,Ks).call(this,"mcp")??null,auth:C(this,b,Ks).call(this,"auth")??null,providers:C(this,b,Ks).call(this,"providers")??null,settings:C(this,b,Ks).call(this,"settings")??null,agents:C(this,b,Ks).call(this,"agents")??null,upgrade:C(this,b,Ks).call(this,"upgrade")??null,defaults:C(this,b,o4).call(this,j(this,U1))})},ds=function(t){j(this,yn)!==void 0&&(V(this,yn,{...j(this,yn),...t}),!j(this,Hd)&&(V(this,Hd,!0),queueMicrotask(()=>{V(this,Hd,!1);for(const n of j(this,Ad))n()})))},h4=function(t){return t===void 0||!Ct(j(this,Be),"boundSkills")?{}:{skills:t}},Ir=function(t,n){j(this,yn)!==void 0&&C(this,b,ds).call(this,{notices:[...j(this,yn).notices,{id:Xn(this,cm)._++,level:t,message:n}].slice(-20)})},Yl=function(){if(!Je(j(this,Be),"beginLogin"))throw new Error("The host is too old for this (needs protocol 5.21); run `pinomad upgrade` on the host")},qe=function(t,n){var i,r;const s=j(this,Pt);if(s!==void 0||j(this,Es)!==void 0){const a=Xn(this,Vr)._++,l={type:"call",id:a,method:t,args:n},c=(s==null?void 0:s.entries)??j(this,Es).entries;return new Promise((u,d)=>{c.push({id:a,frame:l,resolve:u,reject:d})})}return((i=j(this,Oe))==null?void 0:i.phase)!=="ready"||((r=j(this,yn))==null?void 0:r.connection)!=="connected"?Promise.reject(new Error("Not connected to the host")):C(this,b,p4).call(this,j(this,Oe),Xn(this,Vr)._++,t,n)},Lx=function(t,n){var s,i;return((s=j(this,Oe))==null?void 0:s.phase)!=="ready"||((i=j(this,yn))==null?void 0:i.connection)!=="connected"?Promise.reject(new Error("Not connected to the host")):C(this,b,p4).call(this,j(this,Oe),Xn(this,Vr)._++,t,n)},p4=function(t,n,s,i){return!C(this,b,Bs).call(this,t)||t.phase!=="ready"||t.connection===void 0?Promise.reject(new Error("Not connected to the host")):new Promise((r,a)=>{j(this,Cs).set(n,{resolve:r,reject:a});try{t.connection.send(JSON.stringify({type:"call",id:n,method:s,args:i}))}catch(l){j(this,Cs).delete(n),a(Ws(l))}})},Ox=function(){if(!Je(j(this,Be),"startUpgrade"))throw new Error("The host is too old for this (needs protocol 5.30); run `pinomad upgrade` on the host")},Jn=function(t){return V(this,Pa,j(this,Pa).then(t).then(()=>{},n=>C(this,b,Ir).call(this,"error",n instanceof Error?n.message:String(n)))),j(this,Pa)},Sn=function(t){const n=j(this,Pa).then(t);return V(this,Pa,n.then(()=>{},()=>{})),n},cI=function(){return{current:()=>j(this,yn),subscribe:t=>(j(this,Ad).add(t),()=>j(this,Ad).delete(t))}},uI=function(){const t=()=>Array.from(crypto.getRandomValues(new Uint8Array(16)),s=>s.toString(16).padStart(2,"0")).join(""),n=()=>{if(j(this,zn)===void 0)throw new Error("No conversation selected");return j(this,zn)};return{addProject:s=>C(this,b,Sn).call(this,()=>C(this,b,qe).call(this,"addProject",{path:s})),listFolders:s=>C(this,b,Sn).call(this,()=>{if(!Je(j(this,Be),"listFolders"))throw new Error("The host is too old for this (needs protocol 5.3); run `pinomad upgrade` on the host");return C(this,b,qe).call(this,"listFolders",s===void 0?{}:{path:s})}),removeProject:s=>C(this,b,Jn).call(this,()=>C(this,b,qe).call(this,"removeProject",{path:s})),renameConversation:(s,i)=>C(this,b,Sn).call(this,async()=>{if(!Je(j(this,Be),"renameConversation"))throw new Error("The host is too old for this (needs protocol 5.4); run `pinomad upgrade` on the host");await C(this,b,qe).call(this,"renameConversation",{conversationId:s,title:i})}),createConversation:(s,i,r)=>C(this,b,Jn).call(this,async()=>{const a=(r==null?void 0:r.images)??[];if(a.length>0&&!Ct(j(this,Be),"images"))throw new Error("The host is too old for images (needs protocol 5.5); run `pinomad upgrade` on the host");if(Fj(a)&&!Ct(j(this,Be),"imageRefs"))throw new Error("The host is too old for image refs (needs protocol 5.15); run `pinomad upgrade` on the host");const l=(r==null?void 0:r.attachments)??[];if(l.length>Zr)throw new Error(`At most ${Zr} attachments per message`);if(l.length>0&&!Ct(j(this,Be),"attachments"))throw new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host");if((r==null?void 0:r.agent)!==void 0&&!Ct(j(this,Be),"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,b,qe).call(this,"createConversation",{home:s,text:i,requestId:t(),...(r==null?void 0:r.checkout)===void 0?{}:{checkout:r.checkout},...(r==null?void 0:r.model)===void 0?{}:{model:r.model},...(r==null?void 0:r.thinkingLevel)===void 0?{}:{thinkingLevel:r.thinkingLevel},...(r==null?void 0:r.agent)===void 0?{}:{agent:r.agent},...a.length===0?{}:{images:a},...C(this,b,h4).call(this,r==null?void 0:r.skills),...l.length===0?{}:{attachments:l}});await C(this,b,Dx).call(this,c)}),archive:(s,i)=>C(this,b,Jn).call(this,async()=>{await C(this,b,qe).call(this,"archive",{conversationId:s,archived:i}),i&&s===j(this,zn)&&C(this,b,Bx).call(this),i&&j(this,qs)!==void 0&&C(this,b,YR).call(this,j(this,qs),s)&&await C(this,b,zh).call(this,void 0)}),submit:(s,i,r)=>{const a=(r==null?void 0:r.requestId)??t();if(j(this,Ac).has(a))return Promise.resolve();const l=(r==null?void 0:r.target)??j(this,zn),c=l===void 0?void 0:j(this,Xt).get(mo(l)),u={requestId:a,text:s,whenBusy:i,placement:c!==void 0&&nm(c)?"queue":"conversation",images:(r==null?void 0:r.images)??[],...(r==null?void 0:r.imageViews)===void 0?{}:{imageViews:r.imageViews},...(r==null?void 0:r.skills)===void 0?{}:{skills:r.skills},attachments:(r==null?void 0:r.attachments)??[],...(r==null?void 0:r.attachmentDetails)===void 0?{}:{attachmentDetails:r.attachmentDetails},phase:"queued",...l===void 0?{}:{conversationId:l},fixed:(r==null?void 0:r.target)!==void 0,admitted:!1,confirming:!1};return j(this,Ac).set(a,u),j(this,Eo).push(u),C(this,b,Bn).call(this),C(this,b,Sn).call(this,()=>C(this,b,iI).call(this,u)).then(()=>{},()=>{})},retrySubmission:s=>{const i=j(this,Ac).get(s);return i===void 0||j(this,$o).has(s)?Promise.resolve():(j(this,$o).add(s),C(this,b,Sn).call(this,()=>C(this,b,aI).call(this,i)).finally(()=>j(this,$o).delete(s)))},takeBackSubmission:s=>{const i=j(this,Ac).get(s);return i===void 0||j(this,$o).has(s)?Promise.resolve(void 0):(j(this,$o).add(s),C(this,b,Sn).call(this,()=>C(this,b,lI).call(this,i)).finally(()=>j(this,$o).delete(s)))},compact:s=>C(this,b,Jn).call(this,()=>C(this,b,qe).call(this,"compact",{conversationId:n(),...s===void 0?{}:{instructions:s}})),runCommand:(s,i,r)=>C(this,b,Jn).call(this,()=>{if(!Je(j(this,Be),"runCommand"))throw new Error("The host is too old for this (needs protocol 5.17); run `pinomad upgrade` on the host");return C(this,b,qe).call(this,"runCommand",{conversationId:r??n(),name:s,...i===void 0?{}:{args:i}})}),abort:s=>{const i=s??j(this,zn);return i===void 0?(C(this,b,Ir).call(this,"error","No conversation selected"),Promise.resolve()):C(this,b,qe).call(this,"abort",{conversationId:i}).then(()=>{},r=>C(this,b,Ir).call(this,"error",r instanceof Error?r.message:String(r)))},withdrawQueued:(s,i)=>C(this,b,Sn).call(this,async()=>{if(!Je(j(this,Be),"withdrawQueued"))throw new Error("The host is too old for this (needs protocol 5.14); run `pinomad upgrade` on the host");const{outcome:r}=await C(this,b,qe).call(this,"withdrawQueued",{conversationId:i??n(),submissionId:s});return r}),steerQueued:(s,i)=>C(this,b,Sn).call(this,async()=>{if(!Je(j(this,Be),"steerQueued"))throw new Error("The host is too old for this (needs protocol 5.14); run `pinomad upgrade` on the host");const{outcome:r}=await C(this,b,qe).call(this,"steerQueued",{conversationId:i??n(),submissionId:s});return r}),reorderQueued:(s,i,r)=>C(this,b,Sn).call(this,async()=>{if(!Je(j(this,Be),"reorderQueued"))throw new Error("The host is too old for this (needs protocol 5.29); run `pinomad upgrade` on the host");const{outcome:a}=await C(this,b,qe).call(this,"reorderQueued",{conversationId:r??n(),submissionId:s,...i===void 0?{}:{before:i}});return a}),setThinkingLevel:s=>C(this,b,Jn).call(this,()=>C(this,b,qe).call(this,"setThinkingLevel",{conversationId:n(),level:s})),setModel:s=>C(this,b,Jn).call(this,()=>C(this,b,qe).call(this,"setModel",{conversationId:n(),model:s})),setAgent:s=>C(this,b,Jn).call(this,()=>{if(!Je(j(this,Be),"setAgent"))throw new Error("The host is too old for this (needs protocol 5.18); run `pinomad upgrade` on the host");return C(this,b,qe).call(this,"setAgent",{conversationId:n(),agent:s})}),toggleTasks:()=>C(this,b,Jn).call(this,async()=>{if(j(this,nt).delete("tasks")){C(this,b,Nr).call(this,{type:"unsubscribe",stream:"tasks"}),j(this,Xt).delete("tasks"),C(this,b,Zs).call(this);return}j(this,nt).add("tasks");const s=C(this,b,Ch).call(this,"tasks");C(this,b,Nr).call(this,{type:"subscribe",stream:"tasks"}),await s}),switchConversation:s=>C(this,b,Jn).call(this,()=>C(this,b,Dx).call(this,s)),showSide:s=>C(this,b,Jn).call(this,()=>C(this,b,zh).call(this,s)),clearConversation:()=>C(this,b,Jn).call(this,()=>C(this,b,dI).call(this)),fork:(s,i,r,a)=>C(this,b,Jn).call(this,async()=>{const{conversationId:l}=await C(this,b,qe).call(this,"fork",{conversationId:n(),entryId:s,...r===void 0?{}:{removeTools:r}});(a==null?void 0:a.show)==="side"?await C(this,b,zh).call(this,l):await C(this,b,Dx).call(this,l),await C(this,b,qe).call(this,"submit",{conversationId:l,text:i,whenBusy:"followUp",requestId:t()})}),answer:(s,i,r,a)=>C(this,b,Jn).call(this,()=>C(this,b,qe).call(this,"answer",{conversationId:a??n(),kind:s,requestId:i,answers:r})),changes:()=>C(this,b,Sn).call(this,()=>C(this,b,qe).call(this,"changes",{conversationId:n()})),listFiles:(s,i)=>Je(j(this,Be),"listFiles")?C(this,b,qe).call(this,"listFiles",{scope:s,query:i}):Promise.reject(new Error("The host is too old for this (needs protocol 5.10); run `pinomad upgrade` on the host")),beginAttachment:(s,i)=>Je(j(this,Be),"beginAttachment")?C(this,b,qe).call(this,"beginAttachment",{name:s,size:i}).then(({attachmentId:r})=>r):Promise.reject(new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host")),appendAttachment:(s,i,r)=>Je(j(this,Be),"appendAttachment")?C(this,b,qe).call(this,"appendAttachment",{attachmentId:s,offset:i,data:r}):Promise.reject(new Error("The host is too old for attachments (needs protocol 5.19); run `pinomad upgrade` on the host")),image:(s,i="original")=>{if(!Je(j(this,Be),"image"))return Promise.reject(new Error("The host is too old for this (needs protocol 5.15); run `pinomad upgrade` on the host"));const r=i!=="original"&&Ct(j(this,Be),"imageVariants");return C(this,b,qe).call(this,"image",{ref:s,...r?{variant:i}:{}})},listSkills:s=>Je(j(this,Be),"listSkills")?C(this,b,qe).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")),loadEarlier:s=>C(this,b,VR).call(this,s),listCommands:s=>Je(j(this,Be),"listCommands")?C(this,b,qe).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,b,Sn).call(this,()=>C(this,b,qe).call(this,"createPairing",{})),revokeDevice:s=>C(this,b,Jn).call(this,()=>C(this,b,qe).call(this,"revokeDevice",{publicKey:s})),logout:s=>C(this,b,Jn).call(this,()=>{if(!Je(j(this,Be),"logout"))throw new Error("The host is too old for this (needs protocol 5.1); run `pinomad upgrade` on the host");return C(this,b,qe).call(this,"logout",{providerId:s})}),beginLogin:(s,i)=>C(this,b,Sn).call(this,async()=>(C(this,b,Yl).call(this),(await C(this,b,qe).call(this,"beginLogin",{providerId:s,method:i})).loginId)),answerLogin:(s,i,r)=>C(this,b,Sn).call(this,async()=>{C(this,b,Yl).call(this),await C(this,b,qe).call(this,"answerLogin",{loginId:s,promptId:i,value:r})}),cancelLogin:s=>C(this,b,Sn).call(this,async()=>{C(this,b,Yl).call(this),await C(this,b,qe).call(this,"cancelLogin",{loginId:s})}),saveCustomProvider:(s,i)=>C(this,b,Sn).call(this,async()=>{C(this,b,Yl).call(this),await C(this,b,qe).call(this,"saveCustomProvider",i===void 0?{provider:s}:{provider:s,apiKey:i})}),removeCustomProvider:s=>C(this,b,Sn).call(this,async()=>{C(this,b,Yl).call(this),await C(this,b,qe).call(this,"removeCustomProvider",{providerId:s})}),listEndpointModels:async s=>(C(this,b,Yl).call(this),(await C(this,b,qe).call(this,"listEndpointModels",s)).models),updateSettings:s=>C(this,b,Jn).call(this,()=>{if(!Je(j(this,Be),"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&&!Ct(j(this,Be),"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&&!Ct(j(this,Be),"hostName"))throw new Error("The host is too old for this (needs protocol 5.12); run `pinomad upgrade` on the host");if(s.autoUpgrade!==void 0&&!Ct(j(this,Be),"autoUpgrade"))throw new Error("The host is too old for this (needs protocol 5.30); run `pinomad upgrade` on the host");return C(this,b,qe).call(this,"updateSettings",{patch:s})}),startUpgrade:async s=>{C(this,b,Ox).call(this),await C(this,b,qe).call(this,"startUpgrade",{when:s})},cancelUpgrade:async()=>{C(this,b,Ox).call(this),await C(this,b,qe).call(this,"cancelUpgrade",{})},checkUpgrade:async()=>{C(this,b,Ox).call(this),await C(this,b,qe).call(this,"checkUpgrade",{})},createAgent:s=>C(this,b,Sn).call(this,async()=>{if(!Je(j(this,Be),"createAgent"))throw new Error("The host is too old for this (needs protocol 5.6); run `pinomad upgrade` on the host");await C(this,b,qe).call(this,"createAgent",{role:s})}),updateAgent:s=>C(this,b,Sn).call(this,async()=>{if(!Je(j(this,Be),"updateAgent"))throw new Error("The host is too old for this (needs protocol 5.6); run `pinomad upgrade` on the host");await C(this,b,qe).call(this,"updateAgent",{role:s})}),deleteAgent:s=>C(this,b,Sn).call(this,async()=>{if(!Je(j(this,Be),"deleteAgent"))throw new Error("The host is too old for this (needs protocol 5.6); run `pinomad upgrade` on the host");await C(this,b,qe).call(this,"deleteAgent",{name:s})}),setPushToken:s=>C(this,b,Sn).call(this,async()=>{if(!Je(j(this,Be),"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"&&!Ct(j(this,Be),"apnsPush"))throw new Error("The host is too old for this (needs protocol 5.9); run `pinomad upgrade` on the host");await C(this,b,qe).call(this,"setPushToken",{token:s})})}},Dx=async function(t){const n=j(this,zn);t!==n&&(await C(this,b,Q5).call(this,t),V(this,zn,t),n!==void 0&&C(this,b,Mx).call(this,n),C(this,b,Zs).call(this))},Bx=function(){const t=j(this,zn);t!==void 0&&(V(this,zn,void 0),C(this,b,Mx).call(this,t),C(this,b,Zs).call(this))},dI=async function(){C(this,b,Bx).call(this),await C(this,b,zh).call(this,void 0)},zh=async function(t){const n=j(this,qs);t!==n&&(t!==void 0&&await C(this,b,Q5).call(this,t),V(this,qs,t),n!==void 0&&C(this,b,Mx).call(this,n),C(this,b,Zs).call(this))},fI=function(){j(this,Xe)||(V(this,Xe,!0),C(this,b,wa).call(this),C(this,b,Ax).call(this),C(this,b,ja).call(this),C(this,b,ba).call(this),C(this,b,ql).call(this),C(this,b,Pl).call(this,new us),C(this,b,ds).call(this,{connection:"closed"}))};const Hx={width:"var(--spacing-4)",height:"var(--spacing-4)"},x4=e=>e instanceof Error?e.message:String(e),hI=e=>void window.open(e,"_blank","noopener,noreferrer");function hde({providerId:e,method:t,logins:n,remote:s,connected:i,intro:r,signIn:a,onDone:l,onCancel:c}){const[u,d]=h.useState(),[f,p]=h.useState(!1),[x,g]=h.useState(!1),[y,v]=h.useState(),m=u===void 0?void 0:n.find(T=>T.id===u),k=h.useRef(void 0),w=h.useRef(0),S=h.useRef(!1),E=()=>{const T=++w.current;p(!0),g(!1),v(void 0),s.controller.beginLogin(e,t).then(O=>{if(T!==w.current){s.controller.cancelLogin(O).catch(()=>{});return}k.current=O,d(O),p(!1)},O=>{T===w.current&&(g(O instanceof us),v(x4(O)),p(!1))})};h.useEffect(()=>(S.current=!0,t==="api_key"&&w.current===0&&E(),()=>{S.current=!1,queueMicrotask(()=>{if(S.current)return;w.current++;const T=k.current;k.current=void 0,T!==void 0&&s.controller.cancelLogin(T).catch(()=>{})})}),[]);const A=x&&!f&&u===void 0?n.find(T=>T.providerId===e&&T.method===t&&T.state==="running"):void 0;h.useEffect(()=>{A!==void 0&&(k.current=A.id,d(A.id),v(void 0))},[A==null?void 0:A.id]);const z=h.useRef(!1);m!==void 0&&(z.current=!0);const N=u!==void 0&&m===void 0&&z.current;h.useEffect(()=>{N&&(k.current=void 0,c())},[N]);const M=m==null?void 0:m.state;h.useEffect(()=>{M===void 0||M==="running"||(k.current=void 0,M==="succeeded"?l():M==="cancelled"&&c())},[M]);const[$,R]=h.useState(),_=()=>{const T=k.current;if(T===void 0)return c();k.current=void 0,R(void 0),s.controller.cancelLogin(T).then(c,O=>{k.current=T,R(x4(O))})};return u===void 0?t==="api_key"&&y===void 0?o.jsx(Np,{label:"Starting…"}):o.jsxs(te,{gap:3,children:[r,y===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't start the login",description:y}),o.jsxs(pe,{gap:2,wrap:"wrap",children:[o.jsx(K,{label:t==="api_key"?"Try again":a??"Sign in",variant:"primary",isLoading:f,isDisabled:!i,onClick:E}),o.jsx(K,{label:"Cancel",variant:"secondary",onClick:c})]})]}):m===void 0?o.jsx(Np,{label:"Starting…"}):m.state==="failed"?o.jsx(Ie,{status:"error",title:t==="api_key"?"The key wasn't saved":"Sign-in failed",description:m.error,endContent:o.jsx(K,{label:"Try again",size:"sm",isDisabled:!i,isLoading:f,onClick:E})}):m.state!=="running"?o.jsx(Np,{label:m.state==="succeeded"?"Saved":"Cancelled"}):o.jsxs(te,{gap:4,children:[o.jsx(gde,{events:m.events}),m.prompt===void 0?o.jsxs(te,{gap:3,children:[o.jsx(Np,{label:pde(m.events)}),o.jsx(xde,{error:$,onCancel:_})]}):o.jsx(kde,{prompt:m.prompt,connected:i,onAnswer:T=>s.controller.answerLogin(m.id,m.prompt.id,T),cancelError:$,onCancel:_},m.prompt.id)]})}const pde=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 Np({label:e}){return o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(Tt,{size:"sm"}),o.jsx(W,{type:"supporting",role:"status",children:e})]})}function xde({error:e,onCancel:t}){return o.jsxs(pe,{gap:2,vAlign:"center",wrap:"wrap",children:[o.jsx(K,{label:"Cancel",variant:"secondary",onClick:t}),e===void 0?null:o.jsx(T1,{message:e})]})}function T1({message:e}){return o.jsx(W,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:e})}function gde({events:e}){const t=e.findLastIndex(i=>i.type==="auth_url"),n=e.findLastIndex(i=>i.type==="device_code"),s=e.map((i,r)=>({event:i,index:r})).filter(({event:i,index:r})=>i.type==="info"||i.type==="auth_url"&&r===t||i.type==="device_code"&&r===n);return s.length===0?null:o.jsx(te,{gap:4,children:s.map(({event:i,index:r})=>o.jsx(mde,{event:i},r))})}function mde({event:e}){switch(e.type){case"info":return o.jsxs(te,{gap:1,children:[o.jsx(W,{as:"p",type:"supporting",children:e.message}),e.links===void 0||e.links.length===0?null:o.jsx(pe,{gap:3,wrap:"wrap",children:e.links.map(t=>o.jsx(r0,{href:t.url,isExternalLink:!0,children:t.label??t.url},t.url))})]});case"auth_url":return o.jsxs(te,{gap:2,children:[o.jsx(W,{as:"p",children:e.instructions??"Open the sign-in page and approve access."}),o.jsx(pe,{gap:2,children:o.jsx(K,{label:"Open sign-in page",icon:o.jsx(lN,{"aria-hidden":"true",style:Hx}),size:"sm",onClick:()=>hI(e.url)})})]});case"device_code":return o.jsx(yde,{code:e.userCode,url:e.verificationUri});case"progress":return null}}const vde=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 yde({code:e,url:t}){const[n,s]=h.useState(!1),{host:i,display:r}=vde(t);return o.jsxs("ol",{className:"providers-steps",children:[o.jsx("li",{children:o.jsxs(te,{gap:2,children:[o.jsx(W,{children:"Copy this code."}),o.jsxs(pe,{gap:3,vAlign:"center",wrap:"wrap",children:[o.jsx("span",{className:"providers-code",children:e}),o.jsx(K,{label:n?"Copied":"Copy",size:"sm",icon:n?o.jsx(Ea,{"aria-hidden":"true",style:Hx}):o.jsx(Xb,{"aria-hidden":"true",style:Hx}),onClick:()=>{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>s(!0),()=>{})}})]})]})}),o.jsx("li",{children:o.jsxs(te,{gap:2,children:[o.jsxs(W,{children:["Enter it at ",o.jsx("span",{className:"providers-mono",children:r})]}),o.jsx(pe,{gap:2,children:o.jsx(K,{label:`Open ${i}`,icon:o.jsx(lN,{"aria-hidden":"true",style:Hx}),size:"sm",onClick:()=>hI(t)})})]})})]})}const Vj=e=>e.message.replace(/:\s*$/,"");function kde({prompt:e,connected:t,onAnswer:n,cancelError:s,onCancel:i}){var y;const[r,a]=h.useState(e.type==="select"?((y=e.options[0])==null?void 0:y.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||r.trim()!==""),x=v=>{v.preventDefault(),p&&(c(!0),d(void 0),n(e.type==="text"?r:r.trim()).catch(m=>{d(x4(m)),c(!1)}))},g=u===void 0?void 0:{type:"error",message:u};return o.jsx("form",{onSubmit:x,autoComplete:"off",children:o.jsxs(te,{gap:3,children:[e.type==="select"?o.jsx(S3,{label:Vj(e),value:r,onChange:a,isDisabled:!t,status:g,children:e.options.map(v=>o.jsx(sg,{value:v.id,label:v.label,description:v.description},v.id))}):o.jsx(pt,{label:Vj(e),type:e.type==="secret"?"password":"text",value:r,onChange:v=>{a(v),d(void 0)},placeholder:e.placeholder,hasAutoFocus:!0,isDisabled:!t,status:g,width:"100%"}),o.jsxs(pe,{gap:2,vAlign:"center",wrap:"wrap",children:[o.jsx(K,{label:"Continue",variant:"primary",type:"submit",isLoading:l,isDisabled:!p}),o.jsx(K,{label:"Cancel",variant:"secondary",onClick:i}),s===void 0?null:o.jsx(T1,{message:s})]})]})})}const bde={"openai-completions":"OpenAI Chat Completions","openai-responses":"OpenAI Responses","anthropic-messages":"Anthropic Messages","google-generative-ai":"Google Gemini"},fy=e=>e instanceof Error?e.message:String(e),wde=e=>e.toLowerCase().normalize("NFKD").replace(new RegExp("\\p{M}","gu"),"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),jde=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"}},_p=(e,t)=>[...e,...t.filter((n,s)=>!e.includes(n)&&t.indexOf(n)===s)];function Sde({existing:e,providers:t,remote:n,connected:s,onDone:i,onCancel:r,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,y]=h.useState(!1),[v,m]=h.useState(""),[k,w]=h.useState([...(l==null?void 0:l.models)??[]]),[S,E]=h.useState([...(l==null?void 0:l.models)??[]]),[A,z]=h.useState(""),[N,M]=h.useState(!1),[$,R]=h.useState(),[_,T]=h.useState(!1),[O,H]=h.useState(),[L,B]=h.useState(!1),[I,D]=h.useState(!1),[q,U]=h.useState(!1),[X,Z]=h.useState(),ne=(e==null?void 0:e.id)??wde(c),Y=jde(p),ae=$!==void 0?{type:"warning",message:$}:L&&S.length===0?{type:"error",message:"Add at least one model"}:void 0,le=c.trim()===""?L?"Name it so it's recognizable in the model picker":void 0:e!==void 0?void 0:ne===""?"Use at least one letter or digit (a–z, 0–9) in the name":t.some(J=>J.id===ne)?`“${ne}” is already a provider on this host; choose another name`:void 0,re=h.useRef({api:d,baseUrl:p,apiKey:v,checked:S});re.current={api:d,baseUrl:p,apiKey:v,checked:S};const ge=h.useRef(0),be=async J=>{if(y(!0),Y!==void 0)return;const Se=++ge.current,ke=re.current,Ce=()=>{const Ee=re.current;return Se===ge.current&&Ee.api===ke.api&&Ee.baseUrl===ke.baseUrl&&Ee.apiKey===ke.apiKey};M(!0),R(void 0);try{const Ee=await n.controller.listEndpointModels({api:d,baseUrl:p.trim(),...v===""?{}:{apiKey:v},...e===void 0?{}:{providerId:e.id}});if(!Ce())return;if(Ee.length===0){J&&R("The endpoint listed no models. Add model IDs by hand.");return}w(xe=>_p(xe,Ee)),re.current.checked.length===0&&E(_p([],Ee))}catch(Ee){J&&Ce()&&R(`${fy(Ee)} Add model IDs by hand.`)}finally{Se===ge.current&&M(!1)}},me=h.useRef(!1);h.useEffect(()=>{e===void 0||!s||me.current||(me.current=!0,be(!1))},[s]);const je=()=>{const J=A.trim();J!==""&&(w(Se=>_p(Se,[J])),E(Se=>_p(Se,[J])),z(""))},we=async J=>{if(J.preventDefault(),B(!0),y(!0),!(c.trim()===""||le!==void 0||Y!==void 0||S.length===0)){T(!0),H(void 0);try{await n.controller.saveCustomProvider({id:ne,name:c.trim(),api:d,baseUrl:p.trim(),models:k.filter(Se=>S.includes(Se))},v===""?void 0:v),i()}catch(Se){H(fy(Se)),T(!1)}}},ye=async J=>{U(!0),Z(void 0);try{await n.controller.removeCustomProvider(J),a()}catch(Se){Z(fy(Se)),D(!1),U(!1)}};return o.jsxs("form",{onSubmit:J=>void we(J),autoComplete:"off",children:[o.jsxs(te,{gap:3,children:[o.jsx(pt,{label:"Name",value:c,onChange:u,placeholder:"Ollama on studio",hasAutoFocus:e===void 0,isDisabled:!s,width:"100%",status:le===void 0?void 0:{type:"error",message:le}}),o.jsx(Ko,{label:"API format",options:YZ.map(J=>({value:J,label:bde[J]})),value:d,onChange:J=>f(J),description:"Ollama, LM Studio, vLLM and most gateways speak OpenAI Chat Completions.",isDisabled:!s,width:"100%"}),o.jsx("div",{onBlur:()=>y(!0),children:o.jsx(pt,{label:"Base URL",value:p,onChange:x,placeholder:"http://localhost:11434/v1",isDisabled:!s,width:"100%",status:g&&Y!==void 0?{type:"error",message:Y}:void 0})}),o.jsx(pt,{label:"API key",type:"password",isOptional:!0,value:v,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(y$,{label:"Models",description:"Checked models appear in the model picker.",options:k,value:S,onChange:E,placeholder:N?"Fetching models…":"No models yet",hasSearch:!0,hasSelectAll:!0,isLoading:N,isDisabled:!s,width:"100%",status:ae===void 0?void 0:{type:ae.type}}),o.jsx(ht,{label:"Fetch models",tooltip:"Fetch models from the endpoint",icon:o.jsx(C0,{}),isLoading:N,isDisabled:!s,onClick:()=>void be(!0)}),ae===void 0?null:o.jsx("div",{className:"endpoint-models__status",children:o.jsx(t0,{type:ae.type,message:ae.message})}),o.jsx("div",{className:"endpoint-models__add",onKeyDown:J=>{J.key==="Enter"&&(J.preventDefault(),je())},children:o.jsx(pt,{label:"Add model ID",isLabelHidden:!0,value:A,onChange:z,placeholder:"Add a model ID the endpoint doesn't list",isDisabled:!s,width:"100%"})}),o.jsx(ht,{label:"Add model",icon:o.jsx(cf,{}),isDisabled:!s||A.trim()==="",onClick:je})]}),o.jsxs(pe,{gap:2,vAlign:"center",wrap:"wrap",children:[e===void 0?null:o.jsx(K,{label:"Remove endpoint",variant:"secondary",isDisabled:!s,onClick:()=>D(!0)}),X===void 0?null:o.jsx(T1,{message:X}),o.jsx("div",{style:{marginInlineStart:"auto"},children:o.jsxs(pe,{gap:2,vAlign:"center",wrap:"wrap",children:[O===void 0?null:o.jsx(T1,{message:O}),o.jsx(K,{label:"Cancel",variant:"secondary",onClick:r}),o.jsx(K,{label:e===void 0?"Add endpoint":"Save changes",variant:"primary",type:"submit",isLoading:_,isDisabled:!s})]})})]})]}),e===void 0?null:o.jsx(T3,{isOpen:I,onOpenChange:D,title:`Remove ${e.name}?`,description:"Its models disappear from the model picker, and conversations using them stop.",actionLabel:"Remove endpoint",isActionLoading:q,onAction:()=>void ye(e.id)})]})}const Lf=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},pI=e=>{const t=Lf(e.oauth);return t===e.name?"Subscription":t},xI=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?`${Lf(e.oauth)} subscription`:"Signed in"},gI=e=>e.stored!==void 0||e.ambient!==void 0||e.custom!==void 0,qx={at:"home"},Cde=o.jsx(tr,{"aria-hidden":"true",style:{width:"var(--spacing-4)",height:"var(--spacing-4)",color:"var(--color-text-secondary)"}});function Ede({view:e,remote:t}){var s;const n=e.connection==="connected";return e.providers!==null?o.jsx($de,{providers:e.providers,remote:t,connected:n}):e.auth===null?o.jsx(Ie,{status:"warning",title:"This host is too old for logins",description:"Run `pinomad upgrade` on the host."}):Je(((s=e.host)==null?void 0:s.protocol.minor)??0,"beginLogin")?o.jsx(W,{as:"p",type:"supporting",children:"Loading…"}):o.jsxs(te,{gap:3,children:[o.jsx(Ie,{status:"warning",title:"Run `pinomad upgrade` on the host to add providers here"}),e.auth.logins.length===0?o.jsx(W,{as:"p",type:"supporting",children:"No stored logins."}):e.auth.logins.map(i=>o.jsx(Ode,{login:i,connected:n,remote:t},i.providerId))]})}function $de({providers:e,remote:t,connected:n}){const[s,i]=h.useState(qx),r=()=>i(qx),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&&i(qx)},[u]);let d;switch(u?"home":s.at){case"home":d=o.jsx(Ade,{providers:e.providers,connected:n,go:i});break;case"subscription":d=o.jsx(Mde,{providers:e.providers,connected:n,onBack:r,onPick:f=>i({at:"provider",id:f,method:"oauth",from:s})});break;case"key":d=o.jsx(Tde,{providers:e.providers,connected:n,onBack:r,onPick:f=>i({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(j6,{title:f===void 0?"Custom endpoint":`Edit ${f.name}`,onBack:r,children:o.jsx(Sde,{existing:f,providers:e.providers,remote:t,connected:n,onDone:r,onCancel:r,onRemoved:r})});break}case"provider":{const f=s;d=o.jsx(Nde,{provider:c(f.id),method:f.method,providers:e,remote:t,connected:n,onBack:()=>i(f.from),onHome:r},`${f.id}:${f.method??"manage"}`);break}}return o.jsx("div",{ref:a,style:{scrollMarginBlockStart:"var(--spacing-6)"},children:d})}function j6({title:e,onBack:t,children:n}){return o.jsxs(te,{gap:4,children:[o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(ht,{label:"Back",icon:o.jsx(fu,{}),variant:"ghost",size:"sm",onClick:t}),o.jsx(xn,{level:3,children:e})]}),n]})}function Ade({providers:e,connected:t,go:n}){const s=e.filter(gI),i=e.filter(c=>{var u;return((u=c.oauth)==null?void 0:u.subscription)===!0}).slice(0,5),r=e.filter(c=>c.apiKey!==void 0&&c.custom===void 0),a=["google","deepseek","mistral","groq","openrouter"].map(c=>r.find(u=>u.id===c)).filter(c=>c!==void 0),l=a.length>0?a:r.slice(0,5);return o.jsxs(te,{gap:6,children:[s.length>0?o.jsx(wn,{density:"compact",header:o.jsx(W,{type:"supporting",weight:"semibold",children:"Connected"}),children:s.map(c=>{var u;return o.jsx(yt,{label:c.name,description:xI(c),startContent:o.jsx(Ta,{providerId:c.id,name:c.name,baseUrl:(u=c.custom)==null?void 0:u.baseUrl}),endContent:Cde,onClick:()=>n(c.custom===void 0?{at:"provider",id:c.id,from:qx}:{at:"custom",id:c.id})},c.id)})}):null,o.jsxs(te,{gap:2,children:[o.jsx(W,{type:"supporting",weight:"semibold",children:s.length>0?"Add another":"Connect a model provider"}),o.jsxs("div",{className:"providers-paths",children:[o.jsx(hy,{title:"Subscription",body:"Use a plan you already pay for.",foot:[...new Set(i.map(c=>Lf(c.oauth).split(/[\s/]/)[0]))].join(", "),logos:i.map(c=>o.jsx(Ta,{providerId:c.id,name:c.name,size:28},c.id)),disabled:!t,onClick:()=>n({at:"subscription"})}),o.jsx(hy,{title:"API key",body:"Pay per token with a key from the provider.",foot:`${r.length} providers`,logos:l.map(c=>o.jsx(Ta,{providerId:c.id,name:c.name,size:28},c.id)),disabled:!t,onClick:()=>n({at:"key"})}),o.jsx(hy,{title:"Custom endpoint",body:"Your own server or gateway.",foot:"Ollama, LM Studio, vLLM, any OpenAI- or Anthropic-compatible URL",logos:[o.jsx(Ta,{providerId:"ollama",name:"Ollama",size:28},"ollama"),o.jsx(Ta,{providerId:"lmstudio",name:"LM Studio",size:28},"lmstudio")],disabled:!t,onClick:()=>n({at:"custom"})})]})]})]})}function hy({title:e,body:t,foot:n,logos:s,disabled:i,onClick:r}){return o.jsxs("button",{type:"button",className:"providers-tile providers-path",onClick:r,disabled:i,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 mI({provider:e,sub:t,connectedBy:n,disabled:s,onClick:i}){var r;return o.jsxs("button",{type:"button",className:"providers-tile",onClick:i,disabled:s,children:[o.jsxs("span",{className:"providers-tile__top",children:[o.jsx(Ta,{providerId:e.id,name:e.name,size:36}),((r=e.stored)==null?void 0:r.kind)===n?o.jsx($s,{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 Mde({providers:e,connected:t,onBack:n,onPick:s}){const i=e.filter(a=>a.oauth!==void 0),r=[...i.filter(a=>a.oauth.subscription),...i.filter(a=>!a.oauth.subscription)];return o.jsxs(j6,{title:"Sign in with an account",onBack:n,children:[o.jsx(W,{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:r.map(a=>o.jsx(mI,{provider:a,sub:a.oauth.subscription?pI(a):"Account sign-in",connectedBy:"oauth",disabled:!t,onClick:()=>s(a.id)},a.id))})]})}function Tde({providers:e,connected:t,onBack:n,onPick:s}){const[i,r]=h.useState(""),a=e.filter(u=>u.apiKey!==void 0&&u.custom===void 0),l=i.trim().toLowerCase(),c=a.filter(u=>l===""||`${u.name} ${u.id}`.toLowerCase().includes(l));return o.jsxs(j6,{title:"API key",onBack:n,children:[o.jsx(pt,{label:"Filter providers",isLabelHidden:!0,placeholder:`Filter ${a.length} providers`,value:i,onChange:r,hasClear:!0,width:"100%"}),c.length===0?o.jsx(W,{as:"p",type:"supporting",children:`No provider matches “${i.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(mI,{provider:u,connectedBy:"api_key",disabled:!t,onClick:()=>s(u.id)},u.id))})]})}const zde=(e,t)=>{var n;return t==="api_key"?"API key":((n=e.oauth)==null?void 0:n.subscription)===!0?pI(e):"Account sign-in"};function Nde({provider:e,method:t,providers:n,remote:s,connected:i,onBack:r,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??(gI(e)?void 0:l)),d=t===void 0?()=>u(void 0):r;return o.jsxs(te,{gap:5,children:[o.jsxs(pe,{gap:3,vAlign:"center",children:[o.jsx(ht,{label:"Back",icon:o.jsx(fu,{}),variant:"ghost",size:"sm",onClick:r}),o.jsx(Ta,{providerId:e.id,name:e.name,size:40}),o.jsxs(te,{gap:0,style:{minInlineSize:0},children:[o.jsx(xn,{level:3,children:e.name}),o.jsx(W,{type:"supporting",children:c===void 0?xI(e):zde(e,c)})]})]}),c===void 0?o.jsx(Ide,{provider:e,remote:s,connected:i,onLogin:u,onRemoved:a}):o.jsxs(te,{gap:4,children:[o.jsx(Rde,{provider:e,method:c}),o.jsx(hde,{providerId:e.id,method:c,logins:n.logins,remote:s,connected:i,intro:c==="oauth"?o.jsx(W,{as:"p",children:_de(e.oauth)}):void 0,signIn:((p=e.oauth)==null?void 0:p.loginLabel)??(e.oauth===void 0?void 0:`Sign in with ${Lf(e.oauth)}`),onDone:a,onCancel:d},c)]})]})}const Gj=e=>e.subscription?`Use ${Lf(e)} instead`:"Sign in to your account instead",_de=e=>(e==null?void 0:e.subscription)===!0?`Use your ${Lf(e)} plan. Requests count against the plan, not per-token billing.`:"Sign in to your account; there's no key to copy.";function Rde({provider:e,method:t}){const n=e.stored;if(n===void 0)return e.ambient===void 0?null:o.jsx(W,{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(W,{as:"p",type:"supporting",children:n.kind===t?`Replaces ${s}.`:`Replaces ${s}; a provider keeps one credential.`})}function Ide({provider:e,remote:t,connected:n,onLogin:s,onRemoved:i}){const[r,a]=h.useState(!1),[l,c]=h.useState(),u=e.stored,d=e.oauth;if(u===void 0)return o.jsxs(te,{gap:3,children:[o.jsx(W,{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(pe,{gap:2,wrap:"wrap",children:[e.apiKey===void 0?null:o.jsx(K,{label:"Save a key here",size:"sm",isDisabled:!n,onClick:()=>s("api_key")}),d===void 0?null:o.jsx(K,{label:Gj(d),variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>s("oauth")})]})]});const f=u.kind==="api_key";if(r)return o.jsxs(te,{gap:2,children:[o.jsx(W,{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(pe,{gap:2,vAlign:"center",wrap:"wrap",children:[o.jsx(K,{label:f?"Remove key":"Log out",variant:"destructive",size:"sm",isDisabled:!n,clickAction:()=>t.controller.logout(e.id).then(i,g=>{c(g instanceof Error?g.message:String(g))})}),o.jsx(K,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>a(!1)}),l===void 0?null:o.jsx(T1,{message:l})]})]});const p=f?"oauth":"api_key",x=p==="oauth"?d!==void 0:e.apiKey!==void 0;return o.jsxs(te,{gap:3,children:[e.ambient===void 0?null:o.jsx(W,{as:"p",type:"supporting",children:`${e.ambient} is also set where the host runs; the stored credential takes precedence.`}),o.jsxs(pe,{gap:2,wrap:"wrap",children:[o.jsx(K,{label:f?"Replace key":"Sign in again",size:"sm",isDisabled:!n,onClick:()=>s(u.kind)}),o.jsx(K,{label:f?"Remove key":"Log out",variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>a(!0)})]}),x?o.jsx("div",{children:o.jsx(K,{label:p==="api_key"||d===void 0?"Use an API key instead":Gj(d),variant:"ghost",size:"sm",isDisabled:!n,onClick:()=>s(p)})}):null]})}const Lde=e=>e.subscription?"Subscription connected":e.kind==="api_key"?"API key configured":"OAuth connected";function Ode({login:e,connected:t,remote:n}){const[s,i]=h.useState(!1);return o.jsxs(s0,{padding:4,children:[o.jsxs(pe,{gap:3,vAlign:"start",children:[o.jsx(Ta,{providerId:e.providerId,name:e.name}),o.jsxs(te,{gap:1,style:{flex:1,minInlineSize:0},children:[o.jsx(xn,{level:3,children:e.name}),o.jsx(W,{as:"p",type:"supporting",children:Lde(e)})]}),s?null:o.jsx(ou,{icon:o.jsx(S0,{"aria-hidden":"true"}),label:`${e.name} actions`,size:"sm",variant:"ghost",isDisabled:!t,items:[{label:"Log out",onClick:()=>i(!0)}]})]}),s?o.jsxs(te,{gap:2,style:{marginBlockStart:"var(--spacing-4)"},children:[o.jsx(W,{as:"p",type:"supporting",children:`Removes the stored ${e.name} credential from the host.`}),o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(K,{label:"Log out",variant:"destructive",size:"sm",isDisabled:!t,onClick:()=>void n.controller.logout(e.providerId)}),o.jsx(K,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>i(!1)})]})]}):null]})}function vI({update:e}){if(e===void 0)return o.jsx(W,{type:"supporting",children:"Checking for updates…"});const{status:t}=e;switch(t.state){case"checking":return o.jsx(W,{type:"supporting",children:"Checking for updates…"});case"available":case"downloading":{const n=t.progressPercent===void 0?"":` ${Math.round(t.progressPercent)}%`;return o.jsx(W,{type:"supporting",className:"tabular-nums",children:`Downloading PiNomad ${t.availableVersion??""}…${n}`})}case"ready":return o.jsx(K,{label:"Restart to update",variant:"primary",onClick:()=>e.install()});case"error":return o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(W,{type:"supporting",children:t.message}),o.jsx(K,{label:"Retry",variant:"secondary",onClick:()=>e.check()})]});case"disabled":return o.jsx(W,{type:"supporting",children:t.reason??"Updates are unavailable in this build."});default:return o.jsx(W,{type:"supporting",children:`PiNomad ${t.currentVersion} is up to date; no newer release found.`})}}function Dde(){const e=Jb();return e===void 0?null:o.jsxs(te,{gap:3,children:[o.jsx(W,{children:`PiNomad ${e.status.currentVersion}`}),e.status.state==="idle"?o.jsx("div",{children:o.jsx(K,{label:"Check for updates",variant:"secondary",onClick:()=>e.check()})}):o.jsx(vI,{update:e})]})}const Qh=[{id:"account",title:"Account",icon:uN,group:"account",keywords:"profile email password sign-in methods github google apple signed-in devices sessions sign out delete"},{id:"general",title:"General",icon:See,group:"device",keywords:"appearance theme light dark system color updates app version download"},{id:"hosts",title:"Hosts",icon:Gg,group:"device",keywords:"pair unpair add connection relay peer-to-peer join this mac local host install run"},{id:"providers",title:"Providers",icon:aN,group:"host",keywords:"api key login subscription custom endpoint"},{id:"models",title:"Models",icon:l2,group:"host",keywords:"default model thinking"},{id:"agents",title:"Agents",icon:w0,group:"host",keywords:"roles subagents named agents mcp servers tools"},{id:"chats",title:"Chats",icon:p5,group:"host",keywords:"conversations queue steer follow-up messages archived archive restore history"},{id:"devices",title:"Devices",icon:bee,group:"host",keywords:"paired revoke"},{id:"about",title:"About",icon:kee,group:"host",keywords:"host name rename version upgrade update automatic protocol website"}],Bde=e=>e==="account",S6=e=>Qh.find(t=>t.id===e).title,Wj=e=>{var t;return((t=Qh.find(n=>n.id===e))==null?void 0:t.group)==="host"},Hde=(e,t)=>{const n=t.trim().toLowerCase();return n===""||`${e.title} ${e.keywords}`.toLowerCase().includes(n)},Kj=e=>o.jsx(e,{"aria-hidden":"true",style:{width:"var(--spacing-4)",height:"var(--spacing-4)"}}),qde='dialog, [role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [aria-expanded="true"]',Pde='textarea, [contenteditable="true"], input:not([type="checkbox"]):not([type="radio"]):not([type="button"])';function Ude({machines:e,request:t,focusKey:n,narrow:s,safeLeft:i,onClose:r}){var X,Z,ne;const[a,l]=h.useState(t),[c,u]=h.useState(t==null?void 0:t.section),[d,f]=h.useState(""),[p,x]=h.useState(),[g,y]=h.useState(n);a!==t&&(l(t),u(t==null?void 0:t.section),f(""),x(void 0),y(n));const v=h.useMemo(()=>({ownsBack:s,set:x}),[s]),m=h.useRef(null);h.useEffect(()=>{var Y,ae;t!==void 0&&((ae=(Y=m.current)==null?void 0:Y.querySelector("button"))==null||ae.focus())},[t]);const k=an().state.status,w=t!==void 0;if(h.useEffect(()=>{if(!w)return;const Y=ae=>{ae.key==="Escape"&&(ae.target instanceof Element&&ae.target.closest(qde)!==null||ae.target instanceof Element&&ae.target.closest(Pde)!==null||r())};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[w,r]),!w)return;const S=e.find(Y=>Y.key===g)??e[0],E=S==null?void 0:S.view,A=S==null?void 0:S.remote,z=E!==void 0&&A!==void 0,N=(E==null?void 0:E.connection)==="connected",M=((X=window.pinomadDesktop)==null?void 0:X.updates)!==void 0,$=((Z=window.pinomadDesktop)==null?void 0:Z.localHost)!==void 0,R=e.length>1,_=c??(N?"providers":"hosts"),T=((ne=E==null?void 0:E.settings)==null?void 0:ne.hostName)??(S==null?void 0:S.label)??"This host",O=k==="signed-in"||k==="signed-out"?Qh.filter(Y=>Y.group==="account"):[],L=[...O.length===0?[]:[{title:"Account",sections:O}],{title:"This device",sections:Qh.filter(Y=>Y.group==="device")},...z||R?[{title:"Host settings",sections:Qh.filter(Y=>Y.group==="host")}]:[]].map(Y=>({...Y,sections:Y.sections.filter(ae=>Hde(ae,d))})).filter(Y=>Y.sections.length>0),B=!Wj(_)||S===void 0?null:R?o.jsx(Ko,{className:"-ms-2 self-start",label:"Host",isLabelHidden:!0,size:"sm",variant:"ghost",placement:"below",startIcon:o.jsx(bd,{connected:N}),value:S.key,options:e.map(Y=>{var ae;return{value:Y.key,label:Y.label,icon:o.jsx(bd,{connected:((ae=Y.view)==null?void 0:ae.connection)==="connected"})}}),onChange:y}):o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(bd,{connected:N}),o.jsx(W,{type:"supporting",children:T})]}),I=o.jsx(pt,{className:"pigui-nav-lead",label:"Search settings",isLabelHidden:!0,placeholder:"Search",size:"sm",startIcon:"search",value:d,onChange:f,onKeyDown:Y=>{var le;const ae=(le=L[0])==null?void 0:le.sections[0];Y.key==="Enter"&&ae!==void 0&&u(ae.id)}}),D=L.length===0?o.jsx(W,{type:"supporting",children:"No settings match"}):null,q=o.jsx(l_.Provider,{value:v,children:o.jsxs(te,{gap:2,children:[B,o.jsx(Fde,{...E===void 0?{}:{view:E},...A===void 0?{}:{remote:A},...(S==null?void 0:S.device)===void 0?{}:{device:S.device},...(S==null?void 0:S.hostKey)===void 0?{}:{hostKey:S.hostKey},connected:N,...(S==null?void 0:S.retry)===void 0?{}:{onReconnect:S.retry},section:_,hasUpdater:M,hasLocalHost:$,showTitle:!s,showSupporting:p===void 0,onSection:u},Wj(_)?`host:${(S==null?void 0:S.key)??"none"}`:void 0)]})});if(!s)return{nav:o.jsx(_3,{className:"pigui-settings-nav","aria-label":"Settings sections",resizable:{defaultWidth:260,minWidth:240,maxWidth:320,autoSaveId:"pinomad-settings-nav"},...i===void 0?{}:{header:o.jsx("div",{className:"pinomad-drag h-6"})},topContent:o.jsxs(te,{gap:2,children:[o.jsx("span",{ref:m,className:"contents",children:o.jsx(K,{label:"Settings","aria-label":"Close settings",variant:"ghost",size:"sm",icon:o.jsx(tr,{"aria-hidden":"true",className:"size-4 rotate-180"}),onClick:r,className:"pigui-nav-lead self-start"})}),I]}),children:o.jsxs(te,{gap:3,children:[D,L.map(Y=>o.jsx(Lm,{title:Y.title,children:Y.sections.map(ae=>o.jsx(_o,{label:ae.title,icon:Kj(ae.icon),isSelected:ae.id===_,onClick:()=>u(ae.id)},ae.id))},Y.title))]})}),content:o.jsx("div",{className:"pigui-settings h-full overflow-y-auto",children:o.jsx("div",{className:"mx-auto w-full max-w-[46rem] px-6 pt-14 pb-16",children:q})})};const U=o.jsxs(te,{gap:4,children:[I,D,L.map(Y=>o.jsxs(te,{gap:1,children:[o.jsx(W,{type:"supporting",weight:"semibold",children:Y.title}),o.jsx(wn,{density:"compact","aria-label":Y.title,children:Y.sections.map(ae=>o.jsx(yt,{label:ae.title,startContent:Kj(ae.icon),endContent:o.jsx(tr,{"aria-hidden":"true",style:{width:"var(--spacing-4)",height:"var(--spacing-4)"}}),onClick:()=>u(ae.id)},ae.id))})]},Y.title))]});return{nav:void 0,content:o.jsxs("div",{className:"pigui-settings flex h-full min-h-0 flex-col",children:[o.jsxs("div",{className:"pinomad-drag flex h-10 shrink-0 items-center gap-1 px-3",style:i===void 0?void 0:{paddingLeft:i},children:[c===void 0?null:o.jsx(ht,{label:"Back",icon:o.jsx(fu,{className:"size-4"}),size:"sm",variant:"ghost",onClick:()=>p===void 0?u(void 0):p.back()}),o.jsx("h1",{className:"min-w-0 flex-1 truncate px-1 text-sm font-semibold",children:(p==null?void 0:p.title)??(c===void 0?"Settings":S6(c))}),o.jsx("span",{ref:m,className:"contents",children:o.jsx(ht,{label:"Close settings",icon:o.jsx(j0,{className:"size-4"}),size:"sm",variant:"ghost",onClick:r})})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:c===void 0?U:q})]})}}function Fde({view:e,remote:t,device:n,hostKey:s,connected:i,onReconnect:r,section:a,hasUpdater:l,hasLocalHost:c,showTitle:u,showSupporting:d,onSection:f}){const{title:p,supporting:x,body:g}=Bde(a)?{title:S6(a),supporting:void 0,body:o.jsx(u2,{page:"overview"})}:Vde(e,t,n,s,i,r,a,{hasUpdater:l,hasLocalHost:c}),y=`settings-${a}-heading`;return o.jsxs(te,{as:"section",...u?{"aria-labelledby":y}:{"aria-label":p},gap:6,children:[o.jsxs(te,{gap:1,children:[u?o.jsx(xn,{level:2,id:y,children:p}):null,d?x:null]}),g]})}function Vde(e,t,n,s,i,r,a,{hasUpdater:l,hasLocalHost:c}){if(a==="hosts")return{title:"Hosts",supporting:o.jsx(W,{as:"p",type:"supporting",children:"The machines this device can use. It stays connected to every one paired here."}),body:o.jsx(c_,{...c?{thisMac:o.jsx(Pn,{title:"This Mac",children:o.jsx("div",{className:"p-4",children:o.jsx(are,{})})})}:{}})};if(a==="general")return{title:"General",body:o.jsxs(te,{gap:6,children:[o.jsx(Sie,{}),l?o.jsx(Pn,{title:"Updates",children:o.jsx("div",{className:"p-4",children:o.jsx(Dde,{})})}):null]})};if(e===void 0||t===void 0)return{title:S6(a),body:o.jsx(W,{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(W,{as:"p",type:"supporting",children:"Paired devices can reach this host over the secure channel."}),body:o.jsx(Vie,{view:e,remote:t,self:n,...s===void 0?{}:{hostKey:s}})};case"providers":return{title:"Providers",supporting:o.jsx(W,{as:"p",type:"supporting",children:"The subscriptions and API keys this host reaches models with, shared by every paired device."}),body:o.jsx(Ede,{view:e,remote:t})};case"models":return{title:"Models",supporting:o.jsx(W,{as:"p",type:"supporting",children:"Used when a new conversation doesn't pick its own model."}),body:o.jsx(Gde,{view:e,remote:t,connected:i})};case"agents":return{title:"Agents",supporting:o.jsxs(W,{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"}),"."]}),body:o.jsxs(te,{gap:6,children:[o.jsx(Jde,{view:e,remote:t,connected:i}),o.jsx(Xde,{view:e})]})};case"chats":return{title:"Chats",body:o.jsxs(te,{gap:6,children:[o.jsx(Wde,{view:e,remote:t,connected:i}),o.jsx(Kde,{view:e,remote:t,connected:i})]})};case"about":return{title:"About",body:o.jsxs(te,{gap:6,children:[o.jsx(Zde,{view:e,remote:t,connected:i}),o.jsx("section",{"aria-label":"Version",children:o.jsx(Pn,{title:"Version",children:o.jsx("div",{className:"p-4",children:o.jsx(sre,{view:e,remote:t})})})}),o.jsx(Yde,{view:e})]})}}}function Gde({view:e,remote:t,connected:n}){const s=e.settings;if(s===null)return o.jsx(Ie,{status:"warning",title:"This host is too old for settings",description:"Run `pinomad upgrade` on the host."});const i=e.models.find(c=>dx(c,s.defaultModel??void 0)),r=[...new Set(e.models.map(c=>c.provider))],a=(i==null?void 0:i.thinkingLevels)??[],l=s.custom.includes("defaultModel")||s.custom.includes("defaultThinkingLevel");return o.jsx(Pn,{children:o.jsxs("div",{className:$0,children:[o.jsx(Zg,{label:"Default model",children:o.jsx(Ko,{label:"Default model",isLabelHidden:!0,size:"sm",hasSearch:!0,searchPlaceholder:"Search models",placeholder:"Pi's default",isDisabled:!n||e.models.length===0,...i===void 0?{}:{startIcon:o.jsx(Jg,{model:i,size:14})},...i===void 0?{}:{value:String(e.models.indexOf(i))},options:r.map(c=>({type:"section",title:c,options:e.models.flatMap((u,d)=>u.provider===c?[{value:String(d),label:u.name,icon:o.jsx(Jg,{model:u,size:14,reserve:!0})}]:[])})),onChange:c=>{const u=e.models[Number(c)];u!==void 0&&t.controller.updateSettings({defaultModel:{provider:u.provider,modelId:u.modelId}})}})}),a.length>1?o.jsx(Zg,{label:"Thinking",description:"How long the model reasons before it answers",children:o.jsx(Ko,{label:"Thinking",isLabelHidden:!0,size:"sm",isDisabled:!n,value:s.defaultThinkingLevel??"off",options:a.map(c=>({value:c,label:df[c]})),onChange:c=>void t.controller.updateSettings({defaultThinkingLevel:c})})}):null,l?o.jsx("div",{className:"flex justify-end px-4 py-3",children:o.jsx(K,{label:"Use pi's defaults",variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>void t.controller.updateSettings({defaultModel:null,defaultThinkingLevel:null})})}):null]})})}function Wde({view:e,remote:t,connected:n}){const s=e.settings;return s===null?o.jsx(Ie,{status:"warning",title:"This host is too old for settings",description:"Run `pinomad upgrade` on the host."}):o.jsx(Pn,{title:"Messages sent while the agent works",children:o.jsxs("div",{className:$0,children:[o.jsx(Xj,{title:"Steer messages",description:"Delivered at the next turn",value:s.steeringMode,customized:s.custom.includes("steeringMode"),disabled:!n,onChange:i=>void t.controller.updateSettings({steeringMode:i}),onReset:()=>void t.controller.updateSettings({steeringMode:null})}),o.jsx(Xj,{title:"Follow-up messages",description:"Delivered once the agent finishes",value:s.followUpMode,customized:s.custom.includes("followUpMode"),disabled:!n,onChange:i=>void t.controller.updateSettings({followUpMode:i}),onReset:()=>void t.controller.updateSettings({followUpMode:null})})]})})}function Kde({view:e,remote:t,connected:n}){const s=fo(6e4),i=e.organized.archived;return o.jsxs(te,{as:"section","aria-label":"Archived",gap:2,children:[o.jsx(xn,{level:4,children:"Archived"}),o.jsx(W,{as:"p",type:"supporting",children:"Hidden from the sidebar. Restoring one brings back its forks and subagents."}),i.length===0?o.jsx(W,{as:"p",type:"supporting",children:"No archived conversations."}):o.jsx(Pn,{children:o.jsx(wn,{hasDividers:!0,children:i.map(({node:r,project:a})=>{const l=r.summary.title??"New conversation",c=oY(r);return o.jsx(yt,{label:l,description:[(a==null?void 0:a.name)??"Chat",c===void 0?void 0:y0(c,s)].filter(u=>u!==void 0).join(" · "),endContent:o.jsx(K,{label:`Restore ${l}`,icon:o.jsx(uee,{"aria-hidden":"true"}),variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>void t.controller.archive(r.summary.id,!1),children:"Restore"})},r.summary.id)})})})]})}function Xde({view:e}){const t=e.mcp;return o.jsxs(te,{as:"section","aria-label":"MCP servers",gap:2,children:[o.jsx(xn,{level:4,children:"MCP servers"}),t===null?o.jsx(W,{as:"p",type:"supporting",children:"Loading…"}):t.servers.length===0?o.jsx(W,{as:"p",type:"supporting",children:"No servers configured."}):o.jsx(Pn,{children:o.jsx(wn,{hasDividers:!0,children:t.servers.map(n=>o.jsx(yt,{label:n.name,endContent:o.jsx($s,{label:n.state,size:"sm"})},n.name))})})]})}function Zde({view:e,remote:t,connected:n}){var i;const s=e.settings;return s===null||!Ct(((i=e.host)==null?void 0:i.protocol.minor)??0,"hostName")?null:o.jsx(Pn,{children:o.jsx("div",{className:"p-4",children:o.jsx(Qde,{settings:s,remote:t,connected:n})})})}function Yde({view:e}){const t=e.host;return o.jsx(Pn,{title:"Details",children:o.jsxs(wn,{hasDividers:!0,children:[e.upgrade===null?o.jsx(yt,{label:"Host version",description:(t==null?void 0:t.version)??"Source checkout"}):null,o.jsx(yt,{label:"Protocol",description:t===void 0?"—":`${t.protocol.major}.${t.protocol.minor}`}),o.jsx(yt,{label:"Website",description:o.jsx(r0,{href:"https://pinomad.si/?home",isExternalLink:!0,children:"pinomad.si"})})]})})}function Qde({settings:e,remote:t,connected:n}){const s=e.hostName??"",[i,r]=h.useState(s);h.useEffect(()=>r(s),[s]);const a=nY(i),l=n&&a!==""&&a!==s,c=()=>void t.controller.updateSettings({hostName:a});return o.jsxs(te,{gap:1,children:[o.jsx(pt,{label:"Host name",value:i,onChange:r,onEnter:l?c:void 0,isDisabled:!n,description:"How paired devices name this machine. Without a custom name the hostname is used.",status:i!==""&&a===""?{type:"error",message:"The name needs at least one displayable character"}:void 0,width:"100%"}),o.jsxs(pe,{gap:2,hAlign:"end",children:[e.custom.includes("hostName")?o.jsx(K,{label:"Use machine name",variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>void t.controller.updateSettings({hostName:null})}):null,o.jsx(K,{label:"Save",variant:"secondary",size:"sm",isDisabled:!l,onClick:c})]})]})}function Xj({title:e,description:t,value:n,customized:s,disabled:i,onChange:r,onReset:a}){return o.jsxs(Zg,{label:e,description:t,children:[s?o.jsx(K,{label:"Use pi's default",variant:"secondary",size:"sm",isDisabled:i,onClick:a}):null,o.jsxs(o0,{value:n,onChange:l=>r(l),label:e,size:"sm",isDisabled:i,children:[o.jsx(Xi,{value:"one-at-a-time",label:"One at a time"}),o.jsx(Xi,{value:"all",label:"All at once"})]})]})}function Jde({view:e,remote:t,connected:n}){const s=e.agents,[i,r]=h.useState(void 0);return s===null?o.jsx(Ie,{status:"warning",title:"This host is too old for named agents",description:"Run `pinomad upgrade` on the host."}):o.jsxs(te,{gap:3,children:[o.jsx(pe,{gap:2,vAlign:"center",children:o.jsx(K,{label:"New agent",variant:"secondary",size:"sm",isDisabled:!n,onClick:()=>r({mode:"create"})})}),s.roles.length===0&&s.problems.length===0?o.jsx(W,{as:"p",type:"supporting",children:"No named agents yet."}):null,s.roles.map(a=>o.jsx(tfe,{role:a,view:e,remote:t,connected:n,onEdit:()=>r({mode:"edit",role:a})},a.name)),s.problems.map(a=>o.jsx(nfe,{problem:a,remote:t,connected:n},a.file)),i===void 0?null:o.jsx(yie,{view:e,remote:t,connected:n,...i.mode==="edit"?{role:i.role}:{},onClose:()=>r(void 0)})]})}const efe=e=>{const t=e.indexOf("/");return{provider:e.slice(0,t),modelId:e.slice(t+1)}};function tfe({role:e,view:t,remote:n,connected:s,onEdit:i}){const[r,a]=h.useState(!1),[l,c]=h.useState(void 0),u=e.model===void 0?void 0:Ei(t.models,efe(e.model)),d=()=>{n.controller.deleteAgent(e.name).catch(f=>{c(f instanceof Error?f.message:String(f))})};return o.jsxs(s0,{padding:4,children:[o.jsxs(pe,{gap:3,vAlign:"start",children:[o.jsxs(te,{gap:1,style:{flex:1,minInlineSize:0},children:[o.jsx(xn,{level:3,children:e.name}),o.jsx(W,{as:"p",type:"supporting",children:e.description}),e.model===void 0&&e.thinkingLevel===void 0?null:o.jsxs(pe,{gap:1,wrap:"wrap",children:[e.model===void 0?null:o.jsx($s,{label:(u==null?void 0:u.name)??e.model,size:"sm"}),e.thinkingLevel===void 0?null:o.jsx($s,{label:df[e.thinkingLevel],size:"sm"}),e.model!==void 0&&u===void 0?o.jsx($s,{label:"Model not available",color:"orange",size:"sm"}):null]})]}),r?null:o.jsx(pe,{gap:1,vAlign:"center",children:o.jsx(ou,{icon:o.jsx(S0,{"aria-hidden":"true"}),label:`${e.name} actions`,size:"sm",variant:"ghost",isDisabled:!s,items:[{label:"Edit",onClick:i},{label:"Delete",onClick:()=>a(!0)}]})})]}),r?o.jsxs(te,{gap:2,style:{marginBlockStart:"var(--spacing-4)"},children:[o.jsx(W,{as:"p",type:"supporting",children:"Conversations already using this agent keep their copy."}),o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(K,{label:"Delete",variant:"destructive",size:"sm",isDisabled:!s,onClick:d}),o.jsx(K,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>a(!1)})]})]}):null,l===void 0?null:o.jsx(W,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:l})]})}function nfe({problem:e,remote:t,connected:n}){const[s,i]=h.useState(!1),[r,a]=h.useState(void 0),l=f_(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(s0,{padding:4,children:[o.jsxs(pe,{gap:3,vAlign:"start",children:[o.jsxs(te,{gap:1,style:{flex:1,minInlineSize:0},children:[o.jsx(xn,{level:3,children:e.file}),o.jsx(pe,{gap:1,wrap:"wrap",children:o.jsx($s,{label:"Not loaded",color:"orange",size:"sm"})}),o.jsx(W,{as:"p",type:"supporting",children:e.reason}),o.jsx(W,{as:"p",type:"supporting",children:"Fix this file on the host."})]}),s||!l?null:o.jsx(pe,{gap:1,vAlign:"center",children:o.jsx(ou,{icon:o.jsx(S0,{"aria-hidden":"true"}),label:`${e.file} actions`,size:"sm",variant:"ghost",isDisabled:!n,items:[{label:"Delete",onClick:()=>i(!0)}]})})]}),s?o.jsx(te,{gap:2,style:{marginBlockStart:"var(--spacing-4)"},children:o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(K,{label:"Delete",variant:"destructive",size:"sm",isDisabled:!n,onClick:c}),o.jsx(K,{label:"Cancel",variant:"secondary",size:"sm",onClick:()=>i(!1)})]})}):null,r===void 0?null:o.jsx(W,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:r})]})}const yI="pinomad.sidebar.open",sfe=()=>typeof window>"u"||window.localStorage.getItem(yI)!=="false",ife={sidebarOpen:!0,toggleSidebar:()=>{},openNav:()=>{}},kI=h.createContext(ife),rfe=()=>h.useContext(kI);function bI({machines:e,focusKey:t,draftingChat:n,shownId:s,onDraft:i,onOpen:r,onNewChat:a,onShowMachine:l,narrow:c,children:u}){const[d,f]=h.useState(sfe),[p,x]=h.useState(!1),[g,y]=h.useState(),v=h.useRef(null),m=h.useCallback(I=>{v.current=document.activeElement,y(I)},[]),k=h.useCallback(()=>y(void 0),[]),[w,S]=h.useState(!1),E=an(),A=()=>{E.state.status==="signed-in"?m({section:"account"}):S(!0)},[z,N]=h.useState(),M=e.find(I=>I.key===t),$=Kb(),R=g!==void 0,_=$.reserveMacTrafficLights&&!c&&(d||R),T=Ude({machines:e,request:g,focusKey:t,narrow:c,...$.reserveMacTrafficLights&&(c||_)?{safeLeft:$.safeLeft}:{},onClose:k});h.useEffect(()=>{if(R)return;const I=v.current;v.current=null,I instanceof HTMLElement&&I.isConnected&&I.focus()},[R]);const O=h.useCallback(()=>{f(I=>(window.localStorage.setItem(yI,String(!I)),!I))},[]),H=h.useCallback(()=>x(!0),[]),L=I=>{const D=e.find(q=>q.hostKey===I);D!==void 0&&N(q=>({key:D.key,seq:((q==null?void 0:q.seq)??0)+1}))},B=o.jsx(lie,{machines:e,focusKey:t,draftingChat:n,shownId:s,...z===void 0?{}:{locate:z},onDraft:i,...a===void 0?{}:{onNewChat:a},onOpen:r,...l===void 0?{}:{onShowMachine:l},onSelect:()=>x(!1)});return o.jsx($m,{position:"topEnd",inset:{top:48},isTopLayer:!0,children:o.jsxs(kI.Provider,{value:{sidebarOpen:d,toggleSidebar:O,openNav:H},children:[o.jsxs(JC,{className:`pigui-app-layout text-foreground${c?"":" pigui-inset"}${c||d||R?"":" pigui-inset--bare"}`,contentPadding:0,mobileNav:!1,variant:"elevated",sideNav:c||!(d||R)?void 0:o.jsxs(o.Fragment,{children:[d?o.jsx("div",{className:"contents",hidden:R,children:o.jsx(_3,{resizable:{defaultWidth:260,minWidth:240,maxWidth:320,autoSaveId:"pinomad-app-shell"},header:o.jsx(iie,{onCollapse:O,safeLeft:_?$.safeLeft:void 0}),footer:o.jsx(cj,{onOpenSettings:()=>m({}),onOpenAccount:A,onLocateHost:L}),children:B})}):null,T==null?void 0:T.nav]}),children:[o.jsx("div",{className:"pigui-stage",hidden:R,children:u}),T===void 0?null:o.jsx("div",{className:"pigui-stage",children:o.jsx("section",{"aria-label":"Settings",className:"pigui-pane",children:T.content})})]}),!R&&(c||!d)&&((M==null?void 0:M.view)===void 0||M.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:$.reserveMacTrafficLights?{paddingLeft:$.safeLeft}:void 0,children:[o.jsx(ht,{icon:o.jsx(Wg,{className:"size-4"}),label:c?"Open navigation":"Expand sidebar",size:"sm",variant:"ghost",onClick:c?H:O}),o.jsx("span",{className:"text-sm font-semibold",children:"PiNomad"})]}):null,c?o.jsxs(z3,{className:"pigui-app-layout text-foreground",isOpen:p,onOpenChange:x,header:o.jsx("span",{className:"text-sm font-semibold",children:"PiNomad"}),children:[B,o.jsx(cj,{onOpenSettings:()=>m({}),onOpenAccount:A,onLocateHost:L,onSelect:()=>x(!1)})]}):null,w?o.jsx(M0,{onClose:()=>S(!1)}):null,e.map(I=>{var D;return I.view===void 0?null:o.jsx(afe,{machineKey:I.key,source:e.length>1?I.label:void 0,notices:I.view.notices,restarting:I.view.connection==="reconnecting"&&((D=I.view.upgrade)==null?void 0:D.phase)==="installing"},I.key)})]})})}function ofe({narrow:e,title:t,agent:n,parentSummary:s,onBackToParent:i,showOverview:r,overviewOpen:a,onOverviewChange:l,panelControls:c}){const{sidebarOpen:u,toggleSidebar:d,openNav:f}=rfe(),p=Kb(),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 px-3",style:g===void 0?void 0:{paddingLeft:g},children:[e?o.jsx(ht,{icon:o.jsx(Wg,{className:"size-4"}),label:"Open navigation",size:"sm",variant:"ghost",onClick:f}):u?null:o.jsx(ht,{icon:o.jsx(Wg,{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(K,{label:Xc(s),"aria-label":`Back to ${Xc(s)}`,variant:"ghost",size:"sm",onClick:()=>i(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]})]})}),r?o.jsx(ht,{"aria-pressed":a,className:a?"bg-[var(--color-overlay-pressed)]":void 0,icon:o.jsx(cee,{className:"size-4"}),label:"Overview",size:"sm",tooltip:a?"Hide overview":"Show overview",variant:"ghost",onClick:()=>l(!a)}):null,c]})}function afe({machineKey:e,source:t,notices:n,restarting:s}){const i=zf(),r=h.useRef(void 0);return h.useEffect(()=>{var l;const a=(l=n[n.length-1])==null?void 0:l.id;if(r.current===void 0){r.current=a??-1;return}for(const c of n)c.id<=r.current||s&&c.level==="error"||i({body:t===void 0?c.message:`${t}: ${c.message}`,type:c.level==="error"?"error":"info",uniqueID:`${e}:${c.id}`});a!==void 0&&(r.current=a)},[e,n,t,i,s]),null}const lfe=new RegExp("\\p{White_Space}","u"),cfe=/[\p{Alphabetic}\p{N}_$]/u,ufe=e=>e>=48&&e<=57||e>=97&&e<=122||e===45;function wI(e,t){const n=new Set(t),s=[];for(let i=0;i<e.length;i+=1){if(e.charCodeAt(i)!==36||i>0&&!lfe.test(e[i-1]))continue;let r=i+1;for(;r<e.length&&ufe(e.charCodeAt(r));)r+=1;n.has(e.slice(i+1,r))&&(r<e.length&&cfe.test(String.fromCodePoint(e.codePointAt(r)))||s.push({start:i,end:r}))}return s}const dfe={text:"",bindings:[]},jI=(e,t,n)=>t>=0&&e.startsWith(`$${n}`,t);function g4(e,t){const n=[];let s=0;for(const i of[...t].sort((r,a)=>r.start-a.start))i.start<s||!jI(e,i.start,i.name)||(n.push(i),s=i.end);return n}function ffe(e,t,n){const s=e.text;if(t===s&&n===void 0)return e;let i=0;for(;i<s.length&&i<t.length&&s[i]===t[i];)i+=1;let r=0;for(;r<s.length-i&&r<t.length-i&&s[s.length-1-r]===t[t.length-1-r];)r+=1;const a=s.length-r,l=t.length-s.length,c=[];for(const u of e.bindings){let d;u.end<=i?d=u.start:u.start>=a?d=u.start+l:(u.start<i||u.end>a)&&(d=u.start),d!==void 0&&jI(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-r;let f=-1;for(let p=t.indexOf(`$${n}`);p!==-1&&p<=d;p=t.indexOf(`$${n}`,p+1))p+u>=i&&(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:g4(t,[...x,p])}}}return{text:t,bindings:g4(t,c)}}function hfe(e,t){return t.length===0?{text:e,bindings:[]}:{text:e,bindings:wI(e,t).map(({start:n,end:s})=>({start:n,end:s,name:e.slice(n+1,s)}))}}const pfe=new RegExp("\\p{White_Space}","u"),xfe=/[\p{Alphabetic}\p{N}_$-]/u;function SI(e){const{text:t}=e,n=[];let s="",i=0;for(const r of g4(t,e.bindings))s+=t.slice(i,r.start),s!==""&&!pfe.test(s.at(-1))&&(s+=" "),s+=t.slice(r.start,r.end),i=r.end,i<t.length&&xfe.test(String.fromCodePoint(t.codePointAt(i)))&&(s+=" "),n.includes(r.name)||n.push(r.name);return s+=t.slice(i),{text:s,skills:n}}function CI(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 EI(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 gfe(e){let t="";for(let s=0;s<e.length;s+=32768)t+=String.fromCharCode(...e.subarray(s,s+32768));return btoa(t)}function mfe(e){return Math.max(0,Zr-e)}function vfe(e){return wre(e.name,e.size)}class $I extends Error{constructor(){super("Upload cancelled"),this.name="UploadCancelled"}}async function yfe(e,t,n,s){let i=n.attachmentId,r=n.received;if(i===void 0&&(i=await e.beginAttachment(t.name,t.size),s.onId(i)),t.size===0)return s.onProgress(0,!0),{attachmentId:i,received:0};for(;r<t.size;){if(s.isCancelled())throw new $I;const a=Math.min(r+vre,t.size),l=gfe(new Uint8Array(await t.slice(r,a).arrayBuffer())),c=await e.appendAttachment(i,r,l);if(c.complete)return s.onProgress(t.size,!0),{attachmentId:i,received:t.size};if(c.received<=r)throw new Error("Upload made no progress");r=c.received,s.onProgress(r,!1)}return s.onProgress(t.size,!0),{attachmentId:i,received:t.size}}const kfe=1568;function bfe(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 wfe(e){let t;try{t=await createImageBitmap(e)}catch{throw new Error(`Couldn't read ${e.name}`)}const n=Math.min(1,kfe/Math.max(t.width,t.height)),s=Math.max(1,Math.round(t.width*n)),i=Math.max(1,Math.round(t.height*n)),r=document.createElement("canvas");r.width=s,r.height=i;const a=r.getContext("2d");a.fillStyle="#ffffff",a.fillRect(0,0,s,i),a.drawImage(t,0,0,s,i),t.close();const l=await new Promise((d,f)=>r.toBlob(p=>p===null?f(new Error(`Couldn't read ${e.name}`)):d(p),"image/jpeg",.85)),c={data:bfe(await l.arrayBuffer()),mimeType:"image/jpeg"},u=WZ([c]);if(u!==void 0)throw new Error(u);return c}const jfe=()=>({draft:dfe,images:[],preparing:0,imageError:null,fileEntries:[],fileError:null,home:{kind:"chat"},checkoutMode:"worktree",agent:void 0,overrides:{},submitting:!1});var qd,Pd,Zt,To,zo,W1,et,Lt,Ql,m4;class Sfe{constructor(t){oe(this,et);oe(this,qd);oe(this,Pd,new Set);oe(this,Zt,jfe());oe(this,To,0);oe(this,zo,0);oe(this,W1,1);ve(this,"subscribe",t=>(j(this,Pd).add(t),()=>{j(this,Pd).delete(t)}));ve(this,"snapshot",()=>j(this,Zt));V(this,qd,t)}attachRemote(t){j(this,qd).setRemote(t)}setDraft(t){C(this,et,Lt).call(this,{draft:t})}restoreDraft(t,n){this.setDraft(hfe(t,n))}setHome(t){C(this,et,Lt).call(this,{home:t})}setCheckoutMode(t){C(this,et,Lt).call(this,{checkoutMode:t})}setAgent(t){C(this,et,Lt).call(this,{agent:t,overrides:{}})}setOverrides(t){C(this,et,Lt).call(this,{overrides:t})}beginSubmit(){return j(this,Zt).submitting?!1:(C(this,et,Lt).call(this,{submitting:!0}),!0)}endSubmit(){j(this,Zt).submitting&&C(this,et,Lt).call(this,{submitting:!1})}addImages(t,n){if(!n){C(this,et,Lt).call(this,{imageError:"This model doesn't accept images"});return}const s=t.filter(l=>l.type.startsWith("image/")),i=Math.max(0,Wh-j(this,zo)),r=s.slice(0,i);if(s.length>i?C(this,et,Lt).call(this,{imageError:"At most 4 images per message"}):s.length<t.length?C(this,et,Lt).call(this,{imageError:"Only images can be attached"}):C(this,et,Lt).call(this,{imageError:null}),r.length===0)return;V(this,zo,j(this,zo)+r.length);const a=j(this,To);C(this,et,Lt).call(this,{preparing:j(this,Zt).preparing+r.length}),Promise.all(r.map(l=>wfe(l))).then(async l=>{j(this,To)===a&&(await Yz(l),j(this,To)===a&&C(this,et,Lt).call(this,{images:[...j(this,Zt).images,...l],preparing:j(this,Zt).preparing-r.length}))},l=>{j(this,To)===a&&(V(this,zo,j(this,zo)-r.length),C(this,et,Lt).call(this,{imageError:l instanceof Error?l.message:String(l),preparing:j(this,Zt).preparing-r.length}))})}restoreImages(t){const n=t.slice(0,Wh);V(this,To,j(this,To)+1),V(this,zo,n.length),C(this,et,Lt).call(this,{images:[...n],preparing:0,imageError:t.length>Wh?"At most 4 images per message":null})}removeImage(t){V(this,zo,j(this,zo)-1),C(this,et,Lt).call(this,{images:j(this,Zt).images.filter((n,s)=>s!==t)})}clearImages(){V(this,To,j(this,To)+1),V(this,zo,0),C(this,et,Lt).call(this,{images:[],preparing:0,imageError:null})}addFiles(t,n){if(!n){C(this,et,Lt).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,et,Lt).call(this,{fileError:"Images are attached from Add images"});const i=mfe(j(this,Zt).fileEntries.length);if(i===0){C(this,et,Lt).call(this,{fileError:`At most ${Zr} files per message`});return}const r=[];let a=s.length>i?`At most ${Zr} files per message`:void 0;for(const c of s.slice(0,i)){const u=vfe(c);if(u!==void 0){a=`${c.name}: ${u}`;continue}r.push(c)}if(C(this,et,Lt).call(this,{fileError:a??null}),r.length===0)return;const l=r.map(c=>({key:`file-${Xn(this,W1)._++}`,name:c.name,size:c.size,status:"uploading",received:0,file:c}));C(this,et,Lt).call(this,{fileEntries:[...j(this,Zt).fileEntries,...l]});for(const c of l)C(this,et,m4).call(this,c.key,c.file,void 0,0)}retryFile(t){const n=j(this,Zt).fileEntries.find(s=>s.key===t);(n==null?void 0:n.file)!==void 0&&(C(this,et,Ql).call(this,t,{status:"uploading",error:void 0}),C(this,et,m4).call(this,t,n.file,n.attachmentId,n.received))}removeFile(t){C(this,et,Lt).call(this,{fileEntries:j(this,Zt).fileEntries.filter(n=>n.key!==t)})}restoreFiles(t){C(this,et,Lt).call(this,{fileEntries:t.slice(0,Zr).map(n=>({key:`file-${Xn(this,W1)._++}`,name:n.name,size:n.size,status:"done",attachmentId:n.id,received:n.size})),fileError:t.length>Zr?`At most ${Zr} files per message`:null})}clearFiles(){C(this,et,Lt).call(this,{fileEntries:[],fileError:null})}get uploading(){return j(this,Zt).fileEntries.some(t=>t.status==="uploading")}get failed(){return j(this,Zt).fileEntries.some(t=>t.status==="failed")}ids(){return j(this,Zt).fileEntries.flatMap(t=>t.status==="done"&&t.attachmentId!==void 0?[t.attachmentId]:[])}details(){return j(this,Zt).fileEntries.flatMap(t=>t.status==="done"&&t.attachmentId!==void 0?[{id:t.attachmentId,name:t.name,size:t.size}]:[])}}qd=new WeakMap,Pd=new WeakMap,Zt=new WeakMap,To=new WeakMap,zo=new WeakMap,W1=new WeakMap,et=new WeakSet,Lt=function(t){V(this,Zt,{...j(this,Zt),...t});for(const n of j(this,Pd))n()},Ql=function(t,n){C(this,et,Lt).call(this,{fileEntries:j(this,Zt).fileEntries.map(s=>s.key===t?{...s,...n}:s)})},m4=async function(t,n,s,i){const r=j(this,qd).remote;if(r===void 0){C(this,et,Ql).call(this,t,{status:"failed",error:"Host is not connected"});return}try{await yfe(r.controller,n,{...s===void 0?{}:{attachmentId:s},received:i},{onId:a=>C(this,et,Ql).call(this,t,{attachmentId:a}),onProgress:(a,l)=>C(this,et,Ql).call(this,t,{received:a,...l?{status:"done"}:{}}),isCancelled:()=>!j(this,Zt).fileEntries.some(a=>a.key===t)}),j(this,Zt).fileEntries.some(a=>a.key===t)&&C(this,et,Ql).call(this,t,{status:"done"})}catch(a){if(a instanceof $I||!j(this,Zt).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,et,Ql).call(this,t,{status:"failed",error:l,...c?{attachmentId:void 0,received:0}:{}})}};var K1,X1;class C6{constructor(){oe(this,K1,new Map);oe(this,X1)}setRemote(t){V(this,X1,t)}get remote(){return j(this,X1)}slot(t){let n=j(this,K1).get(t);return n===void 0&&(n=new Sfe(this),j(this,K1).set(t,n)),n}}K1=new WeakMap,X1=new WeakMap;const v4="new",Cfe=e=>`conversation:${e}`,y4=h.createContext(void 0);function E6(e=v4){const t=h.useContext(y4),n=h.useRef(void 0);n.current??(n.current=new C6);const s=t??n.current;return h.useMemo(()=>s.slot(e),[e,s])}function Of(e){return h.useSyncExternalStore(e.subscribe,e.snapshot)}const Efe=()=>()=>{},$fe=()=>{};function Afe(e){return h.useSyncExternalStore((e==null?void 0:e.subscribe)??Efe,(e==null?void 0:e.snapshot)??$fe)}function m2(){const e=h.useRef(void 0);return e.current??(e.current=new C6),h.useMemo(()=>e.current.slot("local"),[])}const AI="pinomad.lastNewHost";function Mfe(e){const t=e.getItem(AI);return t===null||t===""?void 0:t}function Tfe(e,t){e.setItem(AI,t)}function zfe({hosts:e,lastNewHost:t,connected:n}){if(e.length===0)return;const s=new Set(e.map(a=>a.hostKey)),i=t!==void 0&&s.has(t)?t:void 0;if(i!==void 0&&n(i))return i;const r=e.find(a=>n(a.hostKey));return r!==void 0?r.hostKey:i??e[0].hostKey}function Nfe({children:e}){var y;const{hosts:t,focus:n,focusConversation:s,focusDraft:i,focusHost:r}=Ns(),a=zN(),l=tu("(max-width: 1023px)"),c=n===null?void 0:a.get(n.hostKey),u=(y=Afe(c==null?void 0:c.composer.slot(v4)))==null?void 0:y.home,d=h.useMemo(()=>new Map(t.map(v=>[v.hostKey,lf(ao(v.privateKey))])),[t]),f=b0(t),p=t.map(v=>{const m=a.get(v.hostKey),k=(m==null?void 0:m.phase)==="ready"?m:void 0,w=d.get(v.hostKey);return{key:v.hostKey,hostKey:v.hostKey,label:f.get(v.hostKey)??v.url,...k===void 0?{}:{view:k.view,remote:k.remote},...w===void 0?{}:{device:w},...m===void 0?{}:{retry:m.retry},...s6(m)==="rejected"?{rejected:!0}:{}}}),x=(v,m)=>{var k;(k=a.get(v))==null||k.composer.slot(v4).setHome(m),i(v)},g=()=>{const v=zfe({hosts:t,lastNewHost:Mfe(window.localStorage),connected:m=>na(a.get(m))==="connected"});v!==void 0&&x(v,{kind:"chat"})};return o.jsx(bI,{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:(v,m)=>s({hostKey:v,conversationId:m}),onNewChat:g,onShowMachine:r,narrow:l,children:e})}function _fe({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(ia,{content:"Use a Git worktree; when off, work in the project folder.",isEnabled:!n,children:o.jsx(n0,{isDisabled:n,label:"worktree",size:"sm",value:e==="worktree",onChange:s=>t(s?"worktree":"local")})})})}const Rfe=150,Ife=(e,t)=>`${e}${t}`;function Lfe(e){let t=0,n;const s=new Map,i=a=>s.get(a)===t,r=(a,l)=>{s.get(a)===l&&s.delete(a)};return{request(a,l,c){if(n!==void 0&&(clearTimeout(n.timer),n=void 0),i(a))return;const u=t;n={cacheKey:a,timer:setTimeout(()=>{n=void 0,!(u!==t||i(a))&&(s.set(a,u),c().then(d=>{r(a,u),u===t&&e(a,l,d.files)},()=>{r(a,u)}))},Rfe)}},cancel(){t+=1,n!==void 0&&(clearTimeout(n.timer),n=void 0)}}}const Zj=5e3,Ofe=e=>({id:`agent:${e.name}`,label:e.name,auxiliaryData:{kind:"agent",group:"Agents",description:e.description,insert:`@${e.name} `}}),Yj=e=>({id:`file:${e}`,label:e,auxiliaryData:{kind:"file",group:"Files",insert:`@./${e} `}}),Qj=e=>e.auxiliaryData;function MI(e,t,n){const s=(e==null?void 0:e.roles)??[],[i,r]=h.useState({byKey:{}}),a=h.useRef(n);a.current=n;const l=h.useRef(void 0);l.current??(l.current=Lfe((u,d,f)=>{r(p=>{const x=Date.now(),g={};for(const[y,v]of Object.entries(p.byKey))x-v.at<Zj&&(g[y]=v);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;i.latest!==void 0&&((u=t.current)==null||u.emitInput())},[i]);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(w=>w.name.includes(x)).map(Ofe),y=a.current;if(y===void 0)return g;const v=p.startsWith("./")?p.slice(2):p,m=Ife(y.key,v),k=i.byKey[m];return k!==void 0&&Date.now()-k.at<Zj?[...g,...k.files.map(Yj)]:(u.request(m,y.key,()=>y.list(v)),i.latest!==void 0&&i.latest.scope===y.key?[...g,...i.latest.files.map(Yj)]: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=Qj(p),g=(x==null?void 0:x.kind)==="file"?Nf:w0;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=Qj(p))==null?void 0:x.insert)??""}}]},[s,i,c])}const Dfe=5e3,Bfe=64;var Z1,Fa,Y1,Ud,Q1,No,J1,k4;class TI{constructor(t,n,s,i={}){oe(this,J1);oe(this,Z1);oe(this,Fa);oe(this,Y1);oe(this,Ud);oe(this,Q1);oe(this,No,new Map);V(this,Z1,t),V(this,Fa,n),V(this,Y1,s),V(this,Ud,i.now??Date.now),V(this,Q1,i.ttlMs??Dfe)}keyOf(t){return j(this,Fa).call(this,t)}snapshot(t){var n;return(n=j(this,No).get(j(this,Fa).call(this,t)))==null?void 0:n.items}request(t,n=!1){const s=C(this,J1,k4).call(this,j(this,Fa).call(this,t));if(s.inflight!==void 0||!n&&s.items!==void 0&&j(this,Ud).call(this)-s.at<j(this,Q1))return;const i=j(this,Z1).call(this,t);s.inflight=i,i.then(r=>{if(s.inflight===i){s.items=j(this,Y1).call(this,r),s.at=j(this,Ud).call(this);for(const a of s.listeners)a()}},()=>{}).finally(()=>{s.inflight===i&&(s.inflight=void 0)})}subscribe(t,n){const s=C(this,J1,k4).call(this,j(this,Fa).call(this,t)).listeners;return s.add(n),()=>s.delete(n)}}Z1=new WeakMap,Fa=new WeakMap,Y1=new WeakMap,Ud=new WeakMap,Q1=new WeakMap,No=new WeakMap,J1=new WeakSet,k4=function(t){let n=j(this,No).get(t);if(n===void 0&&(n={at:0,listeners:new Set},j(this,No).set(t,n),j(this,No).size>Bfe)){for(const[s,i]of j(this,No))if(s!==t&&i.inflight===void 0&&i.listeners.size===0){j(this,No).delete(s);break}}return n};const Hfe=()=>()=>{};function zI(e,t,n){const s=t===void 0?void 0:e.keyOf(t),i=h.useSyncExternalStore(h.useCallback(u=>s===void 0?Hfe:e.subscribe(t,u),[e,s]),h.useCallback(()=>s===void 0?void 0:e.snapshot(t),[e,s])),r=h.useRef(t);r.current=t;const a=h.useRef(n);a.current=n;const l=h.useCallback((u=!1)=>{const d=r.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=r.current;u!==void 0&&e.request(u,c.current),c.current=!1},[e,n,s]),{items:n?i:void 0,request:l}}const qfe="pinomad-skill-mention",Pfe=()=>typeof CSS<"u"&&typeof Highlight=="function"&&"highlights"in CSS;let py;const Ufe=()=>(py??(py=new Highlight),CSS.highlights.set(qfe,py),py);function Ffe(e){const t=[];let n=0;const s=i=>{var r;for(const a of i.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=((r=a.getAttribute("data-astryx-token-value"))==null?void 0:r.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 Vfe(e,t){if(t.length===0)return[];const n=Ffe(e),s=[];for(const{start:i,end:r}of t){const a=n.find(u=>u.node!==void 0&&u.start<=i&&i<u.end),l=n.find(u=>u.node!==void 0&&u.start<r&&r<=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,i-a.start),c.setEnd(l.node,r-l.start),s.push(c)}return s}function Gfe(e,t){if(!Pfe())return()=>{};const n=Vfe(e,t);if(n.length===0)return()=>{};const s=Ufe();for(const i of n)s.add(i);return()=>{for(const i of n)s.delete(i)}}const NI=e=>e.kind==="conversation"?`conversation:${e.conversationId}`:e.kind==="project"?`project:${e.path}:${e.checkout}`:"chat";class Wfe extends TI{constructor(t,n={}){super(t,NI,s=>s.skills,n)}}const Jj=new WeakMap;function _I(e){let t=Jj.get(e);return t===void 0&&(t=new Wfe(n=>e.controller.listSkills(n)),Jj.set(e,t)),t}function Kfe(e,t,n){const{items:s,request:i}=zI(_I(e),t,n);return{skills:s,request:i}}const Xfe=e=>({id:`skill:${e.name}`,label:e.name,auxiliaryData:{group:e.source==="project"?"Project":"User",description:e.description}});function Zfe(e,t){const n=t.toLowerCase();return e.flatMap((s,i)=>{const r=s.name.toLowerCase(),a=r.startsWith(n)?0:r.includes(n)?1:s.description.toLowerCase().includes(n)?2:-1;return a<0?[]:[{skill:s,index:i,tier:a}]}).sort((s,i)=>s.tier-i.tier||s.index-i.index).map(({skill:s})=>Xfe(s))}function RI(e,t,n,s,i){const r=_I(e),a=t===void 0?void 0:NI(t),{skills:l,request:c}=Kfe(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(i);return f.current=i,{trigger:h.useMemo(()=>!s||t===void 0?void 0:{character:"$",searchSource:{bootstrap:()=>[],search:g=>{const y=d.current;return y!==void 0&&r.request(y),Zfe(u.current??[],g)},cancel:()=>{}},menuLabel:"Skills",emptySearchResultsText:"No matching skills",renderItem:g=>{const y=g.auxiliaryData;return o.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(l2,{"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 ${(y==null?void 0:y.description)===void 0?"min-w-0":"max-w-[60%] shrink-0"}`,children:g.label}),(y==null?void 0:y.description)===void 0?null:o.jsx("span",{className:"min-w-0 truncate text-xs text-muted",children:y.description})]})]})},onSelect:g=>(f.current(g.label),`$${g.label} `)},[s,r,a,l]),request:c}}function II(e){const t=m2(),n=e??t,s=Of(n).draft,i=h.useRef(void 0),r=h.useCallback(c=>{const u=i.current;i.current=void 0,n.setDraft(ffe(n.snapshot().draft,c,u))},[n]),a=h.useCallback(c=>{i.current=c},[]),l=h.useCallback((c,u)=>{i.current=void 0,n.restoreDraft(c,u)},[n]);return{value:s.text,draft:s,setValue:r,pick:a,restore:l}}function LI(e,t){h.useEffect(()=>{var s;const n=(s=e.current)==null?void 0:s.editable();if(!(n==null||t.bindings.length===0))return Gfe(n,t.bindings)},[e,t])}function Yfe({text:e,names:t}){const n=h.useMemo(()=>t.length===0?[]:wI(e,t),[e,t]);if(n.length===0)return o.jsx(o.Fragment,{children:e});const s=[];let i=0;return n.forEach((r,a)=>{r.start>i&&s.push(e.slice(i,r.start)),s.push(o.jsx("mark",{className:"chat-skill-mention",children:e.slice(r.start,r.end)},a)),i=r.end}),i<e.length&&s.push(e.slice(i)),o.jsx(o.Fragment,{children:s})}function OI({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(Nf,{"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}%`:EI(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(C0,{"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(j0,{"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 Qfe({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(Nf,{"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:EI(n.size)})]},`${n.id}:${s}`))})}function DI(e,t,n){const s=m2(),i=n??s;h.useEffect(()=>{i.attachRemote(e)},[i,e]);const r=Of(i);return{entries:r.fileEntries,get uploading(){return r.fileEntries.some(a=>a.status==="uploading")},get failed(){return r.fileEntries.some(a=>a.status==="failed")},error:r.fileError,add:a=>i.addFiles(a,t),retry:a=>i.retryFile(a),remove:a=>i.removeFile(a),restore:a=>i.restoreFiles(a),clear:()=>i.clearFiles(),ids:()=>i.ids(),details:()=>i.details()}}function $6({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 BI({inputRef:e,onFiles:t}){return o.jsx($6,{inputRef:e,onFiles:t,accept:"image/*"})}function HI({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((i,r)=>o.jsx(ig,{src:kd(i),alt:`Image ${r+1}`,onRemove:()=>n(r)},r)),t?o.jsx(ig,{isLoading:!0,alt:"Preparing image"}):null,s]})}function qI(e,t){const n=m2(),s=t??n,i=Of(s),r=h.useRef(e);return r.current=e,{images:i.images,pending:i.preparing>0,error:i.imageError,add:a=>s.addImages(a,r.current),restore:a=>s.restoreImages(a),remove:a=>s.removeImage(a),clear:()=>s.clearImages()}}function PI({models:e,selected:t,isDisabled:n=!1,agent:s,sourceHint:i,problem:r,onModelChange:a,onLevelChange:l}){const[c,u]=h.useState(""),d=h.useRef(null),f=e.find(v=>dx(v,t.model)),p=(f==null?void 0:f.thinkingLevels)??["off"],x=hie(e,c),g=s===void 0?void 0:s.kind==="pick"?s.value:s.name,y=(s==null?void 0:s.kind)==="pick"&&s.value!==void 0&&!s.roles.some(v=>v.name===s.value)?s.value:void 0;return o.jsx(CE,{alignment:"start",label:"Model and Thinking",placement:"above",width:236,hasAutoFocus:!1,onOpenChange:v=>{v&&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:v=>v.stopPropagation(),onMouseDown:v=>v.stopPropagation(),onPointerDown:v=>v.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(wn,{className:"max-h-48 overflow-y-auto",density:"compact",children:[y===void 0?null:o.jsx(yt,{description:"No longer available",endContent:o.jsx(Ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}),isDisabled:!0,isSelected:!0,label:y}),o.jsx(yt,{description:"Default system prompt",endContent:s.value===void 0?o.jsx(Ea,{"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(v=>o.jsx(yt,{description:v.description,endContent:s.value===v.name?o.jsx(Ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,isSelected:s.value===v.name,label:v.name,onClick:()=>s.onChange(v.name)},v.name))]}):o.jsx(wn,{density:"compact",children:o.jsx(yt,{...s.description===void 0?{}:{description:s.description},endContent:o.jsx(Ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}),isSelected:!0,label:s.name})})]}),o.jsx(pt,{isLabelHidden:!0,label:"Search models",placeholder:"Search models",ref:d,size:"sm",value:c,width:"100%",onChange:v=>u(v)}),o.jsx(wn,{"aria-label":"Model",className:"max-h-72 overflow-y-auto",density:"compact",children:x.map(v=>o.jsx(yt,{description:v.provider,startContent:o.jsx(Jg,{model:v,reserve:!0}),endContent:dx(v,t.model)?o.jsx(Ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,isSelected:dx(v,t.model),label:v.name,onClick:()=>a({provider:v.provider,modelId:v.modelId})},`${v.provider}/${v.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(wn,{density:"compact",children:p.map(v=>o.jsx(yt,{endContent:v===t.level?o.jsx(Ea,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}):void 0,isDisabled:n,label:df[v],onClick:()=>l(v)},v))})]}):null]}),children:o.jsx(K,{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",...r===void 0?{}:{tooltip:r.title},children:o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r===void 0&&t.model!==void 0?o.jsx(Jg,{model:t.model,size:14}):null,r===void 0?o.jsxs("span",{className:"truncate",children:[g===void 0?"":`@${g} · `,fie(e,t)]}):o.jsx("span",{className:"truncate text-danger",children:r.label}),i===void 0||r!==void 0?null:o.jsx("span",{className:"shrink-0 truncate text-xs text-muted",children:i}),o.jsx(Pe,{icon:"chevronDown",size:"sm",color:"inherit"})]})})})}const eS="pinomad.draft.model";function UI(e){return e===void 0?eS:`${eS}.${e}`}function Jfe(e,t){try{const n=localStorage.getItem(UI(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(i=>i.provider===s.provider&&i.modelId===s.modelId))return s}catch{}}function ehe(e,t,n){const[s,i]=h.useState(()=>{var w;const y=Jfe(e.models,t),v=y!==void 0?{provider:y.provider,modelId:y.modelId}:e.defaults.model??(e.models[0]===void 0?void 0:{provider:e.models[0].provider,modelId:e.models[0].modelId}),m=((w=Ei(e.models,v))==null?void 0:w.thinkingLevels)??["off"],k=(y==null?void 0:y.thinkingLevel)??e.defaults.thinkingLevel??"off";return{model:v,level:Qg(m,k)}}),r=m2(),a=n??r,l=Of(a),c=l.agent,u=l.overrides,d=(y,v)=>{localStorage.setItem(UI(t),JSON.stringify({...y,thinkingLevel:v}))},f=c===void 0?void 0:gie(c,e.agents,e.models,e.defaults,u),p=pie(e.models,e.defaults,s),x=f??p,g=x.level;return{pick:x,agent:c,resolution:f,setModel:y=>{var m;if(c!==void 0){a.setOverrides({...u,model:y});return}const v=Qg(((m=Ei(e.models,y))==null?void 0:m.thinkingLevels)??["off"],g);i({model:y,level:v}),d(y,v)},setLevel:y=>{if(c!==void 0){a.setOverrides({...u,level:y});return}i(v=>({...v,level:y})),x.model!==void 0&&d(x.model,y)},setAgent:y=>{a.setAgent(y)}}}function FI({isDisabled:e=!1,onOpenChange:t,children:n}){return o.jsx(jf,{button:{label:"More actions",variant:"ghost",size:"sm",isIconOnly:!0,icon:o.jsx(cf,{"aria-hidden":"true"}),isDisabled:e},hasChevron:!1,menuWidth:288,onOpenChange:t,placement:"above",children:n})}function Kr({icon:e,label:t,hint:n,isDisabled:s,onClick:i}){return o.jsx(t1,{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:i})}function rh(e){return(e==null?void 0:e.querySelector('[aria-multiline="true"]'))??null}function tS(e){var r;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 i=document.createRange();s===null?(i.selectNodeContents(e),i.collapse(!1)):(i.setStart(s,((r=s.textContent)==null?void 0:r.length)??0),i.collapse(!0)),t.removeAllRanges(),t.addRange(i)}function the({disabled:e=!1,placeholder:t,inputRef:n,onSubmitRequest:s,value:i,onValueChange:r,onFiles:a,triggers:l}){const c=h.useRef(null),u=h.useRef(null),d=h.useRef(i);d.current=i,h.useEffect(()=>{if(n)return n.current={focus:()=>{var p;return(p=u.current)==null?void 0:p.focus()},focusAtEnd:()=>{const p=rh(c.current);p&&(p.focus(),tS(p))},emitInput:()=>{const p=rh(c.current);p!==null&&(document.activeElement===p||p.contains(document.activeElement))&&p.dispatchEvent(new Event("input",{bubbles:!0}))},editable:()=>rh(c.current),openTrigger:p=>{requestAnimationFrame(()=>{const x=rh(c.current);if(!x)return;x.focus(),tS(x);const g=d.current,y=g===""||/[ \n]$/.test(g)?p:` ${p}`;document.execCommand("insertText",!1,y)})}},()=>{n.current=null}},[n]),h.useEffect(()=>{const p=rh(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(d3,{ref:c,className:"prompt-input__input",handleRef:u,hasHistory:!1,isDisabled:e,label:"Prompt",pasteAsToken:!1,placeholder:t,value:i,onChange:p=>r==null?void 0:r(p),onKeyDown:f,...a===void 0?{}:{onFiles:a},...l===void 0?{}:{triggers:[...l]}})}function VI({value:e,status:t="ready",className:n="",placeholder:s,inputRef:i,isDisabled:r=!1,submitDisabled:a=!1,attachments:l,hasAttachments:c,onFiles:u,triggers:d,startActions:f,endActions:p,footer:x,error:g,onSubmit:y,onStop:v,onValueChange:m,...k}){const S=(t==="streaming"||t==="submitted")&&!e.trim()&&c!==!0&&!!v,E=!a&&(!!e.trim()||c===!0),A=()=>{E&&(y==null||y())},z=M=>{u===void 0||!M.dataTransfer.types.includes("Files")||M.preventDefault()},N=M=>{if(u===void 0||!M.dataTransfer.types.includes("Files"))return;M.preventDefault();const $=[...M.dataTransfer.files];$.length>0&&u($)};return o.jsxs("div",{className:`prompt-input ${n}`.trim(),"data-slot":"prompt-input","data-status":t,onDragOver:z,onDrop:N,...k,children:[o.jsx(UE,{elevation:"low",...l===void 0?{}:{drawer:o.jsx(FE,{children:l})},footerActions:f,input:o.jsx(the,{disabled:r,inputRef:i,placeholder:s,value:e,onValueChange:m,onSubmitRequest:A,onFiles:u,triggers:d}),isStopShown:S&&!r,placeholder:s,sendActions:p,sendButton:o.jsx(f3,{className:"pigui-pressable",isDisabled:r||!S&&!E,onSend:A}),status:g?{type:"error",message:g}:void 0,value:e,onChange:M=>m==null?void 0:m(M),onStop:v,onSubmit:A}),x?o.jsx("div",{className:"prompt-input__footer","data-slot":"prompt-input-footer",children:x}):null]})}function GI(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(i=>i!==void 0);return[e,...s].join(" · ")}function nhe(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 she(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 ihe({view:e,remote:t,hostKey:n,draft:s,onDraft:i,onCreated:r,connected:a,machine:l}){var je,we,ye;const c=E6(),u=Of(c),d=II(c),{value:f,setValue:p}=d,x=u.submitting,g=u.checkoutMode,y=J=>c.setCheckoutMode(J),v=h.useRef(null),{pick:m,setModel:k,setLevel:w,agent:S,setAgent:E,resolution:A}=ehe(e,n,c),z=Ei(e.models,m.model),N=(z==null?void 0:z.images)===!0,{images:M,pending:$,error:R,add:_,remove:T,clear:O}=qI(N,c),H=h.useRef(null),L=(je=e.host)==null?void 0:je.protocol.minor,B=L!==void 0&&Ct(L,"attachments")&&Je(L,"beginAttachment"),I=DI(t,B,c),D=h.useRef(null),[q,U]=h.useState(void 0),X=J=>{const{images:Se,others:ke}=CI(J);U(void 0),Se.length>0&&_(Se),ke.length>0&&I.add(ke)},Z=((we=e.agents)==null?void 0:we.roles)??[],ne=L!==void 0&&Ct(L,"agentConversations")&&(Z.length>0||S!==void 0),Y=s.kind==="project"&&L!==void 0&&Je(L,"listFiles")?{key:`project:${s.path}:${g}`,list:J=>t.controller.listFiles({kind:"project",path:s.path,checkout:g==="local"?"project":"worktree"},J)}:void 0,ae=MI(e.agents,v,Y),le=RI(t,s.kind==="project"?{kind:"project",path:s.path,checkout:g==="local"?"project":"worktree"}:{kind:"chat"},v,a&&L!==void 0&&Je(L,"listSkills"),d.pick);LI(v,d.draft);const re=[...ae??[],...le.trigger===void 0?[]:[le.trigger]],ge=A==null?void 0:A.problem,be=S===void 0||A===void 0?void 0:A.modelFrom!=="override"&&A.levelFrom!=="override"?`from @${S}`:A.modelFrom!=="override"?`model from @${S}`:A.levelFrom!=="override"?`level from @${S}`:void 0,me=N||!a?void 0:`${(z==null?void 0:z.name)??((ye=m.model)==null?void 0:ye.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(nhe,{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(BI,{inputRef:H,onFiles:_}),o.jsx($6,{inputRef:D,onFiles:X}),I.uploading?o.jsx(W,{type:"supporting",children:"Uploading files…"}):null,o.jsx(VI,{value:f,inputRef:v,onValueChange:p,onFocus:le.request,triggers:re.length===0?void 0:re,status:x?"submitted":"ready",onSubmit:()=>{var xe;const J=SI(d.draft),Se=J.text.trim();if(Se===""&&M.length===0&&I.entries.length===0||I.uploading||I.failed||$||x||ge!==void 0||!c.beginSubmit())return;o2();const ke=(xe=t.view.current().conversation)==null?void 0:xe.conversation.id,Ce=M,Ee=I.ids();t.controller.createConversation(s,Se,{...s.kind==="project"&&g==="local"?{checkout:"project"}:{},...A===void 0?{...m.model===void 0?{}:{model:m.model},thinkingLevel:m.level}:A.send,...Ce.length===0?{}:{images:Ce},skills:J.skills,...Ee.length===0?{}:{attachments:Ee}}).then(()=>{var st;const xt=(st=t.view.current().conversation)==null?void 0:st.conversation.id;xt!==void 0&&xt!==ke&&(d.restore("",[]),O(),I.clear(),r())}).finally(()=>c.endSubmit())},isDisabled:!a,submitDisabled:ge!==void 0||I.uploading||I.failed,placeholder:GI("Do anything with Pi",{agents:Z.length>0,files:Y!==void 0,commands:!1,skills:le.trigger!==void 0}),attachments:HI({images:M,pending:$,onRemove:T,...I.entries.length===0?{}:{files:o.jsx(o.Fragment,{children:I.entries.map(J=>o.jsx(OI,{entry:J,onRetry:I.retry,onRemove:I.remove},J.key))})}}),hasAttachments:M.length>0||I.entries.length>0,onFiles:X,error:R??I.error??q,startActions:o.jsxs(o.Fragment,{children:[o.jsxs(FI,{isDisabled:!a,children:[o.jsx(Kr,{icon:Zb,label:"Add images",hint:me??"Or paste or drop",isDisabled:!N,onClick:()=>{var J;return(J=H.current)==null?void 0:J.click()}}),B?o.jsx(Kr,{icon:Nf,label:"Attach files",hint:"Up to 10 · 10 MB each",onClick:()=>{var J;return(J=D.current)==null?void 0:J.click()}}):null,le.trigger===void 0?null:o.jsx(Kr,{icon:l2,label:"Use a skill",hint:"Or type $",onClick:()=>{var J;return(J=v.current)==null?void 0:J.openTrigger("$")}}),Z.length===0?null:o.jsx(Kr,{icon:w0,label:"Mention an agent",hint:"Or type @",onClick:()=>{var J;return(J=v.current)==null?void 0:J.openTrigger("@")}})]}),o.jsx(PI,{models:e.models,selected:{model:m.model,level:m.level},isDisabled:!a,agent:ne?{kind:"pick",roles:Z,value:S,onChange:E}:void 0,sourceHint:be,...ge===void 0?{}:{problem:she(ge)},onModelChange:k,onLevelChange:w})]}),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(Ko,{isLabelHidden:!0,label:"Machine",placement:"below",variant:"ghost",size:"sm",value:l.value,startIcon:o.jsx(Gg,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),options:l.options.map(J=>({...J,icon:o.jsx(Gg,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"})})),onChange:J=>{J!==l.value&&l.onChange(J)}}),o.jsx(Ko,{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(Dw,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}):o.jsx(E1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"}),options:[{value:"chat",label:"No project",icon:o.jsx(Dw,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"})},...e.organized.projects.map(J=>({value:J.project.path,label:J.project.name,icon:o.jsx(E1,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted"})}))],onChange:J=>i(J==="chat"?{kind:"chat"}:{kind:"project",path:J})}),s.kind==="project"?o.jsx(_fe,{value:g,onChange:y,isDisabled:!a}):null]})})]})]})})}const nS=new WeakMap;function rhe(e){let t=nS.get(e);return t===void 0&&(t=new TI(n=>e.controller.listCommands(n),n=>`conversation:${n}`,n=>n.commands),nS.set(e,t)),t}const ohe=e=>new RegExp("^\\/\\P{White_Space}*$","u").test(e);function ahe(e,t){return e.filter(n=>n.name.startsWith(t)).map(n=>({id:`command:${n.name}`,label:n.name,auxiliaryData:n}))}function lhe(e,t,n,s,i){const{items:r,request:a}=zI(rhe(e),t,s),l=h.useRef(r);l.current=r;const c=h.useRef(a);c.current=a;const u=s&&ohe(i),d=h.useMemo(()=>{if(!u)return;let f="";return{character:"/",searchSource:{bootstrap:()=>[],search:x=>(f=x,c.current(),ahe(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(a2,{"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,r]);return h.useEffect(()=>{var f;d!==void 0&&((f=n.current)==null||f.emitInput())},[d,n]),{trigger:d,commands:r,request:a}}const sm='<skill name="',sS='" location="',iS=`">
387
+ References are relative to `,rS=`
388
+ </skill>`,xy=`
389
+
390
+ `,che=e=>e>=48&&e<=57||e>=97&&e<=122||e===45;function uhe(e,t){if(!e.startsWith(sm,t))return-1;let n=t+sm.length;const s=n;for(;n<e.length&&che(e.charCodeAt(n));)n+=1;if(n===s||!e.startsWith(sS,n))return-1;n+=sS.length;const i=n;for(;n<e.length&&e[n]!=='"'&&e[n]!==`
391
+ `;)n+=1;if(n===i||!e.startsWith(iS,n))return-1;n+=iS.length;const r=e.indexOf(`
392
+ `,n);if(r-n<2||e[r-1]!=="."||e[r+1]!==`
393
+ `)return-1;const a=e.indexOf(rS,r+1);return a===-1?-1:a+rS.length}function dhe(e){const t=[];let n=0;for(;;){const s=uhe(e,n);if(s===-1||!e.startsWith(xy,s)||s+xy.length===e.length)return{text:e.slice(n),skills:t};t.push(e.slice(n+sm.length,e.indexOf('"',n+sm.length))),n=s+xy.length}}function A6(e){const t=[];let n="";if(typeof e=="string")n=e;else for(const i of e){if(i.type!=="text"||typeof i.text!="string")continue;const r=Tre(i.text);r!==void 0?t.push(...r):n+=i.text}const s=dhe(n);return{text:s.text,skills:s.skills,attachments:t}}function fhe(e){return typeof e=="string"||!Array.isArray(e)?0:e.filter(t=>t.type==="image").length}function hhe(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 phe=e=>e.docs["pi.live"]??{},M6=e=>e.docs["pi.agent"]??{};function xhe(e){var i;const t=phe(e),n=t.generation,s=(i=t.compactions)==null?void 0:i[0];if((n==null?void 0:n.retry)!==void 0)return`Retrying (attempt ${n.attempt+1}): ${n.retry.error}`;if((n==null?void 0:n.deferred)!==void 0)return"Waiting for deferred response...";if(s!==void 0){const r=s.trigger??s.reason;return s.retry?`Retrying ${r} compaction (attempt ${s.attempt+1})...`:`Compacting (${r})...`}return""}function ghe(e,t=[]){const s=(e.docs["pi.inbox"]??{items:[]}).items.flatMap(a=>{if(a.mode==="write")return[];const l=A6(a.content);return[{id:a.id,mode:a.mode,text:l.text,imageCount:fhe(a.content),attachmentCount:l.attachments.length,status:"sent"}]}),i=new Set(s.map(a=>String(a.id))),r=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&&i.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,...r]}function mhe(e,t){const s=(e.docs["pi.inbox"]??{items:[]}).items.find(r=>r.id===t);if(s===void 0||s.mode!=="steer"&&s.mode!=="followUp")return;const i=A6(s.content);return{text:i.text,images:hhe(s.content),skills:i.skills,attachments:i.attachments}}function vhe(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 yhe=new RegExp("\\p{White_Space}","u"),gy=(e,t)=>yhe.test(e[t]);function khe(e,t){if(e.charCodeAt(0)!==47)return;let n=1;for(;n<e.length&&!gy(e,n);)n+=1;const s=e.slice(1,n);if(s===""||!t.some(a=>a.name===s))return;let i=n,r=e.length;for(;i<r&&gy(e,i);)i+=1;for(;r>i&&gy(e,r-1);)r-=1;return i===r?{name:s}:{name:s,args:e.slice(i,r)}}function bhe({body:e,mode:t,narrow:n=!1,isPending:s=!1,isEditDisabled:i=!1,editTooltip:r,status:a,isLocal:l=!1,reorder:c,dragState:u,onSteer:d,onRetry:f,onEdit:p,onWithdraw:x,className:g,...y}){const v=n?"":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",m=w=>{const S=w.key==="ArrowUp"?c==null?void 0:c.onMoveUp:w.key==="ArrowDown"?c==null?void 0:c.onMoveDown:void 0;S!==void 0&&(w.preventDefault(),S())},k=[f===void 0?null:o.jsx(ht,{label:"Retry this message",tooltip:"Retry",variant:"ghost",size:"sm",isDisabled:s,onClick:f,icon:o.jsx(C0,{"aria-hidden":"true"})},"retry"),p===void 0?null:o.jsx(ht,{label:l?"Edit this message":"Edit queued message",tooltip:i&&r!==void 0?r:"Edit",variant:"ghost",size:"sm",isDisabled:s||i,onClick:p,icon:o.jsx(Yb,{"aria-hidden":"true"})},"edit"),x===void 0?null:o.jsx(ht,{label:"Withdraw queued message",tooltip:"Withdraw",variant:"ghost",size:"sm",isDisabled:s,onClick:x,icon:o.jsx(j0,{"aria-hidden":"true"})},"withdraw")].filter(w=>w!==null);return o.jsxs("div",{className:`chat-queued-message group flex min-h-10 min-w-0 items-center gap-1 rounded-lg border border-border bg-surface p-1 text-sm ${g??""}`.trim(),"data-testid":"chat-queued-message","data-local":l?"":void 0,"data-dragging":u==="dragging"?"":void 0,"data-drop-target":u==="before"||u==="after"?u:void 0,...y,children:[c===void 0?o.jsx("span",{className:"w-6 shrink-0"}):o.jsx("button",{ref:c.handleRef,type:"button",className:"chat-queued-message__handle flex h-7 w-6 shrink-0 cursor-grab items-center justify-center rounded-md text-muted active:cursor-grabbing","aria-label":"Reorder queued message","aria-description":"Drag, or press the up and down arrow keys",title:"Drag to reorder",onKeyDown:m,onPointerDown:c.onHandlePointerDown,onBlur:c.onHandleBlur,children:o.jsx(mee,{"aria-hidden":"true",className:"size-4"})}),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 text-xs leading-4","data-slot":"queued-message-status",children:a}),k.length===0?null:o.jsx("span",{className:`flex shrink-0 items-center gap-1 transition-opacity ${l?"":v}`,children:k}),l?null:o.jsx("span",{className:"flex w-7 shrink-0 items-center justify-center text-muted","data-slot":"queued-message-mode","data-mode":t,children:t==="steer"?o.jsx("span",{title:"Steer: lands at the next boundary in this run",role:"img","aria-label":"Steer",children:o.jsx(Ow,{"aria-hidden":"true",className:"size-4"})}):d===void 0?null:o.jsx("span",{className:`flex transition-opacity ${v}`,children:o.jsx(ht,{label:"Steer the run with this message",tooltip:"Steer now",variant:"ghost",size:"sm",isDisabled:s,onClick:d,icon:o.jsx(Ow,{"aria-hidden":"true"})})})})]})}function oS(e,t,n,s){var a;if(s==="before")return n;const i=e.filter(l=>l.id!==void 0&&l.id!==t&&l.mode!=="write"),r=i.findIndex(l=>l.id===n);return(a=i[r+1])==null?void 0:a.id}const b4=e=>e.id===void 0?`local:${e.requestId}`:String(e.id);function whe(e){var f;const t=h.useRef([]),[n,s]=h.useState(),i=e.map(b4),r=i.join(" "),a=t.current,c=a.length===i.length&&a.join(" ")!==r&&i.every(p=>a.includes(p))&&n!==r&&typeof document<"u"&&typeof document.startViewTransition=="function"&&document.visibilityState==="visible"&&!((f=window.matchMedia)!=null&&f.call(window,"(prefers-reduced-motion: reduce)").matches),u=c?a.map(p=>e.find(x=>b4(x)===p)):e,d=h.useRef(void 0);return h.useLayoutEffect(()=>{if(!c){t.current=i;return}if(d.current===r)return;d.current=r,document.startViewTransition(()=>{Gd.flushSync(()=>s(r)),t.current=i}).finished.finally(()=>{d.current===r&&(d.current=void 0)})}),u}function jhe(e){if(e==="unknown")return o.jsx("span",{className:"text-muted",children:"Not confirmed"});if(e==="failed")return o.jsx("span",{className:"text-danger",children:"Failed to send"})}function She({items:e,canAct:t,canReorder:n,busy:s,editDisabled:i,editTooltip:r,editRetryId:a,narrow:l,pendingIds:c,pendingRequestIds:u,onSteer:d,onRetry:f,onEdit:p,onWithdraw:x,onReorder:g}){const[y,v]=h.useState(),m=h.useRef(void 0),k=T=>{m.current=T,v(T)},[w,S]=h.useState(),E=whe(e),A=h.useId().replace(/[^a-zA-Z0-9]/g,""),z=h.useRef(void 0),N=h.useRef(new Map);if(h.useEffect(()=>{const T=z.current;if(T===void 0)return;const O=N.current.get(T);O!==void 0&&(document.activeElement===null||document.activeElement===document.body)&&O.focus(),(O===void 0||document.activeElement===O)&&(z.current=void 0)},[E]),e.length===0)return null;const M=T=>{const O=[...T.imageCount===0?[]:[`${T.imageCount} ${T.imageCount===1?"image":"images"}`],...T.attachmentCount===0?[]:[`${T.attachmentCount} ${T.attachmentCount===1?"file":"files"}`]];if(O.length===0)return T.text;const H=O.join(" · ");return T.text===""?H:`${T.text} · ${H}`},$=T=>t&&n&&T.id!==void 0&&T.mode!=="write",R=T=>e.filter(O=>$(O)&&O.mode===T.mode),_=()=>e.find(T=>{var O;return T.id===((O=m.current)==null?void 0:O.id)});return o.jsx("div",{className:"mx-auto mb-3 grid w-full gap-1.5","data-testid":"queued-message-list",children:E.map(T=>{const O=T.id===void 0,H=!O&&t&&T.mode!=="write",L=O&&(T.status==="unknown"||T.status==="failed"),B=O?T.status==="failed":H,I=O?T.requestId!==void 0&&u.has(T.requestId):c.has(T.id),D=T.id,q=R(T),U=q.findIndex(Z=>Z.id===D),X=(Z,ne)=>{if(!(D===void 0||(Z==null?void 0:Z.id)===void 0))return()=>{z.current=D,g(T,oS(e,D,Z.id,ne))}};return o.jsx(bhe,{"data-testid":O?"local-queued-message":"chat-queued-message",style:{viewTransitionName:`queued-${A}-${b4(T).replace(/[^a-zA-Z0-9-]/g,"")}`,viewTransitionClass:"queued-card"},body:M(T),mode:T.mode,status:O?jhe(T.status):void 0,isLocal:O,narrow:l,isPending:I,isEditDisabled:B&&i&&(O||D!==a),editTooltip:i?r:void 0,reorder:$(T)&&D!==void 0?{onMoveUp:X(q[U-1],"before"),onMoveDown:X(q[U+1],"after"),onHandlePointerDown:()=>S(D),handleRef:Z=>{Z===null?N.current.delete(D):N.current.set(D,Z)},onHandleBlur:Z=>{Z.relatedTarget!==null&&(z.current=void 0)}}:void 0,dragState:D===void 0||y===void 0?void 0:y.id===D?"dragging":y.over===D?y.side:void 0,draggable:w!==void 0&&w===D,onPointerUp:()=>S(void 0),onPointerCancel:()=>S(void 0),onDragStart:Z=>{D===void 0||w!==D||!$(T)||(Z.dataTransfer.effectAllowed="move",Z.dataTransfer.setData("text/plain",T.text),k({id:D}))},onDragOver:Z=>{const ne=_();if((ne==null?void 0:ne.id)===void 0||D===void 0||ne.id===D||ne.mode!==T.mode||!$(T))return;Z.preventDefault();const Y=Z.currentTarget.getBoundingClientRect(),ae=Z.clientY<Y.top+Y.height/2?"before":"after",le=m.current;((le==null?void 0:le.over)!==D||le.side!==ae)&&k({id:ne.id,over:D,side:ae})},onDrop:Z=>{Z.preventDefault();const ne=_(),Y=m.current;(ne==null?void 0:ne.id)!==void 0&&(Y==null?void 0:Y.over)!==void 0&&Y.side!==void 0&&g(ne,oS(e,ne.id,Y.over,Y.side)),k(void 0),S(void 0)},onDragEnd:()=>{k(void 0),S(void 0)},onSteer:H&&T.mode==="followUp"&&s?()=>d(T):void 0,onRetry:L?()=>f(T):void 0,onEdit:B?()=>p(T):void 0,onWithdraw:H?()=>x(T):void 0},O?`local:${T.requestId}`:D)})})}async function Che(e,t,n){try{return await Promise.all(e.map(s=>oJ(s,t,n)))}catch{return}}function Ehe({view:e,remote:t,conversation:n,busy:s,narrow:i,takeBack:r,onTakeBack:a,externalEditLocked:l=!1,onEditorStateChange:c,source:u}){var Rs,Cr,ir,ai,Er,Te,tn,bs,ue,_e,Ye,Kt,cn,he;const d=E6(Cfe(n.conversation.id)),f=II(d),{value:p,setValue:x}=f,[g,y]=h.useState(0),[v,m]=h.useState(!1),k=h.useRef(e.connection);k.current=e.connection;const w=zf(),S=M6(n),E=xhe(n),A=e.connection!=="connected",z=n.conversation.id,N=h.useRef(null),M=((Rs=e.home)==null?void 0:Rs.kind)!=="chat"&&Je(((Cr=e.host)==null?void 0:Cr.protocol.minor)??0,"listFiles")?{key:`conversation:${n.conversation.id}`,list:ee=>t.controller.listFiles({kind:"conversation",conversationId:n.conversation.id},ee)}:void 0,$=MI(e.agents,N,M),R=RI(t,{kind:"conversation",conversationId:n.conversation.id},N,!A&&Je(((ir=e.host)==null?void 0:ir.protocol.minor)??0,"listSkills"),f.pick);LI(N,f.draft);const _=Je(((ai=e.host)==null?void 0:ai.protocol.minor)??0,"listCommands"),T=lhe(t,n.conversation.id,N,!A&&_,p),O=[...$??[],...R.trigger===void 0?[]:[R.trigger],...T.trigger===void 0?[]:[T.trigger]],H=ghe(n,e.submissions??[]),L=((Er=e.agents)==null?void 0:Er.roles)??[],B=(Te=to(e.organized,n.conversation.id))==null?void 0:Te.summary,I=B==null?void 0:B.role,D=az(B),q=B!==void 0&&B.kind!=="subagent"&&e.agents!==null&&Je(((tn=e.host)==null?void 0:tn.protocol.minor)??0,"setAgent"),U=Ei(e.models,S.model),X=(U==null?void 0:U.images)===!0,{images:Z,pending:ne,error:Y,add:ae,restore:le,remove:re,clear:ge}=qI(X,d),be=Ct(((bs=e.host)==null?void 0:bs.protocol.minor)??0,"attachments")&&Je(((ue=e.host)==null?void 0:ue.protocol.minor)??0,"beginAttachment"),me=DI(t,be,d),je=h.useRef(null),[we,ye]=h.useState(void 0),J=ee=>{const{images:Me,others:ze}=CI(ee);ye(void 0),Me.length>0&&ae(Me),ze.length>0&&me.add(ze)},[Se,ke]=h.useState(void 0);h.useEffect(()=>ke(void 0),[p,Z.length,me.entries.length]);const Ce=T.commands===void 0?"Loading…":T.commands.length===0?"None on this host":p.trim()!==""||Z.length>0||me.entries.length>0||ne||me.uploading?"Clear the message first":void 0,Ee=h.useRef(null),xe=X||A?void 0:`${(U==null?void 0:U.name)??((_e=S.model)==null?void 0:_e.modelId)??"This model"} can't see images`,[xt,st]=h.useState([]),Gt=h.useRef(new Set),[Wt,Jt]=h.useState([]),_s=h.useRef(new Set),[Rt,Ke]=h.useState(!1),Mn=(ee,Me)=>Gt.current.has(ee)?!1:(Gt.current.add(ee),st(ze=>[...ze,{id:ee,kind:Me}]),!0),P=ee=>{Gt.current.delete(ee),st(Me=>Me.filter(ze=>ze.id!==ee))},F=new Set(xt.map(ee=>ee.id)),Q=xt.some(ee=>ee.kind==="edit"),de=p.trim()!==""||Z.length>0||me.entries.length>0||ne,fe=de||Q||v||Rt||l,$e=de?"Clear the composer to edit":fe?"Finish the current edit first":void 0,Ae=Q||v||Rt||l;h.useEffect(()=>{c==null||c({occupied:de,locked:Q||v||Rt})},[de,Q,v,Rt,c]);const Ue=!A&&Je(((Ye=e.host)==null?void 0:Ye.protocol.minor)??0,"withdrawQueued"),St=!A&&Je(((Kt=e.host)==null?void 0:Kt.protocol.minor)??0,"reorderQueued"),He=ee=>{w({body:ee instanceof Error?ee.message:String(ee),type:"error"})},at=async(ee,Me)=>{if(!_s.current.has(ee)){_s.current.add(ee),Jt(ze=>[...ze,ee]);try{await Me()}catch(ze){He(ze)}finally{_s.current.delete(ee),Jt(ze=>ze.filter(dt=>dt!==ee))}}},ln=ee=>{at(ee,()=>t.controller.retrySubmission(ee))},Le=ee=>{fe||(Ke(!0),at(ee,async()=>{const Me=await t.controller.takeBackSubmission(ee);Me!==void 0&&(f.restore(Me.text,Me.skills),le(Me.images.flatMap(ze=>"data"in ze?[ze]:[])),me.restore(Me.attachmentDetails??[]),y(ze=>ze+1))}).finally(()=>Ke(!1)))},gt=async ee=>{const Me=ee.id;if(!(Me===void 0||!Mn(Me,"withdraw")))try{await t.controller.withdrawQueued(Me,z)==="sent"&&w({body:"Already sent — can't withdraw"})}catch(ze){He(ze)}finally{P(Me)}},Gs=async ee=>{const Me=ee.id;if(!(Me===void 0||!Mn(Me,"steer")))try{await t.controller.steerQueued(Me,z)}catch(ze){He(ze)}finally{P(Me)}},en=async(ee,Me)=>{const ze=ee.id;if(!(ze===void 0||!Mn(ze,"reorder")))try{await t.controller.reorderQueued(ze,Me,z)}catch(dt){He(dt)}finally{P(ze)}},It=h.useRef(null),Ti=async ee=>{if(Mn(ee.id,"edit"))try{const Me=await Che(ee.input.images,ze=>t.controller.image(ze),u);if(Me===void 0){It.current=null,m(!1),w({body:"Couldn't load the original images — try again",type:"error"});return}await Yz(Me),ee.input={...ee.input,images:Me},await t.controller.withdrawQueued(ee.id,ee.conversationId)==="withdrawn"?(f.restore(ee.input.text,ee.input.skills),le(Me),me.restore(ee.input.attachments),It.current=null,m(!1),y(ze=>ze+1)):(It.current=null,m(!1),w({body:"Already sent — can't withdraw"}))}catch(Me){He(Me),k.current=t.view.current().connection,k.current==="connected"?(It.current=null,m(!1)):m(!0)}finally{P(ee.id)}},oi=async ee=>{var nn;if(ee.id===void 0){ee.requestId!==void 0&&Le(ee.requestId);return}const ze=(((nn=It.current)==null?void 0:nn.id)===ee.id&&It.current.conversationId===z?It.current.input:void 0)??mhe(n,ee.id);if(ze===void 0)return;const dt={conversationId:z,id:ee.id,input:ze};It.current=dt,await Ti(dt)};h.useEffect(()=>{if(e.connection!=="connected"||!v)return;const ee=It.current;ee===null||ee.conversationId!==z||Gt.current.has(ee.id)||Ti(ee)},[e.connection,v,z]),h.useEffect(()=>{var ee;g>0&&((ee=N.current)==null||ee.focusAtEnd())},[g]),h.useEffect(()=>{r!==void 0&&(f.restore(r.text,r.skills),le(r.images.flatMap(ee=>"data"in ee?[ee]:[])),me.restore(r.attachmentDetails??[]),y(ee=>ee+1),a==null||a())},[r]);const sr=ee=>{var Df,Bf;const Me=SI(f.draft),ze=Me.text.trim();if(Ae||me.uploading||ze===""&&Z.length===0&&me.entries.length===0||ne)return;const dt=T.commands===void 0?void 0:khe(Me.text,T.commands);if(dt!==void 0){const Sl=(Bf=(Df=T.commands)==null?void 0:Df.find(N0=>N0.name===dt.name))==null?void 0:Bf.disabled;if(Sl!==void 0){ke(Sl);return}if(Z.length>0){ke("Commands can't include images");return}if(me.entries.length>0){ke("Commands can't include files");return}t.controller.runCommand(dt.name,dt.args),x("");return}if(o2(),me.failed){ye("Some files failed to upload — retry or remove them");return}const nn=Z,$r=me.ids(),la=me.details();t.controller.submit(ze,ee,{images:nn,...nn.some(Sl=>!("data"in Sl))?{imageViews:nn}:{},skills:Me.skills,...$r.length===0?{}:{attachments:$r},...la.length===0?{}:{attachmentDetails:la}}),x(""),ge(),me.clear(),ye(void 0)};return o.jsxs(o.Fragment,{children:[E===""&&!me.uploading?null:o.jsx(W,{type:"supporting",children:me.uploading?"Uploading files…":E}),o.jsx(She,{items:H,canAct:Ue,canReorder:St,busy:s,editDisabled:fe,editTooltip:$e,editRetryId:v?(cn=It.current)==null?void 0:cn.id:void 0,narrow:i,pendingIds:F,pendingRequestIds:new Set(Wt),onSteer:ee=>void Gs(ee),onRetry:ee=>{ee.requestId!==void 0&&ln(ee.requestId)},onEdit:ee=>void oi(ee),onWithdraw:ee=>void gt(ee),onReorder:(ee,Me)=>void en(ee,Me)}),o.jsx(BI,{inputRef:Ee,onFiles:Ae?()=>{}:ae}),o.jsx($6,{inputRef:je,onFiles:Ae?()=>{}:J}),o.jsx(VI,{value:p,inputRef:N,status:s?"streaming":"ready",isDisabled:A||Ae,placeholder:s?"Steer the running turn…":GI("Ask",{agents:L.length>0,files:M!==void 0,commands:_,skills:R.trigger!==void 0}),onValueChange:x,onSubmit:()=>sr("steer"),onFocus:()=>{R.request(),T.request()},triggers:O.length===0?void 0:O,onStop:s?()=>void t.controller.abort():void 0,attachments:HI({images:Z,pending:ne,onRemove:re,...me.entries.length===0?{}:{files:o.jsx(o.Fragment,{children:me.entries.map(ee=>o.jsx(OI,{entry:ee,onRetry:me.retry,onRemove:me.remove},ee.key))})}}),hasAttachments:Z.length>0||me.entries.length>0,onFiles:Ae?void 0:J,error:Se??Y??me.error??we,submitDisabled:me.uploading||me.failed,startActions:o.jsxs(o.Fragment,{children:[o.jsxs(FI,{isDisabled:A||Ae,onOpenChange:ee=>{ee&&T.request(!0)},children:[o.jsx(Kr,{icon:Zb,label:"Add images",hint:xe??"Or paste or drop",isDisabled:!X,onClick:()=>{var ee;return(ee=Ee.current)==null?void 0:ee.click()}}),be?o.jsx(Kr,{icon:Nf,label:"Attach files",hint:"Up to 10 · 10 MB each",onClick:()=>{var ee;return(ee=je.current)==null?void 0:ee.click()}}):null,R.trigger===void 0?null:o.jsx(Kr,{icon:l2,label:"Use a skill",hint:"Or type $",onClick:()=>{var ee;return(ee=N.current)==null?void 0:ee.openTrigger("$")}}),L.length===0?null:o.jsx(Kr,{icon:w0,label:"Mention an agent",hint:"Or type @",onClick:()=>{var ee;return(ee=N.current)==null?void 0:ee.openTrigger("@")}}),_?o.jsx(Kr,{icon:a2,label:"Run a command",hint:Ce??"Or type /",isDisabled:Ce!==void 0,onClick:()=>{var ee;return(ee=N.current)==null?void 0:ee.openTrigger("/")}}):o.jsx(Kr,{icon:sN,label:"Compact conversation",hint:"Frees up context",onClick:()=>void t.controller.compact(void 0)})]}),o.jsx(PI,{models:e.models,selected:{model:S.model,level:S.thinkingLevel??"off"},isDisabled:A,agent:q?{kind:"pick",roles:L,value:D,onChange:ee=>{t.controller.setAgent(ee??null).catch(He)}}:I===void 0?void 0:{kind:"fixed",name:I,description:(he=L.find(ee=>ee.name===I))==null?void 0:he.description},onModelChange:ee=>void t.controller.setModel(ee),onLevelChange:ee=>void t.controller.setThinkingLevel(ee)})]}),endActions:s&&(p.trim()!==""||Z.length>0||me.entries.length>0)?o.jsx(K,{label:"Follow-up",variant:"ghost",size:i?"md":"sm",tooltip:"Queue after the running turn",isDisabled:A||ne||Ae||me.uploading||me.failed,onClick:()=>sr("followUp")}):null})]})}function $he(e,t){return e!==void 0&&e.conversationId===t?e.draft:void 0}const Ahe=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,Mhe=/^\+\s*\d+ /,The=/^-\s*\d+ /;function zhe(e){let t=0,n=0,s=0,i=0,r=!1;for(const a of e.split(`
394
+ `)){const l=Ahe.exec(a);if(l){s=Number.parseInt(l[2]??"1",10),i=Number.parseInt(l[4]??"1",10),r=!0;continue}if(!r)continue;if(s===0&&i===0){r=!1;continue}const c=a.charAt(0);c===" "?(s-=1,i-=1):c==="-"?(s-=1,n+=1):c==="+"&&(i-=1,t+=1)}return{additions:t,deletions:n}}function Nhe(e){let t=0,n=0;for(const s of e.split(`
395
+ `))Mhe.test(s)?t+=1:The.test(s)&&(n+=1);return{additions:t,deletions:n}}function _he(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:i}=n,r=typeof s=="string"?zhe(s):typeof i=="string"?Nhe(i):void 0;return r!==void 0&&(r.additions>0||r.deletions>0)?r:void 0}function T6(e){return e.pinomad}function Rhe(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 Px(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Ihe(e){return typeof e=="string"?e:e.flatMap(t=>t.type==="text"&&t.text!==void 0?[t.text]:[]).join("")}function WI(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 uc=e=>e.type==="toolCall"&&e.id!==void 0;function Lhe(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 Ohe(e){if(typeof e!="object"||e===null)return;const t=e.conversationId;return typeof t=="number"?t:void 0}function Dhe(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,i=e.details===void 0?void 0:jl(t[e.name],e.details),r=(i==null?void 0:i.type)==="pinomad.diff"?{kind:"diff",patch:i.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},...r===void 0?{}:{pinomad:r}}}function Bhe(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 Hhe(e,t,n,s,i){const r=e.id,a=t.results.get(r),l=t.partial?void 0:n.get(r),c=(l==null?void 0:l.name)??e.name,u=Lhe(e.arguments,c);let d,f;a!==void 0?(d=a.isError===!0?"output-error":"output-available",f=Ihe(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:jl(i[c??""],p),g=a!==void 0&&a.isError!==!0?_he({details:a.details}):void 0,y=a===void 0?[]:WI(a.content),v=Ohe(p);let m,k;if((x==null?void 0:x.type)==="pinomad.diff")m={kind:"diff",patch:x.value.patch};else if(v!==void 0){const w=p;m={kind:"subagent",conversationId:v,...f===void 0?{}:{output:f},...typeof w.model=="string"?{model:w.model}:{},...typeof w.startedAt=="number"?{startedAt:w.startedAt}:{},...typeof(a==null?void 0:a.timestamp)=="number"?{endedAt:a.timestamp}:{},...typeof w.branch=="string"?{branch:w.branch}:{}}}return c==="codemode"&&a===void 0?k=(s.get(r)??[]).map(Bhe):(x==null?void 0:x.type)==="pinomad.codemode"&&(k=x.value.calls.map(w=>Dhe(w,i))),{state:d,toolCallId:r,...c===void 0?{}:{toolName:c},...u===void 0?{}:{argsText:u},...f===void 0?{}:{output:f},...g===void 0?{}:{diffStat:g},...y.length===0?{}:{images:y},...k===void 0||k.length===0?{}:{children:k},...m===void 0?{}:{pinomad:m}}}function qhe(e){const t=e==null?void 0:e.calls;return Array.isArray(t)&&t.some(n=>n.name==="todo_write"&&n.status==="ok")}function Phe(e){const t=[];for(const n of e)if(uc(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 Uhe(e,t,n,s,i){var L,B,I;const r=new Map(((L=s?n.tools:void 0)==null?void 0:L.map(D=>[D.callId,D]))??[]),a=new Map;if(s)for(const D of n.nestedTools??[]){if(D.name.startsWith("pi."))continue;const q=a.get(D.parentCallId);q===void 0?a.set(D.parentCallId,[D]):q.push(D)}const l=s?(B=n.generation)==null?void 0:B.message:void 0,c=new Map,u=[...t.assistants.map(({id:D,msg:q,results:U})=>({id:D,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(D=>D.type==="text")).map(D=>D.text??"").join(""),y=(d==null?void 0:d.msg.content.some(uc))===!0,v=g!==""&&(p||!y),m=(D,q)=>uc(q)&&!D.results.has(q.id)&&(D.partial===!0||D.msg.stopReason==="toolUse"),k=u.some(D=>D.msg.content.some(q=>m(D,q))),w=d==null?void 0:d.msg.content[d.msg.content.length-1];let S;p?S="settled":v?S="answering":k||w!==void 0&&uc(w)?S="acting":u.length>0?S="thinking":S="hidden";const E=S==="thinking"||S==="acting",A=[];for(const D of u){const q=D===d,U=D.msg.content;Phe(U).forEach((X,Z)=>{if(X.kind==="tools"){const Y=X.blocks.filter(le=>m(D,le)),ae=E&&Y.length>0;A.push({kind:"tools",id:`${D.id}-tools-${Z}`,tools:X.blocks.map(le=>Hhe(le,D,r,a,i)),live:ae,...ae&&Y[0]!==void 0?{activeToolCallId:Y[0].id}:{}});return}if(X.kind==="text"){q&&v||A.push({kind:"interim",id:`${D.id}-text-${Z}`,text:X.block.text??""});return}const ne=U.indexOf(X.block);A.push({kind:"thinking",id:`${D.id}-thinking-${Z}`,text:X.block.thinking??"",live:E&&D.partial===!0&&ne===U.length-1})})}let z;for(const D of u)for(const q of D.msg.content){if(!uc(q))continue;const U=D.results.get(q.id);U===void 0||typeof U.timestamp!="number"||(q.name==="todo_write"?U.isError!==!0:q.name==="codemode"&&qhe(U.details))&&(z=U.timestamp)}const N=(f==null?void 0:f.msg.stopReason)==="aborted",M=p&&(f==null?void 0:f.msg.stopReason)==="error",$=f===void 0?void 0:Px(f.msg.timestamp),R=f===void 0?void 0:Px(f.msg.durationMs),_=p&&$!==void 0?Px($+(R??0)):void 0,T=(I=u[0])==null?void 0:I.msg.timestamp,O=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 H;if(p&&T!==void 0){let D;v?D=(d===void 0?void 0:Rhe(d.msg))??(d===u[0]||d==null?void 0:d.msg.timestamp):D=t.lastTs??(d==null?void 0:d.msg.timestamp),H=D===void 0?void 0:D-T}return{kind:"run",id:e,cot:{phase:S,...M===!0?{outcome:"failed"}:{},...T===void 0?{}:{anchorMs:T},...H===void 0?{}:{elapsedMs:H},...z===void 0?{}:{todoWrittenAtMs:z},...O===void 0?{}:{model:O},steps:A,...v?{answer:{text:g,streaming:(d==null?void 0:d.partial)===!0}}:{}},interrupted:N,...p&&!N&&M!==!0&&f!==void 0?{forkEntryId:f.id}:{},...M===!0?{failure:(f==null?void 0:f.msg.errorMessage)??"The run failed."}:{},..._===void 0?{}:{endedAt:_}}}function Fhe(e,t,n,s=[],i={}){var p;const r=[],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 y=((g=l.assistants[0])==null?void 0:g.id)??`open-${c++}`;r.push(Uhe(`run-${y}`,l,a,x,t))}l=void 0}};for(const x of e.entries){const g=(p=x.model)==null?void 0:p[0],y=String(x.id);if(x.kind==="pi.user"&&(g==null?void 0:g.role)==="user"){u(!1);const v=A6(g.content),m=Px(g.timestamp);r.push({kind:"user",id:y,text:v.text,images:WI(g.content),skills:v.skills,attachments:v.attachments,...m===void 0?{}:{timestamp:m}})}else if(x.kind==="pi.compaction")u(!1),r.push({kind:"compaction",id:y});else if(x.kind==="pi.reset")u(!1),r.push({kind:"reset",id:y});else if(x.kind==="pi.assistant"&&(g==null?void 0:g.role)==="assistant"){l??(l={assistants:[],orphans:new Map});const v=new Map;for(const m of g.content){if(!uc(m))continue;const k=l.orphans.get(m.id);k!==void 0&&(l.orphans.delete(m.id),v.set(m.id,k))}l.assistants.push({id:y,msg:g,results:v}),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 v=l.assistants.findLast(m=>!m.results.has(g.toolCallId)&&m.msg.content.some(k=>uc(k)&&k.id===g.toolCallId));v===void 0?l.orphans.set(g.toolCallId,g):v.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 r)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"||i.mergeQueuedSubmissions===!0&&x.placement==="queue";if(x.phase==="settled"||!g||x.conversationId!==void 0&&x.conversationId!==f)continue;const y=x.phase==="unknown"?"unknown":x.phase==="failed"?"failed":"sending";r.push({kind:"user",id:`local:${x.requestId}`,text:x.text,images:x.imageViews??x.images.flatMap(v=>"data"in v?[v]:[]),attachments:x.attachmentDetails??[],skills:x.skills,status:y,local:{requestId:x.requestId,...x.error===void 0?{}:{error:x.error}}})}return r}function Vhe(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 Ghe(e){const t=[],n=[];for(const s of e.steps){if(s.kind!=="tools"){n.push(s);continue}const i=[];if(s.tools.forEach((r,a)=>{if(r.toolName!=="subagent"){i.push(r);return}t.push({key:`${s.id}/${r.toolCallId??a}`,tool:r})}),i.length!==0)if(s.activeToolCallId!==void 0&&!i.some(r=>r.toolCallId===s.activeToolCallId)){const r=i.find(a=>a.state==="input-streaming"||a.state==="input-available");if(r===void 0){const{activeToolCallId:a,...l}=s;n.push({...l,tools:i,live:!1})}else n.push({...s,tools:i,...r.toolCallId===void 0?{}:{activeToolCallId:r.toolCallId}})}else n.push({...s,tools:i})}return{view:{...e,steps:n},subagents:t}}const aS={};function z0(e,t){const n=h.useRef(aS);return n.current===aS&&(n.current=e(t)),n}const my=sC[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Whe=my&&my!==h.useLayoutEffect?my:e=>e();function Jc(e){const t=z0(Khe).current;return t.next=e,Whe(t.effect),t.trampoline}function Khe(){const e={next:void 0,callback:Xhe,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Xhe(){}function z6(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 w4(e,t,n,s){const i=z0(KI).current;return Yhe(i,e,t,n,s)&&XI(i,[e,t,n,s]),i.callback}function Zhe(e){const t=z0(KI).current;return Qhe(t,e)&&XI(t,e),t.callback}function KI(){return{callback:null,cleanup:null,refs:[]}}function Yhe(e,t,n,s,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==i}function Qhe(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function XI(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 i=0;i<t.length;i+=1){const r=t[i];if(r!=null)switch(typeof r){case"function":{const a=r(n);typeof a=="function"&&(s[i]=a);break}case"object":{r.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const r=t[i];if(r!=null)switch(typeof r){case"function":{const a=s[i];typeof a=="function"?a():r(null);break}case"object":{r.current=null;break}}}}}}}const Jhe=parseInt(h.version,10);function e1e(e){return Jhe>=e}function lS(e){if(!h.isValidElement(e))return null;const t=e,n=t.props;return(e1e(19)?n==null?void 0:n.ref:t.ref)??null}function j4(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function t1e(e,t){const n={};for(const s in e){const i=e[s];if(t!=null&&t.hasOwnProperty(s)){const r=t[s](i);r!=null&&Object.assign(n,r);continue}i===!0?n[`data-${s.toLowerCase()}`]="":i&&(n[`data-${s.toLowerCase()}`]=i.toString())}return n}function n1e(e,t){return typeof e=="function"?e(t):e}function s1e(e,t){return typeof e=="function"?e(t):e}const Jh={};function ZI(e,t,n,s,i){let r={...S4(e,Jh)};return t&&(r=Ux(r,t)),n&&(r=Ux(r,n)),s&&(r=Ux(r,s)),r}function i1e(e){if(e.length===0)return Jh;if(e.length===1)return S4(e[0],Jh);let t={...S4(e[0],Jh)};for(let n=1;n<e.length;n+=1)t=Ux(t,e[n]);return t}function Ux(e,t){return YI(t)?t(e):r1e(e,t)}function r1e(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=j4(e.style,s);break}case"className":{e[n]=QI(e.className,s);break}default:o1e(n,s)?e[n]=a1e(e[n],s):e[n]=s}}return e}function o1e(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&s===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function YI(e){return typeof e=="function"}function S4(e,t){return YI(e)?e(t):e??Jh}function a1e(e,t){return t?e?n=>{if(l1e(n)){const i=n;C4(i);const r=t(i);return i.baseUIHandlerPrevented||e==null||e(i),r}const s=t(n);return e==null||e(n),s}:t:e}function C4(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function QI(e,t){return t?e?t+" "+e:t:e}function l1e(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const nc=Object.freeze({});function N6(e,t,n={}){const s=t.render,i=c1e(t,n);if(n.enabled===!1)return null;const r=n.state??nc;return u1e(e,s,i,r)}function c1e(e,t={}){const{className:n,style:s,render:i}=e,{state:r=nc,ref:a,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?n1e(n,r):void 0,f=u?s1e(s,r):void 0,p=u?t1e(r,c):nc,x=u?j4(p,Array.isArray(l)?i1e(l):l)??nc:nc;return typeof document<"u"&&(u?Array.isArray(a)?x.ref=Zhe([x.ref,lS(i),...a]):x.ref=w4(x.ref,lS(i),a):w4(null,null)),u?(d!==void 0&&(x.className=QI(x.className,d)),f!==void 0&&(x.style=j4(x.style,f)),x):nc}function u1e(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const i=ZI(n,t.props);return i.ref=n.ref,h.cloneElement(t,i)}if(e&&typeof e=="string")return d1e(e,n);throw new Error(z6(8))}function d1e(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 f1e({controlled:e,default:t,name:n,state:s="value"}){const{current:i}=h.useRef(e!==void 0),[r,a]=h.useState(t),l=i?e:r,c=h.useCallback(u=>{i||a(u)},[]);return[l,c]}const h1e=()=>{},bi=typeof document<"u"?h.useLayoutEffect:h1e,p1e={...sC};let cS=0;function x1e(e,t="mui"){const[n,s]=h.useState(e),i=e||n;return h.useEffect(()=>{n==null&&(cS+=1,s(`${t}-${cS}`))},[n,t]),i}const uS=p1e.useId;function g1e(e,t){if(uS!==void 0){const n=uS();return`${t}-${n}`}return x1e(e,t)}function m1e(e){return g1e(e,"base-ui")}const v1e="none",y1e="trigger-press";function JI(e,t,n,s){let i=!1,r=!1;const a=nc;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){r=!0},get isCanceled(){return i},get isPropagationAllowed(){return r},trigger:n,...a}}const k1e=[];function eL(e){h.useEffect(e,k1e)}const Rp=null;class b1e{constructor(){ve(this,"callbacks",[]);ve(this,"callbacksCount",0);ve(this,"nextId",1);ve(this,"startId",1);ve(this,"isScheduled",!1);ve(this,"tick",t=>{var i;this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let r=0;r<n.length;r+=1)(i=n[r])==null||i.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 Ip=new b1e;class Cn{constructor(){ve(this,"currentId",Rp);ve(this,"cancel",()=>{this.currentId!==Rp&&(Ip.cancel(this.currentId),this.currentId=Rp)});ve(this,"disposeEffect",()=>this.cancel)}static create(){return new Cn}static request(t){return Ip.request(t)}static cancel(t){return Ip.cancel(t)}request(t){this.cancel(),this.currentId=Ip.request(()=>{this.currentId=Rp,t()})}}function tL(){const e=z0(Cn.create).current;return eL(e.disposeEffect),e}function w1e(e){return e==null?e:"current"in e?e.current:e}function nL(e,t=!1,n=!0){const s=tL();return Jc((i,r=null)=>{s.cancel();const a=w1e(e);a!=null&&(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?i():s.request(()=>{function l(){a&&Promise.all(a.getAnimations().map(c=>c.finished)).then(()=>{r!=null&&r.aborted||Gd.flushSync(i)}).catch(()=>{if(n){if(r!=null&&r.aborted)return;Gd.flushSync(i)}else a.getAnimations().length>0&&a.getAnimations().some(c=>c.pending||c.playState!=="finished")&&l()})}t?s.request(l):l()}))})}function j1e(e,t=!1,n=!1){const[s,i]=h.useState(e&&t?"idle":void 0),[r,a]=h.useState(e);return e&&!r&&(a(!0),i("starting")),!e&&r&&s!=="ending"&&!n&&i("ending"),!e&&!r&&s==="ending"&&i(void 0),bi(()=>{if(!e&&r&&s!=="ending"&&n){const l=Cn.request(()=>{i("ending")});return()=>{Cn.cancel(l)}}},[e,r,s,n]),bi(()=>{if(!e||t)return;const l=Cn.request(()=>{Gd.flushSync(()=>{i(void 0)})});return()=>{Cn.cancel(l)}},[t,e]),bi(()=>{if(!e||!t)return;e&&r&&s!=="idle"&&i("starting");const l=Cn.request(()=>{i("idle")});return()=>{Cn.cancel(l)}},[t,e,r,i,s]),h.useMemo(()=>({mounted:r,setMounted:a,transitionStatus:s}),[r,s])}function S1e(e){const{open:t,defaultOpen:n,onOpenChange:s,disabled:i}=e,r=t!==void 0,[a,l]=f1e({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:c,setMounted:u,transitionStatus:d}=j1e(a,!0,!0),[f,p]=h.useState(a),[{height:x,width:g},y]=h.useState({height:void 0,width:void 0}),v=m1e(),[m,k]=h.useState(),w=m??v,[S,E]=h.useState(!1),[A,z]=h.useState(!1),N=h.useRef(null),M=h.useRef(null),$=h.useRef(null),R=h.useRef(null),_=nL(R,!1),T=Jc(O=>{const H=!a,L=JI(y1e,O.nativeEvent);if(s(H,L),L.isCanceled)return;const B=R.current;M.current==="css-animation"&&B!=null&&B.style.removeProperty("animation-name"),!S&&!A&&(M.current!=null&&M.current!=="css-animation"&&!c&&H&&u(!0),M.current==="css-animation"&&(!f&&H&&p(!0),!c&&H&&u(!0))),l(H),M.current==="none"&&c&&!H&&u(!1)});return bi(()=>{r&&M.current==="none"&&!A&&!a&&u(!1)},[r,A,a,t,u]),h.useMemo(()=>({abortControllerRef:N,animationTypeRef:M,disabled:i,handleTrigger:T,height:x,mounted:c,open:a,panelId:w,panelRef:R,runOnceAnimationsFinish:_,setDimensions:y,setHiddenUntilFound:E,setKeepMounted:z,setMounted:u,setOpen:l,setPanelIdState:k,setVisible:p,transitionDimensionRef:$,transitionStatus:d,visible:f,width:g}),[N,M,i,T,x,c,a,w,R,_,y,E,z,u,l,p,$,d,f,g])}const sL=h.createContext(void 0);function iL(){const e=h.useContext(sL);if(e===void 0)throw new Error(z6(15));return e}let im=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const C1e={[im.startingStyle]:""},E1e={[im.endingStyle]:""},rL={transitionStatus(e){return e==="starting"?C1e:e==="ending"?E1e:null}};let e1=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=im.startingStyle]="startingStyle",e[e.endingStyle=im.endingStyle]="endingStyle",e}({}),$1e=function(e){return e.panelOpen="data-panel-open",e}({});const A1e={[e1.open]:""},M1e={[e1.closed]:""},T1e={open(e){return e?{[$1e.panelOpen]:""}:null}},z1e={open(e){return e?A1e:M1e}},oL={...z1e,...rL},v2=h.forwardRef(function(t,n){const{render:s,className:i,defaultOpen:r=!1,disabled:a=!1,onOpenChange:l,open:c,...u}=t,d=Jc(l),f=S1e({open:c,defaultOpen:r,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=N6("div",t,{state:p,ref:n,props:u,stateAttributesMapping:oL});return o.jsx(sL.Provider,{value:x,children:g})});function N1e(){return typeof window<"u"}function _1e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function R1e(e){return N1e()?e instanceof HTMLElement||e instanceof _1e(e).HTMLElement:!1}const I1e=h.createContext(void 0);function L1e(e=!1){const t=h.useContext(I1e);if(t===void 0&&!e)throw new Error(z6(16));return t}function O1e(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:i=0,isNativeButton:r}=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=i,!r&&n&&(u.tabIndex=t?i:-1)),(r&&(t||a)||!r&&n)&&(u["aria-disabled"]=n),r&&(!t||l)&&(u.disabled=n),u},[s,n,t,a,l,r,i])}}function D1e(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=e,r=h.useRef(null),a=L1e(!0)!==void 0,l=Jc(()=>{const p=r.current;return!!((p==null?void 0:p.tagName)==="A"&&(p!=null&&p.href))}),{props:c}=O1e({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:s,isNativeButton:i}),u=h.useCallback(()=>{const p=r.current;B1e(p)&&a&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,a]);bi(u,[u]);const d=h.useCallback((p={})=>{const{onClick:x,onMouseDown:g,onKeyUp:y,onKeyDown:v,onPointerDown:m,...k}=p;return ZI({type:i?"button":void 0,onClick(S){if(t){S.preventDefault();return}x==null||x(S)},onMouseDown(S){t||g==null||g(S)},onKeyDown(S){if(t||(C4(S),v==null||v(S)),S.baseUIHandlerPrevented)return;const E=S.target===S.currentTarget&&!i&&!l()&&!t,A=S.key==="Enter",z=S.key===" ";E&&((z||A)&&S.preventDefault(),A&&(x==null||x(S)))},onKeyUp(S){t||(C4(S),y==null||y(S)),!S.baseUIHandlerPrevented&&S.target===S.currentTarget&&!i&&!t&&S.key===" "&&(x==null||x(S))},onPointerDown(S){if(t){S.preventDefault();return}m==null||m(S)}},i?void 0:{role:"button"},c,k)},[t,c,i,l]),f=Jc(p=>{r.current=p,u()});return{getButtonProps:d,buttonRef:f}}function B1e(e){return R1e(e)&&e.tagName==="BUTTON"}const H1e={...T1e,...rL},y2=h.forwardRef(function(t,n){const{panelId:s,open:i,handleTrigger:r,state:a,disabled:l}=iL(),{className:c,disabled:u=l,id:d,render:f,nativeButton:p=!0,...x}=t,{getButtonProps:g,buttonRef:y}=D1e({disabled:u,focusableWhenDisabled:!0,native:p}),v=h.useMemo(()=>({"aria-controls":i?s:void 0,"aria-expanded":i,disabled:u,onClick:r}),[s,u,i,r]);return N6("button",t,{state:a,ref:[n,y],props:[v,x,g],stateAttributesMapping:H1e})});let q1e=function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e}({});function P1e(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:s,height:i,hiddenUntilFound:r,keepMounted:a,id:l,mounted:c,onOpenChange:u,open:d,panelRef:f,runOnceAnimationsFinish:p,setDimensions:x,setMounted:g,setOpen:y,setVisible:v,transitionDimensionRef:m,visible:k,width:w}=e,S=h.useRef(!1),E=h.useRef(null),A=h.useRef(d),z=h.useRef(d),N=tL(),M=h.useMemo(()=>n.current==="css-animation"?!k:!d&&!c,[d,c,k,n]),$=Jc(_=>{if(!_)return;if(n.current==null||m.current==null){const H=getComputedStyle(_),L=H.animationName!=="none"&&H.animationName!=="",B=H.transitionDuration!=="0s"&&H.transitionDuration!=="";L&&B||(H.animationName==="none"&&H.transitionDuration!=="0s"?n.current="css-transition":H.animationName!=="none"&&H.transitionDuration==="0s"?n.current="css-animation":n.current="none"),_.getAttribute(q1e.orientation)==="horizontal"||H.transitionProperty.indexOf("width")>-1?m.current="width":m.current="height"}if(n.current!=="css-transition")return;(i===void 0||w===void 0)&&(x({height:_.scrollHeight,width:_.scrollWidth}),z.current&&_.style.setProperty("transition-duration","0s"));let T=-1,O=-1;return T=Cn.request(()=>{z.current=!1,O=Cn.request(()=>{setTimeout(()=>{_.style.removeProperty("transition-duration")})})}),()=>{Cn.cancel(T),Cn.cancel(O)}}),R=w4(s,f,$);return bi(()=>{if(n.current!=="css-transition")return;const _=f.current;if(!_)return;let T=-1;if(t.current!=null&&(t.current.abort(),t.current=null),d){const O={"justify-content":_.style.justifyContent,"align-items":_.style.alignItems,"align-content":_.style.alignContent,"justify-items":_.style.justifyItems};Object.keys(O).forEach(H=>{_.style.setProperty(H,"initial","important")}),!z.current&&!a&&_.setAttribute(e1.startingStyle,""),x({height:_.scrollHeight,width:_.scrollWidth}),T=Cn.request(()=>{Object.entries(O).forEach(([H,L])=>{L===""?_.style.removeProperty(H):_.style.setProperty(H,L)})})}else{if(_.scrollHeight===0&&_.scrollWidth===0)return;x({height:_.scrollHeight,width:_.scrollWidth});const O=new AbortController;t.current=O;const H=O.signal;let L=null;const B=e1.endingStyle;return L=new MutationObserver(I=>{I.some(q=>q.type==="attributes"&&q.attributeName===B)&&(L==null||L.disconnect(),L=null,p(()=>{x({height:0,width:0}),_.style.removeProperty("content-visibility"),g(!1),t.current===O&&(t.current=null)},H))}),L.observe(_,{attributes:!0,attributeFilter:[B]}),()=>{L==null||L.disconnect(),N.cancel(),t.current===O&&(O.abort(),t.current=null)}}return()=>{Cn.cancel(T)}},[t,n,N,r,a,c,d,f,p,x,g]),bi(()=>{if(n.current!=="css-animation")return;const _=f.current;_&&(E.current=_.style.animationName||E.current,_.style.setProperty("animation-name","none"),x({height:_.scrollHeight,width:_.scrollWidth}),!A.current&&!S.current&&_.style.removeProperty("animation-name"),d?(t.current!=null&&(t.current.abort(),t.current=null),g(!0),v(!0)):(t.current=new AbortController,p(()=>{g(!1),v(!1),t.current=null},t.current.signal)))},[t,n,d,f,p,x,g,v,k]),eL(()=>{const _=Cn.request(()=>{A.current=!1});return()=>Cn.cancel(_)}),bi(()=>{if(!r)return;const _=f.current;if(!_)return;let T=-1,O=-1;return d&&S.current&&(_.style.transitionDuration="0s",x({height:_.scrollHeight,width:_.scrollWidth}),T=Cn.request(()=>{S.current=!1,O=Cn.request(()=>{setTimeout(()=>{_.style.removeProperty("transition-duration")})})})),()=>{Cn.cancel(T),Cn.cancel(O)}},[r,d,f,x]),bi(()=>{const _=f.current;_&&r&&M&&(_.setAttribute("hidden","until-found"),n.current==="css-transition"&&_.setAttribute(e1.startingStyle,""))},[r,M,n,f]),h.useEffect(function(){const T=f.current;if(!T)return;function O(H){S.current=!0,y(!0),u(!0,JI(v1e,H))}return T.addEventListener("beforematch",O),()=>{T.removeEventListener("beforematch",O)}},[u,f,y]),h.useMemo(()=>({props:{hidden:M,id:l,ref:R}}),[M,l,R])}let dS=function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e}({});function U1e(e){const t=z0(F1e,e).current;return t.next=e,bi(t.effect),t}function F1e(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function V1e(e){const{enabled:t=!0,open:n,ref:s,onComplete:i}=e,r=U1e(n),a=Jc(i),l=nL(s,n);h.useEffect(()=>{t&&l(()=>{n===r.current&&a()})},[t,n,a,l,r])}const k2=h.forwardRef(function(t,n){const{className:s,hiddenUntilFound:i,keepMounted:r,render:a,id:l,...c}=t,{abortControllerRef:u,animationTypeRef:d,height:f,mounted:p,onOpenChange:x,open:g,panelId:y,panelRef:v,runOnceAnimationsFinish:m,setDimensions:k,setHiddenUntilFound:w,setKeepMounted:S,setMounted:E,setPanelIdState:A,setOpen:z,setVisible:N,state:M,transitionDimensionRef:$,visible:R,width:_,transitionStatus:T}=iL(),O=i??!1,H=r??!1;bi(()=>{if(l)return A(l),()=>{A(void 0)}},[l,A]),bi(()=>{w(O)},[w,O]),bi(()=>{S(H)},[S,H]);const{props:L}=P1e({abortControllerRef:u,animationTypeRef:d,externalRef:n,height:f,hiddenUntilFound:O,id:y,keepMounted:H,mounted:p,onOpenChange:x,open:g,panelRef:v,runOnceAnimationsFinish:m,setDimensions:k,setMounted:E,setOpen:z,setVisible:N,transitionDimensionRef:$,visible:R,width:_});V1e({open:g&&T==="idle",ref:v,onComplete(){g&&k({height:void 0,width:void 0})}});const B=h.useMemo(()=>({...M,transitionStatus:T}),[M,T]),I=N6("div",t,{state:B,ref:[n,v],props:[L,{style:{[dS.collapsiblePanelHeight]:f===void 0?"auto":`${f}px`,[dS.collapsiblePanelWidth]:_===void 0?"auto":`${_}px`}},c],stateAttributesMapping:oL});return H||O||!H&&p?I:null});function G1e(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 W1e({atMs:e}){const t=fo(3e4);return o.jsx("span",{className:"todo-card__updated",children:G1e(t-e)})}const K1e={pending:"Not started",in_progress:"In progress",completed:"Done"},aL=2*Math.PI*10,fS=aL/8-4.4;function X1e(e){return o.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",children:o.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeDasharray:`${fS} ${aL/8-fS}`})})}function Z1e({status:e}){const t={"aria-label":K1e[e],role:"img",className:"todo-card__status"};return e==="in_progress"?o.jsx(X1e,{...t,className:"todo-card__status todo-card__status--running"}):e==="completed"?o.jsx(iN,{...t}):o.jsx(fee,{...t})}function Y1e(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 Q1e({todo:e,writtenThisRun:t,updatedAtMs:n,settled:s=!1}){const i=(e==null?void 0:e.items)??[],r=i.length,a=i.filter(p=>p.status==="completed").length,l=a===r,[c,u]=h.useState();if(s||r===0||!t&&l)return null;const d=c??!l,f=i.find(p=>p.status==="in_progress")??i.find(p=>p.status==="pending");return o.jsx("section",{className:"todo-card","data-slot":"todo-card","aria-label":"Todo",children:o.jsxs(v2,{open:d,onOpenChange:u,children:[o.jsxs("div",{className:"todo-card__header",children:[o.jsxs(y2,{className:"todo-card__trigger",children:[l?o.jsx(iN,{"aria-label":"All done",role:"img",className:"todo-card__done"}):null,o.jsxs("span",{className:"todo-card__title",children:["Todo ",a,"/",r]}),!d&&f!==void 0?o.jsxs(o.Fragment,{children:[" ",o.jsxs("span",{className:"todo-card__current",children:["· ",f.text]})]}):null,o.jsx(tr,{"aria-hidden":"true",className:"chat-step__chevron"})]}),n===void 0?null:o.jsx(W1e,{atMs:n})]}),o.jsx(k2,{className:"todo-card__panel",children:o.jsx("ol",{className:"todo-card__items",children:i.map((p,x)=>o.jsxs("li",{className:"todo-card__item","data-status":p.status,children:[o.jsx(Z1e,{status:p.status}),p.status==="completed"?o.jsx("s",{children:p.text}):o.jsx("span",{children:p.text})]},x))})})]})})}function J1e(e){return e.toolName==="todo_write"&&e.state==="output-available"}function e0e(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(i=>!J1e(i)))}return t}const t0e=300,n0e=700;function s0e(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function lL({children:e,className:t="",dwellMs:n=n0e,pageKey:s="",...i}){const r=Math.max(n,t0e),[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 v=d.current;d.current=f.current,p.current=Date.now(),l(f.current),u(s0e()?null:v.node)};if(x.current!==null)return;const y=r-(Date.now()-p.current);if(y<=0){g();return}x.current=window.setTimeout(()=>{x.current=null,f.current.key!==d.current.key&&g()},y)},[e,r,s]),h.useEffect(()=>()=>{x.current!==null&&window.clearTimeout(x.current)},[]),o.jsx("span",{className:`chat-inline-pager ${t}`.trim(),"data-slot":"chat-inline-pager",...i,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 i0e=/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g;function r0e(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 o0e(e){return e.replace(/(^|\n)\*\*([^*\n]+)\*\*(?=\n|$)/g,"$1$2")}function a0e(e){return e.split(i0e).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 l0e({text:e,unwrapLines:t=!1,className:n,...s}){let i=r0e(e);return t&&(i=o0e(i)),o.jsx("span",{className:`chat-thought-md ${n??""}`.trim(),...s,children:a0e(i)})}const c0e=8,u0e=2.6,d0e=1600,f0e="cubic-bezier(0.45, 0, 0.55, 1)";function _6({children:e,className:t="",...n}){const s=h.useRef(null);return h.useEffect(()=>{const i=s.current;if(!i||typeof i.animate!="function"||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let r,a;const l=()=>{const u=i.getBoundingClientRect().width;if(u===a)return;a=u,r==null||r.cancel();const d=Number.parseFloat(getComputedStyle(i).fontSize)||16,f=u0e*d,p=(a+f)/(c0e*d)*1e3,x=p+d0e,g=`${-f}px 0, 0 0`,y=`${a}px 0, 0 0`;r=i.animate([{backgroundPosition:g,easing:f0e},{backgroundPosition:y,offset:p/x},{backgroundPosition:y}],{duration:x,iterations:1/0})};l();const c=new ResizeObserver(l);return c.observe(i),()=>{c.disconnect(),r==null||r.cancel()}},[]),o.jsx("span",{ref:s,className:`text-shimmer ${t}`.trim(),"data-slot":"text-shimmer",...n,children:e})}function h0e(e){if(!(e===void 0||!Number.isFinite(e)||e<0))return e<1e3?"briefly":`${Math.round(e/1e3)}s`}function p0e({className:e="",dwellMs:t,step:n,...s}){const i=n.text.trim(),r=h0e(n.durationMs),a=o.jsx(lL,{dwellMs:t,pageKey:n.live?"live":"settled",children:n.live?o.jsx(_6,{className:"chat-step__label",children:"Thinking…"}):o.jsx("span",{className:"chat-step__label",children:r?o.jsxs(o.Fragment,{children:["Thought ",o.jsx("span",{className:"chat-step__meta",children:r})]}):"Thought"})}),l=o.jsx("span",{"aria-hidden":"true",className:"chat-tool-kind","data-kind":"thinking","data-slot":"chat-tool-kind",children:o.jsx(dee,{})});return i?o.jsxs(v2,{className:`chat-step ${e}`.trim(),"data-slot":"chat-thought-step",...s,children:[o.jsxs(y2,{className:"chat-step__trigger",children:[l,a,o.jsx(tr,{"aria-hidden":"true",className:"chat-step__chevron"})]}),o.jsx(k2,{keepMounted:!0,className:"chat-step__panel",children:o.jsx("div",{className:"chat-step__body",children:o.jsx(l0e,{text:n.text})})})]}):o.jsxs("p",{className:`chat-step chat-step--plain ${e}`.trim(),"data-slot":"chat-thought-step",...s,children:[l,a]})}const x0e=["path","file_path","filePath","command","cmd","query","pattern","url","name","description","task"],hS=120;function g0e(e){if(!(typeof e!="object"||e===null))for(const t of x0e){const n=e[t];if(typeof n=="string"&&n.length>0)return n.length>hS?`${n.slice(0,hS)}…`:n}}function Go(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 R6(e){if(!e)return;let t;try{t=JSON.parse(e)}catch{return}return g0e(t)}function cL(e){if(!(e===void 0||!Number.isFinite(e)||e<0))return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}const m0e={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 uL(e){return(e??"").trim().toLowerCase().replace(/-/g,"_")}function rm(e){return m0e[uL(e)]??"tool"}function v0e(e){const t=new Set(e.map(n=>rm(n.toolName)));return t.size===1?[...t][0]:"tool"}function y0e({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((i,r)=>o.jsx(k0e,{image:i,index:r,onOpen:()=>s(r)},r)),n===void 0?null:o.jsx(dL,{images:e,index:n,onIndexChange:s,onClose:()=>s(void 0)})]})}function k0e({image:e,index:t,onOpen:n}){const[s,i]=Jz(),r=Wb(e,i,"thumbnail");return o.jsx("div",{ref:s,children:o.jsx(ig,{src:r.status==="ready"?r.src:void 0,isLoading:r.status==="loading",alt:`Image ${t+1}`,onClick:n})})}const b0e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";function dL({images:e,index:t,onIndexChange:n,onClose:s}){const[i,r]=h.useState(0),a=e[t],l=Wb(a,!0,"original",i);if(l.status==="error")return o.jsx(os,{isOpen:!0,width:420,onOpenChange:u=>u?void 0:s(),children:o.jsx(Wn,{header:o.jsx(Ts,{title:"Image unavailable",onOpenChange:()=>s()}),content:o.jsx(Kn,{children:o.jsxs(te,{gap:3,padding:3,children:[o.jsx("div",{role:"alert",children:o.jsx(W,{children:"Couldn't load the original image."})}),o.jsx("div",{children:o.jsx(K,{label:"Try again",onClick:()=>r(u=>u+1)})})]})})})});const c=e.map((u,d)=>({src:d===t&&l.status==="ready"?l.src:Lw(u,"thumbnail")??Lw(u,"preview")??b0e,alt:`Image ${d+1}`}));return o.jsx(m$,{isOpen:!0,media:c,index:t,onIndexChange:n,onOpenChange:u=>{u||s()}})}const w0e={shell:a2,search:wee,web:vee,file:hee,edit:lee,tool:yee};function Fx({className:e="",kind:t,...n}){const s=w0e[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 j0e={"input-streaming":"running","input-available":"running","output-available":"complete","output-error":"error"};function fL(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 hL({tool:e,className:t,...n}){var s,i;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((r,a)=>o.jsxs("li",{className:"chat-tool-step__item",children:[o.jsx(Fx,{kind:rm(r.toolName)}),o.jsx(pL,{tools:[r]})]},r.toolCallId??a))}):null,(i=e.images)==null?void 0:i.map((r,a)=>o.jsx(S0e,{image:r},a))]})}function S0e({image:e}){const[t,n]=Jz(),[s,i]=h.useState(!1),r=Wb(e,n,"preview");return r.status==="loading"?o.jsx("div",{ref:t,"data-testid":"tool-image-loading",children:o.jsx(Hc,{height:160,width:"100%"})}):r.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(Zb,{"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:()=>i(!0),children:o.jsx("img",{src:r.src,alt:"",style:{maxWidth:"100%"}})}),s?o.jsx(dL,{images:[e],index:0,onIndexChange:()=>{},onClose:()=>i(!1)}):null]})}function C0e(e,t){const n=fL(e)?o.jsx(hL,{tool:e}):void 0;return{name:Go(e.toolName)??"tool",status:j0e[e.state],target:R6(e.argsText),...e.diffStat?{additions:e.diffStat.additions,deletions:e.diffStat.deletions}:{},duration:cL(e.durationMs),errorMessage:e.state==="output-error"?e.output:void 0,key:e.toolCallId??`tool-${t}`,resultDetail:n}}function pL({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(XE,{calls:e.map(C0e)})}):null}const oh={past:"Ran",noun:["command","commands"]},vy={past:"Read",noun:["file","files"]},pS={past:"Edited",noun:["file","files"]},xS={past:"Wrote",noun:["file","files"]},gS={past:"Searched",noun:["pattern","patterns"]},mS={past:"Searched",noun:["path","paths"]},E0e={past:"Listed",noun:["directory","directories"]},vS={past:"Searched",noun:["web page","web pages"]},Lp={past:"Fetched",noun:["page","pages"]},$0e={bash:oh,shell:oh,sh:oh,terminal:oh,cmd:oh,read:vy,read_file:vy,cat:vy,edit:pS,str_replace:pS,write:xS,write_file:xS,grep:gS,find:mS,glob:mS,ls:E0e,search:gS,web_search:vS,websearch:vS,webfetch:Lp,web_fetch:Lp,web:Lp,browser:Lp},xL={past:"Used",noun:["tool","tools"]};function yS(e){return $0e[uL(e)]??xL}const kS=72;function A0e(e){return e.length<=kS?e:e.includes("/")&&!e.includes(" ")?`…${e.slice(-71)}`:`${e.slice(0,kS-1)}…`}function bS(e,[t,n]){return e!==1?`${e} ${n}`:`${t==="tool"?"a":"1"} ${t}`}function gL(e){if(e.length===1){const[n]=e,s=yS(n.toolName),i=R6(n.argsText);return i?`${s.past} ${A0e(i)}`:s===xL?`Used ${Go(n.toolName)??"a tool"}`:`${s.past} ${bS(1,s.noun)}`}const t=new Map;for(const n of e){const s=yS(n.toolName),i=`${s.past}:${s.noun[1]}`,r=t.get(i)??{verb:s,count:0};r.count+=1,t.set(i,r)}return[...t.values()].map(({verb:n,count:s},i)=>{const r=`${n.past} ${bS(s,n.noun)}`;return i===0?r:r.charAt(0).toLowerCase()+r.slice(1)}).join(", ")}function mL(e){const t=e.filter(s=>s.state==="output-error").length,n=e.reduce((s,i)=>i.diffStat?{additions:((s==null?void 0:s.additions)??0)+i.diffStat.additions,deletions:((s==null?void 0:s.deletions)??0)+i.diffStat.deletions}:s,void 0);return{failed:t,diffStat:n}}function vL({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 yL(e){const t=[];for(const n of e.children??[])t.push(n,...yL(n));return t}function M0e({className:e="",dwellMs:t,step:n,...s}){const{tools:i}=n,{failed:r,diffStat:a}=mL(i),l=i.flatMap(yL),c=l.length,u=l.filter(v=>v.state==="output-error").length,d=i.reduce((v,m)=>v+(m.durationMs??0),0),f=i.find(v=>v.toolCallId===n.activeToolCallId)??i[i.length-1];let p,x=f;for(;x;){const v=(x.children??[]).filter(k=>k.state==="input-available"),m=v[v.length-1];if(!m)break;p=m,x=m}const g=n.live?rm(f==null?void 0:f.toolName):v0e(i),y=n.live?`running:${(f==null?void 0:f.toolCallId)??"none"}`:"settled";return o.jsxs(v2,{className:`chat-step chat-tool-step ${e}`.trim(),"data-slot":"chat-tool-step",...s,children:[o.jsxs(y2,{className:"chat-step__trigger",children:[o.jsx(lL,{dwellMs:t,pageKey:y,children:n.live?o.jsxs("span",{className:"chat-tool-step__page",children:[o.jsx(Fx,{kind:g}),o.jsx(_6,{className:"chat-step__label",children:f!=null&&f.toolName?p!=null&&p.toolName?`Running ${Go(f.toolName)} › ${Go(p.toolName)}…`:`Running ${Go(f.toolName)}…`:"Running…"})]}):o.jsxs("span",{className:"chat-tool-step__page",children:[o.jsx(Fx,{kind:g}),o.jsx("span",{className:"chat-step__label",children:gL(i)}),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(vL,{failed:r,diffStat:a}),d>0?o.jsx("span",{className:"chat-step__meta",children:cL(d)}):null]})}),o.jsx(tr,{"aria-hidden":"true",className:"chat-step__chevron"})]}),o.jsx(k2,{keepMounted:!0,className:"chat-step__panel",children:i.length===1?fL(i[0])?o.jsx("div",{className:"chat-tool-step__detail","data-slot":"chat-tool-step-detail",children:o.jsx(hL,{tool:i[0]})}):null:o.jsx("ol",{className:"chat-tool-step__list",children:i.map((v,m)=>o.jsxs("li",{className:"chat-tool-step__item",children:[o.jsx(Fx,{kind:rm(v.toolName)}),o.jsx(pL,{tools:[v]})]},v.toolCallId??m))})})]})}function T0e(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 r=Math.floor(t/60),a=t%60;return`${r}m ${a}s`}const n=Math.floor(t/3600),s=Math.floor(t%3600/60),i=t%60;return`${n}h ${s}m ${i}s`}function z0e(e){const t=Math.floor(Math.max(0,e)/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function wS(e){return[...e.matchAll(/(\d+)([a-z]+)/g)].map(([,t,n])=>[n,t])}function N0e({text:e}){const[t,n]=h.useState({text:e});t.text!==e&&n({text:e,prev:t.text});const s=t.prev===void 0?void 0:new Map(wS(t.prev));return o.jsx("span",{"aria-label":e,role:"img",className:"chat-clock",children:wS(e).map(([i,r],a)=>{const l=(s==null?void 0:s.get(i))??"";return o.jsxs("span",{"aria-hidden":"true",children:[a>0?" ":null,[...r].map((c,u)=>{const d=r.length-u,f=l[l.length-d],p=s!==void 0&&f!==c;return o.jsxs("span",{className:"chat-clock__slot",children:[p&&f!==void 0?o.jsx("span",{className:"chat-clock-digit","data-out":"",children:f},`out:${e}`):null,o.jsx("span",{className:"chat-clock-digit","data-in":p?"":void 0,children:c},p?`in:${e}`:"still")]},d)}),i]},i)})})}function _0e({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 R0e({startedAtMs:e,running:t}){const[n,s]=h.useState(()=>Date.now()),[i,r]=h.useState(t);return t&&!i&&r(!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||!i?null:o.jsxs(o.Fragment,{children:[" ",o.jsxs("span",{className:"chat-step__meta","data-slot":"chat-trace-clock",children:["· ",o.jsx(N0e,{text:z0e(n-e)})]})]})}function I0e(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 ${Go(n.toolName)}…`:"Running…"}function jS({className:e="",clock:t,counted:n,live:s=!1,steps:i,tail:r,waiting:a,...l}){const c=n.filter(x=>x.state==="output-available"||x.state==="output-error"),u=s?I0e(i)??a:void 0,d=i.some(x=>x.kind==="thinking"&&!x.live),f=c.length>0?gL(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(vL,{...mL(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(_6,{className:"chat-trace__label","data-slot":"chat-trace-current",children:u})]}),r===void 0?null:o.jsxs(o.Fragment,{children:[" ",o.jsxs("span",{className:"chat-step__meta","data-slot":"chat-trace-tail",children:["· ",r]})]}),t===void 0?null:o.jsx(R0e,{...t})]});return i.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(v2,{className:`chat-trace ${e}`.trim(),"data-slot":"chat-trace",...l,children:[o.jsxs(y2,{className:"chain-of-thought__trigger","data-slot":"chat-trace-trigger",children:[p,o.jsx(tr,{"aria-hidden":"true",className:"chat-step__chevron"})]}),o.jsx(k2,{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:i.map(x=>o.jsx("li",{className:"chain-of-thought__step","data-slot":"chain-of-thought-step",children:x.kind==="thinking"?o.jsx(p0e,{step:x}):o.jsx(M0e,{step:x})},x.id))})})]})}const E4=h.createContext(!1);function L0e(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??""),i=s?t.slice(0,s.index):t??"";if(!i||i.endsWith("/"))return null;const r=Number(((l=/^L(\d+)(?:-L?\d+)?$/.exec(n))==null?void 0:l[1])??(s==null?void 0:s[1])),a=i.slice(i.lastIndexOf("/")+1);return{path:i,name:a,...Number.isSafeInteger(r)&&r>0?{line:r}:{}}}function O0e(e){return typeof e=="string"?e:Array.isArray(e)&&e.every(t=>typeof t=="string")?e.join(""):null}function D0e({href:e,children:t}){const n=L0e(e);if(!n){const r=/^https?:\/\//.test(e);return o.jsx(r0,{color:"accent",hasUnderline:!0,href:e,type:"inherit",...r?{target:"_blank",rel:"noopener noreferrer"}:{},children:o.jsx(E4.Provider,{value:!0,children:t})})}const s=O0e(t),i=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(Nf,{"aria-hidden":!0,className:"chat-file-link__icon"}),o.jsx(E4.Provider,{value:!0,children:i?n.line?`${n.name}:${n.line}`:n.name:t})]})}const kL=3,bL=h.createContext(void 0);function wL({children:e}){const t=h.useContext(bL),n=h.useContext(E4),s=o.jsx(n3,{className:"chat-inline-code","data-slot":"chat-inline-code",children:e}),i=typeof e=="string"?e.trim():e;return!n&&typeof i=="string"&&(t!=null&&t.has(i))?o.jsx("a",{href:i,className:"chat-inline-code-link","data-slot":"chat-inline-code-link",title:i,children:s}):s}const jL={inlineCode:wL},SL={inlineCode:wL,link:D0e};function CL({children:e,fileLinks:t=!1,linkedInlineCode:n,className:s="",...i}){return o.jsx("div",{className:`chat-markdown ${s}`.trim(),"data-slot":"chat-markdown","data-testid":"markdown-renderer",...i,children:o.jsx(bL.Provider,{value:t?n:void 0,children:o.jsx(w3,{components:t?SL:jL,density:"compact",headingLevelStart:kL,children:e})})})}function B0e({children:e,isStreaming:t=!1,fileLinks:n=!1,className:s="",...i}){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",...i,children:o.jsx(w3,{components:n?SL:jL,density:"compact",headingLevelStart:kL,isStreaming:t,children:e})})}function H0e({children:e,className:t="",...n}){return o.jsx(h3,{className:`chat-message ${t}`.trim(),"data-slot":"chat-message-user",sender:"user",...n,children:e})}function q0e({children:e,className:t="",...n}){return o.jsx(h3,{className:`chat-message ${t}`.trim(),"data-slot":"chat-message-assistant",sender:"assistant",...n,children:e})}function P0e({children:e,className:t="",...n}){return o.jsx(GE,{className:t||void 0,"data-slot":"chat-message-bubble",...n,children:e})}function U0e({children:e,className:t="",...n}){return o.jsx("div",{className:`chat-message__body ${t}`.trim(),"data-slot":"chat-message-body",...n,children:e})}function F0e({children:e,className:t="",...n}){return o.jsx("div",{className:`chat-message__content ${t}`.trim(),"data-slot":"chat-message-content",...n,children:e})}function b2({"aria-label":e,tooltip:t,onPress:n,children:s,className:i="",...r}){return o.jsx("button",{"aria-label":e,className:`chat-message__action ${i}`.trim(),"data-slot":"chat-message-action",title:t,type:"button",onClick:n,...r,children:s})}function eu({children:e,className:t="",...n}){return o.jsx("div",{className:`chat-message__actions ${t}`.trim(),"data-slot":"chat-message-actions",...n,children:e})}function V0e(e){return o.jsx(b2,{...e,children:o.jsx(Xb,{"aria-hidden":"true",size:16})})}function G0e(e){return o.jsx(b2,{...e,children:o.jsx(Eee,{"aria-hidden":"true",size:16})})}function W0e(e){return o.jsx(b2,{...e,children:o.jsx(Cee,{"aria-hidden":"true",size:16})})}eu.Copy=V0e;eu.ThumbsUp=G0e;eu.ThumbsDown=W0e;const Qa={User:H0e,Assistant:q0e,Bubble:P0e,Body:U0e,Content:F0e,Action:b2},K0e=new Set(["ECONNREFUSED","ETIMEDOUT","ENOTFOUND","EAI_AGAIN","ECONNRESET","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_SOCKET"]);function X0e(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 EL(e,t=0){if(t>4)return{message:""};const n=X0e(e);if(!e||typeof e!="object")return{message:n};const s=e,i=Z0e(s),r=typeof s.code=="string"&&K0e.has(s.code)?s.code:void 0,a=EL(s.cause,t+1),l=a.message&&!n.includes(a.message)?a.message:"";return{status:i??a.status,networkCode:r??a.networkCode,message:[n,l].filter(Boolean).join(" ")}}function Z0e(e){if(typeof e.statusCode=="number")return e.statusCode;if(typeof e.status=="number")return e.status;const t=e.$metadata;if(SS(t)&&typeof t.httpStatusCode=="number")return t.httpStatusCode;const n=e.$response;if(SS(n)&&typeof n.statusCode=="number")return n.statusCode}function SS(e){return typeof e=="object"&&e!==null}const Y0e=/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,Q0e=/invalid_grant|oauth refresh failed|refresh.?token/i;function J0e(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||Y0e.test(e.message)?"network":/invalid.?api.?key|authentication_error|unauthorized/i.test(e.message)||Q0e.test(e.message)?"auth":"unknown"}function epe(e){return J0e(EL(e))}function tpe(e){const t=epe(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 npe({error:e,onRetry:t,onOpenProviderSettings:n,modelControl:s,className:i,...r}){const[a,l]=h.useState(!1),[c,u]=h.useState(!1),d=h.useRef(!1),[f,p]=h.useState(null),x=tpe(e),g=async()=>{if(!(!t||d.current)){d.current=!0,l(!0),p(null);try{await t()}catch(y){p(y instanceof Error?y.message:"Retry could not start.")}finally{d.current=!1,l(!1)}}};return o.jsxs(te,{className:i,gap:2,...r,children:[o.jsx(Ie,{status:"error",title:x.title,description:x.description}),o.jsxs(pe,{gap:2,wrap:"wrap",children:[n?o.jsx(K,{label:"Provider settings",size:"sm",variant:"secondary",onClick:n}):null,s,t?o.jsx(K,{label:"Retry request",size:"sm",variant:"secondary",isDisabled:a,onClick:()=>void g()}):null]}),f?o.jsx(W,{role:"alert",style:{color:"var(--danger)"},children:f}):null,o.jsx(Rm,{trigger:o.jsx(W,{type:"body",size:"sm",color:"secondary",children:"Error details"}),isOpen:c,onOpenChange:u,children:c?o.jsx(W,{as:"div",type:"body",size:"sm",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:e}):null})]})}const spe={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"}},CS=new Map;function ES(e,t,n){const s=`\0${n}`;let i=CS.get(s);return i===void 0&&(i=new Intl.DateTimeFormat(t,spe[n]),CS.set(s,i)),i.format(e)}function ipe(e,t=Date.now(),n){if(!Number.isFinite(e))return;const s=new Date(e),i=new Date(t);if(Number.isNaN(s.getTime())||Number.isNaN(i.getTime()))return;const r=s.getFullYear()===i.getFullYear()&&s.getMonth()===i.getMonth()&&s.getDate()===i.getDate(),a=s.getFullYear()===i.getFullYear();return{label:ES(s,n,r?"time":a?"date":"year"),full:ES(s,n,"full"),iso:s.toISOString()}}const $S={done:"Done",failed:"Failed",running:"Running",idle:"Idle"};function $L(e){const t=Math.max(0,Math.floor(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function rpe({startedAt:e}){const t=fo(1e3);return o.jsx(o.Fragment,{children:$L(t-e)})}function ope(e){if(e.argsText===void 0)return!1;try{const t=JSON.parse(e.argsText);return typeof t=="object"&&t!==null&&t.background===!0}catch{return!1}}function ape({tool:e,summary:t,openInPanel:n}){const s=T6(e),i=(s==null?void 0:s.kind)==="subagent"?s:void 0,r=e.state==="output-available"?"done":e.state==="output-error"?"failed":"running",a=r==="done"&&ope(e),l=a?(t==null?void 0:t.status)==="failed"?"failed":(t==null?void 0:t.status)===void 0?"idle":"running":r,c=t!==void 0?k0(t):R6(e.argsText)??"Subagent",u=i==null?void 0:i.startedAt,d=i==null?void 0:i.endedAt,f=u===void 0||a?void 0:l==="running"?o.jsx(rpe,{startedAt:u},"elapsed"):d===void 0?void 0:$L(d-u),p=[a?"Background":void 0,$S[l],(t==null?void 0:t.role)===void 0?void 0:`@${t.role}`,i==null?void 0:i.model,i==null?void 0:i.branch,f].filter(x=>x!==void 0&&x!=="");return o.jsxs(te,{className:"pigui-subagent-card rounded-lg border border-border p-3",gap:1,"data-slot":"subagent-card","data-status":l,...a?{"data-background":""}:{},children:[o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(br,{variant:l==="failed"?"error":l==="running"?"success":"neutral",label:$S[l],isPulsing:l==="running"}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:c}),i===void 0?null:o.jsx(K,{label:"View",variant:"secondary",size:"sm",onClick:()=>n(i.conversationId)})]}),o.jsx("div",{className:"text-xs text-muted tabular-nums",children:p.map((x,g)=>g===0?o.jsx("span",{children:x},g):o.jsxs("span",{children:[" · ",x]},g))}),l==="running"&&(t==null?void 0:t.activity)!==void 0?o.jsxs("div",{className:"text-xs text-muted",children:["→ ",Go(t.activity.tool)??t.activity.tool,t.activity.target===void 0?"":` ${t.activity.target}`]}):null,r==="failed"&&e.output!==void 0&&e.output!==""?o.jsx("div",{className:"text-xs text-muted",children:e.output}):null]})}function lpe({tools:e,summaryOf:t,openInPanel:n}){return e.length===0?null:o.jsx(te,{gap:2,className:"pigui-subagent-cards",children:e.map(({key:s,tool:i})=>{const r=T6(i);return o.jsx(ape,{tool:i,summary:(r==null?void 0:r.kind)==="subagent"?t==null?void 0:t(r.conversationId):void 0,openInPanel:n},s)})})}const yy=(e,t,n)=>e.startsWith(`${t} ${n}`)?e.slice(t.length+1+n.length):e.slice(t.length+1);function AL(e){const t=[];let n,s=0,i=0,r=!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||i>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}),i-=1):c.startsWith("-")?(n.deletions+=1,n.lines.push({kind:"del",text:c}),s-=1):(n.lines.push({kind:"ctx",text:c}),s-=1,i-=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]),i=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)),r=!0;continue}if(c.startsWith("--- ")){n!==void 0&&r?(r=!1,c==="--- /dev/null"?n.isNew=!0:n.oldPath=yy(c,"---","a/")):(l(),n=a(""),c==="--- /dev/null"?n.isNew=!0:n.oldPath=yy(c,"---","a/"));continue}n!==void 0&&(c.startsWith("+++ ")?c==="+++ /dev/null"?n.isDeleted=!0:n.path=yy(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 cpe=h.lazy(()=>ym(()=>import("./highlighted-diff-DJ7KZCpS.js").then(e=>e.j),[]).catch(()=>({default:({fallback:e})=>e}))),upe={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)"},dpe={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)"}},fpe=400;function ML({patch:e,collapsible:t=!1}){const n=h.useMemo(()=>AL(e),[e]),s=t&&n.reduce((a,l)=>a+l.lines.length,0)>fpe,[i,r]=h.useState(new Map);return n.length===0?o.jsx(W,{type:"supporting",children:"No changes."}):o.jsx(te,{gap:2,children:n.map((a,l)=>{const c=i.get(a.path)??!s,u=o.jsxs(o.Fragment,{children:[o.jsx(W,{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($s,{label:"new",color:"green",size:"sm"}):null,a.isDeleted?o.jsx($s,{label:"deleted",color:"red",size:"sm"}):null,o.jsxs(W,{type:"supporting",children:["+",a.additions," −",a.deletions]})]});return o.jsxs(te,{gap:0,children:[t?o.jsx(hpe,{open:c,onToggle:()=>r(d=>new Map(d).set(a.path,!c)),children:u}):o.jsx(pe,{gap:2,vAlign:"center",padding:1,children:u}),c?a.binary===!0?o.jsx(W,{type:"supporting",children:"Binary file"}):a.lines.length===0?null:o.jsx(h.Suspense,{fallback:o.jsx(AS,{lines:a.lines}),children:o.jsx(cpe,{patch:e,path:a.path,fallback:o.jsx(AS,{lines:a.lines})})}):null]},`${a.path}-${l}`)})})}function AS({lines:e}){return o.jsx("div",{style:upe,children:e.map((t,n)=>o.jsx("div",{style:dpe[t.kind],children:t.text},n))})}function hpe({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(tr,{className:`size-3.5 shrink-0 text-muted ${e?"rotate-90":""}`,"aria-hidden":"true"}),n]})}function ppe(e){return e.kind==="diff"?o.jsx(ML,{patch:e.patch}):void 0}function xpe(e){const t=n=>{var a;const s=T6(n),i=s===void 0?void 0:ppe(s),r=(a=n.children)==null?void 0:a.map(t);return i===void 0&&r===void 0?n:{...n,...i===void 0?{}:{detail:i},...r===void 0?{}:{children:r}}};return{...e,steps:e.steps.map(n=>n.kind==="tools"?{...n,tools:n.tools.map(t)}:n)}}function gpe({entry:e,connected:t,openInPanel:n,onOpenFork:s,onFork:i,canFork:r=!0,forkDisabled:a=!1,forksAt:l,summaryOf:c,onRetry:u,onRetrySubmission:d,onEditSubmission:f,submissionEditDisabled:p,submissionEditTooltip:x,todo:g,today:y}){switch(e.kind){case"user":return o.jsx(mpe,{entry:e,onRetrySubmission:d,onEditSubmission:f,submissionEditDisabled:p,submissionEditTooltip:x,today:y});case"run":return o.jsx(vpe,{entry:e,connected:t,openInPanel:n,onOpenFork:s,onFork:i,canFork:r,forkDisabled:a,forksAt:l,summaryOf:c,onRetry:u,todo:g,today:y});case"compaction":return o.jsx(Dy,{variant:"divider",children:"Earlier context summarized"});case"reset":return o.jsx(Dy,{variant:"divider",children:"New context"})}}function mpe({entry:e,onRetrySubmission:t,onEditSubmission:n,submissionEditDisabled:s=!1,submissionEditTooltip:i,today:r}){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(eu,{className:"chat-message__copy",children:o.jsx(eu.Copy,{"aria-label":"Copy",tooltip:"Copy",onPress:()=>{var g;(g=navigator.clipboard)==null||g.writeText(e.text)}})}),p=o.jsx(p3,{...e.timestamp===void 0?{}:{timestamp:o.jsx(TL,{timestamp:e.timestamp,today:r})},footer:d==="delivered"?o.jsx("span",{title:"Delivered",children:o.jsx(Pe,{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(Qa.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(Qfe,{attachments:e.attachments,...a===void 0?{}:{testId:"local-message-attachments"}}),e.images.length===0?null:o.jsx(y0e,{images:e.images,...a===void 0?{}:{testId:"local-message-images"}}),e.text===""?null:o.jsx(Qa.Bubble,{children:o.jsx(Qa.Content,{children:o.jsx(Yfe,{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(RC,{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===QZ?"The host is upgrading. Retry once it's back.":a.error}),a===void 0||!l||t===void 0?null:o.jsx(K,{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(K,{label:"Edit",variant:"ghost",size:"sm",className:"chat-message__local-action",isDisabled:u,...u&&i!==void 0?{tooltip:i}:{},onClick:()=>n(a.requestId)})]})]})})}function TL({timestamp:e,today:t}){const n=ipe(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 vpe({entry:e,connected:t,openInPanel:n,onOpenFork:s,onFork:i,canFork:r=!0,forkDisabled:a=!1,forksAt:l,summaryOf:c,onRetry:u,todo:d,today:f}){const{view:p,subagents:x}=h.useMemo(()=>Ghe(e.cot),[e.cot]),g=h.useMemo(()=>xpe(p),[p]),y=g.answer,v=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||y!==void 0||e.forkEntryId!==void 0&&(r||v.length>0));return o.jsx(Qa.Assistant,{children:o.jsxs(Qa.Body,{children:[e.interrupted?o.jsx("p",{className:"mb-1",children:o.jsx($s,{label:"interrupted",color:"orange",size:"sm"})}):null,o.jsx(ype,{view:g}),o.jsx(lpe,{tools:x,summaryOf:c,openInPanel:n}),y===void 0?null:o.jsx(Qa.Content,{children:y.streaming?o.jsx(B0e,{isStreaming:!0,children:y.text}):o.jsx(CL,{children:y.text})}),e.failure===void 0?null:o.jsx(npe,{error:e.failure,onRetry:u}),k?o.jsxs(eu,{children:[m===void 0?null:o.jsx(p3,{timestamp:o.jsx(TL,{timestamp:m,today:f})}),y===void 0?null:o.jsx(eu.Copy,{"aria-label":"Copy",tooltip:"Copy",onPress:()=>{var w;(w=navigator.clipboard)==null||w.writeText(y.text)}}),e.forkEntryId===void 0?null:v.length>0?o.jsxs("button",{type:"button",className:"pigui-fork-chip","aria-label":`${v.length} ${v.length===1?"fork":"forks"}`,title:"Open fork",disabled:!t,onClick:()=>s(v[0]),children:[o.jsx(Bw,{"aria-hidden":"true"}),v.length," ",v.length===1?"fork":"forks"]}):r?o.jsx(Qa.Action,{"aria-label":"Fork",tooltip:a?"Creating fork…":"Continue from here in a new conversation",disabled:!t||a,onPress:()=>i(e.forkEntryId),children:o.jsx(Bw,{"aria-hidden":"true",className:"size-4"})}):null]}):null,o.jsx(Q1e,{todo:d==null?void 0:d.state,writtenThisRun:g.todoWrittenAtMs!==void 0,settled:g.phase==="settled",...(d==null?void 0:d.updatedAtMs)===void 0?{}:{updatedAtMs:d.updatedAtMs}})]})})}function ype({view:e}){var d;const t=h.useMemo(()=>e0e(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"?T0e(e.elapsedMs):void 0,i=s===void 0?void 0:e.outcome==="failed"?`Failed after ${s}`:s,r=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}:{},...i===void 0?{}:{tail:i},...r===void 0?{}:{clock:r}};return o.jsxs(_0e,{phase:e.phase,children:[t.map((f,p)=>f.kind==="interim"?o.jsx(Qa.Content,{"data-slot":"chat-interim-output",children:o.jsx(CL,{children:f.text})},f.key):o.jsx(jS,{steps:f.steps,counted:f.counted,...p===c?u:{}},f.key)),l?o.jsx(jS,{steps:[],counted:[],...u},`segment-${c}`):null]})}const zL=typeof window<"u"&&typeof document<"u";function I6(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function kpe(e){const t=new Date(e);return t.setHours(24,0,0,0),Math.max(1,t.getTime()-e)}const sd=new Set;let z1=I6(Date.now()),dc;function NL(){const e=I6(Date.now());if(e!==z1){z1=e;for(const t of sd)t()}_L()}function _L(){dc!==void 0&&clearTimeout(dc),dc=void 0,!(!zL||sd.size===0)&&(dc=window.setTimeout(NL,kpe(Date.now())))}function MS(){document.visibilityState==="visible"&&NL()}function bpe(e){return zL?(sd.add(e),sd.size===1&&(z1=I6(Date.now()),document.addEventListener("visibilitychange",MS),_L()),()=>{sd.delete(e),sd.size===0&&(dc!==void 0&&clearTimeout(dc),dc=void 0,document.removeEventListener("visibilitychange",MS))}):()=>{}}function wpe(){return z1}function jpe(){return z1}function Spe(){return h.useSyncExternalStore(bpe,wpe,jpe)}function RL({conversation:e,toolPresentations:t,connected:n,canFork:s,openInPanel:i,onOpenFork:r,onFork:a,forkDisabled:l,forksAt:c,summaryOf:u,onRetry:d,onRetrySubmission:f,onEditSubmission:p,submissionEditDisabled:x,submissionEditTooltip:g,docs:y,submissions:v,mergeQueuedSubmissions:m,onLoadEarlier:k}){var B;const w=nm(e),S=Spe(),E=h.useMemo(()=>Fhe(e,t,w,v??[],{mergeQueuedSubmissions:m}),[e,t,w,v,m]),A=h.useMemo(()=>Vhe(E),[E]),z=h.useMemo(()=>Epe(y),[y]),N=h.useMemo(()=>Y1e(E),[E]),M=h.useMemo(()=>z===void 0?void 0:{state:z,...N===void 0?{}:{updatedAtMs:N}},[z,N]),$=E.findLastIndex(I=>I.kind==="run"),R=h.useRef(null),_=h.useRef(void 0),T=e.before,O=h.useRef(k);O.current=k;const H=h.useCallback(async()=>{var U;const I=O.current;if(I===void 0)return;const D=Cpe(R.current),q=(U=R.current)==null?void 0:U.firstElementChild;D!==void 0&&q!=null&&(_.current={scroller:D,row:q,top:TS(D,q)});try{await I()}catch{_.current=void 0}},[T,n]),L=(B=E[0])==null?void 0:B.id;return h.useLayoutEffect(()=>{const I=_.current;I!==void 0&&(_.current=void 0,I.row.isConnected&&(I.scroller.scrollTop+=TS(I.scroller,I.row)-I.top))},[L]),E.length===0?null:o.jsx(VE,{isStreaming:w,gap:0,scrollToTopAction:k!==void 0&&n&&T!==void 0?H:void 0,children:o.jsx("div",{ref:R,className:"mx-auto flex w-full max-w-[44rem] flex-col gap-8 px-4 pb-6 pt-2",children:E.map((I,D)=>o.jsx(gpe,{entry:I,connected:n,openInPanel:i,onOpenFork:r,onFork:a,canFork:s,forkDisabled:l,forksAt:c,summaryOf:u,onRetrySubmission:f,onEditSubmission:p,submissionEditDisabled:x,submissionEditTooltip:g,today:S,...D===$&&M!==void 0?{todo:M}:{},onRetry:d!==void 0&&n&&A!==void 0&&D===E.length-1?()=>d(A):void 0},I.id))})})}function Cpe(e){for(let t=e==null?void 0:e.parentElement;t;t=t.parentElement){const{overflowY:n}=getComputedStyle(t);if(n==="auto"||n==="scroll")return t}}function TS(e,t){return t.getBoundingClientRect().top-e.getBoundingClientRect().top}function Epe(e){for(const t of e??[]){if(t.value===null)continue;const n=jl(t.presentation,t.value);if(n.type==="pinomad.todo")return n.value}}function IL(){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(zS,{width:200,index:0}),o.jsx(NS,{lines:["100%","100%",220],index:1}),o.jsx(zS,{width:150,index:5}),o.jsx(NS,{lines:["100%","100%","100%",160],index:6})]})}function zS({width:e,index:t}){return o.jsx("div",{"aria-hidden":"true",className:"flex justify-end",children:o.jsx(Hc,{width:e,height:40,radius:4,index:t})})}function NS({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(Hc,{width:128,height:28,radius:"rounded",index:t})}),e.map((n,s)=>o.jsx(Hc,{width:n,height:12,radius:"rounded",index:t+s+1},s))]})}function $pe(){return o.jsx("div",{"aria-hidden":"true",className:"chat-skeleton",children:o.jsx(Hc,{height:92,radius:4})})}function Ape({missing:e,connected:t,onRetry:n}){return e?o.jsx(ro,{title:"Conversation not found",description:"It was archived or deleted on another device."}):o.jsx(ro,{title:"Couldn't open this conversation",description:t?"The host didn't send it.":"The connection dropped before it arrived.",actions:o.jsx(K,{label:"Try again",variant:"secondary",onClick:n,isDisabled:!t})})}function Mpe(e){return[...e].sort((t,n)=>{const s=hf(t.state),i=hf(n.state);return s!==i?s?-1:1:s?0:(n.endedAt??n.startedAt)-(t.endedAt??t.startedAt)})}function Tpe(e){if(e==="starting")return"Starting";if(e==="running")return"Running";if(e==="lost")return"Lost track after a host restart; it may still be running";if(typeof e=="object"&&"stopped"in e)switch(e.stopped){case"agent":return"Stopped by the agent";case"user":return"Stopped by the user";case"archive":return"Stopped when the conversation was archived";case"shutdown":return"Stopped when the host shut down"}return typeof e=="object"&&"failed"in e?`Failed to start: ${e.failed}`:typeof e=="object"&&"exited"in e?e.signal!==void 0?`Exited after signal ${e.signal}`:e.exited===null?"Exited":`Exited with code ${e.exited}`:"Unknown"}const zpe=new Set(["running","needs-answer"]);function LL(e){const t=e.filter(s=>zpe.has(s.status)),n=e.filter(s=>s.status==="failed").length;return{active:t,done:e.length-t.length-n,failed:n}}function OL(e,t){const[n,s]=h.useState();if(h.useEffect(()=>{if(t!==void 0)return e.watch(t,i=>s({rootId:t,state:i}))},[e,t]),t!==void 0)return(n==null?void 0:n.rootId)===t?n.state:void 0}function DL(e){if(!e.available)return{kind:"unavailable",branch:e.branch};const t=AL(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 BL(e,t){var s,i;const n=(s=e.host)==null?void 0:s.protocol.minor;return n!==void 0&&Ct(n,"liveBranch")?t.kind==="ready"||t.kind==="unavailable"?t.branch:void 0:(i=e.checkout)==null?void 0:i.branch}const Op=e=>e.toLocaleString("en-US");function L6({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":`${Op(e.additions)} added, ${Op(e.deletions)} removed${e.truncated?" at least":""}`,children:[o.jsxs("span",{className:"text-success",children:["+",Op(e.additions),e.truncated?"+":""]})," ",o.jsxs("span",{className:"text-danger",children:["−",Op(e.deletions),e.truncated?"+":""]})]})}function pf({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 Npe({view:e,remote:t,shownId:n,busy:s,barStart:i,barEnd:r}){var v;const a=(v=e.conversation)==null?void 0:v.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"}:DL(u),y=BL(e,g);return o.jsxs(te,{className:"h-full min-h-0",gap:0,children:[o.jsxs(pf,{start:i,end:o.jsxs(o.Fragment,{children:[o.jsx(ht,{icon:o.jsx(C0,{className:"size-4","aria-hidden":"true"}),label:"Refresh changes",size:"sm",variant:"ghost",isDisabled:!c||l===void 0,onClick:p}),r]}),children:[y===void 0?null:o.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx(oN,{className:"size-4 shrink-0 text-muted","aria-hidden":"true"}),o.jsx("span",{className:"truncate",children:y})]}),g.kind==="unavailable"?null:o.jsxs("span",{className:"shrink-0 text-sm tabular-nums",children:[o.jsx(L6,{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(te,{gap:2,padding:3,children:n===void 0?o.jsx(W,{type:"supporting",children:"Open a conversation to see what it changed."}):l===void 0||u===void 0?o.jsx(W,{type:"supporting",children:"Loading…"}):u==="failed"?o.jsx(W,{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(W,{type:"supporting",children:"These are the project directory's uncommitted changes, shared with other conversations working there."}):null,u.truncated?o.jsx(W,{type:"supporting",children:"The diff is truncated; the rest is not shown."}):null,o.jsx(ML,{patch:u.patch,collapsible:!0})]}):o.jsx(W,{type:"supporting",children:u.reason})})})]})}const HL=h.lazy(()=>Promise.all([ym(()=>import("./xterm-view-CKa1-QCM.js"),__vite__mapDeps([0,1])),document.fonts.load('13px "Geist Mono Variable"').catch(()=>[])]).then(([e])=>e).catch(()=>({default:()=>o.jsx(W,{type:"supporting",className:"p-3",children:"Couldn't load the terminal. Reload the page to try again."})})));function ky(e){return e.code!==null?`exit ${e.code}`:e.signal===void 0?"exited":`signal ${e.signal}`}function _pe(e,t,n){var i,r;if(n!==void 0&&t.some(a=>a.id===n))return n;const s=e.findIndex(a=>a.id===n);return s===-1?(i=t[0])==null?void 0:i.id:(r=t[Math.min(s,t.length-1)])==null?void 0:r.id}function Rpe(e,t){const n=(e==null?void 0:e.pending)!==void 0&&t.some(r=>r.id===e.pending),s=n?e.pending:_pe((e==null?void 0:e.seen)??[],t,e==null?void 0:e.selected),i=n||e==null?void 0:e.pending;return{selected:s,memory:{...s===void 0?{}:{selected:s},...i===void 0?{}:{pending:i},seen:t}}}function Ipe(e,t,n){const s=Math.max(n,1),i=new Set(e.slice(0,s).map(r=>r.id));if(t!==void 0&&!i.has(t)&&e.some(r=>r.id===t)){const r=e.slice(0,s).at(-1);r!==void 0&&i.delete(r.id),i.add(t)}return{inline:e.filter(r=>i.has(r.id)),overflow:e.filter(r=>!i.has(r.id))}}function Lpe({terminal:e,terminals:t,connected:n,onClose:s}){const i=e.renamed?e.name:"",[r,a]=h.useState(i),[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=r.trim(),x=()=>{p===i||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(os,{isOpen:!0,onOpenChange:g=>g?void 0:s(),purpose:"form",width:480,children:o.jsx(Wn,{header:o.jsx(Ts,{title:"Rename terminal",onOpenChange:()=>s()}),content:o.jsxs(Kn,{children:[o.jsx(pt,{ref:f,label:"Name",description:"Leave empty to use the shell's window title.",placeholder:e.renamed?void 0:e.name,value:r,onChange:a,onEnter:x,hasAutoFocus:!0,isDisabled:l}),u===void 0?null:o.jsx(W,{type:"supporting",role:"alert",style:{color:"var(--danger)"},children:u})]}),footer:o.jsx(jr,{children:o.jsxs(pe,{gap:2,hAlign:"end",children:[o.jsx(K,{label:"Cancel",variant:"secondary",onClick:s}),o.jsx(K,{label:"Save",variant:"primary",isDisabled:!n||l||p===i,onClick:x})]})})})})}function Ope(){return o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 120 84",width:"120",height:"84",fill:"none","aria-hidden":"true",className:"text-muted",children:[o.jsx("rect",{x:"4.75",y:"4.75",width:"110.5",height:"74.5",rx:"10",fill:"var(--surface)"}),o.jsx("rect",{x:"4.75",y:"4.75",width:"110.5",height:"74.5",rx:"10",stroke:"currentColor",strokeOpacity:"0.45",strokeWidth:"1.5"}),o.jsx("path",{d:"M5.5 21.25h109",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"1.5"}),o.jsxs("g",{fill:"currentColor",fillOpacity:"0.4",children:[o.jsx("circle",{cx:"15.5",cy:"13",r:"2.5"}),o.jsx("circle",{cx:"23.5",cy:"13",r:"2.5"}),o.jsx("circle",{cx:"31.5",cy:"13",r:"2.5"})]}),o.jsxs("g",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M16 30.5l4.5 3.5-4.5 3.5"}),o.jsx("path",{d:"M16 59.5l4.5 3.5-4.5 3.5"})]}),o.jsx("rect",{x:"26",y:"31.5",width:"34",height:"5",rx:"2.5",fill:"currentColor",fillOpacity:"0.45"}),o.jsxs("g",{fill:"currentColor",fillOpacity:"0.2",children:[o.jsx("rect",{x:"16",y:"43",width:"62",height:"4",rx:"2"}),o.jsx("rect",{x:"16",y:"50",width:"44",height:"4",rx:"2"})]}),o.jsx("rect",{x:"26",y:"57.5",width:"6",height:"11",rx:"1",fill:"var(--primary)",className:"pinomad-terminal-cursor"})]})}const Dpe={cols:80,rows:24},_S=new WeakMap;function Bpe(e){let t=_S.get(e);return t===void 0&&_S.set(e,t=new Map),t}function Hpe(e,t){const[n,s]=h.useState();return h.useEffect(()=>{if(t!==void 0)return e.watch(t,i=>s(r=>i.kind==="loading"&&(r==null?void 0:r.state.kind)==="ready"?r:{conversationId:t,state:i}))},[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 qpe(e,t,n){const[s,i]=h.useState(0),r=`${t}\0${s}\0${n}`,[a,l]=h.useState({key:r,fit:t}),[,c]=h.useState(0),u=a.key===r?a.fit:t;return h.useLayoutEffect(()=>{const d=e.current;d!==null&&d.scrollWidth>d.clientWidth&&u>1&&l({key:r,fit:u-1})}),h.useEffect(()=>{const d=e.current;if(d===null)return;const f=new ResizeObserver(()=>{i(d.clientWidth),c(p=>p+1)});return f.observe(d),d.firstElementChild!==null&&f.observe(d.firstElementChild),()=>f.disconnect()},[e]),u}function Ppe({terminals:e,conversationId:t,connected:n,stacked:s,barStart:i,barEnd:r}){const{state:a,confirmed:l}=Hpe(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(),y=Bpe(e),v=c===void 0?void 0:y.get(c.owner),m=c===void 0?void 0:Rpe(v,c.terminals);h.useEffect(()=>{c!==void 0&&m!==void 0&&y.get(c.owner)===v&&y.set(c.owner,m.memory)});const k=m==null?void 0:m.selected,w=c==null?void 0:c.terminals.find(_=>_.id===k),S=(_,T=!1)=>{c!==void 0&&(y.set(c.owner,{...T?{selected:k,pending:_}:{selected:_},seen:c.terminals}),d(O=>O+1))},E=_=>{g(void 0),_.catch(T=>g(T instanceof Error?T.message:String(T)))},A=()=>{t!==void 0&&(g(void 0),e.open(t,Dpe).then(_=>S(_,!0),_=>g(_ instanceof Error?_.message:String(_))))},z=_=>E(e.restart(_.id,{cols:_.cols,rows:_.rows})),N=_=>E(e.close(_.id)),M=c!==void 0&&c.terminals.length>=c.limit,$=c===void 0||c.terminals.length===0?null:o.jsx(Upe,{list:c,selectedId:k,live:u,onSelect:_=>S(_),onRename:p,onRestart:z,onClose:N,onNew:M?void 0:A}),R=c===void 0||c.terminals.length===0?null:o.jsx(ht,{icon:o.jsx(cf,{className:"size-4","aria-hidden":"true"}),label:"New terminal",size:"sm",variant:"ghost",tooltip:M?`Terminal limit reached (${c.limit})`:"New terminal",isDisabled:!u||M,onClick:A});return o.jsxs(te,{className:"h-full min-h-0 bg-surface",gap:0,children:[s?o.jsxs(o.Fragment,{children:[o.jsx(pf,{start:i,end:r,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:$}),R]})]}):o.jsx(pf,{start:i,end:o.jsxs(o.Fragment,{children:[R,r]}),children:$}),!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(W,{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(by,{children:"Open a conversation to use its terminals."}):a===void 0||a.kind==="loading"?o.jsx(by,{children:"Loading…"}):a.kind==="unavailable"?o.jsx(by,{children:a.reason}):w===void 0?o.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:o.jsxs(te,{gap:5,hAlign:"center",children:[o.jsx(Ope,{}),o.jsx(K,{label:"New terminal",variant:"secondary",isDisabled:!u,onClick:A})]})}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(h.Suspense,{fallback:null,children:o.jsx(HL,{terminals:e,terminalId:w.id,enabled:u&&w.exit===void 0},w.id)})}),w.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(W,{type:"supporting",className:"min-w-0 flex-1",children:w.exit.code===null?"The process exited.":`The process exited with code ${w.exit.code}.`}),o.jsx(K,{label:"Restart",variant:"secondary",size:"sm",isDisabled:!u,onClick:()=>z(w)})]})]})}),f===void 0?null:o.jsx(Lpe,{terminal:f,terminals:e,connected:u,onClose:()=>p(void 0)})]})}function by({children:e}){return o.jsx(W,{type:"supporting",className:"p-3",children:e})}function Upe({list:e,selectedId:t,live:n,onSelect:s,onRename:i,onRestart:r,onClose:a,onNew:l}){const c=h.useRef(null),[u,d]=h.useState(),f=qpe(c,e.terminals.length,e.terminals.map(v=>`${v.name}\0${v.exit===void 0?"":ky(v.exit)}`).join("")),{inline:p,overflow:x}=Ipe(e.terminals,t,f),g=v=>{var k,w;if(!(v.target instanceof Element)||((k=c.current)==null?void 0:k.contains(v.target))!==!0)return;const m=(w=v.target.closest("[data-tab-value]"))==null?void 0:w.getAttribute("data-tab-value");d(e.terminals.find(S=>S.id===m))},y=u===void 0?[{label:"New terminal",icon:o.jsx(cf,{"aria-hidden":"true",size:16}),isDisabled:l===void 0,onClick:()=>l==null?void 0:l()}]:[{label:"Rename",icon:o.jsx(Yb,{"aria-hidden":"true",size:16}),onClick:()=>i(u)},{label:"Restart",icon:o.jsx(C0,{"aria-hidden":"true",size:16}),onClick:()=>r(u)},{type:"divider"},{label:"Close",icon:o.jsx(cN,{"aria-hidden":"true",size:16}),onClick:()=>a(u)}];return o.jsx("div",{className:"min-w-0 flex-1",onPointerDownCapture:g,onContextMenuCapture:g,children:o.jsx(_m,{label:"Terminal actions",size:"sm",items:y,isDisabled:!n,children:o.jsx("div",{ref:c,className:"overflow-hidden",children:o.jsxs(b$,{size:"sm",value:t??"",onChange:s,children:[p.map(v=>o.jsxs("span",{className:"pinomad-terminal-tab-slot group",children:[o.jsx(j$,{value:v.id,label:v.name,className:v.exit===void 0?"pinomad-terminal-tab":"pinomad-terminal-tab text-muted",onAuxClick:m=>{m.button===1&&n&&a(v)},endContent:v.exit===void 0?void 0:o.jsx("span",{className:"text-xs text-muted",children:ky(v.exit)})}),o.jsx(ht,{icon:o.jsx(j0,{className:"size-3.5","aria-hidden":"true"}),label:`Close ${v.name}`,size:"sm",variant:"ghost",tabIndex:-1,isDisabled:!n,className:v.id===t?"pinomad-terminal-tab-close":"pinomad-terminal-tab-close opacity-0 group-hover:opacity-100 focus-visible:opacity-100",onClick:()=>a(v)})]},v.id)),x.length===0?null:o.jsx(S$,{label:`${x.length} more`,options:x.map(v=>({value:v.id,label:v.exit===void 0?v.name:`${v.name} (${ky(v.exit)})`}))})]})})})})}const qL=[{id:"tasks",label:"Tasks",icon:o.jsx(w0,{className:"size-4","aria-hidden":"true"})},{id:"changes",label:"Changes",icon:o.jsx(rN,{className:"size-4","aria-hidden":"true"})},{id:"terminal",label:"Terminal",icon:o.jsx(a2,{className:"size-4","aria-hidden":"true"})}];function Fpe(e){var t;return((t=qL.find(n=>n.id===e))==null?void 0:t.id)??"tasks"}function RS(){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 PL({narrow:e,open:t,surface:n,liveActivity:s,onSelect:i}){return e?o.jsxs("span",{className:"relative",children:[o.jsx(ht,{icon:o.jsx(Aee,{className:"size-4"}),label:"Side panel",size:"sm",tooltip:"Show side panel",variant:"ghost",onClick:()=>i(n)}),!t&&s?o.jsx(RS,{}):null]}):o.jsx(o.Fragment,{children:qL.map(r=>{const a=t&&n===r.id;return o.jsxs("span",{className:"relative",children:[o.jsx(ht,{"aria-pressed":a,className:a?"bg-[var(--color-overlay-pressed)]":void 0,icon:r.icon,label:r.label,size:"sm",tooltip:a?`Hide ${r.label}`:`Show ${r.label}`,variant:"ghost",onClick:()=>i(r.id)}),r.id==="tasks"&&!a&&s?o.jsx(RS,{}):null]},r.id)})})}const Vpe={"needs-answer":"warning",failed:"error",running:"success"},Gpe={"needs-answer":"Waiting for your answer",failed:"Failed",running:"Running"};function UL({status:e}){return e===void 0?null:o.jsx("span",{"aria-hidden":"true",children:o.jsx(br,{variant:Vpe[e],label:Gpe[e],isPulsing:e!=="failed"})})}function Wpe({view:e,remote:t,shownId:n,barStart:s,barEnd:i,openInPanel:r,onOpenInMain:a}){var $,R,_;const l=fo(6e4),c=n===void 0?void 0:b1(e.organized,n),u=c==null?void 0:c.summary.id,d=e.side!==void 0&&c!==void 0&&(($=b1(e.organized,e.side.id))==null?void 0:$.summary.id)===c.summary.id?e.side:void 0,f=d===void 0||(R=to(e.organized,d.id))==null?void 0:R.summary,p=OL(t.processes,u),x=(p==null?void 0:p.processes)??[],[g,y]=h.useState(),v=d==null?void 0:d.id;h.useEffect(()=>y(void 0),[u]),h.useEffect(()=>{v!==void 0&&y(void 0)},[v]);const m=c===void 0?[]:Lb(c),k=g!==void 0&&g.rootId===u?x.find(T=>T.id===g.id):void 0,w=()=>void t.controller.showSide(void 0),S=T=>{u!==void 0&&(e.side!==void 0&&t.controller.showSide(void 0),y({rootId:u,id:T}))};if(d!==void 0&&(f==null?void 0:f.kind)==="subagent")return o.jsxs(te,{className:"h-full min-h-0",gap:0,children:[o.jsxs(pf,{start:s,end:i,children:[o.jsx(ht,{icon:o.jsx(fu,{className:"size-4","aria-hidden":"true"}),label:"Back to tasks",size:"sm",variant:"ghost",onClick:w}),o.jsx(UL,{status:f.status}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:k0(f)})]}),o.jsx(ixe,{view:e,side:d,onStop:dz(f,((_=e.host)==null?void 0:_.protocol.minor)??0)&&e.connection==="connected"?()=>void t.controller.abort(d.id):void 0,openInPanel:r,onOpenInMain:a,onLoadEarlier:()=>t.controller.loadEarlier(d.id)})]});if(k!==void 0&&p!==void 0&&u!==void 0)return o.jsx(sxe,{process:k,list:p,remote:t,conversationId:u,barStart:s,barEnd:i,onBack:()=>y(void 0)},k.id);const{active:E,done:A,failed:z}=LL(m.flatMap(T=>T.tasks.map(O=>O.summary))),N=x.filter(T=>hf(T.state)).length,M=[E.length>0?`${E.length} running`:void 0,A>0?`${A} done`:void 0,z>0?`${z} failed`:void 0,N>0?`${N} ${N===1?"process":"processes"} running`:void 0].filter(T=>T!==void 0);return o.jsxs(te,{className:"h-full min-h-0",gap:0,children:[o.jsx(pf,{start:s,end:i,children:o.jsx("span",{className:"truncate text-sm text-muted",children:M.join(" · ")})}),o.jsx(Kpe,{children:m.length===0&&x.length===0?o.jsx(W,{type:"supporting",className:"p-3 text-muted",children:"No tasks yet"}):o.jsxs(o.Fragment,{children:[m.map(T=>o.jsx(wn,{density:"compact",header:o.jsx("div",{className:"px-3 pt-2",children:o.jsx(W,{type:"label",weight:"semibold",children:T.label})}),children:T.tasks.map(O=>o.jsx(Xpe,{summary:O.summary,now:l,onOpen:()=>r(O.summary.id)},O.summary.id))},T.owner.id)),x.length===0?null:o.jsx(nxe,{processes:x,onOpen:S})]})})]})}function Kpe({children:e}){return o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e})}function Xpe({summary:e,now:t,onOpen:n}){return o.jsx(yt,{label:k0(e),description:e.status==="running"&&e.activity!==void 0?`→ ${Go(e.activity.tool)??e.activity.tool}${e.activity.target===void 0?"":` ${e.activity.target}`}`:void 0,startContent:o.jsx(UL,{status:e.status}),endContent:e.updatedAt===void 0?void 0:o.jsx("span",{"aria-hidden":"true",className:"text-xs text-muted",children:y0(e.updatedAt,t)}),onClick:n})}function Zpe(e){const t=Math.max(0,Math.floor(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function Ype({startedAt:e}){const t=fo(1e3);return o.jsx(o.Fragment,{children:Zpe(t-e)})}function Qpe(e){return e==="starting"||e==="running"?"running":e==="lost"||typeof e=="object"&&"failed"in e?"failed":typeof e=="object"&&"exited"in e?e.signal===void 0&&e.exited===0?"done":"failed":"stopped"}const Jpe={running:{variant:"success",pulse:!0,label:"Running"},done:{variant:"neutral",pulse:!1,label:"Done"},failed:{variant:"error",pulse:!1,label:"Failed"},stopped:{variant:"neutral",pulse:!1,label:"Stopped"}};function FL({state:e}){const t=Jpe[Qpe(e)];return o.jsx("span",{"aria-hidden":"true",children:o.jsx(br,{variant:t.variant,label:e==="starting"?"Starting":t.label,isPulsing:t.pulse})})}function exe(e){return e==="lost"?"Lost":typeof e=="object"&&"failed"in e?"Failed":typeof e=="object"&&"stopped"in e?"Stopped":typeof e=="object"&&"exited"in e?e.signal!==void 0?e.signal:`exit ${e.exited??"?"}`:""}function txe({process:e,onOpen:t}){return o.jsx(yt,{label:e.name,description:e.name===e.command?void 0:o.jsx("span",{className:"block truncate font-mono",children:e.command}),startContent:o.jsx(FL,{state:e.state}),endContent:o.jsx("span",{"aria-hidden":"true",className:"text-xs text-muted tabular-nums",children:hf(e.state)?o.jsx(Ype,{startedAt:e.startedAt}):exe(e.state)}),onClick:t})}function nxe({processes:e,onOpen:t}){return o.jsx(wn,{density:"compact",header:o.jsx("div",{className:"px-3 pt-2",children:o.jsx(W,{type:"label",weight:"semibold",children:"Processes"})}),children:Mpe(e).map(n=>o.jsx(txe,{process:n,onOpen:()=>t(n.id)},n.id))})}function sxe({process:e,list:t,remote:n,conversationId:s,barStart:i,barEnd:r,onBack:a}){const[l,c]=h.useState(),[u,d]=h.useState(!1),[f,p]=h.useState(),x=hf(e.state)&&t.unavailable===void 0,g=e.state==="lost"?"The host restarted, so this process's output is no longer available.":void 0,y=t.unavailable??g??l,v=Tpe(e.state)+(e.state==="lost"&&e.pid!==void 0?` (pid ${e.pid})`:""),m=()=>{d(!0),p(void 0),n.processes.stop(s,e.id).then(()=>d(!1),k=>{p(k instanceof Error?k.message:String(k)),d(!1)})};return o.jsxs(te,{className:"h-full min-h-0",gap:0,children:[o.jsxs(pf,{start:i,end:o.jsxs(o.Fragment,{children:[x?o.jsx(K,{label:"Stop",size:"sm",variant:"secondary",isDisabled:u,onClick:m}):null,r]}),children:[o.jsx(ht,{icon:o.jsx(fu,{className:"size-4","aria-hidden":"true"}),label:"Back to tasks",size:"sm",variant:"ghost",onClick:a}),o.jsx(FL,{state:e.state}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:e.name})]}),o.jsxs("div",{className:"shrink-0 border-b border-border px-3 py-2",children:[o.jsx("div",{className:"break-all font-mono text-xs",children:e.command}),o.jsx("div",{className:"mt-1 text-xs text-muted",children:v}),f===void 0?null:o.jsx(W,{type:"supporting",role:"alert",className:"mt-1",children:f})]}),o.jsx("div",{className:"min-h-0 flex-1",children:y===void 0?o.jsx(h.Suspense,{fallback:null,children:o.jsx(HL,{processes:n.processes,processId:e.id,onEnded:c})}):o.jsx(W,{type:"supporting",className:"block p-3 text-muted",children:y})}),o.jsx("div",{className:"shrink-0 border-t border-border p-2 text-center text-xs text-muted",children:"Background processes stop when the host restarts."})]})}function ixe({view:e,side:t,onStop:n,openInPanel:s,onOpenInMain:i,onLoadEarlier:r}){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(IL,{}):o.jsx(RL,{conversation:t.conversation,onLoadEarlier:r,docs:t.docs,submissions:e.submissions,mergeQueuedSubmissions:!0,toolPresentations:e.toolPresentations,connected:e.connection==="connected",canFork:!1,openInPanel:s,onOpenFork:i,onFork:()=>{},summaryOf:a=>{var l;return(l=to(e.organized,a))==null?void 0:l.summary},forksAt:a=>uz(e.organized,t.id,a)})}),o.jsxs(pe,{gap:2,hAlign:"center",className:"shrink-0 border-t border-border p-2",children:[n===void 0?null:o.jsx(K,{label:"Stop",variant:"secondary",size:"sm",onClick:n}),o.jsx(K,{label:"Open in main",variant:"ghost",size:"sm",onClick:()=>i(t.id)})]})]})}const IS=360,LS=1200;function rxe(e){const[t,n]=h.useState();return h.useEffect(()=>{const s=e==null?void 0:e.parentElement,i=e==null?void 0:e.previousElementSibling;if(s==null||!(i instanceof HTMLElement))return;const r=()=>n(s.clientWidth-parseFloat(getComputedStyle(i).minWidth));r();const a=new ResizeObserver(r);return a.observe(s),()=>a.disconnect()},[e]),t}function OS({view:e,remote:t,shownId:n,narrow:s,open:i,surface:r,busy:a,liveActivity:l,onOpenChange:c,onSelectSurface:u,openInPanel:d,onOpenInMain:f}){const[p,x]=h.useState(null),g=rxe(p),y=Math.max(IS,Math.min(LS,g??LS)),v=g$({defaultSize:440,minSizePx:IS,maxSizePx:y,autoSaveId:"pinomad-side-panel"}),{size:m,resize:k}=v;h.useEffect(()=>{m>y&&k(y)},[m,y,k]);const w=(S,E)=>r==="changes"?o.jsx(Npe,{view:e,remote:t,shownId:n,busy:a,barStart:S,barEnd:E}):r==="terminal"?o.jsx(Ppe,{terminals:t.terminals,conversationId:n,connected:e.connection==="connected",stacked:s,barStart:S,barEnd:E}):o.jsx(Wpe,{view:e,remote:t,shownId:n,barStart:S,barEnd:E,openInPanel:d,onOpenInMain:f});return s?o.jsx(os,{isOpen:i,onOpenChange:c,variant:"fullscreen","aria-label":"Side panel",children:o.jsx(Wn,{content:o.jsx(Kn,{padding:0,children:w(o.jsx(PL,{narrow:!1,open:!0,surface:r,liveActivity:l,onSelect:u}),o.jsx(ht,{icon:o.jsx(j0,{className:"size-4","aria-hidden":"true"}),label:"Close side panel",size:"sm",variant:"ghost",onClick:()=>c(!1)}))})})}):i?o.jsxs("div",{ref:x,className:"pigui-pane pigui-side-pane relative h-full min-w-[360px]",style:{width:v.size},"aria-label":"Side panel",role:"complementary",children:[o.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:w()}),o.jsx(C3,{direction:"horizontal",position:"overlay",className:"start-[calc(-0.5rem-var(--pigui-pane-gap)/2-1px)]! end-auto!",pillPlacement:"center",isReversed:!0,label:"Resize side panel",resizable:v.props})]}):null}const oxe=e=>e.totalTokens||e.input+e.output+e.cacheRead+e.cacheWrite;function axe(e,t){var n;if(!(t===void 0||!(t>0)))for(let s=e.entries.length-1;s>=0;s-=1){const i=e.entries[s];if(i.kind==="pi.compaction"||i.kind==="pi.reset")return;if(i.kind!=="pi.assistant")continue;const r=(n=i.model)==null?void 0:n[0];if((r==null?void 0:r.role)!=="assistant"||r.stopReason==="aborted"||r.stopReason==="error")continue;const a=r.usage?oxe(r.usage):0;if(a>0)return{used:a,window:t}}}const lxe=80,N1=e=>e>=1e6?`${+(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:`${Math.round(e)}`,DS=e=>e<.01?"<$0.01":`$${e.toFixed(2)}`,om=e=>Math.round(e.used/e.window*100),VL=e=>e!==void 0&&om(e)>=lxe,GL=[{key:"system",label:"System",color:"var(--pigui-data-slate)"},{key:"skills",label:"Skills",color:"var(--pigui-data-amber)"},{key:"tools",label:"Tools",color:"var(--pigui-data-green)"},{key:"mcp",label:"MCP",color:"var(--pigui-data-orange)"},{key:"messages",label:"Messages",color:"var(--pigui-data-blue)"}];function cxe({usage:e}){return o.jsx("span",{className:VL(e)?"text-warning":"text-muted",children:e===void 0?"—":`${om(e)}% · ${N1(e.used)} / ${N1(e.window)}`})}function uxe({usage:e,breakdown:t}){const n=e===void 0?[]:t===void 0?[{key:"used",tokens:e.used,className:VL(e)?"bg-warning":"bg-muted",color:void 0}]:GL.filter(i=>t[i.key]>0).map(i=>({key:i.key,tokens:t[i.key],className:void 0,color:i.color})),s=e===void 0?1:Math.max(e.window,e.used);return o.jsx("div",{className:"flex h-1.5 gap-px overflow-hidden rounded-full bg-default",...e===void 0?{"aria-label":"Context usage unknown"}:{role:"meter","aria-label":`Context ${om(e)}% used, ${N1(e.used)} of ${N1(e.window)} tokens`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,om(e))},"data-testid":"context-meter",children:n.map(i=>o.jsx("span",{className:i.className,style:{width:`${i.tokens/s*100}%`,...i.color===void 0?{}:{backgroundColor:i.color}}},i.key))})}function dxe(e,t){if(t!==void 0)for(const n of e){const s=jl(n.presentation,n.value);if(s.type==="pinomad.context"&&s.value.used===t.used)return s.value}}function fxe({breakdown:e,window:t}){return o.jsx("ul",{"aria-label":"Context breakdown",className:"flex flex-col pb-1",children:GL.filter(n=>e[n.key]>0).map(n=>o.jsxs("li",{className:"flex h-6 items-center gap-2 text-xs tabular-nums",children:[o.jsx("span",{"aria-hidden":!0,className:"size-2 shrink-0 rounded-[2px]",style:{backgroundColor:n.color}}),o.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.label}),o.jsx("span",{className:"text-muted",children:N1(e[n.key])}),o.jsxs("span",{className:"w-8 text-end text-muted",children:[Math.round(e[n.key]/t*100),"%"]})]},n.key))})}const hxe={pending:"pending",in_progress:"in progress",completed:"completed"};function pxe({doc:e}){if(e.value===null)return null;const t=jl(e.presentation,e.value),n=t.type==="pinomad.todo"?"Todo":t.type==="pinomad.question"?"Questions":e.kind,s=t.type==="pinomad.todo"?o.jsx(xxe,{doc:t.value}):t.type==="pinomad.question"?o.jsx(mxe,{doc:t.value}):o.jsx(vxe,{value:t.value});return o.jsxs(te,{gap:1,children:[o.jsx(W,{type:"label",weight:"semibold",children:n}),s]})}function xxe({doc:e}){return o.jsx(wn,{density:"compact",children:e.items.length===0?o.jsx(yt,{label:"Empty"}):e.items.map((t,n)=>o.jsx(yt,{label:t.text,startContent:o.jsx($s,{label:hxe[t.status],size:"sm"})},n))})}function gxe(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 i=[s.selected.join(", "),...s.other===void 0?[]:[`other: "${s.other}"`]].filter(r=>r!=="").join("; ");return{label:i===""?"skipped":i,color:"green"}}function mxe({doc:e}){return o.jsx(wn,{density:"compact",children:e.requests.length===0?o.jsx(yt,{label:"Empty"}):e.requests.flatMap(t=>t.questions.map((n,s)=>{const i=gxe(t,s);return o.jsx(yt,{label:n.question,description:i.label,startContent:o.jsx($s,{label:n.header,size:"sm"})},`${t.id}-${s}`)}))})}function vxe({value:e}){const t=typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.entries(e):[["value",e]];return o.jsx(wn,{density:"compact",children:t.map(([n,s])=>o.jsx(yt,{label:n,description:yxe(s)},n))})}function yxe(e){const t=JSON.stringify(e);return t.length<=120?t:`${t.slice(0,117)}...`}const BS=3;function kxe(e,t,n,s,i){const[r,a]=h.useState({kind:"loading"}),l=h.useRef(0),c=h.useCallback(()=>{const d=++l.current;e.controller.changes().then(f=>{d===l.current&&a(DL(f))},()=>{d===l.current&&a({kind:"failed"})})},[e]);h.useEffect(()=>a({kind:"loading"}),[t]),h.useEffect(()=>(i&&s&&c(),()=>{l.current++}),[c,t,s,i]);const u=h.useRef(n);return h.useEffect(()=>{u.current&&!n&&i&&s&&c(),u.current=n},[n,i,s,c]),r}const WL="pinomad.overview.collapsed";function HS(){try{return JSON.parse(window.localStorage.getItem(WL)??"{}")}catch{return{}}}const KL="flex shrink-0 flex-col gap-0.5 rounded-[var(--radius-element)] border border-[var(--color-border)] bg-[var(--color-background-popover)] px-2.5";function w2({section:e,title:t,summary:n,children:s}){const[i,r]=h.useState(()=>HS()[e]===!0),[a,l]=h.useState(!1),c=h.useId(),u=()=>{window.localStorage.setItem(WL,JSON.stringify({...HS(),[e]:!i})),r(!i),l(!0)};return o.jsxs("section",{className:`${KL} pt-1 ${i?"pb-1":"pb-1.5"}`,children:[o.jsx("h2",{className:"-mx-1.5",children:o.jsxs("button",{type:"button","aria-expanded":!i,"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:i?n:null}),o.jsx(tr,{"aria-hidden":!0,className:`size-3.5 shrink-0 motion-safe:transition-transform motion-safe:duration-150 motion-safe:ease-out ${i?"":"rotate-90"}`})]})}),o.jsx("div",{id:c,hidden:i,className:`flex flex-col gap-0.5 ${a?"motion-safe:animate-[pigui-overview-reveal_150ms_ease-out]":""}`,children:s})]})}function sa({icon:e,iconLabel:t,children:n,end:s,title:i,onClick:r}){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 r===void 0?o.jsx("div",{className:l,title:i,children:a}):o.jsx("button",{type:"button",className:`${l} hover:bg-surface-hover focus-visible:bg-surface-hover`,title:i,onClick:r,children:a})}function bxe({view:e,remote:t,conversation:n,busy:s,onOpenChanges:i}){var p;const r=M6(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":r==null?void 0:r.split("/").at(-1),d=kxe(t,n.conversation.id,s,e.connection==="connected",!l),f=BL(e,d);return o.jsxs(w2,{section:"workspace",title:"Workspace",summary:l||d.kind==="unavailable"?f:o.jsx(L6,{stat:d}),children:[r===void 0?null:o.jsx(sa,{icon:c?o.jsx(xee,{className:"size-4"}):o.jsx(E1,{className:"size-4"}),iconLabel:l?void 0:c?"Git worktree":"Project folder",title:r,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:`‎${r}`})]})}),f===void 0?null:o.jsx(sa,{icon:o.jsx(oN,{className:"size-4"}),children:f}),l?null:o.jsx(wxe,{stat:d,onOpen:i})]})}function wxe({stat:e,onOpen:t}){return e.kind==="unavailable"?null:o.jsx(sa,{icon:o.jsx(rN,{className:"size-4"}),end:o.jsx(L6,{stat:e}),onClick:t,children:"Changes"})}function jxe({view:e,conversation:t}){const n=Ei(e.models,M6(t).model),s=axe(t,n==null?void 0:n.contextWindow),i=dxe(e.docs,s),r=vhe(t).reduce((l,c)=>l+c.cost,0),a=s===void 0?"—":`${Math.round(s.used/s.window*100)}%`;return o.jsxs(w2,{section:"usage",title:"Usage",summary:r>0?`${a} · ${DS(r)}`:a,children:[o.jsx(sa,{end:o.jsx(cxe,{usage:s}),children:"Context"}),o.jsx("div",{className:"pb-1.5",children:o.jsx(uxe,{usage:s,breakdown:i})}),s===void 0||i===void 0?null:o.jsx(fxe,{breakdown:i,window:s.window}),r>0?o.jsx(sa,{end:o.jsx("span",{className:"text-muted",children:DS(r)}),children:"Spent"}):null]})}function Sxe({view:e,conversation:t,onOpenTasks:n}){const s=b1(e.organized,t.conversation.id),i=s===void 0?[]:Lb(s).flatMap(d=>d.tasks.map(f=>f.summary));if(i.length===0)return null;const{active:r,done:a,failed:l}=LL(i),c=r.length-BS,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(w2,{section:"subagents",title:"Subagents",summary:r.length>0?`${r.length} running`:u.join(" · "),children:[r.slice(0,BS).map(d=>o.jsx(sa,{icon:o.jsx(br,{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:Go(d.activity.tool)??d.activity.tool}),onClick:()=>n(d.id),children:k0(d)},d.id)),u.length===0?null:o.jsx(sa,{icon:null,onClick:()=>n(),children:o.jsx("span",{className:"text-muted",children:u.join(" · ")})})]})}const Cxe={connecting:"warning",connected:"success",failed:"error",disabled:"neutral"};function Exe({view:e}){const t=e.mcp;if(t===null||t.servers.length===0&&t.errors.length===0)return null;const n=t.servers.filter(i=>i.state==="failed").length+t.errors.length,s=t.servers.filter(i=>i.state==="connected").length;return o.jsxs(w2,{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(i=>o.jsx(sa,{icon:o.jsx(br,{variant:Cxe[i.state],label:i.state,isPulsing:i.state==="connecting"}),title:i.error,end:o.jsx("span",{className:"text-xs text-muted",children:i.state==="connected"?`${i.tools} tool${i.tools===1?"":"s"}`:i.state}),children:i.name},i.name)),t.errors.map((i,r)=>o.jsx(sa,{icon:o.jsx(br,{variant:"error",label:"config error"}),title:i,children:o.jsx("span",{className:"text-danger",children:i})},r))]})}function $xe({view:e,remote:t}){const n=e.docs.filter(s=>{if(s.value===null)return!1;const i=jl(s.presentation,s.value).type;return i!=="pinomad.todo"&&i!=="pinomad.question"&&i!=="pinomad.context"});return n.length===0?null:o.jsx(o.Fragment,{children:n.map(s=>o.jsx("section",{className:`${KL} py-2`,children:o.jsx(pxe,{doc:s,remote:t,connected:e.connection==="connected"})},s.kind))})}function Axe({view:e,remote:t,conversation:n,narrow:s,busy:i,onOpenChanges:r,onOpenTasks:a,onClose:l}){return o.jsxs("aside",{"aria-label":"Overview",className:`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-1.5 overflow-y-auto`,onKeyDown:c=>{c.key==="Escape"&&(c.stopPropagation(),l())},children:[o.jsx(bxe,{view:e,remote:t,conversation:n,busy:i,onOpenChanges:r}),o.jsx(jxe,{view:e,conversation:n}),o.jsx(Sxe,{view:e,conversation:n,onOpenTasks:a}),o.jsx(Exe,{view:e}),o.jsx($xe,{view:e,remote:t})]})}function Mxe(e){return e.flatMap(t=>{const n=jl(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 Txe(e,t,n){return Array.from({length:e},(s,i)=>({selected:t[i]??[],...n[i]===void 0||n[i].trim()===""?{}:{other:n[i]}}))}const qS="cubic-bezier(0.32, 0.72, 0, 1)",PS=280,Nh=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches;function zxe(e){const t=h.useRef(null),[n,s]=h.useState(0),i=h.useRef(n);i.current=n;const r=h.useRef(!1),a=h.useRef(null),l=h.useRef(!1),c=h.useRef(void 0),u=h.useCallback(y=>{var v,m;return((m=(v=t.current)==null?void 0:v.children[y])==null?void 0:m.offsetHeight)??0},[]),d=h.useCallback((y,v)=>{if(Nh()||Math.abs(y.offsetHeight-v)<1){y.style.transition="",y.style.height=`${v}px`;return}y.style.height=`${y.offsetHeight}px`,y.style.transition=`height ${PS}ms ${qS}`,y.style.height=`${v}px`},[]),f=h.useCallback((y=!1)=>{const v=t.current;if(v===null||v.clientWidth===0||r.current)return;const m=Math.min(e-1,Math.max(0,v.scrollLeft/v.clientWidth)),k=Math.floor(m),w=u(k),S=u(Math.min(k+1,e-1)),E=w+(S-w)*(m-k);if(y&&l.current&&m===k){d(v,E);return}v.style.transition="",v.style.height=`${E}px`},[e,u,d]),p=h.useCallback(()=>{const y=t.current;a.current=null,y!==null&&!r.current&&s(Math.min(e-1,Math.max(0,Math.round(y.scrollLeft/Math.max(y.clientWidth,1)))))},[e]),x=h.useCallback(()=>{const y=t.current;if(y===null||y.clientWidth===0)return;window.clearTimeout(c.current),c.current=window.setTimeout(p,150),y.scrollTop!==0&&(y.scrollTop=0),f();const v=y.scrollLeft/y.clientWidth;if(a.current!==null){if(Math.abs(v-a.current)>.01)return;a.current=null}r.current||s(Math.min(e-1,Math.max(0,Math.round(v))))},[e,f,p]),g=h.useCallback(y=>{var S,E;const v=t.current;if(v===null)return;const m=Math.min(e-1,Math.max(0,y)),k=Math.abs(m-i.current);if(k<=1||Nh()){k>0&&!Nh()&&(a.current=m),v.scrollTo({left:m*v.clientWidth,behavior:Nh()?"instant":"smooth"}),s(m);return}const w=Math.sign(m-i.current);r.current=!0,v.style.height=`${v.offsetHeight}px`,v.scrollTo({left:m*v.clientWidth,behavior:"instant"}),s(m),d(v,u(m)),(E=(S=v.children[m])==null?void 0:S.firstElementChild)==null||E.animate([{opacity:0,transform:`translateX(${w*24}px)`},{opacity:1,transform:"none"}],{duration:220,easing:qS}),window.setTimeout(()=>{r.current=!1,f(!0)},PS)},[e,u,d,f]);return h.useLayoutEffect(()=>f(),[f]),h.useEffect(()=>{let y=!0;return document.fonts.ready.then(()=>requestAnimationFrame(()=>{y&&(l.current=!0)})),()=>{y=!1}},[]),h.useEffect(()=>{const y=t.current;if(y===null)return;let v=y.clientWidth;const m=new ResizeObserver(()=>{if(y.clientWidth!==v){v=y.clientWidth,y.scrollTo({left:i.current*v,behavior:"instant"}),f();return}f(!0)});for(const k of y.children)m.observe(k);return y.addEventListener("scrollend",p),()=>{m.disconnect(),y.removeEventListener("scrollend",p),window.clearTimeout(c.current)}},[f,p]),{ref:t,index:n,go:g,onScroll:x}}const Lr="\0other",Nxe=250;function _xe({docs:e,remote:t,connected:n,target:s}){const i=Mxe(e);return i.length===0?null:o.jsx(te,{gap:2,padding:2,"data-testid":"pending-questions",children:i.map(({kind:r,request:a})=>o.jsx(Rxe,{kind:r,request:a,remote:t,connected:n,target:s},a.id))})}function Rxe({kind:e,request:t,remote:n,connected:s,target:i}){const r=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),y=(B,I)=>l(D=>D.map((q,U)=>U===B?I:q)),v=(B,I)=>u(D=>D.map((q,U)=>U===B?I:q)),m=(B,I)=>f(D=>D.map((q,U)=>U===B?I:q)),k=B=>{var I;return(((I=a[B])==null?void 0:I.length)??0)>0||d[B]===!0&&(c[B]??"").trim()!==""},w=zxe(r),S=h.useRef(void 0);h.useEffect(()=>()=>window.clearTimeout(S.current),[]);const[E,A]=h.useState(null),z=w.index===r-1,N=t.questions.every((B,I)=>k(I)),M=z||N?"submit":k(w.index)?"next":"skip",$=E??M,R=()=>{window.clearTimeout(S.current),A(null)},_=B=>{R(),w.go(B)},T=h.useRef(null),O=()=>_(w.index+1),H=()=>{if(g.current||!s)return;g.current=!0,x(!0);const B=Txe(r,a,c.map((I,D)=>d[D]===!0?I:""));n.controller.answer(e,t.id,B,i).catch(()=>{g.current=!1,x(!1)})},L=B=>(I,D)=>{var q;if(D||((q=t.questions[B])==null?void 0:q.multiSelect)===!0||I===Lr||B+1>=r){R();return}window.clearTimeout(S.current),A(U=>U??M),S.current=window.setTimeout(()=>{w.go(B+1),A(null)},Nh()?0:Nxe)};return o.jsxs("section",{className:"question-card","aria-label":"The agent asks",onKeyDown:Lxe(w.index,_),children:[o.jsx("div",{ref:w.ref,className:"question-card__pager",onScroll:w.onScroll,onWheel:B=>{Math.abs(B.deltaX)>Math.abs(B.deltaY)&&R()},onTouchStart:B=>{var I;T.current=((I=B.touches[0])==null?void 0:I.clientX)??null},onTouchMove:B=>{var D;const I=(D=B.touches[0])==null?void 0:D.clientX;T.current!==null&&I!==void 0&&Math.abs(I-T.current)>8&&R()},children:t.questions.map((B,I)=>o.jsx("div",{className:"question-card__page",role:"group","aria-roledescription":"question","aria-label":`${I+1} of ${r}: ${B.header}`,inert:I!==w.index,children:o.jsx(Ixe,{question:B,selected:a[I]??[],other:c[I]??"",otherOn:d[I]===!0,onSelect:D=>y(I,D),onOther:D=>v(I,D),onOtherOn:D=>m(I,D),onPointerPick:L(I),onOtherEnter:I+1<r?O:H})},I))}),o.jsxs("div",{className:"question-card__footer",children:[o.jsx("div",{className:"question-card__back",children:w.index>0?o.jsx(K,{label:"Back",variant:"secondary",onClick:()=>_(w.index-1)}):null}),r>1?o.jsx("div",{className:"question-card__segments",role:"tablist","aria-label":"Questions",children:t.questions.map((B,I)=>o.jsx("button",{type:"button",role:"tab",className:"question-card__segment","aria-selected":I===w.index,"aria-label":`${B.header}, ${k(I)?"answered":"not answered"}`,"data-current":I===w.index||void 0,"data-answered":k(I)||void 0,tabIndex:I===w.index?0:-1,onClick:()=>_(I)},I))}):o.jsx("span",{}),o.jsx("div",{className:"question-card__action",children:$==="submit"?o.jsx(K,{label:"Submit",variant:"primary",isDisabled:!s||p,onClick:H}):$==="next"?o.jsx(K,{label:"Next",variant:"secondary",onClick:O}):o.jsx(K,{label:"Skip",variant:"secondary",onClick:O})})]})]})}function Ixe({question:e,selected:t,other:n,otherOn:s,onSelect:i,onOther:r,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 v;const y=(v=f.current)==null?void 0:v.querySelector("input");y==null||y.focus({preventScroll:!0}),y==null||y.setSelectionRange(y.value.length,y.value.length)})},x=g=>g.description===void 0||g.description===""?{}:{description:g.description};return o.jsxs(te,{gap:1,children:[o.jsx(W,{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 y=g.target;if(!(y instanceof HTMLInputElement)||y.type!=="radio"||performance.now()-d.current>1e3)return;d.current=Number.NEGATIVE_INFINITY;const v=y.value===Lr?s:t[0]===y.value;v&&(y.value===Lr?a(!1):i([])),l(y.value,v)},children:u?o.jsxs(x3,{label:e.header,isLabelHidden:!0,density:"compact",value:s?[...t,Lr]:t,onChange:g=>{i(g.filter(y=>y!==Lr)),g.includes(Lr)!==s&&p(!s)},children:[e.options.map(g=>o.jsx(tg,{label:g.label,value:g.label,...x(g)},g.label)),o.jsx(tg,{label:"Other",value:Lr})]}):o.jsxs(S3,{label:e.header,isLabelHidden:!0,size:"sm",value:s?Lr:t[0]??"",onChange:g=>{if(g===Lr){i([]),p(!0);return}i([g]),a(!1)},children:[e.options.map(g=>o.jsx(sg,{label:g.label,value:g.label,...x(g)},g.label)),o.jsx(sg,{label:"Other",value:Lr})]})}),s?o.jsx("div",{ref:f,className:"question-card__other",onKeyDown:g=>{g.key==="Enter"&&!g.nativeEvent.isComposing&&(g.preventDefault(),c())},children:o.jsx(pt,{label:"Other answer",isLabelHidden:!0,value:n,onChange:r,placeholder:"Your answer…"})}):null]})}function Lxe(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 am="pinomad.focus",US="pinomad.activeHost",Oxe=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0,Dxe=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}:Oxe(n.conversationId)?{hostKey:n.hostKey,conversationId:n.conversationId}:void 0};function Bxe(e,t){if(t.length===0)return;const n=new Set(t.map(r=>r.hostKey)),s=e.getItem(am);if(s!==null){const r=Dxe(s);if(r!==void 0&&n.has(r.hostKey))return r}const i=e.getItem(US);return i!==null&&n.has(i)?(e.setItem(am,JSON.stringify({hostKey:i})),e.removeItem(US),{hostKey:i}):{hostKey:t[0].hostKey}}function Hxe(e,t){(t==null?void 0:t.conversationId)!==void 0&&e.set(t.hostKey,t.conversationId)}function qxe(e,t){const n=e.get(t);return n===void 0?{hostKey:t}:{hostKey:t,conversationId:n}}function Pxe(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 Uxe(e,t){if(t===void 0){e.removeItem(am);return}e.setItem(am,JSON.stringify(t.conversationId===void 0?{hostKey:t.hostKey}:{hostKey:t.hostKey,conversationId:t.conversationId}))}function O6({hostKey:e}){const{hosts:t,forget:n}=Ns(),s=an(),[i,r]=h.useState(!1),a=b0(t).get(e),l=f6(s.state,e)!==void 0;return o.jsxs(te,{gap:6,className:"w-full max-w-md",children:[o.jsxs(te,{gap:2,children:[o.jsx(xn,{level:2,children:`${a??"This host"} no longer accepts this device`}),o.jsx(W,{type:"supporting",children:"This device was unpaired from it, or its pairing was never accepted. Pair again to keep using it."})]}),o.jsx(_se,{hostKey:e}),o.jsxs(te,{gap:2,children:[o.jsx(W,{weight:"semibold",children:l?"Or pair with a link":"Pair with a link"}),o.jsx(W,{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(uf,{connectVariant:l?"secondary":"primary"})]}),o.jsxs(pe,{gap:2,hAlign:"between",vAlign:"center",children:[s.state.status==="signed-out"?o.jsx(K,{label:"Sign in to pair through your account",variant:"ghost",size:"sm",onClick:()=>r(!0)}):o.jsx("span",{}),o.jsx(K,{label:a===void 0?"Unpair":`Unpair ${a}`,variant:"secondary",size:"sm",onClick:()=>void n(e)})]}),i?o.jsx(M0,{onClose:()=>r(!1)}):null]})}const Fxe="https://pinomad.si/docs/";function Vxe({state:e}){const[t,n]=h.useState(!1),[s,i]=h.useState(!1);return o.jsxs(te,{gap:6,style:{width:"100%",maxWidth:520},children:[o.jsxs(te,{gap:2,children:[o.jsx(xn,{level:2,children:"Add your first host"}),o.jsx(W,{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(e_,{serverOrigin:e.serverOrigin}),e.hostsError===void 0?null:o.jsx(Ie,{status:"warning",title:"Couldn't check for new hosts",description:Qt(e.hostsError)}),o.jsxs(te,{gap:2,children:[o.jsxs(W,{type:"supporting",children:["Not using an account?"," ",o.jsx(r0,{href:Fxe,isExternalLink:!0,children:"Pair a host directly"})]}),s?o.jsxs(te,{gap:2,children:[o.jsx(W,{type:"supporting",children:"Paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),o.jsx(uf,{})]}):o.jsx(pe,{children:o.jsx(K,{label:"Have a pairing link?",variant:"ghost",size:"sm",onClick:()=>i(!0)})}),o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsxs(W,{type:"supporting",children:["Signed in as ",e.user," on ",new URL(e.serverOrigin).host]}),o.jsx(K,{label:"Account",variant:"secondary",size:"sm",onClick:()=>n(!0)})]})]}),t?o.jsx(M0,{onClose:()=>n(!1)}):null]})}const Gxe=1e4;function Wxe(){const e=an(),t=e.state.status==="signed-in";return h.useEffect(()=>{if(!t)return;const n=setInterval(()=>{document.visibilityState==="visible"&&e.refreshHosts()},Gxe);return()=>clearInterval(n)},[e,t]),e.state.status==="signed-in"&&e.state.hosts.length===0?o.jsx(Vxe,{state:e.state}):e.state.status==="unavailable"?o.jsxs(te,{gap:4,hAlign:"center",style:{width:"100%",maxWidth:420},children:[o.jsx(ro,{title:"No host link",description:"Paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),o.jsx(uf,{})]}):o.jsxs(te,{gap:6,style:{width:"100%",maxWidth:420},children:[o.jsx(u2,{initialPage:"hosts"}),o.jsxs(te,{gap:2,children:[o.jsx(W,{type:"supporting",children:"Or paste a pairing link from pinomad pair or Settings → Devices → Pair a device."}),o.jsx(uf,{})]})]})}const XL="/host-link",Kxe=e=>{const t=new URLSearchParams(e).get("request");return t!==null&&/^[A-Za-z0-9_-]{1,64}$/.test(t)?t:void 0},FS=()=>{window.location.pathname===XL&&history.replaceState(null,"","/")};function Xxe({navigate:e=t=>window.location.assign(t)}){const[t,n]=h.useState(()=>window.location.pathname===XL),[s]=h.useState(()=>t?Kxe(window.location.search):void 0);if(!t)return null;const i=()=>{FS(),n(!1)};return o.jsx(os,{isOpen:!0,onOpenChange:r=>r?void 0:i(),width:480,children:o.jsx(Wn,{header:o.jsx(Ts,{title:"Add a host",onOpenChange:i}),content:o.jsx(Kn,{children:o.jsx("div",{style:{padding:"var(--spacing-2)"},children:o.jsx(Zxe,{requestId:s,navigate:e,onSettled:FS,onClose:i})})})})})}function Zxe({requestId:e,navigate:t,onSettled:n,onClose:s}){const{state:i}=an();switch(i.status){case"checking":return o.jsxs(pe,{gap:2,vAlign:"center",children:[o.jsx(Tt,{size:"sm"}),o.jsx(W,{type:"supporting",children:"Checking for an account…"})]});case"unavailable":return o.jsxs(te,{gap:3,children:[o.jsx(W,{children:"Confirm a host on the server it's joining: open the address its terminal printed."}),o.jsx(pe,{children:o.jsx(K,{label:"Close",variant:"secondary",onClick:s})})]});case"signed-out":return o.jsxs(te,{gap:3,children:[o.jsx(W,{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(u2,{})]});case"signed-in":return e!==void 0?o.jsx(tse,{requestId:e,navigate:t,onSettled:n,onClose:s}):o.jsxs(te,{gap:3,children:[o.jsxs(W,{type:"supporting",children:["Enter the code the host's terminal shows to add it to ",i.user,"'s account."]}),o.jsx(XN,{onSettled:n,onClose:s})]})}}const Yxe={width:"100%",color:"var(--color-text-primary)"};function Qi({children:e}){const t=Kb().reserveMacTrafficLights;return o.jsxs(te,{className:"pigui-centered",style:Yxe,isScrollable:!0,children:[t?o.jsx("div",{"aria-hidden":"true",className:"pinomad-drag fixed inset-x-0 top-0 h-10"}):null,o.jsx(te,{minHeight:"100%",style:{flexShrink:0},hAlign:"center",vAlign:"center",padding:6,children:e})]})}function Qxe({children:e}){const t=an();return t.state.status!=="signed-in"||t.state.needsEmail!==!0?o.jsx(o.Fragment,{children:e}):o.jsx(Qi,{children:o.jsx(Jxe,{account:t})})}function Jxe({account:e}){return o.jsxs(te,{gap:4,style:{width:"100%",maxWidth:420},children:[o.jsxs(te,{gap:1,children:[o.jsx(xn,{level:3,children:"Add an email to your account"}),o.jsx(W,{type:"supporting",children:"You'll sign in with it from now on, and sign-in codes go there."})]}),o.jsx(ON,{account:e,submitLabel:"Save",onSaved:()=>{}}),o.jsx(pe,{children:o.jsx(K,{label:"Sign out",variant:"secondary",onClick:()=>void e.logout()})})]})}function ege({navigate:e=t=>window.location.assign(t)}){const t=an(),[n]=h.useState(()=>E0().pending),[s,i]=h.useState(n!==void 0);if(h.useEffect(()=>{n!==void 0&&Kg("pending")},[n]),!s||n===void 0||t.state.status==="unavailable")return null;const r=()=>i(!1);return o.jsx(os,{isOpen:!0,onOpenChange:a=>a?void 0:r(),width:480,children:o.jsx(Wn,{header:o.jsx(Ts,{title:"Finish signing in",onOpenChange:r}),content:o.jsx(Kn,{children:o.jsx("div",{style:{padding:"var(--spacing-2)"},children:t.state.status==="checking"?o.jsx(Tt,{size:"sm"}):o.jsx(tge,{account:t,id:n,navigate:e,onDone:r})})})})})}const D6=(e,t,n)=>{if(!e.ok)return e.error;e.value.redirect!==void 0?t(e.value.redirect):n()};function tge({account:e,id:t,navigate:n,onDone:s}){const[i,r]=h.useState(),[a,l]=h.useState(),[c,u]=h.useState(),[d,f]=h.useState("create");if(h.useEffect(()=>{let x=!0;return e.pendingSignIn(t).then(g=>{x&&(g.ok?r(g.value):g.error.code==="not_found"?r("expired"):l(g.error))}),e.authMethods().then(g=>{x&&g.ok&&u(g.value.email)}),()=>{x=!1}},[e,t]),a!==void 0)return o.jsx(Ie,{status:"error",title:"Couldn't load this sign-in",description:Qt(a)});if(i===void 0)return o.jsx(Tt,{size:"sm"});if(i==="expired")return o.jsxs(te,{gap:3,children:[o.jsx(W,{children:"This sign-in expired. Start again."}),o.jsx(pe,{children:o.jsx(K,{label:"Back to sign-in",variant:"secondary",onClick:s})})]});const p=Ys(i.provider);return o.jsxs(te,{gap:4,children:[o.jsxs(pe,{gap:3,vAlign:"center",children:[o.jsx(Xg,{provider:i.provider,size:28}),o.jsxs(te,{gap:0,children:[o.jsx(W,{weight:"semibold",children:p}),o.jsx(W,{type:"supporting",children:i.email??i.name??"No email shared"})]})]}),o.jsxs(xn,{level:3,children:["No PiNomad account for ",i.email??`this ${p} account`," yet"]}),d==="create"?o.jsx(nge,{account:e,id:t,needsPassword:c===!1,navigate:n,onDone:s,onLink:()=>f(e.state.status==="signed-in"?"link-current":"sign-in-and-link")}):d==="link-current"&&e.state.status==="signed-in"?o.jsx(sge,{account:e,id:t,provider:p,current:e.state.email??e.state.user,navigate:n,onDone:s,onBack:()=>f("create")}):o.jsx(ige,{account:e,id:t,provider:p,navigate:n,onDone:s,onBack:()=>f("create")})]})}function nge({account:e,id:t,needsPassword:n,navigate:s,onDone:i,onLink:r}){const[a,l]=h.useState(n),[c,u]=h.useState(""),[d,f]=h.useState(!1),[p,x]=h.useState();h.useEffect(()=>{n&&l(!0)},[n]);const g=()=>{if(!d){if(a&&l6(c)<c6){x({code:"weak_password"});return}f(!0),x(void 0),e.createFromPending(t,a?{password:c}:void 0).then(y=>{if(f(!1),!y.ok&&y.error.code==="password_required"){l(!0);return}x(D6(y,s,i))})}};return o.jsxs(te,{gap:3,children:[a?o.jsx(pt,{label:"New password",type:"password",value:c,onChange:u,onEnter:g,width:"100%",...a6}):null,p===void 0?null:o.jsx(Ie,{status:"error",title:"Couldn't create the account",description:Qt(p)}),o.jsx(K,{label:"Create account",variant:"primary",width:"100%",isLoading:d,isDisabled:a&&c==="",onClick:g}),o.jsx(K,{label:"I already have an account",variant:"secondary",width:"100%",isDisabled:d,onClick:r})]})}function sge({account:e,id:t,provider:n,current:s,navigate:i,onDone:r,onBack:a}){const[l,c]=h.useState(!1),[u,d]=h.useState(),f=()=>{!p.ready||l||(c(!0),d(void 0),(async()=>{const x=await p.confirm(),g=x.ok?await e.linkPending(t,x.value):x;c(!1),!g.ok&&g.error.code==="invalid_reauth"&&p.reset(),d(D6(g,i,r))})())},p=_f(e,f);return o.jsxs(te,{gap:3,children:[o.jsxs(W,{children:["Link ",n," to ",s]}),p.field,u===void 0?null:o.jsx(Ie,{status:"error",title:`Couldn't link ${n}`,description:Qt(u)}),o.jsxs(pe,{gap:2,children:[o.jsx(K,{label:`Link ${n}`,variant:"primary",isLoading:l,isDisabled:!p.ready,onClick:f}),o.jsx(K,{label:"Back",variant:"secondary",onClick:a})]})]})}function ige({account:e,id:t,provider:n,navigate:s,onDone:i,onBack:r}){const[a,l]=h.useState(""),[c,u]=h.useState(""),[d,f]=h.useState(!1),[p,x]=h.useState(),g=a.trim()!==""&&c!=="",y=()=>{!g||d||(f(!0),x(void 0),e.signInAndLinkPending(t,{username:a.trim(),password:c}).then(v=>{f(!1),x(D6(v,s,i))}))};return o.jsxs(te,{gap:3,children:[o.jsx(pt,{label:"Email",value:a,onChange:l,onEnter:y,width:"100%",autoComplete:"username"}),o.jsx(pt,{label:"Password",type:"password",value:c,onChange:u,onEnter:y,width:"100%",autoComplete:"current-password"}),p===void 0?null:o.jsx(Ie,{status:"error",title:`Couldn't link ${n}`,description:Qt(p)}),o.jsxs(pe,{gap:2,children:[o.jsx(K,{label:`Sign in and link ${n}`,variant:"primary",isLoading:d,isDisabled:!g,onClick:y}),o.jsx(K,{label:"Back",variant:"secondary",onClick:r})]}),o.jsx(W,{type:"supporting",children:"Signed up with Google, GitHub or Apple? Sign in with it first, then link this one in Settings."})]})}function rge({knownHosts:e=d6}){const t=an(),{state:n}=t,s=zf(),[i,r]=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(K,{label:"Remove",variant:"secondary",size:"sm",onClick:()=>r({hostId:u,name:d})}),onHide:()=>a.current.delete(u)});a.current.set(u,f)}},[e,n,s]),i===void 0||n.status!=="signed-in"?null:o.jsx(u6,{account:t,hostId:i.hostId,name:i.name,serverOrigin:n.serverOrigin,onClose:l=>{var c;l&&((c=a.current.get(i.hostId))==null||c()),r(void 0)}})}const oge=15e3,age={subscribe(e){return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}}},lge={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 ZL(e,t,n){const[s,i]=h.useState({status:"connecting"});return h.useEffect(()=>{let r,a=!1;i({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:vR(e.url,e.token);const m=u;d={label:m.label,open(k){let w;w=m.open({message:k.message,opened:k.opened,authenticated:k.authenticated,closed:(E,A)=>{w!==void 0&&f.delete(w),k.closed(E,A)}});const S=w;return f.add(S),{send:E=>S.send(E),close:()=>{f.delete(S)&&S.close()}}}}}const x=(n==null?void 0:n.connect)??dde,g=(n==null?void 0:n.timeoutMs)??oge;let y;if(!c&&u!==void 0){const m=u.label;y=setTimeout(()=>{a=!0,l.abort(),p(),i({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 v=c?{...e,signal:l.signal,network:e.network??age,lifecycle:e.lifecycle??lge,...(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},...v}).then(m=>{if(y!==void 0&&clearTimeout(y),a){m.close();return}r=m,i({status:"ready",remote:m})},m=>{y!==void 0&&clearTimeout(y),a||i({status:"failed",error:m instanceof Error?m.message:String(m),unauthorized:m instanceof gx,...m instanceof kR?{mismatch:m}:{},...m instanceof yR?{direct:m}:{}})}),()=>{a=!0,y!==void 0&&clearTimeout(y),l.abort(),p(),r==null||r.close()}},[t]),s}function YL(e){return h.useSyncExternalStore(e.view.subscribe,e.view.current)}function QL({hostKey:e,device:t,target:n,candidates:s,stored:i,pairing:r,rtcPlatform:a,onPaired:l,onEndpointSet:c,setConnection:u}){const d=ao(e),f=a===void 0?void 0:{platform:a,hostKey:d,device:t,signalOnlyHint:(i==null?void 0:i.rtcSignalOnly)===!0,openSignalTransport:p=>d5({url:p.url,hostKey:d,device:t,prologue:QQ}),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,...(i==null?void 0:i.connectionMode)===void 0?{}:{connectionMode:i.connectionMode},...r===void 0?{}:{pairing:r},...f===void 0?{}:{rtc:f},...l===void 0?{}:{onPaired:l},openTransport:(p,x)=>d5({url:p.url,hostKey:d,device:t,...x===void 0?{}:{pairing:x}}),onEndpointSet:c}}const VS="pinomad.reloadedForProtocol";function JL(e){return e===void 0?VS:`${VS}.${e}`}function B6({wsUrl:e,mismatch:t,hostKey:n}){var c;const s=JL(n),i=Jb(),r=((c=window.pinomadDesktop)==null?void 0:c.updates)!==void 0,[a]=h.useState(()=>t.direction==="client-older"&&r||!Vee(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(te,{gap:4,children:[o.jsx(Ie,{status:"error",container:"section",title:"Client out of date",description:`The host speaks a newer protocol. ${r?"Update the app.":"Reload the page, or update the app."}${l}`}),r?o.jsx(vI,{update:i}):null]}):o.jsx(Ie,{status:"error",container:"section",title:"Host out of date",description:`This client speaks a newer protocol. Upgrade the host (pinomad upgrade).${l}`})}function cge(e,t,n,s={}){var f,p;const{open:i,cancel:r,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,r==null||r(),(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}i!==void 0?i(n):e.controller.switchConversation(n)}},[r,l,a,i,e,c,u,n])}function uge({hosts:e,focus:t,connect:n,renderWorkbench:s}){return o.jsx(o.Fragment,{children:e.map(i=>o.jsx(dge,{host:i,focused:(t==null?void 0:t.hostKey)===i.hostKey,focusTarget:(t==null?void 0:t.hostKey)===i.hostKey?t.conversationId:void 0,renderWorkbench:s,...n===void 0?{}:{connect:n}},i.hostKey))})}function dge({host:e,focused:t,focusTarget:n,connect:s,renderWorkbench:i}){const{endpoints:r,setConnection:a}=Ns(),l=h.useContext(c2),[c,u]=h.useState(0),d=h.useCallback(()=>u(k=>k+1),[]),f=h.useMemo(()=>new C6,[]),p=h.useMemo(()=>lf(ao(e.privateKey)),[e.privateKey]),x=h.useMemo(()=>({url:e.url,endpointSet:e.endpointSet}),[e.url,e.endpointSet]),g=h.useMemo(()=>af(x.url,x.endpointSet,{pageProtocol:window.location.protocol}),[x]),y=h.useMemo(()=>TN(),[]),v=h.useMemo(()=>QL({hostKey:e.hostKey,device:p,target:x,candidates:g,stored:e,rtcPlatform:y,setConnection:a,onEndpointSet:k=>{r(e.hostKey,k).catch(w=>console.error("Could not store the host's remote endpoints",w))}}),[g,p,r,e,y,a,x]),m=ZL(v,`${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(y4.Provider,{value:f,children:o.jsx(pge,{host:e,remote:m.remote,device:p,composer:f,focused:t,focusTarget:n,retry:d,renderWorkbench:i})}):t?o.jsx(y4.Provider,{value:f,children:m.status==="connecting"?o.jsx(Qi,{children:o.jsx(ro,{title:"Connecting",description:e.url})}):o.jsx(fge,{host:e,state:m,retry:d})}):null}function fge({host:e,state:t,retry:n}){return t.mismatch!==void 0?o.jsxs(Qi,{children:[o.jsx(B6,{wsUrl:e.url,mismatch:t.mismatch,hostKey:e.hostKey}),o.jsx(k5,{})]}):t.unauthorized?o.jsx(Qi,{children:o.jsx(O6,{hostKey:e.hostKey})}):o.jsxs(Qi,{children:[o.jsx(te,{gap:4,hAlign:"center",children:o.jsx(hge,{state:t,retry:n})}),o.jsx(k5,{})]})}function hge({state:e,retry:t}){return o.jsxs(o.Fragment,{children:[o.jsx(Ie,{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(W,{type:"supporting",style:{textAlign:"center"},children:`Details: ${e.direct.reason}`}),o.jsx(K,{label:"Retry",variant:"secondary",onClick:t})]})}function pge({host:e,remote:t,device:n,composer:s,focused:i,focusTarget:r,retry:a,renderWorkbench:l}){var m;const c=YL(t),u=h.useContext(c2),{focusConversation:d,focusDraft:f}=Ns();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]),kN(e.hostKey,c.settings);const{opening:p,open:x,cancel:g}=tN(t),y=h.useCallback(()=>f(e.hostKey),[f,e.hostKey]);if(cge(t,c,r,{open:x,cancel:g,onUnavailable:y}),eN(c,e.hostKey,i&&r!==void 0?(m=c.conversation)==null?void 0:m.conversation.id:void 0,d),!i)return null;const v=o.jsx(O6,{hostKey:e.hostKey});return l({host:e,remote:t,device:n,rejected:v,retry:a,opening:p,cancelOpening:g,openConversation:x})}const xge="pinomad_app",gge="1",mge=2592e3,vge=new URL(LN).hostname;function yge(e,t){return e!==vge?void 0:`${xge}=${gge}; Domain=pinomad.si; Path=/; Max-Age=${t?mge:0}; Secure; SameSite=Lax`}function kge(e,t,n=document){const s=yge(e,t);s!==void 0&&(n.cookie=s)}const bge={flex:1,minHeight:0},eO=e=>e.some(t=>t.summary.status==="running"||t.summary.status==="needs-answer"||eO(t.children)),tO="pinomad.overview.open",wge=()=>typeof window<"u"&&window.localStorage.getItem(tO)==="true",nO="pinomad.side-panel.surface",jge=()=>Fpe(typeof window>"u"?null:window.localStorage.getItem(nO));function Sge(){const[e]=h.useState(Zee),t=h.useMemo(Rte,[]),n=h.useRef(new Map),s=h.useRef(new Map),i=h.useRef(new Set),[r,a]=h.useState();h.useEffect(()=>{let M=!0;return e.list().catch($=>(console.error("Could not load the paired-host list",$),[])).then($=>{if(!M)return;let R=[...$];for(const T of s.current.values()){const O=R.find(H=>H.hostKey===T.hostKey);R=[...R.filter(H=>H.hostKey!==T.hostKey),O===void 0?T:Zh(O,T)]}s.current.clear();const _=Bxe(localStorage,R)??null;Hxe(n.current,_),a({hosts:R,focus:_,address:Fee(window.location.hash,window.location,R,(_==null?void 0:_.hostKey)??null)})}),()=>{M=!1}},[e]),h.useEffect(()=>{const M=()=>{window.location.hash!==""&&window.location.reload()};return window.addEventListener("hashchange",M),()=>window.removeEventListener("hashchange",M)},[]);const l=h.useCallback(M=>qxe(n.current,M),[]),c=h.useCallback(M=>{history.replaceState(null,"",window.location.pathname+window.location.search),a($=>$===void 0?$:{...$,address:void 0,focus:l(M)})},[l]),u=h.useCallback(M=>{a($=>$===void 0||!$.hosts.some(R=>R.hostKey===M.hostKey)?$:(n.current.set(M.hostKey,M.conversationId),{...$,focus:{...M}}))},[]),d=h.useCallback(M=>{a($=>($===void 0||!$.hosts.some(R=>R.hostKey===M.hostKey)||n.current.set(M.hostKey,M.conversationId),$))},[]),f=h.useCallback(M=>{n.current.delete(M),a($=>$===void 0?$:{...$,focus:{hostKey:M}})},[]),p=h.useCallback((M,$)=>{n.current.delete(M),$&&history.replaceState(null,"",window.location.pathname+window.location.search),a(R=>{var O;if(R===void 0)return R;const _=R.hosts.filter(H=>H.hostKey!==M),T=$?void 0:R.address;return((O=R.focus)==null?void 0:O.hostKey)!==M?{...R,hosts:_,address:T}:{...R,hosts:_,address:T,focus:_[0]===void 0?null:l(_[0].hostKey)}})},[l]),x=h.useCallback(M=>e.remove(M).catch($=>{console.error("Could not remove the host",$)}),[e]),g=h.useCallback(async M=>{await x(M),p(M,!1)},[p,x]),y=h.useCallback(async M=>{const $=e.list().catch(()=>(r==null?void 0:r.hosts)??[]);i.current.add(M),p(M,!0);try{const _=(await $).find(T=>T.hostKey===M)??(r==null?void 0:r.hosts.find(T=>T.hostKey===M));(_==null?void 0:_.account)!==void 0&&(wN.add(_.account),cx(_.account.hostId)),await x(M)}finally{i.current.delete(M)}},[p,r==null?void 0:r.hosts,x,e]),v=h.useCallback(async M=>{i.current.has(M.hostKey)||(await e.save(M),!i.current.has(M.hostKey)&&a($=>{if($===void 0){const _=s.current.get(M.hostKey);return s.current.set(M.hostKey,_===void 0?M:Zh(_,M)),$}const R=$.hosts.find(_=>_.hostKey===M.hostKey);return{...$,focus:$.focus??{hostKey:M.hostKey},hosts:[...$.hosts.filter(_=>_.hostKey!==M.hostKey),R===void 0?M:Zh(R,M)]}}))},[e]),m=h.useCallback(async(M,$)=>{await e.setName(M,$),a(R=>R===void 0?R:{...R,hosts:R.hosts.map(_=>_.hostKey===M?{..._,name:$}:_)})},[e]),k=h.useCallback(async(M,$)=>{await e.updateEndpoints(M,$),a(R=>R===void 0?R:{...R,hosts:R.hosts.map(_=>_.hostKey===M?Xz(_,$):_)})},[e]),w=h.useCallback(async(M,$)=>{await e.updateConnection(M,$),a(R=>R===void 0?R:{...R,hosts:R.hosts.map(_=>_.hostKey===M?Zz(_,$):_)})},[e]),S=h.useMemo(()=>r===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:r.hosts,focus:r.focus,paired:v,setName:m,endpoints:k,setConnection:w,focusHost:c,focusConversation:u,rememberConversation:d,focusDraft:f,forget:y,dropHost:g},[g,k,u,f,c,y,r,v,d,w,m,e]);if(h.useEffect(()=>{r!==void 0&&Uxe(localStorage,r.focus??void 0)},[r==null?void 0:r.focus]),r===void 0)return o.jsx(Qi,{children:null});const{address:E,focus:A,hosts:z}=r,N=M=>{history.replaceState(null,"",window.location.pathname+window.location.search),a($=>$===void 0?$:{...$,address:void 0,focus:Pxe(n.current,$.focus,M.hostKey)})};return o.jsx(yN.Provider,{value:S,children:o.jsx(c2.Provider,{value:t,children:o.jsxs(fte,{children:[o.jsx(Cge,{hostCount:z.length}),o.jsx(Qxe,{children:(E==null?void 0:E.kind)==="token"?o.jsx(sO,{options:E,connectionKey:`${E.url} ${E.token}`,label:E.url}):(E==null?void 0:E.kind)==="pair"?o.jsx(Ege,{address:E,onPairedHost:N}):z.length===0?o.jsx(Qi,{children:o.jsx(Wxe,{})}):o.jsx(Nfe,{children:o.jsx(uge,{hosts:z,focus:A,renderWorkbench:({host:M,remote:$,device:R,rejected:_,retry:T,opening:O,cancelOpening:H,openConversation:L})=>o.jsx(iO,{remote:$,wsUrl:M.url,rejected:_,device:R,hostKey:M.hostKey,onReconnect:T,notify:!1,framed:!1,hostOpening:O,hostOpen:L,hostCancelOpening:H})})})}),o.jsx(Xxe,{}),o.jsx(ege,{}),o.jsx(Nse,{stayClosed:E!==void 0||z.length===0}),o.jsx($m,{position:"topEnd",inset:{top:48},isTopLayer:!0,children:o.jsx(rge,{})})]})})})}function Cge({hostCount:e}){const{state:t}=an(),n=t.status==="signed-in"||e>0?!0:t.status==="signed-out"?!1:void 0;return h.useEffect(()=>{n!==void 0&&kge(window.location.hostname,n)},[n]),null}function Ege({address:e,onPairedHost:t}){const[n,s]=h.useState(!1),i=()=>{history.replaceState(null,"",window.location.pathname+window.location.search),window.location.reload()};if(n)return o.jsx($ge,{address:e,...t===void 0?{}:{onPairedHost:t}});const r=new URL(e.url);return o.jsx(Qi,{children:o.jsxs(te,{gap:4,hAlign:"center",style:{maxWidth:420},children:[o.jsx(ro,{title:"Pair with this host?",description:`This device will pair with ${r.host}.`}),o.jsx(W,{type:"supporting",style:{wordBreak:"break-all"},children:e.url}),o.jsxs(pe,{gap:2,children:[o.jsx(K,{label:"Cancel",variant:"secondary",onClick:i}),o.jsx(K,{label:"Pair",variant:"primary",onClick:()=>s(!0)})]})]})})}function $ge({address:e,connect:t,onPairedHost:n}){const{hosts:s,paired:i,endpoints:r,setConnection:a}=Ns(),l=h.useMemo(()=>s.find(z=>z.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?lf(ao(l.privateKey)):e.kind==="device"?lf(ao(e.privateKey)):Gb(),[e,l]),[g,y]=h.useState();h.useEffect(()=>{if(e.kind!=="pair")return;let z=!0;return n6().then(N=>{z&&y(N)}),()=>{z=!1}},[e]);const v=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(()=>af(v.url,v.endpointSet,{pageProtocol:window.location.protocol}),[v]),k=e.kind==="pair"&&!f&&g!==void 0?{secret:e.secret,name:g}:void 0,w=h.useMemo(()=>TN(),[]),S=h.useMemo(()=>{if(!(e.kind==="pair"&&g===void 0))return QL({hostKey:e.hostKey,device:x,target:v,candidates:m,stored:l,rtcPlatform:w,...k===void 0?{}:{pairing:k},setConnection:a,onPaired:()=>{if(d.current)return;d.current=!0,p(!0);const z=e.endpointSet,N={url:z===void 0?e.url:Ob(e.url,z),hostKey:e.hostKey,privateKey:Ho(x.privateKey),...z===void 0?{}:{endpointSet:z}},M=l===void 0?N:Zh(l,N);i(M).then(()=>n==null?void 0:n(M),$=>{console.error("Could not save the paired host",$),u(M)}),history.replaceState(null,"",window.location.pathname+window.location.search)},onEndpointSet:z=>{r(e.hostKey,z).catch(N=>console.error("Could not store the host's remote endpoints",N))}})},[e,m,x,r,n,i,g,k,w,a,l,v]);if(S===void 0)return o.jsx(Qi,{children:null});const E=e.kind==="pair"?o.jsxs(te,{gap:4,hAlign:"center",children:[o.jsx(ro,{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(uf,{})}),s.length===0?null:o.jsx(K,{label:"Use saved pairing",variant:"secondary",onClick:()=>{history.replaceState(null,"",window.location.pathname+window.location.search),window.location.reload()}})]}):o.jsx(O6,{hostKey:e.hostKey}),A=c===void 0?void 0:o.jsx(Ie,{status:"warning",container:"section",title:"This pairing wasn't saved",description:"It will be lost when the app restarts.",endContent:o.jsx(K,{label:"Retry",variant:"secondary",onClick:()=>{i(c).then(()=>{u(void 0),n==null||n(c)},z=>console.error("Could not save the paired host",z))}})});return o.jsx(sO,{options:S,connectionKey:e.hostKey,label:v.url,rejected:E,device:x,notice:A,hostKey:e.hostKey,...t===void 0?{}:{connect:t}})}function sO({options:e,connectionKey:t,label:n,rejected:s,device:i,notice:r,hostKey:a,connect:l}){const[c,u]=h.useState(0),d=ZL(e,`${t} ${c}`,l===void 0?void 0:{connect:l});return d.status==="connecting"?o.jsx(Qi,{children:o.jsx(ro,{title:"Connecting",description:n})}):d.status==="failed"?o.jsxs(Qi,{children:[r===void 0?null:o.jsx("div",{className:"w-full max-w-md",children:r}),d.mismatch!==void 0?o.jsx(B6,{wsUrl:n,mismatch:d.mismatch,...a===void 0?{}:{hostKey:a}}):s!==void 0&&d.unauthorized?s:o.jsxs(te,{gap:4,hAlign:"center",children:[o.jsx(Ie,{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(W,{type:"supporting",style:{textAlign:"center"},children:`Details: ${d.direct.reason}`}),d.direct===void 0?null:o.jsx(W,{type:"supporting",style:{textAlign:"center"},children:"Change this host's connection mode under Hosts below, then retry."}),o.jsx(K,{label:"Retry",variant:"secondary",onClick:()=>u(c+1)})]}),s!==void 0&&d.unauthorized?null:o.jsx(k5,{canSwitch:!0})]}):o.jsx(iO,{remote:d.remote,wsUrl:n,rejected:s,device:i,notice:r,hostKey:a,onReconnect:()=>u(c+1)})}function iO({remote:e,wsUrl:t,rejected:n,device:s,notice:i,hostKey:r,onReconnect:a,notify:l=!0,framed:c=!0,hostOpening:u,hostOpen:d,hostCancelOpening:f}){var Er,Te,tn,bs,ue,_e,Ye,Kt,cn;const p=YL(e),{hosts:x,focus:g,focusConversation:y,focusDraft:v,rememberConversation:m}=Ns(),k=h.useRef(g);k.current=g;const w=h.useRef(!0);h.useEffect(()=>(w.current=!0,()=>{w.current=!1}),[]);const S=h.useRef(null),[E,A]=h.useState(!1),z=h.useCallback(he=>{S.current===he&&(S.current=null,w.current&&A(!1))},[]),N=h.useCallback(he=>{if(S.current!==he||!he.commandSettled)return;if(he.confirmed||he.cancelled){z(he);return}const ee=e.view.current().side;ee!==void 0&&ee.id!==he.sideBeforeId||z(he)},[z,e]);kN(r,p.settings);const[M,$]=h.useState(!0),R=c?M:g!==null&&g.hostKey===r&&g.conversationId===void 0,_=E6(),T=Of(_).home;h.useEffect(()=>{c&&$(p.conversation===void 0)},[c,(Er=p.conversation)==null?void 0:Er.conversation.id]);const O=tN(e),H=u??O.opening,L=d??O.open,B=f??O.cancel,I=h.useCallback(he=>{c&&$(!1),d!==void 0&&r!==void 0?y({hostKey:r,conversationId:he}):L(he)},[y,c,r,d,L]);h.useEffect(()=>{var Df,Bf,Sl,N0;const he=S.current;if(he===null||he.confirmed||he.cancelled)return;const ee=()=>{var H6;he.cancelled=!0,he.stagedId!==void 0&&((H6=e.view.current().side)==null?void 0:H6.id)===he.stagedId&&e.controller.showSide(void 0),N(he)},Me=(Df=p.conversation)==null?void 0:Df.conversation.id;if(Me!==void 0&&Me!==he.parentId){ee();return}if(d!==void 0&&r!==void 0&&((g==null?void 0:g.hostKey)!==r||g.conversationId!==he.parentId)){ee();return}const ze=p.side;if(!he.commandSettled&&(ze===void 0||ze.id===he.sideBeforeId))return;if(ze===void 0||ze.id===he.sideBeforeId){ee();return}if(he.stagedId!==void 0&&ze.id!==he.stagedId){ee();return}const dt=(Bf=to(p.organized,ze.id))==null?void 0:Bf.summary,nn=(dt==null?void 0:dt.kind)==="fork"&&dt.parent===he.parentId&&dt.forkedAt===he.entryId,$r=(Sl=ze.conversation)==null?void 0:Sl.conversation.parent,la=($r==null?void 0:$r.conversationId)===he.parentId&&String($r.at)===he.entryId;if(!nn&&!la){if(dt===void 0&&ze.conversation===void 0)return;ee();return}if(he.stagedId=ze.id,!nn){dt!==void 0&&ee();return}he.confirmed=!0,I(ze.id),((N0=e.view.current().side)==null?void 0:N0.id)===ze.id&&e.controller.showSide(void 0),N(he)},[g,r,d,I,e,N,p.conversation,p.organized,p.side]),eN(p,r,R||(Te=p.conversation)==null?void 0:Te.conversation.id,he=>{r===void 0?($(!1),L(he.conversationId)):y(he)},l);const D=!R&&H!==void 0&&((tn=p.conversation)==null?void 0:tn.conversation.id)!==H.id,q=D&&H.failed,U=R||D?void 0:p.conversation;h.useEffect(()=>{q&&p.connection==="connected"&&L(H.id)},[q,L,H==null?void 0:H.id,p.connection]);const X=R?void 0:D?H.id:!c&&r!==void 0?g==null?void 0:g.conversationId:(bs=p.conversation)==null?void 0:bs.conversation.id,Z=U!==void 0&&nm(U),ne=tu("(max-width: 1023px)"),[Y,ae]=h.useState(wge),le=he=>{window.localStorage.setItem(tO,String(he)),ae(he)},[re,ge]=h.useState(!1),[be,me]=h.useState(jge),je=h.useCallback(he=>{window.localStorage.setItem(nO,he),me(he),ge(!0)},[]),we=he=>{re&&he===be?ge(!1):je(he)},[ye,J]=h.useState(),[Se,ke]=h.useState(),[Ce,Ee]=h.useState({occupied:!1,locked:!1}),xe=zf(),xt=h.useCallback(async(he,ee)=>{var nn,$r;if(S.current!==null)return;const Me=e.view.current(),ze=(nn=Me.conversation)==null?void 0:nn.conversation.id;if(ze===void 0)return;const dt={parentId:ze,entryId:he,sideBeforeId:($r=Me.side)==null?void 0:$r.id,stagedId:void 0,confirmed:!1,cancelled:!1,commandSettled:!1};S.current=dt,A(!0);try{await e.controller.fork(he,ee,void 0,{show:"side"})}catch(la){if(S.current!==dt)return;dt.cancelled=!0,w.current&&xe({body:la instanceof Error?la.message:String(la),type:"error"})}finally{S.current===dt&&(dt.commandSettled=!0,N(dt))}},[e,N,xe]),st=U==null?void 0:U.conversation.id,Gt=$he(ye,st),Wt=Se!==void 0&&Se===st,Jt=Ce.occupied||Ce.locked||Se!==void 0,_s=Ce.occupied?"Clear the composer to edit":Jt?"Finish the current edit first":void 0,Rt=h.useCallback(he=>{I(he),e.controller.showSide(void 0),ne&&ge(!1)},[e,ne,I]),Ke=h.useCallback(he=>{je("tasks"),e.controller.showSide(he)},[e,je]),Mn=he=>{if(he!==void 0)return Ke(he);e.controller.showSide(void 0),je("tasks")},P=X===void 0||(ue=b1(p.organized,X))==null?void 0:ue.summary.id;h.useEffect(()=>{e.controller.showSide(void 0)},[P]);const F=b0(x),Q=r===void 0||c?void 0:{value:r,options:x.map(he=>({value:he.hostKey,label:F.get(he.hostKey)??he.url})),onChange:v},de=T.kind==="chat"?"New chat":`New conversation in ${Tge(p.organized,T.path)}`,fe=X===void 0||(_e=to(p.organized,X))==null?void 0:_e.summary,$e=(fe==null?void 0:fe.kind)==="subagent"?fe:void 0,Ae=$e!==void 0&&dz($e,((Ye=p.host)==null?void 0:Ye.protocol.minor)??0),Ue=fe===void 0?void 0:fe.kind==="subagent"?fe.role:az(fe),St=X===void 0?void 0:b1(p.organized,X),He=St===void 0?[]:Lb(St).flatMap(he=>he.tasks),at=OL(e.processes,St==null?void 0:St.summary.id),ln=eO(He)||((at==null?void 0:at.processes.some(he=>hf(he.state)))??!1),Le=fe==null?void 0:fe.parent,gt=Le===void 0||(Kt=to(p.organized,Le))==null?void 0:Kt.summary,Gs=h.useMemo(()=>(he,ee="original")=>e.controller.image(he,ee),[e]),en=lJ(p),It=(fe==null?void 0:fe.kind)==="conversation",Ti=h.useCallback(he=>fe===void 0?[]:uz(p.organized,fe.id,he),[p.organized,fe]),oi=h.useCallback(he=>{var ee;return(ee=to(p.organized,he))==null?void 0:ee.summary},[p.organized]),sr=he=>{B(),r!==void 0&&v(r),_.setHome(he),c&&$(!0)},[Rs,Cr]=h.useState();if(h.useEffect(()=>{p.connection==="connected"&&sessionStorage.removeItem(JL(r))},[r,p.connection]),p.unauthorized===!0&&n!==void 0)return o.jsx(Qi,{children:n});const ir=o.jsxs("div",{className:"pigui-split flex h-full min-h-0 min-w-0",children:[o.jsxs("div",{className:"pigui-pane flex min-h-0 min-w-[20rem] flex-1 flex-col",children:[o.jsx(ofe,{narrow:ne,title:R?de:k0(fe),...Ue===void 0?{}:{agent:Ue},parentSummary:gt,onBackToParent:I,showOverview:X!==void 0,overviewOpen:Y,onOverviewChange:le,panelControls:o.jsx(PL,{narrow:ne,open:re,surface:be,liveActivity:ln,onSelect:we})}),i,o.jsx(Mge,{view:p,wsUrl:t,hostKey:r}),o.jsxs("div",{className:"@container relative flex min-h-0 min-w-0 flex-1 flex-col",children:[X===void 0?o.jsx(ihe,{view:p,remote:e,hostKey:r,draft:T,onDraft:sr,...Q===void 0?{}:{machine:Q},onCreated:()=>{var ze,dt,nn;const he=(ze=e.view.current().conversation)==null?void 0:ze.conversation.id;if(he===void 0)return;r!==void 0&&Tfe(window.localStorage,r);const ee=r===void 0||((dt=k.current)==null?void 0:dt.hostKey)===r&&k.current.conversationId===void 0;if(!w.current){r!==void 0&&m({hostKey:r,conversationId:he});return}if(ee){I(he),ne||le(!0);return}const Me=((nn=k.current)==null?void 0:nn.hostKey)===r&&k.current.conversationId!==void 0;r!==void 0&&!Me&&m({hostKey:r,conversationId:he})},connected:p.connection==="connected"}):o.jsx(YE,{className:`motion-safe:transition-[padding] motion-safe:duration-200 motion-safe:ease-out${Y&&!ne?" pigui-overview-clearance":""}`,style:bge,composer:o.jsx("div",{className:"mx-auto w-full max-w-[44rem]",children:$e!==void 0?o.jsxs(pe,{gap:2,vAlign:"center",className:"border-t border-border py-2",children:[o.jsx("span",{className:"min-w-0 flex-1 text-center text-xs text-muted",children:"Read-only · subagent"}),Ae?o.jsx(K,{label:"Stop",variant:"secondary",size:"sm",isDisabled:p.connection!=="connected",onClick:()=>void e.controller.abort($e.id)}):null]}):U===void 0?q?null:o.jsx($pe,{}):o.jsxs(te,{gap:1,children:[o.jsx(_xe,{docs:p.docs,remote:e,connected:p.connection==="connected"}),o.jsx(Ehe,{view:p,remote:e,conversation:U,busy:Z,narrow:ne,takeBack:Gt,externalEditLocked:Wt,onEditorStateChange:Ee,source:r,onTakeBack:()=>{J(void 0),ke(void 0)}})]})}),emptyState:q?o.jsx(Ape,{missing:fe===void 0,connected:p.connection==="connected",onRetry:()=>L(H.id)}):o.jsx(ro,{title:"Nothing here yet",description:"Ask the agent something. Every client sees it."}),children:U===void 0?q?null:o.jsx(IL,{}):o.jsx(RL,{conversation:U,onLoadEarlier:()=>e.controller.loadEarlier(U.conversation.id),docs:p.docs,submissions:p.submissions,toolPresentations:p.toolPresentations,connected:p.connection==="connected",canFork:It,forkDisabled:E,openInPanel:Ke,onOpenFork:Rt,onFork:Cr,forksAt:Ti,summaryOf:oi,submissionEditDisabled:Jt,submissionEditTooltip:_s,onRetry:(fe==null?void 0:fe.kind)==="subagent"?void 0:async({text:he,images:ee,skills:Me,attachments:ze,requestId:dt})=>{o2(),await e.controller.submit(he,"followUp",{requestId:dt,images:ee.map(PZ),...ee.some(nn=>!("data"in nn))?{imageViews:ee}:{},skills:Me,...ze.length===0?{}:{attachments:ze.map(nn=>nn.id)},...ze.length===0?{}:{attachmentDetails:ze}})},onRetrySubmission:(fe==null?void 0:fe.kind)==="subagent"?void 0:he=>{e.controller.retrySubmission(he).catch(()=>{})},onEditSubmission:(fe==null?void 0:fe.kind)==="subagent"?void 0:he=>{const ee=st;Jt||ee===void 0||(ke(ee),e.controller.takeBackSubmission(he).then(Me=>{Me!==void 0?J({conversationId:ee,draft:Me}):ke(void 0)}).catch(Me=>{ke(void 0),xe({body:Me instanceof Error?Me.message:String(Me),type:"error"})}))}})},`${r??"local"}:${X}`),Y&&U!==void 0?o.jsx(Axe,{view:p,remote:e,conversation:U,narrow:ne,busy:nm(U),onOpenChanges:()=>je("changes"),onOpenTasks:Mn,onClose:()=>le(!1)}):null]})]}),ne?null:o.jsx(OS,{view:p,remote:e,shownId:X,narrow:!1,open:re,surface:be,busy:Z,liveActivity:ln,onOpenChange:ge,onSelectSurface:we,openInPanel:Ke,onOpenInMain:Rt})]}),ai=o.jsxs(o.Fragment,{children:[ne?o.jsx(OS,{view:p,remote:e,shownId:X,narrow:!0,open:re,surface:be,busy:Z,liveActivity:ln,onOpenChange:ge,onSelectSurface:we,openInPanel:Ke,onOpenInMain:Rt}):null,Rs===void 0?null:o.jsx(Age,{entryId:Rs,connected:p.connection==="connected",busy:E,onClose:()=>Cr(void 0),onCreate:xt})]});return o.jsx(aJ,{load:Gs,retryKey:en,...r===void 0?{}:{source:r},children:c?o.jsxs(bI,{machines:[{key:r??"local",label:((cn=p.settings)==null?void 0:cn.hostName)??t,view:p,remote:e,...r===void 0?{}:{hostKey:r},...s===void 0?{}:{device:s},...a===void 0?{}:{retry:a}}],focusKey:r??"local",draftingChat:R&&T.kind==="chat",shownId:X,onDraft:(he,ee)=>sr(ee),onOpen:(he,ee)=>I(ee),onNewChat:()=>sr({kind:"chat"}),narrow:ne,children:[ir,ai]}):o.jsxs(o.Fragment,{children:[ir,ai]})})}function Age({entryId:e,connected:t,busy:n,onClose:s,onCreate:i}){const[r,a]=h.useState("Continue from here."),l=()=>{o2(),i(e,r.trim()),s()};return o.jsx(os,{isOpen:!0,onOpenChange:c=>c?void 0:s(),purpose:"form",width:480,children:o.jsx(Wn,{header:o.jsx(Ts,{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(Kn,{children:o.jsx(pt,{label:"First message",value:r,onChange:a})}),footer:o.jsx(jr,{children:o.jsxs(pe,{gap:2,hAlign:"end",children:[o.jsx(K,{label:"Cancel",variant:"secondary",onClick:s}),o.jsx(K,{label:n?"Forking…":"Fork",variant:"primary",isDisabled:!t||n||r.trim()==="",onClick:l})]})})})})}function Mge({view:e,wsUrl:t,hostKey:n}){var s;return e.connection==="outdated"?e.protocolMismatch===void 0?null:o.jsx(B6,{wsUrl:t,mismatch:e.protocolMismatch,...n===void 0?{}:{hostKey:n}}):e.connection==="reconnecting"&&((s=e.upgrade)==null?void 0:s.phase)==="installing"?o.jsx(Ie,{status:"info",container:"section",title:"Host is restarting",description:`Upgrading to pinomad ${e.upgrade.target??""}. Reconnecting when it's back…`}):e.connection==="reconnecting"?o.jsx(Ie,{status:"warning",container:"section",title:"Host connection lost",description:"Reconnecting… the view keeps the last state the host sent."}):e.connection==="closed"?o.jsx(Ie,{status:"error",container:"section",title:"Disconnected from the host"}):null}function Tge(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}function zge(){const e=h_();return h.useEffect(()=>{var t,n;(n=(t=window.pinomadDesktop)==null?void 0:t.setAppearance)==null||n.call(t,e)},[e]),o.jsx(yE,{theme:HZ,mode:e,children:o.jsx(Sge,{})})}NT.createRoot(document.getElementById("root")).render(o.jsx(h.StrictMode,{children:o.jsx(zge,{})}));export{ym as _,o as j,h as r};