@duckmind/duckmind-darwin-x64 1.3.11 → 1.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.duckmind/plugins/.duckmind-managed-plugins.json +1 -1
- package/.duckmind/web/assets/{dialog-connect-provider-CRQUO9He.js → dialog-connect-provider-B4iHr_hu.js} +2 -2
- package/.duckmind/web/assets/{dialog-edit-project-CpiVZTJ-.js → dialog-edit-project-CY9SaCFM.js} +1 -1
- package/.duckmind/web/assets/{dialog-fork-CloFkX1M.js → dialog-fork-Bg9TqBlL.js} +1 -1
- package/.duckmind/web/assets/{dialog-manage-models-Bq0UrM20.js → dialog-manage-models-CvYh8u3S.js} +1 -1
- package/.duckmind/web/assets/{dialog-select-directory-Db0c-gQl.js → dialog-select-directory-2WfvK90b.js} +1 -1
- package/.duckmind/web/assets/{dialog-select-file-B-WcV9bA.js → dialog-select-file-BXPFeL46.js} +1 -1
- package/.duckmind/web/assets/{dialog-select-mcp-dA8UDgah.js → dialog-select-mcp-D22QyhEg.js} +1 -1
- package/.duckmind/web/assets/{dialog-select-model-unpaid-NZ41fVE_.js → dialog-select-model-unpaid-1jAjBWgs.js} +2 -2
- package/.duckmind/web/assets/{dialog-select-provider-CKvDgZkl.js → dialog-select-provider-BqrN5PhR.js} +1 -1
- package/.duckmind/web/assets/{dialog-select-server-BmCX76VX.js → dialog-select-server-Wfx_uHN4.js} +1 -1
- package/.duckmind/web/assets/{dialog-settings-BOysoQ60.js → dialog-settings-CjGwRyxi.js} +1 -1
- package/.duckmind/web/assets/{file-icon-By0OPIsC.js → file-icon-BzEaKmk3.js} +1 -1
- package/.duckmind/web/assets/{ghostty-web-BOleg_ST.js → ghostty-web-DY61MtmG.js} +1 -1
- package/.duckmind/web/assets/{home-D8eKClgK.js → home-Dg1i_caj.js} +1 -1
- package/.duckmind/web/assets/{index-CIniE1sM.js → index-Ccp4TMax.js} +3 -3
- package/.duckmind/web/assets/{index-C1_o3AOA.js → index-Cdh5Mqpm.js} +1 -1
- package/.duckmind/web/assets/{list-Bd_lG005.js → list-CnCE6uea.js} +1 -1
- package/.duckmind/web/assets/{provider-icon-DzvEuHl8.js → provider-icon-BuiEJ5bx.js} +1 -1
- package/.duckmind/web/assets/{select-CsoVU8kZ.js → select-B46kPHgP.js} +1 -1
- package/.duckmind/web/assets/{server-row-CfBZdm7h.js → server-row-BOT4YACP.js} +1 -1
- package/.duckmind/web/assets/{session-CuMpLG8c.js → session-1j7GgbCJ.js} +6 -6
- package/.duckmind/web/assets/{status-popover-body-BwKWyFvL.js → status-popover-body-DMRgrS2N.js} +2 -2
- package/.duckmind/web/assets/{switch-BZ-0S1HQ.js → switch-DDb2XoT4.js} +1 -1
- package/.duckmind/web/index.html +1 -1
- package/bin/duckmind +0 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/dialog-select-provider-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/dialog-select-provider-BqrN5PhR.js","assets/list-CnCE6uea.js","assets/provider-icon-BuiEJ5bx.js","assets/dialog-connect-provider-B4iHr_hu.js","assets/dialog-select-server-Wfx_uHN4.js","assets/server-row-BOT4YACP.js","assets/index-Cdh5Mqpm.js","assets/dialog-settings-CjGwRyxi.js","assets/select-B46kPHgP.js","assets/switch-DDb2XoT4.js","assets/dialog-select-directory-2WfvK90b.js","assets/file-icon-BzEaKmk3.js","assets/home-Dg1i_caj.js","assets/session-1j7GgbCJ.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const De={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return P2(this.context.count)},getNextContextId(){return P2(this.context.count++)}};function P2(e){const t=String(e),n=t.length-1;return De.context.id+(n?String.fromCharCode(96+n):"")+t}function lo(e){De.context=e}const H7=!1,ZM=(e,t)=>e===t,vi=Symbol("solid-proxy"),V7=typeof Proxy=="function",Df=Symbol("solid-track"),Of={equals:ZM};let Ic=null,U7=G7;const Gr=1,Nc=2,B7={owned:null,cleanups:null,context:null,owner:null},Am={};var Qe=null;let _e=null,KM=null,It=null,Kn=null,$n=null,Z0=0;function An(e,t){const n=It,r=Qe,i=e.length===0,o=t===void 0?r:t,s=i?B7:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=i?e:()=>e(()=>Ye(()=>Xo(s)));Qe=s,It=null;try{return _r(a,!0)}finally{It=n,Qe=r}}function we(e,t){t=t?Object.assign({},Of,t):Of;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(_e&&_e.running&&_e.sources.has(n)?i=i(n.tValue):i=i(n.value)),W7(n,i));return[q7.bind(n),r]}function zc(e,t,n){const r=gu(e,t,!0,Gr);Sl(r)}function Ve(e,t,n){const r=gu(e,t,!1,Gr);Sl(r)}function re(e,t,n){U7=nD;const r=gu(e,t,!1,Gr),i=js&&wt(js);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),$n?$n.push(r):Sl(r)}function q(e,t,n){n=n?Object.assign({},Of,n):Of;const r=gu(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Sl(r),q7.bind(r)}function YM(e){return e&&typeof e=="object"&&"then"in e}function xl(e,t,n){let r,i,o;typeof t=="function"?(r=e,i=t,o=n||{}):(r=!0,i=e,o=t||{});let s=null,a=Am,l=null,c=!1,u=!1,d="initialValue"in o,f=typeof r=="function"&&q(r);const h=new Set,[m,p]=(o.storage||we)(o.initialValue),[g,b]=we(void 0),[v,y]=we(void 0,{equals:!1}),[_,k]=we(d?"ready":"unresolved");De.context&&(l=De.getNextContextId(),o.ssrLoadFrom==="initial"?a=o.initialValue:De.load&&De.has(l)&&(a=De.load(l)));function x(H,j,M,T){return s===H&&(s=null,T!==void 0&&(d=!0),(H===a||j===a)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(T,{value:j})),a=Am,_e&&H&&c?(_e.promises.delete(H),c=!1,_r(()=>{_e.running=!0,I(j,M)},!1)):I(j,M)),j}function I(H,j){_r(()=>{j===void 0&&p(()=>H),k(j!==void 0?"errored":d?"ready":"unresolved"),b(j);for(const M of h.keys())M.decrement();h.clear()},!1)}function A(){const H=js&&wt(js),j=m(),M=g();if(M!==void 0&&!s)throw M;return It&&!It.user&&H&&zc(()=>{v(),s&&(H.resolved&&_e&&c?_e.promises.add(s):h.has(H)||(H.increment(),h.add(H)))}),j}function L(H=!0){if(H!==!1&&u)return;u=!1;const j=f?f():r;if(c=_e&&_e.running,j==null||j===!1){x(s,Ye(m));return}_e&&s&&_e.promises.delete(s);let M;const T=a!==Am?a:Ye(()=>{try{return i(j,{value:m(),refetching:H})}catch(E){M=E}});if(M!==void 0){x(s,void 0,hf(M),j);return}else if(!YM(T))return x(s,T,void 0,j),T;return s=T,"v"in T?(T.s===1?x(s,T.v,void 0,j):x(s,void 0,hf(T.v),j),T):(u=!0,queueMicrotask(()=>u=!1),_r(()=>{k(d?"refreshing":"pending"),y()},!1),T.then(E=>x(T,E,void 0,j),E=>x(T,void 0,hf(E),j)))}Object.defineProperties(A,{state:{get:()=>_()},error:{get:()=>g()},loading:{get(){const H=_();return H==="pending"||H==="refreshing"}},latest:{get(){if(!d)return A();const H=g();if(H&&!s)throw H;return m()}}});let $=Qe;return f?zc(()=>($=Qe,L(!1))):L(!1),[A,{refetch:H=>co($,()=>L(H)),mutate:p}]}function rt(e){return _r(e,!1)}function Ye(e){if(It===null)return e();const t=It;It=null;try{return e()}finally{It=t}}function Yt(e,t,n){const r=Array.isArray(e);let i,o=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(o)return o=!1,s;const l=Ye(()=>t(a,i,s));return i=a,l}}function Pt(e){re(()=>Ye(e))}function ae(e){return Qe===null||(Qe.cleanups===null?Qe.cleanups=[e]:Qe.cleanups.push(e)),e}function JM(e,t){Ic||(Ic=Symbol("error")),Qe=gu(void 0,void 0,!0),Qe.context={...Qe.context,[Ic]:[t]},_e&&_e.running&&_e.sources.add(Qe);try{return e()}catch(n){vu(n)}finally{Qe=Qe.owner}}function gg(){return It}function bi(){return Qe}function co(e,t){const n=Qe,r=It;Qe=e,It=null;try{return _r(t,!0)}catch(i){vu(i)}finally{Qe=n,It=r}}function XM(e){if(_e&&_e.running)return e(),_e.done;const t=It,n=Qe;return Promise.resolve().then(()=>{It=t,Qe=n;let r;return js&&(r=_e||(_e={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(i=>r.resolve=i)),r.running=!0),_r(e,!1),It=Qe=null,r?r.done:void 0})}const[P0e,R2]=we(!1);function QM(e){$n.push.apply($n,e),e.length=0}function yt(e,t){const n=Symbol("context");return{id:n,Provider:rD(n),defaultValue:e}}function wt(e){let t;return Qe&&Qe.context&&(t=Qe.context[e.id])!==void 0?t:e.defaultValue}function K0(e){const t=q(e),n=q(()=>vg(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let js;function eD(){return js||(js=yt())}function q7(){const e=_e&&_e.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===Gr)Sl(this);else{const t=Kn;Kn=null,_r(()=>Rf(this),!1),Kn=t}if(It){const t=this.observers?this.observers.length:0;It.sources?(It.sources.push(this),It.sourceSlots.push(t)):(It.sources=[this],It.sourceSlots=[t]),this.observers?(this.observers.push(It),this.observerSlots.push(It.sources.length-1)):(this.observers=[It],this.observerSlots=[It.sources.length-1])}return e&&_e.sources.has(this)?this.tValue:this.value}function W7(e,t,n){let r=_e&&_e.running&&_e.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(_e){const i=_e.running;(i||!n&&_e.sources.has(e))&&(_e.sources.add(e),e.tValue=t),i||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&_r(()=>{for(let i=0;i<e.observers.length;i+=1){const o=e.observers[i],s=_e&&_e.running;s&&_e.disposed.has(o)||((s?!o.tState:!o.state)&&(o.pure?Kn.push(o):$n.push(o),o.observers&&Z7(o)),s?o.tState=Gr:o.state=Gr)}if(Kn.length>1e6)throw Kn=[],new Error},!1)}return t}function Sl(e){if(!e.fn)return;Xo(e);const t=Z0;N2(e,_e&&_e.running&&_e.sources.has(e)?e.tValue:e.value,t),_e&&!_e.running&&_e.sources.has(e)&&queueMicrotask(()=>{_r(()=>{_e&&(_e.running=!0),It=Qe=e,N2(e,e.tValue,t),It=Qe=null},!1)})}function N2(e,t,n){let r;const i=Qe,o=It;It=Qe=e;try{r=e.fn(t)}catch(s){return e.pure&&(_e&&_e.running?(e.tState=Gr,e.tOwned&&e.tOwned.forEach(Xo),e.tOwned=void 0):(e.state=Gr,e.owned&&e.owned.forEach(Xo),e.owned=null)),e.updatedAt=n+1,vu(s)}finally{It=o,Qe=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?W7(e,r,!0):_e&&_e.running&&e.pure?(_e.sources.has(e)||(e.value=r),_e.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function gu(e,t,n,r=Gr,i){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Qe,context:Qe?Qe.context:null,pure:n};return _e&&_e.running&&(o.state=0,o.tState=r),Qe===null||Qe!==B7&&(_e&&_e.running&&Qe.pure?Qe.tOwned?Qe.tOwned.push(o):Qe.tOwned=[o]:Qe.owned?Qe.owned.push(o):Qe.owned=[o]),o}function Pf(e){const t=_e&&_e.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===Nc)return Rf(e);if(e.suspense&&Ye(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Z0);){if(t&&_e.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let i=e,o=n[r+1];for(;(i=i.owner)&&i!==o;)if(_e.disposed.has(i))return}if((t?e.tState:e.state)===Gr)Sl(e);else if((t?e.tState:e.state)===Nc){const i=Kn;Kn=null,_r(()=>Rf(e,n[0]),!1),Kn=i}}}function _r(e,t){if(Kn)return e();let n=!1;t||(Kn=[]),$n?n=!0:$n=[],Z0++;try{const r=e();return tD(n),r}catch(r){n||($n=null),Kn=null,vu(r)}}function tD(e){if(Kn&&(G7(Kn),Kn=null),e)return;let t;if(_e){if(!_e.promises.size&&!_e.queue.size){const r=_e.sources,i=_e.disposed;$n.push.apply($n,_e.effects),t=_e.resolve;for(const o of $n)"tState"in o&&(o.state=o.tState),delete o.tState;_e=null,_r(()=>{for(const o of i)Xo(o);for(const o of r){if(o.value=o.tValue,o.owned)for(let s=0,a=o.owned.length;s<a;s++)Xo(o.owned[s]);o.tOwned&&(o.owned=o.tOwned),delete o.tValue,delete o.tOwned,o.tState=0}R2(!1)},!1)}else if(_e.running){_e.running=!1,_e.effects.push.apply(_e.effects,$n),$n=null,R2(!0);return}}const n=$n;$n=null,n.length&&_r(()=>U7(n),!1),t&&t()}function G7(e){for(let t=0;t<e.length;t++)Pf(e[t])}function nD(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Pf(r)}if(De.context){if(De.count){De.effects||(De.effects=[]),De.effects.push(...e.slice(0,n));return}lo()}for(De.effects&&(De.done||!De.count)&&(e=[...De.effects,...e],n+=De.effects.length,delete De.effects),t=0;t<n;t++)Pf(e[t])}function Rf(e,t){const n=_e&&_e.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){const i=e.sources[r];if(i.sources){const o=n?i.tState:i.state;o===Gr?i!==t&&(!i.updatedAt||i.updatedAt<Z0)&&Pf(i):o===Nc&&Rf(i,t)}}}function Z7(e){const t=_e&&_e.running;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=Nc:r.state=Nc,r.pure?Kn.push(r):$n.push(r),r.observers&&Z7(r))}}function Xo(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const o=i.pop(),s=n.observerSlots.pop();r<i.length&&(o.sourceSlots[s]=r,i[r]=o,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Xo(e.tOwned[t]);delete e.tOwned}if(_e&&_e.running&&e.pure)K7(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Xo(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}_e&&_e.running?e.tState=0:e.state=0}function K7(e,t){if(t||(e.tState=0,_e.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)K7(e.owned[n])}function hf(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function z2(e,t,n){try{for(const r of t)r(e)}catch(r){vu(r,n&&n.owner||null)}}function vu(e,t=Qe){const n=Ic&&t&&t.context&&t.context[Ic],r=hf(e);if(!n)throw r;$n?$n.push({fn(){z2(r,n,t)},state:Gr}):z2(r,n,t)}function vg(e){if(typeof e=="function"&&!e.length)return vg(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=vg(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function rD(e,t){return function(r){let i;return Ve(()=>i=Ye(()=>(Qe.context={...Qe.context,[e]:r.value},K0(()=>r.children))),void 0),i}}const bg=Symbol("fallback");function Nf(e){for(let t=0;t<e.length;t++)e[t]()}function iD(e,t,n={}){let r=[],i=[],o=[],s=0,a=t.length>1?[]:null;return ae(()=>Nf(o)),()=>{let l=e()||[],c=l.length,u,d;return l[Df],Ye(()=>{let h,m,p,g,b,v,y,_,k;if(c===0)s!==0&&(Nf(o),o=[],r=[],i=[],s=0,a&&(a=[])),n.fallback&&(r=[bg],i[0]=An(x=>(o[0]=x,n.fallback())),s=1);else if(s===0){for(i=new Array(c),d=0;d<c;d++)r[d]=l[d],i[d]=An(f);s=c}else{for(p=new Array(c),g=new Array(c),a&&(b=new Array(c)),v=0,y=Math.min(s,c);v<y&&r[v]===l[v];v++);for(y=s-1,_=c-1;y>=v&&_>=v&&r[y]===l[_];y--,_--)p[_]=i[y],g[_]=o[y],a&&(b[_]=a[y]);for(h=new Map,m=new Array(_+1),d=_;d>=v;d--)k=l[d],u=h.get(k),m[d]=u===void 0?-1:u,h.set(k,d);for(u=v;u<=y;u++)k=r[u],d=h.get(k),d!==void 0&&d!==-1?(p[d]=i[u],g[d]=o[u],a&&(b[d]=a[u]),d=m[d],h.set(k,d)):o[u]();for(d=v;d<c;d++)d in p?(i[d]=p[d],o[d]=g[d],a&&(a[d]=b[d],a[d](d))):i[d]=An(f);i=i.slice(0,s=c),r=l.slice(0)}return i});function f(h){if(o[d]=h,a){const[m,p]=we(d);return a[d]=p,t(l[d],m)}return t(l[d])}}}function oD(e,t,n={}){let r=[],i=[],o=[],s=[],a=0,l;return ae(()=>Nf(o)),()=>{const c=e()||[],u=c.length;return c[Df],Ye(()=>{if(u===0)return a!==0&&(Nf(o),o=[],r=[],i=[],a=0,s=[]),n.fallback&&(r=[bg],i[0]=An(f=>(o[0]=f,n.fallback())),a=1),i;for(r[0]===bg&&(o[0](),o=[],r=[],i=[],a=0),l=0;l<u;l++)l<r.length&&r[l]!==c[l]?s[l](()=>c[l]):l>=r.length&&(i[l]=An(d));for(;l<r.length;l++)o[l]();return a=s.length=o.length=u,r=c.slice(0),i=i.slice(0,a)});function d(f){o[l]=f;const[h,m]=we(c[l]);return s[l]=m,t(h,l)}}}function C(e,t){return Ye(()=>e(t||{}))}function cd(){return!0}const yg={get(e,t,n){return t===vi?n:e.get(t)},has(e,t){return t===vi?!0:e.has(t)},set:cd,deleteProperty:cd,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:cd,deleteProperty:cd}},ownKeys(e){return e.keys()}};function Mm(e){return(e=typeof e=="function"?e():e)?e:{}}function sD(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function ie(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&vi in a,e[s]=typeof a=="function"?(t=!0,q(a)):a}if(V7&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Mm(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Mm(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Mm(e[a])));return[...new Set(s)]}},yg);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:sD.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},o=Object.keys(r);for(let s=o.length-1;s>=0;s--){const a=o[s],l=r[a];l&&l.get?Object.defineProperty(i,a,l):i[a]=l?l.value:void 0}return i}function pe(e,...t){const n=t.length;if(V7&&vi in e){const i=n>1?t.flat():t[0],o=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},yg));return o.push(new Proxy({get(s){return i.includes(s)?void 0:e[s]},has(s){return i.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!i.includes(s))}},yg)),o}const r=[];for(let i=0;i<=n;i++)r[i]={};for(const i of Object.getOwnPropertyNames(e)){let o=n;for(let l=0;l<t.length;l++)if(t[l].includes(i)){o=l;break}const s=Object.getOwnPropertyDescriptor(e,i);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[o][i]=s.value:Object.defineProperty(r[o],i,s)}return r}function Y7(e){let t,n;const r=i=>{const o=De.context;if(o){const[a,l]=we();De.count||(De.count=0),De.count++,(n||(n=e())).then(c=>{!De.done&&lo(o),De.count--,l(()=>c.default),lo()}),t=a}else if(!t){const[a]=xl(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return q(()=>(s=t())?Ye(()=>{if(!o||De.done)return s(i);const a=De.context;lo(o);const l=s(i);return lo(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}let aD=0;function Mn(){return De.context?De.getNextContextId():`cl-${aD++}`}const J7=e=>`Stale read from <${e}>.`;function zi(e){const t="fallback"in e&&{fallback:()=>e.fallback};return q(iD(()=>e.each,e.children,t||void 0))}function R0e(e){const t="fallback"in e&&{fallback:()=>e.fallback};return q(oD(()=>e.each,e.children,t||void 0))}function Ce(e){const t=e.keyed,n=q(()=>e.when,void 0,void 0),r=t?n:q(n,void 0,{equals:(i,o)=>!i==!o});return q(()=>{const i=r();if(i){const o=e.children;return typeof o=="function"&&o.length>0?Ye(()=>o(t?i:()=>{if(!Ye(r))throw J7("Show");return n()})):o}return e.fallback},void 0,void 0)}function Y0(e){const t=K0(()=>e.children),n=q(()=>{const r=t(),i=Array.isArray(r)?r:[r];let o=()=>{};for(let s=0;s<i.length;s++){const a=s,l=i[s],c=o,u=q(()=>c()?void 0:l.when,void 0,void 0),d=l.keyed?u:q(u,void 0,{equals:(f,h)=>!f==!h});o=()=>c()||(d()?[a,u,l]:void 0)}return o});return q(()=>{const r=n()();if(!r)return e.fallback;const[i,o,s]=r,a=s.children;return typeof a=="function"&&a.length>0?Ye(()=>a(s.keyed?o():()=>{if(Ye(n)()?.[0]!==i)throw J7("Match");return o()})):a},void 0,void 0)}function Fr(e){return e}let Va;function lD(){Va&&[...Va].forEach(e=>e())}function cD(e){let t;De.context&&De.load&&(t=De.load(De.getContextId()));const[n,r]=we(t,void 0);return Va||(Va=new Set),Va.add(r),ae(()=>Va.delete(r)),q(()=>{let i;if(i=n()){const o=e.fallback;return typeof o=="function"&&o.length?Ye(()=>o(i,()=>r())):o}return JM(()=>e.children,r)},void 0,void 0)}const uD=yt();function dD(e){let t=0,n,r,i,o,s;const[a,l]=we(!1),c=eD(),u={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!1)},inFallback:a,effects:[],resolved:!1},d=bi();if(De.context&&De.load){const m=De.getContextId();let p=De.load(m);if(p&&(typeof p!="object"||p.s!==1?i=p:De.gather(m)),i&&i!=="$$f"){const[g,b]=we(void 0,{equals:!1});o=g,i.then(()=>{if(De.done)return b();De.gather(m),lo(r),b(),lo()},v=>{s=v,b()})}}const f=wt(uD);f&&(n=f.register(u.inFallback));let h;return ae(()=>h&&h()),C(c.Provider,{value:u,get children(){return q(()=>{if(s)throw s;if(r=De.context,o)return o(),o=void 0;r&&i==="$$f"&&lo();const m=q(()=>e.children);return q(p=>{const g=u.inFallback(),{showContent:b=!0,showFallback:v=!0}=n?n():{};if((!g||i&&i!=="$$f")&&b)return u.resolved=!0,h&&h(),h=r=i=void 0,QM(u.effects),m();if(v)return h?p:An(y=>(h=y,r&&(lo({id:r.id+"F",count:0}),r=void 0),e.fallback),d)})})}})}const fD=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],hD=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...fD]),mD=new Set(["innerHTML","textContent","innerText","children"]),pD=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),gD=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function vD(e,t){const n=gD[e];return typeof n=="object"?n[t]?n.$:void 0:n}const bD=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),yD=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),wD={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},it=e=>q(()=>e());function kD(e,t,n){let r=n.length,i=t.length,o=r,s=0,a=0,l=t[i-1].nextSibling,c=null;for(;s<i||a<o;){if(t[s]===n[a]){s++,a++;continue}for(;t[i-1]===n[o-1];)i--,o--;if(i===s){const u=o<r?a?n[a-1].nextSibling:n[o-a]:l;for(;a<o;)e.insertBefore(n[a++],u)}else if(o===a)for(;s<i;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[o-1]&&n[a]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--o],u),t[i]=n[o]}else{if(!c){c=new Map;let d=a;for(;d<o;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<o){let d=s,f=1,h;for(;++d<i&&d<o&&!((h=c.get(t[d]))==null||h!==u+f);)f++;if(f>u-a){const m=t[s];for(;a<u;)e.insertBefore(n[a++],m)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const j2="_$DX_DELEGATE";function xD(e,t,n,r={}){let i;return An(o=>{i=o,t===document?e():X(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function me(e,t,n,r){let i;const o=()=>{const a=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:r?a.firstChild:a.content.firstChild},s=t?()=>Ye(()=>document.importNode(i||(i=o()),!0)):()=>(i||(i=o())).cloneNode(!0);return s.cloneNode=s,s}function Jr(e,t=window.document){const n=t[j2]||(t[j2]=new Set);for(let r=0,i=e.length;r<i;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,TD))}}function vt(e,t,n){ra(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function SD(e,t,n,r){ra(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function _D(e,t,n){ra(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function bu(e,t){ra(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Os(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=o=>i.call(e,n[1],o))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Ft(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let o,s;for(o=0,s=i.length;o<s;o++){const a=i[o];!a||a==="undefined"||t[a]||(F2(e,a,!1),delete n[a])}for(o=0,s=r.length;o<s;o++){const a=r[o],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(F2(e,a,!0),n[a]=l)}return n}function wv(e,t,n){if(!t)return n?vt(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,o;for(o in n)t[o]==null&&r.removeProperty(o),delete n[o];for(o in t)i=t[o],i!==n[o]&&(r.setProperty(o,i),n[o]=i);return n}function Xn(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function Zr(e,t={},n,r){const i={};return r||Ve(()=>i.children=jc(e,t.children,i.children)),Ve(()=>typeof t.ref=="function"&&Cr(t.ref,e)),Ve(()=>CD(e,t,n,!0,i,!0)),i}function Cr(e,t,n){return Ye(()=>e(t,n))}function X(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return jc(e,t,r,n);Ve(i=>jc(e,t(),i,n),r)}function CD(e,t,n,r,i={},o=!1){t||(t={});for(const s in i)if(!(s in t)){if(s==="children")continue;i[s]=H2(e,s,null,i[s],n,o,t)}for(const s in t){if(s==="children")continue;const a=t[s];i[s]=H2(e,s,a,i[s],n,o,t)}}function ID(e){let t,n;return!ra()||!(t=De.registry.get(n=$D()))?e():(De.completed&&De.completed.add(t),De.registry.delete(n),t)}function ra(e){return!!De.context&&!De.done&&(!e||e.isConnected)}function ED(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function F2(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,o=r.length;i<o;i++)e.classList.toggle(r[i],n)}function H2(e,t,n,r,i,o,s){let a,l,c,u,d;if(t==="style")return wv(e,n,r);if(t==="classList")return Ft(e,n,r);if(n===r)return r;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=bD.has(f);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(f,m)}(h||n)&&(Os(e,f,n,h),h&&Jr([f]))}else if(t.slice(0,5)==="attr:")vt(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")_D(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=mD.has(t))||!i&&((u=vD(t,e.tagName))||(l=hD.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(d)t=t.slice(5),l=!0;else if(ra(e))return n;t==="class"||t==="className"?bu(e,n):a&&!l&&!c?e[ED(t)]=n:e[u||t]=n}else{const f=i&&t.indexOf(":")>-1&&wD[t.split(":")[0]];f?SD(e,f,t,n):vt(e,pD[t]||t,n)}return n}function TD(e){if(De.registry&&De.events&&De.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,o=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),De.registry&&!De.done&&(De.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();o(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();o(r)}function jc(e,t,n,r,i){const o=ra(e);if(o){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(o||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=ya(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(o)return n;n=ya(e,n,r)}else{if(s==="function")return Ve(()=>{let l=t();for(;typeof l=="function";)l=l();n=jc(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(wg(l,t,n,i))return Ve(()=>n=jc(e,l,n,r,!0)),()=>n;if(o){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(l.length===0){if(n=ya(e,n,r),a)return n}else c?n.length===0?V2(e,l,r):kD(e,n,l):(n&&ya(e),V2(e,l));n=l}else if(t.nodeType){if(o&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=ya(e,n,r,t);ya(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function wg(e,t,n,r){let i=!1;for(let o=0,s=t.length;o<s;o++){let a=t[o],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))i=wg(e,a,l)||i;else if(c==="function")if(r){for(;typeof a=="function";)a=a();i=wg(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||i}else e.push(a),i=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return i}function V2(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function ya(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let o=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(i!==a){const l=a.parentNode===e;!o&&!s?l?e.replaceChild(i,a):e.insertBefore(i,n):l&&a.remove()}else o=!0}}else e.insertBefore(i,n);return[i]}function $D(){return De.getNextContextId()}const LD=!1,AD="http://www.w3.org/2000/svg";function X7(e,t=!1,n=void 0){return t?document.createElementNS(AD,e):document.createElement(e,{is:n})}function ia(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=bi();let o,s=!!De.context;return re(()=>{s&&(bi().user=s=!1),o||(o=co(i,()=>q(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=we(!1),u=()=>c(!0);An(d=>X(a,()=>l()?d():o(),null)),ae(u)}else{const l=X7(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),X(c,o),a.appendChild(l),e.ref&&e.ref(l),ae(()=>a.removeChild(l))}},void 0,{render:!s}),n}function MD(e,t){const n=q(e);return q(()=>{const r=n();switch(typeof r){case"function":return Ye(()=>r(t));case"string":const i=yD.has(r),o=De.context?ID():X7(r,i,Ye(()=>t.is));return Zr(o,t,i),o}})}function Q7(e){const[,t]=pe(e,["component"]);return MD(()=>e.component,t)}const DD="modulepreload",OD=function(e){return"/"+e},U2={},O=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=s?.nonce||s?.getAttribute("nonce");i=l(n.map(c=>{if(c=OD(c),c in U2)return;U2[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":DD,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};function Xt(e){const t=yt();return{provider:n=>{const r=e.init(n);if(!(e.gate??!0))return C(t.Provider,{value:r,get children(){return n.children}});const o=q(()=>{const s=r.ready;return s===void 0||(typeof s=="function"?s():s)});return C(Ce,{get when(){return o()},get children(){return C(t.Provider,{value:r,get children(){return n.children}})}})},use(){const n=wt(t);if(!n)throw new Error(`${e.name} context must be used within a context provider`);return n}}}const{use:N0e,provider:PD}=Xt({name:"Data",init:e=>({get store(){return e.data},get directory(){return e.directory},navigateToSession:e.onNavigateToSession,sessionHref:e.onSessionHref})}),ek=Xt({name:"FileComponent",init:e=>e.component}),RD=ek.provider,z0e=ek.use,ND=e=>e!=null,zD=e=>e.filter(ND);function jD(e){return(...t)=>{for(const n of e)n&&n(...t)}}const ce=e=>typeof e=="function"&&!e.length?e():e,kg=e=>Array.isArray(e)?e:e?[e]:[];function FD(e,...t){return typeof e=="function"?e(...t):e}const kv=ae;function HD(e,t,n){if(De.context){const[r,i]=we(e,n);return Pt(()=>i(()=>t())),[r,i]}return we(t(),n)}function VD(e,t,n,r){const i=e.length,o=t.length;let s=0;if(!o){for(;s<i;s++)n(e[s]);return}if(!i){for(;s<o;s++)r(t[s]);return}for(;s<o&&t[s]===e[s];s++);let a,l;t=t.slice(s),e=e.slice(s);for(a of t)e.includes(a)||r(a);for(l of e)t.includes(l)||n(l)}function Kt(e,t,n,r){return e.addEventListener(t,n,r),kv(e.removeEventListener.bind(e,t,n,r))}function UD(e,t,n,r){const i=()=>{kg(ce(e)).forEach(o=>{o&&kg(ce(t)).forEach(s=>Kt(o,s,n,r))})};typeof e=="function"?re(i):Ve(i)}function BD(e,t=bi()){let n=0,r,i;return()=>(n++,ae(()=>{n--,queueMicrotask(()=>{!n&&i&&(i(),i=r=void 0)})}),i||An(o=>r=e(i=o),t),r)}function qD(e){const t=bi(),n=BD(e,t);return()=>De.context?An(e,t):n()}function xv(e,t=!1){const n=window.matchMedia(e),[r,i]=HD(t,()=>n.matches);return Kt(n,"change",()=>i(n.matches)),r}function WD(e){return xv("(prefers-color-scheme: dark)",e)}WD.bind(void 0,!1);const GD=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function B2(e){const t={};let n;for(;n=GD.exec(e);)t[n[1]]=n[2];return t}function _i(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=B2(e)}else typeof t=="string"&&(t=B2(t));return{...e,...t}}function Nt(...e){return jD(e)}function ZD(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function xg(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function KD(e){return typeof e=="number"}function Pa(e){return Object.prototype.toString.call(e)==="[object String]"}function tk(e){return typeof e=="function"}function Bi(e){return t=>`${e()}-${t}`}function YD(){const e=new Map,t=(i,o,s,a)=>{const l=a?.once?(...c)=>{e.delete(s),s(...c)}:s;e.set(s,{type:o,eventTarget:i,fn:l,options:a}),i.addEventListener(o,s,a)},n=(i,o,s,a)=>{const l=e.get(s)?.fn||s;i.removeEventListener(o,l,a),e.delete(s)},r=()=>{e.forEach((i,o)=>{n(i.eventTarget,i.type,o,i.options)})};return ae(()=>{r()}),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function dn(e,t){return e?e===t||e.contains(t):!1}function dc(e,t=!1){const{activeElement:n}=nr(e);if(!n?.nodeName)return null;if(nk(n)&&n.contentDocument)return dc(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=nr(n).getElementById(r);if(i)return i}}return n}function Sv(e){return nr(e).defaultView||window}function nr(e){return e?e.ownerDocument||e:document}function nk(e){return e.tagName==="IFRAME"}var rk=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(rk||{});function ik(e){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function _v(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function J0(){return _v(/^Mac/i)}function JD(){return _v(/^iPhone/i)}function XD(){return _v(/^iPad/i)||J0()&&navigator.maxTouchPoints>1}function QD(){return JD()||XD()}function eO(){return J0()||QD()}function j0e(){return ik(/AppleWebKit/i)&&!tO()}function tO(){return ik(/Chrome/i)}function Je(e,t){return t&&(tk(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function cn(e){return t=>{for(const n of e)Je(t,n)}}function nO(e){return J0()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function xn(e){if(e)if(rO())e.focus({preventScroll:!0});else{const t=iO(e);e.focus(),oO(t)}}var ud=null;function rO(){if(ud==null){ud=!1;try{document.createElement("div").focus({get preventScroll(){return ud=!0,!0}})}catch{}}return ud}function iO(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function oO(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ok=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],sO=[...ok,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Cv=`${ok.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,aO=sO.join(':not([hidden]):not([tabindex="-1"]),');function sk(e,t){const r=Array.from(e.querySelectorAll(Cv)).filter(q2);return t&&q2(e)&&r.unshift(e),r.forEach((i,o)=>{if(nk(i)&&i.contentDocument){const s=i.contentDocument.body,a=sk(s,!1);r.splice(o,1,...a)}}),r}function q2(e){return ak(e)&&!lO(e)}function ak(e){return e.matches(Cv)&&Iv(e)}function lO(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Iv(e,t){return e.nodeName!=="#comment"&&cO(e)&&uO(e,t)&&(!e.parentElement||Iv(e.parentElement,e))}function cO(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:o,visibility:s}=i(e);r=o!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function uO(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function dO(e,t,n){const r=t?.tabbable?aO:Cv,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(o){return t?.from?.contains(o)?NodeFilter.FILTER_REJECT:o.matches(r)&&Iv(o)&&(!t?.accept||t.accept(o))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}function W2(e){let t=e;for(;t&&!fO(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function fO(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function hO(){}function lk(e){return[e.clientX,e.clientY]}function Ev(e,t){const[n,r]=e;let i=!1;const o=t.length;for(let s=o,a=0,l=s-1;a<s;l=a++){const[c,u]=t[a],[d,f]=t[l],[,h]=t[l===0?s-1:l-1]||[0,0],m=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(m===0)return!0;m>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(u<f){if(r>u&&r<=f){if(m===0)return!0;m<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r===u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return i}function et(e,t){return ie(e,t)}var Yl=new Map,G2=new Set;function Z2(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Yl.get(n.target);r||(r=new Set,Yl.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Yl.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Yl.delete(n.target)),Yl.size===0)){for(const i of G2)i();G2.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Z2():document.addEventListener("DOMContentLoaded",Z2));function Sg(e,t){const n=K2(e,t,"left"),r=K2(e,t,"top"),i=t.offsetWidth,o=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+i>l&&(s+=n+i-l),r<=a?a=r:r+o>c&&(a+=r+o-c),e.scrollLeft=s,e.scrollTop=a}function K2(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function mO(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let i=W2(e);for(;e&&i&&e!==n&&i!==n;)Sg(i,e),e=i,i=W2(e)}else{const{left:i,top:o}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(i-s)>1||Math.abs(o-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var pO={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},Fc="data-kb-top-layer",ck,_g=!1,yo=[];function Hc(e){return yo.findIndex(t=>t.node===e)}function gO(e){return yo[Hc(e)]}function vO(e){return yo[yo.length-1].node===e}function uk(){return yo.filter(e=>e.isPointerBlocking)}function bO(){return[...uk()].slice(-1)[0]}function Tv(){return uk().length>0}function dk(e){const t=Hc(bO()?.node);return Hc(e)<t}function yO(e){yo.push(e)}function wO(e){const t=Hc(e);t<0||yo.splice(t,1)}function kO(){for(const{node:e}of yo)e.style.pointerEvents=dk(e)?"none":"auto"}function xO(e){if(Tv()&&!_g){const t=nr(e);ck=document.body.style.pointerEvents,t.body.style.pointerEvents="none",_g=!0}}function SO(e){if(Tv())return;const t=nr(e);t.body.style.pointerEvents=ck,t.body.style.length===0&&t.body.removeAttribute("style"),_g=!1}var gr={layers:yo,isTopMostLayer:vO,hasPointerBlockingLayer:Tv,isBelowPointerBlockingLayer:dk,addLayer:yO,removeLayer:wO,indexOf:Hc,find:gO,assignPointerEventToLayers:kO,disableBodyPointerEvents:xO,restoreBodyPointerEvents:SO},Dm="focusScope.autoFocusOnMount",Om="focusScope.autoFocusOnUnmount",Y2={bubbles:!1,cancelable:!0},J2={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=xg(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=xg(this.stack,e),this.active()?.resume()}};function fk(e,t){const[n,r]=we(!1),i={pause(){r(!0)},resume(){r(!1)}};let o=null;const s=m=>e.onMountAutoFocus?.(m),a=m=>e.onUnmountAutoFocus?.(m),l=()=>nr(t()),c=()=>{const m=l().createElement("span");return m.setAttribute("data-focus-trap",""),m.tabIndex=0,Object.assign(m.style,pO),m},u=()=>{const m=t();return m?sk(m,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const m=u();return m.length>0?m[0]:null},f=()=>{const m=u();return m.length>0?m[m.length-1]:null},h=()=>{const m=t();if(!m)return!1;const p=dc(m);return!p||dn(m,p)?!1:ak(p)};re(()=>{const m=t();if(!m)return;J2.add(i);const p=dc(m);if(!dn(m,p)){const b=new CustomEvent(Dm,Y2);m.addEventListener(Dm,s),m.dispatchEvent(b),b.defaultPrevented||setTimeout(()=>{xn(d()),dc(m)===p&&xn(m)},0)}ae(()=>{m.removeEventListener(Dm,s),setTimeout(()=>{const b=new CustomEvent(Om,Y2);h()&&b.preventDefault(),m.addEventListener(Om,a),m.dispatchEvent(b),b.defaultPrevented||xn(p??l().body),m.removeEventListener(Om,a),J2.remove(i)},0)})}),re(()=>{const m=t();if(!m||!ce(e.trapFocus)||n())return;const p=b=>{const v=b.target;v?.closest(`[${Fc}]`)||(dn(m,v)?o=v:xn(o))},g=b=>{const y=b.relatedTarget??dc(m);y?.closest(`[${Fc}]`)||dn(m,y)||xn(o)};l().addEventListener("focusin",p),l().addEventListener("focusout",g),ae(()=>{l().removeEventListener("focusin",p),l().removeEventListener("focusout",g)})}),re(()=>{const m=t();if(!m||!ce(e.trapFocus)||n())return;const p=c();m.insertAdjacentElement("afterbegin",p);const g=c();m.insertAdjacentElement("beforeend",g);function b(y){const _=d(),k=f();y.relatedTarget===_?xn(k):xn(_)}p.addEventListener("focusin",b),g.addEventListener("focusin",b);const v=new MutationObserver(y=>{for(const _ of y)_.previousSibling===g&&(g.remove(),m.insertAdjacentElement("beforeend",g)),_.nextSibling===p&&(p.remove(),m.insertAdjacentElement("afterbegin",p))});v.observe(m,{childList:!0,subtree:!1}),ae(()=>{p.removeEventListener("focusin",b),g.removeEventListener("focusin",b),p.remove(),g.remove(),v.disconnect()})})}var _O="data-live-announcer";function hk(e){re(()=>{ce(e.isDisabled)||ae(CO(ce(e.targets),ce(e.root)))})}var Jl=new WeakMap,Dr=[];function CO(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${_O}], [${Fc}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&o(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)o(f),f=u.nextNode()}},o=l=>{const c=Jl.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Jl.set(l,c+1))};Dr.length&&Dr[Dr.length-1].disconnect(),i(t);const s=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return Dr.push(a),()=>{s.disconnect();for(const l of r){const c=Jl.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Jl.delete(l)):Jl.set(l,c-1)}a===Dr[Dr.length-1]?(Dr.pop(),Dr.length&&Dr[Dr.length-1].observe()):Dr.splice(Dr.indexOf(a),1)}}var X2="interactOutside.pointerDownOutside",Q2="interactOutside.focusOutside";function IO(e,t){let n,r=hO;const i=()=>nr(t()),o=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),l=d=>{const f=d.target;return!(f instanceof Element)||f.closest(`[${Fc}]`)||!dn(i(),f)||dn(t(),f)?!1:!e.shouldExcludeElement?.(f)},c=d=>{function f(){const h=t(),m=d.target;if(!h||!m||!l(d))return;const p=cn([o,a]);m.addEventListener(X2,p,{once:!0});const g=new CustomEvent(X2,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||nO(d)&&d.button===0}});m.dispatchEvent(g)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const m=cn([s,a]);h.addEventListener(Q2,m,{once:!0});const p=new CustomEvent(Q2,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(p)};re(()=>{ce(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),ae(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}function EO(e){const t=n=>{n.key===rk.Escape&&e.onEscapeKeyDown?.(n)};re(()=>{if(ce(e.isDisabled))return;const n=e.ownerDocument?.()??nr();n.addEventListener("keydown",t),ae(()=>{n.removeEventListener("keydown",t)})})}function pt(e){const[t,n]=pe(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return C(Q7,ie(n,{get component(){return t.as}}))}var mk=yt();function TO(){return wt(mk)}function X0(e){let t;const n=TO(),[r,i]=pe(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),o=new Set([]),s=d=>{o.add(d);const f=n?.registerNestedLayer(d);return()=>{o.delete(d),f?.()}};IO({shouldExcludeElement:d=>t?r.excludedElements?.some(f=>dn(f(),d))||[...o].some(f=>dn(f,d)):!1,onPointerDownOutside:d=>{!t||gr.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!gr.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),EO({ownerDocument:()=>nr(t),onEscapeKeyDown:d=>{!t||!gr.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Pt(()=>{if(!t)return;gr.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);gr.assignPointerEventToLayers(),gr.disableBodyPointerEvents(t),ae(()=>{t&&(gr.removeLayer(t),d?.(),gr.assignPointerEventToLayers(),gr.restoreBodyPointerEvents(t))})}),re(Yt([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=gr.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,gr.assignPointerEventToLayers()),f&&gr.disableBodyPointerEvents(d),ae(()=>{gr.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return C(mk.Provider,{value:u,get children(){return C(pt,ie({as:"div",ref(d){var f=Nt(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function yu(e){const[t,n]=we(e.defaultValue?.()),r=q(()=>e.value?.()!==void 0),i=q(()=>r()?e.value?.():t());return[i,s=>{Ye(()=>{const a=FD(s,i());return Object.is(a,i())||(r()||n(a),e.onChange?.(a)),a})}]}function pk(e){const[t,n]=yu(e);return[()=>t()??!1,n]}function $O(e){const[t,n]=yu(e);return[()=>t()??[],n]}function oa(e={}){const[t,n]=pk({value:()=>ce(e.open),defaultValue:()=>!!ce(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}function wu(e,t){const[n,r]=we(e6(t?.()));return re(()=>{r(e()?.tagName.toLowerCase()||e6(t?.()))}),n}function e6(e){return Pa(e)?e:void 0}var LO=Object.defineProperty,Ci=(e,t)=>{for(var n in t)LO(e,n,{get:t[n],enumerable:!0})},AO={};Ci(AO,{Button:()=>$v,Root:()=>sa});var MO=["button","color","file","image","reset","submit"];function DO(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?MO.indexOf(e.type)!==-1:!1}function sa(e){let t;const n=et({type:"button"},e),[r,i]=pe(n,["ref","type","disabled"]),o=wu(()=>t,()=>"button"),s=q(()=>{const c=o();return c==null?!1:DO({tagName:c,type:r.type})}),a=q(()=>o()==="input"),l=q(()=>o()==="a"&&t?.getAttribute("href")!=null);return C(pt,ie({as:"button",ref(c){var u=Nt(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return it(()=>!!(s()||a()))()?r.type:void 0},get role(){return!s()&&!l()?"button":void 0},get tabIndex(){return!s()&&!l()&&!r.disabled?0:void 0},get disabled(){return it(()=>!!(s()||a()))()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var $v=sa;function Gn(e){return t=>(e(t),()=>e(void 0))}var Hn=e=>typeof e=="function"?e():e,Cg=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},dd=new Map,OO=e=>{re(()=>{const t=Hn(e.style)??{},n=Hn(e.properties)??[],r={};for(const o in t)r[o]=e.element.style[o];const i=dd.get(e.key);i?i.activeCount++:dd.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(o=>o.key)}),Object.assign(e.element.style,e.style);for(const o of n)e.element.style.setProperty(o.key,o.value);ae(()=>{const o=dd.get(e.key);if(o){if(o.activeCount!==1){o.activeCount--;return}dd.delete(e.key);for(const[s,a]of Object.entries(o.originalStyles))e.element.style[s]=a;for(const s of o.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},t6=OO,PO=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},RO=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},NO=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,o=0,s=0,a=!1;do{const[l,c,u]=PO(i,t),d=u-l-r*c;(c!==0||d!==0)&&RO(i,t)&&(o+=d,s+=c),i===(n??document.documentElement)?a=!0:i=i._$host??i.parentElement}while(i&&!a);return[o,s]},[n6,r6]=we([]),zO=e=>n6().indexOf(e)===n6().length-1,jO=e=>{const t=ie({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Mn();let r=[0,0],i=null,o=null;re(()=>{Hn(t.enabled)&&(r6(c=>[...c,n]),ae(()=>{r6(c=>c.filter(u=>u!==n))}))}),re(()=>{if(!Hn(t.enabled)||!Hn(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(Hn(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(Hn(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,m=window.scrollX;t6({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{Hn(t.restoreScrollPosition)&&u>0&&window.scrollTo(m,h)}})}else t6({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),re(()=>{!zO(n)||!Hn(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),ae(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=i6(c),i=null,o=null},a=c=>{const u=c.target,d=Hn(t.element),f=FO(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",m=h==="x"?f[0]:f[1],p=o6(u,h,m,d);let g;d&&Cg(d,u)?g=!p:g=!0,g&&c.cancelable&&c.preventDefault()},l=c=>{const u=Hn(t.element),d=c.target;let f;if(c.touches.length===2)f=!Hn(t.allowPinchZoom);else{if(i==null||o===null){const h=i6(c).map((p,g)=>r[g]-p),m=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=m,o=m==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=o6(d,i,o,u);u&&Cg(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},FO=e=>[e.deltaX,e.deltaY],i6=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],o6=(e,t,n,r)=>{const i=r!==null&&Cg(r,e),[o,s]=NO(e,t,i?r:void 0);return!(n>0&&Math.abs(o)<=1||n<0&&Math.abs(s)<1)},HO=jO,gk=HO,VO=e=>{const t=q(()=>{const s=Hn(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,i]=we(Hn(e.show)?"present":"hidden");let o="none";return re(s=>{const a=Hn(e.show);return Ye(()=>{if(s===a)return a;const l=o,c=n();a?i("present"):c==="none"||t()?.display==="none"?i("hidden"):i(s===!0&&l!==c?"hiding":"hidden")}),a}),re(()=>{const s=Hn(e.element);if(!s)return;const a=c=>{c.target===s&&(o=n())},l=c=>{const d=n().includes(c.animationName);c.target===s&&d&&r()==="hiding"&&i("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),ae(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:i}},UO=VO,Fs=UO,BO={};Ci(BO,{CloseButton:()=>bk,Content:()=>yk,Description:()=>wk,Dialog:()=>Wo,Overlay:()=>kk,Portal:()=>xk,Root:()=>Sk,Title:()=>_k,Trigger:()=>Ck,useDialogContext:()=>ss});var vk=yt();function ss(){const e=wt(vk);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function bk(e){const t=ss(),[n,r]=pe(e,["aria-label","onClick"]);return C(sa,ie({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:o=>{Je(o,n.onClick),t.close()}},r))}function yk(e){let t;const n=ss(),r=et({id:n.generateId("content")},e),[i,o]=pe(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let s=!1,a=!1;const l=f=>{i.onPointerDownOutside?.(f),n.modal()&&f.detail.isContextMenu&&f.preventDefault()},c=f=>{i.onFocusOutside?.(f),n.modal()&&f.preventDefault()},u=f=>{i.onInteractOutside?.(f),!n.modal()&&(f.defaultPrevented||(s=!0,f.detail.originalEvent.type==="pointerdown"&&(a=!0)),dn(n.triggerRef(),f.target)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&a&&f.preventDefault())},d=f=>{i.onCloseAutoFocus?.(f),n.modal()?(f.preventDefault(),xn(n.triggerRef())):(f.defaultPrevented||(s||xn(n.triggerRef()),f.preventDefault()),s=!1,a=!1)};return hk({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),gk({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),fk({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:i.onOpenAutoFocus,onUnmountAutoFocus:d},()=>t),re(()=>ae(n.registerContentId(o.id))),C(Ce,{get when(){return n.contentPresent()},get children(){return C(X0,ie({ref(f){var h=Nt(m=>{n.setContentRef(m),t=m},i.ref);typeof h=="function"&&h(f)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return it(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,get onDismiss(){return n.close}},o))}})}function wk(e){const t=ss(),n=et({id:t.generateId("description")},e),[r,i]=pe(n,["id"]);return re(()=>ae(t.registerDescriptionId(r.id))),C(pt,ie({as:"p",get id(){return r.id}},i))}function kk(e){const t=ss(),[n,r]=pe(e,["ref","style","onPointerDown"]),i=o=>{Je(o,n.onPointerDown),o.target===o.currentTarget&&o.preventDefault()};return C(Ce,{get when(){return t.overlayPresent()},get children(){return C(pt,ie({as:"div",ref(o){var s=Nt(t.setOverlayRef,n.ref);typeof s=="function"&&s(o)},get style(){return _i({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:i},r))}})}function xk(e){const t=ss();return C(Ce,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return C(ia,e)}})}var s6={dismiss:"Dismiss"};function Sk(e){const t=`dialog-${Mn()}`,n=et({id:t,modal:!0,translations:s6},e),[r,i]=we(),[o,s]=we(),[a,l]=we(),[c,u]=we(),[d,f]=we(),[h,m]=we(),p=oa({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:_=>n.onOpenChange?.(_)}),g=()=>n.forceMount||p.isOpen(),{present:b}=Fs({show:g,element:()=>c()??null}),{present:v}=Fs({show:g,element:()=>d()??null}),y={translations:()=>n.translations??s6,isOpen:p.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??y.modal(),contentId:r,titleId:o,descriptionId:a,triggerRef:h,overlayRef:c,setOverlayRef:u,contentRef:d,setContentRef:f,overlayPresent:b,contentPresent:v,close:p.close,toggle:p.toggle,setTriggerRef:m,generateId:Bi(()=>n.id),registerContentId:Gn(i),registerTitleId:Gn(s),registerDescriptionId:Gn(l)};return C(vk.Provider,{value:y,get children(){return n.children}})}function _k(e){const t=ss(),n=et({id:t.generateId("title")},e),[r,i]=pe(n,["id"]);return re(()=>ae(t.registerTitleId(r.id))),C(pt,ie({as:"h2",get id(){return r.id}},i))}function Ck(e){const t=ss(),[n,r]=pe(e,["ref","onClick"]);return C(sa,ie({ref(o){var s=Nt(t.setTriggerRef,n.ref);typeof s=="function"&&s(o)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return it(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:o=>{Je(o,n.onClick),t.toggle()}},r))}var Wo=Object.assign(Sk,{CloseButton:bk,Content:yk,Description:wk,Overlay:kk,Portal:xk,Title:_k,Trigger:Ck}),qO=me("<div data-component=dialog-stack>");const Ik=yt();function WO(){const[e,t]=we(),n={current:void 0},r={value:!1};ae(()=>{n.current!==void 0&&(clearTimeout(n.current),n.current=void 0)});const i=()=>{const s=e();if(!s||r.value)return;r.value=!0,s.onClose?.(),s.setClosing(!0);const a=s.id;n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),n.current=setTimeout(()=>{n.current=void 0,s.dispose(),e()?.id===a&&t(void 0),r.value=!1},100)};return re(()=>{if(!e())return;Kt(window,"keydown",a=>{a.key==="Escape"&&(i(),a.preventDefault(),a.stopPropagation())},{capture:!0})}),{get active(){return e()},close:i,show:(s,a,l)=>{const c=e();c&&(c.dispose(),t(void 0)),n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),r.value=!1;const u=Math.random().toString(36).slice(2);let d,f;const h=co(a,()=>An(m=>{d=m;const[p,g]=we(!1);return f=g,C(Wo,{modal:!0,get open(){return!p()},onOpenChange:b=>{b||i()},get children(){return C(Wo.Portal,{get children(){return[C(Wo.Overlay,{"data-component":"dialog-overlay",onClick:i}),it(()=>s())]}})}})}));!d||!f||t({id:u,node:h,dispose:d,owner:a,onClose:l,setClosing:f})}}}function GO(e){const t=WO();return C(Ik.Provider,{value:t,get children(){return[it(()=>e.children),(()=>{var n=qO();return X(n,()=>t.active?.node),n})()]}})}function Q0(){const e=wt(Ik),t=bi();if(!t)throw new Error("useDialog must be used within a DialogProvider");if(!e)throw new Error("useDialog must be used within a DialogProvider");return{get active(){return e.active},show(n,r){const i=e.active?.owner??t;e.show(n,i,r)},close(){e.close()}}}const Ek={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.git":"Git changes","ui.sessionReview.title.branch":"Branch changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.submit":"Comment","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.diffs.changed":"Changed","ui.sessionTurn.diffs.showAll":"Show all","ui.sessionTurn.diffs.showLess":"Show less","ui.sessionTurn.diffs.more":"+{{count}} more files","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.codesearch":"Code Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert message","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.answer.none":"(no answer)","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."};function ZO(e,t){return t?e.replace(/{{\s*([^}]+?)\s*}}/g,(n,r)=>{const i=String(r),o=t[i];return o===void 0?"":String(o)}):e}const KO={locale:()=>"en",t:(e,t)=>{const n=Ek[e]??String(e);return ZO(n,t)}},Tk=yt(KO);function YO(e){return C(Tk.Provider,{get value(){return e.value},get children(){return e.children}})}function ku(){return wt(Tk)}function Lv(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var aa=Lv();function $k(e){aa=e}var Ec={exec:()=>null};function xt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(Qn.caret,"$1"),n=n.replace(i,s),r},getRegex:()=>new RegExp(n,t)};return r}var JO=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Qn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},XO=/^(?:[ \t]*(?:\n|$))+/,QO=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,eP=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tP=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Av=/(?:[*+-]|\d{1,9}[.)])/,Lk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ak=xt(Lk).replace(/bull/g,Av).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nP=xt(Lk).replace(/bull/g,Av).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Mv=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rP=/^[^\n]+/,Dv=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,iP=xt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Dv).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),oP=xt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Av).getRegex(),eh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ov=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sP=xt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ov).replace("tag",eh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Mk=xt(Mv).replace("hr",xu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",eh).getRegex(),aP=xt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Mk).getRegex(),Pv={blockquote:aP,code:QO,def:iP,fences:eP,heading:tP,hr:xu,html:sP,lheading:Ak,list:oP,newline:XO,paragraph:Mk,table:Ec,text:rP},a6=xt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",eh).getRegex(),lP={...Pv,lheading:nP,table:a6,paragraph:xt(Mv).replace("hr",xu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",a6).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",eh).getRegex()},cP={...Pv,html:xt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ov).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ec,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xt(Mv).replace("hr",xu).replace("heading",` *#{1,6} *[^
|
|
3
3
|
]`).replace("lheading",Ak).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},uP=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,dP=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Dk=/^( {2,}|\\)\n(?!\s*$)/,fP=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,th=/[\p{P}\p{S}]/u,Rv=/[\s\p{P}\p{S}]/u,Ok=/[^\s\p{P}\p{S}]/u,hP=xt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Rv).getRegex(),Pk=/(?!~)[\p{P}\p{S}]/u,mP=/(?!~)[\s\p{P}\p{S}]/u,pP=/(?:[^\s\p{P}\p{S}]|~)/u,gP=xt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",JO?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Rk=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vP=xt(Rk,"u").replace(/punct/g,th).getRegex(),bP=xt(Rk,"u").replace(/punct/g,Pk).getRegex(),Nk="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",yP=xt(Nk,"gu").replace(/notPunctSpace/g,Ok).replace(/punctSpace/g,Rv).replace(/punct/g,th).getRegex(),wP=xt(Nk,"gu").replace(/notPunctSpace/g,pP).replace(/punctSpace/g,mP).replace(/punct/g,Pk).getRegex(),kP=xt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ok).replace(/punctSpace/g,Rv).replace(/punct/g,th).getRegex(),xP=xt(/\\(punct)/,"gu").replace(/punct/g,th).getRegex(),SP=xt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_P=xt(Ov).replace("(?:-->|$)","-->").getRegex(),CP=xt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_P).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,IP=xt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",zf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zk=xt(/^!?\[(label)\]\[(ref)\]/).replace("label",zf).replace("ref",Dv).getRegex(),jk=xt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Dv).getRegex(),EP=xt("reflink|nolink(?!\\()","g").replace("reflink",zk).replace("nolink",jk).getRegex(),l6=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Nv={_backpedal:Ec,anyPunctuation:xP,autolink:SP,blockSkip:gP,br:Dk,code:dP,del:Ec,emStrongLDelim:vP,emStrongRDelimAst:yP,emStrongRDelimUnd:kP,escape:uP,link:IP,nolink:jk,punctuation:hP,reflink:zk,reflinkSearch:EP,tag:CP,text:fP,url:Ec},TP={...Nv,link:xt(/^!?\[(label)\]\((.*?)\)/).replace("label",zf).getRegex(),reflink:xt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zf).getRegex()},Ig={...Nv,emStrongRDelimAst:wP,emStrongLDelim:bP,url:xt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",l6).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:xt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",l6).getRegex()},$P={...Ig,br:xt(Dk).replace("{2,}","*").getRegex(),text:xt(Ig.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},fd={normal:Pv,gfm:lP,pedantic:cP},Xl={normal:Nv,gfm:Ig,breaks:$P,pedantic:TP},LP={"&":"&","<":"<",">":">",'"':""","'":"'"},c6=e=>LP[e];function io(e,t){if(t){if(Qn.escapeTest.test(e))return e.replace(Qn.escapeReplace,c6)}else if(Qn.escapeTestNoEncode.test(e))return e.replace(Qn.escapeReplaceNoEncode,c6);return e}function u6(e){try{e=encodeURI(e).replace(Qn.percentDecode,"%")}catch{return null}return e}function d6(e,t){let n=e.replace(Qn.findPipe,(o,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(Qn.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Qn.slashPipe,"|");return r}function Ql(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function AP(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function f6(e,t,n,r,i){let o=t.href,s=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:s,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function MP(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
4
4
|
`).map(o=>{let s=o.match(n.other.beginningSpace);if(s===null)return o;let[a]=s;return a.length>=i.length?o.slice(i.length):o}).join(`
|
|
@@ -2400,7 +2400,7 @@ ${t}`,lu=(e,t)=>e<t?-1:e>t?1:0;function Cre(e,t){const n=new Map(e.map(r=>[r.id,
|
|
|
2400
2400
|
${n??Gp}`;return e.get(r).value},clear:()=>e.clear()}}function nie(e){const[t,n]=qe({node:{},dir:{"":{expanded:!0}}}),r=new Map,i=()=>{r.clear(),n("node",Ct({})),n("dir",Ct({})),n("dir","",{expanded:!0})},o=d=>{t.dir[d]||n("dir",d,{expanded:!1})},s=(d,f)=>{const h=e.normalizeDir(d);o(h);const m=t.dir[h];if(!f?.force&&m?.loaded)return Promise.resolve();const p=r.get(h);if(p)return p;n("dir",h,He(v=>{v.loading=!0,v.error=void 0}));const g=e.scope(),b=e.list(h).then(v=>{if(e.scope()!==g)return;const y=t.dir[h]?.children??[],_=v.map(x=>x.path),k=new Set(_);n("node",He(x=>{const I=[];for(const A of y){if(k.has(A))continue;x[A]?.type==="directory"&&I.push(A),delete x[A]}if(I.length>0){const A=Object.keys(x);for(const L of A)for(const $ of I)if(L.startsWith($+"/")){delete x[L];break}}for(const A of v)x[A.path]=A})),n("dir",h,He(x=>{x.loaded=!0,x.loading=!1,x.children=_}))}).catch(v=>{e.scope()===g&&(n("dir",h,He(y=>{y.loading=!1,y.error=v.message})),e.onError(v.message))}).finally(()=>{r.delete(h)});return r.set(h,b),b};return{listDir:s,expandDir:d=>{const f=e.normalizeDir(d);o(f),n("dir",f,"expanded",!0),s(f)},collapseDir:d=>{const f=e.normalizeDir(d);o(f),n("dir",f,"expanded",!1)},dirState:d=>{const f=e.normalizeDir(d);return t.dir[f]},children:d=>{const f=e.normalizeDir(d),h=t.dir[f]?.children;if(!h)return[];const m=[];for(const p of h){const g=t.node[p];g&&m.push(g)}return m},node:d=>t.node[d],isLoaded:d=>!!t.dir[d]?.loaded,reset:i}}function rie(e,t){if(e.type!=="file.watcher.updated")return;const n=typeof e.properties=="object"&&e.properties?e.properties:void 0,r=typeof n?.file=="string"?n.file:void 0,i=typeof n?.event=="string"?n.event:void 0;if(!r||!i)return;const o=t.normalize(r);if(!o||o.startsWith(".git/"))return;if((t.hasFile(o)||t.isOpen?.(o))&&t.loadFile(o),i==="change"){const a=(()=>{if(o==="")return"";if(t.node(o)?.type==="directory")return o})();if(a===void 0||!t.isDirLoaded(a))return;t.refreshDir(a);return}if(i!=="add"&&i!=="unlink")return;const s=o.split("/").slice(0,-1).join("/");t.isDirLoaded(s)&&t.refreshDir(s)}function iie(e,t){return e instanceof Error&&e.message?e.message:typeof e=="string"&&e?e:t}const{use:xhe,provider:oie}=Xt({name:"File",gate:!1,init:()=>{const e=Wh();A4();const t=pr(),n=En(),r=jl(),i=q(()=>e.directory),o=_$(i),s=r.tabs(()=>`${t.dir}${t.id?"/"+t.id:""}`),a=new Map,[l,c]=qe({file:{}}),u=nie({scope:i,normalizeDir:o.normalizeDir,list:M=>e.client.file.list({path:M}).then(T=>T.data??[]),onError:M=>{yn({variant:"error",title:n.t("toast.file.listFailed.title"),description:M})}}),d=M=>{Kre(M,T=>{l.file[T]&&c("file",T,He(E=>{E.content=void 0,E.loaded=!1}))})};re(()=>{i(),a.clear(),Yre(),rt(()=>{c("file",Ct({})),u.reset()})});const f=tie(),h=q(()=>f.load(i(),t.id)),m=M=>{M&&(l.file[M]||c("file",M,{path:M,name:Nn(M)}))},p=M=>{c("file",M,He(T=>{T.loading=!0,T.error=void 0}))},g=(M,T)=>{c("file",M,He(E=>{E.loaded=!0,E.loading=!1,E.content=T}))},b=(M,T)=>{c("file",M,He(E=>{E.loading=!1,E.error=T})),yn({variant:"error",title:n.t("toast.file.loadFailed.title"),description:T})},v=(M,T)=>{const E=o.normalize(M);if(!E)return Promise.resolve();const D=i(),F=`${D}
|
|
2401
2401
|
${E}`;m(E);const G=l.file[E];if(!T?.force&&G?.loaded)return Promise.resolve();const U=a.get(F);if(U)return U;p(E);const Z=e.client.file.read({path:E}).then(Y=>{if(i()!==D)return;const ee=Y.data;g(E,ee),ee&&(Wp(E,I5(ee)),d(new Set([E])))}).catch(Y=>{i()===D&&b(E,iie(Y,n.t("error.chain.unknown")))}).finally(()=>{a.delete(F)});return a.set(F,Z),Z},y=(M,T)=>e.client.find.files({query:M,dirs:T}).then(E=>(E.data??[]).map(o.normalize),()=>[]),_=e.event.listen(M=>{rie(M.details,{normalize:o.normalize,hasFile:T=>!!l.file[T],isOpen:T=>s.all().some(E=>o.pathFromTab(E)===T),loadFile:T=>{v(T,{force:!0})},node:u.node,isDirLoaded:u.isLoaded,refreshDir:T=>{u.listDir(T,{force:!0})}})}),k=M=>{const T=o.normalize(M),E=l.file[T],D=E?.content;return D?Jre(T)?(Wp(T),E):(Wp(T,I5(D)),E):E};function x(M,T){return T(o.normalize(M))}const I=M=>x(M,T=>h().scrollTop(T)),A=M=>x(M,T=>h().scrollLeft(T)),L=M=>x(M,T=>h().selectedLines(T)),$=(M,T)=>x(M,E=>h().setScrollTop(E,T)),H=(M,T)=>x(M,E=>h().setScrollLeft(E,T)),j=(M,T)=>x(M,E=>h().setSelectedLines(E,T));return ae(()=>{_(),f.clear()}),{ready:()=>h().ready(),normalize:o.normalize,tab:o.tab,pathFromTab:o.pathFromTab,tree:{list:u.listDir,refresh:M=>u.listDir(M,{force:!0}),state:u.dirState,children:u.children,expand:u.expandDir,collapse:u.collapseDir,toggle(M){if(u.dirState(M)?.expanded){u.collapseDir(M);return}u.expandDir(M)}},get:k,load:v,scrollTop:I,scrollLeft:A,setScrollTop:$,setScrollLeft:H,selectedLines:L,setSelectedLines:j,searchFiles:M=>y(M,"false"),searchFilesAndDirectories:M=>y(M,"true")}}});var sie=me("<div data-slot=dialog-header>"),aie=me("<div data-slot=dialog-body>"),lie=me("<div data-component=dialog><div data-slot=dialog-container>");function K1(e){const t=ku();return(()=>{var n=lie(),r=n.firstChild;return X(r,C(Wo.Content,{"data-slot":"dialog-content",get"data-no-header"(){return!e.title&&!e.action?"":void 0},get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},onOpenAutoFocus:i=>{const s=i.currentTarget?.querySelector("[autofocus]");s&&(i.preventDefault(),s.focus())},get children(){return[C(Ce,{get when(){return e.title||e.action},get children(){var i=sie();return X(i,C(Ce,{get when(){return e.title},get children(){return C(Wo.Title,{"data-slot":"dialog-title",get children(){return e.title}})}}),null),X(i,C(Y0,{get children(){return[C(Fr,{get when(){return e.action},get children(){return e.action}}),C(Fr,{when:!0,get children(){return C(Wo.CloseButton,{"data-slot":"dialog-close-button",as:Wr,icon:"close",variant:"ghost",get"aria-label"(){return t.t("ui.common.close")}})}})]}}),null),i}}),C(Ce,{get when(){return e.description},get children(){return C(Wo.Description,{"data-slot":"dialog-description",style:{"margin-left":"-4px"},get children(){return e.description}})}}),(()=>{var i=aie();return X(i,()=>e.children),i})()]}})),Ve(i=>{var o=e.fit?!0:void 0,s=e.size||"normal",a=e.transition?!0:void 0;return o!==i.e&&vt(n,"data-fit",i.e=o),s!==i.t&&vt(n,"data-size",i.t=s),a!==i.a&&vt(n,"data-transition",i.a=a),i},{e:void 0,t:void 0,a:void 0}),n})()}function rn(e){const[t,n]=pe(e,["variant","size","icon","class","classList"]);return C($v,ie(n,{"data-component":"button",get"data-size"(){return t.size||"normal"},get"data-variant"(){return t.variant||"secondary"},get"data-icon"(){return t.icon},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return[C(Ce,{get when(){return t.icon},get children(){return C(ur,{get name(){return t.icon},size:"small"})}}),it(()=>e.children)]}}))}var cie=me('<div class="flex flex-1 min-w-0 min-h-0"tabindex=0 autofocus><div class="flex flex-col flex-1 min-w-0 p-8"><div class="flex flex-col gap-2 pt-22"><div class="flex items-center gap-2"><h1 class="text-16-medium text-text-strong"></h1></div><p class="text-14-regular text-text-base"></p></div><div class=flex-1></div><div class="flex flex-col gap-12"><div class="flex flex-col items-start gap-3">'),uie=me('<div class="flex items-center gap-1.5 -my-2.5">'),die=me('<button type=button class="h-6 flex items-center cursor-pointer bg-transparent border-none p-0 transition-all duration-200"><div class="w-full h-0.5 rounded-[1px] transition-colors duration-200">'),fie=me('<div class="flex-1 min-w-0 bg-surface-base overflow-hidden rounded-r-xl">'),hie=me('<img class="w-full h-full object-cover">'),mie=me('<video autoplay loop muted playsinline class="w-full h-full object-cover">');function pie(e){const t=Q0(),n=En(),r=Au(),[i,o]=we(0),s=()=>e.highlights.length,a=()=>Math.max(0,s()-1),l=()=>e.highlights[i()]??e.highlights[a()],c=()=>i()===0,u=()=>i()>=a(),d=()=>s()>1;function f(){u()||o(i()+1)}function h(){t.close()}function m(){r.general.setReleaseNotes(!1),h()}function p(g){if(g.key==="Escape"){g.preventDefault(),h();return}d()&&(g.key==="ArrowLeft"&&!c()&&(g.preventDefault(),o(i()-1)),g.key==="ArrowRight"&&!u()&&(g.preventDefault(),o(i()+1)))}return C(K1,{size:"large",fit:!0,class:"w-[min(calc(100vw-40px),720px)] h-[min(calc(100vh-40px),400px)] -mt-20 min-h-0 overflow-hidden",get children(){var g=cie(),b=g.firstChild,v=b.firstChild,y=v.firstChild,_=y.firstChild,k=y.nextSibling,x=v.nextSibling,I=x.nextSibling,A=I.firstChild;return g.$$keydown=p,X(_,()=>l()?.title??""),X(k,()=>l()?.description??""),X(A,(()=>{var L=it(()=>!!u());return()=>L()?C(rn,{variant:"primary",size:"large",onClick:h,get children(){return n.t("dialog.releaseNotes.action.getStarted")}}):C(rn,{variant:"secondary",size:"large",onClick:f,get children(){return n.t("dialog.releaseNotes.action.next")}})})(),null),X(A,C(rn,{variant:"ghost",size:"small",onClick:m,get children(){return n.t("dialog.releaseNotes.action.hideFuture")}}),null),X(I,(()=>{var L=it(()=>!!d());return()=>L()&&(()=>{var $=uie();return X($,()=>e.highlights.map((H,j)=>(()=>{var M=die(),T=M.firstChild;return M.$$click=()=>o(j),Ve(E=>{var D=j===i(),F=j!==i(),G=j===i(),U=j!==i();return D!==E.e&&M.classList.toggle("w-8",E.e=D),F!==E.t&&M.classList.toggle("w-3",E.t=F),G!==E.a&&T.classList.toggle("bg-icon-strong-base",E.a=G),U!==E.o&&T.classList.toggle("bg-icon-weak-base",E.o=U),E},{e:void 0,t:void 0,a:void 0,o:void 0}),M})())),$})()})(),null),X(g,(()=>{var L=it(()=>!!l()?.media);return()=>L()&&(()=>{var $=fie();return X($,(()=>{var H=it(()=>l().media.type==="image");return()=>H()?(()=>{var j=hie();return Ve(M=>{var T=l().media.src,E=l().media.alt??l()?.title??n.t("dialog.releaseNotes.media.alt");return T!==M.e&&vt(j,"src",M.e=T),E!==M.t&&vt(j,"alt",M.t=E),M},{e:void 0,t:void 0}),j})():(()=>{var j=mie();return Ve(()=>vt(j,"src",l().media.src)),j})()})()),$})()})(),null),g}})}Jr(["keydown","click"]);const gie="https://duckmind.ai/changelog.json";function uu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ni(e){if(typeof e=="string"){const t=e.trim();return t.length>0?t:void 0}if(typeof e=="number")return String(e)}function Yd(e){const t=e?.trim();if(t)return t.startsWith("v")||t.startsWith("V")?t.slice(1):t}function vie(e,t){if(!uu(e))return;const n=Ni(e.type)?.toLowerCase(),r=Ni(e.src)??Ni(e.url);if(r&&!(n!=="image"&&n!=="video"))return{type:n,src:r,alt:t}}function T5(e){if(!uu(e))return;const t=Ni(e.title);if(!t)return;const n=Ni(e.description)??Ni(e.shortDescription);if(!n)return;const r=vie(e.media,t);return{title:t,description:n,media:r}}function $5(e){if(!uu(e))return;const t=Ni(e.tag)??Ni(e.tag_name)??Ni(e.name);if(!Array.isArray(e.highlights))return{tag:t,highlights:[]};const n=e.highlights.flatMap(r=>{if(!uu(r))return[];const i=Ni(r.source);if(!i)return[];if(!i.toLowerCase().includes("desktop"))return[];if(Array.isArray(r.items))return r.items.map(s=>T5(s)).filter(s=>s!==void 0);const o=T5(r);return o?[o]:[]});return{tag:t,highlights:n}}function bie(e){if(Array.isArray(e))return e.map($5).filter(t=>t!==void 0);if(uu(e)&&Array.isArray(e.releases))return e.releases.map($5).filter(t=>t!==void 0)}function yie(e){const t=Yd(e.current),n=Yd(e.previous),r=e.releases,i=(()=>{if(!t)return 0;const c=r.findIndex(u=>Yd(u.tag)===t);return c===-1?0:c})(),o=(()=>{if(!n)return r.length;const c=r.findIndex((u,d)=>d>=i&&Yd(u.tag)===n);return c===-1?r.length:c})(),s=r.slice(i,o).flatMap(c=>c.highlights),a=new Set;return s.filter(c=>{const u=wie(c);return a.has(u)?!1:(a.add(u),!0)}).slice(0,5)}function wie(e){return[e.title,e.description,e.media?.type??"",e.media?.src??""].join(`
|
|
2402
2402
|
`)}function kie(e,t,n){const r=bie(e);return r?.length?yie({releases:r,current:t,previous:n}):[]}const{provider:xie}=Xt({name:"Highlights",gate:!1,init:()=>{const e=$o(),t=Q0(),n=Au(),[r,i,o,s]=Sn("highlights.v1",qe({version:void 0})),[a,l]=qe({from:void 0,to:void 0}),c={started:!1};let u;const d=()=>{u!==void 0&&(clearTimeout(u),u=void 0)},f=()=>{e.version&&i("version",e.version)},h=m=>{if(!n.general.releaseNotes()){f();return}const p=e.fetch??fetch,g=new AbortController;ae(()=>{g.abort(),d()}),p(gie,{signal:g.signal,headers:{Accept:"application/json"}}).then(b=>b.ok?b.json():void 0).then(b=>{if(!b)return;const v=kie(b,e.version,m);if(!g.signal.aborted){if(v.length===0){f();return}u=setTimeout(()=>{u=void 0,f(),t.show(()=>C(pie,{highlights:v}))},500)}}).catch(()=>{})};return re(()=>{if(c.started||!s()||!n.ready()||!e.version)return;c.started=!0;const m=r.version;if(!m){i("version",e.version);return}m!==e.version&&(l({from:m,to:e.version}),h(m))}),{ready:s,from:()=>a.from,to:()=>a.to,get last(){return r.version},markSeen:f}}});class ma extends Error{}class Sie extends ma{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class _ie extends ma{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Cie extends ma{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Wa extends ma{}class T$ extends ma{constructor(t){super(`Invalid unit ${t}`)}}class Un extends ma{}class zo extends ma{constructor(){super("Zone is an abstract class")}}const Ie="numeric",ki="short",Er="long",z0={year:Ie,month:Ie,day:Ie},$$={year:Ie,month:ki,day:Ie},Iie={year:Ie,month:ki,day:Ie,weekday:ki},L$={year:Ie,month:Er,day:Ie},A$={year:Ie,month:Er,day:Ie,weekday:Er},M$={hour:Ie,minute:Ie},D$={hour:Ie,minute:Ie,second:Ie},O$={hour:Ie,minute:Ie,second:Ie,timeZoneName:ki},P$={hour:Ie,minute:Ie,second:Ie,timeZoneName:Er},R$={hour:Ie,minute:Ie,hourCycle:"h23"},N$={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23"},z$={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23",timeZoneName:ki},j$={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23",timeZoneName:Er},F$={year:Ie,month:Ie,day:Ie,hour:Ie,minute:Ie},H$={year:Ie,month:Ie,day:Ie,hour:Ie,minute:Ie,second:Ie},V$={year:Ie,month:ki,day:Ie,hour:Ie,minute:Ie},U$={year:Ie,month:ki,day:Ie,hour:Ie,minute:Ie,second:Ie},Eie={year:Ie,month:ki,day:Ie,weekday:ki,hour:Ie,minute:Ie},B$={year:Ie,month:Er,day:Ie,hour:Ie,minute:Ie,timeZoneName:ki},q$={year:Ie,month:Er,day:Ie,hour:Ie,minute:Ie,second:Ie,timeZoneName:ki},W$={year:Ie,month:Er,day:Ie,weekday:Er,hour:Ie,minute:Ie,timeZoneName:Er},G$={year:Ie,month:Er,day:Ie,weekday:Er,hour:Ie,minute:Ie,second:Ie,timeZoneName:Er};class qu{get type(){throw new zo}get name(){throw new zo}get ianaName(){return this.name}get isUniversal(){throw new zo}offsetName(t,n){throw new zo}formatOffset(t,n){throw new zo}offset(t){throw new zo}equals(t){throw new zo}get isValid(){throw new zo}}let Zp=null;class Kh extends qu{static get instance(){return Zp===null&&(Zp=new Kh),Zp}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return iL(t,n,r)}formatOffset(t,n){return Pc(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const Y1=new Map;function Tie(e){let t=Y1.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Y1.set(e,t)),t}const $ie={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Lie(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,c,u]=r;return[s,i,o,a,l,c,u]}function Aie(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=$ie[o];o==="era"?r[a]=s:Ke(a)||(r[a]=parseInt(s,10))}return r}const Kp=new Map;class Co extends qu{static create(t){let n=Kp.get(t);return n===void 0&&Kp.set(t,n=new Co(t)),n}static resetCache(){Kp.clear(),Y1.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Co.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return iL(t,n,r,this.name)}formatOffset(t,n){return Pc(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=Tie(this.name);let[i,o,s,a,l,c,u]=r.formatToParts?Aie(r,n):Lie(r,n);a==="BC"&&(i=-Math.abs(i)+1);const f=Jh({year:i,month:o,day:s,hour:l===24?0:l,minute:c,second:u,millisecond:0});let h=+n;const m=h%1e3;return h-=m>=0?m:1e3+m,(f-h)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let L5={};function Mie(e,t={}){const n=JSON.stringify([e,t]);let r=L5[n];return r||(r=new Intl.ListFormat(e,t),L5[n]=r),r}const J1=new Map;function X1(e,t={}){const n=JSON.stringify([e,t]);let r=J1.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),J1.set(n,r)),r}const Q1=new Map;function Die(e,t={}){const n=JSON.stringify([e,t]);let r=Q1.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),Q1.set(n,r)),r}const ev=new Map;function Oie(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=ev.get(i);return o===void 0&&(o=new Intl.RelativeTimeFormat(e,t),ev.set(i,o)),o}let wc=null;function Pie(){return wc||(wc=new Intl.DateTimeFormat().resolvedOptions().locale,wc)}const tv=new Map;function Z$(e){let t=tv.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),tv.set(e,t)),t}const nv=new Map;function Rie(e){let t=nv.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...K$,...t}),nv.set(e,t)}return t}function Nie(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,i;try{r=X1(e).resolvedOptions(),i=e}catch{const l=e.substring(0,n);r=X1(l).resolvedOptions(),i=l}const{numberingSystem:o,calendar:s}=r;return[i,o,s]}}function zie(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function jie(e){const t=[];for(let n=1;n<=12;n++){const r=Ge.utc(2009,n,1);t.push(e(r))}return t}function Fie(e){const t=[];for(let n=1;n<=7;n++){const r=Ge.utc(2016,11,13+n);t.push(e(r))}return t}function Jd(e,t,n,r){const i=e.listingMode();return i==="error"?null:i==="en"?n(t):r(t)}function Hie(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||Z$(e.locale).numberingSystem==="latn"}class Vie{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=Die(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):N4(t,3);return ln(n,this.padTo)}}}class Uie{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const s=-1*(t.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&Co.create(a).valid?(i=a,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=X1(n,o)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Bie{constructor(t,n,r){this.opts={style:"long",...r},!n&&nL()&&(this.rtf=Oie(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):foe(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const K$={firstDay:1,minimalDays:4,weekend:[6,7]};class Et{static fromOpts(t){return Et.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,i,o=!1){const s=t||Zt.defaultLocale,a=s||(o?"en-US":Pie()),l=n||Zt.defaultNumberingSystem,c=r||Zt.defaultOutputCalendar,u=iv(i)||Zt.defaultWeekSettings;return new Et(a,l,c,u,s)}static resetCache(){wc=null,J1.clear(),Q1.clear(),ev.clear(),tv.clear(),nv.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return Et.create(t,n,r,i)}constructor(t,n,r,i,o){const[s,a,l]=Nie(t);this.locale=s,this.numberingSystem=n||a||null,this.outputCalendar=r||l||null,this.weekSettings=i,this.intl=zie(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Hie(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Et.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,iv(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Jd(this,t,aL,()=>{const r=n?{month:t,day:"numeric"}:{month:t},i=n?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=jie(o=>this.extract(o,r,"month"))),this.monthsCache[i][t]})}weekdays(t,n=!1){return Jd(this,t,uL,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=n?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=Fie(o=>this.extract(o,r,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return Jd(this,void 0,()=>dL,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ge.utc(2016,11,13,9),Ge.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Jd(this,t,fL,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[Ge.utc(-40,1,1),Ge.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new Vie(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new Uie(t,this.intl,n)}relFormatter(t={}){return new Bie(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Mie(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Z$(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:rL()?Rie(this.locale):K$}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Yp=null;class tr extends qu{static get utcInstance(){return Yp===null&&(Yp=new tr(0)),Yp}static instance(t){return t===0?tr.utcInstance:new tr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new tr(Xh(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Pc(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Pc(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Pc(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class qie extends qu{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function qo(e,t){if(Ke(e)||e===null)return t;if(e instanceof qu)return e;if(Jie(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Kh.instance:n==="utc"||n==="gmt"?tr.utcInstance:tr.parseSpecifier(n)||Co.create(e)}else return Jo(e)?tr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new qie(e)}const D4={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},A5={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Wie=D4.hanidec.replace(/[\[|\]]/g,"").split("");function Gie(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(D4.hanidec)!==-1)t+=Wie.indexOf(e[n]);else for(const i in A5){const[o,s]=A5[i];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}const rv=new Map;function Zie(){rv.clear()}function oi({numberingSystem:e},t=""){const n=e||"latn";let r=rv.get(n);r===void 0&&(r=new Map,rv.set(n,r));let i=r.get(t);return i===void 0&&(i=new RegExp(`${D4[n]}${t}`),r.set(t,i)),i}let M5=()=>Date.now(),D5="system",O5=null,P5=null,R5=null,N5=60,z5,j5=null;class Zt{static get now(){return M5}static set now(t){M5=t}static set defaultZone(t){D5=t}static get defaultZone(){return qo(D5,Kh.instance)}static get defaultLocale(){return O5}static set defaultLocale(t){O5=t}static get defaultNumberingSystem(){return P5}static set defaultNumberingSystem(t){P5=t}static get defaultOutputCalendar(){return R5}static set defaultOutputCalendar(t){R5=t}static get defaultWeekSettings(){return j5}static set defaultWeekSettings(t){j5=iv(t)}static get twoDigitCutoffYear(){return N5}static set twoDigitCutoffYear(t){N5=t%100}static get throwOnInvalid(){return z5}static set throwOnInvalid(t){z5=t}static resetCaches(){Et.resetCache(),Co.resetCache(),Ge.resetCache(),Zie()}}class fi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Y$=[0,31,59,90,120,151,181,212,243,273,304,334],J$=[0,31,60,91,121,152,182,213,244,274,305,335];function Ur(e,t){return new fi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function O4(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function X$(e,t,n){return n+(Wu(e)?J$:Y$)[t-1]}function Q$(e,t){const n=Wu(e)?J$:Y$,r=n.findIndex(o=>o<t),i=t-n[r];return{month:r+1,day:i}}function P4(e,t){return(e-t+7)%7+1}function j0(e,t=4,n=1){const{year:r,month:i,day:o}=e,s=X$(r,i,o),a=P4(O4(r,i,o),n);let l=Math.floor((s-a+14-t)/7),c;return l<1?(c=r-1,l=du(c,t,n)):l>du(r,t,n)?(c=r+1,l=1):c=r,{weekYear:c,weekNumber:l,weekday:a,...Qh(e)}}function F5(e,t=4,n=1){const{weekYear:r,weekNumber:i,weekday:o}=e,s=P4(O4(r,1,t),n),a=rl(r);let l=i*7+o-s-7+t,c;l<1?(c=r-1,l+=rl(c)):l>a?(c=r+1,l-=rl(r)):c=r;const{month:u,day:d}=Q$(c,l);return{year:c,month:u,day:d,...Qh(e)}}function Jp(e){const{year:t,month:n,day:r}=e,i=X$(t,n,r);return{year:t,ordinal:i,...Qh(e)}}function H5(e){const{year:t,ordinal:n}=e,{month:r,day:i}=Q$(t,n);return{year:t,month:r,day:i,...Qh(e)}}function V5(e,t){if(!Ke(e.localWeekday)||!Ke(e.localWeekNumber)||!Ke(e.localWeekYear)){if(!Ke(e.weekday)||!Ke(e.weekNumber)||!Ke(e.weekYear))throw new Wa("Cannot mix locale-based week fields with ISO-based week fields");return Ke(e.localWeekday)||(e.weekday=e.localWeekday),Ke(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Ke(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Kie(e,t=4,n=1){const r=Yh(e.weekYear),i=Br(e.weekNumber,1,du(e.weekYear,t,n)),o=Br(e.weekday,1,7);return r?i?o?!1:Ur("weekday",e.weekday):Ur("week",e.weekNumber):Ur("weekYear",e.weekYear)}function Yie(e){const t=Yh(e.year),n=Br(e.ordinal,1,rl(e.year));return t?n?!1:Ur("ordinal",e.ordinal):Ur("year",e.year)}function eL(e){const t=Yh(e.year),n=Br(e.month,1,12),r=Br(e.day,1,F0(e.year,e.month));return t?n?r?!1:Ur("day",e.day):Ur("month",e.month):Ur("year",e.year)}function tL(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=Br(t,0,23)||t===24&&n===0&&r===0&&i===0,s=Br(n,0,59),a=Br(r,0,59),l=Br(i,0,999);return o?s?a?l?!1:Ur("millisecond",i):Ur("second",r):Ur("minute",n):Ur("hour",t)}function Ke(e){return typeof e>"u"}function Jo(e){return typeof e=="number"}function Yh(e){return typeof e=="number"&&e%1===0}function Jie(e){return typeof e=="string"}function Xie(e){return Object.prototype.toString.call(e)==="[object Date]"}function nL(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function rL(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Qie(e){return Array.isArray(e)?e:[e]}function U5(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const o=[t(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function eoe(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function wl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function iv(e){if(e==null)return null;if(typeof e!="object")throw new Un("Week settings must be an object");if(!Br(e.firstDay,1,7)||!Br(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!Br(t,1,7)))throw new Un("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Br(e,t,n){return Yh(e)&&e>=t&&e<=n}function toe(e,t){return e-t*Math.floor(e/t)}function ln(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Bo(e){if(!(Ke(e)||e===null||e===""))return parseInt(e,10)}function ws(e){if(!(Ke(e)||e===null||e===""))return parseFloat(e)}function R4(e){if(!(Ke(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function N4(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Wu(e){return e%4===0&&(e%100!==0||e%400===0)}function rl(e){return Wu(e)?366:365}function F0(e,t){const n=toe(t-1,12)+1,r=e+(t-n)/12;return n===2?Wu(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Jh(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function B5(e,t,n){return-P4(O4(e,1,t),n)+t-1}function du(e,t=4,n=1){const r=B5(e,t,n),i=B5(e+1,t,n);return(rl(e)-r+i)/7}function ov(e){return e>99?e:e>Zt.twoDigitCutoffYear?1900+e:2e3+e}function iL(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Xh(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function oL(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new Un(`Invalid unit value ${e}`);return t}function H0(e,t){const n={};for(const r in e)if(wl(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=oL(i)}return n}function Pc(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${ln(n,2)}:${ln(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${ln(n,2)}${ln(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Qh(e){return eoe(e,["hour","minute","second","millisecond"])}const noe=["January","February","March","April","May","June","July","August","September","October","November","December"],sL=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],roe=["J","F","M","A","M","J","J","A","S","O","N","D"];function aL(e){switch(e){case"narrow":return[...roe];case"short":return[...sL];case"long":return[...noe];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const lL=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],cL=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ioe=["M","T","W","T","F","S","S"];function uL(e){switch(e){case"narrow":return[...ioe];case"short":return[...cL];case"long":return[...lL];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const dL=["AM","PM"],ooe=["Before Christ","Anno Domini"],soe=["BC","AD"],aoe=["B","A"];function fL(e){switch(e){case"narrow":return[...aoe];case"short":return[...soe];case"long":return[...ooe];default:return null}}function loe(e){return dL[e.hour<12?0:1]}function coe(e,t){return uL(t)[e.weekday-1]}function uoe(e,t){return aL(t)[e.month-1]}function doe(e,t){return fL(t)[e.year<0?0:1]}function foe(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${i[e][0]}`;case-1:return d?"yesterday":`last ${i[e][0]}`;case 0:return d?"today":`this ${i[e][0]}`}}const s=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,c=i[e],u=r?l?c[1]:c[2]||c[1]:l?i[e][0]:e;return s?`${a} ${u} ago`:`in ${a} ${u}`}function q5(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const hoe={D:z0,DD:$$,DDD:L$,DDDD:A$,t:M$,tt:D$,ttt:O$,tttt:P$,T:R$,TT:N$,TTT:z$,TTTT:j$,f:F$,ff:V$,fff:B$,ffff:W$,F:H$,FF:U$,FFF:q$,FFFF:G$};class Wn{static create(t,n={}){return new Wn(t,n)}static parseFormat(t){let n=null,r="",i=!1;const o=[];for(let s=0;s<t.length;s++){const a=t.charAt(s);a==="'"?(r.length>0&&o.push({literal:i||/^\s+$/.test(r),val:r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:/^\s+$/.test(r),val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i||/^\s+$/.test(r),val:r}),o}static macroTokenToFormatOpts(t){return hoe[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return ln(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(h,m)=>this.loc.extract(t,h,m),s=h=>t.isOffsetFixed&&t.offset===0&&h.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,h.format):"",a=()=>r?loe(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(h,m)=>r?uoe(t,h):o(m?{month:h}:{month:h,day:"numeric"},"month"),c=(h,m)=>r?coe(t,h):o(m?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),u=h=>{const m=Wn.macroTokenToFormatOpts(h);return m?this.formatWithSystemDefault(t,m):h},d=h=>r?doe(t,h):o({era:h},"era"),f=h=>{switch(h){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return u(h)}};return q5(Wn.parseFormat(n),f)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>c=>{const u=r(c);return u?this.num(l.get(u),c.length):c},o=Wn.parseFormat(n),s=o.reduce((l,{literal:c,val:u})=>c?l:l.concat(u),[]),a=t.shiftTo(...s.map(r).filter(l=>l));return q5(o,i(a))}}const hL=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Fl(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function Hl(...e){return t=>e.reduce(([n,r,i],o)=>{const[s,a,l]=o(t,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function Vl(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function mL(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=Bo(t[n+i]);return[r,null,n+i]}}const pL=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,moe=`(?:${pL.source}?(?:\\[(${hL.source})\\])?)?`,z4=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,gL=RegExp(`${z4.source}${moe}`),j4=RegExp(`(?:T${gL.source})?`),poe=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,goe=/(\d{4})-?W(\d\d)(?:-?(\d))?/,voe=/(\d{4})-?(\d{3})/,boe=mL("weekYear","weekNumber","weekDay"),yoe=mL("year","ordinal"),woe=/(\d{4})-(\d\d)-(\d\d)/,vL=RegExp(`${z4.source} ?(?:${pL.source}|(${hL.source}))?`),koe=RegExp(`(?: ${vL.source})?`);function il(e,t,n){const r=e[t];return Ke(r)?n:Bo(r)}function xoe(e,t){return[{year:il(e,t),month:il(e,t+1,1),day:il(e,t+2,1)},null,t+3]}function Ul(e,t){return[{hours:il(e,t,0),minutes:il(e,t+1,0),seconds:il(e,t+2,0),milliseconds:R4(e[t+3])},null,t+4]}function Gu(e,t){const n=!e[t]&&!e[t+1],r=Xh(e[t+1],e[t+2]),i=n?null:tr.instance(r);return[{},i,t+3]}function Zu(e,t){const n=e[t]?Co.create(e[t]):null;return[{},n,t+1]}const Soe=RegExp(`^T?${z4.source}$`),_oe=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Coe(e){const[t,n,r,i,o,s,a,l,c]=e,u=t[0]==="-",d=l&&l[0]==="-",f=(h,m=!1)=>h!==void 0&&(m||h&&u)?-h:h;return[{years:f(ws(n)),months:f(ws(r)),weeks:f(ws(i)),days:f(ws(o)),hours:f(ws(s)),minutes:f(ws(a)),seconds:f(ws(l),l==="-0"),milliseconds:f(R4(c),d)}]}const Ioe={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function F4(e,t,n,r,i,o,s){const a={year:t.length===2?ov(Bo(t)):Bo(t),month:sL.indexOf(n)+1,day:Bo(r),hour:Bo(i),minute:Bo(o)};return s&&(a.second=Bo(s)),e&&(a.weekday=e.length>3?lL.indexOf(e)+1:cL.indexOf(e)+1),a}const Eoe=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Toe(e){const[,t,n,r,i,o,s,a,l,c,u,d]=e,f=F4(t,i,r,n,o,s,a);let h;return l?h=Ioe[l]:c?h=0:h=Xh(u,d),[f,new tr(h)]}function $oe(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Loe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Aoe=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Moe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function W5(e){const[,t,n,r,i,o,s,a]=e;return[F4(t,i,r,n,o,s,a),tr.utcInstance]}function Doe(e){const[,t,n,r,i,o,s,a]=e;return[F4(t,a,n,r,i,o,s),tr.utcInstance]}const Ooe=Fl(poe,j4),Poe=Fl(goe,j4),Roe=Fl(voe,j4),Noe=Fl(gL),bL=Hl(xoe,Ul,Gu,Zu),zoe=Hl(boe,Ul,Gu,Zu),joe=Hl(yoe,Ul,Gu,Zu),Foe=Hl(Ul,Gu,Zu);function Hoe(e){return Vl(e,[Ooe,bL],[Poe,zoe],[Roe,joe],[Noe,Foe])}function Voe(e){return Vl($oe(e),[Eoe,Toe])}function Uoe(e){return Vl(e,[Loe,W5],[Aoe,W5],[Moe,Doe])}function Boe(e){return Vl(e,[_oe,Coe])}const qoe=Hl(Ul);function Woe(e){return Vl(e,[Soe,qoe])}const Goe=Fl(woe,koe),Zoe=Fl(vL),Koe=Hl(Ul,Gu,Zu);function Yoe(e){return Vl(e,[Goe,bL],[Zoe,Koe])}const G5="Invalid Duration",yL={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Joe={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...yL},Or=146097/400,Ea=146097/4800,Xoe={years:{quarters:4,months:12,weeks:Or/7,days:Or,hours:Or*24,minutes:Or*24*60,seconds:Or*24*60*60,milliseconds:Or*24*60*60*1e3},quarters:{months:3,weeks:Or/28,days:Or/4,hours:Or*24/4,minutes:Or*24*60/4,seconds:Or*24*60*60/4,milliseconds:Or*24*60*60*1e3/4},months:{weeks:Ea/7,days:Ea,hours:Ea*24,minutes:Ea*24*60,seconds:Ea*24*60*60,milliseconds:Ea*24*60*60*1e3},...yL},Ds=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Qoe=Ds.slice(0).reverse();function jo(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new gt(r)}function wL(e,t){let n=t.milliseconds??0;for(const r of Qoe.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Z5(e,t){const n=wL(e,t)<0?-1:1;Ds.reduceRight((r,i)=>{if(Ke(t[i]))return r;if(r){const o=t[r]*n,s=e[i][r],a=Math.floor(o/s);t[i]+=a*n,t[r]-=a*s*n}return i},null),Ds.reduce((r,i)=>{if(Ke(t[i]))return r;if(r){const o=t[r]%1;t[r]-=o,t[i]+=o*e[r][i]}return i},null)}function ese(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class gt{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?Xoe:Joe;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||Et.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return gt.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Un(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new gt({values:H0(t,gt.normalizeUnit),loc:Et.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Jo(t))return gt.fromMillis(t);if(gt.isDuration(t))return t;if(typeof t=="object")return gt.fromObject(t);throw new Un(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=Boe(t);return r?gt.fromObject(r,n):gt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Woe(t);return r?gt.fromObject(r,n):gt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Un("need to specify a reason the Duration is invalid");const r=t instanceof fi?t:new fi(t,n);if(Zt.throwOnInvalid)throw new Cie(r);return new gt({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new T$(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Wn.create(this.loc,r).formatDurationFromString(this,t):G5}toHuman(t={}){if(!this.isValid)return G5;const n=Ds.map(r=>{const i=this.values[r];return Ke(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=N4(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Ge.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?wL(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=gt.fromDurationLike(t),r={};for(const i of Ds)(wl(n.values,i)||wl(this.values,i))&&(r[i]=n.get(i)+this.get(i));return jo(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=gt.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=oL(t(this.values[r],r));return jo(this,{values:n},!0)}get(t){return this[gt.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...H0(t,gt.normalizeUnit)};return jo(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){const s={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:i,conversionAccuracy:r};return jo(this,s)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Z5(this.matrix,t),jo(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=ese(this.normalize().shiftToAll().toObject());return jo(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>gt.normalizeUnit(s));const n={},r={},i=this.toObject();let o;for(const s of Ds)if(t.indexOf(s)>=0){o=s;let a=0;for(const c in r)a+=this.matrix[c][s]*r[c],r[c]=0;Jo(i[s])&&(a+=i[s]);const l=Math.trunc(a);n[s]=l,r[s]=(a*1e3-l*1e3)/1e3}else Jo(i[s])&&(r[s]=i[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return Z5(this.matrix,n),jo(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return jo(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of Ds)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Ta="Invalid Interval";function tse(e,t){return!e||!e.isValid?Gt.invalid("missing or invalid start"):!t||!t.isValid?Gt.invalid("missing or invalid end"):t<e?Gt.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Gt{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Un("need to specify a reason the Interval is invalid");const r=t instanceof fi?t:new fi(t,n);if(Zt.throwOnInvalid)throw new _ie(r);return new Gt({invalid:r})}static fromDateTimes(t,n){const r=sc(t),i=sc(n),o=tse(r,i);return o??new Gt({start:r,end:i})}static after(t,n){const r=gt.fromDurationLike(n),i=sc(t);return Gt.fromDateTimes(i,i.plus(r))}static before(t,n){const r=gt.fromDurationLike(n),i=sc(t);return Gt.fromDateTimes(i.minus(r),i)}static fromISO(t,n){const[r,i]=(t||"").split("/",2);if(r&&i){let o,s;try{o=Ge.fromISO(r,n),s=o.isValid}catch{s=!1}let a,l;try{a=Ge.fromISO(i,n),l=a.isValid}catch{l=!1}if(s&&l)return Gt.fromDateTimes(o,a);if(s){const c=gt.fromISO(i,n);if(c.isValid)return Gt.after(o,c)}else if(l){const c=gt.fromISO(r,n);if(c.isValid)return Gt.before(a,c)}}return Gt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let i;return n?.useLocaleWeeks?i=this.end.reconfigure({locale:r.locale}):i=this.end,i=i.startOf(t,n),Math.floor(i.diff(r,t).get(t))+(i.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Gt.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(sc).filter(s=>this.contains(s)).sort((s,a)=>s.toMillis()-a.toMillis()),r=[];let{s:i}=this,o=0;for(;i<this.e;){const s=n[o]||this.e,a=+s>+this.e?this.e:s;r.push(Gt.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(t){const n=gt.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const s=[];for(;r<this.e;){const a=this.start.plus(n.mapUnits(l=>l*i));o=+a>+this.e?this.e:a,s.push(Gt.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:Gt.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return Gt.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],o=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((l,c)=>l.time-c.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(Gt.fromDateTimes(n,l.time)),n=null);return Gt.merge(i)}difference(...t){return Gt.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ta}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=z0,n={}){return this.isValid?Wn.create(this.s.loc.clone(n),t).formatInterval(this):Ta}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Ta}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ta}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Ta}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Ta}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):gt.invalid(this.invalidReason)}mapEndpoints(t){return Gt.fromDateTimes(t(this.s),t(this.e))}}class Xd{static hasDST(t=Zt.defaultZone){const n=Ge.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Co.isValidZone(t)}static normalizeZone(t){return qo(t,Zt.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||Et.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||Et.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||Et.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Et.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Et.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Et.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Et.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Et.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Et.create(n,null,"gregory").eras(t)}static features(){return{relative:nL(),localeWeek:rL()}}}function K5(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(gt.fromMillis(r).as("days"))}function nse(e,t,n){const r=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const u=K5(l,c);return(u-u%7)/7}],["days",K5]],i={},o=e;let s,a;for(const[l,c]of r)n.indexOf(l)>=0&&(s=l,i[l]=c(e,t),a=o.plus(i),a>t?(i[l]--,e=o.plus(i),e>t&&(a=e,i[l]--,e=o.plus(i))):e=a);return[e,i,a,s]}function rse(e,t,n,r){let[i,o,s,a]=nse(e,t,n);const l=t-i,c=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);c.length===0&&(s<t&&(s=i.plus({[a]:1})),s!==i&&(o[a]=(o[a]||0)+l/(s-i)));const u=gt.fromObject(o,r);return c.length>0?gt.fromMillis(l,r).shiftTo(...c).plus(u):u}const ise="missing Intl.DateTimeFormat.formatToParts support";function _t(e,t=n=>n){return{regex:e,deser:([n])=>t(Gie(n))}}const ose=" ",kL=`[ ${ose}]`,xL=new RegExp(kL,"g");function sse(e){return e.replace(/\./g,"\\.?").replace(xL,kL)}function Y5(e){return e.replace(/\./g,"").replace(xL," ").toLowerCase()}function si(e,t){return e===null?null:{regex:RegExp(e.map(sse).join("|")),deser:([n])=>e.findIndex(r=>Y5(n)===Y5(r))+t}}function J5(e,t){return{regex:e,deser:([,n,r])=>Xh(n,r),groups:t}}function Qd(e){return{regex:e,deser:([t])=>t}}function ase(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function lse(e,t){const n=oi(t),r=oi(t,"{2}"),i=oi(t,"{3}"),o=oi(t,"{4}"),s=oi(t,"{6}"),a=oi(t,"{1,2}"),l=oi(t,"{1,3}"),c=oi(t,"{1,6}"),u=oi(t,"{1,9}"),d=oi(t,"{2,4}"),f=oi(t,"{4,6}"),h=g=>({regex:RegExp(ase(g.val)),deser:([b])=>b,literal:!0}),p=(g=>{if(e.literal)return h(g);switch(g.val){case"G":return si(t.eras("short"),0);case"GG":return si(t.eras("long"),0);case"y":return _t(c);case"yy":return _t(d,ov);case"yyyy":return _t(o);case"yyyyy":return _t(f);case"yyyyyy":return _t(s);case"M":return _t(a);case"MM":return _t(r);case"MMM":return si(t.months("short",!0),1);case"MMMM":return si(t.months("long",!0),1);case"L":return _t(a);case"LL":return _t(r);case"LLL":return si(t.months("short",!1),1);case"LLLL":return si(t.months("long",!1),1);case"d":return _t(a);case"dd":return _t(r);case"o":return _t(l);case"ooo":return _t(i);case"HH":return _t(r);case"H":return _t(a);case"hh":return _t(r);case"h":return _t(a);case"mm":return _t(r);case"m":return _t(a);case"q":return _t(a);case"qq":return _t(r);case"s":return _t(a);case"ss":return _t(r);case"S":return _t(l);case"SSS":return _t(i);case"u":return Qd(u);case"uu":return Qd(a);case"uuu":return _t(n);case"a":return si(t.meridiems(),0);case"kkkk":return _t(o);case"kk":return _t(d,ov);case"W":return _t(a);case"WW":return _t(r);case"E":case"c":return _t(n);case"EEE":return si(t.weekdays("short",!1),1);case"EEEE":return si(t.weekdays("long",!1),1);case"ccc":return si(t.weekdays("short",!0),1);case"cccc":return si(t.weekdays("long",!0),1);case"Z":case"ZZ":return J5(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return J5(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Qd(/[a-z_+-/]{1,256}?/i);case" ":return Qd(/[^\S\n\r]/);default:return h(g)}})(e)||{invalidReason:ise};return p.token=e,p}const cse={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function use(e,t,n){const{type:r,value:i}=e;if(r==="literal"){const l=/^\s+$/.test(i);return{literal:!l,val:l?" ":i}}const o=t[r];let s=r;r==="hour"&&(t.hour12!=null?s=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?s="hour12":s="hour24":s=n.hour12?"hour12":"hour24");let a=cse[s];if(typeof a=="object"&&(a=a[o]),a)return{literal:!1,val:a}}function dse(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function fse(e,t,n){const r=e.match(t);if(r){const i={};let o=1;for(const s in n)if(wl(n,s)){const a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}else return[r,{}]}function hse(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Ke(e.z)||(n=Co.create(e.z)),Ke(e.Z)||(n||(n=new tr(e.Z)),r=e.Z),Ke(e.q)||(e.M=(e.q-1)*3+1),Ke(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Ke(e.u)||(e.S=R4(e.u)),[Object.keys(e).reduce((o,s)=>{const a=t(s);return a&&(o[a]=e[s]),o},{}),n,r]}let Xp=null;function mse(){return Xp||(Xp=Ge.fromMillis(1555555555555)),Xp}function pse(e,t){if(e.literal)return e;const n=Wn.macroTokenToFormatOpts(e.val),r=IL(n,t);return r==null||r.includes(void 0)?e:r}function SL(e,t){return Array.prototype.concat(...e.map(n=>pse(n,t)))}class _L{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=SL(Wn.parseFormat(n),t),this.units=this.tokens.map(r=>lse(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,i]=dse(this.units);this.regex=RegExp(r,"i"),this.handlers=i}}explainFromTokens(t){if(this.isValid){const[n,r]=fse(t,this.regex,this.handlers),[i,o,s]=r?hse(r):[null,null,void 0];if(wl(r,"a")&&wl(r,"H"))throw new Wa("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:i,zone:o,specificOffset:s}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function CL(e,t,n){return new _L(e,n).explainFromTokens(t)}function gse(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=CL(e,t,n);return[r,i,o,s]}function IL(e,t){if(!e)return null;const r=Wn.create(t,e).dtFormatter(mse()),i=r.formatToParts(),o=r.resolvedOptions();return i.map(s=>use(s,e,o))}const Qp="Invalid DateTime",X5=864e13;function kc(e){return new fi("unsupported zone",`the zone "${e.name}" is not supported`)}function eg(e){return e.weekData===null&&(e.weekData=j0(e.c)),e.weekData}function tg(e){return e.localWeekData===null&&(e.localWeekData=j0(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function ks(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Ge({...n,...t,old:n})}function EL(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function ef(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Lf(e,t,n){return EL(Jh(e),t,n)}function Q5(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:i,day:Math.min(e.c.day,F0(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=gt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=Jh(o);let[l,c]=EL(a,n,e.zone);return s!==0&&(l+=s,c=e.zone.offset(l)),{ts:l,o:c}}function $a(e,t,n,r,i,o){const{setZone:s,zone:a}=n;if(e&&Object.keys(e).length!==0||t){const l=t||a,c=Ge.fromObject(e,{...n,zone:l,specificOffset:o});return s?c:c.setZone(a)}else return Ge.invalid(new fi("unparsable",`the input "${i}" can't be parsed as ${r}`))}function tf(e,t,n=!0){return e.isValid?Wn.create(Et.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ng(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=ln(e.c.year,n?6:4),t?(r+="-",r+=ln(e.c.month),r+="-",r+=ln(e.c.day)):(r+=ln(e.c.month),r+=ln(e.c.day)),r}function e7(e,t,n,r,i,o){let s=ln(e.c.hour);return t?(s+=":",s+=ln(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(s+=":")):s+=ln(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(s+=ln(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=ln(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=ln(Math.trunc(-e.o/60)),s+=":",s+=ln(Math.trunc(-e.o%60))):(s+="+",s+=ln(Math.trunc(e.o/60)),s+=":",s+=ln(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const TL={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},vse={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},bse={ordinal:1,hour:0,minute:0,second:0,millisecond:0},$L=["year","month","day","hour","minute","second","millisecond"],yse=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],wse=["year","ordinal","hour","minute","second","millisecond"];function kse(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new T$(e);return t}function t7(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return kse(e)}}function xse(e){if(xc===void 0&&(xc=Zt.now()),e.type!=="iana")return e.offset(xc);const t=e.name;let n=sv.get(t);return n===void 0&&(n=e.offset(xc),sv.set(t,n)),n}function n7(e,t){const n=qo(t.zone,Zt.defaultZone);if(!n.isValid)return Ge.invalid(kc(n));const r=Et.fromObject(t);let i,o;if(Ke(e.year))i=Zt.now();else{for(const l of $L)Ke(e[l])&&(e[l]=TL[l]);const s=eL(e)||tL(e);if(s)return Ge.invalid(s);const a=xse(n);[i,o]=Lf(e,a,n)}return new Ge({ts:i,zone:n,loc:r,o})}function r7(e,t,n){const r=Ke(n.round)?!0:n.round,i=(s,a)=>(s=N4(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,a)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const a=o(s);if(Math.abs(a)>=1)return i(a,s)}return i(e>t?-0:0,n.units[n.units.length-1])}function i7(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let xc;const sv=new Map;class Ge{constructor(t){const n=t.zone||Zt.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new fi("invalid input"):null)||(n.isValid?null:kc(n));this.ts=Ke(t.ts)?Zt.now():t.ts;let i=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,o]=[t.old.c,t.old.o];else{const a=Jo(t.o)&&!t.old?t.o:n.offset(this.ts);i=ef(this.ts,a),r=Number.isNaN(i.year)?new fi("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=t.loc||Et.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new Ge({})}static local(){const[t,n]=i7(arguments),[r,i,o,s,a,l,c]=n;return n7({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)}static utc(){const[t,n]=i7(arguments),[r,i,o,s,a,l,c]=n;return t.zone=tr.utcInstance,n7({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,n={}){const r=Xie(t)?t.valueOf():NaN;if(Number.isNaN(r))return Ge.invalid("invalid input");const i=qo(n.zone,Zt.defaultZone);return i.isValid?new Ge({ts:r,zone:i,loc:Et.fromObject(n)}):Ge.invalid(kc(i))}static fromMillis(t,n={}){if(Jo(t))return t<-X5||t>X5?Ge.invalid("Timestamp out of range"):new Ge({ts:t,zone:qo(n.zone,Zt.defaultZone),loc:Et.fromObject(n)});throw new Un(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Jo(t))return new Ge({ts:t*1e3,zone:qo(n.zone,Zt.defaultZone),loc:Et.fromObject(n)});throw new Un("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=qo(n.zone,Zt.defaultZone);if(!r.isValid)return Ge.invalid(kc(r));const i=Et.fromObject(n),o=H0(t,t7),{minDaysInFirstWeek:s,startOfWeek:a}=V5(o,i),l=Zt.now(),c=Ke(n.specificOffset)?r.offset(l):n.specificOffset,u=!Ke(o.ordinal),d=!Ke(o.year),f=!Ke(o.month)||!Ke(o.day),h=d||f,m=o.weekYear||o.weekNumber;if((h||u)&&m)throw new Wa("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&u)throw new Wa("Can't mix ordinal dates with month/day");const p=m||o.weekday&&!h;let g,b,v=ef(l,c);p?(g=yse,b=vse,v=j0(v,s,a)):u?(g=wse,b=bse,v=Jp(v)):(g=$L,b=TL);let y=!1;for(const $ of g){const H=o[$];Ke(H)?y?o[$]=b[$]:o[$]=v[$]:y=!0}const _=p?Kie(o,s,a):u?Yie(o):eL(o),k=_||tL(o);if(k)return Ge.invalid(k);const x=p?F5(o,s,a):u?H5(o):o,[I,A]=Lf(x,c,r),L=new Ge({ts:I,zone:r,o:A,loc:i});return o.weekday&&h&&t.weekday!==L.weekday?Ge.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${L.toISO()}`):L.isValid?L:Ge.invalid(L.invalid)}static fromISO(t,n={}){const[r,i]=Hoe(t);return $a(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=Voe(t);return $a(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=Uoe(t);return $a(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(Ke(t)||Ke(n))throw new Un("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,s=Et.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,l,c,u]=gse(s,t,n);return u?Ge.invalid(u):$a(a,l,r,`format ${n}`,t,c)}static fromString(t,n,r={}){return Ge.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=Yoe(t);return $a(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Un("need to specify a reason the DateTime is invalid");const r=t instanceof fi?t:new fi(t,n);if(Zt.throwOnInvalid)throw new Sie(r);return new Ge({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=IL(t,Et.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(t,n={}){return SL(Wn.parseFormat(t),Et.fromObject(n)).map(i=>i.val).join("")}static resetCache(){xc=void 0,sv.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?eg(this).weekYear:NaN}get weekNumber(){return this.isValid?eg(this).weekNumber:NaN}get weekday(){return this.isValid?eg(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?tg(this).weekday:NaN}get localWeekNumber(){return this.isValid?tg(this).weekNumber:NaN}get localWeekYear(){return this.isValid?tg(this).weekYear:NaN}get ordinal(){return this.isValid?Jp(this.c).ordinal:NaN}get monthShort(){return this.isValid?Xd.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Xd.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Xd.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Xd.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=Jh(this.c),i=this.zone.offset(r-t),o=this.zone.offset(r+t),s=this.zone.offset(r-i*n),a=this.zone.offset(r-o*n);if(s===a)return[this];const l=r-s*n,c=r-a*n,u=ef(l,s),d=ef(c,a);return u.hour===d.hour&&u.minute===d.minute&&u.second===d.second&&u.millisecond===d.millisecond?[ks(this,{ts:l}),ks(this,{ts:c})]:[this]}get isInLeapYear(){return Wu(this.year)}get daysInMonth(){return F0(this.year,this.month)}get daysInYear(){return this.isValid?rl(this.year):NaN}get weeksInWeekYear(){return this.isValid?du(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?du(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=Wn.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(tr.instance(t),n)}toLocal(){return this.setZone(Zt.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=qo(t,Zt.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[i]=Lf(s,o,t)}return ks(this,{ts:i,zone:t})}else return Ge.invalid(kc(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return ks(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=H0(t,t7),{minDaysInFirstWeek:r,startOfWeek:i}=V5(n,this.loc),o=!Ke(n.weekYear)||!Ke(n.weekNumber)||!Ke(n.weekday),s=!Ke(n.ordinal),a=!Ke(n.year),l=!Ke(n.month)||!Ke(n.day),c=a||l,u=n.weekYear||n.weekNumber;if((c||s)&&u)throw new Wa("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new Wa("Can't mix ordinal dates with month/day");let d;o?d=F5({...j0(this.c,r,i),...n},r,i):Ke(n.ordinal)?(d={...this.toObject(),...n},Ke(n.day)&&(d.day=Math.min(F0(d.year,d.month),d.day))):d=H5({...Jp(this.c),...n});const[f,h]=Lf(d,this.o,this.zone);return ks(this,{ts:f,o:h})}plus(t){if(!this.isValid)return this;const n=gt.fromDurationLike(t);return ks(this,Q5(this,n))}minus(t){if(!this.isValid)return this;const n=gt.fromDurationLike(t).negate();return ks(this,Q5(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},i=gt.normalizeUnit(t);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(i==="weeks")if(n){const o=this.loc.getStartOfWeek(),{weekday:s}=this;s<o&&(r.weekNumber=this.weekNumber-1),r.weekday=o}else r.weekday=1;if(i==="quarters"){const o=Math.ceil(this.month/3);r.month=(o-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?Wn.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Qp}toLocaleString(t=z0,n={}){return this.isValid?Wn.create(this.loc.clone(n),t).formatDateTime(this):Qp}toLocaleParts(t={}){return this.isValid?Wn.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let a=ng(this,s);return a+="T",a+=e7(this,s,n,r,i,o),a}toISODate({format:t="extended"}={}){return this.isValid?ng(this,t==="extended"):null}toISOWeekDate(){return tf(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(i?"T":"")+e7(this,s==="extended",n,t,r,o):null}toRFC2822(){return tf(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return tf(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ng(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),tf(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Qp}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return gt.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=Qie(n).map(gt.normalizeUnit),s=t.valueOf()>this.valueOf(),a=s?this:t,l=s?t:this,c=rse(a,l,o,i);return s?c.negate():c}diffNow(t="milliseconds",n={}){return this.diff(Ge.now(),t,n)}until(t){return this.isValid?Gt.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const i=t.valueOf(),o=this.setZone(t.zone,{keepLocalTime:!0});return o.startOf(n,r)<=i&&i<=o.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||Ge.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(i=t.unit,o=void 0),r7(n,this.plus(r),{...t,numeric:"always",units:i,unit:o})}toRelativeCalendar(t={}){return this.isValid?r7(t.base||Ge.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Ge.isDateTime))throw new Un("min requires all arguments be DateTimes");return U5(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(Ge.isDateTime))throw new Un("max requires all arguments be DateTimes");return U5(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,s=Et.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return CL(s,t,n)}static fromStringExplain(t,n,r={}){return Ge.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:i=null}=n,o=Et.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return new _L(o,t)}static fromFormatParser(t,n,r={}){if(Ke(t)||Ke(n))throw new Un("fromFormatParser requires an input string and a format parser");const{locale:i=null,numberingSystem:o=null}=r,s=Et.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});if(!s.equals(n.locale))throw new Un(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${n.locale}`);const{result:a,zone:l,specificOffset:c,invalidReason:u}=n.explainFromTokens(t);return u?Ge.invalid(u):$a(a,l,r,`format ${n.format}`,t,c)}static get DATE_SHORT(){return z0}static get DATE_MED(){return $$}static get DATE_MED_WITH_WEEKDAY(){return Iie}static get DATE_FULL(){return L$}static get DATE_HUGE(){return A$}static get TIME_SIMPLE(){return M$}static get TIME_WITH_SECONDS(){return D$}static get TIME_WITH_SHORT_OFFSET(){return O$}static get TIME_WITH_LONG_OFFSET(){return P$}static get TIME_24_SIMPLE(){return R$}static get TIME_24_WITH_SECONDS(){return N$}static get TIME_24_WITH_SHORT_OFFSET(){return z$}static get TIME_24_WITH_LONG_OFFSET(){return j$}static get DATETIME_SHORT(){return F$}static get DATETIME_SHORT_WITH_SECONDS(){return H$}static get DATETIME_MED(){return V$}static get DATETIME_MED_WITH_SECONDS(){return U$}static get DATETIME_MED_WITH_WEEKDAY(){return Eie}static get DATETIME_FULL(){return B$}static get DATETIME_FULL_WITH_SECONDS(){return q$}static get DATETIME_HUGE(){return W$}static get DATETIME_HUGE_WITH_SECONDS(){return G$}}function sc(e){if(Ge.isDateTime(e))return e;if(e&&e.valueOf&&Jo(e.valueOf()))return Ge.fromJSDate(e);if(e&&typeof e=="object")return Ge.fromObject(e);throw new Un(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function LL(e,t,n){let r=i=>e(i,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function Ku(e,t,n){let r=e.length-t.length;if(r===0)return e(...t);if(r===1)return LL(e,t,n);throw new Error("Wrong number of arguments")}var H4={done:!1,hasNext:!1},Sse=e=>({hasNext:!0,next:e,done:!1});function V0(e,...t){let n=e,r=t.map(o=>"lazy"in o?_se(o):void 0),i=0;for(;i<t.length;){if(r[i]===void 0||!Cse(n)){let l=t[i];n=l(n),i+=1;continue}let o=[];for(let l=i;l<t.length;l++){let c=r[l];if(c===void 0||(o.push(c),c.isSingle))break}let s=[];for(let l of n)if(AL(l,s,o))break;let{isSingle:a}=o.at(-1);n=a?s[0]:s,i+=o.length}return n}function AL(e,t,n){if(n.length===0)return t.push(e),!1;let r=e,i=H4,o=!1;for(let[s,a]of n.entries()){let{index:l,items:c}=a;if(c.push(r),i=a(r,l,c),a.index+=1,i.hasNext){if(i.hasMany??!1){for(let u of i.next)if(AL(u,t,n.slice(s+1)))return!0;return o}r=i.next}if(!i.hasNext)break;i.done&&(o=!0)}return i.hasNext&&t.push(r),o}function _se(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function Cse(e){return typeof e=="string"||typeof e=="object"&&e!==null&&Symbol.iterator in e}function Ise(e,t){let n=t.length-e.length;if(n===1){let[r,...i]=t;return V0(r,{lazy:e,lazyArgs:i})}if(n===0){let r={lazy:e,lazyArgs:t};return Object.assign(i=>V0(i,r),r)}throw new Error("Wrong number of arguments")}function Ese(...e){return Ise(Tse,e)}function Tse(e){let t=e,n=new Set;return(r,i,o)=>{let s=t(r,i,o);return n.has(s)?H4:(n.add(s),{done:!1,hasNext:!0,next:r})}}function o7(...e){return Ku(Object.values,e)}function $se(...e){return Ku(Lse,e)}var Lse=(e,t)=>e.length>=t,ML={asc:(e,t)=>e>t,desc:(e,t)=>e<t};function Ase(e,t){let[n,...r]=t;if(!Mse(n)){let o=av(...r);return e(n,o)}let i=av(n,...r);return o=>e(o,i)}function av(e,t,...n){let r=typeof e=="function"?e:e[0],i=typeof e=="function"?"asc":e[1],{[i]:o}=ML,s=t===void 0?void 0:av(t,...n);return(a,l)=>{let c=r(a),u=r(l);return o(c,u)?1:o(u,c)?-1:s?.(a,l)??0}}function Mse(e){if(s7(e))return!0;if(typeof e!="object"||!Array.isArray(e))return!1;let[t,n,...r]=e;return s7(t)&&typeof n=="string"&&n in ML&&r.length===0}var s7=e=>typeof e=="function"&&e.length===1;function Dse(...e){return Ku(Ose,e)}function Ose(e,t){let n={};for(let[r,i]of Object.entries(e)){let o=t(i,r,e);n[r]=o}return n}function a7(...e){return Ku(Pse,e)}var Pse=(e,t)=>{let n=Object.create(null);for(let r=0;r<e.length;r++){let i=e[r],o=t(i,r,e);if(o!==void 0){let s=n[o];s===void 0?n[o]=[i]:s.push(i)}}return Object.setPrototypeOf(n,Object.prototype),n};function Rse(...e){return Ase(Nse,e)}function Nse(e,t){if(!$se(e,2))return e[0];let[n]=e,[,...r]=e;for(let i of r)t(i,n)<0&&(n=i);return n}function zse(e,t){return typeof e=="object"?l7(e,t):LL(l7,[],jse)}var l7=(e,t)=>t===void 0?e.flat():e.flat(t),jse=e=>e===void 0||e===1?Fse:e<=0?Sse:t=>Array.isArray(t)?{next:t.flat(e-1),hasNext:!0,hasMany:!0,done:!1}:{next:t,hasNext:!0,done:!1},Fse=e=>Array.isArray(e)?{next:e,hasNext:!0,hasMany:!0,done:!1}:{next:e,hasNext:!0,done:!1};function Hse(...e){return Ku(Vse,e,Use)}var Vse=(e,t)=>e.filter(t),Use=e=>(t,n,r)=>e(t,n,r)?{done:!1,hasNext:!0,next:t}:H4;const Bse=["duckmind","duckmind-go","anthropic","github-copilot","openai","google","openrouter","vercel"],qse=new Set(Bse);function V4(){const e=Qr(),t=pr(),n=q(()=>bo(t.dir)??""),r=()=>{if(n()){const[i]=e.child(n());if(i.provider_ready)return i.provider}return e.data.provider};return{all:()=>r().all,default:()=>r().default,popular:()=>r().all.filter(i=>qse.has(i.id)),connected:()=>{const i=new Set(r().connected);return r().all.filter(o=>i.has(o.id))},paid:()=>{const i=new Set(r().connected);return r().all.filter(o=>i.has(o.id)&&(o.id!=="duckmind"||Object.values(o.models).some(s=>s.cost?.input)))}}}const Wse=5;function nf(e){return`${e.providerID}:${e.modelID}`}const{use:Gse,provider:Zse}=Xt({name:"Models",init:()=>{const e=V4(),[t,n,r,i]=Sn(Jt.global("model",["model.v1"]),qe({user:[],recent:[],variant:{}})),o=q(()=>e.connected().flatMap(y=>Object.values(y.models).map(_=>({..._,provider:y})))),s=q(()=>new Map(o().map(y=>{const _=Ge.fromISO(y.release_date);return[nf({providerID:y.provider.id,modelID:y.id}),_]}))),a=q(()=>V0(o(),Hse(y=>Math.abs((s().get(nf({providerID:y.provider.id,modelID:y.id}))??Ge.invalid("invalid")).diffNow().as("months"))<6),a7(y=>y.provider.id),Dse(y=>V0(y,a7(_=>_.family),o7(),_=>_.flatMap(k=>{const x=Rse(k,[I=>I.release_date,"desc"]);return x?[{modelID:x.id,providerID:x.provider.id}]:[]}))),o7(),zse())),l=q(()=>new Set(a().map(y=>nf(y)))),c=q(()=>{const y=new Map;for(const _ of t.user)y.set(`${_.providerID}:${_.modelID}`,_.visibility);return y}),u=q(()=>o().map(y=>({...y,name:y.name.replace("(latest)","").trim(),latest:y.name.includes("(latest)")}))),d=y=>u().find(_=>_.id===y.modelID&&_.provider.id===y.providerID);function f(y,_){const k=t.user.findIndex(x=>x.modelID===y.modelID&&x.providerID===y.providerID);if(k>=0){n("user",k,x=>({...x,visibility:_}));return}n("user",t.user.length,{...y,visibility:_})}const h=y=>{const _=nf(y),k=c().get(_);return k==="hide"?!1:!!(k==="show"||l().has(_)||!s().get(_)?.isValid)},m=(y,_)=>{f(y,_?"show":"hide")},p=y=>{const _=Ese([y,...t.recent],k=>`${k.providerID}:${k.modelID}`);_.length>Wse&&_.pop(),n("recent",_)},g=y=>`${y.providerID}/${y.modelID}`,b=y=>t.variant?.[g(y)],v=(y,_)=>{const k=g(y);if(!t.variant){n("variant",{[k]:_});return}n("variant",k,_)};return{ready:i,list:u,find:d,visible:h,setVisibility:m,recent:{list:q(()=>t.recent),push:p},variant:{get:b,set:v}}}});let rf,of;function Kse(){return rf||(rf=Object.assign({"../../../ui/src/assets/audio/alert-01.aac":()=>O(()=>import("./alert-01-BJxg7Br3.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-02.aac":()=>O(()=>import("./alert-02-B_yYorxz.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-03.aac":()=>O(()=>import("./alert-03-DrFH92rH.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-04.aac":()=>O(()=>import("./alert-04-BvTiGxWY.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-05.aac":()=>O(()=>import("./alert-05-CFi_H2fs.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-06.aac":()=>O(()=>import("./alert-06-IqbtOTTn.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-07.aac":()=>O(()=>import("./alert-07-B2AcuX88.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-08.aac":()=>O(()=>import("./alert-08-pIF0yjmQ.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-09.aac":()=>O(()=>import("./alert-09-CidmJWaA.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-10.aac":()=>O(()=>import("./alert-10-84PPn2Zu.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-01.aac":()=>O(()=>import("./bip-bop-01-SdbMMaiV.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-02.aac":()=>O(()=>import("./bip-bop-02-CujvGF7f.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-03.aac":()=>O(()=>import("./bip-bop-03-BPb7xYJT.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-04.aac":()=>O(()=>import("./bip-bop-04-dSUw_8vI.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-05.aac":()=>O(()=>import("./bip-bop-05-BNanGIjD.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-06.aac":()=>O(()=>import("./bip-bop-06-DiKbyBF9.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-07.aac":()=>O(()=>import("./bip-bop-07-BoG3Fd8O.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-08.aac":()=>O(()=>import("./bip-bop-08-C6sK41fd.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-09.aac":()=>O(()=>import("./bip-bop-09-AXzGc7YL.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-10.aac":()=>O(()=>import("./bip-bop-10-E37zfY9y.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-01.aac":()=>O(()=>import("./nope-01-HWHtipgi.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-02.aac":()=>O(()=>import("./nope-02-CzaO3Yrz.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-03.aac":()=>O(()=>import("./nope-03-D3_ztwN2.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-04.aac":()=>O(()=>import("./nope-04-CmCNjd7G.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-05.aac":()=>O(()=>import("./nope-05-DY6LpiuN.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-06.aac":()=>O(()=>import("./nope-06-CfV385SL.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-07.aac":()=>O(()=>import("./nope-07-nvIV4VRE.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-08.aac":()=>O(()=>import("./nope-08-HcI83CoX.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-09.aac":()=>O(()=>import("./nope-09-8gNK4nDO.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-10.aac":()=>O(()=>import("./nope-10-C1PuPJJ6.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-11.aac":()=>O(()=>import("./nope-11-BjKpOuL0.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-12.aac":()=>O(()=>import("./nope-12-XTIkittV.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-01.aac":()=>O(()=>import("./staplebops-01-gmydkbKo.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-02.aac":()=>O(()=>import("./staplebops-02-dGmDElbO.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-03.aac":()=>O(()=>import("./staplebops-03-DK1yH6J2.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-04.aac":()=>O(()=>import("./staplebops-04-Bi3-8HzN.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-05.aac":()=>O(()=>import("./staplebops-05-BVmKob0k.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-06.aac":()=>O(()=>import("./staplebops-06-BAYmihXf.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-07.aac":()=>O(()=>import("./staplebops-07-_-IkdLL4.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-01.aac":()=>O(()=>import("./yup-01-Cv8FIGVN.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-02.aac":()=>O(()=>import("./yup-02-BIvWfOQf.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-03.aac":()=>O(()=>import("./yup-03-DlJPYLhC.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-04.aac":()=>O(()=>import("./yup-04-CrvHiQIe.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-05.aac":()=>O(()=>import("./yup-05-CrtAHyVr.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-06.aac":()=>O(()=>import("./yup-06-W4HuBYhb.js"),[]).then(e=>e.default)}),rf)}const She=[{id:"alert-01",label:"sound.option.alert01"},{id:"alert-02",label:"sound.option.alert02"},{id:"alert-03",label:"sound.option.alert03"},{id:"alert-04",label:"sound.option.alert04"},{id:"alert-05",label:"sound.option.alert05"},{id:"alert-06",label:"sound.option.alert06"},{id:"alert-07",label:"sound.option.alert07"},{id:"alert-08",label:"sound.option.alert08"},{id:"alert-09",label:"sound.option.alert09"},{id:"alert-10",label:"sound.option.alert10"},{id:"bip-bop-01",label:"sound.option.bipbop01"},{id:"bip-bop-02",label:"sound.option.bipbop02"},{id:"bip-bop-03",label:"sound.option.bipbop03"},{id:"bip-bop-04",label:"sound.option.bipbop04"},{id:"bip-bop-05",label:"sound.option.bipbop05"},{id:"bip-bop-06",label:"sound.option.bipbop06"},{id:"bip-bop-07",label:"sound.option.bipbop07"},{id:"bip-bop-08",label:"sound.option.bipbop08"},{id:"bip-bop-09",label:"sound.option.bipbop09"},{id:"bip-bop-10",label:"sound.option.bipbop10"},{id:"staplebops-01",label:"sound.option.staplebops01"},{id:"staplebops-02",label:"sound.option.staplebops02"},{id:"staplebops-03",label:"sound.option.staplebops03"},{id:"staplebops-04",label:"sound.option.staplebops04"},{id:"staplebops-05",label:"sound.option.staplebops05"},{id:"staplebops-06",label:"sound.option.staplebops06"},{id:"staplebops-07",label:"sound.option.staplebops07"},{id:"nope-01",label:"sound.option.nope01"},{id:"nope-02",label:"sound.option.nope02"},{id:"nope-03",label:"sound.option.nope03"},{id:"nope-04",label:"sound.option.nope04"},{id:"nope-05",label:"sound.option.nope05"},{id:"nope-06",label:"sound.option.nope06"},{id:"nope-07",label:"sound.option.nope07"},{id:"nope-08",label:"sound.option.nope08"},{id:"nope-09",label:"sound.option.nope09"},{id:"nope-10",label:"sound.option.nope10"},{id:"nope-11",label:"sound.option.nope11"},{id:"nope-12",label:"sound.option.nope12"},{id:"yup-01",label:"sound.option.yup01"},{id:"yup-02",label:"sound.option.yup02"},{id:"yup-03",label:"sound.option.yup03"},{id:"yup-04",label:"sound.option.yup04"},{id:"yup-05",label:"sound.option.yup05"},{id:"yup-06",label:"sound.option.yup06"}];function Yse(){return of||(of=Object.fromEntries(Object.entries(Kse()).flatMap(([e,t])=>{const n=e.split("/").at(-1);return n?[[n.replace(/\.aac$/,""),t]]:[]})),of)}const c7=new Map;function Jse(e){const t=Yse();if(!e||!(e in t))return Promise.resolve(void 0);const n=e,r=c7.get(n);if(r)return r;const i=t[n]().catch(()=>{});return c7.set(n,i),i}function Xse(e){if(typeof Audio>"u"||!e)return;const t=new Audio(e);return t.play().catch(()=>{}),()=>{t.pause(),t.currentTime=0}}function lv(e){return Jse(e).then(t=>Xse(t))}const u7=500,Qse=1e3*60*60*24*30;function d7(e){const t=Date.now()-Qse,n=e.filter(r=>r.time>=t);return n.length<=u7?n:n.slice(n.length-u7)}function eae(){return{session:{all:{},unseen:{},unseenCount:{},unseenHasError:{}},project:{all:{},unseen:{},unseenCount:{},unseenHasError:{}}}}function f7(e){const t=eae();return e.forEach(n=>{if(n.session){const r=t.session.all[n.session]??[];if(t.session.all[n.session]=[...r,n],!n.viewed){const i=t.session.unseen[n.session]??[];t.session.unseen[n.session]=[...i,n],t.session.unseenCount[n.session]=i.length+1,n.type==="error"&&(t.session.unseenHasError[n.session]=!0)}}if(n.directory){const r=t.project.all[n.directory]??[];if(t.project.all[n.directory]=[...r,n],!n.viewed){const i=t.project.unseen[n.directory]??[];t.project.unseen[n.directory]=[...i,n],t.project.unseenCount[n.directory]=i.length+1,n.type==="error"&&(t.project.unseenHasError[n.directory]=!0)}}}),t}const{use:em,provider:tae}=Xt({name:"Notification",init:()=>{const e=pr(),t=Nl(),n=Qr(),r=$o(),i=Au(),o=En(),s=[],a=q(()=>bo(e.dir)),l=q(()=>e.id),[c,u,d,f]=Sn(Jt.global("notification",["notification.v1"]),qe({list:[]})),[h,m]=qe(f7(c.list)),p={pruned:!1,disposed:!1},g=(L,$,H)=>{m(L,"unseen",$,H),m(L,"unseenCount",$,H.length),m(L,"unseenHasError",$,H.some(j=>j.type==="error"))},b=L=>{L.session&&(m("session","all",L.session,($=[])=>[...$,L]),L.viewed||(m("session","unseen",L.session,($=[])=>[...$,L]),m("session","unseenCount",L.session,($=0)=>$+1),L.type==="error"&&m("session","unseenHasError",L.session,!0))),L.directory&&(m("project","all",L.directory,($=[])=>[...$,L]),L.viewed||(m("project","unseen",L.directory,($=[])=>[...$,L]),m("project","unseenCount",L.directory,($=0)=>$+1),L.type==="error"&&m("project","unseenHasError",L.directory,!0)))},v=L=>{if(L.session&&(m("session","all",L.session,($=[])=>$.filter(H=>H!==L)),!L.viewed)){const $=(h.session.unseen[L.session]??s).filter(H=>H!==L);g("session",L.session,$)}if(L.directory&&(m("project","all",L.directory,($=[])=>$.filter(H=>H!==L)),!L.viewed)){const $=(h.project.unseen[L.directory]??s).filter(H=>H!==L);g("project",L.directory,$)}};re(()=>{if(!f()||p.pruned)return;p.pruned=!0;const L=d7(c.list);rt(()=>{u("list",L),m(Ct(f7(L),{merge:!1}))})});const y=L=>{const $=d7([...c.list,L]),H=new Set($),j=c.list.filter(M=>!H.has(M));rt(()=>{H.has(L)&&b(L),j.forEach(M=>v(M)),u("list",$)})},_=async(L,$)=>{if(!$)return;const[H]=n.child(L,{bootstrap:!1}),j=At.search(H.session,$,M=>M.id);return j.found?H.session[j.index]:t.client.session.get({directory:L,sessionID:$}).then(M=>M.data).catch(()=>{})},k=(L,$)=>{const H=a(),j=l();return!H||!j||!$||L!==H?!1:$===j},x=(L,$,H)=>{const j=$.properties.sessionID;_(L,j).then(M=>{if(p.disposed||!M||M.parentID)return;i.sounds.agentEnabled()&&lv(i.sounds.agent()),y({directory:L,time:H,viewed:k(L,j),type:"turn-complete",session:j});const T=`/${mt(L)}/session/${j}`;i.notifications.agent()&&r.notify(o.t("notification.session.responseReady.title"),M.title??j,T)})},I=(L,$,H)=>{const j=$.properties.sessionID;_(L,j).then(M=>{if(p.disposed||M?.parentID)return;i.sounds.errorsEnabled()&&lv(i.sounds.errors());const T="error"in $.properties?$.properties.error:void 0;y({directory:L,time:H,viewed:k(L,j),type:"error",session:j??"global",error:T});const E=M?.title??(typeof T=="string"?T:o.t("notification.session.error.fallbackDescription")),D=j?`/${mt(L)}/session/${j}`:`/${mt(L)}`;i.notifications.errors()&&r.notify(o.t("notification.session.error.title"),E,D)})},A=t.event.listen(L=>{const $=L.details;if($.type!=="session.idle"&&$.type!=="session.error")return;const H=L.name,j=Date.now();if($.type==="session.idle"){x(H,$,j);return}I(H,$,j)});return ae(()=>{p.disposed=!0,A()}),{ready:f,session:{all(L){return h.session.all[L]??s},unseen(L){return h.session.unseen[L]??s},unseenCount(L){return h.session.unseenCount[L]??0},unseenHasError(L){return h.session.unseenHasError[L]??!1},markViewed(L){const $=h.session.unseen[L]??s;if(!$.length)return;const H=[...new Set($.flatMap(j=>j.directory?[j.directory]:[]))];rt(()=>{u("list",j=>j.session===L&&!j.viewed,"viewed",!0),g("session",L,[]),H.forEach(j=>{const M=(h.project.unseen[j]??s).filter(T=>T.session!==L);g("project",j,M)})})}},project:{all(L){return h.project.all[L]??s},unseen(L){return h.project.unseen[L]??s},unseenCount(L){return h.project.unseenCount[L]??0},unseenHasError(L){return h.project.unseenHasError[L]??!1},markViewed(L){const $=h.project.unseen[L]??s;if(!$.length)return;const H=[...new Set($.flatMap(j=>j.session?[j.session]:[]))];rt(()=>{u("list",j=>j.directory===L&&!j.viewed,"viewed",!0),g("project",L,[]),H.forEach(j=>{const M=(h.session.unseen[j]??s).filter(T=>T.directory!==L);g("session",j,M)})})}}}}});function Af(e,t){return t?`${mt(t)}/${e}`:e}function Rc(e){return`${mt(e)}/*`}function nae(e,t,n){const r=Af(t,n),i=n?Rc(n):void 0;return e[r]??e[t]??(i?e[i]:void 0)}function rae(e,t){const n=Rc(t);return e[n]??!1}function iae(e,t){const n=e.reduce((o,s)=>(s.parentID&&o.set(s.id,s.parentID),o),new Map),r=new Set([t]),i=[t];for(const o of i){const s=n.get(o);!s||r.has(s)||(r.add(s),i.push(s))}return i}function h7(e,t,n,r){return iae(t,n.sessionID).map(o=>nae(e,o,r)).find(o=>o!==void 0)??!1}function oae(e){if(!e)return!1;if(typeof e=="string")return e!=="allow";if(typeof e!="object"||Array.isArray(e))return!1;for(const t of Object.values(e))if(t!=="allow")return!0;return!1}function sae(e){return e?typeof e=="string"?e!=="allow":typeof e!="object"||Array.isArray(e)?!1:Object.values(e).some(oae):!1}const{use:U4,provider:aae}=Xt({name:"Permission",init:()=>{const e=pr(),t=Nl(),n=Qr(),r=q(()=>{const A=bo(e.dir);if(!A)return!1;const[L]=n.child(A);return sae(L.config.permission)}),[i,o,s,a]=Sn({...Jt.global("permission",["permission.v3"]),migrate(A){if(!A||typeof A!="object"||Array.isArray(A))return A;const L=A;return L.autoAccept?A:{...L,autoAccept:typeof L.autoAcceptEdits=="object"&&L.autoAcceptEdits&&!Array.isArray(L.autoAcceptEdits)?L.autoAcceptEdits:{}}}},qe({autoAccept:{}}));re(()=>{if(!a())return;const A=bo(e.dir);if(!A)return;const[L]=n.child(A),$=L.config.permission;if(typeof $=="string"&&$==="allow"){const H=Rc(A);i.autoAccept[H]===void 0&&o(He(j=>{j.autoAccept[H]=!0}))}});const l=1e3,c=3600*1e3,u=new Map,d=new Map;function f(A){for(const[L,$]of u){if(A-$<c)break;u.delete(L)}for(const L of u.keys()){if(u.size<=l)break;u.delete(L)}}const h=A=>{t.client.permission.respond(A).catch(()=>{u.delete(A.permissionID)})};function m(A,L){const $=Date.now(),H=u.has(A.id);u.delete(A.id),u.set(A.id,$),f($),!H&&h({sessionID:A.sessionID,permissionID:A.id,response:"once",directory:L})}function p(A,L){const $=L?n.child(L,{bootstrap:!1})[0].session:[];return h7(i.autoAccept,$,{sessionID:A},L)}function g(A){return rae(i.autoAccept,A)}function b(A,L){const $=L?n.child(L,{bootstrap:!1})[0].session:[];return h7(i.autoAccept,$,A,L)}function v(A,L){const $=Af(A,L),H=(d.get($)??0)+1;return d.set($,H),H}const y=t.event.listen(A=>{const L=A.details;if(L?.type!=="permission.asked")return;const $=L.properties;b($,A.name)&&m($,A.name)});ae(y);function _(A){const L=Rc(A);o(He($=>{$.autoAccept[L]=!0})),t.client.permission.list({directory:A}).then($=>{if(g(A))for(const H of $.data??[])H?.id&&b(H,A)&&m(H,A)}).catch(()=>{})}function k(A){const L=Rc(A);o(He($=>{$.autoAccept[L]=!1}))}function x(A,L){const $=Af(A,L),H=v(A,L);o(He(j=>{j.autoAccept[$]=!0,delete j.autoAccept[A]})),t.client.permission.list({directory:L}).then(j=>{if(d.get($)===H&&p(A,L))for(const M of j.data??[])M?.id&&b(M,L)&&m(M,L)}).catch(()=>{})}function I(A,L){v(A,L);const $=L?Af(A,L):A;o(He(H=>{H.autoAccept[$]=!1,L&&delete H.autoAccept[A]}))}return{ready:a,respond:h,autoResponds(A,L){return b(A,L)},isAutoAccepting:p,isAutoAcceptingDirectory:g,toggleAutoAccept(A,L){if(p(A,L)){I(A,L);return}x(A,L)},toggleAutoAcceptDirectory(A){if(g(A)){k(A);return}_(A)},enableAutoAccept(A,L){p(A,L)||x(A,L)},disableAutoAccept(A,L){I(A,L)},permissionsEnabled:r,isPermissionAllowAll(A){const[L]=n.child(A),$=L.config.permission;return typeof $=="string"&&$==="allow"}}}}),cv=[{type:"text",content:"",start:0,end:0}];function lae(e,t){return!e&&!t?!0:!e||!t?!1:e.startLine===t.startLine&&e.startChar===t.startChar&&e.endLine===t.endLine&&e.endChar===t.endChar}function cae(e,t){switch(e.type){case"text":return t.type==="text"&&e.content===t.content;case"file":return t.type==="file"&&e.path===t.path&&lae(e.selection,t.selection);case"agent":return t.type==="agent"&&e.name===t.name;case"image":return t.type==="image"&&e.id===t.id}}function uae(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!cae(e[n],t[n]))return!1;return!0}function dae(e){if(e)return{...e}}function fae(e){return e.type==="text"?{...e}:e.type==="image"?{...e}:e.type==="agent"?{...e}:{...e,selection:dae(e.selection)}}function uv(e){return e.map(fae)}function rg(e){if(e.type!=="file")return e.type;const t=e.selection?.startLine,n=e.selection?.endLine,r=`${e.type}:${e.path}:${t}:${n}`;if(e.commentID)return`${r}:c=${e.commentID}`;const i=e.comment?.trim();if(!i)return r;const o=d0(i)??i;return`${r}:c=${o.slice(0,8)}`}function hae(e){return e.type==="file"&&!!e.comment?.trim()}function mae(e){return{set(t,n){const r=uv(t);rt(()=>{e("prompt",r),n!==void 0&&e("cursor",n)})},reset(){rt(()=>{e("prompt",uv(cv)),e("cursor",0)})}}}const pae="__workspace__",gae=20;function vae(e,t){const n=`${e}/prompt${t?"/"+t:""}.v2`,[r,i,o,s]=Sn(Jt.scoped(e,t,"prompt",[n]),qe({prompt:uv(cv),cursor:void 0,context:{items:[]}})),a=mae(i);return{ready:s,current:q(()=>r.prompt),cursor:q(()=>r.cursor),dirty:q(()=>!uae(r.prompt,cv)),context:{items:q(()=>r.context.items),add(l){const c=rg(l);r.context.items.find(u=>u.key===c)||i("context","items",u=>[...u,{key:c,...l}])},remove(l){i("context","items",c=>c.filter(u=>u.key!==l))},removeComment(l,c){i("context","items",u=>u.filter(d=>!(d.type==="file"&&d.path===l&&d.commentID===c)))},updateComment(l,c,u){i("context","items",d=>d.map(f=>{if(f.type!=="file"||f.path!==l||f.commentID!==c)return f;const h={...f,...u};return{...h,key:rg(h)}}))},replaceComments(l){i("context","items",c=>[...c.filter(u=>!hae(u)),...l.map(u=>({...u,key:rg(u)}))])}},set:a.set,reset:a.reset}}const{use:_he,provider:bae}=Xt({name:"Prompt",gate:!1,init:()=>{const e=pr(),t=new Map;ae(()=>{for(const l of t.values())l.dispose();t.clear()});const r=()=>{for(;t.size>gae;){const l=t.keys().next().value;if(!l)return;t.get(l)?.dispose(),t.delete(l)}},i=bi(),o=(l,c)=>{const u=`${l}:${c??pae}`,d=t.get(u);if(d)return t.delete(u),t.set(u,d),d.value;const f=An(h=>({value:vae(l,c),dispose:h}),i);return t.set(u,f),r(),f.value},s=q(()=>o(e.dir,e.id)),a=l=>l?o(l.dir,l.id):s();return{ready:()=>s().ready(),current:()=>s().current(),cursor:()=>s().cursor(),dirty:()=>s().dirty(),context:{items:()=>s().context.items(),add:l=>s().context.add(l),remove:l=>s().context.remove(l),removeComment:(l,c)=>s().context.removeComment(l,c),updateComment:(l,c,u)=>s().context.updateComment(l,c,u),replaceComments:l=>s().context.replaceComments(l)},set:(l,c,u)=>a(u).set(l,c),reset:l=>a(l).reset()}}}),DL="Terminal {{number}}",yae=[DL,"محطة طرفية {{number}}","Терминал {{number}}","ターミナル {{number}}","터미널 {{number}}","เทอร์มินัล {{number}}","终端 {{number}}","終端機 {{number}}"];function m7(e){return DL.replace("{{number}}",String(e))}function wae(e,t){return yae.some(n=>e===n.replace("{{number}}",String(t)))}function kae(e,t){return Array.from({length:t},(n,r)=>r+1).find(n=>wae(e,n))}const xae="__workspace__",OL=20;function PL(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Mf(e){return typeof e=="string"?e:void 0}function ac(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function RL(e){return kae(e,OL)}function Sae(e){if(!PL(e))return;const t=Mf(e.id);if(!t)return;const n=Mf(e.title)??"",r=ac(e.titleNumber),i=ac(e.rows),o=ac(e.cols),s=Mf(e.buffer),a=ac(e.scrollY),l=ac(e.cursor);return{id:t,title:n,titleNumber:r&&r>0?r:RL(n)??0,...i!==void 0?{rows:i}:{},...o!==void 0?{cols:o}:{},...s!==void 0?{buffer:s}:{},...a!==void 0?{scrollY:a}:{},...l!==void 0?{cursor:l}:{}}}function _ae(e){if(!PL(e))return e;const t=new Set,n=(Array.isArray(e.all)?e.all:[]).flatMap(i=>{const o=Sae(i);return!o||t.has(o.id)?[]:(t.add(o.id),[o])}),r=Mf(e.active);return{active:r&&t.has(r)?r:n[0]?.id,all:n}}function NL(e){return`${e}:${xae}`}function dv(e,t){return t?[`${e}/terminal/${t}.v1`,`${e}/terminal.v1`]:[`${e}/terminal.v1`]}const fv=new Set,ig=e=>!e.buffer&&e.cursor===void 0&&e.scrollY===void 0?e:{...e,buffer:void 0,cursor:void 0,scrollY:void 0};function Cae(e,t,n){const r=NL(e);for(const o of fv)o.get(r)?.value.clear();x0(Jt.workspace(e,"terminal"),n);const i=new Set(dv(e));for(const o of t??[])for(const s of dv(e,o))i.add(s);for(const o of i)x0({key:o},n)}function Iae(e,t,n){const r=dv(t,n),[i,o,s,a]=Sn({...Jt.workspace(t,"terminal",r),migrate:_ae},qe({all:[]})),l=()=>{const h=new Set(i.all.flatMap(m=>{const p=Number.isFinite(m.titleNumber)&&m.titleNumber>0?m.titleNumber:void 0;if(p!==void 0)return[p];const g=RL(m.title);return g===void 0?[]:[g]}));return Array.from({length:h.size+1},(m,p)=>p+1).find(m=>!h.has(m))??1},c=h=>{const m=i.all,p=m.findIndex(b=>b.id===h);if(p===-1)return;const g=i.active===h?p===0?m[1]?.id:m[0]?.id:i.active;rt(()=>{o("active",g),o("all",He(b=>{b.splice(p,1)}))})},u=e.event.on("pty.exited",h=>{c(h.properties.id)});ae(u);const d=(h,m)=>{const p=i.all.findIndex(b=>b.id===m.id),g=p>=0?i.all[p]:void 0;p>=0&&o("all",p,b=>({...b,...m})),h.pty.update({ptyID:m.id,title:m.title,size:m.cols&&m.rows?{rows:m.rows,cols:m.cols}:void 0}).catch(b=>{if(g){const v=i.all.findIndex(y=>y.id===m.id);v>=0&&o("all",v,g)}console.error("Failed to update terminal",b)})},f=async(h,m)=>{const p=i.all.findIndex(y=>y.id===m),g=i.all[p];if(!g)return;const b=await h.pty.create({title:g.title}).catch(y=>{console.error("Failed to clone terminal",y)});if(!b?.data)return;const v=i.active===g.id;rt(()=>{o("all",p,{id:b.data.id,title:b.data.title??g.title,titleNumber:g.titleNumber,buffer:void 0,cursor:void 0,scrollY:void 0,rows:void 0,cols:void 0}),v&&o("active",b.data.id)})};return{ready:a,all:q(()=>i.all),active:q(()=>i.active),clear(){rt(()=>{o("active",void 0),o("all",[])})},new(){const h=l();e.client.pty.create({title:m7(h)}).then(m=>{const p=m.data?.id;if(!p)return;const g={id:p,title:m.data?.title??m7(h),titleNumber:h};o("all",i.all.length,g),o("active",p)}).catch(m=>{console.error("Failed to create terminal",m)})},update(h){d(e.client,h)},trim(h){const m=i.all.findIndex(p=>p.id===h);m!==-1&&o("all",m,p=>ig(p))},trimAll(){o("all",h=>{const m=h.map(ig);return m.every((p,g)=>p===h[g])?h:m})},async clone(h){await f(e.client,h)},bind(){const h=e.client;return{trim(m){const p=i.all.findIndex(g=>g.id===m);p!==-1&&o("all",p,g=>ig(g))},update(m){d(h,m)},async clone(m){await f(h,m)}}},open(h){o("active",h)},next(){const h=i.all.findIndex(p=>p.id===i.active);if(h===-1)return;const m=(h+1)%i.all.length;o("active",i.all[m]?.id)},previous(){const h=i.all.findIndex(p=>p.id===i.active);if(h===-1)return;const m=h===0?i.all.length-1:h-1;o("active",i.all[m]?.id)},async close(h){const m=i.all.findIndex(p=>p.id===h);m!==-1&&rt(()=>{if(i.active===h){const p=m>0?i.all[m-1]?.id:i.all[1]?.id;o("active",p)}o("all",He(p=>{p.splice(m,1)}))}),await e.client.pty.remove({ptyID:h}).catch(p=>{console.error("Failed to close terminal",p)})},move(h,m){const p=i.all.findIndex(g=>g.id===h);p!==-1&&o("all",He(g=>{g.splice(m,0,g.splice(p,1)[0])}))}}}const{use:Che,provider:Eae}=Xt({name:"Terminal",gate:!1,init:()=>{const e=Wh(),t=pr(),n=new Map;fv.add(n),ae(()=>fv.delete(n)),ae(()=>{for(const a of n.values())a.dispose();n.clear()});const i=()=>{for(;n.size>OL;){const a=n.keys().next().value;if(!a)return;n.get(a)?.dispose(),n.delete(a)}},o=(a,l)=>{const c=NL(a),u=n.get(c);if(u)return n.delete(c),n.set(c,u),u.value;const d=An(f=>({value:Iae(e,a,l),dispose:f}));return n.set(c,d),i(),d.value},s=q(()=>o(t.dir,t.id));return re(Yt(()=>({dir:t.dir,id:t.id}),(a,l)=>{l?.dir&&(a.dir===l.dir&&a.id===l.id||a.dir===l.dir&&a.id||o(l.dir,l.id).trimAll())},{defer:!0})),{ready:()=>s().ready(),all:()=>s().all(),active:()=>s().active(),new:()=>s().new(),update:a=>s().update(a),trim:a=>s().trim(a),trimAll:()=>s().trimAll(),clone:a=>s().clone(a),bind:()=>s(),open:a=>s().open(a),close:a=>s().close(a),move:(a,l)=>s().move(a,l),next:()=>s().next(),previous:()=>s().previous()}}}),p7=e=>{if(e)return{...e,model:e.model?{...e.model}:e.model}};let sf;const zL=()=>typeof window>"u"?!1:window.__duckmind_e2e?.model?.enabled===!0,og=()=>{if(zL())return window.__duckmind_e2e?.model},sg={bind(e,t){const n=og();n&&(sf=e,n.controls=t)},set(e,t){const n=og();!n||sf!==e||(n.current={...t,model:t.model?{...t.model}:void 0,last:t.last?{...t.last,model:t.last.model?{...t.last.model}:t.last.model}:void 0,pick:p7(t.pick),base:p7(t.base),variants:t.variants?.slice(),models:t.models?.map(r=>({...r})),agents:t.agents?.map(r=>({...r}))})},clear(e){const t=og();!t||sf!==e||(sf=void 0,t.current=void 0,t.controls=void 0)}};function Tae(e){if(e.agent?.variant&&e.agent.model&&e.model?.variants&&e.agent.model.providerID===e.model.providerID&&e.agent.model.modelID===e.model.modelID&&e.agent.variant in e.model.variants)return e.agent.variant}function $ae(e){if(e.selected!==null){if(e.selected&&e.variants.includes(e.selected))return e.selected;if(e.configured&&e.variants.includes(e.configured))return e.configured}}function Lae(e){if(e.variants.length!==0){if(e.selected===null)return e.variants[0];if(e.selected&&e.variants.includes(e.selected)){const t=e.variants.indexOf(e.selected);return t===e.variants.length-1?void 0:e.variants[t+1]}if(e.configured&&e.variants.includes(e.configured)){const t=e.variants.indexOf(e.configured);return t===e.variants.length-1?e.variants[0]:e.variants[t+1]}return e.variants[0]}}const Aae="__workspace__",La=new Map,af=(e,t)=>`${e}
|
|
2403
|
-
${t}`,Mae=e=>{if(!e||typeof e!="object")return{session:{}};const t=e;return t.session&&typeof t.session=="object"?{session:t.session}:!t.pick||typeof t.pick!="object"?{session:{}}:{session:Object.fromEntries(Object.entries(t.pick).filter(([n])=>n!==Aae))}},g7=e=>{if(e)return{...e,model:e.model?{...e.model}:void 0}},{use:Ihe,provider:Dae}=Xt({name:"Local",init:()=>{const e=pr(),t=Wh(),n=A4(),r=V4(),i=Gse(),o=q(()=>e.id||void 0),s=q(()=>n.data.agent.filter(M=>M.mode!=="subagent"&&!M.hidden)),a=q(()=>new Set(r.connected().map(M=>M.id))),[l,c]=Sn({...Jt.workspace(t.directory,"model-selection",["model-selection.v1"]),migrate:Mae},qe({session:{}})),[u,d]=qe({current:s()[0]?.name,draft:void 0,last:void 0}),f=M=>!!r.all().find(E=>E.id===M.providerID)?.models[M.modelID]&&a().has(M.providerID),h=(...M)=>{for(const T of M){const E=T();if(E&&f(E))return E}},m=M=>{const T=s();if(T.length!==0)return T.find(E=>E.name===M)??T[0]};re(()=>{const M=s();if(M.length===0){u.current!==void 0&&d("current",void 0);return}M.some(T=>T.name===u.current)||d("current",M[0]?.name)});const p=q(()=>{const M=o();return M?l.session[M]??La.get(af(t.directory,M)):u.draft});re(()=>{const M=o();if(!M)return;const T=af(t.directory,M),E=La.get(T);if(E){if(l.session[M]!==void 0){La.delete(T);return}c("session",M,g7(E)),La.delete(T)}});const g=()=>{if(!n.data.config.model)return;const[M,T]=n.data.config.model.split("/"),E={providerID:M,modelID:T};if(f(E))return E},b=()=>{for(const M of i.recent.list())if(f(M))return M},v=()=>{const M=r.default();for(const T of r.connected()){const E=M[T.id];if(E){const G={providerID:T.id,modelID:E};if(f(G))return G}const D=Object.values(T.models)[0];if(!D)continue;const F={providerID:T.id,modelID:D.id};if(f(F))return F}},y=q(()=>g()??b()??v()),_={list:s,current(){return m(p()?.agent??u.current)},set(M){const T=m(M);if(!T){d("current",void 0);return}rt(()=>{d("current",T.name),d("last",{type:"agent",agent:T.name,model:T.model,variant:T.variant??null});const E=p(),D={agent:T.name,model:T.model??E?.model,variant:T.variant??E?.variant},F=o();if(F){c("session",F,D);return}d("draft",D)})},move(M){const T=s();if(T.length===0){d("current",void 0);return}let E=T.findIndex(F=>F.name===_.current()?.name)+M;E<0&&(E=T.length-1),E>=T.length&&(E=0);const D=T[E];D&&_.set(D.name)}},k=()=>{const M=h(()=>p()?.model,()=>_.current()?.model,y);if(M)return i.find(M)},x=()=>{const M=_.current(),T=k();if(!(!M||!T))return Tae({agent:{model:M.model,variant:M.variant},model:{providerID:T.provider.id,modelID:T.id,variants:T.variants}})},I=()=>p()?.variant,A=()=>{const M=k();return{agent:_.current()?.name,model:M?{providerID:M.provider.id,modelID:M.id}:void 0,variant:I()}},L=M=>{const T={...p()??{agent:_.current()?.name},...M},E=o();if(E){c("session",E,T);return}d("draft",T)},$=q(()=>i.recent.list().map(i.find).filter(Boolean)),H={ready:i.ready,current:k,recent:$,list:i.list,cycle(M){const T=$(),E=k();if(!E)return;const D=T.findIndex(U=>U?.provider.id===E.provider.id&&U?.id===E.id);if(D===-1)return;let F=D+M;F<0&&(F=T.length-1),F>=T.length&&(F=0);const G=T[F];G&&H.set({providerID:G.provider.id,modelID:G.id})},set(M,T){rt(()=>{d("last",{type:"model",agent:_.current()?.name,model:M??null,variant:I()}),L({model:M}),M&&(i.setVisibility(M,!0),T?.recent&&i.recent.push(M))})},visible(M){return i.visible(M)},setVisibility(M,T){i.setVisibility(M,T)},variant:{configured:x,selected:I,current(){return $ae({variants:this.list(),selected:this.selected(),configured:this.configured()})},list(){const M=k();return M?.variants?Object.keys(M.variants):[]},set(M){rt(()=>{const T=k();d("last",{type:"variant",agent:_.current()?.name,model:T?{providerID:T.provider.id,modelID:T.id}:null,variant:M??null}),L({variant:M??null})})},cycle(){const M=this.list();M.length!==0&&this.set(Lae({variants:M,selected:this.selected(),configured:this.configured()}))}}},j={slug:q(()=>mt(t.directory)),model:H,agent:_,session:{reset(){d("draft",void 0)},promote(M,T){const E=g7(A());if(E){if(M===t.directory){c("session",T,E),d("draft",void 0);return}La.set(af(M,T),E),d("draft",void 0)}},restore(M){const T=o();T&&M.sessionID===T&&l.session[T]===void 0&&(La.has(af(t.directory,T))||c("session",T,{agent:M.agent,model:M.model,variant:M.model.variant??null}))}}};if(zL()){const M=Symbol("model-probe");sg.bind(M,{setAgent:_.set,setModel:H.set,setVariant:H.variant.set}),re(()=>{const T=j.agent.current(),E=j.model.current();sg.set(M,{dir:t.directory,sessionID:o(),last:u.last,agent:T?.name,model:E?{providerID:E.provider.id,modelID:E.id,name:E.name}:void 0,variant:j.model.variant.current()??null,selected:j.model.variant.selected(),configured:j.model.variant.configured(),pick:p(),base:void 0,current:u.current,variants:j.model.variant.list(),models:j.model.list().filter(D=>j.model.visible({providerID:D.provider.id,modelID:D.id})).map(D=>({providerID:D.provider.id,modelID:D.id,name:D.name})),agents:j.agent.list().map(D=>({name:D.name}))})}),ae(()=>sg.clear(M))}return j}});function Oae(e){const t=Al(),n=ua(),r=pr(),i=A4(),o=q(()=>mt(e.directory));return re(()=>{const s=i.data.path.directory;if(!s||s===e.directory)return;const a=t.pathname.slice(o().length+1);n(`/${mt(s)}${a}${t.search}${t.hash}`,{replace:!0})}),re(()=>{const s=r.id;s&&i.session.sync(s)}),C(PD,{get data(){return i.data},get directory(){return e.directory},onNavigateToSession:s=>n(`/${o()}/session/${s}`),onSessionHref:s=>`/${o()}/session/${s}`,get children(){return C(Dae,{get children(){return e.children}})}})}function Pae(e){const t=pr(),n=En(),r=ua();let i="";const o=q(()=>t.dir?bo(t.dir)??"":"");return re(()=>{const s=t.dir;if(s){if(o()){i="";return}i!==s&&(i=s,yn({variant:"error",title:n.t("common.requestFailed"),description:n.t("directory.error.invalidUrl")}),r("/",{replace:!0}))}}),C(Ce,{get when(){return o()},keyed:!0,children:s=>C(Vne,{directory:()=>s,get children(){return C(Lre,{get children(){return C(Oae,{directory:s,get children(){return e.children}})}})}})})}var Rae=me("<div>");function Nae(e){const[t,n]=pe(e,["direction","edge","size","min","max","onResize","onCollapse","collapseThreshold","class","classList"]),r=i=>{i.preventDefault();const o=t.edge??(t.direction==="vertical"?"start":"end"),s=t.direction==="horizontal"?i.clientX:i.clientY,a=t.size;let l=a;document.body.style.userSelect="none",document.body.style.overflow="hidden";const c=d=>{const f=t.direction==="horizontal"?d.clientX:d.clientY,h=t.direction==="vertical"?o==="end"?f-s:s-f:o==="start"?s-f:f-s;l=a+h;const m=Math.min(t.max,Math.max(t.min,l));t.onResize(m)},u=()=>{document.body.style.userSelect="",document.body.style.overflow="",document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u);const d=t.collapseThreshold??0;t.onCollapse&&d>0&&l<d&&t.onCollapse()};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)};return(()=>{var i=Rae();return Zr(i,ie(n,{"data-component":"resize-handle",get"data-direction"(){return t.direction},get"data-edge"(){return t.edge??(t.direction==="vertical"?"start":"end")},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},onMouseDown:r}),!1,!1),i})()}var zae=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),jae=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Fae(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return zae.has(n)}const t=e.split("-")[0];return jae.has(t)}function Hae(e){return Fae(e)?"rtl":"ltr"}function jL(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Hae(e)}}var hv=jL(),Sc=new Set;function v7(){hv=jL();for(const e of Sc)e(hv)}function Vae(){const[e,t]=we(hv),n=q(()=>e());return Pt(()=>{Sc.size===0&&window.addEventListener("languagechange",v7),Sc.add(t),ae(()=>{Sc.delete(t),Sc.size===0&&window.removeEventListener("languagechange",v7)})}),{locale:()=>n().locale,direction:()=>n().direction}}var Uae=yt();function Lo(){const e=Vae();return wt(Uae)||e}var ag=new Map;function Bae(e){const{locale:t}=Lo(),n=q(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return q(()=>{const r=n();let i;return ag.has(r)&&(i=ag.get(r)),i||(i=new Intl.Collator(t(),e),ag.set(r,i)),i})}const qae=["top","right","bottom","left"],rs=Math.min,kr=Math.max,U0=Math.round,lf=Math.floor,Hi=e=>({x:e,y:e}),Wae={left:"right",right:"left",bottom:"top",top:"bottom"};function mv(e,t,n){return kr(e,rs(t,n))}function pa(e,t){return typeof e=="function"?e(t):e}function is(e){return e.split("-")[0]}function Bl(e){return e.split("-")[1]}function FL(e){return e==="x"?"y":"x"}function B4(e){return e==="y"?"height":"width"}function mo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function q4(e){return FL(mo(e))}function Gae(e,t,n){n===void 0&&(n=!1);const r=Bl(e),i=q4(e),o=B4(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=B0(s)),[s,B0(s)]}function Zae(e){const t=B0(e);return[pv(e),t,pv(t)]}function pv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const b7=["left","right"],y7=["right","left"],Kae=["top","bottom"],Yae=["bottom","top"];function Jae(e,t,n){switch(e){case"top":case"bottom":return n?t?y7:b7:t?b7:y7;case"left":case"right":return t?Kae:Yae;default:return[]}}function Xae(e,t,n,r){const i=Bl(e);let o=Jae(is(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(pv)))),o}function B0(e){const t=is(e);return Wae[t]+e.slice(t.length)}function Qae(e){return{top:0,right:0,bottom:0,left:0,...e}}function HL(e){return typeof e!="number"?Qae(e):{top:e,right:e,bottom:e,left:e}}function q0(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function w7(e,t,n){let{reference:r,floating:i}=e;const o=mo(t),s=q4(t),a=B4(s),l=is(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Bl(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}async function ele(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=pa(t,e),m=HL(h),g=a[f?d==="floating"?"reference":"floating":d],b=q0(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),_=await(o.isElement==null?void 0:o.isElement(y))?await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1}:{x:1,y:1},k=q0(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(b.top-k.top+m.top)/_.y,bottom:(k.bottom-b.bottom+m.bottom)/_.y,left:(b.left-k.left+m.left)/_.x,right:(k.right-b.right+m.right)/_.x}}const tle=50,nle=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:ele},l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=w7(c,r,l),f=r,h=0;const m={};for(let p=0;p<o.length;p++){const g=o[p];if(!g)continue;const{name:b,fn:v}=g,{x:y,y:_,data:k,reset:x}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});u=y??u,d=_??d,m[b]={...m[b],...k},x&&h<tle&&(h++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(c=x.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=w7(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},rle=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=pa(e,t)||{};if(c==null)return{};const d=HL(u),f={x:n,y:r},h=q4(i),m=B4(h),p=await s.getDimensions(c),g=h==="y",b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",_=o.reference[m]+o.reference[h]-f[h]-o.floating[m],k=f[h]-o.reference[h],x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let I=x?x[y]:0;(!I||!await(s.isElement==null?void 0:s.isElement(x)))&&(I=a.floating[y]||o.floating[m]);const A=_/2-k/2,L=I/2-p[m]/2-1,$=rs(d[b],L),H=rs(d[v],L),j=$,M=I-p[m]-H,T=I/2-p[m]/2+A,E=mv(j,T,M),D=!l.arrow&&Bl(i)!=null&&T!==E&&o.reference[m]/2-(T<j?$:H)-p[m]/2<0,F=D?T<j?T-j:T-M:0;return{[h]:f[h]+F,data:{[h]:E,centerOffset:T-E-F,...D&&{alignmentOffset:F}},reset:D}}}),ile=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=pa(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=is(i),v=mo(a),y=is(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=f||(y||!p?[B0(a)]:Zae(a)),x=m!=="none";!f&&x&&k.push(...Xae(a,p,m,_));const I=[a,...k],A=await l.detectOverflow(t,g),L=[];let $=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&L.push(A[b]),d){const T=Gae(i,s,_);L.push(A[T[0]],A[T[1]])}if($=[...$,{placement:i,overflows:L}],!L.every(T=>T<=0)){var H,j;const T=(((H=o.flip)==null?void 0:H.index)||0)+1,E=I[T];if(E&&(!(d==="alignment"?v!==mo(E):!1)||$.every(G=>mo(G.placement)===v?G.overflows[0]>0:!0)))return{data:{index:T,overflows:$},reset:{placement:E}};let D=(j=$.filter(F=>F.overflows[0]<=0).sort((F,G)=>F.overflows[1]-G.overflows[1])[0])==null?void 0:j.placement;if(!D)switch(h){case"bestFit":{var M;const F=(M=$.filter(G=>{if(x){const U=mo(G.placement);return U===v||U==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(U=>U>0).reduce((U,Z)=>U+Z,0)]).sort((G,U)=>G[1]-U[1])[0])==null?void 0:M[0];F&&(D=F);break}case"initialPlacement":D=a;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function k7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function x7(e){return qae.some(t=>e[t]>=0)}const ole=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=pa(e,t);switch(i){case"referenceHidden":{const s=await r.detectOverflow(t,{...o,elementContext:"reference"}),a=k7(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:x7(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...o,altBoundary:!0}),a=k7(s,n.floating);return{data:{escapedOffsets:a,escaped:x7(a)}}}default:return{}}}}},sle=new Set(["left","top"]);async function ale(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=is(n),a=Bl(n),l=mo(n)==="y",c=sle.has(s)?-1:1,u=o&&l?-1:1,d=pa(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const lle=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await ale(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},cle=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:v,y}=b;return{x:v,y}}},...c}=pa(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),f=mo(is(i)),h=FL(f);let m=u[h],p=u[f];if(s){const b=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=m+d[b],_=m-d[v];m=mv(y,m,_)}if(a){const b=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=p+d[b],_=p-d[v];p=mv(y,p,_)}const g=l.fn({...t,[h]:m,[f]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:s,[f]:a}}}}}},ule=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...c}=pa(e,t),u=await s.detectOverflow(t,c),d=is(i),f=Bl(i),h=mo(i)==="y",{width:m,height:p}=o.floating;let g,b;d==="top"||d==="bottom"?(g=d,b=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,g=f==="end"?"top":"bottom");const v=p-u.top-u.bottom,y=m-u.left-u.right,_=rs(p-u[g],v),k=rs(m-u[b],y),x=!t.middlewareData.shift;let I=_,A=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=v),x&&!f){const $=kr(u.left,0),H=kr(u.right,0),j=kr(u.top,0),M=kr(u.bottom,0);h?A=m-2*($!==0||H!==0?$+H:kr(u.left,u.right)):I=p-2*(j!==0||M!==0?j+M:kr(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:I});const L=await s.getDimensions(a.floating);return m!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function tm(){return typeof window<"u"}function ql(e){return VL(e)?(e.nodeName||"").toLowerCase():"#document"}function Tr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zi(e){var t;return(t=(VL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function VL(e){return tm()?e instanceof Node||e instanceof Tr(e).Node:!1}function xi(e){return tm()?e instanceof Element||e instanceof Tr(e).Element:!1}function Ao(e){return tm()?e instanceof HTMLElement||e instanceof Tr(e).HTMLElement:!1}function S7(e){return!tm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tr(e).ShadowRoot}function Yu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Si(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function dle(e){return/^(table|td|th)$/.test(ql(e))}function nm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fle=/transform|translate|scale|rotate|perspective|filter/,hle=/paint|layout|strict|content/,xs=e=>!!e&&e!=="none";let lg;function W4(e){const t=xi(e)?Si(e):e;return xs(t.transform)||xs(t.translate)||xs(t.scale)||xs(t.rotate)||xs(t.perspective)||!G4()&&(xs(t.backdropFilter)||xs(t.filter))||fle.test(t.willChange||"")||hle.test(t.contain||"")}function mle(e){let t=os(e);for(;Ao(t)&&!kl(t);){if(W4(t))return t;if(nm(t))return null;t=os(t)}return null}function G4(){return lg==null&&(lg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),lg}function kl(e){return/^(html|body|#document)$/.test(ql(e))}function Si(e){return Tr(e).getComputedStyle(e)}function rm(e){return xi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function os(e){if(ql(e)==="html")return e;const t=e.assignedSlot||e.parentNode||S7(e)&&e.host||Zi(e);return S7(t)?t.host:t}function UL(e){const t=os(e);return kl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ao(t)&&Yu(t)?t:UL(t)}function fu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=UL(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Tr(i);if(o){const a=gv(s);return t.concat(s,s.visualViewport||[],Yu(i)?i:[],a&&n?fu(a):[])}else return t.concat(i,fu(i,[],n))}function gv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BL(e){const t=Si(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ao(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=U0(n)!==o||U0(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Z4(e){return xi(e)?e:e.contextElement}function ol(e){const t=Z4(e);if(!Ao(t))return Hi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=BL(t);let s=(o?U0(n.width):n.width)/r,a=(o?U0(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ple=Hi(0);function qL(e){const t=Tr(e);return!G4()||!t.visualViewport?ple:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gle(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tr(e)?!1:t}function na(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Z4(e);let s=Hi(1);t&&(r?xi(r)&&(s=ol(r)):s=ol(e));const a=gle(o,n,r)?qL(o):Hi(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const f=Tr(o),h=r&&xi(r)?Tr(r):r;let m=f,p=gv(m);for(;p&&r&&h!==m;){const g=ol(p),b=p.getBoundingClientRect(),v=Si(p),y=b.left+(p.clientLeft+parseFloat(v.paddingLeft))*g.x,_=b.top+(p.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=y,c+=_,m=Tr(p),p=gv(m)}}return q0({width:u,height:d,x:l,y:c})}function im(e,t){const n=rm(e).scrollLeft;return t?t.left+n:na(Zi(e)).left+n}function WL(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-im(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function vle(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Zi(r),a=t?nm(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Hi(1);const u=Hi(0),d=Ao(r);if((d||!d&&!o)&&((ql(r)!=="body"||Yu(s))&&(l=rm(r)),d)){const h=na(r);c=ol(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=s&&!d&&!o?WL(s,l):Hi(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function ble(e){return Array.from(e.getClientRects())}function yle(e){const t=Zi(e),n=rm(e),r=e.ownerDocument.body,i=kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+im(e);const a=-n.scrollTop;return Si(r).direction==="rtl"&&(s+=kr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const _7=25;function wle(e,t){const n=Tr(e),r=Zi(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const u=G4();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=im(r);if(c<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-h);m<=_7&&(o-=m)}else c<=_7&&(o+=c);return{width:o,height:s,x:a,y:l}}function kle(e,t){const n=na(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Ao(e)?ol(e):Hi(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function C7(e,t,n){let r;if(t==="viewport")r=wle(e,n);else if(t==="document")r=yle(Zi(e));else if(xi(t))r=kle(t,n);else{const i=qL(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return q0(r)}function GL(e,t){const n=os(e);return n===t||!xi(n)||kl(n)?!1:Si(n).position==="fixed"||GL(n,t)}function xle(e,t){const n=t.get(e);if(n)return n;let r=fu(e,[],!1).filter(a=>xi(a)&&ql(a)!=="body"),i=null;const o=Si(e).position==="fixed";let s=o?os(e):e;for(;xi(s)&&!kl(s);){const a=Si(s),l=W4(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Yu(s)&&!l&&GL(e,s))?r=r.filter(u=>u!==s):i=a,s=os(s)}return t.set(e,r),r}function Sle(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?nm(t)?[]:xle(t,this._c):[].concat(n),r],a=C7(t,s[0],i);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f<s.length;f++){const h=C7(t,s[f],i);l=kr(h.top,l),c=rs(h.right,c),u=rs(h.bottom,u),d=kr(h.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function _le(e){const{width:t,height:n}=BL(e);return{width:t,height:n}}function Cle(e,t,n){const r=Ao(t),i=Zi(t),o=n==="fixed",s=na(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Hi(0);function c(){l.x=im(i)}if(r||!r&&!o)if((ql(t)!=="body"||Yu(i))&&(a=rm(t)),r){const h=na(t,!0,o,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?WL(i,a):Hi(0),d=s.left+a.scrollLeft-l.x-u.x,f=s.top+a.scrollTop-l.y-u.y;return{x:d,y:f,width:s.width,height:s.height}}function cg(e){return Si(e).position==="static"}function I7(e,t){if(!Ao(e)||Si(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Zi(e)===n&&(n=n.ownerDocument.body),n}function ZL(e,t){const n=Tr(e);if(nm(e))return n;if(!Ao(e)){let i=os(e);for(;i&&!kl(i);){if(xi(i)&&!cg(i))return i;i=os(i)}return n}let r=I7(e,t);for(;r&&dle(r)&&cg(r);)r=I7(r,t);return r&&kl(r)&&cg(r)&&!W4(r)?n:r||mle(e)||n}const Ile=async function(e){const t=this.getOffsetParent||ZL,n=this.getDimensions,r=await n(e.floating);return{reference:Cle(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ele(e){return Si(e).direction==="rtl"}const KL={convertOffsetParentRelativeRectToViewportRelativeRect:vle,getDocumentElement:Zi,getClippingRect:Sle,getOffsetParent:ZL,getElementRects:Ile,getClientRects:ble,getDimensions:_le,getScale:ol,isElement:xi,isRTL:Ele};function YL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tle(e,t){let n=null,r;const i=Zi(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(a||t(),!f||!h)return;const m=lf(d),p=lf(i.clientWidth-(u+f)),g=lf(i.clientHeight-(d+h)),b=lf(u),y={rootMargin:-m+"px "+-p+"px "+-g+"px "+-b+"px",threshold:kr(0,rs(1,l))||1};let _=!0;function k(x){const I=x[0].intersectionRatio;if(I!==l){if(!_)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!YL(c,e.getBoundingClientRect())&&s(),_=!1}try{n=new IntersectionObserver(k,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,y)}n.observe(e)}return s(!0),o}function $le(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Z4(e),u=i||o?[...c?fu(c):[],...t?fu(t):[]]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=c&&a?Tle(c,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),c&&!l&&h.observe(c),t&&h.observe(t));let m,p=l?na(e):null;l&&g();function g(){const b=na(e);p&&!YL(p,b)&&n(),p=b,m=requestAnimationFrame(g)}return n(),()=>{var b;u.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d?.(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const Lle=lle,Ale=cle,Mle=ile,Dle=ule,Ole=ole,Ple=rle,Rle=(e,t,n)=>{const r=new Map,i={platform:KL,...n},o={...i.platform,_c:r};return nle(e,t,{...i,platform:o})};var Nle=me('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),K4=yt();function Y4(){const e=wt(K4);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var vv=30,E7=vv/2,zle={top:180,right:-90,bottom:0,left:90};function Mo(e){const t=Y4(),n=et({size:vv},e),[r,i]=pe(n,["ref","style","size"]),o=()=>t.currentPlacement().split("-")[0],s=jle(t.contentRef),a=()=>s()?.getPropertyValue("background-color")||"none",l=()=>s()?.getPropertyValue(`border-${o()}-color`)||"none",c=()=>s()?.getPropertyValue(`border-${o()}-width`)||"0px",u=()=>Number.parseInt(c())*2*(vv/r.size),d=()=>`rotate(${zle[o()]} ${E7} ${E7}) translate(0 2)`;return C(pt,ie({as:"div",ref(f){var h=Nt(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return _i({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){var f=Nle(),h=f.firstChild,m=h.firstChild;return m.nextSibling,Ve(()=>vt(h,"transform",d())),f}}))}function jle(e){const[t,n]=we();return re(()=>{const r=e();r&&n(Sv(r).getComputedStyle(r))}),t}function Fle(e){const t=Y4(),[n,r]=pe(e,["ref","style"]);return C(pt,ie({as:"div",ref(i){var o=Nt(t.setPositionerRef,n.ref);typeof o=="function"&&o(i)},"data-popper-positioner":"",get style(){return _i({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function T7(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const o={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...o,toJSON:()=>o}}function Hle(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?T7(r):e?e.getBoundingClientRect():T7()}}}function Vle(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Ule={top:"bottom",right:"left",bottom:"top",left:"right"};function Ble(e,t){const[n,r]=e.split("-"),i=Ule[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function qle(e){const t=et({getAnchorRect:f=>f?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=we(),[i,o]=we(),[s,a]=we(t.placement),l=()=>Hle(t.anchorRef?.(),t.getAnchorRect),{direction:c}=Lo();async function u(){const f=l(),h=n(),m=i();if(!f||!h)return;const p=(m?.clientHeight||0)/2,g=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const b=[Lle(({placement:x})=>{const I=!!x.split("-")[1];return{mainAxis:g,crossAxis:I?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const x=typeof t.flip=="string"?t.flip.split(" "):void 0;if(x!==void 0&&!x.every(Vle))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(Mle({padding:t.overflowPadding,fallbackPlacements:x}))}(t.slide||t.overlap)&&b.push(Ale({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(Dle({padding:t.overflowPadding,apply({availableWidth:x,availableHeight:I,rects:A}){const L=Math.round(A.reference.width);x=Math.floor(x),I=Math.floor(I),h.style.setProperty("--kb-popper-anchor-width",`${L}px`),h.style.setProperty("--kb-popper-content-available-width",`${x}px`),h.style.setProperty("--kb-popper-content-available-height",`${I}px`),t.sameWidth&&(h.style.width=`${L}px`),t.fitViewport&&(h.style.maxWidth=`${x}px`,h.style.maxHeight=`${I}px`)}})),t.hideWhenDetached&&b.push(Ole({padding:t.detachedPadding})),m&&b.push(Ple({element:m,padding:t.arrowPadding}));const v=await Rle(f,h,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...KL,isRTL:()=>c()==="rtl"}});if(a(v.placement),t.onCurrentPlacementChange?.(v.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",Ble(v.placement,c()));const y=Math.round(v.x),_=Math.round(v.y);let k;if(t.hideWhenDetached&&(k=v.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${y}px, ${_}px, 0)`,visibility:k}),m&&v.middlewareData.arrow){const{x,y:I}=v.middlewareData.arrow,A=v.placement.split("-")[0];Object.assign(m.style,{left:x!=null?`${x}px`:"",top:I!=null?`${I}px`:"",[A]:"100%"})}}re(()=>{const f=l(),h=n();if(!f||!h)return;const m=$le(f,h,u,{elementResize:typeof ResizeObserver=="function"});ae(m)}),re(()=>{const f=n(),h=t.contentRef?.();!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:o};return C(K4.Provider,{value:d,get children(){return t.children}})}var Wl=Object.assign(qle,{Arrow:Mo,Context:K4,usePopperContext:Y4,Positioner:Fle}),Wle={};Ci(Wle,{Arrow:()=>Mo,Content:()=>XL,Portal:()=>QL,Root:()=>eA,Tooltip:()=>_c,Trigger:()=>tA,useTooltipContext:()=>om});var JL=yt();function om(){const e=wt(JL);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function XL(e){const t=om(),n=et({id:t.generateId("content")},e),[r,i]=pe(n,["ref","style"]);return re(()=>ae(t.registerContentId(i.id))),C(Ce,{get when(){return t.contentPresent()},get children(){return C(Wl.Positioner,{get children(){return C(X0,ie({ref(o){var s=Nt(a=>{t.setContentRef(a)},r.ref);typeof s=="function"&&s(o)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return _i({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:o=>o.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),i))}})}})}function QL(e){const t=om();return C(Ce,{get when(){return t.contentPresent()},get children(){return C(ia,e)}})}function Gle(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),o=n.getBoundingClientRect(),s=[],a=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":s.push([i.left,l]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([i.right,l]);break;case"right":s.push([a,i.top]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([a,i.bottom]);break;case"bottom":s.push([i.left,l]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([o.right,o.top]),s.push([i.right,l]);break;case"left":s.push([a,i.top]),s.push([o.right,o.top]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([a,i.bottom]);break}return s}var Ss={},Zle=0,Aa=!1,to,lc,Ma;function eA(e){const t=`tooltip-${Mn()}`,n=`${++Zle}`,r=et({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[i,o]=pe(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[a,l]=we(),[c,u]=we(),[d,f]=we(),[h,m]=we(o.placement),p=oa({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:T=>i.onOpenChange?.(T)}),{present:g}=Fs({show:()=>i.forceMount||p.isOpen(),element:()=>d()??null}),b=()=>{Ss[n]=y},v=()=>{for(const T in Ss)T!==n&&(Ss[T](!0),delete Ss[T])},y=(T=!1)=>{T||i.closeDelay&&i.closeDelay<=0?(window.clearTimeout(s),s=void 0,p.close()):s||(s=window.setTimeout(()=>{s=void 0,p.close()},i.closeDelay)),window.clearTimeout(to),to=void 0,i.skipDelayDuration&&i.skipDelayDuration>=0&&(Ma=window.setTimeout(()=>{window.clearTimeout(Ma),Ma=void 0},i.skipDelayDuration)),Aa&&(window.clearTimeout(lc),lc=window.setTimeout(()=>{delete Ss[n],lc=void 0,Aa=!1},i.closeDelay))},_=()=>{clearTimeout(s),s=void 0,v(),b(),Aa=!0,p.open(),window.clearTimeout(to),to=void 0,window.clearTimeout(lc),lc=void 0,window.clearTimeout(Ma),Ma=void 0},k=()=>{v(),b(),!p.isOpen()&&!to&&!Aa?to=window.setTimeout(()=>{to=void 0,Aa=!0,_()},i.openDelay):p.isOpen()||_()},x=(T=!1)=>{!T&&i.openDelay&&i.openDelay>0&&!s&&!Ma?k():_()},I=()=>{window.clearTimeout(to),to=void 0,Aa=!1},A=()=>{window.clearTimeout(s),s=void 0},L=T=>dn(c(),T)||dn(d(),T),$=T=>{const E=c(),D=d();if(!(!E||!D))return Gle(T,E,D)},H=T=>{const E=T.target;if(L(E)){A();return}if(!i.ignoreSafeArea){const D=$(h());if(D&&Ev(lk(T),D)){A();return}}s||y()};re(()=>{if(!p.isOpen())return;const T=nr();T.addEventListener("pointermove",H,!0),ae(()=>{T.removeEventListener("pointermove",H,!0)})}),re(()=>{const T=c();if(!T||!p.isOpen())return;const E=F=>{const G=F.target;dn(G,T)&&y(!0)},D=Sv();D.addEventListener("scroll",E,{capture:!0}),ae(()=>{D.removeEventListener("scroll",E,{capture:!0})})}),ae(()=>{clearTimeout(s),Ss[n]&&delete Ss[n]});const M={dataset:q(()=>({"data-expanded":p.isOpen()?"":void 0,"data-closed":p.isOpen()?void 0:""})),isOpen:p.isOpen,isDisabled:()=>i.disabled??!1,triggerOnFocusOnly:()=>i.triggerOnFocusOnly??!1,contentId:a,contentPresent:g,openTooltip:x,hideTooltip:y,cancelOpening:I,generateId:Bi(()=>r.id),registerContentId:Gn(l),isTargetOnTooltip:L,setTriggerRef:u,setContentRef:f};return C(JL.Provider,{value:M,get children(){return C(Wl,ie({anchorRef:c,contentRef:d,onCurrentPlacementChange:m},o))}})}function tA(e){let t;const n=om(),[r,i]=pe(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let o=!1,s=!1,a=!1;const l=()=>{o=!1},c=()=>{!n.isOpen()&&(s||a)&&n.openTooltip(a)},u=b=>{n.isOpen()&&!s&&!a&&n.hideTooltip(b)},d=b=>{Je(b,r.onPointerEnter),!(b.pointerType==="touch"||n.triggerOnFocusOnly()||n.isDisabled()||b.defaultPrevented)&&(s=!0,c())},f=b=>{Je(b,r.onPointerLeave),b.pointerType!=="touch"&&(s=!1,a=!1,n.isOpen()?u():n.cancelOpening())},h=b=>{Je(b,r.onPointerDown),o=!0,nr(t).addEventListener("pointerup",l,{once:!0})},m=b=>{Je(b,r.onClick),s=!1,a=!1,u(!0)},p=b=>{Je(b,r.onFocus),!(n.isDisabled()||b.defaultPrevented||o)&&(a=!0,c())},g=b=>{Je(b,r.onBlur);const v=b.relatedTarget;n.isTargetOnTooltip(v)||(s=!1,a=!1,u(!0))};return ae(()=>{nr(t).removeEventListener("pointerup",l)}),C(pt,ie({as:"button",ref(b){var v=Nt(y=>{n.setTriggerRef(y),t=y},r.ref);typeof v=="function"&&v(b)},get"aria-describedby"(){return it(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:d,onPointerLeave:f,onPointerDown:h,onClick:m,onFocus:p,onBlur:g},()=>n.dataset(),i))}var _c=Object.assign(eA,{Arrow:Mo,Content:XL,Portal:QL,Trigger:tA}),Kle=me("<div data-slot=tooltip-keybind><span></span><span data-slot=tooltip-keybind-key>");function bv(e){const[t,n]=pe(e,["title","keybind"]);return C($r,ie(n,{get value(){return(()=>{var r=Kle(),i=r.firstChild,o=i.nextSibling;return X(i,()=>t.title),X(o,()=>t.keybind),r})()}}))}function $r(e){let t;const[n,r]=qe({open:!1,block:!1,expand:!1}),[i,o]=pe(e,["children","class","contentClass","contentStyle","inactive","forceOpen","ignoreSafeArea","value"]),s=()=>r("open",!1),a=()=>{const f=document.activeElement;return!t||!f?!1:t.contains(f)},l=(f=n.expand)=>{f||t?.matches(":hover")||a()||r("block",!1)},c=()=>{const f=!!t?.querySelector('[aria-expanded="true"], [data-expanded]');if(r("expand",f),f){r("block",!0),s();return}l(f)},u=()=>{r("block",!0),s()},d=()=>{a()||s(),l()};return re(()=>{if(!t)return;c();const f=new MutationObserver(c);f.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-expanded","data-expanded"]}),ae(()=>f.disconnect())}),C(Y0,{get children(){return[C(Fr,{get when(){return i.inactive},get children(){return i.children}}),C(Fr,{when:!0,get children(){return C(_c,ie({gutter:4},o,{closeDelay:0,get ignoreSafeArea(){return i.ignoreSafeArea??!0},get open(){return i.forceOpen||n.open},onOpenChange:f=>{i.forceOpen||n.block&&f||r("open",f)},get children(){return[C(_c.Trigger,{ref(f){var h=t;typeof h=="function"?h(f):t=f},as:"div","data-component":"tooltip-trigger",get class(){return i.class},onPointerDownCapture:u,onKeyDownCapture:f=>{f.key!=="Enter"&&f.key!==" "||u()},onPointerLeave:d,onFocusOut:()=>requestAnimationFrame(()=>l()),get children(){return i.children}}),C(_c.Portal,{get children(){return C(_c.Content,{"data-component":"tooltip",get"data-placement"(){return e.placement},get"data-force-open"(){return i.forceOpen},get class(){return i.contentClass},get style(){return i.contentStyle},get children(){return i.value}})}})]}}))}})]}})}function nA(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],i=l=>{if(l==null)return"";const c=e.getKey??"key",u=Pa(c)?l[c]:c(l);return u!=null?String(u):""},o=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=Pa(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(Pa(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return Pa(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(Pa(l)||KD(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const u=nA({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:i(l),textValue:o(l),disabled:s(l),level:n,index:t}),t++}return r}function Yle(e,t=[]){return q(()=>{const n=nA({dataSource:ce(e.dataSource),getKey:ce(e.getKey),getTextValue:ce(e.getTextValue),getDisabled:ce(e.getDisabled),getSectionChildren:ce(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var ao=class rA extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof rA?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function Jle(e){const[t,n]=yu(e);return[()=>t()??new ao,n]}function iA(e){return eO()?e.altKey:e.ctrlKey}function Ha(e){return J0()?e.metaKey:e.ctrlKey}function $7(e){return new ao(e)}function Xle(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Qle(e){const t=et({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=we(!1),[i,o]=we(),s=q(()=>{const p=ce(t.selectedKeys);return p!=null?$7(p):p}),a=q(()=>{const p=ce(t.defaultSelectedKeys);return p!=null?$7(p):new ao}),[l,c]=Jle({value:s,defaultValue:a,onChange:p=>t.onSelectionChange?.(p)}),[u,d]=we(ce(t.selectionBehavior)),f=()=>ce(t.selectionMode),h=()=>ce(t.disallowEmptySelection)??!1,m=p=>{(ce(t.allowDuplicateSelectionEvents)||!Xle(p,l()))&&c(p)};return re(()=>{const p=l();ce(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof p=="object"&&p.size===0&&d("replace")}),re(()=>{d(ce(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:o,selectedKeys:l,setSelectedKeys:m}}function ece(e){const[t,n]=we(""),[r,i]=we(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(ce(e.isDisabled))return;const a=ce(e.keyboardDelegate),l=ce(e.selectionManager);if(!a.getKeyForSearch)return;const c=tce(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(f=>f+c),d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);d==null&&nce(u)&&(u=u[0],d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),e.onTypeSelect?.(d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function tce(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function nce(e){return e.split("").every(t=>t===e[0])}function rce(e,t,n){const i=ie({selectOnFocus:()=>ce(e.selectionManager).selectionBehavior()==="replace"},e),o=()=>n?.()??t(),{direction:s}=Lo();let a={top:0,left:0};UD(()=>ce(i.isVirtualized)?void 0:o(),"scroll",()=>{const g=o();g&&(a={top:g.scrollTop,left:g.scrollLeft})});const{typeSelectHandlers:l}=ece({isDisabled:()=>ce(i.disallowTypeAhead),keyboardDelegate:()=>ce(i.keyboardDelegate),selectionManager:()=>ce(i.selectionManager)}),c=()=>ce(i.orientation)??"vertical",u=g=>{Je(g,l.onKeyDown),g.altKey&&g.key==="Tab"&&g.preventDefault();const b=t();if(!b?.contains(g.target))return;const v=ce(i.selectionManager),y=ce(i.selectOnFocus),_=A=>{A!=null&&(v.setFocusedKey(A),g.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(A):y&&!iA(g)&&v.replaceSelection(A))},k=ce(i.keyboardDelegate),x=ce(i.shouldFocusWrap),I=v.focusedKey();switch(g.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(k.getKeyBelow){g.preventDefault();let A;I!=null?A=k.getKeyBelow(I):A=k.getFirstKey?.(),A==null&&x&&(A=k.getFirstKey?.(I)),_(A)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(k.getKeyAbove){g.preventDefault();let A;I!=null?A=k.getKeyAbove(I):A=k.getLastKey?.(),A==null&&x&&(A=k.getLastKey?.(I)),_(A)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(k.getKeyLeftOf){g.preventDefault();const A=s()==="rtl";let L;I!=null?L=k.getKeyLeftOf(I):L=A?k.getFirstKey?.():k.getLastKey?.(),_(L)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(k.getKeyRightOf){g.preventDefault();const A=s()==="rtl";let L;I!=null?L=k.getKeyRightOf(I):L=A?k.getLastKey?.():k.getFirstKey?.(),_(L)}break}case"Home":if(k.getFirstKey){g.preventDefault();const A=k.getFirstKey(I,Ha(g));A!=null&&(v.setFocusedKey(A),Ha(g)&&g.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(A):y&&v.replaceSelection(A))}break;case"End":if(k.getLastKey){g.preventDefault();const A=k.getLastKey(I,Ha(g));A!=null&&(v.setFocusedKey(A),Ha(g)&&g.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(A):y&&v.replaceSelection(A))}break;case"PageDown":if(k.getKeyPageBelow&&I!=null){g.preventDefault();const A=k.getKeyPageBelow(I);_(A)}break;case"PageUp":if(k.getKeyPageAbove&&I!=null){g.preventDefault();const A=k.getKeyPageAbove(I);_(A)}break;case"a":Ha(g)&&v.selectionMode()==="multiple"&&ce(i.disallowSelectAll)!==!0&&(g.preventDefault(),v.selectAll());break;case"Escape":g.defaultPrevented||(g.preventDefault(),ce(i.disallowEmptySelection)||v.clearSelection());break;case"Tab":if(!ce(i.allowsTabNavigation)){if(g.shiftKey)b.focus();else{const A=dO(b,{tabbable:!0});let L,$;do $=A.lastChild(),$&&(L=$);while($);L&&!L.contains(document.activeElement)&&xn(L)}break}}},d=g=>{const b=ce(i.selectionManager),v=ce(i.keyboardDelegate),y=ce(i.selectOnFocus);if(b.isFocused()){g.currentTarget.contains(g.target)||b.setFocused(!1);return}if(g.currentTarget.contains(g.target)){if(b.setFocused(!0),b.focusedKey()==null){const _=x=>{x!=null&&(b.setFocusedKey(x),y&&b.replaceSelection(x))},k=g.relatedTarget;k&&g.currentTarget.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_FOLLOWING?_(b.lastSelectedKey()??v.getLastKey?.()):_(b.firstSelectedKey()??v.getFirstKey?.())}else if(!ce(i.isVirtualized)){const _=o();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const k=_.querySelector(`[data-key="${b.focusedKey()}"]`);k&&(xn(k),Sg(_,k))}}}},f=g=>{const b=ce(i.selectionManager);g.currentTarget.contains(g.relatedTarget)||b.setFocused(!1)},h=g=>{o()===g.target&&g.preventDefault()},m=()=>{const g=ce(i.autoFocus);if(!g)return;const b=ce(i.selectionManager),v=ce(i.keyboardDelegate);let y;g==="first"&&(y=v.getFirstKey?.()),g==="last"&&(y=v.getLastKey?.());const _=b.selectedKeys();_.size&&(y=_.values().next().value),b.setFocused(!0),b.setFocusedKey(y);const k=t();k&&y==null&&!ce(i.shouldUseVirtualFocus)&&xn(k)};return Pt(()=>{i.deferAutoFocus?setTimeout(m,0):m()}),re(Yt([o,()=>ce(i.isVirtualized),()=>ce(i.selectionManager).focusedKey()],g=>{const[b,v,y]=g;if(v)y&&i.scrollToKey?.(y);else if(y&&b){const _=b.querySelector(`[data-key="${y}"]`);_&&Sg(b,_)}})),{tabIndex:q(()=>{if(!ce(i.shouldUseVirtualFocus))return ce(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function oA(e,t){const n=()=>ce(e.selectionManager),r=()=>ce(e.key),i=()=>ce(e.shouldUseVirtualFocus),o=v=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):v?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Ha(v)||"pointerType"in v&&v.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>ce(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=v=>{l()&&(c=v.pointerType,v.pointerType==="mouse"&&v.button===0&&!ce(e.shouldSelectOnPressUp)&&o(v))},d=v=>{l()&&v.pointerType==="mouse"&&v.button===0&&ce(e.shouldSelectOnPressUp)&&ce(e.allowsDifferentPressOrigin)&&o(v)},f=v=>{l()&&(ce(e.shouldSelectOnPressUp)&&!ce(e.allowsDifferentPressOrigin)||c!=="mouse")&&o(v)},h=v=>{!l()||!["Enter"," "].includes(v.key)||(iA(v)?n().toggleSelection(r()):o(v))},m=v=>{a()&&v.preventDefault()},p=v=>{const y=t();i()||a()||!y||v.target===y&&n().setFocusedKey(r())},g=q(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),b=q(()=>ce(e.virtualized)?void 0:r());return re(Yt([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([v,y,_,k,x])=>{v&&y===k&&x&&!_&&document.activeElement!==v&&(e.focus?e.focus():xn(v))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:g,dataKey:b,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:m,onFocus:p}}var ice=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index<e.index;(!e||r)&&(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index>e.index;(!e||r)&&(e=n)}return e?.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new ao(n,r,t);for(const o of this.getKeyRange(r,n.currentKey||t))i.delete(o);for(const o of this.getKeyRange(t,r))this.canSelectItem(o)&&i.add(o);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new ao(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new ao([t],t,t):new ao;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new ao;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new ao)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},L7=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function oce(e){const t=Qle(e),r=Yle({dataSource:()=>ce(e.dataSource),getKey:()=>ce(e.getKey),getTextValue:()=>ce(e.getTextValue),getDisabled:()=>ce(e.getDisabled),getSectionChildren:()=>ce(e.getSectionChildren),factory:o=>e.filter?new L7(e.filter(o)):new L7(o)},[()=>e.filter]),i=new ice(r,t);return zc(()=>{const o=t.focusedKey();o!=null&&!r().getItem(o)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var sce=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const i=this.collection().getItem(r);if(i){const o=i.textValue.slice(0,e.length);if(i.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function ace(e,t,n){const r=Bae({usage:"search",sensitivity:"base"}),i=q(()=>{const o=ce(e.keyboardDelegate);return o||new sce(e.collection,t,r)});return rce({selectionManager:()=>ce(e.selectionManager),keyboardDelegate:i,autoFocus:()=>ce(e.autoFocus),deferAutoFocus:()=>ce(e.deferAutoFocus),shouldFocusWrap:()=>ce(e.shouldFocusWrap),disallowEmptySelection:()=>ce(e.disallowEmptySelection),selectOnFocus:()=>ce(e.selectOnFocus),disallowTypeAhead:()=>ce(e.disallowTypeAhead),shouldUseVirtualFocus:()=>ce(e.shouldUseVirtualFocus),allowsTabNavigation:()=>ce(e.allowsTabNavigation),isVirtualized:()=>ce(e.isVirtualized),scrollToKey:o=>ce(e.scrollToKey)?.(o),orientation:()=>ce(e.orientation)},t,n)}var sA=yt();function aA(){return wt(sA)}function lce(){const e=aA();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function lA(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function cce(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const i=e[r]?.ref();if(i&&lA(i,n))return r+1}return 0}function uce(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[o,s])=>{const a=i.ref(),l=s.ref();return a===l||!a||!l?0:lA(a,l)?(r>o&&(n=!0),-1):(r<o&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function cA(e,t){const n=uce(e);e!==n&&t(n)}function dce(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return nr(r).body}function fce(e,t){re(()=>{const n=setTimeout(()=>{cA(e(),t)});ae(()=>clearTimeout(n))})}function hce(e,t){if(typeof IntersectionObserver!="function"){fce(e,t);return}let n=[];re(()=>{const r=()=>{const s=!!n.length;n=e(),s&&cA(e(),t)},i=dce(e()),o=new IntersectionObserver(r,{root:i});for(const s of e()){const a=s.ref();a&&o.observe(a)}ae(()=>o.disconnect())})}function mce(e={}){const[t,n]=$O({value:()=>ce(e.items),onChange:o=>e.onItemsChange?.(o)});hce(t,n);const r=o=>(n(s=>{const a=cce(s,o);return ZD(s,o,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==o.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:o=>C(sA.Provider,{value:{registerItem:r},get children(){return o.children}})}}function pce(e){const t=lce(),n=et({shouldRegisterItem:!0},e);re(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());ae(r)})}function gce(e={}){const[t,n]=pk({value:()=>ce(e.isSelected),defaultValue:()=>!!ce(e.defaultIsSelected),onChange:o=>e.onSelectedChange?.(o)});return{isSelected:t,setIsSelected:o=>{!ce(e.isReadOnly)&&!ce(e.isDisabled)&&n(o)},toggle:()=>{!ce(e.isReadOnly)&&!ce(e.isDisabled)&&n(!t())}}}var vce=yt();function sm(){return wt(vce)}var bce=yt();function uA(){return wt(bce)}var dA=yt();function fA(){return wt(dA)}function Ki(){const e=fA();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var hA=yt();function J4(){const e=wt(hA);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var mA=yt();function ei(){const e=wt(mA);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function X4(e){let t;const n=ei(),r=Ki(),i=et({id:n.generateId(`item-${Mn()}`)},e),[o,s]=pe(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=we(),[c,u]=we(),[d,f]=we(),h=()=>r.listState().selectionManager(),m=()=>s.id,p=()=>h().focusedKey()===m(),g=()=>{o.onSelect?.(),o.closeOnSelect&&setTimeout(()=>{r.close(!0)})};pce({getItem:()=>({ref:()=>t,type:"item",key:m(),textValue:o.textValue??d()?.textContent??t?.textContent??"",disabled:o.disabled??!1})});const b=oA({key:m,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>t),v=L=>{Je(L,o.onPointerMove),L.pointerType==="mouse"&&(o.disabled?r.onItemLeave(L):(r.onItemEnter(L),L.defaultPrevented||(xn(L.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(m()))))},y=L=>{Je(L,o.onPointerLeave),L.pointerType==="mouse"&&r.onItemLeave(L)},_=L=>{Je(L,o.onPointerUp),!o.disabled&&L.button===0&&g()},k=L=>{if(Je(L,o.onKeyDown),!L.repeat&&!o.disabled)switch(L.key){case"Enter":case" ":g();break}},x=q(()=>{if(o.indeterminate)return"mixed";if(o.checked!=null)return o.checked}),I=q(()=>({"data-indeterminate":o.indeterminate?"":void 0,"data-checked":o.checked&&!o.indeterminate?"":void 0,"data-disabled":o.disabled?"":void 0,"data-highlighted":p()?"":void 0})),A={isChecked:()=>o.checked,dataset:I,setLabelRef:f,generateId:Bi(()=>s.id),registerLabel:Gn(l),registerDescription:Gn(u)};return C(hA.Provider,{value:A,get children(){return C(pt,ie({as:"div",ref(L){var $=Nt(H=>t=H,o.ref);typeof $=="function"&&$(L)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return x()},get"aria-disabled"(){return o.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return cn([o.onPointerDown,b.onPointerDown])},get onPointerUp(){return cn([_,b.onPointerUp])},get onClick(){return cn([o.onClick,b.onClick])},get onKeyDown(){return cn([k,b.onKeyDown])},get onMouseDown(){return cn([o.onMouseDown,b.onMouseDown])},get onFocus(){return cn([o.onFocus,b.onFocus])},onPointerMove:v,onPointerLeave:y},I,s))}})}function am(e){const t=et({closeOnSelect:!1},e),[n,r]=pe(t,["checked","defaultChecked","onChange","onSelect"]),i=gce({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:s=>n.onChange?.(s),isDisabled:()=>r.disabled});return C(X4,ie({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{n.onSelect?.(),i.toggle()}},r))}var hu={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>hu.next(e==="ltr"?"rtl":"ltr",t)},A7={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function pA(e){const t=ei(),n=Ki(),r=sm(),{direction:i}=Lo(),o=et({id:t.generateId("trigger")},e),[s,a]=pe(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>t.value()??s.id,r.lastValue()===void 0&&r.setLastValue(l));const c=wu(()=>n.triggerRef(),()=>"button"),u=q(()=>c()==="a"&&n.triggerRef()?.getAttribute("href")!=null);re(Yt(()=>r?.value(),b=>{u()&&b===l()&&n.triggerRef()?.focus()}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=b=>{Je(b,s.onPointerDown),b.currentTarget.dataset.pointerType=b.pointerType,!s.disabled&&b.pointerType!=="touch"&&b.button===0&&d()},h=b=>{Je(b,s.onClick),s.disabled||b.currentTarget.dataset.pointerType==="touch"&&d()},m=b=>{if(Je(b,s.onKeyDown),!s.disabled){if(u())switch(b.key){case"Enter":case" ":return}switch(b.key){case"Enter":case" ":case A7.first(t.orientation()):b.stopPropagation(),b.preventDefault(),mO(b.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case A7.last(t.orientation()):b.stopPropagation(),b.preventDefault(),n.open("last");break;case hu.next(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.nextMenu();break;case hu.previous(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.previousMenu();break}}},p=b=>{Je(b,s.onMouseOver),n.triggerRef()?.dataset.pointerType!=="touch"&&!s.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},g=b=>{Je(b,s.onFocus),r!==void 0&&b.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return re(()=>ae(n.registerTriggerId(s.id))),C(sa,ie({ref(b){var v=Nt(n.setTriggerRef,s.ref);typeof v=="function"&&v(b)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return it(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&r?.value()===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:p,onClick:h,onKeyDown:m,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}function gA(e){let t;const n=ei(),r=Ki(),i=sm(),o=uA(),{direction:s}=Lo(),a=et({id:n.generateId(`content-${Mn()}`)},e),[l,c]=pe(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=ace({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);fk({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:y=>{i===void 0&&l.onOpenAutoFocus?.(y)},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=y=>{if(dn(y.currentTarget,y.target)&&(y.key==="Tab"&&r.isOpen()&&y.preventDefault(),i!==void 0&&y.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(y.key){case hu.next(s(),n.orientation()):y.stopPropagation(),y.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case hu.previous(s(),n.orientation()):if(y.currentTarget.hasAttribute("data-closed"))break;y.stopPropagation(),y.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},m=y=>{l.onEscapeKeyDown?.(y),i?.setAutoFocusMenu(!1),r.close(!0)},p=y=>{l.onFocusOutside?.(y),n.isModal()&&y.preventDefault()},g=y=>{Je(y,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},b=y=>{if(Je(y,l.onPointerMove),y.pointerType!=="mouse")return;const _=y.target,k=u!==y.clientX;dn(y.currentTarget,_)&&k&&(r.setPointerDir(y.clientX>u?"right":"left"),u=y.clientX)};re(()=>ae(r.registerContentId(l.id))),ae(()=>r.setContentRef(void 0));const v={ref:Nt(y=>{r.setContentRef(y),t=y},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:cn([l.onKeyDown,f.onKeyDown,h]),onMouseDown:cn([l.onMouseDown,f.onMouseDown]),onFocusIn:cn([l.onFocusIn,f.onFocusIn]),onFocusOut:cn([l.onFocusOut,f.onFocusOut]),onPointerEnter:g,onPointerMove:b,get"data-orientation"(){return n.orientation()}};return C(Ce,{get when(){return r.contentPresent()},get children(){return C(Ce,{get when(){return o===void 0||r.parentMenuContext()!=null},get fallback(){return C(pt,ie({as:"div"},()=>r.dataset(),v,c))},get children(){return C(Wl.Positioner,{get children(){return C(X0,ie({get disableOutsidePointerEvents(){return it(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return _i({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:m,onFocusOutside:p,get onDismiss(){return r.close}},()=>r.dataset(),v,c))}})}})}})}function vA(e){let t;const n=ei(),r=Ki(),[i,o]=pe(e,["ref"]);return gk({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),C(gA,ie({ref(s){var a=Nt(l=>{t=l},i.ref);typeof a=="function"&&a(s)}},o))}var bA=yt();function yce(){const e=wt(bA);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Ju(e){const t=ei(),n=et({id:t.generateId(`group-${Mn()}`)},e),[r,i]=we(),o={generateId:Bi(()=>n.id),registerLabelId:Gn(i)};return C(bA.Provider,{value:o,get children(){return C(pt,ie({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function lm(e){const t=yce(),n=et({id:t.generateId("label")},e),[r,i]=pe(n,["id"]);return re(()=>ae(t.registerLabelId(r.id))),C(pt,ie({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function cm(e){const t=Ki(),n=et({children:"▼"},e);return C(pt,ie({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function um(e){return C(X4,ie({role:"menuitem",closeOnSelect:!0},e))}function dm(e){const t=J4(),n=et({id:t.generateId("description")},e),[r,i]=pe(n,["id"]);return re(()=>ae(t.registerDescription(r.id))),C(pt,ie({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function fm(e){const t=J4(),n=et({id:t.generateId("indicator")},e),[r,i]=pe(n,["forceMount"]);return C(Ce,{get when(){return r.forceMount||t.isChecked()},get children(){return C(pt,ie({as:"div"},()=>t.dataset(),i))}})}function hm(e){const t=J4(),n=et({id:t.generateId("label")},e),[r,i]=pe(n,["ref","id"]);return re(()=>ae(t.registerLabel(r.id))),C(pt,ie({as:"div",ref(o){var s=Nt(t.setLabelRef,r.ref);typeof s=="function"&&s(o)},get id(){return r.id}},()=>t.dataset(),i))}function mm(e){const t=Ki();return C(Ce,{get when(){return t.contentPresent()},get children(){return C(ia,e)}})}var yA=yt();function wce(){const e=wt(yA);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function pm(e){const n=ei().generateId(`radiogroup-${Mn()}`),r=et({id:n},e),[i,o]=pe(r,["value","defaultValue","onChange","disabled"]),[s,a]=yu({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>i.onChange?.(c)}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===s(),setSelectedValue:c=>a(c)};return C(yA.Provider,{value:l,get children(){return C(Ju,o)}})}function gm(e){const t=wce(),n=et({closeOnSelect:!1},e),[r,i]=pe(n,["value","onSelect"]);return C(X4,ie({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},i))}function kce(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),o=[],s=t.clientX,a=t.clientY;switch(r){case"top":o.push([s,a+5]),o.push([i.left,i.bottom]),o.push([i.left,i.top]),o.push([i.right,i.top]),o.push([i.right,i.bottom]);break;case"right":o.push([s-5,a]),o.push([i.left,i.top]),o.push([i.right,i.top]),o.push([i.right,i.bottom]),o.push([i.left,i.bottom]);break;case"bottom":o.push([s,a-5]),o.push([i.right,i.top]),o.push([i.right,i.bottom]),o.push([i.left,i.bottom]),o.push([i.left,i.top]);break;case"left":o.push([s+5,a]),o.push([i.right,i.bottom]),o.push([i.left,i.bottom]),o.push([i.left,i.top]),o.push([i.right,i.top]);break}return o}function xce(e,t){return t?Ev([e.clientX,e.clientY],t):!1}function wA(e){const t=ei(),n=aA(),r=fA(),i=sm(),o=uA(),s=et({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=pe(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[f,h]=we(),[m,p]=we(),[g,b]=we(),[v,y]=we(),[_,k]=we(!0),[x,I]=we(l.placement),[A,L]=we([]),[$,H]=we([]),{DomCollectionProvider:j}=mce({items:$,onItemsChange:H}),M=oa({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:xe=>a.onOpenChange?.(xe)}),{present:T}=Fs({show:()=>t.forceMount()||M.isOpen(),element:()=>v()??null}),E=oce({selectionMode:"none",dataSource:$}),D=xe=>{k(xe),M.open()},F=(xe=!1)=>{M.close(),xe&&r&&r.close(!0)},G=xe=>{k(xe),M.toggle()},U=()=>{const xe=v();xe&&(xn(xe),E.selectionManager().setFocused(!0),E.selectionManager().setFocusedKey(void 0))},Z=()=>{o!=null?setTimeout(()=>U()):U()},Y=xe=>{L(lt=>[...lt,xe]);const Ue=r?.registerNestedMenu(xe);return()=>{L(lt=>xg(lt,xe)),Ue?.()}},ee=xe=>d===u?.side&&xce(xe,u?.area),oe=xe=>{ee(xe)&&xe.preventDefault()},fe=xe=>{ee(xe)||Z()},Se=xe=>{ee(xe)&&xe.preventDefault()};hk({isDisabled:()=>!(r==null&&M.isOpen()&&t.isModal()),targets:()=>[v(),...A()].filter(Boolean)}),re(()=>{const xe=v();if(!xe||!r)return;const Ue=r.registerNestedMenu(xe);ae(()=>{Ue()})}),re(()=>{r===void 0&&i?.registerMenu(t.value(),[v(),...A()])}),re(()=>{r!==void 0||i===void 0||(i.value()===t.value()?(g()?.focus(),i.autoFocusMenu()&&D(!0)):F())}),re(()=>{r!==void 0||i===void 0||M.isOpen()&&i.setValue(t.value())}),ae(()=>{r===void 0&&i?.unregisterMenu(t.value())});const Ae={dataset:q(()=>({"data-expanded":M.isOpen()?"":void 0,"data-closed":M.isOpen()?void 0:""})),isOpen:M.isOpen,contentPresent:T,nestedMenus:A,currentPlacement:x,pointerGraceTimeoutId:()=>c,autoFocus:_,listState:()=>E,parentMenuContext:()=>r,triggerRef:g,contentRef:v,triggerId:f,contentId:m,setTriggerRef:b,setContentRef:y,open:D,close:F,toggle:G,focusContent:Z,onItemEnter:oe,onItemLeave:fe,onTriggerLeave:Se,setPointerDir:xe=>d=xe,setPointerGraceTimeoutId:xe=>c=xe,setPointerGraceIntent:xe=>u=xe,registerNestedMenu:Y,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:Gn(h),registerContentId:Gn(p)};return C(j,{get children(){return C(dA.Provider,{value:Ae,get children(){return C(Ce,{when:o===void 0,get fallback(){return l.children},get children(){return C(Wl,ie({anchorRef:g,contentRef:v,onCurrentPlacementChange:I},l))}})}})}})}function vm(e){const{direction:t}=Lo();return C(wA,ie({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Sce={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function bm(e){const t=Ki(),n=ei(),[r,i]=pe(e,["onFocusOutside","onKeyDown"]),{direction:o}=Lo();return C(gA,ie({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{r.onFocusOutside?.(u);const d=u.target;dn(t.triggerRef(),d)||t.close()},onKeyDown:u=>{Je(u,r.onKeyDown);const d=dn(u.currentTarget,u.target),f=Sce.close(o(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),xn(t.triggerRef()))}},i))}var M7=["Enter"," "],_ce={open:(e,t)=>e==="ltr"?[...M7,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...M7,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function ym(e){let t;const n=ei(),r=Ki(),i=et({id:n.generateId(`sub-trigger-${Mn()}`)},e),[o,s]=pe(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=Lo(),u=()=>o.id,d=()=>{const y=r.parentMenuContext();if(y==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return y.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===u(),m=oA({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>t),p=y=>{Je(y,o.onClick),!r.isOpen()&&!o.disabled&&r.open(!0)},g=y=>{if(Je(y,o.onPointerMove),y.pointerType!=="mouse")return;const _=r.parentMenuContext();if(_?.onItemEnter(y),!y.defaultPrevented){if(o.disabled){_?.onItemLeave(y);return}!r.isOpen()&&!a&&(r.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),_?.onItemEnter(y),y.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),xn(y.currentTarget),_?.listState().selectionManager().setFocused(!0),_?.listState().selectionManager().setFocusedKey(u()))}},b=y=>{if(Je(y,o.onPointerLeave),y.pointerType!=="mouse")return;l();const _=r.parentMenuContext(),k=r.contentRef();if(k){_?.setPointerGraceIntent({area:kce(r.currentPlacement(),y,k),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(_?.pointerGraceTimeoutId());const x=window.setTimeout(()=>{_?.setPointerGraceIntent(null)},300);_?.setPointerGraceTimeoutId(x)}else{if(_?.onTriggerLeave(y),y.defaultPrevented)return;_?.setPointerGraceIntent(null)}_?.onItemLeave(y)},v=y=>{Je(y,o.onKeyDown),!y.repeat&&(o.disabled||_ce.open(c(),n.orientation()).includes(y.key)&&(y.stopPropagation(),y.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return re(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const y=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:o.textValue??t?.textContent??"",disabled:o.disabled??!1});ae(y)}),re(Yt(()=>r.parentMenuContext()?.pointerGraceTimeoutId(),y=>{ae(()=>{window.clearTimeout(y),r.parentMenuContext()?.setPointerGraceIntent(null)})})),re(()=>ae(r.registerTriggerId(o.id))),ae(()=>{l()}),C(pt,ie({as:"div",ref(y){var _=Nt(k=>{r.setTriggerRef(k),t=k},o.ref);typeof _=="function"&&_(y)},get id(){return o.id},role:"menuitem",get tabIndex(){return m.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return it(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return o.disabled},get"data-key"(){return m.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return o.disabled?"":void 0},get onPointerDown(){return cn([o.onPointerDown,m.onPointerDown])},get onPointerUp(){return cn([o.onPointerUp,m.onPointerUp])},get onClick(){return cn([p,m.onClick])},get onKeyDown(){return cn([v,m.onKeyDown])},get onMouseDown(){return cn([o.onMouseDown,m.onMouseDown])},get onFocus(){return cn([o.onFocus,m.onFocus])},onPointerMove:g,onPointerLeave:b},()=>r.dataset(),s))}function kA(e){const t=sm(),n=`menu-${Mn()}`,r=et({id:n,modal:!0},e),[i,o]=pe(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),s=oa({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>i.onOpenChange?.(l)}),a={isModal:()=>i.modal??!0,preventScroll:()=>i.preventScroll??a.isModal(),forceMount:()=>i.forceMount??!1,generateId:Bi(()=>i.id),value:()=>i.value,orientation:()=>i.orientation??t?.orientation()??"horizontal"};return C(mA.Provider,{value:a,get children(){return C(wA,ie({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},o))}})}var Cce={};Ci(Cce,{Root:()=>Gl,Separator:()=>Ice});function Gl(e){let t;const n=et({orientation:"horizontal"},e),[r,i]=pe(n,["ref","orientation"]),o=wu(()=>t,()=>"hr");return C(pt,ie({as:"hr",ref(s){var a=Nt(l=>t=l,r.ref);typeof a=="function"&&a(s)},get role(){return o()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var Ice=Gl,Ece={};Ci(Ece,{Arrow:()=>Mo,CheckboxItem:()=>am,Content:()=>xA,DropdownMenu:()=>hn,Group:()=>Ju,GroupLabel:()=>lm,Icon:()=>cm,Item:()=>um,ItemDescription:()=>dm,ItemIndicator:()=>fm,ItemLabel:()=>hm,Portal:()=>mm,RadioGroup:()=>pm,RadioItem:()=>gm,Root:()=>SA,Separator:()=>Gl,Sub:()=>vm,SubContent:()=>bm,SubTrigger:()=>ym,Trigger:()=>pA});function xA(e){const t=ei(),n=Ki(),[r,i]=pe(e,["onCloseAutoFocus","onInteractOutside"]);let o=!1;return C(vA,ie({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),o||xn(n.triggerRef()),o=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(o=!0)}},i))}function SA(e){const t=`dropdownmenu-${Mn()}`,n=et({id:t},e);return C(kA,n)}var hn=Object.assign(SA,{Arrow:Mo,CheckboxItem:am,Content:xA,Group:Ju,GroupLabel:lm,Icon:cm,Item:um,ItemDescription:dm,ItemIndicator:fm,ItemLabel:hm,Portal:mm,RadioGroup:pm,RadioItem:gm,Separator:Gl,Sub:vm,SubContent:bm,SubTrigger:ym,Trigger:pA});function Tce(e){return C(hn,ie(e,{"data-component":"dropdown-menu"}))}function $ce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.Trigger,ie(n,{"data-slot":"dropdown-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Lce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.Icon,ie(n,{"data-slot":"dropdown-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Ace(e){return C(hn.Portal,e)}function Mce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.Content,ie(n,{"data-component":"dropdown-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Dce(e){const[t,n]=pe(e,["class","classList"]);return C(hn.Arrow,ie(n,{"data-slot":"dropdown-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function Oce(e){const[t,n]=pe(e,["class","classList"]);return C(hn.Separator,ie(n,{"data-slot":"dropdown-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function Pce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.Group,ie(n,{"data-slot":"dropdown-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Rce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.GroupLabel,ie(n,{"data-slot":"dropdown-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Nce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.Item,ie(n,{"data-slot":"dropdown-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function zce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.ItemLabel,ie(n,{"data-slot":"dropdown-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function jce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.ItemDescription,ie(n,{"data-slot":"dropdown-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Fce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.ItemIndicator,ie(n,{"data-slot":"dropdown-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Hce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.RadioGroup,ie(n,{"data-slot":"dropdown-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Vce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.RadioItem,ie(n,{"data-slot":"dropdown-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Uce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.CheckboxItem,ie(n,{"data-slot":"dropdown-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Bce(e){return C(hn.Sub,e)}function qce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.SubTrigger,ie(n,{"data-slot":"dropdown-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Wce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.SubContent,ie(n,{"data-component":"dropdown-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const Bt=Object.assign(Tce,{Trigger:$ce,Icon:Lce,Portal:Ace,Content:Mce,Arrow:Dce,Separator:Oce,Group:Pce,GroupLabel:Rce,Item:Nce,ItemLabel:zce,ItemDescription:jce,ItemIndicator:Fce,RadioGroup:Hce,RadioItem:Vce,CheckboxItem:Uce,Sub:Bce,SubTrigger:qce,SubContent:Wce});var Gce=me("<div>"),wm=class{x;y;width;height;constructor(t){this.x=Math.floor(t.x),this.y=Math.floor(t.y),this.width=Math.floor(t.width),this.height=Math.floor(t.height)}get rect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get center(){return{x:this.x+this.width*.5,y:this.y+this.height*.5}}get corners(){return{topLeft:{x:this.left,y:this.top},topRight:{x:this.right,y:this.top},bottomRight:{x:this.left,y:this.bottom},bottomLeft:{x:this.right,y:this.bottom}}}},sl=e=>{let t=new wm(e.getBoundingClientRect());const{transform:n}=getComputedStyle(e);return n&&(t=Zce(t,n)),t},Zce=(e,t)=>{let n,r;if(t.startsWith("matrix3d(")){const i=t.slice(9,-1).split(/, /);n=+i[12],r=+i[13]}else if(t.startsWith("matrix(")){const i=t.slice(7,-1).split(/, /);n=+i[4],r=+i[5]}else n=0,r=0;return new wm({...e,x:e.x-n,y:e.y-r})},hi=()=>({x:0,y:0}),Q4=(e,t)=>e.x===t.x&&e.y===t.y,ug=(e,t)=>new wm({...e,x:e.x+t.x,y:e.y+t.y}),Kce=(e,t)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),Yce=(e,t)=>{const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.right,t.right),o=Math.min(e.bottom,t.bottom),s=i-r,a=o-n;if(r<i&&n<o){const l=e.width*e.height,c=t.width*t.height,u=s*a;return u/(l+c-u)}return 0},dg=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,_A=(e,t,n)=>{const r=e.transformed.center,i={distance:1/0,droppable:null};for(const o of t){const s=Kce(r,o.layout.center);s<i.distance?(i.distance=s,i.droppable=o):s===i.distance&&o.id===n.activeDroppableId&&(i.droppable=o)}return i.droppable},Jce=(e,t,n)=>{const r=e.transformed,i={ratio:0,droppable:null};for(const o of t){const s=Yce(r,o.layout);s>i.ratio?(i.ratio=s,i.droppable=o):s>0&&s===i.ratio&&o.id===n.activeDroppableId&&(i.droppable=o)}return i.droppable},CA=yt(),IA=e=>{const t=ie({collisionDetector:Jce},e),[n,r]=qe({draggables:{},droppables:{},sensors:{},active:{draggableId:null,get draggable(){return n.active.draggableId!==null?n.draggables[n.active.draggableId]:null},droppableId:null,get droppable(){return n.active.droppableId!==null?n.droppables[n.active.droppableId]:null},sensorId:null,get sensor(){return n.active.sensorId!==null?n.sensors[n.active.sensorId]:null},overlay:null}}),i=(T,E,D)=>{T.substring(0,T.length-1),Ye(()=>n[T][E])&&r(T,E,"transformers",D.id,D)},o=(T,E,D)=>{T.substring(0,T.length-1),Ye(()=>n[T][E])&&Ye(()=>n[T][E].transformers[D])&&r(T,E,"transformers",D,void 0)},s=({id:T,node:E,layout:D,data:F})=>{const G=n.draggables[T],U={id:T,node:E,layout:D,data:F,_pendingCleanup:!1};let Z;if(!G)Object.defineProperties(U,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{if(n.active.overlay)return hi();const Y=Object.values(n.draggables[T].transformers);return Y.sort((ee,oe)=>ee.order-oe.order),Y.reduce((ee,oe)=>oe.callback(ee),hi())}},transformed:{enumerable:!0,configurable:!0,get:()=>ug(n.draggables[T].layout,n.draggables[T].transform)}});else if(n.active.draggableId===T&&!n.active.overlay){const Y={x:G.layout.x-D.x,y:G.layout.y-D.y},ee="addDraggable-existing-offset",oe=G.transformers[ee],fe=oe?oe.callback(Y):Y;Z={id:ee,order:100,callback:Se=>({x:Se.x+fe.x,y:Se.y+fe.y})},H(()=>o("draggables",T,ee))}rt(()=>{r("draggables",T,U),Z&&i("draggables",T,Z)}),n.active.draggable&&_()},a=T=>{Ye(()=>n.draggables[T])&&(r("draggables",T,"_pendingCleanup",!0),queueMicrotask(()=>l(T)))},l=T=>{if(n.draggables[T]?._pendingCleanup){const E=n.active.draggableId===T;rt(()=>{E&&r("active","draggableId",null),r("draggables",T,void 0)})}},c=({id:T,node:E,layout:D,data:F})=>{const G=n.droppables[T],U={id:T,node:E,layout:D,data:F,_pendingCleanup:!1};G||Object.defineProperties(U,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{const Z=Object.values(n.droppables[T].transformers);return Z.sort((Y,ee)=>Y.order-ee.order),Z.reduce((Y,ee)=>ee.callback(Y),hi())}},transformed:{enumerable:!0,configurable:!0,get:()=>ug(n.droppables[T].layout,n.droppables[T].transform)}}),r("droppables",T,U),n.active.draggable&&_()},u=T=>{Ye(()=>n.droppables[T])&&(r("droppables",T,"_pendingCleanup",!0),queueMicrotask(()=>d(T)))},d=T=>{if(n.droppables[T]?._pendingCleanup){const E=n.active.droppableId===T;rt(()=>{E&&r("active","droppableId",null),r("droppables",T,void 0)})}},f=({id:T,activators:E})=>{r("sensors",T,{id:T,activators:E,coordinates:{origin:{x:0,y:0},current:{x:0,y:0},get delta(){return{x:n.sensors[T].coordinates.current.x-n.sensors[T].coordinates.origin.x,y:n.sensors[T].coordinates.current.y-n.sensors[T].coordinates.origin.y}}}})},h=T=>{if(!Ye(()=>n.sensors[T]))return;const E=n.active.sensorId===T;rt(()=>{E&&r("active","sensorId",null),r("sensors",T,void 0)})},m=({node:T,layout:E})=>{const D=n.active.overlay,F={node:T,layout:E};D||Object.defineProperties(F,{id:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.id},data:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.data},transformers:{enumerable:!0,configurable:!0,get:()=>Object.fromEntries(Object.entries(n.active.draggable?n.active.draggable.transformers:{}).filter(([G])=>G!=="addDraggable-existing-offset"))},transform:{enumerable:!0,configurable:!0,get:()=>{const G=Object.values(n.active.overlay?n.active.overlay.transformers:[]);return G.sort((U,Z)=>U.order-Z.order),G.reduce((U,Z)=>Z.callback(U),hi())}},transformed:{enumerable:!0,configurable:!0,get:()=>n.active.overlay?ug(n.active.overlay.layout,n.active.overlay.transform):new wm({x:0,y:0,width:0,height:0})}}),r("active","overlay",F)},p=()=>r("active","overlay",null),g=(T,E)=>{rt(()=>{r("sensors",T,"coordinates",{origin:{...E},current:{...E}}),r("active","sensorId",T)})},b=T=>{const E=n.active.sensorId;E&&r("sensors",E,"coordinates","current",{...T})},v=()=>r("active","sensorId",null),y=(T,E)=>{const D={};for(const G of Object.values(n.sensors))if(G)for(const[U,Z]of Object.entries(G.activators))D[U]??=[],D[U].push({sensor:G,activator:Z});const F={};for(const G in D){let U=G;E&&(U=`on${G}`),F[U]=Z=>{for(const{activator:Y}of D[G]){if(n.active.sensor)break;Y(Z,T)}}}return F},_=()=>{let T=!1;const E=Object.values(n.draggables),D=Object.values(n.droppables),F=n.active.overlay;return rt(()=>{const G=new WeakMap;for(const U of E)if(U){const Z=U.layout;G.has(U.node)||G.set(U.node,sl(U.node));const Y=G.get(U.node);dg(Z,Y)||(r("draggables",U.id,"layout",Y),T=!0)}for(const U of D)if(U){const Z=U.layout;G.has(U.node)||G.set(U.node,sl(U.node));const Y=G.get(U.node);dg(Z,Y)||(r("droppables",U.id,"layout",Y),T=!0)}if(F){const U=F.layout,Z=sl(F.node);dg(U,Z)||(r("active","overlay","layout",Z),T=!0)}}),T},k=()=>{const T=n.active.overlay??n.active.draggable;if(T){const E=t.collisionDetector(T,Object.values(n.droppables),{activeDroppableId:n.active.droppableId}),D=E?E.id:null;n.active.droppableId!==D&&r("active","droppableId",D)}},x=T=>{const E={id:"sensorMove",order:0,callback:D=>n.active.sensor?{x:D.x+n.active.sensor.coordinates.delta.x,y:D.y+n.active.sensor.coordinates.delta.y}:D};_(),rt(()=>{r("active","draggableId",T),i("draggables",T,E)}),k()},I=()=>{const T=Ye(()=>n.active.draggableId);rt(()=>{T!==null&&o("draggables",T,"sensorMove"),r("active",["draggableId","droppableId"],null)}),_()},A=T=>{re(()=>{const E=n.active.draggable;E&&Ye(()=>T({draggable:E}))})},L=T=>{re(()=>{const E=n.active.draggable;if(E){const D=Ye(()=>n.active.overlay);Object.values(D?D.transform:E.transform),Ye(()=>T({draggable:E,overlay:D}))}})},$=T=>{re(()=>{const E=n.active.draggable,D=n.active.droppable;E&&Ye(()=>T({draggable:E,droppable:D,overlay:n.active.overlay}))})},H=T=>{re(({previousDraggable:E,previousDroppable:D,previousOverlay:F})=>{const G=n.active.draggable,U=G?n.active.droppable:null,Z=G?n.active.overlay:null;return!G&&E&&Ye(()=>T({draggable:E,droppable:D,overlay:F})),{previousDraggable:G,previousDroppable:U,previousOverlay:Z}},{previousDraggable:null,previousDroppable:null,previousOverlay:null})};L(()=>k()),t.onDragStart&&A(t.onDragStart),t.onDragMove&&L(t.onDragMove),t.onDragOver&&$(t.onDragOver),t.onDragEnd&&H(t.onDragEnd);const M=[n,{addTransformer:i,removeTransformer:o,addDraggable:s,removeDraggable:a,addDroppable:c,removeDroppable:u,addSensor:f,removeSensor:h,setOverlay:m,clearOverlay:p,recomputeLayouts:_,detectCollisions:k,draggableActivators:y,sensorStart:g,sensorMove:b,sensorEnd:v,dragStart:x,dragEnd:I,onDragStart:A,onDragMove:L,onDragOver:$,onDragEnd:H}];return C(CA.Provider,{value:M,get children(){return t.children}})},ga=()=>wt(CA)||null,Xce=(e="pointer-sensor")=>{const[t,{addSensor:n,removeSensor:r,sensorStart:i,sensorMove:o,sensorEnd:s,dragStart:a,dragEnd:l}]=ga(),c=250,u=10;Pt(()=>{n({id:e,activators:{pointerdown:p}})}),ae(()=>{r(e)});const d=()=>t.active.sensorId===e,f={x:0,y:0};let h=null,m=null;const p=(k,x)=>{k.button===0&&(document.addEventListener("pointermove",v),document.addEventListener("pointerup",y),m=x,f.x=k.clientX,f.y=k.clientY,h=window.setTimeout(b,c))},g=()=>{h&&(clearTimeout(h),h=null),document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",y),document.removeEventListener("selectionchange",_)},b=()=>{t.active.sensor?d()||g():(i(e,f),a(m),_(),document.addEventListener("selectionchange",_))},v=k=>{const x={x:k.clientX,y:k.clientY};if(!t.active.sensor){const I={x:x.x-f.x,y:x.y-f.y};Math.sqrt(I.x**2+I.y**2)>u&&b()}d()&&(k.preventDefault(),o(x))},y=k=>{g(),d()&&(k.preventDefault(),l(),s())},_=()=>{window.getSelection()?.removeAllRanges()}},EA=e=>(Xce(),it(()=>e.children)),km=e=>({transform:`translate3d(${e.x}px, ${e.y}px, 0)`}),Qce=(e,t={})=>{const[n,{addDraggable:r,removeDraggable:i,draggableActivators:o}]=ga(),[s,a]=we(null);Pt(()=>{const d=s();d&&r({id:e,node:d,layout:sl(d),data:t})}),ae(()=>i(e));const l=()=>n.active.draggableId===e,c=()=>n.draggables[e]?.transform||hi();return Object.defineProperties((d,f)=>{const h=f?f():{};re(()=>{const m=s(),p=o(e);if(m)for(const g in p)m.addEventListener(g,p[g]);ae(()=>{if(m)for(const g in p)m.removeEventListener(g,p[g])})}),a(d),h.skipTransform||re(()=>{const m=c();if(Q4(m,hi()))d.style.removeProperty("transform");else{const p=km(c());d.style.setProperty("transform",p.transform??null)}})},{ref:{enumerable:!0,value:a},isActiveDraggable:{enumerable:!0,get:l},dragActivators:{enumerable:!0,get:()=>o(e,!0)},transform:{enumerable:!0,get:c}})},eue=(e,t={})=>{const[n,{addDroppable:r,removeDroppable:i}]=ga(),[o,s]=we(null);Pt(()=>{const u=o();u&&r({id:e,node:u,layout:sl(u),data:t})}),ae(()=>i(e));const a=()=>n.active.droppableId===e,l=()=>n.droppables[e]?.transform||hi();return Object.defineProperties((u,d)=>{const f=d?d():{};s(u),f.skipTransform||re(()=>{const h=l();if(Q4(h,hi()))u.style.removeProperty("transform");else{const m=km(l());u.style.setProperty("transform",m.transform??null)}})},{ref:{enumerable:!0,value:s},isActiveDroppable:{enumerable:!0,get:a},transform:{enumerable:!0,get:l}})},TA=e=>{const[t,{onDragStart:n,onDragEnd:r,setOverlay:i,clearOverlay:o}]=ga();let s;n(({draggable:l})=>{i({node:l.node,layout:l.layout}),queueMicrotask(()=>{if(s){const c=sl(s),u={x:(l.layout.width-c.width)/2,y:(l.layout.height-c.height)/2};c.x+=u.x,c.y+=u.y,i({node:s,layout:c})}})}),r(()=>queueMicrotask(o));const a=()=>{const l=t.active.overlay,c=t.active.draggable;return!l||!c?{}:{position:"fixed",transition:"transform 0s",top:`${l.layout.top}px`,left:`${l.layout.left}px`,"min-width":`${c.layout.width}px`,"min-height":`${c.layout.height}px`,...km(l.transform),...e.style}};return C(ia,{get mount(){return document.body},get children(){return C(Ce,{get when(){return t.active.draggable},get children(){var l=Gce(),c=s;return typeof c=="function"?Cr(c,l):s=l,X(l,(()=>{var u=it(()=>typeof e.children=="function");return()=>u()?e.children(t.active.draggable):e.children})()),Ve(u=>{var d=e.class,f=a();return d!==u.e&&bu(l,u.e=d),u.t=wv(l,f,u.t),u},{e:void 0,t:void 0}),l}})}})},tue=(e,t,n)=>{const r=e.slice();return r.splice(n,0,...r.splice(t,1)),r},$A=yt(),LA=e=>{const[t]=ga(),[n,r]=qe({initialIds:[],sortedIds:[]}),i=a=>a>=0&&a<n.initialIds.length;re(()=>{r("initialIds",[...e.ids]),r("sortedIds",[...e.ids])}),re(()=>{t.active.draggableId&&t.active.droppableId?Ye(()=>{const a=n.sortedIds.indexOf(t.active.draggableId),l=n.initialIds.indexOf(t.active.droppableId);if(!i(a)||!i(l))r("sortedIds",[...e.ids]);else if(a!==l){const c=tue(n.sortedIds,a,l);r("sortedIds",c)}}):r("sortedIds",[...e.ids])});const s=[n,{}];return C($A.Provider,{value:s,get children(){return e.children}})},nue=()=>wt($A)||null,rue=(e,t)=>n=>{e(n),t(n)},AA=(e,t={})=>{const[n,{addTransformer:r,removeTransformer:i}]=ga(),[o]=nue(),s=Qce(e,t),a=eue(e,t),l=rue(s.ref,a.ref),c=()=>o.initialIds.indexOf(e),u=()=>o.sortedIds.indexOf(e),d=g=>n.droppables[g]?.layout||null,f=()=>{const g=hi(),b=c(),v=u();if(v!==b){const y=d(e),_=d(o.initialIds[v]);y&&_&&(g.x=_.x-y.x,g.y=_.y-y.y)}return g},h={id:"sortableOffset",order:100,callback:g=>{const b=f();return{x:g.x+b.x,y:g.y+b.y}}};Pt(()=>r("droppables",e,h)),ae(()=>i("droppables",e,h.id));const m=()=>(e===n.active.draggableId&&!n.active.overlay?n.draggables[e]?.transform:n.droppables[e]?.transform)||hi();return Object.defineProperties(g=>{s(g,()=>({skipTransform:!0})),a(g,()=>({skipTransform:!0})),re(()=>{const b=m();if(Q4(b,hi()))g.style.removeProperty("transform");else{const v=km(m());g.style.setProperty("transform",v.transform??null)}})},{ref:{enumerable:!0,value:l},transform:{enumerable:!0,get:m},isActiveDraggable:{enumerable:!0,get:()=>s.isActiveDraggable},dragActivators:{enumerable:!0,get:()=>s.dragActivators},isActiveDroppable:{enumerable:!0,get:()=>a.isActiveDroppable}})};function iue(e){const t={locs:[],timer:void 0,pending:void 0,over:void 0,last:void 0},n=e.delay??250,r=e.max??4,i=e.tolerance??80,o=e.edge??18,s=()=>{t.timer!==void 0&&clearTimeout(t.timer),t.timer=void 0,t.pending=void 0},a=()=>{s(),t.over=void 0,t.last=void 0,t.locs.length=0},l=m=>{if(!e.enabled())return;const p=e.el();if(!p)return;const g=p.getBoundingClientRect(),b=m.clientX,v=m.clientY;b<g.left||b>g.right||v<g.top||v>g.bottom||(t.locs.push({x:b,y:v}),t.locs.length>r&&t.locs.shift())},c=()=>{if(!e.enabled()||!e.active())return 0;const m=e.el();if(!m||t.locs.length<2)return 0;const p=m.getBoundingClientRect(),g=t.locs[t.locs.length-1];if(!g)return 0;const b=t.locs[0]??g;if(b.x<p.left||b.x>p.right||b.y<p.top||b.y>p.bottom||t.last&&g.x===t.last.x&&g.y===t.last.y)return 0;if(p.right-g.x<=o)return t.last=g,n;const v={x:p.right,y:p.top-i},y={x:p.right,y:p.bottom+i},_=(L,$)=>($.y-L.y)/($.x-L.x),k=_(g,v),x=_(g,y),I=_(b,v),A=_(b,y);return k<I&&x>A?(t.last=g,n):(t.last=void 0,0)},u=m=>{s(),e.onActivate(m)},d=m=>{if(!m||e.active()===m)return;if(!e.active()){u(m);return}const p=c();if(p===0){u(m);return}s(),t.pending=m,t.timer=window.setTimeout(()=>{t.timer=void 0,t.pending===m&&(t.pending=void 0,e.enabled()&&e.active()&&t.over===m&&e.onActivate(m))},p)};return{move:l,enter:(m,p)=>{e.enabled()&&(t.over=m,l(p),d(m))},leave:m=>{t.over===m&&(t.over=void 0),t.pending===m&&s()},activate:u,request:d,cancel:s,reset:a}}let yv;const oue=e=>{yv=e},sue=e=>{if(window.focus(),!!e){if(yv)return yv(e);console.warn("notification-click: navigate function not set, falling back to window.location.assign"),window.location.assign(e)}},cc=e=>e.replace(/[\\/]+$/,""),Da=new Map,Oa=new Map;function aue(){const e={resolve:n=>{}};return{promise:new Promise(n=>{e.resolve=n}),resolve:e.resolve}}const cf={get(e){return Da.get(cc(e))},pending(e){const t=cc(e),n=Da.get(t);n&&n.status!=="pending"||Da.set(t,{status:"pending"})},ready(e){const t=cc(e),n={status:"ready"};Da.set(t,n);const r=Oa.get(t);r&&(Oa.delete(t),r.resolve(n))},failed(e,t){const n=cc(e),r={status:"failed",message:t};Da.set(n,r);const i=Oa.get(n);i&&(Oa.delete(n),i.resolve(r))},wait(e){const t=cc(e),n=Da.get(t);if(n&&n.status!=="pending")return Promise.resolve(n);const r=Oa.get(t);if(r)return r.promise;const i=aue();return Oa.set(t,i),i.promise}},lue=40,mu={session:new Map,terminal:new Map},MA=(e,t,n)=>{for(e.delete(t),e.set(t,n);e.size>lue;){const r=e.keys().next().value;if(r===void 0)return;e.delete(r)}},cue=(e,t)=>{const n=mu.session.get(e)??{prompt:"",files:{}};MA(mu.session,e,{...n,...t})},The=e=>mu.session.get(e),$he=(e,t)=>{MA(mu.terminal,e,t)},Lhe=e=>mu.terminal.get(e),uue=e=>typeof e!="object"||e===null?!1:"draggable"in e,W0=e=>{if(!uue(e))return;const t=e.draggable;if(t)return typeof t.id=="string"?t.id:void 0},due=(e,t)=>({id:e,order:100,callback:n=>t==="x"?{...n,x:0}:{...n,y:0}}),DA=(e,t)=>()=>{const n=ga();if(!n)return null;const[,{onDragStart:r,onDragEnd:i,addTransformer:o,removeTransformer:s}]=n,a=due(t,e),l=An(c=>(r(u=>{const d=W0(u);d&&o("draggables",d,a)}),i(u=>{const d=W0(u);d&&s("draggables",d,a.id)}),c));return ae(l),null},OA=DA("x","constrain-x-axis"),Ahe=DA("y","constrain-y-axis");var fue=me('<div><div class="text-[10px] leading-none font-black uppercase tracking-[0.04em] opacity-70"></div><div>'),hue=me('<aside class="pointer-events-auto fixed bottom-3 right-3 z-50 w-[308px] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-xl border border-border-base bg-surface-raised-stronger-non-alpha p-0.5 text-text-strong shadow-[var(--shadow-lg-border-base)] sm:bottom-4 sm:right-4 sm:w-[324px]"><div class="grid grid-cols-5 gap-px font-mono">');const fg=5e3,mue=(e,t=0)=>{if(!(e===void 0||Number.isNaN(e)))return`${e.toFixed(t)}ms`},uc=e=>{if(!(e===void 0||Number.isNaN(e)))return`${Math.round(e)}`},D7=e=>{if(e===void 0||Number.isNaN(e))return;const t=e/1024/1024;return`${t>=1024?t.toFixed(0):t.toFixed(1)}MB`},no=(e,t,n=!1)=>e===void 0||Number.isNaN(e)?!1:n?e<t:e>t,hg=e=>e.includes("/session");function ro(e){return C($r,{get value(){return e.tip},placement:"top",get children(){var t=fue(),n=t.firstChild,r=n.nextSibling;return X(n,()=>e.label),X(r,()=>e.value),Ve(i=>{var o={"flex min-h-[42px] w-full min-w-0 flex-col items-center justify-center rounded-[8px] px-0.5 py-1 text-center":!0,"col-span-2":!!e.wide},s={"text-[13px] leading-none font-bold tabular-nums sm:text-[14px]":!0,"text-text-on-critical-base":!!e.bad,"opacity-70":!!e.dim};return i.e=Ft(t,o,i.e),i.t=Ft(r,s,i.t),i},{e:void 0,t:void 0}),t}})}function pue(){const e=En(),t=Al(),n=rW(),[r,i]=qe({cls:void 0,delay:void 0,fps:void 0,gap:void 0,heap:{limit:void 0,used:void 0},inp:void 0,jank:void 0,long:{block:void 0,count:void 0,max:void 0},nav:{dur:void 0,pending:!1}}),o=()=>e.t("debugBar.na"),s=()=>r.heap.limit?(r.heap.used??0)/r.heap.limit:void 0,a=()=>{const p=s();return p===void 0?o():`${Math.round(p*100)}%`},l=()=>r.long.count===void 0?o():`${uc(r.long.block)??o()}/${r.long.count}`,c=()=>r.nav.pending?"...":uc(r.nav.dur)??o();let u="",d=0,f=!1,h=0,m=0;return re(()=>{const p=n(),g=`${t.pathname}${t.search}`;if(!f){f=!0,u=g;return}if(p){if(h!==0&&cancelAnimationFrame(h),m!==0&&cancelAnimationFrame(m),h=0,m=0,d!==0)return;d=performance.now(),hg(u)&&i("nav",{dur:void 0,pending:!0});return}if(d===0){u=g;return}const b=d,v=u;d=0,u=g,(hg(v)||hg(g))&&(h!==0&&cancelAnimationFrame(h),m!==0&&cancelAnimationFrame(m),h=requestAnimationFrame(()=>{h=0,m=requestAnimationFrame(()=>{m=0,i("nav",{dur:performance.now()-b,pending:!1})})}))}),Pt(()=>{const p=[],g=[],b=[],v=new Map;let y=!1,_,k=0,x=0,I=0;const A=(U,Z,Y)=>{for(;U[0]&&Y-U[0].at>Z;)U.shift()},L=U=>{A(g,fg,U);const Z=g.reduce((oe,fe)=>oe+fe.dur,0),Y=g.reduce((oe,fe)=>Math.max(oe,fe.dur),0),ee=g.filter(oe=>oe.dur>32).length;rt(()=>{i("fps",Z>0?g.length*1e3/Z:void 0),i("gap",Y>0?Y:void 0),i("jank",ee)})},$=(U=performance.now())=>{if(!y)return;A(b,fg,U);const Z=b.reduce((ee,oe)=>ee+Math.max(0,oe.dur-50),0),Y=b.reduce((ee,oe)=>Math.max(ee,oe.dur),0);i("long",{block:Z,count:b.length,max:Y})},H=(U=performance.now())=>{for(const[ee,oe]of v)U-oe.at>fg&&v.delete(ee);let Z=0,Y=0;for(const ee of v.values())Z=Math.max(Z,ee.delay),Y=Math.max(Y,ee.dur);rt(()=>{i("delay",Z>0?Z:void 0),i("inp",Y>0?Y:void 0)})},j=()=>{const U=performance.memory;U&&i("heap",{limit:U.jsHeapSizeLimit,used:U.usedJSHeapSize})},M=()=>{g.length=0,b.length=0,v.clear(),x=0,I=0,rt(()=>{i("fps",void 0),i("gap",void 0),i("jank",void 0),i("delay",void 0),i("inp",void 0),y&&i("long",{block:0,count:0,max:0})})},T=(U,Z,Y)=>{if(typeof PerformanceObserver>"u"||!(PerformanceObserver.supportedEntryTypes??[]).includes(U))return!1;const ee=new PerformanceObserver(oe=>Y(oe.getEntries()));try{return ee.observe(Z),p.push(ee),!0}catch{return ee.disconnect(),!1}};T("layout-shift",{buffered:!0,type:"layout-shift"},U=>{const Z=U.reduce((Y,ee)=>{const oe=ee;return oe.hadRecentInput?Y:Y+oe.value},0);Z!==0&&i("cls",Y=>(Y??0)+Z)})&&i("cls",0),T("longtask",{buffered:!0,type:"longtask"},U=>{const Z=performance.now();b.push(...U.map(Y=>({at:Y.startTime,dur:Y.duration}))),$(Z)})&&(y=!0,i("long",{block:0,count:0,max:0})),T("event",{buffered:!0,durationThreshold:16,type:"event"},U=>{for(const Z of U){const Y=Z;if(Y.duration<16)continue;const ee=Y.interactionId&&Y.interactionId>0?Y.interactionId:`${Y.name}:${Math.round(Y.startTime)}`,oe=v.get(ee),fe=Math.max(0,(Y.processingStart??Y.startTime)-Y.startTime);if(v.set(ee,{at:Y.startTime,delay:Math.max(oe?.delay??0,fe),dur:Math.max(oe?.dur??0,Y.duration)}),v.size<=200)continue;const Se=v.keys().next().value;Se!==void 0&&v.delete(Se)}H()});const E=U=>{if(document.visibilityState!=="visible"){k=0;return}if(x===0){x=U,k=requestAnimationFrame(E);return}g.push({at:U,dur:U-x}),x=U,U-I>=250&&(I=U,L(U)),k=requestAnimationFrame(E)},D=()=>{k!==0&&cancelAnimationFrame(k),k=0,_!==void 0&&(clearInterval(_),_=void 0)},F=()=>{document.visibilityState==="visible"&&(_===void 0&&(_=window.setInterval(()=>{$(),H(),j()},1e3)),k===0&&(k=requestAnimationFrame(E)))},G=()=>{if(document.visibilityState!=="visible"){D();return}M(),F()};j(),F(),Kt(document,"visibilitychange",G),ae(()=>{h!==0&&cancelAnimationFrame(h),m!==0&&cancelAnimationFrame(m),D();for(const U of p)U.disconnect()})}),(()=>{var p=hue(),g=p.firstChild;return X(g,C(ro,{get label(){return e.t("debugBar.nav.label")},get tip(){return e.t("debugBar.nav.tip")},get value(){return c()},get bad(){return no(r.nav.dur,400)},get dim(){return it(()=>r.nav.dur===void 0)()&&!r.nav.pending}}),null),X(g,C(ro,{get label(){return e.t("debugBar.fps.label")},get tip(){return e.t("debugBar.fps.tip")},get value(){return it(()=>r.fps===void 0)()?o():`${Math.round(r.fps)}`},get bad(){return no(r.fps,50,!0)},get dim(){return r.fps===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.frame.label")},get tip(){return e.t("debugBar.frame.tip")},get value(){return uc(r.gap)??o()},get bad(){return no(r.gap,50)},get dim(){return r.gap===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.jank.label")},get tip(){return e.t("debugBar.jank.tip")},get value(){return it(()=>r.jank===void 0)()?o():`${r.jank}`},get bad(){return no(r.jank,8)},get dim(){return r.jank===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.long.label")},get tip(){return e.t("debugBar.long.tip",{max:mue(r.long.max)??o()})},get value(){return l()},get bad(){return no(r.long.block,200)},get dim(){return r.long.count===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.delay.label")},get tip(){return e.t("debugBar.delay.tip")},get value(){return uc(r.delay)??o()},get bad(){return no(r.delay,100)},get dim(){return r.delay===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.inp.label")},get tip(){return e.t("debugBar.inp.tip")},get value(){return uc(r.inp)??o()},get bad(){return no(r.inp,200)},get dim(){return r.inp===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.cls.label")},get tip(){return e.t("debugBar.cls.tip")},get value(){return it(()=>r.cls===void 0)()?o():r.cls.toFixed(2)},get bad(){return no(r.cls,.1)},get dim(){return r.cls===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.mem.label")},get tip(){return it(()=>r.heap.used===void 0)()?e.t("debugBar.mem.tipUnavailable"):e.t("debugBar.mem.tip",{used:D7(r.heap.used)??o(),limit:D7(r.heap.limit)??o()})},get value(){return a()},get bad(){return no(s(),.8)},get dim(){return r.heap.used===void 0},wide:!0}),null),Ve(()=>vt(p,"aria-label",e.t("debugBar.ariaLabel"))),p})()}const e2=100;function gue(e,t,n=e2){if(!e.stack.length){const i=t==="/"?["/"]:["/",t];return{stack:i,index:i.length-1,action:void 0}}const r=e.stack[e.index];return t===r?e.action?{...e,action:void 0}:e:e.action?{...e,action:void 0}:vue(e,t,n)}function vue(e,t,n=e2){const r=e.stack.slice(0,e.index+1).concat(t),i=bue(r,r.length-1,n);return{...e,...i,action:void 0}}function bue(e,t,n=e2){if(e.length<=n)return{stack:e,index:t};const r=e.length-n;return{stack:e.slice(r),index:Math.max(0,t-r)}}function yue(e){if(e.index<=0)return;const t=e.index-1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"back"},to:n}}function wue(e){if(e.index>=e.stack.length-1)return;const t=e.index+1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"forward"},to:n}}var kue=me('<div class="h-full shrink-0">'),xue=me('<div class="xl:hidden w-10 shrink-0 flex items-center justify-center">'),Sue=me('<div class="xl:hidden w-[48px] shrink-0 flex items-center justify-center">'),_ue=me('<div class="flex items-center shrink-0 w-8 mr-1"><div class=transition-opacity>'),Cue=me('<div class="flex items-center gap-0 transition-transform">'),Iue=me('<div data-tauri-decorum-tb class="flex flex-row">'),Eue=me('<header class="h-10 shrink-0 bg-background-base relative grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center"data-tauri-drag-region><div><div class="flex items-center gap-1 shrink-0"><div class="hidden xl:flex items-center shrink-0"></div></div><div id=duckmind-titlebar-left class="flex items-center gap-3 min-w-0 px-2"></div></div><div class="min-w-0 flex items-center justify-center pointer-events-none"><div id=duckmind-titlebar-center class="pointer-events-auto min-w-0 flex justify-center w-fit max-w-full"></div></div><div data-tauri-drag-region><div id=duckmind-titlebar-right class="flex items-center gap-1 shrink-0 justify-end">'),Tue=me('<div class="w-36 shrink-0">');const t2=()=>window.__TAURI__,$ue=()=>t2()?.window?.getCurrentWindow?.(),Lue=()=>t2()?.webviewWindow?.getCurrentWebviewWindow?.();function Aue(){const e=jl(),t=$o(),n=u_(),r=En(),i=aS(),o=ua(),s=Al(),a=pr(),l=q(()=>t.platform==="desktop"&&t.os==="macos"),c=q(()=>t.platform==="desktop"&&t.os==="windows"),u=q(()=>t.platform==="web"),d=()=>t.webviewZoom?.()??1,f=()=>l()?`${40/d()}px`:void 0,[h,m]=qe({stack:[],index:0,action:void 0}),p=()=>`${s.pathname}${s.search}${s.hash}`,g=q(()=>!a.dir||a.id?!1:s.pathname.replace(/\/+$/,"").split("/").at(-1)==="session");re(()=>{const $=p();Ye(()=>{const H=gue(h,$);H!==h&&m(H)})});const b=q(()=>h.index>0),v=q(()=>h.index<h.stack.length-1),y=q(()=>e.projects.list().length>0),_=()=>{const $=yue(h);$&&(m($.state),o($.to))},k=()=>{const $=wue(h);$&&(m($.state),o($.to))};n.register(()=>[{id:"common.goBack",title:r.t("common.goBack"),category:r.t("command.category.view"),keybind:"mod+[",onSelect:_},{id:"common.goForward",title:r.t("common.goForward"),category:r.t("command.category.view"),keybind:"mod+]",onSelect:k}]);const x=()=>{if(t.platform==="desktop")return $ue()};re(()=>{if(t.platform!=="desktop")return;const $=i.colorScheme(),H=$==="system"?null:$,j=Lue();j?.setTheme&&j.setTheme(H).catch(()=>{})});const I=$=>$ instanceof Element?!!$.closest("button, a, input, textarea, select, option, [role='button'], [role='menuitem'], [contenteditable='true'], [contenteditable='']"):!1,A=$=>{if(t.platform!=="desktop"||$.buttons!==1||I($.target))return;const H=x();H?.startDragging&&($.preventDefault(),H.startDragging().catch(()=>{}))},L=$=>{if(t.platform!=="desktop"||I($.target)||$.target instanceof Element&&$.target.closest("[data-tauri-decorum-tb]"))return;const H=x();H?.toggleMaximize&&($.preventDefault(),H.toggleMaximize().catch(()=>{}))};return(()=>{var $=Eue(),H=$.firstChild,j=H.firstChild,M=j.firstChild,T=H.nextSibling,E=T.nextSibling;return E.firstChild,$.$$dblclick=L,$.$$mousedown=A,X(H,C(Ce,{get when(){return l()},get children(){return[(()=>{var D=kue();return Ve(F=>Xn(D,"width",`${72/d()}px`)),D})(),(()=>{var D=xue();return X(D,C(Wr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),D})()]}}),j),X(H,C(Ce,{get when(){return!l()},get children(){var D=Sue();return X(D,C(Wr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),D}}),j),X(j,C(bv,{get class(){return u()?"hidden xl:flex shrink-0 ml-14":"hidden xl:flex shrink-0 ml-2"},placement:"bottom",get title(){return r.t("command.sidebar.toggle")},get keybind(){return n.keybind("sidebar.toggle")},get children(){return C(rn,{variant:"ghost",class:"group/sidebar-toggle titlebar-icon w-8 h-6 p-0 box-border",get onClick(){return e.sidebar.toggle},get"aria-label"(){return r.t("command.sidebar.toggle")},get"aria-expanded"(){return e.sidebar.opened()},get children(){return C(ur,{size:"small",get name(){return e.sidebar.opened()?"sidebar-active":"sidebar"}})}})}}),M),X(M,C(Ce,{get when(){return a.dir},get children(){var D=_ue(),F=D.firstChild;return X(F,C(bv,{placement:"bottom",get title(){return r.t("command.session.new")},get keybind(){return n.keybind("session.new")},openDelay:2e3,get children(){return C(rn,{variant:"ghost",get icon(){return g()?"new-session-active":"new-session"},class:"titlebar-icon w-8 h-6 p-0 box-border",get disabled(){return e.sidebar.opened()},get tabIndex(){return e.sidebar.opened()?-1:void 0},onClick:()=>{a.dir&&o(`/${a.dir}/session`)},get"aria-label"(){return r.t("command.session.new")},get"aria-current"(){return g()?"page":void 0}})}})),Ve(G=>{var U=e.sidebar.opened()?"true":void 0,Z={"opacity-100 duration-120 ease-out":!e.sidebar.opened(),"opacity-0 duration-120 ease-in delay-0 pointer-events-none":e.sidebar.opened()};return U!==G.e&&vt(D,"aria-hidden",G.e=U),G.t=Ft(F,Z,G.t),G},{e:void 0,t:void 0}),D}}),null),X(M,C(Ce,{get when(){return y()},get children(){var D=Cue();return X(D,C($r,{placement:"bottom",get value(){return r.t("common.goBack")},openDelay:2e3,get children(){return C(rn,{variant:"ghost",icon:"chevron-left",class:"titlebar-icon w-6 h-6 p-0 box-border",get disabled(){return!b()},onClick:_,get"aria-label"(){return r.t("common.goBack")}})}}),null),X(D,C($r,{placement:"bottom",get value(){return r.t("common.goForward")},openDelay:2e3,get children(){return C(rn,{variant:"ghost",icon:"chevron-right",class:"titlebar-icon w-6 h-6 p-0 box-border",get disabled(){return!v()},onClick:k,get"aria-label"(){return r.t("common.goForward")}})}}),null),Ve(F=>Ft(D,{"translate-x-0":!e.sidebar.opened(),"-translate-x-[36px]":e.sidebar.opened(),"duration-180 ease-out":!e.sidebar.opened(),"duration-180 ease-in":e.sidebar.opened()},F)),D}}),null),E.$$mousedown=A,X(E,C(Ce,{get when(){return c()},get children(){return[it(()=>it(()=>!t2())()&&Tue()),Iue()]}}),null),Ve(D=>{var F=f(),G={"flex items-center min-w-0":!0,"pl-2":!l()},U={"flex items-center min-w-0 justify-end":!0,"pr-2":!c()};return F!==D.e&&Xn($,"min-height",D.e=F),D.t=Ft(H,G,D.t),D.a=Ft(E,U,D.a),D},{e:void 0,t:void 0,a:void 0}),$})()}Jr(["mousedown","dblclick"]);const Ne=e=>{const t=e.replaceAll("\\","/"),n=t.match(/^([A-Za-z]:)\/+$/);return n?`${n[1]}/`:/^\/+$/i.test(t)?"/":t.replace(/\/+$/,"")};function PA(e){const t=e-6e4;return(n,r)=>{const i=n.time.updated??n.time.created,o=r.time.updated??r.time.created,s=i>t,a=o>t;return s&&a?n.id<r.id?-1:n.id>r.id?1:0:s&&!a?-1:!s&&a?1:o-i}}const Mue=(e,t)=>Ne(e.directory)===Ne(t)&&!e.parentID&&!e.time?.archived,RA=e=>(e.session??[]).filter(t=>Mue(t,e.path.directory)),pu=(e,t)=>RA(e).sort(PA(t)),O7=(e,t)=>e.flatMap(RA).sort(PA(t))[0];function Due(e,t=()=>!0){return Object.values(e??{}).some(n=>n?.some(t))}const Oue=(e,t,n)=>{if(!n||n===t)return;const r=new Map((e??[]).map(o=>[o.id,o]));let i=n;for(;i;){const o=r.get(i);if(!o?.parentID)return;if(o.parentID===t)return o;i=o.parentID}},n2=e=>e.name||Nn(e.worktree),mg=(e,t)=>{if(e&&typeof e=="object"&&"data"in e){const n=e.data;if(n?.message)return n.message}return e instanceof Error?e.message:t},uf=(e,t,n)=>{const r=Ne(e),i=new Map;for(const s of t){const a=Ne(s);a!==r&&(i.has(a)||i.set(a,s))}if(!n?.length)return[e,...i.values()];const o=[e];for(const s of n){const a=Ne(s);if(a===r)continue;const l=i.get(a);l&&(o.push(l),i.delete(a))}return[...o,...i.values()]},Pue="duckmind:deep-link",NA=e=>{if(e.startsWith("duckmind://")&&!(typeof URL.canParse=="function"&&!URL.canParse(e)))try{return new URL(e)}catch{return}},Rue=e=>{const t=NA(e);if(!t||t.hostname!=="open-project")return;const n=t.searchParams.get("directory");if(n)return n},Nue=e=>{const t=NA(e);if(!t||t.hostname!=="new-session")return;const n=t.searchParams.get("directory");if(!n)return;const r=t.searchParams.get("prompt")||void 0;return r?{directory:n,prompt:r}:{directory:n}},zue=e=>e.map(Rue).filter(t=>!!t),jue=e=>e.map(Nue).filter(t=>!!t),Fue=e=>{const t=e.__DUCKMIND__?.deepLinks??[];return t.length===0?[]:(e.__DUCKMIND__&&(e.__DUCKMIND__.deepLinks=[]),t)};var Hue=me("<input data-component=inline-input>");function Vue(e){const[t,n]=pe(e,["class","width","style"]),r=()=>t.style?typeof t.style=="string"?t.width?`${t.style};width:${t.width}`:t.style:t.width?{...t.style,width:t.width}:t.style:{width:t.width};return(()=>{var i=Hue();return Zr(i,ie({get class(){return t.class},get style(){return r()}},n),!1,!1),i})()}var Uue=me("<span>");function Bue(){const[e,t]=qe({active:"",value:""}),n=c=>e.active===c,r=()=>e.value,i=(c,u)=>{c&&t({active:c,value:u})},o=()=>t({active:"",value:""}),s=c=>{const u=e.value.trim();if(!u){o();return}o(),c(u)},a=(c,u)=>{if(c.key==="Enter"){c.preventDefault(),s(u);return}c.key==="Escape"&&(c.preventDefault(),o())};return{editor:e,editorOpen:n,editorValue:r,openEditor:i,closeEditor:o,saveEditor:s,editorKeyDown:a,setEditor:t,InlineEditor:c=>{let u;ae(()=>{u!==void 0&&cancelAnimationFrame(u)});const d=()=>c.editing??n(c.id),f=()=>c.stopPropagation??!1,h=()=>c.openOnDblClick??!0,m=g=>{f()&&g.stopPropagation()},p=g=>{h()&&(m(g),i(c.id,c.value()))};return C(Ce,{get when(){return d()},get fallback(){return(()=>{var g=Uue();return g.$$touchstart=m,g.$$click=m,g.$$mousedown=m,g.$$pointerdown=m,g.$$dblclick=p,X(g,()=>c.value()),Ve(()=>bu(g,c.displayClass??c.class)),g})()},get children(){return C(Vue,{ref:g=>{u!==void 0&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=void 0,g.isConnected&&g.focus()})},get value(){return r()},get class(){return c.class},onInput:g=>t("value",g.currentTarget.value),onKeyDown:g=>{g.stopPropagation(),a(g,c.onSave)},onBlur:o,onPointerDown:m,onClick:m,onDblClick:m,onMouseDown:m,onMouseUp:m,onTouchStart:m})}})}}}Jr(["dblclick","pointerdown","mousedown","click","touchstart"]);var que={};Ci(que,{Collapsible:()=>xm,Content:()=>jA,Root:()=>FA,Trigger:()=>HA,useCollapsibleContext:()=>r2});var zA=yt();function r2(){const e=wt(zA);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function jA(e){const[t,n]=we(),r=r2(),i=et({id:r.generateId("content")},e),[o,s]=pe(i,["ref","id","style"]),{present:a}=Fs({show:r.shouldMount,element:()=>t()??null}),[l,c]=we(0),[u,d]=we(0);let h=r.isOpen()||a();return Pt(()=>{const m=requestAnimationFrame(()=>{h=!1});ae(()=>{cancelAnimationFrame(m)})}),re(Yt(a,()=>{if(!t())return;t().style.transitionDuration="0s",t().style.animationName="none";const m=t().getBoundingClientRect();c(m.height),d(m.width),h||(t().style.transitionDuration="",t().style.animationName="")})),re(Yt(r.isOpen,m=>{!m&&t()&&(t().style.transitionDuration="",t().style.animationName="")},{defer:!0})),re(()=>ae(r.registerContentId(o.id))),C(Ce,{get when(){return a()},get children(){return C(pt,ie({as:"div",ref(m){var p=Nt(n,o.ref);typeof p=="function"&&p(m)},get id(){return o.id},get style(){return _i({"--kb-collapsible-content-height":l()?`${l()}px`:void 0,"--kb-collapsible-content-width":u()?`${u()}px`:void 0},o.style)}},()=>r.dataset(),s))}})}function FA(e){const t=`collapsible-${Mn()}`,n=et({id:t},e),[r,i]=pe(n,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[o,s]=we(),a=oa({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:u=>r.onOpenChange?.(u)}),l=q(()=>({"data-expanded":a.isOpen()?"":void 0,"data-closed":a.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),c={dataset:l,isOpen:a.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||a.isOpen(),contentId:o,toggle:a.toggle,generateId:Bi(()=>i.id),registerContentId:Gn(s)};return C(zA.Provider,{value:c,get children(){return C(pt,ie({as:"div"},l,i))}})}function HA(e){const t=r2(),[n,r]=pe(e,["onClick"]);return C(sa,ie({get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return it(()=>!!t.isOpen())()?t.contentId():void 0},get disabled(){return t.disabled()},onClick:o=>{Je(o,n.onClick),t.toggle()}},()=>t.dataset(),r))}var xm=Object.assign(FA,{Content:jA,Trigger:HA}),Wue=me("<div data-slot=collapsible-arrow><span data-slot=collapsible-arrow-icon>");function Gue(e){const[t,n]=pe(e,["class","classList","variant"]);return C(xm,ie({"data-component":"collapsible",get"data-variant"(){return t.variant||"normal"},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n))}function Zue(e){return C(xm.Trigger,ie({"data-slot":"collapsible-trigger"},e))}function Kue(e){return C(xm.Content,ie({"data-slot":"collapsible-content"},e))}function Yue(e){return(()=>{var t=Wue(),n=t.firstChild;return Zr(t,e||{},!1,!0),X(n,C(ur,{name:"chevron-down",size:"small"})),t})()}const pg=Object.assign(Gue,{Arrow:Yue,Trigger:Zue,Content:Kue});var Jue=me("<svg>"),Xue=me("<svg><rect width=3 height=3 rx=1></svg>",!1,!0,!1);const Que=new Set([1,2,4,7,8,11,13,14]),ede=new Set([0,3,12,15]),tde=Array.from({length:16},(e,t)=>({id:t,x:t%4*4,y:Math.floor(t/4)*4,delay:Math.random()*1.5,duration:1+Math.random()*1,outer:Que.has(t),corner:ede.has(t)}));function VA(e){return(()=>{var t=Jue();return Zr(t,ie(e,{viewBox:"0 0 15 15","data-component":"spinner",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},fill:"currentColor"}),!0,!0),X(t,C(zi,{each:tde,children:n=>(()=>{var r=Xue();return Ve(i=>{var o=n.x,s=n.y,a=n.corner?0:void 0,l=n.corner?void 0:`${n.outer?"pulse-opacity-dim":"pulse-opacity"} ${n.duration}s ease-in-out infinite`,c=n.corner?void 0:"both",u=n.corner?void 0:`${n.delay}s`;return o!==i.e&&vt(r,"x",i.e=o),s!==i.t&&vt(r,"y",i.t=s),a!==i.a&&Xn(r,"opacity",i.a=a),l!==i.o&&Xn(r,"animation",i.o=l),c!==i.i&&Xn(r,"animation-fill-mode",i.i=c),u!==i.n&&Xn(r,"animation-delay",i.n=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})()})),t})()}var nde=me("<div>"),rde=me("<img data-slot=avatar-image>");const P7=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function ide(e){return e?P7?P7.segment(e)[Symbol.iterator]().next().value?.segment??Array.from(e)[0]??"":Array.from(e)[0]??"":""}function ode(e){const[t,n]=pe(e,["fallback","src","background","foreground","size","class","classList","style"]),r=t.src;return(()=>{var i=nde();return Zr(i,ie(n,{"data-component":"avatar",get"data-size"(){return t.size||"normal"},"data-has-image":r?"":void 0,get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get style(){return{...typeof t.style=="object"?t.style:{},...!r&&t.background?{"--avatar-bg":t.background}:{},...!r&&t.foreground?{"--avatar-fg":t.foreground}:{}}}}),!1,!0),X(i,C(Ce,{when:r,get fallback(){return ide(t.fallback)},children:o=>(()=>{var s=rde();return vt(s,"draggable",!1),Ve(()=>vt(s,"src",o())),s})()})),i})()}const R7={ask:"var(--icon-agent-ask-base)",build:"var(--icon-agent-build-base)",docs:"var(--icon-agent-docs-base)",plan:"var(--icon-agent-plan-base)"},N7=["var(--icon-agent-ask-base)","var(--icon-agent-build-base)","var(--icon-agent-docs-base)","var(--icon-agent-plan-base)","var(--syntax-info)","var(--syntax-success)","var(--syntax-warning)","var(--syntax-property)","var(--syntax-constant)","var(--text-diff-add-base)","var(--text-diff-delete-base)","var(--icon-warning-base)"];function sde(e){let t=0;for(const n of e)t=t*31+n.charCodeAt(0)>>>0;return N7[t%N7.length]}function ade(e,t){return t||(R7[e]??R7[e.toLowerCase()]??sde(e.toLowerCase()))}function lde(e,t){if(e)for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(r.role!=="user"||!r.agent))return ade(r.agent,t.find(i=>i.name===r.agent)?.color)}}const cde=/^(New session|Child session) - \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;function UA(e){return e&&(e.match(cde)?.[1]??e)}function BA(e,t,n,r=()=>!0){if(!n)return;const i=e.reduce((l,c)=>{if(!c.parentID)return l;const u=l.get(c.parentID);return u&&u.push(c.id),u||l.set(c.parentID,[c.id]),l},new Map),o=new Set([n]),s=[n];for(const l of s){const c=i.get(l);if(c)for(const u of c)o.has(u)||(o.add(u),s.push(u))}const a=s.find(l=>t[l]?.some(r));if(a)return t[a]?.find(r)}function ude(e,t,n,r){return BA(e,t,n,r)}function Mhe(e,t,n,r){return BA(e,t,n,r)}var dde=me("<div>"),fde=me('<div><div class="size-full rounded overflow-clip">'),hde=me('<div class="size-1.5 rounded-full bg-surface-warning-strong">'),mde=me('<div class="size-1.5 rounded-full bg-text-diff-delete-base">'),pde=me('<div class="size-1.5 rounded-full bg-text-interactive-base">'),qA=me('<div class="shrink-0 size-6 flex items-center justify-center">'),WA=me('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">'),gde=me('<div class="shrink-0 overflow-hidden transition-[width,opacity]">'),vde=me('<div class="group/session relative w-full min-w-0 rounded-md cursor-default pr-3 transition-colors hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active"><div class="flex min-w-0 items-center gap-1"><div class="min-w-0 flex-1">'),bde=me("<div class=w-full>"),yde=me('<div class="group/session relative w-full min-w-0 rounded-md cursor-default transition-colors pl-2 pr-3 hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active">'),wde=me('<div class="flex flex-col gap-1">'),kde=me('<div class="h-8 w-full rounded-md bg-surface-raised-base opacity-60 animate-pulse">');const xde="4b0ea68d7af9a6031a7ffda7ad66e0cb83315750",GA=e=>{const t=Qr(),n=em(),r=U4(),i=q(()=>[e.project.worktree,...e.project.sandboxes??[]]),o=q(()=>i().reduce((u,d)=>u+n.project.unseenCount(d),0)),s=q(()=>i().some(u=>n.project.unseenHasError(u))),a=q(()=>i().some(u=>{const[d]=t.child(u,{bootstrap:!1});return Due(d.permission,f=>!r.autoResponds(f,u))})),l=q(()=>e.notify&&(a()||o()>0)),c=q(()=>e.project.name||Nn(e.project.worktree));return(()=>{var u=fde(),d=u.firstChild;return X(d,C(ode,ie({get fallback(){return c()},get src(){return it(()=>e.project.id===xde)()?"https://duckmind.ai/favicon.svg":e.project.icon?.override}},()=>zre(e.project.icon?.color),{class:"size-full rounded",get classList(){return{"badge-mask":l()}}}))),X(u,C(Ce,{get when(){return l()},get children(){var f=dde();return Ve(h=>Ft(f,{"absolute top-px right-px size-1.5 rounded-full z-10":!0,"bg-surface-warning-strong":a(),"bg-icon-critical-base":!a()&&s(),"bg-text-interactive-base":!a()&&!s()},h)),f}}),null),Ve(()=>bu(u,`relative size-8 shrink-0 rounded ${e.class??""}`)),u})()},Sde=e=>{const t=()=>UA(e.session.title);return C(gS,{get href(){return`/${e.slug}/session/${e.session.id}`},get class(){return`flex items-center gap-2 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},get onPointerDown(){return e.warmPress},get onFocus(){return e.warmFocus},onClick:()=>{e.sidebarOpened()||e.clearHoverProjectSoon()},get children(){return[C(Ce,{get when(){return e.isWorking()||e.hasPermissions()||e.hasError()||e.unseenCount()>0},get children(){var n=qA();return X(n,C(Y0,{get children(){return[C(Fr,{get when(){return e.isWorking()},get children(){return C(VA,{class:"size-[15px]"})}}),C(Fr,{get when(){return e.hasPermissions()},get children(){return hde()}}),C(Fr,{get when(){return e.hasError()},get children(){return mde()}}),C(Fr,{get when(){return e.unseenCount()>0},get children(){return pde()}})]}})),Ve(r=>Xn(n,"color",e.tint()??"var(--icon-interactive-base)")),n}}),(()=>{var n=WA();return X(n,t),n})()]}})},G0=e=>{const t=pr(),n=jl(),r=En(),i=em(),o=U4(),s=Qr(),a=q(()=>i.session.unseenCount(e.session.id)),l=q(()=>i.session.unseenHasError(e.session.id)),[c]=s.child(e.session.directory),u=q(()=>!!ude(c.session,c.permission,e.session.id,b=>!o.autoResponds(b,e.session.directory))),d=q(()=>{if(u())return!1;const b=(c.message[e.session.id]??[]).findLast(y=>y.role==="assistant"&&typeof y.time?.completed!="number"),v=c.session_status[e.session.id];return b!==void 0||v?.type==="busy"||v?.type==="retry"||v!==void 0&&v.type!=="idle"}),f=q(()=>lde(c.message[e.session.id],c.agent)),h=q(()=>e.showTooltip??(e.mobile||!e.sidebarExpanded())),m=q(()=>{if(e.showChild)return Oue(c.session,e.session.id,t.id)}),p=(b,v)=>{const y=e.navList?.(),_=y?.some(x=>x.id===e.session.id&&x.directory===e.session.directory)?y:e.list;e.prefetchSession(e.session,v);const k=_.findIndex(x=>x.id===e.session.id&&x.directory===e.session.directory);if(k!==-1)for(let x=1;x<=b;x++){const I=_[k+x];I&&e.prefetchSession(I,x===1?"high":v);const A=_[k-x];A&&e.prefetchSession(A,x===1?"high":v)}},g=C(Sde,{get session(){return e.session},get slug(){return e.slug},get mobile(){return e.mobile},get dense(){return e.dense},tint:f,isWorking:d,hasPermissions:u,hasError:l,unseenCount:a,get clearHoverProjectSoon(){return e.clearHoverProjectSoon},get sidebarOpened(){return n.sidebar.opened},warmPress:()=>p(2,"high"),warmFocus:()=>p(2,"high")});return[(()=>{var b=vde(),v=b.firstChild,y=v.firstChild;return X(y,C(Ce,{get when(){return!h()},get fallback(){return C($r,{get placement(){return e.mobile?"bottom":"right"},get value(){return UA(e.session.title)},gutter:10,class:"min-w-0 w-full",children:g})},children:g})),X(v,C(Ce,{get when(){return!e.level},get children(){var _=gde();return X(_,C($r,{get value(){return r.t("common.archive")},placement:"top",get children(){return C(Wr,{icon:"archive",variant:"ghost",class:"size-6 rounded-md",get"aria-label"(){return r.t("common.archive")},onClick:k=>{k.preventDefault(),k.stopPropagation(),e.archiveSession(e.session)}})}})),Ve(k=>Ft(_,{"w-6 opacity-100 pointer-events-auto":!!e.mobile,"w-0 opacity-0 pointer-events-none":!e.mobile,"group-hover/session:w-6 group-hover/session:opacity-100 group-hover/session:pointer-events-auto":!0,"group-focus-within/session:w-6 group-focus-within/session:opacity-100 group-focus-within/session:pointer-events-auto":!0},k)),_}}),null),Ve(_=>{var k=e.session.id,x=`${8+(e.level??0)*16}px`;return k!==_.e&&vt(b,"data-session-id",_.e=k),x!==_.t&&Xn(b,"padding-left",_.t=x),_},{e:void 0,t:void 0}),b})(),C(Ce,{get when(){return m()},children:b=>(()=>{var v=bde();return X(v,C(G0,ie(e,{get session(){return b()},get level(){return(e.level??0)+1}}))),v})()})]},_de=e=>{const t=jl(),r=En().t("command.session.new"),i=()=>e.mobile||!e.sidebarExpanded(),o=C(gS,{get href(){return`/${e.slug}/session`},end:!0,get class(){return`flex items-center gap-2 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},onClick:()=>{t.sidebar.opened()||e.clearHoverProjectSoon()},get children(){return[(()=>{var s=qA();return X(s,C(ur,{name:"new-session",size:"small",class:"text-icon-weak"})),s})(),(()=>{var s=WA();return X(s,r),s})()]}});return(()=>{var s=yde();return X(s,C(Ce,{get when(){return!i()},get fallback(){return C($r,{get placement(){return e.mobile?"bottom":"right"},value:r,gutter:10,class:"min-w-0 w-full",children:o})},children:o})),s})()},Cde=e=>{const t=Array.from({length:e.count??4},(n,r)=>r);return(()=>{var n=wde();return X(n,C(zi,{each:t,children:()=>kde()})),n})()};var Ide=me('<div class="bg-background-base rounded-md px-2 py-1 text-14-medium text-text-strong">'),Ede=me('<div class="flex items-center gap-1 min-w-0 flex-1"><div class="flex items-center justify-center shrink-0 size-6"></div><span class="text-14-medium text-text-base shrink-0"> :</span><div class="flex items-center justify-center shrink-0 overflow-hidden w-0 opacity-0 transition-all duration-200 group-hover/workspace:w-3.5 group-hover/workspace:opacity-100 group-focus-within/workspace:w-3.5 group-focus-within/workspace:opacity-100">'),Tde=me('<span class="text-14-medium text-text-base min-w-0 truncate">'),$de=me('<div class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 transition-opacity">'),Lde=me('<div class="relative w-full py-1">'),Ade=me('<nav class="flex flex-col gap-1">'),z7=me("<div>"),Mde=me('<div class=py-1><div class="group/workspace relative"data-component=workspace-item><div class="flex items-center gap-1">'),Dde=me('<div class="size-full flex flex-col py-2 overflow-y-auto no-scrollbar [overflow-anchor:none]">');const Ode=e=>{const t=Qr(),n=En(),r=q(()=>{const i=e.sidebarProject();if(!i)return;const o=e.activeWorkspace();if(!o)return;const[s]=t.child(o,{bootstrap:!1}),a=o===i.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),l=e.workspaceLabel(o,s.vcs?.branch,i.id);return`${a} : ${l}`});return C(Ce,{get when(){return r()},children:i=>(()=>{var o=Ide();return X(o,i),o})()})},Pde=e=>(()=>{var t=Ede(),n=t.firstChild,r=n.nextSibling,i=r.firstChild,o=r.nextSibling;return X(n,C(Ce,{get when(){return e.busy()},get fallback(){return C(ur,{name:"branch",size:"small"})},get children(){return C(VA,{class:"size-[15px]"})}})),X(r,(()=>{var s=it(()=>!!e.local());return()=>s()?e.language.t("workspace.type.local"):e.language.t("workspace.type.sandbox")})(),i),X(t,C(Ce,{get when(){return!e.local()},get fallback(){return(()=>{var s=Tde();return X(s,()=>e.branch()??Nn(e.directory)),s})()},get children(){return C(e.InlineEditor,{get id(){return`workspace:${e.directory}`},get value(){return e.workspaceValue},onSave:s=>{const a=s.trim();a&&(e.renameWorkspace(e.directory,a,e.projectId,e.branch()),e.setEditor("value",e.workspaceValue()))},class:"text-14-medium text-text-base min-w-0 truncate",displayClass:"text-14-medium text-text-base min-w-0 truncate",get editing(){return e.workspaceEditActive()},stopPropagation:!1,openOnDblClick:!1})}}),o),X(o,C(ur,{get name(){return e.open()?"chevron-down":"chevron-right"},size:"small",class:"text-icon-base"})),t})(),Rde=e=>(()=>{var t=$de();return X(t,C(Bt,{get modal(){return!e.sidebarHovering()},get open(){return e.menuOpen()},onOpenChange:n=>e.setMenuOpen(n),get children(){return[C($r,{get value(){return e.language.t("common.moreOptions")},placement:"top",get children(){return C(Bt.Trigger,{as:Wr,icon:"dot-grid",variant:"ghost",class:"size-6 rounded-md","data-action":"workspace-menu",get"data-workspace"(){return mt(e.directory)},get"aria-label"(){return e.language.t("common.moreOptions")}})}}),C(Bt.Portal,{get children(){return C(Bt.Content,{onCloseAutoFocus:n=>{e.pendingRename()&&(n.preventDefault(),e.setPendingRename(!1),e.openEditor(`workspace:${e.directory}`,e.workspaceValue()))},get children(){return[C(Bt.Item,{get disabled(){return e.local()},onSelect:()=>{e.setPendingRename(!0),e.setMenuOpen(!1)},get children(){return C(Bt.ItemLabel,{get children(){return e.language.t("common.rename")}})}}),C(Bt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showResetWorkspaceDialog(e.root,e.directory),get children(){return C(Bt.ItemLabel,{get children(){return e.language.t("common.reset")}})}}),C(Bt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showDeleteWorkspaceDialog(e.root,e.directory),get children(){return C(Bt.ItemLabel,{get children(){return e.language.t("common.delete")}})}})]}})}})]}}),null),X(t,C(Ce,{get when(){return!e.touch()},get children(){return C($r,{get value(){return e.language.t("command.session.new")},placement:"top",get children(){return C(Wr,{icon:"new-session",variant:"ghost",class:"size-6 rounded-md opacity-0 pointer-events-none group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto","data-action":"workspace-new-session",get"data-workspace"(){return mt(e.directory)},get"aria-label"(){return e.language.t("command.session.new")},onClick:n=>{n.preventDefault(),n.stopPropagation(),e.clearHoverProjectSoon(),e.navigateToNewSession()}})}})}}),null),Ve(n=>Ft(t,{"opacity-100 pointer-events-auto":e.menuOpen(),"opacity-0 pointer-events-none":!e.menuOpen(),"group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto":!0,"group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto":!0},n)),t})(),ZA=e=>(()=>{var t=Ade();return X(t,C(Ce,{get when(){return e.showNew()},get children(){return C(_de,{get slug(){return e.slug()},get mobile(){return e.mobile},get sidebarExpanded(){return e.ctx.sidebarExpanded},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon}})}}),null),X(t,C(Ce,{get when(){return e.loading()},get children(){return C(Cde,{})}}),null),X(t,C(zi,{get each(){return e.sessions()},children:n=>C(G0,{session:n,get list(){return e.sessions()},get navList(){return e.ctx.navList},get slug(){return e.slug()},get mobile(){return e.mobile},showChild:!0,get sidebarExpanded(){return e.ctx.sidebarExpanded},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},get prefetchSession(){return e.ctx.prefetchSession},get archiveSession(){return e.ctx.archiveSession}})}),null),X(t,C(Ce,{get when(){return e.hasMore()},get children(){var n=Lde();return X(n,C(rn,{variant:"ghost",class:"flex w-full text-left justify-start text-14-regular text-text-weak pl-9 pr-10",size:"large",onClick:r=>{e.loadMore(),r.currentTarget.blur()},get children(){return e.language.t("common.loadMore")}})),n}}),null),t})(),Nde=e=>{const t=ua(),n=pr(),r=Qr(),i=En(),o=AA(e.directory),[s,a]=r.child(e.directory,{bootstrap:!1}),[l,c]=qe({open:!1,pendingRename:!1}),u=q(()=>mt(e.directory)),d=q(()=>pu(s,e.sortNow())),f=q(()=>e.directory===e.project.worktree),h=q(()=>Ne(e.ctx.currentDir())===Ne(e.directory)),m=q(()=>{const M=s.vcs?.branch,T=M??Nn(e.directory);return e.ctx.workspaceName(e.directory,e.project.id,M)??T}),p=q(()=>e.ctx.workspaceExpanded(e.directory,f())),g=q(()=>p()||h()),b=q(M=>M||s.status==="complete",!1),v=q(()=>d()?.length??0),y=q(()=>s.sessionTotal>v()),_=q(()=>e.ctx.isBusy(e.directory)),k=q(M=>M||_(),!1),x=q(()=>p()&&!b()&&v()===0&&!k()),I=xv("(hover: none)"),A=q(()=>!x()&&(I()||v()===0||h()&&!n.id)),L=async()=>{a("limit",M=>(M??0)+5),await r.project.loadSessions(e.directory)},$=q(()=>e.ctx.editorOpen(`workspace:${e.directory}`)),H=()=>C(Pde,{local:f,busy:_,open:p,get directory(){return e.directory},language:i,branch:()=>s.vcs?.branch,workspaceValue:m,workspaceEditActive:$,get InlineEditor(){return e.ctx.InlineEditor},get renameWorkspace(){return e.ctx.renameWorkspace},get setEditor(){return e.ctx.setEditor},get projectId(){return e.project.id}}),j=M=>{e.ctx.setWorkspaceExpanded(e.directory,M),!M&&e.ctx.editorOpen(`workspace:${e.directory}`)&&e.ctx.closeEditor()};return re(()=>{g()&&r.child(e.directory,{bootstrap:!0})}),(()=>{var M=z7();return Cr(o,M,()=>!0),X(M,C(pg,{variant:"ghost",get open(){return p()},class:"shrink-0",onOpenChange:j,get children(){return[(()=>{var T=Mde(),E=T.firstChild,D=E.firstChild;return X(D,C(Ce,{get when(){return $()},get fallback(){return C(pg.Trigger,{get class(){return`flex items-center justify-between w-full pl-2 py-1.5 rounded-md hover:bg-surface-raised-base-hover transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`},"data-action":"workspace-toggle",get"data-workspace"(){return mt(e.directory)},get children(){return H()}})},get children(){var F=z7();return X(F,H),Ve(()=>bu(F,`flex items-center justify-between w-full pl-2 py-1.5 rounded-md transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`)),F}}),null),X(D,C(Rde,{get directory(){return e.directory},local:f,busy:_,menuOpen:()=>l.open,pendingRename:()=>l.pendingRename,setMenuOpen:F=>c("open",F),setPendingRename:F=>c("pendingRename",F),get sidebarHovering(){return e.ctx.sidebarHovering},touch:I,language:i,workspaceValue:m,get openEditor(){return e.ctx.openEditor},get showResetWorkspaceDialog(){return e.ctx.showResetWorkspaceDialog},get showDeleteWorkspaceDialog(){return e.ctx.showDeleteWorkspaceDialog},get root(){return e.project.worktree},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},navigateToNewSession:()=>t(`/${u()}/session`)}),null),Ve(()=>vt(E,"data-workspace",mt(e.directory))),T})(),C(pg.Content,{get children(){return C(ZA,{slug:u,get mobile(){return e.mobile},get ctx(){return e.ctx},showNew:A,loading:x,sessions:d,hasMore:y,loadMore:L,language:i})}})]}})),Ve(T=>Ft(M,{"opacity-30":o.isActiveDraggable,"opacity-50 pointer-events-none":_()},T)),M})()},zde=e=>{const t=Qr(),n=En(),r=q(()=>{const[d,f]=t.child(e.project.worktree);return{store:d,setStore:f}}),i=q(()=>mt(e.project.worktree)),o=q(()=>pu(r().store,e.sortNow())),s=q(d=>d||r().store.status==="complete",!1),a=q(()=>o()?.length??0),l=q(()=>!s()&&a()===0),c=q(()=>r().store.sessionTotal>a()),u=async()=>{r().setStore("limit",d=>(d??0)+5),await t.project.loadSessions(e.project.worktree)};return(()=>{var d=Dde();return Cr(f=>e.ctx.setScrollContainerRef(f,e.mobile),d),X(d,C(ZA,{slug:i,get mobile(){return e.mobile},get ctx(){return e.ctx},showNew:()=>!1,loading:l,sessions:o,hasMore:c,loadMore:u,language:n})),d})()};var jde={};Ci(jde,{Arrow:()=>Mo,CheckboxItem:()=>am,Content:()=>KA,ContextMenu:()=>mn,Group:()=>Ju,GroupLabel:()=>lm,Icon:()=>cm,Item:()=>um,ItemDescription:()=>dm,ItemIndicator:()=>fm,ItemLabel:()=>hm,Portal:()=>mm,RadioGroup:()=>pm,RadioItem:()=>gm,Root:()=>XA,Separator:()=>Gl,Sub:()=>vm,SubContent:()=>bm,SubTrigger:()=>ym,Trigger:()=>QA,useContextMenuContext:()=>JA});function KA(e){const t=ei(),[n,r]=pe(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return C(vA,ie({onCloseAutoFocus:a=>{n.onCloseAutoFocus?.(a),!a.defaultPrevented&&i&&a.preventDefault(),i=!1},onInteractOutside:a=>{n.onInteractOutside?.(a),!a.defaultPrevented&&!t.isModal()&&(i=!0)}},r))}var YA=yt();function Fde(){return wt(YA)}function JA(){const e=Fde();if(e===void 0)throw new Error("[kobalte]: `useContextMenuContext` must be used within a `ContextMenu` component");return e}function XA(e){const t=`contextmenu-${Mn()}`,{direction:n}=Lo(),r=et({id:t,placement:n()==="rtl"?"left-start":"right-start",gutter:2,shift:2},e),[i,o]=pe(r,["onOpenChange"]),[s,a]=we({x:0,y:0}),l=oa({defaultOpen:!1,onOpenChange:u=>i.onOpenChange?.(u)}),c={setAnchorRect:a};return C(YA.Provider,{value:c,get children(){return C(kA,ie({get open(){return l.isOpen()},get onOpenChange(){return l.setIsOpen},getAnchorRect:s},o))}})}function QA(e){const t=ei(),n=Ki(),r=JA(),i=et({id:t.generateId("trigger")},e),[o,s]=pe(i,["ref","style","disabled","onContextMenu","onPointerDown","onPointerMove","onPointerCancel","onPointerUp"]);let a=0;const l=()=>{window.clearTimeout(a)};ae(()=>{l()});const c=p=>{if(o.disabled){Je(p,o.onContextMenu);return}l(),p.preventDefault(),p.stopPropagation(),r.setAnchorRect({x:p.clientX,y:p.clientY}),n.isOpen()?n.focusContent():n.open(!0)},u=p=>p.pointerType==="touch"||p.pointerType==="pen";return C(pt,ie({as:"div",ref(p){var g=Nt(n.setTriggerRef,o.ref);typeof g=="function"&&g(p)},get style(){return _i({"-webkit-touch-callout":"none"},o.style)},get"data-disabled"(){return o.disabled?"":void 0},onContextMenu:c,onPointerDown:p=>{Je(p,o.onPointerDown),!o.disabled&&u(p)&&(l(),r.setAnchorRect({x:p.clientX,y:p.clientY}),a=window.setTimeout(()=>n.open(!1),700))},onPointerMove:p=>{Je(p,o.onPointerMove),!o.disabled&&u(p)&&l()},onPointerCancel:p=>{Je(p,o.onPointerCancel),!o.disabled&&u(p)&&l()},onPointerUp:p=>{Je(p,o.onPointerUp),!o.disabled&&u(p)&&l()}},()=>n.dataset(),s))}var mn=Object.assign(XA,{Arrow:Mo,CheckboxItem:am,Content:KA,Group:Ju,GroupLabel:lm,Icon:cm,Item:um,ItemDescription:dm,ItemIndicator:fm,ItemLabel:hm,Portal:mm,RadioGroup:pm,RadioItem:gm,Separator:Gl,Sub:vm,SubContent:bm,SubTrigger:ym,Trigger:QA});function Hde(e){return C(mn,ie(e,{"data-component":"context-menu"}))}function Vde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.Trigger,ie(n,{"data-slot":"context-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Ude(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.Icon,ie(n,{"data-slot":"context-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Bde(e){return C(mn.Portal,e)}function qde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.Content,ie(n,{"data-component":"context-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Wde(e){const[t,n]=pe(e,["class","classList"]);return C(mn.Arrow,ie(n,{"data-slot":"context-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function Gde(e){const[t,n]=pe(e,["class","classList"]);return C(mn.Separator,ie(n,{"data-slot":"context-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function Zde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.Group,ie(n,{"data-slot":"context-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Kde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.GroupLabel,ie(n,{"data-slot":"context-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Yde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.Item,ie(n,{"data-slot":"context-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Jde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.ItemLabel,ie(n,{"data-slot":"context-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Xde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.ItemDescription,ie(n,{"data-slot":"context-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Qde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.ItemIndicator,ie(n,{"data-slot":"context-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function efe(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.RadioGroup,ie(n,{"data-slot":"context-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function tfe(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.RadioItem,ie(n,{"data-slot":"context-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function nfe(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.CheckboxItem,ie(n,{"data-slot":"context-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function rfe(e){return C(mn.Sub,e)}function ife(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.SubTrigger,ie(n,{"data-slot":"context-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function ofe(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.SubContent,ie(n,{"data-component":"context-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const br=Object.assign(Hde,{Trigger:Vde,Icon:Ude,Portal:Bde,Content:qde,Arrow:Wde,Separator:Gde,Group:Zde,GroupLabel:Kde,Item:Yde,ItemLabel:Jde,ItemDescription:Xde,ItemIndicator:Qde,RadioGroup:efe,RadioItem:tfe,CheckboxItem:nfe,Sub:rfe,SubTrigger:ife,SubContent:ofe});var sfe={};Ci(sfe,{Link:()=>afe,Root:()=>i2});function i2(e){let t;const[n,r]=pe(e,["ref","href","disabled"]),i=wu(()=>t,()=>"a");return C(pt,ie({as:"a",ref(o){var s=Nt(a=>t=a,n.ref);typeof s=="function"&&s(o)},get role(){return i()!=="a"||n.disabled?"link":void 0},get tabIndex(){return i()!=="a"&&!n.disabled?0:void 0},get href(){return it(()=>!n.disabled)()?n.href:void 0},get"aria-disabled"(){return n.disabled?!0:void 0},get"data-disabled"(){return n.disabled?"":void 0}},r))}var afe=i2,lfe={};Ci(lfe,{Arrow:()=>Mo,Content:()=>tM,HoverCard:()=>Cc,Portal:()=>nM,Root:()=>rM,Trigger:()=>iM,useHoverCardContext:()=>Sm});var eM=yt();function Sm(){const e=wt(eM);if(e===void 0)throw new Error("[kobalte]: `useHoverCardContext` must be used within a `HoverCard` component");return e}function tM(e){const t=Sm(),[n,r]=pe(e,["ref","style"]);return C(Ce,{get when(){return t.contentPresent()},get children(){return C(Wl.Positioner,{get children(){return C(X0,ie({ref(i){var o=Nt(s=>{t.setContentRef(s)},n.ref);typeof o=="function"&&o(i)},disableOutsidePointerEvents:!1,get style(){return _i({"--kb-hovercard-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},n.style)},onFocusOutside:i=>i.preventDefault(),get onDismiss(){return t.close}},()=>t.dataset(),r))}})}})}function nM(e){const t=Sm();return C(Ce,{get when(){return t.contentPresent()},get children(){return C(ia,e)}})}function cfe(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),o=n.getBoundingClientRect(),s=[],a=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":s.push([i.left,l]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([i.right,l]);break;case"right":s.push([a,i.top]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([a,i.bottom]);break;case"bottom":s.push([i.left,l]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([o.right,o.top]),s.push([i.right,l]);break;case"left":s.push([a,i.top]),s.push([o.right,o.top]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([a,i.bottom]);break}return s}function rM(e){const t=`hovercard-${Mn()}`,n=et({id:t,openDelay:700,closeDelay:300},e),[r,i]=pe(n,["id","open","defaultOpen","onOpenChange","openDelay","closeDelay","ignoreSafeArea","forceMount"]);let o,s;const[a,l]=we(),[c,u]=we(),[d,f]=we(i.placement),h=oa({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:$=>r.onOpenChange?.($)}),{present:m}=Fs({show:()=>r.forceMount||h.isOpen(),element:()=>c()??null}),{addGlobalListener:p,removeGlobalListener:g}=YD(),b=()=>{o=window.setTimeout(()=>{o=void 0,h.open()},r.openDelay)},v=()=>{s=window.setTimeout(()=>{s=void 0,h.close()},r.closeDelay)},y=()=>{window.clearTimeout(o),o=void 0},_=()=>{window.clearTimeout(s),s=void 0},k=$=>dn(a(),$)||dn(c(),$),x=$=>{const H=a(),j=c();if(!(!H||!j))return cfe($,H,j)},I=$=>{const H=$.target;if(k(H)){_();return}if(!r.ignoreSafeArea){const j=x(d());if(j&&Ev(lk($),j)){_();return}}s||v()};re(()=>{h.isOpen()&&(p(document,"pointermove",I,!0),ae(()=>{g(document,"pointermove",I,!0)}))}),ae(()=>{y(),_()});const L={dataset:q(()=>({"data-expanded":h.isOpen()?"":void 0,"data-closed":h.isOpen()?void 0:""})),isOpen:h.isOpen,contentPresent:m,openWithDelay:b,closeWithDelay:v,cancelOpening:y,cancelClosing:_,close:h.close,isTargetOnHoverCard:k,setTriggerRef:l,setContentRef:u};return C(eM.Provider,{value:L,get children(){return C(Wl,ie({anchorRef:a,contentRef:c,onCurrentPlacementChange:f},i))}})}function iM(e){const t=Sm(),[n,r]=pe(e,["ref","onPointerEnter","onPointerLeave","onFocus","onBlur"]),i=l=>{Je(l,n.onPointerEnter),!(l.pointerType==="touch"||r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},o=l=>{Je(l,n.onPointerLeave),l.pointerType!=="touch"&&t.cancelOpening()},s=l=>{Je(l,n.onFocus),!(r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},a=l=>{Je(l,n.onBlur),t.cancelOpening();const c=l.relatedTarget;t.isTargetOnHoverCard(c)||t.closeWithDelay()};return ae(t.cancelOpening),C(i2,ie({ref(l){var c=Nt(t.setTriggerRef,n.ref);typeof c=="function"&&c(l)},onPointerEnter:i,onPointerLeave:o,onFocus:s,onBlur:a},()=>t.dataset(),r))}var Cc=Object.assign(rM,{Arrow:Mo,Content:tM,Portal:nM,Trigger:iM}),ufe=me("<div data-slot=hover-card-body>");function dfe(e){const[t,n]=pe(e,["trigger","mount","class","classList","children"]);return C(Cc,ie({gutter:4},n,{get children(){return[C(Cc.Trigger,{as:"div","data-slot":"hover-card-trigger",tabIndex:-1,get children(){return t.trigger}}),C(Cc.Portal,{get mount(){return t.mount},get children(){return C(Cc.Content,{"data-component":"hover-card-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){var r=ufe();return X(r,()=>t.children),r}})}})]}}))}var ffe=me('<div class="bg-background-base rounded-xl p-1">'),hfe=me('<div class="-m-3 p-2 flex flex-col w-72"><div class="px-4 pt-2 pb-1 flex items-center gap-2"><div class="text-14-medium text-text-strong truncate grow"></div></div><div class="px-4 pb-2 text-12-medium text-text-weak"></div><div class="px-2 pb-2 flex flex-col gap-2"></div><div class="px-2 py-2 border-t border-border-weak-base">'),mfe=me('<div class="flex flex-col gap-1"><div class="px-2 py-0.5 flex items-center gap-1 min-w-0"><div class="shrink-0 size-6 flex items-center justify-center"></div><span class="truncate text-14-medium text-text-base">'),pfe=me("<div>");const gfe=e=>{const t=q(()=>e.projects().find(n=>n.worktree===e.activeProject()));return C(Ce,{get when(){return t()},children:n=>(()=>{var r=ffe();return X(r,C(GA,{get project(){return n()}})),r})()})},vfe=e=>{const t=em(),n=jl(),r=q(()=>e.dirs().reduce((o,s)=>o+t.project.unseenCount(s),0)),i=()=>e.dirs().filter(o=>t.project.unseenCount(o)>0).forEach(o=>t.project.markViewed(o));return C(br,{get modal(){return!e.sidebarHovering()},onOpenChange:o=>{e.setMenu(o),e.setSuppressHover(o),o&&e.setOpen(!1)},get children(){return[C(br.Trigger,{as:"button",type:"button",get"aria-label"(){return n2(e.project)},"data-action":"project-switch",get"data-project"(){return mt(e.project.worktree)},get classList(){return{"flex items-center justify-center size-10 p-1 rounded-lg overflow-hidden transition-colors cursor-default":!0,"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover":e.selected(),"bg-transparent border border-transparent hover:bg-surface-base-hover hover:border-border-weak-base":!e.selected()&&!e.active(),"bg-surface-base-hover border border-border-weak-base":!e.selected()&&e.active()}},onPointerDown:o=>{if(o.button===0&&!o.ctrlKey){e.setOpen(!1),e.setSuppressHover(!0);return}e.overlay()&&(o.button!==2&&!(o.button===0&&o.ctrlKey)||(e.setOpen(!1),e.setSuppressHover(!0),o.preventDefault()))},onMouseEnter:o=>{e.overlay()&&(e.suppressHover()||e.onProjectMouseEnter(e.project.worktree,o))},onMouseLeave:()=>{e.suppressHover()&&e.setSuppressHover(!1),e.overlay()&&e.onProjectMouseLeave(e.project.worktree)},onFocus:()=>{e.overlay()&&(e.suppressHover()||e.onProjectFocus(e.project.worktree))},onClick:()=>{if(e.setOpen(!1),e.selected()){n.sidebar.toggle();return}e.navigateToProject(e.project.worktree)},onBlur:()=>e.setOpen(!1),get children(){return C(GA,{get project(){return e.project},notify:!0})}}),C(br.Portal,{get children(){return C(br.Content,{get children(){return[C(br.Item,{onSelect:()=>e.showEditProjectDialog(e.project),get children(){return C(br.ItemLabel,{get children(){return e.language.t("common.edit")}})}}),C(br.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return mt(e.project.worktree)},get disabled(){return it(()=>e.project.vcs!=="git")()&&!e.workspacesEnabled(e.project)},onSelect:()=>e.toggleProjectWorkspaces(e.project),get children(){return C(br.ItemLabel,{get children(){return it(()=>!!e.workspacesEnabled(e.project))()?e.language.t("sidebar.workspaces.disable"):e.language.t("sidebar.workspaces.enable")}})}}),C(br.Item,{"data-action":"project-clear-notifications",get"data-project"(){return mt(e.project.worktree)},get disabled(){return r()===0},onSelect:i,get children(){return C(br.ItemLabel,{get children(){return e.language.t("sidebar.project.clearNotifications")}})}}),C(br.Separator,{}),C(br.Item,{"data-action":"project-close-menu",get"data-project"(){return mt(e.project.worktree)},onSelect:()=>e.closeProject(e.project.worktree),get children(){return C(br.ItemLabel,{get children(){return e.language.t("common.close")}})}})]}})}})]}})},bfe=e=>(()=>{var t=hfe(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,o=i.nextSibling,s=o.nextSibling;return X(r,()=>n2(e.project)),X(i,()=>e.language.t("sidebar.project.recentSessions")),X(o,C(Ce,{get when(){return e.workspaceEnabled()},get fallback(){return C(zi,{get each(){return e.projectSessions().slice(0,2)},children:a=>C(G0,ie(()=>e.ctx.sessionProps,{session:a,get list(){return e.projectSessions()},get slug(){return mt(e.project.worktree)},dense:!0,showTooltip:!0,get mobile(){return e.mobile}}))})},get children(){return C(zi,{get each(){return e.workspaces()},children:a=>{const l=q(()=>e.workspaceSessions(a));return(()=>{var c=mfe(),u=c.firstChild,d=u.firstChild,f=d.nextSibling;return X(d,C(ur,{name:"branch",size:"small",class:"text-icon-base"})),X(f,()=>e.label(a)),X(c,C(zi,{get each(){return l().slice(0,2)},children:h=>C(G0,ie(()=>e.ctx.sessionProps,{session:h,get list(){return l()},get slug(){return mt(a)},dense:!0,showTooltip:!0,get mobile(){return e.mobile}}))}),null),c})()}})}})),X(s,C(rn,{variant:"ghost",class:"flex w-full text-left justify-start text-text-base px-2 hover:bg-transparent active:bg-transparent",onClick:()=>{e.ctx.openSidebar(),e.ctx.onHoverOpenChanged(e.project.worktree,!1),!e.selected()&&e.ctx.navigateToProject(e.project.worktree)},get children(){return e.language.t("sidebar.project.viewAllSessions")}})),t})(),yfe=e=>{const t=Qr(),n=En(),r=AA(e.project.worktree),i=q(()=>e.ctx.currentProject()?.worktree===e.project.worktree),o=q(()=>e.ctx.workspaceIds(e.project).slice(0,2)),s=q(()=>e.ctx.workspacesEnabled(e.project)),a=q(()=>e.ctx.workspaceIds(e.project)),[l,c]=qe({menu:!1,suppressHover:!1}),u=()=>e.ctx.hoverProject()===e.project.worktree,d=q(()=>!e.mobile&&e.ctx.sidebarOpened()),f=q(()=>!e.mobile&&!e.ctx.sidebarOpened()),h=q(()=>l.menu||(d()||f())&&u()),m=()=>u()&&d()&&!i()&&!l.menu,p=_=>{const[k]=t.child(_,{bootstrap:!1}),x=_===e.project.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),I=e.ctx.workspaceLabel(_,k.vcs?.branch,e.project.id);return`${x} : ${I}`},g=q(()=>t.child(e.project.worktree,{bootstrap:!1})[0]),b=q(()=>pu(g(),e.sortNow())),v=_=>{const[k]=t.child(_,{bootstrap:!1});return pu(k,e.sortNow())},y=()=>C(vfe,{get project(){return e.project},get mobile(){return e.mobile},get sidebarHovering(){return e.ctx.sidebarHovering},selected:i,active:h,overlay:f,suppressHover:()=>l.suppressHover,dirs:a,get onProjectMouseEnter(){return e.ctx.onProjectMouseEnter},get onProjectMouseLeave(){return e.ctx.onProjectMouseLeave},get onProjectFocus(){return e.ctx.onProjectFocus},get navigateToProject(){return e.ctx.navigateToProject},get showEditProjectDialog(){return e.ctx.showEditProjectDialog},get toggleProjectWorkspaces(){return e.ctx.toggleProjectWorkspaces},get workspacesEnabled(){return e.ctx.workspacesEnabled},get closeProject(){return e.ctx.closeProject},setMenu:_=>c("menu",_),setOpen:_=>e.ctx.onHoverOpenChanged(e.project.worktree,_),setSuppressHover:_=>c("suppressHover",_),language:n});return(()=>{var _=pfe();return Cr(r,_,()=>!0),X(_,C(Ce,{get when(){return it(()=>!!d())()&&!i()},get fallback(){return y()},get children(){return C(dfe,{get open(){return it(()=>!!(!l.suppressHover&&m()))()&&!l.menu},openDelay:0,closeDelay:0,placement:"right-start",gutter:6,get trigger(){return y()},onOpenChange:k=>{l.menu||k&&l.suppressHover||e.ctx.onHoverOpenChanged(e.project.worktree,k)},get children(){return C(bfe,{get project(){return e.project},get mobile(){return e.mobile},selected:i,workspaceEnabled:s,workspaces:o,label:p,projectSessions:b,workspaceSessions:v,get ctx(){return e.ctx},language:n})}})}})),Ve(()=>_.classList.toggle("opacity-30",!!r.isActiveDraggable)),_})()};var wfe=me('<div class="h-full w-full flex flex-col items-center gap-3 px-3 py-3 overflow-y-auto no-scrollbar">'),kfe=me('<div class="flex h-full w-full min-w-0 overflow-hidden"><div data-component=sidebar-rail class="w-16 shrink-0 bg-background-base flex flex-col items-center overflow-hidden"><div class="flex-1 min-h-0 w-full"></div><div class="shrink-0 w-full pt-3 pb-6 flex flex-col items-center gap-2"></div></div><div>'),xfe=me('<span class="text-icon-base text-12-medium">'),Sfe=me('<div class="flex items-center gap-2"><span>');const _fe=e=>{const t=q(()=>!!e.mobile||e.opened()),n=()=>e.mobile?"bottom":"right";let r;return re(()=>{const i=r;if(i){if(t()){i.removeAttribute("inert");return}i.setAttribute("inert","")}}),(()=>{var i=kfe(),o=i.firstChild,s=o.firstChild,a=s.nextSibling,l=o.nextSibling;return Os(o,"mousemove",e.aimMove,!0),X(s,C(IA,{get onDragStart(){return e.handleDragStart},get onDragEnd(){return e.handleDragEnd},get onDragOver(){return e.handleDragOver},collisionDetector:_A,get children(){return[C(EA,{}),C(OA,{}),(()=>{var c=wfe();return X(c,C(LA,{get ids(){return e.projects().map(u=>u.worktree)},get children(){return C(zi,{get each(){return e.projects()},children:u=>e.renderProject(u)})}}),null),X(c,C($r,{get placement(){return n()},get value(){return(()=>{var u=Sfe(),d=u.firstChild;return X(d,()=>e.openProjectLabel),X(u,C(Ce,{get when(){return it(()=>!e.mobile)()&&!!e.openProjectKeybind()},get children(){var f=xfe();return X(f,()=>e.openProjectKeybind()),f}}),null),u})()},get children(){return C(Wr,{icon:"plus",variant:"ghost",size:"large",get onClick(){return e.onOpenProject},get"aria-label"(){return it(()=>typeof e.openProjectLabel=="string")()?e.openProjectLabel:void 0}})}}),null),c})(),C(TA,{get children(){return e.renderProjectOverlay()}})]}})),X(a,C(bv,{get placement(){return n()},get title(){return e.settingsLabel()},get keybind(){return e.settingsKeybind()??""},get children(){return C(Wr,{icon:"settings-gear",variant:"ghost",size:"large",get onClick(){return e.onOpenSettings},get"aria-label"(){return e.settingsLabel()}})}}),null),X(a,C($r,{get placement(){return n()},get value(){return e.helpLabel()},get children(){return C(Wr,{icon:"help",variant:"ghost",size:"large",get onClick(){return e.onOpenHelp},get"aria-label"(){return e.helpLabel()}})}}),null),Cr(c=>{r=c},l),X(l,()=>e.renderPanel()),Ve(c=>{var u={"flex-1 flex h-full min-h-0 min-w-0 overflow-hidden":!0,"pointer-events-none":!t()},d=!t();return c.e=Ft(l,u,c.e),d!==c.t&&vt(l,"aria-hidden",c.t=d),c},{e:void 0,t:void 0}),i})()};Jr(["mousemove"]);var Cfe=me('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex justify-end gap-2">'),Ife=me('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"> <!> </span></div><div class="flex justify-end gap-2">'),Efe=me('<span class="text-12-regular text-text-base truncate select-text">'),Tfe=me('<div class="shrink-0 pl-1 py-1"><div class="group/project flex items-start justify-between gap-2 py-2 pl-2 pr-0"><div class="flex flex-col min-w-0">'),j7=me('<div class="shrink-0 py-4">'),$fe=me('<div class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar [overflow-anchor:none]">'),Lfe=me('<div class="relative flex-1 min-h-0">'),Afe=me('<div class="flex-1 min-h-0 flex flex-col">'),Mfe=me('<div><div class="shrink-0 px-3 py-3"><div class="rounded-xl bg-background-base shadow-xs-border-base"data-component=getting-started><div class="p-3 flex flex-col gap-6"><div class="flex flex-col gap-2"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div></div><div data-component=getting-started-actions>'),Dfe=me('<div class="flex-1 min-h-0 -mt-4 flex items-center justify-center px-6 pb-64 text-center"><div class="mt-8 flex max-w-60 flex-col items-center gap-6 text-center"><div class="flex flex-col gap-3"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)>'),Ofe=me('<div class="flex-1 min-h-0">'),Pfe=me('<div class="hidden xl:block absolute inset-y-0 z-30 w-0 overflow-visible">'),Rfe=me('<div class="relative bg-background-base flex-1 min-h-0 min-w-0 flex flex-col select-none [&_input]:select-text [&_textarea]:select-text [&_[contenteditable]]:select-text"><div class="flex-1 min-h-0 min-w-0 flex"><div class="flex-1 min-h-0 relative"><div class="size-full relative overflow-x-hidden"><nav data-component=sidebar-nav-desktop><div class="@container w-full h-full contain-strict"></div></nav><div class="hidden xl:block pointer-events-none absolute top-0 right-0 z-0 border-t border-border-weaker-base"style="left:calc(4rem + 12px)"></div><div class=xl:hidden><div></div><nav data-component=sidebar-nav-mobile></nav></div><div><main></main></div><div></div><div><div class="h-full w-px"style=box-shadow:var(--shadow-sidebar-overlay)>'),Nfe=me("<div class=size-full>");function zfe(e){const[t,n,,r]=Sn(Jt.global("layout.page",["layout.page.v1"]),qe({lastProjectSession:{},activeProject:void 0,activeWorkspace:void 0,workspaceOrder:{},workspaceName:{},workspaceBranchName:{},workspaceExpanded:{},gettingStartedDismissed:!1})),i=q(()=>r());let o,s=0,a=!1;const l=pr(),c=Nl(),u=Qr(),d=jl(),f=q(()=>d.ready()),h=$o(),m=Au(),p=Rl(),g=em(),b=U4(),v=ua();oue(v);const y=V4(),_=Q0(),k=u_(),x=aS(),I=En(),A=bo(l.dir),L=q(()=>{const z=l.dir;if(!z)return{slug:z,dir:""};const N=bo(z);return N?{slug:z,dir:u.peek(N,{bootstrap:!1})[0].path.directory||N}:{slug:z,dir:""}}),$=q(()=>x.ids().map(z=>[z,x.themes()[z]])),H=["system","light","dark"],j={system:"theme.scheme.system",light:"theme.scheme.light",dark:"theme.scheme.dark"},M=z=>I.t(j[z]),T=q(()=>L().dir),[E,D]=qe({autoselect:!A,busyWorkspaces:{},hoverProject:void 0,scrollSessionKey:void 0,nav:void 0,sortNow:Date.now(),sizing:!1,peek:void 0,peeked:!1}),F=Bue(),G=(z,N)=>{const J=Ne(z);if(N){D("busyWorkspaces",J,!0);return}D("busyWorkspaces",He(ne=>{delete ne[J]}))},U=z=>!!E.busyWorkspaces[Ne(z)],Z={current:void 0},Y=()=>E.sortNow;let ee,oe;const fe=setTimeout(()=>{D("sortNow",Date.now()),oe=setInterval(()=>D("sortNow",Date.now()),6e4)},6e4-Date.now()%6e4),Se=iue({enabled:()=>!d.sidebar.opened(),active:()=>E.hoverProject,el:()=>E.nav?.querySelector("[data-component='sidebar-rail']")??E.nav,onActivate:z=>{u.child(z),D("hoverProject",z)}});ae(()=>{a=!0,s+=1,Z.current!==void 0&&clearTimeout(Z.current),clearTimeout(fe),oe&&clearInterval(oe),ee!==void 0&&clearTimeout(ee),Ze!==void 0&&clearTimeout(Ze),Se.reset()}),Pt(()=>{const z=()=>D("sizing",!1),N=()=>Dn(),J=()=>{document.visibilityState==="hidden"&&Dn()};Kt(window,"pointerup",z),Kt(window,"pointercancel",z),Kt(window,"blur",z),Kt(window,"blur",N),Kt(document,"visibilitychange",J)});const We=q(()=>!d.sidebar.opened()&&E.hoverProject!==void 0),Ae=q(()=>d.sidebar.opened()||We()),xe=z=>{D("hoverProject",z),Se.reset()},Ue=()=>queueMicrotask(()=>xe(void 0)),lt=()=>{Z.current!==void 0&&(clearTimeout(Z.current),Z.current=void 0)},Dn=()=>{lt(),xe(void 0)},or=()=>{d.sidebar.opened()||E.hoverProject!==void 0&&(lt(),Z.current=window.setTimeout(()=>{Z.current=void 0,xe(void 0)},300))};let Ze;const V=q(()=>{const z=E.hoverProject;if(z)return d.projects.list().find(N=>N.worktree===z)}),ft=q(()=>{const z=E.peek;if(z)return d.projects.list().find(N=>N.worktree===z)});re(()=>{const z=V();if(z){Ze!==void 0&&(clearTimeout(Ze),Ze=void 0),D("peek",z.worktree),D("peeked",!0);return}D("peeked",!1),E.peek!==void 0&&(Ze!==void 0&&clearTimeout(Ze),Ze=window.setTimeout(()=>{Ze=void 0,D("peek",void 0)},180))}),re(()=>{d.sidebar.opened()&&xe(void 0)}),re(()=>{if(!E.autoselect)return;const z=l.dir;!z||!bo(z)||D("autoselect",!1)});const St=F.editorOpen,pn=F.openEditor,Yn=F.closeEditor,Do=F.setEditor,Qu=F.InlineEditor,s2=()=>{d.sidebar.opened()||Dn()},ti=z=>{s2(),v(z),d.mobileSidebar.hide()};function wM(z=1){const N=$().map(([se])=>se);if(N.length===0)return;const J=N.indexOf(x.themeId()),ne=J===-1?0:(J+z+N.length)%N.length,le=N[ne];x.setTheme(le),yn({title:I.t("toast.theme.title"),description:x.name(le)})}function kM(z=1){const N=x.colorScheme(),J=H.indexOf(N),ne=J===-1?0:(J+z+H.length)%H.length,le=H[ne];x.setColorScheme(le),yn({title:I.t("toast.scheme.title"),description:M(le)})}function a2(z){z!==I.locale()&&(I.setLocale(z),yn({title:I.t("toast.language.title"),description:I.t("toast.language.description",{language:I.label(z)})}))}function xM(z=1){const N=I.locales,J=N.indexOf(I.locale()),ne=J===-1?0:(J+z+N.length)%N.length,le=N[ne];le&&a2(le)}const SM=()=>Pt(()=>{if(!h.checkUpdate||!h.update||!h.restart)return;let z,N;const J=()=>h.checkUpdate().then(({updateAvailable:ne,version:le})=>{ne&&z===void 0&&(z=yn({persistent:!0,icon:"download",title:I.t("toast.update.title"),description:I.t("toast.update.description",{version:le??""}),actions:[{label:I.t("toast.update.action.installRestart"),onClick:async()=>{await h.update(),await h.restart()}},{label:I.t("toast.update.action.notYet"),onClick:"dismiss"}]}))});re(()=>{if(m.ready()){if(!m.updates.startup()){if(N===void 0)return;clearInterval(N),N=void 0;return}N===void 0&&(J(),N=setInterval(J,600*1e3))}}),ae(()=>{N!==void 0&&clearInterval(N)})}),_M=()=>Pt(()=>{const z=new Map,N=new Map,J=5e3,ne=se=>{const $e=z.get(se);$e!==void 0&&(hl.dismiss($e),z.delete(se),N.delete(se))},le=c.event.listen(se=>{if(se.details?.type==="worktree.ready"){G(se.name,!1),cf.ready(se.name);return}if(se.details?.type==="worktree.failed"){G(se.name,!1),cf.failed(se.name,se.details.properties?.message??I.t("common.requestFailed"));return}if(se.details?.type==="question.replied"||se.details?.type==="question.rejected"||se.details?.type==="permission.replied"){const Yi=se.details.properties,Kl=`${se.name}:${Yi.sessionID}`;ne(Kl);return}if(se.details?.type!=="permission.asked"&&se.details?.type!=="question.asked")return;const $e=se.details.type==="permission.asked"?I.t("notification.permission.title"):I.t("notification.question.title"),Te=se.details.type==="permission.asked"?"checklist":"bubble-5",Oe=se.name,Pe=se.details.properties;if(se.details.type==="permission.asked"&&b.autoResponds(se.details.properties,Oe))return;const[Re]=u.child(Oe,{bootstrap:!1}),Lt=Re.session.find(Yi=>Yi.id===Pe.sessionID),ht=`${Oe}:${Pe.sessionID}`,Tt=Lt?.title??I.t("command.session.new"),Fe=Nn(Oe),Me=se.details.type==="permission.asked"?I.t("notification.permission.description",{sessionTitle:Tt,projectName:Fe}):I.t("notification.question.description",{sessionTitle:Tt,projectName:Fe}),sr=`/${mt(Oe)}/session/${Pe.sessionID}`,Oo=Date.now(),Ei=N.get(ht)??0;if(Oo-Ei<J)return;N.set(ht,Oo),se.details.type==="permission.asked"&&(m.sounds.permissionsEnabled()&&lv(m.sounds.permissions()),m.notifications.permissions()&&h.notify($e,Me,sr)),se.details.type==="question.asked"&&m.notifications.agent()&&h.notify($e,Me,sr);const ms=l.id;if(Ne(Oe)===Ne(T())&&Pe.sessionID===ms||Ne(Oe)===Ne(T())&&Lt?.parentID===ms)return;ne(ht);const ba=yn({persistent:!0,icon:Te,title:$e,description:Me,actions:[{label:I.t("notification.action.goToSession"),onClick:()=>v(sr)},{label:I.t("common.dismiss"),onClick:"dismiss"}]});z.set(ht,ba)});ae(le),re(()=>{const se=l.id;if(!T()||!se)return;const $e=`${T()}:${se}`;ne($e);const[Te]=u.child(T(),{bootstrap:!1}),Oe=Te.session.filter(Pe=>Pe.parentID===se);for(const Pe of Oe)ne(`${T()}:${Pe.id}`)})});SM(),_M();function CM(z,N){if(!o||E.scrollSessionKey===N)return;const J=o.querySelector(`[data-session-id="${z}"]`);if(!J)return;const ne=o.getBoundingClientRect(),le=J.getBoundingClientRect();if(le.top>=ne.top&&le.bottom<=ne.bottom){D("scrollSessionKey",N);return}D("scrollSessionKey",N),J.scrollIntoView({block:"nearest",behavior:"smooth"})}const zn=q(()=>{const z=T();if(!z)return;const N=Ne(z),J=d.projects.list(),ne=J.find(Pe=>Pe.sandboxes?.some(Re=>Ne(Re)===N));if(ne)return ne;const le=J.find(Pe=>Ne(Pe.worktree)===N);if(le)return le;const[se]=u.child(z,{bootstrap:!1}),$e=se.project;if(!$e)return;const Oe=u.data.project.find(Pe=>Pe.id===$e)?.worktree;if(Oe)return J.find(Pe=>Pe.worktree===Oe)}),[IM]=xl(async()=>{if(await r.promise,await d.ready.promise,!Ye(()=>E.autoselect))return;const z=d.projects.list(),N=p.projects.last();if(z.length===0){if(!N)return;await hs(N,!0)}else{const J=z.find(ne=>ne.worktree===N)??z[0];if(!J)return;await hs(J.worktree,!0)}}),_m=(z,N,J)=>{const ne=Ne(z),le=t.workspaceName[ne]??t.workspaceName[z];if(le)return le;if(N&&J)return t.workspaceBranchName[N]?.[J]},l2=(z,N,J,ne)=>{const le=Ne(z);n("workspaceName",le,N),J&&ne&&(t.workspaceBranchName[J]||n("workspaceBranchName",J,{}),n("workspaceBranchName",J,ne,N))},c2=(z,N,J)=>_m(z,J,N)??N??Nn(z),u2=q(()=>{const z=zn();return!z||z.vcs!=="git"?!1:d.sidebar.workspaces(z.worktree)()}),ed=q(()=>{const z=zn();if(!z)return[];if(!u2())return[z.worktree];const N=T();return sd(z).filter(J=>{const ne=t.workspaceExpanded[J]??J===z.worktree,le=Ne(J)===Ne(N);return ne||le})});re(()=>{if(!i()||!f())return;const z=d.projects.list();for(const[N,J]of Object.entries(t.workspaceExpanded)){if(!J)continue;const ne=Ne(N),le=z.find(se=>Ne(se.worktree)===ne||se.sandboxes?.some($e=>Ne($e)===ne));le&&(le.vcs==="git"&&d.sidebar.workspaces(le.worktree)()||n("workspaceExpanded",N,!1))}});const va=q(()=>{const z=Date.now(),N=ed();if(N.length===0)return[];const J=[];for(const ne of N){const[le]=u.child(ne,{bootstrap:!0}),se=pu(le,z);J.push(...se)}return J}),d2=200,EM=2,TM=10,$M=4,Cm={value:0},Zl=new Map,f2=10,td=new Map,h2=z=>{const N=td.get(z);if(N)return N;const J=new Set;return td.set(z,J),J},LM=(z,N)=>{const J=h2(z);return w$({seen:J,keep:N,limit:f2,preserve:l.id&&Ne(z)===Ne(T())?[l.id]:void 0})};re(()=>{const z=new Set(ed());for(const N of[...td.keys()])z.has(N)||td.delete(N)}),re(()=>{L(),c.url,Cm.value+=1,Zne(),Zl.clear()}),re(()=>{const z=new Set(ed());for(const[N,J]of Zl)z.has(N)||(J.pending.length=0,J.pendingSet.clear(),J.running===0&&Zl.delete(N))});const m2=z=>{const N=Zl.get(z);if(N)return N;const J={inflight:new Set,pending:[],pendingSet:new Set,running:0};return Zl.set(z,J),J},Im=(z,N)=>{if(z.length===0)return N.slice().sort((ne,le)=>ne.id<le.id?-1:ne.id>le.id?1:0);const J=new Map;for(const ne of z)J.set(ne.id,ne);for(const ne of N)J.set(ne.id,ne);return[...J.values()].sort((ne,le)=>ne.id<le.id?-1:ne.id>le.id?1:0)};async function AM(z,N,J){const[ne,le]=u.child(z,{bootstrap:!1});return Kne({directory:z,sessionID:N,task:se=>nn(()=>c.client.session.messages({directory:z,sessionID:N,limit:d2})).then($e=>{if(Cm.value!==J||!p5(z,N,se))return;const Te=($e.data??[]).filter(Me=>!!Me?.info?.id),Oe=Te.map(Me=>Me.info).filter(Me=>!!Me?.id),Pe=Im([],Oe),Re=LM(z,N),Lt=$e.response.headers.get("x-next-cursor")??void 0,ht={limit:Pe.length,cursor:Lt,complete:!Lt,at:Date.now()};if(Re.length>0){v$(z,Re);for(const Me of Re)u.todo.set(Me,void 0)}const Tt=ne.message[N]??[],Fe=Im(Tt.filter(Me=>!!Me?.id),Pe);if(p5(z,N,se))return rt(()=>{Re.length>0&&le(He(Me=>{Zh(Me,Re)})),le("message",N,Ct(Fe,{key:"id"})),g$({directory:z,sessionID:N,...ht});for(const Me of Te){const sr=ne.part[Me.info.id]??[],Oo=Im(sr.filter(Ei=>!!Ei?.id),Me.parts.filter(Ei=>!!Ei?.id));le("part",Me.info.id,Ct(Oo,{key:"id"}))}}),ht}).catch(()=>{})})}const p2=z=>{const N=m2(z);if(N.running>=EM)return;const J=N.pending.shift();if(!J)return;N.pendingSet.delete(J),N.inflight.add(J),N.running+=1;const ne=Cm.value;AM(z,J,ne).finally(()=>{N.running-=1,N.inflight.delete(J),p2(z)})},fs=(z,N="low")=>{const J=z.directory;if(!J)return;const[ne]=u.child(J,{bootstrap:!1});if(Ye(()=>{const Oe=W1(J,z.id);return Wne({message:ne.message[z.id]!==void 0,info:Oe,chunk:d2})}))return;const se=m2(J);if(se.inflight.has(z.id))return;if(se.pendingSet.has(z.id)){if(N!=="high")return;const Oe=se.pending.indexOf(z.id);Oe>0&&(se.pending.splice(Oe,1),se.pending.unshift(z.id));return}const $e=h2(J);if(!(!$e.has(z.id)&&$e.size>=f2&&N!=="high")){for(N==="high"&&se.pending.unshift(z.id),N!=="high"&&se.pending.push(z.id),se.pendingSet.add(z.id);se.pending.length>TM;){const Oe=se.pending.pop();Oe&&se.pendingSet.delete(Oe)}p2(J)}},Em=(z,N)=>{for(let J=1;J<=$M;J++){const ne=z[N+J];ne&&fs(ne,J===1?"high":"low");const le=z[N-J];le&&fs(le,J===1?"high":"low")}};re(()=>{const z=va();if(z.length===0)return;const N=l.id?z.findIndex(J=>J.id===l.id):0;if(N!==-1){if(!l.id){const J=z[N];J&&fs(J,"high")}Em(z,N)}});function g2(z){const N=va();if(N.length===0)return;const J=l.id?N.findIndex(se=>se.id===l.id):-1;let ne;J===-1?ne=z>0?0:N.length-1:ne=(J+z+N.length)%N.length;const le=N[ne];le&&(fs(le,"high"),Em(N,ne),_2(le))}function v2(z){const N=d.projects.list();if(N.length===0)return;const J=zn()?.worktree,ne=T()?nd(T()):void 0,le=J??ne,se=le?N.findIndex(Te=>Te.worktree===le):-1,$e=se===-1?z>0?N[0]:N[N.length-1]:N[(se+z+N.length)%N.length];$e&&(u.child($e.worktree),hs($e.worktree))}function b2(z){const N=va();if(N.length===0||!N.some(se=>g.session.unseenCount(se.id)>0))return;const ne=l.id?N.findIndex(se=>se.id===l.id):-1,le=ne===-1?z>0?-1:0:ne;for(let se=1;se<=N.length;se++){const $e=z>0?(le+se)%N.length:(le-se+N.length)%N.length,Te=N[$e];if(Te&&g.session.unseenCount(Te.id)!==0){fs(Te,"high"),Em(N,$e),_2(Te);return}}}async function Tm(z){const[N,J]=u.child(z.directory),ne=N.session??[],le=ne.findIndex($e=>$e.id===z.id),se=ne[le+1]??ne[le-1];await c.client.session.update({directory:z.directory,sessionID:z.id,time:{archived:Date.now()}}),J(He($e=>{const Te=At.search($e.session,z.id,Oe=>Oe.id);Te.found&&$e.session.splice(Te.index,1)})),z.id===l.id&&v(se?`/${l.dir}/session/${se.id}`:`/${l.dir}/session`)}k.register("layout",()=>{const z=[{id:"sidebar.toggle",title:I.t("command.sidebar.toggle"),category:I.t("command.category.view"),keybind:"mod+b",onSelect:()=>d.sidebar.toggle()},{id:"project.open",title:I.t("command.project.open"),category:I.t("command.category.project"),keybind:"mod+o",onSelect:()=>$m()},{id:"project.previous",title:I.t("command.project.previous"),category:I.t("command.category.project"),keybind:"mod+alt+arrowup",onSelect:()=>v2(-1)},{id:"project.next",title:I.t("command.project.next"),category:I.t("command.category.project"),keybind:"mod+alt+arrowdown",onSelect:()=>v2(1)},{id:"provider.connect",title:I.t("command.provider.connect"),category:I.t("command.category.provider"),onSelect:()=>y2()},{id:"server.switch",title:I.t("command.server.switch"),category:I.t("command.category.server"),onSelect:()=>MM()},{id:"settings.open",title:I.t("command.settings.open"),category:I.t("command.category.settings"),keybind:"mod+comma",onSelect:()=>w2()},{id:"session.previous",title:I.t("command.session.previous"),category:I.t("command.category.session"),keybind:"alt+arrowup",onSelect:()=>g2(-1)},{id:"session.next",title:I.t("command.session.next"),category:I.t("command.category.session"),keybind:"alt+arrowdown",onSelect:()=>g2(1)},{id:"session.previous.unseen",title:I.t("command.session.previous.unseen"),category:I.t("command.category.session"),keybind:"shift+alt+arrowup",onSelect:()=>b2(-1)},{id:"session.next.unseen",title:I.t("command.session.next.unseen"),category:I.t("command.category.session"),keybind:"shift+alt+arrowdown",onSelect:()=>b2(1)},{id:"session.archive",title:I.t("command.session.archive"),category:I.t("command.category.session"),keybind:"mod+shift+backspace",disabled:!l.dir||!l.id,onSelect:()=>{const N=va().find(J=>J.id===l.id);N&&Tm(N)}},{id:"workspace.new",title:I.t("workspace.new"),category:I.t("command.category.workspace"),keybind:"mod+shift+w",disabled:!u2(),onSelect:()=>{const N=zn();if(N)return A2(N)}},{id:"workspace.toggle",title:I.t("command.workspace.toggle"),description:I.t("command.workspace.toggle.description"),category:I.t("command.category.workspace"),slash:"workspace",disabled:!zn()||zn()?.vcs!=="git",onSelect:()=>{const N=zn();if(!N||N.vcs!=="git")return;const J=d.sidebar.workspaces(N.worktree)();d.sidebar.toggleWorkspaces(N.worktree),yn({title:J?I.t("toast.workspace.disabled.title"):I.t("toast.workspace.enabled.title"),description:J?I.t("toast.workspace.disabled.description"):I.t("toast.workspace.enabled.description")})}},{id:"theme.cycle",title:I.t("command.theme.cycle"),category:I.t("command.category.theme"),keybind:"mod+shift+t",onSelect:()=>wM(1)}];for(const[N]of $())z.push({id:`theme.set.${N}`,title:I.t("command.theme.set",{theme:x.name(N)}),category:I.t("command.category.theme"),onSelect:()=>x.commitPreview(),onHighlight:()=>(x.previewTheme(N),()=>x.cancelPreview())});z.push({id:"theme.scheme.cycle",title:I.t("command.theme.scheme.cycle"),category:I.t("command.category.theme"),keybind:"mod+shift+s",onSelect:()=>kM(1)});for(const N of H)z.push({id:`theme.scheme.${N}`,title:I.t("command.theme.scheme.set",{scheme:M(N)}),category:I.t("command.category.theme"),onSelect:()=>x.commitPreview(),onHighlight:()=>(x.previewColorScheme(N),()=>x.cancelPreview())});z.push({id:"language.cycle",title:I.t("command.language.cycle"),category:I.t("command.category.language"),onSelect:()=>xM(1)});for(const N of I.locales)z.push({id:`language.set.${N}`,title:I.t("command.language.set",{language:I.label(N)}),category:I.t("command.category.language"),onSelect:()=>a2(N)});return z});function y2(){const z=++s;O(()=>import("./dialog-select-provider-CKvDgZkl.js").then(N=>N.d),__vite__mapDeps([97,98,99,100])).then(N=>{a||s!==z||_.show(()=>C(N.DialogSelectProvider,{}))})}function MM(){const z=++s;O(()=>import("./dialog-select-server-BmCX76VX.js"),__vite__mapDeps([101,98,102,103])).then(N=>{a||s!==z||_.show(()=>C(N.DialogSelectServer,{}))})}function w2(){const z=++s;O(()=>import("./dialog-settings-BOysoQ60.js"),__vite__mapDeps([104,105,98,106,100,99,97])).then(N=>{a||s!==z||_.show(()=>C(N.DialogSettings,{}))})}function nd(z){const N=Ne(z),J=d.projects.list().find(Te=>Ne(Te.worktree)===N||Te.sandboxes?.some(Oe=>Ne(Oe)===N));if(J)return J.worktree;const ne=Object.entries(t.workspaceOrder).find(([Te,Oe])=>Ne(Te)===N||Oe.some(Pe=>Ne(Pe)===N));if(ne)return ne[0];const[le]=u.child(z,{bootstrap:!1}),se=le.project;return se?u.data.project.find(Te=>Te.id===se)?.worktree??z:z}function k2(z){return zn()?.worktree??nd(z)}function x2(z,N,J=k2(z)){return n("lastProjectSession",J,{directory:z,id:N,at:Date.now()}),J}function S2(z){t.lastProjectSession[z]&&n("lastProjectSession",He(N=>{delete N[z]}))}function DM(z,N,J=k2(z)){return x2(z,N,J),g.session.markViewed(N),Ye(()=>t.workspaceExpanded[z])===!1&&n("workspaceExpanded",z,!0),requestAnimationFrame(()=>CM(N,`${z}:${N}`)),J}async function rd(z){if(!z)return;const N=nd(z);p.projects.touch(N);const J=d.projects.list().find(Re=>Re.worktree===N);let ne=J?uf(N,[N,...J.sandboxes??[]],t.workspaceOrder[N]):[N];const le=Re=>Re?ne.some(Lt=>Ne(Lt)===Ne(Re)):!1,se=async Re=>{if(!Re||Re===N||le(Re))return le(Re);const Lt=await c.client.worktree.list({directory:N}).then(ht=>ht.data??[]).catch(()=>[]);return ne=uf(N,[N,...Lt],t.workspaceOrder[N]),le(Re)},$e=async Re=>{if(!le(Re.directory))return!1;const[Lt]=u.child(Re.directory,{bootstrap:!1});if(Lt.session.some(Tt=>Tt.id===Re.id))return n("lastProjectSession",N,{directory:Re.directory,id:Re.id,at:Date.now()}),ti(`/${mt(Re.directory)}/session/${Re.id}`),!0;const ht=await c.client.session.get({sessionID:Re.id}).then(Tt=>Tt.data).catch(()=>{});return!ht?.directory||!le(ht.directory)?!1:(n("lastProjectSession",N,{directory:ht.directory,id:ht.id,at:Date.now()}),ti(`/${mt(ht.directory)}/session/${ht.id}`),!0)},Te=t.lastProjectSession[N];if(Te?.id){if(await se(Te.directory),await $e(Te))return;S2(N)}const Oe=O7(ne.map(Re=>u.child(Re,{bootstrap:!1})[0]),Date.now());if(Oe&&await $e(Oe))return;const Pe=O7(await Promise.all(ne.map(async Re=>({path:{directory:Re},session:await c.client.session.list({directory:Re}).then(Lt=>Lt.data??[]).catch(()=>[])}))),Date.now());Pe&&await $e(Pe)||ti(`/${mt(N)}/session`)}function _2(z){z&&ti(`/${mt(z.directory)}/session/${z.id}`)}function hs(z,N=!0){if(d.projects.open(z),N)return rd(z)}const C2=z=>{if(p.isLocal()){for(const N of zue(z))hs(N);for(const N of jue(z)){hs(N.directory,!1);const J=mt(N.directory);N.prompt&&cue(J,{prompt:N.prompt});const ne=N.prompt?`/${J}/session?prompt=${encodeURIComponent(N.prompt)}`:`/${J}/session`;ti(ne)}}};Pt(()=>{const z=N=>{const ne=N.detail?.urls??[];ne.length!==0&&C2(ne)};C2(Fue(window)),Kt(window,Pue,z)});async function OM(z,N){const J=n2(z);if(N===J)return;const ne=N===Nn(z.worktree)?"":N;if(z.id&&z.id!=="global"){await c.client.project.update({projectID:z.id,directory:z.worktree,name:ne});return}u.project.meta(z.worktree,{name:ne})}const PM=(z,N,J,ne)=>{(_m(z,J,ne)??ne??Nn(z))!==N&&l2(z,N,J,ne)};function I2(z){const N=d.projects.list(),J=Ne(z),ne=N.findIndex($e=>Ne($e.worktree)===J),le=Ne(zn()?.worktree??"")===J;if(ne===-1)return;const se=N[ne+1];if(!le){d.projects.close(z);return}if(!se){d.projects.close(z),v("/");return}ti(`/${mt(se.worktree)}/session`),d.projects.close(z),queueMicrotask(()=>{rd(se.worktree)})}function E2(z){if(d.sidebar.workspaces(z.worktree)()){d.sidebar.toggleWorkspaces(z.worktree);return}z.vcs==="git"&&d.sidebar.toggleWorkspaces(z.worktree)}const T2=z=>{const N=++s;O(()=>import("./dialog-edit-project-CpiVZTJ-.js"),[]).then(J=>{a||s!==N||_.show(()=>C(J.DialogEditProject,{project:z}))})};async function $m(){function z(N){if(Array.isArray(N)){for(const J of N)hs(J,!1);rd(N[0])}else N&&hs(N)}if(h.openDirectoryPickerDialog&&p.isLocal()){const N=await h.openDirectoryPickerDialog?.({title:I.t("command.project.open"),multiple:!0});z(N)}else{const N=++s;O(()=>import("./dialog-select-directory-Db0c-gQl.js"),__vite__mapDeps([107,108,98])).then(J=>{a||s!==N||_.show(()=>C(J.DialogSelectDirectory,{multiple:!0,onSelect:z}),()=>z(null))})}}const RM=async(z,N,J=!1)=>{if(N===z)return;const ne=T(),le=Ne(ne),se=Ne(N),$e=J||!!l.dir&&le===se;!J&&$e&&ti(`/${mt(z)}/session`),G(N,!0);const Te=await c.client.worktree.remove({directory:z,worktreeRemoveInput:{directory:N}}).then(Tt=>Tt.data).catch(Tt=>(yn({title:I.t("workspace.delete.failed.title"),description:mg(Tt,I.t("common.requestFailed"))}),!1));if(G(N,!1),!Te||(Ne(t.lastProjectSession[z]?.directory??"")===Ne(N)&&S2(z),u.set("project",He(Tt=>{const Fe=Tt.find(Me=>Me.worktree===z);Fe&&(Fe.sandboxes=(Fe.sandboxes??[]).filter(Me=>Me!==N))})),n("workspaceOrder",z,Tt=>(Tt??[]).filter(Fe=>Fe!==N)),d.projects.close(N),d.projects.open(z),$e))return;const Oe=T(),Pe=Ne(Oe),Re=d.projects.list().find(Tt=>Tt.worktree===z),ht=(Re?uf(z,[z,...Re.sandboxes??[]],t.workspaceOrder[z]):[z]).some(Tt=>Ne(Tt)===Pe);l.dir&&nd(Oe)===z&&!ht&&ti(`/${mt(z)}/session`)},NM=async(z,N)=>{if(N===z)return;G(N,!0);const J=yn({persistent:!0,title:I.t("workspace.resetting.title"),description:I.t("workspace.resetting.description")}),ne=()=>hl.dismiss(J),le=await c.client.session.list({directory:N}).then(Te=>Te.data??[]).catch(()=>[]);if(Cae(N,le.map(Te=>Te.id),h),await c.client.instance.dispose({directory:N}).catch(()=>{}),!await c.client.worktree.reset({directory:z,worktreeResetInput:{directory:N}}).then(Te=>Te.data).catch(Te=>(yn({title:I.t("workspace.reset.failed.title"),description:mg(Te,I.t("common.requestFailed"))}),!1))){G(N,!1),ne();return}const $e=Date.now();await Promise.all(le.filter(Te=>Te.time.archived===void 0).map(Te=>c.client.session.update({sessionID:Te.id,directory:Te.directory,time:{archived:$e}}).catch(()=>{}))),G(N,!1),ne(),yn({title:I.t("workspace.reset.success.title"),description:I.t("workspace.reset.success.description"),actions:[{label:I.t("command.session.new"),onClick:()=>{const Te=`/${mt(N)}/session`;v(Te),d.mobileSidebar.hide()}},{label:I.t("common.dismiss"),onClick:"dismiss"}]})};function zM(z){const N=q(()=>Nn(z.directory)),[J,ne]=qe({status:"loading",dirty:!1});Pt(()=>{c.client.file.status({directory:z.directory}).then($e=>{const Oe=($e.data??[]).length>0;ne({status:"ready",dirty:Oe})}).catch(()=>{ne({status:"error",dirty:!1})})});const le=()=>{const $e=!!l.dir&&Ne(T())===Ne(z.directory);$e&&ti(`/${mt(z.root)}/session`),_.close(),RM(z.root,z.directory,$e)},se=()=>J.status==="loading"?I.t("workspace.status.checking"):J.status==="error"?I.t("workspace.status.error"):J.dirty?I.t("workspace.status.dirty"):I.t("workspace.status.clean");return C(K1,{get title(){return I.t("workspace.delete.title")},fit:!0,get children(){var $e=Cfe(),Te=$e.firstChild,Oe=Te.firstChild,Pe=Oe.nextSibling,Re=Te.nextSibling;return X(Oe,()=>I.t("workspace.delete.confirm",{name:N()})),X(Pe,se),X(Re,C(rn,{variant:"ghost",size:"large",onClick:()=>_.close(),get children(){return I.t("common.cancel")}}),null),X(Re,C(rn,{variant:"primary",size:"large",get disabled(){return J.status==="loading"},onClick:le,get children(){return I.t("workspace.delete.button")}}),null),$e}})}function jM(z){const N=q(()=>Nn(z.directory)),[J,ne]=qe({status:"loading",dirty:!1,sessions:[]}),le=async()=>{const Re=(await c.client.session.list({directory:z.directory}).then(Lt=>Lt.data??[]).catch(()=>[])).filter(Lt=>Lt.time.archived===void 0);ne({sessions:Re})};Pt(()=>{c.client.file.status({directory:z.directory}).then(Pe=>{const Lt=(Pe.data??[]).length>0;ne({status:"ready",dirty:Lt}),le()}).catch(()=>{ne({status:"error",dirty:!1})})});const se=()=>{_.close(),NM(z.root,z.directory)},$e=()=>J.sessions.length,Te=()=>J.status==="loading"?I.t("workspace.status.checking"):J.status==="error"?I.t("workspace.status.error"):J.dirty?I.t("workspace.status.dirty"):I.t("workspace.status.clean"),Oe=()=>{const Pe=$e();return Pe===0?I.t("workspace.reset.archived.none"):Pe===1?I.t("workspace.reset.archived.one"):I.t("workspace.reset.archived.many",{count:Pe})};return C(K1,{get title(){return I.t("workspace.reset.title")},fit:!0,get children(){var Pe=Ife(),Re=Pe.firstChild,Lt=Re.firstChild,ht=Lt.nextSibling,Tt=ht.firstChild,Fe=Tt.nextSibling;Fe.nextSibling;var Me=Re.nextSibling;return X(Lt,()=>I.t("workspace.reset.confirm",{name:N()})),X(ht,Te,Tt),X(ht,Oe,Fe),X(ht,()=>I.t("workspace.reset.note"),null),X(Me,C(rn,{variant:"ghost",size:"large",onClick:()=>_.close(),get children(){return I.t("common.cancel")}}),null),X(Me,C(rn,{variant:"primary",size:"large",get disabled(){return J.status==="loading"},onClick:se,get children(){return I.t("workspace.reset.button")}}),null),Pe}})}const On={session:"",sessionProject:"",directory:""};re(Yt(()=>[i(),L().slug,l.id,zn()?.worktree,T()],([z,N,J,ne,le])=>{if(!z||!N||!le){On.session="",On.sessionProject="",On.directory="";return}if(!J){On.session="",On.sessionProject="",On.directory="";return}const se=`${N}/${J}`;if(!ne){On.session=se,On.directory=le,On.sessionProject="";return}if(p.projects.last()!==ne&&p.projects.touch(ne),se!==On.session||le!==On.directory){On.session=se,On.directory=le,On.sessionProject=DM(le,J,ne);return}ne!==On.sessionProject&&(On.directory=le,On.sessionProject=x2(le,J,ne))})),re(()=>{const z=d.sidebar.opened()?d.sidebar.width():48;document.documentElement.style.setProperty("--dialog-left-margin",`${z}px`)});const id=q(()=>Math.max(d.sidebar.width(),244)),$2=q(()=>Math.max(id()-64,0)),od=new Set;re(Yt(ed,z=>{if(z.length===0){od.clear();return}const N=new Set(z);for(const J of N)od.has(J)||u.project.loadSessions(J);od.clear();for(const J of N)od.add(J)},{defer:!0}));function FM(z){const N=W0(z);N&&(xe(void 0),n("activeProject",N))}function HM(z){const{draggable:N,droppable:J}=z;if(N&&J){const ne=d.projects.list(),le=ne.findIndex($e=>$e.worktree===N.id.toString()),se=ne.findIndex($e=>$e.worktree===J.id.toString());le!==se&&se!==-1&&d.projects.move(N.id.toString(),se)}}function VM(){n("activeProject",void 0)}function sd(z){if(!z)return[];const N=z.worktree,J=[N,...z.sandboxes??[]],ne=zn(),le=Ne(ne?.worktree??"")===Ne(z.worktree)?T():void 0,se=le&&Ne(le)!==Ne(N)&&!J.some(Oe=>Ne(Oe)===Ne(le))?le:void 0,$e=se?cf.get(se)?.status==="pending":!1,Te=uf(N,J,t.workspaceOrder[z.worktree]);return $e&&se?[N,se,...Te.filter(Oe=>Oe!==N)]:!se||$e?Te:[...Te,se]}const L2=q(()=>{if(d.sidebar.opened())return zn();const z=V();return z||zn()});function UM(z){const N=W0(z);N&&n("activeWorkspace",N)}function BM(z){const{draggable:N,droppable:J}=z;if(!N||!J)return;const ne=L2();if(!ne)return;const le=sd(ne),se=le.findIndex(Pe=>Pe===N.id.toString()),$e=le.findIndex(Pe=>Pe===J.id.toString());if(se===-1||$e===-1||se===$e)return;const Te=le.slice(),[Oe]=Te.splice(se,1);Oe&&(Te.splice($e,0,Oe),n("workspaceOrder",ne.worktree,Te.filter(Pe=>Ne(Pe)!==Ne(ne.worktree))))}function qM(){n("activeWorkspace",void 0)}const A2=async z=>{s2();const N=await c.client.worktree.create({directory:z.worktree}).then(se=>se.data).catch(se=>{yn({title:I.t("workspace.create.failed.title"),description:mg(se,I.t("common.requestFailed"))})});if(!N?.directory)return;l2(N.directory,N.branch,z.id,N.branch);const J=z.worktree,ne=Ne(N.directory),le=Ne(J);G(N.directory,!0),cf.pending(N.directory),n("workspaceExpanded",ne,!0),ne!==N.directory&&n("workspaceExpanded",N.directory,!0),n("workspaceOrder",z.worktree,se=>{const Te=(se??[]).filter(Oe=>{const Pe=Ne(Oe);return Pe!==le&&Pe!==ne});return[N.directory,...Te]}),u.child(N.directory),ti(`/${mt(N.directory)}/session`)},M2={currentDir:T,navList:va,sidebarExpanded:Ae,sidebarHovering:We,clearHoverProjectSoon:Ue,prefetchSession:fs,archiveSession:Tm,workspaceName:_m,renameWorkspace:PM,editorOpen:St,openEditor:pn,closeEditor:Yn,setEditor:Do,InlineEditor:Qu,isBusy:U,workspaceExpanded:(z,N)=>t.workspaceExpanded[z]??N,setWorkspaceExpanded:(z,N)=>n("workspaceExpanded",z,N),showResetWorkspaceDialog:(z,N)=>_.show(()=>C(jM,{root:z,directory:N})),showDeleteWorkspaceDialog:(z,N)=>_.show(()=>C(zM,{root:z,directory:N})),setScrollContainerRef:(z,N)=>{N||(o=z)}},WM={currentDir:T,currentProject:zn,sidebarOpened:()=>d.sidebar.opened(),sidebarHovering:We,hoverProject:()=>E.hoverProject,onProjectMouseEnter:(z,N)=>Se.enter(z,N),onProjectMouseLeave:z=>Se.leave(z),onProjectFocus:z=>Se.activate(z),onHoverOpenChanged:(z,N)=>{!N&&E.hoverProject&&E.hoverProject!==z||D("hoverProject",N?z:void 0)},navigateToProject:rd,openSidebar:()=>d.sidebar.open(),closeProject:I2,showEditProjectDialog:T2,toggleProjectWorkspaces:E2,workspacesEnabled:z=>z.vcs==="git"&&d.sidebar.workspaces(z.worktree)(),workspaceIds:sd,workspaceLabel:c2,sessionProps:{navList:va,sidebarExpanded:Ae,clearHoverProjectSoon:Ue,prefetchSession:fs,archiveSession:Tm}},Lm=z=>{const N=z.project,J=q(()=>z.mobile||(z.merged??d.sidebar.opened())),ne=q(()=>!z.mobile&&z.merged===!1&&!d.sidebar.opened()),le=q(()=>!l.dir&&d.projects.list().length===0),se=q(()=>{const Me=N();return Me?Me.name||Nn(Me.worktree):""}),$e=q(()=>N()?.id??""),Te=q(()=>N()?.worktree??""),Oe=q(()=>{const Me=Te();return Me?mt(Me):""}),Pe=q(()=>{const Me=N();return Me?sd(Me):[]}),Re=q(()=>Pe().reduce((Me,sr)=>Me+g.project.unseenCount(sr),0)),Lt=()=>Pe().filter(Me=>g.project.unseenCount(Me)>0).forEach(Me=>g.project.markViewed(Me)),ht=q(()=>{const Me=N();return!Me||Me.vcs!=="git"?!1:d.sidebar.workspaces(Me.worktree)()}),Tt=q(()=>{const Me=N();return Me?Me.vcs==="git"||d.sidebar.workspaces(Me.worktree)():!1}),Fe=q(()=>u.data.path.home);return(()=>{var Me=Mfe(),sr=Me.firstChild,Oo=sr.firstChild,Ei=Oo.firstChild,ms=Ei.firstChild,ba=ms.firstChild,Yi=ba.nextSibling,Kl=Yi.nextSibling,ad=ms.nextSibling;return X(Me,C(Ce,{get when(){return N()},get fallback(){return C(Ce,{get when(){return le()},get children(){var gn=Dfe(),vn=gn.firstChild,Pn=vn.firstChild,Vt=Pn.firstChild,ld=Vt.nextSibling;return X(Vt,()=>I.t("sidebar.empty.title")),X(ld,()=>I.t("sidebar.empty.description")),X(vn,C(rn,{size:"large",icon:"folder-add-left",onClick:$m,get children(){return I.t("command.project.open")}}),null),gn}})},get children(){return[(()=>{var gn=Tfe(),vn=gn.firstChild,Pn=vn.firstChild;return X(Pn,C(Qu,{get id(){return`project:${$e()}`},value:se,onSave:Vt=>{const ld=N();ld&&OM(ld,Vt)},class:"text-14-medium text-text-strong truncate",displayClass:"text-14-medium text-text-strong truncate",stopPropagation:!0}),null),X(Pn,C($r,{placement:"bottom",gutter:2,get value(){return Te()},class:"shrink-0",contentStyle:{"max-width":"640px",transform:"translate3d(52px, 0, 0)"},get children(){var Vt=Efe();return X(Vt,()=>Te().replace(Fe(),"~")),Vt}}),null),X(vn,C(Bt,{get modal(){return!We()},get children(){return[C(Bt.Trigger,{as:Wr,icon:"dot-grid",variant:"ghost","data-action":"project-menu",get"data-project"(){return Oe()},class:"shrink-0 size-6 rounded-md transition-opacity data-[expanded]:bg-surface-base-active",get classList(){return{"opacity-100":z.mobile||J(),"opacity-0 group-hover/project:opacity-100 group-focus-within/project:opacity-100 data-[expanded]:opacity-100":!z.mobile&&!J()}},get"aria-label"(){return I.t("common.moreOptions")}}),C(Bt.Portal,{get children(){return C(Bt.Content,{class:"mt-1",get children(){return[C(Bt.Item,{onSelect:()=>{const Vt=N();Vt&&T2(Vt)},get children(){return C(Bt.ItemLabel,{get children(){return I.t("common.edit")}})}}),C(Bt.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return Oe()},get disabled(){return!Tt()},onSelect:()=>{const Vt=N();Vt&&E2(Vt)},get children(){return C(Bt.ItemLabel,{get children(){return it(()=>!!ht())()?I.t("sidebar.workspaces.disable"):I.t("sidebar.workspaces.enable")}})}}),C(Bt.Item,{"data-action":"project-clear-notifications",get"data-project"(){return Oe()},get disabled(){return Re()===0},onSelect:Lt,get children(){return C(Bt.ItemLabel,{get children(){return I.t("sidebar.project.clearNotifications")}})}}),C(Bt.Separator,{}),C(Bt.Item,{"data-action":"project-close-menu",get"data-project"(){return Oe()},onSelect:()=>{const Vt=Te();Vt&&I2(Vt)},get children(){return C(Bt.ItemLabel,{get children(){return I.t("common.close")}})}})]}})}})]}}),null),gn})(),(()=>{var gn=Afe();return X(gn,C(Ce,{get when(){return ht()},get fallback(){return[(()=>{var vn=j7();return X(vn,C(rn,{size:"large",icon:"new-session",class:"w-full",onClick:()=>{const Pn=Te();Pn&&ti(`/${mt(Pn)}/session`)},get children(){return I.t("command.session.new")}})),vn})(),(()=>{var vn=Ofe();return X(vn,C(zde,{ctx:M2,get project(){return N()},sortNow:Y,get mobile(){return z.mobile}})),vn})()]},get children(){return[(()=>{var vn=j7();return X(vn,C(rn,{size:"large",icon:"plus-small",class:"w-full",onClick:()=>{const Pn=N();Pn&&A2(Pn)},get children(){return I.t("workspace.new")}})),vn})(),(()=>{var vn=Lfe();return X(vn,C(IA,{onDragStart:UM,onDragEnd:qM,onDragOver:BM,collisionDetector:_A,get children(){return[C(EA,{}),C(OA,{}),(()=>{var Pn=$fe();return Cr(Vt=>{z.mobile||(o=Vt)},Pn),X(Pn,C(LA,{get ids(){return Pe()},get children(){return C(zi,{get each(){return Pe()},children:Vt=>C(Nde,{ctx:M2,directory:Vt,get project(){return N()},sortNow:Y,get mobile(){return z.mobile}})})}})),Pn})(),C(TA,{get children(){return C(Ode,{sidebarProject:L2,activeWorkspace:()=>t.activeWorkspace,workspaceLabel:c2})}})]}})),vn})()]}})),gn})()]}}),sr),X(ba,()=>I.t("sidebar.gettingStarted.title")),X(Yi,()=>I.t("sidebar.gettingStarted.line1")),X(Kl,()=>I.t("sidebar.gettingStarted.line2")),X(ad,C(rn,{size:"large",icon:"plus-small",onClick:y2,get children(){return I.t("command.provider.connect")}}),null),X(ad,C(rn,{size:"large",variant:"ghost",onClick:()=>n("gettingStartedDismissed",!0),get children(){return I.t("toast.update.action.notYet")}}),null),Ve(gn=>{var vn={"flex flex-col min-h-0 min-w-0 box-border rounded-tl-[12px] px-3":!0,"border border-b-0 border-border-weak-base":!J(),"border-l border-t border-border-weaker-base":J(),"bg-background-base":J()||ne(),"bg-background-stronger":!J()&&!ne(),"flex-1 min-w-0":z.mobile,"max-w-full overflow-hidden":z.mobile},Pn=z.mobile?void 0:`${$2()}px`,Vt=!!(t.gettingStartedDismissed||!(y.all().length>0&&y.paid().length===0));return gn.e=Ft(Me,vn,gn.e),Pn!==gn.t&&Xn(Me,"width",gn.t=Pn),Vt!==gn.a&&sr.classList.toggle("hidden",gn.a=Vt),gn},{e:void 0,t:void 0,a:void 0}),Me})()},D2=()=>d.projects.list(),GM=()=>C(gfe,{projects:D2,activeProject:()=>t.activeProject}),O2=z=>C(_fe,{mobile:z,opened:()=>d.sidebar.opened(),get aimMove(){return Se.move},projects:D2,renderProject:N=>C(yfe,{ctx:WM,project:N,sortNow:Y,mobile:z}),handleDragStart:FM,handleDragEnd:VM,handleDragOver:HM,get openProjectLabel(){return I.t("command.project.open")},openProjectKeybind:()=>k.keybind("project.open"),onOpenProject:$m,renderProjectOverlay:GM,settingsLabel:()=>I.t("sidebar.settings"),settingsKeybind:()=>k.keybind("settings.open"),onOpenSettings:w2,helpLabel:()=>I.t("sidebar.help"),onOpenHelp:()=>h.openLink("https://duckmind.ai/desktop-feedback"),renderPanel:()=>z?C(Lm,{project:zn,mobile:!0}):C(Lm,{project:zn,merged:!0})});return(()=>{var z=Rfe(),N=z.firstChild,J=N.firstChild,ne=J.firstChild,le=ne.firstChild,se=le.firstChild,$e=le.nextSibling,Te=$e.nextSibling,Oe=Te.firstChild,Pe=Oe.nextSibling,Re=Te.nextSibling,Lt=Re.firstChild,ht=Re.nextSibling,Tt=ht.nextSibling;return Tt.firstChild,X(z,C(Aue,{}),N),le.addEventListener("mouseleave",()=>{Se.reset(),We()&&or()}),le.addEventListener("mouseenter",()=>{lt()}),Cr(Fe=>{D("nav",Fe)},le),Ft(le,{"hidden xl:block":!0,"absolute inset-y-0 left-0":!0,"z-10":!0}),X(se,O2),X(ne,C(Ce,{get when(){return d.sidebar.opened()},get children(){var Fe=Pfe();return Fe.$$pointerdown=()=>D("sizing",!0),X(Fe,C(Nae,{direction:"horizontal",get size(){return d.sidebar.width()},min:244,get max(){return typeof window>"u"?1e3:window.innerWidth*.3+64},onResize:Me=>{D("sizing",!0),ee!==void 0&&clearTimeout(ee),ee=window.setTimeout(()=>D("sizing",!1),120),d.sidebar.resize(Me)}})),Ve(Me=>Xn(Fe,"left",`${id()}px`)),Fe}}),$e),Oe.$$click=Fe=>{Fe.target===Fe.currentTarget&&d.mobileSidebar.hide()},Pe.$$click=Fe=>Fe.stopPropagation(),X(Pe,()=>O2(!0)),Ft(Lt,{"size-full overflow-x-hidden flex flex-col items-start contain-strict border-t border-border-weak-base bg-background-base xl:border-l xl:rounded-tl-[12px]":!0}),X(Lt,C(Ce,{get when(){return!IM.loading},get fallback(){return Nfe()},get children(){return e.children}})),ht.addEventListener("mouseleave",()=>{or()}),ht.$$pointerdown=lt,ht.addEventListener("mouseenter",()=>{lt(),Se.reset()}),ht.$$mousemove=lt,X(ht,C(Ce,{get when(){return ft()},get children(){return C(Lm,{project:ft,merged:!1})}})),X(N,(()=>{var Fe=it(()=>!1);return()=>Fe()&&C(pue,{})})(),null),X(z,C(Uo.Region,{}),null),Ve(Fe=>{var Me=I.t("sidebar.nav.projectsAndSessions"),sr=`${id()}px`,Oo={"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200":!0,"opacity-100 pointer-events-auto":d.mobileSidebar.opened(),"opacity-0 pointer-events-none":!d.mobileSidebar.opened()},Ei=I.t("sidebar.nav.projectsAndSessions"),ms={"@container fixed top-10 bottom-0 left-0 z-50 w-full max-w-[400px] overflow-hidden border-r border-border-weaker-base bg-background-base transition-transform duration-200 ease-out":!0,"translate-x-0":d.mobileSidebar.opened(),"-translate-x-full":!d.mobileSidebar.opened()},ba={"absolute inset-0":!0,"xl:inset-y-0 xl:right-0 xl:left-[var(--main-left)]":!0,"z-20":!0,"transition-[left] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-[left] motion-reduce:transition-none":!E.sizing},Yi=d.sidebar.opened()?`${id()}px`:"4rem",Kl={"hidden xl:flex absolute inset-y-0 left-16 z-30":!0,"opacity-100 translate-x-0 pointer-events-auto":E.peeked&&!d.sidebar.opened(),"opacity-0 -translate-x-2 pointer-events-none":!E.peeked||d.sidebar.opened(),"transition-[opacity,transform] motion-reduce:transition-none":!0,"duration-180 ease-out":E.peeked&&!d.sidebar.opened(),"duration-120 ease-in":!E.peeked||d.sidebar.opened()},ad={"hidden xl:block pointer-events-none absolute inset-y-0 right-0 z-25 overflow-hidden":!0,"opacity-100 translate-x-0":E.peeked&&!d.sidebar.opened(),"opacity-0 -translate-x-2":!E.peeked||d.sidebar.opened(),"transition-[opacity,transform] motion-reduce:transition-none":!0,"duration-180 ease-out":E.peeked&&!d.sidebar.opened(),"duration-120 ease-in":!E.peeked||d.sidebar.opened()},gn=`calc(4rem + ${$2()}px)`;return Me!==Fe.e&&vt(le,"aria-label",Fe.e=Me),sr!==Fe.t&&Xn(le,"width",Fe.t=sr),Fe.a=Ft(Oe,Oo,Fe.a),Ei!==Fe.o&&vt(Pe,"aria-label",Fe.o=Ei),Fe.i=Ft(Pe,ms,Fe.i),Fe.n=Ft(Re,ba,Fe.n),Yi!==Fe.s&&Xn(Re,"--main-left",Fe.s=Yi),Fe.h=Ft(ht,Kl,Fe.h),Fe.r=Ft(Tt,ad,Fe.r),gn!==Fe.d&&Xn(Tt,"left",Fe.d=gn),Fe},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),z})()}Jr(["pointerdown","click","mousemove"]);var jfe=["id","name","validationState","required","disabled","readOnly"];function Ffe(e){const t=`form-control-${Mn()}`,n=et({id:t},e),[r,i]=we(),[o,s]=we(),[a,l]=we(),[c,u]=we(),d=(p,g,b)=>{const v=b!=null||r()!=null;return[b,r(),v&&g!=null?p:void 0].filter(Boolean).join(" ")||void 0},f=p=>[a(),c(),p].filter(Boolean).join(" ")||void 0,h=q(()=>({"data-valid":ce(n.validationState)==="valid"?"":void 0,"data-invalid":ce(n.validationState)==="invalid"?"":void 0,"data-required":ce(n.required)?"":void 0,"data-disabled":ce(n.disabled)?"":void 0,"data-readonly":ce(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>ce(n.name)??ce(n.id),dataset:h,validationState:()=>ce(n.validationState),isRequired:()=>ce(n.required),isDisabled:()=>ce(n.disabled),isReadOnly:()=>ce(n.readOnly),labelId:r,fieldId:o,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Bi(()=>ce(n.id)),registerLabel:Gn(i),registerField:Gn(s),registerDescription:Gn(l),registerErrorMessage:Gn(u)}}}var oM=yt();function Xu(){const e=wt(oM);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function sM(e){const t=Xu(),n=et({id:t.generateId("description")},e);return re(()=>ae(t.registerDescription(n.id))),C(pt,ie({as:"div"},()=>t.dataset(),n))}var Hfe=["id","aria-label","aria-labelledby","aria-describedby"];function Vfe(e){const t=Xu(),n=et({id:t.generateId("field")},e);return re(()=>ae(t.registerField(ce(n.id)))),{fieldProps:{id:()=>ce(n.id),ariaLabel:()=>ce(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy(ce(n.id),ce(n["aria-label"]),ce(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy(ce(n["aria-describedby"]))}}}function aM(e){let t;const n=Xu(),r=et({id:n.generateId("label")},e),[i,o]=pe(r,["ref"]),s=wu(()=>t,()=>"label");return re(()=>ae(n.registerLabel(o.id))),C(pt,ie({as:"label",ref(a){var l=Nt(c=>t=c,i.ref);typeof l=="function"&&l(a)},get for(){return it(()=>s()==="label")()?n.fieldId():void 0}},()=>n.dataset(),o))}function Ufe(e,t){re(Yt(e,n=>{if(n==null)return;const r=Bfe(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),ae(()=>{r.removeEventListener("reset",t)}))}))}function Bfe(e){return qfe(e)?e.form:e.closest("form")}function qfe(e){return e.matches("textarea, input, select, button")}function lM(e){const t=Xu(),n=et({id:t.generateId("error-message")},e),[r,i]=pe(n,["forceMount"]),o=()=>t.validationState()==="invalid";return re(()=>{o()&&ae(t.registerErrorMessage(i.id))}),C(Ce,{get when(){return r.forceMount||o()},get children(){return C(pt,ie({as:"div"},()=>t.dataset(),i))}})}var Wfe={};Ci(Wfe,{Description:()=>sM,ErrorMessage:()=>lM,Input:()=>uM,Label:()=>aM,Root:()=>fM,TextArea:()=>hM,TextField:()=>Cs,useTextFieldContext:()=>o2});var cM=yt();function o2(){const e=wt(cM);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function uM(e){return C(dM,ie({type:"text"},e))}function dM(e){const t=Xu(),n=o2(),r=et({id:n.generateId("input")},e),[i,o,s]=pe(r,["onInput"],Hfe),{fieldProps:a}=Vfe(o);return C(pt,ie({as:"input",get id(){return a.id()},get name(){return t.name()},get value(){return n.value()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},get onInput(){return cn([i.onInput,n.onInput])}},()=>t.dataset(),s))}function fM(e){let t;const n=`textfield-${Mn()}`,r=et({id:n},e),[i,o,s]=pe(r,["ref","value","defaultValue","onChange"],jfe),a=i.value,[l,c]=yu({value:()=>a===void 0?void 0:i.value??"",defaultValue:()=>i.defaultValue,onChange:h=>i.onChange?.(h)}),{formControlContext:u}=Ffe(o);Ufe(()=>t,()=>c(i.defaultValue??""));const d=h=>{if(u.isReadOnly()||u.isDisabled())return;const m=h.target;c(m.value),m.value=l()??""},f={value:l,generateId:Bi(()=>ce(o.id)),onInput:d};return C(oM.Provider,{value:u,get children(){return C(cM.Provider,{value:f,get children(){return C(pt,ie({as:"div",ref(h){var m=Nt(p=>t=p,i.ref);typeof m=="function"&&m(h)},role:"group",get id(){return ce(o.id)}},()=>u.dataset(),s))}})}})}function hM(e){let t;const n=o2(),r=et({id:n.generateId("textarea")},e),[i,o]=pe(r,["ref","autoResize","submitOnEnter","onKeyPress"]);re(Yt([()=>t,()=>i.autoResize,()=>n.value()],([a,l])=>{!a||!l||Gfe(a)}));const s=a=>{t&&i.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&t.form&&(t.form.requestSubmit(),a.preventDefault())};return C(dM,ie({as:"textarea",get"aria-multiline"(){return i.submitOnEnter?"false":void 0},get onKeyPress(){return cn([i.onKeyPress,s])},ref(a){var l=Nt(c=>t=c,i.ref);typeof l=="function"&&l(a)}},o))}function Gfe(e){const t=e.style.alignSelf,n=e.style.overflow;"MozAppearance"in e.style||(e.style.overflow="hidden"),e.style.alignSelf="start",e.style.height="auto",e.style.height=`${e.scrollHeight+(e.offsetHeight-e.clientHeight)}px`,e.style.overflow=n,e.style.alignSelf=t}var Cs=Object.assign(fM,{Description:sM,ErrorMessage:lM,Input:uM,Label:aM,TextArea:hM}),Zfe=me("<div data-slot=input-wrapper>");function Kfe(e){const t=ku(),[n,r]=pe(e,["name","defaultValue","value","onChange","onKeyDown","validationState","required","disabled","readOnly","class","label","hideLabel","description","error","variant","copyable","copyKind","multiline"]),[i,o]=we(!1),s=()=>i()?t.t("ui.textField.copied"):n.copyKind==="link"?t.t("ui.textField.copyLink"):t.t("ui.textField.copyToClipboard"),a=()=>i()?"check":n.copyKind==="link"?"link":"copy";async function l(){const u=n.value??n.defaultValue??"";await navigator.clipboard.writeText(u),o(!0),setTimeout(()=>o(!1),2e3)}function c(){n.copyable&&l()}return C(Cs,{"data-component":"input",get"data-variant"(){return n.variant||"normal"},get name(){return n.name},get defaultValue(){return n.defaultValue},get value(){return n.value},get onChange(){return n.onChange},get onKeyDown(){return n.onKeyDown},onClick:c,get required(){return n.required},get disabled(){return n.disabled},get readOnly(){return n.readOnly},get validationState(){return n.validationState},get children(){return[C(Ce,{get when(){return n.label},get children(){return C(Cs.Label,{"data-slot":"input-label",get classList(){return{"sr-only":n.hideLabel}},get children(){return n.label}})}}),(()=>{var u=Zfe();return X(u,C(Ce,{get when(){return n.multiline},get fallback(){return C(Cs.Input,ie(r,{"data-slot":"input-input",get class(){return n.class}}))},get children(){return C(Cs.TextArea,ie(r,{autoResize:!0,"data-slot":"input-input",get class(){return n.class}}))}}),null),X(u,C(Ce,{get when(){return n.copyable},get children(){return C($r,{get value(){return s()},placement:"top",gutter:4,get forceOpen(){return i()},skipDelayDuration:0,get children(){return C(Wr,{type:"button",get icon(){return a()},variant:"ghost",onClick:l,tabIndex:-1,"data-slot":"input-copy-button",get"aria-label"(){return s()}})}})}}),null),u})(),C(Ce,{get when(){return n.description},get children(){return C(Cs.Description,{"data-slot":"input-description",get children(){return n.description}})}}),C(Cs.ErrorMessage,{"data-slot":"input-error",get children(){return n.error}})]}})}var Yfe=me('<div class="relative flex-1 h-screen w-screen min-h-0 flex flex-col items-center justify-center bg-background-base font-sans"><div class="w-2/3 max-w-3xl flex flex-col items-center justify-center gap-8"><div class="flex flex-col items-center gap-2 text-center"><h1 class="text-lg font-medium text-text-strong"></h1><p class="text-sm text-text-weak"></p></div><div class="flex items-center gap-3"></div><div class="flex flex-col items-center gap-2"><div class="flex items-center justify-center gap-1"><button type=button class="flex items-center text-text-interactive-base gap-1"><div>'),Jfe=me('<p class="text-xs text-text-danger-base text-center max-w-2xl">'),Xfe=me('<p class="text-xs text-text-weak">');const df=`
|
|
2403
|
+
${t}`,Mae=e=>{if(!e||typeof e!="object")return{session:{}};const t=e;return t.session&&typeof t.session=="object"?{session:t.session}:!t.pick||typeof t.pick!="object"?{session:{}}:{session:Object.fromEntries(Object.entries(t.pick).filter(([n])=>n!==Aae))}},g7=e=>{if(e)return{...e,model:e.model?{...e.model}:void 0}},{use:Ihe,provider:Dae}=Xt({name:"Local",init:()=>{const e=pr(),t=Wh(),n=A4(),r=V4(),i=Gse(),o=q(()=>e.id||void 0),s=q(()=>n.data.agent.filter(M=>M.mode!=="subagent"&&!M.hidden)),a=q(()=>new Set(r.connected().map(M=>M.id))),[l,c]=Sn({...Jt.workspace(t.directory,"model-selection",["model-selection.v1"]),migrate:Mae},qe({session:{}})),[u,d]=qe({current:s()[0]?.name,draft:void 0,last:void 0}),f=M=>!!r.all().find(E=>E.id===M.providerID)?.models[M.modelID]&&a().has(M.providerID),h=(...M)=>{for(const T of M){const E=T();if(E&&f(E))return E}},m=M=>{const T=s();if(T.length!==0)return T.find(E=>E.name===M)??T[0]};re(()=>{const M=s();if(M.length===0){u.current!==void 0&&d("current",void 0);return}M.some(T=>T.name===u.current)||d("current",M[0]?.name)});const p=q(()=>{const M=o();return M?l.session[M]??La.get(af(t.directory,M)):u.draft});re(()=>{const M=o();if(!M)return;const T=af(t.directory,M),E=La.get(T);if(E){if(l.session[M]!==void 0){La.delete(T);return}c("session",M,g7(E)),La.delete(T)}});const g=()=>{if(!n.data.config.model)return;const[M,T]=n.data.config.model.split("/"),E={providerID:M,modelID:T};if(f(E))return E},b=()=>{for(const M of i.recent.list())if(f(M))return M},v=()=>{const M=r.default();for(const T of r.connected()){const E=M[T.id];if(E){const G={providerID:T.id,modelID:E};if(f(G))return G}const D=Object.values(T.models)[0];if(!D)continue;const F={providerID:T.id,modelID:D.id};if(f(F))return F}},y=q(()=>g()??b()??v()),_={list:s,current(){return m(p()?.agent??u.current)},set(M){const T=m(M);if(!T){d("current",void 0);return}rt(()=>{d("current",T.name),d("last",{type:"agent",agent:T.name,model:T.model,variant:T.variant??null});const E=p(),D={agent:T.name,model:T.model??E?.model,variant:T.variant??E?.variant},F=o();if(F){c("session",F,D);return}d("draft",D)})},move(M){const T=s();if(T.length===0){d("current",void 0);return}let E=T.findIndex(F=>F.name===_.current()?.name)+M;E<0&&(E=T.length-1),E>=T.length&&(E=0);const D=T[E];D&&_.set(D.name)}},k=()=>{const M=h(()=>p()?.model,()=>_.current()?.model,y);if(M)return i.find(M)},x=()=>{const M=_.current(),T=k();if(!(!M||!T))return Tae({agent:{model:M.model,variant:M.variant},model:{providerID:T.provider.id,modelID:T.id,variants:T.variants}})},I=()=>p()?.variant,A=()=>{const M=k();return{agent:_.current()?.name,model:M?{providerID:M.provider.id,modelID:M.id}:void 0,variant:I()}},L=M=>{const T={...p()??{agent:_.current()?.name},...M},E=o();if(E){c("session",E,T);return}d("draft",T)},$=q(()=>i.recent.list().map(i.find).filter(Boolean)),H={ready:i.ready,current:k,recent:$,list:i.list,cycle(M){const T=$(),E=k();if(!E)return;const D=T.findIndex(U=>U?.provider.id===E.provider.id&&U?.id===E.id);if(D===-1)return;let F=D+M;F<0&&(F=T.length-1),F>=T.length&&(F=0);const G=T[F];G&&H.set({providerID:G.provider.id,modelID:G.id})},set(M,T){rt(()=>{d("last",{type:"model",agent:_.current()?.name,model:M??null,variant:I()}),L({model:M}),M&&(i.setVisibility(M,!0),T?.recent&&i.recent.push(M))})},visible(M){return i.visible(M)},setVisibility(M,T){i.setVisibility(M,T)},variant:{configured:x,selected:I,current(){return $ae({variants:this.list(),selected:this.selected(),configured:this.configured()})},list(){const M=k();return M?.variants?Object.keys(M.variants):[]},set(M){rt(()=>{const T=k();d("last",{type:"variant",agent:_.current()?.name,model:T?{providerID:T.provider.id,modelID:T.id}:null,variant:M??null}),L({variant:M??null})})},cycle(){const M=this.list();M.length!==0&&this.set(Lae({variants:M,selected:this.selected(),configured:this.configured()}))}}},j={slug:q(()=>mt(t.directory)),model:H,agent:_,session:{reset(){d("draft",void 0)},promote(M,T){const E=g7(A());if(E){if(M===t.directory){c("session",T,E),d("draft",void 0);return}La.set(af(M,T),E),d("draft",void 0)}},restore(M){const T=o();T&&M.sessionID===T&&l.session[T]===void 0&&(La.has(af(t.directory,T))||c("session",T,{agent:M.agent,model:M.model,variant:M.model.variant??null}))}}};if(zL()){const M=Symbol("model-probe");sg.bind(M,{setAgent:_.set,setModel:H.set,setVariant:H.variant.set}),re(()=>{const T=j.agent.current(),E=j.model.current();sg.set(M,{dir:t.directory,sessionID:o(),last:u.last,agent:T?.name,model:E?{providerID:E.provider.id,modelID:E.id,name:E.name}:void 0,variant:j.model.variant.current()??null,selected:j.model.variant.selected(),configured:j.model.variant.configured(),pick:p(),base:void 0,current:u.current,variants:j.model.variant.list(),models:j.model.list().filter(D=>j.model.visible({providerID:D.provider.id,modelID:D.id})).map(D=>({providerID:D.provider.id,modelID:D.id,name:D.name})),agents:j.agent.list().map(D=>({name:D.name}))})}),ae(()=>sg.clear(M))}return j}});function Oae(e){const t=Al(),n=ua(),r=pr(),i=A4(),o=q(()=>mt(e.directory));return re(()=>{const s=i.data.path.directory;if(!s||s===e.directory)return;const a=t.pathname.slice(o().length+1);n(`/${mt(s)}${a}${t.search}${t.hash}`,{replace:!0})}),re(()=>{const s=r.id;s&&i.session.sync(s)}),C(PD,{get data(){return i.data},get directory(){return e.directory},onNavigateToSession:s=>n(`/${o()}/session/${s}`),onSessionHref:s=>`/${o()}/session/${s}`,get children(){return C(Dae,{get children(){return e.children}})}})}function Pae(e){const t=pr(),n=En(),r=ua();let i="";const o=q(()=>t.dir?bo(t.dir)??"":"");return re(()=>{const s=t.dir;if(s){if(o()){i="";return}i!==s&&(i=s,yn({variant:"error",title:n.t("common.requestFailed"),description:n.t("directory.error.invalidUrl")}),r("/",{replace:!0}))}}),C(Ce,{get when(){return o()},keyed:!0,children:s=>C(Vne,{directory:()=>s,get children(){return C(Lre,{get children(){return C(Oae,{directory:s,get children(){return e.children}})}})}})})}var Rae=me("<div>");function Nae(e){const[t,n]=pe(e,["direction","edge","size","min","max","onResize","onCollapse","collapseThreshold","class","classList"]),r=i=>{i.preventDefault();const o=t.edge??(t.direction==="vertical"?"start":"end"),s=t.direction==="horizontal"?i.clientX:i.clientY,a=t.size;let l=a;document.body.style.userSelect="none",document.body.style.overflow="hidden";const c=d=>{const f=t.direction==="horizontal"?d.clientX:d.clientY,h=t.direction==="vertical"?o==="end"?f-s:s-f:o==="start"?s-f:f-s;l=a+h;const m=Math.min(t.max,Math.max(t.min,l));t.onResize(m)},u=()=>{document.body.style.userSelect="",document.body.style.overflow="",document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u);const d=t.collapseThreshold??0;t.onCollapse&&d>0&&l<d&&t.onCollapse()};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)};return(()=>{var i=Rae();return Zr(i,ie(n,{"data-component":"resize-handle",get"data-direction"(){return t.direction},get"data-edge"(){return t.edge??(t.direction==="vertical"?"start":"end")},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},onMouseDown:r}),!1,!1),i})()}var zae=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),jae=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Fae(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return zae.has(n)}const t=e.split("-")[0];return jae.has(t)}function Hae(e){return Fae(e)?"rtl":"ltr"}function jL(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Hae(e)}}var hv=jL(),Sc=new Set;function v7(){hv=jL();for(const e of Sc)e(hv)}function Vae(){const[e,t]=we(hv),n=q(()=>e());return Pt(()=>{Sc.size===0&&window.addEventListener("languagechange",v7),Sc.add(t),ae(()=>{Sc.delete(t),Sc.size===0&&window.removeEventListener("languagechange",v7)})}),{locale:()=>n().locale,direction:()=>n().direction}}var Uae=yt();function Lo(){const e=Vae();return wt(Uae)||e}var ag=new Map;function Bae(e){const{locale:t}=Lo(),n=q(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return q(()=>{const r=n();let i;return ag.has(r)&&(i=ag.get(r)),i||(i=new Intl.Collator(t(),e),ag.set(r,i)),i})}const qae=["top","right","bottom","left"],rs=Math.min,kr=Math.max,U0=Math.round,lf=Math.floor,Hi=e=>({x:e,y:e}),Wae={left:"right",right:"left",bottom:"top",top:"bottom"};function mv(e,t,n){return kr(e,rs(t,n))}function pa(e,t){return typeof e=="function"?e(t):e}function is(e){return e.split("-")[0]}function Bl(e){return e.split("-")[1]}function FL(e){return e==="x"?"y":"x"}function B4(e){return e==="y"?"height":"width"}function mo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function q4(e){return FL(mo(e))}function Gae(e,t,n){n===void 0&&(n=!1);const r=Bl(e),i=q4(e),o=B4(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=B0(s)),[s,B0(s)]}function Zae(e){const t=B0(e);return[pv(e),t,pv(t)]}function pv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const b7=["left","right"],y7=["right","left"],Kae=["top","bottom"],Yae=["bottom","top"];function Jae(e,t,n){switch(e){case"top":case"bottom":return n?t?y7:b7:t?b7:y7;case"left":case"right":return t?Kae:Yae;default:return[]}}function Xae(e,t,n,r){const i=Bl(e);let o=Jae(is(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(pv)))),o}function B0(e){const t=is(e);return Wae[t]+e.slice(t.length)}function Qae(e){return{top:0,right:0,bottom:0,left:0,...e}}function HL(e){return typeof e!="number"?Qae(e):{top:e,right:e,bottom:e,left:e}}function q0(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function w7(e,t,n){let{reference:r,floating:i}=e;const o=mo(t),s=q4(t),a=B4(s),l=is(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Bl(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}async function ele(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=pa(t,e),m=HL(h),g=a[f?d==="floating"?"reference":"floating":d],b=q0(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),_=await(o.isElement==null?void 0:o.isElement(y))?await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1}:{x:1,y:1},k=q0(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(b.top-k.top+m.top)/_.y,bottom:(k.bottom-b.bottom+m.bottom)/_.y,left:(b.left-k.left+m.left)/_.x,right:(k.right-b.right+m.right)/_.x}}const tle=50,nle=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:ele},l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=w7(c,r,l),f=r,h=0;const m={};for(let p=0;p<o.length;p++){const g=o[p];if(!g)continue;const{name:b,fn:v}=g,{x:y,y:_,data:k,reset:x}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});u=y??u,d=_??d,m[b]={...m[b],...k},x&&h<tle&&(h++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(c=x.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=w7(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},rle=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=pa(e,t)||{};if(c==null)return{};const d=HL(u),f={x:n,y:r},h=q4(i),m=B4(h),p=await s.getDimensions(c),g=h==="y",b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",_=o.reference[m]+o.reference[h]-f[h]-o.floating[m],k=f[h]-o.reference[h],x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let I=x?x[y]:0;(!I||!await(s.isElement==null?void 0:s.isElement(x)))&&(I=a.floating[y]||o.floating[m]);const A=_/2-k/2,L=I/2-p[m]/2-1,$=rs(d[b],L),H=rs(d[v],L),j=$,M=I-p[m]-H,T=I/2-p[m]/2+A,E=mv(j,T,M),D=!l.arrow&&Bl(i)!=null&&T!==E&&o.reference[m]/2-(T<j?$:H)-p[m]/2<0,F=D?T<j?T-j:T-M:0;return{[h]:f[h]+F,data:{[h]:E,centerOffset:T-E-F,...D&&{alignmentOffset:F}},reset:D}}}),ile=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=pa(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=is(i),v=mo(a),y=is(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=f||(y||!p?[B0(a)]:Zae(a)),x=m!=="none";!f&&x&&k.push(...Xae(a,p,m,_));const I=[a,...k],A=await l.detectOverflow(t,g),L=[];let $=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&L.push(A[b]),d){const T=Gae(i,s,_);L.push(A[T[0]],A[T[1]])}if($=[...$,{placement:i,overflows:L}],!L.every(T=>T<=0)){var H,j;const T=(((H=o.flip)==null?void 0:H.index)||0)+1,E=I[T];if(E&&(!(d==="alignment"?v!==mo(E):!1)||$.every(G=>mo(G.placement)===v?G.overflows[0]>0:!0)))return{data:{index:T,overflows:$},reset:{placement:E}};let D=(j=$.filter(F=>F.overflows[0]<=0).sort((F,G)=>F.overflows[1]-G.overflows[1])[0])==null?void 0:j.placement;if(!D)switch(h){case"bestFit":{var M;const F=(M=$.filter(G=>{if(x){const U=mo(G.placement);return U===v||U==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(U=>U>0).reduce((U,Z)=>U+Z,0)]).sort((G,U)=>G[1]-U[1])[0])==null?void 0:M[0];F&&(D=F);break}case"initialPlacement":D=a;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function k7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function x7(e){return qae.some(t=>e[t]>=0)}const ole=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=pa(e,t);switch(i){case"referenceHidden":{const s=await r.detectOverflow(t,{...o,elementContext:"reference"}),a=k7(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:x7(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...o,altBoundary:!0}),a=k7(s,n.floating);return{data:{escapedOffsets:a,escaped:x7(a)}}}default:return{}}}}},sle=new Set(["left","top"]);async function ale(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=is(n),a=Bl(n),l=mo(n)==="y",c=sle.has(s)?-1:1,u=o&&l?-1:1,d=pa(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const lle=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await ale(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},cle=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:v,y}=b;return{x:v,y}}},...c}=pa(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),f=mo(is(i)),h=FL(f);let m=u[h],p=u[f];if(s){const b=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=m+d[b],_=m-d[v];m=mv(y,m,_)}if(a){const b=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=p+d[b],_=p-d[v];p=mv(y,p,_)}const g=l.fn({...t,[h]:m,[f]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:s,[f]:a}}}}}},ule=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...c}=pa(e,t),u=await s.detectOverflow(t,c),d=is(i),f=Bl(i),h=mo(i)==="y",{width:m,height:p}=o.floating;let g,b;d==="top"||d==="bottom"?(g=d,b=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,g=f==="end"?"top":"bottom");const v=p-u.top-u.bottom,y=m-u.left-u.right,_=rs(p-u[g],v),k=rs(m-u[b],y),x=!t.middlewareData.shift;let I=_,A=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=v),x&&!f){const $=kr(u.left,0),H=kr(u.right,0),j=kr(u.top,0),M=kr(u.bottom,0);h?A=m-2*($!==0||H!==0?$+H:kr(u.left,u.right)):I=p-2*(j!==0||M!==0?j+M:kr(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:I});const L=await s.getDimensions(a.floating);return m!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function tm(){return typeof window<"u"}function ql(e){return VL(e)?(e.nodeName||"").toLowerCase():"#document"}function Tr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zi(e){var t;return(t=(VL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function VL(e){return tm()?e instanceof Node||e instanceof Tr(e).Node:!1}function xi(e){return tm()?e instanceof Element||e instanceof Tr(e).Element:!1}function Ao(e){return tm()?e instanceof HTMLElement||e instanceof Tr(e).HTMLElement:!1}function S7(e){return!tm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tr(e).ShadowRoot}function Yu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Si(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function dle(e){return/^(table|td|th)$/.test(ql(e))}function nm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fle=/transform|translate|scale|rotate|perspective|filter/,hle=/paint|layout|strict|content/,xs=e=>!!e&&e!=="none";let lg;function W4(e){const t=xi(e)?Si(e):e;return xs(t.transform)||xs(t.translate)||xs(t.scale)||xs(t.rotate)||xs(t.perspective)||!G4()&&(xs(t.backdropFilter)||xs(t.filter))||fle.test(t.willChange||"")||hle.test(t.contain||"")}function mle(e){let t=os(e);for(;Ao(t)&&!kl(t);){if(W4(t))return t;if(nm(t))return null;t=os(t)}return null}function G4(){return lg==null&&(lg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),lg}function kl(e){return/^(html|body|#document)$/.test(ql(e))}function Si(e){return Tr(e).getComputedStyle(e)}function rm(e){return xi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function os(e){if(ql(e)==="html")return e;const t=e.assignedSlot||e.parentNode||S7(e)&&e.host||Zi(e);return S7(t)?t.host:t}function UL(e){const t=os(e);return kl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ao(t)&&Yu(t)?t:UL(t)}function fu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=UL(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Tr(i);if(o){const a=gv(s);return t.concat(s,s.visualViewport||[],Yu(i)?i:[],a&&n?fu(a):[])}else return t.concat(i,fu(i,[],n))}function gv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BL(e){const t=Si(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ao(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=U0(n)!==o||U0(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Z4(e){return xi(e)?e:e.contextElement}function ol(e){const t=Z4(e);if(!Ao(t))return Hi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=BL(t);let s=(o?U0(n.width):n.width)/r,a=(o?U0(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ple=Hi(0);function qL(e){const t=Tr(e);return!G4()||!t.visualViewport?ple:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gle(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tr(e)?!1:t}function na(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Z4(e);let s=Hi(1);t&&(r?xi(r)&&(s=ol(r)):s=ol(e));const a=gle(o,n,r)?qL(o):Hi(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const f=Tr(o),h=r&&xi(r)?Tr(r):r;let m=f,p=gv(m);for(;p&&r&&h!==m;){const g=ol(p),b=p.getBoundingClientRect(),v=Si(p),y=b.left+(p.clientLeft+parseFloat(v.paddingLeft))*g.x,_=b.top+(p.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=y,c+=_,m=Tr(p),p=gv(m)}}return q0({width:u,height:d,x:l,y:c})}function im(e,t){const n=rm(e).scrollLeft;return t?t.left+n:na(Zi(e)).left+n}function WL(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-im(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function vle(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Zi(r),a=t?nm(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Hi(1);const u=Hi(0),d=Ao(r);if((d||!d&&!o)&&((ql(r)!=="body"||Yu(s))&&(l=rm(r)),d)){const h=na(r);c=ol(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=s&&!d&&!o?WL(s,l):Hi(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function ble(e){return Array.from(e.getClientRects())}function yle(e){const t=Zi(e),n=rm(e),r=e.ownerDocument.body,i=kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+im(e);const a=-n.scrollTop;return Si(r).direction==="rtl"&&(s+=kr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const _7=25;function wle(e,t){const n=Tr(e),r=Zi(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const u=G4();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=im(r);if(c<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-h);m<=_7&&(o-=m)}else c<=_7&&(o+=c);return{width:o,height:s,x:a,y:l}}function kle(e,t){const n=na(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Ao(e)?ol(e):Hi(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function C7(e,t,n){let r;if(t==="viewport")r=wle(e,n);else if(t==="document")r=yle(Zi(e));else if(xi(t))r=kle(t,n);else{const i=qL(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return q0(r)}function GL(e,t){const n=os(e);return n===t||!xi(n)||kl(n)?!1:Si(n).position==="fixed"||GL(n,t)}function xle(e,t){const n=t.get(e);if(n)return n;let r=fu(e,[],!1).filter(a=>xi(a)&&ql(a)!=="body"),i=null;const o=Si(e).position==="fixed";let s=o?os(e):e;for(;xi(s)&&!kl(s);){const a=Si(s),l=W4(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Yu(s)&&!l&&GL(e,s))?r=r.filter(u=>u!==s):i=a,s=os(s)}return t.set(e,r),r}function Sle(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?nm(t)?[]:xle(t,this._c):[].concat(n),r],a=C7(t,s[0],i);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f<s.length;f++){const h=C7(t,s[f],i);l=kr(h.top,l),c=rs(h.right,c),u=rs(h.bottom,u),d=kr(h.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function _le(e){const{width:t,height:n}=BL(e);return{width:t,height:n}}function Cle(e,t,n){const r=Ao(t),i=Zi(t),o=n==="fixed",s=na(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Hi(0);function c(){l.x=im(i)}if(r||!r&&!o)if((ql(t)!=="body"||Yu(i))&&(a=rm(t)),r){const h=na(t,!0,o,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?WL(i,a):Hi(0),d=s.left+a.scrollLeft-l.x-u.x,f=s.top+a.scrollTop-l.y-u.y;return{x:d,y:f,width:s.width,height:s.height}}function cg(e){return Si(e).position==="static"}function I7(e,t){if(!Ao(e)||Si(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Zi(e)===n&&(n=n.ownerDocument.body),n}function ZL(e,t){const n=Tr(e);if(nm(e))return n;if(!Ao(e)){let i=os(e);for(;i&&!kl(i);){if(xi(i)&&!cg(i))return i;i=os(i)}return n}let r=I7(e,t);for(;r&&dle(r)&&cg(r);)r=I7(r,t);return r&&kl(r)&&cg(r)&&!W4(r)?n:r||mle(e)||n}const Ile=async function(e){const t=this.getOffsetParent||ZL,n=this.getDimensions,r=await n(e.floating);return{reference:Cle(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ele(e){return Si(e).direction==="rtl"}const KL={convertOffsetParentRelativeRectToViewportRelativeRect:vle,getDocumentElement:Zi,getClippingRect:Sle,getOffsetParent:ZL,getElementRects:Ile,getClientRects:ble,getDimensions:_le,getScale:ol,isElement:xi,isRTL:Ele};function YL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tle(e,t){let n=null,r;const i=Zi(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(a||t(),!f||!h)return;const m=lf(d),p=lf(i.clientWidth-(u+f)),g=lf(i.clientHeight-(d+h)),b=lf(u),y={rootMargin:-m+"px "+-p+"px "+-g+"px "+-b+"px",threshold:kr(0,rs(1,l))||1};let _=!0;function k(x){const I=x[0].intersectionRatio;if(I!==l){if(!_)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!YL(c,e.getBoundingClientRect())&&s(),_=!1}try{n=new IntersectionObserver(k,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,y)}n.observe(e)}return s(!0),o}function $le(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Z4(e),u=i||o?[...c?fu(c):[],...t?fu(t):[]]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=c&&a?Tle(c,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),c&&!l&&h.observe(c),t&&h.observe(t));let m,p=l?na(e):null;l&&g();function g(){const b=na(e);p&&!YL(p,b)&&n(),p=b,m=requestAnimationFrame(g)}return n(),()=>{var b;u.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d?.(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const Lle=lle,Ale=cle,Mle=ile,Dle=ule,Ole=ole,Ple=rle,Rle=(e,t,n)=>{const r=new Map,i={platform:KL,...n},o={...i.platform,_c:r};return nle(e,t,{...i,platform:o})};var Nle=me('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),K4=yt();function Y4(){const e=wt(K4);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var vv=30,E7=vv/2,zle={top:180,right:-90,bottom:0,left:90};function Mo(e){const t=Y4(),n=et({size:vv},e),[r,i]=pe(n,["ref","style","size"]),o=()=>t.currentPlacement().split("-")[0],s=jle(t.contentRef),a=()=>s()?.getPropertyValue("background-color")||"none",l=()=>s()?.getPropertyValue(`border-${o()}-color`)||"none",c=()=>s()?.getPropertyValue(`border-${o()}-width`)||"0px",u=()=>Number.parseInt(c())*2*(vv/r.size),d=()=>`rotate(${zle[o()]} ${E7} ${E7}) translate(0 2)`;return C(pt,ie({as:"div",ref(f){var h=Nt(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return _i({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){var f=Nle(),h=f.firstChild,m=h.firstChild;return m.nextSibling,Ve(()=>vt(h,"transform",d())),f}}))}function jle(e){const[t,n]=we();return re(()=>{const r=e();r&&n(Sv(r).getComputedStyle(r))}),t}function Fle(e){const t=Y4(),[n,r]=pe(e,["ref","style"]);return C(pt,ie({as:"div",ref(i){var o=Nt(t.setPositionerRef,n.ref);typeof o=="function"&&o(i)},"data-popper-positioner":"",get style(){return _i({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function T7(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const o={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...o,toJSON:()=>o}}function Hle(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?T7(r):e?e.getBoundingClientRect():T7()}}}function Vle(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Ule={top:"bottom",right:"left",bottom:"top",left:"right"};function Ble(e,t){const[n,r]=e.split("-"),i=Ule[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function qle(e){const t=et({getAnchorRect:f=>f?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=we(),[i,o]=we(),[s,a]=we(t.placement),l=()=>Hle(t.anchorRef?.(),t.getAnchorRect),{direction:c}=Lo();async function u(){const f=l(),h=n(),m=i();if(!f||!h)return;const p=(m?.clientHeight||0)/2,g=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const b=[Lle(({placement:x})=>{const I=!!x.split("-")[1];return{mainAxis:g,crossAxis:I?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const x=typeof t.flip=="string"?t.flip.split(" "):void 0;if(x!==void 0&&!x.every(Vle))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(Mle({padding:t.overflowPadding,fallbackPlacements:x}))}(t.slide||t.overlap)&&b.push(Ale({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(Dle({padding:t.overflowPadding,apply({availableWidth:x,availableHeight:I,rects:A}){const L=Math.round(A.reference.width);x=Math.floor(x),I=Math.floor(I),h.style.setProperty("--kb-popper-anchor-width",`${L}px`),h.style.setProperty("--kb-popper-content-available-width",`${x}px`),h.style.setProperty("--kb-popper-content-available-height",`${I}px`),t.sameWidth&&(h.style.width=`${L}px`),t.fitViewport&&(h.style.maxWidth=`${x}px`,h.style.maxHeight=`${I}px`)}})),t.hideWhenDetached&&b.push(Ole({padding:t.detachedPadding})),m&&b.push(Ple({element:m,padding:t.arrowPadding}));const v=await Rle(f,h,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...KL,isRTL:()=>c()==="rtl"}});if(a(v.placement),t.onCurrentPlacementChange?.(v.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",Ble(v.placement,c()));const y=Math.round(v.x),_=Math.round(v.y);let k;if(t.hideWhenDetached&&(k=v.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${y}px, ${_}px, 0)`,visibility:k}),m&&v.middlewareData.arrow){const{x,y:I}=v.middlewareData.arrow,A=v.placement.split("-")[0];Object.assign(m.style,{left:x!=null?`${x}px`:"",top:I!=null?`${I}px`:"",[A]:"100%"})}}re(()=>{const f=l(),h=n();if(!f||!h)return;const m=$le(f,h,u,{elementResize:typeof ResizeObserver=="function"});ae(m)}),re(()=>{const f=n(),h=t.contentRef?.();!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:o};return C(K4.Provider,{value:d,get children(){return t.children}})}var Wl=Object.assign(qle,{Arrow:Mo,Context:K4,usePopperContext:Y4,Positioner:Fle}),Wle={};Ci(Wle,{Arrow:()=>Mo,Content:()=>XL,Portal:()=>QL,Root:()=>eA,Tooltip:()=>_c,Trigger:()=>tA,useTooltipContext:()=>om});var JL=yt();function om(){const e=wt(JL);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function XL(e){const t=om(),n=et({id:t.generateId("content")},e),[r,i]=pe(n,["ref","style"]);return re(()=>ae(t.registerContentId(i.id))),C(Ce,{get when(){return t.contentPresent()},get children(){return C(Wl.Positioner,{get children(){return C(X0,ie({ref(o){var s=Nt(a=>{t.setContentRef(a)},r.ref);typeof s=="function"&&s(o)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return _i({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:o=>o.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),i))}})}})}function QL(e){const t=om();return C(Ce,{get when(){return t.contentPresent()},get children(){return C(ia,e)}})}function Gle(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),o=n.getBoundingClientRect(),s=[],a=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":s.push([i.left,l]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([i.right,l]);break;case"right":s.push([a,i.top]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([a,i.bottom]);break;case"bottom":s.push([i.left,l]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([o.right,o.top]),s.push([i.right,l]);break;case"left":s.push([a,i.top]),s.push([o.right,o.top]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([a,i.bottom]);break}return s}var Ss={},Zle=0,Aa=!1,to,lc,Ma;function eA(e){const t=`tooltip-${Mn()}`,n=`${++Zle}`,r=et({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[i,o]=pe(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[a,l]=we(),[c,u]=we(),[d,f]=we(),[h,m]=we(o.placement),p=oa({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:T=>i.onOpenChange?.(T)}),{present:g}=Fs({show:()=>i.forceMount||p.isOpen(),element:()=>d()??null}),b=()=>{Ss[n]=y},v=()=>{for(const T in Ss)T!==n&&(Ss[T](!0),delete Ss[T])},y=(T=!1)=>{T||i.closeDelay&&i.closeDelay<=0?(window.clearTimeout(s),s=void 0,p.close()):s||(s=window.setTimeout(()=>{s=void 0,p.close()},i.closeDelay)),window.clearTimeout(to),to=void 0,i.skipDelayDuration&&i.skipDelayDuration>=0&&(Ma=window.setTimeout(()=>{window.clearTimeout(Ma),Ma=void 0},i.skipDelayDuration)),Aa&&(window.clearTimeout(lc),lc=window.setTimeout(()=>{delete Ss[n],lc=void 0,Aa=!1},i.closeDelay))},_=()=>{clearTimeout(s),s=void 0,v(),b(),Aa=!0,p.open(),window.clearTimeout(to),to=void 0,window.clearTimeout(lc),lc=void 0,window.clearTimeout(Ma),Ma=void 0},k=()=>{v(),b(),!p.isOpen()&&!to&&!Aa?to=window.setTimeout(()=>{to=void 0,Aa=!0,_()},i.openDelay):p.isOpen()||_()},x=(T=!1)=>{!T&&i.openDelay&&i.openDelay>0&&!s&&!Ma?k():_()},I=()=>{window.clearTimeout(to),to=void 0,Aa=!1},A=()=>{window.clearTimeout(s),s=void 0},L=T=>dn(c(),T)||dn(d(),T),$=T=>{const E=c(),D=d();if(!(!E||!D))return Gle(T,E,D)},H=T=>{const E=T.target;if(L(E)){A();return}if(!i.ignoreSafeArea){const D=$(h());if(D&&Ev(lk(T),D)){A();return}}s||y()};re(()=>{if(!p.isOpen())return;const T=nr();T.addEventListener("pointermove",H,!0),ae(()=>{T.removeEventListener("pointermove",H,!0)})}),re(()=>{const T=c();if(!T||!p.isOpen())return;const E=F=>{const G=F.target;dn(G,T)&&y(!0)},D=Sv();D.addEventListener("scroll",E,{capture:!0}),ae(()=>{D.removeEventListener("scroll",E,{capture:!0})})}),ae(()=>{clearTimeout(s),Ss[n]&&delete Ss[n]});const M={dataset:q(()=>({"data-expanded":p.isOpen()?"":void 0,"data-closed":p.isOpen()?void 0:""})),isOpen:p.isOpen,isDisabled:()=>i.disabled??!1,triggerOnFocusOnly:()=>i.triggerOnFocusOnly??!1,contentId:a,contentPresent:g,openTooltip:x,hideTooltip:y,cancelOpening:I,generateId:Bi(()=>r.id),registerContentId:Gn(l),isTargetOnTooltip:L,setTriggerRef:u,setContentRef:f};return C(JL.Provider,{value:M,get children(){return C(Wl,ie({anchorRef:c,contentRef:d,onCurrentPlacementChange:m},o))}})}function tA(e){let t;const n=om(),[r,i]=pe(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let o=!1,s=!1,a=!1;const l=()=>{o=!1},c=()=>{!n.isOpen()&&(s||a)&&n.openTooltip(a)},u=b=>{n.isOpen()&&!s&&!a&&n.hideTooltip(b)},d=b=>{Je(b,r.onPointerEnter),!(b.pointerType==="touch"||n.triggerOnFocusOnly()||n.isDisabled()||b.defaultPrevented)&&(s=!0,c())},f=b=>{Je(b,r.onPointerLeave),b.pointerType!=="touch"&&(s=!1,a=!1,n.isOpen()?u():n.cancelOpening())},h=b=>{Je(b,r.onPointerDown),o=!0,nr(t).addEventListener("pointerup",l,{once:!0})},m=b=>{Je(b,r.onClick),s=!1,a=!1,u(!0)},p=b=>{Je(b,r.onFocus),!(n.isDisabled()||b.defaultPrevented||o)&&(a=!0,c())},g=b=>{Je(b,r.onBlur);const v=b.relatedTarget;n.isTargetOnTooltip(v)||(s=!1,a=!1,u(!0))};return ae(()=>{nr(t).removeEventListener("pointerup",l)}),C(pt,ie({as:"button",ref(b){var v=Nt(y=>{n.setTriggerRef(y),t=y},r.ref);typeof v=="function"&&v(b)},get"aria-describedby"(){return it(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:d,onPointerLeave:f,onPointerDown:h,onClick:m,onFocus:p,onBlur:g},()=>n.dataset(),i))}var _c=Object.assign(eA,{Arrow:Mo,Content:XL,Portal:QL,Trigger:tA}),Kle=me("<div data-slot=tooltip-keybind><span></span><span data-slot=tooltip-keybind-key>");function bv(e){const[t,n]=pe(e,["title","keybind"]);return C($r,ie(n,{get value(){return(()=>{var r=Kle(),i=r.firstChild,o=i.nextSibling;return X(i,()=>t.title),X(o,()=>t.keybind),r})()}}))}function $r(e){let t;const[n,r]=qe({open:!1,block:!1,expand:!1}),[i,o]=pe(e,["children","class","contentClass","contentStyle","inactive","forceOpen","ignoreSafeArea","value"]),s=()=>r("open",!1),a=()=>{const f=document.activeElement;return!t||!f?!1:t.contains(f)},l=(f=n.expand)=>{f||t?.matches(":hover")||a()||r("block",!1)},c=()=>{const f=!!t?.querySelector('[aria-expanded="true"], [data-expanded]');if(r("expand",f),f){r("block",!0),s();return}l(f)},u=()=>{r("block",!0),s()},d=()=>{a()||s(),l()};return re(()=>{if(!t)return;c();const f=new MutationObserver(c);f.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-expanded","data-expanded"]}),ae(()=>f.disconnect())}),C(Y0,{get children(){return[C(Fr,{get when(){return i.inactive},get children(){return i.children}}),C(Fr,{when:!0,get children(){return C(_c,ie({gutter:4},o,{closeDelay:0,get ignoreSafeArea(){return i.ignoreSafeArea??!0},get open(){return i.forceOpen||n.open},onOpenChange:f=>{i.forceOpen||n.block&&f||r("open",f)},get children(){return[C(_c.Trigger,{ref(f){var h=t;typeof h=="function"?h(f):t=f},as:"div","data-component":"tooltip-trigger",get class(){return i.class},onPointerDownCapture:u,onKeyDownCapture:f=>{f.key!=="Enter"&&f.key!==" "||u()},onPointerLeave:d,onFocusOut:()=>requestAnimationFrame(()=>l()),get children(){return i.children}}),C(_c.Portal,{get children(){return C(_c.Content,{"data-component":"tooltip",get"data-placement"(){return e.placement},get"data-force-open"(){return i.forceOpen},get class(){return i.contentClass},get style(){return i.contentStyle},get children(){return i.value}})}})]}}))}})]}})}function nA(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],i=l=>{if(l==null)return"";const c=e.getKey??"key",u=Pa(c)?l[c]:c(l);return u!=null?String(u):""},o=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=Pa(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(Pa(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return Pa(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(Pa(l)||KD(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const u=nA({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:i(l),textValue:o(l),disabled:s(l),level:n,index:t}),t++}return r}function Yle(e,t=[]){return q(()=>{const n=nA({dataSource:ce(e.dataSource),getKey:ce(e.getKey),getTextValue:ce(e.getTextValue),getDisabled:ce(e.getDisabled),getSectionChildren:ce(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var ao=class rA extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof rA?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function Jle(e){const[t,n]=yu(e);return[()=>t()??new ao,n]}function iA(e){return eO()?e.altKey:e.ctrlKey}function Ha(e){return J0()?e.metaKey:e.ctrlKey}function $7(e){return new ao(e)}function Xle(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Qle(e){const t=et({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=we(!1),[i,o]=we(),s=q(()=>{const p=ce(t.selectedKeys);return p!=null?$7(p):p}),a=q(()=>{const p=ce(t.defaultSelectedKeys);return p!=null?$7(p):new ao}),[l,c]=Jle({value:s,defaultValue:a,onChange:p=>t.onSelectionChange?.(p)}),[u,d]=we(ce(t.selectionBehavior)),f=()=>ce(t.selectionMode),h=()=>ce(t.disallowEmptySelection)??!1,m=p=>{(ce(t.allowDuplicateSelectionEvents)||!Xle(p,l()))&&c(p)};return re(()=>{const p=l();ce(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof p=="object"&&p.size===0&&d("replace")}),re(()=>{d(ce(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:o,selectedKeys:l,setSelectedKeys:m}}function ece(e){const[t,n]=we(""),[r,i]=we(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(ce(e.isDisabled))return;const a=ce(e.keyboardDelegate),l=ce(e.selectionManager);if(!a.getKeyForSearch)return;const c=tce(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(f=>f+c),d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);d==null&&nce(u)&&(u=u[0],d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),e.onTypeSelect?.(d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function tce(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function nce(e){return e.split("").every(t=>t===e[0])}function rce(e,t,n){const i=ie({selectOnFocus:()=>ce(e.selectionManager).selectionBehavior()==="replace"},e),o=()=>n?.()??t(),{direction:s}=Lo();let a={top:0,left:0};UD(()=>ce(i.isVirtualized)?void 0:o(),"scroll",()=>{const g=o();g&&(a={top:g.scrollTop,left:g.scrollLeft})});const{typeSelectHandlers:l}=ece({isDisabled:()=>ce(i.disallowTypeAhead),keyboardDelegate:()=>ce(i.keyboardDelegate),selectionManager:()=>ce(i.selectionManager)}),c=()=>ce(i.orientation)??"vertical",u=g=>{Je(g,l.onKeyDown),g.altKey&&g.key==="Tab"&&g.preventDefault();const b=t();if(!b?.contains(g.target))return;const v=ce(i.selectionManager),y=ce(i.selectOnFocus),_=A=>{A!=null&&(v.setFocusedKey(A),g.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(A):y&&!iA(g)&&v.replaceSelection(A))},k=ce(i.keyboardDelegate),x=ce(i.shouldFocusWrap),I=v.focusedKey();switch(g.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(k.getKeyBelow){g.preventDefault();let A;I!=null?A=k.getKeyBelow(I):A=k.getFirstKey?.(),A==null&&x&&(A=k.getFirstKey?.(I)),_(A)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(k.getKeyAbove){g.preventDefault();let A;I!=null?A=k.getKeyAbove(I):A=k.getLastKey?.(),A==null&&x&&(A=k.getLastKey?.(I)),_(A)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(k.getKeyLeftOf){g.preventDefault();const A=s()==="rtl";let L;I!=null?L=k.getKeyLeftOf(I):L=A?k.getFirstKey?.():k.getLastKey?.(),_(L)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(k.getKeyRightOf){g.preventDefault();const A=s()==="rtl";let L;I!=null?L=k.getKeyRightOf(I):L=A?k.getLastKey?.():k.getFirstKey?.(),_(L)}break}case"Home":if(k.getFirstKey){g.preventDefault();const A=k.getFirstKey(I,Ha(g));A!=null&&(v.setFocusedKey(A),Ha(g)&&g.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(A):y&&v.replaceSelection(A))}break;case"End":if(k.getLastKey){g.preventDefault();const A=k.getLastKey(I,Ha(g));A!=null&&(v.setFocusedKey(A),Ha(g)&&g.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(A):y&&v.replaceSelection(A))}break;case"PageDown":if(k.getKeyPageBelow&&I!=null){g.preventDefault();const A=k.getKeyPageBelow(I);_(A)}break;case"PageUp":if(k.getKeyPageAbove&&I!=null){g.preventDefault();const A=k.getKeyPageAbove(I);_(A)}break;case"a":Ha(g)&&v.selectionMode()==="multiple"&&ce(i.disallowSelectAll)!==!0&&(g.preventDefault(),v.selectAll());break;case"Escape":g.defaultPrevented||(g.preventDefault(),ce(i.disallowEmptySelection)||v.clearSelection());break;case"Tab":if(!ce(i.allowsTabNavigation)){if(g.shiftKey)b.focus();else{const A=dO(b,{tabbable:!0});let L,$;do $=A.lastChild(),$&&(L=$);while($);L&&!L.contains(document.activeElement)&&xn(L)}break}}},d=g=>{const b=ce(i.selectionManager),v=ce(i.keyboardDelegate),y=ce(i.selectOnFocus);if(b.isFocused()){g.currentTarget.contains(g.target)||b.setFocused(!1);return}if(g.currentTarget.contains(g.target)){if(b.setFocused(!0),b.focusedKey()==null){const _=x=>{x!=null&&(b.setFocusedKey(x),y&&b.replaceSelection(x))},k=g.relatedTarget;k&&g.currentTarget.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_FOLLOWING?_(b.lastSelectedKey()??v.getLastKey?.()):_(b.firstSelectedKey()??v.getFirstKey?.())}else if(!ce(i.isVirtualized)){const _=o();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const k=_.querySelector(`[data-key="${b.focusedKey()}"]`);k&&(xn(k),Sg(_,k))}}}},f=g=>{const b=ce(i.selectionManager);g.currentTarget.contains(g.relatedTarget)||b.setFocused(!1)},h=g=>{o()===g.target&&g.preventDefault()},m=()=>{const g=ce(i.autoFocus);if(!g)return;const b=ce(i.selectionManager),v=ce(i.keyboardDelegate);let y;g==="first"&&(y=v.getFirstKey?.()),g==="last"&&(y=v.getLastKey?.());const _=b.selectedKeys();_.size&&(y=_.values().next().value),b.setFocused(!0),b.setFocusedKey(y);const k=t();k&&y==null&&!ce(i.shouldUseVirtualFocus)&&xn(k)};return Pt(()=>{i.deferAutoFocus?setTimeout(m,0):m()}),re(Yt([o,()=>ce(i.isVirtualized),()=>ce(i.selectionManager).focusedKey()],g=>{const[b,v,y]=g;if(v)y&&i.scrollToKey?.(y);else if(y&&b){const _=b.querySelector(`[data-key="${y}"]`);_&&Sg(b,_)}})),{tabIndex:q(()=>{if(!ce(i.shouldUseVirtualFocus))return ce(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function oA(e,t){const n=()=>ce(e.selectionManager),r=()=>ce(e.key),i=()=>ce(e.shouldUseVirtualFocus),o=v=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):v?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Ha(v)||"pointerType"in v&&v.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>ce(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=v=>{l()&&(c=v.pointerType,v.pointerType==="mouse"&&v.button===0&&!ce(e.shouldSelectOnPressUp)&&o(v))},d=v=>{l()&&v.pointerType==="mouse"&&v.button===0&&ce(e.shouldSelectOnPressUp)&&ce(e.allowsDifferentPressOrigin)&&o(v)},f=v=>{l()&&(ce(e.shouldSelectOnPressUp)&&!ce(e.allowsDifferentPressOrigin)||c!=="mouse")&&o(v)},h=v=>{!l()||!["Enter"," "].includes(v.key)||(iA(v)?n().toggleSelection(r()):o(v))},m=v=>{a()&&v.preventDefault()},p=v=>{const y=t();i()||a()||!y||v.target===y&&n().setFocusedKey(r())},g=q(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),b=q(()=>ce(e.virtualized)?void 0:r());return re(Yt([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([v,y,_,k,x])=>{v&&y===k&&x&&!_&&document.activeElement!==v&&(e.focus?e.focus():xn(v))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:g,dataKey:b,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:m,onFocus:p}}var ice=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index<e.index;(!e||r)&&(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index>e.index;(!e||r)&&(e=n)}return e?.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new ao(n,r,t);for(const o of this.getKeyRange(r,n.currentKey||t))i.delete(o);for(const o of this.getKeyRange(t,r))this.canSelectItem(o)&&i.add(o);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new ao(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new ao([t],t,t):new ao;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new ao;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new ao)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},L7=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function oce(e){const t=Qle(e),r=Yle({dataSource:()=>ce(e.dataSource),getKey:()=>ce(e.getKey),getTextValue:()=>ce(e.getTextValue),getDisabled:()=>ce(e.getDisabled),getSectionChildren:()=>ce(e.getSectionChildren),factory:o=>e.filter?new L7(e.filter(o)):new L7(o)},[()=>e.filter]),i=new ice(r,t);return zc(()=>{const o=t.focusedKey();o!=null&&!r().getItem(o)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var sce=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const i=this.collection().getItem(r);if(i){const o=i.textValue.slice(0,e.length);if(i.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function ace(e,t,n){const r=Bae({usage:"search",sensitivity:"base"}),i=q(()=>{const o=ce(e.keyboardDelegate);return o||new sce(e.collection,t,r)});return rce({selectionManager:()=>ce(e.selectionManager),keyboardDelegate:i,autoFocus:()=>ce(e.autoFocus),deferAutoFocus:()=>ce(e.deferAutoFocus),shouldFocusWrap:()=>ce(e.shouldFocusWrap),disallowEmptySelection:()=>ce(e.disallowEmptySelection),selectOnFocus:()=>ce(e.selectOnFocus),disallowTypeAhead:()=>ce(e.disallowTypeAhead),shouldUseVirtualFocus:()=>ce(e.shouldUseVirtualFocus),allowsTabNavigation:()=>ce(e.allowsTabNavigation),isVirtualized:()=>ce(e.isVirtualized),scrollToKey:o=>ce(e.scrollToKey)?.(o),orientation:()=>ce(e.orientation)},t,n)}var sA=yt();function aA(){return wt(sA)}function lce(){const e=aA();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function lA(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function cce(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const i=e[r]?.ref();if(i&&lA(i,n))return r+1}return 0}function uce(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[o,s])=>{const a=i.ref(),l=s.ref();return a===l||!a||!l?0:lA(a,l)?(r>o&&(n=!0),-1):(r<o&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function cA(e,t){const n=uce(e);e!==n&&t(n)}function dce(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return nr(r).body}function fce(e,t){re(()=>{const n=setTimeout(()=>{cA(e(),t)});ae(()=>clearTimeout(n))})}function hce(e,t){if(typeof IntersectionObserver!="function"){fce(e,t);return}let n=[];re(()=>{const r=()=>{const s=!!n.length;n=e(),s&&cA(e(),t)},i=dce(e()),o=new IntersectionObserver(r,{root:i});for(const s of e()){const a=s.ref();a&&o.observe(a)}ae(()=>o.disconnect())})}function mce(e={}){const[t,n]=$O({value:()=>ce(e.items),onChange:o=>e.onItemsChange?.(o)});hce(t,n);const r=o=>(n(s=>{const a=cce(s,o);return ZD(s,o,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==o.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:o=>C(sA.Provider,{value:{registerItem:r},get children(){return o.children}})}}function pce(e){const t=lce(),n=et({shouldRegisterItem:!0},e);re(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());ae(r)})}function gce(e={}){const[t,n]=pk({value:()=>ce(e.isSelected),defaultValue:()=>!!ce(e.defaultIsSelected),onChange:o=>e.onSelectedChange?.(o)});return{isSelected:t,setIsSelected:o=>{!ce(e.isReadOnly)&&!ce(e.isDisabled)&&n(o)},toggle:()=>{!ce(e.isReadOnly)&&!ce(e.isDisabled)&&n(!t())}}}var vce=yt();function sm(){return wt(vce)}var bce=yt();function uA(){return wt(bce)}var dA=yt();function fA(){return wt(dA)}function Ki(){const e=fA();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var hA=yt();function J4(){const e=wt(hA);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var mA=yt();function ei(){const e=wt(mA);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function X4(e){let t;const n=ei(),r=Ki(),i=et({id:n.generateId(`item-${Mn()}`)},e),[o,s]=pe(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=we(),[c,u]=we(),[d,f]=we(),h=()=>r.listState().selectionManager(),m=()=>s.id,p=()=>h().focusedKey()===m(),g=()=>{o.onSelect?.(),o.closeOnSelect&&setTimeout(()=>{r.close(!0)})};pce({getItem:()=>({ref:()=>t,type:"item",key:m(),textValue:o.textValue??d()?.textContent??t?.textContent??"",disabled:o.disabled??!1})});const b=oA({key:m,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>t),v=L=>{Je(L,o.onPointerMove),L.pointerType==="mouse"&&(o.disabled?r.onItemLeave(L):(r.onItemEnter(L),L.defaultPrevented||(xn(L.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(m()))))},y=L=>{Je(L,o.onPointerLeave),L.pointerType==="mouse"&&r.onItemLeave(L)},_=L=>{Je(L,o.onPointerUp),!o.disabled&&L.button===0&&g()},k=L=>{if(Je(L,o.onKeyDown),!L.repeat&&!o.disabled)switch(L.key){case"Enter":case" ":g();break}},x=q(()=>{if(o.indeterminate)return"mixed";if(o.checked!=null)return o.checked}),I=q(()=>({"data-indeterminate":o.indeterminate?"":void 0,"data-checked":o.checked&&!o.indeterminate?"":void 0,"data-disabled":o.disabled?"":void 0,"data-highlighted":p()?"":void 0})),A={isChecked:()=>o.checked,dataset:I,setLabelRef:f,generateId:Bi(()=>s.id),registerLabel:Gn(l),registerDescription:Gn(u)};return C(hA.Provider,{value:A,get children(){return C(pt,ie({as:"div",ref(L){var $=Nt(H=>t=H,o.ref);typeof $=="function"&&$(L)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return x()},get"aria-disabled"(){return o.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return cn([o.onPointerDown,b.onPointerDown])},get onPointerUp(){return cn([_,b.onPointerUp])},get onClick(){return cn([o.onClick,b.onClick])},get onKeyDown(){return cn([k,b.onKeyDown])},get onMouseDown(){return cn([o.onMouseDown,b.onMouseDown])},get onFocus(){return cn([o.onFocus,b.onFocus])},onPointerMove:v,onPointerLeave:y},I,s))}})}function am(e){const t=et({closeOnSelect:!1},e),[n,r]=pe(t,["checked","defaultChecked","onChange","onSelect"]),i=gce({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:s=>n.onChange?.(s),isDisabled:()=>r.disabled});return C(X4,ie({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{n.onSelect?.(),i.toggle()}},r))}var hu={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>hu.next(e==="ltr"?"rtl":"ltr",t)},A7={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function pA(e){const t=ei(),n=Ki(),r=sm(),{direction:i}=Lo(),o=et({id:t.generateId("trigger")},e),[s,a]=pe(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>t.value()??s.id,r.lastValue()===void 0&&r.setLastValue(l));const c=wu(()=>n.triggerRef(),()=>"button"),u=q(()=>c()==="a"&&n.triggerRef()?.getAttribute("href")!=null);re(Yt(()=>r?.value(),b=>{u()&&b===l()&&n.triggerRef()?.focus()}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=b=>{Je(b,s.onPointerDown),b.currentTarget.dataset.pointerType=b.pointerType,!s.disabled&&b.pointerType!=="touch"&&b.button===0&&d()},h=b=>{Je(b,s.onClick),s.disabled||b.currentTarget.dataset.pointerType==="touch"&&d()},m=b=>{if(Je(b,s.onKeyDown),!s.disabled){if(u())switch(b.key){case"Enter":case" ":return}switch(b.key){case"Enter":case" ":case A7.first(t.orientation()):b.stopPropagation(),b.preventDefault(),mO(b.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case A7.last(t.orientation()):b.stopPropagation(),b.preventDefault(),n.open("last");break;case hu.next(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.nextMenu();break;case hu.previous(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.previousMenu();break}}},p=b=>{Je(b,s.onMouseOver),n.triggerRef()?.dataset.pointerType!=="touch"&&!s.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},g=b=>{Je(b,s.onFocus),r!==void 0&&b.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return re(()=>ae(n.registerTriggerId(s.id))),C(sa,ie({ref(b){var v=Nt(n.setTriggerRef,s.ref);typeof v=="function"&&v(b)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return it(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&r?.value()===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:p,onClick:h,onKeyDown:m,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}function gA(e){let t;const n=ei(),r=Ki(),i=sm(),o=uA(),{direction:s}=Lo(),a=et({id:n.generateId(`content-${Mn()}`)},e),[l,c]=pe(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=ace({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);fk({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:y=>{i===void 0&&l.onOpenAutoFocus?.(y)},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=y=>{if(dn(y.currentTarget,y.target)&&(y.key==="Tab"&&r.isOpen()&&y.preventDefault(),i!==void 0&&y.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(y.key){case hu.next(s(),n.orientation()):y.stopPropagation(),y.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case hu.previous(s(),n.orientation()):if(y.currentTarget.hasAttribute("data-closed"))break;y.stopPropagation(),y.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},m=y=>{l.onEscapeKeyDown?.(y),i?.setAutoFocusMenu(!1),r.close(!0)},p=y=>{l.onFocusOutside?.(y),n.isModal()&&y.preventDefault()},g=y=>{Je(y,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},b=y=>{if(Je(y,l.onPointerMove),y.pointerType!=="mouse")return;const _=y.target,k=u!==y.clientX;dn(y.currentTarget,_)&&k&&(r.setPointerDir(y.clientX>u?"right":"left"),u=y.clientX)};re(()=>ae(r.registerContentId(l.id))),ae(()=>r.setContentRef(void 0));const v={ref:Nt(y=>{r.setContentRef(y),t=y},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:cn([l.onKeyDown,f.onKeyDown,h]),onMouseDown:cn([l.onMouseDown,f.onMouseDown]),onFocusIn:cn([l.onFocusIn,f.onFocusIn]),onFocusOut:cn([l.onFocusOut,f.onFocusOut]),onPointerEnter:g,onPointerMove:b,get"data-orientation"(){return n.orientation()}};return C(Ce,{get when(){return r.contentPresent()},get children(){return C(Ce,{get when(){return o===void 0||r.parentMenuContext()!=null},get fallback(){return C(pt,ie({as:"div"},()=>r.dataset(),v,c))},get children(){return C(Wl.Positioner,{get children(){return C(X0,ie({get disableOutsidePointerEvents(){return it(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return _i({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:m,onFocusOutside:p,get onDismiss(){return r.close}},()=>r.dataset(),v,c))}})}})}})}function vA(e){let t;const n=ei(),r=Ki(),[i,o]=pe(e,["ref"]);return gk({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),C(gA,ie({ref(s){var a=Nt(l=>{t=l},i.ref);typeof a=="function"&&a(s)}},o))}var bA=yt();function yce(){const e=wt(bA);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Ju(e){const t=ei(),n=et({id:t.generateId(`group-${Mn()}`)},e),[r,i]=we(),o={generateId:Bi(()=>n.id),registerLabelId:Gn(i)};return C(bA.Provider,{value:o,get children(){return C(pt,ie({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function lm(e){const t=yce(),n=et({id:t.generateId("label")},e),[r,i]=pe(n,["id"]);return re(()=>ae(t.registerLabelId(r.id))),C(pt,ie({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function cm(e){const t=Ki(),n=et({children:"▼"},e);return C(pt,ie({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function um(e){return C(X4,ie({role:"menuitem",closeOnSelect:!0},e))}function dm(e){const t=J4(),n=et({id:t.generateId("description")},e),[r,i]=pe(n,["id"]);return re(()=>ae(t.registerDescription(r.id))),C(pt,ie({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function fm(e){const t=J4(),n=et({id:t.generateId("indicator")},e),[r,i]=pe(n,["forceMount"]);return C(Ce,{get when(){return r.forceMount||t.isChecked()},get children(){return C(pt,ie({as:"div"},()=>t.dataset(),i))}})}function hm(e){const t=J4(),n=et({id:t.generateId("label")},e),[r,i]=pe(n,["ref","id"]);return re(()=>ae(t.registerLabel(r.id))),C(pt,ie({as:"div",ref(o){var s=Nt(t.setLabelRef,r.ref);typeof s=="function"&&s(o)},get id(){return r.id}},()=>t.dataset(),i))}function mm(e){const t=Ki();return C(Ce,{get when(){return t.contentPresent()},get children(){return C(ia,e)}})}var yA=yt();function wce(){const e=wt(yA);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function pm(e){const n=ei().generateId(`radiogroup-${Mn()}`),r=et({id:n},e),[i,o]=pe(r,["value","defaultValue","onChange","disabled"]),[s,a]=yu({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>i.onChange?.(c)}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===s(),setSelectedValue:c=>a(c)};return C(yA.Provider,{value:l,get children(){return C(Ju,o)}})}function gm(e){const t=wce(),n=et({closeOnSelect:!1},e),[r,i]=pe(n,["value","onSelect"]);return C(X4,ie({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},i))}function kce(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),o=[],s=t.clientX,a=t.clientY;switch(r){case"top":o.push([s,a+5]),o.push([i.left,i.bottom]),o.push([i.left,i.top]),o.push([i.right,i.top]),o.push([i.right,i.bottom]);break;case"right":o.push([s-5,a]),o.push([i.left,i.top]),o.push([i.right,i.top]),o.push([i.right,i.bottom]),o.push([i.left,i.bottom]);break;case"bottom":o.push([s,a-5]),o.push([i.right,i.top]),o.push([i.right,i.bottom]),o.push([i.left,i.bottom]),o.push([i.left,i.top]);break;case"left":o.push([s+5,a]),o.push([i.right,i.bottom]),o.push([i.left,i.bottom]),o.push([i.left,i.top]),o.push([i.right,i.top]);break}return o}function xce(e,t){return t?Ev([e.clientX,e.clientY],t):!1}function wA(e){const t=ei(),n=aA(),r=fA(),i=sm(),o=uA(),s=et({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=pe(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[f,h]=we(),[m,p]=we(),[g,b]=we(),[v,y]=we(),[_,k]=we(!0),[x,I]=we(l.placement),[A,L]=we([]),[$,H]=we([]),{DomCollectionProvider:j}=mce({items:$,onItemsChange:H}),M=oa({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:xe=>a.onOpenChange?.(xe)}),{present:T}=Fs({show:()=>t.forceMount()||M.isOpen(),element:()=>v()??null}),E=oce({selectionMode:"none",dataSource:$}),D=xe=>{k(xe),M.open()},F=(xe=!1)=>{M.close(),xe&&r&&r.close(!0)},G=xe=>{k(xe),M.toggle()},U=()=>{const xe=v();xe&&(xn(xe),E.selectionManager().setFocused(!0),E.selectionManager().setFocusedKey(void 0))},Z=()=>{o!=null?setTimeout(()=>U()):U()},Y=xe=>{L(lt=>[...lt,xe]);const Ue=r?.registerNestedMenu(xe);return()=>{L(lt=>xg(lt,xe)),Ue?.()}},ee=xe=>d===u?.side&&xce(xe,u?.area),oe=xe=>{ee(xe)&&xe.preventDefault()},fe=xe=>{ee(xe)||Z()},Se=xe=>{ee(xe)&&xe.preventDefault()};hk({isDisabled:()=>!(r==null&&M.isOpen()&&t.isModal()),targets:()=>[v(),...A()].filter(Boolean)}),re(()=>{const xe=v();if(!xe||!r)return;const Ue=r.registerNestedMenu(xe);ae(()=>{Ue()})}),re(()=>{r===void 0&&i?.registerMenu(t.value(),[v(),...A()])}),re(()=>{r!==void 0||i===void 0||(i.value()===t.value()?(g()?.focus(),i.autoFocusMenu()&&D(!0)):F())}),re(()=>{r!==void 0||i===void 0||M.isOpen()&&i.setValue(t.value())}),ae(()=>{r===void 0&&i?.unregisterMenu(t.value())});const Ae={dataset:q(()=>({"data-expanded":M.isOpen()?"":void 0,"data-closed":M.isOpen()?void 0:""})),isOpen:M.isOpen,contentPresent:T,nestedMenus:A,currentPlacement:x,pointerGraceTimeoutId:()=>c,autoFocus:_,listState:()=>E,parentMenuContext:()=>r,triggerRef:g,contentRef:v,triggerId:f,contentId:m,setTriggerRef:b,setContentRef:y,open:D,close:F,toggle:G,focusContent:Z,onItemEnter:oe,onItemLeave:fe,onTriggerLeave:Se,setPointerDir:xe=>d=xe,setPointerGraceTimeoutId:xe=>c=xe,setPointerGraceIntent:xe=>u=xe,registerNestedMenu:Y,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:Gn(h),registerContentId:Gn(p)};return C(j,{get children(){return C(dA.Provider,{value:Ae,get children(){return C(Ce,{when:o===void 0,get fallback(){return l.children},get children(){return C(Wl,ie({anchorRef:g,contentRef:v,onCurrentPlacementChange:I},l))}})}})}})}function vm(e){const{direction:t}=Lo();return C(wA,ie({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Sce={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function bm(e){const t=Ki(),n=ei(),[r,i]=pe(e,["onFocusOutside","onKeyDown"]),{direction:o}=Lo();return C(gA,ie({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{r.onFocusOutside?.(u);const d=u.target;dn(t.triggerRef(),d)||t.close()},onKeyDown:u=>{Je(u,r.onKeyDown);const d=dn(u.currentTarget,u.target),f=Sce.close(o(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),xn(t.triggerRef()))}},i))}var M7=["Enter"," "],_ce={open:(e,t)=>e==="ltr"?[...M7,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...M7,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function ym(e){let t;const n=ei(),r=Ki(),i=et({id:n.generateId(`sub-trigger-${Mn()}`)},e),[o,s]=pe(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=Lo(),u=()=>o.id,d=()=>{const y=r.parentMenuContext();if(y==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return y.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===u(),m=oA({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>t),p=y=>{Je(y,o.onClick),!r.isOpen()&&!o.disabled&&r.open(!0)},g=y=>{if(Je(y,o.onPointerMove),y.pointerType!=="mouse")return;const _=r.parentMenuContext();if(_?.onItemEnter(y),!y.defaultPrevented){if(o.disabled){_?.onItemLeave(y);return}!r.isOpen()&&!a&&(r.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),_?.onItemEnter(y),y.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),xn(y.currentTarget),_?.listState().selectionManager().setFocused(!0),_?.listState().selectionManager().setFocusedKey(u()))}},b=y=>{if(Je(y,o.onPointerLeave),y.pointerType!=="mouse")return;l();const _=r.parentMenuContext(),k=r.contentRef();if(k){_?.setPointerGraceIntent({area:kce(r.currentPlacement(),y,k),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(_?.pointerGraceTimeoutId());const x=window.setTimeout(()=>{_?.setPointerGraceIntent(null)},300);_?.setPointerGraceTimeoutId(x)}else{if(_?.onTriggerLeave(y),y.defaultPrevented)return;_?.setPointerGraceIntent(null)}_?.onItemLeave(y)},v=y=>{Je(y,o.onKeyDown),!y.repeat&&(o.disabled||_ce.open(c(),n.orientation()).includes(y.key)&&(y.stopPropagation(),y.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return re(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const y=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:o.textValue??t?.textContent??"",disabled:o.disabled??!1});ae(y)}),re(Yt(()=>r.parentMenuContext()?.pointerGraceTimeoutId(),y=>{ae(()=>{window.clearTimeout(y),r.parentMenuContext()?.setPointerGraceIntent(null)})})),re(()=>ae(r.registerTriggerId(o.id))),ae(()=>{l()}),C(pt,ie({as:"div",ref(y){var _=Nt(k=>{r.setTriggerRef(k),t=k},o.ref);typeof _=="function"&&_(y)},get id(){return o.id},role:"menuitem",get tabIndex(){return m.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return it(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return o.disabled},get"data-key"(){return m.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return o.disabled?"":void 0},get onPointerDown(){return cn([o.onPointerDown,m.onPointerDown])},get onPointerUp(){return cn([o.onPointerUp,m.onPointerUp])},get onClick(){return cn([p,m.onClick])},get onKeyDown(){return cn([v,m.onKeyDown])},get onMouseDown(){return cn([o.onMouseDown,m.onMouseDown])},get onFocus(){return cn([o.onFocus,m.onFocus])},onPointerMove:g,onPointerLeave:b},()=>r.dataset(),s))}function kA(e){const t=sm(),n=`menu-${Mn()}`,r=et({id:n,modal:!0},e),[i,o]=pe(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),s=oa({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>i.onOpenChange?.(l)}),a={isModal:()=>i.modal??!0,preventScroll:()=>i.preventScroll??a.isModal(),forceMount:()=>i.forceMount??!1,generateId:Bi(()=>i.id),value:()=>i.value,orientation:()=>i.orientation??t?.orientation()??"horizontal"};return C(mA.Provider,{value:a,get children(){return C(wA,ie({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},o))}})}var Cce={};Ci(Cce,{Root:()=>Gl,Separator:()=>Ice});function Gl(e){let t;const n=et({orientation:"horizontal"},e),[r,i]=pe(n,["ref","orientation"]),o=wu(()=>t,()=>"hr");return C(pt,ie({as:"hr",ref(s){var a=Nt(l=>t=l,r.ref);typeof a=="function"&&a(s)},get role(){return o()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var Ice=Gl,Ece={};Ci(Ece,{Arrow:()=>Mo,CheckboxItem:()=>am,Content:()=>xA,DropdownMenu:()=>hn,Group:()=>Ju,GroupLabel:()=>lm,Icon:()=>cm,Item:()=>um,ItemDescription:()=>dm,ItemIndicator:()=>fm,ItemLabel:()=>hm,Portal:()=>mm,RadioGroup:()=>pm,RadioItem:()=>gm,Root:()=>SA,Separator:()=>Gl,Sub:()=>vm,SubContent:()=>bm,SubTrigger:()=>ym,Trigger:()=>pA});function xA(e){const t=ei(),n=Ki(),[r,i]=pe(e,["onCloseAutoFocus","onInteractOutside"]);let o=!1;return C(vA,ie({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),o||xn(n.triggerRef()),o=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(o=!0)}},i))}function SA(e){const t=`dropdownmenu-${Mn()}`,n=et({id:t},e);return C(kA,n)}var hn=Object.assign(SA,{Arrow:Mo,CheckboxItem:am,Content:xA,Group:Ju,GroupLabel:lm,Icon:cm,Item:um,ItemDescription:dm,ItemIndicator:fm,ItemLabel:hm,Portal:mm,RadioGroup:pm,RadioItem:gm,Separator:Gl,Sub:vm,SubContent:bm,SubTrigger:ym,Trigger:pA});function Tce(e){return C(hn,ie(e,{"data-component":"dropdown-menu"}))}function $ce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.Trigger,ie(n,{"data-slot":"dropdown-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Lce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.Icon,ie(n,{"data-slot":"dropdown-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Ace(e){return C(hn.Portal,e)}function Mce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.Content,ie(n,{"data-component":"dropdown-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Dce(e){const[t,n]=pe(e,["class","classList"]);return C(hn.Arrow,ie(n,{"data-slot":"dropdown-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function Oce(e){const[t,n]=pe(e,["class","classList"]);return C(hn.Separator,ie(n,{"data-slot":"dropdown-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function Pce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.Group,ie(n,{"data-slot":"dropdown-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Rce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.GroupLabel,ie(n,{"data-slot":"dropdown-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Nce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.Item,ie(n,{"data-slot":"dropdown-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function zce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.ItemLabel,ie(n,{"data-slot":"dropdown-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function jce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.ItemDescription,ie(n,{"data-slot":"dropdown-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Fce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.ItemIndicator,ie(n,{"data-slot":"dropdown-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Hce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.RadioGroup,ie(n,{"data-slot":"dropdown-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Vce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.RadioItem,ie(n,{"data-slot":"dropdown-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Uce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.CheckboxItem,ie(n,{"data-slot":"dropdown-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Bce(e){return C(hn.Sub,e)}function qce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.SubTrigger,ie(n,{"data-slot":"dropdown-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Wce(e){const[t,n]=pe(e,["class","classList","children"]);return C(hn.SubContent,ie(n,{"data-component":"dropdown-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const Bt=Object.assign(Tce,{Trigger:$ce,Icon:Lce,Portal:Ace,Content:Mce,Arrow:Dce,Separator:Oce,Group:Pce,GroupLabel:Rce,Item:Nce,ItemLabel:zce,ItemDescription:jce,ItemIndicator:Fce,RadioGroup:Hce,RadioItem:Vce,CheckboxItem:Uce,Sub:Bce,SubTrigger:qce,SubContent:Wce});var Gce=me("<div>"),wm=class{x;y;width;height;constructor(t){this.x=Math.floor(t.x),this.y=Math.floor(t.y),this.width=Math.floor(t.width),this.height=Math.floor(t.height)}get rect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get center(){return{x:this.x+this.width*.5,y:this.y+this.height*.5}}get corners(){return{topLeft:{x:this.left,y:this.top},topRight:{x:this.right,y:this.top},bottomRight:{x:this.left,y:this.bottom},bottomLeft:{x:this.right,y:this.bottom}}}},sl=e=>{let t=new wm(e.getBoundingClientRect());const{transform:n}=getComputedStyle(e);return n&&(t=Zce(t,n)),t},Zce=(e,t)=>{let n,r;if(t.startsWith("matrix3d(")){const i=t.slice(9,-1).split(/, /);n=+i[12],r=+i[13]}else if(t.startsWith("matrix(")){const i=t.slice(7,-1).split(/, /);n=+i[4],r=+i[5]}else n=0,r=0;return new wm({...e,x:e.x-n,y:e.y-r})},hi=()=>({x:0,y:0}),Q4=(e,t)=>e.x===t.x&&e.y===t.y,ug=(e,t)=>new wm({...e,x:e.x+t.x,y:e.y+t.y}),Kce=(e,t)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),Yce=(e,t)=>{const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.right,t.right),o=Math.min(e.bottom,t.bottom),s=i-r,a=o-n;if(r<i&&n<o){const l=e.width*e.height,c=t.width*t.height,u=s*a;return u/(l+c-u)}return 0},dg=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,_A=(e,t,n)=>{const r=e.transformed.center,i={distance:1/0,droppable:null};for(const o of t){const s=Kce(r,o.layout.center);s<i.distance?(i.distance=s,i.droppable=o):s===i.distance&&o.id===n.activeDroppableId&&(i.droppable=o)}return i.droppable},Jce=(e,t,n)=>{const r=e.transformed,i={ratio:0,droppable:null};for(const o of t){const s=Yce(r,o.layout);s>i.ratio?(i.ratio=s,i.droppable=o):s>0&&s===i.ratio&&o.id===n.activeDroppableId&&(i.droppable=o)}return i.droppable},CA=yt(),IA=e=>{const t=ie({collisionDetector:Jce},e),[n,r]=qe({draggables:{},droppables:{},sensors:{},active:{draggableId:null,get draggable(){return n.active.draggableId!==null?n.draggables[n.active.draggableId]:null},droppableId:null,get droppable(){return n.active.droppableId!==null?n.droppables[n.active.droppableId]:null},sensorId:null,get sensor(){return n.active.sensorId!==null?n.sensors[n.active.sensorId]:null},overlay:null}}),i=(T,E,D)=>{T.substring(0,T.length-1),Ye(()=>n[T][E])&&r(T,E,"transformers",D.id,D)},o=(T,E,D)=>{T.substring(0,T.length-1),Ye(()=>n[T][E])&&Ye(()=>n[T][E].transformers[D])&&r(T,E,"transformers",D,void 0)},s=({id:T,node:E,layout:D,data:F})=>{const G=n.draggables[T],U={id:T,node:E,layout:D,data:F,_pendingCleanup:!1};let Z;if(!G)Object.defineProperties(U,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{if(n.active.overlay)return hi();const Y=Object.values(n.draggables[T].transformers);return Y.sort((ee,oe)=>ee.order-oe.order),Y.reduce((ee,oe)=>oe.callback(ee),hi())}},transformed:{enumerable:!0,configurable:!0,get:()=>ug(n.draggables[T].layout,n.draggables[T].transform)}});else if(n.active.draggableId===T&&!n.active.overlay){const Y={x:G.layout.x-D.x,y:G.layout.y-D.y},ee="addDraggable-existing-offset",oe=G.transformers[ee],fe=oe?oe.callback(Y):Y;Z={id:ee,order:100,callback:Se=>({x:Se.x+fe.x,y:Se.y+fe.y})},H(()=>o("draggables",T,ee))}rt(()=>{r("draggables",T,U),Z&&i("draggables",T,Z)}),n.active.draggable&&_()},a=T=>{Ye(()=>n.draggables[T])&&(r("draggables",T,"_pendingCleanup",!0),queueMicrotask(()=>l(T)))},l=T=>{if(n.draggables[T]?._pendingCleanup){const E=n.active.draggableId===T;rt(()=>{E&&r("active","draggableId",null),r("draggables",T,void 0)})}},c=({id:T,node:E,layout:D,data:F})=>{const G=n.droppables[T],U={id:T,node:E,layout:D,data:F,_pendingCleanup:!1};G||Object.defineProperties(U,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{const Z=Object.values(n.droppables[T].transformers);return Z.sort((Y,ee)=>Y.order-ee.order),Z.reduce((Y,ee)=>ee.callback(Y),hi())}},transformed:{enumerable:!0,configurable:!0,get:()=>ug(n.droppables[T].layout,n.droppables[T].transform)}}),r("droppables",T,U),n.active.draggable&&_()},u=T=>{Ye(()=>n.droppables[T])&&(r("droppables",T,"_pendingCleanup",!0),queueMicrotask(()=>d(T)))},d=T=>{if(n.droppables[T]?._pendingCleanup){const E=n.active.droppableId===T;rt(()=>{E&&r("active","droppableId",null),r("droppables",T,void 0)})}},f=({id:T,activators:E})=>{r("sensors",T,{id:T,activators:E,coordinates:{origin:{x:0,y:0},current:{x:0,y:0},get delta(){return{x:n.sensors[T].coordinates.current.x-n.sensors[T].coordinates.origin.x,y:n.sensors[T].coordinates.current.y-n.sensors[T].coordinates.origin.y}}}})},h=T=>{if(!Ye(()=>n.sensors[T]))return;const E=n.active.sensorId===T;rt(()=>{E&&r("active","sensorId",null),r("sensors",T,void 0)})},m=({node:T,layout:E})=>{const D=n.active.overlay,F={node:T,layout:E};D||Object.defineProperties(F,{id:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.id},data:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.data},transformers:{enumerable:!0,configurable:!0,get:()=>Object.fromEntries(Object.entries(n.active.draggable?n.active.draggable.transformers:{}).filter(([G])=>G!=="addDraggable-existing-offset"))},transform:{enumerable:!0,configurable:!0,get:()=>{const G=Object.values(n.active.overlay?n.active.overlay.transformers:[]);return G.sort((U,Z)=>U.order-Z.order),G.reduce((U,Z)=>Z.callback(U),hi())}},transformed:{enumerable:!0,configurable:!0,get:()=>n.active.overlay?ug(n.active.overlay.layout,n.active.overlay.transform):new wm({x:0,y:0,width:0,height:0})}}),r("active","overlay",F)},p=()=>r("active","overlay",null),g=(T,E)=>{rt(()=>{r("sensors",T,"coordinates",{origin:{...E},current:{...E}}),r("active","sensorId",T)})},b=T=>{const E=n.active.sensorId;E&&r("sensors",E,"coordinates","current",{...T})},v=()=>r("active","sensorId",null),y=(T,E)=>{const D={};for(const G of Object.values(n.sensors))if(G)for(const[U,Z]of Object.entries(G.activators))D[U]??=[],D[U].push({sensor:G,activator:Z});const F={};for(const G in D){let U=G;E&&(U=`on${G}`),F[U]=Z=>{for(const{activator:Y}of D[G]){if(n.active.sensor)break;Y(Z,T)}}}return F},_=()=>{let T=!1;const E=Object.values(n.draggables),D=Object.values(n.droppables),F=n.active.overlay;return rt(()=>{const G=new WeakMap;for(const U of E)if(U){const Z=U.layout;G.has(U.node)||G.set(U.node,sl(U.node));const Y=G.get(U.node);dg(Z,Y)||(r("draggables",U.id,"layout",Y),T=!0)}for(const U of D)if(U){const Z=U.layout;G.has(U.node)||G.set(U.node,sl(U.node));const Y=G.get(U.node);dg(Z,Y)||(r("droppables",U.id,"layout",Y),T=!0)}if(F){const U=F.layout,Z=sl(F.node);dg(U,Z)||(r("active","overlay","layout",Z),T=!0)}}),T},k=()=>{const T=n.active.overlay??n.active.draggable;if(T){const E=t.collisionDetector(T,Object.values(n.droppables),{activeDroppableId:n.active.droppableId}),D=E?E.id:null;n.active.droppableId!==D&&r("active","droppableId",D)}},x=T=>{const E={id:"sensorMove",order:0,callback:D=>n.active.sensor?{x:D.x+n.active.sensor.coordinates.delta.x,y:D.y+n.active.sensor.coordinates.delta.y}:D};_(),rt(()=>{r("active","draggableId",T),i("draggables",T,E)}),k()},I=()=>{const T=Ye(()=>n.active.draggableId);rt(()=>{T!==null&&o("draggables",T,"sensorMove"),r("active",["draggableId","droppableId"],null)}),_()},A=T=>{re(()=>{const E=n.active.draggable;E&&Ye(()=>T({draggable:E}))})},L=T=>{re(()=>{const E=n.active.draggable;if(E){const D=Ye(()=>n.active.overlay);Object.values(D?D.transform:E.transform),Ye(()=>T({draggable:E,overlay:D}))}})},$=T=>{re(()=>{const E=n.active.draggable,D=n.active.droppable;E&&Ye(()=>T({draggable:E,droppable:D,overlay:n.active.overlay}))})},H=T=>{re(({previousDraggable:E,previousDroppable:D,previousOverlay:F})=>{const G=n.active.draggable,U=G?n.active.droppable:null,Z=G?n.active.overlay:null;return!G&&E&&Ye(()=>T({draggable:E,droppable:D,overlay:F})),{previousDraggable:G,previousDroppable:U,previousOverlay:Z}},{previousDraggable:null,previousDroppable:null,previousOverlay:null})};L(()=>k()),t.onDragStart&&A(t.onDragStart),t.onDragMove&&L(t.onDragMove),t.onDragOver&&$(t.onDragOver),t.onDragEnd&&H(t.onDragEnd);const M=[n,{addTransformer:i,removeTransformer:o,addDraggable:s,removeDraggable:a,addDroppable:c,removeDroppable:u,addSensor:f,removeSensor:h,setOverlay:m,clearOverlay:p,recomputeLayouts:_,detectCollisions:k,draggableActivators:y,sensorStart:g,sensorMove:b,sensorEnd:v,dragStart:x,dragEnd:I,onDragStart:A,onDragMove:L,onDragOver:$,onDragEnd:H}];return C(CA.Provider,{value:M,get children(){return t.children}})},ga=()=>wt(CA)||null,Xce=(e="pointer-sensor")=>{const[t,{addSensor:n,removeSensor:r,sensorStart:i,sensorMove:o,sensorEnd:s,dragStart:a,dragEnd:l}]=ga(),c=250,u=10;Pt(()=>{n({id:e,activators:{pointerdown:p}})}),ae(()=>{r(e)});const d=()=>t.active.sensorId===e,f={x:0,y:0};let h=null,m=null;const p=(k,x)=>{k.button===0&&(document.addEventListener("pointermove",v),document.addEventListener("pointerup",y),m=x,f.x=k.clientX,f.y=k.clientY,h=window.setTimeout(b,c))},g=()=>{h&&(clearTimeout(h),h=null),document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",y),document.removeEventListener("selectionchange",_)},b=()=>{t.active.sensor?d()||g():(i(e,f),a(m),_(),document.addEventListener("selectionchange",_))},v=k=>{const x={x:k.clientX,y:k.clientY};if(!t.active.sensor){const I={x:x.x-f.x,y:x.y-f.y};Math.sqrt(I.x**2+I.y**2)>u&&b()}d()&&(k.preventDefault(),o(x))},y=k=>{g(),d()&&(k.preventDefault(),l(),s())},_=()=>{window.getSelection()?.removeAllRanges()}},EA=e=>(Xce(),it(()=>e.children)),km=e=>({transform:`translate3d(${e.x}px, ${e.y}px, 0)`}),Qce=(e,t={})=>{const[n,{addDraggable:r,removeDraggable:i,draggableActivators:o}]=ga(),[s,a]=we(null);Pt(()=>{const d=s();d&&r({id:e,node:d,layout:sl(d),data:t})}),ae(()=>i(e));const l=()=>n.active.draggableId===e,c=()=>n.draggables[e]?.transform||hi();return Object.defineProperties((d,f)=>{const h=f?f():{};re(()=>{const m=s(),p=o(e);if(m)for(const g in p)m.addEventListener(g,p[g]);ae(()=>{if(m)for(const g in p)m.removeEventListener(g,p[g])})}),a(d),h.skipTransform||re(()=>{const m=c();if(Q4(m,hi()))d.style.removeProperty("transform");else{const p=km(c());d.style.setProperty("transform",p.transform??null)}})},{ref:{enumerable:!0,value:a},isActiveDraggable:{enumerable:!0,get:l},dragActivators:{enumerable:!0,get:()=>o(e,!0)},transform:{enumerable:!0,get:c}})},eue=(e,t={})=>{const[n,{addDroppable:r,removeDroppable:i}]=ga(),[o,s]=we(null);Pt(()=>{const u=o();u&&r({id:e,node:u,layout:sl(u),data:t})}),ae(()=>i(e));const a=()=>n.active.droppableId===e,l=()=>n.droppables[e]?.transform||hi();return Object.defineProperties((u,d)=>{const f=d?d():{};s(u),f.skipTransform||re(()=>{const h=l();if(Q4(h,hi()))u.style.removeProperty("transform");else{const m=km(l());u.style.setProperty("transform",m.transform??null)}})},{ref:{enumerable:!0,value:s},isActiveDroppable:{enumerable:!0,get:a},transform:{enumerable:!0,get:l}})},TA=e=>{const[t,{onDragStart:n,onDragEnd:r,setOverlay:i,clearOverlay:o}]=ga();let s;n(({draggable:l})=>{i({node:l.node,layout:l.layout}),queueMicrotask(()=>{if(s){const c=sl(s),u={x:(l.layout.width-c.width)/2,y:(l.layout.height-c.height)/2};c.x+=u.x,c.y+=u.y,i({node:s,layout:c})}})}),r(()=>queueMicrotask(o));const a=()=>{const l=t.active.overlay,c=t.active.draggable;return!l||!c?{}:{position:"fixed",transition:"transform 0s",top:`${l.layout.top}px`,left:`${l.layout.left}px`,"min-width":`${c.layout.width}px`,"min-height":`${c.layout.height}px`,...km(l.transform),...e.style}};return C(ia,{get mount(){return document.body},get children(){return C(Ce,{get when(){return t.active.draggable},get children(){var l=Gce(),c=s;return typeof c=="function"?Cr(c,l):s=l,X(l,(()=>{var u=it(()=>typeof e.children=="function");return()=>u()?e.children(t.active.draggable):e.children})()),Ve(u=>{var d=e.class,f=a();return d!==u.e&&bu(l,u.e=d),u.t=wv(l,f,u.t),u},{e:void 0,t:void 0}),l}})}})},tue=(e,t,n)=>{const r=e.slice();return r.splice(n,0,...r.splice(t,1)),r},$A=yt(),LA=e=>{const[t]=ga(),[n,r]=qe({initialIds:[],sortedIds:[]}),i=a=>a>=0&&a<n.initialIds.length;re(()=>{r("initialIds",[...e.ids]),r("sortedIds",[...e.ids])}),re(()=>{t.active.draggableId&&t.active.droppableId?Ye(()=>{const a=n.sortedIds.indexOf(t.active.draggableId),l=n.initialIds.indexOf(t.active.droppableId);if(!i(a)||!i(l))r("sortedIds",[...e.ids]);else if(a!==l){const c=tue(n.sortedIds,a,l);r("sortedIds",c)}}):r("sortedIds",[...e.ids])});const s=[n,{}];return C($A.Provider,{value:s,get children(){return e.children}})},nue=()=>wt($A)||null,rue=(e,t)=>n=>{e(n),t(n)},AA=(e,t={})=>{const[n,{addTransformer:r,removeTransformer:i}]=ga(),[o]=nue(),s=Qce(e,t),a=eue(e,t),l=rue(s.ref,a.ref),c=()=>o.initialIds.indexOf(e),u=()=>o.sortedIds.indexOf(e),d=g=>n.droppables[g]?.layout||null,f=()=>{const g=hi(),b=c(),v=u();if(v!==b){const y=d(e),_=d(o.initialIds[v]);y&&_&&(g.x=_.x-y.x,g.y=_.y-y.y)}return g},h={id:"sortableOffset",order:100,callback:g=>{const b=f();return{x:g.x+b.x,y:g.y+b.y}}};Pt(()=>r("droppables",e,h)),ae(()=>i("droppables",e,h.id));const m=()=>(e===n.active.draggableId&&!n.active.overlay?n.draggables[e]?.transform:n.droppables[e]?.transform)||hi();return Object.defineProperties(g=>{s(g,()=>({skipTransform:!0})),a(g,()=>({skipTransform:!0})),re(()=>{const b=m();if(Q4(b,hi()))g.style.removeProperty("transform");else{const v=km(m());g.style.setProperty("transform",v.transform??null)}})},{ref:{enumerable:!0,value:l},transform:{enumerable:!0,get:m},isActiveDraggable:{enumerable:!0,get:()=>s.isActiveDraggable},dragActivators:{enumerable:!0,get:()=>s.dragActivators},isActiveDroppable:{enumerable:!0,get:()=>a.isActiveDroppable}})};function iue(e){const t={locs:[],timer:void 0,pending:void 0,over:void 0,last:void 0},n=e.delay??250,r=e.max??4,i=e.tolerance??80,o=e.edge??18,s=()=>{t.timer!==void 0&&clearTimeout(t.timer),t.timer=void 0,t.pending=void 0},a=()=>{s(),t.over=void 0,t.last=void 0,t.locs.length=0},l=m=>{if(!e.enabled())return;const p=e.el();if(!p)return;const g=p.getBoundingClientRect(),b=m.clientX,v=m.clientY;b<g.left||b>g.right||v<g.top||v>g.bottom||(t.locs.push({x:b,y:v}),t.locs.length>r&&t.locs.shift())},c=()=>{if(!e.enabled()||!e.active())return 0;const m=e.el();if(!m||t.locs.length<2)return 0;const p=m.getBoundingClientRect(),g=t.locs[t.locs.length-1];if(!g)return 0;const b=t.locs[0]??g;if(b.x<p.left||b.x>p.right||b.y<p.top||b.y>p.bottom||t.last&&g.x===t.last.x&&g.y===t.last.y)return 0;if(p.right-g.x<=o)return t.last=g,n;const v={x:p.right,y:p.top-i},y={x:p.right,y:p.bottom+i},_=(L,$)=>($.y-L.y)/($.x-L.x),k=_(g,v),x=_(g,y),I=_(b,v),A=_(b,y);return k<I&&x>A?(t.last=g,n):(t.last=void 0,0)},u=m=>{s(),e.onActivate(m)},d=m=>{if(!m||e.active()===m)return;if(!e.active()){u(m);return}const p=c();if(p===0){u(m);return}s(),t.pending=m,t.timer=window.setTimeout(()=>{t.timer=void 0,t.pending===m&&(t.pending=void 0,e.enabled()&&e.active()&&t.over===m&&e.onActivate(m))},p)};return{move:l,enter:(m,p)=>{e.enabled()&&(t.over=m,l(p),d(m))},leave:m=>{t.over===m&&(t.over=void 0),t.pending===m&&s()},activate:u,request:d,cancel:s,reset:a}}let yv;const oue=e=>{yv=e},sue=e=>{if(window.focus(),!!e){if(yv)return yv(e);console.warn("notification-click: navigate function not set, falling back to window.location.assign"),window.location.assign(e)}},cc=e=>e.replace(/[\\/]+$/,""),Da=new Map,Oa=new Map;function aue(){const e={resolve:n=>{}};return{promise:new Promise(n=>{e.resolve=n}),resolve:e.resolve}}const cf={get(e){return Da.get(cc(e))},pending(e){const t=cc(e),n=Da.get(t);n&&n.status!=="pending"||Da.set(t,{status:"pending"})},ready(e){const t=cc(e),n={status:"ready"};Da.set(t,n);const r=Oa.get(t);r&&(Oa.delete(t),r.resolve(n))},failed(e,t){const n=cc(e),r={status:"failed",message:t};Da.set(n,r);const i=Oa.get(n);i&&(Oa.delete(n),i.resolve(r))},wait(e){const t=cc(e),n=Da.get(t);if(n&&n.status!=="pending")return Promise.resolve(n);const r=Oa.get(t);if(r)return r.promise;const i=aue();return Oa.set(t,i),i.promise}},lue=40,mu={session:new Map,terminal:new Map},MA=(e,t,n)=>{for(e.delete(t),e.set(t,n);e.size>lue;){const r=e.keys().next().value;if(r===void 0)return;e.delete(r)}},cue=(e,t)=>{const n=mu.session.get(e)??{prompt:"",files:{}};MA(mu.session,e,{...n,...t})},The=e=>mu.session.get(e),$he=(e,t)=>{MA(mu.terminal,e,t)},Lhe=e=>mu.terminal.get(e),uue=e=>typeof e!="object"||e===null?!1:"draggable"in e,W0=e=>{if(!uue(e))return;const t=e.draggable;if(t)return typeof t.id=="string"?t.id:void 0},due=(e,t)=>({id:e,order:100,callback:n=>t==="x"?{...n,x:0}:{...n,y:0}}),DA=(e,t)=>()=>{const n=ga();if(!n)return null;const[,{onDragStart:r,onDragEnd:i,addTransformer:o,removeTransformer:s}]=n,a=due(t,e),l=An(c=>(r(u=>{const d=W0(u);d&&o("draggables",d,a)}),i(u=>{const d=W0(u);d&&s("draggables",d,a.id)}),c));return ae(l),null},OA=DA("x","constrain-x-axis"),Ahe=DA("y","constrain-y-axis");var fue=me('<div><div class="text-[10px] leading-none font-black uppercase tracking-[0.04em] opacity-70"></div><div>'),hue=me('<aside class="pointer-events-auto fixed bottom-3 right-3 z-50 w-[308px] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-xl border border-border-base bg-surface-raised-stronger-non-alpha p-0.5 text-text-strong shadow-[var(--shadow-lg-border-base)] sm:bottom-4 sm:right-4 sm:w-[324px]"><div class="grid grid-cols-5 gap-px font-mono">');const fg=5e3,mue=(e,t=0)=>{if(!(e===void 0||Number.isNaN(e)))return`${e.toFixed(t)}ms`},uc=e=>{if(!(e===void 0||Number.isNaN(e)))return`${Math.round(e)}`},D7=e=>{if(e===void 0||Number.isNaN(e))return;const t=e/1024/1024;return`${t>=1024?t.toFixed(0):t.toFixed(1)}MB`},no=(e,t,n=!1)=>e===void 0||Number.isNaN(e)?!1:n?e<t:e>t,hg=e=>e.includes("/session");function ro(e){return C($r,{get value(){return e.tip},placement:"top",get children(){var t=fue(),n=t.firstChild,r=n.nextSibling;return X(n,()=>e.label),X(r,()=>e.value),Ve(i=>{var o={"flex min-h-[42px] w-full min-w-0 flex-col items-center justify-center rounded-[8px] px-0.5 py-1 text-center":!0,"col-span-2":!!e.wide},s={"text-[13px] leading-none font-bold tabular-nums sm:text-[14px]":!0,"text-text-on-critical-base":!!e.bad,"opacity-70":!!e.dim};return i.e=Ft(t,o,i.e),i.t=Ft(r,s,i.t),i},{e:void 0,t:void 0}),t}})}function pue(){const e=En(),t=Al(),n=rW(),[r,i]=qe({cls:void 0,delay:void 0,fps:void 0,gap:void 0,heap:{limit:void 0,used:void 0},inp:void 0,jank:void 0,long:{block:void 0,count:void 0,max:void 0},nav:{dur:void 0,pending:!1}}),o=()=>e.t("debugBar.na"),s=()=>r.heap.limit?(r.heap.used??0)/r.heap.limit:void 0,a=()=>{const p=s();return p===void 0?o():`${Math.round(p*100)}%`},l=()=>r.long.count===void 0?o():`${uc(r.long.block)??o()}/${r.long.count}`,c=()=>r.nav.pending?"...":uc(r.nav.dur)??o();let u="",d=0,f=!1,h=0,m=0;return re(()=>{const p=n(),g=`${t.pathname}${t.search}`;if(!f){f=!0,u=g;return}if(p){if(h!==0&&cancelAnimationFrame(h),m!==0&&cancelAnimationFrame(m),h=0,m=0,d!==0)return;d=performance.now(),hg(u)&&i("nav",{dur:void 0,pending:!0});return}if(d===0){u=g;return}const b=d,v=u;d=0,u=g,(hg(v)||hg(g))&&(h!==0&&cancelAnimationFrame(h),m!==0&&cancelAnimationFrame(m),h=requestAnimationFrame(()=>{h=0,m=requestAnimationFrame(()=>{m=0,i("nav",{dur:performance.now()-b,pending:!1})})}))}),Pt(()=>{const p=[],g=[],b=[],v=new Map;let y=!1,_,k=0,x=0,I=0;const A=(U,Z,Y)=>{for(;U[0]&&Y-U[0].at>Z;)U.shift()},L=U=>{A(g,fg,U);const Z=g.reduce((oe,fe)=>oe+fe.dur,0),Y=g.reduce((oe,fe)=>Math.max(oe,fe.dur),0),ee=g.filter(oe=>oe.dur>32).length;rt(()=>{i("fps",Z>0?g.length*1e3/Z:void 0),i("gap",Y>0?Y:void 0),i("jank",ee)})},$=(U=performance.now())=>{if(!y)return;A(b,fg,U);const Z=b.reduce((ee,oe)=>ee+Math.max(0,oe.dur-50),0),Y=b.reduce((ee,oe)=>Math.max(ee,oe.dur),0);i("long",{block:Z,count:b.length,max:Y})},H=(U=performance.now())=>{for(const[ee,oe]of v)U-oe.at>fg&&v.delete(ee);let Z=0,Y=0;for(const ee of v.values())Z=Math.max(Z,ee.delay),Y=Math.max(Y,ee.dur);rt(()=>{i("delay",Z>0?Z:void 0),i("inp",Y>0?Y:void 0)})},j=()=>{const U=performance.memory;U&&i("heap",{limit:U.jsHeapSizeLimit,used:U.usedJSHeapSize})},M=()=>{g.length=0,b.length=0,v.clear(),x=0,I=0,rt(()=>{i("fps",void 0),i("gap",void 0),i("jank",void 0),i("delay",void 0),i("inp",void 0),y&&i("long",{block:0,count:0,max:0})})},T=(U,Z,Y)=>{if(typeof PerformanceObserver>"u"||!(PerformanceObserver.supportedEntryTypes??[]).includes(U))return!1;const ee=new PerformanceObserver(oe=>Y(oe.getEntries()));try{return ee.observe(Z),p.push(ee),!0}catch{return ee.disconnect(),!1}};T("layout-shift",{buffered:!0,type:"layout-shift"},U=>{const Z=U.reduce((Y,ee)=>{const oe=ee;return oe.hadRecentInput?Y:Y+oe.value},0);Z!==0&&i("cls",Y=>(Y??0)+Z)})&&i("cls",0),T("longtask",{buffered:!0,type:"longtask"},U=>{const Z=performance.now();b.push(...U.map(Y=>({at:Y.startTime,dur:Y.duration}))),$(Z)})&&(y=!0,i("long",{block:0,count:0,max:0})),T("event",{buffered:!0,durationThreshold:16,type:"event"},U=>{for(const Z of U){const Y=Z;if(Y.duration<16)continue;const ee=Y.interactionId&&Y.interactionId>0?Y.interactionId:`${Y.name}:${Math.round(Y.startTime)}`,oe=v.get(ee),fe=Math.max(0,(Y.processingStart??Y.startTime)-Y.startTime);if(v.set(ee,{at:Y.startTime,delay:Math.max(oe?.delay??0,fe),dur:Math.max(oe?.dur??0,Y.duration)}),v.size<=200)continue;const Se=v.keys().next().value;Se!==void 0&&v.delete(Se)}H()});const E=U=>{if(document.visibilityState!=="visible"){k=0;return}if(x===0){x=U,k=requestAnimationFrame(E);return}g.push({at:U,dur:U-x}),x=U,U-I>=250&&(I=U,L(U)),k=requestAnimationFrame(E)},D=()=>{k!==0&&cancelAnimationFrame(k),k=0,_!==void 0&&(clearInterval(_),_=void 0)},F=()=>{document.visibilityState==="visible"&&(_===void 0&&(_=window.setInterval(()=>{$(),H(),j()},1e3)),k===0&&(k=requestAnimationFrame(E)))},G=()=>{if(document.visibilityState!=="visible"){D();return}M(),F()};j(),F(),Kt(document,"visibilitychange",G),ae(()=>{h!==0&&cancelAnimationFrame(h),m!==0&&cancelAnimationFrame(m),D();for(const U of p)U.disconnect()})}),(()=>{var p=hue(),g=p.firstChild;return X(g,C(ro,{get label(){return e.t("debugBar.nav.label")},get tip(){return e.t("debugBar.nav.tip")},get value(){return c()},get bad(){return no(r.nav.dur,400)},get dim(){return it(()=>r.nav.dur===void 0)()&&!r.nav.pending}}),null),X(g,C(ro,{get label(){return e.t("debugBar.fps.label")},get tip(){return e.t("debugBar.fps.tip")},get value(){return it(()=>r.fps===void 0)()?o():`${Math.round(r.fps)}`},get bad(){return no(r.fps,50,!0)},get dim(){return r.fps===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.frame.label")},get tip(){return e.t("debugBar.frame.tip")},get value(){return uc(r.gap)??o()},get bad(){return no(r.gap,50)},get dim(){return r.gap===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.jank.label")},get tip(){return e.t("debugBar.jank.tip")},get value(){return it(()=>r.jank===void 0)()?o():`${r.jank}`},get bad(){return no(r.jank,8)},get dim(){return r.jank===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.long.label")},get tip(){return e.t("debugBar.long.tip",{max:mue(r.long.max)??o()})},get value(){return l()},get bad(){return no(r.long.block,200)},get dim(){return r.long.count===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.delay.label")},get tip(){return e.t("debugBar.delay.tip")},get value(){return uc(r.delay)??o()},get bad(){return no(r.delay,100)},get dim(){return r.delay===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.inp.label")},get tip(){return e.t("debugBar.inp.tip")},get value(){return uc(r.inp)??o()},get bad(){return no(r.inp,200)},get dim(){return r.inp===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.cls.label")},get tip(){return e.t("debugBar.cls.tip")},get value(){return it(()=>r.cls===void 0)()?o():r.cls.toFixed(2)},get bad(){return no(r.cls,.1)},get dim(){return r.cls===void 0}}),null),X(g,C(ro,{get label(){return e.t("debugBar.mem.label")},get tip(){return it(()=>r.heap.used===void 0)()?e.t("debugBar.mem.tipUnavailable"):e.t("debugBar.mem.tip",{used:D7(r.heap.used)??o(),limit:D7(r.heap.limit)??o()})},get value(){return a()},get bad(){return no(s(),.8)},get dim(){return r.heap.used===void 0},wide:!0}),null),Ve(()=>vt(p,"aria-label",e.t("debugBar.ariaLabel"))),p})()}const e2=100;function gue(e,t,n=e2){if(!e.stack.length){const i=t==="/"?["/"]:["/",t];return{stack:i,index:i.length-1,action:void 0}}const r=e.stack[e.index];return t===r?e.action?{...e,action:void 0}:e:e.action?{...e,action:void 0}:vue(e,t,n)}function vue(e,t,n=e2){const r=e.stack.slice(0,e.index+1).concat(t),i=bue(r,r.length-1,n);return{...e,...i,action:void 0}}function bue(e,t,n=e2){if(e.length<=n)return{stack:e,index:t};const r=e.length-n;return{stack:e.slice(r),index:Math.max(0,t-r)}}function yue(e){if(e.index<=0)return;const t=e.index-1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"back"},to:n}}function wue(e){if(e.index>=e.stack.length-1)return;const t=e.index+1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"forward"},to:n}}var kue=me('<div class="h-full shrink-0">'),xue=me('<div class="xl:hidden w-10 shrink-0 flex items-center justify-center">'),Sue=me('<div class="xl:hidden w-[48px] shrink-0 flex items-center justify-center">'),_ue=me('<div class="flex items-center shrink-0 w-8 mr-1"><div class=transition-opacity>'),Cue=me('<div class="flex items-center gap-0 transition-transform">'),Iue=me('<div data-tauri-decorum-tb class="flex flex-row">'),Eue=me('<header class="h-10 shrink-0 bg-background-base relative grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center"data-tauri-drag-region><div><div class="flex items-center gap-1 shrink-0"><div class="hidden xl:flex items-center shrink-0"></div></div><div id=duckmind-titlebar-left class="flex items-center gap-3 min-w-0 px-2"></div></div><div class="min-w-0 flex items-center justify-center pointer-events-none"><div id=duckmind-titlebar-center class="pointer-events-auto min-w-0 flex justify-center w-fit max-w-full"></div></div><div data-tauri-drag-region><div id=duckmind-titlebar-right class="flex items-center gap-1 shrink-0 justify-end">'),Tue=me('<div class="w-36 shrink-0">');const t2=()=>window.__TAURI__,$ue=()=>t2()?.window?.getCurrentWindow?.(),Lue=()=>t2()?.webviewWindow?.getCurrentWebviewWindow?.();function Aue(){const e=jl(),t=$o(),n=u_(),r=En(),i=aS(),o=ua(),s=Al(),a=pr(),l=q(()=>t.platform==="desktop"&&t.os==="macos"),c=q(()=>t.platform==="desktop"&&t.os==="windows"),u=q(()=>t.platform==="web"),d=()=>t.webviewZoom?.()??1,f=()=>l()?`${40/d()}px`:void 0,[h,m]=qe({stack:[],index:0,action:void 0}),p=()=>`${s.pathname}${s.search}${s.hash}`,g=q(()=>!a.dir||a.id?!1:s.pathname.replace(/\/+$/,"").split("/").at(-1)==="session");re(()=>{const $=p();Ye(()=>{const H=gue(h,$);H!==h&&m(H)})});const b=q(()=>h.index>0),v=q(()=>h.index<h.stack.length-1),y=q(()=>e.projects.list().length>0),_=()=>{const $=yue(h);$&&(m($.state),o($.to))},k=()=>{const $=wue(h);$&&(m($.state),o($.to))};n.register(()=>[{id:"common.goBack",title:r.t("common.goBack"),category:r.t("command.category.view"),keybind:"mod+[",onSelect:_},{id:"common.goForward",title:r.t("common.goForward"),category:r.t("command.category.view"),keybind:"mod+]",onSelect:k}]);const x=()=>{if(t.platform==="desktop")return $ue()};re(()=>{if(t.platform!=="desktop")return;const $=i.colorScheme(),H=$==="system"?null:$,j=Lue();j?.setTheme&&j.setTheme(H).catch(()=>{})});const I=$=>$ instanceof Element?!!$.closest("button, a, input, textarea, select, option, [role='button'], [role='menuitem'], [contenteditable='true'], [contenteditable='']"):!1,A=$=>{if(t.platform!=="desktop"||$.buttons!==1||I($.target))return;const H=x();H?.startDragging&&($.preventDefault(),H.startDragging().catch(()=>{}))},L=$=>{if(t.platform!=="desktop"||I($.target)||$.target instanceof Element&&$.target.closest("[data-tauri-decorum-tb]"))return;const H=x();H?.toggleMaximize&&($.preventDefault(),H.toggleMaximize().catch(()=>{}))};return(()=>{var $=Eue(),H=$.firstChild,j=H.firstChild,M=j.firstChild,T=H.nextSibling,E=T.nextSibling;return E.firstChild,$.$$dblclick=L,$.$$mousedown=A,X(H,C(Ce,{get when(){return l()},get children(){return[(()=>{var D=kue();return Ve(F=>Xn(D,"width",`${72/d()}px`)),D})(),(()=>{var D=xue();return X(D,C(Wr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),D})()]}}),j),X(H,C(Ce,{get when(){return!l()},get children(){var D=Sue();return X(D,C(Wr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),D}}),j),X(j,C(bv,{get class(){return u()?"hidden xl:flex shrink-0 ml-14":"hidden xl:flex shrink-0 ml-2"},placement:"bottom",get title(){return r.t("command.sidebar.toggle")},get keybind(){return n.keybind("sidebar.toggle")},get children(){return C(rn,{variant:"ghost",class:"group/sidebar-toggle titlebar-icon w-8 h-6 p-0 box-border",get onClick(){return e.sidebar.toggle},get"aria-label"(){return r.t("command.sidebar.toggle")},get"aria-expanded"(){return e.sidebar.opened()},get children(){return C(ur,{size:"small",get name(){return e.sidebar.opened()?"sidebar-active":"sidebar"}})}})}}),M),X(M,C(Ce,{get when(){return a.dir},get children(){var D=_ue(),F=D.firstChild;return X(F,C(bv,{placement:"bottom",get title(){return r.t("command.session.new")},get keybind(){return n.keybind("session.new")},openDelay:2e3,get children(){return C(rn,{variant:"ghost",get icon(){return g()?"new-session-active":"new-session"},class:"titlebar-icon w-8 h-6 p-0 box-border",get disabled(){return e.sidebar.opened()},get tabIndex(){return e.sidebar.opened()?-1:void 0},onClick:()=>{a.dir&&o(`/${a.dir}/session`)},get"aria-label"(){return r.t("command.session.new")},get"aria-current"(){return g()?"page":void 0}})}})),Ve(G=>{var U=e.sidebar.opened()?"true":void 0,Z={"opacity-100 duration-120 ease-out":!e.sidebar.opened(),"opacity-0 duration-120 ease-in delay-0 pointer-events-none":e.sidebar.opened()};return U!==G.e&&vt(D,"aria-hidden",G.e=U),G.t=Ft(F,Z,G.t),G},{e:void 0,t:void 0}),D}}),null),X(M,C(Ce,{get when(){return y()},get children(){var D=Cue();return X(D,C($r,{placement:"bottom",get value(){return r.t("common.goBack")},openDelay:2e3,get children(){return C(rn,{variant:"ghost",icon:"chevron-left",class:"titlebar-icon w-6 h-6 p-0 box-border",get disabled(){return!b()},onClick:_,get"aria-label"(){return r.t("common.goBack")}})}}),null),X(D,C($r,{placement:"bottom",get value(){return r.t("common.goForward")},openDelay:2e3,get children(){return C(rn,{variant:"ghost",icon:"chevron-right",class:"titlebar-icon w-6 h-6 p-0 box-border",get disabled(){return!v()},onClick:k,get"aria-label"(){return r.t("common.goForward")}})}}),null),Ve(F=>Ft(D,{"translate-x-0":!e.sidebar.opened(),"-translate-x-[36px]":e.sidebar.opened(),"duration-180 ease-out":!e.sidebar.opened(),"duration-180 ease-in":e.sidebar.opened()},F)),D}}),null),E.$$mousedown=A,X(E,C(Ce,{get when(){return c()},get children(){return[it(()=>it(()=>!t2())()&&Tue()),Iue()]}}),null),Ve(D=>{var F=f(),G={"flex items-center min-w-0":!0,"pl-2":!l()},U={"flex items-center min-w-0 justify-end":!0,"pr-2":!c()};return F!==D.e&&Xn($,"min-height",D.e=F),D.t=Ft(H,G,D.t),D.a=Ft(E,U,D.a),D},{e:void 0,t:void 0,a:void 0}),$})()}Jr(["mousedown","dblclick"]);const Ne=e=>{const t=e.replaceAll("\\","/"),n=t.match(/^([A-Za-z]:)\/+$/);return n?`${n[1]}/`:/^\/+$/i.test(t)?"/":t.replace(/\/+$/,"")};function PA(e){const t=e-6e4;return(n,r)=>{const i=n.time.updated??n.time.created,o=r.time.updated??r.time.created,s=i>t,a=o>t;return s&&a?n.id<r.id?-1:n.id>r.id?1:0:s&&!a?-1:!s&&a?1:o-i}}const Mue=(e,t)=>Ne(e.directory)===Ne(t)&&!e.parentID&&!e.time?.archived,RA=e=>(e.session??[]).filter(t=>Mue(t,e.path.directory)),pu=(e,t)=>RA(e).sort(PA(t)),O7=(e,t)=>e.flatMap(RA).sort(PA(t))[0];function Due(e,t=()=>!0){return Object.values(e??{}).some(n=>n?.some(t))}const Oue=(e,t,n)=>{if(!n||n===t)return;const r=new Map((e??[]).map(o=>[o.id,o]));let i=n;for(;i;){const o=r.get(i);if(!o?.parentID)return;if(o.parentID===t)return o;i=o.parentID}},n2=e=>e.name||Nn(e.worktree),mg=(e,t)=>{if(e&&typeof e=="object"&&"data"in e){const n=e.data;if(n?.message)return n.message}return e instanceof Error?e.message:t},uf=(e,t,n)=>{const r=Ne(e),i=new Map;for(const s of t){const a=Ne(s);a!==r&&(i.has(a)||i.set(a,s))}if(!n?.length)return[e,...i.values()];const o=[e];for(const s of n){const a=Ne(s);if(a===r)continue;const l=i.get(a);l&&(o.push(l),i.delete(a))}return[...o,...i.values()]},Pue="duckmind:deep-link",NA=e=>{if(e.startsWith("duckmind://")&&!(typeof URL.canParse=="function"&&!URL.canParse(e)))try{return new URL(e)}catch{return}},Rue=e=>{const t=NA(e);if(!t||t.hostname!=="open-project")return;const n=t.searchParams.get("directory");if(n)return n},Nue=e=>{const t=NA(e);if(!t||t.hostname!=="new-session")return;const n=t.searchParams.get("directory");if(!n)return;const r=t.searchParams.get("prompt")||void 0;return r?{directory:n,prompt:r}:{directory:n}},zue=e=>e.map(Rue).filter(t=>!!t),jue=e=>e.map(Nue).filter(t=>!!t),Fue=e=>{const t=e.__DUCKMIND__?.deepLinks??[];return t.length===0?[]:(e.__DUCKMIND__&&(e.__DUCKMIND__.deepLinks=[]),t)};var Hue=me("<input data-component=inline-input>");function Vue(e){const[t,n]=pe(e,["class","width","style"]),r=()=>t.style?typeof t.style=="string"?t.width?`${t.style};width:${t.width}`:t.style:t.width?{...t.style,width:t.width}:t.style:{width:t.width};return(()=>{var i=Hue();return Zr(i,ie({get class(){return t.class},get style(){return r()}},n),!1,!1),i})()}var Uue=me("<span>");function Bue(){const[e,t]=qe({active:"",value:""}),n=c=>e.active===c,r=()=>e.value,i=(c,u)=>{c&&t({active:c,value:u})},o=()=>t({active:"",value:""}),s=c=>{const u=e.value.trim();if(!u){o();return}o(),c(u)},a=(c,u)=>{if(c.key==="Enter"){c.preventDefault(),s(u);return}c.key==="Escape"&&(c.preventDefault(),o())};return{editor:e,editorOpen:n,editorValue:r,openEditor:i,closeEditor:o,saveEditor:s,editorKeyDown:a,setEditor:t,InlineEditor:c=>{let u;ae(()=>{u!==void 0&&cancelAnimationFrame(u)});const d=()=>c.editing??n(c.id),f=()=>c.stopPropagation??!1,h=()=>c.openOnDblClick??!0,m=g=>{f()&&g.stopPropagation()},p=g=>{h()&&(m(g),i(c.id,c.value()))};return C(Ce,{get when(){return d()},get fallback(){return(()=>{var g=Uue();return g.$$touchstart=m,g.$$click=m,g.$$mousedown=m,g.$$pointerdown=m,g.$$dblclick=p,X(g,()=>c.value()),Ve(()=>bu(g,c.displayClass??c.class)),g})()},get children(){return C(Vue,{ref:g=>{u!==void 0&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=void 0,g.isConnected&&g.focus()})},get value(){return r()},get class(){return c.class},onInput:g=>t("value",g.currentTarget.value),onKeyDown:g=>{g.stopPropagation(),a(g,c.onSave)},onBlur:o,onPointerDown:m,onClick:m,onDblClick:m,onMouseDown:m,onMouseUp:m,onTouchStart:m})}})}}}Jr(["dblclick","pointerdown","mousedown","click","touchstart"]);var que={};Ci(que,{Collapsible:()=>xm,Content:()=>jA,Root:()=>FA,Trigger:()=>HA,useCollapsibleContext:()=>r2});var zA=yt();function r2(){const e=wt(zA);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function jA(e){const[t,n]=we(),r=r2(),i=et({id:r.generateId("content")},e),[o,s]=pe(i,["ref","id","style"]),{present:a}=Fs({show:r.shouldMount,element:()=>t()??null}),[l,c]=we(0),[u,d]=we(0);let h=r.isOpen()||a();return Pt(()=>{const m=requestAnimationFrame(()=>{h=!1});ae(()=>{cancelAnimationFrame(m)})}),re(Yt(a,()=>{if(!t())return;t().style.transitionDuration="0s",t().style.animationName="none";const m=t().getBoundingClientRect();c(m.height),d(m.width),h||(t().style.transitionDuration="",t().style.animationName="")})),re(Yt(r.isOpen,m=>{!m&&t()&&(t().style.transitionDuration="",t().style.animationName="")},{defer:!0})),re(()=>ae(r.registerContentId(o.id))),C(Ce,{get when(){return a()},get children(){return C(pt,ie({as:"div",ref(m){var p=Nt(n,o.ref);typeof p=="function"&&p(m)},get id(){return o.id},get style(){return _i({"--kb-collapsible-content-height":l()?`${l()}px`:void 0,"--kb-collapsible-content-width":u()?`${u()}px`:void 0},o.style)}},()=>r.dataset(),s))}})}function FA(e){const t=`collapsible-${Mn()}`,n=et({id:t},e),[r,i]=pe(n,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[o,s]=we(),a=oa({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:u=>r.onOpenChange?.(u)}),l=q(()=>({"data-expanded":a.isOpen()?"":void 0,"data-closed":a.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),c={dataset:l,isOpen:a.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||a.isOpen(),contentId:o,toggle:a.toggle,generateId:Bi(()=>i.id),registerContentId:Gn(s)};return C(zA.Provider,{value:c,get children(){return C(pt,ie({as:"div"},l,i))}})}function HA(e){const t=r2(),[n,r]=pe(e,["onClick"]);return C(sa,ie({get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return it(()=>!!t.isOpen())()?t.contentId():void 0},get disabled(){return t.disabled()},onClick:o=>{Je(o,n.onClick),t.toggle()}},()=>t.dataset(),r))}var xm=Object.assign(FA,{Content:jA,Trigger:HA}),Wue=me("<div data-slot=collapsible-arrow><span data-slot=collapsible-arrow-icon>");function Gue(e){const[t,n]=pe(e,["class","classList","variant"]);return C(xm,ie({"data-component":"collapsible",get"data-variant"(){return t.variant||"normal"},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n))}function Zue(e){return C(xm.Trigger,ie({"data-slot":"collapsible-trigger"},e))}function Kue(e){return C(xm.Content,ie({"data-slot":"collapsible-content"},e))}function Yue(e){return(()=>{var t=Wue(),n=t.firstChild;return Zr(t,e||{},!1,!0),X(n,C(ur,{name:"chevron-down",size:"small"})),t})()}const pg=Object.assign(Gue,{Arrow:Yue,Trigger:Zue,Content:Kue});var Jue=me("<svg>"),Xue=me("<svg><rect width=3 height=3 rx=1></svg>",!1,!0,!1);const Que=new Set([1,2,4,7,8,11,13,14]),ede=new Set([0,3,12,15]),tde=Array.from({length:16},(e,t)=>({id:t,x:t%4*4,y:Math.floor(t/4)*4,delay:Math.random()*1.5,duration:1+Math.random()*1,outer:Que.has(t),corner:ede.has(t)}));function VA(e){return(()=>{var t=Jue();return Zr(t,ie(e,{viewBox:"0 0 15 15","data-component":"spinner",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},fill:"currentColor"}),!0,!0),X(t,C(zi,{each:tde,children:n=>(()=>{var r=Xue();return Ve(i=>{var o=n.x,s=n.y,a=n.corner?0:void 0,l=n.corner?void 0:`${n.outer?"pulse-opacity-dim":"pulse-opacity"} ${n.duration}s ease-in-out infinite`,c=n.corner?void 0:"both",u=n.corner?void 0:`${n.delay}s`;return o!==i.e&&vt(r,"x",i.e=o),s!==i.t&&vt(r,"y",i.t=s),a!==i.a&&Xn(r,"opacity",i.a=a),l!==i.o&&Xn(r,"animation",i.o=l),c!==i.i&&Xn(r,"animation-fill-mode",i.i=c),u!==i.n&&Xn(r,"animation-delay",i.n=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})()})),t})()}var nde=me("<div>"),rde=me("<img data-slot=avatar-image>");const P7=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function ide(e){return e?P7?P7.segment(e)[Symbol.iterator]().next().value?.segment??Array.from(e)[0]??"":Array.from(e)[0]??"":""}function ode(e){const[t,n]=pe(e,["fallback","src","background","foreground","size","class","classList","style"]),r=t.src;return(()=>{var i=nde();return Zr(i,ie(n,{"data-component":"avatar",get"data-size"(){return t.size||"normal"},"data-has-image":r?"":void 0,get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get style(){return{...typeof t.style=="object"?t.style:{},...!r&&t.background?{"--avatar-bg":t.background}:{},...!r&&t.foreground?{"--avatar-fg":t.foreground}:{}}}}),!1,!0),X(i,C(Ce,{when:r,get fallback(){return ide(t.fallback)},children:o=>(()=>{var s=rde();return vt(s,"draggable",!1),Ve(()=>vt(s,"src",o())),s})()})),i})()}const R7={ask:"var(--icon-agent-ask-base)",build:"var(--icon-agent-build-base)",docs:"var(--icon-agent-docs-base)",plan:"var(--icon-agent-plan-base)"},N7=["var(--icon-agent-ask-base)","var(--icon-agent-build-base)","var(--icon-agent-docs-base)","var(--icon-agent-plan-base)","var(--syntax-info)","var(--syntax-success)","var(--syntax-warning)","var(--syntax-property)","var(--syntax-constant)","var(--text-diff-add-base)","var(--text-diff-delete-base)","var(--icon-warning-base)"];function sde(e){let t=0;for(const n of e)t=t*31+n.charCodeAt(0)>>>0;return N7[t%N7.length]}function ade(e,t){return t||(R7[e]??R7[e.toLowerCase()]??sde(e.toLowerCase()))}function lde(e,t){if(e)for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(r.role!=="user"||!r.agent))return ade(r.agent,t.find(i=>i.name===r.agent)?.color)}}const cde=/^(New session|Child session) - \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;function UA(e){return e&&(e.match(cde)?.[1]??e)}function BA(e,t,n,r=()=>!0){if(!n)return;const i=e.reduce((l,c)=>{if(!c.parentID)return l;const u=l.get(c.parentID);return u&&u.push(c.id),u||l.set(c.parentID,[c.id]),l},new Map),o=new Set([n]),s=[n];for(const l of s){const c=i.get(l);if(c)for(const u of c)o.has(u)||(o.add(u),s.push(u))}const a=s.find(l=>t[l]?.some(r));if(a)return t[a]?.find(r)}function ude(e,t,n,r){return BA(e,t,n,r)}function Mhe(e,t,n,r){return BA(e,t,n,r)}var dde=me("<div>"),fde=me('<div><div class="size-full rounded overflow-clip">'),hde=me('<div class="size-1.5 rounded-full bg-surface-warning-strong">'),mde=me('<div class="size-1.5 rounded-full bg-text-diff-delete-base">'),pde=me('<div class="size-1.5 rounded-full bg-text-interactive-base">'),qA=me('<div class="shrink-0 size-6 flex items-center justify-center">'),WA=me('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">'),gde=me('<div class="shrink-0 overflow-hidden transition-[width,opacity]">'),vde=me('<div class="group/session relative w-full min-w-0 rounded-md cursor-default pr-3 transition-colors hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active"><div class="flex min-w-0 items-center gap-1"><div class="min-w-0 flex-1">'),bde=me("<div class=w-full>"),yde=me('<div class="group/session relative w-full min-w-0 rounded-md cursor-default transition-colors pl-2 pr-3 hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active">'),wde=me('<div class="flex flex-col gap-1">'),kde=me('<div class="h-8 w-full rounded-md bg-surface-raised-base opacity-60 animate-pulse">');const xde="4b0ea68d7af9a6031a7ffda7ad66e0cb83315750",GA=e=>{const t=Qr(),n=em(),r=U4(),i=q(()=>[e.project.worktree,...e.project.sandboxes??[]]),o=q(()=>i().reduce((u,d)=>u+n.project.unseenCount(d),0)),s=q(()=>i().some(u=>n.project.unseenHasError(u))),a=q(()=>i().some(u=>{const[d]=t.child(u,{bootstrap:!1});return Due(d.permission,f=>!r.autoResponds(f,u))})),l=q(()=>e.notify&&(a()||o()>0)),c=q(()=>e.project.name||Nn(e.project.worktree));return(()=>{var u=fde(),d=u.firstChild;return X(d,C(ode,ie({get fallback(){return c()},get src(){return it(()=>e.project.id===xde)()?"https://duckmind.ai/favicon.svg":e.project.icon?.override}},()=>zre(e.project.icon?.color),{class:"size-full rounded",get classList(){return{"badge-mask":l()}}}))),X(u,C(Ce,{get when(){return l()},get children(){var f=dde();return Ve(h=>Ft(f,{"absolute top-px right-px size-1.5 rounded-full z-10":!0,"bg-surface-warning-strong":a(),"bg-icon-critical-base":!a()&&s(),"bg-text-interactive-base":!a()&&!s()},h)),f}}),null),Ve(()=>bu(u,`relative size-8 shrink-0 rounded ${e.class??""}`)),u})()},Sde=e=>{const t=()=>UA(e.session.title);return C(gS,{get href(){return`/${e.slug}/session/${e.session.id}`},get class(){return`flex items-center gap-2 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},get onPointerDown(){return e.warmPress},get onFocus(){return e.warmFocus},onClick:()=>{e.sidebarOpened()||e.clearHoverProjectSoon()},get children(){return[C(Ce,{get when(){return e.isWorking()||e.hasPermissions()||e.hasError()||e.unseenCount()>0},get children(){var n=qA();return X(n,C(Y0,{get children(){return[C(Fr,{get when(){return e.isWorking()},get children(){return C(VA,{class:"size-[15px]"})}}),C(Fr,{get when(){return e.hasPermissions()},get children(){return hde()}}),C(Fr,{get when(){return e.hasError()},get children(){return mde()}}),C(Fr,{get when(){return e.unseenCount()>0},get children(){return pde()}})]}})),Ve(r=>Xn(n,"color",e.tint()??"var(--icon-interactive-base)")),n}}),(()=>{var n=WA();return X(n,t),n})()]}})},G0=e=>{const t=pr(),n=jl(),r=En(),i=em(),o=U4(),s=Qr(),a=q(()=>i.session.unseenCount(e.session.id)),l=q(()=>i.session.unseenHasError(e.session.id)),[c]=s.child(e.session.directory),u=q(()=>!!ude(c.session,c.permission,e.session.id,b=>!o.autoResponds(b,e.session.directory))),d=q(()=>{if(u())return!1;const b=(c.message[e.session.id]??[]).findLast(y=>y.role==="assistant"&&typeof y.time?.completed!="number"),v=c.session_status[e.session.id];return b!==void 0||v?.type==="busy"||v?.type==="retry"||v!==void 0&&v.type!=="idle"}),f=q(()=>lde(c.message[e.session.id],c.agent)),h=q(()=>e.showTooltip??(e.mobile||!e.sidebarExpanded())),m=q(()=>{if(e.showChild)return Oue(c.session,e.session.id,t.id)}),p=(b,v)=>{const y=e.navList?.(),_=y?.some(x=>x.id===e.session.id&&x.directory===e.session.directory)?y:e.list;e.prefetchSession(e.session,v);const k=_.findIndex(x=>x.id===e.session.id&&x.directory===e.session.directory);if(k!==-1)for(let x=1;x<=b;x++){const I=_[k+x];I&&e.prefetchSession(I,x===1?"high":v);const A=_[k-x];A&&e.prefetchSession(A,x===1?"high":v)}},g=C(Sde,{get session(){return e.session},get slug(){return e.slug},get mobile(){return e.mobile},get dense(){return e.dense},tint:f,isWorking:d,hasPermissions:u,hasError:l,unseenCount:a,get clearHoverProjectSoon(){return e.clearHoverProjectSoon},get sidebarOpened(){return n.sidebar.opened},warmPress:()=>p(2,"high"),warmFocus:()=>p(2,"high")});return[(()=>{var b=vde(),v=b.firstChild,y=v.firstChild;return X(y,C(Ce,{get when(){return!h()},get fallback(){return C($r,{get placement(){return e.mobile?"bottom":"right"},get value(){return UA(e.session.title)},gutter:10,class:"min-w-0 w-full",children:g})},children:g})),X(v,C(Ce,{get when(){return!e.level},get children(){var _=gde();return X(_,C($r,{get value(){return r.t("common.archive")},placement:"top",get children(){return C(Wr,{icon:"archive",variant:"ghost",class:"size-6 rounded-md",get"aria-label"(){return r.t("common.archive")},onClick:k=>{k.preventDefault(),k.stopPropagation(),e.archiveSession(e.session)}})}})),Ve(k=>Ft(_,{"w-6 opacity-100 pointer-events-auto":!!e.mobile,"w-0 opacity-0 pointer-events-none":!e.mobile,"group-hover/session:w-6 group-hover/session:opacity-100 group-hover/session:pointer-events-auto":!0,"group-focus-within/session:w-6 group-focus-within/session:opacity-100 group-focus-within/session:pointer-events-auto":!0},k)),_}}),null),Ve(_=>{var k=e.session.id,x=`${8+(e.level??0)*16}px`;return k!==_.e&&vt(b,"data-session-id",_.e=k),x!==_.t&&Xn(b,"padding-left",_.t=x),_},{e:void 0,t:void 0}),b})(),C(Ce,{get when(){return m()},children:b=>(()=>{var v=bde();return X(v,C(G0,ie(e,{get session(){return b()},get level(){return(e.level??0)+1}}))),v})()})]},_de=e=>{const t=jl(),r=En().t("command.session.new"),i=()=>e.mobile||!e.sidebarExpanded(),o=C(gS,{get href(){return`/${e.slug}/session`},end:!0,get class(){return`flex items-center gap-2 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},onClick:()=>{t.sidebar.opened()||e.clearHoverProjectSoon()},get children(){return[(()=>{var s=qA();return X(s,C(ur,{name:"new-session",size:"small",class:"text-icon-weak"})),s})(),(()=>{var s=WA();return X(s,r),s})()]}});return(()=>{var s=yde();return X(s,C(Ce,{get when(){return!i()},get fallback(){return C($r,{get placement(){return e.mobile?"bottom":"right"},value:r,gutter:10,class:"min-w-0 w-full",children:o})},children:o})),s})()},Cde=e=>{const t=Array.from({length:e.count??4},(n,r)=>r);return(()=>{var n=wde();return X(n,C(zi,{each:t,children:()=>kde()})),n})()};var Ide=me('<div class="bg-background-base rounded-md px-2 py-1 text-14-medium text-text-strong">'),Ede=me('<div class="flex items-center gap-1 min-w-0 flex-1"><div class="flex items-center justify-center shrink-0 size-6"></div><span class="text-14-medium text-text-base shrink-0"> :</span><div class="flex items-center justify-center shrink-0 overflow-hidden w-0 opacity-0 transition-all duration-200 group-hover/workspace:w-3.5 group-hover/workspace:opacity-100 group-focus-within/workspace:w-3.5 group-focus-within/workspace:opacity-100">'),Tde=me('<span class="text-14-medium text-text-base min-w-0 truncate">'),$de=me('<div class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 transition-opacity">'),Lde=me('<div class="relative w-full py-1">'),Ade=me('<nav class="flex flex-col gap-1">'),z7=me("<div>"),Mde=me('<div class=py-1><div class="group/workspace relative"data-component=workspace-item><div class="flex items-center gap-1">'),Dde=me('<div class="size-full flex flex-col py-2 overflow-y-auto no-scrollbar [overflow-anchor:none]">');const Ode=e=>{const t=Qr(),n=En(),r=q(()=>{const i=e.sidebarProject();if(!i)return;const o=e.activeWorkspace();if(!o)return;const[s]=t.child(o,{bootstrap:!1}),a=o===i.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),l=e.workspaceLabel(o,s.vcs?.branch,i.id);return`${a} : ${l}`});return C(Ce,{get when(){return r()},children:i=>(()=>{var o=Ide();return X(o,i),o})()})},Pde=e=>(()=>{var t=Ede(),n=t.firstChild,r=n.nextSibling,i=r.firstChild,o=r.nextSibling;return X(n,C(Ce,{get when(){return e.busy()},get fallback(){return C(ur,{name:"branch",size:"small"})},get children(){return C(VA,{class:"size-[15px]"})}})),X(r,(()=>{var s=it(()=>!!e.local());return()=>s()?e.language.t("workspace.type.local"):e.language.t("workspace.type.sandbox")})(),i),X(t,C(Ce,{get when(){return!e.local()},get fallback(){return(()=>{var s=Tde();return X(s,()=>e.branch()??Nn(e.directory)),s})()},get children(){return C(e.InlineEditor,{get id(){return`workspace:${e.directory}`},get value(){return e.workspaceValue},onSave:s=>{const a=s.trim();a&&(e.renameWorkspace(e.directory,a,e.projectId,e.branch()),e.setEditor("value",e.workspaceValue()))},class:"text-14-medium text-text-base min-w-0 truncate",displayClass:"text-14-medium text-text-base min-w-0 truncate",get editing(){return e.workspaceEditActive()},stopPropagation:!1,openOnDblClick:!1})}}),o),X(o,C(ur,{get name(){return e.open()?"chevron-down":"chevron-right"},size:"small",class:"text-icon-base"})),t})(),Rde=e=>(()=>{var t=$de();return X(t,C(Bt,{get modal(){return!e.sidebarHovering()},get open(){return e.menuOpen()},onOpenChange:n=>e.setMenuOpen(n),get children(){return[C($r,{get value(){return e.language.t("common.moreOptions")},placement:"top",get children(){return C(Bt.Trigger,{as:Wr,icon:"dot-grid",variant:"ghost",class:"size-6 rounded-md","data-action":"workspace-menu",get"data-workspace"(){return mt(e.directory)},get"aria-label"(){return e.language.t("common.moreOptions")}})}}),C(Bt.Portal,{get children(){return C(Bt.Content,{onCloseAutoFocus:n=>{e.pendingRename()&&(n.preventDefault(),e.setPendingRename(!1),e.openEditor(`workspace:${e.directory}`,e.workspaceValue()))},get children(){return[C(Bt.Item,{get disabled(){return e.local()},onSelect:()=>{e.setPendingRename(!0),e.setMenuOpen(!1)},get children(){return C(Bt.ItemLabel,{get children(){return e.language.t("common.rename")}})}}),C(Bt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showResetWorkspaceDialog(e.root,e.directory),get children(){return C(Bt.ItemLabel,{get children(){return e.language.t("common.reset")}})}}),C(Bt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showDeleteWorkspaceDialog(e.root,e.directory),get children(){return C(Bt.ItemLabel,{get children(){return e.language.t("common.delete")}})}})]}})}})]}}),null),X(t,C(Ce,{get when(){return!e.touch()},get children(){return C($r,{get value(){return e.language.t("command.session.new")},placement:"top",get children(){return C(Wr,{icon:"new-session",variant:"ghost",class:"size-6 rounded-md opacity-0 pointer-events-none group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto","data-action":"workspace-new-session",get"data-workspace"(){return mt(e.directory)},get"aria-label"(){return e.language.t("command.session.new")},onClick:n=>{n.preventDefault(),n.stopPropagation(),e.clearHoverProjectSoon(),e.navigateToNewSession()}})}})}}),null),Ve(n=>Ft(t,{"opacity-100 pointer-events-auto":e.menuOpen(),"opacity-0 pointer-events-none":!e.menuOpen(),"group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto":!0,"group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto":!0},n)),t})(),ZA=e=>(()=>{var t=Ade();return X(t,C(Ce,{get when(){return e.showNew()},get children(){return C(_de,{get slug(){return e.slug()},get mobile(){return e.mobile},get sidebarExpanded(){return e.ctx.sidebarExpanded},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon}})}}),null),X(t,C(Ce,{get when(){return e.loading()},get children(){return C(Cde,{})}}),null),X(t,C(zi,{get each(){return e.sessions()},children:n=>C(G0,{session:n,get list(){return e.sessions()},get navList(){return e.ctx.navList},get slug(){return e.slug()},get mobile(){return e.mobile},showChild:!0,get sidebarExpanded(){return e.ctx.sidebarExpanded},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},get prefetchSession(){return e.ctx.prefetchSession},get archiveSession(){return e.ctx.archiveSession}})}),null),X(t,C(Ce,{get when(){return e.hasMore()},get children(){var n=Lde();return X(n,C(rn,{variant:"ghost",class:"flex w-full text-left justify-start text-14-regular text-text-weak pl-9 pr-10",size:"large",onClick:r=>{e.loadMore(),r.currentTarget.blur()},get children(){return e.language.t("common.loadMore")}})),n}}),null),t})(),Nde=e=>{const t=ua(),n=pr(),r=Qr(),i=En(),o=AA(e.directory),[s,a]=r.child(e.directory,{bootstrap:!1}),[l,c]=qe({open:!1,pendingRename:!1}),u=q(()=>mt(e.directory)),d=q(()=>pu(s,e.sortNow())),f=q(()=>e.directory===e.project.worktree),h=q(()=>Ne(e.ctx.currentDir())===Ne(e.directory)),m=q(()=>{const M=s.vcs?.branch,T=M??Nn(e.directory);return e.ctx.workspaceName(e.directory,e.project.id,M)??T}),p=q(()=>e.ctx.workspaceExpanded(e.directory,f())),g=q(()=>p()||h()),b=q(M=>M||s.status==="complete",!1),v=q(()=>d()?.length??0),y=q(()=>s.sessionTotal>v()),_=q(()=>e.ctx.isBusy(e.directory)),k=q(M=>M||_(),!1),x=q(()=>p()&&!b()&&v()===0&&!k()),I=xv("(hover: none)"),A=q(()=>!x()&&(I()||v()===0||h()&&!n.id)),L=async()=>{a("limit",M=>(M??0)+5),await r.project.loadSessions(e.directory)},$=q(()=>e.ctx.editorOpen(`workspace:${e.directory}`)),H=()=>C(Pde,{local:f,busy:_,open:p,get directory(){return e.directory},language:i,branch:()=>s.vcs?.branch,workspaceValue:m,workspaceEditActive:$,get InlineEditor(){return e.ctx.InlineEditor},get renameWorkspace(){return e.ctx.renameWorkspace},get setEditor(){return e.ctx.setEditor},get projectId(){return e.project.id}}),j=M=>{e.ctx.setWorkspaceExpanded(e.directory,M),!M&&e.ctx.editorOpen(`workspace:${e.directory}`)&&e.ctx.closeEditor()};return re(()=>{g()&&r.child(e.directory,{bootstrap:!0})}),(()=>{var M=z7();return Cr(o,M,()=>!0),X(M,C(pg,{variant:"ghost",get open(){return p()},class:"shrink-0",onOpenChange:j,get children(){return[(()=>{var T=Mde(),E=T.firstChild,D=E.firstChild;return X(D,C(Ce,{get when(){return $()},get fallback(){return C(pg.Trigger,{get class(){return`flex items-center justify-between w-full pl-2 py-1.5 rounded-md hover:bg-surface-raised-base-hover transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`},"data-action":"workspace-toggle",get"data-workspace"(){return mt(e.directory)},get children(){return H()}})},get children(){var F=z7();return X(F,H),Ve(()=>bu(F,`flex items-center justify-between w-full pl-2 py-1.5 rounded-md transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`)),F}}),null),X(D,C(Rde,{get directory(){return e.directory},local:f,busy:_,menuOpen:()=>l.open,pendingRename:()=>l.pendingRename,setMenuOpen:F=>c("open",F),setPendingRename:F=>c("pendingRename",F),get sidebarHovering(){return e.ctx.sidebarHovering},touch:I,language:i,workspaceValue:m,get openEditor(){return e.ctx.openEditor},get showResetWorkspaceDialog(){return e.ctx.showResetWorkspaceDialog},get showDeleteWorkspaceDialog(){return e.ctx.showDeleteWorkspaceDialog},get root(){return e.project.worktree},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},navigateToNewSession:()=>t(`/${u()}/session`)}),null),Ve(()=>vt(E,"data-workspace",mt(e.directory))),T})(),C(pg.Content,{get children(){return C(ZA,{slug:u,get mobile(){return e.mobile},get ctx(){return e.ctx},showNew:A,loading:x,sessions:d,hasMore:y,loadMore:L,language:i})}})]}})),Ve(T=>Ft(M,{"opacity-30":o.isActiveDraggable,"opacity-50 pointer-events-none":_()},T)),M})()},zde=e=>{const t=Qr(),n=En(),r=q(()=>{const[d,f]=t.child(e.project.worktree);return{store:d,setStore:f}}),i=q(()=>mt(e.project.worktree)),o=q(()=>pu(r().store,e.sortNow())),s=q(d=>d||r().store.status==="complete",!1),a=q(()=>o()?.length??0),l=q(()=>!s()&&a()===0),c=q(()=>r().store.sessionTotal>a()),u=async()=>{r().setStore("limit",d=>(d??0)+5),await t.project.loadSessions(e.project.worktree)};return(()=>{var d=Dde();return Cr(f=>e.ctx.setScrollContainerRef(f,e.mobile),d),X(d,C(ZA,{slug:i,get mobile(){return e.mobile},get ctx(){return e.ctx},showNew:()=>!1,loading:l,sessions:o,hasMore:c,loadMore:u,language:n})),d})()};var jde={};Ci(jde,{Arrow:()=>Mo,CheckboxItem:()=>am,Content:()=>KA,ContextMenu:()=>mn,Group:()=>Ju,GroupLabel:()=>lm,Icon:()=>cm,Item:()=>um,ItemDescription:()=>dm,ItemIndicator:()=>fm,ItemLabel:()=>hm,Portal:()=>mm,RadioGroup:()=>pm,RadioItem:()=>gm,Root:()=>XA,Separator:()=>Gl,Sub:()=>vm,SubContent:()=>bm,SubTrigger:()=>ym,Trigger:()=>QA,useContextMenuContext:()=>JA});function KA(e){const t=ei(),[n,r]=pe(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return C(vA,ie({onCloseAutoFocus:a=>{n.onCloseAutoFocus?.(a),!a.defaultPrevented&&i&&a.preventDefault(),i=!1},onInteractOutside:a=>{n.onInteractOutside?.(a),!a.defaultPrevented&&!t.isModal()&&(i=!0)}},r))}var YA=yt();function Fde(){return wt(YA)}function JA(){const e=Fde();if(e===void 0)throw new Error("[kobalte]: `useContextMenuContext` must be used within a `ContextMenu` component");return e}function XA(e){const t=`contextmenu-${Mn()}`,{direction:n}=Lo(),r=et({id:t,placement:n()==="rtl"?"left-start":"right-start",gutter:2,shift:2},e),[i,o]=pe(r,["onOpenChange"]),[s,a]=we({x:0,y:0}),l=oa({defaultOpen:!1,onOpenChange:u=>i.onOpenChange?.(u)}),c={setAnchorRect:a};return C(YA.Provider,{value:c,get children(){return C(kA,ie({get open(){return l.isOpen()},get onOpenChange(){return l.setIsOpen},getAnchorRect:s},o))}})}function QA(e){const t=ei(),n=Ki(),r=JA(),i=et({id:t.generateId("trigger")},e),[o,s]=pe(i,["ref","style","disabled","onContextMenu","onPointerDown","onPointerMove","onPointerCancel","onPointerUp"]);let a=0;const l=()=>{window.clearTimeout(a)};ae(()=>{l()});const c=p=>{if(o.disabled){Je(p,o.onContextMenu);return}l(),p.preventDefault(),p.stopPropagation(),r.setAnchorRect({x:p.clientX,y:p.clientY}),n.isOpen()?n.focusContent():n.open(!0)},u=p=>p.pointerType==="touch"||p.pointerType==="pen";return C(pt,ie({as:"div",ref(p){var g=Nt(n.setTriggerRef,o.ref);typeof g=="function"&&g(p)},get style(){return _i({"-webkit-touch-callout":"none"},o.style)},get"data-disabled"(){return o.disabled?"":void 0},onContextMenu:c,onPointerDown:p=>{Je(p,o.onPointerDown),!o.disabled&&u(p)&&(l(),r.setAnchorRect({x:p.clientX,y:p.clientY}),a=window.setTimeout(()=>n.open(!1),700))},onPointerMove:p=>{Je(p,o.onPointerMove),!o.disabled&&u(p)&&l()},onPointerCancel:p=>{Je(p,o.onPointerCancel),!o.disabled&&u(p)&&l()},onPointerUp:p=>{Je(p,o.onPointerUp),!o.disabled&&u(p)&&l()}},()=>n.dataset(),s))}var mn=Object.assign(XA,{Arrow:Mo,CheckboxItem:am,Content:KA,Group:Ju,GroupLabel:lm,Icon:cm,Item:um,ItemDescription:dm,ItemIndicator:fm,ItemLabel:hm,Portal:mm,RadioGroup:pm,RadioItem:gm,Separator:Gl,Sub:vm,SubContent:bm,SubTrigger:ym,Trigger:QA});function Hde(e){return C(mn,ie(e,{"data-component":"context-menu"}))}function Vde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.Trigger,ie(n,{"data-slot":"context-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Ude(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.Icon,ie(n,{"data-slot":"context-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Bde(e){return C(mn.Portal,e)}function qde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.Content,ie(n,{"data-component":"context-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Wde(e){const[t,n]=pe(e,["class","classList"]);return C(mn.Arrow,ie(n,{"data-slot":"context-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function Gde(e){const[t,n]=pe(e,["class","classList"]);return C(mn.Separator,ie(n,{"data-slot":"context-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function Zde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.Group,ie(n,{"data-slot":"context-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Kde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.GroupLabel,ie(n,{"data-slot":"context-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Yde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.Item,ie(n,{"data-slot":"context-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Jde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.ItemLabel,ie(n,{"data-slot":"context-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Xde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.ItemDescription,ie(n,{"data-slot":"context-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function Qde(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.ItemIndicator,ie(n,{"data-slot":"context-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function efe(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.RadioGroup,ie(n,{"data-slot":"context-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function tfe(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.RadioItem,ie(n,{"data-slot":"context-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function nfe(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.CheckboxItem,ie(n,{"data-slot":"context-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function rfe(e){return C(mn.Sub,e)}function ife(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.SubTrigger,ie(n,{"data-slot":"context-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function ofe(e){const[t,n]=pe(e,["class","classList","children"]);return C(mn.SubContent,ie(n,{"data-component":"context-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const br=Object.assign(Hde,{Trigger:Vde,Icon:Ude,Portal:Bde,Content:qde,Arrow:Wde,Separator:Gde,Group:Zde,GroupLabel:Kde,Item:Yde,ItemLabel:Jde,ItemDescription:Xde,ItemIndicator:Qde,RadioGroup:efe,RadioItem:tfe,CheckboxItem:nfe,Sub:rfe,SubTrigger:ife,SubContent:ofe});var sfe={};Ci(sfe,{Link:()=>afe,Root:()=>i2});function i2(e){let t;const[n,r]=pe(e,["ref","href","disabled"]),i=wu(()=>t,()=>"a");return C(pt,ie({as:"a",ref(o){var s=Nt(a=>t=a,n.ref);typeof s=="function"&&s(o)},get role(){return i()!=="a"||n.disabled?"link":void 0},get tabIndex(){return i()!=="a"&&!n.disabled?0:void 0},get href(){return it(()=>!n.disabled)()?n.href:void 0},get"aria-disabled"(){return n.disabled?!0:void 0},get"data-disabled"(){return n.disabled?"":void 0}},r))}var afe=i2,lfe={};Ci(lfe,{Arrow:()=>Mo,Content:()=>tM,HoverCard:()=>Cc,Portal:()=>nM,Root:()=>rM,Trigger:()=>iM,useHoverCardContext:()=>Sm});var eM=yt();function Sm(){const e=wt(eM);if(e===void 0)throw new Error("[kobalte]: `useHoverCardContext` must be used within a `HoverCard` component");return e}function tM(e){const t=Sm(),[n,r]=pe(e,["ref","style"]);return C(Ce,{get when(){return t.contentPresent()},get children(){return C(Wl.Positioner,{get children(){return C(X0,ie({ref(i){var o=Nt(s=>{t.setContentRef(s)},n.ref);typeof o=="function"&&o(i)},disableOutsidePointerEvents:!1,get style(){return _i({"--kb-hovercard-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},n.style)},onFocusOutside:i=>i.preventDefault(),get onDismiss(){return t.close}},()=>t.dataset(),r))}})}})}function nM(e){const t=Sm();return C(Ce,{get when(){return t.contentPresent()},get children(){return C(ia,e)}})}function cfe(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),o=n.getBoundingClientRect(),s=[],a=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":s.push([i.left,l]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([i.right,l]);break;case"right":s.push([a,i.top]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([a,i.bottom]);break;case"bottom":s.push([i.left,l]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([o.right,o.top]),s.push([i.right,l]);break;case"left":s.push([a,i.top]),s.push([o.right,o.top]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([a,i.bottom]);break}return s}function rM(e){const t=`hovercard-${Mn()}`,n=et({id:t,openDelay:700,closeDelay:300},e),[r,i]=pe(n,["id","open","defaultOpen","onOpenChange","openDelay","closeDelay","ignoreSafeArea","forceMount"]);let o,s;const[a,l]=we(),[c,u]=we(),[d,f]=we(i.placement),h=oa({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:$=>r.onOpenChange?.($)}),{present:m}=Fs({show:()=>r.forceMount||h.isOpen(),element:()=>c()??null}),{addGlobalListener:p,removeGlobalListener:g}=YD(),b=()=>{o=window.setTimeout(()=>{o=void 0,h.open()},r.openDelay)},v=()=>{s=window.setTimeout(()=>{s=void 0,h.close()},r.closeDelay)},y=()=>{window.clearTimeout(o),o=void 0},_=()=>{window.clearTimeout(s),s=void 0},k=$=>dn(a(),$)||dn(c(),$),x=$=>{const H=a(),j=c();if(!(!H||!j))return cfe($,H,j)},I=$=>{const H=$.target;if(k(H)){_();return}if(!r.ignoreSafeArea){const j=x(d());if(j&&Ev(lk($),j)){_();return}}s||v()};re(()=>{h.isOpen()&&(p(document,"pointermove",I,!0),ae(()=>{g(document,"pointermove",I,!0)}))}),ae(()=>{y(),_()});const L={dataset:q(()=>({"data-expanded":h.isOpen()?"":void 0,"data-closed":h.isOpen()?void 0:""})),isOpen:h.isOpen,contentPresent:m,openWithDelay:b,closeWithDelay:v,cancelOpening:y,cancelClosing:_,close:h.close,isTargetOnHoverCard:k,setTriggerRef:l,setContentRef:u};return C(eM.Provider,{value:L,get children(){return C(Wl,ie({anchorRef:a,contentRef:c,onCurrentPlacementChange:f},i))}})}function iM(e){const t=Sm(),[n,r]=pe(e,["ref","onPointerEnter","onPointerLeave","onFocus","onBlur"]),i=l=>{Je(l,n.onPointerEnter),!(l.pointerType==="touch"||r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},o=l=>{Je(l,n.onPointerLeave),l.pointerType!=="touch"&&t.cancelOpening()},s=l=>{Je(l,n.onFocus),!(r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},a=l=>{Je(l,n.onBlur),t.cancelOpening();const c=l.relatedTarget;t.isTargetOnHoverCard(c)||t.closeWithDelay()};return ae(t.cancelOpening),C(i2,ie({ref(l){var c=Nt(t.setTriggerRef,n.ref);typeof c=="function"&&c(l)},onPointerEnter:i,onPointerLeave:o,onFocus:s,onBlur:a},()=>t.dataset(),r))}var Cc=Object.assign(rM,{Arrow:Mo,Content:tM,Portal:nM,Trigger:iM}),ufe=me("<div data-slot=hover-card-body>");function dfe(e){const[t,n]=pe(e,["trigger","mount","class","classList","children"]);return C(Cc,ie({gutter:4},n,{get children(){return[C(Cc.Trigger,{as:"div","data-slot":"hover-card-trigger",tabIndex:-1,get children(){return t.trigger}}),C(Cc.Portal,{get mount(){return t.mount},get children(){return C(Cc.Content,{"data-component":"hover-card-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){var r=ufe();return X(r,()=>t.children),r}})}})]}}))}var ffe=me('<div class="bg-background-base rounded-xl p-1">'),hfe=me('<div class="-m-3 p-2 flex flex-col w-72"><div class="px-4 pt-2 pb-1 flex items-center gap-2"><div class="text-14-medium text-text-strong truncate grow"></div></div><div class="px-4 pb-2 text-12-medium text-text-weak"></div><div class="px-2 pb-2 flex flex-col gap-2"></div><div class="px-2 py-2 border-t border-border-weak-base">'),mfe=me('<div class="flex flex-col gap-1"><div class="px-2 py-0.5 flex items-center gap-1 min-w-0"><div class="shrink-0 size-6 flex items-center justify-center"></div><span class="truncate text-14-medium text-text-base">'),pfe=me("<div>");const gfe=e=>{const t=q(()=>e.projects().find(n=>n.worktree===e.activeProject()));return C(Ce,{get when(){return t()},children:n=>(()=>{var r=ffe();return X(r,C(GA,{get project(){return n()}})),r})()})},vfe=e=>{const t=em(),n=jl(),r=q(()=>e.dirs().reduce((o,s)=>o+t.project.unseenCount(s),0)),i=()=>e.dirs().filter(o=>t.project.unseenCount(o)>0).forEach(o=>t.project.markViewed(o));return C(br,{get modal(){return!e.sidebarHovering()},onOpenChange:o=>{e.setMenu(o),e.setSuppressHover(o),o&&e.setOpen(!1)},get children(){return[C(br.Trigger,{as:"button",type:"button",get"aria-label"(){return n2(e.project)},"data-action":"project-switch",get"data-project"(){return mt(e.project.worktree)},get classList(){return{"flex items-center justify-center size-10 p-1 rounded-lg overflow-hidden transition-colors cursor-default":!0,"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover":e.selected(),"bg-transparent border border-transparent hover:bg-surface-base-hover hover:border-border-weak-base":!e.selected()&&!e.active(),"bg-surface-base-hover border border-border-weak-base":!e.selected()&&e.active()}},onPointerDown:o=>{if(o.button===0&&!o.ctrlKey){e.setOpen(!1),e.setSuppressHover(!0);return}e.overlay()&&(o.button!==2&&!(o.button===0&&o.ctrlKey)||(e.setOpen(!1),e.setSuppressHover(!0),o.preventDefault()))},onMouseEnter:o=>{e.overlay()&&(e.suppressHover()||e.onProjectMouseEnter(e.project.worktree,o))},onMouseLeave:()=>{e.suppressHover()&&e.setSuppressHover(!1),e.overlay()&&e.onProjectMouseLeave(e.project.worktree)},onFocus:()=>{e.overlay()&&(e.suppressHover()||e.onProjectFocus(e.project.worktree))},onClick:()=>{if(e.setOpen(!1),e.selected()){n.sidebar.toggle();return}e.navigateToProject(e.project.worktree)},onBlur:()=>e.setOpen(!1),get children(){return C(GA,{get project(){return e.project},notify:!0})}}),C(br.Portal,{get children(){return C(br.Content,{get children(){return[C(br.Item,{onSelect:()=>e.showEditProjectDialog(e.project),get children(){return C(br.ItemLabel,{get children(){return e.language.t("common.edit")}})}}),C(br.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return mt(e.project.worktree)},get disabled(){return it(()=>e.project.vcs!=="git")()&&!e.workspacesEnabled(e.project)},onSelect:()=>e.toggleProjectWorkspaces(e.project),get children(){return C(br.ItemLabel,{get children(){return it(()=>!!e.workspacesEnabled(e.project))()?e.language.t("sidebar.workspaces.disable"):e.language.t("sidebar.workspaces.enable")}})}}),C(br.Item,{"data-action":"project-clear-notifications",get"data-project"(){return mt(e.project.worktree)},get disabled(){return r()===0},onSelect:i,get children(){return C(br.ItemLabel,{get children(){return e.language.t("sidebar.project.clearNotifications")}})}}),C(br.Separator,{}),C(br.Item,{"data-action":"project-close-menu",get"data-project"(){return mt(e.project.worktree)},onSelect:()=>e.closeProject(e.project.worktree),get children(){return C(br.ItemLabel,{get children(){return e.language.t("common.close")}})}})]}})}})]}})},bfe=e=>(()=>{var t=hfe(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,o=i.nextSibling,s=o.nextSibling;return X(r,()=>n2(e.project)),X(i,()=>e.language.t("sidebar.project.recentSessions")),X(o,C(Ce,{get when(){return e.workspaceEnabled()},get fallback(){return C(zi,{get each(){return e.projectSessions().slice(0,2)},children:a=>C(G0,ie(()=>e.ctx.sessionProps,{session:a,get list(){return e.projectSessions()},get slug(){return mt(e.project.worktree)},dense:!0,showTooltip:!0,get mobile(){return e.mobile}}))})},get children(){return C(zi,{get each(){return e.workspaces()},children:a=>{const l=q(()=>e.workspaceSessions(a));return(()=>{var c=mfe(),u=c.firstChild,d=u.firstChild,f=d.nextSibling;return X(d,C(ur,{name:"branch",size:"small",class:"text-icon-base"})),X(f,()=>e.label(a)),X(c,C(zi,{get each(){return l().slice(0,2)},children:h=>C(G0,ie(()=>e.ctx.sessionProps,{session:h,get list(){return l()},get slug(){return mt(a)},dense:!0,showTooltip:!0,get mobile(){return e.mobile}}))}),null),c})()}})}})),X(s,C(rn,{variant:"ghost",class:"flex w-full text-left justify-start text-text-base px-2 hover:bg-transparent active:bg-transparent",onClick:()=>{e.ctx.openSidebar(),e.ctx.onHoverOpenChanged(e.project.worktree,!1),!e.selected()&&e.ctx.navigateToProject(e.project.worktree)},get children(){return e.language.t("sidebar.project.viewAllSessions")}})),t})(),yfe=e=>{const t=Qr(),n=En(),r=AA(e.project.worktree),i=q(()=>e.ctx.currentProject()?.worktree===e.project.worktree),o=q(()=>e.ctx.workspaceIds(e.project).slice(0,2)),s=q(()=>e.ctx.workspacesEnabled(e.project)),a=q(()=>e.ctx.workspaceIds(e.project)),[l,c]=qe({menu:!1,suppressHover:!1}),u=()=>e.ctx.hoverProject()===e.project.worktree,d=q(()=>!e.mobile&&e.ctx.sidebarOpened()),f=q(()=>!e.mobile&&!e.ctx.sidebarOpened()),h=q(()=>l.menu||(d()||f())&&u()),m=()=>u()&&d()&&!i()&&!l.menu,p=_=>{const[k]=t.child(_,{bootstrap:!1}),x=_===e.project.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),I=e.ctx.workspaceLabel(_,k.vcs?.branch,e.project.id);return`${x} : ${I}`},g=q(()=>t.child(e.project.worktree,{bootstrap:!1})[0]),b=q(()=>pu(g(),e.sortNow())),v=_=>{const[k]=t.child(_,{bootstrap:!1});return pu(k,e.sortNow())},y=()=>C(vfe,{get project(){return e.project},get mobile(){return e.mobile},get sidebarHovering(){return e.ctx.sidebarHovering},selected:i,active:h,overlay:f,suppressHover:()=>l.suppressHover,dirs:a,get onProjectMouseEnter(){return e.ctx.onProjectMouseEnter},get onProjectMouseLeave(){return e.ctx.onProjectMouseLeave},get onProjectFocus(){return e.ctx.onProjectFocus},get navigateToProject(){return e.ctx.navigateToProject},get showEditProjectDialog(){return e.ctx.showEditProjectDialog},get toggleProjectWorkspaces(){return e.ctx.toggleProjectWorkspaces},get workspacesEnabled(){return e.ctx.workspacesEnabled},get closeProject(){return e.ctx.closeProject},setMenu:_=>c("menu",_),setOpen:_=>e.ctx.onHoverOpenChanged(e.project.worktree,_),setSuppressHover:_=>c("suppressHover",_),language:n});return(()=>{var _=pfe();return Cr(r,_,()=>!0),X(_,C(Ce,{get when(){return it(()=>!!d())()&&!i()},get fallback(){return y()},get children(){return C(dfe,{get open(){return it(()=>!!(!l.suppressHover&&m()))()&&!l.menu},openDelay:0,closeDelay:0,placement:"right-start",gutter:6,get trigger(){return y()},onOpenChange:k=>{l.menu||k&&l.suppressHover||e.ctx.onHoverOpenChanged(e.project.worktree,k)},get children(){return C(bfe,{get project(){return e.project},get mobile(){return e.mobile},selected:i,workspaceEnabled:s,workspaces:o,label:p,projectSessions:b,workspaceSessions:v,get ctx(){return e.ctx},language:n})}})}})),Ve(()=>_.classList.toggle("opacity-30",!!r.isActiveDraggable)),_})()};var wfe=me('<div class="h-full w-full flex flex-col items-center gap-3 px-3 py-3 overflow-y-auto no-scrollbar">'),kfe=me('<div class="flex h-full w-full min-w-0 overflow-hidden"><div data-component=sidebar-rail class="w-16 shrink-0 bg-background-base flex flex-col items-center overflow-hidden"><div class="flex-1 min-h-0 w-full"></div><div class="shrink-0 w-full pt-3 pb-6 flex flex-col items-center gap-2"></div></div><div>'),xfe=me('<span class="text-icon-base text-12-medium">'),Sfe=me('<div class="flex items-center gap-2"><span>');const _fe=e=>{const t=q(()=>!!e.mobile||e.opened()),n=()=>e.mobile?"bottom":"right";let r;return re(()=>{const i=r;if(i){if(t()){i.removeAttribute("inert");return}i.setAttribute("inert","")}}),(()=>{var i=kfe(),o=i.firstChild,s=o.firstChild,a=s.nextSibling,l=o.nextSibling;return Os(o,"mousemove",e.aimMove,!0),X(s,C(IA,{get onDragStart(){return e.handleDragStart},get onDragEnd(){return e.handleDragEnd},get onDragOver(){return e.handleDragOver},collisionDetector:_A,get children(){return[C(EA,{}),C(OA,{}),(()=>{var c=wfe();return X(c,C(LA,{get ids(){return e.projects().map(u=>u.worktree)},get children(){return C(zi,{get each(){return e.projects()},children:u=>e.renderProject(u)})}}),null),X(c,C($r,{get placement(){return n()},get value(){return(()=>{var u=Sfe(),d=u.firstChild;return X(d,()=>e.openProjectLabel),X(u,C(Ce,{get when(){return it(()=>!e.mobile)()&&!!e.openProjectKeybind()},get children(){var f=xfe();return X(f,()=>e.openProjectKeybind()),f}}),null),u})()},get children(){return C(Wr,{icon:"plus",variant:"ghost",size:"large",get onClick(){return e.onOpenProject},get"aria-label"(){return it(()=>typeof e.openProjectLabel=="string")()?e.openProjectLabel:void 0}})}}),null),c})(),C(TA,{get children(){return e.renderProjectOverlay()}})]}})),X(a,C(bv,{get placement(){return n()},get title(){return e.settingsLabel()},get keybind(){return e.settingsKeybind()??""},get children(){return C(Wr,{icon:"settings-gear",variant:"ghost",size:"large",get onClick(){return e.onOpenSettings},get"aria-label"(){return e.settingsLabel()}})}}),null),X(a,C($r,{get placement(){return n()},get value(){return e.helpLabel()},get children(){return C(Wr,{icon:"help",variant:"ghost",size:"large",get onClick(){return e.onOpenHelp},get"aria-label"(){return e.helpLabel()}})}}),null),Cr(c=>{r=c},l),X(l,()=>e.renderPanel()),Ve(c=>{var u={"flex-1 flex h-full min-h-0 min-w-0 overflow-hidden":!0,"pointer-events-none":!t()},d=!t();return c.e=Ft(l,u,c.e),d!==c.t&&vt(l,"aria-hidden",c.t=d),c},{e:void 0,t:void 0}),i})()};Jr(["mousemove"]);var Cfe=me('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex justify-end gap-2">'),Ife=me('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"> <!> </span></div><div class="flex justify-end gap-2">'),Efe=me('<span class="text-12-regular text-text-base truncate select-text">'),Tfe=me('<div class="shrink-0 pl-1 py-1"><div class="group/project flex items-start justify-between gap-2 py-2 pl-2 pr-0"><div class="flex flex-col min-w-0">'),j7=me('<div class="shrink-0 py-4">'),$fe=me('<div class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar [overflow-anchor:none]">'),Lfe=me('<div class="relative flex-1 min-h-0">'),Afe=me('<div class="flex-1 min-h-0 flex flex-col">'),Mfe=me('<div><div class="shrink-0 px-3 py-3"><div class="rounded-xl bg-background-base shadow-xs-border-base"data-component=getting-started><div class="p-3 flex flex-col gap-6"><div class="flex flex-col gap-2"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div></div><div data-component=getting-started-actions>'),Dfe=me('<div class="flex-1 min-h-0 -mt-4 flex items-center justify-center px-6 pb-64 text-center"><div class="mt-8 flex max-w-60 flex-col items-center gap-6 text-center"><div class="flex flex-col gap-3"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)>'),Ofe=me('<div class="flex-1 min-h-0">'),Pfe=me('<div class="hidden xl:block absolute inset-y-0 z-30 w-0 overflow-visible">'),Rfe=me('<div class="relative bg-background-base flex-1 min-h-0 min-w-0 flex flex-col select-none [&_input]:select-text [&_textarea]:select-text [&_[contenteditable]]:select-text"><div class="flex-1 min-h-0 min-w-0 flex"><div class="flex-1 min-h-0 relative"><div class="size-full relative overflow-x-hidden"><nav data-component=sidebar-nav-desktop><div class="@container w-full h-full contain-strict"></div></nav><div class="hidden xl:block pointer-events-none absolute top-0 right-0 z-0 border-t border-border-weaker-base"style="left:calc(4rem + 12px)"></div><div class=xl:hidden><div></div><nav data-component=sidebar-nav-mobile></nav></div><div><main></main></div><div></div><div><div class="h-full w-px"style=box-shadow:var(--shadow-sidebar-overlay)>'),Nfe=me("<div class=size-full>");function zfe(e){const[t,n,,r]=Sn(Jt.global("layout.page",["layout.page.v1"]),qe({lastProjectSession:{},activeProject:void 0,activeWorkspace:void 0,workspaceOrder:{},workspaceName:{},workspaceBranchName:{},workspaceExpanded:{},gettingStartedDismissed:!1})),i=q(()=>r());let o,s=0,a=!1;const l=pr(),c=Nl(),u=Qr(),d=jl(),f=q(()=>d.ready()),h=$o(),m=Au(),p=Rl(),g=em(),b=U4(),v=ua();oue(v);const y=V4(),_=Q0(),k=u_(),x=aS(),I=En(),A=bo(l.dir),L=q(()=>{const z=l.dir;if(!z)return{slug:z,dir:""};const N=bo(z);return N?{slug:z,dir:u.peek(N,{bootstrap:!1})[0].path.directory||N}:{slug:z,dir:""}}),$=q(()=>x.ids().map(z=>[z,x.themes()[z]])),H=["system","light","dark"],j={system:"theme.scheme.system",light:"theme.scheme.light",dark:"theme.scheme.dark"},M=z=>I.t(j[z]),T=q(()=>L().dir),[E,D]=qe({autoselect:!A,busyWorkspaces:{},hoverProject:void 0,scrollSessionKey:void 0,nav:void 0,sortNow:Date.now(),sizing:!1,peek:void 0,peeked:!1}),F=Bue(),G=(z,N)=>{const J=Ne(z);if(N){D("busyWorkspaces",J,!0);return}D("busyWorkspaces",He(ne=>{delete ne[J]}))},U=z=>!!E.busyWorkspaces[Ne(z)],Z={current:void 0},Y=()=>E.sortNow;let ee,oe;const fe=setTimeout(()=>{D("sortNow",Date.now()),oe=setInterval(()=>D("sortNow",Date.now()),6e4)},6e4-Date.now()%6e4),Se=iue({enabled:()=>!d.sidebar.opened(),active:()=>E.hoverProject,el:()=>E.nav?.querySelector("[data-component='sidebar-rail']")??E.nav,onActivate:z=>{u.child(z),D("hoverProject",z)}});ae(()=>{a=!0,s+=1,Z.current!==void 0&&clearTimeout(Z.current),clearTimeout(fe),oe&&clearInterval(oe),ee!==void 0&&clearTimeout(ee),Ze!==void 0&&clearTimeout(Ze),Se.reset()}),Pt(()=>{const z=()=>D("sizing",!1),N=()=>Dn(),J=()=>{document.visibilityState==="hidden"&&Dn()};Kt(window,"pointerup",z),Kt(window,"pointercancel",z),Kt(window,"blur",z),Kt(window,"blur",N),Kt(document,"visibilitychange",J)});const We=q(()=>!d.sidebar.opened()&&E.hoverProject!==void 0),Ae=q(()=>d.sidebar.opened()||We()),xe=z=>{D("hoverProject",z),Se.reset()},Ue=()=>queueMicrotask(()=>xe(void 0)),lt=()=>{Z.current!==void 0&&(clearTimeout(Z.current),Z.current=void 0)},Dn=()=>{lt(),xe(void 0)},or=()=>{d.sidebar.opened()||E.hoverProject!==void 0&&(lt(),Z.current=window.setTimeout(()=>{Z.current=void 0,xe(void 0)},300))};let Ze;const V=q(()=>{const z=E.hoverProject;if(z)return d.projects.list().find(N=>N.worktree===z)}),ft=q(()=>{const z=E.peek;if(z)return d.projects.list().find(N=>N.worktree===z)});re(()=>{const z=V();if(z){Ze!==void 0&&(clearTimeout(Ze),Ze=void 0),D("peek",z.worktree),D("peeked",!0);return}D("peeked",!1),E.peek!==void 0&&(Ze!==void 0&&clearTimeout(Ze),Ze=window.setTimeout(()=>{Ze=void 0,D("peek",void 0)},180))}),re(()=>{d.sidebar.opened()&&xe(void 0)}),re(()=>{if(!E.autoselect)return;const z=l.dir;!z||!bo(z)||D("autoselect",!1)});const St=F.editorOpen,pn=F.openEditor,Yn=F.closeEditor,Do=F.setEditor,Qu=F.InlineEditor,s2=()=>{d.sidebar.opened()||Dn()},ti=z=>{s2(),v(z),d.mobileSidebar.hide()};function wM(z=1){const N=$().map(([se])=>se);if(N.length===0)return;const J=N.indexOf(x.themeId()),ne=J===-1?0:(J+z+N.length)%N.length,le=N[ne];x.setTheme(le),yn({title:I.t("toast.theme.title"),description:x.name(le)})}function kM(z=1){const N=x.colorScheme(),J=H.indexOf(N),ne=J===-1?0:(J+z+H.length)%H.length,le=H[ne];x.setColorScheme(le),yn({title:I.t("toast.scheme.title"),description:M(le)})}function a2(z){z!==I.locale()&&(I.setLocale(z),yn({title:I.t("toast.language.title"),description:I.t("toast.language.description",{language:I.label(z)})}))}function xM(z=1){const N=I.locales,J=N.indexOf(I.locale()),ne=J===-1?0:(J+z+N.length)%N.length,le=N[ne];le&&a2(le)}const SM=()=>Pt(()=>{if(!h.checkUpdate||!h.update||!h.restart)return;let z,N;const J=()=>h.checkUpdate().then(({updateAvailable:ne,version:le})=>{ne&&z===void 0&&(z=yn({persistent:!0,icon:"download",title:I.t("toast.update.title"),description:I.t("toast.update.description",{version:le??""}),actions:[{label:I.t("toast.update.action.installRestart"),onClick:async()=>{await h.update(),await h.restart()}},{label:I.t("toast.update.action.notYet"),onClick:"dismiss"}]}))});re(()=>{if(m.ready()){if(!m.updates.startup()){if(N===void 0)return;clearInterval(N),N=void 0;return}N===void 0&&(J(),N=setInterval(J,600*1e3))}}),ae(()=>{N!==void 0&&clearInterval(N)})}),_M=()=>Pt(()=>{const z=new Map,N=new Map,J=5e3,ne=se=>{const $e=z.get(se);$e!==void 0&&(hl.dismiss($e),z.delete(se),N.delete(se))},le=c.event.listen(se=>{if(se.details?.type==="worktree.ready"){G(se.name,!1),cf.ready(se.name);return}if(se.details?.type==="worktree.failed"){G(se.name,!1),cf.failed(se.name,se.details.properties?.message??I.t("common.requestFailed"));return}if(se.details?.type==="question.replied"||se.details?.type==="question.rejected"||se.details?.type==="permission.replied"){const Yi=se.details.properties,Kl=`${se.name}:${Yi.sessionID}`;ne(Kl);return}if(se.details?.type!=="permission.asked"&&se.details?.type!=="question.asked")return;const $e=se.details.type==="permission.asked"?I.t("notification.permission.title"):I.t("notification.question.title"),Te=se.details.type==="permission.asked"?"checklist":"bubble-5",Oe=se.name,Pe=se.details.properties;if(se.details.type==="permission.asked"&&b.autoResponds(se.details.properties,Oe))return;const[Re]=u.child(Oe,{bootstrap:!1}),Lt=Re.session.find(Yi=>Yi.id===Pe.sessionID),ht=`${Oe}:${Pe.sessionID}`,Tt=Lt?.title??I.t("command.session.new"),Fe=Nn(Oe),Me=se.details.type==="permission.asked"?I.t("notification.permission.description",{sessionTitle:Tt,projectName:Fe}):I.t("notification.question.description",{sessionTitle:Tt,projectName:Fe}),sr=`/${mt(Oe)}/session/${Pe.sessionID}`,Oo=Date.now(),Ei=N.get(ht)??0;if(Oo-Ei<J)return;N.set(ht,Oo),se.details.type==="permission.asked"&&(m.sounds.permissionsEnabled()&&lv(m.sounds.permissions()),m.notifications.permissions()&&h.notify($e,Me,sr)),se.details.type==="question.asked"&&m.notifications.agent()&&h.notify($e,Me,sr);const ms=l.id;if(Ne(Oe)===Ne(T())&&Pe.sessionID===ms||Ne(Oe)===Ne(T())&&Lt?.parentID===ms)return;ne(ht);const ba=yn({persistent:!0,icon:Te,title:$e,description:Me,actions:[{label:I.t("notification.action.goToSession"),onClick:()=>v(sr)},{label:I.t("common.dismiss"),onClick:"dismiss"}]});z.set(ht,ba)});ae(le),re(()=>{const se=l.id;if(!T()||!se)return;const $e=`${T()}:${se}`;ne($e);const[Te]=u.child(T(),{bootstrap:!1}),Oe=Te.session.filter(Pe=>Pe.parentID===se);for(const Pe of Oe)ne(`${T()}:${Pe.id}`)})});SM(),_M();function CM(z,N){if(!o||E.scrollSessionKey===N)return;const J=o.querySelector(`[data-session-id="${z}"]`);if(!J)return;const ne=o.getBoundingClientRect(),le=J.getBoundingClientRect();if(le.top>=ne.top&&le.bottom<=ne.bottom){D("scrollSessionKey",N);return}D("scrollSessionKey",N),J.scrollIntoView({block:"nearest",behavior:"smooth"})}const zn=q(()=>{const z=T();if(!z)return;const N=Ne(z),J=d.projects.list(),ne=J.find(Pe=>Pe.sandboxes?.some(Re=>Ne(Re)===N));if(ne)return ne;const le=J.find(Pe=>Ne(Pe.worktree)===N);if(le)return le;const[se]=u.child(z,{bootstrap:!1}),$e=se.project;if(!$e)return;const Oe=u.data.project.find(Pe=>Pe.id===$e)?.worktree;if(Oe)return J.find(Pe=>Pe.worktree===Oe)}),[IM]=xl(async()=>{if(await r.promise,await d.ready.promise,!Ye(()=>E.autoselect))return;const z=d.projects.list(),N=p.projects.last();if(z.length===0){if(!N)return;await hs(N,!0)}else{const J=z.find(ne=>ne.worktree===N)??z[0];if(!J)return;await hs(J.worktree,!0)}}),_m=(z,N,J)=>{const ne=Ne(z),le=t.workspaceName[ne]??t.workspaceName[z];if(le)return le;if(N&&J)return t.workspaceBranchName[N]?.[J]},l2=(z,N,J,ne)=>{const le=Ne(z);n("workspaceName",le,N),J&&ne&&(t.workspaceBranchName[J]||n("workspaceBranchName",J,{}),n("workspaceBranchName",J,ne,N))},c2=(z,N,J)=>_m(z,J,N)??N??Nn(z),u2=q(()=>{const z=zn();return!z||z.vcs!=="git"?!1:d.sidebar.workspaces(z.worktree)()}),ed=q(()=>{const z=zn();if(!z)return[];if(!u2())return[z.worktree];const N=T();return sd(z).filter(J=>{const ne=t.workspaceExpanded[J]??J===z.worktree,le=Ne(J)===Ne(N);return ne||le})});re(()=>{if(!i()||!f())return;const z=d.projects.list();for(const[N,J]of Object.entries(t.workspaceExpanded)){if(!J)continue;const ne=Ne(N),le=z.find(se=>Ne(se.worktree)===ne||se.sandboxes?.some($e=>Ne($e)===ne));le&&(le.vcs==="git"&&d.sidebar.workspaces(le.worktree)()||n("workspaceExpanded",N,!1))}});const va=q(()=>{const z=Date.now(),N=ed();if(N.length===0)return[];const J=[];for(const ne of N){const[le]=u.child(ne,{bootstrap:!0}),se=pu(le,z);J.push(...se)}return J}),d2=200,EM=2,TM=10,$M=4,Cm={value:0},Zl=new Map,f2=10,td=new Map,h2=z=>{const N=td.get(z);if(N)return N;const J=new Set;return td.set(z,J),J},LM=(z,N)=>{const J=h2(z);return w$({seen:J,keep:N,limit:f2,preserve:l.id&&Ne(z)===Ne(T())?[l.id]:void 0})};re(()=>{const z=new Set(ed());for(const N of[...td.keys()])z.has(N)||td.delete(N)}),re(()=>{L(),c.url,Cm.value+=1,Zne(),Zl.clear()}),re(()=>{const z=new Set(ed());for(const[N,J]of Zl)z.has(N)||(J.pending.length=0,J.pendingSet.clear(),J.running===0&&Zl.delete(N))});const m2=z=>{const N=Zl.get(z);if(N)return N;const J={inflight:new Set,pending:[],pendingSet:new Set,running:0};return Zl.set(z,J),J},Im=(z,N)=>{if(z.length===0)return N.slice().sort((ne,le)=>ne.id<le.id?-1:ne.id>le.id?1:0);const J=new Map;for(const ne of z)J.set(ne.id,ne);for(const ne of N)J.set(ne.id,ne);return[...J.values()].sort((ne,le)=>ne.id<le.id?-1:ne.id>le.id?1:0)};async function AM(z,N,J){const[ne,le]=u.child(z,{bootstrap:!1});return Kne({directory:z,sessionID:N,task:se=>nn(()=>c.client.session.messages({directory:z,sessionID:N,limit:d2})).then($e=>{if(Cm.value!==J||!p5(z,N,se))return;const Te=($e.data??[]).filter(Me=>!!Me?.info?.id),Oe=Te.map(Me=>Me.info).filter(Me=>!!Me?.id),Pe=Im([],Oe),Re=LM(z,N),Lt=$e.response.headers.get("x-next-cursor")??void 0,ht={limit:Pe.length,cursor:Lt,complete:!Lt,at:Date.now()};if(Re.length>0){v$(z,Re);for(const Me of Re)u.todo.set(Me,void 0)}const Tt=ne.message[N]??[],Fe=Im(Tt.filter(Me=>!!Me?.id),Pe);if(p5(z,N,se))return rt(()=>{Re.length>0&&le(He(Me=>{Zh(Me,Re)})),le("message",N,Ct(Fe,{key:"id"})),g$({directory:z,sessionID:N,...ht});for(const Me of Te){const sr=ne.part[Me.info.id]??[],Oo=Im(sr.filter(Ei=>!!Ei?.id),Me.parts.filter(Ei=>!!Ei?.id));le("part",Me.info.id,Ct(Oo,{key:"id"}))}}),ht}).catch(()=>{})})}const p2=z=>{const N=m2(z);if(N.running>=EM)return;const J=N.pending.shift();if(!J)return;N.pendingSet.delete(J),N.inflight.add(J),N.running+=1;const ne=Cm.value;AM(z,J,ne).finally(()=>{N.running-=1,N.inflight.delete(J),p2(z)})},fs=(z,N="low")=>{const J=z.directory;if(!J)return;const[ne]=u.child(J,{bootstrap:!1});if(Ye(()=>{const Oe=W1(J,z.id);return Wne({message:ne.message[z.id]!==void 0,info:Oe,chunk:d2})}))return;const se=m2(J);if(se.inflight.has(z.id))return;if(se.pendingSet.has(z.id)){if(N!=="high")return;const Oe=se.pending.indexOf(z.id);Oe>0&&(se.pending.splice(Oe,1),se.pending.unshift(z.id));return}const $e=h2(J);if(!(!$e.has(z.id)&&$e.size>=f2&&N!=="high")){for(N==="high"&&se.pending.unshift(z.id),N!=="high"&&se.pending.push(z.id),se.pendingSet.add(z.id);se.pending.length>TM;){const Oe=se.pending.pop();Oe&&se.pendingSet.delete(Oe)}p2(J)}},Em=(z,N)=>{for(let J=1;J<=$M;J++){const ne=z[N+J];ne&&fs(ne,J===1?"high":"low");const le=z[N-J];le&&fs(le,J===1?"high":"low")}};re(()=>{const z=va();if(z.length===0)return;const N=l.id?z.findIndex(J=>J.id===l.id):0;if(N!==-1){if(!l.id){const J=z[N];J&&fs(J,"high")}Em(z,N)}});function g2(z){const N=va();if(N.length===0)return;const J=l.id?N.findIndex(se=>se.id===l.id):-1;let ne;J===-1?ne=z>0?0:N.length-1:ne=(J+z+N.length)%N.length;const le=N[ne];le&&(fs(le,"high"),Em(N,ne),_2(le))}function v2(z){const N=d.projects.list();if(N.length===0)return;const J=zn()?.worktree,ne=T()?nd(T()):void 0,le=J??ne,se=le?N.findIndex(Te=>Te.worktree===le):-1,$e=se===-1?z>0?N[0]:N[N.length-1]:N[(se+z+N.length)%N.length];$e&&(u.child($e.worktree),hs($e.worktree))}function b2(z){const N=va();if(N.length===0||!N.some(se=>g.session.unseenCount(se.id)>0))return;const ne=l.id?N.findIndex(se=>se.id===l.id):-1,le=ne===-1?z>0?-1:0:ne;for(let se=1;se<=N.length;se++){const $e=z>0?(le+se)%N.length:(le-se+N.length)%N.length,Te=N[$e];if(Te&&g.session.unseenCount(Te.id)!==0){fs(Te,"high"),Em(N,$e),_2(Te);return}}}async function Tm(z){const[N,J]=u.child(z.directory),ne=N.session??[],le=ne.findIndex($e=>$e.id===z.id),se=ne[le+1]??ne[le-1];await c.client.session.update({directory:z.directory,sessionID:z.id,time:{archived:Date.now()}}),J(He($e=>{const Te=At.search($e.session,z.id,Oe=>Oe.id);Te.found&&$e.session.splice(Te.index,1)})),z.id===l.id&&v(se?`/${l.dir}/session/${se.id}`:`/${l.dir}/session`)}k.register("layout",()=>{const z=[{id:"sidebar.toggle",title:I.t("command.sidebar.toggle"),category:I.t("command.category.view"),keybind:"mod+b",onSelect:()=>d.sidebar.toggle()},{id:"project.open",title:I.t("command.project.open"),category:I.t("command.category.project"),keybind:"mod+o",onSelect:()=>$m()},{id:"project.previous",title:I.t("command.project.previous"),category:I.t("command.category.project"),keybind:"mod+alt+arrowup",onSelect:()=>v2(-1)},{id:"project.next",title:I.t("command.project.next"),category:I.t("command.category.project"),keybind:"mod+alt+arrowdown",onSelect:()=>v2(1)},{id:"provider.connect",title:I.t("command.provider.connect"),category:I.t("command.category.provider"),onSelect:()=>y2()},{id:"server.switch",title:I.t("command.server.switch"),category:I.t("command.category.server"),onSelect:()=>MM()},{id:"settings.open",title:I.t("command.settings.open"),category:I.t("command.category.settings"),keybind:"mod+comma",onSelect:()=>w2()},{id:"session.previous",title:I.t("command.session.previous"),category:I.t("command.category.session"),keybind:"alt+arrowup",onSelect:()=>g2(-1)},{id:"session.next",title:I.t("command.session.next"),category:I.t("command.category.session"),keybind:"alt+arrowdown",onSelect:()=>g2(1)},{id:"session.previous.unseen",title:I.t("command.session.previous.unseen"),category:I.t("command.category.session"),keybind:"shift+alt+arrowup",onSelect:()=>b2(-1)},{id:"session.next.unseen",title:I.t("command.session.next.unseen"),category:I.t("command.category.session"),keybind:"shift+alt+arrowdown",onSelect:()=>b2(1)},{id:"session.archive",title:I.t("command.session.archive"),category:I.t("command.category.session"),keybind:"mod+shift+backspace",disabled:!l.dir||!l.id,onSelect:()=>{const N=va().find(J=>J.id===l.id);N&&Tm(N)}},{id:"workspace.new",title:I.t("workspace.new"),category:I.t("command.category.workspace"),keybind:"mod+shift+w",disabled:!u2(),onSelect:()=>{const N=zn();if(N)return A2(N)}},{id:"workspace.toggle",title:I.t("command.workspace.toggle"),description:I.t("command.workspace.toggle.description"),category:I.t("command.category.workspace"),slash:"workspace",disabled:!zn()||zn()?.vcs!=="git",onSelect:()=>{const N=zn();if(!N||N.vcs!=="git")return;const J=d.sidebar.workspaces(N.worktree)();d.sidebar.toggleWorkspaces(N.worktree),yn({title:J?I.t("toast.workspace.disabled.title"):I.t("toast.workspace.enabled.title"),description:J?I.t("toast.workspace.disabled.description"):I.t("toast.workspace.enabled.description")})}},{id:"theme.cycle",title:I.t("command.theme.cycle"),category:I.t("command.category.theme"),keybind:"mod+shift+t",onSelect:()=>wM(1)}];for(const[N]of $())z.push({id:`theme.set.${N}`,title:I.t("command.theme.set",{theme:x.name(N)}),category:I.t("command.category.theme"),onSelect:()=>x.commitPreview(),onHighlight:()=>(x.previewTheme(N),()=>x.cancelPreview())});z.push({id:"theme.scheme.cycle",title:I.t("command.theme.scheme.cycle"),category:I.t("command.category.theme"),keybind:"mod+shift+s",onSelect:()=>kM(1)});for(const N of H)z.push({id:`theme.scheme.${N}`,title:I.t("command.theme.scheme.set",{scheme:M(N)}),category:I.t("command.category.theme"),onSelect:()=>x.commitPreview(),onHighlight:()=>(x.previewColorScheme(N),()=>x.cancelPreview())});z.push({id:"language.cycle",title:I.t("command.language.cycle"),category:I.t("command.category.language"),onSelect:()=>xM(1)});for(const N of I.locales)z.push({id:`language.set.${N}`,title:I.t("command.language.set",{language:I.label(N)}),category:I.t("command.category.language"),onSelect:()=>a2(N)});return z});function y2(){const z=++s;O(()=>import("./dialog-select-provider-BqrN5PhR.js").then(N=>N.d),__vite__mapDeps([97,98,99,100])).then(N=>{a||s!==z||_.show(()=>C(N.DialogSelectProvider,{}))})}function MM(){const z=++s;O(()=>import("./dialog-select-server-Wfx_uHN4.js"),__vite__mapDeps([101,98,102,103])).then(N=>{a||s!==z||_.show(()=>C(N.DialogSelectServer,{}))})}function w2(){const z=++s;O(()=>import("./dialog-settings-CjGwRyxi.js"),__vite__mapDeps([104,105,98,106,100,99,97])).then(N=>{a||s!==z||_.show(()=>C(N.DialogSettings,{}))})}function nd(z){const N=Ne(z),J=d.projects.list().find(Te=>Ne(Te.worktree)===N||Te.sandboxes?.some(Oe=>Ne(Oe)===N));if(J)return J.worktree;const ne=Object.entries(t.workspaceOrder).find(([Te,Oe])=>Ne(Te)===N||Oe.some(Pe=>Ne(Pe)===N));if(ne)return ne[0];const[le]=u.child(z,{bootstrap:!1}),se=le.project;return se?u.data.project.find(Te=>Te.id===se)?.worktree??z:z}function k2(z){return zn()?.worktree??nd(z)}function x2(z,N,J=k2(z)){return n("lastProjectSession",J,{directory:z,id:N,at:Date.now()}),J}function S2(z){t.lastProjectSession[z]&&n("lastProjectSession",He(N=>{delete N[z]}))}function DM(z,N,J=k2(z)){return x2(z,N,J),g.session.markViewed(N),Ye(()=>t.workspaceExpanded[z])===!1&&n("workspaceExpanded",z,!0),requestAnimationFrame(()=>CM(N,`${z}:${N}`)),J}async function rd(z){if(!z)return;const N=nd(z);p.projects.touch(N);const J=d.projects.list().find(Re=>Re.worktree===N);let ne=J?uf(N,[N,...J.sandboxes??[]],t.workspaceOrder[N]):[N];const le=Re=>Re?ne.some(Lt=>Ne(Lt)===Ne(Re)):!1,se=async Re=>{if(!Re||Re===N||le(Re))return le(Re);const Lt=await c.client.worktree.list({directory:N}).then(ht=>ht.data??[]).catch(()=>[]);return ne=uf(N,[N,...Lt],t.workspaceOrder[N]),le(Re)},$e=async Re=>{if(!le(Re.directory))return!1;const[Lt]=u.child(Re.directory,{bootstrap:!1});if(Lt.session.some(Tt=>Tt.id===Re.id))return n("lastProjectSession",N,{directory:Re.directory,id:Re.id,at:Date.now()}),ti(`/${mt(Re.directory)}/session/${Re.id}`),!0;const ht=await c.client.session.get({sessionID:Re.id}).then(Tt=>Tt.data).catch(()=>{});return!ht?.directory||!le(ht.directory)?!1:(n("lastProjectSession",N,{directory:ht.directory,id:ht.id,at:Date.now()}),ti(`/${mt(ht.directory)}/session/${ht.id}`),!0)},Te=t.lastProjectSession[N];if(Te?.id){if(await se(Te.directory),await $e(Te))return;S2(N)}const Oe=O7(ne.map(Re=>u.child(Re,{bootstrap:!1})[0]),Date.now());if(Oe&&await $e(Oe))return;const Pe=O7(await Promise.all(ne.map(async Re=>({path:{directory:Re},session:await c.client.session.list({directory:Re}).then(Lt=>Lt.data??[]).catch(()=>[])}))),Date.now());Pe&&await $e(Pe)||ti(`/${mt(N)}/session`)}function _2(z){z&&ti(`/${mt(z.directory)}/session/${z.id}`)}function hs(z,N=!0){if(d.projects.open(z),N)return rd(z)}const C2=z=>{if(p.isLocal()){for(const N of zue(z))hs(N);for(const N of jue(z)){hs(N.directory,!1);const J=mt(N.directory);N.prompt&&cue(J,{prompt:N.prompt});const ne=N.prompt?`/${J}/session?prompt=${encodeURIComponent(N.prompt)}`:`/${J}/session`;ti(ne)}}};Pt(()=>{const z=N=>{const ne=N.detail?.urls??[];ne.length!==0&&C2(ne)};C2(Fue(window)),Kt(window,Pue,z)});async function OM(z,N){const J=n2(z);if(N===J)return;const ne=N===Nn(z.worktree)?"":N;if(z.id&&z.id!=="global"){await c.client.project.update({projectID:z.id,directory:z.worktree,name:ne});return}u.project.meta(z.worktree,{name:ne})}const PM=(z,N,J,ne)=>{(_m(z,J,ne)??ne??Nn(z))!==N&&l2(z,N,J,ne)};function I2(z){const N=d.projects.list(),J=Ne(z),ne=N.findIndex($e=>Ne($e.worktree)===J),le=Ne(zn()?.worktree??"")===J;if(ne===-1)return;const se=N[ne+1];if(!le){d.projects.close(z);return}if(!se){d.projects.close(z),v("/");return}ti(`/${mt(se.worktree)}/session`),d.projects.close(z),queueMicrotask(()=>{rd(se.worktree)})}function E2(z){if(d.sidebar.workspaces(z.worktree)()){d.sidebar.toggleWorkspaces(z.worktree);return}z.vcs==="git"&&d.sidebar.toggleWorkspaces(z.worktree)}const T2=z=>{const N=++s;O(()=>import("./dialog-edit-project-CY9SaCFM.js"),[]).then(J=>{a||s!==N||_.show(()=>C(J.DialogEditProject,{project:z}))})};async function $m(){function z(N){if(Array.isArray(N)){for(const J of N)hs(J,!1);rd(N[0])}else N&&hs(N)}if(h.openDirectoryPickerDialog&&p.isLocal()){const N=await h.openDirectoryPickerDialog?.({title:I.t("command.project.open"),multiple:!0});z(N)}else{const N=++s;O(()=>import("./dialog-select-directory-2WfvK90b.js"),__vite__mapDeps([107,108,98])).then(J=>{a||s!==N||_.show(()=>C(J.DialogSelectDirectory,{multiple:!0,onSelect:z}),()=>z(null))})}}const RM=async(z,N,J=!1)=>{if(N===z)return;const ne=T(),le=Ne(ne),se=Ne(N),$e=J||!!l.dir&&le===se;!J&&$e&&ti(`/${mt(z)}/session`),G(N,!0);const Te=await c.client.worktree.remove({directory:z,worktreeRemoveInput:{directory:N}}).then(Tt=>Tt.data).catch(Tt=>(yn({title:I.t("workspace.delete.failed.title"),description:mg(Tt,I.t("common.requestFailed"))}),!1));if(G(N,!1),!Te||(Ne(t.lastProjectSession[z]?.directory??"")===Ne(N)&&S2(z),u.set("project",He(Tt=>{const Fe=Tt.find(Me=>Me.worktree===z);Fe&&(Fe.sandboxes=(Fe.sandboxes??[]).filter(Me=>Me!==N))})),n("workspaceOrder",z,Tt=>(Tt??[]).filter(Fe=>Fe!==N)),d.projects.close(N),d.projects.open(z),$e))return;const Oe=T(),Pe=Ne(Oe),Re=d.projects.list().find(Tt=>Tt.worktree===z),ht=(Re?uf(z,[z,...Re.sandboxes??[]],t.workspaceOrder[z]):[z]).some(Tt=>Ne(Tt)===Pe);l.dir&&nd(Oe)===z&&!ht&&ti(`/${mt(z)}/session`)},NM=async(z,N)=>{if(N===z)return;G(N,!0);const J=yn({persistent:!0,title:I.t("workspace.resetting.title"),description:I.t("workspace.resetting.description")}),ne=()=>hl.dismiss(J),le=await c.client.session.list({directory:N}).then(Te=>Te.data??[]).catch(()=>[]);if(Cae(N,le.map(Te=>Te.id),h),await c.client.instance.dispose({directory:N}).catch(()=>{}),!await c.client.worktree.reset({directory:z,worktreeResetInput:{directory:N}}).then(Te=>Te.data).catch(Te=>(yn({title:I.t("workspace.reset.failed.title"),description:mg(Te,I.t("common.requestFailed"))}),!1))){G(N,!1),ne();return}const $e=Date.now();await Promise.all(le.filter(Te=>Te.time.archived===void 0).map(Te=>c.client.session.update({sessionID:Te.id,directory:Te.directory,time:{archived:$e}}).catch(()=>{}))),G(N,!1),ne(),yn({title:I.t("workspace.reset.success.title"),description:I.t("workspace.reset.success.description"),actions:[{label:I.t("command.session.new"),onClick:()=>{const Te=`/${mt(N)}/session`;v(Te),d.mobileSidebar.hide()}},{label:I.t("common.dismiss"),onClick:"dismiss"}]})};function zM(z){const N=q(()=>Nn(z.directory)),[J,ne]=qe({status:"loading",dirty:!1});Pt(()=>{c.client.file.status({directory:z.directory}).then($e=>{const Oe=($e.data??[]).length>0;ne({status:"ready",dirty:Oe})}).catch(()=>{ne({status:"error",dirty:!1})})});const le=()=>{const $e=!!l.dir&&Ne(T())===Ne(z.directory);$e&&ti(`/${mt(z.root)}/session`),_.close(),RM(z.root,z.directory,$e)},se=()=>J.status==="loading"?I.t("workspace.status.checking"):J.status==="error"?I.t("workspace.status.error"):J.dirty?I.t("workspace.status.dirty"):I.t("workspace.status.clean");return C(K1,{get title(){return I.t("workspace.delete.title")},fit:!0,get children(){var $e=Cfe(),Te=$e.firstChild,Oe=Te.firstChild,Pe=Oe.nextSibling,Re=Te.nextSibling;return X(Oe,()=>I.t("workspace.delete.confirm",{name:N()})),X(Pe,se),X(Re,C(rn,{variant:"ghost",size:"large",onClick:()=>_.close(),get children(){return I.t("common.cancel")}}),null),X(Re,C(rn,{variant:"primary",size:"large",get disabled(){return J.status==="loading"},onClick:le,get children(){return I.t("workspace.delete.button")}}),null),$e}})}function jM(z){const N=q(()=>Nn(z.directory)),[J,ne]=qe({status:"loading",dirty:!1,sessions:[]}),le=async()=>{const Re=(await c.client.session.list({directory:z.directory}).then(Lt=>Lt.data??[]).catch(()=>[])).filter(Lt=>Lt.time.archived===void 0);ne({sessions:Re})};Pt(()=>{c.client.file.status({directory:z.directory}).then(Pe=>{const Lt=(Pe.data??[]).length>0;ne({status:"ready",dirty:Lt}),le()}).catch(()=>{ne({status:"error",dirty:!1})})});const se=()=>{_.close(),NM(z.root,z.directory)},$e=()=>J.sessions.length,Te=()=>J.status==="loading"?I.t("workspace.status.checking"):J.status==="error"?I.t("workspace.status.error"):J.dirty?I.t("workspace.status.dirty"):I.t("workspace.status.clean"),Oe=()=>{const Pe=$e();return Pe===0?I.t("workspace.reset.archived.none"):Pe===1?I.t("workspace.reset.archived.one"):I.t("workspace.reset.archived.many",{count:Pe})};return C(K1,{get title(){return I.t("workspace.reset.title")},fit:!0,get children(){var Pe=Ife(),Re=Pe.firstChild,Lt=Re.firstChild,ht=Lt.nextSibling,Tt=ht.firstChild,Fe=Tt.nextSibling;Fe.nextSibling;var Me=Re.nextSibling;return X(Lt,()=>I.t("workspace.reset.confirm",{name:N()})),X(ht,Te,Tt),X(ht,Oe,Fe),X(ht,()=>I.t("workspace.reset.note"),null),X(Me,C(rn,{variant:"ghost",size:"large",onClick:()=>_.close(),get children(){return I.t("common.cancel")}}),null),X(Me,C(rn,{variant:"primary",size:"large",get disabled(){return J.status==="loading"},onClick:se,get children(){return I.t("workspace.reset.button")}}),null),Pe}})}const On={session:"",sessionProject:"",directory:""};re(Yt(()=>[i(),L().slug,l.id,zn()?.worktree,T()],([z,N,J,ne,le])=>{if(!z||!N||!le){On.session="",On.sessionProject="",On.directory="";return}if(!J){On.session="",On.sessionProject="",On.directory="";return}const se=`${N}/${J}`;if(!ne){On.session=se,On.directory=le,On.sessionProject="";return}if(p.projects.last()!==ne&&p.projects.touch(ne),se!==On.session||le!==On.directory){On.session=se,On.directory=le,On.sessionProject=DM(le,J,ne);return}ne!==On.sessionProject&&(On.directory=le,On.sessionProject=x2(le,J,ne))})),re(()=>{const z=d.sidebar.opened()?d.sidebar.width():48;document.documentElement.style.setProperty("--dialog-left-margin",`${z}px`)});const id=q(()=>Math.max(d.sidebar.width(),244)),$2=q(()=>Math.max(id()-64,0)),od=new Set;re(Yt(ed,z=>{if(z.length===0){od.clear();return}const N=new Set(z);for(const J of N)od.has(J)||u.project.loadSessions(J);od.clear();for(const J of N)od.add(J)},{defer:!0}));function FM(z){const N=W0(z);N&&(xe(void 0),n("activeProject",N))}function HM(z){const{draggable:N,droppable:J}=z;if(N&&J){const ne=d.projects.list(),le=ne.findIndex($e=>$e.worktree===N.id.toString()),se=ne.findIndex($e=>$e.worktree===J.id.toString());le!==se&&se!==-1&&d.projects.move(N.id.toString(),se)}}function VM(){n("activeProject",void 0)}function sd(z){if(!z)return[];const N=z.worktree,J=[N,...z.sandboxes??[]],ne=zn(),le=Ne(ne?.worktree??"")===Ne(z.worktree)?T():void 0,se=le&&Ne(le)!==Ne(N)&&!J.some(Oe=>Ne(Oe)===Ne(le))?le:void 0,$e=se?cf.get(se)?.status==="pending":!1,Te=uf(N,J,t.workspaceOrder[z.worktree]);return $e&&se?[N,se,...Te.filter(Oe=>Oe!==N)]:!se||$e?Te:[...Te,se]}const L2=q(()=>{if(d.sidebar.opened())return zn();const z=V();return z||zn()});function UM(z){const N=W0(z);N&&n("activeWorkspace",N)}function BM(z){const{draggable:N,droppable:J}=z;if(!N||!J)return;const ne=L2();if(!ne)return;const le=sd(ne),se=le.findIndex(Pe=>Pe===N.id.toString()),$e=le.findIndex(Pe=>Pe===J.id.toString());if(se===-1||$e===-1||se===$e)return;const Te=le.slice(),[Oe]=Te.splice(se,1);Oe&&(Te.splice($e,0,Oe),n("workspaceOrder",ne.worktree,Te.filter(Pe=>Ne(Pe)!==Ne(ne.worktree))))}function qM(){n("activeWorkspace",void 0)}const A2=async z=>{s2();const N=await c.client.worktree.create({directory:z.worktree}).then(se=>se.data).catch(se=>{yn({title:I.t("workspace.create.failed.title"),description:mg(se,I.t("common.requestFailed"))})});if(!N?.directory)return;l2(N.directory,N.branch,z.id,N.branch);const J=z.worktree,ne=Ne(N.directory),le=Ne(J);G(N.directory,!0),cf.pending(N.directory),n("workspaceExpanded",ne,!0),ne!==N.directory&&n("workspaceExpanded",N.directory,!0),n("workspaceOrder",z.worktree,se=>{const Te=(se??[]).filter(Oe=>{const Pe=Ne(Oe);return Pe!==le&&Pe!==ne});return[N.directory,...Te]}),u.child(N.directory),ti(`/${mt(N.directory)}/session`)},M2={currentDir:T,navList:va,sidebarExpanded:Ae,sidebarHovering:We,clearHoverProjectSoon:Ue,prefetchSession:fs,archiveSession:Tm,workspaceName:_m,renameWorkspace:PM,editorOpen:St,openEditor:pn,closeEditor:Yn,setEditor:Do,InlineEditor:Qu,isBusy:U,workspaceExpanded:(z,N)=>t.workspaceExpanded[z]??N,setWorkspaceExpanded:(z,N)=>n("workspaceExpanded",z,N),showResetWorkspaceDialog:(z,N)=>_.show(()=>C(jM,{root:z,directory:N})),showDeleteWorkspaceDialog:(z,N)=>_.show(()=>C(zM,{root:z,directory:N})),setScrollContainerRef:(z,N)=>{N||(o=z)}},WM={currentDir:T,currentProject:zn,sidebarOpened:()=>d.sidebar.opened(),sidebarHovering:We,hoverProject:()=>E.hoverProject,onProjectMouseEnter:(z,N)=>Se.enter(z,N),onProjectMouseLeave:z=>Se.leave(z),onProjectFocus:z=>Se.activate(z),onHoverOpenChanged:(z,N)=>{!N&&E.hoverProject&&E.hoverProject!==z||D("hoverProject",N?z:void 0)},navigateToProject:rd,openSidebar:()=>d.sidebar.open(),closeProject:I2,showEditProjectDialog:T2,toggleProjectWorkspaces:E2,workspacesEnabled:z=>z.vcs==="git"&&d.sidebar.workspaces(z.worktree)(),workspaceIds:sd,workspaceLabel:c2,sessionProps:{navList:va,sidebarExpanded:Ae,clearHoverProjectSoon:Ue,prefetchSession:fs,archiveSession:Tm}},Lm=z=>{const N=z.project,J=q(()=>z.mobile||(z.merged??d.sidebar.opened())),ne=q(()=>!z.mobile&&z.merged===!1&&!d.sidebar.opened()),le=q(()=>!l.dir&&d.projects.list().length===0),se=q(()=>{const Me=N();return Me?Me.name||Nn(Me.worktree):""}),$e=q(()=>N()?.id??""),Te=q(()=>N()?.worktree??""),Oe=q(()=>{const Me=Te();return Me?mt(Me):""}),Pe=q(()=>{const Me=N();return Me?sd(Me):[]}),Re=q(()=>Pe().reduce((Me,sr)=>Me+g.project.unseenCount(sr),0)),Lt=()=>Pe().filter(Me=>g.project.unseenCount(Me)>0).forEach(Me=>g.project.markViewed(Me)),ht=q(()=>{const Me=N();return!Me||Me.vcs!=="git"?!1:d.sidebar.workspaces(Me.worktree)()}),Tt=q(()=>{const Me=N();return Me?Me.vcs==="git"||d.sidebar.workspaces(Me.worktree)():!1}),Fe=q(()=>u.data.path.home);return(()=>{var Me=Mfe(),sr=Me.firstChild,Oo=sr.firstChild,Ei=Oo.firstChild,ms=Ei.firstChild,ba=ms.firstChild,Yi=ba.nextSibling,Kl=Yi.nextSibling,ad=ms.nextSibling;return X(Me,C(Ce,{get when(){return N()},get fallback(){return C(Ce,{get when(){return le()},get children(){var gn=Dfe(),vn=gn.firstChild,Pn=vn.firstChild,Vt=Pn.firstChild,ld=Vt.nextSibling;return X(Vt,()=>I.t("sidebar.empty.title")),X(ld,()=>I.t("sidebar.empty.description")),X(vn,C(rn,{size:"large",icon:"folder-add-left",onClick:$m,get children(){return I.t("command.project.open")}}),null),gn}})},get children(){return[(()=>{var gn=Tfe(),vn=gn.firstChild,Pn=vn.firstChild;return X(Pn,C(Qu,{get id(){return`project:${$e()}`},value:se,onSave:Vt=>{const ld=N();ld&&OM(ld,Vt)},class:"text-14-medium text-text-strong truncate",displayClass:"text-14-medium text-text-strong truncate",stopPropagation:!0}),null),X(Pn,C($r,{placement:"bottom",gutter:2,get value(){return Te()},class:"shrink-0",contentStyle:{"max-width":"640px",transform:"translate3d(52px, 0, 0)"},get children(){var Vt=Efe();return X(Vt,()=>Te().replace(Fe(),"~")),Vt}}),null),X(vn,C(Bt,{get modal(){return!We()},get children(){return[C(Bt.Trigger,{as:Wr,icon:"dot-grid",variant:"ghost","data-action":"project-menu",get"data-project"(){return Oe()},class:"shrink-0 size-6 rounded-md transition-opacity data-[expanded]:bg-surface-base-active",get classList(){return{"opacity-100":z.mobile||J(),"opacity-0 group-hover/project:opacity-100 group-focus-within/project:opacity-100 data-[expanded]:opacity-100":!z.mobile&&!J()}},get"aria-label"(){return I.t("common.moreOptions")}}),C(Bt.Portal,{get children(){return C(Bt.Content,{class:"mt-1",get children(){return[C(Bt.Item,{onSelect:()=>{const Vt=N();Vt&&T2(Vt)},get children(){return C(Bt.ItemLabel,{get children(){return I.t("common.edit")}})}}),C(Bt.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return Oe()},get disabled(){return!Tt()},onSelect:()=>{const Vt=N();Vt&&E2(Vt)},get children(){return C(Bt.ItemLabel,{get children(){return it(()=>!!ht())()?I.t("sidebar.workspaces.disable"):I.t("sidebar.workspaces.enable")}})}}),C(Bt.Item,{"data-action":"project-clear-notifications",get"data-project"(){return Oe()},get disabled(){return Re()===0},onSelect:Lt,get children(){return C(Bt.ItemLabel,{get children(){return I.t("sidebar.project.clearNotifications")}})}}),C(Bt.Separator,{}),C(Bt.Item,{"data-action":"project-close-menu",get"data-project"(){return Oe()},onSelect:()=>{const Vt=Te();Vt&&I2(Vt)},get children(){return C(Bt.ItemLabel,{get children(){return I.t("common.close")}})}})]}})}})]}}),null),gn})(),(()=>{var gn=Afe();return X(gn,C(Ce,{get when(){return ht()},get fallback(){return[(()=>{var vn=j7();return X(vn,C(rn,{size:"large",icon:"new-session",class:"w-full",onClick:()=>{const Pn=Te();Pn&&ti(`/${mt(Pn)}/session`)},get children(){return I.t("command.session.new")}})),vn})(),(()=>{var vn=Ofe();return X(vn,C(zde,{ctx:M2,get project(){return N()},sortNow:Y,get mobile(){return z.mobile}})),vn})()]},get children(){return[(()=>{var vn=j7();return X(vn,C(rn,{size:"large",icon:"plus-small",class:"w-full",onClick:()=>{const Pn=N();Pn&&A2(Pn)},get children(){return I.t("workspace.new")}})),vn})(),(()=>{var vn=Lfe();return X(vn,C(IA,{onDragStart:UM,onDragEnd:qM,onDragOver:BM,collisionDetector:_A,get children(){return[C(EA,{}),C(OA,{}),(()=>{var Pn=$fe();return Cr(Vt=>{z.mobile||(o=Vt)},Pn),X(Pn,C(LA,{get ids(){return Pe()},get children(){return C(zi,{get each(){return Pe()},children:Vt=>C(Nde,{ctx:M2,directory:Vt,get project(){return N()},sortNow:Y,get mobile(){return z.mobile}})})}})),Pn})(),C(TA,{get children(){return C(Ode,{sidebarProject:L2,activeWorkspace:()=>t.activeWorkspace,workspaceLabel:c2})}})]}})),vn})()]}})),gn})()]}}),sr),X(ba,()=>I.t("sidebar.gettingStarted.title")),X(Yi,()=>I.t("sidebar.gettingStarted.line1")),X(Kl,()=>I.t("sidebar.gettingStarted.line2")),X(ad,C(rn,{size:"large",icon:"plus-small",onClick:y2,get children(){return I.t("command.provider.connect")}}),null),X(ad,C(rn,{size:"large",variant:"ghost",onClick:()=>n("gettingStartedDismissed",!0),get children(){return I.t("toast.update.action.notYet")}}),null),Ve(gn=>{var vn={"flex flex-col min-h-0 min-w-0 box-border rounded-tl-[12px] px-3":!0,"border border-b-0 border-border-weak-base":!J(),"border-l border-t border-border-weaker-base":J(),"bg-background-base":J()||ne(),"bg-background-stronger":!J()&&!ne(),"flex-1 min-w-0":z.mobile,"max-w-full overflow-hidden":z.mobile},Pn=z.mobile?void 0:`${$2()}px`,Vt=!!(t.gettingStartedDismissed||!(y.all().length>0&&y.paid().length===0));return gn.e=Ft(Me,vn,gn.e),Pn!==gn.t&&Xn(Me,"width",gn.t=Pn),Vt!==gn.a&&sr.classList.toggle("hidden",gn.a=Vt),gn},{e:void 0,t:void 0,a:void 0}),Me})()},D2=()=>d.projects.list(),GM=()=>C(gfe,{projects:D2,activeProject:()=>t.activeProject}),O2=z=>C(_fe,{mobile:z,opened:()=>d.sidebar.opened(),get aimMove(){return Se.move},projects:D2,renderProject:N=>C(yfe,{ctx:WM,project:N,sortNow:Y,mobile:z}),handleDragStart:FM,handleDragEnd:VM,handleDragOver:HM,get openProjectLabel(){return I.t("command.project.open")},openProjectKeybind:()=>k.keybind("project.open"),onOpenProject:$m,renderProjectOverlay:GM,settingsLabel:()=>I.t("sidebar.settings"),settingsKeybind:()=>k.keybind("settings.open"),onOpenSettings:w2,helpLabel:()=>I.t("sidebar.help"),onOpenHelp:()=>h.openLink("https://duckmind.ai/desktop-feedback"),renderPanel:()=>z?C(Lm,{project:zn,mobile:!0}):C(Lm,{project:zn,merged:!0})});return(()=>{var z=Rfe(),N=z.firstChild,J=N.firstChild,ne=J.firstChild,le=ne.firstChild,se=le.firstChild,$e=le.nextSibling,Te=$e.nextSibling,Oe=Te.firstChild,Pe=Oe.nextSibling,Re=Te.nextSibling,Lt=Re.firstChild,ht=Re.nextSibling,Tt=ht.nextSibling;return Tt.firstChild,X(z,C(Aue,{}),N),le.addEventListener("mouseleave",()=>{Se.reset(),We()&&or()}),le.addEventListener("mouseenter",()=>{lt()}),Cr(Fe=>{D("nav",Fe)},le),Ft(le,{"hidden xl:block":!0,"absolute inset-y-0 left-0":!0,"z-10":!0}),X(se,O2),X(ne,C(Ce,{get when(){return d.sidebar.opened()},get children(){var Fe=Pfe();return Fe.$$pointerdown=()=>D("sizing",!0),X(Fe,C(Nae,{direction:"horizontal",get size(){return d.sidebar.width()},min:244,get max(){return typeof window>"u"?1e3:window.innerWidth*.3+64},onResize:Me=>{D("sizing",!0),ee!==void 0&&clearTimeout(ee),ee=window.setTimeout(()=>D("sizing",!1),120),d.sidebar.resize(Me)}})),Ve(Me=>Xn(Fe,"left",`${id()}px`)),Fe}}),$e),Oe.$$click=Fe=>{Fe.target===Fe.currentTarget&&d.mobileSidebar.hide()},Pe.$$click=Fe=>Fe.stopPropagation(),X(Pe,()=>O2(!0)),Ft(Lt,{"size-full overflow-x-hidden flex flex-col items-start contain-strict border-t border-border-weak-base bg-background-base xl:border-l xl:rounded-tl-[12px]":!0}),X(Lt,C(Ce,{get when(){return!IM.loading},get fallback(){return Nfe()},get children(){return e.children}})),ht.addEventListener("mouseleave",()=>{or()}),ht.$$pointerdown=lt,ht.addEventListener("mouseenter",()=>{lt(),Se.reset()}),ht.$$mousemove=lt,X(ht,C(Ce,{get when(){return ft()},get children(){return C(Lm,{project:ft,merged:!1})}})),X(N,(()=>{var Fe=it(()=>!1);return()=>Fe()&&C(pue,{})})(),null),X(z,C(Uo.Region,{}),null),Ve(Fe=>{var Me=I.t("sidebar.nav.projectsAndSessions"),sr=`${id()}px`,Oo={"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200":!0,"opacity-100 pointer-events-auto":d.mobileSidebar.opened(),"opacity-0 pointer-events-none":!d.mobileSidebar.opened()},Ei=I.t("sidebar.nav.projectsAndSessions"),ms={"@container fixed top-10 bottom-0 left-0 z-50 w-full max-w-[400px] overflow-hidden border-r border-border-weaker-base bg-background-base transition-transform duration-200 ease-out":!0,"translate-x-0":d.mobileSidebar.opened(),"-translate-x-full":!d.mobileSidebar.opened()},ba={"absolute inset-0":!0,"xl:inset-y-0 xl:right-0 xl:left-[var(--main-left)]":!0,"z-20":!0,"transition-[left] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-[left] motion-reduce:transition-none":!E.sizing},Yi=d.sidebar.opened()?`${id()}px`:"4rem",Kl={"hidden xl:flex absolute inset-y-0 left-16 z-30":!0,"opacity-100 translate-x-0 pointer-events-auto":E.peeked&&!d.sidebar.opened(),"opacity-0 -translate-x-2 pointer-events-none":!E.peeked||d.sidebar.opened(),"transition-[opacity,transform] motion-reduce:transition-none":!0,"duration-180 ease-out":E.peeked&&!d.sidebar.opened(),"duration-120 ease-in":!E.peeked||d.sidebar.opened()},ad={"hidden xl:block pointer-events-none absolute inset-y-0 right-0 z-25 overflow-hidden":!0,"opacity-100 translate-x-0":E.peeked&&!d.sidebar.opened(),"opacity-0 -translate-x-2":!E.peeked||d.sidebar.opened(),"transition-[opacity,transform] motion-reduce:transition-none":!0,"duration-180 ease-out":E.peeked&&!d.sidebar.opened(),"duration-120 ease-in":!E.peeked||d.sidebar.opened()},gn=`calc(4rem + ${$2()}px)`;return Me!==Fe.e&&vt(le,"aria-label",Fe.e=Me),sr!==Fe.t&&Xn(le,"width",Fe.t=sr),Fe.a=Ft(Oe,Oo,Fe.a),Ei!==Fe.o&&vt(Pe,"aria-label",Fe.o=Ei),Fe.i=Ft(Pe,ms,Fe.i),Fe.n=Ft(Re,ba,Fe.n),Yi!==Fe.s&&Xn(Re,"--main-left",Fe.s=Yi),Fe.h=Ft(ht,Kl,Fe.h),Fe.r=Ft(Tt,ad,Fe.r),gn!==Fe.d&&Xn(Tt,"left",Fe.d=gn),Fe},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),z})()}Jr(["pointerdown","click","mousemove"]);var jfe=["id","name","validationState","required","disabled","readOnly"];function Ffe(e){const t=`form-control-${Mn()}`,n=et({id:t},e),[r,i]=we(),[o,s]=we(),[a,l]=we(),[c,u]=we(),d=(p,g,b)=>{const v=b!=null||r()!=null;return[b,r(),v&&g!=null?p:void 0].filter(Boolean).join(" ")||void 0},f=p=>[a(),c(),p].filter(Boolean).join(" ")||void 0,h=q(()=>({"data-valid":ce(n.validationState)==="valid"?"":void 0,"data-invalid":ce(n.validationState)==="invalid"?"":void 0,"data-required":ce(n.required)?"":void 0,"data-disabled":ce(n.disabled)?"":void 0,"data-readonly":ce(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>ce(n.name)??ce(n.id),dataset:h,validationState:()=>ce(n.validationState),isRequired:()=>ce(n.required),isDisabled:()=>ce(n.disabled),isReadOnly:()=>ce(n.readOnly),labelId:r,fieldId:o,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Bi(()=>ce(n.id)),registerLabel:Gn(i),registerField:Gn(s),registerDescription:Gn(l),registerErrorMessage:Gn(u)}}}var oM=yt();function Xu(){const e=wt(oM);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function sM(e){const t=Xu(),n=et({id:t.generateId("description")},e);return re(()=>ae(t.registerDescription(n.id))),C(pt,ie({as:"div"},()=>t.dataset(),n))}var Hfe=["id","aria-label","aria-labelledby","aria-describedby"];function Vfe(e){const t=Xu(),n=et({id:t.generateId("field")},e);return re(()=>ae(t.registerField(ce(n.id)))),{fieldProps:{id:()=>ce(n.id),ariaLabel:()=>ce(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy(ce(n.id),ce(n["aria-label"]),ce(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy(ce(n["aria-describedby"]))}}}function aM(e){let t;const n=Xu(),r=et({id:n.generateId("label")},e),[i,o]=pe(r,["ref"]),s=wu(()=>t,()=>"label");return re(()=>ae(n.registerLabel(o.id))),C(pt,ie({as:"label",ref(a){var l=Nt(c=>t=c,i.ref);typeof l=="function"&&l(a)},get for(){return it(()=>s()==="label")()?n.fieldId():void 0}},()=>n.dataset(),o))}function Ufe(e,t){re(Yt(e,n=>{if(n==null)return;const r=Bfe(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),ae(()=>{r.removeEventListener("reset",t)}))}))}function Bfe(e){return qfe(e)?e.form:e.closest("form")}function qfe(e){return e.matches("textarea, input, select, button")}function lM(e){const t=Xu(),n=et({id:t.generateId("error-message")},e),[r,i]=pe(n,["forceMount"]),o=()=>t.validationState()==="invalid";return re(()=>{o()&&ae(t.registerErrorMessage(i.id))}),C(Ce,{get when(){return r.forceMount||o()},get children(){return C(pt,ie({as:"div"},()=>t.dataset(),i))}})}var Wfe={};Ci(Wfe,{Description:()=>sM,ErrorMessage:()=>lM,Input:()=>uM,Label:()=>aM,Root:()=>fM,TextArea:()=>hM,TextField:()=>Cs,useTextFieldContext:()=>o2});var cM=yt();function o2(){const e=wt(cM);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function uM(e){return C(dM,ie({type:"text"},e))}function dM(e){const t=Xu(),n=o2(),r=et({id:n.generateId("input")},e),[i,o,s]=pe(r,["onInput"],Hfe),{fieldProps:a}=Vfe(o);return C(pt,ie({as:"input",get id(){return a.id()},get name(){return t.name()},get value(){return n.value()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},get onInput(){return cn([i.onInput,n.onInput])}},()=>t.dataset(),s))}function fM(e){let t;const n=`textfield-${Mn()}`,r=et({id:n},e),[i,o,s]=pe(r,["ref","value","defaultValue","onChange"],jfe),a=i.value,[l,c]=yu({value:()=>a===void 0?void 0:i.value??"",defaultValue:()=>i.defaultValue,onChange:h=>i.onChange?.(h)}),{formControlContext:u}=Ffe(o);Ufe(()=>t,()=>c(i.defaultValue??""));const d=h=>{if(u.isReadOnly()||u.isDisabled())return;const m=h.target;c(m.value),m.value=l()??""},f={value:l,generateId:Bi(()=>ce(o.id)),onInput:d};return C(oM.Provider,{value:u,get children(){return C(cM.Provider,{value:f,get children(){return C(pt,ie({as:"div",ref(h){var m=Nt(p=>t=p,i.ref);typeof m=="function"&&m(h)},role:"group",get id(){return ce(o.id)}},()=>u.dataset(),s))}})}})}function hM(e){let t;const n=o2(),r=et({id:n.generateId("textarea")},e),[i,o]=pe(r,["ref","autoResize","submitOnEnter","onKeyPress"]);re(Yt([()=>t,()=>i.autoResize,()=>n.value()],([a,l])=>{!a||!l||Gfe(a)}));const s=a=>{t&&i.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&t.form&&(t.form.requestSubmit(),a.preventDefault())};return C(dM,ie({as:"textarea",get"aria-multiline"(){return i.submitOnEnter?"false":void 0},get onKeyPress(){return cn([i.onKeyPress,s])},ref(a){var l=Nt(c=>t=c,i.ref);typeof l=="function"&&l(a)}},o))}function Gfe(e){const t=e.style.alignSelf,n=e.style.overflow;"MozAppearance"in e.style||(e.style.overflow="hidden"),e.style.alignSelf="start",e.style.height="auto",e.style.height=`${e.scrollHeight+(e.offsetHeight-e.clientHeight)}px`,e.style.overflow=n,e.style.alignSelf=t}var Cs=Object.assign(fM,{Description:sM,ErrorMessage:lM,Input:uM,Label:aM,TextArea:hM}),Zfe=me("<div data-slot=input-wrapper>");function Kfe(e){const t=ku(),[n,r]=pe(e,["name","defaultValue","value","onChange","onKeyDown","validationState","required","disabled","readOnly","class","label","hideLabel","description","error","variant","copyable","copyKind","multiline"]),[i,o]=we(!1),s=()=>i()?t.t("ui.textField.copied"):n.copyKind==="link"?t.t("ui.textField.copyLink"):t.t("ui.textField.copyToClipboard"),a=()=>i()?"check":n.copyKind==="link"?"link":"copy";async function l(){const u=n.value??n.defaultValue??"";await navigator.clipboard.writeText(u),o(!0),setTimeout(()=>o(!1),2e3)}function c(){n.copyable&&l()}return C(Cs,{"data-component":"input",get"data-variant"(){return n.variant||"normal"},get name(){return n.name},get defaultValue(){return n.defaultValue},get value(){return n.value},get onChange(){return n.onChange},get onKeyDown(){return n.onKeyDown},onClick:c,get required(){return n.required},get disabled(){return n.disabled},get readOnly(){return n.readOnly},get validationState(){return n.validationState},get children(){return[C(Ce,{get when(){return n.label},get children(){return C(Cs.Label,{"data-slot":"input-label",get classList(){return{"sr-only":n.hideLabel}},get children(){return n.label}})}}),(()=>{var u=Zfe();return X(u,C(Ce,{get when(){return n.multiline},get fallback(){return C(Cs.Input,ie(r,{"data-slot":"input-input",get class(){return n.class}}))},get children(){return C(Cs.TextArea,ie(r,{autoResize:!0,"data-slot":"input-input",get class(){return n.class}}))}}),null),X(u,C(Ce,{get when(){return n.copyable},get children(){return C($r,{get value(){return s()},placement:"top",gutter:4,get forceOpen(){return i()},skipDelayDuration:0,get children(){return C(Wr,{type:"button",get icon(){return a()},variant:"ghost",onClick:l,tabIndex:-1,"data-slot":"input-copy-button",get"aria-label"(){return s()}})}})}}),null),u})(),C(Ce,{get when(){return n.description},get children(){return C(Cs.Description,{"data-slot":"input-description",get children(){return n.description}})}}),C(Cs.ErrorMessage,{"data-slot":"input-error",get children(){return n.error}})]}})}var Yfe=me('<div class="relative flex-1 h-screen w-screen min-h-0 flex flex-col items-center justify-center bg-background-base font-sans"><div class="w-2/3 max-w-3xl flex flex-col items-center justify-center gap-8"><div class="flex flex-col items-center gap-2 text-center"><h1 class="text-lg font-medium text-text-strong"></h1><p class="text-sm text-text-weak"></p></div><div class="flex items-center gap-3"></div><div class="flex flex-col items-center gap-2"><div class="flex items-center justify-center gap-1"><button type=button class="flex items-center text-text-interactive-base gap-1"><div>'),Jfe=me('<p class="text-xs text-text-danger-base text-center max-w-2xl">'),Xfe=me('<p class="text-xs text-text-weak">');const df=`
|
|
2404
2404
|
`+"─".repeat(40)+`
|
|
2405
2405
|
`;function Qfe(e){if(!e||typeof e!="object"||!("message"in e)||!("path"in e))return!1;const t=e.message,n=e.path;return typeof t!="string"||!Array.isArray(n)?!1:n.every(r=>typeof r=="string")}function e0e(e){return typeof e=="object"&&e!==null&&"name"in e&&"data"in e&&typeof e.data=="object"}function mM(e,t){const n=new WeakSet;return JSON.stringify(e,(i,o)=>{if(typeof o=="bigint")return o.toString();if(typeof o=="object"&&o){if(n.has(o))return t;n.add(o)}return o},2)??String(e)}function t0e(e,t){const n=e.data,r=i=>mM(i,t("error.page.circular"));switch(e.name){case"MCPFailed":{const i=typeof n.name=="string"?n.name:"";return t("error.chain.mcpFailed",{name:i})}case"ProviderAuthError":{const i=typeof n.providerID=="string"?n.providerID:t("common.unknown"),o=typeof n.message=="string"?n.message:r(n.message);return t("error.chain.providerAuthFailed",{provider:i,message:o})}case"APIError":{const o=[typeof n.message=="string"?n.message:t("error.chain.apiError")];return typeof n.statusCode=="number"&&o.push(t("error.chain.status",{status:n.statusCode})),typeof n.isRetryable=="boolean"&&o.push(t("error.chain.retryable",{retryable:n.isRetryable})),typeof n.responseBody=="string"&&n.responseBody&&o.push(t("error.chain.responseBody",{body:n.responseBody})),o.join(`
|
|
2406
2406
|
`)}case"ProviderModelNotFoundError":{const{providerID:i,modelID:o,suggestions:s}=n,a=Array.isArray(s)&&s.length?[t("error.chain.didYouMean",{suggestions:s.join(", ")})]:[];return[t("error.chain.modelNotFound",{provider:i,model:o}),...a,t("error.chain.checkConfig")].join(`
|
|
@@ -2420,4 +2420,4 @@ ${df}${t("error.chain.causedBy")}
|
|
|
2420
2420
|
`:"")+e:(n>0?`
|
|
2421
2421
|
${df}${t("error.chain.causedBy")}
|
|
2422
2422
|
`:"")+i(e)}function ff(e,t){return pM(e,t,0)}const n0e=e=>{const t=$o(),n=En(),[r,i]=qe({checking:!1,version:void 0,actionError:void 0});Pt(()=>{if(!window.__duckmind_e2e)return;const l=ff(e.error,n.t);console.error(`[e2e:error-boundary] ${window.location.pathname}
|
|
2423
|
-
${l}`)});async function o(){t.checkUpdate&&(i("checking",!0),await t.checkUpdate().then(a=>{i("actionError",void 0),a.updateAvailable&&a.version&&i("version",a.version)}).catch(a=>{i("actionError",ff(a,n.t))}).finally(()=>{i("checking",!1)}))}async function s(){!t.update||!t.restart||await t.update().then(()=>t.restart()).then(()=>i("actionError",void 0)).catch(a=>{i("actionError",ff(a,n.t))})}return(()=>{var a=Yfe(),l=a.firstChild,c=l.firstChild,u=c.firstChild,d=u.nextSibling,f=c.nextSibling,h=f.nextSibling,m=h.firstChild,p=m.firstChild,g=p.firstChild;return X(l,C(Cq,{class:"w-58.5 opacity-12 shrink-0"}),c),X(u,()=>n.t("error.page.title")),X(d,()=>n.t("error.page.description")),X(l,C(Kfe,{get value(){return ff(e.error,n.t)},readOnly:!0,copyable:!0,multiline:!0,class:"max-h-96 w-full font-mono text-xs no-scrollbar",get label(){return n.t("error.page.details.label")},hideLabel:!0}),f),X(f,C(rn,{size:"large",get onClick(){return t.restart},get children(){return n.t("error.page.action.restart")}}),null),X(f,C(Ce,{get when(){return t.checkUpdate},get children(){return C(Ce,{get when(){return r.version},get fallback(){return C(rn,{size:"large",variant:"ghost",onClick:o,get disabled(){return r.checking},get children(){return it(()=>!!r.checking)()?n.t("error.page.action.checking"):n.t("error.page.action.checkUpdates")}})},get children(){return C(rn,{size:"large",onClick:s,get children(){return n.t("error.page.action.updateTo",{version:r.version??""})}})}})}}),null),X(l,C(Ce,{get when(){return r.actionError},children:b=>(()=>{var v=Jfe();return X(v,b),v})()}),h),X(m,()=>n.t("error.page.report.prefix"),p),p.$$click=()=>t.openLink("https://duckmind.ai/desktop-feedback"),X(g,()=>n.t("error.page.report.discord")),X(p,C(ur,{name:"discord",class:"text-text-interactive-base"}),null),X(h,C(Ce,{get when(){return t.version},children:b=>(()=>{var v=Xfe();return X(v,()=>n.t("error.page.version",{version:b()})),v})()}),null),a})()};Jr(["click"]);var r0e=me("<div class=size-full>"),i0e=me('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base">'),o0e=me('<div class="flex flex-col gap-2 w-full max-w-sm"><span class="text-12-regular text-text-base text-center"></span><div class="flex flex-col gap-1 bg-surface-base rounded-lg p-2">'),s0e=me('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base gap-6 p-6"><div class="flex flex-col items-center max-w-md text-center"><p class="text-14-regular text-text-base"><span class="text-text-strong font-medium"></span></p><p class="mt-1 text-12-regular text-text-weak">'),a0e=me('<button type=button class="flex items-center gap-3 w-full px-3 py-2 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><span class="text-14-regular text-text-strong truncate">');const l0e=Y7(()=>O(()=>import("./home-D8eKClgK.js"),__vite__mapDeps([109,107,108,98,101,102,103]))),gM=()=>O(()=>import("./session-CuMpLG8c.js").then(e=>e.s),__vite__mapDeps([110,103,105,98,99,108])),c0e=Y7(gM),u0e=()=>r0e();typeof location=="object"&&/\/session(?:\/|$)/.test(location.pathname)&&gM();const d0e=()=>C(g0e,{get children(){return C(c0e,{})}}),f0e=()=>C(kW,{href:"session"});function h0e(e){const t=En();return C(YO,{get value(){return{locale:t.intl,t:t.t}},get children(){return e.children}})}function m0e(e){const t=new tG;return C(QW,{client:t,get children(){return e.children}})}function p0e(e){return C(nY,{get children(){return C(aae,{get children(){return C(Ure,{get children(){return C(tae,{get children(){return C(Zse,{get children(){return C(lY,{get children(){return C(xie,{get children(){return C(zfe,{get children(){return e.children}})}})}})}})}})}})}})}})}function g0e(e){return C(Eae,{get children(){return C(oie,{get children(){return C(bae,{get children(){return C(bY,{get children(){return e.children}})}})}})}})}function v0e(e){return C(p0e,{get children(){return C(dD,{get fallback(){return C(u0e,{})},get children(){return[it(()=>e.appChildren),it(()=>e.children)]}})}})}function b0e(e){return C(Uq,{get children(){return[C(kq,{}),C(jq,{onThemeApplied:(t,n)=>{window.api?.setTitlebar?.({mode:n})},get children(){return C(ZK,{get locale(){return e.locale},get children(){return C(h0e,{get children(){return C(cD,{fallback:t=>C(n0e,{error:t}),get children(){return C(m0e,{get children(){return C(GO,{get children(){return C(aB,{get children(){return C(RD,{component:wq,get children(){return e.children}})}})}})}})}})}})}})}})]}})}function y0e(e){const t=Rl(),n=h$(),[r,i]=we("blocking"),[o,s]=xl(()=>e.disableHealthCheck?!0:IK(function*(){if(!t.current)return!0;const{http:a,type:l}=t.current;for(;;){if((yield*SK(()=>n(a))).healthy)return!0;if(r()==="background"||l==="http")return!1}}).pipe(EK({duration:"10 seconds",orElse:()=>_K(!1)}),TK(CK(()=>i("background"))),$K));return C(Ce,{get when(){return it(()=>r()==="blocking")()?!o.loading:o.state!=="pending"},get fallback(){return(()=>{var a=i0e();return X(a,C(Y9,{class:"w-16 h-20 opacity-50 animate-pulse"})),a})()},get children(){return C(Ce,{get when(){return o()},get fallback(){return C(w0e,{onRetry:()=>{r()==="background"&&s.refetch()},onServerSelected:a=>{i("blocking"),t.setActive(a),s.refetch()}})},get children(){return e.children}})}})}function w0e(e){const t=En(),n=Rl(),r=()=>n.list.filter(l=>Ri.key(l)!==n.key),i=q(()=>n.name||n.key),o="\0server\0",s=q(()=>t.t("app.server.unreachable",{server:o}).split(o)),a=setInterval(()=>e.onRetry?.(),1e3);return ae(()=>clearInterval(a)),(()=>{var l=s0e(),c=l.firstChild,u=c.firstChild,d=u.firstChild,f=u.nextSibling;return X(c,C(Y9,{class:"w-12 h-15 mb-4"}),u),X(u,()=>s()[0],d),X(d,i),X(u,()=>s()[1],null),X(f,()=>t.t("app.server.retrying")),X(l,C(Ce,{get when(){return r().length>0},get children(){var h=o0e(),m=h.firstChild,p=m.nextSibling;return X(m,()=>t.t("app.server.otherServers")),X(p,C(zi,{get each(){return r()},children:g=>{const b=Ri.key(g);return(()=>{var v=a0e(),y=v.firstChild;return v.$$click=()=>e.onServerSelected?.(b),X(y,()=>m$(g)),v})()}})),h}}),null),l})()}function k0e(e){const t=Rl();return C(Ce,{get when(){return t.key},keyed:!0,get children(){return e.children}})}function x0e(e){return C(jne,{get defaultServer(){return e.defaultServer},get disableHealthCheck(){return e.disableHealthCheck},get servers(){return e.servers},get children(){return C(y0e,{get disableHealthCheck(){return e.disableHealthCheck},get children(){return C(k0e,{get children(){return C(Hne,{get children(){return C(Sre,{get children(){return C(Q7,{get component(){return e.router??yW},root:t=>C(v0e,{get appChildren(){return e.children},get children(){return t.children}}),get children(){return[C(Fd,{path:"/",component:l0e}),C(Fd,{path:"/:dir",component:Pae,get children(){return[C(Fd,{path:"/",component:f0e}),C(Fd,{path:"/session/:id?",component:d0e})]}})]}})}})}})}})}})}})}Jr(["click"]);const S0e="1.4.2",_0e={version:S0e},vM="duckmind.settings.dat:defaultServerUrl",C0e=e=>{if(typeof localStorage>"u")return null;try{return localStorage.getItem(e)}catch{return null}},I0e=(e,t)=>{if(!(typeof localStorage>"u"))try{if(t!==null){localStorage.setItem(e,t);return}localStorage.removeItem(e)}catch{return}},bM=()=>C0e(vM),E0e=e=>I0e(vM,e),T0e=async(e,t,n)=>{if(!("Notification"in window)||(Notification.permission==="default"?await Notification.requestPermission().catch(()=>"denied"):Notification.permission)!=="granted"||document.visibilityState==="visible"&&document.hasFocus())return;const o=new Notification(e,{body:t??"",icon:"https://duckmind.ai/favicon-96x96-v3.png"});o.onclick=()=>{sue(n),o.close()}},$0e=e=>{window.open(e,"_blank")},L0e=()=>{window.history.back()},A0e=()=>{window.history.forward()},M0e=async()=>{window.location.reload()},F7=document.getElementById("root"),yM=()=>location.hostname.includes("duckmind.ai")?"http://localhost:4096":location.origin,D0e=()=>{const e=bM();return e||yM()},O0e={platform:"web",version:_0e.version,openLink:$0e,back:L0e,forward:A0e,restart:M0e,notify:T0e,getDefaultServer:async()=>{const e=bM();return e?Ri.Key.make(e):null},setDefaultServer:E0e};if(F7 instanceof HTMLElement){const e={type:"http",http:{url:yM()}};xD(()=>C(DK,{value:O0e,get children(){return C(b0e,{get children(){return C(x0e,{get defaultServer(){return Ri.Key.make(D0e())},servers:[e],disableHealthCheck:!0})}})}}),F7)}export{Wl as $,x5 as A,rn as B,rt as C,Ge as D,Kt as E,zi as F,pr as G,Mn as H,ur as I,et as J,oa as K,Cq as L,Fr as M,Fs as N,Nt as O,Mo as P,sa as Q,pt as R,Y0 as S,hk as T,gk as U,fk as V,wt as W,Je as X,xn as Y,yt as Z,Ci as _,jl as a,ghe as a$,X0 as a0,_i as a1,Ce as a2,ia as a3,dn as a4,Gn as a5,Bi as a6,ku as a7,Wr as a8,Y7 as a9,X0e as aA,xl as aB,d0 as aC,Cr as aD,Jr as aE,Os as aF,vt as aG,Xn as aH,V4 as aI,wq as aJ,xhe as aK,AA as aL,wae as aM,Wh as aN,ihe as aO,phe as aP,d5 as aQ,Rre as aR,Ihe as aS,U4 as aT,_he as aU,cf as aV,Oc as aW,At as aX,K1 as aY,Bse as aZ,cY as a_,O as aa,A4 as ab,dD as ac,u_ as ad,Che as ae,bo as af,Nn as ag,Sn as ah,Jt as ai,lde as aj,VA as ak,Bt as al,$r as am,bv as an,yn as ao,mce as ap,oce as aq,ace as ar,r2 as as,pce as at,oA as au,cn as av,HA as aw,jA as ax,FA as ay,$t as az,$o as b,hhe as b$,Wo as b0,mhe as b1,wv as b2,cv as b3,uae as b4,lhe as b5,R0e as b6,bu as b7,jfe as b8,Ffe as b9,Au as bA,UA as bB,He as bC,Vue as bD,Kfe as bE,yu as bF,Q0e as bG,nhe as bH,ehe as bI,xD as bJ,rhe as bK,Ye as bL,qB as bM,the as bN,xv as bO,IA as bP,_A as bQ,EA as bR,Ahe as bS,LA as bT,TA as bU,Nae as bV,W0 as bW,bs as bX,aS as bY,eY as bZ,R1 as b_,gce as ba,Ufe as bb,aM as bc,Xu as bd,Hfe as be,Vfe as bf,pO as bg,lM as bh,sM as bi,rk as bj,ce as bk,oM as bl,K0 as bm,tk as bn,The as bo,cue as bp,Mhe as bq,ude as br,Q7 as bs,pg as bt,n3 as bu,J0e as bv,N0e as bw,Al as bx,z0e as by,Nl as bz,Q0 as c,iS as c0,$he as c1,Lhe as c2,ohe as c3,zc as c4,W1 as c5,qne as c6,L4 as c7,h$ as c8,Nne as c9,fhe as cA,dhe as cB,She as cC,lv as cD,Fp as cE,Gse as cF,ode as cG,zre as cH,Ri as ca,Ct as cb,Ku as cc,PB as cd,Hn as ce,V0 as cf,a7 as cg,m$ as ch,zD as ci,kg as cj,VD as ck,Df as cl,An as cm,Lo as cn,rce as co,dO as cp,j0e as cq,Xle as cr,J0 as cs,ece as ct,ao as cu,Bae as cv,sce as cw,uhe as cx,tY as cy,che as cz,ua as d,Rl as e,En as f,q as g,C as h,X as i,Ve as j,Ft as k,mt as l,it as m,qe as n,mB as o,re as p,Yt as q,UD as r,ae as s,me as t,Qr as u,pe as v,we as w,Pt as x,Zr as y,ie as z};
|
|
2423
|
+
${l}`)});async function o(){t.checkUpdate&&(i("checking",!0),await t.checkUpdate().then(a=>{i("actionError",void 0),a.updateAvailable&&a.version&&i("version",a.version)}).catch(a=>{i("actionError",ff(a,n.t))}).finally(()=>{i("checking",!1)}))}async function s(){!t.update||!t.restart||await t.update().then(()=>t.restart()).then(()=>i("actionError",void 0)).catch(a=>{i("actionError",ff(a,n.t))})}return(()=>{var a=Yfe(),l=a.firstChild,c=l.firstChild,u=c.firstChild,d=u.nextSibling,f=c.nextSibling,h=f.nextSibling,m=h.firstChild,p=m.firstChild,g=p.firstChild;return X(l,C(Cq,{class:"w-58.5 opacity-12 shrink-0"}),c),X(u,()=>n.t("error.page.title")),X(d,()=>n.t("error.page.description")),X(l,C(Kfe,{get value(){return ff(e.error,n.t)},readOnly:!0,copyable:!0,multiline:!0,class:"max-h-96 w-full font-mono text-xs no-scrollbar",get label(){return n.t("error.page.details.label")},hideLabel:!0}),f),X(f,C(rn,{size:"large",get onClick(){return t.restart},get children(){return n.t("error.page.action.restart")}}),null),X(f,C(Ce,{get when(){return t.checkUpdate},get children(){return C(Ce,{get when(){return r.version},get fallback(){return C(rn,{size:"large",variant:"ghost",onClick:o,get disabled(){return r.checking},get children(){return it(()=>!!r.checking)()?n.t("error.page.action.checking"):n.t("error.page.action.checkUpdates")}})},get children(){return C(rn,{size:"large",onClick:s,get children(){return n.t("error.page.action.updateTo",{version:r.version??""})}})}})}}),null),X(l,C(Ce,{get when(){return r.actionError},children:b=>(()=>{var v=Jfe();return X(v,b),v})()}),h),X(m,()=>n.t("error.page.report.prefix"),p),p.$$click=()=>t.openLink("https://duckmind.ai/desktop-feedback"),X(g,()=>n.t("error.page.report.discord")),X(p,C(ur,{name:"discord",class:"text-text-interactive-base"}),null),X(h,C(Ce,{get when(){return t.version},children:b=>(()=>{var v=Xfe();return X(v,()=>n.t("error.page.version",{version:b()})),v})()}),null),a})()};Jr(["click"]);var r0e=me("<div class=size-full>"),i0e=me('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base">'),o0e=me('<div class="flex flex-col gap-2 w-full max-w-sm"><span class="text-12-regular text-text-base text-center"></span><div class="flex flex-col gap-1 bg-surface-base rounded-lg p-2">'),s0e=me('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base gap-6 p-6"><div class="flex flex-col items-center max-w-md text-center"><p class="text-14-regular text-text-base"><span class="text-text-strong font-medium"></span></p><p class="mt-1 text-12-regular text-text-weak">'),a0e=me('<button type=button class="flex items-center gap-3 w-full px-3 py-2 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><span class="text-14-regular text-text-strong truncate">');const l0e=Y7(()=>O(()=>import("./home-Dg1i_caj.js"),__vite__mapDeps([109,107,108,98,101,102,103]))),gM=()=>O(()=>import("./session-1j7GgbCJ.js").then(e=>e.s),__vite__mapDeps([110,103,105,98,99,108])),c0e=Y7(gM),u0e=()=>r0e();typeof location=="object"&&/\/session(?:\/|$)/.test(location.pathname)&&gM();const d0e=()=>C(g0e,{get children(){return C(c0e,{})}}),f0e=()=>C(kW,{href:"session"});function h0e(e){const t=En();return C(YO,{get value(){return{locale:t.intl,t:t.t}},get children(){return e.children}})}function m0e(e){const t=new tG;return C(QW,{client:t,get children(){return e.children}})}function p0e(e){return C(nY,{get children(){return C(aae,{get children(){return C(Ure,{get children(){return C(tae,{get children(){return C(Zse,{get children(){return C(lY,{get children(){return C(xie,{get children(){return C(zfe,{get children(){return e.children}})}})}})}})}})}})}})}})}function g0e(e){return C(Eae,{get children(){return C(oie,{get children(){return C(bae,{get children(){return C(bY,{get children(){return e.children}})}})}})}})}function v0e(e){return C(p0e,{get children(){return C(dD,{get fallback(){return C(u0e,{})},get children(){return[it(()=>e.appChildren),it(()=>e.children)]}})}})}function b0e(e){return C(Uq,{get children(){return[C(kq,{}),C(jq,{onThemeApplied:(t,n)=>{window.api?.setTitlebar?.({mode:n})},get children(){return C(ZK,{get locale(){return e.locale},get children(){return C(h0e,{get children(){return C(cD,{fallback:t=>C(n0e,{error:t}),get children(){return C(m0e,{get children(){return C(GO,{get children(){return C(aB,{get children(){return C(RD,{component:wq,get children(){return e.children}})}})}})}})}})}})}})}})]}})}function y0e(e){const t=Rl(),n=h$(),[r,i]=we("blocking"),[o,s]=xl(()=>e.disableHealthCheck?!0:IK(function*(){if(!t.current)return!0;const{http:a,type:l}=t.current;for(;;){if((yield*SK(()=>n(a))).healthy)return!0;if(r()==="background"||l==="http")return!1}}).pipe(EK({duration:"10 seconds",orElse:()=>_K(!1)}),TK(CK(()=>i("background"))),$K));return C(Ce,{get when(){return it(()=>r()==="blocking")()?!o.loading:o.state!=="pending"},get fallback(){return(()=>{var a=i0e();return X(a,C(Y9,{class:"w-16 h-20 opacity-50 animate-pulse"})),a})()},get children(){return C(Ce,{get when(){return o()},get fallback(){return C(w0e,{onRetry:()=>{r()==="background"&&s.refetch()},onServerSelected:a=>{i("blocking"),t.setActive(a),s.refetch()}})},get children(){return e.children}})}})}function w0e(e){const t=En(),n=Rl(),r=()=>n.list.filter(l=>Ri.key(l)!==n.key),i=q(()=>n.name||n.key),o="\0server\0",s=q(()=>t.t("app.server.unreachable",{server:o}).split(o)),a=setInterval(()=>e.onRetry?.(),1e3);return ae(()=>clearInterval(a)),(()=>{var l=s0e(),c=l.firstChild,u=c.firstChild,d=u.firstChild,f=u.nextSibling;return X(c,C(Y9,{class:"w-12 h-15 mb-4"}),u),X(u,()=>s()[0],d),X(d,i),X(u,()=>s()[1],null),X(f,()=>t.t("app.server.retrying")),X(l,C(Ce,{get when(){return r().length>0},get children(){var h=o0e(),m=h.firstChild,p=m.nextSibling;return X(m,()=>t.t("app.server.otherServers")),X(p,C(zi,{get each(){return r()},children:g=>{const b=Ri.key(g);return(()=>{var v=a0e(),y=v.firstChild;return v.$$click=()=>e.onServerSelected?.(b),X(y,()=>m$(g)),v})()}})),h}}),null),l})()}function k0e(e){const t=Rl();return C(Ce,{get when(){return t.key},keyed:!0,get children(){return e.children}})}function x0e(e){return C(jne,{get defaultServer(){return e.defaultServer},get disableHealthCheck(){return e.disableHealthCheck},get servers(){return e.servers},get children(){return C(y0e,{get disableHealthCheck(){return e.disableHealthCheck},get children(){return C(k0e,{get children(){return C(Hne,{get children(){return C(Sre,{get children(){return C(Q7,{get component(){return e.router??yW},root:t=>C(v0e,{get appChildren(){return e.children},get children(){return t.children}}),get children(){return[C(Fd,{path:"/",component:l0e}),C(Fd,{path:"/:dir",component:Pae,get children(){return[C(Fd,{path:"/",component:f0e}),C(Fd,{path:"/session/:id?",component:d0e})]}})]}})}})}})}})}})}})}Jr(["click"]);const S0e="1.4.3",_0e={version:S0e},vM="duckmind.settings.dat:defaultServerUrl",C0e=e=>{if(typeof localStorage>"u")return null;try{return localStorage.getItem(e)}catch{return null}},I0e=(e,t)=>{if(!(typeof localStorage>"u"))try{if(t!==null){localStorage.setItem(e,t);return}localStorage.removeItem(e)}catch{return}},bM=()=>C0e(vM),E0e=e=>I0e(vM,e),T0e=async(e,t,n)=>{if(!("Notification"in window)||(Notification.permission==="default"?await Notification.requestPermission().catch(()=>"denied"):Notification.permission)!=="granted"||document.visibilityState==="visible"&&document.hasFocus())return;const o=new Notification(e,{body:t??"",icon:"https://duckmind.ai/favicon-96x96-v3.png"});o.onclick=()=>{sue(n),o.close()}},$0e=e=>{window.open(e,"_blank")},L0e=()=>{window.history.back()},A0e=()=>{window.history.forward()},M0e=async()=>{window.location.reload()},F7=document.getElementById("root"),yM=()=>location.hostname.includes("duckmind.ai")?"http://localhost:4096":location.origin,D0e=()=>{const e=bM();return e||yM()},O0e={platform:"web",version:_0e.version,openLink:$0e,back:L0e,forward:A0e,restart:M0e,notify:T0e,getDefaultServer:async()=>{const e=bM();return e?Ri.Key.make(e):null},setDefaultServer:E0e};if(F7 instanceof HTMLElement){const e={type:"http",http:{url:yM()}};xD(()=>C(DK,{value:O0e,get children(){return C(b0e,{get children(){return C(x0e,{get defaultServer(){return Ri.Key.make(D0e())},servers:[e],disableHealthCheck:!0})}})}}),F7)}export{Wl as $,x5 as A,rn as B,rt as C,Ge as D,Kt as E,zi as F,pr as G,Mn as H,ur as I,et as J,oa as K,Cq as L,Fr as M,Fs as N,Nt as O,Mo as P,sa as Q,pt as R,Y0 as S,hk as T,gk as U,fk as V,wt as W,Je as X,xn as Y,yt as Z,Ci as _,jl as a,ghe as a$,X0 as a0,_i as a1,Ce as a2,ia as a3,dn as a4,Gn as a5,Bi as a6,ku as a7,Wr as a8,Y7 as a9,X0e as aA,xl as aB,d0 as aC,Cr as aD,Jr as aE,Os as aF,vt as aG,Xn as aH,V4 as aI,wq as aJ,xhe as aK,AA as aL,wae as aM,Wh as aN,ihe as aO,phe as aP,d5 as aQ,Rre as aR,Ihe as aS,U4 as aT,_he as aU,cf as aV,Oc as aW,At as aX,K1 as aY,Bse as aZ,cY as a_,O as aa,A4 as ab,dD as ac,u_ as ad,Che as ae,bo as af,Nn as ag,Sn as ah,Jt as ai,lde as aj,VA as ak,Bt as al,$r as am,bv as an,yn as ao,mce as ap,oce as aq,ace as ar,r2 as as,pce as at,oA as au,cn as av,HA as aw,jA as ax,FA as ay,$t as az,$o as b,hhe as b$,Wo as b0,mhe as b1,wv as b2,cv as b3,uae as b4,lhe as b5,R0e as b6,bu as b7,jfe as b8,Ffe as b9,Au as bA,UA as bB,He as bC,Vue as bD,Kfe as bE,yu as bF,Q0e as bG,nhe as bH,ehe as bI,xD as bJ,rhe as bK,Ye as bL,qB as bM,the as bN,xv as bO,IA as bP,_A as bQ,EA as bR,Ahe as bS,LA as bT,TA as bU,Nae as bV,W0 as bW,bs as bX,aS as bY,eY as bZ,R1 as b_,gce as ba,Ufe as bb,aM as bc,Xu as bd,Hfe as be,Vfe as bf,pO as bg,lM as bh,sM as bi,rk as bj,ce as bk,oM as bl,K0 as bm,tk as bn,The as bo,cue as bp,Mhe as bq,ude as br,Q7 as bs,pg as bt,n3 as bu,J0e as bv,N0e as bw,Al as bx,z0e as by,Nl as bz,Q0 as c,iS as c0,$he as c1,Lhe as c2,ohe as c3,zc as c4,W1 as c5,qne as c6,L4 as c7,h$ as c8,Nne as c9,fhe as cA,dhe as cB,She as cC,lv as cD,Fp as cE,Gse as cF,ode as cG,zre as cH,Ri as ca,Ct as cb,Ku as cc,PB as cd,Hn as ce,V0 as cf,a7 as cg,m$ as ch,zD as ci,kg as cj,VD as ck,Df as cl,An as cm,Lo as cn,rce as co,dO as cp,j0e as cq,Xle as cr,J0 as cs,ece as ct,ao as cu,Bae as cv,sce as cw,uhe as cx,tY as cy,che as cz,ua as d,Rl as e,En as f,q as g,C as h,X as i,Ve as j,Ft as k,mt as l,it as m,qe as n,mB as o,re as p,Yt as q,UD as r,ae as s,me as t,Qr as u,pe as v,we as w,Pt as x,Zr as y,ie as z};
|