@nextclaw/ui 0.15.19 → 0.15.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/assets/api-CHo2gekJ.js +13 -0
- package/dist/assets/app-presenter-provider-2_DmWYT9.js +108 -0
- package/dist/assets/appearance-settings-page-BEy2UE7R.js +1 -0
- package/dist/assets/{book-open-HtUSPwoS.js → book-open-BrZL4o9L.js} +1 -1
- package/dist/assets/card-B5rRLu_6.js +1 -0
- package/dist/assets/{channels-list-page-Bspr1Jp4.js → channels-list-page-C1dnm68I.js} +2 -2
- package/dist/assets/chat-page-Dz6tvZ91.js +1 -0
- package/dist/assets/config-split-page-6y6W6dz4.js +1 -0
- package/dist/assets/confirm-dialog-q1CpEmR8.js +5 -0
- package/dist/assets/desktop-update-config-DrdlwP4j.js +1 -0
- package/dist/assets/{dist-CZx9Q6jc.js → dist-C9EX46wM.js} +1 -1
- package/dist/assets/doc-browser-BfttDSti.js +1 -0
- package/dist/assets/{doc-browser-B4l0Xu7u.js → doc-browser-DH-3hDnI.js} +1 -1
- package/dist/assets/{doc-browser-context-Dy7EhLI8.js → doc-browser-context-TU2heon0.js} +1 -1
- package/dist/assets/{eye-DU7p1-7X.js → eye-B-3dyZNA.js} +1 -1
- package/dist/assets/form-actions-DvvxCpL4.js +1 -0
- package/dist/assets/index-CXDPLDFD.css +1 -0
- package/dist/assets/index-k_eWScvN.js +2 -0
- package/dist/assets/loader-circle-B35NlHTI.js +1 -0
- package/dist/assets/logo-badge-DB51c0cS.js +1 -0
- package/dist/assets/mcp-marketplace-page-CkPtwPBk.js +1 -0
- package/dist/assets/{mcp-marketplace-page-Dg03SZX1.js → mcp-marketplace-page-DWtsIqml.js} +3 -3
- package/dist/assets/{model-config-page-DOBqLZoQ.js → model-config-page-D6cGNnMM.js} +1 -1
- package/dist/assets/{navigation-link-Ct6xtnVM.js → navigation-link-BSJEUiwD.js} +1 -1
- package/dist/assets/plus-BRVe5jSJ.js +1 -0
- package/dist/assets/{popover-C2oIpGBF.js → popover-Bp9IpE_N.js} +1 -1
- package/dist/assets/provider-scoped-model-input-dk7fz9NL.js +1 -0
- package/dist/assets/{providers-config-page-BAVPJKpx.js → providers-config-page-DTP2YfxA.js} +1 -1
- package/dist/assets/react-D6ShNq95.js +8 -0
- package/dist/assets/{refresh-cw-BZ8giusN.js → refresh-cw-C2e94pmp.js} +1 -1
- package/dist/assets/remote-FllhXW3o.js +1 -0
- package/dist/assets/rotate-cw-CTC-Qszi.js +1 -0
- package/dist/assets/runtime-config-page-C57OLdPm.js +1 -0
- package/dist/assets/{save-CSzFGRse.js → save-CkwDOgvt.js} +1 -1
- package/dist/assets/{search-BmSWsiG2.js → search-CLXM2reO.js} +1 -1
- package/dist/assets/{search-config-page-CrL1pUzy.js → search-config-page-tnJXaaSr.js} +1 -1
- package/dist/assets/{secrets-config-page-BlgsD0-L.js → secrets-config-page-DQ_Curaj.js} +1 -1
- package/dist/assets/security-config-S00DjFfO.js +1 -0
- package/dist/assets/{select-CklWb6Rs.js → select-CNFBf00l.js} +1 -1
- package/dist/assets/{settings-2-BSZf8327.js → settings-2-B9IT2HGd.js} +1 -1
- package/dist/assets/skeleton-Dc06gatK.js +1 -0
- package/dist/assets/{tabs-Cah5klko.js → tabs-BuNr8LSO.js} +1 -1
- package/dist/assets/{tag-chip-DcrirDgN.js → tag-chip-CDkB5smU.js} +1 -1
- package/dist/assets/{trash-2-BLQOULWD.js → trash-2-GchaJuEM.js} +1 -1
- package/dist/assets/{use-config-CuFIsUVG.js → use-config-C69rR15i.js} +1 -1
- package/dist/assets/use-confirm-dialog-DF_EgPYx.js +1 -0
- package/dist/assets/{use-viewport-layout-DU29bUJS.js → use-viewport-layout-BACNZyMY.js} +1 -1
- package/dist/assets/x-BXFquY9e.js +1 -0
- package/dist/index.html +28 -28
- package/package.json +9 -9
- package/src/app/components/__tests__/app-notification-runtime.test.tsx +32 -0
- package/src/app/components/app-notification-runtime.tsx +15 -0
- package/src/app/components/layout/sidebar-items.tsx +23 -9
- package/src/app/configs/app-navigation.config.ts +21 -0
- package/src/app/index.tsx +22 -2
- package/src/app/presenters/app.presenter.ts +8 -0
- package/src/features/chat/components/layout/chat-page-shell.tsx +7 -2
- package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +12 -0
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-run-queue.test.tsx +28 -0
- package/src/features/chat/features/conversation/hooks/use-session-run-queue.ts +4 -5
- package/src/features/chat/features/input/hooks/__tests__/use-chat-input-surface-state.test.tsx +13 -0
- package/src/features/chat/features/input/hooks/use-chat-input-surface-state.ts +31 -8
- package/src/features/chat/features/input/input-surface-plugins/__tests__/context-reference-plugin.test.ts +79 -9
- package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +16 -4
- package/src/features/chat/features/input/input-surface-plugins/chat-input-product-plugin-adapters.types.ts +10 -2
- package/src/features/chat/features/input/input-surface-plugins/context-reference-items.utils.ts +240 -0
- package/src/features/chat/features/input/input-surface-plugins/context-reference-plugin.utils.ts +62 -173
- package/src/features/chat/features/input/utils/__tests__/chat-inline-token.utils.test.ts +29 -0
- package/src/features/chat/features/input/utils/chat-composer-token-protocol.utils.ts +5 -0
- package/src/features/chat/features/input/utils/chat-inline-token.utils.ts +26 -5
- package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +12 -1
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +9 -5
- package/src/features/chat/index.ts +1 -0
- package/src/features/chat/managers/__tests__/chat-completion-notification.manager.test.ts +177 -0
- package/src/features/chat/managers/chat-completion-notification.manager.ts +146 -0
- package/src/features/chat/pages/__tests__/ncp-chat-page.test.ts +26 -0
- package/src/features/chat/pages/__tests__/ncp-chat-page.test.tsx +29 -2
- package/src/features/chat/pages/ncp-chat-page.tsx +9 -0
- package/src/features/inbox/components/inbox-delivery-content.test.tsx +57 -0
- package/src/features/inbox/components/inbox-delivery-content.tsx +118 -0
- package/src/features/inbox/components/inbox-reader-dialog.test.tsx +77 -0
- package/src/features/inbox/components/inbox-reader-dialog.tsx +224 -0
- package/src/features/inbox/components/inbox-runtime.tsx +14 -0
- package/src/features/inbox/hooks/use-inbox-deliveries.ts +14 -0
- package/src/features/inbox/index.ts +7 -0
- package/src/features/inbox/managers/inbox.manager.test.ts +86 -0
- package/src/features/inbox/managers/inbox.manager.ts +178 -0
- package/src/features/inbox/pages/inbox-page.test.ts +28 -0
- package/src/features/inbox/pages/inbox-page.tsx +385 -0
- package/src/features/inbox/stores/inbox.store.ts +23 -0
- package/src/features/notifications/components/__tests__/app-notification-toast.test.tsx +48 -0
- package/src/features/notifications/components/app-notification-toast.tsx +80 -0
- package/src/features/notifications/index.ts +8 -0
- package/src/features/notifications/managers/__tests__/app-notification.manager.test.ts +75 -0
- package/src/features/notifications/managers/app-notification.manager.ts +41 -0
- package/src/platforms/mobile/components/mobile-bottom-nav.tsx +14 -7
- package/src/shared/hooks/use-projects.ts +2 -1
- package/src/shared/lib/i18n/index.ts +4 -0
- package/src/shared/lib/i18n/locales/en-US/chat.json +16 -4
- package/src/shared/lib/i18n/locales/en-US/inbox.json +30 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +16 -4
- package/src/shared/lib/i18n/locales/zh-CN/inbox.json +30 -0
- package/dist/assets/api-O5yEgzBt.js +0 -13
- package/dist/assets/app-presenter-provider-DXTYtH78.js +0 -106
- package/dist/assets/appearance-settings-page-BuGxSvlJ.js +0 -1
- package/dist/assets/card-GkBc-UMw.js +0 -1
- package/dist/assets/chat-page-BKQ89f4s.js +0 -1
- package/dist/assets/config-split-page-CvLXSFSC.js +0 -1
- package/dist/assets/confirm-dialog-BVH7haN0.js +0 -5
- package/dist/assets/desktop-update-config-C9ZUI8UW.js +0 -1
- package/dist/assets/doc-browser-DsVF1DrS.js +0 -1
- package/dist/assets/form-actions-aM9_jSJC.js +0 -1
- package/dist/assets/index-6pHX0DZH.js +0 -2
- package/dist/assets/index-DN6KM7WD.css +0 -1
- package/dist/assets/loader-circle-Dd6jw700.js +0 -1
- package/dist/assets/logo-badge-2-iV1pkr.js +0 -1
- package/dist/assets/mcp-marketplace-page-C-d0RMfg.js +0 -1
- package/dist/assets/plus-CsgeRId8.js +0 -1
- package/dist/assets/provider-scoped-model-input-DDqCdnTU.js +0 -1
- package/dist/assets/react-CeMr9V52.js +0 -8
- package/dist/assets/remote-C-r0SHcz.js +0 -1
- package/dist/assets/rotate-cw-DVdRfMSO.js +0 -1
- package/dist/assets/runtime-config-page-D0244uxJ.js +0 -1
- package/dist/assets/security-config-cDrdpMJW.js +0 -1
- package/dist/assets/skeleton-DG9u1BmA.js +0 -1
- package/dist/assets/use-confirm-dialog-CcySmkWp.js +0 -1
- package/dist/assets/x-BVoeXny1.js +0 -1
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-D0Q77r9I.js","assets/preload-helper-D4M6sveU.js","assets/chunk-HOUHSVGY-Bd0FnbWZ.js","assets/src-DKf77Yzo.js","assets/chunk-DseTPa7n.js","assets/chunk-Y2CYZVJY-pTllD0P3.js","assets/chunk-WYO6CB5R-Bk2HeDvJ.js","assets/chunk-ICXQ74PX-ntNwAm4_.js","assets/dist-IgNNB7K9.js","assets/chunk-Q4XR5HBZ-CjPy94Lz.js","assets/chunk-52WLFC77-Ddx68Xzx.js","assets/line-BM7PoxY5.js","assets/path-DB0USYHi.js","assets/array-CAkJT3no.js","assets/chunk-7BUUIJ7U-B7o-mn4r.js","assets/chunk-C7G6YPKG-C6tosszM.js","assets/chunk-OGEWGWER-DOFWVw3O.js","assets/chunk-ZGVPDNZ5-70JdIGo0.js","assets/rough.esm-B1B52ZQS.js","assets/chunk-FWX5IMBZ-DOObDWbf.js","assets/chunk-VAUOI2AC-BRvqNW76.js","assets/chunk-ZIRB5QZD-XZdgBt5L.js","assets/docx-preview-D0tp3a9T.js","assets/jszip.min-Das2IAnb.js","assets/aiden0z-pptx-renderer.es-Bd99vut2.js","assets/doc-browser-DsVF1DrS.js","assets/doc-browser-B4l0Xu7u.js","assets/dist-CZx9Q6jc.js","assets/react-CeMr9V52.js","assets/popover-C2oIpGBF.js","assets/search-BmSWsiG2.js","assets/navigation-link-Ct6xtnVM.js","assets/host-capabilities-B-TtABsP.js","assets/plus-CsgeRId8.js","assets/refresh-cw-BZ8giusN.js","assets/x-BVoeXny1.js","assets/doc-browser-context-Dy7EhLI8.js","assets/middleware-Df-a4x-q.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,n as t,t as n}from"./chunk-DseTPa7n.js";import{C as r,D as i,E as a,O as o,T as s,_ as c,a as l,b as u,d,f,g as p,h as m,i as h,m as g,n as _,o as v,p as y,r as b,t as x,u as S,v as C,w,x as T,y as E}from"./react-CeMr9V52.js";import{t as D}from"./preload-helper-D4M6sveU.js";import{$t as O,At as k,C as A,Ct as ee,D as j,E as M,Gt as N,Ht as te,It as ne,Jt as re,K as ie,Kt as ae,Nt as oe,O as se,Pt as ce,Qt as le,Rt as ue,S as de,T as fe,Tt as pe,U as me,Ut as he,Vt as ge,Wt as _e,X as ve,Yt as ye,Z as be,Zt as P,_ as xe,_t as Se,a as Ce,b as we,c as Te,d as Ee,f as De,g as Oe,gt as ke,h as Ae,ht as je,i as Me,jt as Ne,k as Pe,kt as Fe,l as Ie,n as Le,nt as Re,o as ze,p as Be,qt as F,r as Ve,rt as He,s as Ue,t as We,u as Ge,un as Ke,v as qe,vt as Je,w as Ye,wt as Xe,x as Ze,y as Qe,yt as $e,zt as et}from"./api-O5yEgzBt.js";import{c as I}from"./dist-CZx9Q6jc.js";import{a as tt,c as nt,i as rt,l as it,o as at,r as ot,s as st,t as ct,u as lt}from"./popover-C2oIpGBF.js";import{a as ut,c as dt,d as ft,f as pt,i as mt,l as ht,m as gt,n as _t,o as vt,p as yt,r as bt,s as xt,t as St,u as Ct}from"./confirm-dialog-BVH7haN0.js";import{n as wt,t as Tt}from"./search-BmSWsiG2.js";import{_ as Et,a as Dt,c as Ot,d as kt,f as At,g as jt,h as Mt,i as Nt,l as Pt,m as Ft,n as It,o as Lt,p as Rt,r as zt,s as Bt,u as Vt,v as Ht}from"./doc-browser-B4l0Xu7u.js";import{t as Ut}from"./book-open-HtUSPwoS.js";import{C as Wt,S as Gt,_ as Kt,a as qt,b as Jt,c as Yt,d as Xt,f as Zt,g as Qt,h as $t,i as en,l as tn,m as nn,n as rn,o as an,p as on,r as sn,s as cn,t as ln,u as un,v as dn,w as fn,x as pn,y as mn}from"./select-CklWb6Rs.js";import{a as hn,c as gn,o as _n,r as vn,s as yn,t as bn}from"./use-confirm-dialog-CcySmkWp.js";import{a as xn,i as Sn,n as Cn,o as wn,r as Tn,t as En}from"./card-GkBc-UMw.js";import{n as Dn,t as On}from"./eye-DU7p1-7X.js";import{n as kn,t as An}from"./navigation-link-Ct6xtnVM.js";import{a as jn,c as Mn,i as Nn,n as Pn,o as Fn,r as In,s as Ln,t as Rn}from"./tabs-Cah5klko.js";import{i as zn,n as Bn,r as Vn,t as Hn}from"./use-viewport-layout-DU29bUJS.js";import{t as Un}from"./loader-circle-Dd6jw700.js";import{t as Wn}from"./plus-CsgeRId8.js";import{t as Gn}from"./refresh-cw-BZ8giusN.js";import{t as Kn}from"./trash-2-BLQOULWD.js";import{t as qn}from"./x-BVoeXny1.js";import{n as Jn,t as Yn}from"./logo-badge-2-iV1pkr.js";import{t as Xn}from"./host-capabilities-B-TtABsP.js";import{n as Zn,t as Qn}from"./middleware-Df-a4x-q.js";import{_ as $n,a as er,c as tr,d as nr,g as rr,h as ir,i as ar,l as or,n as sr,o as cr,p as lr,r as ur,s as dr,u as fr,v as pr}from"./doc-browser-context-Dy7EhLI8.js";import{c as mr,n as hr,r as gr}from"./provider-models-CXUgDxGR.js";var L=e(o(),1),_r=`popstate`;function vr(e={}){let{initialEntries:t=[`/`],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((e,t)=>u(e,typeof e==`string`?null:e.state,t===0?`default`:void 0));let a=c(n??i.length-1),o=`POP`,s=null;function c(e){return Math.min(Math.max(e,0),i.length-1)}function l(){return i[a]}function u(e,t=null,n){let r=wr(i?l().pathname:`/`,e,t,n);return xr(r.pathname.charAt(0)===`/`,`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),r}function d(e){return typeof e==`string`?e:Tr(e)}return{get index(){return a},get action(){return o},get location(){return l()},createHref:d,createURL(e){return new URL(d(e),`http://localhost`)},encodeLocation(e){let t=typeof e==`string`?Er(e):e;return{pathname:t.pathname||``,search:t.search||``,hash:t.hash||``}},push(e,t){o=`PUSH`;let n=u(e,t);a+=1,i.splice(a,i.length,n),r&&s&&s({action:o,location:n,delta:1})},replace(e,t){o=`REPLACE`;let n=u(e,t);i[a]=n,r&&s&&s({action:o,location:n,delta:0})},go(e){o=`POP`;let t=c(a+e),n=i[t];a=t,s&&s({action:o,location:n,delta:e})},listen(e){return s=e,()=>{s=null}}}}function yr(e={}){function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return wr(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:Tr(t)}return Dr(t,n,null,e)}function br(e,t){if(e===!1||e==null)throw Error(t)}function xr(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Sr(){return Math.random().toString(36).substring(2,10)}function Cr(e,t){return{usr:e.state,key:e.key,idx:t}}function wr(e,t,n=null,r){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Er(t):t,state:n,key:t&&t.key||r||Sr()}}function Tr({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Er(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Dr(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=wr(h.location,e,t);n&&n(r,e),l=u()+1;let d=Cr(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=wr(h.location,e,t);n&&n(r,e),l=u();let i=Cr(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Or(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(_r,d),c=e,()=>{i.removeEventListener(_r,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Or(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),br(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:Tr(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function kr(e,t,n=`/`){return Ar(e,t,n,!1)}function Ar(e,t,n,r){let i=Jr((typeof t==`string`?Er(t):t).pathname||`/`,n);if(i==null)return null;let a=Mr(e);Pr(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=qr(i);o=Wr(a[e],t,r)}return o}function jr(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Mr(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;br(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=ni([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(br(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Mr(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Hr(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Nr(e.path))a(e,t,!0,n)}),t}function Nr(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Nr(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Pr(e){e.sort((e,t)=>e.score===t.score?Ur(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Fr=/^:[\w-]+$/,Ir=3,Lr=2,Rr=1,zr=10,Br=-2,Vr=e=>e===`*`;function Hr(e,t){let n=e.split(`/`),r=n.length;return n.some(Vr)&&(r+=Br),t&&(r+=Lr),n.filter(e=>!Vr(e)).reduce((e,t)=>e+(Fr.test(t)?Ir:t===``?Rr:zr),r)}function Ur(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Wr(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=Gr({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Gr({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:ni([a,u.pathname]),pathnameBase:ri(ni([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=ni([a,u.pathnameBase]))}return o}function Gr(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Kr(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Kr(e,t=!1,n=!0){xr(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`)).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function qr(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return xr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Jr(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var Yr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Xr(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Er(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?Zr(n.substring(1),`/`):Zr(n,t)):a=t,{pathname:a,search:ii(r),hash:ai(i)}}function Zr(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Qr(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function $r(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ei(e){let t=$r(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function ti(e,t,n,r=!1){let i;typeof e==`string`?i=Er(e):(i={...e},br(!i.pathname||!i.pathname.includes(`?`),Qr(`?`,`pathname`,`search`,i)),br(!i.pathname||!i.pathname.includes(`#`),Qr(`#`,`pathname`,`hash`,i)),br(!i.search||!i.search.includes(`#`),Qr(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Xr(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ni=e=>e.join(`/`).replace(/\/\/+/g,`/`),ri=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),ii=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ai=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,oi=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function si(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ci(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var li=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ui(e,t){let n=e;if(typeof n!=`string`||!Yr.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(li)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=Jr(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{xr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var di=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(di);var fi=[`GET`,...di];new Set(fi);var pi=L.createContext(null);pi.displayName=`DataRouter`;var mi=L.createContext(null);mi.displayName=`DataRouterState`;var hi=L.createContext(!1),gi=L.createContext({isTransitioning:!1});gi.displayName=`ViewTransition`;var _i=L.createContext(new Map);_i.displayName=`Fetchers`;var vi=L.createContext(null);vi.displayName=`Await`;var yi=L.createContext(null);yi.displayName=`Navigation`;var bi=L.createContext(null);bi.displayName=`Location`;var xi=L.createContext({outlet:null,matches:[],isDataRoute:!1});xi.displayName=`Route`;var Si=L.createContext(null);Si.displayName=`RouteError`;var Ci=`REACT_ROUTER_ERROR`,wi=`REDIRECT`,Ti=`ROUTE_ERROR_RESPONSE`;function Ei(e){if(e.startsWith(`${Ci}:${wi}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Di(e){if(e.startsWith(`${Ci}:${Ti}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new oi(t.status,t.statusText,t.data)}catch{}}function Oi(e,{relative:t}={}){br(ki(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=L.useContext(yi),{hash:i,pathname:a,search:o}=Ii(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:ni([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ki(){return L.useContext(bi)!=null}function Ai(){return br(ki(),`useLocation() may be used only in the context of a <Router> component.`),L.useContext(bi).location}var ji=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Mi(e){L.useContext(yi).static||L.useLayoutEffect(e)}function Ni(){let{isDataRoute:e}=L.useContext(xi);return e?ta():Pi()}function Pi(){br(ki(),`useNavigate() may be used only in the context of a <Router> component.`);let e=L.useContext(pi),{basename:t,navigator:n}=L.useContext(yi),{matches:r}=L.useContext(xi),{pathname:i}=Ai(),a=JSON.stringify(ei(r)),o=L.useRef(!1);return Mi(()=>{o.current=!0}),L.useCallback((r,s={})=>{if(xr(o.current,ji),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=ti(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:ni([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}L.createContext(null);function Fi(){let{matches:e}=L.useContext(xi),t=e[e.length-1];return t?t.params:{}}function Ii(e,{relative:t}={}){let{matches:n}=L.useContext(xi),{pathname:r}=Ai(),i=JSON.stringify(ei(n));return L.useMemo(()=>ti(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Li(e,t){return Ri(e,t)}function Ri(e,t,n,r,i){br(ki(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:a}=L.useContext(yi),{matches:o}=L.useContext(xi),s=o[o.length-1],c=s?s.params:{},l=s?s.pathname:`/`,u=s?s.pathnameBase:`/`,d=s&&s.route;{let e=d&&d.path||``;ra(l,!d||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3
|
-
|
|
4
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let f=Ai(),p;if(t){let e=typeof t==`string`?Er(t):t;br(u===`/`||e.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${e.pathname}" was given in the \`location\` prop.`),p=e}else p=f;let m=p.pathname||`/`,h=m;if(u!==`/`){let e=u.replace(/^\//,``).split(`/`);h=`/`+m.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let g=kr(e,{pathname:h});xr(d||g!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),xr(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=Gi(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:ni([u,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?u:ni([u,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),o,n,r,i);return t&&_?L.createElement(bi.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,...p},navigationType:`POP`}},_):_}function zi(){let e=ea(),t=si(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=L.createElement(L.Fragment,null,L.createElement(`p`,null,`💿 Hey developer 👋`),L.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,L.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,L.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),L.createElement(L.Fragment,null,L.createElement(`h2`,null,`Unexpected Application Error!`),L.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?L.createElement(`pre`,{style:i},n):null,o)}var Bi=L.createElement(zi,null),Vi=class extends L.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Di(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:L.createElement(xi.Provider,{value:this.props.routeContext},L.createElement(Si.Provider,{value:e,children:this.props.component}));return this.context?L.createElement(Ui,{error:e},t):t}};Vi.contextType=hi;var Hi=new WeakMap;function Ui({children:e,error:t}){let{basename:n}=L.useContext(yi);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ei(t.digest);if(e){let r=Hi.get(t);if(r)throw r;let i=ui(e.location,n);if(li&&!Hi.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Hi.set(t,n),n}return L.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Wi({routeContext:e,match:t,children:n}){let r=L.useContext(pi);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),L.createElement(xi.Provider,{value:e},n)}function Gi(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);br(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}let l=n&&r?(e,t)=>{r(e,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:ci(n.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,i)=>{let u,d=!1,f=null,p=null;n&&(u=o&&r.route.id?o[r.route.id]:void 0,f=r.route.errorElement||Bi,s&&(c<0&&i===0?(ra(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):c===i&&(d=!0,p=r.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,i+1)),h=()=>{let t;return t=u?f:d?p:r.route.Component?L.createElement(r.route.Component,null):r.route.element?r.route.element:e,L.createElement(Wi,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?L.createElement(Vi,{location:n.location,revalidation:n.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Ki(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qi(e){let t=L.useContext(pi);return br(t,Ki(e)),t}function Ji(e){let t=L.useContext(mi);return br(t,Ki(e)),t}function Yi(e){let t=L.useContext(xi);return br(t,Ki(e)),t}function Xi(e){let t=Yi(e),n=t.matches[t.matches.length-1];return br(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Zi(){return Xi(`useRouteId`)}function Qi(){return Ji(`useNavigation`).navigation}function $i(){let{matches:e,loaderData:t}=Ji(`useMatches`);return L.useMemo(()=>e.map(e=>jr(e,t)),[e,t])}function ea(){let e=L.useContext(Si),t=Ji(`useRouteError`),n=Xi(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ta(){let{router:e}=qi(`useNavigate`),t=Xi(`useNavigate`),n=L.useRef(!1);return Mi(()=>{n.current=!0}),L.useCallback(async(r,i={})=>{xr(n.current,ji),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var na={};function ra(e,t,n){!t&&!na[e]&&(na[e]=!0,xr(!1,n))}L.useOptimistic,L.memo(ia);function ia({routes:e,future:t,state:n,onError:r}){return Ri(e,void 0,n,r,t)}function aa({basename:e,children:t,initialEntries:n,initialIndex:r,unstable_useTransitions:i}){let a=L.useRef();a.current??=vr({initialEntries:n,initialIndex:r,v5Compat:!0});let o=a.current,[s,c]=L.useState({action:o.action,location:o.location}),l=L.useCallback(e=>{i===!1?c(e):L.startTransition(()=>c(e))},[i]);return L.useLayoutEffect(()=>o.listen(l),[o,l]),L.createElement(ca,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,unstable_useTransitions:i})}function oa({to:e,replace:t,state:n,relative:r}){br(ki(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=L.useContext(yi);xr(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=L.useContext(xi),{pathname:o}=Ai(),s=Ni(),c=ti(e,ei(a),o,r===`path`),l=JSON.stringify(c);return L.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function sa(e){br(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function ca({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){br(!ki(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=L.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Er(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`}=n,m=L.useMemo(()=>{let e=Jr(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p},navigationType:r}},[s,l,u,d,f,p,r]);return xr(m!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:L.createElement(yi.Provider,{value:c},L.createElement(bi.Provider,{children:t,value:m}))}function la({children:e,location:t}){return Li(ua(e),t)}L.Component;function ua(e,t=[]){let n=[];return L.Children.forEach(e,(e,r)=>{if(!L.isValidElement(e))return;let i=[...t,r];if(e.type===L.Fragment){n.push.apply(n,ua(e.props.children,i));return}br(e.type===sa,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),br(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=ua(e.props.children,i)),n.push(a)}),n}var da=`get`,fa=`application/x-www-form-urlencoded`;function pa(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ma(e){return pa(e)&&e.tagName.toLowerCase()===`button`}function ha(e){return pa(e)&&e.tagName.toLowerCase()===`form`}function ga(e){return pa(e)&&e.tagName.toLowerCase()===`input`}function _a(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function va(e,t){return e.button===0&&(!t||t===`_self`)&&!_a(e)}var ya=null;function ba(){if(ya===null)try{new FormData(document.createElement(`form`),0),ya=!1}catch{ya=!0}return ya}var xa=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Sa(e){return e!=null&&!xa.has(e)?(xr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${fa}"`),null):e}function Ca(e,t){let n,r,i,a,o;if(ha(e)){let o=e.getAttribute(`action`);r=o?Jr(o,t):null,n=e.getAttribute(`method`)||da,i=Sa(e.getAttribute(`enctype`))||fa,a=new FormData(e)}else if(ma(e)||ga(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Jr(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||da,i=Sa(e.getAttribute(`formenctype`))||Sa(o.getAttribute(`enctype`))||fa,a=new FormData(o,e),!ba()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(pa(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=da,r=null,i=fa,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var wa={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Ta=/[&><\u2028\u2029]/g;function Ea(e){return e.replace(Ta,e=>wa[e])}function Da(e,t){if(e===!1||e==null)throw Error(t)}function Oa(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Jr(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function ka(e,t){if(e.id in t)return t[e.id];try{let n=await D(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Aa(e){return e!=null&&typeof e.page==`string`}function ja(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ma(e,t,n){return La((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ka(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ja).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Na(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Pa(e,t,{includeHydrateFallback:n}={}){return Fa(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Fa(e){return[...new Set(e)]}function Ia(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function La(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Aa(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Ia(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ra(){let e=L.useContext(pi);return Da(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function za(){let e=L.useContext(mi);return Da(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ba=L.createContext(void 0);Ba.displayName=`FrameworkContext`;function Va(){let e=L.useContext(Ba);return Da(e,`You must render this element inside a <HydratedRouter> element`),e}function Ha(e,t){let n=L.useContext(Ba),[r,i]=L.useState(!1),[a,o]=L.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=L.useRef(null);L.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),L.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ua(s,p),onBlur:Ua(c,m),onMouseEnter:Ua(l,p),onMouseLeave:Ua(u,m),onTouchStart:Ua(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ua(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Wa({page:e,...t}){let{router:n}=Ra(),r=L.useMemo(()=>kr(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?L.createElement(Ka,{page:e,matches:r,...t}):null}function Ga(e){let{manifest:t,routeModules:n}=Va(),[r,i]=L.useState([]);return L.useEffect(()=>{let r=!1;return Ma(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ka({page:e,matches:t,...n}){let r=Ai(),{future:i,manifest:a,routeModules:o}=Va(),{basename:s}=Ra(),{loaderData:c,matches:l}=za(),u=L.useMemo(()=>Na(e,t,l,a,r,`data`),[e,t,l,a,r]),d=L.useMemo(()=>Na(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=L.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Oa(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=L.useMemo(()=>Pa(d,a),[d,a]),m=Ga(d);return L.createElement(L.Fragment,null,f.map(e=>L.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>L.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>L.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function qa(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}L.Component;var Ja=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Ja&&(window.__reactRouterVersion=`7.13.0`)}catch{}function Ya({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=L.useRef();i.current??=yr({window:r,v5Compat:!0});let a=i.current,[o,s]=L.useState({action:a.action,location:a.location}),c=L.useCallback(e=>{n===!1?s(e):L.startTransition(()=>s(e))},[n]);return L.useLayoutEffect(()=>a.listen(c),[a,c]),L.createElement(ca,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function Xa({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=L.useState({action:n.action,location:n.location}),o=L.useCallback(e=>{r===!1?a(e):L.startTransition(()=>a(e))},[r]);return L.useLayoutEffect(()=>n.listen(o),[n,o]),L.createElement(ca,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Xa.displayName=`unstable_HistoryRouter`;var Za=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qa=L.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,state:o,target:s,to:c,preventScrollReset:l,viewTransition:u,unstable_defaultShouldRevalidate:d,...f},p){let{basename:m,unstable_useTransitions:h}=L.useContext(yi),g=typeof c==`string`&&Za.test(c),_=ui(c,m);c=_.to;let v=Oi(c,{relative:r}),[y,b,x]=Ha(n,f),S=ao(c,{replace:a,state:o,target:s,preventScrollReset:l,relative:r,viewTransition:u,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h});function C(t){e&&e(t),t.defaultPrevented||S(t)}let w=L.createElement(`a`,{...f,...x,href:_.absoluteURL||v,onClick:_.isExternal||i?e:C,ref:qa(p,b),target:s,"data-discover":!g&&t===`render`?`true`:void 0});return y&&!g?L.createElement(L.Fragment,null,w,L.createElement(Wa,{page:v})):w});Qa.displayName=`Link`;var $a=L.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Ii(a,{relative:c.relative}),d=Ai(),f=L.useContext(mi),{navigator:p,basename:m}=L.useContext(yi),h=f!=null&&go(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Jr(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return L.createElement(Qa,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});$a.displayName=`NavLink`;var eo=L.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=da,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=L.useContext(yi),g=co(),_=lo(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Za.test(s);return L.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?L.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});eo.displayName=`Form`;function to({getKey:e,storageKey:t,...n}){let r=L.useContext(Ba),{basename:i}=L.useContext(yi),a=Ai(),o=$i();mo({getKey:e,storageKey:t});let s=L.useMemo(()=>{if(!r||!e)return null;let t=po(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return L.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Ea(JSON.stringify(t||uo))}, ${Ea(JSON.stringify(s))})`}})}to.displayName=`ScrollRestoration`;function no(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ro(e){let t=L.useContext(pi);return br(t,no(e)),t}function io(e){let t=L.useContext(mi);return br(t,no(e)),t}function ao(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:s,unstable_useTransitions:c}={}){let l=Ni(),u=Ai(),d=Ii(e,{relative:a});return L.useCallback(f=>{if(va(f,t)){f.preventDefault();let t=n===void 0?Tr(u)===Tr(d):n,p=()=>l(e,{replace:t,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:s});c?L.startTransition(()=>p()):p()}},[u,l,d,n,r,t,e,i,a,o,s,c])}var oo=0,so=()=>`__${String(++oo)}__`;function co(){let{router:e}=ro(`useSubmit`),{basename:t}=L.useContext(yi),n=Zi(),r=e.fetch,i=e.navigate;return L.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ca(e,t);a.navigate===!1?await r(a.fetcherKey||so(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function lo(e,{relative:t}={}){let{basename:n}=L.useContext(yi),r=L.useContext(xi);br(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Ii(e||`.`,{relative:t})},o=Ai();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:ni([n,a.pathname])),Tr(a)}var uo=`react-router-scroll-positions`,fo={};function po(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Jr(e.pathname,n)||e.pathname},t)),i??=e.key,i}function mo({getKey:e,storageKey:t}={}){let{router:n}=ro(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=io(`useScrollRestoration`),{basename:a}=L.useContext(yi),o=Ai(),s=$i(),c=Qi();L.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),ho(L.useCallback(()=>{if(c.state===`idle`){let t=po(o,s,a,e);fo[t]=window.scrollY}try{sessionStorage.setItem(t||uo,JSON.stringify(fo))}catch(e){xr(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(L.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||uo);e&&(fo=JSON.parse(e))}catch{}},[t]),L.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(fo,()=>window.scrollY,e?(t,n)=>po(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),L.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{xr(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function ho(e,t){let{capture:n}=t||{};L.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function go(e,{relative:t}={}){let n=L.useContext(gi);br(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ro(`useViewTransitionState`),i=Ii(e,{relative:t});if(!n.isTransitioning)return!1;let a=Jr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Jr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Gr(i.pathname,o)!=null||Gr(i.pathname,a)!=null}var _o=I(`AlarmClock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),vo=I(`AppWindow`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),yo=I(`ArrowDown`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),bo=I(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),xo=I(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),So=I(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Co=I(`Braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),wo=I(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),To=I(`Brain`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`,key:`ep3f8r`}],[`path`,{d:`M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4`,key:`1p4c4q`}],[`path`,{d:`M17.599 6.5a3 3 0 0 0 .399-1.375`,key:`tmeiqw`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M19.938 10.5a4 4 0 0 1 .585.396`,key:`1qfode`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M19.967 17.484A4 4 0 0 1 18 18`,key:`159ez6`}]]),Eo=I(`CalendarClock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),Do=I(`CalendarDays`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Oo=I(`ChartNoAxesColumnIncreasing`,[[`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`10`,key:`1vz5eb`}],[`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`4`,key:`cun8e5`}],[`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`16`,key:`hq0ia6`}]]),ko=I(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ao=I(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),jo=I(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Mo=I(`CircleDashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),No=I(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Po=I(`CirclePause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Fo=I(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),Io=I(`Cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Lo=I(`CodeXml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Ro=I(`Command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),zo=I(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Bo=I(`CornerDownRight`,[[`polyline`,{points:`15 10 20 15 15 20`,key:`1q7qjw`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),Vo=I(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]),Ho=I(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Uo=I(`Expand`,[[`path`,{d:`m21 21-6-6m6 6v-4.8m0 4.8h-4.8`,key:`1c15vz`}],[`path`,{d:`M3 16.2V21m0 0h4.8M3 21l6-6`,key:`1fsnz2`}],[`path`,{d:`M21 7.8V3m0 0h-4.8M21 3l-6 6`,key:`hawz9i`}],[`path`,{d:`M3 7.8V3m0 0h4.8M3 3l6 6`,key:`u9ee12`}]]),Wo=I(`FileArchive`,[[`path`,{d:`M10 12v-1`,key:`v7bkov`}],[`path`,{d:`M10 18v-2`,key:`1cjy8d`}],[`path`,{d:`M10 7V6`,key:`dljcrl`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01`,key:`gkbcor`}],[`circle`,{cx:`10`,cy:`20`,r:`2`,key:`1xzdoj`}]]),Go=I(`FileAudio2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2`,key:`17k7jt`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`3`,cy:`17`,r:`1`,key:`vo6nti`}],[`path`,{d:`M2 17v-3a4 4 0 0 1 8 0v3`,key:`1ggdre`}],[`circle`,{cx:`9`,cy:`17`,r:`1`,key:`bc1fq4`}]]),Ko=I(`FileCode2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),qo=I(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Jo=I(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),Yo=I(`FileSpreadsheet`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),Xo=I(`FileVideo2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`rect`,{width:`8`,height:`6`,x:`2`,y:`12`,rx:`1`,key:`1a6c1e`}],[`path`,{d:`m10 15.5 4 2.5v-6l-4 2.5`,key:`t7cp39`}]]),Zo=I(`File`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}]]),Qo=I(`Files`,[[`path`,{d:`M20 7h-3a2 2 0 0 1-2-2V2`,key:`x099mo`}],[`path`,{d:`M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z`,key:`18t6ie`}],[`path`,{d:`M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8`,key:`1nja0z`}]]),$o=I(`FolderKanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),es=I(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),ts=I(`FolderPlus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),ns=I(`FolderTree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),rs=I(`FolderUp`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m9 13 3-3 3 3`,key:`1pxg3c`}]]),is=I(`FolderX`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`m9.5 10.5 5 5`,key:`ra9qjz`}],[`path`,{d:`m14.5 10.5-5 5`,key:`l2rkpq`}]]),as=I(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),os=I(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),ss=I(`Github`,[[`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`,key:`tonef`}],[`path`,{d:`M9 18c-4.51 2-5-2-7-2`,key:`9comsn`}]]),cs=I(`Grid3x3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),ls=I(`HardDrive`,[[`line`,{x1:`22`,x2:`2`,y1:`12`,y2:`12`,key:`1y58io`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}],[`line`,{x1:`6`,x2:`6.01`,y1:`16`,y2:`16`,key:`sgf278`}],[`line`,{x1:`10`,x2:`10.01`,y1:`16`,y2:`16`,key:`1l4acy`}]]),us=I(`Heart`,[[`path`,{d:`M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z`,key:`c3ymky`}]]),ds=I(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),fs=I(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ps=I(`Languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),ms=I(`Laptop`,[[`path`,{d:`M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16`,key:`tarvll`}]]),hs=I(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),gs=I(`Lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),_s=I(`ListChecks`,[[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),vs=I(`ListTodo`,[[`rect`,{x:`3`,y:`5`,width:`6`,height:`6`,rx:`1`,key:`1defrl`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),ys=I(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),bs=I(`Maximize2`,[[`polyline`,{points:`15 3 21 3 21 9`,key:`mznyad`}],[`polyline`,{points:`9 21 3 21 3 15`,key:`1avn1i`}],[`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`,key:`ota7mn`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),xs=I(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),Ss=I(`MessageSquarePlus`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}]]),Cs=I(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),ws=I(`Minimize2`,[[`polyline`,{points:`4 14 10 14 10 20`,key:`11kfnr`}],[`polyline`,{points:`20 10 14 10 14 4`,key:`rlmsce`}],[`line`,{x1:`14`,x2:`21`,y1:`10`,y2:`3`,key:`o5lafz`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),Ts=I(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Es=I(`Monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Ds=I(`Newspaper`,[[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2`,key:`7pis2x`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M10 6h8v4h-8V6Z`,key:`smlsk5`}]]),Os=I(`Palette`,[[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`path`,{d:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z`,key:`12rzf8`}]]),ks=I(`PanelLeftClose`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),As=I(`PanelLeftOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),js=I(`PanelRightClose`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Ms=I(`PanelsTopLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),Ns=I(`Paperclip`,[[`path`,{d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`,key:`1u3ebp`}]]),Ps=I(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Fs=I(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Is=I(`Puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Ls=I(`Radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),Rs=I(`RefreshCcw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),zs=I(`Send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Bs=I(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Vs=I(`ShieldAlert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Hs=I(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Us=I(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Ws=I(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Gs=I(`SquareArrowOutUpRight`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),Ks=I(`SquarePen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),qs=I(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Js=I(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Ys=I(`Terminal`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),Xs=I(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Zs=I(`Unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),Qs=I(`User`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),$s=I(`Wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),ec=I(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),tc=I(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]);function nc(){return O({queryKey:ac,queryFn:Te,staleTime:5e3,refetchOnWindowFocus:!0})}var R=a();function rc(e){let{label:t,muted:n,value:r}=e;return(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:t}),(0,R.jsx)(`span`,{className:n?`text-right text-muted-foreground`:`text-right text-foreground`,children:r==null||r===``?`-`:String(r)})]})}function ic(){let e=s6(),t=nc(),n=t.data,r=pc(e=>e.actionLabel),i=(0,L.useMemo)(()=>yc(n),[n]),a=!!r,o=n?.runtime?.deviceName?.trim()||n?.settings.deviceName?.trim()||b(`remoteDeviceNameAuto`),s=!!(n?.account.loggedIn&&fc(n)),{hero:c,issueHint:l}=i;return(0,L.useEffect)(()=>{e.remoteAccessManager.syncStatus(n)},[e,n]),t.isLoading&&!n?(0,R.jsx)(he,{title:b(`remotePageTitle`),description:b(`remotePageDescription`),children:(0,R.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:b(`remoteLoading`)})}):(0,R.jsx)(he,{title:b(`remotePageTitle`),description:b(`remotePageDescription`),children:(0,R.jsxs)(`div`,{className:`grid gap-7 xl:grid-cols-[1.2fr_0.8fr]`,children:[(0,R.jsx)(te,{title:c.title,description:c.description,actions:(0,R.jsx)(Jn,{status:c.badgeStatus,label:c.badgeLabel}),children:(0,R.jsx)(ge,{children:(0,R.jsxs)(`div`,{className:`space-y-5 p-4`,children:[(0,R.jsxs)(hn,{tone:`neutral`,children:[(0,R.jsx)(rc,{label:b(`remoteSignedInAccount`),value:n?.account.email}),(0,R.jsx)(rc,{label:b(`remoteDeviceName`),value:o}),(0,R.jsx)(rc,{label:b(`remoteConnectionStatus`),value:c.badgeLabel}),(0,R.jsx)(rc,{label:b(`remoteLastConnectedAt`),value:n?.runtime?.lastConnectedAt?_(n.runtime.lastConnectedAt):`-`,muted:!0})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[i.primaryAction?(0,R.jsxs)(F,{onClick:()=>{if(i.primaryAction?.kind===`reauthorize`){e.remoteAccessManager.reauthorizeRemoteAccess(n);return}if(i.primaryAction?.kind===`repair`){e.remoteAccessManager.repairRemoteAccess(n);return}e.remoteAccessManager.enableRemoteAccess(n)},disabled:a,children:[i.primaryAction.showRefreshIcon?(0,R.jsx)(Rs,{className:`mr-2 h-4 w-4`}):null,r||i.primaryAction.label]}):null,(0,R.jsxs)(F,{variant:`outline`,onClick:()=>void e.accountManager.openNextClawWeb(),disabled:a||!s,children:[(0,R.jsx)(Gs,{className:`mr-2 h-4 w-4`}),b(`remoteOpenDeviceList`)]}),n?.settings.enabled?(0,R.jsx)(F,{variant:`outline`,onClick:()=>void e.remoteAccessManager.disableRemoteAccess(n),disabled:a,children:b(`remoteDisable`)}):null]}),i.shouldShowIssueHint&&l?(0,R.jsx)(hn,{tone:`warning`,title:l.title,description:l.body}):null,(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b(`remoteOpenWebHint`)})]})})}),(0,R.jsx)(te,{title:(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(ms,{className:`h-4 w-4 text-primary`}),b(`remoteDeviceSectionTitle`)]}),description:b(`remoteDeviceSectionDescription`),children:(0,R.jsx)(ge,{children:(0,R.jsxs)(`div`,{className:`space-y-5 p-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(Jn,{status:n?.account.loggedIn?`ready`:`inactive`,label:n?.account.loggedIn?b(`remoteAccountConnected`):b(`remoteAccountNotConnected`)}),(0,R.jsx)(Jn,{status:n?.settings.enabled?`active`:`inactive`,label:n?.settings.enabled?b(`remoteEnabled`):b(`remoteStateDisabled`)}),(0,R.jsx)(Jn,{status:n?.service.running?`active`:`inactive`,label:n?.service.running?b(`remoteServiceRunning`):b(`remoteServiceStopped`)})]}),(0,R.jsxs)(hn,{tone:`neutral`,children:[(0,R.jsx)(rc,{label:b(`remoteDeviceName`),value:o}),(0,R.jsx)(rc,{label:b(`remoteConnectionStatus`),value:c.badgeLabel}),(0,R.jsx)(rc,{label:b(`remoteLastConnectedAt`),value:n?.runtime?.lastConnectedAt?_(n.runtime.lastConnectedAt):`-`,muted:!0})]}),(0,R.jsx)(hn,{tone:`neutral`,borderStyle:`dashed`,description:n?.account.loggedIn?b(`remoteOpenWebHint`):b(`remoteStatusNeedsSignInDescription`),className:`text-sm`})]})})})]})})}var ac=[`remote-status`],oc=`https://platform.nextclaw.io`,sc=`https://nextclaw-platform-console.pages.dev`,cc=async()=>await ye.fetchQuery({queryKey:ac,queryFn:Te,staleTime:5e3}),lc=async()=>(await ye.invalidateQueries({queryKey:ac}),await cc()),uc=(e,t)=>t?.trim()||e?.settings.platformApiBase?.trim()||e?.account.apiBase?.trim()||void 0;function dc(e){let t=e?.trim();if(!t)return;let n;try{n=new URL(t)}catch{return}if(n.hostname===`platform.nextclaw.io`||n.hostname===`nextclaw-platform-console.pages.dev`)return n.origin;if(n.hostname===`ai-gateway-api.nextclaw.io`)return oc;if(n.hostname.includes(`nextclaw-provider-gateway-api`)&&n.hostname.endsWith(`.workers.dev`))return sc}var fc=e=>dc(e?.account.apiBase)||dc(e?.settings.platformApiBase)||dc(e?.platformBase)||dc(e?.account.platformBase)||void 0,pc=x(e=>({enabled:!1,deviceName:``,platformApiBase:``,advancedOpen:!1,draftTouched:!1,actionLabel:null,doctor:null,setEnabled:t=>e({enabled:t,draftTouched:!0}),setDeviceName:t=>e({deviceName:t,draftTouched:!0}),setPlatformApiBase:t=>e({platformApiBase:t,draftTouched:!0}),setAdvancedOpen:t=>e({advancedOpen:t}),hydrateDraft:({enabled:t,deviceName:n,platformApiBase:r})=>e({enabled:t,deviceName:n,platformApiBase:r,draftTouched:!1}),beginAction:t=>e({actionLabel:t}),finishAction:()=>e({actionLabel:null}),setDoctor:t=>e({doctor:t})})),mc=class{constructor(e){this.params=e,this.syncStatus=e=>{if(!e)return;let t=pc.getState();t.draftTouched||t.actionLabel||this.hydrateDraftFromStatus(e)},this.setEnabled=e=>{pc.getState().setEnabled(e)},this.setDeviceName=e=>{pc.getState().setDeviceName(e)},this.setPlatformApiBase=e=>{pc.getState().setPlatformApiBase(e)},this.setAdvancedOpen=e=>{pc.getState().setAdvancedOpen(e)},this.enableRemoteAccess=async e=>{let t=e??await lc(),n=pc.getState(),r=await this.ensureRemoteAccount(t,n.platformApiBase);await this.applyEnabledState(!0,r)},this.disableRemoteAccess=async e=>{let t=e??await lc();await this.applyEnabledState(!1,t)},this.repairRemoteAccess=async e=>{let t=e??await lc(),n=(await this.ensureRemoteAccount(t)).service.running?`restart`:`start`;await this.runManagedAction({actionLabel:b(n===`restart`?`remoteActionRestarting`:`remoteActionStarting`),job:async()=>{await ze(n);let e=await lc();this.hydrateDraftFromStatus(e)},successMessage:b(`remoteServiceRecovered`)})},this.reauthorizeRemoteAccess=async e=>{let t=e??await lc(),n=await this.params.accountManager.startBrowserSignInAndWait({status:t,apiBase:pc.getState().platformApiBase});await this.repairRemoteAccess(n)},this.saveAdvancedSettings=async e=>{let t=e??await lc(),n=pc.getState();await this.runManagedAction({actionLabel:b(`remoteActionSavingAdvanced`),job:async()=>{await Be({enabled:n.enabled,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let e=await lc();this.hydrateDraftFromStatus(e)},successMessage:t.settings.enabled===n.enabled?b(`remoteSettingsSaved`):b(`remoteAdvancedSaved`)})},this.runDoctor=async()=>{await this.runManagedAction({actionLabel:b(`remoteDoctorRunning`),job:async()=>{let e=await Ue();pc.getState().setDoctor(e)},successMessage:b(`remoteDoctorCompleted`)})},this.startService=async()=>{await this.runServiceAction(`start`,b(`remoteActionStarting`))},this.restartService=async()=>{await this.runServiceAction(`restart`,b(`remoteActionRestarting`))},this.stopService=async()=>{await this.runServiceAction(`stop`,b(`remoteActionStopping`))},this.applyEnabledState=async(e,t)=>{let n=pc.getState();await this.runManagedAction({actionLabel:b(e?`remoteActionEnabling`:`remoteActionDisabling`),job:async()=>{await Be({enabled:e,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let r=await lc();this.hydrateDraftFromStatus(r),e?await ze(r.service.running?`restart`:`start`):t.service.running&&await ze(`restart`);let i=await lc();this.hydrateDraftFromStatus(i)},successMessage:b(e?`remoteEnabledReady`:`remoteDisabledDone`)})},this.ensureRemoteAccount=async(e,t)=>e.account.loggedIn?e:await this.params.accountManager.ensureSignedIn({apiBase:t,status:e}),this.runServiceAction=async(e,t)=>{await this.runManagedAction({actionLabel:t,job:async()=>{let t=await ze(e),n=await lc();this.hydrateDraftFromStatus(n),P.success(t.message)}})},this.hydrateDraftFromStatus=e=>{pc.getState().hydrateDraft({enabled:e.settings.enabled,deviceName:e.settings.deviceName,platformApiBase:e.settings.platformApiBase})},this.runManagedAction=async e=>{let{actionLabel:t,job:n,successMessage:r}=e;pc.getState().beginAction(t);try{await n(),r&&P.success(r)}catch(e){let t=e instanceof Error?e.message:b(`error`);throw P.error(t),e}finally{pc.getState().finishAction()}}}},hc=[/invalid or expired token/i,/missing bearer token/i,/token expired/i,/token is invalid/i,/run "nextclaw login"/i,/browser sign-in again/i];function gc(e){return e?.runtime?.lastError?.trim()||``}function _c(e){let t=b(`remoteStatusIssueDetailGeneric`),n=gc(e);return n?`${t} (${n})`:t}function vc(e){if(!e?.settings.enabled)return!1;let t=gc(e);return hc.some(e=>e.test(t))}function yc(e){return vc(e)?{hero:{badgeStatus:`warning`,badgeLabel:b(`remoteStateReauthorizationRequired`),title:b(`remoteStatusReauthorizationTitle`),description:b(`remoteStatusReauthorizationDescription`)},primaryAction:{kind:`reauthorize`,label:b(`remoteReauthorizeNow`),showRefreshIcon:!1},issueHint:{title:b(`remoteStatusRecoveryTitle`),body:b(`remoteStatusReauthorizationHint`)},shouldShowIssueHint:!0,requiresReauthorization:!0}:e?.account.loggedIn?e.settings.enabled?e.service.running?e.runtime?.state===`connected`?{hero:{badgeStatus:`ready`,badgeLabel:b(`statusReady`),title:b(`remoteStatusReadyTitle`),description:b(`remoteStatusReadyDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:e.runtime?.state===`connecting`?{hero:{badgeStatus:`active`,badgeLabel:b(`connecting`),title:b(`remoteStatusConnectingTitle`),description:b(`remoteStatusConnectingDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:{hero:{badgeStatus:`warning`,badgeLabel:b(`remoteStateDisconnected`),title:b(`remoteStatusIssueTitle`),description:b(`remoteStatusIssueDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:{title:b(`remoteStatusRecoveryTitle`),body:_c(e)},shouldShowIssueHint:!!(e.settings.enabled&&e.account.loggedIn),requiresReauthorization:!1}:{hero:{badgeStatus:`warning`,badgeLabel:b(`remoteServiceStopped`),title:b(`remoteStatusNeedsServiceTitle`),description:b(`remoteStatusNeedsServiceDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:{title:b(`remoteStatusRecoveryTitle`),body:b(`remoteStatusIssueDetailServiceStopped`)},shouldShowIssueHint:!0,requiresReauthorization:!1}:{hero:{badgeStatus:`inactive`,badgeLabel:b(`statusInactive`),title:b(`remoteStatusNeedsEnable`),description:b(`remoteStatusNeedsEnableDescription`)},primaryAction:{kind:`enable`,label:b(`remoteEnableNow`),showRefreshIcon:!1},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:{hero:{badgeStatus:`setup`,badgeLabel:b(`statusSetup`),title:b(`remoteStatusNeedsSignIn`),description:b(`remoteStatusNeedsSignInDescription`)},primaryAction:{kind:`sign-in-enable`,label:b(`remoteSignInAndEnable`),showRefreshIcon:!1},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}}var bc=x(e=>({panelOpen:!1,authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500,openPanel:()=>e({panelOpen:!0}),closePanel:()=>e({panelOpen:!1}),beginBrowserAuth:({sessionId:t,verificationUri:n,expiresAt:r,intervalMs:i,statusMessage:a})=>e({panelOpen:!0,authSessionId:t,authVerificationUri:n,authExpiresAt:r,authPollIntervalMs:i,authStatusMessage:a}),updateBrowserAuth:({statusMessage:t,intervalMs:n})=>e(e=>({authStatusMessage:t??e.authStatusMessage,authPollIntervalMs:n??e.authPollIntervalMs})),clearBrowserAuth:()=>e({authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500}),setAuthStatusMessage:t=>e({authStatusMessage:t})}));function xc({label:e,value:t}){return(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,R.jsx)(`span`,{className:`text-gray-500`,children:e}),(0,R.jsx)(`span`,{className:`text-right text-gray-900`,children:t?.trim()||`-`})]})}function Sc(e){let{email:t,username:n,role:r,canSubmitUsername:i,savingUsername:a,usernameDraft:o,onUsernameDraftChange:s,onSubmitUsername:c,onOpenDeviceList:l,onLogout:u}=e;return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(hn,{tone:`success`,title:b(`accountPanelSignedInTitle`),description:b(`accountPanelSignedInDescription`)}),(0,R.jsxs)(hn,{tone:`neutral`,children:[(0,R.jsx)(xc,{label:b(`remoteAccountEmail`),value:t}),(0,R.jsx)(xc,{label:b(`remoteAccountUsername`),value:n}),(0,R.jsx)(xc,{label:b(`remoteAccountRole`),value:r})]}),n?(0,R.jsx)(`p`,{className:`text-xs text-gray-500`,children:b(`remoteAccountUsernameLockedHelp`)}):(0,R.jsxs)(hn,{tone:`warning`,title:b(`remoteAccountUsernameRequiredTitle`),description:b(`remoteAccountUsernameRequiredDescription`),children:[(0,R.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,R.jsx)(N,{htmlFor:`account-panel-username`,children:b(`remoteAccountUsername`)}),(0,R.jsx)(ae,{id:`account-panel-username`,value:o,onChange:e=>s(e.target.value),placeholder:b(`remoteAccountUsernamePlaceholder`),autoCapitalize:`none`,autoCorrect:`off`,spellCheck:!1})]}),(0,R.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-3`,children:(0,R.jsx)(F,{disabled:!i,onClick:()=>void c(),children:b(a?`remoteAccountUsernameSaving`:`remoteAccountUsernameSave`)})})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,R.jsxs)(F,{onClick:()=>void l(),children:[(0,R.jsx)(Gs,{className:`mr-2 h-4 w-4`}),b(`remoteOpenDeviceList`)]}),(0,R.jsxs)(F,{variant:`outline`,onClick:()=>void u(),children:[(0,R.jsx)(ys,{className:`mr-2 h-4 w-4`}),b(`remoteLogout`)]})]})]})}function Cc(e){let{authSessionId:t,authExpiresAt:n,authStatusMessage:r,authVerificationUri:i,onStartBrowserSignIn:a,onResumeBrowserSignIn:o}=e;return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(hn,{tone:`neutral`,title:b(`accountPanelSignedOutTitle`),description:b(`accountPanelSignedOutDescription`),children:t?(0,R.jsxs)(`div`,{className:`mt-3 border-t border-white/80 pt-3`,children:[(0,R.jsx)(xc,{label:b(`remoteBrowserAuthSession`),value:t}),(0,R.jsx)(xc,{label:b(`remoteBrowserAuthExpiresAt`),value:n?_(n):`-`})]}):null}),r?(0,R.jsx)(`p`,{className:`text-sm text-gray-600`,children:r}):null,(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,R.jsx)(F,{onClick:()=>void a(),children:b(t?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),i?(0,R.jsx)(F,{variant:`outline`,onClick:()=>void o(),children:b(`remoteBrowserAuthResume`)}):null]})]})}function wc(){let e=n6(),t=nc(),n=bc(e=>e.panelOpen),r=bc(e=>e.authSessionId),i=bc(e=>e.authVerificationUri),a=bc(e=>e.authExpiresAt),o=bc(e=>e.authStatusMessage),s=t.data,[c,l]=(0,L.useState)(``),[u,d]=(0,L.useState)(!1);(0,L.useEffect)(()=>{e.accountManager.syncRemoteStatus(s)},[e,s]);let f=!u&&c.trim().length>0&&!s?.account.username;return(0,R.jsx)(_t,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,R.jsxs)(bt,{className:`max-w-xl`,children:[(0,R.jsxs)(vt,{children:[(0,R.jsxs)(xt,{className:`flex items-center gap-2`,children:[(0,R.jsx)(zn,{className:`h-5 w-5 text-primary`}),b(`accountPanelTitle`)]}),(0,R.jsx)(mt,{children:b(`accountPanelDescription`)})]}),s?.account.loggedIn?(0,R.jsx)(Sc,{email:s.account.email,username:s.account.username,role:s.account.role,canSubmitUsername:f,savingUsername:u,usernameDraft:c,onUsernameDraftChange:l,onSubmitUsername:async()=>{d(!0);try{await e.accountManager.updateUsername(c)}finally{d(!1)}},onOpenDeviceList:()=>e.accountManager.openNextClawWeb(`/account`),onLogout:()=>e.accountManager.logout()}):(0,R.jsx)(Cc,{authSessionId:r,authExpiresAt:a,authStatusMessage:o,authVerificationUri:i,onStartBrowserSignIn:()=>e.accountManager.startBrowserSignIn(),onResumeBrowserSignIn:()=>e.accountManager.resumeBrowserSignIn()})]})})}function Tc({username:e}){let t=ee(),[n,r]=(0,L.useState)(e??``),[i,a]=(0,L.useState)(``),o=n.trim().length>0&&i.length>0&&!t.isPending;return(0,R.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-secondary px-6 py-10`,children:(0,R.jsxs)(En,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,R.jsxs)(Sn,{children:[(0,R.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:b(`authBrand`)}),(0,R.jsx)(xn,{className:`text-2xl`,children:b(`authLoginTitle`)}),(0,R.jsx)(Tn,{children:b(`authLoginDescription`)})]}),(0,R.jsx)(Cn,{children:(0,R.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e?.preventDefault(),o&&t.mutate({username:n.trim(),password:i})},children:[(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:b(`authUsername`)}),(0,R.jsx)(ae,{value:n,onChange:e=>r(e.target.value),placeholder:b(`authUsernamePlaceholder`),autoFocus:!0})]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:b(`authPassword`)}),(0,R.jsx)(ae,{type:`password`,value:i,onChange:e=>a(e.target.value),placeholder:b(`authPasswordPlaceholder`)})]}),(0,R.jsx)(F,{type:`submit`,className:`w-full`,disabled:!o,children:t.isPending?b(`authLoggingIn`):b(`authLoginAction`)})]})})]})})}var Ec=class{constructor(){this.authPollTimerId=null,this.browserSignInCompletion=null,this.openAccountPanel=()=>{bc.getState().openPanel()},this.closeAccountPanel=()=>{bc.getState().closePanel()},this.syncRemoteStatus=e=>{e?.account.loggedIn&&(this.clearPollTimer(),this.resolveBrowserSignIn(e),bc.getState().clearBrowserAuth())},this.ensureSignedIn=async e=>{let t=e?.status??await cc();return t.account.loggedIn?t:(this.openAccountPanel(),await this.startBrowserSignInAndWait({apiBase:e?.apiBase,status:t}))},this.startBrowserSignInAndWait=async e=>{let t=this.createBrowserSignInCompletion();return await this.startBrowserSignIn(e),await t},this.startBrowserSignIn=async e=>{try{let t=e?.apiBase,n=await Ee({apiBase:uc(e?.status??await cc(),t)});bc.getState().beginBrowserAuth({sessionId:n.sessionId,verificationUri:n.verificationUri,expiresAt:n.expiresAt,intervalMs:n.intervalMs,statusMessage:b(`remoteBrowserAuthWaiting`)}),(await Xn.openExternalUrl(n.verificationUri)).opened||bc.getState().setAuthStatusMessage(b(`remoteBrowserAuthPopupBlocked`)),this.scheduleBrowserAuthPoll()}catch(e){let t=e instanceof Error?e.message:b(`remoteBrowserAuthStartFailed`);this.rejectBrowserSignIn(e),P.error(`${b(`remoteBrowserAuthStartFailed`)}: ${t}`)}},this.resumeBrowserSignIn=async()=>{let e=bc.getState().authVerificationUri;e&&await Xn.openExternalUrl(e)},this.logout=async()=>{try{await Ie(),this.rejectBrowserSignIn(Error(`Signed out before browser sign-in completed.`)),bc.getState().clearBrowserAuth(),await lc(),P.success(b(`remoteLogoutSuccess`))}catch(e){let t=e instanceof Error?e.message:b(`remoteLogoutFailed`);P.error(`${b(`remoteLogoutFailed`)}: ${t}`)}},this.updateUsername=async e=>{try{await De({username:e.trim()}),await lc(),P.success(b(`remoteAccountUsernameSetSuccess`))}catch(e){let t=e instanceof Error?e.message:b(`remoteAccountUsernameSetFailed`);P.error(`${b(`remoteAccountUsernameSetFailed`)}: ${t}`)}},this.openNextClawWeb=async(e=`/`)=>{let t=fc(await cc());if(!t){P.error(b(`remoteOpenWebUnavailable`));return}let n=new URL(e,`${t.replace(/\/+$/,``)}/`).toString();await Xn.openExternalUrl(n)},this.scheduleBrowserAuthPoll=()=>{this.clearPollTimer();let{authSessionId:e,authPollIntervalMs:t}=bc.getState();e&&(this.authPollTimerId=window.setTimeout(async()=>{await this.pollBrowserSignIn()},t))},this.pollBrowserSignIn=async()=>{let e=bc.getState();if(e.authSessionId)try{let t=await cc(),n=await Ge({sessionId:e.authSessionId,apiBase:uc(t)});if(n.status===`pending`){bc.getState().updateBrowserAuth({statusMessage:b(`remoteBrowserAuthWaiting`),intervalMs:n.nextPollMs??1500}),this.scheduleBrowserAuthPoll();return}if(n.status===`expired`){this.clearPollTimer(),this.rejectBrowserSignIn(Error(n.message||b(`remoteBrowserAuthExpired`))),bc.getState().clearBrowserAuth(),P.error(n.message||b(`remoteBrowserAuthExpired`));return}bc.getState().setAuthStatusMessage(b(`remoteBrowserAuthCompleted`));let r=await lc();this.clearPollTimer(),this.resolveBrowserSignIn(r),bc.getState().clearBrowserAuth(),P.success(b(`remoteLoginSuccess`))}catch(e){this.clearPollTimer(),this.rejectBrowserSignIn(e),bc.getState().clearBrowserAuth();let t=e instanceof Error?e.message:b(`remoteBrowserAuthPollFailed`);P.error(`${b(`remoteBrowserAuthPollFailed`)}: ${t}`)}},this.clearPollTimer=()=>{this.authPollTimerId!==null&&(window.clearTimeout(this.authPollTimerId),this.authPollTimerId=null)},this.createBrowserSignInCompletion=()=>(this.rejectBrowserSignIn(Error(`Browser sign-in was replaced by a newer request.`)),new Promise((e,t)=>{this.browserSignInCompletion={resolve:e,reject:t}})),this.resolveBrowserSignIn=e=>{let t=this.browserSignInCompletion;t&&(this.browserSignInCompletion=null,t.resolve(e))},this.rejectBrowserSignIn=e=>{let t=this.browserSignInCompletion;t&&(this.browserSignInCompletion=null,t.reject(e instanceof Error?e:Error(String(e))))},this.getBrowserAuthSummary=()=>{let e=bc.getState();return{sessionId:e.authSessionId,expiresAt:e.authExpiresAt?_(e.authExpiresAt):`-`}}}};function Dc({parentSessionLabel:e,onGoToParentSession:t}){if(!e)return null;let n=e.trim();return(0,R.jsx)(`div`,{className:`bg-background/75 px-4 py-2 backdrop-blur-sm sm:px-5`,children:(0,R.jsxs)(`button`,{type:`button`,onClick:t,className:`inline-flex items-center gap-2 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:[(0,R.jsx)(wt,{className:`h-3.5 w-3.5`}),(0,R.jsxs)(`span`,{children:[b(`chatBackToParent`),n?` · ${n}`:``]})]})})}function Oc({layoutMode:e,actions:t,leading:n,onBackToList:i,projectBadge:a,sessionTypeBadge:o,shouldShow:s,title:c,titleContent:l}){let u=e===`mobile`;return(0,R.jsxs)(`div`,{"data-testid":`chat-conversation-header`,className:r(`bg-background/80 backdrop-blur-sm flex items-center justify-between shrink-0 overflow-hidden transition-colors duration-200`,u?`px-3 sm:px-3`:`px-4 sm:px-5`,s?`opacity-100`:`h-0 py-0 opacity-0`,s&&(u?`min-h-12 pb-2 pt-2`:`h-[52px]`)),style:u&&s?{paddingTop:`calc(env(safe-area-inset-top, 0px) + 0.5rem)`}:void 0,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-center gap-2`,children:[u&&i?(0,R.jsx)(Nt,{icon:(0,R.jsx)(wt,{className:`h-4 w-4`}),label:b(`chat`),onClick:i,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`}):null,n,l??(0,R.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:c}),o,a]}),t]})}function kc(){let e=Ke();return async t=>{let{sessionKey:n,patch:r,successMessage:i}=t;try{Oe(e,await se(n,r)),await e.invalidateQueries({queryKey:[`ncp-session-skills`,n]}),P.success(i??b(`configSavedApplied`))}catch(e){throw P.error(b(`configSaveFailed`)+`: `+(e instanceof Error?e.message:String(e))),e}}}function Ac(){let e=kc();return async t=>{await e({sessionKey:t.sessionKey,patch:{label:t.label},successMessage:b(`configSavedApplied`)})}}function jc(){let e=kc();return async t=>{let{persistToServer:n,projectRoot:r,sessionKey:i}=t,a=b(r?`chatSessionProjectUpdated`:`chatSessionProjectCleared`);if(!n){P.success(a);return}await e({sessionKey:i,patch:{projectRoot:r},successMessage:a})}}function Mc({icon:e,label:t,onClick:n,disabled:i=!1,destructive:a=!1}){return(0,R.jsxs)(`button`,{type:`button`,className:r(`flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,a?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-accent hover:text-accent-foreground`),onClick:n,disabled:i,children:[(0,R.jsx)(e,{className:`h-4 w-4 shrink-0`}),(0,R.jsx)(`span`,{children:t})]})}function Nc(e){try{return JSON.stringify(e??{},null,2)}catch{return`{}`}}function Pc({open:e,metadata:t,onOpenChange:n}){return(0,R.jsx)(_t,{open:e,onOpenChange:n,children:(0,R.jsxs)(bt,{className:`max-w-2xl gap-0 overflow-hidden p-0`,children:[(0,R.jsxs)(vt,{className:`border-b border-border px-5 py-4 pr-12`,children:[(0,R.jsx)(xt,{className:`text-base`,children:b(`chatSessionMetadataDialogTitle`)}),(0,R.jsx)(mt,{className:`sr-only`,children:b(`chatSessionMetadataDialogDescription`)})]}),(0,R.jsx)(`div`,{className:`px-5 pb-5 pt-4`,children:(0,R.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto rounded-lg border border-border bg-muted/60 p-4 font-mono text-xs leading-6 text-foreground shadow-inner custom-scrollbar`,children:Nc(t)})})]})})}function Fc(e){return[`server-path-browse`,e.path?.trim()??``,e.basePath?.trim()??``,e.includeFiles??!1]}function Ic(e){let{basePath:t,enabled:n,includeFiles:r,path:i}=e,a=i?.trim()??``,o=t?.trim()??``;return O({queryKey:Fc({path:a,basePath:o,includeFiles:r}),queryFn:()=>Ve({path:a,basePath:o,includeFiles:r}),enabled:n??!0,staleTime:0})}function Lc(){return le({mutationFn:Le})}var Rc=L.forwardRef(({className:e,children:t,...n},i)=>(0,R.jsx)(`div`,{ref:i,className:r(`overflow-auto`,e),...n,children:t}));Rc.displayName=`ScrollArea`;function zc({entries:e,emptyMessage:t,disabled:n,onOpen:i,onSelect:a,selectedPath:o}){let s=(e,t)=>{e.preventDefault();let n=Array.from(e.currentTarget.parentElement?.querySelectorAll(`[data-server-path-row]`)??[]),r=n[n.indexOf(e.currentTarget)+t];r&&(r.focus(),r.click())};return(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_8rem] border-b border-border bg-muted/20 px-3 py-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{children:b(`pathPickerNameColumn`)}),(0,R.jsx)(`span`,{children:b(`pathPickerTypeColumn`)})]}),(0,R.jsx)(Rc,{className:`min-h-0 flex-1`,children:e.length>0?(0,R.jsx)(`div`,{role:`listbox`,"aria-label":b(`pathPickerDirectoryList`),className:`p-1.5`,children:e.map(e=>{let t=o===e.path;return(0,R.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,"data-server-path-row":!0,className:r(`grid w-full grid-cols-[minmax(0,1fr)_8rem] items-center rounded-sm border border-transparent px-2 py-1.5 text-left text-sm text-foreground outline-none transition-colors`,t?`border-primary/25 bg-primary/15`:`hover:bg-accent/70 focus-visible:border-primary/35 focus-visible:bg-accent/70`),onClick:()=>a(e.path),onDoubleClick:()=>i(e.path),onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),i(e.path)),t.key===`ArrowDown`&&s(t,1),t.key===`ArrowUp`&&s(t,-1)},disabled:n,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(as,{className:`h-4 w-4 shrink-0 fill-amber-300 text-amber-500`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,R.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:b(`pathPickerDirectoryType`)})]},e.path)})}):(0,R.jsx)(`div`,{className:`grid h-full min-h-48 place-items-center px-6 text-center text-sm text-muted-foreground`,children:t})})]})}function Bc({confirmLabel:e,disabled:t,hint:n,isSaving:r,onCancel:i,onSelectedPathChange:a,pathLabel:o,pathPlaceholder:s,selectedPath:c}){return(0,R.jsxs)(`div`,{className:`min-w-0 border-t border-border bg-muted/20 px-4 py-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,R.jsx)(N,{htmlFor:`server-path-picker-selection`,className:`shrink-0 text-sm`,children:o}),(0,R.jsx)(ae,{id:`server-path-picker-selection`,value:c,onChange:e=>a(e.target.value),placeholder:s,disabled:r,className:`h-9 min-w-0 flex-1 bg-background`}),(0,R.jsxs)(ut,{className:`shrink-0 flex-row gap-2`,children:[(0,R.jsx)(F,{type:`button`,variant:`outline`,onClick:i,disabled:r,children:b(`cancel`)}),(0,R.jsx)(F,{type:`submit`,disabled:t,children:r?b(`saving`):e})]})]}),n?(0,R.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:n}):null]})}var Vc={applications:vo,desktop:Es,documents:yn,downloads:wn,home:ds,"icloud-drive":Io,workspace:$o,root:ls,volumes:ls},Hc={applications:`pathPickerApplications`,desktop:`pathPickerDesktop`,documents:`pathPickerDocuments`,downloads:`pathPickerDownloads`,"icloud-drive":`pathPickerICloudDrive`,volumes:`pathPickerVolumes`};function Uc({currentPath:e,defaultWorkspacePath:t,disabled:n,homePath:i,locations:a,rootPath:o,onNavigate:s}){let c=[],l=[],u=new Set,d=(e,t)=>{let n=t.path.trim();!n||u.has(n)||(u.add(n),e.push({...t,path:n}))};t&&d(c,{icon:`workspace`,label:b(`pathPickerDefaultWorkspace`),path:t}),i&&d(c,{icon:`home`,label:b(`homeDirectory`),path:i});for(let e of a)d(e.kind===`volumes`?l:c,{icon:e.kind,label:b(Hc[e.kind]),path:e.path});o&&d(l,{icon:`root`,label:b(`pathPickerFileSystem`),path:o});let f=t=>t.map(t=>{let i=Vc[t.icon],a=e===t.path;return(0,R.jsxs)(`button`,{type:`button`,className:r(`flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,a?`bg-primary/12 text-primary`:`text-foreground hover:bg-accent`),"aria-current":a?`location`:void 0,onClick:()=>s(t.path),disabled:n,children:[(0,R.jsx)(i,{className:r(`h-4 w-4 shrink-0`,a?`text-primary`:`text-amber-500`)}),(0,R.jsx)(`span`,{className:`truncate`,children:t.label})]},t.path)});return(0,R.jsxs)(`aside`,{className:`hidden min-h-0 w-48 shrink-0 overflow-y-auto border-r border-border bg-muted/20 p-2 sm:block`,children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 px-2 py-1.5 text-xs font-medium text-muted-foreground`,children:[(0,R.jsx)(Js,{className:`h-3.5 w-3.5`}),b(`pathPickerQuickAccess`)]}),(0,R.jsx)(`nav`,{"aria-label":b(`pathPickerQuickAccess`),className:`space-y-0.5`,children:f(c)}),l.length>0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`mb-1 mt-3 px-2 py-1.5 text-xs font-medium text-muted-foreground`,children:b(`pathPickerLocations`)}),(0,R.jsx)(`nav`,{"aria-label":b(`pathPickerLocations`),className:`space-y-0.5`,children:f(l)})]}):null]})}function Wc({addressPath:e,breadcrumbs:t,canGoBack:n,canGoForward:r,canGoUp:i,disabled:a,onBack:o,onForward:s,onNavigate:c,onRefresh:l,onSearchChange:u,onUp:d,searchText:f}){let[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(``),_=t.length>5?[t[0],...t.slice(-4)]:t,v=_.length<t.length,y=()=>{a||(g(e),m(!0))},x=()=>{g(``),m(!1)},S=()=>{let e=h.trim();e&&(m(!1),c(e))};return(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden border-b border-border bg-muted/25 px-3 py-2`,children:[(0,R.jsx)(Nt,{icon:(0,R.jsx)(wt,{className:`h-4 w-4`}),label:b(`pathPickerBack`),size:`lg`,onClick:o,disabled:!n||a}),(0,R.jsx)(Nt,{icon:(0,R.jsx)(Ht,{className:`h-4 w-4`}),label:b(`pathPickerForward`),size:`lg`,onClick:s,disabled:!r||a}),(0,R.jsx)(Nt,{icon:(0,R.jsx)(rs,{className:`h-4 w-4`}),label:b(`parentDirectory`),size:`lg`,onClick:d,disabled:!i||a}),(0,R.jsx)(`div`,{className:`ml-1 flex h-9 min-w-0 flex-1 items-center overflow-hidden rounded-md border border-border bg-background shadow-sm focus-within:ring-1 focus-within:ring-primary/50`,children:p?(0,R.jsx)(ae,{value:h,onChange:e=>g(e.target.value),onBlur:x,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),S()),e.key===`Escape`&&(e.preventDefault(),x())},"aria-label":b(`pathPickerAddressLabel`),className:`h-full rounded-none border-0 bg-transparent px-3 shadow-none focus-visible:ring-0`,autoFocus:!0}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(as,{className:`ml-3 h-4 w-4 shrink-0 text-amber-500`}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center overflow-hidden pl-2`,onDoubleClick:y,children:[_.length>0?_.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center`,children:[t>0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Ao,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),v&&t===1?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,className:`rounded px-1.5 py-1 text-sm text-muted-foreground hover:bg-accent`,"aria-label":b(`pathPickerShowFullAddress`),onClick:y,children:`…`}),(0,R.jsx)(Ao,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}):null]}):null,(0,R.jsx)(`button`,{type:`button`,className:`max-w-40 truncate rounded px-1.5 py-1 text-sm text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>c(e.path),disabled:a,children:e.label})]},e.path)):(0,R.jsx)(`span`,{className:`truncate text-sm text-foreground`,children:e}),(0,R.jsx)(`span`,{className:`h-full min-w-2 flex-1 cursor-text`,"aria-hidden":`true`}),(0,R.jsx)(Nt,{icon:(0,R.jsx)(Ps,{className:`h-3.5 w-3.5`}),label:b(`pathPickerEditAddress`),size:`md`,tooltipSide:`bottom`,onClick:y,disabled:a,className:`mr-1`})]})]})}),(0,R.jsx)(Nt,{icon:(0,R.jsx)(Rs,{className:`h-4 w-4`}),label:b(`chatRefresh`),size:`lg`,onClick:l,disabled:a}),(0,R.jsxs)(`div`,{className:`relative hidden w-56 shrink-0 sm:block`,children:[(0,R.jsx)(Tt,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,R.jsx)(ae,{value:f,onChange:e=>u(e.target.value),placeholder:b(`pathPickerSearchPlaceholder`),disabled:a,className:`h-9 rounded-md bg-background pl-9`})]})]})}function Gc({errorMessage:e,isCreating:t,name:n,onCancel:r,onCreate:i,onNameChange:a}){return(0,R.jsxs)(`div`,{className:`border-b border-gray-200 bg-white px-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(ae,{value:n,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i()),e.key===`Escape`&&r()},placeholder:b(`pathPickerNewFolderPlaceholder`),"aria-label":b(`pathPickerNewFolderName`),autoFocus:!0,disabled:t}),(0,R.jsx)(F,{type:`button`,onClick:i,disabled:!n.trim()||t,children:b(t?`saving`:`pathPickerCreateFolder`)}),(0,R.jsx)(F,{type:`button`,variant:`outline`,onClick:r,disabled:t,children:b(`cancel`)})]}),e?(0,R.jsxs)(`p`,{role:`alert`,className:`mt-2 text-sm text-destructive`,children:[b(`pathPickerCreateFolderFailed`),`: `,e]}):null]})}function Kc({allowCreateDirectory:e,disabled:t,onNewFolder:n}){return(0,R.jsxs)(`div`,{className:`flex items-center border-b border-border bg-background px-3 py-1.5`,children:[e?(0,R.jsxs)(F,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,disabled:t,children:[(0,R.jsx)(ts,{className:`mr-1 h-4 w-4`}),b(`pathPickerNewFolder`)]}):null,(0,R.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:b(`pathPickerDoubleClickHint`)})]})}function qc(e,t){if(!t)return e;if(e===`~`)return t;let n=t.includes(`\\`);if(e.startsWith(`~/`)||n&&e.startsWith(`~\\`)){let r=n?`\\`:`/`,i=e.slice(2).replaceAll(r===`\\`?`/`:`\\`,r);return`${t.replace(/[\\/]+$/,``)}${r}${i}`}return e}function Jc({open:e,allowCreateDirectory:t=!0,currentPath:n,defaultWorkspacePath:r,isSaving:i,onOpenChange:a,onConfirm:o,title:s,description:c,pathLabel:l,pathPlaceholder:u,confirmLabel:d,hint:f}){let p=n?.trim()??``,m=r?.trim()??``,h=`${p}\u0000${m}`;return(0,R.jsx)(_t,{open:e,onOpenChange:e=>{i||a(e)},children:(0,R.jsxs)(bt,{className:`max-h-[92vh] overflow-hidden p-0 sm:h-[44rem] sm:max-w-5xl sm:grid-rows-[auto_minmax(0,1fr)]`,children:[(0,R.jsxs)(vt,{className:`border-b border-border px-5 py-4 pr-12`,children:[(0,R.jsx)(xt,{children:s}),(0,R.jsx)(mt,{className:c?void 0:`sr-only`,children:c??s})]}),e?(0,R.jsx)(Yc,{allowCreateDirectory:t,currentPath:p,defaultWorkspacePath:m,isSaving:i,onCancel:()=>a(!1),onConfirm:o,pathLabel:l,pathPlaceholder:u,confirmLabel:d,hint:f},h):null]})})}function Yc({allowCreateDirectory:e,currentPath:t,defaultWorkspacePath:n,isSaving:r,onCancel:i,onConfirm:a,pathLabel:o,pathPlaceholder:s,confirmLabel:c,hint:l}){let u=t||n,[d,f]=(0,L.useState)(u||null),[p,m]=(0,L.useState)(u||null),[h,g]=(0,L.useState)([]),[_,v]=(0,L.useState)([]),[y,x]=(0,L.useState)(``),[S,C]=(0,L.useState)(!1),[w,T]=(0,L.useState)(``),E=Ic({path:p,enabled:!0}),D=Lc(),O=qc(p?.trim()??``,E.data?.homePath),k=d===null?E.data?.currentPath??``:d===p&&E.data?.currentPath===O?E.data.currentPath:d,A=k.trim(),ee=A.length===0||r,j=O||E.data?.currentPath||``,M=!p||E.data?.currentPath===j?E.data?.breadcrumbs??[]:[],N=(0,L.useMemo)(()=>E.error?E.error instanceof Error?E.error.message:String(E.error):null,[E.error]),te=(0,L.useMemo)(()=>D.error?D.error instanceof Error?D.error.message:String(D.error):null,[D.error]),ne=w.trim().toLowerCase(),re=(0,L.useMemo)(()=>(E.data?.entries??[]).filter(e=>e.kind===`directory`),[E.data?.entries]),ie=(0,L.useMemo)(()=>ne.length===0?re:re.filter(e=>{let t=e.name.toLowerCase(),n=e.path.toLowerCase();return t.includes(ne)||n.includes(ne)}),[re,ne]),oe=e=>{m(e),f(e),T(``),C(!1),x(``),D.reset()},se=e=>{let t=e.trim();if(!t)return;let n=j;n&&n!==t&&g(e=>[...e,n].slice(-50)),v([]),oe(t)},ce=()=>{let e=h.at(-1);if(!e)return;let t=j;g(e=>e.slice(0,-1)),t&&v(e=>[t,...e].slice(0,50)),oe(e)},le=()=>{let e=_[0];if(!e)return;let t=j;v(e=>e.slice(1)),t&&g(e=>[...e,t].slice(-50)),oe(e)},ue=async()=>{let t=E.data?.currentPath,n=y.trim();if(!(!e||!t||!n||D.isPending))try{let e=await D.mutateAsync({parentPath:t,name:n});await E.refetch(),f(e.path),x(``),C(!1)}catch{}},de=E.isLoading?b(`loading`):N?`${b(`pathBrowseFailed`)}: ${N}`:re.length>0?b(`pathPickerSearchEmpty`):b(`emptyDirectory`),fe=r||E.isLoading;return(0,R.jsxs)(`form`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden`,onSubmit:e=>{e.preventDefault(),!ee&&a(A)},children:[(0,R.jsx)(Wc,{addressPath:j,breadcrumbs:M,canGoBack:h.length>0,canGoForward:_.length>0,canGoUp:!!E.data?.parentPath,disabled:fe,onBack:ce,onForward:le,onNavigate:se,onRefresh:()=>void E.refetch(),onSearchChange:T,onUp:()=>{let e=E.data?.parentPath;e&&se(e)},searchText:w}),(0,R.jsx)(Kc,{allowCreateDirectory:e,disabled:fe||!E.data?.currentPath,onNewFolder:()=>{C(!0),x(``),D.reset()}}),(0,R.jsxs)(`div`,{className:`relative border-b border-border p-2 sm:hidden`,children:[(0,R.jsx)(Tt,{className:`pointer-events-none absolute left-5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,R.jsx)(ae,{value:w,onChange:e=>T(e.target.value),placeholder:b(`pathPickerSearchPlaceholder`),disabled:fe,className:`h-9 pl-9`})]}),e&&S?(0,R.jsx)(Gc,{errorMessage:te,isCreating:D.isPending,name:y,onCancel:()=>C(!1),onCreate:()=>void ue(),onNameChange:e=>{x(e),D.reset()}}):null,(0,R.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,R.jsx)(Uc,{currentPath:j,defaultWorkspacePath:qc(n,E.data?.homePath)||null,disabled:fe,homePath:E.data?.homePath,locations:E.data?.locations??[],rootPath:E.data?.breadcrumbs[0]?.path,onNavigate:se}),(0,R.jsx)(zc,{entries:ie,emptyMessage:de,disabled:r,onOpen:se,onSelect:f,selectedPath:A})]}),(0,R.jsx)(Bc,{confirmLabel:c,disabled:ee,hint:l,isSaving:r,onCancel:i,onSelectedPathChange:f,pathLabel:o,pathPlaceholder:s,selectedPath:k})]})}function Xc({open:e,currentProjectRoot:t,defaultWorkspacePath:n,isSaving:r,onOpenChange:i,onSave:a}){return(0,R.jsx)(Jc,{open:e,currentPath:t,defaultWorkspacePath:n,isSaving:r,onOpenChange:i,onConfirm:a,title:b(`chatSessionProjectDialogTitle`),description:b(`chatSessionProjectDialogDescription`),pathLabel:b(`chatSessionProjectPathLabel`),pathPlaceholder:b(`chatSessionProjectPathPlaceholder`),confirmLabel:b(`chatSessionSetProject`),hint:b(`chatSessionProjectUpdateHint`)})}var Zc=`flex shrink-0 items-center gap-1.5`;function Qc({sessionKey:e,canDeleteSession:t,isDeletePending:n,currentPath:r,defaultWorkspacePath:i,metadata:a,isWorkspaceOpen:o,onToggleWorkspace:s,onDeleteSession:c}){let l=jc(),[u,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(!1),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),v=n||g,y=async n=>{let r=t;_(!0);try{await l({sessionKey:e,projectRoot:n,persistToServer:r}),p(!1),d(!1)}finally{_(!1)}};return(0,R.jsxs)(`div`,{className:Zc,children:[(0,R.jsxs)(ct,{open:u,onOpenChange:d,children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(Nt,{icon:(0,R.jsx)(jt,{className:`h-4 w-4`}),label:b(`chatSessionMoreActions`),tooltip:!1,disabled:v})}),(0,R.jsx)(ot,{align:`end`,className:`w-56 p-2`,children:(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(Mc,{icon:es,label:b(`chatSessionSetProject`),onClick:()=>{d(!1),p(!0)},disabled:v}),(0,R.jsx)(Mc,{icon:Co,label:b(`chatSessionViewMetadata`),onClick:()=>{d(!1),h(!0)},disabled:v}),(0,R.jsx)(Mc,{icon:Kn,label:b(`chatDeleteSession`),onClick:()=>{d(!1),c()},disabled:!t||v,destructive:!0})]})})]}),(0,R.jsx)(Nt,{icon:o?(0,R.jsx)(js,{className:`h-4 w-4`}):(0,R.jsx)(Mt,{className:`h-4 w-4`}),label:b(o?`chatSessionCloseWorkspace`:`chatSessionOpenWorkspace`),"aria-pressed":o,onClick:s,disabled:v}),(0,R.jsx)(Xc,{open:f,currentProjectRoot:r,defaultWorkspacePath:i,isSaving:g,onOpenChange:p,onSave:y}),(0,R.jsx)(Pc,{open:m,metadata:a,onOpenChange:h})]})}var $c={maxHeight:tt(`18rem`)};function el({sessionKey:e,projectName:t,projectRoot:n,defaultWorkspacePath:r,persistToServer:i}){let a=jc(),[o,s]=(0,L.useState)(!1),[c,l]=(0,L.useState)(!1),[u,d]=(0,L.useState)(!1),f=async t=>{d(!0);try{await a({sessionKey:e,projectRoot:t,persistToServer:i}),l(!1),s(!1)}finally{d(!1)}};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(ct,{open:o,onOpenChange:s,children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,title:n??void 0,className:`min-w-0 max-w-[320px] shrink rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors hover:border-primary/35 hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-60`,"aria-label":b(`chatSessionSetProject`),disabled:u,children:(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,R.jsx)(es,{className:`h-3.5 w-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:t}),(0,R.jsx)(Wt,{className:`h-3 w-3 shrink-0 opacity-70`})]})})}),(0,R.jsxs)(ot,{align:`start`,className:`w-72 p-2`,style:$c,children:[(0,R.jsxs)(`div`,{className:`px-3 pb-2 pt-1`,children:[(0,R.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:t}),n?(0,R.jsx)(`div`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:n}):null]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(Mc,{icon:Ps,label:b(`chatSessionSetProject`),onClick:()=>{s(!1),l(!0)},disabled:u}),(0,R.jsx)(Mc,{icon:is,label:b(`chatSessionClearProject`),onClick:()=>{f(null)},disabled:u})]})]})]}),(0,R.jsx)(Xc,{open:c,currentProjectRoot:n,defaultWorkspacePath:r,isSaving:u,onOpenChange:l,onSave:f})]})}var tl=(0,L.createContext)(null);function nl({presenter:e,children:t}){return(0,R.jsx)(tl.Provider,{value:e,children:t})}function rl(){let e=(0,L.useContext)(tl);if(!e)throw Error(`usePresenter must be used inside ChatPresenterProvider`);return e}function il(e){let t=e.label?.trim();if(t)return t;let n=e.key.split(`:`);return n[n.length-1]||e.key}function al(e){let t=e.activityPreview;return!t||t.state===`cancelled`?null:t.state===`failed`||t.state===`running`?t.statusText??t.replyText??null:t.state===`completed`?t.replyText??t.statusText??null:t.statusText??t.replyText??null}function ol(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function sl(e,t){return e.getFullYear()===t.getFullYear()}function cl(e,t){let n=`${e.getMonth()+1}月${e.getDate()}日`;return sl(e,t)?n:`${e.getFullYear()}年${n}`}function ll(e,t=l(),n=new Date){if(!e)return`-`;let r=e instanceof Date?e:new Date(e);if(Number.isNaN(r.getTime()))return typeof e==`string`?e:`-`;let i=v(t),a=ol(r),o=ol(n),s=Math.floor((o-a)/864e5);if(s===0)return new Intl.DateTimeFormat(i,{hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(r);if(s===1)return b(`chatSidebarYesterday`,t);if(s>1&&s<7)return new Intl.DateTimeFormat(i,{weekday:`long`}).format(r);if(t===`zh`)return cl(r,n);let c=sl(r,n)?{month:`numeric`,day:`numeric`}:{year:`numeric`,month:`numeric`,day:`numeric`};return new Intl.DateTimeFormat(i,c).format(r)}function ul(e){return e.trim().toLowerCase()}function dl(e,t){let n=ul(t);return n?[e.key,il(e),e.projectRoot??``,e.projectName??``].map(ul).some(e=>e.includes(n)):!0}var fl=function(e){return e.CALL=`call`,e.RESULT=`result`,e.PARTIAL_CALL=`partial-call`,e.ERROR=`error`,e.CANCELLED=`cancelled`,e}({});function pl(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function ml(e){return pl(e)}function hl(e){let t=pl(e);if(!t)return null;let n=t.replace(/[\\/]+$/,``);if(!n)return t;let r=n.split(/[\\/]/).filter(Boolean);return r[r.length-1]??n}function gl(e){return/^[A-Za-z]:[\\/]?$/.test(e)||e===`/`?e:e.replace(/[\\/]+$/,``)}function _l(e){let t=gl(e.trim().replace(/\\/g,`/`));return/^[A-Za-z]:/.test(t)?`${t.slice(0,1).toLowerCase()}${t.slice(1)}`:t}function vl(e,t){if(!e)return t.join(`/`);let n=gl(e.trim().replace(/\\/g,`/`));return t.length===0?n:n===`/`?`/${t.join(`/`)}`:`${n}/${t.join(`/`)}`}function yl(e){let t=gl(e.trim().replace(/\\/g,`/`));if(!t||t===`/`||/^[A-Za-z]:[\\/]?$/.test(t))return null;let n=t.lastIndexOf(`/`);if(n<0)return null;if(n===0)return`/`;let r=t.slice(0,n);return/^[A-Za-z]:$/.test(r)?`${r}/`:r}function bl(e){let t=e.trim().replace(/\\/g,`/`);return t?/^[A-Za-z]:\//.test(t)?{prefix:t.slice(0,2),segments:t.slice(3).split(`/`).filter(Boolean)}:t.startsWith(`/`)?{prefix:`/`,segments:t.slice(1).split(`/`).filter(Boolean)}:{prefix:null,segments:t.split(`/`).filter(Boolean)}:{prefix:null,segments:[]}}function xl(e){let t=_l(e.path),n=_l(e.sessionProjectRoot);if(!t||!n)return null;if(!t.startsWith(`/`)&&!/^[A-Za-z]:\//.test(t))return t.split(`/`).filter(Boolean);if(t===n)return[];let r=n.endsWith(`/`)?n:`${n}/`;return t.startsWith(r)?t.slice(r.length).split(`/`).filter(Boolean):null}function Sl(e){let{basePath:t=null,currentKind:n=`file`,labels:r,leading:i=null}=e,a=r.map((e,i)=>{let a=i===r.length-1?n:`directory`,o=vl(t,r.slice(0,i+1));return{key:`${i}:${e}`,label:e,kind:a,path:o,browsePath:a===`file`?yl(o):o,isCurrent:i===r.length-1}});return i?[i,...a]:a}function Cl(e){let{kind:t=`file`,path:n,sessionProjectRoot:r,truncated:i}=e,a=n.trim(),o=r?.trim()&&a?xl({path:a,sessionProjectRoot:r}):null,s;if(r?.trim()&&o){let e=r.trim(),n=hl(e)??e;s=Sl({labels:o,basePath:e,currentKind:t,leading:{key:`workspace:${n}`,label:n,kind:`workspace`,path:e,browsePath:e,isCurrent:o.length===0}})}else{let{prefix:e,segments:n}=bl(a),r=e===`/`?`/`:e?`${e}/`:null;s=Sl({labels:n,basePath:r,currentKind:t,leading:e?{key:`root:${e}`,label:e,kind:`root`,path:r??e,browsePath:r??e,isCurrent:n.length===0}:null})}return s.length===0&&(s=[{key:`file:unknown`,label:a||`file`,kind:t,path:a,browsePath:t===`directory`?a:yl(a),isCurrent:!0}]),{fullPath:a,truncated:i,segments:s}}var wl=new Set([`off`,`minimal`,`low`,`medium`,`high`,`adaptive`,`xhigh`]),Tl=new Set([`running`,`completed`,`failed`,`cancelled`,`idle`]);function El(e){if(typeof e==`string`)return e;try{return JSON.stringify(e??{})}catch{return String(e??``)}}function Dl(e){return`${ue}/api/ncp/assets/content?${new URLSearchParams({uri:e}).toString()}`}function Ol(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function kl(e){let{metadata:t}=e;return!t||typeof t!=`object`||Array.isArray(t)?null:t}function Al(e){let t=kl(e)?.last_activity_preview;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,{state:r}=n,i=Ol(n.timestamp);if(!Tl.has(r)||!i)return null;let a=Ol(n.statusText),o=Ol(n.replyText);return{state:r,timestamp:i,...a?{statusText:a}:{},...o?{replyText:o}:{}}}function jl(e){let t=kl(e);return t?Ol(t.preferred_model)??Ol(t.preferredModel)??Ol(t.model):null}function Ml(e){let t=kl(e);if(!t)return null;let n=Ol(t.preferred_thinking)??Ol(t.thinking)??Ol(t.thinking_level)??Ol(t.thinkingLevel);if(!n)return null;let r=n.toLowerCase();return wl.has(r)?r:null}function Nl(e){let t=kl(e);return t?Ol(t.label):null}function Pl(e){let t=kl(e);return t?ml(t.project_root??t.projectRoot):null}function Fl(e){return Ol(e.workingDir)}function Il(e){let t=kl(e);return t?Ol(t.ui_last_read_at):null}function Ll(e){let t=kl(e);return t?Ol(t.runtime)??Ol(t.session_type)??Ol(t.sessionType)??`native`:`native`}function Rl(e){let t=kl(e);return t?Ol(t.parent_session_id)??Ol(t.parentSessionId):null}function zl(e){let t=kl(e);return t?Ol(t.spawned_by_request_id)??Ol(t.spawnedByRequestId):null}function Bl(e){let t=kl(e);return t?t.child_session_promoted===!0:!1}function Vl(e){if(e.startsWith(`cron:`))return{type:`cron`};if(e.startsWith(`agent:`)){let t=e.split(`:`);if(t.length>=3){let e=t[2];if(e&&e!==`main`&&e!==`direct`)return{channel:e}}}return{}}function Hl(e){return e.state===`cancelled`?fl.CANCELLED:e.state===`result`?fl.RESULT:e.state===`partial-call`?fl.PARTIAL_CALL:fl.CALL}function Ul(e){let t=[];for(let n of e){if(n.type===`text`){t.push({type:`text`,text:n.text});continue}if(n.type===`rich-text`){t.push({type:`text`,text:n.text});continue}if(n.type===`reasoning`){t.push({type:`reasoning`,reasoning:n.text,details:[]});continue}if(n.type===`source`){t.push({type:`source`,source:{sourceType:`url`,id:n.url??n.title??Math.random().toString(36).slice(2,8),url:n.url??``,...n.title?{title:n.title}:{}}});continue}if(n.type===`file`&&n.contentBase64){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:n.contentBase64,...n.url?{url:n.url}:{},...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`file`&&n.url){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:``,url:n.url,...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`file`&&n.assetUri){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:``,url:Dl(n.assetUri),...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`step-start`){t.push({type:`step-start`});continue}n.type===`tool-invocation`&&t.push({type:`tool-invocation`,toolInvocation:{status:Hl(n),toolCallId:n.toolCallId??`${n.toolName}-${Math.random().toString(36).slice(2,8)}`,toolName:n.toolName,args:El(n.args),result:n.result}})}return t}function Wl(e){return e===`service`?`system`:e===`tool`?`assistant`:e}function Gl(e){return{id:e.id,role:Wl(e.role),parts:Ul(e.parts),meta:{source:`stream`,status:e.status,sessionKey:e.sessionId,timestamp:e.timestamp}}}function Kl(e){let t=kl(e),n=Nl(e),r=jl(e),i=Ml(e),a=Pl(e),o=Fl(e)??a,s=Il(e),c=Ol(e.lastMessageAt),l=hl(a),u=Vl(e.sessionId),d=Rl(e),f=zl(e),p=Bl(e),m=Al(e);return{key:e.sessionId,createdAt:e.createdAt??e.updatedAt,updatedAt:e.updatedAt,...c?{lastMessageAt:c}:{},...s?{readAt:s}:{},...typeof e.agentId==`string`&&e.agentId.trim().length>0?{agentId:e.agentId.trim()}:{},...n?{label:n}:{},...u,...r?{preferredModel:r}:{},...i?{preferredThinking:i}:{},...a?{projectRoot:a}:{},...o?{workingDir:o}:{},...l?{projectName:l}:{},...t?{metadata:t}:{},sessionType:Ll(e),sessionTypeMutable:!1,status:e.status??`idle`,isChildSession:!!d,...p?{isPromotedChildSession:p}:{},...d?{parentSessionId:d}:{},...f?{spawnedByRequestId:f}:{},...m?{activityPreview:m}:{},messageCount:e.messageCount}}function ql(e){return e.map(Kl)}var Jl=`nextclaw.chat.session-list.mode`,Yl=`time-first`;function Xl(e){return e===`time-first`||e===`project-first`}function Zl(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean))]:[]}function Ql(e){if(!e||typeof e!=`object`)return null;let{snapshot:t}=e;return!t||typeof t!=`object`?null:Xl(t.listMode)?t.listMode:null}function $l(e,t){let n=e?.trim();if(!n)return!1;let r=t?.trim();return r?n.localeCompare(r)>0:!1}function eu(e){let{active:t,readAt:n,runStatus:r,lastMessageAt:i}=e;return t||r===`running`?!1:$l(i,n)}var tu={selectedSessionKey:null,selectedAgentId:`main`,query:``,listMode:Yl,pinnedSessionKeys:[],pinnedProjectRoots:[],collapsedProjectRoots:[]};function nu(e){return t=>e(e=>({snapshot:{...e.snapshot,...t}}))}function ru(e){return(t,n)=>e(e=>{let r=t.trim(),i=n?.trim();if(!r||!i)return e;let a=e.optimisticReadAtBySessionKey[r];return a&&a.localeCompare(i)>=0?e:{...e,optimisticReadAtBySessionKey:{...e.optimisticReadAtBySessionKey,[r]:i}}})}var z=x()(Zn(e=>({snapshot:tu,optimisticReadAtBySessionKey:{},setSnapshot:nu(e),markSessionRead:ru(e)}),{name:Jl,storage:Qn(()=>window.localStorage),partialize:e=>({snapshot:{listMode:e.snapshot.listMode,pinnedSessionKeys:e.snapshot.pinnedSessionKeys,pinnedProjectRoots:e.snapshot.pinnedProjectRoots,collapsedProjectRoots:e.snapshot.collapsedProjectRoots}}),merge:(e,t)=>{if(!e||typeof e!=`object`)return t;let{snapshot:n}=e,r=Ql(e);return{...t,snapshot:{...t.snapshot,...r?{listMode:r}:{},pinnedSessionKeys:Zl(n?.pinnedSessionKeys),pinnedProjectRoots:Zl(n?.pinnedProjectRoots),collapsedProjectRoots:Zl(n?.collapsedProjectRoots)}}}})),iu={staleTime:5e3,retry:!1};function au(e){return O({queryKey:[`ncp-sessions`,e?.limit??null,e?.peerId?.trim()||null],queryFn:()=>j(e),...iu})}function ou(e){return O({queryKey:[`ncp-session-skills`,e.sessionId,e.projectRoot??null],queryFn:()=>M(e.sessionId,{...Object.prototype.hasOwnProperty.call(e,`projectRoot`)?{projectRoot:e.projectRoot??null}:{}}),enabled:!!e.sessionId,...iu})}function su(e,t){return e.filter(e=>dl(e,t))}function cu(e){return e.isChildSession?e.isPromotedChildSession===!0:!0}function lu(e={}){let t=z(e=>e.snapshot.query),n=e.query??t,r=au({limit:e.limit??200}),i=(0,L.useMemo)(()=>su(ql(r.data?.sessions??[]).filter(cu),n).map(e=>({session:e,runStatus:e.status===`running`?`running`:void 0})),[n,r.data?.sessions]);return{isLoading:r.isLoading,items:i}}function uu(e){return new Date(e.session.lastMessageAt??e.session.createdAt).getTime()}function du(e){return[...e].sort((e,t)=>uu(t)-uu(e))}function fu(e,t){return[...e].sort((e,n)=>Number(t.has(n.session.key))-Number(t.has(e.session.key))||uu(n)-uu(e))}function pu(e,t=new Set){let n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),i=r-864e5,a=r-7*864e5,o=[],s=[],c=[],l=[],u=e.filter(e=>!t.has(e.session.key)),d=fu(e.filter(e=>t.has(e.session.key)),t);for(let e of u){let t=uu(e);t>=r?o.push(e):t>=i?s.push(e):t>=a?c.push(e):l.push(e)}let f=[];return d.length>0&&f.push({label:b(`chatSidebarPinned`),items:d}),o.length>0&&f.push({label:b(`chatSidebarToday`),items:o}),s.length>0&&f.push({label:b(`chatSidebarYesterday`),items:s}),c.length>0&&f.push({label:b(`chatSidebarPrevious7Days`),items:c}),l.length>0&&f.push({label:b(`chatSidebarOlder`),items:l}),f}function mu(e,t=new Set,n=new Set,r=[]){let i=new Map;for(let e of r)i.set(e.rootPath,{projectRoot:e.rootPath,projectName:e.name,items:[],latestUpdatedAt:new Date(e.updatedAt).getTime(),isPinned:n.has(e.rootPath)});for(let t of e){let e=t.session.projectRoot?.trim();if(!e)continue;let r=i.get(e),a=uu(t);if(r){r.items.push(t),r.latestUpdatedAt=Math.max(r.latestUpdatedAt,a);continue}i.set(e,{projectRoot:e,projectName:t.session.projectName?.trim()||hl(e)||e,items:[t],latestUpdatedAt:a,isPinned:n.has(e)})}return[...i.values()].map(e=>({...e,items:fu(e.items,t)})).sort((e,t)=>Number(t.isPinned)-Number(e.isPinned)||t.latestUpdatedAt-e.latestUpdatedAt)}function hu(e){let t=new Map;for(let n of e){let e=n.session.parentSessionId?.trim();if(!e)continue;let r=t.get(e)??[];r.push(n),t.set(e,r)}for(let e of t.values())e.sort((e,t)=>uu(t)-uu(e));return t}function gu(e){if(e.label&&e.label.trim())return e.label.trim();let t=e.key.split(`:`);return t[t.length-1]||e.key}function _u({isProjectFirstView:e,onSelectMode:t}){return(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px]`,children:[(0,R.jsx)(`button`,{type:`button`,"aria-pressed":!e,onClick:()=>t(`time-first`),className:r(`transition-colors`,e?`text-muted-foreground/65 hover:text-muted-foreground`:`font-medium text-foreground`),children:b(`chatSidebarViewTime`)}),(0,R.jsx)(`span`,{className:`text-muted-foreground/35`,children:`/`}),(0,R.jsx)(`button`,{type:`button`,"aria-pressed":e,onClick:()=>t(`project-first`),className:r(`transition-colors`,e?`font-medium text-foreground`:`text-muted-foreground/65 hover:text-muted-foreground`),children:b(`chatSidebarViewProject`)})]})}var vu=`native`;function yu(e){return typeof e==`string`?e.trim().toLowerCase()||`native`:vu}function bu(e,t=vu){return yu(e?.runtime?.trim()||e?.engine?.trim()||t)}function xu(e,t){return e===`native`?b(`chatSessionTypeNative`):t?.trim()||e.trim().split(/[-_]+/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)||e}function Su(e){let t=new Map;for(let n of e){let e=yu(n.value);t.set(e,{value:e,label:n.label?.trim()||xu(e),icon:n.icon??null,ready:n.ready??!0,reason:n.reason??null,reasonMessage:n.reasonMessage??null,supportedModels:n.supportedModels,recommendedModel:n.recommendedModel??null,modelSelectionMode:n.modelSelectionMode??`nextclaw`,runtimeDefaultThinking:n.runtimeDefaultThinking??null,cta:n.cta??null})}return t.has(`native`)||t.set(vu,{value:vu,label:xu(vu),icon:null,ready:!0,reason:null,reasonMessage:null,supportedModels:void 0,recommendedModel:null,modelSelectionMode:`nextclaw`,runtimeDefaultThinking:null,cta:null}),Array.from(t.values()).sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}var Cu={wx:`weixin`,lark:`feishu`},wu={cron:{icon:`cron`}},Tu={codex:`chatSessionTypeCodex`,claude:`chatSessionTypeClaude`};function Eu(e){return e?.trim().toLowerCase()??``}function Du(e){return e.split(/[-_]+/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Ou(e,t){let n=Eu(e);if(!n||n===`native`)return null;let r=t.find(e=>Eu(e.value)===n);return r?.label.trim()?r.label.trim():Du(n)}function ku(e,t){let n=Eu(e);return!n||n===`native`?null:t.find(e=>Eu(e.value)===n)??null}function Au(e){let t=Eu(e);if(!t)return null;let n=Cu[t]??t;return jn(n)?n:null}function ju(e,t){let n=Au(e.channel??``);if(n)return{icon:{kind:`channel-logo`,channel:n},label:null};let r=wu[Eu(e.type)];if(r)return{icon:{kind:`symbol`,icon:r.icon},label:null};let i=Eu(e.sessionType),a=ku(i,t);if(a?.icon?.src?.trim())return{icon:{kind:`runtime-image`,src:a.icon.src,alt:a.icon.alt??null,name:a.label},label:null};let o=Tu[i];return o?{icon:null,label:b(o)}:{icon:null,label:a?.label?.trim()||Ou(e.sessionType,t)}}var Mu=`app://`;function Nu(e){let t=e.trim().replace(/^\/+/,``);if(!t)return null;let n=t.split(`/`);return n.some(e=>e.trim().length===0||e===`.`||e===`..`)?null:n.join(`/`)}function Pu(e){let t=e.trim();if(!t)return null;if(!t.startsWith(Mu))return t;let n=Nu(t.slice(6));return n?`/${n}`:null}function Fu({icon:e,className:t}){if(e.kind===`channel-logo`)return(0,R.jsx)(Iu,{channel:e.channel,className:t});if(e.kind===`runtime-image`){let n=Pu(e.src);return(0,R.jsx)(Yn,{name:e.name?.trim()||e.alt?.trim()||`runtime`,src:n??void 0,className:r(`h-[1.125rem] w-[1.125rem]`,t),imgClassName:`h-full w-full object-contain`,fallback:(0,R.jsx)(So,{className:r(`h-3 w-3 text-current`,t),strokeWidth:2.4})})}return(0,R.jsx)(_o,{className:r(`h-3.5 w-3.5`,t)})}function Iu({channel:e,className:t}){return(0,R.jsx)(Yn,{name:e,src:jn(e),className:r(`h-[1.125rem] w-[1.125rem]`,t),imgClassName:`h-full w-full object-contain`,fallback:(0,R.jsx)(So,{className:`h-3 w-3 text-muted-foreground`})})}function Lu({status:e,className:t}){let n=b(e===`running`?`sessionsRunStatusRunning`:`sessionsRunStatusQueued`);return(0,R.jsxs)(`span`,{className:r(`inline-flex h-3.5 w-3.5 items-center justify-center text-muted-foreground/70`,t),title:n,"aria-label":n,children:[(0,R.jsx)(Un,{className:`h-3 w-3 animate-spin`}),(0,R.jsx)(`span`,{className:`sr-only`,children:n})]})}function Ru({item:e,selectedSessionKey:t,optimisticReadAtBySessionKey:n,sessionTypeOptions:i,onSelect:a}){let{session:o,runStatus:s}=e,c=t===o.key,l=n[o.key],u=l&&o.readAt?l.localeCompare(o.readAt)>0?l:o.readAt:l??o.readAt,d=eu({active:c,lastMessageAt:o.lastMessageAt,readAt:u,runStatus:s}),f=al(o)??o.projectName??o.projectRoot??`${o.messageCount}`,p=ll(o.lastMessageAt??o.createdAt),m=ju(o,i);return(0,R.jsxs)(`button`,{type:`button`,"aria-current":c?`page`:void 0,className:r(`flex w-full min-w-0 items-start gap-2 rounded-lg px-2.5 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,c?`bg-accent text-accent-foreground`:`text-foreground hover:bg-accent/65 hover:text-accent-foreground`),onClick:()=>a(o.key),children:[(0,R.jsx)(`span`,{className:`relative mt-1 flex h-2.5 w-2.5 shrink-0 items-center justify-center`,children:d?(0,R.jsx)(`span`,{"aria-label":b(`chatSidebarUnread`),className:`h-1.5 w-1.5 rounded-full bg-primary`}):c?(0,R.jsx)(fn,{className:`h-3 w-3 text-primary`}):(0,R.jsx)(`span`,{className:`h-1 w-1 rounded-full bg-muted-foreground/45`})}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:il(o)}),m.label?(0,R.jsx)(`span`,{className:`shrink-0 rounded-full border border-border/70 px-1.5 py-0.5 text-[10px] font-semibold leading-none text-muted-foreground`,children:m.label}):null,m.icon?(0,R.jsx)(`span`,{className:`inline-flex h-[1.125rem] w-[1.125rem] shrink-0 items-center justify-center text-muted-foreground`,children:(0,R.jsx)(Fu,{icon:m.icon})}):null]}),(0,R.jsxs)(`span`,{className:`mt-0.5 flex min-w-0 items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:f}),(0,R.jsx)(`span`,{className:`shrink-0`,children:p})]})]}),s?(0,R.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:(0,R.jsx)(Lu,{status:s})}):null]})}function zu({items:e,selectedSessionKey:t,optimisticReadAtBySessionKey:n,sessionTypeOptions:i,onSelect:a,className:o}){return(0,R.jsx)(`div`,{className:r(`space-y-1`,o),children:e.map(e=>(0,R.jsx)(Ru,{item:e,selectedSessionKey:t,optimisticReadAtBySessionKey:n,sessionTypeOptions:i,onSelect:a},e.session.key))})}function Bu({group:e,...t}){return(0,R.jsxs)(`section`,{"aria-label":e.label,children:[(0,R.jsx)(`div`,{className:`px-2 py-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/70`,children:e.label}),(0,R.jsx)(zu,{items:e.items,...t})]})}function Vu({group:e,isCollapsed:t,onToggleCollapsed:n,...r}){let i=(0,L.useId)(),a=`${b(t?`chatSidebarExpandProject`:`chatSidebarCollapseProject`)} · ${e.projectName}`;return(0,R.jsxs)(`section`,{"aria-label":e.projectName,children:[(0,R.jsxs)(`button`,{type:`button`,"aria-controls":i,"aria-expanded":!t,"aria-label":a,className:`group flex h-10 w-full min-w-0 items-center gap-1.5 rounded-lg px-2 text-left text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>n(e.projectRoot),children:[(0,R.jsx)(as,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-medium uppercase tracking-wider`,title:e.projectRoot,children:e.projectName}),(0,R.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground/70`,children:e.items.length}),t?(0,R.jsx)(Ao,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):(0,R.jsx)(Wt,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`})]}),t?null:(0,R.jsx)(zu,{items:e.items,className:`mt-0.5`,...r})]})}function Hu({collapsedProjectRoots:e,dateGroups:t,isProjectFirstView:n,onToggleProjectCollapsed:r,projectGroups:i,...a}){return(0,R.jsx)(`div`,{className:`space-y-3`,children:n?i.map(t=>(0,R.jsx)(Vu,{group:t,isCollapsed:e.includes(t.projectRoot),onToggleCollapsed:r,...a},t.projectRoot)):t.map(e=>(0,R.jsx)(Bu,{group:e,...a},e.label))})}var Uu=x(e=>({snapshot:{},setSnapshot:t=>e(({snapshot:e})=>({snapshot:{...e,...t}}))})),Wu=[`projects`];function Gu(){return O({queryKey:Wu,queryFn:de,staleTime:3e4})}function Ku(){let e=Ke();return le({mutationFn:Ze,onSuccess:async()=>{await e.invalidateQueries({queryKey:Wu}),P.success(b(`chatProjectCreated`))},onError:e=>{P.error(`${b(`chatProjectCreateFailed`)}: ${e.message}`)}})}function qu(){let e=Ke();return le({mutationFn:we,onSuccess:async()=>{await e.invalidateQueries({queryKey:Wu}),P.success(b(`chatProjectExistingAdded`))},onError:e=>{P.error(`${b(`chatProjectExistingFailed`)}: ${e.message}`)}})}var Ju=`group inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-md px-1.5 py-1 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`;function Yu({title:e}){return(0,R.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:e})}function Xu({label:e}){return(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-xs text-muted-foreground`,children:[(0,R.jsx)(Cs,{className:`h-4 w-4 shrink-0 text-muted-foreground/55`}),(0,R.jsx)(`span`,{children:e})]})}function Zu(){return(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-xs text-muted-foreground`,children:[(0,R.jsx)(Un,{className:`h-4 w-4 shrink-0 animate-spin`}),(0,R.jsx)(`span`,{children:b(`sessionsLoading`)})]})}function Qu({selectedSessionKey:e,title:t}){let n=rl(),[i,a]=(0,L.useState)(!1),[o,s]=(0,L.useState)(``),c=z(e=>e.optimisticReadAtBySessionKey),l=z(e=>e.snapshot.pinnedSessionKeys),u=z(e=>e.snapshot.pinnedProjectRoots),d=z(e=>e.snapshot.collapsedProjectRoots),f=z(e=>e.snapshot.listMode),p=Uu(e=>e.snapshot.sessionTypesQuery?.data??null),{isLoading:m,items:h}=lu({query:o}),g=Gu(),_=(0,L.useMemo)(()=>{let e=o.trim().toLowerCase(),t=g.data?.projects??[];return e?t.filter(t=>t.name.toLowerCase().includes(e)||t.rootPath.toLowerCase().includes(e)):t},[g.data?.projects,o]),v=(0,L.useMemo)(()=>du(h),[h]),y=(0,L.useMemo)(()=>pu(v,new Set(l)),[l,v]),x=(0,L.useMemo)(()=>mu(v,new Set(l),new Set(u),_),[u,l,v,_]),S=(0,L.useMemo)(()=>Su(p?.options??[]),[p?.options]),C=t=>{a(!1),s(``),t!==e&&n.chatSessionListManager.selectSession(t)},w=e=>{a(e),e||s(``)},T={selectedSessionKey:e,optimisticReadAtBySessionKey:c,sessionTypeOptions:S,onSelect:C},E=f===`project-first`,D=E?x.length>0:y.length>0;return(0,R.jsxs)(ct,{open:i,onOpenChange:w,children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"aria-label":`${b(`chatSessionSwitch`)}: ${t}`,"aria-expanded":i,className:Ju,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,R.jsx)(Wt,{className:r(`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-hover:text-accent-foreground`,i?`rotate-180`:null)})]})}),(0,R.jsxs)(ot,{align:`start`,className:`w-[22rem] max-w-[calc(100vw-2rem)] p-0`,children:[(0,R.jsxs)(`div`,{className:`space-y-2 border-b border-border px-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,R.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground/75`,children:b(`chatSessionSwitcherTitle`)}),(0,R.jsx)(_u,{isProjectFirstView:E,onSelectMode:n.chatSessionListManager.setListMode})]}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(Tt,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/65`}),(0,R.jsx)(ae,{value:o,onChange:e=>s(e.target.value),placeholder:b(`chatSearchSessionPlaceholder`),"aria-label":b(`chatSearchSessionPlaceholder`),className:`h-8 rounded-lg bg-background pl-8 pr-2 text-xs`,autoFocus:!0})]})]}),(0,R.jsx)(`div`,{className:`max-h-80 overflow-y-auto p-1.5`,children:m?(0,R.jsx)(Zu,{}):D?(0,R.jsx)(Hu,{collapsedProjectRoots:d,dateGroups:y,isProjectFirstView:E,onToggleProjectCollapsed:n.chatSessionListManager.toggleProjectCollapsed,projectGroups:x,...T}):(0,R.jsx)(Xu,{label:o.trim()?b(`chatSessionSwitcherNoResults`):b(E?`chatSidebarProjectViewEmpty`:`sessionsEmpty`)})})]})]})}function $u({layoutMode:e,selectedSessionKey:t,title:n}){let r=Vn(e=>e.isSidebarCollapsed);return e===`desktop`&&!r?(0,R.jsx)(Yu,{title:n}):(0,R.jsx)(Qu,{selectedSessionKey:t,title:n})}var ed=xe.chat.newSessionType,td=[`preference`,ed];function nd(e,t){let n=yu(e);return t.find(e=>e.value===n&&e.ready!==!1)??null}function rd(e){let{defaultSessionType:t,preferredSessionType:n,sessionTypeOptions:r}=e,i=n?nd(n,r):null,a=nd(t,r);return i??a??r.find(e=>e.ready!==!1)??r[0]??{value:yu(t),label:yu(t),icon:null,ready:!0,reason:null,reasonMessage:null,supportedModels:void 0,recommendedModel:null,modelSelectionMode:`nextclaw`,runtimeDefaultThinking:null,cta:null}}function id(e){return typeof e?.value==`string`?yu(e.value):null}function ad({defaultSessionType:e,sessionTypeOptions:t}){let n=Ke(),r=O({queryKey:td,queryFn:()=>qe(ed),staleTime:3e4,retry:!1}),i=(0,L.useMemo)(()=>id(r.data),[r.data]),a=(0,L.useMemo)(()=>rd({preferredSessionType:i,defaultSessionType:e,sessionTypeOptions:t}),[e,i,t]),o=le({mutationFn:async e=>await Qe(ed,yu(e)),onMutate:async e=>{let t=yu(e);await n.cancelQueries({queryKey:td});let r=n.getQueryData(td);return n.setQueryData(td,{key:ed,value:t,updatedAt:new Date().toISOString()}),{previous:r}},onError:(e,t,r)=>{r?.previous&&n.setQueryData(td,r.previous)},onSuccess:e=>{n.setQueryData(td,e)}}),s=(0,L.useCallback)(e=>{let n=nd(e,t);n&&o.mutate(n.value)},[t,o]);return{selectedSessionType:a.value,selectedSessionTypeOption:a,isLoading:r.isLoading,setSelectedSessionType:s}}var od=[];function sd(){let e=Uu(e=>!!(e.snapshot.configQuery?.isFetched||e.snapshot.configQuery?.isSuccess)),t=Uu(e=>!!(e.snapshot.providersQuery?.isFetched||e.snapshot.providersQuery?.isSuccess)),n=Uu(e=>!!(e.snapshot.providerTemplatesQuery?.isFetched||e.snapshot.providerTemplatesQuery?.isSuccess));return e&&t&&n}function cd(e){let t=Uu(e=>e.snapshot.sessionsQuery?.data?.sessions??od),n=(0,L.useMemo)(()=>ql(t),[t]);return(0,L.useMemo)(()=>n.find(t=>t.key===e)??null,[n,e])}function ld(e){return!!e&&typeof e==`object`}function ud(e){return typeof e==`string`&&e.trim().length>0?e.trim():null}function dd(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function fd(e){return typeof e==`string`?e:null}function pd(e){return e===`auto`||e===`source`||e===`rendered`?e:null}function md(e){try{return f(e)??null}catch{return null}}function hd(e){if(!ld(e)||typeof e.key!=`string`||typeof e.path!=`string`||e.viewMode!==`preview`&&e.viewMode!==`diff`)return null;let t=e.key.trim(),n=e.path.trim();return!t||!n?null:{key:t,parentSessionKey:ud(e.parentSessionKey),path:n,label:ud(e.label),viewMode:e.viewMode,previewViewer:pd(e.previewViewer),line:dd(e.line),column:dd(e.column),params:md(e.params),rawText:fd(e.rawText),contentUrl:ud(e.contentUrl),mimeType:ud(e.mimeType),beforeText:fd(e.beforeText),afterText:fd(e.afterText),patchText:fd(e.patchText),oldStartLine:dd(e.oldStartLine),newStartLine:dd(e.newStartLine)}}function gd(e){return{key:e.key,parentSessionKey:e.parentSessionKey,path:e.path,label:e.label,viewMode:e.viewMode,previewViewer:e.previewViewer,line:e.line,column:e.column,params:e.params,rawText:e.rawText,contentUrl:e.contentUrl,mimeType:e.mimeType,beforeText:e.beforeText,afterText:e.afterText,patchText:e.patchText,oldStartLine:e.oldStartLine,newStartLine:e.newStartLine}}function _d(e,t,n){let r=e.slice(0,n),i=t?e.find(e=>e.key===t):null;return!i||r.some(e=>e.key===i.key)?r:r.length<n?[...r,i]:[...r.slice(0,-1),i]}function vd(e){return typeof e!=`number`||!Number.isFinite(e)?480:Math.max(360,Math.min(860,e))}function yd(e){return e.index>0&&e.entries.length>0}function bd(e){return e.index>=0&&e.index<e.entries.length-1}function xd(e,t,n=Object.is){let r=wd(e),i=e.entries[r];if(i&&n(i,t))return{entries:e.entries,index:r};let a=[...e.entries.slice(0,r+1),t];return{entries:a,index:a.length-1}}function Sd(e,t){let n=wd(e),r=t===`back`?n-1:n+1,i=e.entries[r];return i?{history:{entries:e.entries,index:r},entry:i}:null}function Cd(e,t,n){let r=wd(e),i=e.entries.filter(t);if(i.length===0)return n===void 0?{entries:[],index:0}:{entries:[n],index:0};let a=e.entries.slice(0,r+1).filter(t);return{entries:i,index:Math.min(Math.max(0,a.length-1),i.length-1)}}function wd(e){return e.entries.length===0?0:Number.isInteger(e.index)?Math.min(Math.max(0,e.index),e.entries.length-1):e.entries.length-1}function Td(e,t){return e.kind===t.kind?e.kind===`overview`||e.kind===`child-sessions`||e.kind===`project-files`||e.kind===`cron`?!0:t.kind!==`overview`&&t.kind!==`child-sessions`&&t.kind!==`project-files`&&t.kind!==`cron`&&e.key===t.key:!1}function Ed(e){let{activeChildSessionKey:t,activeSideChatDraft:n,activeWorkspaceFileKey:r,activeWorkspacePanelKind:i}=e;return i===`overview`||i===`child-sessions`||i===`project-files`||i===`cron`?{kind:i}:i===`child-session`&&t?{kind:`child-session`,key:t}:i===`side-chat-draft`&&n?{kind:`side-chat-draft`,key:n.draftKey}:i===`file`&&r?{kind:`file`,key:r}:null}function Dd(e,t){if(e.kind===`overview`||e.kind===`child-sessions`||e.kind===`project-files`)return{activeWorkspacePanelKind:e.kind,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null};if(e.kind===`cron`)return{activeWorkspacePanelKind:`cron`,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null};if(e.kind===`file`)return t.workspaceFileTabs.some(t=>t.key===e.key)?{activeWorkspacePanelKind:`file`,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:e.key}:null;if(e.kind===`side-chat-draft`){let{activeSideChatDraft:n}=t;return n?.draftKey===e.key?{activeWorkspacePanelKind:`side-chat-draft`,activeChildSessionKey:null,activeSideChatDraft:n,activeWorkspaceFileKey:null}:null}return{activeWorkspacePanelKind:`child-session`,activeChildSessionKey:e.key,activeSideChatDraft:null,activeWorkspaceFileKey:null}}function Od(e,t){if(t.kind===`overview`||t.kind===`child-sessions`||t.kind===`cron`||t.kind===`project-files`)return null;let n=Cd({entries:e.workspaceNavigationHistory,index:e.workspaceNavigationHistoryIndex},e=>!Td(e,t),{kind:`overview`}),r={closedWorkspaceTabEntries:t.kind!==`file`&&t.kind!==`side-chat-draft`?[...e.closedWorkspaceTabEntries.filter(e=>!Td(e,t)),t]:e.closedWorkspaceTabEntries,childSessionTabs:t.kind===`child-session`?e.childSessionTabs.filter(e=>e.sessionKey!==t.key):e.childSessionTabs,activeSideChatDraft:t.kind===`side-chat-draft`?null:e.activeSideChatDraft,workspaceFileTabs:t.kind===`file`?e.workspaceFileTabs.filter(e=>e.key!==t.key):e.workspaceFileTabs,workspaceNavigationHistory:[...n.entries],workspaceNavigationHistoryIndex:n.index},i=Ed(e);if(!i||!Td(i,t))return r;let a=Dd(n.entries[n.index]??{kind:`overview`},{...e,...r});return{...r,...a??Dd({kind:`overview`},e)}}function kd(e){return{draftKey:`side-chat-draft:${e}:${typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}`,parentSessionKey:e}}function Ad(e,t){let n=e.findIndex(e=>e.sessionKey===t.sessionKey);if(n===-1)return[t,...e];let r=e[n],i=[...e];return i[n]={...r,parentSessionKey:r.parentSessionKey??t.parentSessionKey,label:r.label?.trim()?r.label:t.label,agentId:r.agentId?.trim()?r.agentId:t.agentId},i}function jd(e){let{agentId:t,draftKey:n,label:r,sessionKey:i,snapshot:a}=e,o=i.trim(),s=n.trim(),{activeSideChatDraft:c}=a;if(!o||!s||c?.draftKey!==s)return null;let{parentSessionKey:l}=c,u=xd(Cd({entries:a.workspaceNavigationHistory,index:a.workspaceNavigationHistoryIndex},e=>e.kind!==`side-chat-draft`||e.key!==s),{kind:`child-session`,key:o},Td);return{parentSessionKey:l,patch:{workspacePanelParentKey:l,activeWorkspacePanelKind:`child-session`,activeChildSessionKey:o,activeSideChatDraft:null,activeWorkspaceFileKey:null,childSessionTabs:Ad(a.childSessionTabs,{sessionKey:o,parentSessionKey:l,label:r?.trim()||null,agentId:t?.trim()||null}),workspaceNavigationHistory:[...u.entries],workspaceNavigationHistoryIndex:u.index}}}var Md=`nextclaw.chat.workspace-panel.state`,Nd=2,Pd=8,Fd={sessionTypeLabel:null,sessionTypeIcon:null,sessionKey:null,agentId:null,sessionDisplayName:void 0,sessionProjectRoot:null,sessionWorkingDir:null,sessionProjectName:null,canDeleteSession:!1,isDeletePending:!1,isHistoryLoading:!1,messages:[],isSending:!1,isAwaitingAssistantOutput:!1,hasSubmittedDraftMessage:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeSideChatDraft:null,workspaceFileTabs:[],activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0,workspacePanelWidth:480,contextWindow:null};function Id(e){return!!e&&typeof e==`object`}function Ld(e){return typeof e==`string`&&e.trim().length>0?e.trim():null}function Rd(e,t){return typeof e==`number`&&Number.isInteger(e)?Math.min(Math.max(0,e),t):t}function zd(e){return e===`overview`||e===`child-sessions`||e===`child-session`||e===`project-files`||e===`file`||e===`cron`}function Bd(e){if(!Id(e))return null;if(e.kind===`overview`||e.kind===`child-sessions`||e.kind===`project-files`||e.kind===`cron`)return{kind:e.kind};let t=Ld(e.key);return!t||e.kind!==`child-session`&&e.kind!==`file`?null:{kind:e.kind,key:t}}function Vd(e){if(!Id(e))return null;let t=Ld(e.workspacePanelParentKey),n=Ld(e.activeWorkspaceFileKey),r=_d(Array.isArray(e.workspaceFileTabs)?e.workspaceFileTabs.map(hd).filter(e=>e!==null):[],n,Pd),i=r.filter(e=>e.parentSessionKey===t),a=n&&i.some(e=>e.key===n)?n:i[0]?.key??null,o=zd(e.activeWorkspacePanelKind)?e.activeWorkspacePanelKind:null,s=o===`file`&&!a?null:o,c=Ld(e.activeChildSessionKey),l=Array.isArray(e.closedWorkspaceTabEntries)?e.closedWorkspaceTabEntries.map(Bd).filter(e=>e!==null&&e.kind!==`overview`):[],u=Ed({activeWorkspacePanelKind:s,activeChildSessionKey:c,activeSideChatDraft:null,activeWorkspaceFileKey:a}),d=Array.isArray(e.workspaceNavigationHistory)?e.workspaceNavigationHistory.map(Bd).filter(e=>e!==null).filter(e=>e.kind!==`file`||r.some(t=>t.key===e.key)):[],f=d.length>0?d:u?[u]:[];return{workspacePanelParentKey:t,activeWorkspacePanelKind:s,activeChildSessionKey:c,workspaceFileTabs:r,activeWorkspaceFileKey:a,closedWorkspaceTabEntries:l,workspaceNavigationHistory:f,workspaceNavigationHistoryIndex:f.length>0?Rd(e.workspaceNavigationHistoryIndex,f.length-1):0,workspacePanelWidth:vd(e.workspacePanelWidth)}}var Hd=x()(Zn(e=>({snapshot:Fd,setSnapshot:t=>e(e=>({snapshot:{...e.snapshot,...t}}))}),{name:Md,version:Nd,storage:Qn(()=>window.localStorage),partialize:e=>{let t=e.snapshot.workspaceNavigationHistory.filter(e=>e.kind!==`side-chat-draft`),n=t.length>0?Math.min(e.snapshot.workspaceNavigationHistoryIndex,t.length-1):0;return{snapshot:{workspacePanelParentKey:e.snapshot.workspacePanelParentKey,activeWorkspacePanelKind:e.snapshot.activeWorkspacePanelKind===`side-chat-draft`?null:e.snapshot.activeWorkspacePanelKind,activeChildSessionKey:e.snapshot.activeChildSessionKey,workspaceFileTabs:_d(e.snapshot.workspaceFileTabs,e.snapshot.activeWorkspaceFileKey,Pd).map(gd),activeWorkspaceFileKey:e.snapshot.activeWorkspaceFileKey,closedWorkspaceTabEntries:e.snapshot.closedWorkspaceTabEntries.filter(e=>e.kind!==`overview`&&e.kind!==`side-chat-draft`),workspaceNavigationHistory:t,workspaceNavigationHistoryIndex:n,workspacePanelWidth:e.snapshot.workspacePanelWidth}}},merge:(e,t)=>{let n=Vd(Id(e)?e.snapshot:null);return n?{...t,snapshot:{...t.snapshot,...n}}:t}})),Ud=[[`bg-amber-100`,`text-amber-700`],[`bg-emerald-100`,`text-emerald-700`],[`bg-blue-100`,`text-blue-700`],[`bg-rose-100`,`text-rose-700`],[`bg-cyan-100`,`text-cyan-700`],[`bg-violet-100`,`text-violet-700`]];function Wd(e){let t=0;for(let n=0;n<e.length;n+=1)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}function Gd({agentId:e,displayName:t,avatarUrl:n,className:i}){let a=t?.trim()||e,o=e.trim().toLowerCase()===`main`,[s,c]=Ud[Wd(e)%Ud.length]??Ud[0],l=o?`bg-primary`:s,u=o?`text-primary-foreground`:c;return n?.trim()?(0,R.jsx)(`img`,{src:n,alt:t?.trim()||e,className:r(`rounded-full object-cover`,i)}):(0,R.jsx)(`div`,{className:r(`rounded-full flex items-center justify-center font-semibold`,l,u,i),"aria-label":t?.trim()||e,children:o?(0,R.jsx)(So,{className:`h-[55%] w-[55%]`,strokeWidth:2.4}):(a.trim()||`A`).slice(0,1).toUpperCase()})}function Kd(){return O({queryKey:[`agents`],queryFn:ke,staleTime:3e4})}function qd(){let e=Ke();return le({mutationFn:({agentId:e,data:t})=>Se(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`agents`]}),e.invalidateQueries({queryKey:[`config`]}),P.success(b(`configSavedApplied`))},onError:e=>{P.error(b(`configSaveFailed`)+`: `+e.message)}})}function Jd(){let e=Ke();return le({mutationFn:({agentId:e})=>je(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`agents`]}),e.invalidateQueries({queryKey:[`config`]}),P.success(b(`configSavedApplied`))},onError:e=>{P.error(b(`configSaveFailed`)+`: `+e.message)}})}function Yd(e){return new Map(e.filter(e=>typeof e.id==`string`&&e.id.trim().length>0).map(e=>[e.id,e]))}function Xd(e){let t=e?.trim()??``,n=Kd(),r=(0,L.useMemo)(()=>Yd(n.data?.agents??[]),[n.data?.agents]);return(0,L.useMemo)(()=>{if(!t)return null;let e=r.get(t)??null;return{agentId:t,profile:e,displayName:e?.displayName?.trim()||t,avatarUrl:e?.avatarUrl?.trim()||null}},[r,t])}function Zd({agentId:e,className:t}){let n=Xd(e);return n?(0,R.jsx)(Gd,{agentId:n.agentId,displayName:n.displayName,avatarUrl:n.avatarUrl,className:t}):null}function Qd({layoutMode:e,onBackToList:t}){let n=rl(),r=Hd(e=>e.snapshot),i=z(e=>e.snapshot.selectedSessionKey),a=z(e=>e.snapshot.selectedAgentId),o=Uu(e=>e.snapshot.sessionTypesQuery?.data??null),s=Uu(e=>e.snapshot.configQuery?.data??null),c=cd(i),l=(0,L.useMemo)(()=>Su(o?.options??[]),[o?.options]),u=yu(o?.defaultType??`native`),d=ad({defaultSessionType:u,sessionTypeOptions:l}),f=yu(c?.sessionType??u),p=l.find(e=>e.value===f)??null,m=p?.label??xu(f),h=f!==`native`&&!!m,g=c?.projectRoot??null,_=ml(s?.agents.defaults.workspace),v=c?.projectName??hl(g),y=!!c,x=!!(i||m),S=(c?il(c):void 0)||(y&&i?i:null)||b(`chatSidebarNewTask`),C=c?.agentId?.trim()??a?.trim()??``,w=C.length>0&&C.toLowerCase()!==`main`,T=!!(i&&r.workspacePanelParentKey===i&&r.activeWorkspacePanelKind);return(0,R.jsx)(Oc,{layoutMode:e,title:S,titleContent:(0,R.jsx)($u,{layoutMode:e,selectedSessionKey:i,title:S}),shouldShow:x,onBackToList:t,leading:w?(0,R.jsx)(`div`,{className:`inline-flex shrink-0 items-center`,children:(0,R.jsx)(Zd,{agentId:C,className:`h-5 w-5`})}):null,sessionTypeBadge:h?(0,R.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground`,children:[p?.icon?.src?(0,R.jsx)(`span`,{className:`inline-flex h-[1.125rem] w-[1.125rem] items-center justify-center`,children:(0,R.jsx)(Fu,{icon:{kind:`runtime-image`,src:p.icon.src,alt:p.icon.alt??null,name:m}})}):null,m]}):null,projectBadge:v?(0,R.jsx)(el,{sessionKey:i??`draft`,projectName:v,projectRoot:g,defaultWorkspacePath:_,persistToServer:y}):null,actions:i?(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[e===`mobile`?(0,R.jsx)(Nt,{icon:(0,R.jsx)(Ks,{className:`h-4 w-4`}),label:b(`chatSidebarNewTask`),tooltip:!1,onClick:()=>n.chatSessionListManager.createSession({sessionType:d.selectedSessionType})}):null,(0,R.jsx)(Qc,{sessionKey:i,canDeleteSession:y,isDeletePending:r.isDeletePending,currentPath:g??c?.workingDir??null,defaultWorkspacePath:_,metadata:c?.metadata??null,isWorkspaceOpen:T,onToggleWorkspace:()=>{i&&n.chatThreadManager.toggleWorkspacePanel(i)},onDeleteSession:n.chatThreadManager.deleteSession})]}):null})}function $d(){let e=rl(),t=Hd(e=>e.snapshot);return(0,R.jsx)(Dc,{parentSessionLabel:t.parentSessionKey?t.parentSessionLabel??null:null,onGoToParentSession:e.chatThreadManager.goToParentSession})}function ef(e,t){return e.label?.trim()?e.label.trim():t?il(t):e.sessionKey}function tf(e){let t=au({limit:200}),n=(0,L.useMemo)(()=>t.data?.sessions??[],[t.data?.sessions]),r=(0,L.useMemo)(()=>{let e=ql(n);return new Map(e.map(e=>[e.key,e]))},[n]);return(0,L.useMemo)(()=>e.map(e=>{let t=r.get(e.sessionKey)??null,n=e.agentId?.trim()||t?.agentId||null;return{sessionKey:e.sessionKey,parentSessionKey:e.parentSessionKey,title:ef(e,t),agentId:n,updatedAt:t?.updatedAt??null,lastMessageAt:t?.lastMessageAt??null,readAt:t?.readAt??null,runStatus:t?.status===`running`?`running`:void 0,sessionTypeLabel:t?.sessionType?xu(t.sessionType):null,preferredModel:t?.preferredModel?.trim()||null,projectName:t?.projectName?.trim()||null,projectRoot:t?.projectRoot?.trim()||null}}),[r,e])}function nf(e){return/\.html?$/i.test(e)?`html`:/\.mdx?$/i.test(e)?`markdown`:null}function rf(e,t){let n=nf(e);return n===`html`?t===`rendered`?`rendered`:`source`:n===`markdown`?t===`source`?`source`:`rendered`:t===`source`||t===`rendered`?t:null}function af(e,t){return rf(e,t)??t??null}function of(e,t){return nf(e)?rf(e,t)===`source`?`rendered`:`source`:null}function sf(e){let t=e.path.split(`/`).filter(Boolean).pop();return e.label?.trim()||t||e.path}function cf(e){let{activePanelKind:t,activeChildSessionKey:n,activeSideChatDraft:r,activeWorkspaceFileKey:i,childSessionTabs:a,workspaceFileTabs:o}=e;if(t===`overview`)return{kind:`overview`};if(t===`child-sessions`)return{kind:`child-sessions`};if(t===`project-files`)return{kind:`project-files`};if(t===`cron`)return{kind:`cron`};if(t===`side-chat-draft`&&r)return{kind:`side-chat-draft`,draft:r};if(t!==`child-session`&&i){let e=o.find(e=>e.key===i);if(e)return{kind:`file`,file:e}}if(t!==`file`&&n){let e=a.find(e=>e.sessionKey===n);if(e)return{kind:`child-session`,tab:e}}return a[0]?{kind:`child-session`,tab:a[0]}:r?{kind:`side-chat-draft`,draft:r}:o[0]?{kind:`file`,file:o[0]}:null}function lf({activeSelection:e,onSelectChildSessions:t,onSelectCronJobs:n,onSelectOverview:r,onSelectProjectFiles:i}){return[{key:`overview`,kind:`overview`,title:b(`chatWorkspaceOverview`),tooltip:b(`chatWorkspaceOverview`),active:e?.kind===`overview`,onSelect:r},{key:`child-sessions`,kind:`child-sessions`,title:b(`chatWorkspaceChildSessions`),tooltip:b(`chatWorkspaceChildSessions`),active:e?.kind===`child-sessions`,onSelect:t},{key:`cron:session`,kind:`cron`,title:b(`chatWorkspaceSessionCronJobs`),tooltip:b(`chatWorkspaceSessionCronJobs`),active:e?.kind===`cron`,onSelect:n},{key:`project-files`,kind:`project-files`,title:b(`chatWorkspaceProjectFiles`),tooltip:b(`chatWorkspaceProjectFiles`),active:e?.kind===`project-files`,onSelect:i}]}function uf(e){let{activeSideChatDraft:t,closedWorkspaceTabEntries:n,resolvedChildTabs:r,workspaceFileTabs:i,activeSelection:a,optimisticReadAtBySessionKey:o,onSelectSession:s,onSelectFile:c,onOpenFileViewer:l,onCloseTab:u,onSelectOverview:d,onSelectChildSessions:f,onSelectProjectFiles:p,onSelectCronJobs:m}=e,h=lf({activeSelection:a,onSelectChildSessions:f,onSelectCronJobs:m,onSelectOverview:d,onSelectProjectFiles:p}),g=t?[{key:`side-chat-draft:${t.draftKey}`,kind:`side-chat-draft`,title:b(`chatWorkspaceSideChatDraftTitle`),tooltip:b(`chatWorkspaceSideChatDraftSubtitle`),active:a?.kind===`side-chat-draft`&&a.draft.draftKey===t.draftKey,onSelect:()=>void 0,onClose:()=>u({kind:`side-chat-draft`,key:t.draftKey})}]:[],_=r.filter(e=>!n.some(t=>Td(t,{kind:`child-session`,key:e.sessionKey}))).map(e=>{let t=o[e.sessionKey],n=t&&e.readAt?t.localeCompare(e.readAt)>0?t:e.readAt:t??e.readAt;return{key:`child:${e.sessionKey}`,kind:`child-session`,title:e.title,tooltip:e.title,agentId:e.agentId,active:a?.kind===`child-session`&&a.tab.sessionKey===e.sessionKey,showUnreadDot:eu({active:a?.kind===`child-session`&&a.tab.sessionKey===e.sessionKey,lastMessageAt:e.lastMessageAt,readAt:n,runStatus:e.runStatus}),onSelect:()=>s(e.sessionKey),onClose:()=>u({kind:`child-session`,key:e.sessionKey})}}),v=i.map(e=>{let t=e.viewMode===`preview`?rf(e.path,e.previewViewer):null,n=e.viewMode===`preview`?of(e.path,e.previewViewer):null,r=sf(e);return{key:`file:${e.key}`,kind:`file`,title:t===`rendered`?`${b(`chatWorkspacePreview`)}: ${r}`:r,tooltip:e.path,fileName:e.path,viewMode:e.viewMode,isRenderedPreview:t===`rendered`,alternateViewerAction:n?{label:b(n===`rendered`?`chatWorkspaceOpenPreview`:`chatWorkspaceOpenSource`),viewer:n,onSelect:()=>l(e.key,n)}:null,active:a?.kind===`file`&&a.file.key===e.key,onSelect:()=>c(e.key),onClose:()=>u({kind:`file`,key:e.key})}});return[...h,...g,..._,...v]}function df(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var ff=Object.freeze({left:0,top:0,width:16,height:16}),pf=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),mf=Object.freeze({...ff,...pf}),hf=Object.freeze({...mf,body:``,hidden:!1});function gf(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function _f(e,t){let n=gf(e,t);for(let r in hf)r in pf?r in e&&!(r in n)&&(n[r]=pf[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function vf(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=_f(r[e]||i[e],a)}return o(t),n.forEach(o),_f(e,a)}function yf(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=df(e);for(let i in r){let a=r[i];a&&(t(i,vf(e,i,a)),n.push(i))}return n}var bf={provider:``,aliases:{},not_found:{},...ff};function xf(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Sf(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!xf(e,bf))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!xf(t,hf))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!xf(t,hf))return null}return t}var Cf=Object.create(null);function wf(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Tf(e,t){let n=Cf[e]||(Cf[e]=Object.create(null));return n[t]||(n[t]=wf(e,t))}function Ef(e,t){return Sf(t)?yf(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function Df(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var Of=/^[a-z0-9]+(-[a-z0-9]+)*$/,kf=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!Af(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!Af(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!Af(e,n)?null:e}return null},Af=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,jf=!1;function Mf(e){return typeof e==`boolean`&&(jf=e),jf}function Nf(e){let t=typeof e==`string`?kf(e,!0,jf):e;if(t){let e=Tf(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function Pf(e,t){let n=kf(e,!0,jf);if(!n)return!1;let r=Tf(n.provider,n.prefix);return t?Df(r,n.name,t):(r.missing.add(n.name),!0)}function Ff(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),jf&&!t&&!e.prefix){let t=!1;return Sf(e)&&(e.prefix=``,yf(e,(e,n)=>{Pf(e,n)&&(t=!0)})),t}let n=e.prefix;return Af({prefix:n,name:`a`})?!!Ef(Tf(t,n),e):!1}var If=Object.freeze({width:null,height:null}),Lf=Object.freeze({...If,...pf}),Rf=/(-?[0-9.]*[0-9]+[0-9.]*)/g,zf=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Bf(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(Rf);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=zf.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function Vf(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Hf(e,t){return e?`<defs>`+e+`</defs>`+t:t}function Uf(e,t,n){let r=Vf(e);return Hf(r.defs,t+r.content+n)}var Wf=e=>e===`unset`||e===`undefined`||e===`none`;function Gf(e,t){let n={...mf,...e},r={...Lf,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=Uf(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=Bf(d,c/l)):(u=o===`auto`?c:o,d=s===null?Bf(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Wf(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Kf=/\sid="(\S+)"/g,qf=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Jf=0;function Yf(e,t=qf){let n=[],r;for(;r=Kf.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(Jf++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}var Xf=Object.create(null);function Zf(e,t){Xf[e]=t}function Qf(e){return Xf[e]||Xf[``]}function $f(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var ep=Object.create(null),tp=[`https://api.simplesvg.com`,`https://api.unisvg.com`],np=[];tp.length>0;)tp.length===1||Math.random()>.5?np.push(tp.shift()):np.push(tp.pop());ep[``]=$f({resources:[`https://api.iconify.design`].concat(np)});function rp(e,t){let n=$f(t);return n===null?!1:(ep[e]=n,!0)}function ip(e){return ep[e]}var ap=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function op(e,t){let n=ip(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function sp(e){return e===404}var cp=(e,t,n)=>{let r=[],i=op(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function lp(e){if(typeof e==`string`){let t=ip(e);if(t)return t.path}return`/`}var up={prepare:cp,send:(e,t,n)=>{if(!ap){n(`abort`,424);return}let r=lp(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;ap(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(sp(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function dp(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function fp(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||dp([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var pp=0;function mp(e,t,n){let r=pp++,i=dp.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function hp(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=Tf(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function gp(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?kf(e,t,n):e;i&&r.push(i)}),r}var _p={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function vp(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function yp(e){let t={..._p,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=vp(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function bp(){}var xp=Object.create(null);function Sp(e){if(!xp[e]){let t=ip(e);if(!t)return;xp[e]={config:t,redundancy:yp(t)}}return xp[e]}function Cp(e,t,n){let r,i;if(typeof e==`string`){let t=Qf(e);if(!t)return n(void 0,424),bp;i=t.send;let a=Sp(e);a&&(r=a.redundancy)}else{let t=$f(e);if(t){r=yp(t);let n=Qf(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),bp):r.query(t,i,n)().abort}function wp(){}function Tp(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,fp(e)}))}function Ep(e){let t=[],n=[];return e.forEach(e=>{(e.match(Of)?t:n).push(e)}),{valid:t,invalid:n}}function Dp(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!Ef(e,n).length){r();return}}catch(e){console.error(e)}r(),Tp(e)}function Op(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function kp(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){Op(e.loadIcons(r,n,t),t=>{Dp(e,r,t)});return}if(i){r.forEach(r=>{Op(i(r,n,t),t=>{Dp(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Ep(r);if(o.length&&Dp(e,o,null),!a.length)return;let s=n.match(Of)?Qf(t):null;if(!s){Dp(e,a,null);return}s.prepare(t,n,a).forEach(n=>{Cp(t,n,t=>{Dp(e,n.icons,t)})})}))}var Ap=(e,t)=>{let n=hp(gp(e,!0,Mf()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,wp)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(Tf(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=Tf(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&kp(e,t)}),t?mp(t,n,i):wp};function jp(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in If?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Mp=/[\s,]+/;function Np(e,t){t.split(Mp).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function Pp(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function Fp(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Ip(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Lp(e){return`data:image/svg+xml,`+Ip(e)}function Rp(e){return`url("`+Lp(e)+`")`}var zp;function Bp(){try{zp=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{zp=null}}function Vp(e){return zp===void 0&&Bp(),zp?zp.createHTML(e):e}var Hp={...Lf,inline:!1},Up={xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Wp={display:`inline-block`},Gp={backgroundColor:`currentColor`},Kp={backgroundColor:`transparent`},qp={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},Jp={WebkitMask:Gp,mask:Gp,background:Kp};for(let e in Jp){let t=Jp[e];for(let n in qp)t[e+n]=qp[n]}var Yp={...Hp,inline:!0};function Xp(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var Zp=(e,t,n)=>{let r=t.inline?Yp:Hp,i=jp(r,t),a=t.mode||`svg`,o={},s=t.style||{},c={...a===`svg`?Up:{}};if(n){let e=kf(n,!1,!0);if(e){let t=[`iconify`];for(let n of[`provider`,`prefix`])e[n]&&t.push(`iconify--`+e[n]);c.className=t.join(` `)}}for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`children`:case`onLoad`:case`mode`:case`ssr`:case`fallback`:break;case`_ref`:c.ref=n;break;case`className`:c[e]=(c[e]?c[e]+` `:``)+n;break;case`inline`:case`hFlip`:case`vFlip`:i[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&Np(i,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?i[e]=Pp(n):typeof n==`number`&&(i[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete c[`aria-hidden`];break;default:r[e]===void 0&&(c[e]=n)}}let l=Gf(e,i),u=l.attributes;if(i.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){c.style={...o,...s},Object.assign(c,u);let e=0,n=t.id;return typeof n==`string`&&(n=n.replace(/-/g,`_`)),c.dangerouslySetInnerHTML={__html:Vp(Yf(l.body,n?()=>n+`ID`+ e++:`iconifyReact`))},(0,L.createElement)(`svg`,c)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=Fp(d,{...u,width:f+``,height:p+``});return c.style={...o,"--svg":Rp(h),width:Xp(u.width),height:Xp(u.height),...Wp,...m?Gp:Kp,...s},(0,L.createElement)(`span`,c)};if(Mf(!0),Zf(``,up),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!Ff(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;rp(e,r)||console.error(n)}catch{console.error(n)}}}}function Qp(e){let[t,n]=(0,L.useState)(!!e.ssr),[r,i]=(0,L.useState)({});function a(t){if(t){let t=e.icon;if(typeof t==`object`)return{name:``,data:t};let n=Nf(t);if(n)return{name:t,data:n}}return{name:``}}let[o,s]=(0,L.useState)(a(!!e.ssr));function c(){let e=r.callback;e&&(e(),i({}))}function l(e){if(JSON.stringify(o)!==JSON.stringify(e))return c(),s(e),!0}function u(){var t;let n=e.icon;if(typeof n==`object`){l({name:``,data:n});return}let r=Nf(n);l({name:n,data:r})&&(r===void 0?i({callback:Ap([n],u)}):r&&((t=e.onLoad)==null||t.call(e,n)))}(0,L.useEffect)(()=>(n(!0),c),[]),(0,L.useEffect)(()=>{t&&u()},[e.icon,t]);let{name:d,data:f}=o;return f?Zp({...mf,...f},e,d):e.children?e.children:e.fallback?e.fallback:(0,L.createElement)(`span`,{})}var $p=(0,L.forwardRef)((e,t)=>Qp({...e,_ref:t}));(0,L.forwardRef)((e,t)=>Qp({inline:!0,...e,_ref:t}));var em=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#c5c5c5" d="M20.414 2H5v28h22V8.586ZM7 28V4h12v6h6v18Z"/>`}})),tm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#00007f" d="M17.229 4a.9.9 0 0 0-.569.232l-7.6 6.32a1.158 1.158 0 0 1-.955.328H3.208A1.2 1.2 0 0 0 2 12.088v7.826a1.2 1.2 0 0 0 1.208 1.206H8.1a1.158 1.158 0 0 1 .955.328l7.6 6.32c.521.433 1.081.224 1.081-.289V4.522A.494.494 0 0 0 17.229 4ZM27 6.3l-1.791 1.793a14.708 14.708 0 0 1 0 15.844l1.785 1.776A17.19 17.19 0 0 0 27 6.3Zm-4.333 4.323L20.905 12.4a6.035 6.035 0 0 1 0 7.237l1.756 1.756a8.554 8.554 0 0 0 .01-10.769Z"/>`}})),nm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#fbf0df" d="M29 17c0 5.65-5.82 10.23-13 10.23S3 22.61 3 17c0-3.5 2.24-6.6 5.66-8.44S14.21 4.81 16 4.81s3.32 1.54 7.34 3.71C26.76 10.36 29 13.46 29 17Z"/><path fill="none" stroke="#000" d="M16 27.65c7.32 0 13.46-4.65 13.46-10.65c0-3.72-2.37-7-5.89-8.85c-1.39-.75-2.46-1.41-3.37-2l-1.13-.69A6.14 6.14 0 0 0 16 4.35a6.88 6.88 0 0 0-3.3 1.23c-.42.24-.86.51-1.32.8c-.87.54-1.83 1.13-3 1.73C4.91 10 2.54 13.24 2.54 17c0 6 6.14 10.65 13.46 10.65Z"/><ellipse cx="21.65" cy="18.62" fill="#febbd0" rx="2.17" ry="1.28"/><ellipse cx="10.41" cy="18.62" fill="#febbd0" rx="2.17" ry="1.28"/><path fill-rule="evenodd" d="M11.43 18.11a2 2 0 1 0-2-2.05a2.05 2.05 0 0 0 2 2.05Zm9.2 0a2 2 0 1 0-2-2.05a2 2 0 0 0 2 2.05Z"/><path fill="#fff" fill-rule="evenodd" d="M10.79 16.19a.77.77 0 1 0-.76-.77a.76.76 0 0 0 .76.77Zm9.2 0a.77.77 0 1 0 0-1.53a.77.77 0 0 0 0 1.53Z"/><path fill="#b71422" stroke="#000" stroke-width=".75" d="M18.62 19.67a3.3 3.3 0 0 1-1.09 1.75a2.48 2.48 0 0 1-1.5.69a2.53 2.53 0 0 1-1.5-.69a3.28 3.28 0 0 1-1.08-1.75a.26.26 0 0 1 .29-.3h4.58a.27.27 0 0 1 .3.3Z"/><path fill="#ccbea7" fill-rule="evenodd" d="M14.93 5.75a6.09 6.09 0 0 1-2.09 4.62c-.1.09 0 .27.11.22c1.25-.49 2.94-1.94 2.23-4.88c-.03-.15-.25-.11-.25.04Zm.85 0a6 6 0 0 1 .57 5c0 .13.12.24.21.13c.83-1 1.54-3.11-.59-5.31c-.1-.11-.27.04-.19.17Zm1-.06a6.09 6.09 0 0 1 2.53 4.38c0 .14.21.17.24 0c.34-1.3.15-3.51-2.66-4.66c-.12-.02-.21.18-.09.27ZM9.94 9.55a6.27 6.27 0 0 0 3.89-3.33c.07-.13.28-.08.25.07c-.64 3-2.79 3.59-4.13 3.51c-.14-.01-.14-.21-.01-.25Z"/>`}})),rm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#99b8c4" d="m23.265 24.381l.9-.894c4.164.136 4.228-.01 4.411-.438l1.144-2.785l.085-.264l-.093-.231c-.049-.122-.2-.486-2.8-2.965V15.5c3-2.89 2.936-3.038 2.765-3.461l-1.139-2.814c-.171-.422-.236-.587-4.37-.474l-.9-.93a20.166 20.166 0 0 0-.141-4.106l-.116-.263l-2.974-1.3c-.438-.2-.592-.272-3.4 2.786l-1.262-.019c-2.891-3.086-3.028-3.03-3.461-2.855L9.149 3.182c-.433.175-.586.237-.418 4.437l-.893.89c-4.162-.136-4.226.012-4.407.438l-1.146 2.786l-.09.267l.094.232c.049.12.194.48 2.8 2.962v1.3c-3 2.89-2.935 3.038-2.763 3.462l1.138 2.817c.174.431.236.584 4.369.476l.9.935a20.243 20.243 0 0 0 .137 4.1l.116.265l2.993 1.308c.435.182.586.247 3.386-2.8l1.262.016c2.895 3.09 3.043 3.03 3.466 2.859l2.759-1.115c.436-.173.588-.234.413-4.436Zm-11.858-6.524a4.957 4.957 0 1 1 6.488 2.824a5.014 5.014 0 0 1-6.488-2.824Z"/>`}})),im=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#984c93" d="M14.742 24.047a10.242 10.242 0 0 1-4.673.919a7.628 7.628 0 0 1-5.914-2.346A8.876 8.876 0 0 1 2 16.369a9.476 9.476 0 0 1 2.422-6.748a8.216 8.216 0 0 1 6.285-2.588a11.151 11.151 0 0 1 4.035.641v3.761A6.839 6.839 0 0 0 11 10.395a4.813 4.813 0 0 0-3.712 1.535a5.9 5.9 0 0 0-1.413 4.159A5.8 5.8 0 0 0 7.209 20.1a4.57 4.57 0 0 0 3.59 1.493a7.319 7.319 0 0 0 3.943-1.113Zm2.37-9.218v-2.344h2.344v2.344H21.8v2.343h-2.344v2.343h-2.344v-2.343H14.77v-2.344l2.342.001zm8.201 0v-2.344h2.344v2.344H30v2.343h-2.343v2.343h-2.344v-2.343h-2.342v-2.344l2.342.001z"/>`}})),am=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#368832" d="M19.792 7.071h2.553v2.553H24.9V7.071h2.552v2.553H30v2.552h-2.55v2.551H30v2.553h-2.551v2.552H24.9v-2.55h-2.55v2.552h-2.557v-2.55H17.24v-2.559h2.553v-2.546H17.24V9.622h2.554Zm2.553 7.658H24.9v-2.553h-2.555Zm-7.656 9.284a10.2 10.2 0 0 1-4.653.915a7.6 7.6 0 0 1-5.89-2.336A8.839 8.839 0 0 1 2 16.367a9.436 9.436 0 0 1 2.412-6.719a8.181 8.181 0 0 1 6.259-2.577a11.1 11.1 0 0 1 4.018.638v3.745a6.81 6.81 0 0 0-3.723-1.036a4.793 4.793 0 0 0-3.7 1.529a5.879 5.879 0 0 0-1.407 4.142a5.774 5.774 0 0 0 1.328 3.992a4.551 4.551 0 0 0 3.575 1.487a7.288 7.288 0 0 0 3.927-1.108Z"/>`}})),om=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#1572b6" d="M5.902 27.201L3.656 2h24.688l-2.249 25.197L15.985 30L5.902 27.201z"/><path fill="#33a9dc" d="m16 27.858l8.17-2.265l1.922-21.532H16v23.797z"/><path fill="#fff" d="M16 13.191h4.09l.282-3.165H16V6.935h7.75l-.074.829l-.759 8.518H16v-3.091z"/><path fill="#ebebeb" d="m16.019 21.218l-.014.004l-3.442-.93l-.22-2.465H9.24l.433 4.853l6.331 1.758l.015-.004v-3.216z"/><path fill="#fff" d="m19.827 16.151l-.372 4.139l-3.447.93v3.216l6.336-1.756l.047-.522l.537-6.007h-3.101z"/><path fill="#ebebeb" d="M16.011 6.935v3.091H8.545l-.062-.695l-.141-1.567l-.074-.829h7.743zM16 13.191v3.091h-3.399l-.062-.695l-.14-1.567l-.074-.829H16z"/>`}})),sm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#3a4e55" d="M18.191 13.071H20.7v2.566h1.27a5.5 5.5 0 0 0 1.744-.292a4.462 4.462 0 0 0 .848-.383a3.149 3.149 0 0 1-.589-1.623a3.427 3.427 0 0 1 .616-2.416l.264-.305l.314.253a4 4 0 0 1 1.575 2.538a3.837 3.837 0 0 1 2.913.271l.345.2l-.181.354a3.629 3.629 0 0 1-3.648 1.74c-2.173 5.413-6.9 7.976-12.642 7.976A7.958 7.958 0 0 1 6.3 20.211l-.025-.043l-.226-.459a7.28 7.28 0 0 1-.579-3.693l.035-.38h2.143v-2.565h2.51v-2.51h5.02v-2.51h3.012v5.02Z"/><path fill="#00aada" d="M26.324 14.021a3.311 3.311 0 0 0-1.418-2.821a3.072 3.072 0 0 0 .289 3.821a5.279 5.279 0 0 1-3.225 1.037H5.883a6.779 6.779 0 0 0 .667 3.737l.183.335a6.2 6.2 0 0 0 .379.569q.992.064 1.829.045a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.4 8.4 0 0 1-1.845.3c.044 0-.046.007-.046.007l-.082.007a21.455 21.455 0 0 1-2.008-.006l-.01.007a7.882 7.882 0 0 0 6.063 2.41c5.56 0 10.276-2.465 12.365-8c1.482.152 2.906-.226 3.553-1.49a3.5 3.5 0 0 0-3.122-.022"/><path fill="#27b9ec" d="M26.324 14.021a3.311 3.311 0 0 0-1.418-2.821a3.072 3.072 0 0 0 .289 3.821a5.279 5.279 0 0 1-3.225 1.037H6.836a5.223 5.223 0 0 0 2.106 4.686a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.83 8.83 0 0 1-1.894.314l-.019-.022c1.892.971 4.636.967 7.782-.241a21.868 21.868 0 0 0 9.1-6.889l-.1.048"/><path fill="#088cb9" d="M5.913 17.732a6.431 6.431 0 0 0 .637 2.061l.183.335a6.2 6.2 0 0 0 .379.569q.992.064 1.829.045a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.826 8.826 0 0 1-1.891.307h-.1c-.291.016-.6.026-.922.026c-.351 0-.709-.007-1.1-.026a7.913 7.913 0 0 0 6.076 2.413c4.76 0 8.9-1.807 11.3-5.8Z"/><path fill="#039cc7" d="M6.98 17.732a4.832 4.832 0 0 0 1.961 3.01a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.959 8.959 0 0 1-1.9.307c1.892.971 4.628.957 7.773-.252a20.545 20.545 0 0 0 5.377-3.13Z"/><path fill="#00acd3" d="M9.889 13.671h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813H9.23v-1.813Zm-.33 0h.179v1.813H8.9v-1.813Zm-.33 0h.179v1.813H8.57v-1.813Zm-.323 0h.172v1.813h-.17v-1.813Zm-.181-.181h2.175v2.176H8.066V13.49Zm4.335-2.329h.172v1.813H12.4v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.178v1.813h-.178v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.175v-2.177Z"/><path fill="#26c2ee" d="M12.4 13.671h.172v1.813H12.4v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.178v1.813h-.178v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.175V13.49Z"/><path fill="#00acd3" d="M14.909 13.671h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.181v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.174V13.49Z"/><path fill="#26c2ee" d="M14.909 11.161h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.181v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.174v-2.177Zm4.335 2.691h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813H16.1v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.177-.181h2.176v2.176H15.6V13.49Z"/><path fill="#00acd3" d="M17.42 11.161h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813H16.1v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176H15.6v-2.177Z"/><path fill="#26c2ee" d="M17.42 8.65h.172v1.813h-.172V8.65Zm-.33 0h.179v1.813h-.179V8.65Zm-.33 0h.179v1.813h-.179V8.65Zm-.33 0h.179v1.813h-.179V8.65Zm-.33 0h.179v1.813H16.1V8.65Zm-.323 0h.172v1.813h-.172V8.65Zm-.177-.181h2.176v2.176H15.6V8.469Z"/><path fill="#00acd3" d="M19.93 13.671h.17v1.813h-.17v-1.813Zm-.33 0h.178v1.813H19.6v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.175V13.49Z"/><path fill="#d5eef2" d="M12.616 19.193a.6.6 0 1 1-.6.6a.6.6 0 0 1 .6-.6"/><path fill="#3a4e55" d="M12.616 19.363a.431.431 0 0 1 .156.029a.175.175 0 1 0 .241.236a.43.43 0 1 1-.4-.265M2 17.949h27.92c-.608-.154-1.923-.362-1.707-1.159c-1.105 1.279-3.771.9-4.444.267c-.749 1.087-5.111.674-5.415-.173c-.939 1.1-3.85 1.1-4.789 0c-.3.847-4.666 1.26-5.415.173c-.673.631-3.338 1.012-4.444-.267c.217.8-1.1 1.005-1.707 1.159"/><path fill="#c0dbe1" d="M14.211 23.518a5.287 5.287 0 0 1-2.756-2.711a9.2 9.2 0 0 1-1.987.3q-.436.024-.917.025q-.554 0-1.168-.033a7.942 7.942 0 0 0 6.145 2.43q.344 0 .683-.013"/><path fill="#d5eef2" d="M12.007 21.773a5.206 5.206 0 0 1-.552-.966a9.2 9.2 0 0 1-1.987.3a6.325 6.325 0 0 0 2.539.664"/>`}})),cm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<g fill-rule="evenodd"><path d="M3.167 3.167h25.667v25.667H3.167z"/><path fill="#ecd53f" fill-rule="nonzero" d="M30 2v28H2V2zM14.757 20.539H9.98v6.44h4.898v-1.085h-3.597V24.14h3.232v-1.085H11.28v-1.428h3.475v-1.09zm2.503 0h-1.264v6.44h1.207v-4.2l2.597 4.2h1.305v-6.44h-1.21v4.3l-2.635-4.301zm5.97 0h-1.41l2.303 6.44h1.388l2.306-6.44h-1.38l-1.577 4.766l-1.63-4.767zM8.3 24.96H6.34v1.96H8.3z"/></g>`}})),lm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#4b32c3" d="m29.832 16.7l-6.354 10.717A1.256 1.256 0 0 1 22.36 28H9.647a1.262 1.262 0 0 1-1.118-.59l-6.356-10.7a1.256 1.256 0 0 1 0-1.272L8.527 4.676A1.344 1.344 0 0 1 9.647 4h12.709a1.344 1.344 0 0 1 1.118.678l6.354 10.786a1.2 1.2 0 0 1 0 1.238Zm-5.262 4.2v-9.614L16 6.466l-8.56 4.82V20.9L16 25.719Z"/><path fill="#8080f2" d="m21.802 19.188l-5.747 3.235l-5.742-3.235v-6.47l5.742-3.236l5.747 3.236v6.47z"/>`}})),um=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeExcel0" x1="4.494" x2="13.832" y1="-2092.086" y2="-2075.914" gradientTransform="translate(0 2100)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#18884f"/><stop offset=".5" stop-color="#117e43"/><stop offset="1" stop-color="#0b6631"/></linearGradient></defs><path fill="#185c37" d="M19.581 15.35L8.512 13.4v14.409A1.192 1.192 0 0 0 9.705 29h19.1A1.192 1.192 0 0 0 30 27.809V22.5Z"/><path fill="#21a366" d="M19.581 3H9.705a1.192 1.192 0 0 0-1.193 1.191V9.5L19.581 16l5.861 1.95L30 16V9.5Z"/><path fill="#107c41" d="M8.512 9.5h11.069V16H8.512Z"/><path d="M16.434 8.2H8.512v16.25h7.922a1.2 1.2 0 0 0 1.194-1.191V9.391A1.2 1.2 0 0 0 16.434 8.2Z" opacity=".1"/><path d="M15.783 8.85H8.512V25.1h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.783 8.85H8.512V23.8h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.132 8.85h-6.62V23.8h6.62a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path fill="url(#vscodeIconsFileTypeExcel0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"/><path fill="#fff" d="m5.7 19.873l2.511-3.884l-2.3-3.862h1.847L9.013 14.6c.116.234.2.408.238.524h.017c.082-.188.169-.369.26-.546l1.342-2.447h1.7l-2.359 3.84l2.419 3.905h-1.809l-1.45-2.711A2.355 2.355 0 0 1 9.2 16.8h-.024a1.688 1.688 0 0 1-.168.351l-1.493 2.722Z"/><path fill="#33c481" d="M28.806 3h-9.225v6.5H30V4.191A1.192 1.192 0 0 0 28.806 3Z"/><path fill="#107c41" d="M19.581 16H30v6.5H19.581Z"/>`}})),dm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#cfcfcf" d="m12.677 17.781l-2.626-6.256l-2.694 6.256Zm6.723 6.511h-7.069v-1.365l.458-.023a1.847 1.847 0 0 0 .972-.2a.313.313 0 0 0 .145-.263a4.158 4.158 0 0 0-.419-1.4l-.812-1.931H7.322L6.4 21.259a3.319 3.319 0 0 0-.349 1.157c0 .036 0 .119.154.241a2.481 2.481 0 0 0 1.191.247l.448.033v1.354H2v-1.31l.4-.07a2.188 2.188 0 0 0 1-.318a6.318 6.318 0 0 0 1.18-2.066l5.575-13.036H11.2l5.512 13.174a5.255 5.255 0 0 0 1.049 1.835a1.959 1.959 0 0 0 1.19.4l.454.027Zm6.441-2.732v-3.985a22.542 22.542 0 0 0-2.226.97a3.845 3.845 0 0 0-1.29 1.05a2.03 2.03 0 0 0-.388 1.2a1.951 1.951 0 0 0 .491 1.362a1.49 1.49 0 0 0 1.13.544a4.142 4.142 0 0 0 2.283-1.141Zm-3.333 2.949a2.833 2.833 0 0 1-2.139-.893a3.206 3.206 0 0 1-.833-2.285a2.959 2.959 0 0 1 .415-1.577a5 5 0 0 1 1.791-1.625a23.876 23.876 0 0 1 3.617-1.588v-.074a2.905 2.905 0 0 0-.383-1.833a1.325 1.325 0 0 0-1.075-.412a1.155 1.155 0 0 0-.816.26a.687.687 0 0 0-.277.536l.023.646a1.62 1.62 0 0 1-.4 1.158a1.481 1.481 0 0 1-2.1-.019a1.634 1.634 0 0 1-.391-1.134a2.8 2.8 0 0 1 1.182-2.177a4.813 4.813 0 0 1 3.125-.932a5.381 5.381 0 0 1 2.508.524a2.628 2.628 0 0 1 1.213 1.346a6.391 6.391 0 0 1 .244 2.2v3.55a14.665 14.665 0 0 0 .051 1.749a.661.661 0 0 0 .054.2c.085-.078.284-.225.864-.806l.819-.828v1.967l-.1.128c-.958 1.283-1.883 1.907-2.83 1.907a1.6 1.6 0 0 1-1.257-.557a1.788 1.788 0 0 1-.358-.74a9.688 9.688 0 0 1-1.433.977a3.579 3.579 0 0 1-1.514.332Z"/>`}})),fm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#dd4c35" d="M29.472 14.753L17.247 2.528a1.8 1.8 0 0 0-2.55 0l-2.539 2.539l3.22 3.22a2.141 2.141 0 0 1 2.712 2.73l3.1 3.1a2.143 2.143 0 1 1-1.285 1.21l-2.895-2.895v7.617a2.141 2.141 0 1 1-1.764-.062V12.3a2.146 2.146 0 0 1-1.165-2.814l-3.17-3.172L2.528 14.7a1.8 1.8 0 0 0 0 2.551l12.225 12.221a1.8 1.8 0 0 0 2.55 0L29.472 17.3a1.8 1.8 0 0 0 0-2.551"/><path fill="#fff" d="m12.158 5.067l3.22 3.22a2.141 2.141 0 0 1 2.712 2.73l3.1 3.1a2.143 2.143 0 1 1-1.285 1.21l-2.895-2.895v7.617a2.141 2.141 0 1 1-1.764-.062V12.3a2.146 2.146 0 0 1-1.165-2.814l-3.17-3.172"/>`}})),pm=n((e=>{e.__esModule=!0,e.default={width:254.5,height:225,body:`<path fill="#00acd7" d="M-46.926 89c-.621 0-.777-.311-.466-.777l3.262-4.194a2.225 2.225 0 0 1 1.708-.777h55.448c.621 0 .777.466.466.932l-2.64 4.038a2.367 2.367 0 0 1-1.553.932Zm-23.453 14.285c-.621 0-.777-.311-.466-.777l3.262-4.194a2.225 2.225 0 0 1 1.708-.777H4.95a.714.714 0 0 1 .777.932L4.484 102.2a1.358 1.358 0 0 1-1.4.932Zm37.587 14.289c-.621 0-.777-.466-.466-.932l2.174-3.883a2.06 2.06 0 0 1 1.553-.932H1.533c.621 0 .932.466.932 1.087l-.311 3.728a1.167 1.167 0 0 1-1.087 1.087ZM128.426 86.2c-9.785 2.485-16.464 4.349-26.093 6.834c-2.33.621-2.485.777-4.5-1.553c-2.33-2.64-4.038-4.349-7.3-5.9c-9.785-4.815-19.259-3.417-28.112 2.33c-10.561 6.834-16 16.929-15.842 29.51c.155 12.425 8.7 22.676 20.968 24.385c10.561 1.4 19.414-2.33 26.4-10.251c1.4-1.708 2.64-3.572 4.194-5.747H68.163c-3.262 0-4.038-2.019-2.951-4.659c2.019-4.815 5.747-12.891 7.921-16.929a4.194 4.194 0 0 1 3.883-2.485h56.535c-.311 4.194-.311 8.387-.932 12.581a66.239 66.239 0 0 1-12.736 30.442c-11.183 14.752-25.783 23.915-44.265 26.4c-15.221 2.019-29.355-.932-41.78-10.251a48.785 48.785 0 0 1-19.725-34.48c-2.019-16.929 2.951-32.15 13.2-45.508C38.342 66.475 52.942 57.312 70.8 54.05c14.6-2.64 28.578-.932 41.159 7.61a48.686 48.686 0 0 1 18.017 21.9c.935 1.398.313 2.175-1.55 2.64Z"/><path fill="#00acd7" d="M179.835 172.09c-14.134-.311-27.025-4.349-37.9-13.668a48.711 48.711 0 0 1-16.774-29.976c-2.8-17.551 2.019-33.082 12.581-46.905c11.338-14.91 25.006-22.676 43.488-25.938c15.842-2.8 30.753-1.243 44.265 7.921c12.27 8.387 19.88 19.725 21.9 34.635c2.64 20.968-3.417 38.052-17.861 52.652a71.17 71.17 0 0 1-37.276 19.88c-4.191.778-8.384.933-12.423 1.399Zm36.965-62.747a44.7 44.7 0 0 0-.466-5.125c-2.8-15.376-16.929-24.074-31.684-20.657c-14.444 3.262-23.763 12.425-27.18 27.025a25.579 25.579 0 0 0 14.289 29.355c8.542 3.728 17.085 3.262 25.317-.932c12.269-6.369 18.948-16.309 19.724-29.666Z"/>`}})),mm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#e10098" d="M4.781 22.746L16.232 2.914l1.028.593L5.81 23.34z"/><path fill="#e10098" d="M4.545 21.162h22.902v1.187H4.545z"/><path fill="#e10098" d="m4.999 21.828l.593-1.028l11.455 6.614l-.594 1.028zM14.95 4.59l.594-1.027l11.455 6.614l-.594 1.028z"/><path fill="#e10098" d="M5.002 10.174L16.456 3.56l.594 1.028l-11.455 6.614z"/><path fill="#e10098" d="m14.743 3.508l1.028-.594l11.45 19.833l-1.027.593zM5.454 9.386h1.187v13.228H5.454z"/><path fill="#e10098" d="M25.36 9.386h1.187v13.228H25.36z"/><path fill="#e10098" d="m15.734 27.042l9.962-5.752l.519.898l-9.963 5.752z"/><path fill="#e10098" d="M28.12 23a2.5 2.5 0 1 1-.915-3.411A2.5 2.5 0 0 1 28.12 23M8.2 11.5a2.5 2.5 0 1 1-.915-3.411A2.5 2.5 0 0 1 8.2 11.5M3.88 23a2.5 2.5 0 1 1 3.411.915A2.5 2.5 0 0 1 3.88 23M23.8 11.5a2.5 2.5 0 1 1 3.411.915A2.5 2.5 0 0 1 23.8 11.5M16 30a2.5 2.5 0 1 1 2.5-2.5A2.493 2.493 0 0 1 16 30m0-23.009a2.5 2.5 0 1 1 2.5-2.5a2.493 2.493 0 0 1-2.5 2.5"/>`}})),hm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#e44f26" d="M5.902 27.201L3.655 2h24.69l-2.25 25.197L15.985 30L5.902 27.201z"/><path fill="#f1662a" d="m16 27.858l8.17-2.265l1.922-21.532H16v23.797z"/><path fill="#ebebeb" d="M16 13.407h-4.09l-.282-3.165H16V7.151H8.25l.074.83l.759 8.517H16v-3.091zm0 8.027l-.014.004l-3.442-.929l-.22-2.465H9.221l.433 4.852l6.332 1.758l.014-.004v-3.216z"/><path fill="#fff" d="M15.989 13.407v3.091h3.806l-.358 4.009l-3.448.93v3.216l6.337-1.757l.046-.522l.726-8.137l.076-.83h-7.185zm0-6.256v3.091h7.466l.062-.694l.141-1.567l.074-.83h-7.743z"/>`}})),gm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#2dcc9f" d="M30 5.851v20.298H2V5.851h28"/><path fill="#fff" d="M24.232 8.541a2.2 2.2 0 1 0 1.127.623a2.212 2.212 0 0 0-1.127-.623M18.111 20.1q-2.724-3.788-5.45-7.575L4.579 23.766h10.9q1.316-1.832 2.634-3.663M22.057 16q-2.793 3.882-5.584 7.765h11.169Q24.851 19.882 22.057 16Z"/>`}})),_m=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#5382a1" d="M12.325 23.654s-1.07.622.761.833a16.023 16.023 0 0 0 5.8-.246a10.088 10.088 0 0 0 1.541.752c-5.481 2.349-12.405-.136-8.1-1.339m-.671-3.066s-1.2.888.633 1.078a22.618 22.618 0 0 0 7.481-.359a3.32 3.32 0 0 0 1.152.7c-6.627 1.938-14.009.153-9.266-1.421m5.644-5.198a2.051 2.051 0 0 1-.355 2.954s3.429-1.77 1.854-3.987c-1.471-2.067-2.6-3.095 3.508-6.636c0 0-9.586 2.394-5.007 7.669"/><path fill="#5382a1" d="M24.552 25.921s.792.652-.872 1.157c-3.164.958-13.168 1.248-15.948.038c-1-.435.874-1.038 1.464-1.164a3.8 3.8 0 0 1 .966-.108c-1.111-.783-7.181 1.537-3.083 2.2c11.176 1.812 20.372-.816 17.473-2.124M12.84 17.412s-5.089 1.209-1.8 1.648a38.225 38.225 0 0 0 6.731-.072a53.11 53.11 0 0 0 4.221-.555a8.934 8.934 0 0 0-1.28.685c-5.168 1.359-15.151.727-12.277-.663a9.629 9.629 0 0 1 4.407-1.042m9.127 5.102c5.253-2.73 2.824-5.353 1.129-5a3.932 3.932 0 0 0-.6.161a.957.957 0 0 1 .449-.346c3.354-1.179 5.933 3.478-1.083 5.322a.458.458 0 0 0 .106-.138M18.8 2s2.909 2.91-2.759 7.386c-4.546 3.59-1.037 5.637 0 7.975c-2.653-2.394-4.6-4.5-3.294-6.463C14.664 8.019 19.976 6.623 18.8 2"/><path fill="#5382a1" d="M13.356 29.912c5.042.323 12.786-.179 12.969-2.565c0 0-.353.9-4.167 1.623a41.458 41.458 0 0 1-12.76.2s.645.533 3.959.746"/>`}})),vm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f5de19" d="M18.774 19.7a3.727 3.727 0 0 0 3.376 2.078c1.418 0 2.324-.709 2.324-1.688c0-1.173-.931-1.589-2.491-2.272l-.856-.367c-2.469-1.052-4.11-2.37-4.11-5.156c0-2.567 1.956-4.52 5.012-4.52A5.058 5.058 0 0 1 26.9 10.52l-2.665 1.711a2.327 2.327 0 0 0-2.2-1.467a1.489 1.489 0 0 0-1.638 1.467c0 1.027.636 1.442 2.1 2.078l.856.366c2.908 1.247 4.549 2.518 4.549 5.376c0 3.081-2.42 4.769-5.671 4.769a6.575 6.575 0 0 1-6.236-3.5ZM6.686 20c.538.954 1.027 1.76 2.2 1.76c1.124 0 1.834-.44 1.834-2.15V7.975h3.422v11.683c0 3.543-2.078 5.156-5.11 5.156A5.312 5.312 0 0 1 3.9 21.688Z"/>`}})),ym=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f5de19" d="M4.014 14.976a2.51 2.51 0 0 0 1.567-.518a2.377 2.377 0 0 0 .805-1.358a15.261 15.261 0 0 0 .214-2.944q.012-2.085.075-2.747a5.236 5.236 0 0 1 .418-1.686a3.025 3.025 0 0 1 .755-1.018A3.046 3.046 0 0 1 9 4.125A6.762 6.762 0 0 1 10.544 4h.7v1.96h-.387a2.338 2.338 0 0 0-1.723.468a3.4 3.4 0 0 0-.425 2.092a36.054 36.054 0 0 1-.137 4.133a4.734 4.734 0 0 1-.768 2.06A4.567 4.567 0 0 1 6.1 16a3.809 3.809 0 0 1 1.992 1.754a8.861 8.861 0 0 1 .618 3.865q0 2.435.05 2.9a1.755 1.755 0 0 0 .504 1.181a2.639 2.639 0 0 0 1.592.337h.387V28h-.7a5.655 5.655 0 0 1-1.773-.2a2.97 2.97 0 0 1-1.324-.93a3.353 3.353 0 0 1-.681-1.63a24.175 24.175 0 0 1-.165-3.234a16.469 16.469 0 0 0-.214-3.106a2.408 2.408 0 0 0-.805-1.361a2.489 2.489 0 0 0-1.567-.524Zm23.972 2.035a2.489 2.489 0 0 0-1.567.524a2.408 2.408 0 0 0-.805 1.361a16.469 16.469 0 0 0-.212 3.109a24.175 24.175 0 0 1-.169 3.234a3.353 3.353 0 0 1-.681 1.63a2.97 2.97 0 0 1-1.324.93a5.655 5.655 0 0 1-1.773.2h-.7V26.04h.387a2.639 2.639 0 0 0 1.592-.337a1.755 1.755 0 0 0 .506-1.186q.05-.462.05-2.9a8.861 8.861 0 0 1 .618-3.865A3.809 3.809 0 0 1 25.9 16a4.567 4.567 0 0 1-1.7-1.286a4.734 4.734 0 0 1-.768-2.06a36.054 36.054 0 0 1-.137-4.133a3.4 3.4 0 0 0-.425-2.092a2.338 2.338 0 0 0-1.723-.468h-.387V4h.7a6.762 6.762 0 0 1 1.54.125a3.046 3.046 0 0 1 1.149.581a3.025 3.025 0 0 1 .755 1.018a5.236 5.236 0 0 1 .418 1.686q.062.662.075 2.747a15.261 15.261 0 0 0 .212 2.947a2.377 2.377 0 0 0 .805 1.355a2.51 2.51 0 0 0 1.567.518Z"/>`}})),bm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeKotlin0" x1="311.336" x2="283.342" y1="1452.064" y2="1480.058" gradientTransform="translate(-281.4 -1450)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#e44857"/><stop offset=".47" stop-color="#9d4b9d"/><stop offset="1" stop-color="#6d5faa"/></linearGradient></defs><path fill="url(#vscodeIconsFileTypeKotlin0)" d="M30 30H2V2h28L16 16Z"/>`}})),xm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeLicense0" x1="-264.845" x2="-255.586" y1="181.772" y2="182.061" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#bd6316"/><stop offset="1" stop-color="#4e1500"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense1" x1="-263.276" x2="-256.603" y1="170.205" y2="171.772" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense2" x1="-265.068" x2="-256.777" y1="175.732" y2="178.801" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense3" x1="-655.014" x2="-655.555" y1="147.549" y2="146.948" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffd436"/><stop offset="1" stop-color="#8b3f02"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense4" x1="-258.899" x2="-253.843" y1="170.981" y2="171.325" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff8b7"/><stop offset="1" stop-color="#fcbf0e"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense5" x1="-258.884" x2="-253.896" y1="170.975" y2="171.314" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense6" x1="-257.805" x2="-257.726" y1="172.266" y2="168.648" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense7" x1="-258.935" x2="-256.173" y1="181.92" y2="182.108" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicense8" x1="-274.156" x2="-274.512" y1="170.544" y2="173.778" gradientTransform="matrix(-1 0 0 1 -257.657 -155.509)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense9" x1="-645.79" x2="-645.121" y1="-337.938" y2="-334.17" gradientTransform="scale(-1 1) rotate(-52.06 29.075 -802.903)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffef94"/><stop offset="1" stop-color="#ffd200"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicensea" x1="-276.128" x2="-274.754" y1="178.682" y2="178.682" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenseb" x1="-274.314" x2="-271.841" y1="178.887" y2="178.987" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensec" x1="-273.817" x2="-274.213" y1="189.281" y2="174.569" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#d89530"/><stop offset="1" stop-color="#772d00"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicensed" x1="-274.075" x2="-273.917" y1="174.09" y2="181.459" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensee" x1="-272.919" x2="-273.315" y1="189.281" y2="174.57" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensef" x1="-273.177" x2="-273.019" y1="174.071" y2="181.44" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenseg" x1="-652.29" x2="-651.867" y1="-335.227" y2="-332.867" gradientTransform="scale(-1 1) rotate(-52.06 29.075 -802.903)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffdb57"/><stop offset="1" stop-color="#b55c13"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicenseh" x1="-665.076" x2="-659.751" y1="157.413" y2="150.922" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensei" x1="-665.161" x2="-664.822" y1="156.114" y2="155.701" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensej" x1="-665.308" x2="-665.836" y1="156.436" y2="155.32" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensek" x1="-655.442" x2="-654.817" y1="147.568" y2="146.776" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensel" x1="-253.999" x2="-254.134" y1="175.1" y2="173.736" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensem" x1="-252.571" x2="-252.785" y1="173.138" y2="170.963" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensen" x1="-257.206" x2="-259.174" y1="169.107" y2="169.787" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicenseo" x1="-260.717" x2="-260.77" y1="170.284" y2="171.228" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensep" x1="-257.835" x2="-257.782" y1="174.993" y2="171.93" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenseq" x1="-263.928" x2="-255.721" y1="171.018" y2="171.018" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenser" x1="-514.299" x2="-505.041" y1="-57.926" y2="-57.638" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicenses" x1="-512.744" x2="-505.964" y1="-69.496" y2="-67.904" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicenset" x1="-514.521" x2="-506.23" y1="-63.966" y2="-60.897" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicenseu" x1="-662.221" x2="-662.762" y1="-197.167" y2="-197.768" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensev" x1="-508.354" x2="-503.297" y1="-68.717" y2="-68.373" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicensew" x1="-508.338" x2="-503.351" y1="-68.723" y2="-68.384" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicensex" x1="-507.26" x2="-507.18" y1="-67.432" y2="-71.05" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensey" x1="-508.389" x2="-505.627" y1="-57.779" y2="-57.591" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicensez" x1="-523.609" x2="-523.966" y1="-69.153" y2="-65.918" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense10" x1="-645.333" x2="-642.973" y1="-334.169" y2="-332.091" href="#vscodeIconsFileTypeLicense9"/><linearGradient id="vscodeIconsFileTypeLicense11" x1="-525.581" x2="-524.207" y1="-61.015" y2="-61.015" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense12" x1="-523.768" x2="-521.294" y1="-60.81" y2="-60.71" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense13" x1="-523.27" x2="-523.666" y1="-50.416" y2="-65.127" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense14" x1="-523.528" x2="-523.37" y1="-65.606" y2="-58.238" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense15" x1="-522.372" x2="-522.768" y1="-50.416" y2="-65.127" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense16" x1="-522.631" x2="-522.472" y1="-65.626" y2="-58.257" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense17" x1="-649.116" x2="-646.827" y1="-328.591" y2="-326.795" href="#vscodeIconsFileTypeLicense9"/><linearGradient id="vscodeIconsFileTypeLicense18" x1="-672.284" x2="-666.958" y1="-187.303" y2="-193.795" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense19" x1="-672.369" x2="-672.03" y1="-188.603" y2="-189.016" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1a" x1="-672.516" x2="-673.044" y1="-188.281" y2="-189.397" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1b" x1="-662.648" x2="-662.023" y1="-197.148" y2="-197.94" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1c" x1="-503.367" x2="-503.501" y1="-64.607" y2="-65.971" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1d" x1="-502.006" x2="-502.232" y1="-66.361" y2="-68.654" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1e" x1="-506.661" x2="-508.629" y1="-70.591" y2="-69.911" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1f" x1="-510.172" x2="-510.224" y1="-69.414" y2="-68.47" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1g" x1="-507.289" x2="-507.236" y1="-64.705" y2="-67.768" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1h" x1="-642.337" x2="-640.048" y1="-337.231" y2="-335.435" gradientTransform="scale(-1 1) rotate(-52.06 29.075 -802.903)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffdb57"/><stop offset="1" stop-color="#b66512"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense1i" x1="-628.479" x2="-627.663" y1="-215.005" y2="-209.203" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense1j" x1="-633.006" x2="-622.552" y1="-211.18" y2="-211.18" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicense1k" x1="-627.491" x2="-627.755" y1="-215.556" y2="-211.648" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1l" x1="-627.796" x2="-627.057" y1="-210.705" y2="-205.186" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1m" x1="245.815" x2="245.923" y1="139.434" y2="136.367" gradientTransform="rotate(7.312 1187.515 -1764.249)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicense1n" x1="-626.269" x2="-627.643" y1="-215.112" y2="-213.078" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense3"/></defs><path fill="url(#vscodeIconsFileTypeLicense0)" d="m13.372 16.416l5.013-2.464l.93 1.893l-.054.238l-2.048 1.007l5.706 11.611l-.221.359l-1.543.758l-.82-.45l-5.459-11.109l-.482.237l-1.022-2.08z"/><path fill="url(#vscodeIconsFileTypeLicense1)" d="m9.24 13.619l1.2 2.44c.072.146.416.252.617.292l2.634.683l4.609-2.268l.867-2.342a.679.679 0 0 0 .036-.674l-1.2-2.44a.546.546 0 0 0-.452-.3l-4.44.136a1.278 1.278 0 0 0-1.018.541l-2.72 3.162a.916.916 0 0 0-.133.77Zm1.932.033a.356.356 0 0 1 .011-.334l1.84-2.215a.829.829 0 0 1 .66-.351l2.877-.088a.355.355 0 0 1 .293.2l.356.725a.242.242 0 0 1-.139.339L11.833 14.5a.224.224 0 0 1-.3-.121Z"/><path fill="url(#vscodeIconsFileTypeLicense2)" d="m9.426 13.209l1.2 2.44c.072.146.416.252.617.292l2.7.547l.782 1.591l.375-.179l5.459 11.109l.82.451l1.541-.76l-.017-.683l.868-1.458l-.241-.49l-.54.1l-.31-.63l.41-.366l-.59-1.199l-.593-.006l-.277-.564l.357-.473l-.3-.607l-.568.043l-.432-.879l.382-.423l-.161-.327a.871.871 0 0 1-.659-1.342l-.345-.7a1.347 1.347 0 0 1-.962-1.956l-.29-.591l.631-.31l-.773-1.546l.843-2.277a.68.68 0 0 0 .035-.674l-1.2-2.44a.546.546 0 0 0-.453-.3l-4.435.131a1.278 1.278 0 0 0-1.018.541l-2.84 3.419a.548.548 0 0 0-.016.516Zm1.932.033a.356.356 0 0 1 .011-.334l1.84-2.215a.828.828 0 0 1 .66-.351l2.877-.088a.354.354 0 0 1 .293.2l.356.725a.242.242 0 0 1-.139.339l-5.238 2.574a.224.224 0 0 1-.3-.121Z"/><path fill="url(#vscodeIconsFileTypeLicense3)" d="m14.47 18.381l.276-.318l.335-.164l-.139.245l-.472.237z"/><path fill="url(#vscodeIconsFileTypeLicense4)" d="m11.259 15.828l2.776.6l4.38-2.152l.865-2.339a.576.576 0 0 0 .024-.567L18.1 8.917a.441.441 0 0 0-.367-.246l-4.438.13a1.169 1.169 0 0 0-.938.5L9.52 12.725a.447.447 0 0 0-.011.414l1.206 2.453a1 1 0 0 0 .544.236Zm.354-1.836l-.358-.729a.463.463 0 0 1 .013-.434v-.008l1.853-2.221a.922.922 0 0 1 .739-.389l2.881-.084a.468.468 0 0 1 .392.257l.358.729c.005.009.19.3-.187.481l-5.244 2.577c-.272.129-.44-.164-.447-.179Z"/><path fill="url(#vscodeIconsFileTypeLicense5)" d="M11.246 15.738c.006 0 2.438.51 2.751.591l4.354-2.139l.878-2.336a.472.472 0 0 0 .015-.458l-1.208-2.458a.337.337 0 0 0-.282-.187l-4.454.141a1.083 1.083 0 0 0-.864.46l-2.863 3.436a.341.341 0 0 0-.008.313l1.206 2.454a1.118 1.118 0 0 0 .475.183Zm.245-1.7l-.355-.723a.568.568 0 0 1 .018-.535v-.008l.01-.015l1.865-2.241a1.033 1.033 0 0 1 .824-.43l2.9-.091a.575.575 0 0 1 .492.316l.359.73a.456.456 0 0 1 .027.338a.484.484 0 0 1-.265.286l-5.287 2.6a.415.415 0 0 1-.331.025a.486.486 0 0 1-.258-.248Z"/><path fill="url(#vscodeIconsFileTypeLicense6)" d="M11.268 15.663c.009 0 2.53.528 2.722.577l4.3-2.113l.878-2.314a.419.419 0 0 0 .01-.4l-1.2-2.436a.282.282 0 0 0-.237-.156l-4.433.149a1.033 1.033 0 0 0-.82.437l-2.353 2.823l-.5.595a.285.285 0 0 0 0 .254l1.193 2.421a1.181 1.181 0 0 0 .44.163Zm.14-1.529l-.351-.715a.575.575 0 0 1-.011-.56l1.959-2.36a1.082 1.082 0 0 1 .86-.447l2.887-.1a.628.628 0 0 1 .538.341l.356.724a.539.539 0 0 1-.309.773l-5.267 2.588a.482.482 0 0 1-.662-.243Z"/><path fill="url(#vscodeIconsFileTypeLicense7)" d="m18.463 14.345l.7 1.433l-.653.321l.319.649a1.428 1.428 0 0 0 1 2.043l.3.619a.958.958 0 0 0 .706 1.436l.107.218l-.39.428l.5 1.011l.577-.047l.239.485l-.366.478l.336.683h.6l.523 1.065l-.419.371l.382.777l.549-.1l.181.368A96.344 96.344 0 0 1 22.8 28v.638l-1.342.659l-.729-.414l-5.488-11.176l-.467.23l-.7-1.433Z"/><path fill="url(#vscodeIconsFileTypeLicense8)" d="M14.289 15.413h4.622v1.4h-4.622z" transform="rotate(-26.171 16.6 16.113)"/><path fill="url(#vscodeIconsFileTypeLicense9)" d="m18.128 14.582l-.8.392l.617 1.256l.8-.392Zm-1.319.648l.617 1.256l.308-.152l-.617-1.256Z"/><path fill="url(#vscodeIconsFileTypeLicensea)" d="m18.4 16.123l.308.628a1.523 1.523 0 0 0 1.037 2.11l.263.535a1.052 1.052 0 0 0 .744 1.513l.054.111l-.381.423l.557 1.134l.567-.043l.177.36l-.357.472l.392.8l.591.006l.456.929l-.409.366l.45.917l.539-.1l.12.243L22.634 28l-1.027.5l-5.525-11.235Z"/><path fill="url(#vscodeIconsFileTypeLicenseb)" d="m17.141 16.745l5.528 11.248l.046.511l-1.247.613l-.613-.349l-5.483-11.154Z"/><path fill="url(#vscodeIconsFileTypeLicensec)" d="m22.287 28.694l.427-.21l-4.794-9.754l-1.028-1.554l.602 1.764l4.793 9.754z"/><path fill="url(#vscodeIconsFileTypeLicensed)" d="M16.892 17.176L22.5 28.589l-.213.105l-4.793-9.754l-.602-1.764z"/><path fill="url(#vscodeIconsFileTypeLicensee)" d="m21.481 29.09l.427-.209l-4.794-9.755l-1.028-1.554l.602 1.764l4.793 9.754z"/><path fill="url(#vscodeIconsFileTypeLicensef)" d="m16.086 17.572l5.608 11.413l-.213.105l-4.793-9.754l-.602-1.764z"/><path fill="url(#vscodeIconsFileTypeLicenseg)" d="m18.27 16.189l-.411.2l5.285 10.755l.279-.47l-.181-.369l-.386.072l-.45-.917l.294-.26l-.508-1.034h-.424l-.392-.8l.256-.338l-.237-.482l-.407.031l-.557-1.134l.273-.3l-.143-.291a1.038 1.038 0 0 1-.619-1.259l-.391-.8a1.505 1.505 0 0 1-.906-1.844Zm-.68.334l5.371 10.929l.108-.182l-5.319-10.825Z"/><path fill="url(#vscodeIconsFileTypeLicenseh)" d="m15.018 18.247l5.356 10.997l.196-.273l-5.391-11.032l-.161.308z"/><path fill="url(#vscodeIconsFileTypeLicensei)" d="m20.436 29.315l.211-.291l.705.361l-.203.294l-.713-.364z"/><path fill="url(#vscodeIconsFileTypeLicensej)" d="m21.446 29.41l-.179.26l1.382-.659l.131-.241l-1.334.64z"/><path fill="url(#vscodeIconsFileTypeLicensek)" d="m14.029 16.673l-.225.388l.601 1.293l.297-.354l-.673-1.327z"/><path fill="url(#vscodeIconsFileTypeLicensel)" d="m13.946 16.506l-.239.432l-2.944-.761l.124-.345l3.059.674z"/><path fill="url(#vscodeIconsFileTypeLicensem)" d="M9.359 13s-.145.444-.087.563l1.212 2.465l.2-.384Z"/><path fill="url(#vscodeIconsFileTypeLicensen)" d="m16.683 10.624l.1-.327l-2.963.095a.914.914 0 0 0-.51.251l-.007.165a1.871 1.871 0 0 1 .394-.1Z"/><path fill="url(#vscodeIconsFileTypeLicenseo)" d="M16.83 10.309a.329.329 0 0 1 .17.137l.382.762l-.164.279l-.341-.693c-.023-.047-.108-.145-.147-.149Z"/><path fill="url(#vscodeIconsFileTypeLicensep)" d="m11.237 13.786l.171.348a.482.482 0 0 0 .661.248l5.267-2.588a.539.539 0 0 0 .309-.773l-.153-.31l1.08-.531l.606 1.232a.419.419 0 0 1-.01.4l-.878 2.314l-4.3 2.113c-.191-.049-2.713-.575-2.722-.577a1.181 1.181 0 0 1-.439-.16l-.6-1.222Z"/><path fill="url(#vscodeIconsFileTypeLicenseq)" d="m13.377 8.968l.532 1.084l.539-.018l-.532-1.084Zm2.306-.077l-1.395.047l.533 1.084l1.4-.046Zm1.471 2.994l-1.142.561l1.106 2.25l1.142-.561Zm-1.447.711l-.441.217l1.106 2.251l.441-.217Z"/><path fill="url(#vscodeIconsFileTypeLicenser)" d="m10.65 14.159l5.287 1.803L15.623 18l-.173.134l-2.16-.737l-1.921 12.501l-.371.102l-1.627-.555l-.395-.913l1.838-11.961l-.508-.173l.344-2.239z"/><path fill="url(#vscodeIconsFileTypeLicenses)" d="m8.951 9.175l-.542 2.747a.567.567 0 0 0 .175.452l1.976 2.461l4.866 1.659l1.969-1.077a.535.535 0 0 0 .4-.463l.4-2.627a.659.659 0 0 0-.188-.544L14.453 8.7a1.313 1.313 0 0 0-1.1-.337l-3.874.345a.707.707 0 0 0-.528.467Zm1.5 1.407a.281.281 0 0 1 .192-.234l2.633-.256a.928.928 0 0 1 .724.315l2.3 2a.426.426 0 0 1 .121.352l-.1.651s-.027.237-.3.146L10.5 11.667a.269.269 0 0 1-.172-.305Z"/><path fill="url(#vscodeIconsFileTypeLicenset)" d="m9.322 9.01l-.4 2.627c-.024.157.188.481.324.653l1.817 2.33l-.263 1.714l.392.134l-1.843 11.959l.395.914l1.627.555l.363-.507l1.483-.436l.081-.528l-.479-.314l.1-.678l.523.028l.2-1.283l-.461-.428l.093-.608l.54-.087l.1-.653l-.469-.375l.145-.946l.532-.034l.054-.352a1.047 1.047 0 0 1-.29-.859a.688.688 0 0 1 .512-.585l.116-.756a1.6 1.6 0 0 1-.364-1.232a1.07 1.07 0 0 1 .688-.874l.1-.636l.666.227l.246-1.674l1.915-1.047a.535.535 0 0 0 .4-.463l.4-2.627a.657.657 0 0 0-.188-.544l-3.556-3.08a1.313 1.313 0 0 0-1.1-.336l-4.109.445a.434.434 0 0 0-.29.356Zm1.5 1.407a.281.281 0 0 1 .192-.234l2.663-.289a.852.852 0 0 1 .711.218l2.3 2a.427.427 0 0 1 .122.352l-.12.781s-.027.237-.3.146L10.871 11.5a.269.269 0 0 1-.171-.3Z"/><path fill="url(#vscodeIconsFileTypeLicenseu)" d="m10.428 16.37l.392-.033l.353.12l-.244.078l-.501-.165z"/><path fill="url(#vscodeIconsFileTypeLicensev)" d="m9.317 12.221l1.846 2.421l4.619 1.575l1.967-1.076a.454.454 0 0 0 .331-.393l.406-2.641a.53.53 0 0 0-.152-.441l-3.552-3.083a1.207 1.207 0 0 0-1.011-.31l-4.109.453a.354.354 0 0 0-.237.292l-.405 2.641a1.261 1.261 0 0 0 .297.562Zm1.289-1.077l.121-.785a.367.367 0 0 1 .25-.305h.008l2.675-.295a.953.953 0 0 1 .794.247l2.3 2a.563.563 0 0 1 .166.467l-.121.785c0 .01-.014.35-.411.215l-5.53-1.886a.423.423 0 0 1-.252-.443Z"/><path fill="url(#vscodeIconsFileTypeLicensew)" d="M9.356 12.146c0 .005 1.63 2.115 1.831 2.4l4.591 1.566l1.974-1.065a.372.372 0 0 0 .264-.321l.406-2.646a.405.405 0 0 0-.118-.338l-3.571-3.091a1.117 1.117 0 0 0-.931-.285l-4.133.444a.271.271 0 0 0-.179.221l-.406 2.642a1.421 1.421 0 0 0 .272.473Zm1.126-1.054l.12-.778a.451.451 0 0 1 .309-.375h.024l2.7-.29a1.07 1.07 0 0 1 .883.278l2.324 2.01a.694.694 0 0 1 .212.581l-.121.786a.38.38 0 0 1-.165.265a.417.417 0 0 1-.365.018l-5.576-1.9a.5.5 0 0 1-.273-.219a.55.55 0 0 1-.072-.377Z"/><path fill="url(#vscodeIconsFileTypeLicensex)" d="M9.415 12.108c.006.008 1.693 2.194 1.816 2.366l4.535 1.546l1.963-1.048a.33.33 0 0 0 .228-.282l.4-2.623a.339.339 0 0 0-.1-.283L14.7 8.719a1.066 1.066 0 0 0-.884-.271l-3.4.359l-.716.076a.226.226 0 0 0-.142.183s-.4 2.594-.4 2.611a1.506 1.506 0 0 0 .257.431Zm.952-1.007l.118-.77a.463.463 0 0 1 .3-.414l2.836-.308a1.12 1.12 0 0 1 .921.292l2.316 2a.758.758 0 0 1 .234.632s-.1.633-.12.779c-.034.219-.191.5-.668.339l-5.555-1.894a.584.584 0 0 1-.383-.657Z"/><path fill="url(#vscodeIconsFileTypeLicensey)" d="m15.781 16.3l-.237 1.543l-.689-.235l-.107.7a1.158 1.158 0 0 0-.7.917a1.723 1.723 0 0 0 .367 1.283l-.1.666a.765.765 0 0 0-.527.634a1.154 1.154 0 0 0 .29.912l-.036.235l-.542.031l-.167 1.088l.479.379l-.08.522l-.55.084l-.113.736l.471.432l-.176 1.146l-.532-.031l-.128.837l.488.317l-.061.4c-.09.027-1.455.411-1.455.411l-.352.462l-1.424-.483l-.343-.822l1.843-12.03l-.493-.168l.237-1.543Z"/><path fill="url(#vscodeIconsFileTypeLicensez)" d="m11.056 16.181l4.374 1.491l.208-1.352l-4.374-1.492l-.208 1.353z"/><path fill="url(#vscodeIconsFileTypeLicense10)" d="m15.388 16.234l-.842-.287l-.207 1.353l.841.287ZM14 15.76l-.208 1.353l.325.111l.208-1.353Z"/><path fill="url(#vscodeIconsFileTypeLicense11)" d="m14.756 17.55l-.1.676a1.251 1.251 0 0 0-.7.957A1.845 1.845 0 0 0 14.3 20.5l-.089.576a.844.844 0 0 0-.525.678a1.256 1.256 0 0 0 .275.95l-.018.119l-.531.034l-.188 1.221l.469.375l-.06.388l-.539.087l-.132.858l.46.427l-.154 1l-.522-.028l-.152.987l.478.314l-.04.262l-1.506.443l-1.083-.369l1.86-12.1Z"/><path fill="url(#vscodeIconsFileTypeLicense12)" d="m13.423 17.1l-1.86 12.1l-.246.4L10 29.16l-.289-.692l1.845-12.009Z"/><path fill="url(#vscodeIconsFileTypeLicense13)" d="m10.877 29.44l.45.154l1.614-10.501l.049-1.863l-.499 1.709l-1.614 10.501z"/><path fill="url(#vscodeIconsFileTypeLicense14)" d="m12.99 17.23l-1.888 12.287l-.225-.077l1.614-10.501l.499-1.709z"/><path fill="url(#vscodeIconsFileTypeLicense15)" d="m10.028 29.151l.449.153l1.614-10.501l.049-1.863l-.499 1.71l-1.613 10.501z"/><path fill="url(#vscodeIconsFileTypeLicense16)" d="m12.14 16.94l-1.887 12.287l-.225-.076l1.613-10.501l.499-1.71z"/><path fill="url(#vscodeIconsFileTypeLicense17)" d="m14.615 17.5l-.433-.148l-1.782 11.58l.478-.14l.061-.4l-.339-.222l.152-.987l.374.02l.171-1.113l-.33-.306l.132-.858l.387-.062l.08-.519l-.336-.268l.188-1.221l.381-.024l.048-.314a1.2 1.2 0 0 1-.154-.766a.85.85 0 0 1 .363-.59l.132-.856a1.79 1.79 0 0 1-.231-1.123a1.261 1.261 0 0 1 .536-.861Zm-.717-.244L12.09 29.024l.185-.054l1.791-11.655Z"/><path fill="url(#vscodeIconsFileTypeLicense18)" d="M10.932 16.665L9.075 28.47l.303-.058l1.85-11.855l-.296.108z"/><path fill="url(#vscodeIconsFileTypeLicense19)" d="m9.085 28.566l.325-.06l.354.766l-.321.068l-.358-.774z"/><path fill="url(#vscodeIconsFileTypeLicense1a)" d="m9.823 29.357l-.283.06l1.447.513l.235-.081l-1.399-.492z"/><path fill="url(#vscodeIconsFileTypeLicense1b)" d="m11.024 14.816l-.391.12l-.241 1.367l.429-.043l.203-1.444z"/><path fill="url(#vscodeIconsFileTypeLicense1c)" d="m11.05 14.636l-.425.141l-2.084-2.606l.483-.214l2.026 2.679z"/><path fill="url(#vscodeIconsFileTypeLicense1d)" d="M9.384 8.813s-.358.218-.378.346l-.546 2.773l.51-.253Z"/><path fill="url(#vscodeIconsFileTypeLicense1e)" d="m16.435 12.332l.256-.168l-2.375-2.052a.962.962 0 0 0-.538-.183l-.1.115a2.143 2.143 0 0 1 .362.211Z"/><path fill="url(#vscodeIconsFileTypeLicense1f)" d="M16.724 12.208a.393.393 0 0 1 .058.221c-.016.1-.112.774-.12.825l-.283.085l.115-.747a.4.4 0 0 0-.033-.213Z"/><path fill="url(#vscodeIconsFileTypeLicense1g)" d="m10.424 10.725l-.058.375a.584.584 0 0 0 .381.653l5.553 1.894c.478.163.634-.12.668-.339l.051-.334l1.139.388l-.2 1.327a.33.33 0 0 1-.228.282l-1.963 1.048l-4.535-1.546a358.09 358.09 0 0 0-1.816-2.366a1.506 1.506 0 0 1-.257-.43l.2-1.315Z"/><path fill="url(#vscodeIconsFileTypeLicense1h)" d="m14.756 8.764l-.179 1.166l.432.373l.179-1.167Zm1.851 1.595l-1.119-.965l-.179 1.167l1.119.965Zm-.5 3.223l-1.2-.411l-.372 2.423l1.2.411Zm-1.526-.52l-.461-.162l-.372 2.423l.465.159Z"/><path fill="url(#vscodeIconsFileTypeLicense1i)" d="M9.936 2.733c2.042-1.441 5.206-.715 7.065 1.8A6.169 6.169 0 0 1 18.27 9.1c-.219-.73-1.023-.427-1.664-.441a4.11 4.11 0 0 0-.763-3.207C14.6 3.778 12.41 3.1 11.07 4.094s-1.382 3.253-.143 4.929a3.68 3.68 0 0 0 3.69 1.742c.521.444 1 .871 1.507 1.329c-1.84 1.134-4.8.334-6.51-1.982c-1.86-2.512-1.93-5.789.322-7.379Z"/><path fill="url(#vscodeIconsFileTypeLicense1j)" d="M9.956 2.841c1.939-1.405 5.111-.606 6.892 1.8a6.587 6.587 0 0 1 1.38 4.159c-.293-.387-1.035-.264-1.466-.211a4.6 4.6 0 0 0-.823-3.272c-1.317-1.78-3.546-2.373-4.97-1.32s-1.442 3.27-.125 5.051a4.034 4.034 0 0 0 3.842 1.905c.4.35.79.715 1.185 1.073c-1.982 1.012-4.528.084-6.123-2.073c-1.782-2.408-1.897-5.587.208-7.112Z"/><path fill="url(#vscodeIconsFileTypeLicense1k)" d="M10.1 2.918c1.855-1.345 4.971-.5 6.675 1.8a6.635 6.635 0 0 1 1.361 3.89a1.872 1.872 0 0 0-1.148-.126a4.555 4.555 0 0 0-.946-3.23c-1.394-1.885-3.6-2.472-5.1-1.357s-1.511 3.279-.171 5.2a4.075 4.075 0 0 0 3.976 1.973c.323.285.639.58.957.871c-1.939.959-4.394-.1-5.893-2.131C8.1 7.511 8.1 4.363 10.1 2.918Z"/><path fill="url(#vscodeIconsFileTypeLicense1l)" d="M9.684 3.412C8.6 4.969 8.825 7.5 10.3 9.494c1.413 1.911 3.466 2.885 5.249 2.443c-1.694.674-4.074-.233-5.554-2.235c-1.54-2.081-1.66-4.783-.311-6.29Z"/><path fill="url(#vscodeIconsFileTypeLicense1m)" d="M9.9 3.511c-.171.291.366.627.547.144a4.29 4.29 0 0 1 2.442-1.222A3.558 3.558 0 0 0 9.9 3.511Zm.077.506a.244.244 0 1 0 .211.273a.243.243 0 0 0-.213-.273Z"/><path fill="url(#vscodeIconsFileTypeLicense1n)" d="M11.035 3.763c1.4-1.181 3.664-.647 5.163 1.132a4.723 4.723 0 0 1 1.2 3.542c-.136.014-.273.03-.411.048a4.555 4.555 0 0 0-.946-3.23c-1.394-1.885-3.6-2.472-5.1-1.357c-.071.053-.136.11-.2.167a2.672 2.672 0 0 1 .294-.302Z"/>`}})),Sm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="gray" d="m16.5 30l-.011-.321c.4-.014.8-.045 1.19-.094l.039.319c-.406.048-.818.08-1.218.096Zm-1.222-.011c-.4-.021-.814-.061-1.216-.118l.045-.318c.393.055.793.094 1.188.115Zm3.642-.289l-.067-.314c.387-.083.776-.184 1.155-.3l.094.307c-.388.118-.786.222-1.182.307Zm-6.063-.053c-.4-.091-.791-.2-1.177-.326l.1-.306c.377.122.764.23 1.15.319Zm8.4-.665l-.121-.3c.364-.148.728-.314 1.08-.493h.006l.145.286c-.367.186-.741.356-1.114.507Zm-10.718-.088a13.693 13.693 0 0 1-1.1-.524l.15-.284c.35.186.713.358 1.078.512Zm12.893-1.021l-.17-.273c.337-.21.668-.437.984-.675l.193.257c-.328.243-.667.476-1.011.691Zm-15.053-.122c-.341-.22-.676-.459-1-.708l.2-.253c.312.243.64.476.972.691Zm17-1.346l-.215-.239c.294-.265.58-.546.851-.836l.235.219c-.278.297-.571.585-.872.851Zm-18.925-.153c-.3-.276-.585-.569-.856-.87l.239-.215c.265.294.547.58.836.85Zm20.587-1.632l-.253-.2c.244-.312.476-.639.692-.972l.27.175c-.221.343-.46.677-.709.997ZM4.82 24.439a14.237 14.237 0 0 1-.692-1.007l.272-.17c.21.337.438.668.676.984Zm23.547-1.867l-.284-.151c.186-.35.358-.713.513-1.078l.3.125a14.91 14.91 0 0 1-.528 1.104Zm-24.841-.2l-.006-.012a13.075 13.075 0 0 1-.5-1.1l.3-.121c.147.362.312.724.491 1.074l.006.012Zm25.794-2.047l-.306-.1c.122-.377.23-.764.319-1.15l.313.072c-.091.396-.2.792-.326 1.178Zm-26.712-.218c-.12-.388-.223-.786-.308-1.182l.314-.067c.083.387.184.776.3 1.155Zm27.262-2.161l-.318-.045c.056-.393.094-.793.115-1.188l.321.017a13.78 13.78 0 0 1-.118 1.216ZM2.1 17.72c-.05-.4-.082-.812-.1-1.218l.321-.011c.014.4.046.8.094 1.19Zm27.582-2.2c-.014-.4-.045-.8-.093-1.19l.319-.039c.049.4.082.813.1 1.218ZM2.331 15.3l-.321-.02c.021-.405.061-.814.117-1.216l.318.045c-.055.391-.093.791-.114 1.191Zm27.057-2.144a13.987 13.987 0 0 0-.3-1.155l.312-.101c.119.388.223.786.307 1.183Zm-26.725-.222l-.313-.072c.091-.4.2-.791.326-1.177l.306.1c-.123.376-.23.763-.319 1.149Zm26.026-2.062a12.639 12.639 0 0 0-.5-1.086l.286-.146c.185.363.355.736.507 1.111ZM3.4 10.665l-.3-.125c.158-.374.334-.745.524-1.1l.284.15c-.184.347-.356.71-.508 1.075Zm1.113-2.108l-.27-.174c.22-.341.458-.676.707-1l.254.2c-.243.317-.476.641-.691.974Zm1.464-1.881l-.235-.219c.276-.3.569-.585.87-.857l.215.239c-.294.261-.58.547-.85.837Zm1.77-1.6l-.193-.257c.323-.244.662-.477 1.007-.692l.17.272c-.337.215-.668.442-.984.68Zm15.705-.558l-.018-.012l.175-.27l.018.011Zm-1.047-.616a13.44 13.44 0 0 0-1.078-.512l.125-.3c.374.158.745.334 1.1.524ZM9.769 3.815l-.146-.286l.018-.009c.356-.181.724-.349 1.093-.5l.121.3c-.361.147-.72.311-1.068.488Zm10.44-.838a13.414 13.414 0 0 0-1.151-.317l.072-.313c.4.091.792.2 1.178.325Zm-8.229-.06l-.094-.307a14.25 14.25 0 0 1 1.182-.308l.067.314a13.89 13.89 0 0 0-1.155.301Zm5.9-.473a13.953 13.953 0 0 0-1.188-.113l.016-.321c.405.021.814.059 1.216.115Zm-3.572-.026l-.04-.319c.4-.05.812-.083 1.218-.1l.012.321c-.392.017-.793.049-1.186.098Z"/><circle cx="16" cy="15.998" r="10.708" fill="navy"/><circle cx="20.435" cy="11.562" r="3.136" fill="#fff"/><circle cx="26.708" cy="5.29" r="3.137" fill="navy"/><path fill="#fff" d="M13.1 21.352v-.79H9.629v-6.236h-.9v7.026H13.1m4.816 0V16.3h-.8v2.785c0 1.031-.54 1.706-1.378 1.706A.95.95 0 0 1 14.7 19.8v-3.5h-.8v3.817c0 .838.626 1.378 1.609 1.378a1.863 1.863 0 0 0 1.687-.925v.781h.723m5.872-.018v-.607a.664.664 0 0 1-.173.019c-.279 0-.434-.145-.434-.4v-2.809c0-.9-.655-1.378-1.9-1.378c-1.224 0-1.976.472-2.024 1.638h.81c.067-.617.434-.9 1.185-.9c.723 0 1.128.27 1.128.752v.212c0 .337-.2.482-.838.559a5.763 5.763 0 0 0-1.619.308a1.327 1.327 0 0 0-.887 1.311c0 .916.636 1.455 1.658 1.455a2.363 2.363 0 0 0 1.715-.742a.855.855 0 0 0 .829.665a1.967 1.967 0 0 0 .549-.087m-1.407-1.725a1.366 1.366 0 0 1-1.513 1.185c-.626 0-.993-.222-.993-.771c0-.53.357-.761 1.214-.887a4 4 0 0 0 1.291-.279v.752"/>`}})),Cm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#fff" d="M7.313 18.654a.548.548 0 0 1-.6.233a.917.917 0 0 0-.869.08c-.306.218-.637.053-.579-.345a1.229 1.229 0 0 1 .583-.971c.833-.479.254-.812.711-1.293s.357-.629.341-1.283a4.648 4.648 0 0 1-3.4-1.9a6.012 6.012 0 0 1-1.46-3.764a6.365 6.365 0 0 1 .649-3.8a5.315 5.315 0 0 1 2.565-2.522a7.022 7.022 0 0 1 3.489-.77a4.96 4.96 0 0 1 2.443.452a5.148 5.148 0 0 0 1.546.8a1.217 1.217 0 0 0 .782-.226c.047 1.189-1.023 1.292-1.98 1.317s-1.546-.371-2.427-.224a4.193 4.193 0 0 0-3.03 1.774A3.783 3.783 0 0 0 5.408 8.9a1.952 1.952 0 0 0 1.441 1.8c.5.008.61-.136 1.047-.421s2.665-3.043 3.426-3.663a3.522 3.522 0 0 1 2.322-.821a3.24 3.24 0 0 1 1.671.286A12.275 12.275 0 0 1 16.9 7.139a8.833 8.833 0 0 0 .684-.576a2.865 2.865 0 0 1 2.393-.718a3.644 3.644 0 0 1 1.819.8a14.312 14.312 0 0 1 2.013 2.425a3.59 3.59 0 0 0 1.621 1.489c.771.237 1.352-.762 1.437-1.316a5.814 5.814 0 0 0 .112-.935a4.413 4.413 0 0 0-.135-1.125a4 4 0 0 0-.455-1.016a3.606 3.606 0 0 0-1.3-1.25A4.129 4.129 0 0 0 23.7 4.5a13.676 13.676 0 0 0-1.4.2c-.584.04-1.628.171-2.086-.28a1.18 1.18 0 0 1-.378-.853a.892.892 0 0 0 .469.19c.366.031.708-.268 1-.441a7.34 7.34 0 0 1 .908-.526a5.856 5.856 0 0 1 2.7-.232a6.308 6.308 0 0 1 2.2.725a6 6 0 0 1 1.634 1.48A4.983 4.983 0 0 1 29.781 6.9a8.981 8.981 0 0 1 .017 3.847a7.577 7.577 0 0 1-1.714 2.819a4.388 4.388 0 0 1-2.317 1.112a4.911 4.911 0 0 0 .086.488c.064.206.188.436.441.363a.236.236 0 0 1 .289.063c.133.116.064.567-.311.769a1.449 1.449 0 0 1-.695.131a6.612 6.612 0 0 1-1.11-.051c-.33-.058-.528-.32-.894-.361a3.572 3.572 0 0 1-1.452-.764a3.048 3.048 0 0 0-.362-.185c.059.18.138.368.177.541s.023.334.043.472s.059.247.082.359c.09.081.119.2.272.243a1.706 1.706 0 0 0 .546-.043c.156-.021.26-.106.383-.083a.85.85 0 0 1 .34.193c.1.082.191.094.274.3a3.333 3.333 0 0 1 .171.9a1.93 1.93 0 0 1-.1.755a1.261 1.261 0 0 1-.381.541a5.937 5.937 0 0 1-.956.769a1.652 1.652 0 0 0 .2.3c.1.109.324.229.421.344a.473.473 0 0 1 .148.324a.686.686 0 0 1-.109.433a1.9 1.9 0 0 1-.937.573a2.477 2.477 0 0 1 .023 1.06c-.037.159-.119.519-.315.612a3.823 3.823 0 0 1-.814.086c-.239.038-.373.074-.56.111a3.3 3.3 0 0 0-.34.492a.4.4 0 0 0 .008.35c.049.15.214.368.261.544a1.091 1.091 0 0 1 .012.541a.943.943 0 0 1-.269.46c-.15.157-.446.28-.593.406s-.294.142-.254.352a1.551 1.551 0 0 0 .781.867a.925.925 0 0 0 .65-.048c-.015.246-.228.412-.367.576a2.2 2.2 0 0 0 1-.588a2.488 2.488 0 0 1-.752.955a2.872 2.872 0 0 1-.6.4a2.652 2.652 0 0 0 .99 0a1.97 1.97 0 0 1-.748.242a2.2 2.2 0 0 1-.85-.064a5.7 5.7 0 0 1-.951-.541a.78.78 0 0 0 .217.442a2.859 2.859 0 0 0 .639.334a9.407 9.407 0 0 1-.963-.116a2.233 2.233 0 0 1-.555-.189a3.647 3.647 0 0 1-.449-.309a1.291 1.291 0 0 0 .215.411a1.963 1.963 0 0 0 .48.232a2.1 2.1 0 0 1-.5-.011a1.408 1.408 0 0 1-.517-.245a3.7 3.7 0 0 1-.52-.463a2.155 2.155 0 0 1-.4-.538c-.058-.154.035-.262.052-.393a1.233 1.233 0 0 0-.318.21a.4.4 0 0 0-.118.37a2.46 2.46 0 0 0 .315.589c-.344-.281-.536-.389-.618-.729a1.143 1.143 0 0 1 .272-.846c.075-.119.187-.23.257-.345a4.668 4.668 0 0 1-.466-.456c-.133-.173-.189-.408-.325-.573a3.412 3.412 0 0 0-.478-.407a6.246 6.246 0 0 1 .42.9a.6.6 0 0 1-.139.5c-.083.126-.216.154-.343.231s-.323.017-.4.131a.392.392 0 0 0-.023.4l.3.466a1.421 1.421 0 0 1-.381-.328c-.084-.114-.214-.218-.232-.371a.541.541 0 0 1 .073-.422c.1-.137.371-.182.493-.287s.19-.173.183-.309s-.14-.232-.253-.318a8.278 8.278 0 0 1-1.088-.815a1.08 1.08 0 0 1-.28-.443a.459.459 0 0 1 .085-.368c.083-.151.367-.352.4-.515s-.109-.2-.238-.256s-.376.029-.5-.071s.035-.311-.1-.427s-.445-.051-.6-.176a.837.837 0 0 1-.281-.459a.974.974 0 0 1-.024-.509c.038-.131.15-.154.217-.222s.127-.124.036-.225s-.385.006-.555-.124s-.066-.44-.186-.572s-.336-.079-.449-.121s-.159.106-.228-.128s-.072-.93-.166-1.189s-.278-.018-.363-.276a7.085 7.085 0 0 1-.043-1.06l-.175-1.061c-.609.409-2.53.935-2.7 1.233"/><path fill="#030303" d="M16.623 8.258a3.733 3.733 0 0 0 .077.942a.909.909 0 0 0 .382.66c.462.343.758.286 1.114.485a1.017 1.017 0 0 1 .446.421a.363.363 0 0 1-.17.422a.361.361 0 0 0 .371-.48c-.052-.128-.3-.185-.373-.314a.488.488 0 0 1-.04-.393c.064-.236.531-.451.7-.637a.772.772 0 0 0 .208-.9a2.831 2.831 0 0 0-1.45-1.141a3.209 3.209 0 0 0-.5-.15a1.65 1.65 0 0 1 .875.807c.144.374.019.515.024.84c0 .151.2.226.289.322s.07.145.009.259a.3.3 0 0 0-.13-.236c-.13-.093-.271-.073-.341-.263c-.106-.289.1-.563-.132-.888a1.029 1.029 0 0 0-.727-.522a1.267 1.267 0 0 0-.423.066l-.219-.258a4.594 4.594 0 0 0-1.34-.995a3.033 3.033 0 0 0-1.607-.3a3.068 3.068 0 0 0-2.2.771c-.808.7-2.892 3.367-3.4 3.7a1.7 1.7 0 0 1-1.248.453a2.124 2.124 0 0 1-1.657-2.002a4.041 4.041 0 0 1 .722-2.857a4.173 4.173 0 0 1 3.224-1.9a12.022 12.022 0 0 1 2.441.23c.771 0 1.534-.132 1.759-.745a1.044 1.044 0 0 1-.672.118A6.739 6.739 0 0 1 11 2.952a5.237 5.237 0 0 0-2.29-.377a6.319 6.319 0 0 0-3.215.669a5.769 5.769 0 0 0-2.582 2.475a5.866 5.866 0 0 0-.654 3.649a6.068 6.068 0 0 0 1.423 3.613a4.457 4.457 0 0 0 3.295 1.785l.329-1.45l-.587.842l.015-.937l-.531.659l-.233-.894l-.43.716l-.214-1l-.623.5l.2-.823l-.825.092l.379-.572l-.752.009l.438-.764l-.667-.106L4 10.35l-.817-.242l.676-.648l-.659-.544l.522-.406l-.492-.65l.521-.607l-.194-.8L4 6.067l.132-.916l.5-.249l.427-.715l.785-.087l.39-.643l.793.04l.749-.407l.778.181l.883-.266l.654.153l.853.125l.824.659L10.5 3.5l-.636.305l-.526-.321l-.362.246l-.64.064l-.574-.037l-.419.511l-.843.013l-.3.688l-.759.266l-.071.791l-.544.426L5 7.2l-.47.773l.361.676l-.355.619l.472.308l-.107.995l.656.166l.148.738l.715-.075l.444.506l.549-.536a6.151 6.151 0 0 0 2.193-1.625a10.282 10.282 0 0 1 2.58-2.506a3.451 3.451 0 0 1 2.493-.477c.895.154 1.194.691 1.853 1.257a.626.626 0 0 1 .2-.253a4.416 4.416 0 0 0-.108.492Zm4.665 5.934a.71.71 0 0 1-.2.143a2.376 2.376 0 0 1-.344.083c.173.27.355.543.521.826s.31.594.469.892a4.909 4.909 0 0 0-.022-.511a5.014 5.014 0 0 0-.168-.537c-.071-.239-.159-.564-.26-.9Zm-.06-1.551a.508.508 0 0 1 .168.092a.646.646 0 0 1 .255.269a1.025 1.025 0 0 1 .048.466c-.056-.016-.132-.005-.191-.055s-.092-.162-.167-.21a.439.439 0 0 0-.219-.048a.694.694 0 0 1 .043.35a.431.431 0 0 1-.409.387a1.336 1.336 0 0 1-.342-.036c.04.089.108.167.147.256a1.842 1.842 0 0 0 .439-.073a3.264 3.264 0 0 1 .345-.2a2.175 2.175 0 0 1 .395-.067c-.113.1-.188.2-.3.295l.25.728c.177.111.344.169.566.306a7.337 7.337 0 0 0 .781.515a2.887 2.887 0 0 0 .767.263c.3.057.545.3.844.343a6.43 6.43 0 0 0 1.087.025c.261-.025.6-.16.631-.447a.6.6 0 0 1-.723-.407c-.075-.183-.038-.52-.153-.737s-.274-.286-.466-.552a8.352 8.352 0 0 1-.679-1.045c-.175-.357-.217-.762-.365-1.082a5.285 5.285 0 0 0-.546-.826a2.918 2.918 0 0 0-1.308-1.18a6.4 6.4 0 0 0-.963-.249c-.131.059-.31.124-.342.276a.622.622 0 0 0 .14.493a2.1 2.1 0 0 1 .568.7a2.753 2.753 0 0 1 .03 1.029a1.146 1.146 0 0 1-.328.42Zm-1.451.173a2.483 2.483 0 0 1 .854-.242c.126-.008.321.012.448.017a1.7 1.7 0 0 0 .3-.466a2.519 2.519 0 0 0-.043-.826c-.172-.423-.34-.441-.577-.683a1.347 1.347 0 0 1-.231-.743c-.019-.11-.073-.249-.1-.363a4.64 4.64 0 0 0-1-.052a1.088 1.088 0 0 0 .39-.567a1.116 1.116 0 0 0-.132-.78a3.032 3.032 0 0 0-.576-.6c-.208-.182-.506-.332-.7-.482a5.781 5.781 0 0 1 .768-.275a2.5 2.5 0 0 1 1.842.448a4.6 4.6 0 0 1 1.053.833c.384.4.859 1.137 1.23 1.574a7.877 7.877 0 0 0 .997 1.043a4.973 4.973 0 0 0 .925.5l.481.51l.389-.481l.625.071l.129-.7l.574-.157l-.093-.947l.413-.293l-.31-.589l.315-.644l-.411-.736l.159-.708l-.476-.405l-.062-.753l-.664-.253l-.266-.655l-.75-.01l-.366-.486l-.5.035l-.56-.061l-.316-.234l-.46.3l-.557-.29l-1.106.42l.721-.627l.747-.119l.569-.138l.773.254l.68-.172l.656.388l.694-.038l.341.612l.691.079l.374.68l.435.237l.115.871l.387.367l-.17.762l.456.577l-.428.619l.457.387l-.585.518l.592.616l-.715.23l.466.661l-.584.1l.383.727l-.658-.009l.331.545l-.722-.087l.173.783l-.546-.48l-.187.949l-.377-.682l-.2.85l-.465-.627l.012.891l-.514-.8a3.638 3.638 0 0 0 .385 1.382a3.518 3.518 0 0 0 2.24-1.041a7.168 7.168 0 0 0 1.627-2.739a9.306 9.306 0 0 0 .011-3.618a5.45 5.45 0 0 0-1.045-2.109A7.963 7.963 0 0 0 26.9 3.405a6.2 6.2 0 0 0-3.2-.694a3.79 3.79 0 0 0-1.338.25c-.617.224-1.11.714-1.737.955a.6.6 0 0 1-.53 0a.989.989 0 0 0 .723.572a5.464 5.464 0 0 0 1.431-.013a9.013 9.013 0 0 1 1.451-.19a3.1 3.1 0 0 1 1.484.428a3.658 3.658 0 0 1 1.4 1.318a4 4 0 0 1 .448 1.079a5.063 5.063 0 0 1 .151 1.174a3.6 3.6 0 0 1-.112 1.035c-.212.781-.68 1.576-1.641 1.454c-.588-.075-1.475-1.18-1.772-1.585a15.7 15.7 0 0 0-1.969-2.4a3.034 3.034 0 0 0-1.705-.757a2.579 2.579 0 0 0-2.384.829a4.609 4.609 0 0 1 .532.17a3.981 3.981 0 0 1 1.094.718a1.19 1.19 0 0 1 .5.968c.008.3-.239.541-.465.758c-.139.133-.322.254-.434.357c-.149.137-.333.286-.147.5a1.883 1.883 0 0 0 .3.22c.163.121.089.572-.127.691a.712.712 0 0 1-.832-.069c.287-.043.469-.081.461-.315c0-.136-.177-.249-.347-.326a4.931 4.931 0 0 1-1.125-.452c-.411-.3-.42-.458-.531-.922a2.623 2.623 0 0 0-.646.113c-.265.087-.558.3-.8.348a1.718 1.718 0 0 1-1.058.006a4.244 4.244 0 0 0-2.1.349a5.917 5.917 0 0 0-.975.121a6.413 6.413 0 0 0-1.7.995a9.083 9.083 0 0 0-1.98 4.059c-.051.57.112.955-.248 1.233s-.349.992-.471 1.193s-.263.111-.525.392s-.4.234-.389.766a1.839 1.839 0 0 1 .845-.332c.256-.009.259.328.916-.322c.352-.348 1.027-.358 1.5-.512A4.732 4.732 0 0 0 11 16.152a5.613 5.613 0 0 0 1.415-3.381a3.984 3.984 0 0 1-.038 1.247a3.473 3.473 0 0 0 .151 2.442l.309.59a5.184 5.184 0 0 1-.652-.953l-.25-.674a5.057 5.057 0 0 1-1.463 1.662a2.916 2.916 0 0 0 .089 1.169c.128.373-.076.8.021 1.049s.321.106.394.355s-.038.741.075.983s.392.1.527.174a.774.774 0 0 1 .251.289c.073.1-.028.346.119.425s.376.012.529.088a.357.357 0 0 1 .139.422c-.036.163-.2.238-.272.4a.427.427 0 0 0 .023.434a.891.891 0 0 0 .466.314c.19.077.457.034.653.14a1.537 1.537 0 0 1 .476.473a.636.636 0 0 1 .127.425a1.19 1.19 0 0 1-.157.505c-.087.157-.278.347.021.647s.287.17.458.364c-.019-.336-.157-.609-.056-.862s.406-.3.566-.411a2.625 2.625 0 0 0 .379-.4a4.487 4.487 0 0 1 0 .491c-.041.266-.119.5.277.544a1.293 1.293 0 0 0 .535-.166c-.1.176-.269.318-.3.528a.918.918 0 0 0 .151.651a2.127 2.127 0 0 0 .582.487a2.227 2.227 0 0 0 .425.2c.007.207-.034.427-.01.621a1.134 1.134 0 0 0 .2.529a1.73 1.73 0 0 0 .465.373c-.094-.218-.283-.424-.281-.653a.734.734 0 0 1 .294-.594c.223-.2.746-.38.992-.577a1.214 1.214 0 0 0 .414-.51a2.23 2.23 0 0 0 .08-.673a2.032 2.032 0 0 1 .119.569a2.006 2.006 0 0 1-.221.794a1.217 1.217 0 0 0 .6-.612c.065.039.032.145.056.349c.109-.108.232-.191.341-.293a.949.949 0 0 0 .284-.334a.765.765 0 0 0-.008-.459a3.091 3.091 0 0 0-.324-.538c-.1-.181.017-.358.01-.576a1.727 1.727 0 0 0-.6-.1c-.229.033-.491.29-.725.293s-.365-.216-.557-.277a3.409 3.409 0 0 0-.579-.08a5.348 5.348 0 0 1 1.84-.451a11.629 11.629 0 0 1 1.715-.155a4.393 4.393 0 0 0 .769.03c.179-.051.141-.174.194-.307a1.73 1.73 0 0 0-.006-1.079A8.378 8.378 0 0 0 20.46 22c-.511.039-1.117.282-1.644.3a3.165 3.165 0 0 1-1.53-.328a3.63 3.63 0 0 1-.986-1.125c-.215-.329-.486-.975-.651-1.27a1.614 1.614 0 0 0-.339-.5a1.512 1.512 0 0 0-.488-.2c.188.019.392-.04.563.058c.256.147.543.756.7 1.021c.169-.566.129-.788.618-1.107a2.153 2.153 0 0 0-.5 1.295c.327.537.782 1.393 1.378 1.63a3.907 3.907 0 0 0 .817.168a5.91 5.91 0 0 0 2.132-.315a5.587 5.587 0 0 1 1.678-.04c.215.012.72-.117.825-.333a.382.382 0 0 0-.033-.386c-.081-.126-.3-.186-.414-.3a2.667 2.667 0 0 1-.274-.368a7.515 7.515 0 0 1-1.238.138c.257-.106.5-.167.771-.271a4.6 4.6 0 0 0 .787-.419a2.522 2.522 0 0 0 .51-.391a3.13 3.13 0 0 0 .471-.539a1.406 1.406 0 0 0 .139-.681a2.03 2.03 0 0 0-.1-.805a.634.634 0 0 0-.433-.311c-.15-.048-.252.073-.408.09s-.3.115-.527.008a1.967 1.967 0 0 1-.72-.642c-.228-.32-.39-.844-.623-1.247a21.2 21.2 0 0 0-1.376-1.986a4.043 4.043 0 0 1-.118-.593a2.861 2.861 0 0 1 .076-1.13a.987.987 0 0 1 .512-.69a.563.563 0 0 1 .371-.026a.25.25 0 0 1 .167.294c-.045.15-.15.155-.221.231a.808.808 0 0 0-.213.384a1.825 1.825 0 0 1 .412.016a.481.481 0 0 1 .339.326a.611.611 0 0 0-.456-.22a2.057 2.057 0 0 0-.316.048a2.271 2.271 0 0 1-.118.383c-.056.1-.163.075-.2.191a1.12 1.12 0 0 0-.022.455Zm.546.2c-.208.013-.258-.014-.424.1l.271.422a.65.65 0 0 1 .153-.525Zm-7.072-1.86a.812.812 0 0 1 .036-.194c-.3-.081-.423.115-.6.479c-.066.136 0 .217-.072.306s-.185.077-.3.163s-.23.251-.338.34a3.758 3.758 0 0 1-.777.418a2.536 2.536 0 0 0 .625-.513c.058-.1.05-.287.14-.377s.123-.152.24-.174s.07-.159.108-.266a1.151 1.151 0 0 1 .193-.293a.848.848 0 0 1 .339-.329c.158-.059.405 0 .525-.029s.051-.121.138-.173s.257-.029.373-.085a1.139 1.139 0 0 0 .429-.442A2.256 2.256 0 0 1 14.187 11a1.478 1.478 0 0 1-.749.89a2.38 2.38 0 0 1-.426.16c.073-.1.177-.143.219-.3a3.762 3.762 0 0 0 .02-.6Zm1.931 1.493c.157-.014.351.028.5.02a2.652 2.652 0 0 0 .377-.07c-.023-.221 0-.627-.205-.774a1.783 1.783 0 0 0-.817.008a7.63 7.63 0 0 0-1.017.385a3.168 3.168 0 0 1 .923-.514a2.428 2.428 0 0 1 .948-.09c.1.028.123.07.185.156a1.811 1.811 0 0 1 .268.9a2.524 2.524 0 0 1 .157.229a1.1 1.1 0 0 1 .081.338c-.056-.081-.022-.183-.177-.243a1.507 1.507 0 0 0-.6.018a.508.508 0 0 1-.231.934a.541.541 0 0 1-.641-.333a.988.988 0 0 1-.021-.4a.794.794 0 0 0-.688.259a1.3 1.3 0 0 0 .523.508a1.681 1.681 0 0 0 .5.186a2.516 2.516 0 0 0 .676.032a.734.734 0 0 0 .444-.216a1.04 1.04 0 0 0 .212-.47a1.369 1.369 0 0 1-.083.431a.786.786 0 0 1-.778.412a2.853 2.853 0 0 1-1.019-.2a1.542 1.542 0 0 1-.73-.624a1.8 1.8 0 0 1-.02-.557c.332-.22.413-.166.806-.231c.164-.027.277-.088.433-.1Zm.9-2.187a1.48 1.48 0 0 0 .524.212c.147 0 .185-.1.272-.154a6.578 6.578 0 0 0 .523 1.333c.1.169.159.09.232.26s.107.514.176.73a5.907 5.907 0 0 0 .242.564a7.727 7.727 0 0 1-.583-.9c-.114-.241-.041-.262-.133-.492s-.279-.588-.418-.882a.829.829 0 0 1-.3.008c-.076-.023-.061-.1-.129-.156s-.184-.032-.28-.115a.592.592 0 0 1-.127-.405Zm-1.964 7.762c.138-.112.511-.023.789 0l-.6.154c-.019.068-.01.147-.056.2s-.132.079-.2.119c.007-.179-.072-.363.066-.475Zm2.574-3.737a2.621 2.621 0 0 0 .205-.6c-.027.252.024.529-.1.712s-.339.151-.518.2c.139-.106.3-.153.411-.312Zm-.252 2.8a1 1 0 0 1 .5-.9a2.14 2.14 0 0 1 .706-.253a2.751 2.751 0 0 1 1.186.155a7.055 7.055 0 0 1 .7.459c.239.141.409.236.637.395c.35.243.554.512.8.673a1.763 1.763 0 0 0 .435.113a.73.73 0 0 1-.407.033a1.823 1.823 0 0 1-.513-.306a3.515 3.515 0 0 0-.579-.42c-.145-.084-.383-.183-.542-.287s-.435-.331-.587-.407a1.892 1.892 0 0 0-.759-.146a1.606 1.606 0 0 0-.959.267a.645.645 0 0 0-.264.66a2.992 2.992 0 0 1 .23-.3a.721.721 0 0 1 .607-.131a.531.531 0 0 1 .459.415a1.1 1.1 0 0 0-.238-.159a.573.573 0 0 0-.51.05c-.21.112-.153.278-.183.463a1.765 1.765 0 0 1-.069.231a.453.453 0 0 1-.211-.113a1.493 1.493 0 0 0 .008.259a3.194 3.194 0 0 0 .1.319a1.872 1.872 0 0 1-.39-.47a1.237 1.237 0 0 1-.148-.6Zm1.889.318a.98.98 0 0 1 .439.114a1.712 1.712 0 0 1 .314.223a1.858 1.858 0 0 1 .5.877a5.274 5.274 0 0 1 .077.745a4.767 4.767 0 0 0-.225-.687a1.682 1.682 0 0 0-.783-.8a.42.42 0 0 0-.252-.032c.028.047.075.086.077.155a.27.27 0 0 1-.13.259a.493.493 0 0 1-.541-.1a.48.48 0 0 1-.12-.535c.091-.224.439-.224.644-.216Zm-10.406.644a.726.726 0 0 0-.6.4a.548.548 0 0 1-.6.233a.917.917 0 0 0-.869.08c-.306.218-.637.053-.579-.344a1.226 1.226 0 0 1 .583-.971c.832-.479.254-.812.71-1.293s.356-.629.342-1.283a4.65 4.65 0 0 1-3.4-1.9A6.013 6.013 0 0 1 2.036 9.4a6.362 6.362 0 0 1 .649-3.8a5.314 5.314 0 0 1 2.569-2.522a7.026 7.026 0 0 1 3.489-.769a4.958 4.958 0 0 1 2.443.452a5.153 5.153 0 0 0 1.545.8a1.218 1.218 0 0 0 .782-.226c.047 1.189-1.023 1.292-1.981 1.317s-1.546-.371-2.427-.223A4.192 4.192 0 0 0 6.078 6.2a3.78 3.78 0 0 0-.669 2.683a1.951 1.951 0 0 0 1.44 1.8c.5.008.61-.136 1.047-.421s2.665-3.041 3.426-3.662a3.518 3.518 0 0 1 2.321-.821a3.236 3.236 0 0 1 1.671.285A12.282 12.282 0 0 1 16.9 7.128a8.515 8.515 0 0 0 .684-.576a2.865 2.865 0 0 1 2.393-.718a3.644 3.644 0 0 1 1.819.8a14.284 14.284 0 0 1 2.014 2.425a3.594 3.594 0 0 0 1.621 1.489c.771.237 1.351-.762 1.437-1.316a5.786 5.786 0 0 0 .112-.932a4.39 4.39 0 0 0-.134-1.125a4.012 4.012 0 0 0-.455-1.016a3.6 3.6 0 0 0-1.3-1.25a4.131 4.131 0 0 0-1.391-.424a13.632 13.632 0 0 0-1.4.2c-.584.04-1.627.171-2.085-.28a1.18 1.18 0 0 1-.378-.854a.891.891 0 0 0 .469.189c.366.031.708-.268 1-.441a7.2 7.2 0 0 1 .907-.526a5.861 5.861 0 0 1 2.7-.233a6.315 6.315 0 0 1 2.2.725a6.005 6.005 0 0 1 1.634 1.48a4.992 4.992 0 0 1 1.037 2.15a8.988 8.988 0 0 1 .017 3.847a7.581 7.581 0 0 1-1.713 2.819a4.391 4.391 0 0 1-2.317 1.112c.034.177.04.342.085.487c.065.206.188.436.442.364a.236.236 0 0 1 .289.062c.133.117.063.567-.312.769a1.444 1.444 0 0 1-.695.131a6.517 6.517 0 0 1-1.11-.051c-.33-.058-.528-.319-.894-.361a3.576 3.576 0 0 1-1.452-.764a3.069 3.069 0 0 0-.362-.185c.059.18.137.368.177.541s.022.334.043.473s.059.246.081.359c.091.081.12.2.272.243a1.688 1.688 0 0 0 .546-.043c.156-.021.261-.105.383-.083a.853.853 0 0 1 .341.193c.1.082.19.094.274.3a3.364 3.364 0 0 1 .17.9a1.922 1.922 0 0 1-.1.755a1.254 1.254 0 0 1-.381.541a5.924 5.924 0 0 1-.957.769a1.691 1.691 0 0 0 .2.3c.1.108.324.229.421.343a.474.474 0 0 1 .148.324a.689.689 0 0 1-.109.434a1.9 1.9 0 0 1-.937.573a2.484 2.484 0 0 1 .023 1.06c-.037.159-.119.519-.315.612a3.808 3.808 0 0 1-.814.086c-.239.038-.373.074-.56.111a3.312 3.312 0 0 0-.34.491a.4.4 0 0 0 .008.35c.049.15.215.369.261.544a1.091 1.091 0 0 1 .012.541a.952.952 0 0 1-.269.461c-.15.157-.446.279-.593.406s-.294.142-.254.352a1.548 1.548 0 0 0 .781.867a.93.93 0 0 0 .65-.047c-.015.246-.228.412-.367.575a2.2 2.2 0 0 0 1-.587a2.486 2.486 0 0 1-.752.954a2.86 2.86 0 0 1-.6.4a2.634 2.634 0 0 0 .991 0a1.964 1.964 0 0 1-.748.242a2.189 2.189 0 0 1-.85-.063a5.72 5.72 0 0 1-.951-.541a.782.782 0 0 0 .216.442a2.849 2.849 0 0 0 .639.334a9.6 9.6 0 0 1-.963-.116a2.274 2.274 0 0 1-.555-.189a3.8 3.8 0 0 1-.449-.309a1.3 1.3 0 0 0 .215.411a1.95 1.95 0 0 0 .481.233a2.1 2.1 0 0 1-.5-.011a1.409 1.409 0 0 1-.517-.245a3.708 3.708 0 0 1-.521-.464a2.146 2.146 0 0 1-.4-.538c-.058-.154.035-.262.052-.393a1.218 1.218 0 0 0-.319.209a.4.4 0 0 0-.118.371a2.45 2.45 0 0 0 .315.589c-.344-.281-.536-.39-.618-.729a1.142 1.142 0 0 1 .272-.846c.075-.119.187-.23.256-.345a4.636 4.636 0 0 1-.466-.456c-.133-.174-.189-.408-.325-.574a3.436 3.436 0 0 0-.478-.406a6.173 6.173 0 0 1 .42.9a.6.6 0 0 1-.139.5c-.083.126-.216.154-.342.231s-.324.016-.4.131a.393.393 0 0 0-.023.4l.3.466a1.418 1.418 0 0 1-.381-.328c-.085-.113-.214-.218-.232-.371a.541.541 0 0 1 .073-.423c.1-.136.371-.182.493-.287s.19-.173.183-.309s-.139-.233-.253-.318a8.319 8.319 0 0 1-1.088-.815a1.091 1.091 0 0 1-.28-.443a.461.461 0 0 1 .085-.368c.083-.151.367-.352.4-.515s-.109-.2-.238-.257s-.375.029-.5-.071s.035-.311-.1-.427s-.445-.051-.6-.176a.84.84 0 0 1-.281-.46a.968.968 0 0 1-.024-.509c.037-.131.149-.153.217-.221s.127-.124.036-.226s-.386.006-.556-.124s-.066-.44-.186-.571s-.336-.08-.449-.122s-.158.106-.228-.127s-.072-.929-.165-1.189s-.278-.017-.364-.276a7.171 7.171 0 0 1-.043-1.061l-.175-1.061a3.741 3.741 0 0 1-1.666.654a10.832 10.832 0 0 0 .338 4.321c.543 1.777 1.643 2.824 3.128 4.328a9.109 9.109 0 0 1-3.478-4.188a9.791 9.791 0 0 1-.414-4.277"/>`}})),wm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="none" stroke="#755838" d="M2.5 7.955h27v16.091h-27z"/><path fill="#755838" d="M5.909 20.636v-9.272h2.727l2.728 3.409l2.727-3.409h2.727v9.272h-2.727v-5.318l-2.727 3.409l-2.728-3.409v5.318H5.909zm17.046 0l-4.091-4.5h2.727v-4.772h2.727v4.772h2.727l-4.09 4.5z"/>`}})),Tm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#cb3837" d="M2 10.555h28v9.335H16v1.556H9.778v-1.557H2Zm1.556 7.779h3.111v-4.668h1.555v4.667h1.556v-6.222H3.556Zm7.778-6.223v7.779h3.111v-1.556h3.111v-6.223Zm3.111 1.556H16v3.112h-1.556Zm4.667-1.556v6.223h3.111v-4.668h1.556v4.667h1.556v-4.667h1.556v4.667h1.556v-6.222Z"/>`}})),Em=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#909090" d="m24.1 2.072l5.564 5.8v22.056H8.879V30h20.856V7.945L24.1 2.072"/><path fill="#f4f4f4" d="M24.031 2H8.808v27.928h20.856V7.873L24.03 2"/><path fill="#7a7b7c" d="M8.655 3.5h-6.39v6.827h20.1V3.5H8.655"/><path fill="#dd2025" d="M22.472 10.211H2.395V3.379h20.077v6.832"/><path fill="#464648" d="M9.052 4.534H7.745v4.8h1.028V7.715L9 7.728a2.042 2.042 0 0 0 .647-.117a1.427 1.427 0 0 0 .493-.291a1.224 1.224 0 0 0 .335-.454a2.13 2.13 0 0 0 .105-.908a2.237 2.237 0 0 0-.114-.644a1.173 1.173 0 0 0-.687-.65a2.149 2.149 0 0 0-.409-.104a2.232 2.232 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.193a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.942.942 0 0 1-.524.114m3.671-2.306c-.111 0-.219.008-.295.011L12 4.538h-.78v4.8h.918a2.677 2.677 0 0 0 1.028-.175a1.71 1.71 0 0 0 .68-.491a1.939 1.939 0 0 0 .373-.749a3.728 3.728 0 0 0 .114-.949a4.416 4.416 0 0 0-.087-1.127a1.777 1.777 0 0 0-.4-.733a1.63 1.63 0 0 0-.535-.4a2.413 2.413 0 0 0-.549-.178a1.282 1.282 0 0 0-.228-.017m-.182 3.937h-.1V5.392h.013a1.062 1.062 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a2.926 2.926 0 0 1-.033.513a1.756 1.756 0 0 1-.169.5a1.13 1.13 0 0 1-.363.36a.673.673 0 0 1-.416.106m5.08-3.915H15v4.8h1.028V7.434h1.3v-.892h-1.3V5.43h1.4v-.892"/><path fill="#dd2025" d="M21.781 20.255s3.188-.578 3.188.511s-1.975.646-3.188-.511Zm-2.357.083a7.543 7.543 0 0 0-1.473.489l.4-.9c.4-.9.815-2.127.815-2.127a14.216 14.216 0 0 0 1.658 2.252a13.033 13.033 0 0 0-1.4.288Zm-1.262-6.5c0-.949.307-1.208.546-1.208s.508.115.517.939a10.787 10.787 0 0 1-.517 2.434a4.426 4.426 0 0 1-.547-2.162Zm-4.649 10.516c-.978-.585 2.051-2.386 2.6-2.444c-.003.001-1.576 3.056-2.6 2.444ZM25.9 20.895c-.01-.1-.1-1.207-2.07-1.16a14.228 14.228 0 0 0-2.453.173a12.542 12.542 0 0 1-2.012-2.655a11.76 11.76 0 0 0 .623-3.1c-.029-1.2-.316-1.888-1.236-1.878s-1.054.815-.933 2.013a9.309 9.309 0 0 0 .665 2.338s-.425 1.323-.987 2.639s-.946 2.006-.946 2.006a9.622 9.622 0 0 0-2.725 1.4c-.824.767-1.159 1.356-.725 1.945c.374.508 1.683.623 2.853-.91a22.549 22.549 0 0 0 1.7-2.492s1.784-.489 2.339-.623s1.226-.24 1.226-.24s1.629 1.639 3.2 1.581s1.495-.939 1.485-1.035"/><path fill="#909090" d="M23.954 2.077V7.95h5.633l-5.633-5.873Z"/><path fill="#f4f4f4" d="M24.031 2v5.873h5.633L24.031 2Z"/><path fill="#fff" d="M8.975 4.457H7.668v4.8H8.7V7.639l.228.013a2.042 2.042 0 0 0 .647-.117a1.428 1.428 0 0 0 .493-.291a1.224 1.224 0 0 0 .332-.454a2.13 2.13 0 0 0 .105-.908a2.237 2.237 0 0 0-.114-.644a1.173 1.173 0 0 0-.687-.65a2.149 2.149 0 0 0-.411-.105a2.232 2.232 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.194a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.942.942 0 0 1-.524.114m3.67-2.306c-.111 0-.219.008-.295.011l-.235.006h-.78v4.8h.918a2.677 2.677 0 0 0 1.028-.175a1.71 1.71 0 0 0 .68-.491a1.939 1.939 0 0 0 .373-.749a3.728 3.728 0 0 0 .114-.949a4.416 4.416 0 0 0-.087-1.127a1.777 1.777 0 0 0-.4-.733a1.63 1.63 0 0 0-.535-.4a2.413 2.413 0 0 0-.549-.178a1.282 1.282 0 0 0-.228-.017m-.182 3.937h-.1V5.315h.013a1.062 1.062 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a2.926 2.926 0 0 1-.033.513a1.756 1.756 0 0 1-.169.5a1.13 1.13 0 0 1-.363.36a.673.673 0 0 1-.416.106m5.077-3.915h-2.43v4.8h1.028V7.357h1.3v-.892h-1.3V5.353h1.4v-.892"/>`}})),Dm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><radialGradient id="vscodeIconsFileTypePhp0" cx="-16.114" cy="20.532" r="18.384" gradientTransform="translate(26.52 -9.307)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".5" stop-color="#4c6b96"/><stop offset="1" stop-color="#231f20"/></radialGradient></defs><ellipse cx="16" cy="16" fill="url(#vscodeIconsFileTypePhp0)" rx="14" ry="7.365"/><ellipse cx="16" cy="16" fill="#6280b6" rx="13.453" ry="6.818"/><path fill="#fff" d="m18.725 18.2l.667-3.434a1.752 1.752 0 0 0-.372-1.719a2.929 2.929 0 0 0-2-.525h-1.153l.331-1.7a.219.219 0 0 0-.215-.26h-1.6a.219.219 0 0 0-.215.177l-.709 3.646a2.051 2.051 0 0 0-.477-1.054a2.783 2.783 0 0 0-2.2-.807H7.7a.219.219 0 0 0-.215.177l-1.434 7.38a.219.219 0 0 0 .215.26h1.603a.219.219 0 0 0 .215-.177l.347-1.785h1.2a5.167 5.167 0 0 0 1.568-.2a3.068 3.068 0 0 0 1.15-.689a3.538 3.538 0 0 0 .68-.844l-.287 1.475a.219.219 0 0 0 .215.26h1.6a.219.219 0 0 0 .215-.177l.787-4.051h1.094c.466 0 .6.093.64.133s.1.165.025.569l-.635 3.265a.219.219 0 0 0 .215.26h1.62a.219.219 0 0 0 .207-.18Zm-7.395-2.834a1.749 1.749 0 0 1-.561 1.092a2.171 2.171 0 0 1-1.315.321h-.712l.515-2.651h.921c.677 0 .949.145 1.059.266a1.181 1.181 0 0 1 .093.972Zm14.216-2.034a2.783 2.783 0 0 0-2.2-.807h-3.091a.219.219 0 0 0-.215.177l-1.434 7.38a.219.219 0 0 0 .215.26h1.608a.219.219 0 0 0 .215-.177l.347-1.785h1.2a5.167 5.167 0 0 0 1.568-.2a3.068 3.068 0 0 0 1.15-.689a3.425 3.425 0 0 0 1.076-1.927a2.512 2.512 0 0 0-.439-2.232Zm-1.667 2.034a1.749 1.749 0 0 1-.561 1.092a2.171 2.171 0 0 1-1.318.32h-.71l.515-2.651h.921c.677 0 .949.145 1.059.266a1.181 1.181 0 0 1 .094.973Z"/><path fill="#000004" d="M10.178 13.908a1.645 1.645 0 0 1 1.221.338a1.34 1.34 0 0 1 .145 1.161a1.945 1.945 0 0 1-.642 1.223a2.361 2.361 0 0 1-1.448.37h-.978l.6-3.089Zm-3.917 6.216h1.608l.381-1.962h1.377a4.931 4.931 0 0 0 1.5-.191a2.84 2.84 0 0 0 1.07-.642a3.207 3.207 0 0 0 1.01-1.808a2.3 2.3 0 0 0-.385-2.044a2.568 2.568 0 0 0-2.035-.732H7.7Zm8.126-9.342h1.6l-.387 1.962h1.421a2.767 2.767 0 0 1 1.85.468a1.548 1.548 0 0 1 .305 1.516l-.667 3.434H16.89l.635-3.265a.886.886 0 0 0-.08-.76a1.121 1.121 0 0 0-.8-.2H15.37l-.822 4.228h-1.6Zm8.34 3.126a1.645 1.645 0 0 1 1.221.338a1.34 1.34 0 0 1 .145 1.161a1.945 1.945 0 0 1-.642 1.223A2.361 2.361 0 0 1 22 17h-.978l.6-3.089Zm-3.917 6.216h1.608l.381-1.962h1.377a4.931 4.931 0 0 0 1.5-.191a2.84 2.84 0 0 0 1.07-.642a3.207 3.207 0 0 0 1.01-1.808a2.3 2.3 0 0 0-.385-2.044a2.568 2.568 0 0 0-2.035-.732h-3.092Z"/>`}})),Om=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f9ad00" d="M30 10.75h-8.749V2H30Zm-9.626 0h-8.75V2h8.75Zm-9.625 0H2V2h8.749ZM30 20.375h-8.749v-8.75H30Z"/><path fill="#fff" d="M20.374 20.375h-8.75v-8.75h8.75Zm0 9.625h-8.75v-8.75h8.75ZM30 30h-8.749v-8.75H30Zm-19.251 0H2v-8.75h8.749Z"/>`}})),km=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypePowerpoint0" x1="4.494" x2="13.832" y1="-1748.086" y2="-1731.914" gradientTransform="translate(0 1756)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ca4c28"/><stop offset=".5" stop-color="#c5401e"/><stop offset="1" stop-color="#b62f14"/></linearGradient></defs><path fill="#ed6c47" d="M18.93 17.3L16.977 3h-.146A12.9 12.9 0 0 0 3.953 15.854V16Z"/><path fill="#ff8f6b" d="M17.123 3h-.146v13l6.511 2.6L30 16v-.146A12.9 12.9 0 0 0 17.123 3Z"/><path fill="#d35230" d="M30 16v.143A12.905 12.905 0 0 1 17.12 29h-.287a12.907 12.907 0 0 1-12.88-12.857V16Z"/><path d="M17.628 9.389V23.26a1.2 1.2 0 0 1-.742 1.1a1.16 1.16 0 0 1-.45.091H7.027a10.08 10.08 0 0 1-.521-.65a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85a8.82 8.82 0 0 1 .456-.65h9.93a1.2 1.2 0 0 1 1.192 1.189Z" opacity=".1"/><path d="M16.977 10.04v13.871a1.15 1.15 0 0 1-.091.448a1.2 1.2 0 0 1-1.1.741H7.62q-.309-.314-.593-.65a10.08 10.08 0 0 1-.521-.65a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.735a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"/><path d="M16.977 10.04v12.571a1.2 1.2 0 0 1-1.192 1.189H6.506a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.735a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"/><path d="M16.326 10.04v12.571a1.2 1.2 0 0 1-1.192 1.189H6.506a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.084a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"/><path fill="url(#vscodeIconsFileTypePowerpoint0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"/><path fill="#fff" d="M9.293 12.028a3.287 3.287 0 0 1 2.174.636a2.27 2.27 0 0 1 .756 1.841a2.555 2.555 0 0 1-.373 1.376a2.49 2.49 0 0 1-1.059.935a3.607 3.607 0 0 1-1.591.334H7.687v2.8H6.141v-7.922ZM7.686 15.94h1.331a1.735 1.735 0 0 0 1.177-.351a1.3 1.3 0 0 0 .4-1.025q0-1.309-1.525-1.31H7.686v2.686Z"/>`}})),Am=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#56b3b4" d="M21.714 8.571h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#ea5e5e" d="M4.571 26.857h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Z"/><path fill="#bf85bf" d="M18.286 17.714h3.429a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-3.429a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#ea5e5e" d="M11.429 17.714H16a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-4.571a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#56b3b4" d="M4.571 17.714h4.572a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Z"/><path fill="#bf85bf" d="M4.571 22.286h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 22.857a.571.571 0 0 1 .571-.571Zm0-9.143h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 13.714a.571.571 0 0 1 .571-.571Z"/><path fill="#f7ba3e" d="M10.286 6.286h11.428a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H10.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#ea5e5e" d="M4.571 6.286H8a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.572H4.571A.571.571 0 0 1 4 6.857a.571.571 0 0 1 .571-.571Z"/><path fill="#f7ba3e" d="M9.143 24.571h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H9.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#56b3b4" d="M9.143 10.857h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H9.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571ZM4.571 24.571h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Z"/><path fill="#f7ba3e" d="M4.571 10.857h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.572H4.571A.571.571 0 0 1 4 11.429a.571.571 0 0 1 .571-.572Z"/><path fill="#4d616e" d="M19.429 24.571h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-6.858 0h4.571a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Zm10.286 0h4.571a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-4.571a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z" opacity=".5"/><path fill="#56b3b4" d="M13.714 15.429h9.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-9.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#f7ba3e" d="M8 15.429h3.429A.571.571 0 0 1 12 16a.571.571 0 0 1-.571.571H8A.571.571 0 0 1 7.429 16A.571.571 0 0 1 8 15.429Z"/><path fill="#ea5e5e" d="M4.571 15.429h1.143a.571.571 0 0 1 .572.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 16a.571.571 0 0 1 .571-.571Z"/><path fill="#bf85bf" d="M14.857 8.571h4.571a.571.571 0 0 1 .572.572a.571.571 0 0 1-.571.571h-4.572a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Z"/><path fill="#56b3b4" d="M4.571 8.571h8a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-8A.571.571 0 0 1 4 9.143a.571.571 0 0 1 .571-.572Z"/><path fill="#f7ba3e" d="M8 20h10.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H8a.571.571 0 0 1-.571-.571A.571.571 0 0 1 8 20Z"/><path fill="#bf85bf" d="M4.571 20h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 20.571A.571.571 0 0 1 4.571 20Z"/><path fill="#ea5e5e" d="M18.286 10.857H24a.571.571 0 0 1 .571.571A.571.571 0 0 1 24 12h-5.714a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Z"/><path fill="#f7ba3e" d="M18.286 13.143H24a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-5.714a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#56b3b4" d="M4.571 4h13.715a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 4.571A.571.571 0 0 1 4.571 4Z"/><path fill="#4d616e" d="M20.571 4h6.857a.571.571 0 0 1 .572.571a.571.571 0 0 1-.571.571h-6.858A.571.571 0 0 1 20 4.571A.571.571 0 0 1 20.571 4Zm0 16h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm4.572 0h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571ZM24 17.714h3.429a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H24a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm0-11.428h3.429a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H24a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm1.143 9.143h2.286A.571.571 0 0 1 28 16a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.572-.571a.571.571 0 0 1 .572-.571Zm0-6.858h2.286a.571.571 0 0 1 .571.572a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Zm1.143 2.286h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm0 2.286h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-9.143 9.143h10.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H17.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-4.572 0h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm9.143 4.571h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-5.714a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-9.143 0h6.857a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-6.857a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Zm0-16H16a.571.571 0 0 1 .571.571A.571.571 0 0 1 16 12h-3.429a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Zm0 2.286H16a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-3.429a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z" opacity=".5"/>`}})),jm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypePython0" x1="-133.268" x2="-133.198" y1="-202.91" y2="-202.84" gradientTransform="matrix(189.38 0 0 189.81 25243.061 38519.17)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#387eb8"/><stop offset="1" stop-color="#366994"/></linearGradient><linearGradient id="vscodeIconsFileTypePython1" x1="-133.575" x2="-133.495" y1="-203.203" y2="-203.133" gradientTransform="matrix(189.38 0 0 189.81 25309.061 38583.42)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffe052"/><stop offset="1" stop-color="#ffc331"/></linearGradient></defs><path fill="url(#vscodeIconsFileTypePython0)" d="M15.885 2.1c-7.1 0-6.651 3.07-6.651 3.07v3.19h6.752v1H6.545S2 8.8 2 16.005s4.013 6.912 4.013 6.912H8.33v-3.361s-.13-4.013 3.9-4.013h6.762s3.772.06 3.772-3.652V5.8s.572-3.712-6.842-3.712Zm-3.732 2.137a1.214 1.214 0 1 1-1.183 1.244v-.02a1.214 1.214 0 0 1 1.214-1.214Z"/><path fill="url(#vscodeIconsFileTypePython1)" d="M16.085 29.91c7.1 0 6.651-3.08 6.651-3.08v-3.18h-6.751v-1h9.47S30 23.158 30 15.995s-4.013-6.912-4.013-6.912H23.64V12.4s.13 4.013-3.9 4.013h-6.765S9.2 16.356 9.2 20.068V26.2s-.572 3.712 6.842 3.712h.04Zm3.732-2.147A1.214 1.214 0 1 1 21 26.519v.03a1.214 1.214 0 0 1-1.214 1.214h.03Z"/>`}})),Mm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<circle cx="16" cy="15.974" r="2.5" fill="#00d8ff"/><path fill="#00d8ff" d="M16 21.706a28.385 28.385 0 0 1-8.88-1.2a11.3 11.3 0 0 1-3.657-1.958A3.543 3.543 0 0 1 2 15.974c0-1.653 1.816-3.273 4.858-4.333A28.755 28.755 0 0 1 16 10.293a28.674 28.674 0 0 1 9.022 1.324a11.376 11.376 0 0 1 3.538 1.866A3.391 3.391 0 0 1 30 15.974c0 1.718-2.03 3.459-5.3 4.541a28.8 28.8 0 0 1-8.7 1.191Zm0-10.217a27.948 27.948 0 0 0-8.749 1.282c-2.8.977-4.055 2.313-4.055 3.2c0 .928 1.349 2.387 4.311 3.4A27.21 27.21 0 0 0 16 20.51a27.6 27.6 0 0 0 8.325-1.13C27.4 18.361 28.8 16.9 28.8 15.974a2.327 2.327 0 0 0-1.01-1.573a10.194 10.194 0 0 0-3.161-1.654A27.462 27.462 0 0 0 16 11.489Z"/><path fill="#00d8ff" d="M10.32 28.443a2.639 2.639 0 0 1-1.336-.328c-1.432-.826-1.928-3.208-1.327-6.373a28.755 28.755 0 0 1 3.4-8.593a28.676 28.676 0 0 1 5.653-7.154a11.376 11.376 0 0 1 3.384-2.133a3.391 3.391 0 0 1 2.878 0c1.489.858 1.982 3.486 1.287 6.859a28.806 28.806 0 0 1-3.316 8.133a28.385 28.385 0 0 1-5.476 7.093a11.3 11.3 0 0 1-3.523 2.189a4.926 4.926 0 0 1-1.624.307Zm1.773-14.7a27.948 27.948 0 0 0-3.26 8.219c-.553 2.915-.022 4.668.75 5.114c.8.463 2.742.024 5.1-2.036a27.209 27.209 0 0 0 5.227-6.79a27.6 27.6 0 0 0 3.181-7.776c.654-3.175.089-5.119-.713-5.581a2.327 2.327 0 0 0-1.868.089A10.194 10.194 0 0 0 17.5 6.9a27.464 27.464 0 0 0-5.4 6.849Z"/><path fill="#00d8ff" d="M21.677 28.456c-1.355 0-3.076-.82-4.868-2.361a28.756 28.756 0 0 1-5.747-7.237a28.676 28.676 0 0 1-3.374-8.471a11.376 11.376 0 0 1-.158-4A3.391 3.391 0 0 1 8.964 3.9c1.487-.861 4.01.024 6.585 2.31a28.8 28.8 0 0 1 5.39 6.934a28.384 28.384 0 0 1 3.41 8.287a11.3 11.3 0 0 1 .137 4.146a3.543 3.543 0 0 1-1.494 2.555a2.59 2.59 0 0 1-1.315.324Zm-9.58-10.2a27.949 27.949 0 0 0 5.492 6.929c2.249 1.935 4.033 2.351 4.8 1.9c.8-.465 1.39-2.363.782-5.434A27.212 27.212 0 0 0 19.9 13.74a27.6 27.6 0 0 0-5.145-6.64c-2.424-2.152-4.39-2.633-5.191-2.169a2.327 2.327 0 0 0-.855 1.662a10.194 10.194 0 0 0 .153 3.565a27.465 27.465 0 0 0 3.236 8.1Z"/>`}})),Nm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<circle cx="16" cy="15.974" r="2.5" fill="#007acc"/><path fill="#007acc" d="M16 21.706a28.385 28.385 0 0 1-8.88-1.2a11.3 11.3 0 0 1-3.657-1.958A3.543 3.543 0 0 1 2 15.974c0-1.653 1.816-3.273 4.858-4.333A28.755 28.755 0 0 1 16 10.293a28.674 28.674 0 0 1 9.022 1.324a11.376 11.376 0 0 1 3.538 1.866A3.391 3.391 0 0 1 30 15.974c0 1.718-2.03 3.459-5.3 4.541a28.8 28.8 0 0 1-8.7 1.191Zm0-10.217a27.948 27.948 0 0 0-8.749 1.282c-2.8.977-4.055 2.313-4.055 3.2c0 .928 1.349 2.387 4.311 3.4A27.21 27.21 0 0 0 16 20.51a27.6 27.6 0 0 0 8.325-1.13C27.4 18.361 28.8 16.9 28.8 15.974a2.327 2.327 0 0 0-1.01-1.573a10.194 10.194 0 0 0-3.161-1.654A27.462 27.462 0 0 0 16 11.489Z"/><path fill="#007acc" d="M10.32 28.443a2.639 2.639 0 0 1-1.336-.328c-1.432-.826-1.928-3.208-1.327-6.373a28.755 28.755 0 0 1 3.4-8.593a28.676 28.676 0 0 1 5.653-7.154a11.376 11.376 0 0 1 3.384-2.133a3.391 3.391 0 0 1 2.878 0c1.489.858 1.982 3.486 1.287 6.859a28.806 28.806 0 0 1-3.316 8.133a28.385 28.385 0 0 1-5.476 7.093a11.3 11.3 0 0 1-3.523 2.189a4.926 4.926 0 0 1-1.624.307Zm1.773-14.7a27.948 27.948 0 0 0-3.26 8.219c-.553 2.915-.022 4.668.75 5.114c.8.463 2.742.024 5.1-2.036a27.209 27.209 0 0 0 5.227-6.79a27.6 27.6 0 0 0 3.181-7.776c.654-3.175.089-5.119-.713-5.581a2.327 2.327 0 0 0-1.868.089A10.194 10.194 0 0 0 17.5 6.9a27.464 27.464 0 0 0-5.4 6.849Z"/><path fill="#007acc" d="M21.677 28.456c-1.355 0-3.076-.82-4.868-2.361a28.756 28.756 0 0 1-5.747-7.237a28.676 28.676 0 0 1-3.374-8.471a11.376 11.376 0 0 1-.158-4A3.391 3.391 0 0 1 8.964 3.9c1.487-.861 4.01.024 6.585 2.31a28.8 28.8 0 0 1 5.39 6.934a28.384 28.384 0 0 1 3.41 8.287a11.3 11.3 0 0 1 .137 4.146a3.543 3.543 0 0 1-1.494 2.555a2.59 2.59 0 0 1-1.315.324Zm-9.58-10.2a27.949 27.949 0 0 0 5.492 6.929c2.249 1.935 4.033 2.351 4.8 1.9c.8-.465 1.39-2.363.782-5.434A27.212 27.212 0 0 0 19.9 13.74a27.6 27.6 0 0 0-5.145-6.64c-2.424-2.152-4.39-2.633-5.191-2.169a2.327 2.327 0 0 0-.855 1.662a10.194 10.194 0 0 0 .153 3.565a27.465 27.465 0 0 0 3.236 8.1Z"/>`}})),Pm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeRuby0" x1="-235.957" x2="-235.986" y1="-308.579" y2="-308.527" gradientTransform="matrix(202.935 0 0 -202.78 47910.461 -62541.16)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fb7655"/><stop offset=".41" stop-color="#e42b1e"/><stop offset=".99" stop-color="#900"/><stop offset="1" stop-color="#900"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby1" x1="-235.571" x2="-235.697" y1="-309.087" y2="-309.041" gradientTransform="matrix(60.308 0 0 -111.778 14236.351 -34525.395)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#871101"/><stop offset=".99" stop-color="#911209"/><stop offset="1" stop-color="#911209"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby2" x1="-235.896" x2="-235.937" y1="-313.362" y2="-313.129" gradientTransform="matrix(188.32 0 0 -21.986 44447.302 -6856.882)" href="#vscodeIconsFileTypeRuby1"/><linearGradient id="vscodeIconsFileTypeRuby3" x1="-233.515" x2="-233.497" y1="-309.082" y2="-309.161" gradientTransform="matrix(65.222 0 0 -97.1 15237.802 -29991.814)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".23" stop-color="#e57252"/><stop offset=".46" stop-color="#de3b20"/><stop offset=".99" stop-color="#a60003"/><stop offset="1" stop-color="#a60003"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby4" x1="-235.314" x2="-235.31" y1="-309.534" y2="-309.607" gradientTransform="matrix(105.32 0 0 -106.825 24798.925 -33053.152)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".23" stop-color="#e4714e"/><stop offset=".56" stop-color="#be1a0d"/><stop offset=".99" stop-color="#a80d00"/><stop offset="1" stop-color="#a80d00"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby5" x1="-235.882" x2="-235.869" y1="-311.851" y2="-311.935" gradientTransform="matrix(94.321 0 0 -66.418 22271.499 -20707.004)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".18" stop-color="#e46342"/><stop offset=".4" stop-color="#c82410"/><stop offset=".99" stop-color="#a80d00"/><stop offset="1" stop-color="#a80d00"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby6" x1="-235.412" x2="-235.333" y1="-321.074" y2="-320.958" gradientTransform="matrix(70.767 0 0 -24.301 16678.116 -7798.647)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".54" stop-color="#c81f11"/><stop offset=".99" stop-color="#bf0905"/><stop offset="1" stop-color="#bf0905"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby7" x1="-223.821" x2="-223.796" y1="-310.116" y2="-310.18" gradientTransform="matrix(18.177 0 0 -72.645 4071.017 -22510.233)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".31" stop-color="#de4024"/><stop offset=".99" stop-color="#bf190b"/><stop offset="1" stop-color="#bf190b"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby8" x1="-235.561" x2="-235.424" y1="-309.258" y2="-309.116" gradientTransform="matrix(158.162 0 0 -157.937 37256.313 -48819.382)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#bd0012"/><stop offset=".07" stop-color="#fff"/><stop offset=".17" stop-color="#fff"/><stop offset=".27" stop-color="#c82f1c"/><stop offset=".33" stop-color="#820c01"/><stop offset=".46" stop-color="#a31601"/><stop offset=".72" stop-color="#b31301"/><stop offset=".99" stop-color="#e82609"/><stop offset="1" stop-color="#e82609"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby9" x1="-235.424" x2="-235.476" y1="-309.143" y2="-309.126" gradientTransform="matrix(127.074 0 0 -97.409 29932.229 -30086.947)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8c0c01"/><stop offset=".54" stop-color="#990c00"/><stop offset=".99" stop-color="#a80d0e"/><stop offset="1" stop-color="#a80d0e"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubya" x1="-235.839" x2="-235.901" y1="-309.604" y2="-309.555" gradientTransform="matrix(94.011 0 0 -105.603 22198.743 -32676.856)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7e110b"/><stop offset=".99" stop-color="#9e0c00"/><stop offset="1" stop-color="#9e0c00"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubyb" x1="-235.854" x2="-235.891" y1="-311.24" y2="-311.202" gradientTransform="matrix(79.702 0 0 -81.791 18827.397 -25447.905)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#79130d"/><stop offset=".99" stop-color="#9e120b"/><stop offset="1" stop-color="#9e120b"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubyc" x1="-231.241" x2="-231.299" y1="-309.435" y2="-309.337" gradientTransform="matrix(40.137 0 0 -81.143 9286.998 -25078.589)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8b2114"/><stop offset=".43" stop-color="#9e100a"/><stop offset=".99" stop-color="#b3100c"/><stop offset="1" stop-color="#b3100c"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubyd" x1="-235.898" x2="-235.831" y1="-317.466" y2="-317.537" gradientTransform="matrix(78.099 0 0 -32.624 18447.361 -10353.553)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#b31000"/><stop offset=".44" stop-color="#910f08"/><stop offset=".99" stop-color="#791c12"/><stop offset="1" stop-color="#791c12"/></linearGradient><radialGradient id="vscodeIconsFileTypeRubye" cx="-235.882" cy="-312.543" r=".076" gradientTransform="matrix(93.113 0 0 -48.655 21986.073 -15193.61)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a80d00"/><stop offset=".99" stop-color="#7e0e08"/><stop offset="1" stop-color="#7e0e08"/></radialGradient><radialGradient id="vscodeIconsFileTypeRubyf" cx="-235.282" cy="-309.704" r=".097" gradientTransform="matrix(97.434 0 0 -75.848 22937.057 -23467.84)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a30c00"/><stop offset=".99" stop-color="#800e08"/><stop offset="1" stop-color="#800e08"/></radialGradient></defs><path fill="url(#vscodeIconsFileTypeRuby0)" d="M23.693 20.469L7.707 29.961l20.7-1.4L30 7.685Z"/><path fill="url(#vscodeIconsFileTypeRuby1)" d="m28.44 28.542l-1.779-12.279l-4.846 6.4Z"/><path fill="url(#vscodeIconsFileTypeRuby2)" d="M28.464 28.542L15.43 27.519l-7.654 2.415Z"/><path fill="url(#vscodeIconsFileTypeRuby3)" d="M7.794 29.937L11.05 19.27L3.885 20.8Z"/><path fill="url(#vscodeIconsFileTypeRuby4)" d="m21.813 22.7l-3-11.735L10.243 19Z"/><path fill="url(#vscodeIconsFileTypeRuby5)" d="m29.32 11.127l-8.1-6.619l-2.257 7.3Z"/><path fill="url(#vscodeIconsFileTypeRuby6)" d="m25.53 2.148l-4.767 2.634l-3.007-2.67Z"/><path fill="url(#vscodeIconsFileTypeRuby7)" d="m2 24.38l2-3.642L2.382 16.4Z"/><path fill="#fff" d="m2.274 16.263l1.626 4.61l7.062-1.584l8.062-7.489L21.3 4.569l-3.583-2.53l-6.091 2.28C9.706 6.1 5.982 9.635 5.848 9.7s-2.459 4.464-3.574 6.562Z"/><path fill="url(#vscodeIconsFileTypeRuby8)" d="M7.981 7.981C12.14 3.858 17.5 1.421 19.559 3.5s-.124 7.121-4.283 11.244s-9.455 6.69-11.511 4.614s.057-7.258 4.216-11.377Z"/><path fill="url(#vscodeIconsFileTypeRuby9)" d="m7.794 29.933l3.231-10.7l10.729 3.447c-3.879 3.638-8.194 6.713-13.96 7.254Z"/><path fill="url(#vscodeIconsFileTypeRubya)" d="m19.038 11.774l2.754 10.91c3.24-3.407 6.149-7.07 7.573-11.6l-10.328.691Z"/><path fill="url(#vscodeIconsFileTypeRubyb)" d="M29.337 11.139c1.1-3.327 1.357-8.1-3.841-8.985l-4.265 2.355l8.106 6.629Z"/><path fill="#9e1209" d="M2 24.332c.153 5.49 4.114 5.572 5.8 5.62l-3.9-9.1l-1.9 3.48Z"/><path fill="url(#vscodeIconsFileTypeRubye)" d="M19.053 11.791c2.49 1.531 7.509 4.6 7.61 4.661a17.552 17.552 0 0 0 2.619-5.343l-10.229.683Z"/><path fill="url(#vscodeIconsFileTypeRubyf)" d="m11.021 19.232l4.319 8.332a27.924 27.924 0 0 0 6.385-4.88l-10.7-3.452Z"/><path fill="url(#vscodeIconsFileTypeRubyc)" d="m3.887 20.861l-.612 7.287c1.155 1.577 2.743 1.714 4.409 1.591c-1.205-3-3.614-9-3.8-8.878Z"/><path fill="url(#vscodeIconsFileTypeRubyd)" d="m21.206 4.528l8.58 1.2c-.458-1.94-1.864-3.192-4.261-3.584l-4.319 2.38Z"/>`}})),Fm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><radialGradient id="vscodeIconsFileTypeRust0" cx="-492.035" cy="-883.37" r="13.998" gradientTransform="matrix(.866 -.5 -.3 -.52 177.106 -689.033)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7d7d7d"/><stop offset=".267" stop-color="#7e7c7a"/><stop offset=".45" stop-color="#817871"/><stop offset=".608" stop-color="#867162"/><stop offset=".753" stop-color="#8d684c"/><stop offset=".886" stop-color="#965c30"/><stop offset="1" stop-color="#a04f12"/></radialGradient></defs><path fill="url(#vscodeIconsFileTypeRust0)" d="M15.124 5.3a.832.832 0 1 1 .832.832a.831.831 0 0 1-.832-.832M5.2 12.834a.832.832 0 1 1 .832.832a.832.832 0 0 1-.832-.832m19.856.039a.832.832 0 1 1 .832.832a.831.831 0 0 1-.832-.832m-17.451 1.14a.76.76 0 0 0 .386-1l-.369-.835h1.452v6.545h-2.93a10.247 10.247 0 0 1-.332-3.911Zm6.074.161v-1.929h3.458c.179 0 1.261.206 1.261 1.016c0 .672-.83.913-1.513.913ZM8.958 24.561a.832.832 0 1 1 .832.832a.831.831 0 0 1-.832-.832m12.331.039a.832.832 0 1 1 .832.832a.832.832 0 0 1-.832-.832m.257-1.887a.758.758 0 0 0-.9.584l-.418 1.949a10.249 10.249 0 0 1-8.545-.041l-.417-1.949a.759.759 0 0 0-.9-.583l-1.721.37a10.233 10.233 0 0 1-.89-1.049h8.374c.095 0 .158-.017.158-.1v-2.966c0-.086-.063-.1-.158-.1h-2.45v-1.881h2.649a1.665 1.665 0 0 1 1.629 1.412c.105.413.336 1.757.494 2.187c.157.483.8 1.447 1.482 1.447h4.323a10.243 10.243 0 0 1-.949 1.1Zm4.65-7.821a10.261 10.261 0 0 1 .022 1.779h-1.051c-.105 0-.148.069-.148.172v.483c0 1.136-.641 1.384-1.2 1.447c-.535.06-1.128-.224-1.2-.551a3.616 3.616 0 0 0-1.671-2.808c1.03-.654 2.1-1.619 2.1-2.911A3.292 3.292 0 0 0 21.44 9.8a4.559 4.559 0 0 0-2.2-.724H8.367A10.246 10.246 0 0 1 14.1 5.84l1.282 1.344a.758.758 0 0 0 1.072.026l1.434-1.372a10.248 10.248 0 0 1 7.015 5l-.982 2.217a.761.761 0 0 0 .386 1Zm2.448.036l-.033-.343l1.011-.943a.42.42 0 0 0-.013-.595a.428.428 0 0 0-.121-.081l-1.288-.483l-.1-.334l.806-1.12a.422.422 0 0 0-.13-.581a.43.43 0 0 0-.133-.055l-1.363-.222l-.164-.306l.573-1.257a.419.419 0 0 0-.236-.544a.426.426 0 0 0-.146-.029l-1.383.048l-.224-.264l.318-1.347a.421.421 0 0 0-.343-.487a.435.435 0 0 0-.144 0l-1.348.315l-.266-.219l.049-1.381a.421.421 0 0 0-.431-.411a.426.426 0 0 0-.141.028l-1.257.573l-.306-.164l-.222-1.363a.421.421 0 0 0-.5-.318a.43.43 0 0 0-.133.055l-1.121.806l-.333-.1l-.483-1.293a.421.421 0 0 0-.555-.215a.442.442 0 0 0-.12.08l-.946 1.012l-.343-.033l-.728-1.177a.421.421 0 0 0-.688 0l-.728 1.177l-.343.033l-.943-1.012a.421.421 0 0 0-.595.015a.442.442 0 0 0-.08.12L12.483 3.8l-.333.1l-1.12-.8a.422.422 0 0 0-.581.13a.43.43 0 0 0-.055.133l-.222 1.363l-.306.164l-1.258-.573a.421.421 0 0 0-.544.239a.444.444 0 0 0-.028.144l.048 1.383l-.266.217l-1.347-.316a.421.421 0 0 0-.487.343a.435.435 0 0 0 0 .144L6.3 7.819l-.218.265L4.7 8.036a.422.422 0 0 0-.383.573l.573 1.257l-.164.306l-1.363.222a.42.42 0 0 0-.318.5a.43.43 0 0 0 .055.133l.806 1.12l-.1.334l-1.293.483a.421.421 0 0 0-.215.555a.414.414 0 0 0 .081.121l1.011.943l-.033.343l-1.177.728a.421.421 0 0 0 0 .688l1.177.728l.033.343l-1.011.943a.421.421 0 0 0 .015.595a.436.436 0 0 0 .119.08l1.293.483l.1.334l-.806 1.124a.421.421 0 0 0 .131.581a.43.43 0 0 0 .133.055l1.363.222l.164.307l-.573 1.257a.422.422 0 0 0 .24.545a.438.438 0 0 0 .143.028l1.383-.048l.219.266l-.317 1.348a.42.42 0 0 0 .341.486a.4.4 0 0 0 .146 0l1.345-.319l.266.218l-.049 1.382a.419.419 0 0 0 .429.41a.413.413 0 0 0 .143-.028l1.257-.573l.306.164l.222 1.362a.421.421 0 0 0 .5.319a.407.407 0 0 0 .133-.055l1.12-.807l.334.1l.483 1.292a.422.422 0 0 0 .556.214a.436.436 0 0 0 .119-.08l.943-1.011l.343.034l.728 1.177a.422.422 0 0 0 .588.1a.413.413 0 0 0 .1-.1l.728-1.177l.343-.034l.943 1.011a.421.421 0 0 0 .595-.015a.436.436 0 0 0 .08-.119l.483-1.292l.334-.1l1.12.807a.421.421 0 0 0 .581-.131a.43.43 0 0 0 .055-.133l.222-1.362l.306-.164l1.257.573a.421.421 0 0 0 .544-.239a.438.438 0 0 0 .028-.143l-.048-1.384l.265-.218l1.347.317a.421.421 0 0 0 .487-.34a.447.447 0 0 0 0-.146l-.309-1.346l.218-.266l1.383.048a.421.421 0 0 0 .41-.431a.4.4 0 0 0-.028-.142l-.573-1.257l.164-.307l1.363-.222a.421.421 0 0 0 .319-.5a.434.434 0 0 0-.056-.135l-.806-1.12l.1-.334l1.293-.483a.42.42 0 0 0 .215-.554a.414.414 0 0 0-.081-.121l-1.011-.943l.033-.343l1.177-.728a.421.421 0 0 0 0-.688Z"/>`}})),Im=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#cd6799" d="M26.11 17.572a5.8 5.8 0 0 0-2.537.588a5.345 5.345 0 0 1-.568-1.314a3.53 3.53 0 0 1-.051-1.1a9.811 9.811 0 0 1 .332-1.192c-.005-.051-.061-.292-.624-.3s-1.048.107-1.1.256a6.171 6.171 0 0 0-.235.834a19.686 19.686 0 0 1-1.713 3.294a3.186 3.186 0 0 1-.44-2.066a9.811 9.811 0 0 1 .332-1.192c-.005-.051-.061-.292-.624-.3s-1.048.107-1.1.256s-.118.5-.235.834s-1.483 3.386-1.841 4.173c-.184.4-.343.726-.455.946a.233.233 0 0 1-.02.041l-.153.292v.005c-.077.138-.159.266-.2.266a1.711 1.711 0 0 1 .01-.869c.2-1.059.69-2.705.685-2.762c0-.031.092-.317-.317-.465a.508.508 0 0 0-.578.1c-.036 0-.061.087-.061.087s.445-1.851-.849-1.851a3.855 3.855 0 0 0-2.475 1.683c-.348.189-1.089.593-1.882 1.028c-.3.169-.614.338-.905.5c-.02-.02-.041-.046-.061-.066C6.87 17.6 3.975 16.416 4.1 14.171c.046-.818.327-2.966 5.559-5.575c4.306-2.122 7.733-1.534 8.326-.23c.849 1.862-1.836 5.319-6.285 5.82a3.351 3.351 0 0 1-2.813-.711c-.235-.256-.271-.271-.358-.22c-.143.077-.051.307 0 .44a2.626 2.626 0 0 0 1.606 1.263a8.55 8.55 0 0 0 5.217-.517c2.7-1.043 4.8-3.943 4.184-6.372c-.619-2.465-4.71-3.278-8.582-1.9a19.5 19.5 0 0 0-6.595 3.783c-2.133 1.995-2.47 3.728-2.332 4.455c.5 2.578 4.051 4.255 5.472 5.5a8.554 8.554 0 0 1-.194.107c-.711.353-3.421 1.77-4.1 3.268c-.767 1.7.123 2.915.711 3.079a4.374 4.374 0 0 0 4.71-1.908a4.725 4.725 0 0 0 .423-4.353a.107.107 0 0 0-.02-.031l.557-.327a27.2 27.2 0 0 1 1.028-.578a6.74 6.74 0 0 0-.363 1.862a3.886 3.886 0 0 0 .834 2.7a.921.921 0 0 0 .675.22c.6 0 .875-.5 1.176-1.094c.368-.726.7-1.57.7-1.57s-.414 2.281.711 2.281c.409 0 .823-.532 1.008-.8v.005l.031-.051l.066-.107v-.01c.164-.286.532-.936 1.079-2.015c.706-1.391 1.386-3.13 1.386-3.13a8.888 8.888 0 0 0 .271 1.13a10.643 10.643 0 0 0 .583 1.309c-.164.23-.266.358-.266.358l.005.005c-.133.174-.276.363-.435.547a16.3 16.3 0 0 0-1.314 1.647a.447.447 0 0 0 .123.6a1.116 1.116 0 0 0 .685.113a3.147 3.147 0 0 0 1.028-.235a3.45 3.45 0 0 0 .885-.465a1.98 1.98 0 0 0 .849-1.744a3.521 3.521 0 0 0-.322-1.233c.051-.072.1-.143.148-.215a23.428 23.428 0 0 0 1.534-2.649a8.888 8.888 0 0 0 .271 1.13a7.57 7.57 0 0 0 .5 1.125a4.861 4.861 0 0 0-1.497 1.922c-.322.931-.072 1.35.4 1.447a1.425 1.425 0 0 0 .747-.153a3.4 3.4 0 0 0 .946-.486a2.126 2.126 0 0 0 1.043-1.729a3.268 3.268 0 0 0-.235-1.023a5.356 5.356 0 0 1 2.716-.312c2.434.286 2.915 1.805 2.823 2.445a1.618 1.618 0 0 1-.772 1.094c-.169.107-.225.143-.21.22c.02.113.1.107.245.087A1.9 1.9 0 0 0 30 20.7c.077-1.5-1.355-3.145-3.887-3.13ZM7.33 23.9c-.808.88-1.933 1.212-2.419.931c-.522-.3-.317-1.6.675-2.532a12.884 12.884 0 0 1 1.9-1.417c.118-.072.292-.174.5-.3l.056-.031l.123-.077A3.493 3.493 0 0 1 7.33 23.9Zm5.881-4c-.281.685-.869 2.44-1.227 2.342c-.307-.082-.5-1.412-.061-2.726a6.193 6.193 0 0 1 .956-1.754c.44-.491.926-.655 1.043-.455a9.062 9.062 0 0 1-.711 2.593Zm4.853 2.322c-.118.061-.23.1-.281.072c-.036-.02.051-.1.051-.1s.609-.655.849-.951c.138-.174.3-.378.476-.609v.066c0 .782-.757 1.309-1.094 1.524Zm3.744-.854c-.087-.061-.072-.266.22-.905a3.408 3.408 0 0 1 .834-1.074a1.448 1.448 0 0 1 .082.471a1.547 1.547 0 0 1-1.135 1.509Z"/>`}})),Lm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#d9b400" d="M29.4 27.6H2.5V4.5h26.9Zm-25.9-1h24.9V5.5H3.5Z"/><path fill="#d9b400" d="m6.077 19.316l-.555-.832l4.844-3.229l-4.887-4.071l.641-.768l5.915 4.928l-5.958 3.972zM12.7 18.2h7.8v1h-7.8zM2.5 5.5h26.9v1.9H2.5z"/>`}})),Rm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ffda44" d="M8.562 15.256A21.159 21.159 0 0 0 16 16.449a21.159 21.159 0 0 0 7.438-1.194c1.864-.727 2.525-1.535 2.525-2V9.7a10.357 10.357 0 0 1-2.084 1.076A22.293 22.293 0 0 1 16 12.078a22.36 22.36 0 0 1-7.879-1.3A10.28 10.28 0 0 1 6.037 9.7v3.55c0 .474.663 1.278 2.525 2.006Zm0 6.705a15.611 15.611 0 0 0 2.6.741a24.9 24.9 0 0 0 4.838.453a24.9 24.9 0 0 0 4.838-.452a15.614 15.614 0 0 0 2.6-.741c1.864-.727 2.525-1.535 2.525-2v-3.39a10.706 10.706 0 0 1-1.692.825A23.49 23.49 0 0 1 16 18.74a23.49 23.49 0 0 1-8.271-1.348a10.829 10.829 0 0 1-1.692-.825v3.393c0 .466.663 1.271 2.525 2.001ZM16 30c5.5 0 9.963-1.744 9.963-3.894v-2.837a10.5 10.5 0 0 1-1.535.762l-.157.063A23.487 23.487 0 0 1 16 25.445a23.422 23.422 0 0 1-8.271-1.351c-.054-.02-.106-.043-.157-.063a10.5 10.5 0 0 1-1.535-.762v2.837C6.037 28.256 10.5 30 16 30Z"/><ellipse cx="16" cy="5.894" fill="#ffda44" rx="9.963" ry="3.894"/>`}})),zm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ff3e00" d="M26.47 5.7a8.973 8.973 0 0 0-11.793-2.454L7.96 7.4a7.461 7.461 0 0 0-3.481 5.009a7.686 7.686 0 0 0 .8 5.058a7.358 7.358 0 0 0-1.151 2.8a7.789 7.789 0 0 0 1.4 6.028a8.977 8.977 0 0 0 11.794 2.458L24.04 24.6a7.468 7.468 0 0 0 3.481-5.009a7.673 7.673 0 0 0-.8-5.062a7.348 7.348 0 0 0 1.152-2.8A7.785 7.785 0 0 0 26.47 5.7"/><path fill="#fff" d="M14.022 26.64A5.413 5.413 0 0 1 8.3 24.581a4.678 4.678 0 0 1-.848-3.625a4.307 4.307 0 0 1 .159-.61l.127-.375l.344.238a8.76 8.76 0 0 0 2.628 1.274l.245.073l-.025.237a1.441 1.441 0 0 0 .271.968a1.63 1.63 0 0 0 1.743.636a1.512 1.512 0 0 0 .411-.175l6.7-4.154a1.366 1.366 0 0 0 .633-.909a1.407 1.407 0 0 0-.244-1.091a1.634 1.634 0 0 0-1.726-.622a1.509 1.509 0 0 0-.413.176l-2.572 1.584a4.934 4.934 0 0 1-1.364.582a5.415 5.415 0 0 1-5.727-2.06a4.678 4.678 0 0 1-.831-3.628A4.507 4.507 0 0 1 9.9 10.09l6.708-4.154a4.932 4.932 0 0 1 1.364-.581A5.413 5.413 0 0 1 23.7 7.414a4.679 4.679 0 0 1 .848 3.625a4.272 4.272 0 0 1-.159.61l-.127.375l-.344-.237a8.713 8.713 0 0 0-2.628-1.274l-.245-.074l.025-.237a1.438 1.438 0 0 0-.272-.968a1.629 1.629 0 0 0-1.725-.622a1.484 1.484 0 0 0-.411.176l-6.722 4.14a1.353 1.353 0 0 0-.631.908a1.394 1.394 0 0 0 .244 1.092a1.634 1.634 0 0 0 1.726.621a1.538 1.538 0 0 0 .413-.175l2.562-1.585a4.9 4.9 0 0 1 1.364-.581a5.417 5.417 0 0 1 5.728 2.059a4.681 4.681 0 0 1 .843 3.625a4.5 4.5 0 0 1-2.089 3.013l-6.707 4.154a4.9 4.9 0 0 1-1.364.581"/>`}})),Bm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M7.674 14.488a2.218 2.218 0 1 0 0 3.137h16.652a2.218 2.218 0 1 0 0-3.137Z"/><path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M11.222 9.06A2.218 2.218 0 1 0 9 11.278l11.778 11.774A2.218 2.218 0 1 0 23 20.834Z"/><path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M17.568 7.73a2.218 2.218 0 1 0-3.137 0v16.652a2.218 2.218 0 1 0 3.137 0Z"/><path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M23 11.278a2.218 2.218 0 1 0-2.222-2.218L9 20.834a2.218 2.218 0 1 0 2.218 2.218Z"/><path fill="#ffb13b" d="M7.674 14.488a2.218 2.218 0 1 0 0 3.137h16.652a2.218 2.218 0 1 0 0-3.137Z"/><path fill="#ffb13b" d="M11.222 9.06A2.218 2.218 0 1 0 9 11.278l11.778 11.774A2.218 2.218 0 1 0 23 20.834Z"/><path fill="#ffb13b" d="M17.568 7.73a2.218 2.218 0 1 0-3.137 0v16.652a2.218 2.218 0 1 0 3.137 0Z"/><path fill="#ffb13b" d="M23 11.278a2.218 2.218 0 1 0-2.222-2.218L9 20.834a2.218 2.218 0 1 0 2.218 2.218Z"/><path d="M2 16.056h28v9.894a4.035 4.035 0 0 1-4.106 4.106H6.106A4.035 4.035 0 0 1 2 25.95Z"/><path fill="#fff" d="M6.2 23.045a3.628 3.628 0 1 1 6.2-2.565h-2.13a1.5 1.5 0 1 0-2.57 1.061a1.6 1.6 0 0 0 1.062.441a4.118 4.118 0 0 1 2.566 1.063a3.628 3.628 0 1 1-6.194 2.565h2.13a1.5 1.5 0 1 0 2.566-1.06a1.948 1.948 0 0 0-1.063-.44A4.465 4.465 0 0 1 6.2 23.045Zm13.451-6.193L17.085 29.24H14.96L12.4 16.852h2.12l1.5 7.255l1.5-7.255Zm3.629 5.131h3.628v3.628a3.628 3.628 0 1 1-7.257 0V20.48a3.628 3.628 0 0 1 7.257 0h-2.125a1.5 1.5 0 1 0-3.005 0v5.13a1.5 1.5 0 0 0 3.005 0v-1.5h-1.5v-2.127Z"/>`}})),Vm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeSwift0" x1="-134.494" x2="-134.497" y1="-171.82" y2="-171.89" gradientTransform="matrix(240 0 0 -205.6 32295 -35312.585)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f88535"/><stop offset="1" stop-color="#fd2221"/></linearGradient></defs><path fill="url(#vscodeIconsFileTypeSwift0)" d="M19.422 4.007s6.217 3.554 7.844 9.2c1.466 5.1.292 7.534.292 7.534a8.915 8.915 0 0 1 1.742 2.8a4.825 4.825 0 0 1 .29 4.453s-.1-2.08-3.2-2.511c-2.841-.4-3.874 2.366-9.3 2.232A18.435 18.435 0 0 1 2 19.354C4.651 20.8 8.124 23.045 12.449 22.7s5.228-1.674 5.228-1.674A66.9 66.9 0 0 1 4.891 7.643c3.4 2.845 11.822 8.507 11.626 8.363A75.826 75.826 0 0 1 8.092 6.24s12.636 10.389 13.653 10.323c.418-.861 2.579-5.318-2.324-12.557Z"/>`}})),Hm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#44a8b3" d="M9 13.7q1.4-5.6 7-5.6c5.6 0 6.3 4.2 9.1 4.9q2.8.7 4.9-2.1q-1.4 5.6-7 5.6c-5.6 0-6.3-4.2-9.1-4.9q-2.8-.7-4.9 2.1Zm-7 8.4q1.4-5.6 7-5.6c5.6 0 6.3 4.2 9.1 4.9q2.8.7 4.9-2.1q-1.4 5.6-7 5.6c-5.6 0-6.3-4.2-9.1-4.9q-2.8-.7-4.9 2.1Z"/>`}})),Um=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#c2c2c2" d="M22.038 2H6.375a1.755 1.755 0 0 0-1.75 1.75v24.5A1.755 1.755 0 0 0 6.375 30h19.25a1.755 1.755 0 0 0 1.75-1.75V6.856Zm.525 2.844l1.663 1.531h-1.663ZM6.375 28.25V3.75h14.438v4.375h4.813V28.25Z"/><path fill="#829ec2" d="M8.125 15.097h13.076v1.75H8.125zm0 9.342h9.762v1.75H8.125zm0-4.676h15.75v1.75H8.125zm0-9.533h15.75v1.75H8.125z"/>`}})),Wm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#7f7f7f" d="M22.76 6.83v3.25h-5v15.09h-3.5V10.08h-5V6.83Z"/><path fill="#bfbfbf" d="M2 2h6.2v3.09H5.34v21.8H8.2V30H2Zm28 28h-6.2v-3.09h2.86V5.11H23.8V2H30Z"/>`}})),Gm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#007acc" d="M23.827 8.243a4.424 4.424 0 0 1 2.223 1.281a5.853 5.853 0 0 1 .852 1.143c.011.045-1.534 1.083-2.471 1.662c-.034.023-.169-.124-.322-.35a2.014 2.014 0 0 0-1.67-1c-1.077-.074-1.771.49-1.766 1.433a1.3 1.3 0 0 0 .153.666c.237.49.677.784 2.059 1.383c2.544 1.1 3.636 1.817 4.31 2.843a5.158 5.158 0 0 1 .416 4.333a4.764 4.764 0 0 1-3.932 2.815a10.9 10.9 0 0 1-2.708-.028a6.531 6.531 0 0 1-3.616-1.884a6.278 6.278 0 0 1-.926-1.371a2.655 2.655 0 0 1 .327-.208c.158-.09.756-.434 1.32-.761l1.024-.6l.214.312a4.771 4.771 0 0 0 1.35 1.292a3.3 3.3 0 0 0 3.458-.175a1.545 1.545 0 0 0 .2-1.974c-.276-.4-.84-.727-2.443-1.422a8.8 8.8 0 0 1-3.349-2.055a4.687 4.687 0 0 1-.976-1.777a7.116 7.116 0 0 1-.062-2.268a4.332 4.332 0 0 1 3.644-3.374a9 9 0 0 1 2.691.084Zm-8.343 1.483l.011 1.454h-4.63v13.148H7.6V11.183H2.97V9.755a13.986 13.986 0 0 1 .04-1.466c.017-.023 2.832-.034 6.245-.028l6.211.017Z"/><path fill="#99b8c4" d="m27.075 25.107l.363-.361c1.68.055 1.706 0 1.78-.177l.462-1.124l.034-.107l-.038-.093c-.02-.049-.081-.2-1.13-1.2v-.526c1.211-1.166 1.185-1.226 1.116-1.4l-.46-1.136c-.069-.17-.1-.237-1.763-.191l-.364-.367a8.138 8.138 0 0 0-.057-1.657l-.047-.106l-1.2-.525c-.177-.081-.239-.11-1.372 1.124l-.509-.008c-1.167-1.245-1.222-1.223-1.4-1.152l-1.115.452c-.175.071-.236.1-.169 1.79l-.36.359c-1.68-.055-1.7 0-1.778.177L18.606 20l-.036.108l.038.094c.02.048.078.194 1.13 1.2v.525c-1.211 1.166-1.184 1.226-1.115 1.4l.459 1.137c.07.174.1.236 1.763.192l.363.377a8.169 8.169 0 0 0 .055 1.654l.047.107l1.208.528c.176.073.236.1 1.366-1.13l.509.006c1.168 1.247 1.228 1.223 1.4 1.154l1.113-.45c.176-.075.237-.102.169-1.795Zm-4.788-2.632a2 2 0 1 1 2.618 1.14a2.023 2.023 0 0 1-2.618-1.14Z"/>`}})),Km=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#007acc" d="M23.827 8.243a4.424 4.424 0 0 1 2.223 1.281a5.853 5.853 0 0 1 .852 1.143c.011.045-1.534 1.083-2.471 1.662c-.034.023-.169-.124-.322-.35a2.014 2.014 0 0 0-1.67-1c-1.077-.074-1.771.49-1.766 1.433a1.3 1.3 0 0 0 .153.666c.237.49.677.784 2.059 1.383c2.544 1.095 3.636 1.817 4.31 2.843a5.158 5.158 0 0 1 .416 4.333a4.764 4.764 0 0 1-3.932 2.815a10.9 10.9 0 0 1-2.708-.028a6.531 6.531 0 0 1-3.616-1.884a6.278 6.278 0 0 1-.926-1.371a2.655 2.655 0 0 1 .327-.208c.158-.09.756-.434 1.32-.761l1.024-.6l.214.312a4.771 4.771 0 0 0 1.35 1.292a3.3 3.3 0 0 0 3.458-.175a1.545 1.545 0 0 0 .2-1.974c-.276-.395-.84-.727-2.443-1.422a8.8 8.8 0 0 1-3.349-2.055a4.687 4.687 0 0 1-.976-1.777a7.116 7.116 0 0 1-.062-2.268a4.332 4.332 0 0 1 3.644-3.374a9 9 0 0 1 2.691.084Zm-8.343 1.483l.011 1.454h-4.63v13.148H7.6V11.183H2.97V9.755a13.986 13.986 0 0 1 .04-1.466c.017-.023 2.832-.034 6.245-.028l6.211.017Z"/>`}})),qm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#e75749" d="M4.5 2.375A2.562 2.562 0 0 1 5.861 2h20.366a2.545 2.545 0 0 1 2.423 1.951a3.37 3.37 0 0 1 .072.862v11.176h-1.573a1.814 1.814 0 0 0-.22.022a5.236 5.236 0 0 0-.581-.011c-.3.007-.61-.014-.914.014a2.275 2.275 0 0 0-.4-.02h-4.739c-.2 0-.392.008-.587-.01l.1-.065l-6.353-3.813v3.889c-2.213-.005-4.427 0-6.64 0a2.274 2.274 0 0 0-.251.021c-.212-.032-.427-.016-.642-.016c-.284.006-.57-.015-.853.015a2.052 2.052 0 0 0-.253-.022H3.275c.006-3.635 0-7.27 0-10.9a4.786 4.786 0 0 1 .071-1.131A2.541 2.541 0 0 1 4.5 2.375Zm.54 2.188a.639.639 0 0 0-.489.606v1.316a.639.639 0 0 0 .627.6h1.309a.638.638 0 0 0 .6-.608c.005-.426 0-.853 0-1.279a.644.644 0 0 0-.329-.575a.708.708 0 0 0-.358-.078H5.264a1.081 1.081 0 0 0-.224.018Zm20.341 0a.639.639 0 0 0-.474.607v1.306a.638.638 0 0 0 .6.608c.436.005.872 0 1.308 0a.639.639 0 0 0 .627-.606c.006-.438 0-.876 0-1.314a.638.638 0 0 0-.594-.621c-.348-.009-.7 0-1.045 0a1.98 1.98 0 0 0-.422.024ZM5.042 8.38a.637.637 0 0 0-.452.4a1.078 1.078 0 0 0-.041.386v1.135a.637.637 0 0 0 .6.6c.4.008.795 0 1.192 0a.826.826 0 0 0 .395-.065a.641.641 0 0 0 .36-.574V8.983a.638.638 0 0 0-.6-.624c-.338-.008-.677 0-1.016 0a2.385 2.385 0 0 0-.438.021Zm20.338 0a.637.637 0 0 0-.433.4a1.072 1.072 0 0 0-.041.387v1.131a.638.638 0 0 0 .608.607c.406.006.812 0 1.218 0a.739.739 0 0 0 .38-.078a.64.64 0 0 0 .335-.558V8.985a.637.637 0 0 0-.593-.622c-.349-.009-.7 0-1.047 0a1.928 1.928 0 0 0-.428.022ZM5.041 12.2a.639.639 0 0 0-.491.608c0 .438-.005.877 0 1.315a.638.638 0 0 0 .627.6h1.3a.638.638 0 0 0 .608-.607v-1.307a.638.638 0 0 0-.605-.626c-.348-.007-.7 0-1.045 0a2.12 2.12 0 0 0-.394.017Zm20.335.006a.635.635 0 0 0-.43.394a1.06 1.06 0 0 0-.041.386v1.131a.638.638 0 0 0 .607.608c.435.005.87 0 1.306 0a.639.639 0 0 0 .628-.605c.006-.438 0-.876 0-1.313a.637.637 0 0 0-.592-.622c-.349-.01-.7 0-1.046 0a1.908 1.908 0 0 0-.431.015Z"/><path fill="#fff" d="M13.458 12.1q3.176 1.908 6.353 3.813l-.1.065q-3.127 1.872-6.251 3.748V15.99c-.001-1.295-.004-2.59-.002-3.89Z"/><path fill="#c0392b" d="M3.275 15.988h1.541a2.052 2.052 0 0 1 .253.022a.645.645 0 0 0-.409.273a.883.883 0 0 0-.111.518v1.045a.686.686 0 0 0 .685.689h1.192a.68.68 0 0 0 .657-.569c.008-.447 0-.9 0-1.343a.632.632 0 0 0-.521-.613a2.274 2.274 0 0 1 .251-.021h6.64v3.736q3.127-1.871 6.251-3.748c.2.018.391.007.587.01h4.741a2.275 2.275 0 0 1 .4.02a.637.637 0 0 0-.475.385a.983.983 0 0 0-.045.407v1.014a.677.677 0 0 0 .691.719h1.16a.684.684 0 0 0 .686-.658v-.984a1.074 1.074 0 0 0-.1-.589a.642.642 0 0 0-.42-.292a1.814 1.814 0 0 1 .22-.022h1.573c.011 1.721 0 3.443 0 5.165v6.293a2.567 2.567 0 0 1-.612 1.651a2.539 2.539 0 0 1-1.563.868a7.534 7.534 0 0 1-.981.033H6.724a9.27 9.27 0 0 1-1.368-.048a2.557 2.557 0 0 1-2-1.846a2.825 2.825 0 0 1-.09-.746V16.891c.007-.3-.002-.602.009-.903Zm1.795 3.843a.613.613 0 0 0-.386.234a.761.761 0 0 0-.134.464v1.162a.685.685 0 0 0 .686.658h1.283a.687.687 0 0 0 .568-.716v-1.191a.617.617 0 0 0-.2-.458a.712.712 0 0 0-.487-.17H5.264a1.039 1.039 0 0 0-.194.017Zm20.366 0a.62.62 0 0 0-.522.58v1.222a.676.676 0 0 0 .69.718c.428 0 .857.005 1.285 0a.7.7 0 0 0 .562-.684v-1.013a.9.9 0 0 0-.123-.568a.661.661 0 0 0-.532-.267h-.954a2.246 2.246 0 0 0-.406.011ZM5.071 23.648a.609.609 0 0 0-.4.249a.766.766 0 0 0-.124.448v1.132a.7.7 0 0 0 .6.688h1.376a.687.687 0 0 0 .567-.717v-1.189a.617.617 0 0 0-.2-.459a.71.71 0 0 0-.484-.17H5.265a1.028 1.028 0 0 0-.194.018Zm20.362 0a.616.616 0 0 0-.492.427a.99.99 0 0 0-.029.33V25.6a.681.681 0 0 0 .656.567h1.193a.689.689 0 0 0 .686-.719v-1.164a.657.657 0 0 0-.286-.545a1.461 1.461 0 0 0-.787-.11c-.312.01-.629-.02-.94.018Z"/>`}})),Jm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<g fill="none"><path fill="url(#vscodeIconsFileTypeVite0)" d="m29.884 6.146l-13.142 23.5a.714.714 0 0 1-1.244.005L2.096 6.148a.714.714 0 0 1 .746-1.057l13.156 2.352a.714.714 0 0 0 .253 0l12.881-2.348a.714.714 0 0 1 .752 1.05z"/><path fill="url(#vscodeIconsFileTypeVite1)" d="M22.264 2.007L12.54 3.912a.357.357 0 0 0-.288.33l-.598 10.104a.357.357 0 0 0 .437.369l2.707-.625a.357.357 0 0 1 .43.42l-.804 3.939a.357.357 0 0 0 .454.413l1.672-.508a.357.357 0 0 1 .454.414l-1.279 6.187c-.08.387.435.598.65.267l.143-.222l7.925-15.815a.357.357 0 0 0-.387-.51l-2.787.537a.357.357 0 0 1-.41-.45l1.818-6.306a.357.357 0 0 0-.412-.45z"/><defs><linearGradient id="vscodeIconsFileTypeVite0" x1="6" x2="235" y1="33" y2="344" gradientTransform="translate(1.34 1.894) scale(.07142)" gradientUnits="userSpaceOnUse"><stop stop-color="#41D1FF"/><stop offset="1" stop-color="#BD34FE"/></linearGradient><linearGradient id="vscodeIconsFileTypeVite1" x1="194.651" x2="236.076" y1="8.818" y2="292.989" gradientTransform="translate(1.34 1.894) scale(.07142)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFEA83"/><stop offset=".083" stop-color="#FFDD35"/><stop offset="1" stop-color="#FFA800"/></linearGradient></defs></g>`}})),Ym=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#fcc72b" d="m22.86 11.09l-6.55 9.46a.58.58 0 0 1-.28.21a.55.55 0 0 1-.36 0a.56.56 0 0 1-.29-.21a.59.59 0 0 1-.09-.35l.26-5.2l-4.23-.9a.55.55 0 0 1-.24-.12a.5.5 0 0 1-.16-.22a.5.5 0 0 1 0-.27a.46.46 0 0 1 .1-.25l6.54-9.46a.58.58 0 0 1 .29-.22a.53.53 0 0 1 .35 0a.58.58 0 0 1 .29.22a.52.52 0 0 1 .09.34l-.26 5.22l4.23.9a.58.58 0 0 1 .25.12a.69.69 0 0 1 .16.22a.62.62 0 0 1-.06.53Z"/><path fill="#729b1b" d="M16 28.49a1.44 1.44 0 0 1-.5-.1a1.3 1.3 0 0 1-.43-.29l-6.19-6.19A1.28 1.28 0 0 1 8.5 21a1.3 1.3 0 0 1 1.32-1.32a1.32 1.32 0 0 1 .94.38L16 25.29l11.43-11.43a1.32 1.32 0 0 1 .94-.38a1.31 1.31 0 0 1 .93.39a1.29 1.29 0 0 1 .39.93a1.34 1.34 0 0 1-.38.93L16.94 28.1a1.42 1.42 0 0 1-.43.29a1.45 1.45 0 0 1-.51.1Z"/><path fill="#729b1b" fill-opacity=".5" d="M16 28.49a1.44 1.44 0 0 0 .5-.1a1.3 1.3 0 0 0 .43-.29l6.19-6.19a1.28 1.28 0 0 0 .38-.91a1.3 1.3 0 0 0-1.32-1.32a1.32 1.32 0 0 0-.94.38L16 25.29L4.57 13.86a1.32 1.32 0 0 0-.94-.38a1.31 1.31 0 0 0-.93.39a1.29 1.29 0 0 0-.39.93a1.34 1.34 0 0 0 .38.93L15.06 28.1a1.42 1.42 0 0 0 .43.29a1.45 1.45 0 0 0 .51.1Z"/>`}})),Xm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#41b883" d="M24.4 3.925H30l-14 24.15L2 3.925h10.71l3.29 5.6l3.22-5.6Z"/><path fill="#41b883" d="m2 3.925l14 24.15l14-24.15h-5.6L16 18.415L7.53 3.925Z"/><path fill="#35495e" d="M7.53 3.925L16 18.485l8.4-14.56h-5.18L16 9.525l-3.29-5.6Z"/>`}})),Zm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeWord0" x1="4.494" x2="13.832" y1="-1712.086" y2="-1695.914" gradientTransform="translate(0 1720)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2368c4"/><stop offset=".5" stop-color="#1a5dbe"/><stop offset="1" stop-color="#1146ac"/></linearGradient></defs><path fill="#41a5ee" d="M28.806 3H9.705a1.192 1.192 0 0 0-1.193 1.191V9.5l11.069 3.25L30 9.5V4.191A1.192 1.192 0 0 0 28.806 3Z"/><path fill="#2b7cd3" d="M30 9.5H8.512V16l11.069 1.95L30 16Z"/><path fill="#185abd" d="M8.512 16v6.5l10.418 1.3L30 22.5V16Z"/><path fill="#103f91" d="M9.705 29h19.1A1.192 1.192 0 0 0 30 27.809V22.5H8.512v5.309A1.192 1.192 0 0 0 9.705 29Z"/><path d="M16.434 8.2H8.512v16.25h7.922a1.2 1.2 0 0 0 1.194-1.191V9.391A1.2 1.2 0 0 0 16.434 8.2Z" opacity=".1"/><path d="M15.783 8.85H8.512V25.1h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.783 8.85H8.512V23.8h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.132 8.85h-6.62V23.8h6.62a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path fill="url(#vscodeIconsFileTypeWord0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"/><path fill="#fff" d="M6.9 17.988c.023.184.039.344.046.481h.028c.01-.13.032-.287.065-.47s.062-.338.089-.465l1.255-5.407h1.624l1.3 5.326a7.761 7.761 0 0 1 .162 1h.022a7.6 7.6 0 0 1 .135-.975l1.039-5.358h1.477l-1.824 7.748h-1.727l-1.237-5.126q-.054-.222-.122-.578t-.084-.52h-.021q-.021.189-.084.561c-.042.249-.075.432-.1.552L7.78 19.871H6.024L4.19 12.127h1.5l1.131 5.418a4.469 4.469 0 0 1 .079.443Z"/>`}})),Qm=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f1662a" d="m20.42 21.157l2.211 2.211L30 16l-7.369-7.369l-2.211 2.212L25.58 16Zm-8.84-10.314L9.369 8.631L2 16l7.369 7.369l2.211-2.211L6.42 16Zm5.831-3.166l1.6.437l-4.42 16.209l-1.6-.437l4.42-16.209Z"/>`}})),$m=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ffe885" d="M2 12.218c.755 0 1.51-.008 2.264 0l.053.038l2.761 2.758c.891-.906 1.8-1.794 2.7-2.7c.053-.052.11-.113.192-.1h1.823a1.4 1.4 0 0 1 .353.019c-.7.67-1.377 1.369-2.069 2.05L5.545 18.8c-.331.324-.648.663-.989.975c-.754.022-1.511.007-2.266.007c1.223-1.209 2.431-2.433 3.658-3.637c-1.321-1.304-2.63-2.62-3.948-3.927Zm10.7 0h1.839v7.566c-.611 0-1.222.012-1.832-.008v-4.994c-1.6 1.607-3.209 3.2-4.811 4.8c-.089.08-.166.217-.305.194c-.824-.006-1.649 0-2.474 0Q8.916 16 12.7 12.218Zm2.258.002c.47-.009.939 0 1.409 0c.836.853 1.69 1.689 2.536 2.532q1.268-1.267 2.539-2.532h1.4q-.008 3.784 0 7.567c-.471 0-.943.006-1.414 0q.008-2.387 0-4.773c-.844.843-1.676 1.7-2.526 2.536c-.856-.835-1.687-1.695-2.532-2.541c0 1.594-.006 3.188.006 4.781c-.472 0-.943.005-1.415 0q-.003-3.79-.003-7.57Zm8.301-.003c.472 0 .944-.007 1.416 0q-.007 3.083 0 6.166h3.782c.063.006.144-.012.191.045c.448.454.907.9 1.353 1.354q-3.371.007-6.741 0q.007-3.782-.001-7.565Z"/>`}})),eh=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#2188b6" d="M28.208 24.409a10.493 10.493 0 0 0-3.959 1.822a23.743 23.743 0 0 1-5.835 2.642a1.632 1.632 0 0 1-.983.55a62.228 62.228 0 0 1-6.447.577c-1.163.009-1.876-.3-2.074-.776a1.573 1.573 0 0 1 .866-2.074a3.759 3.759 0 0 1-.514-.379c-.171-.171-.352-.514-.406-.388c-.225.55-.343 1.894-.947 2.5c-.83.839-2.4.559-3.328.072c-1.019-.541.072-1.813.072-1.813a.73.73 0 0 1-.992-.343a4.847 4.847 0 0 1-.667-2.949a5.374 5.374 0 0 1 1.749-2.895a9.334 9.334 0 0 1 .658-4.4a10.445 10.445 0 0 1 3.165-3.661S6.628 10.747 7.35 8.817c.469-1.262.658-1.253.812-1.308a3.633 3.633 0 0 0 1.452-.857a5.265 5.265 0 0 1 4.41-1.7S15.2 1.4 16.277 2.09a18.349 18.349 0 0 1 1.533 2.886s1.281-.748 1.425-.469a11.334 11.334 0 0 1 .523 6.132a14.01 14.01 0 0 1-2.6 5.411c-.135.225 1.551.938 2.615 3.887c.983 2.7.108 4.96.262 5.212c.027.045.036.063.036.063s1.127.09 3.391-1.308a8.5 8.5 0 0 1 4.277-1.604a1.081 1.081 0 0 1 .469 2.11Z"/>`}})),th=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeZip0" x1="17.65" x2="21.099" y1="26.056" y2="26.056" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#4d4d4d"/><stop offset=".5" stop-color="#fff"/><stop offset="1" stop-color="#4d4d4d"/></linearGradient><linearGradient id="vscodeIconsFileTypeZip1" x1="17.65" x2="21.099" y1="23.756" y2="23.756" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip2" x1="17.65" x2="21.099" y1="21.456" y2="21.456" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip3" x1="17.65" x2="21.099" y1="19.156" y2="19.156" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip4" x1="17.65" x2="21.099" y1="16.857" y2="16.857" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip5" x1="17.65" x2="21.099" y1="14.557" y2="14.557" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip6" x1="17.65" x2="21.099" y1="12.257" y2="12.257" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip7" x1="17.65" x2="21.099" y1="9.957" y2="9.957" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip8" x1="17.65" x2="21.099" y1="7.657" y2="7.657" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip9" x1="16.237" x2="19.686" y1="27.217" y2="27.217" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipa" x1="16.237" x2="19.686" y1="24.918" y2="24.918" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipb" x1="16.237" x2="19.686" y1="22.618" y2="22.618" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipc" x1="16.237" x2="19.686" y1="20.318" y2="20.318" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipd" x1="16.237" x2="19.686" y1="18.018" y2="18.018" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipe" x1="17.65" x2="21.099" y1="28.356" y2="28.356" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipf" x1="16.237" x2="19.686" y1="15.718" y2="15.718" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipg" x1="16.237" x2="19.686" y1="13.419" y2="13.419" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZiph" x1="16.237" x2="19.686" y1="11.119" y2="11.119" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipi" x1="16.237" x2="19.686" y1="8.819" y2="8.819" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipj" x1="16.237" x2="19.686" y1="29.514" y2="29.514" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipk" x1="16.985" x2="20.446" y1="11.196" y2="11.196" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipl" x1="18.096" x2="19.336" y1="5.329" y2="5.329" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipm" x1="16.029" x2="21.403" y1="5.591" y2="5.591" href="#vscodeIconsFileTypeZip0"/></defs><path fill="#c09553" d="M27.667 27.667V17.333L23 15V2H4.333v28h23.334Zm-4.667 0v-9.111l2.333 1.222v7.889Z"/><path fill="url(#vscodeIconsFileTypeZip0)" d="M17.65 25.559h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip1)" d="M17.65 23.26h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip2)" d="M17.65 20.96h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip3)" d="M17.65 18.66h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip4)" d="M17.65 16.36h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip5)" d="M17.65 14.06h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip6)" d="M17.65 11.76h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip7)" d="M17.65 9.461h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip8)" d="M17.65 7.161h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip9)" d="M16.237 26.721h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipa)" d="M16.237 24.421h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipb)" d="M16.237 22.121h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipc)" d="M16.237 19.821h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipd)" d="M16.237 17.522h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipe)" d="M17.65 27.859h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipf)" d="M16.237 15.222h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipg)" d="M16.237 12.922h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZiph)" d="M16.237 10.622h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipi)" d="M16.237 8.322h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipj)" d="M16.237 29.018h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipk)" d="M20.1 5.911a.554.554 0 0 0-.548-.53h-.009v.557h.092l.206 2.514h-2.252l.211-2.514h.094v-.557h-.044a.552.552 0 0 0-.547.53l-.314 10.569a.513.513 0 0 0 .515.531h2.432a.512.512 0 0 0 .513-.531Zm-1.384 10.5a1.171 1.171 0 1 1 1.171-1.171a1.171 1.171 0 0 1-1.171 1.168Z"/><path fill="url(#vscodeIconsFileTypeZipl)" d="M18.096 3.802h1.24v3.054h-1.24z"/><path fill="url(#vscodeIconsFileTypeZipm)" d="M21.4 4.56a2.549 2.549 0 0 0-2.549-2.549h-.276a2.55 2.55 0 0 0-2.436 3.3v.006a7.986 7.986 0 0 1 .261 2.561a1.811 1.811 0 0 0 .641 1.271l.109-3.441a.593.593 0 0 1 .6-.551h.135v-1.57h1.653v1.57h.1a.6.6 0 0 1 .605.551l.121 3.462a1.813 1.813 0 0 0 .666-1.292V7.72a7.693 7.693 0 0 1 .236-2.359a2.543 2.543 0 0 0 .134-.801Z"/>`}})),nh=e(em(),1),rh=e(tm(),1),ih=e(nm(),1),ah=e(rm(),1),oh=e(im(),1),sh=e(am(),1),ch=e(om(),1),lh=e(sm(),1),uh=e(cm(),1),dh=e(lm(),1),fh=e(um(),1),ph=e(dm(),1),mh=e(fm(),1),hh=e(pm(),1),gh=e(mm(),1),_h=e(hm(),1),vh=e(gm(),1),yh=e(_m(),1),bh=e(vm(),1),xh=e(ym(),1),Sh=e(bm(),1),Ch=e(xm(),1),wh=e(Sm(),1),Th=e(Cm(),1),Eh=e(wm(),1),Dh=e(Tm(),1),Oh=e(Em(),1),kh=e(Dm(),1),Ah=e(Om(),1),jh=e(km(),1),Mh=e(Am(),1),Nh=e(jm(),1),Ph=e(Mm(),1),Fh=e(Nm(),1),Ih=e(Pm(),1),Lh=e(Fm(),1),Rh=e(Im(),1),zh=e(Lm(),1),Bh=e(Rm(),1),Vh=e(zm(),1),Hh=e(Bm(),1),Uh=e(Vm(),1),Wh=e(Hm(),1),Gh=e(Um(),1),Kh=e(Wm(),1),qh=e(Gm(),1),Jh=e(Km(),1),Yh=e(qm(),1),Xh=e(Jm(),1),Zh=e(Ym(),1),Qh=e(Xm(),1),$h=e(Zm(),1),eg=e(Qm(),1),tg=e($m(),1),ng=e(eh(),1),rg=e(th(),1),ig=[{icon:lh.default,name:`docker`,pattern:/^(dockerfile|\.dockerignore)$/},{icon:uh.default,name:`dotenv`,pattern:/^\.env(?:\.|$)/},{icon:mh.default,name:`git`,pattern:/^\.git(?:attributes|ignore|modules)$/},{icon:Th.default,name:`makefile`,pattern:/^makefile$/},{icon:Ch.default,name:`license`,pattern:/^licen[cs]e(?:\.|$)/},{icon:Eh.default,name:`markdown`,pattern:/^readme(?:\.|$)/},{icon:Dh.default,name:`npm`,pattern:/^package(?:-lock)?\.json$/},{icon:Ah.default,name:`pnpm`,pattern:/^(pnpm-lock\.yaml|pnpm-workspace\.yaml)$/},{icon:ng.default,name:`yarn`,pattern:/^yarn\.lock$/},{icon:ih.default,name:`bun`,pattern:/^bun\.lockb?$/},{icon:qh.default,name:`tsconfig`,pattern:/^tsconfig(?:\..+)?\.json$/},{icon:Xh.default,name:`vite`,pattern:/^vite\.config\./},{icon:Zh.default,name:`vitest`,pattern:/^vitest(?:\..+)?\.config\./},{icon:Wh.default,name:`tailwind`,pattern:/^tailwind\.config\./},{icon:dh.default,name:`eslint`,pattern:/^(eslint\.config\.|\.eslintrc)/},{icon:Mh.default,name:`prettier`,pattern:/^(prettier\.config\.|\.prettierrc)/}],ag=[{icon:Fh.default,name:`react-typescript`,extensions:[`tsx`]},{icon:Ph.default,name:`react-javascript`,extensions:[`jsx`]},{icon:Jh.default,name:`typescript`,extensions:[`ts`,`mts`,`cts`]},{icon:bh.default,name:`javascript`,extensions:[`js`,`mjs`,`cjs`]},{icon:xh.default,name:`json`,extensions:[`json`,`json5`,`jsonc`]},{icon:Eh.default,name:`markdown`,extensions:[`md`,`mdx`]},{icon:_h.default,name:`html`,extensions:[`html`,`htm`]},{icon:ch.default,name:`css`,extensions:[`css`,`pcss`,`less`]},{icon:Rh.default,name:`sass`,extensions:[`sass`,`scss`]},{icon:Qh.default,name:`vue`,extensions:[`vue`]},{icon:Vh.default,name:`svelte`,extensions:[`svelte`]},{icon:Nh.default,name:`python`,extensions:[`py`,`pyw`]},{icon:hh.default,name:`go`,extensions:[`go`]},{icon:Lh.default,name:`rust`,extensions:[`rs`]},{icon:yh.default,name:`java`,extensions:[`java`]},{icon:Sh.default,name:`kotlin`,extensions:[`kt`,`kts`]},{icon:Uh.default,name:`swift`,extensions:[`swift`]},{icon:oh.default,name:`cpp`,extensions:[`c`,`cc`,`cpp`,`h`,`hpp`]},{icon:sh.default,name:`csharp`,extensions:[`cs`]},{icon:kh.default,name:`php`,extensions:[`php`]},{icon:Ih.default,name:`ruby`,extensions:[`rb`]},{icon:wh.default,name:`lua`,extensions:[`lua`]},{icon:zh.default,name:`shell`,extensions:[`sh`,`bash`,`zsh`,`fish`,`ps1`]},{icon:gh.default,name:`graphql`,extensions:[`graphql`,`gql`]},{icon:tg.default,name:`yaml`,extensions:[`yaml`,`yml`]},{icon:Kh.default,name:`toml`,extensions:[`toml`]},{icon:eg.default,name:`xml`,extensions:[`xml`]},{icon:Bh.default,name:`sql`,extensions:[`sql`,`sqlite`,`db`]},{icon:Hh.default,name:`svg`,extensions:[`svg`]},{icon:vh.default,name:`image`,extensions:[`avif`,`bmp`,`gif`,`heic`,`ico`,`jpeg`,`jpg`,`png`,`tif`,`tiff`,`webp`]},{icon:rh.default,name:`audio`,extensions:[`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]},{icon:Yh.default,name:`video`,extensions:[`avi`,`m4v`,`mkv`,`mov`,`mp4`,`webm`,`wmv`]},{icon:Oh.default,name:`pdf`,extensions:[`pdf`]},{icon:$h.default,name:`word`,extensions:[`doc`,`docx`,`odt`,`rtf`]},{icon:fh.default,name:`excel`,extensions:[`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]},{icon:jh.default,name:`powerpoint`,extensions:[`odp`,`ppt`,`pptx`]},{icon:rg.default,name:`archive`,extensions:[`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]},{icon:ph.default,name:`font`,extensions:[`eot`,`otf`,`ttf`,`woff`,`woff2`]},{icon:ah.default,name:`config`,extensions:[`cfg`,`conf`,`ini`,`properties`]},{icon:Gh.default,name:`text`,extensions:[`log`,`txt`]}],og={icon:nh.default,name:`default`};function sg(e){return e.trim().split(/[\\/]/).filter(Boolean).pop()??e.trim()}function cg(e){return/\.([a-z0-9]{1,16})$/i.exec(e)?.[1]?.toLowerCase()??``}function lg(e){let t=sg(e).toLowerCase(),n=ig.find(({pattern:e})=>e.test(t));if(n)return n;let r=cg(t);return ag.find(({extensions:e})=>e.includes(r))??og}function ug(e){let t=e;return`body`in t?t:t.default}function dg({className:e,fileName:t,size:n=`default`}){let i=lg(t);return(0,R.jsx)($p,{"aria-hidden":`true`,"data-file-type-icon":i.name,icon:ug(i.icon),className:r(`shrink-0`,n===`compact`?`h-3.5 w-3.5`:`h-4 w-4`,e)})}function fg({agentId:e,fileName:t,kind:n}){return n===`overview`?(0,R.jsx)(hs,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`child-sessions`?(0,R.jsx)(os,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`project-files`?(0,R.jsx)(ns,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`cron`?(0,R.jsx)(_o,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`file`?(0,R.jsx)(dg,{fileName:t??``,size:`compact`}):n===`side-chat-draft`?(0,R.jsx)(Ss,{className:`h-3.5 w-3.5 shrink-0 text-primary`}):e?(0,R.jsx)(Zd,{agentId:e,className:`h-3.5 w-3.5 shrink-0`}):(0,R.jsx)(Cs,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`})}function pg(e){return e.map(e=>({key:e.key,label:e.title,labelClassName:e.isRenderedPreview?`italic font-normal`:void 0,active:e.active,tooltip:e.tooltip,leadingIcon:(0,R.jsx)(fg,{kind:e.kind,agentId:e.agentId,fileName:e.fileName}),badge:e.kind===`file`&&e.viewMode===`diff`?(0,R.jsx)(`span`,{className:`shrink-0 rounded border border-amber-200 bg-amber-50 px-1 py-0 text-[9px] font-medium uppercase tracking-[0.08em] text-amber-700`,children:b(`chatWorkspaceDiff`)}):null,unreadIndicator:e.showUnreadDot?(0,R.jsx)(`span`,{"aria-label":b(`chatSessionUnread`),className:`h-2 w-2 shrink-0 rounded-full bg-primary`}):null,closeLabel:`${e.kind===`file`?b(`chatWorkspaceCloseFile`):b(`chatWorkspaceCloseTab`)}: ${e.title}`,closePlacement:`leading-hover`,onSelect:e.onSelect,onClose:e.onClose,menuLabel:b(`chatWorkspaceFileMoreActions`),menuActions:e.kind===`file`?[...e.alternateViewerAction?[{key:`viewer:${e.alternateViewerAction.viewer}`,icon:e.alternateViewerAction.viewer===`rendered`?(0,R.jsx)(On,{className:`h-3.5 w-3.5`}):(0,R.jsx)(Lo,{className:`h-3.5 w-3.5`}),label:e.alternateViewerAction.label,onClick:e.alternateViewerAction.onSelect}]:[],...e.onClose?[{key:`close`,icon:(0,R.jsx)(qn,{className:`h-3.5 w-3.5`}),label:b(`chatWorkspaceCloseFile`),onClick:e.onClose}]:[]]:void 0}))}function mg({canGoBack:e,canGoForward:t,isMaximized:n=!1,onClose:r,onGoBack:i,onGoForward:a,onRefreshFile:o,onToggleMaximize:s,tabs:c}){return(0,R.jsx)(zt,{testId:`workspace-tabs-bar`,scrollTestId:`workspace-tabs-scroll`,tabs:pg(c),actions:[{key:`back`,icon:(0,R.jsx)(wt,{className:`h-4 w-4`}),label:b(`chatWorkspaceBack`),disabled:!e,onClick:i},{key:`forward`,icon:(0,R.jsx)(Ht,{className:`h-4 w-4`}),label:b(`chatWorkspaceForward`),disabled:!t,onClick:a},...o?[{key:`refresh-file`,icon:(0,R.jsx)(Gn,{className:`h-4 w-4`}),label:b(`chatWorkspaceRefreshFile`),onClick:o}]:[],...s?[{key:`maximize`,icon:n?(0,R.jsx)(ws,{className:`h-4 w-4`}):(0,R.jsx)(bs,{className:`h-4 w-4`}),label:b(n?`chatWorkspaceRestorePanel`:`chatWorkspaceMaximizePanel`),onClick:s}]:[],{key:`close`,icon:(0,R.jsx)(qn,{className:`h-4 w-4`}),label:b(`chatWorkspaceClosePanel`),onClick:r}],scrollClassName:`workspace-horizontal-scrollbar`,actionsClassName:`ml-1 mr-1 self-stretch`})}var hg={key:`slash`,marker:`/`};function gg(){return`composer-${Math.random().toString(36).slice(2,10)}`}function _g(e=``){return{id:gg(),type:`text`,text:e}}function vg(e){return{id:gg(),type:`token`,tokenKind:e.tokenKind,tokenKey:e.tokenKey,label:e.label}}function yg(e){return e.type===`text`?e.text.length:1}function bg(){return[_g(``)]}function xg(e){return[_g(e)]}function Sg(e){let t=[];for(let n of e){if(n.type===`text`){if(n.text.length===0)continue;let e=t[t.length-1];if(e?.type===`text`){t[t.length-1]={...e,text:e.text+n.text};continue}}t.push(n)}return t.length===0?bg():t}function Cg(e){return e.map(e=>e.type===`text`?e.text:``).join(``)}function wg(e){return e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Tg(e,t){let n=[],r=new Set;for(let i of e)i.type!==`token`||i.tokenKind!==t||r.has(i.tokenKey)||(r.add(i.tokenKey),n.push(i.tokenKey));return n}function Eg(e,t,n,r){let i=Math.max(0,n-t),a=Math.max(0,t+e.text.length-r),o=[];return i>0&&o.push({...e,text:e.text.slice(0,i)}),a>0&&o.push({...e,text:e.text.slice(e.text.length-a)}),o}function Dg(e,t,n,r){return t<=n||e>=r}function Og(e,t,n,r,i){return!n&&r>=i?(e.push(...t),!0):n}function kg(e,t,n,r,i,a,o){let s=Eg(t,n,r,i);s[0]&&e.push(s[0]);let c=o;return c||=(e.push(...a),!0),s[1]&&e.push(s[1]),c}function Ag(e,t,n,r,i,a){return!r&&i<=a?(e.push(...n),!0):(e.push(t),r)}function jg(e,t,n,r){let i=Math.max(0,t),a=Math.max(i,n),o=[],s=0,c=!1;for(let t of e){let e=yg(t),n=s,l=s+e;if(Dg(n,l,i,a)){c=Og(o,r,c,n,a),o.push(t),s=l;continue}c=t.type===`text`?kg(o,t,n,i,a,r,c):Ag(o,t,r,c,i,n),s=l}return c||o.push(...r),Sg(o)}function Mg(e,t){return Sg(e.filter(e=>e.type!==`token`||!t(e)))}function Ng(e,t){return t===0||/\s/.test(e[t-1]??``)}function Pg(e,t,n){if(!t||t.start!==t.end)return null;let r=Cg(e),i=t.end,a=r.slice(0,i),o=a.lastIndexOf(n.marker);if(o<0||!Ng(a,o))return null;let s=a.slice(o+n.marker.length);return/[\s\uFFFC]/.test(s)?null:{key:n.key,marker:n.marker,query:s.trim().toLowerCase(),start:o,end:i}}function Fg(e,t,n=[hg]){let r=null;for(let i of n){let n=Pg(e,t,i);n&&(!r||n.start>r.start)&&(r=n)}return r}function Ig(e,t){let n=Pg(e,t,hg);return n?{query:n.query,start:n.start,end:n.end}:null}var Lg=e=>`[data-item-index="${e}"]`;function Rg(e){let{activeIndex:t,containerRef:n,getItemSelector:r,isEnabled:i,itemCount:a}=e,o=r??Lg;(0,L.useEffect)(()=>{if(!i||a===0)return;let e=n.current;if(!e)return;let r=e.querySelector(o(t));typeof r?.scrollIntoView==`function`&&r.scrollIntoView({block:`nearest`,inline:`nearest`})},[t,n,o,i,a])}function zg(){let e=(0,L.useRef)(null),[t,n]=(0,L.useState)(null);return(0,L.useEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=()=>{n(t.getBoundingClientRect().width)};r();let i=new ResizeObserver(()=>r());return i.observe(t),()=>i.disconnect()},[]),{elementRef:e,width:t}}function B(...e){return w(s(e))}var Bg=L.forwardRef(({className:e,type:t,...n},r)=>(0,R.jsx)(`input`,{type:t,className:B(`flex h-9 w-full rounded-xl border border-border bg-card px-3.5 py-2 text-sm text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/55 placeholder:font-normal focus:outline-none focus:ring-0 focus:border-border transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));Bg.displayName=`ChatInput`;var Vg=yt,Hg=gt,Ug=Ct,Wg=L.forwardRef(({className:e,children:t,closeLabel:n,...r},i)=>(0,R.jsxs)(pt,{children:[(0,R.jsx)(ft,{className:`fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),(0,R.jsxs)(ht,{ref:i,className:B(`fixed left-[50%] top-[50%] z-[var(--z-modal,10050)] grid max-h-[min(42rem,calc(100vh-2rem))] w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-2xl border border-border bg-background p-6 text-foreground shadow-xl outline-none duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,e),...r,children:[t,(0,R.jsxs)(dt,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none`,children:[(0,R.jsx)(qn,{className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`sr-only`,children:n})]})]})]}));Wg.displayName=ht.displayName;var Gg=({className:e,...t})=>(0,R.jsx)(`div`,{className:B(`flex flex-col gap-2 text-center sm:text-left`,e),...t}),Kg=`2rem`;function qg(e){return`min(${e}, max(0px, calc(var(--radix-popover-content-available-height, 100vh) - ${Kg})))`}var Jg=qg(`24rem`),Yg=it,Xg=lt,Zg=at,Qg=L.forwardRef(({className:e,sideOffset:t=8,align:n=`start`,collisionPadding:r=12,style:i,...a},o)=>(0,R.jsx)(nt,{children:(0,R.jsx)(st,{ref:o,sideOffset:t,align:n,collisionPadding:r,className:B(`z-[var(--z-popover,50)] w-72 overflow-x-hidden overflow-y-auto rounded-2xl border border-border bg-popover p-4 text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=top]:slide-in-from-bottom-2 data-[side=right]:slide-in-from-left-2`,e),style:{maxHeight:Jg,...i},...a})}));Qg.displayName=st.displayName;var $g=$t,e_=Yt,t_=Jt,n_=`2rem`;function r_(e){return`min(${e}, max(0px, calc(var(--radix-select-content-available-height, 100vh) - ${n_})))`}var i_=r_(`24rem`),a_=L.forwardRef(({className:e,children:t,...n},r)=>(0,R.jsxs)(mn,{ref:r,className:B(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-0 focus:border-border disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,R.jsx)(tn,{asChild:!0,children:(0,R.jsx)(Wt,{className:`h-4 w-4 opacity-50`})})]}));a_.displayName=mn.displayName;var o_=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Kt,{ref:n,className:B(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,R.jsx)(Gt,{className:`h-4 w-4`})}));o_.displayName=Kt.displayName;var s_=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Qt,{ref:n,className:B(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,R.jsx)(Wt,{className:`h-4 w-4`})}));s_.displayName=Qt.displayName;var c_=L.forwardRef(({className:e,children:t,collisionPadding:n=12,position:r=`popper`,style:i,viewportClassName:a,...o},s)=>(0,R.jsx)(nn,{children:(0,R.jsxs)(cn,{ref:s,className:B(`relative z-50 flex max-h-96 min-w-[8rem] flex-col overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),collisionPadding:n,position:r,style:{maxHeight:i_,...i},...o,children:[(0,R.jsx)(o_,{}),(0,R.jsx)(pn,{className:B(`min-h-0 flex-1 overflow-y-auto overscroll-contain p-1`,r===`popper`&&`w-full min-w-[var(--radix-select-trigger-width)]`,a),children:t}),(0,R.jsx)(s_,{})]})}));c_.displayName=cn.displayName;var l_=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(on,{ref:n,className:B(`px-2 py-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,e),...t}));l_.displayName=on.displayName;var u_=L.forwardRef(({className:e,children:t,...n},r)=>(0,R.jsxs)(un,{ref:r,className:B(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:bg-accent hover:text-accent-foreground`,e),...n,children:[(0,R.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,R.jsx)(Xt,{children:(0,R.jsx)(fn,{className:`h-4 w-4`})})}),(0,R.jsx)(Zt,{children:t})]}));u_.displayName=un.displayName;var d_=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(dn,{ref:n,className:B(`-mx-1 my-1 h-px bg-border`,e),...t}));d_.displayName=dn.displayName;var f_=kt,p_=At,m_=Rt,h_=L.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,R.jsx)(Vt,{children:(0,R.jsx)(Pt,{ref:r,sideOffset:t,className:B(`z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));h_.displayName=Pt.displayName;var g_={Dialog:Vg,DialogContent:Wg,DialogDescription:Ug,DialogHeader:Gg,DialogTitle:Hg,Popover:Yg,PopoverAnchor:Zg,PopoverContent:Qg,PopoverTrigger:Xg,Input:Bg,Select:$g,SelectContent:c_,SelectGroup:e_,SelectItem:u_,SelectLabel:l_,SelectSeparator:d_,SelectTrigger:a_,SelectValue:t_,Tooltip:p_,TooltipContent:h_,TooltipProvider:f_,TooltipTrigger:m_};function __({pathPreview:e}){return(0,R.jsxs)(`div`,{className:`rounded-lg border border-gray-200 bg-gray-50/70 px-3 py-2.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-gray-600`,children:[(0,R.jsx)(as,{"aria-hidden":`true`,className:`h-4 w-4 text-gray-400`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.rootLabel})]}),(0,R.jsx)(`div`,{className:`mt-2`,children:e.segments.map((e,t)=>{let n=e.kind===`directory`?as:Zo;return(0,R.jsxs)(`div`,{className:`relative flex min-w-0 items-center gap-2 py-1 text-xs text-gray-700`,style:{paddingLeft:`${(t+1)*18}px`},children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`absolute bottom-1/2 top-[-0.25rem] w-px bg-gray-200`,style:{left:`${t*18+7}px`}}),(0,R.jsx)(n,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0 text-gray-400`}),(0,R.jsx)(`span`,{className:`truncate font-medium`,children:e.label})]},`${t}:${e.label}`)})})]})}var v_=680,y_=.82,b_=560,x_=qg(`24rem`),S_={back:wt,command:Ro,file:Zo,files:Qo,folder:as,"panel-app":Ms,skill:Is};function C_(e,t){return!t.sectionKeys||t.sectionKeys.length===0?!0:!!(e.sectionKey&&t.sectionKeys.includes(e.sectionKey))}function w_(e,t){return e?.length?e.some(e=>e.key===t)?t:e[0].key:null}function T_({icon:e}){let t=S_[e];return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-input-surface-icon":e,className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-gray-100 text-gray-500`,children:(0,R.jsx)(t,{className:`h-3.5 w-3.5`})})}function E_({item:e,texts:t}){return e?(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.subtitle?(0,R.jsx)(`span`,{className:`inline-flex rounded-full bg-primary/10 px-2 py-0.5 text-[11px] font-semibold text-primary`,children:e.subtitle}):null,(0,R.jsx)(`span`,{className:`text-sm font-semibold text-gray-900`,children:e.title})]}),(0,R.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description}),e.pathPreview?(0,R.jsx)(__,{pathPreview:e.pathPreview}):null,(0,R.jsx)(`div`,{className:`space-y-1`,children:e.detailLines.map(e=>(0,R.jsx)(`div`,{className:`min-w-0 break-all rounded-md bg-gray-50 px-2 py-1 text-[11px] leading-5 text-gray-600`,children:e},e))}),(0,R.jsx)(`div`,{className:`pt-1 text-[11px] text-gray-500`,children:e.hintLabel??t.itemHintLabel})]}):(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:t.hintLabel})}function D_(e){let{activeIndex:t,event:n,isOpen:r,items:i,onOpenChange:a,onSelectItem:o,setActiveIndex:s}=e;return r?n.key===`Escape`?(n.preventDefault(),a(!1),!0):i.length===0?!1:n.key===`ArrowDown`?(n.preventDefault(),s(e=>(e+1)%i.length),!0):n.key===`ArrowUp`?(n.preventDefault(),s(e=>(e-1+i.length)%i.length),!0):n.key===`Enter`&&!n.shiftKey||n.key===`Tab`?(n.preventDefault(),o(i[t]),!0):!1:!1}var O_=(0,L.forwardRef)(function(e,t){let{Popover:n,PopoverAnchor:r,PopoverContent:i}=g_,{elementRef:a,width:o}=zg(),s=(0,L.useRef)(null),[c,l]=(0,L.useState)({index:0,itemsSignature:``}),{isOpen:u,isLoading:d,filterOptions:f,items:p,notice:m,texts:h,onSelectItem:g,onOpenChange:_,onDetailsPointerDown:v}=e,[y,b]=(0,L.useState)(f?.[0]?.key??null),x=(0,L.useMemo)(()=>w_(f,y),[y,f]),S=(0,L.useMemo)(()=>f?.find(e=>e.key===x)??null,[f,x]),C=(0,L.useMemo)(()=>f?.map(e=>({...e,count:p.filter(t=>C_(t,e)).length}))??[],[f,p]),w=(0,L.useMemo)(()=>S?p.filter(e=>C_(e,S)):p,[S,p]),T=(0,L.useMemo)(()=>w.map(e=>e.key).join(``),[w]),E=(0,L.useMemo)(()=>w.some(e=>!!e.sectionLabel?.trim()),[w]),D=c.itemsSignature===T?c.index:0,O=w.length===0?0:Math.min(D,w.length-1),k=w[O]??null,A=(0,L.useCallback)(e=>{b(e),l({index:0,itemsSignature:``})},[]),ee=(0,L.useCallback)(e=>{l(t=>{let n=t.itemsSignature===T?t.index:0;return{index:typeof e==`function`?e(n):e,itemsSignature:T}})},[T]),j=(0,L.useCallback)(e=>{e.selectionBehavior===`navigate`&&l({index:0,itemsSignature:``}),g(e)},[g]),M=(0,L.useMemo)(()=>{if(o)return Math.min(o>b_?o*y_:o,v_)},[o]);return(0,L.useImperativeHandle)(t,()=>({handleKeyDown:e=>D_({activeIndex:O,event:e,isOpen:u,items:w,onOpenChange:_,onSelectItem:j,setActiveIndex:ee})}),[O,u,_,j,ee,w]),Rg({containerRef:s,activeIndex:O,itemCount:w.length,isEnabled:u&&!d,getItemSelector:e=>`[data-input-surface-index="${e}"]`}),(0,R.jsxs)(n,{open:u,onOpenChange:_,children:[(0,R.jsx)(r,{asChild:!0,children:(0,R.jsx)(`div`,{ref:a,className:`pointer-events-none absolute bottom-0 left-3 right-3 top-0`})}),(0,R.jsx)(i,{side:`top`,align:`start`,sideOffset:10,className:`z-[70] flex max-w-[calc(100vw-1.5rem)] flex-col overflow-hidden rounded-2xl border border-gray-200 bg-white/95 p-0 shadow-2xl backdrop-blur-md`,onOpenAutoFocus:e=>e.preventDefault(),style:{height:x_,maxHeight:x_,width:M?`${M}px`:void 0},children:(0,R.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[minmax(220px,300px)_minmax(0,1fr)]`,children:[(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-col border-r border-gray-200`,children:[!d&&C.length>0?(0,R.jsx)(`div`,{className:`flex shrink-0 gap-0.5 overflow-x-auto px-2 pb-1.5 pt-2`,children:C.map(({count:e,key:t,label:n})=>{let r=t===x;return(0,R.jsxs)(`button`,{type:`button`,"aria-pressed":r,onPointerDown:e=>e.preventDefault(),onClick:()=>A(t),className:`inline-flex h-7 shrink-0 items-center gap-1 rounded-md px-2 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 ${r?`bg-gray-100 text-gray-900`:`text-gray-600 hover:bg-gray-100 hover:text-gray-900`}`,children:[(0,R.jsx)(`span`,{children:n}),(0,R.jsx)(`span`,{className:r?`text-gray-500`:`text-gray-400`,children:e})]},t)})}):null,!d&&m?(0,R.jsxs)(`div`,{className:`mx-2 mb-1.5 flex items-start gap-2 rounded-lg border border-red-200 bg-red-50 px-2.5 py-2 text-xs leading-4 text-red-700`,children:[(0,R.jsx)(gn,{"aria-hidden":`true`,className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,R.jsx)(`span`,{children:m.message})]}):null,(0,R.jsx)(`div`,{ref:s,role:`listbox`,"aria-label":h.sectionLabel,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain ${!d&&C.length>0?`px-2 pb-2`:`p-2`}`,children:d?(0,R.jsx)(`div`,{className:`p-2 text-xs text-gray-500`,children:h.loadingLabel}):(0,R.jsxs)(R.Fragment,{children:[E?null:(0,R.jsx)(`div`,{className:`mb-1 px-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-500`,children:h.sectionLabel}),w.length===0?(0,R.jsx)(`div`,{className:`px-1.5 text-xs text-gray-400`,children:h.emptyLabel}):(0,R.jsx)(`div`,{children:w.map((e,t)=>{let{icon:n,key:r,sectionKey:i,sectionLabel:a,title:o,subtitle:s}=e,c=t===O,l=w[t-1];return(0,R.jsxs)(`div`,{children:[E&&a?.trim()&&l?.sectionKey!==i?(0,R.jsx)(`div`,{className:`px-1.5 pb-1 pt-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-500`,children:a}):null,(0,R.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":c,"data-input-surface-index":t,onPointerMove:e=>{e.pointerType!==`touch`&&ee(t)},onPointerDown:t=>{t.button>0||(t.preventDefault(),j(e))},onClick:t=>{t.detail===0&&j(e)},className:`flex w-full items-center gap-1.5 rounded-md px-1.5 py-1 text-left leading-4 transition-colors ${c?`bg-gray-100 text-gray-900`:`text-gray-700 hover:bg-gray-100`}`,children:[n?(0,R.jsx)(T_,{icon:n}):null,(0,R.jsx)(`span`,{className:`truncate text-xs font-medium`,children:o}),(0,R.jsx)(`span`,{className:`truncate text-xs text-gray-500`,children:s})]})]},r)})})]})})]}),(0,R.jsx)(`div`,{className:`custom-scrollbar min-h-0 min-w-0 select-text overflow-y-auto overscroll-contain p-2.5`,onPointerDown:v,children:(0,R.jsx)(E_,{item:k,texts:h})})]})})]})});function k_(e){return`${e.key}:${e.marker}:${e.start}`}function A_(e,t){return t.type===`insert-text`&&e.query===``&&e.end===e.start+e.marker.length}function j_(e,t,n){if(!t)return null;let r=k_(t);return e===r?e:A_(t,n)?r:null}function M_(e){let{children:t,inputSurface:n,onInputSurfaceTriggerChange:r,onSelectItem:i,triggerSpecs:a=[hg]}=e,o=(0,L.useRef)(null),s=(0,L.useRef)(!1),c=(0,L.useRef)(null),[l,u]=(0,L.useState)(null),d=!!n&&l!==null,f=(0,L.useCallback)((e,t)=>{c.current=e,u(e),r?.(e?t:null)},[r]),p=(0,L.useCallback)((e,t,n)=>{let r=Fg(e,t,a),i=j_(c.current,r,n);f(i,i?r:null)},[f,a]),m=(0,L.useCallback)(e=>o.current?.handleKeyDown(e)??!1,[]),h=(0,L.useCallback)(e=>{!e&&!s.current&&f(null,null)},[f]);return(0,R.jsxs)(R.Fragment,{children:[t((0,L.useMemo)(()=>({onInputSurfaceKeyDown:m,onInputSurfaceOpenChange:h,onInputSurfaceSnapshotChange:p}),[m,h,p])),n&&d?(0,R.jsx)(O_,{ref:o,isOpen:d,isLoading:n.isLoading,filterOptions:n.filterOptions,items:n.items,notice:n.notice,texts:n.texts,onSelectItem:e=>{e.selectionBehavior!==`navigate`&&f(null,null),i(e)},onOpenChange:h,onDetailsPointerDown:()=>{s.current=!0,requestAnimationFrame(()=>{s.current=!1})}},l):null]})}var N_=re(`inline-flex items-center justify-center whitespace-nowrap rounded-full text-sm font-medium transition-all duration-fast focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-border bg-card text-muted-foreground hover:bg-accent hover:text-accent-foreground`,secondary:`bg-muted text-foreground hover:bg-accent hover:text-accent-foreground`,ghost:`text-muted-foreground hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`,primary:`bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm`,subtle:`bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground`,"primary-outline":`border border-primary/30 text-primary hover:bg-primary hover:text-primary-foreground`},size:{default:`h-9 px-4 py-2`,sm:`h-8 px-3 text-xs`,lg:`h-11 px-5 text-[14px]`,xl:`h-12 px-6 text-[15px]`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),P_=L.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,R.jsx)(`button`,{className:B(N_({variant:t,size:n,className:e})),ref:i,...r}));P_.displayName=`ChatButton`;function F_(){return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`chat-stop-icon`,className:`block h-3 w-3 rounded-[2px] bg-foreground shadow-[inset_0_0_0_1px_hsl(var(--border))]`})}function I_({contextWindow:e}){let{Tooltip:t,TooltipContent:n,TooltipProvider:r,TooltipTrigger:i}=g_,a=Math.max(0,Math.min(1,e.ratio)),o=Math.round(a*360);return(0,R.jsx)(r,{delayDuration:0,children:(0,R.jsxs)(t,{children:[(0,R.jsx)(i,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,"aria-label":e.label,title:e.label,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-[7px] rounded-full`,style:{background:`conic-gradient(hsl(var(--muted-foreground)) ${o}deg, hsl(var(--border)) 0deg)`}}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-[10px] rounded-full bg-card`})]})}),(0,R.jsx)(n,{side:`top`,className:`max-w-[18rem]`,children:(0,R.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-5 font-semibold text-foreground`,children:[(0,R.jsx)(`span`,{children:e.label}),(0,R.jsx)(`span`,{children:e.percentLabel})]}),e.details.map(e=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-5 text-muted-foreground`,children:[(0,R.jsx)(`span`,{children:e.label}),(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:e.value})]},e.label))]})})]})})}function L_({isSending:e,canStopGeneration:t,sendDisabled:n,stopDisabled:r,stopHint:i,sendButtonLabel:a,stopButtonLabel:o,contextWindow:s,onSend:c,onStop:l}){let{Tooltip:u,TooltipContent:d,TooltipProvider:f,TooltipTrigger:p}=g_;return(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s?(0,R.jsx)(I_,{contextWindow:s}):null,!e||!n?(0,R.jsx)(P_,{size:`icon`,className:`h-8 w-8 rounded-full`,"aria-label":a,onClick:()=>void c(),disabled:n,children:(0,R.jsx)(xo,{className:`h-5 w-5`})}):t?(0,R.jsx)(P_,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":o,onClick:()=>void l(),disabled:r,children:(0,R.jsx)(F_,{})}):(0,R.jsx)(f,{children:(0,R.jsxs)(u,{children:[(0,R.jsx)(p,{asChild:!0,children:(0,R.jsx)(`span`,{children:(0,R.jsx)(P_,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":o,disabled:!0,children:(0,R.jsx)(F_,{})})})}),(0,R.jsx)(d,{side:`top`,children:(0,R.jsx)(`p`,{className:`text-xs`,children:i})})]})})]})}function R_(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[e.label,e.key,e.description].filter(e=>typeof e==`string`&&e.trim().length>0).join(` `).toLowerCase().includes(n)):e}var z_=qg(`20rem`);function B_(e){let{Input:t,Popover:n,PopoverContent:r,PopoverTrigger:i}=g_,{picker:a}=e,o=(0,L.useRef)(null),s=(0,L.useId)(),[c,l]=(0,L.useState)(``),[u,d]=(0,L.useState)(null),[f,p]=(0,L.useState)(0),m=(0,L.useMemo)(()=>new Set(a.selectedKeys),[a.selectedKeys]),h=a.selectedKeys.length,g=(0,L.useMemo)(()=>a.groups?.filter(e=>e.options.length>0)??[],[a.groups]),_=g.some(e=>e.key===u)?u:null,v=(0,L.useMemo)(()=>g.length===0?null:(_?g.filter(e=>e.key===_):g).map(e=>({...e,options:R_(e.options,c)})).filter(e=>e.options.length>0),[g,c,_]),y=(0,L.useMemo)(()=>v===null?R_(a.options,c):v.flatMap(e=>e.options),[v,a.options,c]),b=y.length===0?0:Math.min(f,y.length-1);Rg({containerRef:o,activeIndex:b,itemCount:y.length,isEnabled:y.length>0,getItemSelector:e=>`[data-skill-index="${e}"]`});let x=e=>{if(m.has(e)){a.onSelectedKeysChange(a.selectedKeys.filter(t=>t!==e));return}a.onSelectedKeysChange([...a.selectedKeys,e])},S=e=>{if(y.length!==0){if(e.key===`ArrowDown`){e.preventDefault(),p(Math.min(b+1,y.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),p(Math.max(b-1,0));return}if(e.key===`Enter`){e.preventDefault();let t=y[b];t&&x(t.key)}}};return(0,R.jsxs)(n,{children:[(0,R.jsx)(i,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-label":a.title,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg px-0 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground sm:w-auto sm:gap-1.5 sm:px-3`,children:[(0,R.jsx)(wo,{className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`nextclaw-chat-skill-picker-label hidden sm:inline [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`,children:a.title}),h>0?(0,R.jsx)(`span`,{className:`absolute -right-1 -top-1 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-primary px-1 text-[10px] font-semibold leading-none text-white shadow-sm sm:static sm:ml-0.5 sm:bg-primary/10 sm:text-primary sm:shadow-none`,children:h}):null]})}),(0,R.jsxs)(r,{side:`top`,align:`start`,className:`flex w-[min(360px,calc(100vw-1rem))] flex-col overflow-hidden p-0`,style:{height:z_},children:[(0,R.jsxs)(`div`,{className:`shrink-0 space-y-2 border-b border-border px-4 py-3`,children:[(0,R.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:a.title}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(Tt,{className:`pointer-events-none absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground/70`}),(0,R.jsx)(t,{value:c,onChange:e=>{l(e.target.value),p(0)},onKeyDown:S,placeholder:a.searchPlaceholder,role:`combobox`,"aria-controls":s,"aria-expanded":`true`,"aria-autocomplete":`list`,"aria-activedescendant":y[b]?`${s}-option-${b}`:void 0,className:`h-8 rounded-lg pl-8 text-xs`})]}),g.length>0?(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1`,"aria-label":a.allGroupsLabel,children:[{key:null,label:a.allGroupsLabel,count:a.options.length},...g.map(e=>({key:e.key,label:e.label||e.key,count:e.options.length}))].map(e=>{let t=e.key===_;return(0,R.jsxs)(`button`,{type:`button`,"aria-pressed":t,onMouseDown:e=>e.preventDefault(),onClick:()=>{d(e.key),p(0)},className:`inline-flex h-6 items-center gap-1 rounded-md px-2 text-[10px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 ${t?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground hover:text-foreground`}`,children:[(0,R.jsx)(`span`,{children:e.label}),(0,R.jsx)(`span`,{className:`opacity-70`,children:e.count})]},e.key??`all-skills`)})}):null]}),(0,R.jsx)(`div`,{ref:o,id:s,role:`listbox`,"aria-multiselectable":`true`,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:a.isLoading?(0,R.jsx)(`div`,{className:`p-4 text-xs text-muted-foreground`,children:a.loadingLabel}):y.length===0?(0,R.jsx)(`div`,{className:`p-4 text-center text-xs text-muted-foreground`,children:a.emptyLabel}):(0,R.jsx)(`div`,{className:`py-1`,children:(()=>{let e=v??[{key:`all-skills`,options:y}],t=0;return e.map(e=>(0,R.jsxs)(`div`,{children:[e.label?(0,R.jsx)(`div`,{className:`px-4 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e.label}):null,e.options.map(e=>{let n=t;t+=1;let r=m.has(e.key),i=n===b;return(0,R.jsxs)(`div`,{id:`${s}-option-${n}`,role:`option`,"aria-selected":r,"data-skill-index":n,onMouseEnter:()=>p(n),className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${i?`bg-accent`:`hover:bg-accent`}`,children:[(0,R.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,R.jsx)(Is,{className:`h-4 w-4`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 select-text`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm text-foreground`,children:e.label}),e.badgeLabel?(0,R.jsx)(`span`,{className:`shrink-0 rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary`,children:e.badgeLabel}):null]}),(0,R.jsx)(`div`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.description||e.key})]}),(0,R.jsx)(`div`,{className:`ml-3 shrink-0`,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`${r?`Remove`:`Add`} ${e.label}`,onClick:()=>x(e.key),className:r?`inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary text-white`:`inline-flex h-5 w-5 items-center justify-center rounded-full border border-border bg-card`,children:r?(0,R.jsx)(fn,{className:`h-3 w-3`}):null})})]},e.key)})]},e.key))})()})}),a.manageHref&&a.manageLabel?(0,R.jsx)(`div`,{className:`shrink-0 border-t border-border px-4 py-2.5`,children:(0,R.jsxs)(`a`,{href:a.manageHref,className:`inline-flex items-center gap-1.5 text-xs font-medium text-primary transition-colors hover:text-primary/80`,children:[a.manageLabel,(0,R.jsx)(kn,{className:`h-3 w-3`})]})}):null]})]})}function V_({icon:e}){return e===`sparkles`?(0,R.jsx)(_n,{className:`h-3.5 w-3.5 shrink-0 text-primary`}):e===`brain`?(0,R.jsx)(To,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):null}function H_({icon:e}){return e===`paperclip`?(0,R.jsx)(Ns,{className:`h-4 w-4`}):(0,R.jsx)(V_,{icon:e})}var U_={model:`min-w-0 max-w-[18rem]`,"session-type":`shrink-0`,thinking:`shrink-0`},W_={model:`w-[min(18rem,calc(100vw-1rem))] sm:w-[320px]`,"session-type":`w-[220px]`,thinking:`w-[180px]`},G_=qg(`18rem`),K_=r_(`18rem`);function q_(e){return e.key===`model`&&e.selectedLabel&&e.selectedLabel.split(`/`).slice(1).join(`/`).trim()||e.selectedLabel}function J_(e){return e.groups?.filter(e=>e.options.length>0)??(e.options.length>0?[{key:`${e.key}-default`,options:e.options}]:[])}function Y_({item:e}){let t=q_(e);return e.selectedLabel?(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,R.jsx)(V_,{icon:e.icon}),(0,R.jsx)(`span`,{className:`nextclaw-chat-toolbar-mobile-label truncate sm:hidden [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`,children:t}),(0,R.jsx)(`span`,{className:`nextclaw-chat-toolbar-label hidden truncate sm:inline [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`,children:e.selectedLabel})]}):e.loading?(0,R.jsx)(`div`,{className:`h-3 w-24 animate-pulse rounded bg-muted`}):(0,R.jsx)(`span`,{className:`truncate`,children:e.placeholder})}function X_({option:e}){return e.description?(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`truncate text-xs font-semibold text-foreground`,children:e.label}),(0,R.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:e.description})]}):(0,R.jsx)(`span`,{className:`truncate text-xs font-semibold text-foreground`,children:e.label})}function Z_({item:e}){let{Input:t,Popover:n,PopoverContent:r,PopoverTrigger:i,Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=g_,[l,u]=(0,L.useState)(!1),[d,f]=(0,L.useState)(``),p=J_(e),m=(0,L.useMemo)(()=>{let e=d.trim().toLowerCase();return e?p.map(t=>({...t,options:t.options.filter(t=>[t.label,t.value,t.description].filter(e=>!!e).some(t=>t.toLowerCase().includes(e)))})).filter(e=>e.options.length>0):p},[p,d]),h=p.some(e=>e.options.length>0),g=m.some(e=>e.options.length>0),_=e.optionAction,v=new Set(_?.activeValues??[]);return(0,R.jsxs)(n,{open:l,onOpenChange:u,children:[(0,R.jsx)(i,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"aria-label":e.selectedLabel?`${e.placeholder}: ${e.selectedLabel}`:e.placeholder,disabled:e.disabled,className:`nextclaw-chat-toolbar-select-trigger inline-flex h-8 w-auto items-center justify-between rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50 sm:px-3 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!basis-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!justify-center [@container_nextclaw-chat-input-bar_(max-width:440px)]:!max-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!min-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!px-0 ${U_[e.key]??``}`,children:[(0,R.jsx)(Y_,{item:e}),(0,R.jsx)(Wt,{className:`ml-1 h-3.5 w-3.5 shrink-0 text-muted-foreground/70 [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`})]})}),(0,R.jsxs)(r,{className:`flex flex-col overflow-hidden p-1.5 ${W_[e.key]??``}`,style:{maxHeight:G_},children:[(0,R.jsxs)(`div`,{className:`relative mb-1.5 shrink-0`,children:[(0,R.jsx)(Tt,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,R.jsx)(t,{value:d,onChange:e=>f(e.currentTarget.value),placeholder:e.search?.placeholder??e.placeholder,className:`h-7 rounded-md pl-8 text-xs`})]}),h?null:e.loading?(0,R.jsxs)(`div`,{className:`space-y-2 px-2 py-1`,children:[(0,R.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`}),(0,R.jsx)(`div`,{className:`h-3 w-28 animate-pulse rounded bg-muted`}),(0,R.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded bg-muted`})]}):e.emptyLabel?(0,R.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:e.emptyLabel}):null,h&&!g?(0,R.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:e.search?.emptyLabel??e.emptyLabel}):null,(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:m.map((t,n)=>(0,R.jsxs)(`div`,{className:n>0?`border-t border-border pt-0.5`:void 0,children:[t.label?(0,R.jsx)(`div`,{className:`px-2 pb-0.5 pt-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:t.label}):null,t.options.map(t=>{let n=e.value===t.value,r=v.has(t.value),i=r?_?.activeLabel:_?.inactiveLabel;return(0,R.jsxs)(`div`,{className:`group flex items-center gap-1 rounded-md hover:bg-accent`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-left leading-4`,onClick:()=>{e.onValueChange(t.value),u(!1),f(``)},children:[(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(X_,{option:t})}),n?(0,R.jsx)(fn,{className:`h-4 w-4 shrink-0 text-primary`}):null]}),_&&i?(0,R.jsx)(s,{children:(0,R.jsxs)(a,{children:[(0,R.jsx)(c,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":i,"aria-pressed":r,className:`mr-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground/70 transition-colors hover:bg-card hover:text-foreground focus:outline-none focus:ring-1 focus:ring-primary/40`,onClick:e=>{e.stopPropagation(),_.onToggle(t.value,!r)},children:(0,R.jsx)(Js,{className:`h-3.5 w-3.5 ${r?`fill-current text-foreground`:``}`})})}),(0,R.jsx)(o,{side:`left`,children:(0,R.jsx)(`p`,{className:`text-xs`,children:i})})]})}):null]},t.value)})]},t.key))})]})]})}function Q_({item:e}){if(e.search)return(0,R.jsx)(Z_,{item:e});let{Select:t,SelectContent:n,SelectGroup:r,SelectItem:i,SelectLabel:a,SelectSeparator:o,SelectTrigger:s,SelectValue:c}=g_,l=J_(e),u=l.some(e=>e.options.length>0);return(0,R.jsxs)(t,{value:e.value,onValueChange:e.onValueChange,disabled:e.disabled,children:[(0,R.jsx)(s,{"aria-label":e.selectedLabel?`${e.placeholder}: ${e.selectedLabel}`:e.placeholder,title:e.selectedLabel,className:`nextclaw-chat-toolbar-select-trigger h-8 w-auto rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground focus:ring-0 sm:px-3 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!basis-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!justify-center [@container_nextclaw-chat-input-bar_(max-width:440px)]:!max-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!min-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!px-0 ${U_[e.key]??``}`,children:e.selectedLabel||e.loading?(0,R.jsx)(Y_,{item:e}):(0,R.jsx)(c,{placeholder:e.placeholder})}),(0,R.jsxs)(n,{className:W_[e.key]??``,style:{maxHeight:K_},children:[u?null:e.loading?(0,R.jsxs)(`div`,{className:`space-y-2 px-3 py-2`,children:[(0,R.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`}),(0,R.jsx)(`div`,{className:`h-3 w-28 animate-pulse rounded bg-muted`}),(0,R.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded bg-muted`})]}):e.emptyLabel?(0,R.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:e.emptyLabel}):null,l.map((e,t)=>(0,R.jsxs)(`div`,{children:[t>0?(0,R.jsx)(o,{}):null,(0,R.jsxs)(r,{children:[e.label?(0,R.jsx)(a,{children:e.label}):null,e.options.map(e=>(0,R.jsx)(i,{value:e.value,className:`py-1.5`,children:(0,R.jsx)(X_,{option:e})},e.value))]})]},e.key))]})]})}function $_({actions:e,accessories:t,selects:n,skillPicker:r,trailingSelects:i=[]}){let{Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=g_;return(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-2 px-3 pb-3`,children:[(0,R.jsxs)(`div`,{className:`nextclaw-chat-toolbar-leading-controls flex min-w-0 flex-1 flex-wrap items-center gap-1 overflow-hidden`,children:[r?(0,R.jsx)(B_,{picker:r}):null,n.map(e=>(0,R.jsx)(Q_,{item:e},e.key)),t?.map(e=>{let t=(0,R.jsxs)(`button`,{type:`button`,className:`inline-flex items-center rounded-lg py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:text-muted-foreground/50 ${e.iconOnly?`h-8 w-8 justify-center px-0`:`gap-1.5 px-3`}`,onClick:e.onClick,disabled:e.disabled,"aria-label":e.label,children:[(0,R.jsx)(H_,{icon:e.icon}),e.iconOnly?null:(0,R.jsx)(`span`,{children:e.label})]});return e.tooltip?(0,R.jsx)(s,{children:(0,R.jsxs)(a,{children:[(0,R.jsx)(c,{asChild:!0,children:e.disabled?(0,R.jsx)(`span`,{className:`inline-flex`,children:t}):t}),(0,R.jsx)(o,{side:`top`,children:(0,R.jsx)(`p`,{className:`text-xs`,children:e.tooltip})})]})},e.key):(0,R.jsx)(`div`,{children:t},e.key)})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-end gap-1`,children:[i.length>0?(0,R.jsx)(`div`,{className:`nextclaw-chat-toolbar-trailing-selects flex min-w-0 items-center gap-1`,children:i.map(e=>(0,R.jsx)(Q_,{item:e},e.key))}):null,(0,R.jsx)(L_,{...e})]})]})}var ev=(0,L.createContext)(null);function tv(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n==null?null:n.getTheme())}}}function nv(){let e=(0,L.useContext)(ev);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function V(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function rv(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var iv=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,av=iv&&`documentMode`in document?document.documentMode:null,ov=iv&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),sv=iv&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),cv=!(!iv||!(`InputEvent`in window)||av)&&`getTargetRanges`in new window.InputEvent(`input`),lv=iv&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,uv=iv&&/Android/.test(navigator.userAgent),dv=iv&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!uv,fv=iv&&/^(?=.*Chrome).*/i.test(navigator.userAgent),pv=iv&&uv&&fv,mv=iv&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ov&&!fv,hv=0,gv=1,_v=2,vv=1,yv=2,bv=3,xv=4,Sv=5,Cv=6,wv=dv||lv||mv?`\xA0`:``,Tv=`
|
|
5
|
-
|
|
6
|
-
`,Ev=sv?`\xA0`:wv,Dv={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Ov={directionless:1,unmergeable:2},kv={center:2,end:6,justify:4,left:1,right:3,start:5},Av={[yv]:`center`,[Cv]:`end`,[xv]:`justify`,[vv]:`left`,[bv]:`right`,[Sv]:`start`},jv={normal:0,segmented:2,token:1},Mv={[hv]:`normal`,[_v]:`segmented`,[gv]:`token`},Nv=`$config`;function Pv(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(K(o)&&Pv(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var Fv=!1,Iv=0;function Lv(e){Iv=e.timeStamp}function Rv(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&IC(e,n)!==void 0}function zv(e,t,n){let r=Tw(_w(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&YC(t,o,i,a,!1)}function Bv(e,t,n){if(W(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return TC(t)&&n.isAttached()}function Vv(e,t,n,r){for(let i=e;i&&!Bw(i);i=dw(i)){let e=IC(i,t);if(e!==void 0){let t=PC(e,n);if(t)return KS(t)||!Dw(i)?void 0:[i,t]}else if(i===r)return[r,VC(n)]}}function Hv(e,t,n){Fv=!0;let r=performance.now()-Iv>100;try{BS(e,()=>{let i=G()||function(e){return e.getEditorState().read(()=>{let e=G();return e===null?null:e.clone()})}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=Vv(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&U(g)&&TC(p)&&Bv(i,p,g)&&zv(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=FC(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!Rv(r,a,e)){if(sv){let e=(Dw(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Rv(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Rv(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&HC(i),sv&&lw(e)&&i.insertRawText(u))})}finally{Fv=!1}}function Uv(e){let t=e._observer;t!==null&&Hv(e,t.takeRecords(),t)}function Wv(e){(function(e){Iv===0&&_w(e).addEventListener(`textInput`,Lv,!0)})(e),e._observer=new MutationObserver((t,n)=>{Hv(e,t,n)})}var Gv=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Qv).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Kv(e,t){return new Gv(e,t)}function qv(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=Hw(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var Jv=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState;this.size=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return Zv(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=Zv(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function Yv(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Jv(t,Xv(t));return t.__state=n,n}function Xv(e){return e.__state?e.__state.sharedNodeState:mC(Nw(),e.getType()).sharedNodeState}function Zv(e){if(e)for(let t in e)return e}function Qv(e){return e}function $v(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function ey(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function ty(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function ny(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&$v(n,e,t)||t&&$v(n,t,e)||e&&ey(n,e,t)||t&&ey(n,t,e))}(c,l))}function ry(e,t){let n=e.mergeWithSibling(t),r=DS()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function iy(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&U(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(ny(t,r)){r=ry(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&U(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(ny(r,n)){r=ry(r,n);break}break}n.remove()}}else r.remove()}function ay(e){return oy(e.anchor),oy(e.focus),e}function oy(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),U(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!K(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var sy,cy,ly,uy,dy,fy,py,my,hy,gy,_y=``,vy=null,yy=null,by=!1,xy=!1;function Sy(e,t){let n=py.get(e);if(t!==null){let n=By(e);n.parentNode===t&&t.removeChild(n)}if(my.has(e)||cy._keyToDOMMap.delete(e),K(n)){let e=Py(n,py);Cy(e,0,e.length-1,null)}n!==void 0&&ow(gy,ly,uy,n,`destroyed`)}function Cy(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&Sy(t,r)}}function wy(e,t){e.setProperty(`text-align`,t)}var Ty=`40px`;function Ey(e,t){let n=sy.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(t===0)return void e.style.setProperty(`padding-inline-start`,``);let r=getComputedStyle(cy._rootElement||e).getPropertyValue(`--lexical-indent-base-value`)||Ty;e.style.setProperty(`padding-inline-start`,`calc(${t} * ${r})`)}function Dy(e,t){let n=e.style;t===0?wy(n,``):t===1?wy(n,`left`):t===2?wy(n,`center`):t===3?wy(n,`right`):t===4?wy(n,`justify`):t===5?wy(n,`start`):t===6&&wy(n,`end`)}function Oy(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(JS(e))return null;let n=e.getParentOrThrow();return JS(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function ky(e,t){let n=my.get(e);n===void 0&&V(60);let r=n.createDOM(sy,cy);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,cy),U(n)?r.setAttribute(`data-lexical-text`,`true`):KS(n)&&r.setAttribute(`data-lexical-decorator`,`true`),K(n)){let e=n.__indent,t=n.__size;if(Oy(r,n),e!==0&&Ey(r,e),t!==0){let e=t-1;Ay(Py(n,my),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&Dy(r,i),n.isInline()||My(null,n,r)}else{let t=n.getTextContent();if(KS(n)){let t=n.decorate(cy,sy);t!==null&&Iy(e,t),r.contentEditable=`false`}_y+=t}return t!==null&&t.insertChild(r),ow(gy,ly,uy,n,`created`),r}function Ay(e,t,n,r,i){let a=_y;_y=``;let o=n;for(;o<=r;++o){ky(e[o],i);let t=my.get(e[o]);t!==null&&U(t)?vy===null&&(vy=t.getFormat(),yy=t.getStyle()):K(t)&&o<r&&!t.isInline()&&(_y+=Tv)}i.element.__lexicalTextContent=_y,_y=a+_y}function jy(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return vx(e)?`line-break`:KS(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function My(e,t,n){let r=jy(e,py),i=jy(t,my);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function Ny(e,t,n){var r;vy=null,yy=null,function(e,t,n){let r=_y,i=e.__size,a=t.__size;_y=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)Fy(n,o);else{let e=By(n),t=ky(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}Sy(n,null)}let i=my.get(r);U(i)&&vy===null&&(vy=i.getFormat(),yy=i.getStyle())}else{let r=Py(e,py),s=Py(t,my);if(r.length!==i&&V(227),s.length!==a&&V(228),i===0)a!==0&&Ay(s,0,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;Cy(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else (function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=Ly(Fy(r,a.element)),d++,f++;else{if(l===void 0&&(l=Ry(n,f)),c===void 0)c=Ry(t,d);else if(!c.has(e)){d++;continue}if(!l.has(e)){u=Ly(By(e)),Sy(e,a.element),d++,c.delete(e);continue}if(c.has(r)){let e=uw(cy,r);e!==u&&a.withBefore(u).insertChild(e),u=Ly(Fy(r,a.element)),d++,f++}else ky(r,a.withBefore(u)),f++}let i=my.get(r);i!==null&&U(i)?vy===null&&(vy=i.getFormat(),yy=i.getStyle()):K(i)&&f<=s&&!i.isInline()&&(_y+=Tv)}let p=d>o,m=f>s;if(p&&!m){let e=n[s+1],t=e===void 0?null:cy.getElementByKey(e);Ay(n,0,f,s,a.withBefore(t))}else m&&!p&&Cy(t,d,o,a.element)})(0,r,s,i,a,n)}o.__lexicalTextContent=_y,_y=r+_y}(e,t,t.getDOMSlot(n)),r=t,vy==null||vy===r.__textFormat||xy||r.setTextFormat(vy),function(e){yy==null||yy===e.__textStyle||xy||e.setTextStyle(yy)}(t)}function Py(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&V(101),n.push(r),r=e.__next}return n}function Fy(e,t){let n=py.get(e),r=my.get(e);n!==void 0&&r!==void 0||V(61);let i=by||fy.has(e)||dy.has(e),a=uw(cy,e);if(n===r&&!i){let e;if(K(n)){let t=a.__lexicalTextContent;typeof t==`string`?e=t:(e=n.getTextContent(),a.__lexicalTextContent=e)}else e=n.getTextContent();return _y+=e,a}if(n!==r&&i&&ow(gy,ly,uy,r,`updated`),r.updateDOM(n,a,sy)){let n=ky(e,null);return t===null&&V(62),t.replaceChild(n,a),Sy(e,null),n}if(K(n)){K(r)||V(334,e);let t=r.__indent;(by||t!==n.__indent)&&Ey(a,t);let o=r.__format;if((by||o!==n.__format)&&Dy(a,o),i)Ny(n,r,a),JS(r)||r.isInline()||My(n,r,a);else{let e=a.__lexicalTextContent,t;typeof e==`string`?t=e:(t=n.getTextContent(),a.__lexicalTextContent=t),_y+=t}if((by||r.__dir!==n.__dir)&&(Oy(a,r),JS(r)&&!by))for(let e of r.getChildren())K(e)&&Oy(uw(cy,e.getKey()),e)}else{let t=r.getTextContent();if(KS(r)){let t=r.decorate(cy,sy);t!==null&&Iy(e,t)}_y+=t}if(!xy&&JS(r)&&r.__cachedText!==_y){let e=r.getWritable();e.__cachedText=_y,r=e}return a}function Iy(e,t){let n=cy._pendingDecorators,r=cy._decorators;if(n===null){if(r[e]===t)return;n=RC(cy)}n[e]=t}function Ly(e){let t=e.nextSibling;return t!==null&&t===cy._blockCursorElement&&(t=t.nextSibling),t}function Ry(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function zy(e,t,n,r,i,a){_y=``,by=r===2,cy=n,sy=n._config,ly=n._nodes,uy=cy._listeners.mutation,dy=i,fy=a,py=e._nodeMap,my=t._nodeMap,xy=t._readOnly,hy=new Map(n._keyToDOMMap);let o=new Map;return gy=o,Fy(`root`,null),cy=void 0,ly=void 0,dy=void 0,fy=void 0,py=void 0,my=void 0,sy=void 0,hy=void 0,gy=void 0,o}function By(e){let t=hy.get(e);return t===void 0&&V(75,e),t}function H(e){return{type:e}}var Vy=H(`SELECTION_CHANGE_COMMAND`),Hy=H(`CLICK_COMMAND`),Uy=H(`BEFORE_INPUT_COMMAND`),Wy=H(`INPUT_COMMAND`),Gy=H(`COMPOSITION_START_COMMAND`),Ky=H(`COMPOSITION_END_COMMAND`),qy=H(`DELETE_CHARACTER_COMMAND`),Jy=H(`INSERT_LINE_BREAK_COMMAND`),Yy=H(`INSERT_PARAGRAPH_COMMAND`),Xy=H(`CONTROLLED_TEXT_INSERTION_COMMAND`),Zy=H(`PASTE_COMMAND`),Qy=H(`REMOVE_TEXT_COMMAND`),$y=H(`DELETE_WORD_COMMAND`),eb=H(`DELETE_LINE_COMMAND`),tb=H(`FORMAT_TEXT_COMMAND`),nb=H(`UNDO_COMMAND`),rb=H(`REDO_COMMAND`),ib=H(`KEYDOWN_COMMAND`),ab=H(`KEY_ARROW_RIGHT_COMMAND`),ob=H(`MOVE_TO_END`),sb=H(`KEY_ARROW_LEFT_COMMAND`),cb=H(`MOVE_TO_START`),lb=H(`KEY_ARROW_UP_COMMAND`),ub=H(`KEY_ARROW_DOWN_COMMAND`),db=H(`KEY_ENTER_COMMAND`),fb=H(`KEY_SPACE_COMMAND`),pb=H(`KEY_BACKSPACE_COMMAND`),mb=H(`KEY_ESCAPE_COMMAND`),hb=H(`KEY_DELETE_COMMAND`),gb=H(`KEY_TAB_COMMAND`),_b=H(`DROP_COMMAND`),vb=H(`DRAGSTART_COMMAND`),yb=H(`DRAGOVER_COMMAND`),bb=H(`DRAGEND_COMMAND`),xb=H(`COPY_COMMAND`),Sb=H(`CUT_COMMAND`),Cb=H(`SELECT_ALL_COMMAND`),wb=H(`FOCUS_COMMAND`),Tb=H(`BLUR_COMMAND`),Eb=H(`KEY_MODIFIER_COMMAND`),Db=Object.freeze({}),Ob=[[`keydown`,function(e,t){kb=e.timeStamp,Ab=e.key,!t.isComposing()&&q(t,ib,e)}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;Ow(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&BS(t,()=>{_C(n)||(Ib=!0)})}],[`compositionstart`,function(e,t){q(t,Gy,e)}],[`compositionend`,function(e,t){sv?Rb=!0:lv||!dv&&!mv?q(t,Ky,e):(zb=!0,Bb=e.data)}],[`input`,function(e,t){e.stopPropagation(),BS(t,()=>{t.dispatchCommand(Wy,e)},{event:e}),Mb=null}],[`click`,function(e,t){BS(t,()=>{let n=G(),r=Tw(_w(t)),i=oS();if(r){if(W(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!JS(a)&&BC().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=Ww(a,e=>K(e)&&!e.isInline());K(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(Dw(n)||TC(n))&&HC(aS(i,r,t,e))}}q(t,Hy,e)})}],[`cut`,Db],[`copy`,Db],[`dragstart`,Db],[`dragover`,Db],[`dragend`,Db],[`paste`,Db],[`focus`,Db],[`blur`,Db],[`drop`,Db]];cv&&Ob.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||sv&&lw(t)||n!==`insertCompositionText`&&q(t,Uy,e)}(e,t)]);var kb=0,Ab=null,jb=0,Mb=null,Nb=new WeakMap,Pb=new WeakMap,Fb=!1,Ib=!1,Lb=!1,Rb=!1,zb=!1,Bb=``,Vb=null,Hb=[0,``,0,`root`,0];function Ub(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=DS(),l=Tw(_w(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!U(s)||(!i&&(!cv||jb<r+50)||s.isDirty()&&p<2||WC(n))&&a.offset!==o.offset&&!s.isComposing()||wC(s)||s.isDirty()&&p>1||(i||!cv)&&f!==null&&!s.isComposing()&&u!==DC(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||!s.isComposing()&&(s.getFormat()!==e.format||s.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=CC(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(U(t)||K(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function Wb(e,t){return TC(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Gb(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;Fb&&(Fb=!1,Wb(r,i)&&Wb(a,o)&&!Vb)||BS(t,()=>{if(!n)return void HC(null);if(!yC(t,r,a))return;let s=G();if(Vb&&W(s)&&s.isCollapsed()){let e=s.anchor,t=Vb.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=Vb.clone(),HC(s))}if(Vb=null,W(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=_w(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=Hb,f=BC(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)Kb(s,o,c);else if(n.type===`text`)U(r)||V(141),qb(s,r);else if(n.type===`element`&&!p){K(r)||V(259);let e=n.getNode();e.isEmpty()?function(e,t){Kb(e,t.getTextFormat(),t.getTextStyle())}(s,e):Kb(s,s.format,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(U(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}q(t,Vy,void 0)})}function Kb(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function qb(e,t){Kb(e,t.getFormat(),t.getStyle())}function Jb(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function Yb(e){let t=e.inputType,n=Jb(e),r=DS(),i=G();if(t===`deleteContentBackward`){if(i===null){let e=oS();if(!W(e))return!0;HC(e.clone())}if(W(i)){let t=i.anchor.key===i.focus.key;if(a=e.timeStamp,Ab===`MediaLast`&&a<kb+30&&r.isComposing()&&t){if(MC(null),kb=0,setTimeout(()=>{BS(r,()=>{MC(null)})},30),W(i)){let e=i.anchor.getNode();e.markDirty(),U(e)||V(142),qb(i,e)}}else{MC(null),e.preventDefault();let n=i.anchor.getNode(),a=n.getTextContent(),o=n.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=pv&&t&&!s&&o;if(c&&i.isCollapsed()&&(c=!KS(cw(i.anchor,!0))),!c){q(r,qy,!0);let e=G();pv&&W(e)&&e.isCollapsed()&&(Vb=e,setTimeout(()=>Vb=null))}}return!0}}var a;if(!W(i))return!0;let o=e.data;Mb!==null&&JC(!1,r,Mb),i.dirty&&Mb===null||!i.isCollapsed()||JS(i.anchor.getNode())||n===null||i.applyDOMRange(n),Mb=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
|
|
7
|
-
`)e.preventDefault(),q(r,Jy,!1);else if(o===Tv)e.preventDefault(),q(r,Yy,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&Ub(i,n,o,e.timeStamp,!0)?(e.preventDefault(),q(r,Xy,o)):Mb=o;return jb=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:q(r,Xy,e);break;case`insertFromComposition`:MC(null),q(r,Xy,e);break;case`insertLineBreak`:MC(null),q(r,Jy,!1);break;case`insertParagraph`:MC(null),Lb&&!lv?(Lb=!1,q(r,Jy,!1)):q(r,Yy,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:q(r,Zy,e);break;case`deleteByComposition`:(function(e,t){return e!==t||K(e)||K(t)||!CC(e)||!CC(t)})(l,u)&&q(r,Qy,e);break;case`deleteByDrag`:case`deleteByCut`:q(r,Qy,e);break;case`deleteContent`:q(r,qy,!1);break;case`deleteWordBackward`:q(r,$y,!0);break;case`deleteWordForward`:q(r,$y,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:q(r,eb,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:q(r,eb,!1);break;case`formatStrikeThrough`:q(r,tb,`strikethrough`);break;case`formatBold`:q(r,tb,`bold`);break;case`formatItalic`:q(r,tb,`italic`);break;case`formatUnderline`:q(r,tb,`underline`);break;case`historyUndo`:q(r,nb,void 0);break;case`historyRedo`:q(r,rb,void 0)}return!0}function Xb(e){if(Dw(e.target)&&_C(e.target))return!0;let t=DS(),n=G(),r=e.data,i=Jb(e);if(r!=null&&W(n)&&Ub(n,i,r,e.timeStamp,!1)){Rb&&=($b(t,r),!1);let i=n.anchor.getNode(),a=Tw(_w(t));if(a===null)return!0;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,c=o?n.focus.offset:n.anchor.offset;cv&&!n.isCollapsed()&&U(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===qC(a.anchorNode)||q(t,Xy,r);let l=r.length;sv&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),pv&&t.isComposing()&&(kb=0,MC(null))}else JC(!1,t,r===null?void 0:r),Rb&&=($b(t,r||void 0),!1);return function(){wS(),Uv(DS())}(),!0}function Zb(e){let t=DS(),n=G();if(W(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();MC(r.key),pw(px),(e.timeStamp<kb+30||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||U(i)&&i.getStyle()!==n.style)&&q(t,Xy,Ev)}return!0}function Qb(e){return $b(DS(),e.data),pw(mx),!0}function $b(e,t){let n=e._compositionKey;if(MC(null),n!==null&&t!=null){if(t===``){let t=PC(n),r=DC(e.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&U(t)){let n=Tw(_w(e)),i=null,a=null;n!==null&&n.anchorNode===r&&(i=n.anchorOffset,a=n.focusOffset),YC(t,r.nodeValue,i,a,!0)}return}if(t[t.length-1]===`
|
|
8
|
-
`){let t=G();if(W(t)||Kx(t)){if(W(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}q(e,db,null);return}}}JC(!0,e,t)}function ex(e){let t=DS();if(e.key==null)return!0;if(zb){if(nw(e))return BS(t,()=>{$b(t,Bb)}),zb=!1,Bb=``,!0;zb=!1,Bb=``}if(function(e){return $C(e,`ArrowRight`,{shiftKey:`any`})}(e))q(t,ab,e);else if(function(e){return $C(e,`ArrowRight`,ew)}(e))q(t,ob,e);else if(function(e){return $C(e,`ArrowLeft`,{shiftKey:`any`})}(e))q(t,sb,e);else if(function(e){return $C(e,`ArrowLeft`,ew)}(e))q(t,cb,e);else if(function(e){return $C(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))q(t,lb,e);else if(function(e){return $C(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))q(t,ub,e);else if(function(e){return $C(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))Lb=!0,q(t,db,e);else if(function(e){return e.key===` `}(e))q(t,fb,e);else if(function(e){return ov&&$C(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),Lb=!0,q(t,Jy,!0);else if(function(e){return $C(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))Lb=!1,q(t,db,e);else if(function(e){return $C(e,`Backspace`,{shiftKey:`any`})||ov&&$C(e,`h`,{ctrlKey:!0})}(e))nw(e)?q(t,pb,e):(e.preventDefault(),q(t,qy,!0));else if(function(e){return e.key===`Escape`}(e))q(t,mb,e);else if(function(e){return $C(e,`Delete`,{})||ov&&$C(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?q(t,hb,e):(e.preventDefault(),q(t,qy,!1));else if(function(e){return $C(e,`Backspace`,tw)}(e))e.preventDefault(),q(t,$y,!0);else if(function(e){return $C(e,`Delete`,tw)}(e))e.preventDefault(),q(t,$y,!1);else if(function(e){return ov&&$C(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),q(t,eb,!0);else if(function(e){return ov&&($C(e,`Delete`,{metaKey:!0})||$C(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),q(t,eb,!1);else if(function(e){return $C(e,`b`,ew)}(e))e.preventDefault(),q(t,tb,`bold`);else if(function(e){return $C(e,`u`,ew)}(e))e.preventDefault(),q(t,tb,`underline`);else if(function(e){return $C(e,`i`,ew)}(e))e.preventDefault(),q(t,tb,`italic`);else if(function(e){return $C(e,`Tab`,{shiftKey:`any`})}(e))q(t,gb,e);else if(function(e){return $C(e,`z`,ew)}(e))e.preventDefault(),q(t,nb,void 0);else if(function(e){return ov?$C(e,`z`,{metaKey:!0,shiftKey:!0}):$C(e,`y`,{ctrlKey:!0})||$C(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),q(t,rb,void 0);else{let n=t._editorState._selection;n===null||W(n)?rw(e)&&(e.preventDefault(),q(t,Cb,e)):function(e){return $C(e,`c`,ew)}(e)?(e.preventDefault(),q(t,xb,e)):function(e){return $C(e,`x`,ew)}(e)?(e.preventDefault(),q(t,Sb,e)):rw(e)&&(e.preventDefault(),q(t,Cb,e))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(Eb,e),!0}function tx(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var nx=new Map;function rx(e){let t=Ew(e.target);if(t===null)return;let n=xC(t.anchorNode);if(n===null)return;Ib&&(Ib=!1,BS(n,()=>{let r=oS(),i=t.anchorNode;(Dw(i)||TC(i))&&HC(aS(r,t,n,e))}));let r=GC(n),i=r[r.length-1],a=i._key,o=nx.get(a),s=o||i;s!==n&&Gb(t,s,!1),Gb(t,n,!0),n===i?o&&nx.delete(a):nx.set(a,n)}function ix(e){e._lexicalHandled=!0}function ax(e){return!0===e._lexicalHandled}function ox(e){let t=Nb.get(e);if(t===void 0)return;let n=Pb.get(t);if(n===void 0)return;let r=n-1;r>=0||V(164),Nb.delete(e),Pb.set(t,r),r===0&&t.removeEventListener(`selectionchange`,rx);let i=SC(e);bC(i)?(function(e){if(e._parentEditor!==null){let t=GC(e),n=t[t.length-1]._key;nx.get(n)===e&&nx.delete(n)}else nx.delete(e._key)}(i),e.__lexicalEditor=null):i&&V(198);let a=tx(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}function sx(e,t,n){wS();let r=e.__key,i=e.getParent();if(i===null)return;let a=function(e){let t=G();if(!W(t)||!K(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return hw(i,e)&&n.set(e.__key,0,`element`),hw(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(W(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(lS(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(lS(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Kx(a)&&t&&e.isSelected()&&e.selectPrevious();if(W(a)&&t&&!o){let t=e.getIndexWithinParent();AC(e),sS(a,i,t,-1)}else AC(e);n||yw(i)||i.canBeEmpty()||!i.isEmpty()||sx(i,t),t&&a&&JS(i)&&i.isEmpty()&&i.selectEnd()}var cx=Symbol.for(`ephemeral`);function lx(e){return e[cx]||!1}var ux=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Hw(this);return e===void 0&&V(64,this.name),e}static clone(e){V(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,`__state`,{configurable:!0,enumerable:!1,value:void 0,writable:!0}),kC(this,e)}getType(){return this.__type}isInline(){V(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=PC(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||G();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(U(this))return n;if(W(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(KS(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:PC(e)}getParentOrThrow(){let e=this.getParent();return e===null&&V(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(yw(t))return K(e)||e===this&&KS(e)||V(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&V(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:PC(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:PC(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=K(this)?this:this.getParent(),n=K(e)?e:e.getParent(),r=t&&n?ST(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=ST(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?yT(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&V(279),!1)))}isParentOf(e){let t=ST(this,e);return t!==null&&t.type===`ancestor`}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=K(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&V(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=DS()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(lx(this))return this;let e=PC(this.__key);return e===null&&V(113),e}getWritable(){if(lx(this))return this;wS();let e=ES(),t=DS(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=G();if(o!==null&&o.setCachedNodes(null),a.has(r))return jC(i),i;let s=Lw(i);return a.add(r),jC(s),n.set(r,s),s}getTextContent(){return``}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){V(70)}updateDOM(e,t,n){V(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){V(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of Xv(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&Yv(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){sx(this,!0,e)}replace(e,t){wS();let n=G();n!==null&&(n=n.clone()),xw(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size;AC(o);let l=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,f=r.__next,p=r.__parent;if(sx(r,!1,!0),l===null?s.__first=a:l.getWritable().__next=a,o.__prev=d,u===null?s.__last=a:u.getWritable().__prev=a,o.__next=f,o.__parent=p,s.__size=c,t&&(K(this)&&K(o)||V(139),this.getChildren().forEach(e=>{o.append(e)})),W(n)){HC(n);let e=n.anchor,t=n.focus;e.key===i&&Ux(e,o),t.key===i&&Ux(t,o)}return NC()===i&&MC(a),o}insertAfter(e,t=!0){wS(),xw(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.getParent(),a=G(),o=!1,s=!1;if(i!==null){let t=e.getIndexWithinParent();if(AC(r),W(a)){let e=i.__key,n=a.anchor,r=a.focus;o=n.type===`element`&&n.key===e&&n.offset===t+1,s=r.type===`element`&&r.key===e&&r.offset===t+1}}let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&W(a)){let e=this.getIndexWithinParent();sS(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){wS(),xw(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;AC(r);let a=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),s=n.__prev,c=this.getIndexWithinParent();a===null?o.__first=i:a.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=s,r.__next=n.__key,r.__parent=n.__parent;let l=G();return t&&W(l)&&sS(l,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return rC()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){wS();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(n===null)return r.select(0,0);if(K(n))return n.select();if(!U(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){wS();let n=this.getNextSibling(),r=this.getParentOrThrow();if(n===null)return r.select();if(K(n))return n.select(0,0);if(!U(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}},dx=`history-merge`,fx=`skip-dom-selection`,px=`composition-start`,mx=`composition-end`,hx=class e extends ux{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
9
|
-
`}createDOM(){return document.createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){let t=e.parentElement;if(t!==null&&jw(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&yx(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&yx(n))return!0}}return!1}(e)||function(e){let t=e.parentElement;if(t!==null&&jw(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&yx(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&yx(r))return!0}return!1}(e)?null:{conversion:gx,priority:0}}}static importJSON(e){return _x().updateFromJSON(e)}};function gx(e){return{node:_x()}}function _x(){return bw(new hx)}function vx(e){return e instanceof hx}function yx(e){return TC(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function bx(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function xx(e,t){return 1&t?`strong`:2&t?`em`:`span`}function Sx(e,t,n,r,i){let a=r.classList,o=aw(i,`base`);o!==void 0&&a.add(...o),o=aw(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in Dv){let r=Dv[e];if(o=aw(i,e),o!==void 0)if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}function Cx(e,t,n){let r=t.firstChild,i=n.isComposing(),a=e+(i?wv:``);if(r==null)t.textContent=a;else{let e=r.nodeValue;if(e!==a)if(i||sv){let[t,n,i]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(e,a);n!==0&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=a}}function wx(e,t,n,r,i,a){Cx(i,e,t);let o=a.theme.text;o!==void 0&&Sx(0,0,r,e,o)}function Tx(e,t){let n=document.createElement(t);return n.appendChild(e),n}var Ex=class e extends ux{__text;__format;__style;__mode;__detail;static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return Mv[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===NC()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Dv[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return OC(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=bx(0,n),i=xx(0,n),a=r===null?i:r,o=document.createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=document.createElement(i),o.appendChild(s)),wx(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&(o.style.cssText=c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=bx(0,i),s=bx(0,a),c=xx(0,i),l=xx(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??V(48);let i=document.createElement(l);return wx(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??V(49)),Cx(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&Sx(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:jx,priority:0}),b:()=>({conversion:Ox,priority:0}),code:()=>({conversion:Px,priority:0}),em:()=>({conversion:Px,priority:0}),i:()=>({conversion:Px,priority:0}),mark:()=>({conversion:Px,priority:0}),s:()=>({conversion:Px,priority:0}),span:()=>({conversion:Dx,priority:0}),strong:()=>({conversion:Px,priority:0}),sub:()=>({conversion:Px,priority:0}),sup:()=>({conversion:Px,priority:0}),u:()=>({conversion:Px,priority:0})}}static importJSON(e){return Fx().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Dw(t)||V(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=Tx(t,`b`)),this.hasFormat(`italic`)&&(t=Tx(t,`i`)),this.hasFormat(`strikethrough`)&&(t=Tx(t,`s`)),this.hasFormat(`underline`)&&(t=Tx(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?Dv[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Ov[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=OC(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=jv[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){wS();let n=e,r=t,i=G(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!W(i))return nS(o,n,o,r,`text`,`text`);{let e=NC();e!==i.anchor.key&&e!==i.focus.key||MC(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=G();if(r&&W(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){wS();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=NC(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=G();if(W(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=Fx(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=ty(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=Fx(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=ty(t,n);let a=n.__key;i===r&&MC(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&jC(t),n!==null&&jC(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),W(v)&&sS(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||V(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;NC()===r&&MC(n);let o=G();if(W(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&uS(i,t,n,e,a),s!==null&&s.key===r&&uS(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function Dx(e){return{forChild:Ix(e.style),node:null}}function Ox(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Ix(t.style,n?void 0:`bold`),node:null}}var kx=new WeakMap;function Ax(e){if(!Dw(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function jx(e){let t=e;e.parentElement===null&&V(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=kx.get(n))===void 0&&!Ax(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)kx.set(r[e],i);return i}(t)!==null){let e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){let r=e[n];r===`
|
|
10
|
-
`||r===`\r
|
|
11
|
-
`?t.push(_x()):r===` `?t.push(Rx()):r!==``&&t.push(Fx(r))}return{node:t}}if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=Mx(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Mx(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:Fx(n)}}function Mx(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,Dw(n)){let e=n.style.display;if(e===``&&!Aw(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(TC(n))return n;if(n.nodeName===`BR`)return null}}var Nx={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Px(e){let t=Nx[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Ix(e.style,t),node:null}}function Fx(e=``){return bw(new Ex(e))}function U(e){return e instanceof Ex}function Ix(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>U(e)?(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}var Lx=class e extends Ex{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=aw(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return Rx().updateFromJSON(e)}setTextContent(e){return e!==` `&&e!==``&&rv(126),super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||V(286),this}setDetail(e){return e!==2&&V(127),this}setMode(e){return e!==`normal`&&V(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Rx(){return bw(new Lx)}function zx(e){return e instanceof Lx}var Bx=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:vT(MT(CT(this,`next`)),MT(CT(e,`next`)))<0}getNode(){let e=PC(this.key);return e===null&&V(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,CS()||(NC()===a&&MC(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}};function Vx(e,t,n){return new Bx(e,t,n)}function Hx(e,t){let n=t.__key,r=e.offset,i=`element`;if(U(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!K(t)){let e=t.getNextSibling();if(U(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Ux(e,t){if(K(t)){let n=t.getLastDescendant();K(n)||U(n)?Hx(e,n):Hx(e,t)}else Hx(e,t)}var Wx=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Kx(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),n=t.length,r=t[n-1],i;if(U(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=PC(e);t!==null&&n.push(t)}return CS()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((G()||oS())===this&&e[0]){let t=aT(e[0],`next`);TT(gT(t,t))}for(let t of e)t.remove()}};function W(e){return e instanceof Gx}var Gx=class e{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!W(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(tT(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;K(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),eT(e.focus)&&K(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=lT(e.focus.origin,`previous`);tT(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=dT(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!K(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=MT(e.anchor),r=MT(e.anchor.getFlipped()),i=e=>$w(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(FT(DT(this),`next`));return CS()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`)}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=Jx(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if(K(d)&&!d.isInline())l||(c+=`
|
|
12
|
-
`),l=!d.isEmpty();else if(l=!1,U(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else !KS(d)&&!vx(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=DS(),n=t.getEditorState()._selection,r=tS(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),ay(this)}clone(){let t=this.anchor,n=this.focus;return new e(Vx(t.key,t.offset,t.type),Vx(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=OC(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=Dv[e];return(this.format&t)!==0}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];r===`
|
|
13
|
-
`||r===`\r
|
|
14
|
-
`?n.push(_x()):r===` `?n.push(Rx()):n.push(Fx(r))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=Fx();if(o.setFormat(n),o.setStyle(r),iC(a))a.splice(0,0,[o]);else{let e=JS(i)?rC().append(o):o;a===null?i.append(e):a.insertBefore(e)}e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&wT(o,MT(CT(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];U(d)||V(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(wC(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling();if(U(t)&&t.canInsertTextBefore()&&!wC(t)||(t=Fx(),t.setFormat(r),t.setStyle(i),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(wC(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling();if(U(t)&&!wC(t)||(t=Fx(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f){let e=Fx(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||K(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),eS(this.anchor,this.focus),void this.insertText(e)}if(u===1){if(CC(d)){let t=Fx(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(zx(d)){let t=Fx(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=Fx(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=K(d)?d:d.getParentOrThrow(),r=K(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c)if(U(m)&&!CC(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=Fx(m.getTextContent());m.replace(e),m=e}JS(o.getNode())||o.type!==`text`||(m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||K(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(CC(d))if(s===f)d.select();else{let t=Fx(e);t.select(),d.replace(t)}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length));for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=G()===this;ET(this,jT(DT(this))),e&&G()!==this&&HC(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void MC(null);let n=this.getNodes(),r=[];for(let e of n)U(e)&&r.push(e);let i=t=>{n.forEach(n=>{if(K(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}})},a=r.length;if(a===0)return this.toggleFormat(e),MC(null),void i(t);let o=this.anchor,s=this.focus,c=this.isBackward(),l=c?s:o,u=c?o:s,d=0,f=r[0],p=l.type===`element`?0:l.offset;if(l.type===`text`&&p===f.getTextContentSize()&&(d=1,f=r[1],p=0),f==null)return;let m=f.getFormatFlags(e,t);i(m);let h=a-1,g=r[h],_=u.type===`text`?u.offset:g.getTextContentSize();if(f.is(g)){if(p===_)return;if(wC(f)||p===0&&_===f.getTextContentSize())f.setFormat(m);else{let e=f.splitText(p,_),t=p===0?e[0]:e[1];t.setFormat(m),l.type===`text`&&l.set(t.__key,0,`text`),u.type===`text`&&u.set(t.__key,_-p,`text`)}this.format=m;return}p===0||wC(f)||([,f]=f.splitText(p),p=0),f.setFormat(m);let v=g.getFormatFlags(e,m);_>0&&(_===g.getTextContentSize()||wC(g)||([g]=g.splitText(_)),g.setFormat(v));for(let t=d+1;t<h;t++){let n=r[t],i=n.getFormatFlags(e,v);n.setFormat(i)}l.type===`text`&&l.set(f.__key,p,`text`),u.type===`text`&&u.set(g.__key,_,`text`),this.format=m|v}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key===`root`){this.insertParagraph();let t=G();return W(t)||V(134),t.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),n=Ww(t,Mw),r=e[e.length-1];if(K(n)&&`__language`in n){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=mS(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some(e=>(K(e)||KS(e))&&!e.isInline())){K(n)||V(211,t.constructor.name,t.getType());let i=mS(this);n.splice(i,0,e),r.selectEnd();return}let i=function(e){let t=rC(),n=null;for(let r=0;r<e.length;r++){let i=e[r],a=vx(i);if(a||KS(i)&&i.isInline()||K(i)&&i.isInline()||U(i)||i.isParentRequired()){if(n===null&&(n=i.createParentElementNode(),t.append(n),a))continue;n!==null&&n.append(i)}else t.append(i),n=null}return t}(e),a=i.getLastDescendant(),o=i.getChildren(),s=!K(n)||!n.isEmpty()?this.insertParagraph():null,c=o[o.length-1],l=o[0];var u;K(u=l)&&Mw(u)&&!u.isEmpty()&&K(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(K(n)||V(211,t.constructor.name,t.getType()),n.append(...l.getChildren()),l=o[1]),l&&(n===null&&V(212,t.constructor.name,t.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||V(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(n,l));let d=Ww(a,Mw);s&&K(d)&&(s.canMergeWhenEmpty()||Mw(c))&&(d.append(...s.getChildren()),s.remove()),K(n)&&n.isEmpty()&&n.remove(),a.selectEnd();let f=K(n)?n.getLastChild():null;vx(f)&&d!==n&&f.remove()}insertParagraph(){if(this.anchor.key===`root`){let e=rC();return BC().splice(this.anchor.offset,0,[e]),e.select(),e}let e=mS(this),t=Ww(this.anchor.getNode(),Mw);K(t)||V(213);let n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){let t=_x();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=Jx(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(U(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(U(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),U(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(gS(this,e,t,n))return;let r=e===`move`,i=DS(),a=Tw(_w(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();if(s===null||o===null||!K(c)||c.isInline()||c.canBeEmpty()||ww(o,i,s),this.dirty){let e=uw(i,this.anchor.key),t=uw(i,this.focus.key);this.anchor.type===`text`&&(e=DC(e)),this.focus.type===`text`&&(t=DC(t)),e&&t&&dS(a,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=a.getRangeAt(0),n=this.anchor.getNode(),i=JS(n)?n:vw(n);if(this.applyDOMRange(e),this.dirty=!0,!r){let n=this.getNodes(),r=[],o=!1;for(let e=0;e<n.length;e++){let t=n[e];hw(t,i)?r.push(t):o=!0}if(o&&r.length>0)if(t){let e=r[0];K(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=r[r.length-1];K(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}a.anchorNode===e.startContainer&&a.anchorOffset===e.startOffset||function(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}(this)}}n===`lineboundary`&&gS(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&K(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(K(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=mT(CT(t,e?`previous`:`next`));if(r.getTextSlices().every(e=>e===null||e.distance===0)){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(tT(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(K(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=MT(t);ET(this,gT(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(eT(t)){if(K(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(KS(t.origin)){if(!t.origin.isIsolated())if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&K(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=iS();e.add(t.origin.getKey()),HC(e)}else t.origin.remove();return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return ET(this,gT(!t.origin.isEmpty()&&n.isEmpty()?OT(aT(n,t.direction)):r.anchor,t)),this.removeText()}}let i=this.focus;if(this.modify(`extend`,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&Yx(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void Zx(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void Zx(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!(WC(e)||Xx(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&JS(e.getParent())&&e.getPreviousSibling()===null&&Yx(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify(`extend`,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify(`extend`,e,`word`)}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Kx(e){return e instanceof Wx}function qx(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Jx(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[qx(n),qx(r)]}function Yx(e,t){for(let n=t;n;n=n.getParent()){if(K(n)){if(n.collapseAtStart(e))return!0;if(yw(n))break}if(n.getPreviousSibling())break}return!1}var Xx=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function Zx(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Qx(e,t,n,r){let i,a=t;if(Dw(e)){let o=!1,s=e.childNodes,c=s.length,l=r._blockCursorElement;a===c&&(o=!0,a=c-1);let u=s[a],d=!1;if(u===l)u=s[a+1],d=!0;else if(l!==null){let n=l.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,l)&&a--}if(i=UC(u),U(i))a=sT(i,o?`next`:`previous`);else{let s=UC(e);if(s===null)return null;if(K(s)){let c=r.getElementByKey(s.getKey());c===null&&V(214);let l=s.getDOMSlot(c);[s,a]=l.resolveChildIndex(s,c,e,t),K(s)||V(215),o&&a>=s.getChildrenSize()&&(a=Math.max(0,s.getChildrenSize()-1));let u=s.getChildAtIndex(a);if(K(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=o?u.getLastDescendant():u.getFirstDescendant();e===null?s=u:(u=e,s=K(u)?u:u.getParentOrThrow()),a=0}U(u)?(i=u,s=null,a=sT(u,o?`next`:`previous`)):u!==s&&o&&!d&&(K(s)||V(216),a=Math.min(s.getChildrenSize(),a+1))}else{let n=s.getIndexWithinParent();a=t===0&&KS(s)&&UC(e)===s?n:n+1,s=s.getParentOrThrow()}if(K(s))return Vx(s.__key,a,`element`)}}else i=UC(e);return U(i)?Vx(i.__key,sT(i,a,`clamp`),`text`):null}function $x(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&K(a)&&a.isInline()){let t=a.getPreviousSibling();U(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else K(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):U(r)&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&K(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&K(a)&&a.isInline()&&!a.canInsertTextAfter()){let t=a.getNextSibling();U(t)&&e.set(t.__key,0,`text`)}}}function eS(e,t,n){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);$x(e,n,r),$x(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function tS(e,t,n,r,i,a){if(e===null||n===null||!yC(i,e,n))return null;let o=Qx(e,t,W(a)?a.anchor:null,i);if(o===null)return null;let s=Qx(n,r,W(a)?a.focus:null,i);if(s===null)return null;if(o.type===`element`&&s.type===`element`){let t=UC(e),r=UC(n);if(KS(t)&&KS(r))return null}return eS(o,s),[o,s]}function nS(e,t,n,r,i,a){let o=ES(),s=new Gx(Vx(e,t,i),Vx(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function rS(){return new Gx(Vx(`root`,0,`element`),Vx(`root`,0,`element`),0,``)}function iS(){return new Wx(new Set)}function aS(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!Fv&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(W(e)&&!c)return e.clone();if(t===null)return null;if(l=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,(s||o===void 0)&&W(e)&&!yC(n,l,u))return e.clone();let p=tS(l,d,u,f,n,e);if(p===null)return null;let[m,h]=p,g=0,_=``;if(W(e)){let t=e.anchor;if(m.key===t.key)g=e.format,_=e.style;else{let e=m.getNode();U(e)?(g=e.getFormat(),_=e.getStyle()):K(e)&&(g=e.getTextFormat(),_=e.getTextStyle())}}return new Gx(m,h,g,_)}function G(){return ES()._selection}function oS(){return DS()._editorState._selection}function sS(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),cS(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}cS(e)}function cS(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!K(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(U(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}return}if(K(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(U(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if(K(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(U(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}function lS(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,U(i)?s=`text`:K(i)&&(s=`element`)):(a=r.__key,U(r)?(o=r.getTextContentSize(),s=`text`):K(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function uS(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function dS(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function fS(e,t,n){let r=uw(e,t.getKey());if(K(t)){let e=t.getDOMSlot(r);return[e.element,n+e.getFirstChildOffset()]}return[r,n]}function pS(e,t,n,r,i,a,o){let s=r.anchorNode,c=r.focusNode,l=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(`collaboration`)&&d!==a||d!==null&&vC(d))return;if(!W(t))return void(e!==null&&yC(n,s,c)&&r.removeAllRanges());let f=t.anchor,p=t.focus,m=f.getNode(),h=p.getNode(),[g,_]=fS(n,m,f.offset),[v,y]=fS(n,h,p.offset),b=t.format,x=t.style,S=t.isCollapsed(),C=g,w=v,T=!1;var E,D,O,k,A;if((f.type===`text`?(C=DC(g),T=m.getFormat()!==b||m.getStyle()!==x):W(e)&&e.anchor.type===`text`&&(T=!0),p.type===`text`&&(w=DC(v)),C!==null&&w!==null)&&(S&&(e===null||T||W(e)&&(e.format!==b||e.style!==x))&&(E=b,D=x,O=_,k=f.key,A=performance.now(),Hb=[E,D,O,k,A]),l!==_||u!==y||s!==C||c!==w||r.type===`Range`&&S||(d!==null&&a.contains(d)||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0}),f.type===`element`))){if(dS(r,C,_,w,y),!sv||!t.isCollapsed()||a===null||i.has(`skip-selection-focus`)||document.activeElement!==null&&a.contains(document.activeElement)||a.focus({preventScroll:!0}),!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let e=W(t)&&t.anchor.type===`element`?C.childNodes[_]||null:r.rangeCount>0?r.getRangeAt(0):null;if(e!==null){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=fw(n),i=gw(r);if(r===null||i===null)return;let{top:a,bottom:o}=t,s=0,c=0,l=n;for(;l!==null;){let t=l===r.body;if(t){s=0,c=_w(e).innerHeight;let t=i.getComputedStyle(r.documentElement),n=parseFloat(t.scrollPaddingTop),a=parseFloat(t.scrollPaddingBottom);isFinite(n)&&(s+=n),isFinite(a)&&(c-=a)}else{let e=l.getBoundingClientRect();s=e.top,c=e.bottom}let n=0;if(a<s?n=-(s-a):o>c&&(n=o-c),n!==0)if(t)i.scrollBy(0,n);else{let e=l.scrollTop;l.scrollTop+=n;let t=l.scrollTop-e;a-=t,o-=t}if(t)break;l=dw(l)}})(n,t,a)}}Fb=!0}}function mS(e){let t=e;e.isCollapsed()||t.removeText();let n=G();W(n)&&(t=n),W(t)||V(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!Mw(i);){let e=i;if([i,a]=hS(i,a),e.is(i))break}return a}function hS(e,t){let n=e.getParent();if(!n){let e=rC();return BC().append(e),e.select(),[BC(),0]}if(U(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!K(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new Gx(Vx(e.__key,t,`element`),Vx(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function gS(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=CT(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!NT(c)){for(let e of c){l=!1;let{origin:t}=e;if(!KS(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of mT(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(tT(e))e.origin.isInline()||(c=e);else{if(K(e.origin))continue;KS(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&KS(c.origin)&&c.origin.isKeyboardSelectable()){let e=iS();return e.add(c.origin.getKey()),HC(e),!0}return c=MT(c),s&&wT(e.anchor,c),wT(e.focus,c),l||!o}var _S=null,vS=null,yS=!1,bS=!1,xS=0,SS={characterData:!0,childList:!0,subtree:!0};function CS(){return yS||_S!==null&&_S._readOnly}function wS(){yS&&V(13)}function TS(){xS>99&&V(14)}function ES(){return _S===null&&V(195,OS()),_S}function DS(){return vS===null&&V(196,OS()),vS}function OS(){let e=0,t=new Set,n=uC.version;if(typeof window<`u`)for(let r of document.querySelectorAll(`[contenteditable]`)){let i=SC(r);if(bC(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function kS(){return vS}function AS(e,t,n){let r=t.__type,i=mC(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function jS(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function MS(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function NS(e,t){let n=e.type,r=t.get(n);r===void 0&&V(17,n);let i=r.klass;e.type!==i.getType()&&V(18,i.name);let a=i.importJSON(e),o=e.children;if(K(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=NS(o[e],t);a.append(n)}return a}function PS(e,t,n){let r=_S,i=yS,a=vS;_S=t,yS=!0,vS=e;try{return n()}finally{_S=r,yS=i,vS=a}}function FS(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return;let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=_S,u=yS,d=vS,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){vS=e,_S=n,yS=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=zy(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),bS)throw t;aC(e,null,r,n),Wv(e),e._dirtyType=2,bS=!0,FS(e,a),bS=!1;return}finally{p.observe(r,SS),e._updating=f,_S=l,yS=u,vS=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags,y=e._deferred;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=RC(e)),delete r[a])}(e,n);let b=i?null:Tw(_w(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){vS=e,_S=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&ww(t,e,r),pS(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(W(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(document.activeElement)){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())Cw(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&Cw(t)){let n=t.getPreviousSibling();(n===null||Cw(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=e.getElementByKey(a.__key);r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=document.createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=BT(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&ww(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,SS),vS=d,_S=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),W(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(Vy,void 0);let x=e._pendingDecorators;x!==null&&(e._decorators=x,e._pendingDecorators=null,IS(`decorator`,e,!0,x)),function(e,t,n){let r=zC(t),i=zC(n);r!==i&&IS(`textcontent`,e,!0,i)}(e,t||a,n),IS(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),function(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){let t=e._updates;if(t.length!==0){let n=t.shift();if(n){let[t,r]=n;zS(e,t,r)}}}(e)}function IS(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function LS(e,t,n,r){let i=GC(e),a;for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t!==void 0){let e=Array.from(t),i=e.length,a=!1;if(BS(s,()=>{for(let t=0;t<i;t++)if(e[t](n,r))return void(a=!0)}),a)return a}}}return a&&a.update(()=>{LS(a,t,n,r)}),!1}function RS(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&V(191),a._flushSync=!0),o&&e._deferred.push(o),MS(e,i.tag)),a==null?zS(e,n,i):n()}}return r}function zS(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,MS(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=YS(c||s),l=!0),c._flushSync=o;let u=_S,d=yS,f=vS,p=e._updating;_S=c,yS=!1,e._updating=!0,vS=e;let m=e._headless||e.getRootElement()===null;fC(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=Tw(_w(e));return W(n)||n==null?aS(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=RS(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(W(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==0&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);U(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&iy(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=NC(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);U(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&iy(r),r!==void 0&&jS(r,a)&&AS(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){xS++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&jS(c,a)&&AS(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,xS++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),RS(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(K(t)&&Pv(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of o)a.delete(e);for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(i.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(W(i)){let e=c._nodeMap,t=i.anchor.key,n=i.focus.key;e.get(t)!==void 0&&e.get(n)!==void 0||V(19)}else Kx(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),FS(e);return}finally{_S=u,yS=d,vS=f,e._updating=p,xS=0}e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,FS(e)):l&&gC(()=>{FS(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function BS(e,t,n){vS===e&&n===void 0?t():zS(e,t,n)}var VS=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&V(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&V(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&V(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(mv||lv||dv);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=document.createElement(`br`);if(n.insertBefore(i,r),e){let e=document.createElement(`img`);e.setAttribute(`data-lexical-linebreak`,`true`),e.style.cssText=`display: inline !important; border: 0px !important; margin: 0px !important;`,e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let i=HS(t,n);i.push(r);let a=HS(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function HS(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&V(225),n.reverse()}var US=class extends ux{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return Av[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=DS()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(U(t)&&e.push(t),K(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;K(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;K(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return K(e)&&e.getLastDescendant()||e||null}let r=t[e];return K(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:PC(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&V(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:PC(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&V(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=``,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),K(i)&&r!==n-1&&!i.isInline()&&(e+=Tv)}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),K(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=kv[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=Dv[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return OC(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){wS();let n=G(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(U(e)||K(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(U(e)||K(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return W(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):nS(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e===``?0:kv[e],this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){lx(this)&&V(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||V(226,String(e),String(t),String(r));let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0)if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n<t;n++){e===null&&V(100);let t=e.getNextSibling(),n=e.__key;AC(e.getWritable()),s.push(n),e=t}}let d=l;for(let e of n){d!==null&&e.is(d)&&(l=d=d.getPreviousSibling());let t=e.getWritable();t.__parent===a&&u--,AC(t);let n=e.__key;if(d===null)i.__first=n,t.__prev=null;else{let e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===a&&V(76),t.__parent=a,o.push(n),d=e}if(e+t===r)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){let e=c.getWritable();if(d!==null){let t=d.getWritable();e.__prev=d.__key,t.__next=c.__key}else e.__prev=null}if(i.__size=u,s.length){let e=G();if(W(e)){let t=new Set(s),n=new Set(o),{anchor:r,focus:i}=e;WS(r,t,n)&&lS(r,r.getNode(),this,l,c),WS(i,t,n)&&lS(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||yw(this)||this.remove()}}return i}getDOMSlot(e){return new VS(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(Dw(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===``||yw(this)||this.getChildren().some(U)||(t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function K(e){return e instanceof US}function WS(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var GS=class extends ux{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function KS(e){return e instanceof GS}var qS=class e extends US{__cachedText;static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){V(51)}getTextContent(){let e=this.__cachedText;return!CS()&&DS()._dirtyType!==0||e===null?super.getTextContent():e}remove(){V(52)}replace(e){V(53)}insertBefore(e){V(54)}insertAfter(e){V(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)K(e)||KS(e)||V(282);return super.splice(e,t,n)}static importJSON(e){return BC().updateFromJSON(e)}collapseAtStart(){return!0}};function JS(e){return e instanceof qS}function YS(e){return new $S(new Map(e._nodeMap))}function XS(){return new $S(new Map([[`root`,new qS]]))}function ZS(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&V(130,n.name),K(e)){let r=t.children;Array.isArray(r)||V(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=ZS(i[e]);r.push(t)}}return t}function QS(e){return e instanceof $S}var $S=class e{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return PS(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return PS(null,this,()=>({root:ZS(BC())}))}},eC=class extends US{static getType(){return`artificial`}createDOM(e){return document.createElement(`div`)}},tC=class e extends US{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`p`),n=aw(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:nC,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Dw(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return rC().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(U);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=rC();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||U(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function nC(e){let t=rC();if(e.style&&(t.setFormat(e.style.textAlign),zw(e,t)),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in kv&&t.setFormat(n)}return{node:t}}function rC(){return bw(new tC)}function iC(e){return e instanceof tC}function aC(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=XS(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=``),n!==null&&(n.textContent=``,i.set(`root`,n))}function oC(e){let t=new Set,n=new Set,r=e;for(;r;){let{ownNodeConfig:e}=Hw(r),i=r.transform;if(!n.has(i)){n.add(i);let e=r.transform();e&&t.add(e)}if(e){let n=e.$transform;n&&t.add(n),r=e.extends}else{let e=Object.getPrototypeOf(r);r=e.prototype instanceof ux&&e!==ux?e:void 0}}return t}function sC(e){let t=e||{},n=kS(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=XS(),s=t.namespace||(i===null?KC():i._config.namespace),c=t.editorState,l=[qS,Ex,hx,Lx,tC,eC,...t.nodes||[]],{onError:u,html:d}=t,f=t.editable===void 0||t.editable,p;if(e===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let e=0;e<l.length;e++){let t=l[e],n=null,r=null;if(typeof t!=`function`){let e=t;t=e.replace,n=e.with,r=e.withKlass||null}Hw(t);let i=t.getType(),a=oC(t);p.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:qv(l[e]),transforms:a})}}let m=new uC(o,i,p,{disableEvents:a,namespace:s,theme:r},u||console.error,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(p,d?d.import:void 0),f,e);return c!==void 0&&(m._pendingEditorState=c,m._dirtyType=2),function(e){e.registerCommand(Uy,Yb,0),e.registerCommand(Wy,Xb,0),e.registerCommand(Gy,Zb,0),e.registerCommand(Ky,Qb,0),e.registerCommand(ib,ex,0)}(m),m}function cC(e,t){let n=e.get(t);e.delete(t),n&&n()}function lC(e,t,n){return e.set(t,n),cC.bind(null,e,t)}var uC=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,a,o,s){this._createEditorArgs=s,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=KC(),this._onError=i,this._htmlConversions=a,this._editable=o,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return lC(this._listeners.update,e)}registerEditableListener(e){return lC(this._listeners.editable,e)}registerDecoratorListener(e){return lC(this._listeners.decorator,e)}registerTextContentListener(e){return lC(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return HT(lC(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&V(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let i=r.get(e);i===void 0&&V(36,String(e));let a=i[n];return a.add(t),()=>{a.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&V(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=Iw(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=Iw(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=PC(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:dx}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return q(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=aw(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,aC(this,t,e,r),t!==null&&(this._config.disableEvents||ox(t),n!=null&&t.classList.remove(...n)),e!==null){let t=gw(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,Wv(this),this._updateTags.add(dx),FS(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;Nb.set(e,n);let r=Pb.get(n)??0;r<1&&n.addEventListener(`selectionchange`,rx),Pb.set(n,r+1),e.__lexicalEditor=t;let i=tx(e);for(let n=0;n<Ob.length;n++){let[r,a]=Ob[n],o=typeof a==`function`?e=>{ax(e)||(ix(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(ax(e))return;ix(e);let n=t.isEditable();switch(r){case`cut`:return n&&q(t,Sb,e);case`copy`:return q(t,xb,e);case`paste`:return n&&q(t,Zy,e);case`dragstart`:return n&&q(t,vb,e);case`dragover`:return n&&q(t,yb,e);case`dragend`:return n&&q(t,bb,e);case`focus`:return n&&q(t,wb,e);case`blur`:return n&&q(t,Tb,e);case`drop`:return n&&q(t,_b,e)}};e.addEventListener(r,o),i.push(()=>{e.removeEventListener(r,o)})}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(dx),FS(this);IS(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&V(38);let n=e;n._readOnly&&(n=YS(e),n._selection=e._selection?e._selection.clone():null),Uv(this);let r=this._pendingEditorState,i=this._updateTags,a=t===void 0?null:t.tag;r===null||r.isEmpty()||(a!=null&&i.add(a),FS(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,a!=null&&i.add(a),this._updating||FS(this)}parseEditorState(e,t){return function(e,t,n){let r=XS(),i=_S,a=yS,o=vS,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,_S=r,yS=!1,vS=t,fC(null);try{let i=t._nodes;NS(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,_S=i,yS=a,vS=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(e){return FS(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):zS(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),BS(this,()=>{let r=G(),i=BC();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||HC(r.clone()),pw(`focus`),mw(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Tw(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,IS(`editable`,this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};uC.version=`0.43.0+prod.esm`;var dC=null;function fC(e){dC=e}var pC=1;function mC(e,t){let n=hC(e,t);return n===void 0&&V(30,t),n}function hC(e,t){return e._nodes.get(t)}var gC=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function _C(e){return KS(LC(e))}function vC(e){let t=document.activeElement;if(!Dw(t))return!1;let n=t.nodeName;return KS(LC(e))&&(n===`INPUT`||n===`TEXTAREA`||t.contentEditable===`true`&&SC(t)==null)}function yC(e,t,n){let r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!vC(t)&&xC(t)===e}catch{return!1}}function bC(e){return e instanceof uC}function xC(e){let t=e;for(;t!=null;){let e=SC(t);if(bC(e))return e;t=dw(t)}return null}function SC(e){return e?e.__lexicalEditor:null}function CC(e){return zx(e)||e.isToken()}function wC(e){return CC(e)||e.isSegmented()}function TC(e){return Ow(e)&&e.nodeType===3}function EC(e){return Ow(e)&&e.nodeType===9}function DC(e){let t=e;for(;t!=null;){if(TC(t))return t;t=t.firstChild}return null}function OC(e,t,n){let r=Dv[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~Dv.superscript:t===`superscript`?i&=~Dv.subscript:t===`lowercase`?(i&=~Dv.uppercase,i&=~Dv.capitalize):t===`uppercase`?(i&=~Dv.lowercase,i&=~Dv.capitalize):t===`capitalize`&&(i&=~Dv.lowercase,i&=~Dv.uppercase),i}function kC(e,t){let n=function(){let e=dC;return dC=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);wS(),TS();let r=DS(),i=ES(),a=``+ pC++;i._nodeMap.set(a,e),K(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType=1,e.__key=a}function AC(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function jC(e){TS(),lx(e)&&V(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,r=ES(),i=DS(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent}}(n,a,o);let s=t.__key;i._dirtyType=1,K(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function MC(e){wS();let t=DS(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=PC(n);e!==null&&e.getWritable()}if(e!==null){let t=PC(e);t!==null&&t.getWritable()}}}function NC(){return CS()?null:DS()._compositionKey}function PC(e,t){let n=(t||ES())._nodeMap.get(e);return n===void 0?null:n}function FC(e,t){let n=IC(e,DS());return n===void 0?null:PC(n,t)}function IC(e,t){return e[`__lexicalKey_${t._key}`]}function LC(e,t){let n=e;for(;n!=null;){let e=FC(n,t);if(e!==null)return e;n=dw(n)}return null}function RC(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function zC(e){return e.read(()=>BC().getTextContent())}function BC(){return VC(ES())}function VC(e){return e._nodeMap.get(`root`)}function HC(e){wS();let t=ES();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function UC(e){let t=DS(),n=function(e,t){let n=e;for(;n!=null;){let e=IC(n,t);if(e!==void 0)return e;n=dw(n)}return null}(e,t);return n===null?e===t.getRootElement()?PC(`root`):null:PC(n)}function WC(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function GC(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function KC(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function qC(e){return TC(e)?e.nodeValue:null}function JC(e,t,n){let r=Tw(_w(t));if(r===null)return;let i=r.anchorNode,{anchorOffset:a,focusOffset:o}=r;if(i!==null){let t=qC(i),r=LC(i);if(t!==null&&U(r)){if((t===wv||t===Ev)&&n){let e=n.length;t=n,a=e,o=e}t!==null&&YC(r,t,a,o,e)}}}function YC(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=t;if((o||i)&&(t.endsWith(wv)&&(s=t.slice(0,-wv.length)),i)){let e=Ev,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){if(s===``){if(MC(null),dv||lv||mv)a.remove();else{let e=DS();setTimeout(()=>{e.update(()=>{a.isAttached()&&a.remove()})},20)}return}let t=a.getParent(),i=oS(),c=a.getTextContentSize(),l=NC(),u=a.getKey();if(a.isToken()||l!==null&&u===l&&!o||W(i)&&(t!==null&&!t.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===e.__key&&i.anchor.offset===0&&!a.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===c&&!a.canInsertTextAfter()&&!o))return void a.markDirty();let d=G();if(!W(d)||n===null||r===null)return void XC(a,s,d);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=Fx(a.getTextContent());a.replace(e),a=e}XC(a,s,d)}}}function XC(e,t,n){if(e.setTextContent(t),W(n)){let t=e.getKey();for(let r of[`anchor`,`focus`]){let i=n[r];i.type===`text`&&i.key===t&&(i.offset=sT(e,i.offset,`clamp`))}}}function ZC(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function QC(e,t){return ZC(e,t,`altKey`)&&ZC(e,t,`ctrlKey`)&&ZC(e,t,`shiftKey`)&&ZC(e,t,`metaKey`)}function $C(e,t,n){if(!QC(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;let r=`Key`+t.toUpperCase();return e.code===r}var ew={ctrlKey:!ov,metaKey:ov},tw={altKey:ov,ctrlKey:!ov};function nw(e){return e.key===`Backspace`}function rw(e){return $C(e,`a`,ew)}function iw(e){let t=BC();if(W(e)){let t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),ay(e),e}{let e=t.select(0,t.getChildrenSize());return HC(ay(e)),e}}function aw(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=BT(i);return n[t]=e,e}return i}function ow(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&V(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function sw(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function cw(e,t){let n=e.offset;if(e.type===`element`)return sw(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?sw(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function lw(e){let t=_w(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function q(e,t,n){return LS(e,t,n,e)}function uw(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&V(75,t),n}function dw(e){let t=e.assignedSlot||e.parentElement;return kw(t)?t.host:t}function fw(e){return EC(e)?e:Dw(e)?e.ownerDocument:null}function pw(e){wS(),DS()._updateTags.add(e)}function mw(e){wS(),DS()._deferred.push(e)}function hw(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function gw(e){let t=fw(e);return t?t.defaultView:null}function _w(e){let t=e._window;return t===null&&V(78),t}function vw(e){let t=e.getParentOrThrow();for(;t!==null;){if(yw(t))return t;t=t.getParentOrThrow()}return t}function yw(e){return JS(e)||K(e)&&e.isShadowRoot()}function bw(e){let t=DS(),n=e.getType(),r=hC(t,n);r===void 0&&V(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||V(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||V(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&V(203,e.constructor.name,n,r.name,r.getType()),t}return e}function xw(e,t){!JS(e.getParent())||K(t)||KS(t)||V(99)}function Sw(e){let t=PC(e);return t===null&&V(63,e),t}function Cw(e){return(KS(e)||K(e)&&!e.canBeEmpty())&&!e.isInline()}function ww(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function Tw(e){return iv?(e||window).getSelection():null}function Ew(e){let t=gw(e);return t?t.getSelection():null}function Dw(e){return Ow(e)&&e.nodeType===1}function Ow(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function kw(e){return Ow(e)&&e.nodeType===11}function Aw(e){let t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,`i`);return e.nodeName.match(t)!==null}function jw(e){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,`i`);return e.nodeName.match(t)!==null}function Mw(e){if(KS(e)&&!e.isInline())return!0;if(!K(e)||yw(e))return!1;let t=e.getFirstChild(),n=t===null||vx(t)||U(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Nw(){return DS()}var Pw=new WeakMap,Fw=new Map;function Iw(e){if(!e._readOnly&&e.isEmpty())return Fw;e._readOnly||V(192);let t=Pw.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),Pw.set(e,t)),t}function Lw(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Rw(e){return(t=Lw(e))[cx]=!0,t;var t}function zw(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Bw(e){return!0===e.__lexicalUnmanaged}function Vw(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==ux[t]}function Hw(e){let t=Nv in e.prototype?e.prototype[Nv]():void 0,n=function(e){if(!(e===ux||e.prototype instanceof ux)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{uC.version&&(n=JSON.parse(uC.version))}catch{}V(290,e.name,t,n)}return e===GS||e===US||e===ux}(e),r=!n&&Vw(e,`getType`)?e.getType():void 0,i,a=r;if(t)if(r)i=t[r];else for(let[e,n]of Object.entries(t))a=e,i=n;if(!n&&a&&(Vw(e,`getType`)||(e.getType=()=>a),Vw(e,`clone`)||(e.clone=t=>(fC(t),new e)),Vw(e,`importJSON`)||(e.importJSON=i&&i.$importJSON||(t=>new e().updateFromJSON(t))),!Vw(e,`importDOM`)&&i)){let{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:a}}function Uw(e){let t=Nw();return wS(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var Ww=(e,t)=>{let n=e;for(;n!=null&&!JS(n);){if(t(n))return n;n=n.getParent()}return null},Gw={next:`previous`,previous:`next`},Kw=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return _T({hasNext:eT,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return aT(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return aT(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&V(263,Array.from(o).join(` `))}else i.insert(e);i=aT(e,this.direction)}for(let e of o.values())e.remove();return this}},qw=class e extends Kw{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:lT(e,this.direction)}getParentCaret(e=`root`){return aT(Xw(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Yw(this.direction);return aT(this.getNodeAtCaret(),e)||lT(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Jw={root:JS,shadowRoot:yw};function Yw(e){return Gw[e]}function Xw(e,t=`root`){return Jw[t](e)?null:e}var Zw=class e extends Kw{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:aT(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return K(this.origin)?lT(this.origin,this.direction):null}getParentCaret(e=`root`){return aT(Xw(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Yw(this.direction);return aT(this.getNodeAtCaret(),e)||lT(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Qw)&&this.direction===t.direction&&this.origin.is(t.origin)}},Qw=class e extends Kw{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:oT(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return aT(Xw(this.getParentAtCaret(),e),this.direction)}getFlipped(){return oT(this.origin,Yw(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Zw||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return aT(this.origin,this.direction)}};function $w(e){return e instanceof Qw}function eT(e){return e instanceof Zw}function tT(e){return e instanceof qw}var nT={next:class extends Qw{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Qw{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},rT={next:class extends Zw{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Zw{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},iT={next:class extends qw{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends qw{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function aT(e,t){return e?new rT[t](e):null}function oT(e,t,n){return e?new nT[t](e,sT(e,n)):null}function sT(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&rv(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function cT(e,t){return new pT(e,t)}function lT(e,t){return K(e)?new iT[t](e):null}function uT(e){return e&&e.getChildCaret()||e}function dT(e){return e&&uT(e.getAdjacentCaret())}var fT=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return $w(t)?function(e,t){let{direction:n,origin:r}=e;return cT(e,sT(r,t===`focus`?Yw(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[cT(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=$w(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=$w(n),i=t=>t.isSameNodeCaret(n)?null:dT(t)||t.getParentCaret(e);return _T({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},pT=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return oT(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function mT(e){return gT(e,aT(BC(),e.direction))}function hT(e){return gT(e,e)}function gT(e,t){return e.direction!==t.direction&&V(265),new fT(e,t,e.direction)}function _T(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function vT(e,t){let n=ST(e.origin,t.origin);switch(n===null&&V(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return yT(n)}}function yT(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function bT(e,t){return t.is(e)}function xT(e){return K(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function ST(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=xT(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=xT(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(bT(e,r)||V(276),{commonAncestor:r,type:`ancestor`}):i===null?(bT(t,r)||V(277),{commonAncestor:r,type:`descendant`}):((K(a)||bT(e,a))&&(K(i)||bT(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||V(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function CT(e,t){let{type:n,key:r,offset:i}=e,a=Sw(e.key);return n===`text`?(U(a)||V(266,a.getType(),r),oT(a,t,i)):(K(a)||V(267,a.getType(),r),IT(a,e.offset,t))}function wT(e,t){let{origin:n,direction:r}=t,i=r===`next`;$w(t)?e.set(n.getKey(),t.offset,`text`):eT(t)?U(n)?e.set(n.getKey(),sT(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),`element`):(tT(t)&&K(n)||V(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function TT(e){let t=G(),n=W(t)?t:rS();return ET(n,e),HC(n),n}function ET(e,t){wT(e.anchor,t.anchor),wT(e.focus,t.focus)}function DT(e){let{anchor:t,focus:n}=e,r=CT(t,`next`),i=CT(n,`next`),a=vT(r,i)<=0?`next`:`previous`;return gT(PT(r,a),PT(i,a))}function OT(e){let{direction:t,origin:n}=e,r=aT(n,Yw(t)).getNodeAtCaret();return r?aT(r,t):lT(n.getParentOrThrow(),t)}function kT(e,t=`root`){let n=[e];for(let r=tT(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(OT(r));return n}function AT(e){return!!e&&e.origin.isAttached()}function jT(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=FT(e,r),o=kT(a.anchor,n),s=kT(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(tT(e))c.add(e.origin.getKey());else if(eT(e)){let{origin:t}=e;K(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=OT(aT(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=Fx(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=oT(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(AT(e)){u=MT(e);break}for(let e of s)if(AT(e)){d=MT(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c;for(c=0;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(yw(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,Mw),d=u&&l(o,e=>n.has(e.getKey())&&Mw(e));return u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;lT(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}let p=[u,d,...o,...s].find(AT);if(p)return hT(PT(MT(p),e.direction));V(269,JSON.stringify(o.map(e=>e.origin.__key)))}function MT(e){let t=function(e){let t=e;for(;tT(t);){let e=dT(t);if(!tT(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(U(t.origin))return $w(t)?t:oT(t.origin,n,n);let r=t.getAdjacentCaret();return eT(r)&&U(r.origin)?oT(r.origin,n,Yw(n)):t}function NT(e){return $w(e)&&e.offset!==sT(e.origin,e.direction)}function PT(e,t){return e.direction===t?e:e.getFlipped()}function FT(e,t){return e.direction===t?e:gT(PT(e.focus,t),PT(e.anchor,t))}function IT(e,t,n){let r=lT(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return PT(r,n)}function LT(e){return e}function RT(e){return e}function zT(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function BT(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function VT(e,...t){let n=BT(...t);n.length>0&&e.classList.add(...n)}function HT(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function UT(){return BC().getTextContent()}function WT(e,t=!0){if(e)return!1;let n=UT();return t&&(n=n.trim()),n===``}function GT(e){if(!WT(e,!1))return!1;let t=BC().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(KS(n))return!1;if(K(n)){if(!iC(n)||n.__indent!==0)return!1;let t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){let n=t[e];if(!U(n))return!1}}}return!0}function KT(e){return()=>GT(e)}function qT(e){let t=Nw().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function JT(e){return qT(JS(e)?e:e.getParentOrThrow())}function YT(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!wC(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=Jx(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=Rw(t)),t.__text=p)}}return t}function XT(e){let t=ZT(e);return t!==null&&t.writingMode===`vertical-rl`}function ZT(e){let t=e.anchor.getNode();return K(t)?qT(t):JT(t)}function QT(e,t){let n=XT(e)?!t:t;eE(e)&&(n=!n);let r=CT(e.focus,n?`previous`:`next`);if(NT(r))return!1;for(let e of mT(r)){if(tT(e))return!e.origin.isInline();if(!K(e.origin)){if(KS(e.origin))return!0;break}}return!1}function $T(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function eE(e){let t=ZT(e);return t!==null&&t.direction===`rtl`}function tE(e,t,n){let r=eE(e),i;i=XT(e)||r?!n:n,$T(e,t,i,`character`)}var nE=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,rE=nE&&`documentMode`in document?document.documentMode:null;nE&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),nE&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!nE||!(`InputEvent`in window)||rE)&&`getTargetRanges`in new window.InputEvent(`input`),nE&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,nE&&/Android/.test(navigator.userAgent),nE&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),nE&&/^(?=.*Chrome).*/i.test(navigator.userAgent),nE&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function iE(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}var aE=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function oE({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:m,id:h,role:g=`textbox`,spellCheck:_=!0,style:v,tabIndex:y,"data-testid":b,...x},S){let[C,w]=(0,L.useState)(e.isEditable()),T=(0,L.useCallback)(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),E=(0,L.useMemo)(()=>function(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}(S,T),[T,S]);return aE(()=>(w(e.isEditable()),e.registerEditableListener(e=>{w(e)})),[e]),(0,R.jsx)(`div`,{"aria-activedescendant":C?t:void 0,"aria-autocomplete":C?n:`none`,"aria-controls":C?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":C&&g===`combobox`?!!o:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":C?d:void 0,"aria-readonly":!C||void 0,"aria-required":f,autoCapitalize:p,className:m,contentEditable:C,"data-testid":b,id:h,ref:E,role:g,spellCheck:_,style:v,tabIndex:y,...x})}var sE=(0,L.forwardRef)(oE);function cE(e){return e.getEditorState().read(KT(e.isComposing()))}var lE=(0,L.forwardRef)(uE);function uE(e,t){let{placeholder:n,...r}=e,[i]=nv();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(sE,{editor:i,...r,ref:t}),n!=null&&(0,R.jsx)(dE,{editor:i,content:n})]})}function dE({content:e,editor:t}){let n=function(e){let[t,n]=(0,L.useState)(()=>cE(e));return aE(()=>{function t(){n(cE(e))}return t(),HT(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,i]=(0,L.useState)(t.isEditable());if((0,L.useLayoutEffect)(()=>(i(t.isEditable()),t.registerEditableListener(e=>{i(e)})),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:(0,R.jsx)(`div`,{"aria-hidden":!0,children:a})}var fE=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,pE=fE?L.useLayoutEffect:L.useEffect,mE={tag:dx};function hE({initialConfig:e,children:t}){let n=(0,L.useMemo)(()=>{let{theme:t,namespace:n,nodes:r,onError:i,editorState:a,html:o}=e,s=tv(null,t),c=sC({editable:e.editable,html:o,namespace:n,nodes:r,onError:e=>i(e,c),theme:t});return function(e,t){if(t!==null){if(t===void 0)e.update(()=>{let t=BC();if(t.isEmpty()){let n=rC();t.append(n);let r=fE?document.activeElement:null;(G()!==null||r!==null&&r===e.getRootElement())&&n.select()}},mE);else if(t!==null)switch(typeof t){case`string`:{let n=e.parseEditorState(t);e.setEditorState(n,mE);break}case`object`:e.setEditorState(t,mE);break;case`function`:e.update(()=>{BC().isEmpty()&&t(e)},mE)}}}(c,a),[c,s]},[]);return pE(()=>{let t=e.editable,[r]=n;r.setEditable(t===void 0||t)},[]),(0,R.jsx)(ev.Provider,{value:n,children:t})}var gE=(0,L.createContext)(null),_E={didCatch:!1,error:null},vE=class extends L.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=_E}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(_E))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&yE(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(_E))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,L.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,L.createElement)(gE.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function yE(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function bE({children:e,onError:t}){return(0,R.jsx)(vE,{fallback:(0,R.jsx)(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}),onError:t,children:e})}var xE=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function SE(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function CE(){return function(e){let[t]=nv(),n=(0,L.useMemo)(()=>e(t),[t,e]),[r,i]=(0,L.useState)(()=>n.initialValueFn()),a=(0,L.useRef)(r);return xE(()=>{let{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,i(r)),t(e=>{a.current=e,i(e)})},[n,e]),r}(SE)}var wE=Symbol.for(`preact-signals`);function TE(){if(AE>1)return void AE--;let e,t=!1;for(function(){let e=kE;for(kE=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();DE!==void 0;){let n=DE;for(DE=void 0,jE++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&IE(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(jE=0,AE--,t)throw e}var EE,DE;function OE(e){let t=EE;EE=void 0;try{return e()}finally{EE=t}}var kE,AE=0,jE=0,ME=0,NE=0;function PE(e){if(EE===void 0)return;let t=e.n;return t===void 0||t.t!==EE?(t={i:0,S:e,p:EE.s,n:void 0,t:EE,e:void 0,x:void 0,r:t},EE.s!==void 0&&(EE.s.n=t),EE.s=t,e.n=t,32&EE.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=EE.s,t.n=void 0,EE.s.n=t,EE.s=t),t):void 0}function FE(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function IE(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function LE(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function RE(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function zE(e,t){FE.call(this,void 0),this.x=e,this.s=void 0,this.g=NE-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function BE(e){let t=e.m;if(e.m=void 0,typeof t==`function`){AE++;let n=EE;EE=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,VE(e),t}finally{EE=n,TE()}}}function VE(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,BE(e)}function HE(e){if(EE!==this)throw Error(`Out-of-order effect`);RE(this),EE=e,this.f&=-2,8&this.f&&VE(this),TE()}function UE(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}function WE(e,t){let n=new UE(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}FE.prototype.brand=wE,FE.prototype.h=function(){return!0},FE.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?OE(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},FE.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&OE(()=>{var e;(e=this.Z)==null||e.call(this)}))}},FE.prototype.subscribe=function(e){return WE(()=>{let t=this.value,n=EE;EE=void 0;try{e(t)}finally{EE=n}},{name:`sub`})},FE.prototype.valueOf=function(){return this.value},FE.prototype.toString=function(){return this.value+``},FE.prototype.toJSON=function(){return this.value},FE.prototype.peek=function(){let e=EE;EE=void 0;try{return this.value}finally{EE=e}},Object.defineProperty(FE.prototype,`value`,{get(){let e=PE(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(jE>100)throw Error(`Cycle detected`);(function(e){AE!==0&&jE===0&&e.l!==ME&&(e.l=ME,kE={S:e,v:e.v,i:e.i,o:kE})})(this),this.v=e,this.i++,NE++,AE++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{TE()}}}}),zE.prototype=new FE,zE.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===NE))return!0;if(this.g=NE,this.f|=1,this.i>0&&!IE(this))return this.f&=-2,!0;let e=EE;try{LE(this),EE=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return EE=e,RE(this),this.f&=-2,!0},zE.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}FE.prototype.S.call(this,e)},zE.prototype.U=function(e){if(this.t!==void 0&&(FE.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},zE.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(zE.prototype,`value`,{get(){if(1&this.f)throw Error(`Cycle detected`);let e=PE(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),UE.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},UE.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,BE(this),LE(this),AE++;let e=EE;return EE=this,HE.bind(this,e)},UE.prototype.N=function(){2&this.f||(this.f|=2,this.u=DE,DE=this)},UE.prototype.d=function(){this.f|=8,1&this.f||VE(this)},UE.prototype.dispose=function(){this.d()};function GE(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}Kv(`format`,{parse:e=>typeof e==`number`?e:0});function KE(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function qE(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)n[e]=qE(n[e],r[e]);return e}return t}var JE=0,YE=1,XE=2,ZE=3,QE=4,$E=5,eD=6,tD=7;function nD(e){return e.id===JE}function rD(e){return e.id===XE}function iD(e){return function(e){return e.id===YE}(e)||KE(305,String(e.id),String(YE)),Object.assign(e,{id:XE})}var aD=new Set,oD=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:JE}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):zT;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;rD(t)||KE(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:ZE,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:QE,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==QE&&KE(307,String(t.id),String($E)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:$E,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==$E&&KE(308,String(n.id),String($E));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:eD})}(n),()=>{let e=this.state;e.id!==tD&&KE(309,String(n.id),String(tD)),this.state=function(e){return Object.assign(e,{id:$E})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==eD&&KE(310,String(t.id),String(eD)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:tD})}(t),n}getSignal(){return this._signal===void 0&&KE(311),this._signal}getInitResult(){this.extension.init===void 0&&KE(312,this.extension.name);let e=this.state;return function(e){return e.id>=QE}(e)||KE(313,String(e.id),String(QE)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=ZE}(e)||KE(314,String(e.id),String(ZE)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&KE(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&KE(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=tD}(e)||KE(316,String(e.id),String(tD)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||aD}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=$E})(e)||KE(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},sD={tag:dx};function cD(){let e=BC();e.isEmpty()&&e.append(rC())}var lD=LT({config:RT({setOptions:sD,updateOptions:sD}),init:({$initialEditorState:e=cD})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(QS(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[qS,Ex,hx,Lx,tC]}),uD=Symbol.for(`@lexical/extension/LexicalBuilder`);function dD(){}function fD(e){throw e}function pD(e){return Array.isArray(e)?e:[e]}var mD=`0.43.0+prod.esm`,hD=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=mD,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[pD(lD)];for(let e of t)n.push(pD(e));return new e(n)}static maybeFromEditor(t){let n=t[uD];return n&&(n.PACKAGE_VERSION!==mD&&KE(292,n.PACKAGE_VERSION,mD),n instanceof e||KE(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&KE(294),n}constructEditor(){let{$initialEditorState:e,onError:t,...n}=this.buildCreateEditorArgs(),r=Object.assign(sC({...n,...t?{onError:e=>{t(e,r)}}:{}}),{[uD]:this});for(let e of this.sortedExtensionReps())e.build(r);return r}buildEditor(){let e=dD;function t(){try{e()}finally{e=dD}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=HT(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&KE(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&KE(296);let[t]=pD(e);typeof t.name!=`string`&&KE(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&KE(298,t.name),!n){n=new oD(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&KE(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&KE(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=pD(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(rD(i))return;let a=n.extension.name;var o;nD(i)||KE(300,a,r||`[unknown]`),nD(o=i)||KE(304,String(o.id),String(JE)),i=Object.assign(o,{id:YE}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=iD(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())nD(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&KE(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return HT(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of GE(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&KE(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&qE(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=fD,e}},gD=class e extends GS{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return vD().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:_D,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return VT(t,e.theme.hr),t}getTextContent(){return`
|
|
15
|
-
`}isInline(){return!1}updateDOM(){return!1}};function _D(){return{node:vD()}}function vD(){return Uw(gD)}var yD=LT({name:`@lexical/react/ReactProvider`});function bD(e){let t=window.location.origin,n=n=>{if(n.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let i=n.data;if(typeof i==`string`){let t;try{t=JSON.parse(i)}catch{return}if(t&&t.protocol===`nuanria_messaging`&&t.type===`request`){let r=t.payload;if(r&&r.functionId===`makeChanges`){let t=r.args;if(t){let[r,i,a,o,s]=t;e.update(()=>{let e=G();if(W(e)){let t=e.anchor,c=t.getNode(),l=0,u=0;if(U(c)&&r>=0&&i>=0&&(l=r,u=r+i,e.setTextNodeRange(c,l,c,u)),l===u&&a===``||(e.insertRawText(a),c=t.getNode()),U(c)){l=o,u=o+s;let t=c.getTextContentSize();l=l>t?t:l,u=u>t?t:u,e.setTextNodeRange(c,l,c,u)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener(`message`,n,!0),()=>{window.removeEventListener(`message`,n,!0)}}function xD(e,t){if(typeof document>`u`||typeof window>`u`&&global.window===void 0)throw Error(`To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.`);let n=document.createElement(`div`),r=BC().getChildren();for(let i=0;i<r.length;i++)SD(e,r[i],n,t);return n.innerHTML}function SD(e,t,n,r=null){let i=r===null||t.isSelected(r),a=K(t)&&t.excludeFromCopy(`html`),o=t;r!==null&&U(t)&&(o=YT(r,t,`clone`));let s=K(o)?o.getChildren():[],c=hC(e,o.getType()),l;l=c&&c.exportDOM!==void 0?c.exportDOM(e,o):o.exportDOM(e);let{element:u,after:d}=l;if(!u)return!1;let f=document.createDocumentFragment();for(let n=0;n<s.length;n++){let a=s[n],o=SD(e,a,f,r);!i&&K(t)&&o&&t.extractWithChild(a,r,`html`)&&(i=!0)}if(i&&!a){if((Dw(u)||kw(u))&&u.append(f),n.append(u),d){let e=d.call(o,u);e&&(kw(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(f);return i}function CD(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function wD(e,t=G()){return t??CD(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?``:xD(e,t)}function TD(e,t){let n=e.getData(`text/plain`)||e.getData(`text/uri-list`);n!=null&&t.insertRawText(n)}var ED=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,DD=ED&&`documentMode`in document?document.documentMode:null,OD=ED&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),kD=!(!ED||!(`InputEvent`in window)||DD)&&`getTargetRanges`in new window.InputEvent(`input`),AD=ED&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,jD=ED&&/Android/.test(navigator.userAgent),MD=ED&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!jD,ND=ED&&/^(?=.*Chrome).*/i.test(navigator.userAgent),PD=ED&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&OD&&!ND;function FD(e,t){t.update(()=>{if(e!==null){let n=iE(e,KeyboardEvent)?null:e.clipboardData,r=G();if(r!==null&&!r.isCollapsed()&&n!=null){e.preventDefault();let i=wD(t);i!==null&&n.setData(`text/html`,i),n.setData(`text/plain`,r.getTextContent())}}})}function ID(e){return HT(e.registerCommand(qy,e=>{let t=G();return!!W(t)&&(t.deleteCharacter(e),!0)},0),e.registerCommand($y,e=>{let t=G();return!!W(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(eb,e=>{let t=G();return!!W(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(Xy,e=>{let t=G();if(!W(t))return!1;if(typeof e==`string`)t.insertText(e);else{let n=e.dataTransfer;if(n!=null)TD(n,t);else{let n=e.data;n&&t.insertText(n)}}return!0},0),e.registerCommand(Qy,()=>{let e=G();return!!W(e)&&(e.removeText(),!0)},0),e.registerCommand(Jy,e=>{let t=G();return!!W(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(Yy,()=>{let e=G();return!!W(e)&&(e.insertLineBreak(),!0)},0),e.registerCommand(sb,e=>{let t=G();if(!W(t))return!1;let n=e,r=n.shiftKey;return!!QT(t,!0)&&(n.preventDefault(),tE(t,r,!0),!0)},0),e.registerCommand(ab,e=>{let t=G();if(!W(t))return!1;let n=e,r=n.shiftKey;return!!QT(t,!1)&&(n.preventDefault(),tE(t,r,!1),!0)},0),e.registerCommand(pb,t=>!!W(G())&&(!AD||navigator.language!==`ko-KR`)&&(t.preventDefault(),e.dispatchCommand(qy,!0)),0),e.registerCommand(hb,t=>!!W(G())&&(t.preventDefault(),e.dispatchCommand(qy,!1)),0),e.registerCommand(db,t=>{if(!W(G()))return!1;if(t!==null){if((AD||MD||PD)&&kD)return!1;t.preventDefault()}return e.dispatchCommand(Jy,!1)},0),e.registerCommand(Cb,()=>(iw(),!0),0),e.registerCommand(xb,t=>!!W(G())&&(FD(t,e),!0),0),e.registerCommand(Sb,t=>!!W(G())&&(function(e,t){FD(e,t),t.update(()=>{let e=G();W(e)&&e.removeText()})}(t,e),!0),0),e.registerCommand(Zy,t=>!!W(G())&&(function(e,t){e.preventDefault(),t.update(()=>{let t=G(),n=iE(e,ClipboardEvent)?e.clipboardData:null;n!=null&&W(t)&&TD(n,t)},{tag:`paste`})}(t,e),!0),0),e.registerCommand(_b,e=>!!W(G())&&(e.preventDefault(),!0),0),e.registerCommand(vb,e=>!!W(G())&&(e.preventDefault(),!0),0))}var LD=e(i(),1);function RD(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var zD=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function BD({editor:e,ErrorBoundary:t}){return function(e,t){let[n,r]=(0,L.useState)(()=>e.getDecorators());return zD(()=>e.registerDecoratorListener(e=>{(0,LD.flushSync)(()=>{r(e)})}),[e]),(0,L.useEffect)(()=>{r(e.getDecorators())},[e]),(0,L.useMemo)(()=>{let r=[],i=Object.keys(n);for(let a=0;a<i.length;a++){let o=i[a],s=(0,R.jsx)(t,{onError:t=>e._onError(t),children:(0,R.jsx)(L.Suspense,{fallback:null,children:n[o]})}),c=e.getElementByKey(o);c!==null&&r.push((0,LD.createPortal)(s,c,o))}return r},[t,n,e])}(e,t)}function VD({editor:e,ErrorBoundary:t}){return function(e){let t=hD.maybeFromEditor(e);if(t&&t.hasExtensionByName(yD.name)){for(let e of[`@lexical/plain-text`,`@lexical/rich-text`])t.hasExtensionByName(e)&&RD(320,e);return!0}return!1}(e)?null:(0,R.jsx)(BD,{editor:e,ErrorBoundary:t})}function HD(e){return e.getEditorState().read(KT(e.isComposing()))}function UD({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[r]=nv();return function(e){zD(()=>HT(ID(e),bD(e)),[e])}(r),(0,R.jsxs)(R.Fragment,{children:[e,(0,R.jsx)(WD,{content:t}),(0,R.jsx)(VD,{editor:r,ErrorBoundary:n})]})}function WD({content:e}){let[t]=nv(),n=function(e){let[t,n]=(0,L.useState)(()=>HD(e));return zD(()=>{function t(){n(HD(e))}return t(),HT(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),r=CE();return n?typeof e==`function`?e(r):e:null}function GD(e){return e===`file`?[`mx-[2px]`,`inline-flex`,`h-7`,`max-w-[min(100%,17rem)]`,`items-center`,`gap-1.5`,`rounded-lg`,`border`,`border-border`,`bg-muted`,`px-2`,`align-baseline`,`text-foreground`,`transition-[border-color,background-color,box-shadow,color]`,`duration-150`].join(` `):[`mx-[2px]`,`inline-flex`,`h-7`,`max-w-full`,`items-center`,`gap-1.5`,`rounded-lg`,`border`,`border-primary/12`,`bg-primary/8`,`px-2`,`align-baseline`,`text-[11px]`,`font-medium`,`text-primary`,`transition`].join(` `)}function KD({label:e,tokenKind:t}){let n=t===`workspace_file`||t===`workspace_directory`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:t===`file`?`inline-flex h-4.5 w-4.5 shrink-0 items-center justify-center rounded-md bg-card text-muted-foreground ring-1 ring-border`:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center text-primary/70`,children:t===`file`?(0,R.jsx)(fs,{"aria-hidden":`true`,className:`h-3 w-3`}):t===`workspace_file`?(0,R.jsx)(yn,{"aria-hidden":`true`,className:`h-3 w-3`}):t===`workspace_directory`?(0,R.jsx)(as,{"aria-hidden":`true`,className:`h-3 w-3`}):t===`panel_app`?(0,R.jsx)(vo,{"aria-hidden":`true`,className:`h-3 w-3`}):(0,R.jsx)(Is,{"aria-hidden":`true`,className:`h-3 w-3`})}),(0,R.jsx)(`span`,{className:t===`file`?`min-w-0 flex-1 truncate text-[12px] font-medium text-foreground`:n?`max-w-[16rem] truncate`:`truncate`,children:e})]})}var qD=class e extends GS{static getType(){return`chat-composer-token`}static clone(t){return new e(t.__composerId,t.__tokenKind,t.__tokenKey,t.__label,t.__key)}static importJSON(e){return JD({composerId:e.composerId,label:e.label,tokenKey:e.tokenKey,tokenKind:e.tokenKind})}constructor(e,t,n,r,i){super(i),this.applyTokenDom=e=>{e.contentEditable=`false`,e.dataset.composerNodeId=this.__composerId,e.dataset.composerNodeType=`token`,e.dataset.composerTokenKind=this.__tokenKind,e.dataset.composerTokenKey=this.__tokenKey,e.dataset.composerLabel=this.__label,e.title=this.__label,e.className=GD(this.__tokenKind)},this.createDOM=(e,t)=>{let n=document.createElement(`span`);return this.applyTokenDom(n),n},this.updateDOM=(e,t)=>(this.applyTokenDom(t),!1),this.decorate=()=>(0,R.jsx)(KD,{label:this.__label,tokenKind:this.__tokenKind}),this.exportJSON=()=>({composerId:this.__composerId,label:this.__label,tokenKey:this.__tokenKey,tokenKind:this.__tokenKind,type:`chat-composer-token`,version:1}),this.getComposerId=()=>this.getLatest().__composerId,this.getTokenKind=()=>this.getLatest().__tokenKind,this.getTokenKey=()=>this.getLatest().__tokenKey,this.getLabel=()=>this.getLatest().__label,this.getTextContent=()=>``,this.isInline=()=>!0,this.isIsolated=()=>!0,this.isKeyboardSelectable=()=>!1,this.__composerId=e,this.__tokenKind=t,this.__tokenKey=n,this.__label=r}};function JD(e){let{composerId:t,label:n,tokenKey:r,tokenKind:i}=e;return bw(new qD(t,i,r,n))}function YD(e){return e instanceof qD}var XD=`nextclaw-chat-composer-external-update`;function ZD(){let e=BC(),t=e.getFirstChild();if(!K(t))return{descriptors:[],paragraphKey:e.getKey(),paragraphSize:0,totalLength:0};let n=t.getChildren(),r=[],i=0;for(let[e,t]of n.entries()){if(U(t)){let n=t.getTextContent();r.push({index:e,key:t.getKey(),length:n.length,node:t,start:i,text:n,type:`text`}),i+=n.length;continue}if(YD(t)){r.push({index:e,key:t.getKey(),length:1,node:t,start:i,type:`token`}),i+=1;continue}r.push({index:e,key:t.getKey(),length:t.getTextContent().length,node:t,start:i,type:`linebreak`}),i+=t.getTextContent().length}return{descriptors:r,paragraphKey:t.getKey(),paragraphSize:n.length,totalLength:i}}function QD(e){let{descriptors:t,paragraphKey:n,paragraphSize:r,totalLength:i}=ZD(),a=Math.max(0,Math.min(e,i));if(t.length===0)return{key:n,offset:0,type:`element`};for(let e of t){let r=e.start+e.length;if(e.type===`text`&&a>=e.start&&a<=r)return{key:e.key,offset:a-e.start,type:`text`};if(e.type!==`text`){if(a===e.start)return{key:n,offset:e.index,type:`element`};if(a===r){let r=t[e.index+1];return r?.type===`text`&&r.length===0?{key:r.key,offset:0,type:`text`}:{key:n,offset:e.index+1,type:`element`}}}}return{key:n,offset:r,type:`element`}}function $D(e){let{descriptors:t,paragraphKey:n,totalLength:r}=ZD();if(e.key===n){let n=t[e.offset-1];return n?n.start+n.length:0}let i=t.find(t=>t.key===e.key);return i?i.start+Math.min(e.offset,i.length):r}function eO(e){if(e.type===`element`)return $D(e);let{descriptors:t,totalLength:n}=ZD(),r=t.find(t=>t.key===e.key);return r?r.start+Math.min(e.offset,r.length):n}function tO(){let{descriptors:e}=ZD(),t=[],n=``,r=``,i=()=>{n.length!==0&&(t.push({id:r,type:`text`,text:n}),n=``,r=``)};for(let a of e){if(a.type===`text`){n.length===0&&(r=a.key),n+=a.text;continue}if(a.type===`linebreak`){n.length===0&&(r=a.key),n+=`
|
|
16
|
-
`;continue}i();let e=a.node;t.push({id:e.getComposerId(),label:e.getLabel(),tokenKey:e.getTokenKey(),tokenKind:e.getTokenKind(),type:`token`})}return i(),Sg(t)}function nO(e){return e.read(()=>{let e=G(),t=tO();return W(e)?{nodes:t,selection:{start:Math.min(eO(e.anchor),eO(e.focus)),end:Math.max(eO(e.anchor),eO(e.focus))}}:{nodes:t,selection:null}})}function rO(e,t){let n=BC();n.clear();let r=rC();n.append(r);for(let t of Sg(e)){if(t.type===`token`){r.append(JD({composerId:t.id,label:t.label,tokenKey:t.tokenKey,tokenKind:t.tokenKind}));continue}let e=t.text.split(`
|
|
17
|
-
`);for(let[t,n]of e.entries())n.length>0&&r.append(Fx(n)),t<e.length-1&&r.append(_x())}if(YD(r.getLastChild())&&r.append(Fx(``)),!t)return;let i=rS(),a=QD(t.start),o=QD(t.end);i.anchor.set(a.key,a.offset,a.type),i.focus.set(o.key,o.offset,o.type),HC(i)}function iO(e,t,n,r=!1){e.update(()=>{rO(t,n)},{tag:r?[XD,fx]:XD})}function aO(e,t,n=!1){e.update(()=>{let e=rS(),n=QD(t.start),r=QD(t.end);e.anchor.set(n.key,n.offset,n.type),e.focus.set(r.key,r.offset,r.type),HC(e)},{tag:n?[XD,fx]:XD})}function oO(e){return e.reduce((e,t)=>e+yg(t),0)}function sO(e){let{label:t,nodes:n,selection:r,tokenKey:i,tokenKind:a,trigger:o}=e,s=oO(n),[c,l]=r?[Math.min(r.start,r.end),Math.max(r.start,r.end)]:[s,s],u=o?.start??c;return{nodes:jg(n,u,o?.end??l,[vg({label:t,tokenKey:i,tokenKind:a})]),selection:{start:u+1,end:u+1}}}function cO(e){let{label:t,nodes:n,selection:r,tokenKey:i,tokenKind:a,triggerSpecs:o}=e;return Tg(n,a).includes(i)?{nodes:Sg(n),selection:r}:sO({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:a,trigger:Fg(n,r,o??[hg])})}function lO(e){let{item:t,nodes:n,selection:r,triggerSpecs:i}=e,a=t.tokenKind??(t.value?`skill`:void 0),o=t.tokenKey??t.value;if(!a||!o){let e=Fg(n,r,i??[hg]);return e?{nodes:Sg(jg(n,e.start,e.end,[])),selection:{start:e.start,end:e.start}}:{nodes:Sg(n),selection:r}}return cO({label:t.title,nodes:n,selection:r,tokenKey:o,tokenKind:a,triggerSpecs:i})}function uO(e){return e.map(e=>e.type===`text`?`text:${e.text}`:`token:${e.tokenKind}:${e.tokenKey}:${e.label}`).join(``)}function dO(e){let{label:t,nodes:n,selection:r,tokenKey:i}=e;return sO({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:`file`})}function fO(e){let{label:t,nodes:n,selection:r,tokenKey:i}=e;return Tg(n,`skill`).includes(i)?{nodes:Sg(n),selection:r}:sO({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:`skill`,trigger:Ig(n,r)})}function pO(e){let{nextKeys:t,nodes:n,options:r,selection:i}=e,a=Tg(n,`skill`),o=new Map(r.map(e=>[e.key,e])),s=t.find(e=>!a.includes(e));if(s)return fO({label:o.get(s)?.label??s,nodes:n,selection:i,tokenKey:s});let c=a.find(e=>!t.includes(e));return c?{nodes:Mg(n,e=>e.tokenKind===`skill`&&e.tokenKey===c),selection:i}:{nodes:Sg(n),selection:i}}function mO(e){if(e.key!==`Backspace`&&e.key!==`Delete`)return!1;let t=G();if(W(t)&&!t.isCollapsed())return!1;let n=null;if(W(t)){let{anchor:r}=t,i=r.getNode();if(r.type===`element`&&K(i)){let t=e.key===`Backspace`?r.offset-1:r.offset;n=i.getChildAtIndex(t)}else e.key===`Backspace`&&r.offset===0?n=i.getPreviousSibling():e.key===`Delete`&&r.offset===i.getTextContentSize()&&(n=i.getNextSibling())}else if(e.key===`Backspace`){let e=BC().getFirstChild();n=K(e)?e.getLastChild():null}return U(n)&&n.getTextContentSize()===0&&(n=e.key===`Backspace`?n.getPreviousSibling():n.getNextSibling()),YD(n)?(e.preventDefault(),n.remove(),!0):!1}function hO(e){let{canStopGeneration:t,isComposing:n,isSending:r,key:i,shiftKey:a}=e;return n?{type:`noop`}:i===`Escape`?r&&t?{type:`stop-generation`}:{type:`noop`}:i===`Enter`&&!a?{type:`send-message`}:{type:`noop`}}function gO(e){let{actions:t,isComposing:n,nativeEvent:r}=e,i=hO({canStopGeneration:t.canStopGeneration,isComposing:n,isSending:t.isSending,key:r.key,shiftKey:r.shiftKey});switch(i.type!==`noop`&&r.preventDefault(),i.type){case`stop-generation`:return t.onStop(),!0;case`send-message`:return t.onSend(),!0;case`noop`:return!1}}function _O(e){return{current:e}}function vO(e){return e.reduce((e,t)=>e+(t.type===`text`?t.text.length:1),0)}var yO=class{constructor(){this.pendingOwnerSignatureRef=_O(null),this.pendingSelectionRef=_O(null),this.selectionRef=_O(null),this.shouldFocusAfterSyncRef=_O(!1),this.editorSignatureRef=_O(``),this.lastPublishedSignatureRef=_O(``),this.pendingInputSurfaceReasonRef=_O(null),this.editor=null,this.runtime=null,this.configureRuntime=e=>{this.runtime=e},this.bindEditor=e=>{this.editor=e;let t=uO(nO(e.getEditorState()).nodes);return this.editorSignatureRef.current=t,this.lastPublishedSignatureRef.current=t,()=>{this.editor===e&&(this.editor=null)}},this.registerEditorListeners=e=>HT(e.registerUpdateListener(({editorState:e,tags:t})=>{let n=this.getRuntime();this.handleEditorUpdate(e,n.callbacks,t)}),e.registerCommand(Vy,()=>{let t=this.getRuntime();return this.handleSelectionChange(e,t.callbacks),!1},0),e.registerCommand(Tb,()=>(this.getRuntime().callbacks.onInputSurfaceOpenChange?.(!1),!1),0),e.registerCommand(ib,e=>{let t=this.getRuntime();return this.handleKeyDown({actions:t.actions,callbacks:t.callbacks,event:e})},3)),this.syncExternalState=(e,t)=>{if(e.isComposing())return;let n=uO(t),r=this.pendingSelectionRef.current,i=this.pendingOwnerSignatureRef.current;if(i){if(n===i)this.pendingOwnerSignatureRef.current=null;else if(n!==this.editorSignatureRef.current)return}let a=n!==this.editorSignatureRef.current;if(!a&&!r)return;let o=e.getRootElement()!==document.activeElement;if(a?(this.editorSignatureRef.current=n,this.lastPublishedSignatureRef.current=n,iO(e,t,r,o)):r&&aO(e,r,o),r&&(this.selectionRef.current=r,this.pendingSelectionRef.current=null),this.shouldFocusAfterSyncRef.current){this.shouldFocusAfterSyncRef.current=!1;let t=this.selectionRef.current;e.focus(()=>{t&&aO(e,t)})}},this.publishSnapshot=(e,t,n)=>{this.selectionRef.current=e.selection,this.pendingSelectionRef.current=e.selection,n?.focusAfterSync&&(this.shouldFocusAfterSyncRef.current=!0);let r=uO(e.nodes),{editor:i}=this;this.pendingOwnerSignatureRef.current=r,i&&(this.editorSignatureRef.current=r,iO(i,e.nodes,e.selection)),t.onInputSurfaceSnapshotChange?.(e.nodes,e.selection,n?.inputSurfaceReason??{type:`programmatic`}),r!==this.lastPublishedSignatureRef.current&&(this.lastPublishedSignatureRef.current=r,t.onNodesChange(e.nodes))},this.focusComposer=()=>{let{editor:e}=this;if(!e)return;e.getRootElement()?.focus({preventScroll:!0});let t=this.selectionRef.current;t&&aO(e,t),e.focus()},this.focusComposerAtEnd=e=>{let{editor:t}=this;if(!t)return;let n=vO(e??nO(t.getEditorState()).nodes),r={start:n,end:n};if(this.selectionRef.current=r,this.pendingSelectionRef.current=r,t.getRootElement()?.focus({preventScroll:!0}),e){let n=uO(e);this.editorSignatureRef.current=n,this.lastPublishedSignatureRef.current=n,iO(t,e,r)}else aO(t,r);t.focus(()=>{aO(t,r)})},this.readComposerSnapshot=e=>{let{editor:t}=this;if(!t)return{nodes:e,selection:this.selectionRef.current};let n=nO(t.getEditorState());return this.selectionRef.current=n.selection,n},this.createHandle=()=>{let e=(e,t=[hg])=>{let{callbacks:n}=this.getRuntime();n.onInputSurfaceItemSelect?.(e),this.publishRuntimeSnapshot(n=>lO({item:e,nodes:n.nodes,selection:n.selection,triggerSpecs:t}),{focusAfterSync:!0})};return{insertInputSurfaceItem:e,insertSlashItem:t=>{e(t)},insertFileToken:(e,t)=>{this.publishRuntimeSnapshot(n=>dO({label:t,nodes:n.nodes,selection:n.selection,tokenKey:e}),{focusAfterSync:!0})},insertFileTokens:e=>{this.publishRuntimeSnapshot(t=>e.reduce((e,t)=>dO({label:t.label,nodes:e.nodes,selection:e.selection,tokenKey:t.tokenKey}),t),{focusAfterSync:!0})},focusComposer:this.focusComposer,focusComposerAtEnd:this.focusComposerAtEnd,syncSelectedSkills:(e,t)=>{this.publishRuntimeSnapshot(n=>pO({nextKeys:e,nodes:n.nodes,options:t,selection:n.selection}),{focusAfterSync:!0})}}},this.handleKeyDown=e=>{let{actions:t,callbacks:n,event:r}=e,i=r.isComposing||(this.editor?.isComposing()??!1);return r.key.length===1&&!i&&!r.altKey&&!r.ctrlKey&&!r.metaKey?this.pendingInputSurfaceReasonRef.current={type:`insert-text`,text:r.key}:!i&&(r.key===`Backspace`||r.key===`Delete`)?this.pendingInputSurfaceReasonRef.current={type:`delete-content`}:!i&&r.key===`Enter`&&r.shiftKey&&(this.pendingInputSurfaceReasonRef.current={type:`insert-text`,text:`
|
|
18
|
-
`}),n.onInputSurfaceKeyDown?.(r)?(this.pendingInputSurfaceReasonRef.current=null,!0):!i&&mO(r)?!0:gO({actions:t,isComposing:i,nativeEvent:r})},this.handleEditorUpdate=(e,t,n)=>{let r=nO(e),i=uO(r.nodes),a=this.editorSignatureRef.current;this.editorSignatureRef.current=i,!(n.has(`nextclaw-chat-composer-external-update`)&&i===a||this.editor?.isComposing()&&!n.has(`composition-end`))&&(this.selectionRef.current=r.selection,t.onInputSurfaceSnapshotChange?.(r.nodes,r.selection,this.consumeInputSurfaceReason()??{type:`sync`}),i!==this.lastPublishedSignatureRef.current&&(this.lastPublishedSignatureRef.current=i,t.onNodesChange(r.nodes)))},this.handleSelectionChange=(e,t)=>{let n=nO(e.getEditorState());e.isComposing()||(this.selectionRef.current=n.selection,t.onInputSurfaceSnapshotChange?.(n.nodes,n.selection,{type:`selection`}))},this.consumeInputSurfaceReason=()=>{let e=this.pendingInputSurfaceReasonRef.current;return this.pendingInputSurfaceReasonRef.current=null,e},this.publishRuntimeSnapshot=(e,t)=>{let{callbacks:n,fallbackNodes:r}=this.getRuntime();this.publishSnapshot(e(this.readComposerSnapshot(r)),n,t)},this.getRuntime=()=>{if(!this.runtime)throw Error(`ChatComposerLexicalOwner runtime has not been configured.`);return this.runtime}}};function bO({disabled:e,nodes:t,owner:n}){let[r]=nv();return(0,L.useLayoutEffect)(()=>n.bindEditor(r),[r,n]),(0,L.useLayoutEffect)(()=>{r.setEditable(!e),n.syncExternalState(r,t)},[e,r,t,n]),(0,L.useEffect)(()=>n.registerEditorListeners(r),[r,n]),null}var xO=(0,L.forwardRef)(function({actions:e,disabled:t,nodes:n,onFilesAdd:r,onInputSurfaceItemSelect:i,onInputSurfaceKeyDown:a,onInputSurfaceOpenChange:o,onInputSurfaceSnapshotChange:s,onNodesChange:c,placeholder:l},u){let[d]=(0,L.useState)(()=>new yO),f=(0,L.useMemo)(()=>({onInputSurfaceItemSelect:i,onInputSurfaceKeyDown:a,onInputSurfaceOpenChange:o,onInputSurfaceSnapshotChange:s,onNodesChange:c}),[i,a,o,s,c]);return d.configureRuntime({actions:e,callbacks:f,fallbackNodes:n}),(0,L.useImperativeHandle)(u,()=>d.createHandle(),[d]),(0,R.jsxs)(hE,{initialConfig:(0,L.useMemo)(()=>({editable:!t,editorState:()=>{rO(n,null)},namespace:`NextClawChatComposerLexical`,nodes:[qD],onError:e=>{throw e},theme:{}}),[t,n]),children:[(0,R.jsx)(`div`,{className:`px-3 py-2 sm:px-4 sm:py-2.5`,children:(0,R.jsx)(`div`,{className:`min-h-11 sm:min-h-[60px]`,children:(0,R.jsx)(UD,{contentEditable:(0,R.jsx)(lE,{className:`min-h-7 max-h-[188px] w-full overflow-y-auto whitespace-pre-wrap break-words bg-transparent py-0.5 text-sm leading-6 text-foreground outline-none`,onPaste:e=>{let t=Array.from(e.clipboardData.files??[]);t.length>0&&r&&(e.preventDefault(),r(t))}}),placeholder:(0,R.jsx)(`div`,{className:`pointer-events-none absolute left-3 top-2 select-none text-sm leading-6 text-muted-foreground/60 sm:left-4 sm:top-2.5`,children:l}),ErrorBoundary:bE})})}),(0,R.jsx)(bO,{disabled:t,nodes:n,owner:d})]})});xO.displayName=`LexicalChatInputBarTokenizedComposer`;var SO=120;function CO(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=SO?t:`${t.slice(0,SO-1)}…`}function wO({hint:e}){return e?e.loading?(0,R.jsx)(`div`,{className:`px-4 pb-2`,children:(0,R.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-lg border border-border bg-muted px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`h-3 w-28 animate-pulse rounded bg-muted-foreground/20`}),(0,R.jsx)(`span`,{className:`h-3 w-16 animate-pulse rounded bg-muted-foreground/20`})]})}):(0,R.jsx)(`div`,{className:`px-4 pb-2`,children:(0,R.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-lg px-3 py-1.5 text-xs ${e.tone===`warning`?`border-amber-200 bg-amber-50 text-amber-800`:`border-border bg-muted text-muted-foreground`}`,children:[e.text?(0,R.jsx)(`span`,{children:e.text}):null,e.actionLabel&&e.onAction?(0,R.jsx)(`button`,{type:`button`,onClick:e.onAction,className:`font-semibold underline-offset-2 hover:underline`,children:e.actionLabel}):null]})}):null}function TO({sendError:e,sendErrorDetailsLabel:t}){let n=e?.trim()??``;if(!n)return null;let{Popover:r,PopoverContent:i,PopoverTrigger:a}=g_,o=CO(n),s=t?.trim()||`Details`;return(0,R.jsx)(`div`,{className:`px-3 pb-2 sm:px-4`,children:(0,R.jsxs)(`div`,{"aria-live":`polite`,className:`flex min-w-0 items-start justify-between gap-3 rounded-lg border border-red-200/80 bg-red-50/80 px-3 py-2 text-xs text-red-700`,role:`status`,children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate leading-5`,title:n,children:o}),(0,R.jsxs)(r,{children:[(0,R.jsx)(a,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,className:`inline-flex h-7 shrink-0 items-center rounded-md border border-red-200/80 bg-background px-2 text-xs font-medium text-red-700 transition-colors hover:bg-red-100`,children:s})}),(0,R.jsxs)(i,{align:`end`,className:`w-[min(32rem,calc(100vw-1.5rem))] border-red-100/80 p-0`,children:[(0,R.jsx)(`div`,{className:`border-b border-red-100 bg-red-50/80 px-4 py-2 text-xs font-semibold text-red-700`,children:s}),(0,R.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words px-4 py-3 text-xs leading-relaxed text-red-700`,children:n})]})]})]})})}var EO=(0,L.forwardRef)(function({composer:e,hint:t,inputSurface:n,sendError:r,sendErrorDetailsLabel:i,slashMenu:a,surface:o,toolbar:s,topSlot:c},l){let u=(0,L.useRef)(null),d=n??(a?{isLoading:a.isLoading,filterOptions:a.filterOptions,items:a.items,onSelectItem:a.onSelectItem,texts:{loadingLabel:a.texts.slashLoadingLabel,sectionLabel:a.texts.slashSectionLabel,emptyLabel:a.texts.slashEmptyLabel,hintLabel:a.texts.slashHintLabel,itemHintLabel:a.texts.slashSkillHintLabel}}:null),f=(0,L.useMemo)(()=>s.skillPicker?{...s,skillPicker:{...s.skillPicker,onSelectedKeysChange:e=>{u.current?.syncSelectedSkills(e,s.skillPicker?.options??[]),s.skillPicker?.onSelectedKeysChange(e)}}}:s,[s]);return(0,L.useImperativeHandle)(l,()=>({insertFileToken:(e,t)=>u.current?.insertFileToken(e,t),insertFileTokens:e=>u.current?.insertFileTokens(e),focusComposer:()=>u.current?.focusComposer(),focusComposerAtEnd:e=>u.current?.focusComposerAtEnd(e)}),[]),(0,R.jsx)(`div`,{className:o===`embedded`?`bg-transparent px-0 py-0`:`bg-background px-3 pb-3 pt-2 sm:px-4 sm:pb-4 sm:pt-2`,children:(0,R.jsx)(`div`,{className:`nextclaw-chat-input-bar-shell mx-auto w-full max-w-[min(1120px,100%)] [container:nextclaw-chat-input-bar/inline-size]`,children:(0,R.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-card shadow-card`,children:[c?(0,R.jsx)(`div`,{className:`px-3 pb-0 pt-2 sm:px-4 sm:pt-2.5`,children:c}):null,(0,R.jsx)(`div`,{className:`relative`,children:(0,R.jsx)(M_,{inputSurface:d,onInputSurfaceTriggerChange:e.onInputSurfaceTriggerChange,onSelectItem:t=>{if(t.selectionBehavior===`navigate`){d?.onSelectItem?.(t);return}u.current?.insertInputSurfaceItem(t,e.inputSurfaceTriggerSpecs)},triggerSpecs:e.inputSurfaceTriggerSpecs,children:({onInputSurfaceKeyDown:t,onInputSurfaceOpenChange:n,onInputSurfaceSnapshotChange:r})=>(0,R.jsx)(xO,{ref:u,nodes:e.nodes,placeholder:e.placeholder,disabled:e.disabled,onInputSurfaceItemSelect:d?.onSelectItem,actions:s.actions,onNodesChange:e.onNodesChange,onFilesAdd:e.onFilesAdd,onInputSurfaceSnapshotChange:r,onInputSurfaceOpenChange:n,onInputSurfaceKeyDown:t})})}),(0,R.jsx)(wO,{hint:t}),(0,R.jsx)(TO,{sendError:r,sendErrorDetailsLabel:i}),(0,R.jsx)($_,{...f})]})})})});EO.displayName=`ChatInputBar`;function DO({assistantIcon:e,role:t,size:n=`default`}){let r=n===`compact`,i=r?`h-7 w-7`:`h-8 w-8`,a=r?`h-3.5 w-3.5`:`h-4 w-4`;return t===`user`?(0,R.jsx)(`div`,{"data-testid":`chat-message-avatar-user`,className:B(`flex shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-sm`,i),children:(0,R.jsx)(Qs,{className:a})}):t===`tool`?(0,R.jsx)(`div`,{"data-testid":`chat-message-avatar-tool`,className:B(`flex shrink-0 items-center justify-center rounded-full bg-accent text-accent-foreground shadow-sm ring-1 ring-border`,i),children:(0,R.jsx)(tc,{className:a})}):(0,R.jsx)(`div`,{"data-testid":`chat-message-avatar-assistant`,className:B(`flex shrink-0 items-center justify-center rounded-full bg-muted text-foreground shadow-sm ring-1 ring-border`,i),children:e??(0,R.jsx)(So,{className:B(r?`h-4 w-4`:`h-[18px] w-[18px]`,`text-current`),strokeWidth:2.5})})}function OO(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var kO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jO={};function MO(e,t){return((t||jO).jsx?AO:kO).test(e)}var NO=/[ \t\n\f\r]/g;function PO(e){return typeof e==`object`?e.type===`text`?FO(e.value):!1:FO(e)}function FO(e){return e.replace(NO,``)===``}var IO=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};IO.prototype.normal={},IO.prototype.property={},IO.prototype.space=void 0;function LO(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new IO(n,r,t)}function RO(e){return e.toLowerCase()}var zO=class{constructor(e,t){this.attribute=t,this.property=e}};zO.prototype.attribute=``,zO.prototype.booleanish=!1,zO.prototype.boolean=!1,zO.prototype.commaOrSpaceSeparated=!1,zO.prototype.commaSeparated=!1,zO.prototype.defined=!1,zO.prototype.mustUseProperty=!1,zO.prototype.number=!1,zO.prototype.overloadedBoolean=!1,zO.prototype.property=``,zO.prototype.spaceSeparated=!1,zO.prototype.space=void 0;var BO=t({boolean:()=>J,booleanish:()=>HO,commaOrSpaceSeparated:()=>KO,commaSeparated:()=>GO,number:()=>Y,overloadedBoolean:()=>UO,spaceSeparated:()=>WO}),VO=0,J=qO(),HO=qO(),UO=qO(),Y=qO(),WO=qO(),GO=qO(),KO=qO();function qO(){return 2**++VO}var JO=Object.keys(BO),YO=class extends zO{constructor(e,t,n,r){let i=-1;if(super(e,t),XO(this,`space`,r),typeof n==`number`)for(;++i<JO.length;){let e=JO[i];XO(this,JO[i],(n&BO[e])===BO[e])}}};YO.prototype.defined=!0;function XO(e,t,n){n&&(e[t]=n)}function ZO(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new YO(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[RO(r)]=r,n[RO(a.attribute)]=r}return new IO(t,n,e.space)}var QO=ZO({properties:{ariaActiveDescendant:null,ariaAtomic:HO,ariaAutoComplete:null,ariaBusy:HO,ariaChecked:HO,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:WO,ariaCurrent:null,ariaDescribedBy:WO,ariaDetails:null,ariaDisabled:HO,ariaDropEffect:WO,ariaErrorMessage:null,ariaExpanded:HO,ariaFlowTo:WO,ariaGrabbed:HO,ariaHasPopup:null,ariaHidden:HO,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:WO,ariaLevel:Y,ariaLive:null,ariaModal:HO,ariaMultiLine:HO,ariaMultiSelectable:HO,ariaOrientation:null,ariaOwns:WO,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:HO,ariaReadOnly:HO,ariaRelevant:null,ariaRequired:HO,ariaRoleDescription:WO,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:HO,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function $O(e,t){return t in e?e[t]:t}function ek(e,t){return $O(e,t.toLowerCase())}var tk=ZO({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:GO,acceptCharset:WO,accessKey:WO,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:WO,autoFocus:J,autoPlay:J,blocking:WO,capture:null,charSet:null,checked:J,cite:null,className:WO,cols:Y,colSpan:null,content:null,contentEditable:HO,controls:J,controlsList:WO,coords:Y|GO,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:UO,draggable:HO,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:WO,height:Y,hidden:UO,high:Y,href:null,hrefLang:null,htmlFor:WO,httpEquiv:WO,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:WO,itemRef:WO,itemScope:J,itemType:WO,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:J,optimum:Y,pattern:null,ping:WO,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:WO,required:J,reversed:J,rows:Y,rowSpan:Y,sandbox:WO,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:HO,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:HO,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:WO,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:HO,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:J,disableRemotePlayback:J,prefix:null,property:null,results:Y,security:null,unselectable:null},space:`html`,transform:ek}),nk=ZO({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:KO,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:WO,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:GO,g2:GO,glyphName:GO,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:KO,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:WO,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:KO,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:KO,rev:KO,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:KO,requiredFeatures:KO,requiredFonts:KO,requiredFormats:KO,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:KO,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:KO,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:KO,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:$O}),rk=ZO({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ik=ZO({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ek}),ak=ZO({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ok={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},sk=/[A-Z]/g,ck=/-[a-z]/g,lk=/^data[-\w.:]+$/i;function uk(e,t){let n=RO(t),r=t,i=zO;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&lk.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ck,fk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ck.test(e)){let n=e.replace(sk,dk);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=YO}return new i(r,t)}function dk(e){return`-`+e.toLowerCase()}function fk(e){return e.charAt(1).toUpperCase()}var pk=LO([QO,tk,rk,ik,ak],`html`),mk=LO([QO,nk,rk,ik,ak],`svg`);function hk(e){return e.join(` `).trim()}var gk=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
19
|
-
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),_k=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(gk());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),vk=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),yk=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(_k()),r=vk();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),bk=Sk(`end`),xk=Sk(`start`);function Sk(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Ck(e){let t=xk(e),n=bk(e);if(t&&n)return{start:t,end:n}}function wk(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Ek(e.position):`start`in e||`end`in e?Ek(e):`line`in e||`column`in e?Tk(e):``}function Tk(e){return Dk(e&&e.line)+`:`+Dk(e&&e.column)}function Ek(e){return Tk(e&&e.start)+`-`+Tk(e&&e.end)}function Dk(e){return e&&typeof e==`number`?e:1}var Ok=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=wk(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Ok.prototype.file=``,Ok.prototype.name=``,Ok.prototype.reason=``,Ok.prototype.message=``,Ok.prototype.stack=``,Ok.prototype.column=void 0,Ok.prototype.line=void 0,Ok.prototype.ancestors=void 0,Ok.prototype.cause=void 0,Ok.prototype.fatal=void 0,Ok.prototype.place=void 0,Ok.prototype.ruleId=void 0,Ok.prototype.source=void 0;var kk=e(yk(),1),Ak={}.hasOwnProperty,jk=new Map,Mk=/[A-Z]/g,Nk=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Pk=new Set([`td`,`th`]),Fk=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ik(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=qk(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Kk(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?mk:pk,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Lk(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Lk(e,t,n){if(t.type===`element`)return Rk(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return zk(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Vk(e,t,n);if(t.type===`mdxjsEsm`)return Bk(e,t);if(t.type===`root`)return Hk(e,t,n);if(t.type===`text`)return Uk(e,t)}function Rk(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=mk,e.schema=i),e.ancestors.push(t);let a=$k(e,t.tagName,!1),o=Jk(e,t),s=Xk(e,t);return Nk.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!PO(e):!0})),Wk(e,o,a,t),Gk(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function zk(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}eA(e,t.position)}function Bk(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);eA(e,t.position)}function Vk(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=mk,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:$k(e,t.name,!0),o=Yk(e,t),s=Xk(e,t);return Wk(e,o,a,t),Gk(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Hk(e,t,n){let r={};return Gk(r,Xk(e,t)),e.create(t,e.Fragment,r,n)}function Uk(e,t){return t.value}function Wk(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gk(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Kk(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function qk(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=xk(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Jk(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ak.call(t.properties,i)){let a=Zk(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Pk.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Yk(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else eA(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else eA(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Xk(e,t){let n=[],r=-1,i=e.passKeys?new Map:jk;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Lk(e,a,o);s!==void 0&&n.push(s)}return n}function Zk(e,t,n){let r=uk(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?OO(n):hk(n)),r.property===`style`){let t=typeof n==`object`?n:Qk(e,String(n));return e.stylePropertyNameCase===`css`&&(t=tA(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?ok[r.property]||r.property:r.attribute,n]}}function Qk(e,t){try{return(0,kk.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Ok("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Fk+`#cannot-parse-style-attribute`,r}}function $k(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=MO(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=MO(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ak.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);eA(e)}function eA(e,t){let n=new Ok("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Fk+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function tA(e){let t={},n;for(n in e)Ak.call(e,n)&&(t[nA(n)]=e[n]);return t}function nA(e){let t=e.replace(Mk,rA);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function rA(e){return`-`+e.toLowerCase()}var iA={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},aA={};function oA(e,t){let n=t||aA;return sA(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function sA(e,t,n){if(lA(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return cA(e.children,t,n)}return Array.isArray(e)?cA(e,t,n):``}function cA(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=sA(e[i],t,n);return r.join(``)}function lA(e){return!!(e&&typeof e==`object`)}var uA=document.createElement(`i`);function dA(e){let t=`&`+e+`;`;uA.innerHTML=t;let n=uA.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function fA(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function pA(e,t){return e.length>0?(fA(e,e.length,0,t),e):t}var mA={}.hasOwnProperty;function hA(e){let t={},n=-1;for(;++n<e.length;)gA(t,e[n]);return t}function gA(e,t){let n;for(n in t){let r=(mA.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){mA.call(r,a)||(r[a]=[]);let e=i[a];_A(r[a],Array.isArray(e)?e:e?[e]:[])}}}function _A(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);fA(e,0,0,r)}function vA(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function yA(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var bA=AA(/[A-Za-z]/),xA=AA(/[\dA-Za-z]/),SA=AA(/[#-'*+\--9=?A-Z^-~]/);function CA(e){return e!==null&&(e<32||e===127)}var wA=AA(/\d/),TA=AA(/[\dA-Fa-f]/),EA=AA(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function DA(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var OA=AA(/\p{P}|\p{S}/u),kA=AA(/\s/);function AA(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function jA(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&xA(e.charCodeAt(n+1))&&xA(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var MA={tokenize:NA};function NA(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return X(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var PA={tokenize:IA},FA={tokenize:LA};function IA(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return fA(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(FA,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(FA,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return X(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;fA(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function LA(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function RA(e){if(e===null||DA(e)||kA(e))return 1;if(OA(e))return 2}function zA(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var BA={name:`attention`,resolveAll:VA,tokenize:HA};function VA(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};UA(d,-c),UA(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=pA(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=pA(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=pA(l,zA(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=pA(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=pA(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,fA(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function HA(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=RA(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=RA(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function UA(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var WA={name:`autolink`,tokenize:GA};function GA(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return bA(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||xA(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||xA(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||CA(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):SA(t)?(e.consume(t),l):n(t)}function u(e){return xA(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||xA(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var KA={partial:!0,tokenize:qA};function qA(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||X(e)?t(e):n(e)}}var JA={continuation:{tokenize:XA},exit:ZA,name:`blockQuote`,tokenize:YA};function YA(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function XA(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(JA,t,n)(r)}}function ZA(e){e.exit(`blockQuote`)}var QA={name:`characterEscape`,tokenize:$A};function $A(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return EA(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var ej={name:`characterReference`,tokenize:tj};function tj(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=xA,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=TA,u):(e.enter(`characterReferenceValue`),a=7,o=wA,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===xA&&!dA(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var nj={partial:!0,tokenize:aj},rj={concrete:!0,name:`codeFenced`,tokenize:ij};function ij(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||X(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(nj,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||X(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||X(t)?e.check(nj,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||X(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||X(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function aj(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var oj={name:`codeIndented`,tokenize:cj},sj={partial:!0,tokenize:lj};function cj(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):X(t)?e.attempt(sj,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||X(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function lj(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):X(e)?i(e):n(e)}}var uj={name:`codeText`,previous:fj,resolve:dj,tokenize:pj};function dj(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function fj(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function pj(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||X(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var mj=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&hj(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),hj(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),hj(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);hj(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);hj(this.left,t.reverse())}}};function hj(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function gj(e){let t={},n=-1,r,i,a,o,s,c,l,u=new mj(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,_j(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return fA(e,0,1/0,u.slice(0)),!l}function _j(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var vj={resolve:bj,tokenize:xj},yj={partial:!0,tokenize:Sj};function bj(e){return gj(e),e}function xj(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):X(t)?e.check(yj,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Sj(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||X(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Cj(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||CA(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||X(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||DA(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||CA(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function wj(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):X(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||X(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Tj(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||X(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Ej(e,t){let n;return r;function r(i){return X(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Dj={name:`definition`,tokenize:kj},Oj={partial:!0,tokenize:Aj};function kj(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return wj.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=yA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return DA(t)?Ej(e,l)(t):l(t)}function l(t){return Cj(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Oj,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||X(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Aj(e,t,n){return r;function r(t){return DA(t)?Ej(e,i)(t):n(t)}function i(t){return Tj(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||X(e)?t(e):n(e)}}var jj={name:`hardBreakEscape`,tokenize:Mj};function Mj(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return X(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Nj={name:`headingAtx`,resolve:Pj,tokenize:Fj};function Pj(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},fA(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Fj(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||DA(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||X(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||DA(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Ij=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Lj=[`pre`,`script`,`style`,`textarea`],Rj={concrete:!0,name:`htmlFlow`,resolveTo:Vj,tokenize:Hj},zj={partial:!0,tokenize:Wj},Bj={partial:!0,tokenize:Uj};function Vj(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Hj(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ne):bA(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):bA(a)?(e.consume(a),i=4,r.interrupt?t:ne):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ne):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return bA(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||DA(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Lj.includes(l)?(i=1,r.interrupt?t(s):O(s)):Ij.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||xA(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||bA(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||xA(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||X(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||DA(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||X(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),ne):t===93&&i===5?(e.consume(t),te):X(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(zj,ie,k)(t)):t===null||X(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Bj,A,ie)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||X(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),ne):O(t)}function M(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return Lj.includes(n)?(e.consume(t),re):O(t)}return bA(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),ne):O(t)}function ne(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),ne):O(t)}function re(t){return t===null||X(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function Uj(e,t,n){let r=this;return i;function i(t){return X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Wj(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(KA,t,n)}}var Gj={name:`htmlText`,tokenize:Kj};function Kj(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):bA(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):bA(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):X(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):X(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):X(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):X(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return bA(t)?(e.consume(t),S):n(t)}function S(t){return t===45||xA(t)?(e.consume(t),S):C(t)}function C(t){return X(t)?(o=C,M(t)):Z(t)?(e.consume(t),C):j(t)}function w(t){return t===45||xA(t)?(e.consume(t),w):t===47||t===62||DA(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||bA(t)?(e.consume(t),E):X(t)?(o=T,M(t)):Z(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||xA(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):X(t)?(o=D,M(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):X(t)?(o=O,M(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):X(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||DA(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||DA(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return Z(t)?Q(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var qj={name:`labelEnd`,resolveAll:Zj,resolveTo:Qj,tokenize:$j},Jj={tokenize:eM},Yj={tokenize:tM},Xj={tokenize:nM};function Zj(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&fA(e,0,e.length,n),e}function Qj(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=pA(s,e.slice(a+1,a+r+3)),s=pA(s,[[`enter`,u,t]]),s=pA(s,zA(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=pA(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=pA(s,e.slice(o+1)),s=pA(s,[[`exit`,c,t]]),fA(e,a,e.length,s),e}function $j(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(yA(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Jj,u,o?u:d)(t):t===91?e.attempt(Yj,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Xj,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function eM(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return DA(t)?Ej(e,a)(t):a(t)}function a(t){return t===41?u(t):Cj(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return DA(t)?Ej(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Tj(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return DA(t)?Ej(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function tM(e,t,n){let r=this;return i;function i(t){return wj.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(yA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function nM(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var rM={name:`labelStartImage`,resolveAll:qj.resolveAll,tokenize:iM};function iM(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var aM={name:`labelStartLink`,resolveAll:qj.resolveAll,tokenize:oM};function oM(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var sM={name:`lineEnding`,tokenize:cM};function cM(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var lM={name:`thematicBreak`,tokenize:uM};function uM(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||X(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}var dM={continuation:{tokenize:hM},exit:_M,name:`list`,tokenize:mM},fM={partial:!0,tokenize:vM},pM={partial:!0,tokenize:gM};function mM(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:wA(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(lM,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return wA(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(KA,r.interrupt?n:u,e.attempt(fM,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function hM(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(KA,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pM,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(dM,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function gM(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function _M(e){e.exit(this.containerState.type)}function vM(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var yM={name:`setextUnderline`,resolveTo:bM,tokenize:xM};function bM(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function xM(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||X(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var SM={tokenize:CM};function CM(e){let t=this,n=e.attempt(KA,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vj,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var wM={resolveAll:OM()},TM=DM(`string`),EM=DM(`text`);function DM(e){return{resolveAll:OM(e===`text`?kM:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function OM(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function kM(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var AM=t({attentionMarkers:()=>RM,contentInitial:()=>MM,disable:()=>zM,document:()=>jM,flow:()=>PM,flowInitial:()=>NM,insideSpan:()=>LM,string:()=>FM,text:()=>IM}),jM={42:dM,43:dM,45:dM,48:dM,49:dM,50:dM,51:dM,52:dM,53:dM,54:dM,55:dM,56:dM,57:dM,62:JA},MM={91:Dj},NM={[-2]:oj,[-1]:oj,32:oj},PM={35:Nj,42:lM,45:[yM,lM],60:Rj,61:yM,95:lM,96:rj,126:rj},FM={38:ej,92:QA},IM={[-5]:sM,[-4]:sM,[-3]:sM,33:rM,38:ej,42:BA,60:[WA,Gj],91:aM,92:[jj,QA],93:qj,95:BA,96:uj},LM={null:[BA,wM]},RM={null:[42,95]},zM={null:[]};function BM(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=pA(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=zA(a,l.events,l),l.events):[]}function f(e,t){return HM(p(e),t)}function p(e){return VM(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){X(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&fA(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function VM(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function HM(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
20
|
-
`;break;case-3:o=`\r
|
|
21
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function UM(e){let t={constructs:hA([AM,...(e||{}).extensions||[]]),content:n(MA),defined:[],document:n(PA),flow:n(SM),lazy:{},string:n(TM),text:n(EM)};return t;function n(e){return n;function n(n){return BM(t,e,n)}}}function WM(e){for(;!gj(e););return e}var GM=/[\0\t\n\r]/g;function KM(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(GM.lastIndex=u,c=GM.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var qM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JM(e){return e.replace(qM,YM)}function YM(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return vA(n.slice(t?2:1),t?16:10)}return dA(n)||e}var XM={}.hasOwnProperty;function ZM(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),QM(n)(WM(UM(n).document().write(KM()(e,t,!0))))}function QM(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(P),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(_e),blockQuote:a(fe),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(me,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(he),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ge),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a(ye,o),htmlFlowData:T,htmlText:a(ye,o),htmlTextData:T,image:a(be),label:o,link:a(P),listItem:a(Se),listItemValue:f,listOrdered:a(xe,d),listUnordered:a(xe),paragraph:a(Ce),reference:ae,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(we),thematicBreak:a(Ee)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:te,labelText:N,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:ne,resourceTitleString:re,resource:ie,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};eN(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];XM.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||nN).call(a,void 0,e[0])}for(r.position={start:$M(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:$M(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:$M(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||nN).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+wk({start:e.start,end:e.end})+`): it’s not open`);n.position.end=$M(e.end)}function u(){return oA(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=yA(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Te(),n.position={start:$M(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=$M(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=$M(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=JM(t),n.identifier=yA(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=yA(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=vA(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=dA(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=$M(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[]}}function pe(){return{type:`code`,lang:null,meta:null,value:``}}function me(){return{type:`inlineCode`,value:``}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ge(){return{type:`emphasis`,children:[]}}function _e(){return{type:`heading`,depth:0,children:[]}}function ve(){return{type:`break`}}function ye(){return{type:`html`,value:``}}function be(){return{type:`image`,title:null,url:``,alt:null}}function P(){return{type:`link`,title:null,url:``,children:[]}}function xe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Se(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ce(){return{type:`paragraph`,children:[]}}function we(){return{type:`strong`,children:[]}}function Te(){return{type:`text`,value:``}}function Ee(){return{type:`thematicBreak`}}}function $M(e){return{line:e.line,column:e.column,offset:e.offset}}function eN(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?eN(e,r):tN(e,r)}}function tN(e,t){let n;for(n in t)if(XM.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function nN(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+wk({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wk({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+wk({start:t.start,end:t.end})+`) is still open`)}function rN(e){let t=this;t.parser=n;function n(n){return ZM(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function iN(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function aN(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
22
|
-
`}]}function oN(e,t){let n=t.value?t.value+`
|
|
23
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function sN(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cN(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lN(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=jA(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function uN(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dN(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function fN(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function pN(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fN(e,t);let i={src:jA(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function mN(e,t){let n={src:jA(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function hN(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function gN(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fN(e,t);let i={href:jA(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function _N(e,t){let n={href:jA(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vN(e,t,n){let r=e.all(t),i=n?yN(n):bN(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
24
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
25
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function yN(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=bN(n[r])}return t}function bN(e){return e.spread??e.children.length>1}function xN(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function SN(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CN(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function wN(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TN(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=xk(t.children[1]),o=bk(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function EN(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function DN(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var ON=9,kN=32;function AN(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(jN(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(jN(t.slice(i),i>0,!1)),a.join(``)}function jN(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===ON||t===kN;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===ON||t===kN;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function MN(e,t){let n={type:`text`,value:AN(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function NN(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var PN={blockquote:iN,break:aN,code:oN,delete:sN,emphasis:cN,footnoteReference:lN,heading:uN,html:dN,imageReference:pN,image:mN,inlineCode:hN,linkReference:gN,link:_N,listItem:vN,list:xN,paragraph:SN,root:CN,strong:wN,table:TN,tableCell:DN,tableRow:EN,text:MN,thematicBreak:NN,toml:FN,yaml:FN,definition:FN,footnoteDefinition:FN};function FN(){}var IN=typeof self==`object`?self:globalThis,LN=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new IN[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new IN[a](o),i)};return r},RN=e=>LN(new Map,e)(0),zN=``,{toString:BN}={},{keys:VN}=Object,HN=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=BN.call(e).slice(8,-1);switch(n){case`Array`:return[1,zN];case`Object`:return[2,zN];case`Date`:return[3,zN];case`RegExp`:return[4,zN];case`Map`:return[5,zN];case`Set`:return[6,zN];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},UN=([e,t])=>e===0&&(t===`function`||t===`symbol`),WN=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=HN(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of VN(r))(e||!UN(HN(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(UN(HN(n))||UN(HN(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!UN(HN(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},GN=(e,{json:t,lossy:n}={})=>{let r=[];return WN(!(t||n),!!t,new Map,r)(e),r},KN=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?RN(GN(e,t)):structuredClone(e):(e,t)=>RN(GN(e,t));function qN(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function JN(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function YN(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||qN,r=e.options.footnoteBackLabel||JN,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=jA(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...KN(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
26
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
27
|
-
`}]}}var XN=(function(e){if(e==null)return tP;if(typeof e==`function`)return eP(e);if(typeof e==`object`)return Array.isArray(e)?ZN(e):QN(e);if(typeof e==`string`)return $N(e);throw Error(`Expected function, string, or object as test`)});function ZN(e){let t=[],n=-1;for(;++n<e.length;)t[n]=XN(e[n]);return eP(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function QN(e){let t=e;return eP(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function $N(e){return eP(t);function t(t){return t&&t.type===e}}function eP(e){return t;function t(t,n,r){return!!(nP(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function tP(){return!0}function nP(e){return typeof e==`object`&&!!e&&`type`in e}function rP(e){return e}var iP=[];function aP(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=XN(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+rP(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=iP,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=oP(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function oP(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?iP:[e]}function sP(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),aP(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var cP={}.hasOwnProperty,lP={};function uP(e,t){let n=t||lP,r=new Map,i=new Map,a={all:s,applyData:fP,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...PN,...n.handlers},one:o,options:n,patch:dP,wrap:mP};return sP(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(cP.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=KN(n);return r.children=a.all(e),r}return KN(e)}return(a.options.unknownHandler||pP)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=hP(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=hP(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function dP(e,t){e.position&&(t.position=Ck(e))}function fP(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,KN(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function pP(e,t){let n=t.data||{},r=`value`in t&&!(cP.call(n,`hProperties`)||cP.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mP(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
28
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
29
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
30
|
-
`}),n}function hP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function gP(e,t){let n=uP(e,t),r=n.one(e,void 0),i=YN(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
31
|
-
`},i)),a}function _P(e,t){return e&&`run`in e?async function(n,r){let i=gP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return gP(n,{file:r,...e||t})}}function vP(e){if(e)throw e}var yP=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function bP(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function xP(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?SP(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function SP(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var CP={basename:wP,dirname:TP,extname:EP,join:DP,sep:`/`};function wP(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);AP(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function TP(e){if(AP(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function EP(e){AP(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function DP(...e){let t=-1,n;for(;++t<e.length;)AP(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:OP(n)}function OP(e){AP(e);let t=e.codePointAt(0)===47,n=kP(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function kP(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function AP(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var jP={cwd:MP};function MP(){return`/`}function NP(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function PP(e){if(typeof e==`string`)e=new URL(e);else if(!NP(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return FP(e)}function FP(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var IP=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],LP=class{constructor(e){let t;t=e?NP(e)?{path:e}:typeof e==`string`||VP(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:jP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<IP.length;){let e=IP[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)IP.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?CP.basename(this.path):void 0}set basename(e){zP(e,`basename`),RP(e,`basename`),this.path=CP.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?CP.dirname(this.path):void 0}set dirname(e){BP(this.basename,`dirname`),this.path=CP.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?CP.extname(this.path):void 0}set extname(e){if(RP(e,`extname`),BP(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=CP.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){NP(e)&&(e=PP(e)),zP(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?CP.basename(this.path,this.extname):void 0}set stem(e){zP(e,`stem`),RP(e,`stem`),this.path=CP.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Ok(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function RP(e,t){if(e&&e.includes(CP.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+CP.sep+"`")}function zP(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function BP(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function VP(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var HP=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),UP=e(yP(),1),WP={}.hasOwnProperty,GP=new class e extends HP{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=xP()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,UP.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(JP(`data`,this.frozen),this.namespace[e]=t,this):WP.call(this.namespace,e)&&this.namespace[e]||void 0:e?(JP(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=ZP(e),n=this.parser||this.Parser;return KP(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),KP(`process`,this.parser||this.Parser),qP(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ZP(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);$P(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),KP(`processSync`,this.parser||this.Parser),qP(`processSync`,this.compiler||this.Compiler),this.process(e,r),XP(`processSync`,`process`,t),n;function r(e,r){t=!0,vP(e),n=r}}run(e,t,n){YP(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=ZP(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),XP(`runSync`,`run`,n),r;function i(e,t){vP(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ZP(t),r=this.compiler||this.Compiler;return qP(`stringify`,r),YP(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(JP(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,UP.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];bP(o)&&bP(r)&&(r=(0,UP.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function KP(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function qP(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function JP(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function YP(e){if(!bP(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function XP(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ZP(e){return QP(e)?e:new LP(e)}function QP(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function $P(e){return typeof e==`string`||eF(e)}function eF(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var tF=[],nF={allowDangerousHtml:!0},rF=/^(https?|ircs?|mailto|xmpp)$/i,iF=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function aF(e){let t=oF(e),n=sF(e);return cF(t.runSync(t.parse(n),n),e)}function oF(e){let t=e.rehypePlugins||tF,n=e.remarkPlugins||tF,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nF}:nF;return GP().use(rN).use(n).use(_P,r).use(t)}function sF(e){let t=e.children||``,n=new LP;return typeof t==`string`?n.value=t:``+t,n}function cF(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||lF;for(let e of iF)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return sP(e,l),Ik(e,{Fragment:R.Fragment,components:i,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in iA)if(Object.hasOwn(iA,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=iA[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function lF(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||rF.test(e.slice(0,t))?e:``}function uF(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function dF(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function fF(e,t,n){let r=XN((n||{}).ignore||[]),i=pF(t),a=-1;for(;++a<i.length;)aP(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function pF(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([mF(e[0]),hF(e[1])])}return t}function mF(e){return typeof e==`string`?new RegExp(dF(e),`g`):e}function hF(e){return typeof e==`function`?e:function(){return e}}var gF=`phrasing`,_F=[`autolink`,`link`,`image`,`label`];function vF(){return{transforms:[EF],enter:{literalAutolink:bF,literalAutolinkEmail:xF,literalAutolinkHttp:xF,literalAutolinkWww:xF},exit:{literalAutolink:TF,literalAutolinkEmail:wF,literalAutolinkHttp:SF,literalAutolinkWww:CF}}}function yF(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:gF,notInConstruct:_F},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:gF,notInConstruct:_F},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:gF,notInConstruct:_F}]}}function bF(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function xF(e){this.config.enter.autolinkProtocol.call(this,e)}function SF(e){this.config.exit.autolinkProtocol.call(this,e)}function CF(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function wF(e){this.config.exit.autolinkEmail.call(this,e)}function TF(e){this.exit(e)}function EF(e){fF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,DF],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,OF]],{ignore:[`link`,`linkReference`]})}function DF(e,t,n,r,i){let a=``;if(!jF(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!kF(n)))return!1;let o=AF(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function OF(e,t,n,r){return!jF(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function kF(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function AF(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=uF(e,`(`),a=uF(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function jF(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||kA(n)||OA(n))&&(!t||n!==47)}VF.peek=BF;function MF(){this.buffer()}function NF(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function PF(){this.buffer()}function FF(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function IF(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LF(e){this.exit(e)}function RF(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zF(e){this.exit(e)}function BF(){return`[`}function VF(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function HF(){return{enter:{gfmFootnoteCallString:MF,gfmFootnoteCall:NF,gfmFootnoteDefinitionLabelString:PF,gfmFootnoteDefinition:FF},exit:{gfmFootnoteCallString:IF,gfmFootnoteCall:LF,gfmFootnoteDefinitionLabelString:RF,gfmFootnoteDefinition:zF}}}function UF(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:VF},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
32
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?GF:WF))),s(),o}}function WF(e,t,n){return t===0?e:GF(e,t,n)}function GF(e,t,n){return(n?``:` `)+e}var KF=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];ZF.peek=QF;function qF(){return{canContainEols:[`delete`],enter:{strikethrough:YF},exit:{strikethrough:XF}}}function JF(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:KF}],handlers:{delete:ZF}}}function YF(e){this.enter({type:`delete`,children:[]},e)}function XF(e){this.exit(e)}function ZF(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function QF(){return`~`}function $F(e){return e.length}function eI(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||$F,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=tI(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=nI(r[d]);else{let e=nI(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
33
|
-
`)}function tI(e){return e==null?``:String(e)}function nI(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function rI(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),iI);return i(),o}function iI(e,t,n){return`>`+(n?``:` `)+e}function aI(e,t){return oI(e,t.inConstruct,!0)&&!oI(e,t.notInConstruct,!1)}function oI(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function sI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
34
|
-
`&&aI(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
35
|
-
`}function cI(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function lI(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function uI(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function dI(e,t,n,r){let i=uI(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(lI(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,fI);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(cI(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
36
|
-
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
37
|
-
`),a&&(u+=s.move(a+`
|
|
38
|
-
`)),u+=s.move(c),l(),u}function fI(e,t,n){return(n?``:` `)+e}function pI(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function mI(e,t,n,r){let i=pI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
39
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function hI(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function gI(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function _I(e,t,n){let r=RA(e),i=RA(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vI.peek=yI;function vI(e,t,n,r){let i=hI(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=_I(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=gI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=_I(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+gI(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function yI(e,t,n){return n.options.emphasis||`*`}function bI(e,t){let n=!1;return sP(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&oA(e)&&(t.options.setext||n))}function xI(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(bI(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
40
|
-
`,after:`
|
|
41
|
-
`});return r(),t(),o+`
|
|
42
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
43
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
44
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=gI(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}SI.peek=CI;function SI(e){return e.value||``}function CI(){return`<`}wI.peek=TI;function wI(e,t,n,r){let i=pI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function TI(){return`!`}EI.peek=DI;function EI(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function DI(){return`!`}OI.peek=kI;function OI(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function kI(){return"`"}function AI(e,t){let n=oA(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}jI.peek=MI;function jI(e,t,n,r){let i=pI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(AI(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function MI(e,t,n){return AI(e,n)?`<`:`[`}NI.peek=PI;function NI(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function PI(){return`[`}function FI(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function II(e){let t=FI(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function LI(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function RI(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function zI(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?LI(n):FI(n),s=e.ordered?o===`.`?`)`:`.`:II(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),RI(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function BI(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function VI(e,t,n,r){let i=BI(n),a=n.bulletCurrent||FI(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function HI(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var UI=XN([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function WI(e,t,n,r){return(e.children.some(function(e){return UI(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function GI(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}KI.peek=qI;function KI(e,t,n,r){let i=GI(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=_I(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=gI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=_I(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+gI(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function qI(e,t,n){return n.options.strong||`*`}function JI(e,t,n,r){return n.safe(e.value,r)}function YI(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function XI(e,t,n){let r=(RI(n)+(n.options.ruleSpaces?` `:``)).repeat(YI(n));return n.options.ruleSpaces?r.slice(0,-1):r}var ZI={blockquote:rI,break:sI,code:dI,definition:mI,emphasis:vI,hardBreak:sI,heading:xI,html:SI,image:wI,imageReference:EI,inlineCode:OI,link:jI,linkReference:NI,list:zI,listItem:VI,paragraph:HI,root:WI,strong:KI,text:JI,thematicBreak:XI};function QI(){return{enter:{table:$I,tableData:rL,tableHeader:rL,tableRow:tL},exit:{codeText:iL,table:eL,tableData:nL,tableHeader:nL,tableRow:nL}}}function $I(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function eL(e){this.exit(e),this.data.inTable=void 0}function tL(e){this.enter({type:`tableRow`,children:[]},e)}function nL(e){this.exit(e)}function rL(e){this.enter({type:`tableCell`,children:[]},e)}function iL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,aL));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function aL(e,t){return t===`|`?t:e}function oL(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
45
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
46
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return eI(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=ZI.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function sL(){return{exit:{taskListCheckValueChecked:lL,taskListCheckValueUnchecked:lL,paragraph:uL}}}function cL(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:dL}}}function lL(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function uL(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function dL(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=ZI.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function fL(){return[vF(),HF(),qF(),QI(),sL()]}function pL(e){return{extensions:[yF(),UF(e),JF(),oL(e),cL()]}}var mL={tokenize:OL,partial:!0},hL={tokenize:kL,partial:!0},gL={tokenize:AL,partial:!0},_L={tokenize:jL,partial:!0},vL={tokenize:ML,partial:!0},yL={name:`wwwAutolink`,tokenize:EL,previous:NL},bL={name:`protocolAutolink`,tokenize:DL,previous:PL},xL={name:`emailAutolink`,tokenize:TL,previous:FL},SL={};function CL(){return{text:SL}}for(var wL=48;wL<123;)SL[wL]=xL,wL++,wL===58?wL=65:wL===91&&(wL=97);SL[43]=xL,SL[45]=xL,SL[46]=xL,SL[95]=xL,SL[72]=[xL,bL],SL[104]=[xL,bL],SL[87]=[xL,yL],SL[119]=[xL,yL];function TL(e,t,n){let r=this,i,a;return o;function o(t){return!IL(t)||!FL.call(r,r.previous)||LL(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return IL(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(vL,u,l)(t):t===45||t===95||xA(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&bA(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function EL(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!NL.call(r,r.previous)||LL(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(mL,e.attempt(hL,e.attempt(gL,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function DL(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&PL.call(r,r.previous)&&!LL(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(bA(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||CA(t)||DA(t)||kA(t)||OA(t)?n(t):e.attempt(hL,e.attempt(gL,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function OL(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function kL(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(_L,c,s)(t):t===null||DA(t)||kA(t)||t!==45&&OA(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function AL(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(_L,t,a)(o):o===null||DA(o)||kA(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function jL(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||DA(o)||kA(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||DA(e)||kA(e)?t(e):r(e)}function a(e){return bA(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):bA(t)?(e.consume(t),o):n(t)}}function ML(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return xA(e)?n(e):t(e)}}function NL(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||DA(e)}function PL(e){return!bA(e)}function FL(e){return!(e===47||IL(e))}function IL(e){return e===43||e===45||e===46||e===95||xA(e)}function LL(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var RL={tokenize:KL,partial:!0};function zL(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:UL,continuation:{tokenize:WL},exit:GL}},text:{91:{name:`gfmFootnoteCall`,tokenize:HL},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:BL,resolveTo:VL}}}}function BL(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=yA(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function VL(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function HL(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||DA(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(yA(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return DA(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function UL(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||DA(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=yA(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return DA(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function WL(e,t,n){return e.check(KA,t,e.attempt(RL,t,n))}function GL(e){e.exit(`gfmFootnoteDefinition`)}function KL(e,t,n){let r=this;return Q(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function qL(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&fA(o,o.length,0,zA(s,e.slice(r+1,n),t)),fA(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),fA(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=RA(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=RA(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var JL=class{constructor(){this.map=[]}add(e,t,n){YL(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function YL(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function XL(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ZL(){return{flow:{null:{name:`table`,tokenize:QL,resolveAll:$L}}}}function QL(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):X(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Q(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||DA(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Q(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Q(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||X(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||X(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||X(n)?(e.exit(`tableRow`),t(n)):Z(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||DA(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function $L(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new JL;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(tR(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=eR(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=eR(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=eR(f,t,o,i,n,d)):(o[0]=o[1],d=eR(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&tR(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=XL(t.events,n))}return e}function eR(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},nR(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=nR(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=nR(t.events,n[2]),a=nR(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},nR(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function tR(e,t,n,r,i){let a=[],o=nR(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function nR(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var rR={name:`tasklistCheck`,tokenize:aR};function iR(){return{text:{91:rR}}}function aR(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return DA(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return X(r)?t(r):Z(r)?e.check({tokenize:oR},t,n)(r):n(r)}}function oR(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function sR(e){return hA([CL(),zL(),qL(e),ZL(),iR()])}var cR={};function lR(e){let t=this,n=e||cR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(sR(n)),a.push(fL()),o.push(pL(n))}function uR(e){return e===`panel_app`?(0,R.jsx)(vo,{"aria-hidden":`true`,className:`h-[0.9em] w-[0.9em]`}):e===`workspace_file`?(0,R.jsx)(yn,{"aria-hidden":`true`,className:`h-[0.9em] w-[0.9em]`}):e===`workspace_directory`?(0,R.jsx)(as,{"aria-hidden":`true`,className:`h-[0.9em] w-[0.9em]`}):(0,R.jsx)(Is,{"aria-hidden":`true`,className:`h-[0.9em] w-[0.9em]`})}function dR({kind:e,label:t,tooltip:n,onClick:r}){let{Tooltip:i,TooltipContent:a,TooltipProvider:o,TooltipTrigger:s}=g_,c=!!r,l=B(`nextclaw-chat-inline-token mx-[0.08em] inline-flex max-w-full items-baseline gap-[0.22em] align-baseline text-[1em] font-normal leading-[inherit] text-[color:var(--md-link)] underline decoration-[1.2px] underline-offset-2`,c?`cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[color:var(--md-link)]/30`:`cursor-default decoration-dotted`),u=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`inline-flex h-[1em] w-[1em] shrink-0 translate-y-[0.08em] items-center justify-center text-current opacity-80`,children:uR(e)}),(0,R.jsx)(`span`,{className:`truncate`,children:t})]});return(0,R.jsx)(o,{delayDuration:250,children:(0,R.jsxs)(i,{children:[(0,R.jsx)(s,{asChild:!0,children:c?(0,R.jsx)(`button`,{type:`button`,className:l,onClick:e=>{e.preventDefault(),e.stopPropagation(),r?.()},children:u}):(0,R.jsx)(`span`,{className:l,children:u})}),(0,R.jsx)(a,{side:`top`,className:`max-w-[24rem] break-all text-xs`,children:n})]})})}function fR(){return typeof navigator<`u`&&typeof navigator.clipboard?.writeText==`function`}function pR(e){if(typeof document>`u`)return;let t=document.getSelection();t&&(t.removeAllRanges(),e.forEach(e=>t.addRange(e)))}function mR(){let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e:null,n=t?{input:t,start:t.selectionStart,end:t.selectionEnd}:null,r=document.getSelection();return{activeElement:e,activeInputSelection:n,ranges:r?Array.from({length:r.rangeCount},(e,t)=>r.getRangeAt(t).cloneRange()):[]}}function hR(e){let t=document.createElement(`textarea`);return t.value=e,t.setAttribute(`readonly`,``),t.setAttribute(`aria-hidden`,`true`),Object.assign(t.style,{fontSize:`12pt`,left:`-9999px`,opacity:`0`,pointerEvents:`none`,position:`fixed`,top:`0`}),t}function gR(e){try{e.focus({preventScroll:!0})}catch{e.focus()}}function _R(e){gR(e),e.select(),e.setSelectionRange(0,e.value.length)}function vR(){try{return typeof document.execCommand==`function`&&document.execCommand(`copy`)}catch{return!1}}function yR(e){if(!e.activeInputSelection)return!1;let{input:t,start:n,end:r}=e.activeInputSelection;return n===null||r===null?!1:(t.setSelectionRange(n,r),!0)}function bR(e){e.activeElement&&gR(e.activeElement),yR(e)||pR(e.ranges)}function xR(e){if(typeof document>`u`||!document.body)return!1;let t=mR(),n=hR(e);document.body.appendChild(n),_R(n);let r=vR();return n.remove(),bR(t),r}async function SR(e){if(!e)return!1;if(fR())try{return await navigator.clipboard.writeText(e),!0}catch{return xR(e)}return xR(e)}var CR=1300;function wR(e){let[t,n]=(0,L.useState)(!1),r=(0,L.useCallback)(async()=>{e.text&&(await SR(e.text)?n(!0):n(!1))},[e.text]);return(0,L.useEffect)(()=>{if(!t||typeof window>`u`)return;let r=window.setTimeout(()=>n(!1),e.resetDelayMs??CR);return()=>window.clearTimeout(r)},[t,e.resetDelayMs]),{copied:t,copy:r}}var TR=e(n(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,ee=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},j={begin:`\\\\[\\s\\S]`,relevance:0},M={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[j]},N={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[j]},te={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ne=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},re=ne(`//`,`$`),ie=ne(`/\\*`,`\\*/`),ae=ne(`#`,`$`),oe={scope:`number`,begin:D,relevance:0},se={scope:`number`,begin:O,relevance:0},ce={scope:`number`,begin:k,relevance:0},le={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},ue={scope:`title`,begin:T,relevance:0},de={scope:`title`,begin:E,relevance:0},fe={begin:`\\.\\s*`+E,relevance:0},pe=Object.freeze({__proto__:null,APOS_STRING_MODE:M,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:ce,BINARY_NUMBER_RE:k,COMMENT:ne,C_BLOCK_COMMENT_MODE:ie,C_LINE_COMMENT_MODE:re,C_NUMBER_MODE:se,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ae,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:fe,NUMBER_MODE:oe,NUMBER_RE:D,PHRASAL_WORDS_MODE:te,QUOTE_STRING_MODE:N,REGEXP_MODE:le,RE_STARTERS_RE:A,SHEBANG:ee,TITLE_MODE:ue,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:de});function me(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function he(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ge(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=me,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function _e(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function ve(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ye(e,t){e.relevance===void 0&&(e.relevance=1)}var be=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},P=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],xe=`keyword`;function Se(e,t,n=xe){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,Se(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,Ce(n[0],n[1])]})}}function Ce(e,t){return t?Number(t):we(e)?0:1}function we(e){return P.includes(e.toLowerCase())}var Te={},Ee=e=>{console.error(e)},De=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Oe=(e,t)=>{Te[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Te[`${e}/${t}`]=!0)},ke=Error();function Ae(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function je(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ee(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ke;if(typeof e.beginScope!=`object`||e.beginScope===null)throw Ee(`beginScope must be object`),ke;Ae(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Me(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ee(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ke;if(typeof e.endScope!=`object`||e.endScope===null)throw Ee(`endScope must be object`),ke;Ae(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Ne(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Pe(e){Ne(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),je(e),Me(e)}function Fe(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[he,ve,Pe,be].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ge,_e,ye].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=Se(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Le(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Ie(e){return e?e.endsWithParent||Ie(e.starts):!1}function Le(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Ie(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Re=`11.11.1`,ze=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Be=i,F=a,Ve=Symbol(`nomatch`),He=7,Ue=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=M(n[1]);return t||(De(s.replace(`{}`,n[1])),De(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||M(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(Oe(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),Oe(`10.7.0`,`Please use highlight(code, options) instead.
|
|
47
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ae(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,ae(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){j.addText(N);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(N),n=``;for(;t;){n+=N.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(j.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=He&&(te+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(N)}n+=N.substring(e),j.addText(n)}function f(){if(N===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){j.addText(N);return}e=v(A.subLanguage,N,!0,ee[A.subLanguage]),ee[A.subLanguage]=e._top}else e=S(N,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(te+=e.relevance),j.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),N=``}function m(e,t){e!==``&&(j.startScope(t),j.addText(e),j.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(N=i,d(),N=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&j.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(N,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),N=``):e.beginScope._multi&&(h(e.beginScope,t),N=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(N+=e[0],1):(ie=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?N+=t:(n.excludeBegin&&(N+=t),p(),!n.returnBegin&&!n.excludeBegin&&(N=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Ve;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?N+=t:(a.returnEnd||a.excludeEnd||(N+=t),p(),a.excludeEnd&&(N=t));do A.scope&&j.closeNode(),!A.skip&&!A.subLanguage&&(te+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>j.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(N+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(N+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==Ve)return e}if(r.type===`illegal`&&a===``)return N+=`
|
|
48
|
-
`,1;if(re>1e5&&re>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return N+=a,a.length}let D=M(e);if(!D)throw Ee(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Fe(D),k=``,A=a||O,ee={},j=new l.__emitter(l);w();let N=``,te=0,ne=0,re=0,ie=!1;try{if(D.__emitTokens)D.__emitTokens(n,j);else{for(A.matcher.considerAll();;){re++,ie?ie=!1:A.matcher.considerAll(),A.matcher.lastIndex=ne;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(ne,e.index),e);ne=e.index+t}E(n.substring(ne))}return j.finalize(),k=j.toHTML(),{language:e,value:k,relevance:te,illegal:!1,_emitter:j,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Be(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:ne,context:n.slice(ne-100,ne+100),mode:t.mode,resultSoFar:k},_emitter:j};if(o)return{language:e,value:Be(n),illegal:!1,relevance:0,errorRaised:t,_emitter:j,_top:A};throw t}}function b(e){let t={value:Be(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(M).filter(te).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(M(e.language).supersetOf===t.language)return 1;if(M(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(ae(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new ze(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ae(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=F(l,e)}let E=()=>{k(),Oe(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),Oe(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(Ee(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)Ee(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&N(i.aliases,{languageName:n})}function ee(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function j(){return Object.keys(t)}function M(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function N(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function te(e){let t=M(e);return t&&!t.disableAutodetect}function ne(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function re(e){ne(e),a.push(e)}function ie(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ae(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function oe(e){return Oe(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),Oe(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:oe,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:ee,listLanguages:j,getLanguage:M,registerAliases:N,autoDetection:te,inherit:F,addPlugin:re,removePlugin:ie}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Re,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in pe)typeof pe[e]==`object`&&n(pe[e]);return Object.assign(e,pe),e},We=Ue({});We.newInstance=()=>Ue({}),t.exports=We,We.HighlightJS=We,We.default=We}))()).default;function ER(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var DR=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),OR=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),kR=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),AR=[...OR,...kR],jR=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),MR=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),NR=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),PR=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function FR(e){let t=e.regex,n=DR(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+MR.join(`|`)+`)`},{begin:`:(:)?(`+NR.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+PR.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:jR.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+AR.join(`|`)+`)\\b`}]}}function IR(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}var LR=`[A-Za-z$_][0-9A-Za-z$_]*`,RR=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),zR=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],BR=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),VR=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],HR=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],UR=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],WR=[].concat(HR,BR,VR);function GR(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=LR,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:LR,keyword:RR,literal:zR,built_in:WR,"variable.language":UR},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...BR,...VR]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...HR,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ee=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ee,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function KR(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function qR(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function JR(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function YR(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function XR(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var ZR=`[A-Za-z$_][0-9A-Za-z$_]*`,QR=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),$R=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],ez=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),tz=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],nz=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],rz=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],iz=[].concat(nz,ez,tz);function az(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=ZR,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:ZR,keyword:QR,literal:$R,built_in:iz,"variable.language":rz},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...ez,...tz]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...nz,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ee=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ee,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function oz(e){let t=e.regex,n=az(e),r=ZR,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:ZR,keyword:QR.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:$R,built_in:iz.concat(i),"variable.language":rz},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function sz(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function cz(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var lz=new Set([`text`,`txt`,`plain`,`plaintext`,`none`,`output`]),uz=[`typescript`,`javascript`,`json`,`bash`,`shell`,`python`,`css`,`xml`,`markdown`,`yaml`,`sql`,`diff`],dz=4,fz=[{name:`typescript`,language:oz,aliases:[`ts`,`tsx`]},{name:`javascript`,language:GR,aliases:[`js`,`jsx`,`mjs`,`cjs`]},{name:`json`,language:KR,aliases:[`jsonc`]},{name:`bash`,language:ER,aliases:[`sh`,`zsh`]},{name:`shell`,language:YR,aliases:[`console`,`terminal`]},{name:`python`,language:JR,aliases:[`py`]},{name:`css`,language:FR},{name:`xml`,language:sz,aliases:[`html`,`svg`]},{name:`markdown`,language:qR,aliases:[`md`,`mdx`]},{name:`yaml`,language:cz,aliases:[`yml`]},{name:`sql`,language:XR},{name:`diff`,language:IR,aliases:[`patch`]}];function pz(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function mz(e){return e.trim().toLowerCase()}var hz=new class{constructor(){this.highlight=(e,t)=>{let n=mz(t);if(!e||lz.has(n))return this.createPlainTextResult(e,n||`text`);if(this.engine.getLanguage(n)){let t=this.engine.highlight(e,{language:n,ignoreIllegals:!0});return{html:t.value,language:t.language??n,highlighted:!0}}let r=this.engine.highlightAuto(e,uz);return r.language&&r.relevance>=dz?{html:r.value,language:r.language,highlighted:!0}:this.createPlainTextResult(e,n||`text`)},this.createPlainTextResult=(e,t)=>({html:pz(e),language:t,highlighted:!1}),this.engine=TR.newInstance(),fz.forEach(e=>{this.engine.registerLanguage(e.name,e.language),e.aliases&&this.engine.registerAliases(e.aliases,{languageName:e.name})})}},gz=/language-([a-z0-9-]+)/i;function _z(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(_z).join(``):``}function vz(e){let t=_z(e);return t.endsWith(`
|
|
49
|
-
`)?t.slice(0,-1):t}function yz(e){return(e?gz.exec(e):null)?.[1]?.toLowerCase()||`text`}function bz({className:e,children:t,texts:n}){let r=(0,L.useMemo)(()=>yz(e),[e]),i=(0,L.useMemo)(()=>vz(t),[t]),a=(0,L.useMemo)(()=>hz.highlight(i,r),[i,r]),o=(0,L.useMemo)(()=>{let t=`language-${a.language}`;return B(`hljs`,e,e?.includes(`language-`)?void 0:t)},[e,a.language]),{copied:s,copy:c}=wR({text:i});return(0,R.jsxs)(`div`,{className:`chat-codeblock`,children:[(0,R.jsxs)(`div`,{className:`chat-codeblock-toolbar`,children:[(0,R.jsx)(`span`,{className:`chat-codeblock-language`,children:r}),(0,R.jsxs)(`button`,{type:`button`,className:`chat-codeblock-copy`,onClick:()=>void c(),"aria-label":s?n.copiedCodeLabel:n.copyCodeLabel,children:[s?(0,R.jsx)(fn,{className:`h-3.5 w-3.5`}):(0,R.jsx)(zo,{className:`h-3.5 w-3.5`}),(0,R.jsx)(`span`,{children:s?n.copiedCodeLabel:n.copyCodeLabel})]})]}),(0,R.jsx)(`pre`,{children:(0,R.jsx)(`code`,{className:o,"data-highlighted":a.highlighted?`true`:`false`,dangerouslySetInnerHTML:{__html:a.html}})})]})}var xz=`nextclaw-inline`,Sz=/language-([a-z0-9-]+)/i,Cz=new Set([`auto`,`source`,`rendered`]),wz=32,Tz=64*1024;function Ez(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Dz(e){return typeof e==`string`&&e.trim().length>0?e.trim():void 0}function Oz(e){return Number.isInteger(e)&&Number(e)>0?Number(e):void 0}function kz(e){let t=Dz(e);return t&&Cz.has(t)?t:void 0}function Az(e){let{payload:t}=e;return Ez(t)?t:null}function jz(e,t){return e===null||typeof e==`string`||typeof e==`boolean`?!0:typeof e==`number`?Number.isFinite(e):t>=wz||typeof e!=`object`?!1:(Array.isArray(e)?e:Object.values(e)).every(e=>jz(e,t+1))}function Mz(e){if(e!==void 0)return!Ez(e)||!jz(e,0)?null:new TextEncoder().encode(JSON.stringify(e)).byteLength<=Tz?e:null}function Nz(e){let t=Az(e);if(!t)return null;let n=Dz(t.path);if(!n)return null;let r=kz(t.viewer),i=Mz(t.params);return i===null||i&&(r===`source`||!/\.html?$/i.test(n))?null:{type:`file`,payload:{path:n,line:Oz(t.line),column:Oz(t.column),viewer:r,params:i??void 0}}}function Pz(e){let t=Az(e);if(!t)return null;let n=Dz(t.url);return n?{type:`url`,payload:{url:n}}:null}function Fz(e){let t=Az(e);if(!t)return null;let n=Dz(t.appId);if(!n)return null;let r=Mz(t.params);return r===null?null:{type:`panel_app`,payload:{appId:n,path:Dz(t.path),params:r??void 0}}}function Iz(e){let t=Az(e);return!t||!(`value`in t)?null:{type:`json`,payload:{value:t.value}}}function Lz(e){if(!Ez(e))return null;let t=Dz(e.type);return t===`file`?Nz(e):t===`url`?Pz(e):t===`panel_app`?Fz(e):t===`json`?Iz(e):null}function Rz(e){return(e?Sz.exec(e):null)?.[1]?.toLowerCase()===xz}function zz(e){let t=e.endsWith(`
|
|
50
|
-
`)?e.slice(0,-1):e,n;try{n=JSON.parse(t)}catch{return null}if(!Ez(n))return null;let r=Lz(n.target);return r?{target:r,title:Dz(n.title),description:Dz(n.description)}:null}function Bz(e){if(e.title)return e.title;if(e.target.type===`file`){let t=e.target.payload.path.split(`/`).filter(Boolean);return t[t.length-1]??e.target.payload.path}return e.target.type===`url`?e.target.payload.url:e.target.type===`panel_app`?e.target.payload.appId:`JSON`}function Vz(e){return e.target.type===`file`?e.target.payload.path:e.target.type===`url`?e.target.payload.url:e.target.type===`panel_app`?e.target.payload.appId:JSON.stringify(e.target.payload.value,null,2)}function Hz({display:e}){let t=`h-3.5 w-3.5 shrink-0 text-muted-foreground`;return e.target.type===`file`?(0,R.jsx)(yn,{className:t,"aria-hidden":!0}):e.target.type===`url`?(0,R.jsx)(Mn,{className:t,"aria-hidden":!0}):e.target.type===`panel_app`?(0,R.jsx)(vo,{className:t,"aria-hidden":!0}):(0,R.jsx)(Lo,{className:t,"aria-hidden":!0})}function Uz(e){return e.length>1200?`${e.slice(0,1200)}\n...`:e}function Wz({display:e}){let t=Bz(e),n=Vz(e),r=e.target.type===`json`?Uz(n):n;return(0,R.jsxs)(`section`,{className:B(`my-2 max-w-full border-l-2 border-border bg-muted/30 px-3 py-2`,`text-xs leading-relaxed text-foreground`),"data-nextclaw-inline-display":`true`,"data-nextclaw-inline-display-type":e.target.type,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(Hz,{display:e}),(0,R.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:t})]}),e.description?(0,R.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[12px] text-muted-foreground`,children:e.description}):null,(0,R.jsx)(`pre`,{className:B(`mt-1 max-h-40 overflow-auto whitespace-pre-wrap break-words`,`font-mono text-[11px] leading-relaxed text-muted-foreground`),children:r})]})}function Gz({display:e,renderInlineDisplay:t}){let n=t?.(e);return n==null?(0,R.jsx)(Wz,{display:e}):(0,R.jsx)(R.Fragment,{children:n})}function Kz({children:e,closeLabel:t,label:n,onClose:r}){return(0,L.useEffect)(()=>{let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let t=e=>{e.key===`Escape`&&(e.preventDefault(),r())};return window.addEventListener(`keydown`,t),()=>{document.body.style.overflow=e,window.removeEventListener(`keydown`,t)}},[r]),(0,LD.createPortal)((0,R.jsxs)(`div`,{role:`dialog`,"aria-label":n,"aria-modal":`true`,className:`fixed inset-0 z-[var(--z-modal,10050)] flex items-center justify-center bg-black/80 p-4 backdrop-blur-[2px]`,onClick:r,children:[(0,R.jsx)(`button`,{type:`button`,"aria-label":t,className:`absolute right-4 top-4 inline-flex h-9 w-9 items-center justify-center rounded-full bg-black/55 text-white transition-colors hover:bg-black/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/70`,onClick:e=>{e.stopPropagation(),r()},children:(0,R.jsx)(qn,{className:`h-4 w-4`,strokeWidth:2})}),(0,R.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:e})]}),document.body)}var qz=200,Jz=null;function Yz(){return Jz??=D(()=>import(`./mermaid.core-D0Q77r9I.js`).then(e=>e.default),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),Jz}function Xz(){if(typeof document>`u`)return`default`;let e=document.documentElement;return e.getAttribute(`data-theme-appearance`)===`dark`||e.classList.contains(`dark`)?`dark`:`default`}function Zz(){let[e,t]=(0,L.useState)(Xz);return(0,L.useEffect)(()=>{let e=document.documentElement,n=new MutationObserver(()=>t(Xz()));return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-theme-appearance`]}),()=>n.disconnect()},[]),e}function Qz({isStreaming:e,source:t,texts:n}){let r=(0,L.useId)().replace(/[^a-zA-Z0-9_-]/g,``),i=(0,L.useRef)(0),a=Zz(),o=t.trim(),s=`${a}:${o}`,c=(0,L.useRef)({isFinal:!e,key:s,source:o,theme:a}),l=(0,L.useRef)(null),u=(0,L.useRef)(!1),d=(0,L.useRef)(Date.now()),f=(0,L.useRef)(!0),[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(null),[_,v]=(0,L.useState)(null),y=n.mermaidDiagramLabel??`Mermaid diagram`,b=n.mermaidExpandLabel??`Expand diagram`,x=n.attachmentCloseLabel??`Close preview`,S=n.mermaidLoadingLabel??`Rendering diagram…`,C=n.mermaidRenderErrorLabel??`Diagram could not be rendered`,w=(0,L.useCallback)(e=>{if(!f.current||u.current)return;if(l.current!==null){if(!e)return;window.clearTimeout(l.current),l.current=null}let t=Date.now()-d.current,n=e?0:Math.max(0,qz-t);l.current=window.setTimeout(()=>{l.current=null,g(c.current)},n)},[]);(0,L.useEffect)(()=>(f.current=!0,()=>{f.current=!1,l.current!==null&&(window.clearTimeout(l.current),l.current=null)}),[]),(0,L.useEffect)(()=>{c.current={isFinal:!e,key:s,source:o,theme:a},w(!e)},[e,o,s,w,a]),(0,L.useEffect)(()=>{if(!h)return;let e=!0;return(async()=>{u.current=!0,d.current=Date.now();try{let t=await Yz();if(!e||!f.current)return;i.current+=1;let n=`nextclaw-mermaid-${r}-${i.current}`;t.initialize({securityLevel:`strict`,startOnLoad:!1,suppressErrorRendering:!0,theme:h.theme});let a=await t.parse(h.source,{suppressErrors:!0});if(!e||!f.current)return;if(!a)throw Error(`Invalid Mermaid diagram`);let{svg:o}=await t.render(n,h.source);e&&f.current&&c.current.theme===h.theme&&v({key:h.key,status:`rendered`,svg:o})}catch{e&&f.current&&h.isFinal&&c.current.key===h.key&&v({key:h.key,status:`error`})}finally{u.current=!1;let t=c.current;e&&f.current&&(t.key!==h.key||t.isFinal!==h.isFinal)&&w(t.isFinal)}})(),()=>{e=!1}},[r,h,w]);let T=_?.key===s?_:null;if(T?.status===`error`)return(0,R.jsxs)(`div`,{"data-chat-mermaid-error":`true`,className:`my-3 overflow-hidden rounded-xl border border-border bg-muted/25`,children:[(0,R.jsx)(`div`,{className:`border-b border-border px-3 py-2 text-xs text-muted-foreground`,children:C}),(0,R.jsx)(bz,{className:`language-mermaid`,texts:n,children:o})]});let E=_?.status===`rendered`?_:null;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`figure`,{"aria-label":y,"aria-busy":!T,"data-chat-mermaid-diagram":`true`,"data-chat-mermaid-pending":!E||void 0,"data-chat-mermaid-updating":!T||void 0,className:E?`group/mermaid relative my-3 min-h-24 overflow-auto py-2`:`my-3 flex min-h-14 items-center justify-center rounded-xl bg-muted/20 px-3 py-2`,children:E?(0,R.jsxs)(`button`,{type:`button`,"aria-label":b,className:`relative block min-w-full cursor-zoom-in border-0 bg-transparent p-0 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>m(!0),children:[(0,R.jsx)(`span`,{className:`block min-w-fit [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:E.svg}}),(0,R.jsx)(`span`,{className:`pointer-events-none absolute right-2 top-2 inline-flex h-7 w-7 items-center justify-center rounded-md bg-black/45 text-white opacity-0 transition-opacity duration-150 group-hover/mermaid:opacity-100 group-focus-within/mermaid:opacity-100`,children:(0,R.jsx)(Uo,{className:`h-3.5 w-3.5`,strokeWidth:2})})]}):(0,R.jsxs)(`div`,{role:`status`,className:`inline-flex items-center gap-2 text-xs font-medium text-muted-foreground/80`,children:[(0,R.jsx)(Un,{"aria-hidden":`true`,className:`h-3.5 w-3.5 animate-spin motion-reduce:animate-none`}),(0,R.jsx)(`span`,{children:S})]})}),p&&E?(0,R.jsx)(Kz,{closeLabel:x,label:y,onClose:()=>m(!1),children:(0,R.jsx)(`div`,{className:`max-h-[92vh] max-w-[96vw] overflow-auto rounded-xl bg-background p-4 shadow-2xl [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:!max-w-none`,dangerouslySetInnerHTML:{__html:E.svg}})}):null]})}function $z({alt:e,expandLabel:t,closeLabel:n,sizeLabel:r,src:i}){let[a,o]=(0,L.useState)(!1),s=()=>o(!0);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{"data-chat-message-image-preview":!0,className:`group/image relative block w-fit max-w-[min(100%,32rem)] overflow-hidden rounded-lg`,children:[(0,R.jsx)(`button`,{type:`button`,className:`block w-fit max-w-[min(100%,32rem)] text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:s,onDoubleClick:e=>{e.preventDefault(),s()},"aria-label":t,children:(0,R.jsx)(`img`,{src:i,alt:e,className:`block h-auto w-auto max-h-[26rem] max-w-full rounded-lg bg-transparent object-contain`})}),(0,R.jsx)(`button`,{type:`button`,"aria-label":t,className:`absolute right-2 top-2 inline-flex h-7 w-7 items-center justify-center rounded-md bg-black/45 text-white opacity-0 transition-opacity duration-150 hover:bg-black/60 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/70 group-hover/image:opacity-100`,onClick:e=>{e.preventDefault(),e.stopPropagation(),s()},children:(0,R.jsx)(Uo,{className:`h-3.5 w-3.5`,strokeWidth:2})}),r?(0,R.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 bottom-0 flex items-end justify-start bg-gradient-to-t from-black/50 via-black/15 to-transparent px-2.5 pb-2 pt-8 opacity-0 transition-opacity duration-150 group-hover/image:opacity-100 group-focus-within/image:opacity-100`,children:(0,R.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-black/40 px-1.5 py-0.5 text-[10px] font-medium text-white/95 backdrop-blur-sm`,children:r})}):null]}),a?(0,R.jsx)(Kz,{closeLabel:n,label:e,onClose:()=>o(!1),children:(0,R.jsx)(`img`,{src:i,alt:e,className:`max-h-[min(92vh,100%)] max-w-[min(96vw,100%)] object-contain shadow-2xl`})}):null]})}var eB=new Set([`http:`,`https:`,`mailto:`,`tel:`]),tB=/^[a-zA-Z][a-zA-Z\d+.-]*:/,nB=/^[a-z]:[\\/]/i,rB=/^\/[a-z]:[\\/]/i,iB=`file:`;function aB(e){return!e.startsWith(`//`)&&!tB.test(e)}function oB(e){let t=Number(e);return Number.isSafeInteger(t)&&t>0?t:void 0}function sB(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==iB||t.hostname&&t.hostname.toLowerCase()!==`localhost`)return null;let n;try{n=decodeURIComponent(t.pathname)}catch{return null}return rB.test(n)&&(n=n.slice(1)),n?{path:n,query:t.searchParams,fragment:t.hash.slice(1)}:null}function cB(e){let t=e.indexOf(`#`),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):``,i=n.indexOf(`?`),a=i>=0?n.slice(0,i):n,o=i>=0?n.slice(i+1):``,s;try{s=decodeURIComponent(a)}catch{return null}return s?{path:s,query:new URLSearchParams(o),fragment:r}:null}function lB(e){let t=/^L(\d+)(?:C(\d+))?(?:-L\d+(?:C\d+)?)?$/i.exec(e),n=oB(t?.[1]);return{line:n,column:n?oB(t?.[2]):void 0}}function uB(e){if(nB.test(e)||aB(e))return e;try{let t=new URL(e);return eB.has(t.protocol)||t.protocol===iB&&sB(e)?e:``}catch{return``}}function dB(e){return e&&uB(e)||null}function fB(e){return/^https?:\/\//i.test(e)}function pB(e){let t=e.toLowerCase().startsWith(iB)?sB(e):cB(e),n=t?.path;if(!n||n.startsWith(`#`)||n.startsWith(`//`)||!nB.test(n)&&tB.test(n))return null;let r=t.query.get(`viewer`),i=lB(t.fragment),a=/^(.*?)(?::(\d+)(?::(\d+))?)$/.exec(n),o=a?.[1]??n,s=i.line??oB(a?.[2]),c=i.column??(s?oB(a?.[3]):void 0);return{path:o,label:o.split(/[\\/]/).filter(Boolean).pop()??o,viewMode:`preview`,...r===`source`||r===`rendered`?{previewViewer:r}:{},...typeof s==`number`?{line:s}:{},...typeof c==`number`?{column:c}:{}}}var mB=`data-chat-inline-token-kind`,hB=`data-chat-inline-token-key`,gB=`data-chat-inline-token-ref`,_B=`data-chat-inline-token-name`,vB=`data-chat-inline-token-source`,yB=`data-chat-inline-token-path`,bB=`data-chat-inline-token-label`,xB=`data-chat-inline-token-raw-text`;function SB(e){return e.filter(e=>e.rawText).sort((e,t)=>t.rawText.length-e.rawText.length)}function CB(e){let t={[mB]:e.kind,[bB]:e.label,[xB]:e.rawText};return`ref`in e?(t[gB]=e.ref,t[_B]=e.name,e.source&&(t[vB]=e.source),e.path&&(t[yB]=e.path)):t[hB]=e.key,{type:`chatInlineToken`,data:{hName:`span`,hProperties:t,hChildren:[{type:`text`,value:e.label}]}}}function wB(e,t,n){let r=null;for(let i of n){let n=e.indexOf(i.rawText,t);n<0||(!r||n<r.index||n===r.index&&i.rawText.length>r.token.rawText.length)&&(r={index:n,token:i})}return r}var TB=class{constructor(e){this.tokens=e,this.occurrenceCounts=new Map,this.transform=e=>e.type===`code`||e.type===`inlineCode`||!e.children?e:{...e,children:e.children.flatMap(e=>e.type===`text`&&typeof e.value==`string`?this.splitTextNode(e.value):[this.transform(e)])},this.splitTextNode=e=>{let t=[],n=0;for(;n<e.length;){let r=wB(e,n,this.tokens);if(!r){t.push({type:`text`,value:e.slice(n)});break}r.index>n&&t.push({type:`text`,value:e.slice(n,r.index)});let i=this.tokens.filter(e=>e.rawText===r.token.rawText),a=this.occurrenceCounts.get(r.token.rawText)??0,o=i[Math.min(a,i.length-1)]??r.token;this.occurrenceCounts.set(r.token.rawText,a+1),t.push(CB(o)),n=r.index+r.token.rawText.length}return t.length>0?t:[{type:`text`,value:e}]}}};function EB(e){let t=SB(e);return()=>e=>t.length>0?new TB(t).transform(e):e}function DB(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:null}function OB(e){let t=DB(e,vB);return t===`builtin`||t===`global`||t===`project`||t===`workspace`?t:null}function kB(e){let t=DB(e,mB),n=DB(e,bB),r=DB(e,xB);if(t===`skill`&&n&&r){let i=DB(e,gB),a=DB(e,_B);return i&&a?{kind:t,ref:i,name:a,source:OB(e),path:DB(e,yB),label:n,rawText:r}:null}let i=DB(e,hB);return t&&i&&n&&r?{kind:t,key:i,label:n,rawText:r}:null}var AB=14e4;function jB(e){return e.length<=AB?e:`${e.slice(0,AB)}\n\n...`}function MB(e){let t=0;for(let n of e?.children??[]){if(n.type===`text`){let e=n.value??``;if(e.trim().length>0||e.includes(`
|
|
51
|
-
`)||e.includes(`\r`))return!1;continue}if(n.tagName!==`img`)return!1;t+=1}return t>=3}var NB=(0,L.createContext)(null);function PB(){let e=(0,L.useContext)(NB);if(!e)throw Error(`Chat message Markdown renderer requires its runtime context`);return e}var FB={p:function({node:e,children:t}){let{inline:n}=PB();return n?(0,R.jsx)(R.Fragment,{children:t}):(0,R.jsx)(`p`,{"data-chat-image-row":MB(e)?`three-column`:void 0,children:t})},span:function({node:e,children:t,...n}){let{onInlineTokenClick:r}=PB(),i=kB(n);return i?(0,R.jsx)(dR,{kind:i.kind,label:i.label,tooltip:`ref`in i?i.name:i.key,onClick:r?()=>r(i):void 0}):(0,R.jsx)(`span`,{...n,children:t})},a:function({node:e,href:t,children:n,...r}){let{onFileOpen:i}=PB(),a=dB(t),o=a?fB(a):!1,s=o?null:a?pB(a):null,c=e=>{if(!a){e.preventDefault();return}!i||!s||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),i(s))};return(0,R.jsx)(`a`,{...r,className:B(r.className,!a&&`chat-link-invalid`),href:a??`#`,"aria-disabled":!a||void 0,onClick:c,target:o?`_blank`:void 0,rel:o?`noreferrer noopener`:void 0,children:n})},table:function({node:e,children:t,...n}){return(0,R.jsx)(`div`,{className:`chat-table-wrap`,children:(0,R.jsx)(`table`,{...n,children:t})})},input:function({node:e,type:t,checked:n,...r}){return t===`checkbox`?(0,R.jsx)(`input`,{...r,type:`checkbox`,checked:n,readOnly:!0,disabled:!0,className:`chat-task-checkbox`}):(0,R.jsx)(`input`,{...r,type:t})},img:function({node:e,src:t,alt:n}){let{resolveFileContentUrl:r,texts:i}=PB(),a=dB(t);if(!a)return null;let o=pB(a),s=o&&r?r(o):a;return s?(0,R.jsx)($z,{alt:n||``,closeLabel:i.attachmentCloseLabel??`Close preview`,expandLabel:i.attachmentExpandLabel??`Expand image`,sizeLabel:null,src:s}):null},code:function({node:e,className:t,children:n,...r}){let{isStreaming:i,renderInlineDisplay:a,texts:o}=PB(),s=String(n??``);if(!t&&!s.includes(`
|
|
52
|
-
`))return(0,R.jsx)(`code`,{...r,className:B(`chat-inline-code`,t),children:n});let c=Rz(t)?zz(s):null;return c?(0,R.jsx)(Gz,{display:c,renderInlineDisplay:a}):t?.split(` `).includes(`language-mermaid`)?(0,R.jsx)(Qz,{isStreaming:i,source:s,texts:o}):(0,R.jsx)(bz,{className:t,texts:o,children:n})}};function IB({text:e,role:t,texts:n,inline:r=!1,isStreaming:i=!1,inlineTokens:a,onFileOpen:o,onInlineTokenClick:s,resolveFileContentUrl:c,renderInlineDisplay:l}){let u=t===`user`,d=a?.length?[lR,EB(a)]:[lR],f=r?`span`:`div`;return(0,R.jsx)(NB.Provider,{value:{inline:r,isStreaming:i,isUser:u,onFileOpen:o,onInlineTokenClick:s,renderInlineDisplay:l,resolveFileContentUrl:c,texts:n},children:(0,R.jsx)(f,{className:B(`chat-markdown`,u?`chat-markdown-user`:`chat-markdown-assistant`),children:(0,R.jsx)(aF,{skipHtml:!0,remarkPlugins:d,components:FB,urlTransform:uB,children:jB(e)})})})}var LB={archive:`bg-muted text-muted-foreground`,audio:`bg-muted text-muted-foreground`,code:`bg-muted text-muted-foreground`,data:`bg-muted text-muted-foreground`,document:`bg-muted text-muted-foreground`,generic:`bg-muted text-muted-foreground`,image:`bg-muted text-muted-foreground`,pdf:`bg-muted text-muted-foreground`,sheet:`bg-muted text-muted-foreground`,video:`bg-muted text-muted-foreground`},RB=new Set([`c`,`cpp`,`css`,`go`,`html`,`java`,`js`,`jsx`,`md`,`php`,`py`,`rb`,`rs`,`sh`,`sql`,`svg`,`ts`,`tsx`]),zB=new Set([`graphql`,`json`,`toml`,`xml`,`yaml`,`yml`]),BB=new Set([`avif`,`bmp`,`gif`,`heic`,`heif`,`ico`,`jpeg`,`jpg`,`png`,`svg`,`tif`,`tiff`,`webp`]),VB=new Set([`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]),HB=new Set([`avi`,`m4v`,`mov`,`mp4`,`mkv`,`webm`,`wmv`]),UB=new Set([`doc`,`docx`,`odt`,`pages`,`rtf`,`txt`]),WB=new Set([`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]),GB=new Set([`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]);function KB(e){if(!Number.isFinite(e)||e==null||e<0)return null;if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;let i=n>=10||r===0?0:1;return`${n.toFixed(i).replace(/\.0$/,``)} ${t[r]}`}function qB(e,t){let n=JB(e);if(n)return n.toUpperCase();let r=(t.split(`/`)[1]??``).split(/[+.;-]/)[0]?.trim();return r?r.slice(0,6).toUpperCase():`FILE`}function JB(e){return/\.([a-z0-9]{1,12})$/i.exec(e.trim())?.[1]?.toLowerCase()??``}function YB(e){return typeof e==`string`&&/^data:image\//i.test(e.trim())}function XB(e){return BB.has(e)?e===`jpg`||e===`jpeg`?`image/jpeg`:e===`svg`?`image/svg+xml`:`image/${e}`:VB.has(e)?e===`mp3`?`audio/mpeg`:e===`m4a`?`audio/mp4`:e===`weba`?`audio/webm`:`audio/${e}`:HB.has(e)?e===`mov`?`video/quicktime`:e===`m4v`?`video/mp4`:`video/${e}`:e===`pdf`?`application/pdf`:null}function ZB(e){let t=JB(e);return t?XB(t):null}function QB(e){let t=e.mimeType.trim().toLowerCase();return t.length>0&&t!==`application/octet-stream`?t:ZB(e.label)}function $B(e){let t=e.mimeType.trim().toLowerCase(),n=JB(e.label);return e.isImage||t.startsWith(`image/`)||BB.has(n)||YB(e.dataUrl)}function eV(e,t){let n=JB(e),r=t.toLowerCase();return r.startsWith(`image/`)||BB.has(n)?`image`:r.startsWith(`audio/`)||VB.has(n)?`audio`:r.startsWith(`video/`)||HB.has(n)?`video`:r.includes(`pdf`)||n===`pdf`?`pdf`:GB.has(n)||/(zip|tar|gzip|rar|compressed|archive)/.test(r)?`archive`:WB.has(n)||/(spreadsheet|sheet|excel|csv)/.test(r)?`sheet`:zB.has(n)||/(json|xml|yaml|toml)/.test(r)?`data`:RB.has(n)||/(javascript|typescript|jsx|tsx|css|html)/.test(r)?`code`:UB.has(n)||/(msword|document|opendocument|rtf|text\/)/.test(r)?`document`:`generic`}function tV(e){let t=eV(e.label,e.mimeType),n=KB(e.sizeBytes);return{category:t,extension:qB(e.label,e.mimeType),sizeLabel:n}}var nV={archive:`Archive`,audio:`Audio`,code:`Code file`,data:`Data file`,document:`Document`,generic:`File`,image:`Image`,pdf:`PDF document`,sheet:`Spreadsheet`,video:`Video`},rV={archive:Wo,audio:Go,code:Ko,data:Jo,document:yn,generic:Zo,image:qo,pdf:yn,sheet:Yo,video:Xo};function iV(e,t){return t?.attachmentCategoryLabels?.[e]??nV[e]}function aV(e,t,n){return(0,R.jsx)(`div`,{className:B(`mt-0.5 text-[11px] leading-4`,n?`text-foreground/55`:`text-muted-foreground`),children:t?`${e} · ${t}`:e})}function oV(e,t,n){return(0,R.jsx)(`span`,{className:B(`inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-medium`,n?t?`bg-black/5 text-foreground/75`:`bg-muted text-muted-foreground`:t?`bg-black/[0.03] text-foreground/45`:`bg-muted/70 text-muted-foreground/70`),children:e})}function sV(e){let{label:t,href:n,isUser:r,onOpen:i}=e,a=B(`inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors`,r?`bg-black/5 text-foreground/75 hover:bg-black/10 hover:text-foreground`:`bg-muted text-muted-foreground hover:bg-accent hover:text-foreground`);return i?(0,R.jsx)(`button`,{type:`button`,className:a,onClick:e=>{e.preventDefault(),e.stopPropagation(),i()},children:t}):n?(0,R.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:a,children:t}):oV(t,r,!1)}function cV({category:e,isUser:t}){let n=rV[e];return(0,R.jsx)(`div`,{className:B(`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg`,t?`bg-black/5 text-foreground/70`:LB[e]),children:(0,R.jsx)(n,{className:B(`h-4 w-4`,t?`text-foreground/70`:`text-current`),strokeWidth:2})})}function lV(e){let{category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,action:o}=e;return(0,R.jsxs)(`div`,{className:`flex items-center gap-2.5 px-2.5 py-2`,children:[(0,R.jsx)(cV,{category:t,isUser:a}),(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`truncate text-[13px] font-medium leading-5`,children:n.label}),aV(r,i,a)]}),o]})})]})}function uV(e){let{category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,shellClasses:o,actionLabel:s,onOpen:c}=e;if(!n.dataUrl||t!==`audio`&&t!==`video`)return null;let l=QB(n);return(0,R.jsxs)(`div`,{className:o,children:[lV({category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,action:sV({label:s,href:n.dataUrl,isUser:a,onOpen:c?()=>c(n):void 0})}),(0,R.jsx)(`div`,{className:`px-2.5 pb-2.5`,children:t===`audio`?(0,R.jsx)(`audio`,{controls:!0,preload:`metadata`,"aria-label":n.label,className:`block w-full`,children:(0,R.jsx)(`source`,{src:n.dataUrl,...l?{type:l}:{}})}):(0,R.jsx)(`div`,{className:B(`overflow-hidden rounded-lg`,a?`bg-black/10`:`bg-muted ring-1 ring-border/70`),children:(0,R.jsx)(`video`,{controls:!0,preload:`metadata`,playsInline:!0,"aria-label":n.label,className:`block max-h-[28rem] w-full bg-black`,children:(0,R.jsx)(`source`,{src:n.dataUrl,...l?{type:l}:{}})})})})]})}function dV({file:e,isUser:t=!1,texts:n,onOpen:r}){let{category:i,sizeLabel:a}=tV(e),o=$B(e)&&!!e.dataUrl,s=i===`audio`&&!!e.dataUrl,c=i===`video`&&!!e.dataUrl,l=!!e.dataUrl,u=l?n?.attachmentOpenLabel??`Open`:n?.attachmentAttachedLabel??`Attached`,d=n?.attachmentExpandLabel??`Expand image`,f=n?.attachmentCloseLabel??`Close preview`,p=iV(i,n),m=B(`block overflow-hidden rounded-xl border transition-colors`,t?`border-black/8 bg-black/[0.03] text-foreground`:`border-border/70 bg-card text-card-foreground`,l&&(t?`hover:bg-black/[0.05]`:`hover:bg-muted/50`));if(o&&e.dataUrl)return(0,R.jsx)($z,{alt:e.label,expandLabel:d,closeLabel:f,sizeLabel:a,src:e.dataUrl});if(s||c)return uV({category:i,file:e,categoryLabel:p,sizeLabel:a,isUser:t,shellClasses:m,actionLabel:u,onOpen:r});let h=lV({category:i,file:e,categoryLabel:p,sizeLabel:a,isUser:t,action:oV(u,t,l)});return!l||!e.dataUrl?(0,R.jsx)(`div`,{className:m,children:h}):r?(0,R.jsx)(`button`,{type:`button`,className:B(m,`group w-full text-left`),onClick:()=>r(e),children:h}):(0,R.jsx)(`a`,{href:e.dataUrl,target:`_blank`,rel:`noreferrer`,className:B(m,`group`),children:h})}function fV({group:e,indexOffset:t,isUser:n,texts:r,onOpen:i}){return(0,R.jsx)(`div`,{"data-chat-message-image-row":`three-column`,"data-chat-message-wide-content":`true`,className:`grid w-full grid-cols-3 items-start gap-3`,children:e.items.map(({index:e,part:a})=>(0,R.jsx)(dV,{file:a.file,isUser:n,texts:r,onOpen:i},`file-${t+e}`))})}function pV(e){return!!(e?.kind===`part`&&e.part.type===`file`&&e.part.file.isImage&&e.part.file.dataUrl)}function mV(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!pV(r)){r&&t.push(r),n+=1;continue}let i=n,a=[];for(;pV(e[n]);)a.push(e[n]),n+=1;if(a.length<3){t.push(...a);continue}t.push({kind:`image-group`,key:`image-group-${i}`,items:a})}return t}function hV(e){let{isInProgress:t}=e,[n,r]=(0,L.useState)(t),[i,a]=(0,L.useState)(!1),o=(0,L.useRef)(t);(0,L.useEffect)(()=>{let e=o.current;!e&&t?(r(!0),a(!1)):e&&!t&&!i&&r(!1),o.current=t},[t,i]);function s(e){e.preventDefault();let i=!n;if(r(i),!i){a(!1);return}t&&a(!0)}return{isOpen:n,onSummaryClick:s}}var gV=10;function _V({contentRef:e,contentVersion:t,hasContent:n,isLoading:r,resetKey:i,scrollRef:a,stickyThresholdPx:o}){let[s,c]=(0,L.useState)(!0),l=(0,L.useRef)(!0),u=(0,L.useRef)(null),d=(0,L.useRef)(!1),f=(0,L.useRef)(null),p=(0,L.useCallback)(e=>{l.current=e,c(e)},[]),m=(0,L.useCallback)(e=>e.scrollHeight-e.scrollTop-e.clientHeight<=(o??gV),[o]),h=(0,L.useCallback)(()=>{let e=f.current;e!==null&&(cancelAnimationFrame(e),f.current=null)},[]),g=(0,L.useCallback)((e=`auto`)=>{a.current&&(h(),f.current=requestAnimationFrame(()=>{f.current=null;let t=a.current;t&&(typeof t.scrollTo==`function`?t.scrollTo({top:t.scrollHeight,behavior:e}):t.scrollTop=t.scrollHeight)}))},[h,a]),_=(0,L.useCallback)(()=>{p(!0),g()},[g,p]),v=(0,L.useCallback)(()=>{let e=a.current;if(!e)return;let t=m(e);t||h(),p(t)},[h,m,a,p]);return(0,L.useEffect)(()=>{u.current!==i&&(u.current=i,p(!0),d.current=!0)},[i,p]),(0,L.useEffect)(()=>h,[h]),(0,L.useEffect)(()=>{let t=e?.current;if(!t||!n||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{l.current&&g()});return r.observe(t),()=>r.disconnect()},[e,n,g,i]),(0,L.useLayoutEffect)(()=>{!d.current||r||!n||(d.current=!1,g())},[n,r,g]),(0,L.useLayoutEffect)(()=>{!l.current||!n||g()},[t,n,g]),{isAtBottom:s,onScroll:v,scrollToBottom:_}}var vV=`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-current`,yV=`group/process-row flex w-full min-w-0 items-center gap-1.5 py-0 text-[0.925rem] font-normal leading-[1.72] text-muted-foreground/80`;function bV({children:e,className:t}){return(0,R.jsx)(`span`,{className:B(vV,t),children:e})}function xV({position:e}){return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-tool-workflow-rail":`true`,className:B(`pointer-events-none absolute left-[0.575em] w-px -translate-x-1/2 bg-border/70`,e===`first`?`bottom-0 top-[0.86em]`:e===`last`?`top-0 h-[0.86em]`:`inset-y-0`)})}function SV({children:e,className:t,interactive:n=!1,onClick:r,role:i,tabIndex:a,onKeyDown:o}){return(0,R.jsx)(`div`,{"data-chat-process-meta-row":`true`,className:B(yV,n?`cursor-pointer transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`:null,t),onClick:r,role:i,tabIndex:a,onKeyDown:o,children:e})}function CV({label:e,openGroup:t,open:n=!1,icon:r,className:i,leadingIconClassName:a,labelClassName:o,onClick:s}){return(0,R.jsxs)(`button`,{type:`button`,"data-chat-process-meta-row":`true`,className:B(yV,`m-0 w-full border-0 bg-transparent p-0 text-left shadow-none transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,i),"aria-expanded":n,onClick:s,children:[r?(0,R.jsx)(bV,{className:B(`relative z-[1] rounded-sm`,a),children:(0,R.jsx)(r,{className:`h-[1.05em] w-[1.05em]`,strokeWidth:2.25})}):null,(0,R.jsx)(`span`,{className:B(`min-w-0 shrink truncate`,o),children:e}),(0,R.jsx)(`span`,{className:B(`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-muted-foreground/80 transition-opacity`,n?`opacity-100`:`opacity-0 group-hover/process-row:opacity-100 focus-visible:opacity-100`),children:(0,R.jsx)(Ao,{className:B(`h-[1.05em] w-[1.05em] transition-transform`,n&&`rotate-90`),strokeWidth:2.25})})]})}function wV(e,t,n){let r=Array.from(t).length;return(n??`${e} · {count}`).split(`{count}`).join(String(r))}function TV({label:e,text:t,characterCountTemplates:n,isUser:r,isInProgress:i}){let{isOpen:a,onSummaryClick:o}=hV({isInProgress:i}),s=(0,L.useRef)(null),c=wV(e,t,i?n?.inProgress:n?.completed),{onScroll:l}=_V({scrollRef:s,resetKey:`reasoning`,isLoading:!1,hasContent:t.length>0,contentVersion:t,stickyThresholdPx:20});return(0,R.jsxs)(`div`,{className:`group/reasoning`,children:[(0,R.jsx)(CV,{openGroup:`reasoning`,open:a,icon:To,leadingIconClassName:r?`bg-primary`:`bg-card`,label:c,labelClassName:r?`text-primary-100`:void 0,onClick:o}),a?(0,R.jsx)(`div`,{ref:s,onScroll:l,"data-reasoning-scroll":`true`,className:B(`mt-1 w-fit max-w-[500px] max-h-56 overflow-y-auto rounded-lg custom-scrollbar`,r?`bg-primary/70`:`bg-muted`),children:(0,R.jsx)(`pre`,{className:`min-w-0 whitespace-pre-wrap break-all p-2 text-[11px]`,children:t})}):null]})}function EV({children:e,className:t}){return(0,R.jsx)(`div`,{className:B(`relative my-0 flex w-full min-w-0 max-w-full flex-col text-[0.925rem] leading-[1.72] text-muted-foreground`,t),children:e})}function DV({children:e,className:t}){return(0,R.jsx)(`div`,{className:B(`mt-0.5 w-full max-w-full min-w-0 overflow-hidden pl-[calc(1.15em+0.375rem)] text-[0.925rem] leading-[1.72] text-muted-foreground`,t),children:e})}function OV({label:e,tone:t,children:n}){let r={input:{dot:`bg-muted-foreground/60`,body:`text-foreground`},output:{dot:`bg-primary/70`,body:`text-foreground`},error:{dot:`bg-rose-500/80`,body:`text-rose-950/85`}}[t];return(0,R.jsxs)(`section`,{className:`overflow-hidden rounded-md border border-border/70 bg-muted/20`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/60 px-2.5 py-1.5 text-[10px] font-medium tracking-wide text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:B(`h-1.5 w-1.5 rounded-full`,r.dot)}),(0,R.jsx)(`span`,{className:`normal-case tracking-normal`,children:e})]}),(0,R.jsx)(`div`,{className:`w-full overflow-hidden`,children:(0,R.jsx)(`pre`,{className:B(`w-full max-w-full min-w-0 max-h-64 overflow-x-auto overflow-y-auto px-2.5 py-2 font-mono text-[12px] leading-relaxed whitespace-pre custom-scrollbar`,r.body),children:n})})]})}var kV={running:{text:`text-muted-foreground`,icon:Un,spin:!0},success:{text:`text-muted-foreground/75`,icon:fn,spin:!1},error:{text:`text-destructive`,icon:Xs,spin:!1},cancelled:{text:`text-muted-foreground/70`,icon:Ts,spin:!1}};function AV({card:e,iconOnly:t=!1}){let n=kV[e.statusTone]||kV.cancelled,r=n.icon,i=!t&&(e.statusTone===`running`||e.statusTone===`error`);return(0,R.jsxs)(`span`,{className:B(`inline-flex shrink-0 items-center gap-1 text-[0.925rem] font-normal leading-[1.72]`,n.text),"aria-label":t?e.statusLabel:void 0,children:[(0,R.jsx)(r,{"aria-hidden":`true`,className:B(`h-[1.05em] w-[1.05em]`,n.spin&&`animate-spin`),strokeWidth:2.25}),i?e.statusLabel:null]})}function jV(e){return e.kind===`show-content`?{icon:On,label:e.label,toneClassName:`border-border/70 bg-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:ring-primary/35`}:{icon:bo,label:e.label??(e.sessionKind===`child`?`Open child session`:`Open session`),toneClassName:`border-border/70 bg-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:ring-primary/35`}}function MV({action:e,onAction:t}){let{Tooltip:n,TooltipContent:r,TooltipProvider:i,TooltipTrigger:a}=g_,o=jV(e),s=o.icon;return(0,R.jsx)(i,{delayDuration:250,children:(0,R.jsxs)(n,{children:[(0,R.jsx)(a,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(e)},className:B(`inline-flex h-6 w-6 items-center justify-center rounded-md border transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1`,o.toneClassName),"aria-label":o.label,title:o.label,children:(0,R.jsx)(s,{className:`h-3.5 w-3.5`,strokeWidth:2.25})})}),(0,R.jsx)(r,{side:`top`,className:`text-xs`,children:o.label})]})})}function NV(e){return e.replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim()}function PV(e,t){e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),t())}function FV({label:e,summary:t}){return(0,R.jsxs)(`span`,{className:`min-w-0 shrink truncate`,children:[e,t?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`mx-1.5 select-none text-muted-foreground/45`,children:`·`}),(0,R.jsx)(`span`,{title:t,children:t})]}):null]})}function IV({expanded:e}){return(0,R.jsx)(`span`,{className:B(`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-muted-foreground/80 transition-opacity`,e?`opacity-100`:`opacity-0 group-hover/process-row:opacity-100 group-focus-within/process-row:opacity-100`),children:(0,R.jsx)(Ao,{className:B(`h-[1.05em] w-[1.05em] transition-transform`,e&&`rotate-90`),strokeWidth:2.25})})}function LV({additions:e,deletions:t}){if(e===0&&t===0)return null;let n=[e>0?`+${e}`:null,t>0?`-${t}`:null].filter(Boolean).join(` `);return(0,R.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 tabular-nums text-muted-foreground/75`,"aria-label":n,children:[e>0?(0,R.jsxs)(`span`,{className:`transition-colors group-hover/process-row:text-emerald-600`,children:[`+`,e]}):null,t>0?(0,R.jsxs)(`span`,{className:`transition-colors group-hover/process-row:text-rose-600`,children:[`-`,t]}):null]})}function RV({card:e,toolLabel:t,changeSummary:n,icon:r,expanded:i,canExpand:a,hideSummary:o=!1,actionSlot:s,onToggle:c}){let l=o?``:e.summary?.replace(/^(command|path|args|query|input):\s*/i,``)??``,u=t??NV(e.toolName);return(0,R.jsxs)(SV,{interactive:a,onClick:a?()=>c():void 0,role:a?`button`:void 0,tabIndex:a?0:void 0,onKeyDown:a?e=>PV(e,c):void 0,children:[(0,R.jsx)(bV,{className:`relative z-[1] rounded-sm bg-card`,children:(0,R.jsx)(r,{className:`h-[1.05em] w-[1.05em]`,strokeWidth:2.25})}),(0,R.jsx)(FV,{label:u,summary:l}),n?(0,R.jsx)(LV,{...n}):null,(0,R.jsx)(AV,{card:e,iconOnly:!!t}),a?(0,R.jsx)(IV,{expanded:i}):null,s?(0,R.jsx)(`span`,{className:`inline-flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover/process-row:opacity-100 group-focus-within/process-row:opacity-100`,children:s}):null]})}function zV({action:e,onAction:t}){return(0,R.jsx)(MV,{action:e,onAction:t})}var BV=`font-mono text-[11px] leading-5`,VV=`flex h-5 w-full ${BV}`,HV=`flex h-5 items-center justify-center px-2.5 tabular-nums select-none`;function UV(e){return String(e.newLineNumber??e.oldLineNumber??``)}function WV(e,t){return typeof t==`number`&&(e.newLineNumber??e.oldLineNumber)===t}function GV(e,t,n){return`${e}-${n}-${t.oldLineNumber??`x`}-${t.newLineNumber??`x`}`}function KV(e){return typeof e.newLineNumber==`number`||typeof e.oldLineNumber==`number`}function qV(e){return e.lines.some(KV)}function JV(e){let t=e.lines.reduce((e,t)=>KV(t)?Math.max(e,UV(t).length):e,0);return`${Math.max(6.5,Math.min(8,t+3.5))}ch`}function YV(e){return`calc(${e.lines.reduce((e,t)=>Math.max(e,Math.max(1,t.text.length)),1)}ch + 1.25rem)`}function XV(e){let t=e.split(/[\\/]/).filter(Boolean).pop()??e,n=t.split(/[?#]/)[0]??t,r=n.lastIndexOf(`.`);return r<=0||r===n.length-1?null:n.slice(r+1).toLowerCase()}function ZV(e){return e.languageHint?.trim()||XV(e.path)||`text`}function QV(e){let t=e.toLowerCase().replace(/[^a-z0-9-]/g,`-`);return t?`language-${t}`:`language-text`}function $V(e){return e.kind===`remove`?`border-r border-rose-200 bg-rose-50 text-rose-700`:e.kind===`add`?`border-r border-emerald-200 bg-emerald-50 text-emerald-700`:`border-r border-border bg-muted text-muted-foreground`}function eH(e){return e.kind===`remove`?`bg-rose-50 text-rose-950`:e.kind===`add`?`bg-emerald-50 text-emerald-950`:`bg-card text-foreground`}function tH({layout:e,line:t,lineNumberColumnWidth:n,target:r,targetRef:i}){return(0,R.jsx)(`span`,{ref:i,"data-file-line-number-cell":`true`,style:e===`compact`?{width:n,minWidth:n}:void 0,className:B(HV,e===`compact`?`sticky left-0 z-[1]`:`w-full shrink-0`,$V(t),r?`bg-gray-200 font-medium text-gray-950`:null),children:UV(t)})}function nH({language:e,line:t,target:n,targetColumn:r,targetRef:i}){let a=(0,L.useMemo)(()=>hz.highlight(t.text||` `,e),[e,t.text]),o=typeof r==`number`&&Number.isSafeInteger(r)&&r>0?Math.min(r,t.text.length+1):null;return(0,R.jsxs)(`span`,{ref:o?void 0:i,"data-file-code-row":`true`,"data-file-code-language":a.language,"data-highlighted":a.highlighted?`true`:`false`,"data-file-target-column":o??void 0,className:B(`chat-file-code-syntax hljs relative block min-w-0 flex-1 whitespace-pre px-2.5`,QV(a.language),eH(t),n?`bg-gray-100/90`:null),children:[(0,R.jsx)(`span`,{dangerouslySetInnerHTML:{__html:a.html}}),o?(0,R.jsx)(`span`,{ref:i,"aria-hidden":`true`,"data-file-target-caret":`true`,className:`pointer-events-none absolute inset-y-0 w-px bg-primary`,style:{left:`calc(0.625rem + ${o-1}ch)`}}):null]})}function rH({language:e,line:t,showLineNumbers:n,lineNumberColumnWidth:r}){return(0,R.jsxs)(`div`,{"data-file-line-row":`true`,className:VV,children:[n?(0,R.jsx)(tH,{layout:`compact`,line:t,lineNumberColumnWidth:r}):null,(0,R.jsx)(nH,{language:e,line:t})]})}function iH({block:e,targetColumn:t,targetLine:n}){let r=qV(e),i=JV(e),a=YV(e),o=ZV(e),s=(0,L.useRef)(null);return(0,L.useLayoutEffect)(()=>{s.current?.scrollIntoView({block:`center`,inline:t?`center`:`nearest`})},[e,t,n]),(0,R.jsxs)(`div`,{"data-file-code-surface":`true`,"data-file-code-surface-layout":`workspace`,className:`flex h-full min-h-full min-w-full bg-card`,children:[r?(0,R.jsxs)(`div`,{"data-file-code-gutter":`true`,style:{width:i,minWidth:i},className:B(`flex h-full min-h-full shrink-0 flex-col`,BV),children:[e.lines.map((e,r)=>(0,R.jsx)(tH,{layout:`workspace`,line:e,lineNumberColumnWidth:i,target:WV(e,n),targetRef:!t&&WV(e,n)?s:void 0},GV(`gutter`,e,r))),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 border-r border-border bg-muted`})]}):null,(0,R.jsxs)(`div`,{"data-file-code-canvas":`true`,className:`flex h-full min-h-full min-w-0 flex-1 flex-col bg-card`,children:[(0,R.jsx)(`div`,{"data-file-code-stack":`true`,className:`min-w-full`,style:{minWidth:a},children:e.lines.map((e,i)=>{let a=WV(e,n);return(0,R.jsx)(`div`,{"data-file-code-canvas-row":`true`,"data-file-target-line":a?`true`:void 0,"aria-current":a?`location`:void 0,className:VV,children:(0,R.jsx)(nH,{language:o,line:e,target:a,targetColumn:a?t:null,targetRef:a&&(t||!r)?s:void 0})},GV(`code`,e,i))})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 bg-card`})]})]})}function aH({block:e,layout:t=`compact`,targetColumn:n,targetLine:r}){if(t===`workspace`)return(0,R.jsx)(iH,{block:e,targetColumn:n,targetLine:r});let i=qV(e),a=JV(e),o=YV(e),s=i?`calc(${a} + ${o})`:o,c=ZV(e);return(0,R.jsx)(`div`,{"data-file-code-surface":`true`,"data-file-code-surface-layout":`compact`,className:`overflow-x-auto custom-scrollbar bg-card`,children:(0,R.jsx)(`div`,{"data-file-code-stack":`true`,className:`min-w-full`,style:{minWidth:s},children:e.lines.map((e,t)=>(0,R.jsx)(rH,{language:c,line:e,showLineNumbers:i,lineNumberColumnWidth:a},GV(`row`,e,t)))})})}function oH({block:e}){return(0,R.jsx)(aH,{block:e,layout:`compact`})}function sH(e){return e.display===`preview`}function cH(e){return e.rawText?e.rawText:e.lines.map(e=>[e.kind,e.oldLineNumber??``,e.newLineNumber??``,e.text].join(`:`)).join(`
|
|
53
|
-
`)}function lH(e){return/^\+\d+$/.test(e)?`text-emerald-700`:/^-\d+$/.test(e)?`text-rose-700`:`text-muted-foreground`}function uH(e){let t=e.split(`·`).map(e=>e.trim()).filter(e=>/^\+\d+$/.test(e)||/^-\d+$/.test(e));return t.length===0?null:(0,R.jsx)(`div`,{className:`flex shrink-0 items-center gap-x-1 whitespace-nowrap text-[10px] font-medium uppercase tracking-[0.08em]`,children:t.map((e,t)=>(0,R.jsxs)(L.Fragment,{children:[t>0?(0,R.jsx)(`span`,{className:`text-muted-foreground/45`,children:`·`}):null,(0,R.jsx)(`span`,{className:B(lH(e)),children:e})]},`${e}-${t}`))})}function dH(e){return{path:e.path,label:e.path.split(`/`).filter(Boolean).pop()??e.path,viewMode:e.display===`diff`?`diff`:`preview`,...e.rawText?{rawText:e.rawText}:{},...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...e.patchText?{patchText:e.patchText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{},fullLines:e.fullLines??e.lines}}function fH({children:e,contentVersion:t,resetKey:n,className:r,scrollKind:i}){let a=(0,L.useRef)(null),{onScroll:o}=_V({scrollRef:a,resetKey:n,isLoading:!1,hasContent:!0,contentVersion:t,stickyThresholdPx:20});return(0,R.jsx)(`div`,{ref:a,onScroll:o,"data-file-scroll-kind":i,className:B(`overflow-y-auto bg-card custom-scrollbar`,r),children:e})}function pH({block:e,showPathRow:t,isFirst:n,onFileOpen:r}){let{Tooltip:i,TooltipContent:a,TooltipProvider:o,TooltipTrigger:s}=g_,c=sH(e),l=t||!!e.caption;return(0,R.jsxs)(`section`,{className:B(`overflow-hidden bg-card`,!n&&`border-t border-border`),children:[l?(0,R.jsxs)(`div`,{className:B(`flex min-h-9 items-center justify-between gap-4 border-b border-border px-3 text-muted-foreground`,t?`py-2`:`py-1.5`),children:[(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:t?(0,R.jsx)(o,{delayDuration:250,children:(0,R.jsxs)(i,{children:[(0,R.jsx)(s,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,onClick:()=>{r&&r(dH(e))},className:B(`w-full truncate whitespace-nowrap text-left font-mono text-[12px] font-medium leading-5 text-foreground`,r&&`transition-colors hover:text-primary hover:underline`),title:e.path,children:e.path})}),(0,R.jsx)(a,{side:`top`,className:`max-w-[420px] text-xs font-mono break-all`,children:e.path})]})}):null}),e.caption?uH(e.caption):null]}):null,e.lines.length>0?(0,R.jsx)(fH,{resetKey:`block:${e.key}`,contentVersion:cH(e),className:`max-h-72`,scrollKind:`block`,children:(0,R.jsx)(oH,{block:e})}):e.rawText?(0,R.jsx)(fH,{resetKey:`raw:${e.key}`,contentVersion:e.rawText,className:`max-h-72`,scrollKind:`raw`,children:(0,R.jsx)(`div`,{className:`overflow-x-auto custom-scrollbar`,children:(0,R.jsx)(`pre`,{className:`min-w-max whitespace-pre bg-card px-3 py-2 font-mono text-[11px] leading-5 text-foreground`,children:e.rawText})})}):null,e.truncated&&!c?(0,R.jsx)(`div`,{className:`border-t border-border bg-muted px-3 py-2 text-[10px] text-muted-foreground`,children:`Showing a shortened diff preview.`}):null]})}function mH({card:e,className:t,onFileOpen:n,showPathRow:r=!0}){let i=e.fileOperation?.blocks??[],a=e.output?.trim()??``;return i.length===0&&!a?null:(0,R.jsxs)(`div`,{className:B(`overflow-hidden rounded-md border border-border/70 bg-card`,t),children:[i.map((e,t)=>(0,R.jsx)(pH,{block:e,showPathRow:r,isFirst:t===0,onFileOpen:n},e.key)),a?(0,R.jsx)(fH,{resetKey:`output:${e.toolName}:${e.summary??`none`}`,contentVersion:a,className:B(`max-h-56`,i.length>0&&`border-t border-border`),scrollKind:`output`,children:(0,R.jsx)(`div`,{className:`overflow-x-auto custom-scrollbar`,children:(0,R.jsx)(`pre`,{className:`min-w-max whitespace-pre bg-card px-3 py-2 font-mono text-[11px] leading-5 text-foreground`,children:a})})}):null]})}var hH=`\x1B`,gH=RegExp(`${hH}\\[(.*?)([ -/]*[@-~])`,`g`);function _H(e){return e.includes(`${hH}[`)}function vH(e){return e.replace(RegExp(`${hH}\\[[0-?]*[ -/]*[@-~]`,`g`),``)}function yH(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}var bH={bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1},xH={1:{bold:!0},2:{dim:!0},3:{italic:!0},4:{underline:!0},7:{inverse:!0},22:{bold:!1,dim:!1},23:{italic:!1},24:{underline:!1},27:{inverse:!1},39:{fg:void 0},49:{bg:void 0}},SH={30:`black`,31:`red`,32:`green`,33:`yellow`,34:`blue`,35:`magenta`,36:`cyan`,37:`white`,90:`bright-black`,91:`bright-red`,92:`bright-green`,93:`bright-yellow`,94:`bright-blue`,95:`bright-magenta`,96:`bright-cyan`,97:`bright-white`},CH={40:`black`,41:`red`,42:`green`,43:`yellow`,44:`blue`,45:`magenta`,46:`cyan`,47:`white`,100:`bright-black`,101:`bright-red`,102:`bright-green`,103:`bright-yellow`,104:`bright-blue`,105:`bright-magenta`,106:`bright-cyan`,107:`bright-white`};function wH(e,t){let n=e[t+1];return n===5&&typeof e[t+2]==`number`?{color:`ansi-256-${e[t+2]}`,consumed:2}:n===2&&typeof e[t+2]==`number`&&typeof e[t+3]==`number`&&typeof e[t+4]==`number`?{color:`rgb(${e[t+2]},${e[t+3]},${e[t+4]})`,consumed:4}:null}function TH(e,t){let n={...e};for(let e=0;e<t.length;e+=1){let r=t[e];if(r===0)return{...bH};let i=xH[r];if(i){n={...n,...i};continue}if(r===38||r===48){let i=wH(t,e);i&&(n=r===38?{...n,fg:i.color}:{...n,bg:i.color},e+=i.consumed);continue}if(SH[r]){n={...n,fg:SH[r]};continue}CH[r]&&(n={...n,bg:CH[r]})}return n}function EH(e){let t=[`ansi`];return e.bold&&t.push(`ansi-bold`),e.dim&&t.push(`ansi-dim`),e.italic&&t.push(`ansi-italic`),e.underline&&t.push(`ansi-underline`),e.inverse&&t.push(`ansi-inverse`),e.fg&&(e.fg.startsWith(`rgb(`)?t.push(`ansi-fg-custom`):e.fg.startsWith(`ansi-256-`)?(t.push(`ansi-fg-256`),t.push(e.fg)):t.push(`ansi-fg-${e.fg}`)),e.bg&&(e.bg.startsWith(`rgb(`)?t.push(`ansi-bg-custom`):e.bg.startsWith(`ansi-256-`)?(t.push(`ansi-bg-256`),t.push(e.bg)):t.push(`ansi-bg-${e.bg}`)),t.join(` `)}function DH(e){let t=[];return e.fg?.startsWith(`rgb(`)&&t.push(`color:${e.fg}`),e.bg?.startsWith(`rgb(`)&&t.push(`background-color:${e.bg}`),t.length>0?t.join(`;`):void 0}function OH(e){let t=EH(e),n=DH(e);return n?`<span class="${t}" style="${n}">`:`<span class="${t}">`}function kH(e){if(!e)return``;if(!_H(e))return yH(e);let t=``,n=0,r={...bH},i=!1,a=e=>{e&&(i||=(t+=OH(r),!0),t+=yH(e))},o=()=>{i&&=(t+=`</span>`,!1)};return e.replace(gH,(t,i,s,c)=>{if(a(e.slice(n,c)),n=c+t.length,s!==`m`)return t;let l=i.trim().length===0?[0]:i.split(`;`).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e));return o(),r=TH(r,l.length>0?l:[0]),t}),a(e.slice(n)),o(),t}var AH=12e4;function jH(e){return e.length<=AH?e:`${e.slice(0,AH)}\n…`}function MH({code:e,language:t,preferAnsi:n=!1,className:r}){let i=jH(e),a=(0,L.useMemo)(()=>{if(n&&_H(i))return{html:kH(i),language:`ansi`,highlighted:!0};let e=vH(i);return hz.highlight(e,t)},[t,n,i]);return(0,R.jsx)(`code`,{className:B(`hljs chat-terminal-code`,`language-${a.language}`,r),"data-highlighted":a.highlighted?`true`:`false`,dangerouslySetInnerHTML:{__html:a.html}})}function NH({command:e,output:t,emptyLabel:n,isRunning:r,hasOutput:i,isError:a=!1}){return(0,R.jsx)(`div`,{className:B(`chat-terminal-surface`,a?`chat-terminal-surface-error`:void 0),"data-testid":`chat-terminal-surface`,children:(0,R.jsxs)(`div`,{className:`chat-terminal-body custom-scrollbar`,children:[(0,R.jsxs)(`div`,{className:`chat-terminal-line chat-terminal-line-command`,children:[(0,R.jsx)(`span`,{className:`chat-terminal-gutter`,"aria-hidden":`true`,children:`$`}),(0,R.jsx)(`div`,{className:`chat-terminal-line-content`,children:e?(0,R.jsxs)(`pre`,{className:`chat-terminal-pre`,children:[(0,R.jsx)(MH,{code:e,language:`bash`}),r&&!i?(0,R.jsx)(`span`,{className:`chat-terminal-caret`,"aria-hidden":`true`}):null]}):(0,R.jsx)(`div`,{className:`chat-terminal-skeleton`})})]}),(i||!r)&&(0,R.jsx)(`div`,{className:`chat-terminal-output-block`,children:i?(0,R.jsxs)(`pre`,{className:B(`chat-terminal-pre chat-terminal-output`,a?`chat-terminal-pre-error`:void 0),children:[(0,R.jsx)(MH,{code:t,language:a?`text`:`shell`,preferAnsi:!0,className:a?`chat-terminal-code-error`:void 0}),r?(0,R.jsx)(`span`,{className:`chat-terminal-caret`,"aria-hidden":`true`}):null]}):(0,R.jsx)(`div`,{className:`chat-terminal-empty`,children:n})})]})})}var PH=200;function FH(e){return typeof e==`string`&&e.length>0?e:null}function IH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function LH(e){return`command`in e||`workingDir`in e||`exitCode`in e||`durationMs`in e||`stdout`in e||`stderr`in e||`aggregated_output`in e||`combinedOutput`in e}function RH(e){let t=FH(e.aggregated_output)??FH(e.combinedOutput)??FH(e.output);if(t)return t;let n=FH(e.stdout),r=FH(e.stderr);return!n&&!r?null:[n,r].filter(e=>!!e).join(`
|
|
54
|
-
`)}function zH(e,t){if(IH(t)){let e=RH(t);if(e)return e;if(LH(t))return``}if(!e)return``;let n=e.trim();if(!n.startsWith(`{`))return e;try{let t=JSON.parse(n);return IH(t)?RH(t)||(LH(t)?``:e):e}catch{return e}}function BH(e){return e===`write_file`||e===`edit_file`}function VH(e){return e.reduce((e,t)=>({additions:e.additions+t.lines.filter(e=>e.kind===`add`).length,deletions:e.deletions+t.lines.filter(e=>e.kind===`remove`).length}),{additions:0,deletions:0})}function HH({canExpand:e,isRunning:t,autoExpandWhileRunning:n=!0,expandOnError:r=!1,statusTone:i}){let[a,o]=(0,L.useState)(!1),[s,c]=(0,L.useState)(!1),l=(0,L.useRef)(null),u=(0,L.useRef)(t),d=(0,L.useRef)(!0);return(0,L.useEffect)(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]),(0,L.useEffect)(()=>{if(r&&i===`error`&&e&&!s){l.current!==null&&(window.clearTimeout(l.current),l.current=null),o(!0),u.current=t,d.current=!1;return}n&&t&&e&&!s&&!a&&(d.current||!u.current)&&(l.current=window.setTimeout(()=>{o(!0),l.current=null},PH)),t||(l.current!==null&&(window.clearTimeout(l.current),l.current=null),u.current&&!s&&o(!1)),u.current=t,d.current=!1},[n,e,r,a,s,t,i]),{expanded:a,onToggle:()=>{e&&(l.current!==null&&(window.clearTimeout(l.current),l.current=null),o(e=>!e),c(!0))}}}function UH(e){return IH(e)?{exitCode:typeof e.exitCode==`number`?e.exitCode:typeof e.exit_code==`number`?e.exit_code:null,workingDir:FH(e.workingDir)??FH(e.cwd)??FH(e.working_directory)}:{}}function WH({card:e,toolLabel:t}){let n=zH(e.output,e.outputData),r=e.statusTone===`running`,i=e.summary?.replace(/^(command|path|args|query|input):\s*/i,``),a=n.trim().length>0,o=r||a||!!i?.trim(),s=UH(e.outputData),{expanded:c,onToggle:l}=HH({canExpand:o,isRunning:r,autoExpandWhileRunning:!1,expandOnError:o,statusTone:e.statusTone});return(0,R.jsxs)(EV,{children:[(0,R.jsx)(RV,{card:e,toolLabel:t,icon:Ys,expanded:c,canExpand:o,onToggle:l}),c&&(0,R.jsx)(DV,{className:`bg-transparent py-0`,children:(0,R.jsx)(NH,{command:i,output:n,emptyLabel:e.emptyLabel,isRunning:r,hasOutput:a,isError:e.statusTone===`error`,exitCode:s.exitCode,workingDir:s.workingDir})})]})}function GH({card:e,toolLabel:t,onFileOpen:n}){let r=e.input?.trim()??``,i=e.output?.trim()??``,a=e.statusTone===`running`,o=!!e.fileOperation?.blocks.length,s=!!r&&!o,c=o||!!r||!!i,l=e.fileOperation?.blocks??[],u=l.reduce((e,t)=>e+t.lines.length,0),d=l.reduce((e,t)=>t.rawText?e+t.rawText.length:e+t.lines.reduce((e,t)=>e+t.text.length+1,0),0),f=BH(e.toolName)&&!(a&&e.toolName===`write_file`&&(u>24||d>1200)),{expanded:p,onToggle:m}=HH({canExpand:c||a,isRunning:a,autoExpandWhileRunning:f,expandOnError:c,statusTone:e.statusTone}),h=e.toolName===`edit_file`||e.toolName===`write_file`||e.toolName===`apply_patch`||e.toolName===`file_change`;return(0,R.jsxs)(EV,{children:[(0,R.jsx)(RV,{card:e,toolLabel:t,changeSummary:h?VH(l):void 0,icon:h?Lo:yn,expanded:p,canExpand:c||a,hideSummary:!1,onToggle:m}),p&&c?(0,R.jsxs)(DV,{className:`bg-transparent py-0`,children:[s?(0,R.jsx)(OV,{label:e.inputLabel?.trim()||`Input`,tone:`input`,children:r}):null,s&&i?(0,R.jsx)(`div`,{className:`h-2`}):null,o||i?(0,R.jsx)(mH,{card:e,onFileOpen:n,showPathRow:!0}):null]}):null]})}function KH({card:e,toolLabel:t,icon:n=Tt}){let r=e.statusTone===`running`,i=e.output?.trim()??``,{expanded:a,onToggle:o}=HH({canExpand:!!i||r,isRunning:r,autoExpandWhileRunning:!1,statusTone:e.statusTone});return(0,R.jsxs)(EV,{children:[(0,R.jsx)(RV,{card:e,toolLabel:t,icon:n,expanded:a,canExpand:!!i||r,onToggle:o}),a&&i&&(0,R.jsx)(DV,{className:`py-0`,children:(0,R.jsx)(`pre`,{className:`font-mono text-[12px] text-muted-foreground whitespace-pre-wrap break-all w-full max-w-full max-h-64 overflow-y-auto overflow-x-hidden min-w-0 custom-scrollbar leading-relaxed`,children:i})})]})}function qH(e,t,n){let r=e.agentId&&n?n(e.agentId):null,i=e.action&&t?(0,R.jsx)(zV,{action:e.action,onAction:t}):null;return r||i?(0,R.jsxs)(R.Fragment,{children:[r,i]}):void 0}function JH({card:e,toolLabel:t,icon:n=tc,onToolAction:r,renderToolAgent:i}){let a=e.input?.trim()??``,o=e.output?.trim()??``,s=e.statusTone===`running`,c=a.length>0,l=o.length>0,u=c||l,d=qH(e,r,i),{expanded:f,onToggle:p}=HH({canExpand:u||s,isRunning:s,autoExpandWhileRunning:!1,statusTone:e.statusTone});return(0,R.jsxs)(EV,{children:[(0,R.jsx)(RV,{card:e,toolLabel:t,icon:n,expanded:f,canExpand:u||s,actionSlot:d,onToggle:p}),f&&u?(0,R.jsxs)(DV,{className:`bg-transparent py-0`,children:[c?(0,R.jsx)(OV,{label:e.inputLabel?.trim()||`Input`,tone:`input`,children:a}):null,c&&l?(0,R.jsx)(`div`,{className:`h-2`}):null,l?(0,R.jsx)(OV,{label:e.outputLabel?.trim()||`Output`,tone:e.statusTone===`error`?`error`:`output`,children:o}):null]}):null]})}function YH({card:e,onToolAction:t,renderPanelAppCard:n}){let{panelApp:r}=e;return r&&n?n(r):(0,R.jsx)(JH,{card:e,onToolAction:t})}function XH(e){let t=e.toLowerCase();return t===`exec`||t===`exec_command`||t===`execute_command`||t===`command_execution`||t===`bash`||t===`shell`||t.includes(`run_`)}function ZH(e){let t=e.toLowerCase();return t===`read_file`||t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`}function QH(e){let t=e.toLowerCase();return t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`}function $H(e){let t=e.toLowerCase();return t===`grep_search`||t===`find_files`||t.includes(`search`)}var eU={list_dir:{statusKind:`directory`,icon:ns},web_fetch:{statusKind:`web`,icon:Ho},message:{statusKind:`message`,icon:zs},sessions_list:{statusKind:`session`,icon:Ln},sessions_history:{statusKind:`session`,icon:Ln},sessions_request:{statusKind:`session`,icon:Ln},spawn:{statusKind:`agent`,icon:So},sessions_spawn:{statusKind:`agent`,icon:So},subagents:{statusKind:`agent`,icon:So},memory_search:{statusKind:`memory`,icon:To},memory_get:{statusKind:`memory`,icon:To},cron:{statusKind:`schedule`,icon:Eo},gateway:{statusKind:`system`,icon:Fn},view_image:{statusKind:`image`,icon:fs},show_file:{statusKind:`display`,icon:On},show_url:{statusKind:`display`,icon:On},show_panel_app:{statusKind:`display`,icon:On},show_content:{statusKind:`display`,icon:On}};function tU(e){return eU[e.toLowerCase()]??null}function nU({card:e,toolStatusLabels:t,onToolAction:n,onFileOpen:r,renderToolAgent:i,renderPanelAppCard:a}){if(e.panelApp)return(0,R.jsx)(YH,{card:e,onToolAction:n,renderPanelAppCard:a});let o=tU(e.toolName),s=o?t?.builtIn?.[o.statusKind]?.[e.statusTone]:void 0;return XH(e.toolName)?(0,R.jsx)(WH,{card:e,toolLabel:t?.terminal[e.statusTone]}):ZH(e.toolName)?(0,R.jsx)(GH,{card:e,toolLabel:QH(e.toolName)?t?.fileEdit[e.statusTone]:t?.fileRead[e.statusTone],onFileOpen:r}):$H(e.toolName)?(0,R.jsx)(KH,{card:e,toolLabel:s??t?.search[e.statusTone],icon:o?.icon}):(0,R.jsx)(JH,{card:e,toolLabel:s,icon:o?.icon,onToolAction:n,renderToolAgent:i})}function rU({group:e,open:t,isUser:n,reasoningCharacterCountTemplates:r,toolStatusLabels:i,onToolAction:a,onFileOpen:o,renderToolAgent:s,renderPanelAppCard:c,onOpenChange:l}){let u=e.parts.filter(e=>e.type===`tool-card`).length,d=t&&u>1;return(0,R.jsxs)(`div`,{className:`group/tool-activity`,children:[(0,R.jsx)(CV,{openGroup:`tool-activity`,open:t,icon:ec,leadingIconClassName:`bg-card`,label:e.label,onClick:()=>l(!t)}),t?(0,R.jsx)(`div`,{className:`text-[0.925rem] leading-[1.72]`,children:e.parts.map((t,l)=>{let u=l===e.parts.length-1;return(0,R.jsxs)(`div`,{className:`relative min-w-0`,children:[d?(0,R.jsx)(xV,{position:l===0?`first`:u?`last`:`middle`}):null,t.type===`tool-card`?(0,R.jsx)(nU,{card:t.card,toolStatusLabels:i,onToolAction:a,onFileOpen:o,renderToolAgent:s,renderPanelAppCard:c}):(0,R.jsx)(TV,{label:t.label,text:t.text,characterCountTemplates:r,isUser:n,isInProgress:!1})]},`tool-group-item-${e.startIndex+l}`)})}):null]})}var iU=3;function aU(e){return e.type===`tool-card`}function oU(e){return e?.type===`reasoning`||e?.type===`tool-card`&&!e.card.panelApp}function sU(e){let t=e.toLowerCase();return t===`list_dir`?`directory`:t.includes(`show_content`)||t.includes(`panel_app`)||t.includes(`panel`)?`panel`:t===`spawn`||t.includes(`subagent`)||t.includes(`session_request`)||t.includes(`agent`)&&!t.includes(`read`)?`agent`:t.includes(`web_`)||t.includes(`_web`)||t.includes(`url`)||t.includes(`fetch`)||t.includes(`http`)?`web`:t===`grep_search`||t===`find_files`||t===`search_files`||t.includes(`search`)||t.includes(`grep`)?`search`:t===`exec`||t===`exec_command`||t===`execute_command`||t===`command_execution`||t===`bash`||t===`shell`||t===`terminal`||t.includes(`run_`)?`bash`:t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`||t===`multi_replace`||t.includes(`write_file`)||t.includes(`edit_file`)||t.includes(`apply_patch`)?`edit`:t===`read_file`||t===`read`||t===`view_file`||t.includes(`read_file`)||t.startsWith(`read_`)?`read`:`other`}function cU(e){return e===`error`?0:e===`cancelled`?1:e===`running`?2:3}function lU(e,t,n){if(t!==`read`&&t!==`edit`&&t!==`directory`)return[`call:${n}`];let r=e.fileOperation?.blocks.map(({path:e})=>e.trim()).filter(Boolean),i=e.summary?.replace(/^(path|file):\s*/i,``).trim();return r?.length?r:[i||`call:${n}`]}function uU(e,t){let n=t.segmentTemplates[e.family],r=e.count===1?n.one:n.other.split(`{count}`).join(String(e.count));return e.tone===`error`?`${r} ${t.failedLabel}`:e.tone===`cancelled`?`${r} ${t.cancelledLabel}`:r}function dU(e){let t=[],n=new Map;for(let[r,i]of e.entries()){let e=sU(i.toolName),a=lU(i,e,r),o=n.get(e);if(!o){t.push(e),n.set(e,{units:new Set(a),tone:i.statusTone});continue}a.forEach(e=>o.units.add(e)),cU(i.statusTone)<cU(o.tone)&&(o.tone=i.statusTone)}let r=t.map(e=>{let t=n.get(e);return{family:e,count:t.units.size,tone:t.tone}});return r.sort((e,n)=>{let r=cU(e.tone)-cU(n.tone);return r===0?t.indexOf(e.family)-t.indexOf(n.family):r}),r}function fU(e){let{labels:t,segments:n}=e;if(n.length===0)return``;let r=n.slice(0,iU),i=n.length-r.length,a=r.map(e=>uU(e,t));return i>0&&a.push(`+${i}`),a.join(` · `)}function pU(e,t){let n=[],r=t,i=-1;for(;;){let t=e[r];if(!oU(t))break;n.push(t),t.type===`tool-card`&&(i=n.length-1),r+=1}return{candidateParts:n,lastToolOffset:i}}function mU(e,t){let n=[],r=0;for(;r<e.length;){let i=e[r];if(i.type!==`tool-card`||i.card.panelApp){n.push({kind:`part`,key:`part-${r}`,index:r,part:i}),r+=1;continue}let a=r,{candidateParts:o,lastToolOffset:s}=pU(e,a),c=o.filter(aU);if(c.length===1){n.push({kind:`part`,key:`part-${a}`,index:a,part:i}),r=a+1;continue}let l=o.slice(0,s+1);r=a+l.length;let u=dU(c.map(e=>e.card)),d=fU({segments:u,labels:t});n.push({kind:`tool-group`,key:`tool-group-${a}`,group:{key:`tool-group-${a}`,startIndex:a,endIndex:r-1,parts:l,segments:u,label:d}})}return n}var hU={segmentTemplates:{read:{one:`Read 1 file`,other:`Read {count} files`},edit:{one:`Edit 1 file`,other:`Edit {count} files`},directory:{one:`View 1 directory`,other:`View {count} directories`},search:{one:`Search 1 time`,other:`Search {count} times`},bash:{one:`Run 1 command`,other:`Run {count} commands`},web:{one:`Open 1 page`,other:`Open {count} pages`},agent:{one:`Start 1 subtask`,other:`Start {count} subtasks`},panel:{one:`Show 1 result`,other:`Show {count} results`},other:{one:`Use 1 tool`,other:`Use {count} tools`}},failedLabel:`failed`,cancelledLabel:`cancelled`};function gU(e){return{segmentTemplates:{...hU.segmentTemplates,...e.toolActivitySegmentTemplates??{}},failedLabel:e.toolActivityFailedLabel??hU.failedLabel,cancelledLabel:e.toolActivityCancelledLabel??hU.cancelledLabel}}function _U(e){return e===`pending`||e===`streaming`}function vU(e){return e.type===`reasoning`||e.type===`tool-card`}function yU(e){if(e.role!==`assistant`||!e.processSummary||_U(e.status))return null;let t=-1;for(let n=e.parts.length-1;n>=0;--n)if(vU(e.parts[n])){t=n;break}return t<0||t>=e.parts.length-1?null:{processParts:e.parts.slice(0,t+1),finalParts:e.parts.slice(t+1)}}function bU({index:e,isInProgress:t,isLastPart:n,isUser:r,onAttachmentOpen:i,onFileOpen:a,onInlineTokenClick:o,onToolAction:s,part:c,renderInlineDisplay:l,renderPanelAppCard:u,renderToolAgent:d,resolveFileContentUrl:f,role:p,texts:m}){let{type:h}=c;if(h===`markdown`){let{inlineTokens:r,text:i}=c;return(0,R.jsx)(IB,{text:i,role:p,texts:m,isStreaming:t&&n,inlineTokens:r,onFileOpen:a,onInlineTokenClick:o,resolveFileContentUrl:f,renderInlineDisplay:l},`markdown-${e}`)}if(h===`reasoning`){let{label:i,text:a}=c;return(0,R.jsx)(TV,{label:i,text:a,characterCountTemplates:m.reasoningCharacterCountTemplates,isUser:r,isInProgress:t&&n},`reasoning-${e}`)}if(h===`tool-card`){let{card:t}=c;return(0,R.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,R.jsx)(xV,{position:`single`}),(0,R.jsx)(nU,{card:t,toolStatusLabels:m.toolStatusLabels,onToolAction:s,onFileOpen:a,renderToolAgent:d,renderPanelAppCard:u})]},`tool-${e}`)}if(h===`file`){let{file:t}=c;return(0,R.jsx)(dV,{file:t,isUser:r,texts:m,onOpen:i},`file-${e}`)}if(h===`unknown`){let{label:t,rawType:n,text:r}=c;return(0,R.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/60 px-2.5 py-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`div`,{className:`font-semibold text-foreground`,children:[t,`: `,n]}),r?(0,R.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words text-[11px] text-muted-foreground`,children:r}):null]},`unknown-${e}`)}return null}function xU(e){let{isInProgress:t,isUser:n,onAttachmentOpen:r,onFileOpen:i,onInlineTokenClick:a,onToolActivityOpenChange:o,onToolAction:s,openToolGroupKeys:c,parts:l,renderInlineDisplay:u,renderPanelAppCard:d,renderToolAgent:f,resolveFileContentUrl:p,role:m,texts:h,indexOffset:g=0}=e;return mV(mU(l,gU(h))).map(e=>e.kind===`image-group`?(0,R.jsx)(fV,{group:e,indexOffset:g,isUser:n,texts:h,onOpen:r},`${e.key}-${g}`):e.kind===`tool-group`?(0,R.jsx)(rU,{group:e.group,open:c.has(e.group.key),isUser:n,reasoningCharacterCountTemplates:h.reasoningCharacterCountTemplates,toolStatusLabels:h.toolStatusLabels,onToolAction:s,onFileOpen:i,renderToolAgent:f,renderPanelAppCard:d,onOpenChange:t=>o(e.group.key,t)},e.key):bU({part:e.part,index:g+e.index,role:m,isUser:n,isInProgress:t,isLastPart:g+e.index===g+l.length-1,texts:h,onToolAction:s,onFileOpen:i,onAttachmentOpen:r,onInlineTokenClick:a,resolveFileContentUrl:p,renderInlineDisplay:u,renderToolAgent:f,renderPanelAppCard:d}))}var SU=(0,L.memo)(function({layout:e,message:t,texts:n,onToolAction:r,onFileOpen:i,onAttachmentOpen:a,onInlineTokenClick:o,renderInlineDisplay:s,renderToolAgent:c,renderPanelAppCard:l,resolveFileContentUrl:u}){let{role:d}=t,f=d===`user`,p=e===`flat`&&!f,m=_U(t.status),h=yU(t),[g,_]=(0,L.useState)(!1),[v,y]=(0,L.useState)(()=>new Set),b=(e,t)=>{y(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r}),t&&_(!0)};return(0,R.jsx)(`div`,{"data-chat-message-surface":p?`flat`:`card`,className:B(`max-w-full has-[[data-chat-message-wide-content=true]]:w-full`,p?`block w-full text-foreground`:`inline-block w-fit rounded-2xl border px-4 shadow-sm`,!p&&(f?`nextclaw-chat-message-user rounded-[1.45rem] border-primary bg-primary py-2.5 text-primary-foreground shadow-none`:d===`assistant`?`border-border bg-card pb-3 pt-4 text-card-foreground`:`border-border bg-muted/45 py-3 text-foreground`)),children:(0,R.jsx)(`div`,{className:`space-y-0`,children:h?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`group/process`,children:[(0,R.jsx)(`div`,{className:`mb-2 border-b border-border/60 pb-2`,children:(0,R.jsx)(CV,{openGroup:`process`,open:g,icon:_s,leadingIconClassName:`bg-card`,label:t.processSummary?.label,onClick:()=>_(e=>!e)})}),g?(0,R.jsx)(`div`,{className:`space-y-0`,children:xU({parts:h.processParts,role:d,isUser:f,isInProgress:m,texts:n,onToolAction:r,onFileOpen:i,onAttachmentOpen:a,onInlineTokenClick:o,resolveFileContentUrl:u,openToolGroupKeys:v,onToolActivityOpenChange:b,renderInlineDisplay:s,renderToolAgent:c,renderPanelAppCard:l})}):null]}),xU({parts:h.finalParts,role:d,isUser:f,isInProgress:m,texts:n,onToolAction:r,onFileOpen:i,onAttachmentOpen:a,onInlineTokenClick:o,resolveFileContentUrl:u,openToolGroupKeys:v,onToolActivityOpenChange:b,renderInlineDisplay:s,renderToolAgent:c,renderPanelAppCard:l,indexOffset:h.processParts.length})]}):xU({parts:t.parts,role:d,isUser:f,isInProgress:m,texts:n,onToolAction:r,onFileOpen:i,onAttachmentOpen:a,onInlineTokenClick:o,resolveFileContentUrl:u,openToolGroupKeys:v,onToolActivityOpenChange:b,renderInlineDisplay:s,renderToolAgent:c,renderPanelAppCard:l})})})});function CU({messageText:e,texts:t}){let{copied:n,copy:r}=wR({text:e}),i=n?t.copiedMessageLabel:t.copyMessageLabel,{Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=g_;return e?(0,R.jsx)(s,{delayDuration:250,children:(0,R.jsxs)(a,{children:[(0,R.jsx)(c,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,onClick:()=>void r(),className:`flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,"aria-label":i,children:n?(0,R.jsx)(fn,{className:`h-3.5 w-3.5`}):(0,R.jsx)(zo,{className:`h-3.5 w-3.5`})})}),(0,R.jsx)(o,{side:`top`,className:`text-xs`,children:i})]})}):null}function wU({action:e,open:t,onOpenChange:n,restoreFocusRef:r}){let{Dialog:i,DialogContent:a,DialogDescription:o,DialogHeader:s,DialogTitle:c}=g_;return(0,R.jsx)(i,{open:t,onOpenChange:n,children:(0,R.jsxs)(a,{className:`sm:max-w-xl`,closeLabel:e.dialog.closeLabel,onCloseAutoFocus:e=>{e.preventDefault(),r.current?.focus()},children:[(0,R.jsxs)(s,{className:`space-y-1 pr-8 text-left`,children:[(0,R.jsx)(c,{className:`text-lg font-semibold leading-tight text-foreground`,children:e.dialog.title}),e.dialog.description?(0,R.jsx)(o,{className:`text-sm leading-relaxed text-muted-foreground`,children:e.dialog.description}):null]}),(0,R.jsx)(`dl`,{className:`divide-y divide-border/70 rounded-xl border border-border/80 bg-muted/20 px-4`,children:e.dialog.rows.map(e=>(0,R.jsxs)(`div`,{className:`grid gap-1 py-3 sm:grid-cols-[11rem_minmax(0,1fr)] sm:gap-4`,children:[(0,R.jsx)(`dt`,{className:`text-xs font-medium text-muted-foreground`,children:e.label}),(0,R.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-xs leading-5 text-foreground`,children:e.value})]},e.label))})]})})}function TU({message:e}){let[t,n]=(0,L.useState)(!1),[r,i]=(0,L.useState)(!1),[a,o]=(0,L.useState)(null),s=(0,L.useRef)(null),{moreActions:c}=e,{Popover:l,PopoverContent:u,PopoverTrigger:d,Tooltip:f,TooltipContent:p,TooltipProvider:m,TooltipTrigger:h}=g_;return c?.items.length?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(l,{open:t,onOpenChange:n,children:[(0,R.jsx)(m,{delayDuration:250,children:(0,R.jsxs)(f,{children:[(0,R.jsx)(h,{asChild:!0,children:(0,R.jsx)(d,{asChild:!0,children:(0,R.jsx)(`button`,{ref:s,type:`button`,"aria-label":c.triggerLabel,className:`flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,children:(0,R.jsx)(Dn,{className:`h-3.5 w-3.5`})})})}),(0,R.jsx)(p,{side:`top`,className:`text-xs`,children:c.triggerLabel})]})}),(0,R.jsx)(u,{align:`end`,className:`w-52 p-1`,role:`menu`,children:c.items.map(e=>(0,R.jsx)(`button`,{type:`button`,role:`menuitem`,className:`flex w-full items-center rounded-lg px-3 py-2 text-left text-sm text-foreground transition-colors hover:bg-accent focus-visible:bg-accent focus-visible:outline-none`,onClick:()=>{n(!1),o(e),i(!0)},children:e.label},e.key))})]}),a?(0,R.jsx)(wU,{action:a,open:r,onOpenChange:i,restoreFocusRef:s}):null]}):null}function EU({message:e,texts:t}){return(0,R.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,R.jsx)(CU,{messageText:(0,L.useMemo)(()=>e.parts.map(e=>e.type===`markdown`||e.type===`unknown`?e.text:``).filter(e=>!!e?.trim()).join(`
|
|
55
|
-
|
|
56
|
-
`),[e.parts]),texts:t}),(0,R.jsx)(TU,{message:e})]})}var DU=/\u200B|\u200C|\u200D|\u2060|\uFEFF/g,OU=`
|
|
57
|
-
@keyframes nextclaw-chat-typing-text-sheen {
|
|
58
|
-
0% {
|
|
59
|
-
background-position: 160% 0;
|
|
60
|
-
}
|
|
61
|
-
100% {
|
|
62
|
-
background-position: -60% 0;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
.nextclaw-chat-typing-indicator__text {
|
|
66
|
-
background-image: linear-gradient(
|
|
67
|
-
100deg,
|
|
68
|
-
hsl(var(--muted-foreground)) 0%,
|
|
69
|
-
hsl(var(--muted-foreground)) 34%,
|
|
70
|
-
hsl(var(--foreground-tertiary)) 43%,
|
|
71
|
-
hsl(var(--foreground-muted)) 50%,
|
|
72
|
-
hsl(var(--foreground-tertiary)) 57%,
|
|
73
|
-
hsl(var(--muted-foreground)) 66%,
|
|
74
|
-
hsl(var(--muted-foreground)) 100%
|
|
75
|
-
);
|
|
76
|
-
background-size: 240% 100%;
|
|
77
|
-
background-position: 160% 0;
|
|
78
|
-
-webkit-background-clip: text;
|
|
79
|
-
background-clip: text;
|
|
80
|
-
color: transparent;
|
|
81
|
-
-webkit-text-fill-color: transparent;
|
|
82
|
-
animation: nextclaw-chat-typing-text-sheen 2.5s linear infinite;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@media (prefers-reduced-motion: reduce) {
|
|
86
|
-
.nextclaw-chat-typing-indicator__text {
|
|
87
|
-
animation: none;
|
|
88
|
-
background-image: none;
|
|
89
|
-
color: hsl(var(--muted-foreground));
|
|
90
|
-
-webkit-text-fill-color: currentColor;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
`;function kU(e){let t=e.trim();return t?t.replace(DU,``).trim().length>0:!1}function AU(e){return e.parts.some(e=>e.type===`markdown`||e.type===`reasoning`?kU(e.text):!0)}function jU(){return(0,R.jsx)(`div`,{className:`flex items-center gap-2 px-1 py-0.5 text-[11px] text-muted-foreground`,children:(0,R.jsxs)(`div`,{className:`flex space-x-1 items-center h-full`,children:[(0,R.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse`}),(0,R.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse [animation-delay:200ms]`}),(0,R.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse [animation-delay:400ms]`})]})})}function MU({label:e,layout:t}){return(0,R.jsxs)(`div`,{"data-chat-message-surface":t===`flat`?`flat`:`card`,className:B(`text-sm text-muted-foreground`,t===`flat`?`py-1`:`rounded-2xl border border-border bg-card px-4 py-3 shadow-sm`),children:[(0,R.jsx)(`style`,{children:OU}),(0,R.jsx)(`span`,{className:`nextclaw-chat-typing-indicator__text`,children:e})]})}function NU({assistantAvatarIcon:e,className:t,isSending:n,layout:r=`card`,messages:i,onAttachmentOpen:a,onFileOpen:o,onInlineTokenClick:s,onToolAction:c,renderInlineDisplay:l,renderPanelAppCard:u,renderToolAgent:d,resolveFileContentUrl:f,texts:p}){let m=i.filter(AU),h=m.some(e=>e.role===`assistant`&&(e.status===`streaming`||e.status===`pending`));return(0,R.jsxs)(`div`,{className:B(`space-y-5`,t),children:[m.map(t=>{let n=t.role===`user`,i=!n&&(t.status===`streaming`||t.status===`pending`),m=(0,R.jsx)(SU,{layout:r,message:t,texts:p,onToolAction:c,onFileOpen:o,onAttachmentOpen:a,onInlineTokenClick:s,resolveFileContentUrl:f,renderInlineDisplay:l,renderToolAgent:d,renderPanelAppCard:u});return r===`flat`&&!n?(0,R.jsxs)(`article`,{"data-chat-message-layout":`flat`,className:`w-full min-w-0 space-y-2`,children:[(0,R.jsxs)(`div`,{"data-chat-message-header":`flat`,className:`flex min-w-0 items-center gap-2.5`,children:[(0,R.jsx)(DO,{assistantIcon:e,role:t.role,size:`compact`}),(0,R.jsx)(`span`,{className:`truncate text-sm font-semibold text-foreground`,children:t.roleLabel})]}),(0,R.jsx)(`div`,{"data-chat-message-body":`flat`,className:`min-w-0 w-full`,children:m}),i?(0,R.jsx)(`div`,{className:`w-full`,children:(0,R.jsx)(jU,{})}):(0,R.jsxs)(`div`,{"data-chat-message-footer":`flat`,className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsxs)(`span`,{className:`px-1 text-[11px] leading-4 text-muted-foreground`,children:[t.timestampLabel,t.executionSummaryLabel?` · ${t.executionSummaryLabel}`:null]}),(0,R.jsx)(EU,{message:t,texts:p})]})]},t.id):(0,R.jsxs)(`div`,{"data-chat-message-layout":`card`,className:B(`flex gap-3`,n?`justify-end`:`justify-start`),children:[n?null:(0,R.jsx)(DO,{assistantIcon:e,role:t.role}),(0,R.jsxs)(`div`,{className:B(`w-fit max-w-[92%] space-y-2 has-[[data-chat-message-wide-content=true]]:w-full`,n&&`flex flex-col items-end`),children:[m,(0,R.jsx)(`div`,{className:B(`flex flex-wrap items-center gap-2`,n&&`justify-end`),children:i?(0,R.jsx)(jU,{}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:B(`px-1 text-[11px] leading-4 text-muted-foreground`,n?`text-right`:`text-left`),children:[t.roleLabel,` · `,t.timestampLabel,t.executionSummaryLabel?` · ${t.executionSummaryLabel}`:null]}),(0,R.jsx)(EU,{message:t,texts:p})]})})]}),n?(0,R.jsx)(DO,{role:t.role}):null]},t.id)}),n&&!h?(0,R.jsxs)(`div`,{"data-chat-message-layout":r,className:`flex justify-start gap-3`,children:[(0,R.jsx)(DO,{assistantIcon:e,role:`assistant`,size:r===`flat`?`compact`:`default`}),(0,R.jsx)(MU,{label:p.typingLabel,layout:r})]}):null]})}function PU(e){return{key:e.key,triggerSpecs:[e.trigger],resolvePanel:t=>t.trigger.key===e.trigger.key?e.resolvePanel(t):null}}function FU(e){let{data:t,plugins:n,trigger:r}=e,i=n.flatMap(e=>[...e.triggerSpecs]);if(!r)return{triggerSpecs:i,panel:null};for(let e of n){let n=e.resolvePanel({data:t,trigger:r});if(n)return{triggerSpecs:i,panel:n}}return{triggerSpecs:i,panel:null}}var IU=[`cmd`,`command`,`query`,`q`,`path`,`url`,`to`,`channel`,`agentId`,`sessionKey`];function LU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function RU(e,t=2400){return e.length<=t?e:`${e.slice(0,t)}\n…`}function zU(e,t=120){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:t<=1?`…`:`${n.slice(0,t-1)}…`}function BU(e){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(e==null)return``;try{return RU(JSON.stringify(e,null,2))}catch{return String(e)}}function VU(e){if(LU(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return null;try{let e=JSON.parse(t);return LU(e)?e:null}catch{return null}}function HU(e){let t=VU(e);if(!t){let t=BU(e).trim();return t?zU(t,120):void 0}let n=[];for(let e of IU){let r=t[e];if(typeof r==`string`&&r.trim()?n.push(`${e}: ${r.trim()}`):(typeof r==`number`||typeof r==`boolean`)&&n.push(`${e}: ${String(r)}`),n.length>=2)break}return n.length>0?zU(n.join(` · `),120):zU(BU(t),140)}var UU=`$`,WU=`@panel-app:`,GU=`@file:`,KU=`@folder:`;function qU(e){let{label:t,tokenKey:n,tokenKind:r}=e;return r===`skill`?`${UU}${t?.trim()||n}`:r===`panel_app`?`${WU}${n}`:r===`workspace_file`?`${GU}${encodeURIComponent(n)}`:r===`workspace_directory`?`${KU}${encodeURIComponent(n)}`:null}var JU=`@panel-app:`,YU=/@panel-app:([A-Za-z0-9_-]+)/g,XU=/@file:([^\s]+)/g,ZU=/@folder:([^\s]+)/g;function QU(e){let t=e.projectRoot?.trim().replace(/[\\/]+$/,``)??``,n=e.relativePath.trim().replace(/\\/g,`/`).split(`/`);if(!t||n.length===0||n.some(e=>!e||e===`.`||e===`..`))return null;let r=t.includes(`\\`)?`\\`:`/`;return`${t}${r}${n.join(r)}`}function $U(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function eW(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function tW(e){let t=new Set,n=[];for(let r of e){let e=`ref`in r?r.ref:r.key,i=`${r.kind}:${e}:${r.rawText}`;t.has(i)||(t.add(i),n.push(r))}return n}function nW(e,t=[]){let n=new Map(t.map(e=>[e.ref,e])),r=[];for(let t of e){if(t.type!==`token`||t.tokenKind!==`skill`&&t.tokenKind!==`workspace_file`&&t.tokenKind!==`workspace_directory`)continue;let e=qU(t);if(!e)continue;if(t.tokenKind===`skill`){let i=n.get(t.tokenKey);if(!i?.path.trim())continue;r.push({kind:`skill`,ref:i.ref,name:i.name,source:i.source,path:i.path,label:t.label,rawText:e});continue}let i=t.tokenKind===`workspace_file`?c:p;r.push({kind:i,key:t.tokenKey,label:t.label,rawText:e})}return tW(r)}function rW(e){let{kind:t,pattern:n,text:r,tokens:i}=e;for(let e of r.matchAll(n)){let n=e[1];if(!n)continue;let r;try{r=decodeURIComponent(n)}catch{continue}i.push({kind:t,key:r,label:r.split(`/`).filter(Boolean).at(-1)??r,rawText:e[0]})}}function iW(e){let t=[];for(let n of e.matchAll(YU)){let e=n[1];e&&t.push({kind:`panel_app`,key:e,label:e,rawText:`${JU}${e}`})}return rW({kind:c,pattern:XU,text:e,tokens:t}),rW({kind:p,pattern:ZU,text:e,tokens:t}),tW(t)}function aW(e,t){return tW([...t,...iW(e)])}function oW(e){let t=e?.[m];if(Array.isArray(t))return cW(t);if(!$U(t)||t.schemaVersion!==2||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!$U(e))continue;let t=eW(e.kind),r=eW(e.rawText),i=eW(e.label);if(!t||!i||!r)continue;if(t===`skill`){let a=eW(e.ref),o=eW(e.name),s=eW(e.path),c=sW(e.source);if(!a||!o||!s||!c)continue;n.push({kind:t,ref:a,name:o,source:c,path:s,label:i,rawText:r});continue}let a=eW(e.key);a&&n.push({kind:t,key:a,rawText:r,label:i})}return tW(n)}function sW(e){return e===`builtin`||e===`global`||e===`project`||e===`workspace`?e:null}function cW(e){let t=[];for(let n of e){if(!$U(n))continue;let e=eW(n.kind),r=eW(n.key),i=eW(n.rawText);if(!e||!r||!i)continue;let a=eW(n.label)??r;t.push(e===`skill`?{kind:e,ref:r,name:a,source:null,path:null,label:a,rawText:i}:{kind:e,key:r,label:a,rawText:i})}return tW(t)}function lW(e){return{schemaVersion:2,items:e}}var uW=/\u200B|\u200C|\u200D|\u2060|\uFEFF/g;function dW(e){let t=e.trim();return t&&t.replace(uW,``).trim()?t:null}function fW(e,t){let n=dW(e.text);if(!n)return null;let r=aW(e.text,t);return{type:`markdown`,text:n,inlineTokens:r.length>0?r:void 0}}function pW(e){return dW(e)}function mW(e){return typeof e==`object`&&!!e}function hW(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function gW(e){if(typeof e==`number`&&Number.isFinite(e)&&e>=0)return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=Number(t);return Number.isFinite(n)&&n>=0?n:null}function _W(e){return mW(e)?`command`in e||`workingDir`in e||`exitCode`in e||`stdout`in e||`stderr`in e||`aggregated_output`in e||`combinedOutput`in e:!1}function vW(e,t){if(!mW(e))return null;let n=mW(e.asset)?e.asset:Array.isArray(e.assets)&&e.assets.length>0&&mW(e.assets[0])?e.assets[0]:null;if(!n)return null;let r=hW(n.url),i=hW(n.mimeType)??`application/octet-stream`,a=gW(n.sizeBytes);return r?{type:`file`,file:{label:hW(n.name)??(i.startsWith(`image/`)?t.imageAttachmentLabel:t.fileAttachmentLabel),mimeType:i,dataUrl:r,...a==null?{}:{sizeBytes:a},isImage:i.startsWith(`image/`)}}:null}function yW(e,t){return{kind:e.kind,toolName:e.name,...`agentId`in e&&e.agentId?{agentId:e.agentId}:{},summary:e.detail,inputLabel:t.toolInputLabel,input:`input`in e&&typeof e.input==`string`?e.input:void 0,output:e.text,outputData:e.outputData,hasResult:!!e.hasResult,statusTone:e.statusTone,statusLabel:e.statusLabel,titleLabel:e.kind===`call`?t.toolCallLabel:t.toolResultLabel,outputLabel:t.toolOutputLabel,emptyLabel:t.toolNoOutputLabel,...`action`in e&&e.action?{action:e.action}:{},...`fileOperation`in e&&e.fileOperation?{fileOperation:e.fileOperation}:{},...`panelApp`in e&&e.panelApp?{panelApp:e.panelApp}:{}}}function bW(e){let{cancelled:t,error:n,result:r,status:i,texts:a}=e,o=typeof i==`string`?i.trim().toLowerCase():``,s=typeof n==`string`&&n.trim().length>0;return t===!0||o===`cancelled`?{kind:`result`,hasResult:!0,statusTone:`cancelled`,statusLabel:a.toolStatusCancelledLabel}:s||o===`error`?{kind:`result`,hasResult:!0,statusTone:`error`,statusLabel:a.toolStatusFailedLabel}:o===`result`||r!=null?{kind:`result`,hasResult:!0,statusTone:`success`,statusLabel:a.toolStatusCompletedLabel}:{kind:`call`,hasResult:!1,statusTone:`running`,statusLabel:a.toolStatusRunningLabel}}function xW(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function SW(e,t){return BU(t??xW(e)).trim()||void 0}function CW(e){return typeof e==`object`&&!!e}function wW(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function TW(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function EW(e){let t=wW(e);return CW(t)?TW(t.agentId):null}function DW(e){return EW(e.parsedArgs)??EW(e.args)??EW(e.result)}var OW=12e3,kW=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function AW(e){let t=e.replace(/\r\n/g,`
|
|
94
|
-
`).replace(/\r/g,`
|
|
95
|
-
`);return t===``?[]:t.split(`
|
|
96
|
-
`)}function jW(e){return typeof e==`number`?e+1:void 0}function MW(e){let{kind:t,newLineNumber:n,oldLineNumber:r,text:i}=e;return{kind:t,text:i,...typeof r==`number`?{oldLineNumber:r}:{},...typeof n==`number`?{newLineNumber:n}:{}}}function NW(e){let t=kW.exec(e);return t?{oldLineNumber:Number(t[1]),newLineNumber:Number(t[2])}:null}function PW(e){let{kind:t,newStartLine:n,oldStartLine:r,text:i}=e;return AW(i).map((e,i)=>MW(t===`add`?{kind:`add`,text:e,newLineNumber:n+i}:{kind:`context`,text:e,oldLineNumber:r+i,newLineNumber:n+i}))}function FW(e){let{afterLines:t,beforeLines:n,newStartLine:r,oldStartLine:i}=e,a=i,o=r;return[...n.map(e=>{let t=MW({kind:`remove`,text:e,oldLineNumber:a});return a=jW(a),t}),...t.map(e=>{let t=MW({kind:`add`,text:e,newLineNumber:o});return o=jW(o),t})]}function IW(e){let{afterLines:t,beforeLines:n}=e,r=Array.from({length:n.length+1},()=>Array.from({length:t.length+1},()=>0));for(let e=n.length-1;e>=0;--e)for(let i=t.length-1;i>=0;--i)r[e][i]=n[e]===t[i]?(r[e+1][i+1]??0)+1:Math.max(r[e+1][i]??0,r[e][i+1]??0);return r}function LW(e){let{afterIndex:t,afterLines:n,beforeIndex:r,beforeLines:i,lines:a,newLineNumber:o,oldLineNumber:s}=e,c=s,l=o;for(let e=r;e<i.length;e+=1)a.push(MW({kind:`remove`,text:i[e]??``,oldLineNumber:c})),c=jW(c);for(let e=t;e<n.length;e+=1)a.push(MW({kind:`add`,text:n[e]??``,newLineNumber:l})),l=jW(l)}function RW(e){let{afterText:t,beforeText:n,newStartLine:r,oldStartLine:i}=e,a=AW(n),o=AW(t);if(a.length*o.length>OW)return FW({beforeLines:a,afterLines:o,oldStartLine:i,newStartLine:r});let s=IW({beforeLines:a,afterLines:o}),c=[],l=0,u=0,d=i,f=r;for(;l<a.length&&u<o.length;){if(a[l]===o[u]){c.push(MW({kind:`context`,text:a[l]??``,oldLineNumber:d,newLineNumber:f})),l+=1,u+=1,d=jW(d),f=jW(f);continue}if((s[l+1][u]??0)>=(s[l][u+1]??0)){c.push(MW({kind:`remove`,text:a[l]??``,oldLineNumber:d})),l+=1,d=jW(d);continue}c.push(MW({kind:`add`,text:o[u]??``,newLineNumber:f})),u+=1,f=jW(f)}return LW({lines:c,beforeLines:a,afterLines:o,beforeIndex:l,afterIndex:u,oldLineNumber:d,newLineNumber:f}),c}var zW=120;function BW(e){let{lines:t,operation:n}=e,r=t.filter(e=>e.kind===`add`).length,i=t.filter(e=>e.kind===`remove`).length,a=[],o=n?.trim().toLowerCase()??``;return o&&o!==`update`&&a.push(o),r>0&&a.push(`+${r}`),i>0&&a.push(`-${i}`),a.length>0?a.join(` · `):void 0}function VW(e){let{afterText:t,beforeText:n,newStartLine:r,oldStartLine:i,operation:a}=e,o=a?.trim().toLowerCase()??``;return{oldStartLine:typeof i==`number`?i:(o===`delete`||o===`remove`)&&n!=null?1:void 0,newStartLine:typeof r==`number`?r:(o===`write`||o===`add`)&&t!=null?1:void 0}}function HW(e){return e.length<=zW?{lines:e,truncated:!1}:{lines:e.slice(0,zW),truncated:!0}}function UW(e){let{lines:t,operation:n,path:r}=e,i=HW(t);return{path:r,display:`diff`,caption:BW({operation:n,lines:t}),lines:i.lines,...i.truncated?{fullLines:t}:{},truncated:i.truncated}}function WW(e){let{newStartLine:t,oldStartLine:n,operation:r,path:i,text:a}=e,o=a.trim();if(!o)return null;let s=r?.trim().toLowerCase()===`write`?`add`:`context`,c=typeof n==`number`?n:1,l=typeof t==`number`?t:1,u=PW({text:o,kind:s,oldStartLine:c,newStartLine:l});return{path:i,display:`preview`,caption:BW({operation:r,lines:u}),lines:u,rawText:o,oldStartLine:c,newStartLine:l}}function GW(e){let{afterText:t,beforeText:n,operation:r,path:i}=e,{oldStartLine:a,newStartLine:o}=VW(e),s=RW({beforeText:n??``,afterText:t??``,oldStartLine:a,newStartLine:o}),c=HW(s);return c.lines.length===0?null:{path:i,display:`diff`,caption:BW({operation:r,lines:s}),lines:c.lines,...c.truncated?{fullLines:s}:{},...n==null?{}:{beforeText:n},...t==null?{}:{afterText:t},...typeof a==`number`?{oldStartLine:a}:{},...typeof o==`number`?{newStartLine:o}:{},truncated:c.truncated}}function KW(e){let{flushCurrent:t,line:n,setCurrent:r}=e;return n.startsWith(`*** Update File: `)?(t(),r(n.slice(17).trim(),`update`),!0):n.startsWith(`*** Add File: `)?(t(),r(n.slice(14).trim(),`add`),!0):n.startsWith(`*** Delete File: `)?(t(),r(n.slice(17).trim(),`delete`),!0):!1}function qW(e){let{currentLines:t,line:n,newLineNumber:r,oldLineNumber:i}=e;return n.startsWith(`+`)?(t.push(MW({kind:`add`,text:n.slice(1),newLineNumber:r})),{oldLineNumber:i,newLineNumber:jW(r)}):n.startsWith(`-`)?(t.push(MW({kind:`remove`,text:n.slice(1),oldLineNumber:i})),{oldLineNumber:jW(i),newLineNumber:r}):n.startsWith(` `)?(t.push(MW({kind:`context`,text:n.slice(1),oldLineNumber:i,newLineNumber:r})),{oldLineNumber:jW(i),newLineNumber:jW(r)}):{oldLineNumber:i,newLineNumber:r}}function JW(e){let t=[],n=null,r=null,i=[],a,o,s=()=>{if(!n){i=[],r=null,a=void 0,o=void 0;return}t.push(UW({path:n,operation:r,lines:i})),n=null,r=null,i=[],a=void 0,o=void 0};for(let t of AW(e)){if(KW({line:t,flushCurrent:s,setCurrent:(e,t)=>{n=e,r=t}})||t.startsWith(`*** Move to: `)||t.startsWith(`*** Begin Patch`)||t.startsWith(`*** End Patch`))continue;if(t.startsWith(`@@`)){let e=NW(t);a=e?.oldLineNumber,o=e?.newLineNumber;continue}if(!n)continue;let e=qW({currentLines:i,line:t,oldLineNumber:a,newLineNumber:o});a=e.oldLineNumber,o=e.newLineNumber}return s(),t}function YW(e){let t=[],n=null,r=[],i,a,o=()=>{if(!n){r=[],i=void 0,a=void 0;return}t.push(UW({path:n,operation:`update`,lines:r})),n=null,r=[],i=void 0,a=void 0};for(let t of AW(e)){if(t.startsWith(`+++ `)){o(),n=t.slice(4).trim().replace(/^b\//,``).replace(/^a\//,``);continue}if(t.startsWith(`--- `))continue;if(t.startsWith(`@@`)){let e=NW(t);i=e?.oldLineNumber,a=e?.newLineNumber;continue}if(!n)continue;let e=qW({currentLines:r,line:t,oldLineNumber:i,newLineNumber:a});i=e.oldLineNumber,a=e.newLineNumber}return o(),t}function XW(e){return e.includes(`*** Begin Patch`)?JW(e):e.includes(`--- `)&&e.includes(`+++ `)?YW(e):[]}function ZW(e){switch(e){case`"`:case`\\`:case`/`:return e;case`b`:return`\b`;case`f`:return`\f`;case`n`:return`
|
|
97
|
-
`;case`r`:return`\r`;case`t`:return` `;default:return e}}function QW(e,t){let n=`"${t}"`,r=e.indexOf(n);if(r<0)return null;let i=e.indexOf(`:`,r+n.length);if(i<0)return null;let a=i+1;for(;a<e.length&&/\s/.test(e[a]??``);)a+=1;return e[a]===`"`?a+1:null}function $W(e,t,n=1/0){let r=``,i=!1;for(let a=t;a<e.length;a+=1){let t=e[a];if(t==null)break;if(i){r+=ZW(t),i=!1;continue}if(t===`\\`){i=!0;continue}if(t===`"`)return{value:r,truncated:!1};if(r+=t,r.length>=n)return{value:r,truncated:!0}}return r.length>0?{value:r,truncated:!1}:null}function eG(e,t,n=1/0){for(let r of t){let t=QW(e,r);if(t!=null)return $W(e,t,n)}return null}function tG(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function nG(e){return typeof e==`string`&&e.trim()?e.trim():null}function rG(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:typeof e==`string`&&/^\d+$/.test(e.trim())?Number(e.trim()):null}function iG(e){if(tG(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`))return null;try{let e=JSON.parse(t);return tG(e)?e:null}catch{return null}}function aG(e){if(tG(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`))return null;let n=eG(t,[`path`,`filePath`,`file_path`,`targetPath`,`target_path`,`filename`,`name`])?.value??null,r=eG(t,[`content`,`text`,`afterText`,`after_text`])?.value??null,i=eG(t,[`oldText`,`beforeText`,`before_text`])?.value??null,a=eG(t,[`newText`,`afterText`,`after_text`])?.value??null,o=eG(t,[`patch`,`diff`,`unifiedDiff`,`unified_diff`])?.value??null,s={};return n&&(s.path=n),r&&(s.content=r),i&&(s.oldText=i),a&&(s.newText=a),o&&(s.patch=o),Object.keys(s).length>0?s:null}function oG(e){return nG(e.path)??nG(e.filePath)??nG(e.file_path)??nG(e.targetPath)??nG(e.target_path)??nG(e.filename)??nG(e.name)}function sG(e){return $(e.operation)??$(e.op)??$(e.action)??$(e.kind)??$(e.type)??$(e.status)}function cG(e,t){for(let n of t){let t=rG(e[n]);if(t!==null)return t}return null}function lG(e){return cG(e,[`oldStartLine`,`old_start_line`,`startOldLine`,`start_old_line`,`oldLineStart`,`old_line_start`,`oldLineNumber`,`old_line_number`,`lineStart`,`line_start`,`startLine`,`start_line`,`lineNumber`,`line_number`])}function uG(e){return cG(e,[`newStartLine`,`new_start_line`,`startNewLine`,`start_new_line`,`newLineStart`,`new_line_start`,`newLineNumber`,`new_line_number`,`lineStart`,`line_start`,`startLine`,`start_line`,`lineNumber`,`line_number`])}function dG(e){return $(e.patch)??$(e.diff)??$(e.unifiedDiff)??$(e.unified_diff)}function fG(e){return $(e.beforeText)??$(e.before_text)??$(e.oldText)??$(e.old_text)??$(e.oldContent)??$(e.old_content)??$(e.before)??$(e.previous)}function pG(e){return $(e.afterText)??$(e.after_text)??$(e.newText)??$(e.new_text)??$(e.newContent)??$(e.new_content)??$(e.content)??$(e.text)??$(e.after)??$(e.updated)}var mG=new Set([`file_change`,`read_file`,`write_file`,`edit_file`,`apply_patch`]);function hG(e){let t=e.map((e,t)=>({key:`${e.path}-${t+1}`,path:e.path,display:e.display,...e.caption?{caption:e.caption}:{},lines:e.lines,...e.fullLines?{fullLines:e.fullLines}:{},...e.rawText?{rawText:e.rawText}:{},...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{},...e.truncated?{truncated:!0}:{}})).filter(e=>e.lines.length>0||!!e.rawText);if(t.length===0)return null;let n=t.map(e=>e.path);return{summary:n.length===1?n[0]:`${n.length} files · ${n.slice(0,2).join(` · `)}${n.length>2?` …`:``}`,fileOperation:{blocks:t}}}function gG(e,t){let n=oG(e)??t,r=sG(e),i=lG(e),a=uG(e),o=dG(e);if(o){let e=XW(o);if(e.length>0)return e[0]??null}let s=fG(e),c=pG(e);if(s!=null||c!=null)return GW({path:n,beforeText:s,afterText:c,operation:r,oldStartLine:i,newStartLine:a});let l=$(e.preview);return l?WW({path:n,text:l,operation:r,oldStartLine:i,newStartLine:a}):null}function _G(e){if(!Array.isArray(e))return[];let t=[];return e.forEach((e,n)=>{if(typeof e==`string`){let n=XW(e);n.length>0&&t.push(...n);return}if(!tG(e))return;let r=gG(e,oG(e)??`file-${n+1}`);if(r){t.push(r);return}let i=Array.isArray(e.changes)?_G(e.changes):[];i.length>0&&t.push(...i)}),t}function vG(e){let t=iG(e.result)??iG(e.parsedArgs)??iG(e.args);return t?hG(_G(t.changes)):null}function yG(e){let t=iG(e.parsedArgs)??iG(e.args)??aG(e.args),n=t&&oG(t),r=$(e.result);return!n||!r?null:hG([WW({path:n,text:r,operation:`read`})].filter(e=>!!e))}function bG(e){if(e.status===`partial-call`&&typeof e.args==`string`){let t=eG(e.args,[`path`,`filePath`,`file_path`,`targetPath`,`target_path`,`filename`,`name`]),n=eG(e.args,[`content`,`text`,`afterText`,`after_text`]);if(t?.value&&n?.value){let e=WW({path:t.value,text:n.value,operation:`write`});if(e)return hG([e])}}let t=iG(e.parsedArgs)??iG(e.args)??aG(e.args);if(!t)return null;let n=oG(t),r=$(t.content);return!n||!r?null:hG([WW({path:n,text:r,operation:`write`})].filter(e=>!!e))}function xG(e){let t=iG(e.result),n=iG(e.parsedArgs)??iG(e.args)??aG(e.args);if(!t&&!n)return null;let r=(t?oG(t):null)??(n?oG(n):null),i=(t?fG(t):null)??(n?fG(n):null),a=(t?pG(t):null)??(n?pG(n):null),o=(t?lG(t):null)??(n?lG(n):null),s=(t?uG(t):null)??(n?uG(n):null);return!r||i==null&&a==null?null:hG([GW({path:r,beforeText:i,afterText:a,operation:`edit`,oldStartLine:o,newStartLine:s})].filter(e=>!!e))}function SG(e){let t=iG(e.parsedArgs),n=iG(e.args)??aG(e.args),r=$(e.args)??(t?$(t.patch):null)??(n?$(n.patch):null);return r?hG(XW(r)):null}function CG(e){return mG.has(e.toolName)?e.toolName===`file_change`?vG(e):e.toolName===`read_file`?yG(e):e.toolName===`write_file`?bG(e):e.toolName===`edit_file`?xG(e):e.toolName===`apply_patch`?SG(e):null:null}var wG=[`show_content`,`show_file`,`show_url`,`show_panel_app`];function TG(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function EG(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function DG(e){return Number.isInteger(e)&&typeof e==`number`&&e>0?e:void 0}function OG(e){return e===`file`||e===`url`||e===`panel_app`?e:null}function kG(e){return e===`read`||e===`preview`||e===`edit`||e===`interact`?e:void 0}function AG(e){return e===`inline`||e===`side_panel`?e:void 0}function jG(e){return e===`auto`||e===`source`||e===`rendered`?e:void 0}function MG(e){try{return f(e)}catch{return null}}function NG(e){if(!TG(e)||!TG(e.target))return null;let{target:t}=e,{payload:n,type:r}=t,i=OG(r);if(!i||!TG(n))return null;let a=EG(e.title),o=kG(e.purpose),s=AG(e.placement);if(i===`file`){let e=EG(n.path);if(!e)return null;let t=MG(n.params);return t===null||t&&(jG(n.viewer)===`source`||!/\.html?$/i.test(e))?null:{target:{type:`file`,payload:{path:e,line:DG(n.line),column:DG(n.column),viewer:jG(n.viewer),params:t??void 0}},title:a,purpose:o,placement:s}}if(i===`url`){let e=EG(n.url);return e?{target:{type:`url`,payload:{url:e}},title:a,purpose:o,placement:s}:null}let c=EG(n.appId);if(!c)return null;let l=MG(n.params);return l===null?null:{target:{type:`panel_app`,payload:{appId:c,path:EG(n.path),params:l??void 0}},title:a,purpose:o,placement:s}}function PG(e){return!TG(e)||e.action!==`showContent`?null:NG(e.request)}function FG(e){return e.title?e.title:e.target.type===`file`?e.target.payload.path:e.target.type===`url`?e.target.payload.url:e.target.payload.appId}function IG(e){let{actionLabel:t,invocation:n,statusLabel:r}=e;if(!wG.includes(n.toolName))return null;let i=PG(n.result);if(!i)return null;let a={kind:`show-content`,label:t,request:{...i,placement:`side_panel`}},o=i.target.type===`panel_app`&&i.placement===`inline`?{appId:i.target.payload.appId,path:i.target.payload.path,params:i.target.payload.params,title:i.title,action:a}:void 0;return{kind:`result`,name:n.toolName,detail:FG(i),text:void 0,outputData:n.result,hasResult:!0,statusTone:`success`,statusLabel:r,action:a,...o?{panelApp:o}:{}}}function LG(e){return typeof e==`object`&&!!e}function RG(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function zG(e){return!LG(e)||e.kind!==`nextclaw.session_request`?null:e}function BG(e){return!LG(e)||e.kind!==`nextclaw.session`?null:e}function VG(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function HG(e){return BU(VG(e)).trim()||void 0}function UG(e,t){return[RG(e.title)?`title: ${e.title?.trim()}`:null,RG(e.sessionId)?`session: ${e.sessionId?.trim()}`:null,RG(e.task)?`task: ${e.task?.trim()}`:null].filter(e=>!!e).join(` · `)||HU(t)}function WG(e,t){return[RG(e.title)?`title: ${e.title?.trim()}`:null,RG(e.sessionId)?`session: ${e.sessionId?.trim()}`:null].filter(e=>!!e).join(` · `)||HU(t)}function GG(e){let t=RG(e.requestId),n=RG(e.sessionId),r=RG(e.title),i=RG(e.task),a=RG(e.status),o=RG(e.notify),s=RG(e.lifecycle),c=RG(e.parentSessionId),l=RG(e.spawnedByRequestId),u=e.message===void 0?``:BU(e.message).trim(),d=e.finalResponseText===void 0?``:BU(e.finalResponseText).trim(),f=e.error===void 0?``:BU(e.error).trim(),p=[t?`Request ID: ${t}`:null,n?`Session ID: ${n}`:null,typeof e.isChildSession==`boolean`?`Target: ${e.isChildSession?`child`:`session`}`:null,a?`Status: ${a}`:null,o?`Notify: ${o}`:null,s?`Lifecycle: ${s}`:null,c?`Parent Session ID: ${c}`:null,l?`Spawned By Request ID: ${l}`:null,r?`Title: ${r}`:null,i?`Task:\n${i}`:null,d?`Final Response:\n${d}`:f?`Error:\n${f}`:u?`Status:\n${u}`:null].filter(e=>!!e);return p.length>0?p.join(`
|
|
98
|
-
|
|
99
|
-
`):void 0}function KG(e){let t=RG(e.sessionId),n=RG(e.title),r=RG(e.sessionType),i=RG(e.lifecycle),a=RG(e.parentSessionId),o=RG(e.createdAt),s=[t?`Session ID: ${t}`:null,typeof e.isChildSession==`boolean`?`Target: ${e.isChildSession?`child`:`session`}`:null,n?`Title: ${n}`:null,r?`Session Type: ${r}`:null,i?`Lifecycle: ${i}`:null,a?`Parent Session ID: ${a}`:null,o?`Created At: ${o}`:null].filter(e=>!!e);return s.length>0?s.join(`
|
|
100
|
-
|
|
101
|
-
`):void 0}function qG(e){let{invocation:t,texts:n}=e,{toolName:r,toolCallId:i,args:a,result:o}=t;if(r!==`spawn`&&r!==`sessions_request`&&r!==`sessions_spawn`)return null;let s=zG(o);if(s){let e=RG(s.status)?.toLowerCase(),t=UG(s,a),o=GG(s),c=RG(s.sessionId),l=DW({args:a,result:s}),u=c?{kind:`open-session`,sessionId:c,sessionKind:s.isChildSession===!0?`child`:`session`,...l?{agentId:l}:{},...RG(s.title)?{label:s.title.trim()}:{},...RG(s.parentSessionId)?{parentSessionId:s.parentSessionId.trim()}:{}}:void 0;return e===`failed`?{kind:`result`,name:r,detail:t,input:HG(a),text:o,callId:i||void 0,hasResult:!!o,statusTone:`error`,statusLabel:n.toolStatusFailedLabel,...l?{agentId:l}:{},...u?{action:u}:{}}:e===`completed`?{kind:`result`,name:r,detail:t,input:HG(a),text:o,callId:i||void 0,hasResult:!!o,statusTone:`success`,statusLabel:n.toolStatusCompletedLabel,...l?{agentId:l}:{},...u?{action:u}:{}}:{kind:`result`,name:r,detail:t,input:HG(a),text:o,callId:i||void 0,hasResult:!!o,statusTone:`running`,statusLabel:n.toolStatusRunningLabel,...l?{agentId:l}:{},...u?{action:u}:{}}}let c=BG(o);if(!c)return null;let l=WG(c,a),u=KG(c),d=RG(c.sessionId),f=DW({args:a,result:c}),p=d?{kind:`open-session`,sessionId:d,sessionKind:c.isChildSession===!0?`child`:`session`,...f?{agentId:f}:{},...RG(c.title)?{label:c.title.trim()}:{},...RG(c.parentSessionId)?{parentSessionId:c.parentSessionId.trim()}:{}}:void 0;return{kind:`result`,name:r,detail:l,input:HG(a),text:u,callId:i||void 0,hasResult:!!u,statusTone:`success`,statusLabel:n.toolStatusCompletedLabel,...f?{agentId:f}:{},...p?{action:p}:{}}}function JG(e){let t=typeof e==`object`&&e&&!Array.isArray(e)?e.error:null;return typeof t==`object`&&t&&!Array.isArray(t)&&t.code===`invalid_tool_arguments`?t:null}function YG(e,t){let n=pW(e.reasoning);return n?{type:`reasoning`,text:n,label:t.reasoningLabel}:null}function XG(e,t){let n=e.mimeType.startsWith(`image/`),r=gW(e.sizeBytes);return{type:`file`,file:{label:typeof e.name==`string`&&e.name.trim()?e.name.trim():n?t.imageAttachmentLabel:t.fileAttachmentLabel,mimeType:e.mimeType,dataUrl:typeof e.url==`string`&&e.url.trim().length>0?e.url.trim():`data:${e.mimeType};base64,${e.data}`,...r==null?{}:{sizeBytes:r},isImage:n}}}function ZG(e,t){let n=e.toolInvocation,r=vW(n.result,t);if(r)return r;let i=qG({invocation:n,texts:{toolStatusRunningLabel:t.toolStatusRunningLabel,toolStatusCompletedLabel:t.toolStatusCompletedLabel,toolStatusFailedLabel:t.toolStatusFailedLabel}});if(i)return{type:`tool-card`,card:yW(i,t)};let a=IG({invocation:n,actionLabel:t.showContentActionLabel??`Show content`,statusLabel:t.toolStatusCompletedLabel});if(a)return{type:`tool-card`,card:yW(a,t)};let o=bW({status:n.status,error:n.error,cancelled:n.cancelled,result:n.result,texts:t}),s=JG(n.result),c=Array.isArray(s?.issues)?s.issues.find(e=>typeof e==`string`&&e.trim().length>0):void 0,l=CG({toolName:n.toolName,status:n.status,toolCallId:n.toolCallId,args:n.args,parsedArgs:n.parsedArgs,result:n.result}),u=c?`Invalid arguments: ${c}`:l?.summary??HU(n.parsedArgs??n.args),d=l?void 0:SW(n.args,n.parsedArgs),f=c||(typeof n.error==`string`&&n.error.trim()?n.error.trim():n.result==null?``:BU(n.result).trim()),p=!n.error&&_W(n.result),m=(!l?.fileOperation||!!n.error)&&!p,h=DW(n);return{type:`tool-card`,card:yW({kind:o.kind,name:n.toolName,...h?{agentId:h}:{},detail:u,...d?{input:d}:{},text:m&&f?f:void 0,outputData:n.result,callId:n.toolCallId||void 0,hasResult:o.hasResult,statusTone:s?`error`:o.statusTone,statusLabel:s?t.toolStatusFailedLabel:o.statusLabel,...l?.fileOperation?{fileOperation:l.fileOperation}:{}},t)}}function QG(e,t){return{type:`unknown`,label:t.unknownPartLabel,rawType:typeof e.type==`string`?e.type:`unknown`,text:BU(e)}}function $G(e){return e.type===`text`&&typeof e.text==`string`}function eK(e){return e.type===`reasoning`&&typeof e.reasoning==`string`}function tK(e){return e.type===`file`&&typeof e.mimeType==`string`&&typeof e.data==`string`}function nK(e){return e.type!==`tool-invocation`||typeof e.toolInvocation!=`object`||e.toolInvocation===null||Array.isArray(e.toolInvocation)?!1:`toolName`in e.toolInvocation&&typeof e.toolInvocation.toolName==`string`}function rK(e){let{inlineTokens:t,part:n,texts:r}=e;return $G(n)?fW(n,t):eK(n)?YG(n,r):tK(n)?XG(n,r):nK(n)?ZG(n,r):QG(n,r)}function iK(e){let t=e.meta?.timestamp;return t&&Number.isFinite(Date.parse(t))?t:new Date().toISOString()}function aK(e,t){return e===`user`?t.user:e===`assistant`?t.assistant:e===`tool`?t.tool:e===`system`?t.system:t.fallback}function oK(e){return e===`user`||e===`assistant`||e===`tool`||e===`system`?e:`message`}function sK(e,t){return{id:e.id,role:oK(e.role),roleLabel:aK(e.role,t.texts.roleLabels),timestampLabel:t.formatTimestamp(iK(e)),status:e.meta?.status,processSummary:e.meta?.processSummary,executionSummaryLabel:e.meta?.executionSummaryLabel,moreActions:e.meta?.moreActions,parts:e.parts.map(n=>rK({part:n,inlineTokens:e.meta?.inlineTokens??[],texts:t.texts})).filter(e=>e!==null)}}function cK(e){return e.type===`reasoning`||e.type===`tool-invocation`}function lK(e){return e.type===`text`||e.type===`rich-text`?e.text.trim().length>0:e.type===`file`||e.type===`source`||e.type===`card`}function uK(e){if(e.role!==`assistant`||e.status===`pending`||e.status===`streaming`)return!1;let t=-1;for(let n=e.parts.length-1;n>=0;--n){let r=e.parts[n];if(r&&cK(r)){t=n;break}}return t>=0&&t<e.parts.length-1&&e.parts.slice(t+1).some(lK)}function dK(e){let t=e.lifecycle?.startedAt,n=e.lifecycle?.endedAt;if(!t||!n)return null;let r=Date.parse(t),i=Date.parse(n);if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return null;let a=Math.round((i-r)/1e3),o=Math.floor(a/3600),s=Math.floor(a%3600/60),c=a%60;return o>0?s>0?`${o}h ${s}m`:`${o}h`:s>0?`${s}m ${c}s`:`${c}s`}function fK({message:e,processedLabel:t}){if(!uK(e))return;let n=dK(e);return{label:n?`${t} ${n}`:t}}var pK=`ai_execution`;function mK(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function hK(e){return e===null||typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function gK(e){return e===`reported`||e===`partial`||e===`unavailable`}function _K(e){return e===`completed`||e===`failed`||e===`aborted`}function vK(e){let t=e?.[pK];if(!mK(t)||t.version!==1||!mK(t.usage))return null;let n=t.usage;return typeof t.runId!=`string`||!t.runId.trim()||typeof t.runtimeId!=`string`||!t.runtimeId.trim()||typeof t.model!=`string`||!t.model.trim()||!(t.requestedModel===null||typeof t.requestedModel==`string`)||!_K(t.outcome)||!hK(n.inputTokens)||!hK(n.outputTokens)||!hK(n.cachedInputTokens)||!hK(n.totalTokens)||!hK(n.modelCallCount)||!hK(n.reportedModelCallCount)||!gK(n.status)?null:t}var yK=function(e){return e.EndpointReady=`endpoint.ready`,e.EndpointError=`endpoint.error`,e.MessageRequest=`message.request`,e.MessageStreamRequest=`message.stream-request`,e.MessageSent=`message.sent`,e.MessageAccepted=`message.accepted`,e.MessageIncoming=`message.incoming`,e.MessageCompleted=`message.completed`,e.MessageFailed=`message.failed`,e.MessageAbort=`message.abort`,e.MessageTextStart=`message.text-start`,e.MessageTextDelta=`message.text-delta`,e.MessageTextEnd=`message.text-end`,e.MessageReasoningStart=`message.reasoning-start`,e.MessageReasoningDelta=`message.reasoning-delta`,e.MessageReasoningEnd=`message.reasoning-end`,e.MessageToolCallStart=`message.tool-call-start`,e.MessageToolCallArgs=`message.tool-call-args`,e.MessageToolCallArgsDelta=`message.tool-call-args-delta`,e.MessageToolCallEnd=`message.tool-call-end`,e.MessageToolCallResult=`message.tool-call-result`,e.MessageRead=`message.read`,e.MessageDelivered=`message.delivered`,e.MessageRecalled=`message.recalled`,e.MessageReaction=`message.reaction`,e.RunStarted=`run.started`,e.RunFinished=`run.finished`,e.RunError=`run.error`,e.RunMetadata=`run.metadata`,e.ContextWindowUpdated=`context-window.updated`,e.TypingStart=`typing.start`,e.TypingEnd=`typing.end`,e.PresenceUpdated=`presence.updated`,e}({});function bK(e,t=e.occurredAt??new Date().toISOString()){return{...e,occurredAt:t}}var xK=/\[\[\s*reply_to_current\s*\]\]/gi,SK=/\[\[\s*reply_to\s*:\s*([^\]]+?)\s*\]\]/i;function CK(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function wK(e,t){let n=e,r;xK.test(n)&&(r=CK(t),n=n.replace(xK,``).trim());let i=n.match(SK)?.[1];return i&&(r=CK(i),n=n.replace(SK,``).trim()),r?{content:n,replyTo:r}:{content:n}}function TK(e,t=e.id){if(e.role!==`assistant`)return{...e,parts:[...e.parts],metadata:e.metadata?{...e.metadata}:void 0};let n=e.parts.findIndex(e=>e.type===`text`),r=e.metadata?{...e.metadata}:void 0,i=CK(r?.reply_to);if(n<0)return{...e,parts:[...e.parts],metadata:r};let a=e.parts[n];if(!a||a.type!==`text`)return{...e,parts:[...e.parts],metadata:r};let{content:o,replyTo:s}=wK(a.text,t),c=s??i,l=e.parts.flatMap((e,t)=>t!==n||e.type!==`text`?[e]:o.length===0?[]:[{...e,text:o}]);return c?{...e,parts:l,metadata:{...r,reply_to:c}}:{...e,parts:l,metadata:r}}function EK(e){let t=e>=1e9?{divisor:1e9,suffix:`b`}:e>=1e6?{divisor:1e6,suffix:`m`}:e>=1e3?{divisor:1e3,suffix:`k`}:null;return t?`${Math.round(e/t.divisor*10)/10}${t.suffix}`:String(e)}function DK(e,t){if(e===null)return t;let n=EK(e);return e>=1e3?`${n} (${e})`:n}function OK(e,t){let n=[];if(e.usage.inputTokens!==null&&n.push(`${EK(e.usage.inputTokens)} ${t.input}`),e.usage.outputTokens!==null&&n.push(`${EK(e.usage.outputTokens)} ${t.output}`),n.length===0&&e.usage.totalTokens!==null&&n.push(`${EK(e.usage.totalTokens)} ${t.tokens}`),n.length===0)return e.model;let r=`${e.model} · ${n.join(` / `)}`;return e.usage.status===`partial`?`${r} · ${t.partial}`:r}function kK(e){let{labels:t,message:n}=e;if(n.role!==`assistant`)return null;let r=vK(n.metadata);if(!r)return null;let{usage:i}=r,a=[{label:t.fields.runId,value:r.runId},{label:t.fields.runtime,value:r.runtimeId},{label:t.fields.model,value:r.model},{label:t.fields.requestedModel,value:r.requestedModel??t.notAvailable},{label:t.fields.outcome,value:t.outcomes[r.outcome]},{label:t.fields.inputTokens,value:DK(i.inputTokens,t.notAvailable)},{label:t.fields.outputTokens,value:DK(i.outputTokens,t.notAvailable)},{label:t.fields.cachedInputTokens,value:DK(i.cachedInputTokens,t.notAvailable)},{label:t.fields.totalTokens,value:DK(i.totalTokens,t.notAvailable)},{label:t.fields.modelCallCount,value:i.modelCallCount?.toString()??t.notAvailable},{label:t.fields.reportedModelCallCount,value:i.reportedModelCallCount?.toString()??t.notAvailable},{label:t.fields.usageStatus,value:t.usageStatuses[i.status]}];return{cacheKey:JSON.stringify(r),summaryLabel:OK(r,t),moreActions:{triggerLabel:t.moreActions,items:[{key:`ai-execution-metadata`,label:t.viewMetadata,dialog:{title:t.metadataTitle,description:t.metadataDescription,closeLabel:t.close,rows:a}}]}}}function AK(e){return{roleLabels:{user:b(`chatRoleUser`),assistant:b(`chatRoleAssistant`),tool:b(`chatRoleTool`),system:b(`chatRoleSystem`),fallback:b(`chatRoleMessage`)},reasoningLabel:b(`chatReasoning`),toolCallLabel:b(`chatToolCall`),toolResultLabel:b(`chatToolResult`),toolInputLabel:b(`chatToolInput`),toolNoOutputLabel:b(`chatToolNoOutput`),toolOutputLabel:b(`chatToolOutput`),toolStatusPreparingLabel:b(`chatToolStatusPreparing`),toolStatusRunningLabel:b(`chatToolStatusRunning`),toolStatusCompletedLabel:b(`chatToolStatusCompleted`),toolStatusFailedLabel:b(`chatToolStatusFailed`),toolStatusCancelledLabel:b(`chatToolStatusCancelled`),showContentActionLabel:b(`chatShowContentAction`),imageAttachmentLabel:b(`chatImageAttachment`),fileAttachmentLabel:b(`chatFileAttachment`),unknownPartLabel:b(`chatUnknownPart`)}}function jK(){return{directory:{running:b(`chatToolDirectoryRunning`),success:b(`chatToolDirectorySuccess`),error:b(`chatToolDirectoryError`),cancelled:b(`chatToolDirectoryCancelled`)},web:{running:b(`chatToolWebRunning`),success:b(`chatToolWebSuccess`),error:b(`chatToolWebError`),cancelled:b(`chatToolWebCancelled`)},message:{running:b(`chatToolMessageRunning`),success:b(`chatToolMessageSuccess`),error:b(`chatToolMessageError`),cancelled:b(`chatToolMessageCancelled`)},session:{running:b(`chatToolSessionRunning`),success:b(`chatToolSessionSuccess`),error:b(`chatToolSessionError`),cancelled:b(`chatToolSessionCancelled`)},agent:{running:b(`chatToolAgentRunning`),success:b(`chatToolAgentSuccess`),error:b(`chatToolAgentError`),cancelled:b(`chatToolAgentCancelled`)},memory:{running:b(`chatToolMemoryRunning`),success:b(`chatToolMemorySuccess`),error:b(`chatToolMemoryError`),cancelled:b(`chatToolMemoryCancelled`)},schedule:{running:b(`chatToolScheduleRunning`),success:b(`chatToolScheduleSuccess`),error:b(`chatToolScheduleError`),cancelled:b(`chatToolScheduleCancelled`)},system:{running:b(`chatToolSystemRunning`),success:b(`chatToolSystemSuccess`),error:b(`chatToolSystemError`),cancelled:b(`chatToolSystemCancelled`)},image:{running:b(`chatToolImageRunning`),success:b(`chatToolImageSuccess`),error:b(`chatToolImageError`),cancelled:b(`chatToolImageCancelled`)},display:{running:b(`chatToolDisplayRunning`),success:b(`chatToolDisplaySuccess`),error:b(`chatToolDisplayError`),cancelled:b(`chatToolDisplayCancelled`)}}}function MK(e){return{input:b(`chatAiExecutionInput`),output:b(`chatAiExecutionOutput`),tokens:b(`chatAiExecutionTokens`),partial:b(`chatAiExecutionPartial`),moreActions:b(`chatMessageMoreActions`),viewMetadata:b(`chatAiExecutionViewMetadata`),metadataTitle:b(`chatAiExecutionMetadataTitle`),metadataDescription:b(`chatAiExecutionMetadataDescription`),close:b(`chatAiExecutionMetadataClose`),notAvailable:b(`chatAiExecutionNotAvailable`),fields:{runId:b(`chatAiExecutionRunId`),runtime:b(`chatAiExecutionRuntime`),model:b(`chatAiExecutionModel`),requestedModel:b(`chatAiExecutionRequestedModel`),outcome:b(`chatAiExecutionOutcome`),inputTokens:b(`chatAiExecutionInputTokens`),outputTokens:b(`chatAiExecutionOutputTokens`),cachedInputTokens:b(`chatAiExecutionCachedInputTokens`),totalTokens:b(`chatAiExecutionTotalTokens`),modelCallCount:b(`chatAiExecutionModelCallCount`),reportedModelCallCount:b(`chatAiExecutionReportedModelCallCount`),usageStatus:b(`chatAiExecutionUsageStatus`)},outcomes:{completed:b(`chatAiExecutionOutcomeCompleted`),failed:b(`chatAiExecutionOutcomeFailed`),aborted:b(`chatAiExecutionOutcomeAborted`)},usageStatuses:{reported:b(`chatAiExecutionUsageReported`),partial:b(`chatAiExecutionUsagePartial`),unavailable:b(`chatAiExecutionUsageUnavailable`)}}}function NK(e){return{copyCodeLabel:b(`chatCodeCopy`),copiedCodeLabel:b(`chatCodeCopied`),copyMessageLabel:b(`chatMessageCopy`),copiedMessageLabel:b(`chatMessageCopied`),mermaidDiagramLabel:b(`chatMermaidDiagram`),mermaidExpandLabel:b(`chatMermaidExpand`),mermaidLoadingLabel:b(`chatMermaidLoading`),mermaidRenderErrorLabel:b(`chatMermaidRenderError`),typingLabel:b(`chatTyping`),reasoningCharacterCountTemplates:{inProgress:b(`chatReasoningInProgressCharacterCount`),completed:b(`chatReasoningCompletedCharacterCount`)},toolStatusLabels:{terminal:{running:b(`chatToolTerminalRunning`),success:b(`chatToolTerminalSuccess`),error:b(`chatToolTerminalError`),cancelled:b(`chatToolTerminalCancelled`)},fileRead:{running:b(`chatToolFileReadRunning`),success:b(`chatToolFileReadSuccess`),error:b(`chatToolFileReadError`),cancelled:b(`chatToolFileReadCancelled`)},fileEdit:{running:b(`chatToolFileEditRunning`),success:b(`chatToolFileEditSuccess`),error:b(`chatToolFileEditError`),cancelled:b(`chatToolFileEditCancelled`)},search:{running:b(`chatToolSearchRunning`),success:b(`chatToolSearchSuccess`),error:b(`chatToolSearchError`),cancelled:b(`chatToolSearchCancelled`)},builtIn:jK()},attachmentOpenLabel:b(`chatAttachmentOpen`),attachmentAttachedLabel:b(`chatAttachmentAttached`),attachmentExpandLabel:b(`chatAttachmentExpand`),attachmentCloseLabel:b(`chatAttachmentClosePreview`),attachmentCategoryLabels:{archive:b(`chatAttachmentCategoryArchive`),audio:b(`chatAttachmentCategoryAudio`),code:b(`chatAttachmentCategoryCode`),data:b(`chatAttachmentCategoryData`),document:b(`chatAttachmentCategoryDocument`),generic:b(`chatAttachmentCategoryGeneric`),image:b(`chatAttachmentCategoryImage`),pdf:b(`chatAttachmentCategoryPdf`),sheet:b(`chatAttachmentCategorySheet`),video:b(`chatAttachmentCategoryVideo`)},toolActivitySegmentTemplates:{read:{one:b(`chatToolActivityReadOne`),other:b(`chatToolActivityReadOther`)},edit:{one:b(`chatToolActivityEditOne`),other:b(`chatToolActivityEditOther`)},directory:{one:b(`chatToolActivityDirectoryOne`),other:b(`chatToolActivityDirectoryOther`)},search:{one:b(`chatToolActivitySearchOne`),other:b(`chatToolActivitySearchOther`)},bash:{one:b(`chatToolActivityBashOne`),other:b(`chatToolActivityBashOther`)},web:{one:b(`chatToolActivityWebOne`),other:b(`chatToolActivityWebOther`)},agent:{one:b(`chatToolActivityAgentOne`),other:b(`chatToolActivityAgentOther`)},panel:{one:b(`chatToolActivityPanelOne`),other:b(`chatToolActivityPanelOther`)},other:{one:b(`chatToolActivityOtherOne`),other:b(`chatToolActivityOtherOther`)}},toolActivityFailedLabel:b(`chatProcessSummaryFailed`),toolActivityCancelledLabel:b(`chatProcessSummaryCancelled`)}}function PK(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function FK(e){if(typeof e!=`number`||!Number.isFinite(e))return null;let t=Math.trunc(e);return t>=0?t:null}function IK(e){return e===!0}function LK(e){let t=e;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,r=FK(n.usedContextTokens),i=FK(n.totalContextTokens),a=FK(n.prunedUsedContextTokens),o=PK(n.updatedAt);if(r===null||i===null||a===null||!o)return null;let s=FK(n.compactedUsedContextTokens);return{usedContextTokens:r,totalContextTokens:i,prunedUsedContextTokens:a,availableContextTokens:FK(n.availableContextTokens)??Math.max(0,i-r),droppedHistoryCount:FK(n.droppedHistoryCount)??0,truncatedToolResultCount:FK(n.truncatedToolResultCount)??0,truncatedSystemPrompt:IK(n.truncatedSystemPrompt),truncatedUserMessage:IK(n.truncatedUserMessage),compacted:IK(n.compacted),...PK(n.checkpointId)?{checkpointId:PK(n.checkpointId)??void 0}:{},compactedMessageCount:FK(n.compactedMessageCount)??0,...s===null?{}:{compactedUsedContextTokens:s},updatedAt:o}}function RK(e){let{metadata:t}=e;if(!t||t.nextclaw_timeline_kind!==`context_compaction`)return null;let n=t.checkpoint&&typeof t.checkpoint==`object`&&!Array.isArray(t.checkpoint)?t.checkpoint:null;if(!n)return null;let r=PK(n.id),i=n.status===`compressing`?`compressing`:n.status===`compressed`?`compressed`:null,a=PK(n.summary),o=FK(n.coveredMessageCount),s=FK(n.coveredSessionMessageCount),c=FK(n.originalEstimatedTokens),l=FK(n.projectedEstimatedTokens),u=PK(n.createdAt),d=PK(n.updatedAt);return!r||!i||!a||o===null||s===null||c===null||l===null||!u||!d?null:{id:r,status:i,summary:a,coveredMessageCount:o,coveredSessionMessageCount:s,originalEstimatedTokens:c,projectedEstimatedTokens:l,createdAt:u,updatedAt:d}}function zK(e){return`${e.kind===`directory`?b(`chatWorkspaceOpenDirectory`):b(`chatWorkspaceOpenFile`)}: ${e.name}`}function BK(e){return e.split(/[\\/]/).filter(Boolean).pop()??e}function VK(e){return e.error?e.error instanceof Error?e.error.message:String(e.error):null}function HK({fileName:e,isDirectory:t,isExpanded:n}){return t?n?(0,R.jsx)(es,{className:`h-4 w-4 shrink-0 text-amber-500`}):(0,R.jsx)(as,{className:`h-4 w-4 shrink-0 text-amber-500`}):(0,R.jsx)(dg,{fileName:e})}function UK({browseQuery:e,level:t,onFileOpen:n}){let r=e.data?.entries??[],i=VK(e),a={paddingLeft:`${36+t*14}px`};return e.isLoading&&!e.data?(0,R.jsx)(`div`,{className:`h-7 truncate pr-2 text-[11px] leading-7 text-gray-400`,style:a,children:b(`chatWorkspaceLoadingDirectory`)}):i&&!e.data?(0,R.jsx)(`div`,{className:`h-7 truncate pr-2 text-[11px] leading-7 text-rose-600`,style:a,title:i,children:b(`chatWorkspaceDirectoryLoadFailed`)}):r.length===0?(0,R.jsx)(`div`,{className:`h-7 truncate pr-2 text-[11px] leading-7 text-gray-400`,style:a,children:b(`chatWorkspaceDirectoryEmpty`)}):r.map(e=>(0,R.jsx)(WK,{entry:e,level:t+1,onFileOpen:n},e.path))}function WK({entry:e,level:t,onFileOpen:n}){let i=e.kind===`directory`,[a,o]=(0,L.useState)(!1),s=Ic({path:e.path,includeFiles:!0,enabled:i&&a}),c=()=>{if(i){o(e=>!e);return}n({path:e.path,label:e.name,viewMode:`preview`})};return(0,R.jsxs)(`div`,{role:`treeitem`,"aria-expanded":i?a:void 0,"aria-label":zK(e),children:[(0,R.jsxs)(`button`,{type:`button`,className:r(`flex h-7 w-full min-w-0 items-center gap-1.5 pr-2 text-left text-[13px] text-gray-700 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border`,e.hidden?`opacity-65`:null),style:{paddingLeft:`${8+t*14}px`},onClick:c,children:[(0,R.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-gray-400`,children:i?a?(0,R.jsx)(Wt,{className:`h-3.5 w-3.5`}):(0,R.jsx)(Ao,{className:`h-3.5 w-3.5`}):null}),(0,R.jsx)(HK,{fileName:e.name,isDirectory:i,isExpanded:a}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]}),i&&a?(0,R.jsx)(`div`,{role:`group`,children:(0,R.jsx)(UK,{browseQuery:s,level:t,onFileOpen:n})}):null]})}function GK({browseQuery:e,onFileOpen:t,renderStatus:n,showRoot:r=!1}){let i=e.data?.entries??[],a=VK(e);return e.isLoading&&!e.data?n({text:b(`chatWorkspaceLoadingDirectory`)}):a&&!e.data?n({tone:`error`,text:`${b(`chatWorkspaceDirectoryLoadFailed`)}: ${a}`}):i.length===0?n({text:b(`chatWorkspaceDirectoryEmpty`)}):(0,R.jsx)(`div`,{"data-testid":`workspace-directory-browser`,role:`tree`,"aria-label":b(`chatWorkspaceProjectFiles`),className:`h-full overflow-auto bg-white py-2 custom-scrollbar`,children:r&&e.data?(0,R.jsxs)(`div`,{role:`treeitem`,"aria-expanded":`true`,children:[(0,R.jsxs)(`div`,{className:`flex h-8 items-center gap-1.5 border-b border-gray-100 px-2 text-xs font-semibold text-gray-700`,children:[(0,R.jsx)(Wt,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}),(0,R.jsx)(es,{className:`h-4 w-4 shrink-0 text-amber-500`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.data.currentPath,children:BK(e.data.currentPath)})]}),(0,R.jsx)(`div`,{role:`group`,className:`pt-1`,children:i.map(e=>(0,R.jsx)(WK,{entry:e,level:1,onFileOpen:t},e.path))})]}):i.map(e=>(0,R.jsx)(WK,{entry:e,level:0,onFileOpen:t},e.path))})}function KK({name:e,kind:t}){return t===`directory`?(0,R.jsx)(as,{className:`h-3.5 w-3.5 shrink-0 text-emerald-600`}):(0,R.jsx)(dg,{fileName:e,size:`compact`})}function qK({browsePath:e,onBrowsePathChange:t,onClose:n,onFileOpen:i}){let a=Ic({path:e,includeFiles:!0,enabled:!!e}),o=a.error?a.error instanceof Error?a.error.message:String(a.error):null,s=a.data?.entries??[],c=e=>{if(e.kind===`directory`){t(e.path);return}i({path:e.path,label:e.name,viewMode:`preview`}),n()};return(0,R.jsxs)(`div`,{"data-testid":`workspace-breadcrumb-browser`,className:`flex max-h-72 flex-col overflow-hidden`,children:[(0,R.jsx)(`div`,{className:`border-b border-gray-200 px-2 py-1`,children:(0,R.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-0.5 text-[11px] leading-none text-gray-600`,children:a.data?.breadcrumbs.map((e,n)=>(0,R.jsxs)(L.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,className:`h-5 rounded-sm px-1 text-left hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>t(e.path),children:e.label}),n<a.data.breadcrumbs.length-1?(0,R.jsx)(Ao,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},e.path))})}),(0,R.jsx)(Rc,{className:`min-h-0 flex-1 px-1 py-1`,children:a.isLoading?(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-4 text-[11px] text-gray-500`,children:[(0,R.jsx)(Un,{className:`h-3.5 w-3.5 animate-spin`}),b(`loading`)]}):o?(0,R.jsxs)(`div`,{className:`px-2 py-3 text-[11px] text-rose-600`,children:[b(`pathBrowseFailed`),`: `,o]}):s.length>0?(0,R.jsx)(`div`,{className:`space-y-0.5`,children:s.map(e=>(0,R.jsxs)(`button`,{type:`button`,className:r(`flex h-6 w-full items-center gap-1.5 rounded-sm px-1.5 text-left text-[11px] text-gray-700 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e.hidden?`opacity-65`:null),onClick:()=>c(e),children:[(0,R.jsx)(KK,{kind:e.kind,name:e.name}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.kind===`directory`?(0,R.jsx)(Ao,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},e.path))}):(0,R.jsx)(`div`,{className:`px-2 py-4 text-[11px] text-gray-500`,children:b(`emptyDirectory`)})})]})}function JK({value:e}){return(0,R.jsx)(`span`,{className:`inline-flex h-5 items-center rounded-sm border border-amber-200 bg-amber-50 px-1.5 text-[10px] font-medium leading-none text-amber-700`,children:e})}function YK({onFileOpen:e,segment:t}){let[n,i]=(0,L.useState)(!1),[a,o]=(0,L.useState)(t.browsePath);return(0,R.jsxs)(ct,{open:n,onOpenChange:e=>{e&&o(t.browsePath),i(e)},children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"aria-current":t.isCurrent?`page`:void 0,className:r(`inline-flex h-5 items-center gap-1 rounded-sm px-1 text-[11px] leading-none transition-colors hover:bg-gray-200/80 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,t.kind===`workspace`?`bg-primary/8 text-primary hover:bg-primary/12`:t.isCurrent?`bg-gray-200/70 text-gray-900`:`text-gray-500`),disabled:!t.browsePath,children:[t.kind===`workspace`?(0,R.jsx)(ns,{className:`h-3 w-3 shrink-0`}):t.kind===`directory`&&t.isCurrent?(0,R.jsx)(as,{className:`h-3 w-3 shrink-0`}):t.isCurrent?(0,R.jsx)(dg,{fileName:t.label,size:`compact`}):null,(0,R.jsx)(`span`,{children:t.label})]})}),(0,R.jsx)(ot,{"data-testid":`workspace-breadcrumb-popover`,className:`w-[22rem] rounded-md p-0`,align:`start`,children:(0,R.jsx)(qK,{browsePath:a,onBrowsePathChange:o,onClose:()=>i(!1),onFileOpen:e})})]})}function XK({breadcrumb:e,onFileOpen:t}){return(0,R.jsx)(`div`,{"data-testid":`workspace-file-breadcrumbs`,title:e.fullPath,className:`workspace-horizontal-scrollbar overflow-x-auto overflow-y-hidden border-b border-gray-200/80 bg-gray-50/55`,children:(0,R.jsxs)(`div`,{"data-testid":`workspace-file-breadcrumb-scroll`,className:`flex min-w-max items-center gap-2.5 px-3 py-1.5`,children:[(0,R.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 pr-1`,children:e.segments.map((n,r)=>(0,R.jsxs)(L.Fragment,{children:[(0,R.jsx)(YK,{segment:n,onFileOpen:t}),r<e.segments.length-1?(0,R.jsx)(Ao,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},n.key))}),e.truncated?(0,R.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1`,children:(0,R.jsx)(JK,{value:b(`chatWorkspacePreviewTruncated`)})}):null]})})}function ZK(e){let[t,n]=(0,L.useState)(null),r=t?.contentUrl===e?t:null;return(0,L.useEffect)(()=>{let t=new AbortController;return fetch(e,{signal:t.signal}).then(e=>{if(!e.ok)throw Error(`Unable to load document (${e.status}).`);return e.arrayBuffer()}).then(r=>{t.signal.aborted||n({contentUrl:e,status:`ready`,data:r})}).catch(r=>{t.signal.aborted||(console.error(`Failed to load workspace document`,r),n({contentUrl:e,status:`error`,data:null}))}),()=>t.abort()},[e]),{status:r?.status??`loading`,data:r?.data??null}}function QK({status:e}){return e===`ready`?null:(0,R.jsx)(`div`,{className:`absolute inset-0 z-10 flex items-center justify-center bg-background/90 px-6 text-center text-sm text-muted-foreground`,children:b(e===`loading`?`chatWorkspaceLoadingPreview`:`chatWorkspacePreviewFailed`)})}function $K(e){let t=Array.from(e.querySelectorAll(`.docx-wrapper > section.docx`)).some(e=>!e.style.width&&!e.style.padding);if(e.classList.toggle(`workspace-docx-preview--reflow`,t),t)for(let t of e.querySelectorAll(`table`)){if(t.querySelectorAll(`col`).length<5)continue;let e=document.createElement(`div`);e.className=`workspace-docx-wide-table`,t.before(e),e.append(t)}}function eq({contentUrl:e}){let t=(0,L.useRef)(null),n=ZK(e),[r,i]=(0,L.useState)(null),a=r?.contentUrl===e?r.status:`loading`,o=n.status===`ready`?a:n.status;return(0,L.useEffect)(()=>{let r=t.current;if(!r||!n.data)return;let a=!1;return r.replaceChildren(),D(()=>import(`./docx-preview-D0tp3a9T.js`).then(async t=>{await t.renderAsync(n.data,r,r,{breakPages:!0,inWrapper:!0,ignoreLastRenderedPageBreak:!1}),a||($K(r),i({contentUrl:e,status:`ready`}))}),__vite__mapDeps([22,4,23])).catch(t=>{a||(console.error(`Failed to render DOCX preview`,t),i({contentUrl:e,status:`error`}))}),()=>{a=!0,r.replaceChildren()}},[e,n.data]),(0,R.jsxs)(`div`,{className:`relative h-full overflow-auto bg-muted/40 p-4 custom-scrollbar`,children:[(0,R.jsx)(QK,{status:o}),(0,R.jsx)(`div`,{ref:t,className:`workspace-docx-preview min-h-full`,"data-testid":`workspace-content-docx`})]})}function tq({contentUrl:e}){let t=(0,L.useRef)(null),n=ZK(e),[r,i]=(0,L.useState)(null),a=r?.contentUrl===e?r.status:`loading`,o=n.status===`ready`?a:n.status;return(0,L.useEffect)(()=>{let r=t.current;if(!r||!n.data)return;let a=new AbortController,o=null;return r.replaceChildren(),D(async()=>{let{PptxViewer:e,RECOMMENDED_ZIP_LIMITS:t}=await import(`./aiden0z-pptx-renderer.es-Bd99vut2.js`);return{PptxViewer:e,RECOMMENDED_ZIP_LIMITS:t}},__vite__mapDeps([24,4,23])).then(async({PptxViewer:t,RECOMMENDED_ZIP_LIMITS:s})=>{if(o=await t.open(n.data,r,{renderMode:`list`,fitMode:`contain`,lazySlides:!0,lazyMedia:!0,pdfjs:!1,scrollContainer:r,signal:a.signal,zipLimits:s,listOptions:{windowed:!0,batchSize:8,initialSlides:4,overscanViewport:1.5}}),a.signal.aborted){o.destroy(),o=null;return}i({contentUrl:e,status:`ready`})}).catch(t=>{a.signal.aborted||(console.error(`Failed to render presentation preview`,t),i({contentUrl:e,status:`error`}))}),()=>{a.abort(),o?.destroy(),r.replaceChildren()}},[e,n.data]),(0,R.jsxs)(`div`,{className:`relative h-full bg-muted/40`,children:[(0,R.jsx)(QK,{status:o}),(0,R.jsx)(`div`,{ref:t,className:`h-full overflow-auto p-4 custom-scrollbar`,"data-testid":`workspace-content-presentation`})]})}var nq=500,rq=100;function iq(e){let t=``,n=e+1;for(;n>0;)--n,t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26);return t}function aq({contentUrl:e}){let t=ZK(e),[n,i]=(0,L.useState)(null),[a,o]=(0,L.useState)(``),s=n?.contentUrl===e?n:null,c=t.status===`ready`?s?.status??`loading`:t.status,l=s?.sheets.find(e=>e.name===a)??s?.sheets[0]??null;return(0,L.useEffect)(()=>{if(!t.data)return;let n=!1;return D(()=>import(`./xlsx-DfjC_iml.js`).then(r=>{let a=r.read(t.data,{dense:!0,sheetRows:nq+1}),o=a.SheetNames.map(e=>{let t=a.Sheets[e],n=t?r.utils.sheet_to_json(t,{header:1,raw:!1,defval:``,blankrows:!1}):[],i=n.slice(0,nq).map(e=>e.slice(0,rq).map(e=>String(e??``)));return{name:e,rows:i,columnCount:Math.min(rq,i.reduce((e,t)=>Math.max(e,t.length),0)),truncated:n.length>nq||n.some(e=>e.length>rq)}});n||i({contentUrl:e,status:`ready`,sheets:o})}),[]).catch(t=>{n||(console.error(`Failed to render spreadsheet preview`,t),i({contentUrl:e,status:`error`,sheets:[]}))}),()=>{n=!0}},[e,t.data]),(0,R.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col bg-white`,"data-testid":`workspace-content-spreadsheet`,children:[(0,R.jsx)(QK,{status:c}),s&&s.sheets.length>1?(0,R.jsx)(`div`,{className:`flex shrink-0 gap-1 overflow-x-auto border-b border-border px-2 py-1.5 custom-scrollbar`,children:s.sheets.map(e=>(0,R.jsx)(`button`,{type:`button`,className:r(`h-7 shrink-0 rounded-md px-2.5 text-xs transition-colors`,e.name===l?.name?`bg-accent font-medium text-accent-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),onClick:()=>o(e.name),children:e.name},e.name))}):null,l?(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto custom-scrollbar`,children:(0,R.jsxs)(`table`,{className:`min-w-full border-collapse text-xs text-foreground`,children:[(0,R.jsx)(`thead`,{className:`sticky top-0 z-[1] bg-muted`,children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{className:`sticky left-0 z-[2] h-7 min-w-10 border border-border bg-muted px-2`}),Array.from({length:l.columnCount},(e,t)=>(0,R.jsx)(`th`,{className:`h-7 min-w-24 border border-border px-2 text-center font-medium text-muted-foreground`,children:iq(t)},t))]})}),(0,R.jsx)(`tbody`,{children:l.rows.map((e,t)=>(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{className:`sticky left-0 min-w-10 border border-border bg-muted px-2 text-right font-normal text-muted-foreground`,children:t+1}),Array.from({length:l.columnCount},(t,n)=>(0,R.jsx)(`td`,{className:`max-w-80 whitespace-pre-wrap border border-border px-2 py-1.5 align-top`,children:e[n]??``},n))]},t))})]})}):null,l?.truncated?(0,R.jsx)(`div`,{className:`shrink-0 border-t border-border bg-muted/60 px-3 py-1.5 text-xs text-muted-foreground`,children:b(`chatWorkspaceSpreadsheetPreviewTruncated`)}):null]})}function oq(e){let t=e.mimeType?.trim().toLowerCase()??``,n=e.path.trim().toLowerCase();return t.startsWith(`image/`)||/\.(avif|bmp|gif|heic|heif|ico|jpe?g|png|svg|tiff?|webp)$/i.test(n)?`image`:t.startsWith(`audio/`)||/\.(aac|flac|m4a|mp3|ogg|opus|wav|weba)$/i.test(n)?`audio`:t.startsWith(`video/`)||/\.(avi|m4v|mkv|mov|mp4|webm|wmv)$/i.test(n)?`video`:t.includes(`pdf`)||n.endsWith(`.pdf`)?`pdf`:t===`application/vnd.openxmlformats-officedocument.wordprocessingml.document`||n.endsWith(`.docx`)?`docx`:t.includes(`spreadsheet`)||t.includes(`excel`)||/\.(ods|xls|xlsb|xlsm|xlsx)$/i.test(n)?`spreadsheet`:t===`application/vnd.openxmlformats-officedocument.presentationml.presentation`||n.endsWith(`.pptx`)?`presentation`:t.includes(`html`)||/\.html?$/i.test(n)?`html`:`other`}function sq({contentUrl:e,label:t}){return(0,R.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-6 text-center`,"data-testid":`workspace-content-unsupported`,children:[(0,R.jsxs)(`div`,{className:`max-w-sm space-y-1.5`,children:[(0,R.jsx)(`p`,{className:`truncate text-sm font-medium text-foreground`,title:t,children:t}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:b(`chatWorkspacePreviewUnsupported`)}),(0,R.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground/80`,children:b(`chatWorkspacePreviewUnsupportedHint`)})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,R.jsx)(`a`,{href:e,download:t,className:`inline-flex h-8 items-center rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted`,children:b(`chatWorkspacePreviewDownload`)}),(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`inline-flex h-8 items-center rounded-lg bg-primary px-3 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:b(`chatWorkspacePreviewOpenExternally`)})]})]})}function cq({contentUrl:e,contentParams:t,label:n,onContentHeightChange:r}){let i=(0,L.useRef)(null),a=(0,L.useRef)(null),o=d(t);(0,L.useEffect)(()=>()=>{a.current?.()},[]);let s=()=>{a.current?.(),a.current=null;let e=i.current;if(!(!e||!r||typeof ResizeObserver>`u`))try{let t=e.contentDocument;if(!t)return;let n=()=>{let e=y(t.body,t.documentElement);e>0&&r(e)},i=new ResizeObserver(n);i.observe(t.documentElement),t.body&&i.observe(t.body),n(),a.current=()=>i.disconnect()}catch{}};return(0,R.jsx)(`iframe`,{ref:i,allowFullScreen:!0,className:`h-full w-full border-0 bg-white`,"data-testid":`workspace-html-preview`,name:o,src:S(e,t),title:n,onLoad:s},o??`no-content-params`)}function lq({contentUrl:e,contentParams:t,kind:n,label:r,onHtmlContentHeightChange:i}){return n===`image`?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center overflow-auto bg-white p-4 custom-scrollbar`,children:(0,R.jsx)(`img`,{src:e,alt:r,className:`max-h-full max-w-full object-contain`,"data-testid":`workspace-content-image`})}):n===`audio`?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center bg-white px-6`,children:(0,R.jsx)(`audio`,{controls:!0,preload:`metadata`,"aria-label":r,className:`w-full max-w-xl`,"data-testid":`workspace-content-audio`,src:e})}):n===`video`?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center bg-black`,children:(0,R.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,"aria-label":r,className:`max-h-full max-w-full`,"data-testid":`workspace-content-video`,src:e})}):n===`html`?(0,R.jsx)(cq,{contentUrl:e,contentParams:t,label:r,onContentHeightChange:i}):n===`pdf`?(0,R.jsx)(`iframe`,{allowFullScreen:!0,className:`h-full w-full border-0 bg-white`,"data-testid":`workspace-content-pdf`,src:e,title:r}):n===`docx`?(0,R.jsx)(eq,{contentUrl:e}):n===`spreadsheet`?(0,R.jsx)(aq,{contentUrl:e}):n===`presentation`?(0,R.jsx)(tq,{contentUrl:e}):(0,R.jsx)(sq,{contentUrl:e,label:r})}function uq(e){return[`server-path-read`,e.path?.trim()??``,e.basePath??null,e.line??null]}function dq(e){let{basePath:t,enabled:n=!0,line:r,path:i}=e,a=i?.trim()??``;return O({queryKey:uq({path:a,basePath:t,line:r}),queryFn:()=>Me({path:a,basePath:t,line:r}),enabled:n&&a.length>0,staleTime:0})}function fq(e){return e.serverKind?e.serverKind:/\.mdx?$/i.test(e.path)?`markdown`:`text`}function pq(e,t){return t<=0?e:`${e}${e.includes(`?`)?`&`:`?`}refresh=${t}`}function mq(e){let{languageHint:t,path:n,startLine:r,text:i}=e,a=r??1;return{key:`preview:${n}`,path:n,display:`preview`,lines:PW({text:i,kind:`context`,oldStartLine:a,newStartLine:a}),rawText:i,languageHint:t??null,oldStartLine:a,newStartLine:a}}function hq(e){if(Array.isArray(e.fullLines)&&e.fullLines.length>0)return{key:`diff:${e.key}`,path:e.path,display:`diff`,lines:e.fullLines,fullLines:e.fullLines,...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...e.patchText?{patchText:e.patchText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{}};if(e.beforeText==null&&e.afterText==null)return null;let t=RW({beforeText:e.beforeText??``,afterText:e.afterText??``,oldStartLine:e.oldStartLine??void 0,newStartLine:e.newStartLine??void 0});return{key:`diff:${e.key}`,path:e.path,display:`diff`,lines:t,fullLines:t,...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{}}}function gq({text:e,tone:t=`muted`}){return(0,R.jsx)(`div`,{className:r(`flex h-full items-center justify-center px-6 text-center text-sm`,t===`error`?`text-rose-600`:`text-gray-500`),children:e})}function _q(e){return e instanceof et&&e.code===`SERVER_PATH_NOT_FOUND`?b(`chatWorkspacePreviewNotFound`):b(`chatWorkspacePreviewFailed`)}function vq({diffBlock:e}){return e?(0,R.jsx)(yq,{block:e}):(0,R.jsx)(gq,{text:b(`chatWorkspaceDiffEmpty`)})}function yq({block:e,targetColumn:t,targetLine:n}){return(0,R.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar bg-white`,children:(0,R.jsx)(aH,{block:e,layout:`workspace`,targetColumn:t,targetLine:n})})}function bq({contentUrl:e,contentUrlKind:t,contentLabel:n,contentParams:r,directoryQuery:i,fileBasePath:a,onFileOpen:o,onHtmlContentHeightChange:s,previewBlock:c,previewKind:l,previewViewer:u,previewQuery:d,previewText:f,targetColumn:p,targetLine:m}){return e&&t?(0,R.jsx)(lq,{contentUrl:e,contentParams:r??void 0,kind:t,label:n,onHtmlContentHeightChange:s}):i?.data?(0,R.jsx)(GK,{browseQuery:i,onFileOpen:o,renderStatus:e=>(0,R.jsx)(gq,{...e})}):i?.isLoading&&d?.error&&!c?(0,R.jsx)(gq,{text:b(`chatWorkspaceLoadingDirectory`)}):(i?.isLoading||d?.isLoading)&&!c?(0,R.jsx)(gq,{text:b(`chatWorkspaceLoadingPreview`)}):d?.data?.kind===`binary`?(0,R.jsx)(gq,{text:b(`chatWorkspacePreviewUnsupported`)}):d?.error&&!c?(0,R.jsx)(gq,{tone:`error`,text:_q(d.error)}):l===`markdown`&&u!==`source`&&f?(0,R.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar px-5 py-4`,children:(0,R.jsx)(IB,{text:f,role:`assistant`,texts:{copyCodeLabel:b(`chatCodeCopy`),copiedCodeLabel:b(`chatCodeCopied`)},onFileOpen:o,resolveFileContentUrl:e=>We(e.path,a)})}):c?(0,R.jsx)(yq,{block:c,targetColumn:p,targetLine:m}):(0,R.jsx)(gq,{text:b(`chatWorkspacePreviewEmpty`)})}function xq({file:e,refreshVersion:t=0,sessionProjectRoot:n,sessionWorkingDir:r,showBreadcrumbs:i=!0,onHtmlContentHeightChange:a,onFileOpen:o}){let s=e.viewMode===`preview`,c=e.contentUrl?.trim()||null,l=s&&!c,u=dq({path:e.path,basePath:r,line:e.line,enabled:l}),d=Ic({path:e.path,basePath:r,includeFiles:!0,enabled:l}),f=(0,L.useMemo)(()=>e.viewMode===`diff`?hq(e):null,[e]),p=s?u?.data?.text??e.rawText??null:null,m=fq({path:u?.data?.resolvedPath??e.path,serverKind:u?.data?.kind}),h=c?oq({path:e.path,mimeType:e.mimeType}):null,g=d?.data?.currentPath??u?.data?.resolvedPath??e.path,_=d?.data?`directory`:`file`,v=rf(g,e.previewViewer),y=oq({path:g}),b=We(e.path,r),x=!c&&s&&b&&e.previewViewer!==`source`&&y!==`other`&&(y!==`html`||v===`rendered`)&&b?pq(b,t):null,S=c??x,C=h??(x?y:null),w=(0,L.useMemo)(()=>!s||!p||S?null:mq({path:u?.data?.resolvedPath??e.path,text:p,languageHint:u?.data?.languageHint??null,startLine:u?.data?.startLine??1}),[S,e.path,s,u?.data?.languageHint,u?.data?.resolvedPath,u?.data?.startLine,p]),T=!S&&!!u?.data?.truncated,E=n??r,D=(0,L.useMemo)(()=>Cl({path:g,kind:_,sessionProjectRoot:E,truncated:T}),[E,T,_,g]);return(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-white`,children:[i?(0,R.jsx)(XK,{breadcrumb:D,onFileOpen:o}):null,(0,R.jsx)(`div`,{className:`flex-1 min-h-0 overflow-hidden`,children:e.viewMode===`diff`?(0,R.jsx)(vq,{diffBlock:f}):(0,R.jsx)(bq,{contentUrl:S,contentUrlKind:C,contentLabel:e.label?.trim()||g,contentParams:e.params,directoryQuery:d,fileBasePath:r,onFileOpen:o,onHtmlContentHeightChange:a,previewBlock:w,previewKind:m,previewViewer:v,previewQuery:u,previewText:p,targetColumn:e.column,targetLine:e.line})})]})}var Sq=240;function Cq({actions:e,children:t,contentHeight:n,isLoading:i=!1}){return(0,R.jsxs)(`section`,{className:`group/inline-content relative my-2 w-full max-w-[48rem] overflow-visible`,"data-chat-inline-content-surface":`true`,"data-chat-message-wide-content":`true`,children:[e?(0,R.jsx)(`div`,{className:r(`pointer-events-none absolute bottom-full left-1/2 z-10 -translate-x-1/2 pb-2 opacity-0 transition-opacity duration-150`,`group-hover/inline-content:pointer-events-auto group-hover/inline-content:opacity-100 group-focus-within/inline-content:pointer-events-auto group-focus-within/inline-content:opacity-100`),"data-chat-inline-content-actions":`true`,children:(0,R.jsx)(`div`,{className:`flex items-center gap-0.5 rounded-lg bg-background/95 p-0.5 shadow-md ring-1 ring-border/60 backdrop-blur-sm`,"data-chat-inline-content-actions-surface":`true`,children:e})}):null,(0,R.jsx)(`div`,{className:r(`h-[240px] min-h-[240px] max-h-[min(90vh,1440px)] overflow-hidden rounded-lg`,i&&`animate-pulse bg-muted/45`),"data-chat-inline-content-viewport":`true`,style:n?{height:Math.max(Sq,n)}:void 0,children:t})]})}function wq(e,t){let n=e.path.trim();if(!n)return null;let r=t?.trim()||null,i=e.viewMode===`preview`?af(n,e.previewViewer??(e.line?`source`:void 0)):e.previewViewer??null,a=e.viewMode===`preview`&&i===`rendered`?`preview:rendered`:e.viewMode;return{key:`${r??`draft`}::${a}::${n}`,parentSessionKey:r,path:n,label:e.label?.trim()||null,viewMode:e.viewMode,previewViewer:i,line:e.line??null,column:e.column??null,params:e.params??null,rawText:e.rawText??null,contentUrl:e.contentUrl?.trim()||null,mimeType:e.mimeType?.trim()||null,beforeText:e.beforeText??null,afterText:e.afterText??null,patchText:e.patchText??null,oldStartLine:e.oldStartLine??null,newStartLine:e.newStartLine??null,fullLines:e.fullLines}}function Tq(e,t,n){let r=e.findIndex(e=>e.key===t.key);if(r!==-1){let n=[...e];return n[r]={...e[r],...t},n}let i=n?e.findIndex(e=>e.key===n):-1;return i===-1?[t,...e]:[...e.slice(0,i+1),t,...e.slice(i+1)]}function Eq({display:e,parentSessionKey:t,sessionProjectRoot:n,sessionWorkingDir:r,onFileOpen:i}){let[a,o]=(0,L.useState)(null);if(e.target.type!==`file`)return null;let{path:s,line:c,column:l,params:u,viewer:d}=e.target.payload,f=wq({path:s,label:e.title,viewMode:`preview`,previewViewer:d,line:c,column:l,params:u},t);if(!f)return null;let p=f.label??f.path.split(/[\\/]/).filter(Boolean).pop()??f.path,m=f.previewViewer===`rendered`&&/\.html?$/i.test(f.path),h=e=>{i({path:f.path,label:f.label??void 0,viewMode:`preview`,previewViewer:e,line:f.line??void 0,column:f.column??void 0,params:f.params??void 0})};return m?(0,R.jsx)(Cq,{actions:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Nt,{size:`sm`,icon:(0,R.jsx)(Mt,{className:`h-3.5 w-3.5`}),label:b(`chatPanelCardExpand`),tooltipSide:`top`,onClick:()=>h(`rendered`)}),(0,R.jsx)(Nt,{size:`sm`,icon:(0,R.jsx)(Lo,{className:`h-3.5 w-3.5`}),label:b(`chatWorkspaceOpenSource`),tooltipSide:`top`,onClick:()=>h(`source`)})]}),contentHeight:a,children:(0,R.jsx)(xq,{file:f,sessionProjectRoot:n,sessionWorkingDir:r,showBreadcrumbs:!1,onHtmlContentHeightChange:o,onFileOpen:i})}):(0,R.jsxs)(`section`,{className:`my-2 w-full max-w-[48rem] overflow-hidden rounded-lg border border-border bg-card shadow-sm`,"data-chat-inline-file-preview":`true`,"data-chat-message-wide-content":`true`,children:[(0,R.jsxs)(`header`,{className:`border-b border-border bg-muted/45 px-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium text-foreground`,children:[(0,R.jsx)(yn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`truncate`,children:p})]}),(0,R.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] font-normal text-muted-foreground`,title:f.path,children:f.path})]}),(0,R.jsx)(`div`,{className:`h-[420px] min-h-[240px] max-h-[min(60vh,420px)] overflow-hidden`,children:(0,R.jsx)(xq,{file:f,sessionProjectRoot:n,sessionWorkingDir:r,showBreadcrumbs:!1,onFileOpen:i})})]})}function Dq({deletePending:e,entry:t,favoritePending:n,onDelete:r,onOpen:i,onToggleFavorite:a}){let[o,s]=(0,L.useState)(!1),[c,l]=(0,L.useState)(!1),u=t.favorite?b(`panelAppsUnfavorite`):b(`panelAppsFavorite`),d=t.lastOpenedAt?`${b(`panelAppsLastOpened`)} ${kq(t.lastOpenedAt)}`:`${b(`panelAppsUpdated`)} ${kq(t.updatedAt)}`,f=e=>{e.stopPropagation(),a()},p=()=>{s(!1),l(!0)};return(0,R.jsxs)(`div`,{className:`group w-full min-w-0 rounded-lg border border-border/60 bg-card px-2.5 py-2.5 transition-colors hover:bg-muted/40`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:i,className:`min-w-0 flex-1 text-left`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-base text-muted-foreground`,children:(0,R.jsx)(Aq,{icon:t.icon,title:t.title})}),(0,R.jsx)(`span`,{className:`block min-w-0 flex-1 truncate text-sm font-medium text-foreground`,children:t.title})]}),t.description?(0,R.jsx)(`span`,{className:`mt-1.5 block truncate text-xs leading-5 text-muted-foreground`,children:t.description}):null,(0,R.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] leading-4 text-muted-foreground/70`,children:d})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-70 transition-opacity group-hover:opacity-100`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:f,disabled:n,className:`rounded-md p-1.5 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,title:u,"aria-label":u,children:(0,R.jsx)(Js,{className:t.favorite?`h-4 w-4 fill-current text-foreground`:`h-4 w-4`})}),(0,R.jsxs)(ct,{open:o,onOpenChange:s,children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground`,"aria-label":b(`panelAppsMoreActions`),disabled:e,children:(0,R.jsx)(jt,{className:`h-4 w-4`})})}),(0,R.jsx)(ot,{align:`end`,className:`w-48 rounded-xl p-1.5`,children:(0,R.jsx)(Oq,{destructive:!0,disabled:e,icon:Kn,label:b(`panelAppsDelete`),onClick:p})})]})]})]}),(0,R.jsx)(St,{open:c,onOpenChange:l,title:b(`panelAppsDeleteConfirmTitle`),description:`${b(`panelAppsDeleteConfirmDescription`)} ${t.fileName}`,confirmLabel:b(`delete`),variant:`destructive`,onConfirm:r,onCancel:()=>void 0})]})}function Oq({destructive:e=!1,disabled:t=!1,icon:n,label:i,onClick:a}){return(0,R.jsxs)(`button`,{type:`button`,className:r(`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-accent hover:text-accent-foreground`),disabled:t,onClick:a,children:[(0,R.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,R.jsx)(`span`,{children:i})]})}function kq(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=v(l()),r=new Date;return t.toDateString()===r.toDateString()?new Intl.DateTimeFormat(n,{hour:`2-digit`,minute:`2-digit`}).format(t):t.getFullYear()===r.getFullYear()?new Intl.DateTimeFormat(n,{month:`numeric`,day:`numeric`}).format(t):new Intl.DateTimeFormat(n,{year:`2-digit`,month:`numeric`,day:`numeric`}).format(t)}function Aq({icon:e,title:t}){return e?jq(e)?(0,R.jsx)(`img`,{src:e,alt:``,"aria-hidden":`true`,className:`h-5 w-5 rounded-sm object-contain`,title:t}):(0,R.jsx)(`span`,{className:`max-w-6 truncate text-center leading-none`,children:e}):(0,R.jsx)(vo,{className:`h-4 w-4`})}function jq(e){return e.startsWith(`data:image/`)||e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)}var Mq=[`panel-apps`];function Nq(e={}){return O({queryKey:Mq,queryFn:()=>Je.panelApps.listPanelApps(),enabled:e.enabled??!0,staleTime:0})}function Pq(){let e=Ke();return le({mutationFn:({id:e,preferences:t})=>Je.panelApps.updatePanelAppPreferences(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:Mq})}})}function Fq(){let e=Ke();return le({mutationFn:e=>Je.panelApps.recordPanelAppOpened(e),onSuccess:()=>{e.invalidateQueries({queryKey:Mq})}})}function Iq(){let e=Ke();return le({mutationFn:e=>Je.panelApps.grantClient(e),onSuccess:()=>{e.invalidateQueries({queryKey:Mq})}})}function Lq(){let e=Ke();return le({mutationFn:e=>Je.panelApps.deletePanelApp(e),onSuccess:()=>{e.invalidateQueries({queryKey:Mq})}})}function Rq(e,t){return t===`favorites`?zq(e.filter(e=>e.favorite),`smart`):zq(t===`recent-open`?e.filter(e=>e.lastOpenedAt):e,t)}function zq(e,t){return[...e].sort((e,n)=>Bq(e,n,t))}function Bq(e,t,n){return n===`recent-open`?Wq(e.lastOpenedAt,t.lastOpenedAt)||Vq(e,t):n===`updated`?Wq(e.updatedAt,t.updatedAt)||Vq(e,t):n===`name`?Vq(e,t):Hq(e,t)||Number(t.favorite)-Number(e.favorite)||Vq(e,t)}function Vq(e,t){return e.title.localeCompare(t.title)}function Hq(e,t){return Uq(t)-Uq(e)}function Uq(e){return Math.max(new Date(e.lastOpenedAt??0).getTime(),new Date(e.createdAt).getTime(),new Date(e.updatedAt).getTime())}function Wq(e,t){return new Date(t??0).getTime()-new Date(e??0).getTime()}var Gq=[];function Kq({headerContent:e,onOpenPanelApp:t}){let n=Nq(),r=Lq(),i=Pq(),a=Fq(),o=Iq(),s=s6(),c=Ni(),[l,u]=(0,L.useState)(`smart`),d=n.data?.entries??Gq,f=(0,L.useMemo)(()=>Rq(d,l),[d,l]),p=async e=>{if(await m(e))try{t(await a.mutateAsync(e.id))}catch{t(e)}},m=async e=>!e.clientDeclared||e.clientGranted?!0:await s.serviceActionAuthorizationManager.requestAuthorization({panelAppId:e.appId,actions:[{actionId:`nextclaw.client`,actionTitle:b(`panelAppsClientGrantTitle`),actionDescription:b(`panelAppsClientGrantDescription`),risk:`dangerous`}]})?(await o.mutateAsync(e.appId),!0):!1,h=e=>{i.mutate({id:e.id,preferences:{favorite:!e.favorite}})},g=e=>{r.mutate(e.id)},_=()=>{c(`/chat`),s.chatDraftIntentManager.requestDraft(b(`panelAppsExamplePrompt`))};return n.isLoading?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:b(`panelAppsLoading`)}):n.isError?(0,R.jsx)(`div`,{className:`p-4 text-sm text-rose-600`,children:n.error instanceof Error?n.error.message:b(`panelAppsLoadFailed`)}):(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-card text-card-foreground`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border/70 px-4 py-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e??(0,R.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:b(`panelAppsTitle`)}),n.data?.panelsPath?(0,R.jsx)(Bt,{delayDuration:250,children:(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,className:`rounded p-0.5 text-muted-foreground/70 transition-colors hover:bg-accent hover:text-accent-foreground`,"aria-label":b(`panelAppsTitle`),children:(0,R.jsx)(No,{className:`h-3.5 w-3.5`})})}),(0,R.jsx)(Lt,{side:`bottom`,className:`max-w-[320px] break-all font-mono text-xs`,children:n.data.panelsPath})]})}):null]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>void n.refetch(),className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,title:b(`panelAppsRefresh`),"aria-label":b(`panelAppsRefresh`),children:(0,R.jsx)(Gn,{className:`h-3.5 w-3.5`})})]}),(0,R.jsx)(`div`,{className:`border-b border-border/70 px-3 py-2`,children:(0,R.jsx)(Rn,{value:l,onValueChange:e=>u(e),children:(0,R.jsxs)(In,{className:`grid h-auto w-full grid-cols-5 rounded-lg bg-muted/70 p-0.5`,children:[(0,R.jsx)(Nn,{value:`smart`,className:`px-2 py-1 text-xs`,children:b(`panelAppsSortSmart`)}),(0,R.jsx)(Nn,{value:`favorites`,className:`px-2 py-1 text-xs`,children:b(`panelAppsFavorites`)}),(0,R.jsx)(Nn,{value:`recent-open`,className:`px-2 py-1 text-xs`,children:b(`panelAppsSortRecentOpen`)}),(0,R.jsx)(Nn,{value:`updated`,className:`px-2 py-1 text-xs`,children:b(`panelAppsSortUpdated`)}),(0,R.jsx)(Nn,{value:`name`,className:`px-2 py-1 text-xs`,children:b(`panelAppsSortName`)})]})})}),d.length===0?(0,R.jsx)(qq,{panelsPath:n.data?.panelsPath,onCreateExample:_,onRefresh:()=>void n.refetch()}):f.length===0?(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground`,children:b(`panelAppsEmptyFiltered`)}):(0,R.jsx)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto p-3`,children:(0,R.jsx)(`div`,{className:`space-y-1.5`,children:f.map(e=>(0,R.jsx)(Dq,{entry:e,deletePending:r.isPending,favoritePending:i.isPending,onDelete:()=>g(e),onOpen:()=>void p(e),onToggleFavorite:()=>h(e)},e.id))})})]})}function qq({onCreateExample:e,panelsPath:t,onRefresh:n}){return(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center overflow-y-auto px-5 py-6 text-center`,children:(0,R.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,R.jsx)(`div`,{className:`mx-auto flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,R.jsx)(vo,{className:`h-5 w-5`})}),(0,R.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-foreground`,children:b(`panelAppsEmptyTitle`)}),(0,R.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:b(`panelAppsEmptyDescription`)}),(0,R.jsxs)(`div`,{className:`mt-4 space-y-2 text-left`,children:[(0,R.jsx)(Jq,{icon:(0,R.jsx)(Ss,{className:`h-4 w-4`}),title:b(`panelAppsEmptyAskTitle`),description:b(`panelAppsEmptyAskDescription`),actionLabel:b(`panelAppsEmptyAskAction`),onAction:e}),(0,R.jsx)(Jq,{icon:(0,R.jsx)(Ko,{className:`h-4 w-4`}),title:b(`panelAppsEmptyFileTitle`),description:b(`panelAppsEmptyFileDescription`)})]}),t?(0,R.jsxs)(`div`,{className:`mt-4 rounded-md bg-muted/60 px-3 py-2 text-left`,children:[(0,R.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:b(`panelAppsPanelsPath`)}),(0,R.jsx)(`code`,{className:`mt-1 block break-all text-xs text-muted-foreground`,children:t})]}):null,(0,R.jsxs)(`button`,{type:`button`,onClick:n,className:`mt-4 inline-flex items-center justify-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,R.jsx)(Gn,{className:`h-3.5 w-3.5`}),b(`panelAppsRefresh`)]})]})})}function Jq({actionLabel:e,description:t,icon:n,onAction:r,title:i}){let a=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`mt-0.5 text-muted-foreground`,children:n}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:i}),(0,R.jsx)(`div`,{className:`mt-0.5 text-xs leading-5 text-muted-foreground`,children:t}),e?(0,R.jsx)(`div`,{className:`mt-2 text-xs font-medium text-primary`,children:e}):null]})]});return r?(0,R.jsx)(`button`,{type:`button`,onClick:r,className:`flex w-full gap-2 rounded-md bg-muted/60 px-3 py-2.5 text-left transition-colors hover:bg-accent/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:a}):(0,R.jsx)(`div`,{className:`flex gap-2 rounded-md bg-muted/60 px-3 py-2.5`,children:a})}var Yq=class{constructor(e){this.authorizationManager=e,this.handleIframeMessage=({event:e,iframe:t,iframeInstanceId:n,tab:r})=>{this.isBridgeRequest(e.data)&&(!t?.contentWindow||e.source!==t.contentWindow||this.handleBridgeRequest({event:e,iframe:t,iframeInstanceId:n,tab:r},e.data))},this.handleBridgeRequest=async(e,t)=>{try{let n=this.getBridgeContext(t),r=await this.dispatchRequest(n,t);this.postResponse(e,{type:`nextclaw:panel-app-service-actions:response`,requestId:t.requestId,ok:!0,data:r})}catch(n){this.postResponse(e,{type:`nextclaw:panel-app-service-actions:response`,requestId:t.requestId,ok:!1,error:this.toBridgeError(n)})}},this.dispatchRequest=async(e,t)=>{switch(t.method){case`list`:return await Je.serviceApps.listServiceActions({bridgeSessionToken:e.token});case`requestGrant`:return await this.confirmAndGrant(e,this.requireActionId(t));case`revokeGrant`:return await Je.serviceApps.revokeServiceAction(this.requireActionId(t),{bridgeSessionToken:e.token});case`invoke`:return await this.invokeWithAuthorization(e,t);case`agent.send`:return await this.sendAgentMessageWithAuthorization(e,t);case`agent.generateObject`:return await this.generateAgentObjectWithAuthorization(e,t);default:throw Error(`Unsupported panel bridge method: ${String(t.method)}`)}},this.invokeWithAuthorization=async(e,t)=>{let n=this.requireActionId(t);try{return await Je.serviceApps.invokeServiceAction(n,this.readOptionalRecord(t.payload?.input),{bridgeSessionToken:e.token})}catch(r){if(!(r instanceof et)||r.code!==`AUTHORIZATION_REQUIRED`)throw r;return await this.confirmAndGrant(e,n,this.readOptionalRecord(t.payload?.input)),await Je.serviceApps.invokeServiceAction(n,this.readOptionalRecord(t.payload?.input),{bridgeSessionToken:e.token})}},this.sendAgentMessageWithAuthorization=async(e,t)=>{try{return await Je.panelApps.sendAgentMessage(this.readAgentSendRequest(t),{bridgeSessionToken:e.token})}catch(n){if(!(n instanceof et)||n.code!==`AUTHORIZATION_REQUIRED`)throw n;return await this.confirmAndGrantAgentCapability(e,`agent:send`),await Je.panelApps.sendAgentMessage(this.readAgentSendRequest(t),{bridgeSessionToken:e.token})}},this.generateAgentObjectWithAuthorization=async(e,t)=>{try{return await Je.panelApps.generateAgentObject(this.readGenerateObjectRequest(t),{bridgeSessionToken:e.token})}catch(n){if(!(n instanceof et)||n.code!==`AUTHORIZATION_REQUIRED`)throw n;return await this.confirmAndGrantAgentCapability(e,`agent:generateObject`),await Je.panelApps.generateAgentObject(this.readGenerateObjectRequest(t),{bridgeSessionToken:e.token})}},this.confirmAndGrantAgentCapability=async(e,t)=>{if(!await this.authorizationManager.requestAuthorization({panelAppId:e.appId,actions:[{actionId:t,actionTitle:t===`agent:send`?`Send agent message`:`Generate object`,actionDescription:t===`agent:send`?`Send a message to a NextClaw Agent session.`:`Send context to a NextClaw Agent session and receive a structured object.`,risk:`write`}]}))throw new et({code:`AUTHORIZATION_REJECTED`,message:`Permission rejected for ${t}.`});return await Je.panelApps.grantAgentCapability(t,{bridgeSessionToken:e.token})},this.confirmAndGrant=async(e,t,n)=>{let r=await this.listGrantCandidateActions(e,t);if(!await this.authorizationManager.requestAuthorization({panelAppId:e.appId,actions:r.map(e=>({actionId:e.id,actionTitle:e.title,actionDescription:e.description,risk:e.risk})),inputPreview:this.createInputPreview(n)}))throw new et({code:`AUTHORIZATION_REJECTED`,message:`Permission rejected for ${t}.`});let i=await Je.serviceApps.grantServiceActions(r.map(e=>e.id),{bridgeSessionToken:e.token}),a=i.grants.find(e=>e.actionId===t)??i.grants[0];if(!a)throw Error(`No permission grant returned for ${t}.`);return a},this.listGrantCandidateActions=async(e,t)=>{let n=await Je.serviceApps.listServiceActions({bridgeSessionToken:e.token}),r=n.actions.find(e=>e.id===t);if(r&&r.grantState!==`not-granted`)return[r];let i=n.actions.filter(e=>e.grantState===`not-granted`),a=[...i.filter(e=>e.id===t),...i.filter(e=>e.id!==t)];return a.length>0?a:[{appId:r?.appId??t.split(`.`)[0]??t,description:r?.description,id:t,name:r?.name??t,risk:r?.risk??`dangerous`,title:r?.title}]},this.createInputPreview=e=>{if(!(!e||Object.keys(e).length===0))try{let t=JSON.stringify(e,null,2);return t.length>500?`${t.slice(0,500)}...`:t}catch{return`[unserializable input]`}},this.getBridgeContext=e=>({appId:e.appId,token:e.runtimeToken}),this.requireActionId=e=>{let t=e.payload?.actionId?.trim();if(!t)throw Error(`Panel bridge actionId is required.`);return t},this.readOptionalRecord=e=>{if(e!==void 0)return this.requireRecord(e,`input`)},this.readAgentSendRequest=e=>({payload:this.requireRecord(e.payload?.request,`agent.send request`)}),this.readGenerateObjectRequest=e=>({input:this.requireRecord(e.payload?.input,`generateObject input`)}),this.requireRecord=(e,t)=>{if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`${t} is required.`);return e},this.postResponse=(e,t)=>{e.iframe?.contentWindow?.postMessage(t,`*`)},this.toBridgeError=e=>e instanceof et?{code:e.code,message:e.message,details:e.details}:{message:e instanceof Error?e.message:String(e)},this.isBridgeRequest=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`nextclaw:panel-app-service-actions:request`&&typeof t.requestId==`string`&&typeof t.runtimeToken==`string`&&typeof t.appId==`string`&&(t.method===`invoke`||t.method===`agent.send`||t.method===`agent.generateObject`||t.method===`list`||t.method===`requestGrant`||t.method===`revokeGrant`)}}};function Xq(e,t){let n=t.trim();return[e.id,e.appId,e.fileName,e.title].some(e=>e.trim()===n)}function Zq(e,t){let n=t.trim();return n?e.find(e=>Xq(e,n))??null:null}var Qq=`allow-scripts allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-downloads allow-pointer-lock allow-presentation`;function $q(e){e?.focus({preventScroll:!0}),e?.contentWindow?.focus()}function eJ(){return`service-action-auth-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}var tJ=x((e,t)=>({pending:null,requestAuthorization:async n=>await new Promise(r=>{t().pending?.resolve(!1),e({pending:{id:eJ(),...n,resolve:r}})}),resolveAuthorization:n=>{let{pending:r}=t();r&&(r.resolve(n),e({pending:null}))}}));function nJ(){let e=tJ(e=>e.pending),t=tJ(e=>e.resolveAuthorization);return(0,R.jsx)(_t,{open:!!e,onOpenChange:e=>{e||t(!1)},children:(0,R.jsxs)(bt,{className:`[&>:last-child]:hidden`,children:[(0,R.jsxs)(vt,{children:[(0,R.jsxs)(xt,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Vs,{className:`h-4 w-4 text-amber-600`}),b(`serviceActionAuthorizationTitle`)]}),(0,R.jsx)(mt,{children:b(`serviceActionAuthorizationDescription`)})]}),e?(0,R.jsxs)(`div`,{className:`space-y-3 rounded-md border border-border bg-muted/60 p-3 text-sm`,children:[(0,R.jsx)(iJ,{label:b(`serviceActionAuthorizationSource`),value:e.panelAppId}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:b(`serviceActionAuthorizationActions`)}),(0,R.jsx)(`div`,{className:`max-h-64 space-y-2 overflow-auto`,children:e.actions.map(e=>(0,R.jsx)(rJ,{action:e},e.actionId))})]}),e.inputPreview?(0,R.jsx)(iJ,{label:b(`serviceActionAuthorizationInput`),value:e.inputPreview}):null]}):null,(0,R.jsxs)(ut,{className:`gap-2 sm:gap-0`,children:[(0,R.jsx)(F,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:b(`serviceActionAuthorizationReject`)}),(0,R.jsx)(F,{type:`button`,onClick:()=>t(!0),children:b(`serviceActionAuthorizationAllow`)})]})]})})}function rJ({action:e}){return(0,R.jsxs)(`div`,{className:`space-y-1 rounded border border-border bg-card px-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,R.jsx)(`div`,{className:`min-w-0 break-words text-xs font-medium text-foreground`,children:e.actionTitle??e.actionId}),(0,R.jsx)(`div`,{className:`shrink-0 rounded bg-amber-50 px-1.5 py-0.5 text-[11px] font-medium text-amber-700`,children:e.risk??`dangerous`})]}),(0,R.jsx)(`div`,{className:`break-words text-[11px] text-muted-foreground`,children:e.actionId}),e.actionDescription?(0,R.jsx)(`div`,{className:`break-words text-xs text-muted-foreground`,children:e.actionDescription}):null]})}function iJ({label:e,value:t}){return(0,R.jsxs)(`div`,{className:`grid grid-cols-[5rem_minmax(0,1fr)] gap-3`,children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,R.jsx)(`div`,{className:`min-w-0 break-words text-xs text-foreground`,children:t})]})}var aJ=class{constructor(){this.requestAuthorization=async e=>await tJ.getState().requestAuthorization(e)}},oJ=[`service-apps`],sJ=[`service-actions`],cJ=[`service-action-grants`];function lJ(){return O({queryKey:oJ,queryFn:()=>Je.serviceApps.listServiceApps()})}function uJ(){return O({queryKey:sJ,queryFn:()=>Je.serviceApps.listServiceActions()})}function dJ(){return O({queryKey:cJ,queryFn:()=>Je.serviceApps.listServiceActionGrants()})}function fJ(){let e=Ke();return le({mutationFn:e=>Je.serviceApps.restartServiceApp(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:oJ}),e.invalidateQueries({queryKey:sJ})])}})}function pJ(){let e=Ke();return le({mutationFn:e=>Je.serviceApps.deleteServiceApp(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:oJ}),e.invalidateQueries({queryKey:sJ}),e.invalidateQueries({queryKey:cJ})])}})}function mJ(){let e=Ke();return le({mutationFn:e=>Je.serviceApps.discoverServiceAppActions(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:oJ})}})}function hJ(){let e=Ke();return le({mutationFn:e=>Je.serviceApps.revokeServiceActionGrant(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:sJ}),e.invalidateQueries({queryKey:cJ})])}})}function gJ({headerContent:e}){let t=lJ(),n=uJ(),r=dJ(),i=pJ(),a=fJ(),o=mJ(),s=hJ(),[c,l]=(0,L.useState)({}),[u,d]=(0,L.useState)({}),f=()=>{t.refetch(),n.refetch(),r.refetch()};if(t.isLoading||n.isLoading||r.isLoading)return(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:b(`serviceAppsLoading`)});if(t.isError||n.isError||r.isError){let e=t.error??n.error??r.error;return(0,R.jsx)(`div`,{className:`p-4 text-sm text-rose-600`,children:e instanceof Error?e.message:b(`serviceAppsLoadFailed`)})}let p=t.data?.entries??[],m=n.data?.actions??[],h=r.data?.grants??[],g=e=>{o.mutateAsync(e).then(t=>{l(n=>({...n,[e]:t.actions})),d(t=>({...t,[e]:!0}))})};return(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-card text-card-foreground`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border/60 px-4 py-3`,children:[(0,R.jsx)(`div`,{className:`flex min-w-0 items-center gap-2`,children:e??(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Bs,{className:`h-4 w-4 text-primary`}),(0,R.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:b(`serviceAppsTitle`)})]})}),(0,R.jsx)(Bt,{delayDuration:250,children:(0,R.jsx)(bJ,{icon:Gn,label:b(`serviceAppsRefresh`),onClick:f})})]}),p.length===0?(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 py-8 text-center`,children:(0,R.jsxs)(`div`,{className:`w-full max-w-xs`,children:[(0,R.jsx)(`div`,{className:`mx-auto flex h-10 w-10 items-center justify-center rounded-xl bg-muted text-muted-foreground`,children:(0,R.jsx)(Bs,{className:`h-5 w-5`})}),(0,R.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-foreground`,children:b(`serviceAppsEmptyTitle`)}),(0,R.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:b(`serviceAppsEmptyDescription`)})]})}):(0,R.jsx)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto bg-muted/25 p-3`,children:(0,R.jsx)(`div`,{className:`space-y-2.5`,children:p.map(e=>(0,R.jsx)(_J,{app:e,actions:c[e.id]??m.filter(t=>t.appId===e.id),actionsOpen:!!u[e.id],grants:h,deletePending:i.isPending,isDiscovering:o.isPending,onActionsOpenChange:t=>d(n=>({...n,[e.id]:t})),onDiscover:g,onDelete:e=>void i.mutate(e),onRestart:e=>void a.mutate(e),onRevoke:e=>void s.mutate({actionId:e.actionId,caller:e.caller})},e.id))})})]})}function _J({app:e,actions:t,actionsOpen:n,grants:i,deletePending:a,isDiscovering:o,onActionsOpenChange:s,onDiscover:c,onDelete:l,onRestart:u,onRevoke:d}){let[f,p]=(0,L.useState)(!1),[m,h]=(0,L.useState)(!1),g=e.status!==`starting`&&e.status!==`stopped`,_=e.status===`running`||e.status===`failed`,v=()=>{p(!1),h(!0)};return(0,R.jsx)(Bt,{delayDuration:250,children:(0,R.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-border/70 bg-card shadow-[0_1px_2px_rgba(30,20,10,0.03)]`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3 px-3 pt-3`,children:[(0,R.jsx)(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,R.jsx)(Bs,{className:`h-4 w-4`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:e.title}),(0,R.jsx)(vJ,{status:e.status})]}),e.description?(0,R.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-muted-foreground`,children:e.description}):null]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,R.jsx)(bJ,{disabled:o||!g,icon:Ls,label:b(`serviceAppsDiscoverActions`),tooltip:b(`serviceAppsDiscoverActionsHint`),onClick:()=>c(e.id)}),(0,R.jsx)(bJ,{disabled:!_,icon:Zs,label:b(`serviceAppsDisconnectRuntime`),tooltip:b(`serviceAppsDisconnectRuntimeHint`),onClick:()=>u(e.id)}),(0,R.jsxs)(ct,{open:f,onOpenChange:p,children:[(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,"aria-label":b(`serviceAppsMoreActions`),disabled:a,children:(0,R.jsx)(jt,{className:`h-3.5 w-3.5`})})})}),(0,R.jsx)(Lt,{side:`bottom`,className:`text-xs`,children:b(`serviceAppsMoreActions`)})]}),(0,R.jsx)(ot,{align:`end`,className:`w-48 rounded-xl p-1.5`,children:(0,R.jsx)(xJ,{destructive:!0,disabled:a,icon:Kn,label:b(`serviceAppsDelete`),onClick:v})})]})]})]}),e.lastError?(0,R.jsx)(`div`,{className:`mx-3 mt-3 rounded-lg border border-rose-200/70 bg-rose-50 px-2.5 py-1.5 text-xs text-rose-700`,children:e.lastError}):null,(0,R.jsx)(SJ,{app:e}),(0,R.jsxs)(`div`,{className:`mt-3 border-t border-border/50 bg-muted/30`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>s(!n),className:`flex w-full items-start justify-between gap-2 px-3 py-2 text-left transition-colors hover:bg-muted/40`,"aria-expanded":n,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground/80`,children:b(`serviceAppsActionsSection`)}),(0,R.jsx)(`span`,{className:`rounded-full bg-card px-1.5 py-0.5 text-[11px] tabular-nums text-muted-foreground/70`,children:t.length})]}),n?null:t.length===0?(0,R.jsx)(`div`,{className:`mt-1 text-[11px] text-muted-foreground`,children:b(`serviceAppsActionsEmpty`)}):(0,R.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:[t.slice(0,4).map(e=>(0,R.jsx)(`span`,{className:`max-w-[9.5rem] truncate rounded-md border border-border/50 bg-card px-1.5 py-0.5 text-[11px] text-muted-foreground`,title:e.title??e.name,children:e.title??e.name},e.id)),t.length>4?(0,R.jsxs)(`span`,{className:`rounded-md bg-card px-1.5 py-0.5 text-[11px] text-muted-foreground/70`,children:[`+`,t.length-4]}):null]})]}),(0,R.jsx)(Wt,{className:r(`mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground/70 transition-transform`,n&&`rotate-180`)})]}),n?(0,R.jsx)(`div`,{className:`px-3 pb-2.5`,children:t.length===0?(0,R.jsx)(`div`,{className:`rounded-lg border border-dashed border-border/70 bg-card/70 px-2.5 py-2 text-[11px] text-muted-foreground`,children:b(`serviceAppsActionsEmpty`)}):(0,R.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>(0,R.jsx)(wJ,{action:e,grants:i.filter(t=>t.actionId===e.id),onRevoke:d},e.id))})}):null]}),(0,R.jsx)(St,{open:m,onOpenChange:h,title:b(`serviceAppsDeleteConfirmTitle`),description:`${b(`serviceAppsDeleteConfirmDescription`)} ${e.title}`,confirmLabel:b(`delete`),variant:`destructive`,onConfirm:()=>l(e.id),onCancel:()=>void 0})]})})}function vJ({status:e}){let t=yJ(e),n=t.icon;return(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsxs)(`span`,{className:r(`inline-flex shrink-0 items-center gap-1 rounded-full px-1.5 py-0.5 text-[11px] font-medium`,t.className),"aria-label":t.label,children:[(0,R.jsx)(n,{className:r(`h-3 w-3`,t.iconClassName)}),(0,R.jsx)(`span`,{children:t.label})]})}),(0,R.jsx)(Lt,{side:`bottom`,className:`text-xs`,children:t.tooltip})]})}function yJ(e){switch(e){case`running`:return{className:`bg-emerald-50 text-emerald-700`,icon:jo,label:b(`serviceAppsStatus_running`),tooltip:b(`serviceAppsStatusHint_running`)};case`starting`:return{className:`bg-blue-50 text-blue-700`,icon:Un,iconClassName:`animate-spin`,label:b(`serviceAppsStatus_starting`),tooltip:b(`serviceAppsStatusHint_starting`)};case`failed`:return{className:`bg-rose-50 text-rose-700`,icon:Xs,label:b(`serviceAppsStatus_failed`),tooltip:b(`serviceAppsStatusHint_failed`)};case`stopped`:return{className:`bg-muted text-muted-foreground`,icon:Po,label:b(`serviceAppsStatus_stopped`),tooltip:b(`serviceAppsStatusHint_stopped`)};default:return{className:`bg-muted text-muted-foreground`,icon:Mo,label:b(`serviceAppsStatus_idle`),tooltip:b(`serviceAppsStatusHint_idle`)}}}function bJ({disabled:e=!1,icon:t,label:n,tooltip:r=n,onClick:i}){return(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,onClick:i,disabled:e,className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:text-muted-foreground/40 disabled:opacity-60 disabled:hover:bg-transparent`,"aria-label":n,children:(0,R.jsx)(t,{className:`h-3.5 w-3.5`})})}),(0,R.jsx)(Lt,{side:`bottom`,className:`max-w-56 text-xs`,children:r})]})}function xJ({destructive:e=!1,disabled:t=!1,icon:n,label:i,onClick:a}){return(0,R.jsxs)(`button`,{type:`button`,className:r(`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-accent hover:text-accent-foreground`),disabled:t,onClick:a,children:[(0,R.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,R.jsx)(`span`,{children:i})]})}function SJ({app:e}){let[t,n]=(0,L.useState)(!1),i=[e.command,...e.args??[]].filter(e=>!!e?.trim()).join(` `),a=[{label:b(`serviceAppsCommand`),value:i},{label:b(`serviceAppsCwd`),value:e.cwd},{label:b(`serviceAppsManifest`),value:e.manifestPath},{label:b(`serviceAppsLastStarted`),value:e.lastStartedAt},{label:b(`serviceAppsLastReady`),value:e.lastReadyAt},{label:b(`serviceAppsLastFailed`),value:e.lastFailedAt}].filter(e=>e.value);return a.length===0?null:(0,R.jsxs)(`div`,{className:`mx-3 mt-3 overflow-hidden rounded-lg border border-border/50 bg-muted/35`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left transition-colors hover:bg-muted/50`,"aria-expanded":t,children:[(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground`,children:b(`serviceAppsDetails`)}),(0,R.jsx)(Wt,{className:r(`h-3.5 w-3.5 shrink-0 text-muted-foreground/70 transition-transform`,t&&`rotate-180`)})]}),t?(0,R.jsx)(`dl`,{className:`grid grid-cols-[4.75rem_minmax(0,1fr)] gap-x-2 gap-y-1 border-t border-border/50 px-2.5 py-2 text-[11px]`,children:a.map(e=>(0,R.jsx)(CJ,{label:e.label,value:e.value},e.label))}):null]})}function CJ({label:e,value:t}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground/70`,children:e}),(0,R.jsx)(`dd`,{className:`min-w-0 truncate font-mono text-muted-foreground`,title:t,children:t})]})}function wJ({action:e,grants:t,onRevoke:n}){return(0,R.jsxs)(`div`,{className:`rounded-lg border border-border/50 bg-card px-2.5 py-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground`,children:(0,R.jsx)(tc,{className:`h-3.5 w-3.5`})}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`truncate text-xs font-medium text-foreground`,children:e.title??e.name}),e.description?(0,R.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:e.description}):null]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[e.runtimeState?(0,R.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground`,children:b(`serviceAppsRuntimeState_${e.runtimeState}`)}):null,(0,R.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground`,children:e.risk})]})]}),t.map(e=>(0,R.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between gap-2 pl-8`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,R.jsx)(Hs,{className:`h-3 w-3 shrink-0 text-emerald-500`}),(0,R.jsxs)(`span`,{className:`truncate`,children:[b(`serviceAppsGrantedTo`),` `,e.caller.appId]})]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:`rounded-md p-1 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-rose-600`,title:b(`serviceAppsRevokeGrant`),"aria-label":b(`serviceAppsRevokeGrant`),children:(0,R.jsx)(Kn,{className:`h-3 w-3`})})]},`${e.caller.surface}:${e.caller.appId}:${e.actionId}`))]})}function TJ({activeTab:e,onActiveTabChange:t,onOpenPanelApp:n}){let r=(0,R.jsx)(Rn,{value:e,onValueChange:e=>t(e),children:(0,R.jsxs)(In,{className:`grid h-auto w-[min(340px,100%)] grid-cols-2 rounded-lg bg-gray-100/70 p-0.5`,children:[(0,R.jsxs)(Nn,{value:`panel-apps`,className:`gap-1.5 px-2 py-1.5 text-xs`,children:[(0,R.jsx)(vo,{className:`h-3.5 w-3.5`}),b(`panelAppsTitle`)]}),(0,R.jsxs)(Nn,{value:`service-apps`,className:`gap-1.5 px-2 py-1.5 text-xs`,children:[(0,R.jsx)(Bs,{className:`h-3.5 w-3.5`}),b(`serviceAppsTitle`)]})]})});return(0,R.jsx)(`div`,{className:`h-full min-h-0 bg-white`,children:e===`panel-apps`?(0,R.jsx)(Kq,{headerContent:r,onOpenPanelApp:n}):(0,R.jsx)(gJ,{headerContent:r})})}function EJ({appTitle:e,onOpenApps:t,onRefresh:n}){return(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border/70 bg-card px-3.5 py-2 shrink-0`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:t,className:`inline-flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,title:b(`appsTitle`),"aria-label":b(`appsTitle`),children:(0,R.jsx)(wt,{className:`h-3.5 w-3.5`})}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium text-muted-foreground`,title:e,children:e}),(0,R.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,title:b(`panelAppsRefreshCurrent`),"aria-label":b(`panelAppsRefreshCurrent`),children:(0,R.jsx)(Gn,{className:`h-3.5 w-3.5`})})]})}function DJ(e){return e.split(`/`).map(e=>e.trim()).filter(e=>e.length>0)}function OJ(e){let t=e.trim();try{let e=t.startsWith(`/`),n=e?new URL(t,`http://nextclaw.local`):new URL(t);return{authority:e?``:n.hostname,pathSegments:DJ(n.pathname),pathname:n.pathname,raw:t,scheme:e?``:n.protocol.replace(/:$/,``).toLowerCase(),searchParams:n.searchParams}}catch{return{authority:``,pathSegments:DJ(t),pathname:t,raw:t,scheme:``,searchParams:new URLSearchParams}}}var kJ=class{constructor(e,t){this.routeDefinitions=e,this.options=t,this.resolve=e=>{let t=OJ(e);return this.findDefinition(t).resolve(t)},this.normalize=e=>this.options.getNormalizedUri(this.resolve(e)),this.areEquivalent=(e,t)=>this.findDefinition(OJ(e)).areEquivalent?.(e,t)??this.normalize(e)===this.normalize(t),this.findDefinition=e=>{let t=this.routeDefinitions.find(t=>t.match(e));if(!t)throw Error(`Unsupported resource URI: ${e.raw}`);return t}}},AJ=`home`,jJ=`nextclaw://new-tab`,MJ=`apps`,NJ=`nextclaw://apps`,PJ=`${NJ}?tab=service-apps`,FJ=`panel-app`,IJ=`panel-apps`;function LJ(e){return e===`panel-apps`||e===`service-apps`}function RJ(e=IJ){return e===IJ?NJ:PJ}function zJ(e){try{let t=new URL(e).searchParams.get(`tab`);return LJ(t)?t:IJ}catch{return IJ}}function BJ(e){return RJ(zJ(e))}function VJ(e,t){let n=`nextclaw://panel-app/${encodeURIComponent(e)}`,r=t?.trim();return r?`${n}?${new URLSearchParams({path:r}).toString()}`:n}function HJ(e,t){let n=`/api/panel-apps/${encodeURIComponent(e)}/content`,r=t?.trim();return r?`${n}?${new URLSearchParams({path:r}).toString()}`:n}function UJ(e){return e.startsWith(`data:image/`)||e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)}function WJ(e){let t=e.icon?.trim();if(t)return UJ(t)?{type:`url`,url:t}:{type:`text`,value:t}}function GJ(e){return{dedupeKey:`panel-app:${e.id}`,dockIcon:WJ(e),historyPolicy:`managed`,kind:FJ,resourceUri:VJ(e.id),title:e.title,url:e.contentPath}}function KJ(e,t){return e===t||e.startsWith(`${t}?`)||e.startsWith(`${t}/`)}function qJ(e){let t=e.pathSegments.join(`/`);return pr(t?`/${t}`:`/`,`docs`)}function JJ(e){let t=e.filter(e=>e.trim().length>0).map(e=>encodeURIComponent(decodeURIComponent(e))).join(`/`);return t?`nextclaw://docs/${t}`:`nextclaw://docs`}function YJ(e){let t=$n(e),n=t.startsWith(`/`)?t:(()=>{try{return new URL(e).pathname}catch{return``}})();return n?JJ(n.split(`/`)):`nextclaw://docs`}function XJ(e){if(e.scheme===`nextclaw`&&e.authority===`panel-app`)return e.pathSegments[0]??``;let[t,n,r,i]=e.pathSegments;return t===`api`&&n===`panel-apps`&&r!==void 0&&r.length>0&&i===`content`?r:``}function ZJ(e){return XJ(e).length>0}function QJ(e){let t=XJ(e);if(!t)return`nextclaw://panel-app`;let n=e.searchParams.get(`path`)?.trim();return HJ(decodeURIComponent(t),n)}function $J(e){let t=XJ(e);if(!t)return`nextclaw://panel-app`;let n=`nextclaw://panel-app/${encodeURIComponent(decodeURIComponent(t))}`,r=e.searchParams.get(`path`)?.trim();return r?`${n}?${new URLSearchParams({path:r}).toString()}`:n}function eY(e,t){let n=OJ(e),r=OJ(t),i=XJ(n),a=XJ(r),o=n.searchParams.get(`path`)?.trim()??``,s=r.searchParams.get(`path`)?.trim()??``;return i.length>0&&a.length>0?decodeURIComponent(i)===decodeURIComponent(a)&&o===s:e===t}var tY=[{defaultUrl:()=>jJ,id:`home`,kind:AJ,match:e=>e.raw===jJ,resolve:()=>({historyPolicy:`managed`,kind:AJ,resourceUri:jJ,title:b(`docBrowserHomeTitle`),url:jJ}),areEquivalent:(e,t)=>e===t},{defaultUrl:lr,id:`docs-url`,kind:`docs`,match:e=>rr(e.raw),resolve:e=>{let t=pr(e.raw,`docs`);return{historyPolicy:`managed`,kind:`docs`,resourceUri:YJ(t),title:b(`docBrowserHelp`),url:t}},areEquivalent:(e,t)=>$n(e)===$n(t)},{defaultUrl:lr,id:`nextclaw-docs`,kind:`docs`,match:e=>e.scheme===`nextclaw`&&e.authority===`docs`,resolve:e=>{let t=qJ(e);return{historyPolicy:`managed`,kind:`docs`,resourceUri:JJ(e.pathSegments),title:b(`docBrowserHelp`),url:t}},areEquivalent:(e,t)=>$n(e)===$n(t)},{defaultUrl:()=>NJ,id:`apps`,kind:MJ,match:e=>KJ(e.raw,NJ),resolve:e=>{let t=BJ(e.raw);return{dedupeKey:`apps`,historyPolicy:`managed`,kind:MJ,resourceUri:t,title:b(t===`nextclaw://apps`?`appsTitle`:`serviceAppsTitle`),url:t}},areEquivalent:(e,t)=>BJ(e)===BJ(t)},{defaultUrl:()=>`nextclaw://panel-app`,id:`panel-app`,kind:FJ,match:e=>e.scheme===`nextclaw`&&e.authority===`panel-app`||ZJ(e),resolve:e=>{let t=QJ(e),n=XJ(e);return{dedupeKey:n?`panel-app:${e.searchParams.get(`path`)?.trim()||decodeURIComponent(n)}`:void 0,historyPolicy:`managed`,kind:FJ,resourceUri:$J(e),title:b(`panelAppsTitle`),url:t}},areEquivalent:eY},{defaultUrl:()=>`about:blank`,id:`content`,kind:`content`,match:()=>!0,resolve:e=>({historyPolicy:`managed`,kind:`content`,resourceUri:e.raw||`about:blank`,title:ir(e.raw,`content`,`Detail`),url:e.raw||`about:blank`}),areEquivalent:(e,t)=>e===t}],nY=tY.map(e=>({areEquivalent:e.areEquivalent,id:e.id,match:e.match,resolve:e.resolve}));function rY(){return[{id:`apps`,label:b(`appsTitle`),target:{type:`right-panel-resource`,uri:NJ}},{id:`service-apps`,label:b(`serviceAppsTitle`),target:{type:`right-panel-resource`,uri:PJ}},{id:`docs`,label:b(`docBrowserHelp`),target:{options:{newTab:!0},type:`right-panel-resource`,uri:lr()}},{id:`skill-marketplace`,label:b(`marketplaceSkillsPageTitle`),target:{path:`/marketplace/skills`,type:`app-route`}}]}var iY={apps:{accentClassName:`bg-emerald-50 text-emerald-700`,hoverAccentClassName:`group-hover:bg-emerald-100`,icon:(0,R.jsx)(Et,{className:`h-5 w-5`})},"service-apps":{accentClassName:`bg-sky-50 text-sky-700`,hoverAccentClassName:`group-hover:bg-sky-100`,icon:(0,R.jsx)(cs,{className:`h-5 w-5`})},docs:{accentClassName:`bg-amber-50 text-amber-700`,hoverAccentClassName:`group-hover:bg-amber-100`,icon:(0,R.jsx)(Ut,{className:`h-5 w-5`})},"skill-marketplace":{accentClassName:`bg-rose-50 text-rose-700`,hoverAccentClassName:`group-hover:bg-rose-100`,icon:(0,R.jsx)(wo,{className:`h-5 w-5`})}};function aY(e){return iY[e.id]??{accentClassName:`bg-gray-50 text-gray-700`,hoverAccentClassName:`group-hover:bg-gray-100`,icon:(0,R.jsx)(Et,{className:`h-5 w-5`})}}function oY({open:e}){let t=Ni(),n=rY(),i=n=>{if(n.type===`app-route`){t(n.path);return}e(n.uri,n.options)};return(0,R.jsx)(`div`,{className:`h-full overflow-auto bg-background px-4 py-5`,children:(0,R.jsx)(`div`,{className:`mx-auto w-full max-w-[520px]`,children:(0,R.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(76px,1fr))] gap-x-2 gap-y-4`,children:n.map(e=>{let t=aY(e);return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>i(e.target),className:`group flex min-h-[68px] flex-col items-center gap-1.5 rounded-md px-1.5 py-1.5 text-center focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,R.jsx)(`span`,{className:r(`flex h-10 w-10 shrink-0 items-center justify-center rounded-md transition-colors`,t.accentClassName,t.hoverAccentClassName),children:t.icon}),(0,R.jsx)(`span`,{className:`line-clamp-2 min-w-0 max-w-full text-xs font-medium leading-snug text-gray-700 transition-colors group-hover:text-gray-900`,children:e.label})]},e.id)})})})})}function sY(e){return e&&rr(e)?`docs`:`content`}var cY=class{constructor(){this.resourceUriResolver=new kJ(nY,{getNormalizedUri:e=>e.resourceUri??e.url}),this.resolve=e=>this.resourceUriResolver.resolve(e),this.normalize=e=>this.resourceUriResolver.normalize(e),this.areEquivalent=(e,t)=>this.resourceUriResolver.areEquivalent(e,t),this.resolveOpenTarget=e=>{let{activeTab:t,kind:n,url:r}=e,i=this.resolveRouteDefinition(r,n,t),a=r?.trim()||(!n&&t&&t.kind!==`docs`?t.currentUrl:i.defaultUrl());return i.resolve(OJ(a))},this.areUrlsEquivalent=(e,t,n,r)=>n===r?this.resolveRouteDefinition(e,n).areEquivalent?.(e,t)??this.areEquivalent(e,t):!1,this.usesManagedHistory=e=>this.resolveRouteDefinition(e.currentUrl,e.kind).resolve(OJ(e.currentUrl)).historyPolicy===`managed`,this.resolveRouteDefinition=(e,t,n)=>{let r=t??(e?void 0:n?.kind),i=r?tY.find(e=>e.kind===r):void 0;if(i)return i;let a=e?OJ(e):null,o=a?tY.find(e=>e.match(a)):void 0;if(o)return o;let s=t??n?.kind??sY(e);return tY.find(e=>e.kind===s)??tY[tY.length-1]}}},lY=MJ,uY=FJ,dY=`panel-apps`;function fY(e){return e===`panel-apps`||e===`service-apps`}function pY(e=dY){return e===dY?NJ:PJ}function mY(e){try{let t=new URL(e).searchParams.get(`tab`);return fY(t)?t:dY}catch{return dY}}function hY(e){e.open(pY(),{kind:lY,title:b(`appsTitle`),dedupeKey:`apps`})}var gY={[AJ]:{getTitle:()=>b(`docBrowserHomeTitle`),renderContent:({open:e})=>(0,R.jsx)(oY,{open:e})},[lY]:{getTitle:()=>b(`appsTitle`),renderIcon:()=>(0,R.jsx)(Et,{className:`w-4 h-4 text-primary shrink-0`}),renderContent:({currentUrl:e,open:t,openTarget:n})=>(0,R.jsx)(TJ,{activeTab:mY(e),onActiveTabChange:e=>t(pY(e),{activate:!1,kind:lY,title:b(`appsTitle`),dedupeKey:`apps`}),onOpenPanelApp:e=>n(GJ(e))})},[uY]:{getIframeSandbox:()=>Qq,getTitle:e=>e.title||b(`panelAppsTitle`),onIframeMessage:e=>r6().panelAppBridgeManager.handleIframeMessage(e),onIframePointerOver:e=>$q(e.currentTarget),renderIcon:()=>(0,R.jsx)(vo,{className:`w-4 h-4 text-primary shrink-0`}),renderToolbar:({open:e,refreshIframe:t,tab:n})=>(0,R.jsx)(EJ,{appTitle:n.title||b(`panelAppsTitle`),onOpenApps:()=>hY({open:e}),onRefresh:t})}};function _Y(e,t){return HJ(e,t)}function vY(e){return`${e}${e.includes(`?`)?`&`:`?`}${new URLSearchParams({[g.displayModeSearchParam]:g.displayMode,[g.placementSearchParam]:g.placement}).toString()}`}function yY(e){if(!e||typeof e!=`object`)return null;let t=e;return t.type===g.contentHeightMessageType&&typeof t.height==`number`&&Number.isFinite(t.height)&&t.height>0?Math.ceil(t.height):null}function bY(e){let{appId:t,params:n,path:r,title:i,url:a}=e;return{contentParams:n,currentUrl:a,dedupeKey:`panel-app:${r??t}`,history:[a],historyIndex:0,id:`inline-panel-app:${r??t}`,kind:FJ,navVersion:0,resourceUri:VJ(t,r),title:i}}function xY({panelApp:e,showExpandAction:t=!0}){let n=sr(),r=(0,L.useRef)(null),i=(0,L.useId)(),[a,o]=(0,L.useState)(null),s=Nq(),c=(0,L.useMemo)(()=>e.path?void 0:Zq(s.data?.entries??[],e.appId),[e.appId,e.path,s.data?.entries]),l=c?GJ(c):null,u=e.title??l?.title??e.appId,f=e.path?_Y(e.appId,e.path):s.isLoading?``:l?.url??_Y(e.appId),p=(0,L.useMemo)(()=>f?vY(f):``,[f]),m=(0,L.useMemo)(()=>bY({appId:c?.id??e.appId,params:e.params,path:e.path,title:u,url:f}),[c?.id,e.appId,e.params,e.path,u,f]),h=d(e.params),g=`${m.id}:${m.navVersion}:${i}:${h??``}`;return(0,L.useEffect)(()=>{if(!f)return;let e=e=>{if(e.source!==r.current?.contentWindow)return;let t=yY(e.data);if(t!==null){o(t);return}r6().panelAppBridgeManager.handleIframeMessage({event:e,iframe:r.current,iframeInstanceId:g,tab:m})};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[g,m,f]),f?(0,R.jsx)(Cq,{actions:t?(0,R.jsx)(Nt,{size:`sm`,icon:(0,R.jsx)(bs,{className:`h-3.5 w-3.5`}),label:b(`chatPanelCardExpand`),tooltipSide:`top`,onClick:()=>{if(l){n.openTarget({...l,contentParams:e.params});return}n.open(f,{dedupeKey:m.dedupeKey,kind:m.kind,contentParams:e.params,title:u})}}):void 0,contentHeight:a,children:(0,R.jsx)(`iframe`,{ref:r,src:p,name:h,title:u,sandbox:Qq,tabIndex:0,onPointerOver:()=>$q(r.current),className:`h-full w-full border-0 bg-card`},g)}):(0,R.jsx)(Cq,{isLoading:!0,children:(0,R.jsx)(`span`,{className:`sr-only`,children:u})})}var SY=`nextclaw.chat.message-layout`,CY=1,wY=`flat`;function TY(e){if(!e||typeof e!=`object`)return wY;let{layout:t}=e;return t===`flat`||t===`card`?t:wY}var EY=x()(Zn(e=>({layout:wY,setLayout:t=>e({layout:t})}),{name:SY,version:CY,storage:Qn(()=>window.localStorage),partialize:e=>({layout:e.layout}),merge:(e,t)=>({...t,layout:TY(e)})}));function DY(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function OY(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function kY(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var AY=(e,t)=>Math.abs(e-t)<1.01,jY=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},MY,NY=()=>{if(MY!==void 0)return MY;if(typeof navigator>`u`)return MY=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return MY=!0;let e=navigator.maxTouchPoints;return MY=navigator.platform===`MacIntel`&&e!==void 0&&e>0},PY=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},FY=e=>e,IY=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},LY=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(PY(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(PY(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},RY={passive:!0},zY=typeof window>`u`?!0:`onscrollend`in window,BY=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&zY,o=0,s=a?null:jY(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,RY),a&&r.addEventListener(`scrollend`,u,RY),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},VY=(e,t)=>BY(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),HY=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},UY=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},WY=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:FY,rangeExtractor:IY,onChange:()=>{},measureElement:HY,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=OY(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!NY()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,RY),e.addEventListener(`touchend`,n,RY),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(NY()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=OY(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.getMeasurements=OY(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=DY(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=OY(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=qY(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=OY(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=OY(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return kY(t[GY(0,t.length-1,r?e=>n[e*2]:e=>kY(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t);this.scrollState={index:null,align:t,behavior:n,startedAt:this.now(),lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e;this.scrollState={index:null,align:`start`,behavior:t,startedAt:this.now(),lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(NY()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&AY(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},GY=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function KY(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function qY(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=KY(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=GY(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var JY=typeof document<`u`?L.useLayoutEffect:L.useEffect;function YY({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=L.useReducer(e=>e+1,0)[1],a=L.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}let r=!!e.options.horizontal,i=t.mode===`transform`,o=r?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let n of c){let a=n.start-s,c=e.elementsCache.get(n.key);c&&t.lastPositions.get(c)!==a&&(t.lastPositions.set(c,a),i?c.style.transform=r?`translate3d(${a}px, 0, 0)`:`translate3d(0, ${a}px, 0)`:c.style[o]=`${a}px`)}},s={...r,onChange:(t,n)=>{var s;let c=a.current,l=!0;if(c.enabled){o(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,LD.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[c]=L.useState(()=>{let e=new WY(s);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return c.setOptions(s),JY(()=>c._didMount(),[]),JY(()=>c._willUpdate()),JY(()=>{o(c)}),c}function XY(e){return YY({observeElementRect:LY,observeElementOffset:VY,scrollToFn:UY,...e})}var ZY=180;function QY(e){let{activeRowKey:t,focusedRowKey:n,rows:r,scrollRef:i}=e,a=(0,L.useMemo)(()=>r.flatMap((e,r)=>e.key===t||e.key===n?[r]:[]),[t,n,r]),o=(0,L.useCallback)(e=>[...new Set([...IY(e),...a])].sort((e,t)=>e-t),[a]),s=(0,L.useRef)(null),c=XY({anchorTo:`end`,count:r.length,directDomUpdates:!0,estimateSize:()=>ZY,getItemKey:e=>r[e]?.key??e,getScrollElement:()=>i.current,initialOffset:()=>r.length*ZY,initialRect:{width:0,height:800},overscan:8,rangeExtractor:o,scrollToFn:(e,t,n)=>{let r=s.current;r&&(r.style.height=`${n.getTotalSize()}px`),UY(e,t,n)}});return c.shouldAdjustScrollPositionOnItemSizeChange=e=>e.end<=(c.scrollOffset??0),{containerRef:(0,L.useCallback)(e=>{s.current=e,c.containerRef(e)},[c]),virtualizer:c}}var $Y=`inherited_from_session_id`;function eX(e){let t=e.metadata?.[$Y];return typeof t==`string`&&t.trim()?t.trim():null}function tX(e){return!RK(e)&&!eX(e)}function nX(e){let{rawMessageId:t,rawMessages:n,visibleRawMessages:r}=e,i=n.findIndex(e=>e.id===t);return i<0?r.length-1:n.slice(0,i).filter(tX).length-1}function rX(e){let t=e.findIndex(e=>eX(e));if(t<0)return null;let n=eX(e[t]);return n?{boundaryIndex:e.slice(0,t).filter(tX).length,sourceSessionId:n,inheritedMessageCount:e.filter(e=>eX(e)===n).length}:null}function iX(e){let t=e.rawMessages.filter(tX),n=e.rawMessages.map(e=>({rawMessageId:e.id,checkpoint:RK(e)})).filter(e=>!!e.checkpoint).map(n=>({key:`compaction:${n.rawMessageId}`,checkpoint:n.checkpoint,boundaryIndex:nX({rawMessages:e.rawMessages,visibleRawMessages:t,rawMessageId:n.rawMessageId})})).sort((e,t)=>e.boundaryIndex-t.boundaryIndex),r=rX(e.rawMessages),i=[],a=[],o=0,s=()=>{a.length!==0&&(i.push(...a.map(e=>({kind:`message`,key:`message:${e.id}`,message:e}))),a=[])};for(t.forEach((t,c)=>{r?.boundaryIndex===c&&(s(),i.push({kind:`context-inheritance`,key:`context-inheritance:${r.sourceSessionId}`,inheritance:r}));let l=e.messages[c];for(l&&a.push(l);o<n.length&&n[o]?.boundaryIndex<=c;){let e=n[o];s(),i.push({kind:`compaction`,key:e.key,checkpoint:e.checkpoint}),o+=1}}),r?.boundaryIndex===t.length&&(s(),i.push({kind:`context-inheritance`,key:`context-inheritance:${r.sourceSessionId}`,inheritance:r}));o<n.length;){let e=n[o];s(),i.push({kind:`compaction`,key:e.key,checkpoint:e.checkpoint}),o+=1}return s(),i.length===0&&i.push({kind:`empty`,key:`empty`}),i}var aX=new class{constructor(){this.cache=new WeakMap,this.adapt=e=>{let{executionLabels:t,language:n,processedLabel:r,rawMessages:i,texts:a}=e;return i.filter(tX).flatMap(e=>{let i=fK({message:e,processedLabel:r}),o=i?.label??null,s=kK({message:e,labels:t}),c=s?.cacheKey??null,l=this.cache.get(e);if(l&&l.language===n&&l.processSummaryLabel===o&&l.executionPresentationKey===c)return[l.viewModel];let u=Gl(e),d=sK({id:u.id,role:u.role,meta:{timestamp:u.meta?.timestamp,status:u.meta?.status,inlineTokens:oW(e.metadata),processSummary:i,executionSummaryLabel:s?.summaryLabel,moreActions:s?.moreActions},parts:u.parts},{formatTimestamp:e=>_(e,n),texts:a});return this.cache.set(e,{language:n,processSummaryLabel:o,executionPresentationKey:c,viewModel:d}),[d]})}}};function oX(e){if(e.target.type===`panel_app`)return(0,R.jsx)(xY,{panelApp:{appId:e.target.payload.appId,params:e.target.payload.params,path:e.target.payload.path,title:e.title}})}var sX=e=>(0,R.jsx)(Zd,{agentId:e,className:`h-4 w-4 shrink-0`}),cX=e=>(0,R.jsx)(xY,{panelApp:e});function lX({checkpoint:e}){let t=!e||e.status===`compressing`;return(0,R.jsxs)(`div`,{className:`my-4 flex items-center gap-3 text-[11px] text-muted-foreground`,title:e?[`${b(`chatContextCompactionCoveredMessages`)}: ${e.coveredSessionMessageCount}`,`${b(`chatContextCompactionOriginalTokens`)}: ${e.originalEstimatedTokens}`,`${b(`chatContextCompactionProjectedTokens`)}: ${e.projectedEstimatedTokens}`].join(`
|
|
102
|
-
`):void 0,children:[(0,R.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,R.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-border bg-muted px-3 py-1`,children:[t?(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-muted-foreground`}):(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground/45`}),(0,R.jsx)(`span`,{children:b(t?`chatContextCompactionCompressing`:`chatContextCompactionCompressed`)})]}),(0,R.jsx)(`div`,{className:`h-px flex-1 bg-border`})]})}function uX({inheritance:e}){return(0,R.jsxs)(`div`,{className:`my-4 flex items-center gap-3 text-[11px] text-emerald-700`,title:[`${b(`chatContextInheritanceSourceSession`)}: ${e.sourceSessionId}`,`${b(`chatContextInheritanceMessages`)}: ${e.inheritedMessageCount}`].join(`
|
|
103
|
-
`),children:[(0,R.jsx)(`div`,{className:`h-px flex-1 bg-emerald-100`}),(0,R.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-emerald-200 bg-emerald-50 px-3 py-1`,children:[(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-emerald-400`}),(0,R.jsx)(`span`,{children:b(`chatContextInheritanceInherited`)})]}),(0,R.jsx)(`div`,{className:`h-px flex-1 bg-emerald-100`})]})}function dX({messages:e,isSending:t,scrollRef:n,sessionKey:i,className:a}){let o=rl(),{language:s}=vn(),c=EY(e=>e.layout),l=cd(i),u=Uu(e=>e.snapshot.sessionTypesQuery?.data??null),d=yu(l?.sessionType??u?.defaultType??`native`),f=Su(u?.options??[]).find(e=>e.value===d),p=f?.icon?.src?.trim()?(0,R.jsx)(Fu,{icon:{kind:`runtime-image`,src:f.icon.src,alt:f.icon.alt??null,name:f.label},className:`h-[65%] w-[65%]`}):void 0,m=l?.workingDir??l?.projectRoot??null,h=(0,L.useCallback)(e=>{let t=oX(e);if(t)return t;if(e.target.type===`file`)return(0,R.jsx)(Eq,{display:e,parentSessionKey:i,sessionProjectRoot:l?.projectRoot??null,sessionWorkingDir:m,onFileOpen:o.chatThreadManager.openFilePreview})},[m,o.chatThreadManager,l?.projectRoot,i]),g=(0,L.useCallback)(e=>We(e.path,m),[m]),_=(0,L.useMemo)(()=>AK(s),[s]),v=(0,L.useMemo)(()=>MK(s),[s]),y=(0,L.useMemo)(()=>aX.adapt({executionLabels:v,language:s,processedLabel:b(`chatProcessSummaryProcessed`),rawMessages:e,texts:_}),[v,s,e,_]),x=y.findLast(e=>e.role===`assistant`&&(e.status===`streaming`||e.status===`pending`)),S=!!x,C=(0,L.useMemo)(()=>NK(s),[s]),w=(0,L.useMemo)(()=>iX({rawMessages:e,messages:y}),[y,e]),T=(0,L.useMemo)(()=>t&&!S?[...w,{kind:`typing`,key:`typing`}]:w,[S,t,w]),[E,D]=(0,L.useState)(null),{containerRef:O,virtualizer:k}=QY({rows:T,scrollRef:n,activeRowKey:x?`message:${x.id}`:null,focusedRowKey:E}),A=(0,L.useCallback)(e=>{if(e.kind===`panel_app`&&`key`in e){o.chatUiManager.showContent({target:{type:`panel_app`,payload:{appId:e.key}}});return}if(`key`in e&&(e.kind===`workspace_file`||e.kind===`workspace_directory`)){let t=QU({projectRoot:l?.projectRoot,relativePath:e.key});t&&o.chatThreadManager.openFilePreview({path:t,label:e.label,viewMode:`preview`});return}if(e.kind!==`skill`||!(`ref`in e))return;let t=e.path?.trim();if(t){o.chatThreadManager.openFilePreview({path:t,label:e.label||e.name,viewMode:`preview`,previewViewer:`rendered`});return}if(!i){P.error(b(`chatSkillPreviewUnavailable`));return}M(i,{projectRoot:l?.projectRoot??null}).then(({records:t})=>{let n=t.find(t=>t.ref===e.ref),r=t.filter(t=>t.name===e.name),i=n??(r.length===1?r[0]:null),a=i?.path.trim();if(!i||!a){P.error(b(`chatSkillPreviewUnavailable`));return}o.chatThreadManager.openFilePreview({path:a,label:e.label||i.name,viewMode:`preview`,previewViewer:`rendered`})}).catch(()=>P.error(b(`chatSkillPreviewUnavailable`)))},[o.chatThreadManager,o.chatUiManager,l?.projectRoot,i]),ee=(0,L.useCallback)(e=>{let t=e.dataUrl?.trim();if(!t)return;let n=e.label.trim()||`attachment`;o.chatThreadManager.openFilePreview({path:n,label:n,viewMode:`preview`,contentUrl:t,mimeType:e.mimeType})},[o.chatThreadManager]),j=(0,L.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||D(null)},[]);return(0,R.jsx)(`div`,{className:r(`relative`,a),ref:O,children:k.getVirtualItems().map(e=>{let t=T[e.index];return t?(0,R.jsx)(`div`,{"data-index":e.index,ref:k.measureElement,onBlurCapture:j,onFocusCapture:()=>D(t.key),className:`absolute left-0 top-0 w-full`,children:t.kind===`compaction`?(0,R.jsx)(lX,{checkpoint:t.checkpoint}):t.kind===`context-inheritance`?(0,R.jsx)(uX,{inheritance:t.inheritance}):(0,R.jsx)(`div`,{className:t.kind===`message`?`pb-5`:void 0,children:(0,R.jsx)(NU,{assistantAvatarIcon:p,layout:c,messages:t.kind===`message`?[t.message]:[],isSending:t.kind===`typing`,hasAssistantDraft:S,texts:C,onToolAction:o.chatThreadManager.handleToolAction,onFileOpen:o.chatThreadManager.openFilePreview,onAttachmentOpen:ee,onInlineTokenClick:A,resolveFileContentUrl:g,renderInlineDisplay:h,renderToolAgent:sX,renderPanelAppCard:cX})})},t.key):null})})}function fX({children:e,className:t,width:n=`messages`}){let i=EY(e=>e.layout);return(0,R.jsx)(`div`,{"data-chat-conversation-track":i,"data-chat-conversation-track-width":n,className:r(`mx-auto w-full px-4 sm:px-6`,i===`flat`?n===`composer`?`max-w-[min(54rem,100%)]`:`max-w-[min(52rem,100%)]`:`max-w-[min(1120px,100%)]`,t),children:e})}function pX({bottomSlot:e,isAwaitingAssistantOutput:t,isHistoryLoading:n,hasPreviousMessages:r,historyError:i,isLoadingPreviousMessages:a,isContextCompacting:o=!1,isSending:s,messages:c,sessionKey:l,showWelcome:u,onLoadPreviousMessages:d,welcomeSlot:f}){let p=(0,L.useRef)(null),m=(0,L.useRef)(null),{isAtBottom:h,onScroll:g,scrollToBottom:_}=_V({contentRef:m,scrollRef:p,resetKey:l,isLoading:n,hasContent:c.length>0,contentVersion:c[c.length-1]??null}),v=c.length>0;return(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,R.jsx)(`div`,{ref:p,onScroll:(0,L.useCallback)(e=>{g(),e.currentTarget.scrollTop<=320&&r&&!a&&d()},[r,a,d,g]),"data-chat-scroll-container":`true`,className:`h-full overflow-y-auto custom-scrollbar`,style:{overflowAnchor:`none`},children:u?f??null:(0,R.jsxs)(`div`,{ref:m,children:[v?(0,R.jsxs)(fX,{className:`relative py-4 sm:py-5`,children:[i?(0,R.jsx)(`div`,{role:`alert`,className:`flex h-8 justify-center`,children:(0,R.jsxs)(`button`,{type:`button`,"aria-label":b(`chatHistoryRetry`),className:`rounded px-1.5 text-xs text-foreground underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>void d(),children:[b(`chatHistoryLoadFailed`),` · `,b(`chatHistoryRetry`)]})}):a?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-1/2 top-[13px] block h-1.5 w-1.5 -translate-x-1/2 animate-pulse rounded-full bg-muted-foreground/50 sm:top-[17px]`}):null,(0,R.jsx)(dX,{messages:c,isSending:v&&s&&t,scrollRef:p,sessionKey:l}),o?(0,R.jsx)(lX,{}):null]}):null,e?(0,R.jsx)(fX,{className:`pb-4 sm:pb-5`,children:e}):null]})}),v&&!u&&!h?(0,R.jsx)(Nt,{icon:(0,R.jsx)(yo,{className:`h-4 w-4`}),label:b(`chatScrollToBottom`),onClick:_,tooltipSide:`top`,className:`absolute bottom-4 left-1/2 z-10 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background/90 text-foreground shadow-lg backdrop-blur hover:bg-accent hover:text-accent-foreground`}):null]})}function mX(e){let t=e.split(/\r?\n/),n=`message`,r=[];for(let e of t){let t=e.trimEnd();if(!(!t||t.startsWith(`:`))){if(t.startsWith(`event:`)){n=t.slice(6).trim()||`message`;continue}t.startsWith(`data:`)&&r.push(t.slice(5).trimStart())}}return r.length===0?null:{event:n,data:r.join(`
|
|
104
|
-
`)}}async function*hX(e){let t=e.getReader(),n=new TextDecoder,r=``;try{for(;;){let{value:e,done:i}=await t.read();if(i)break;r+=n.decode(e,{stream:!0});let{frames:a,rest:o}=gX(r);r=o;for(let e of a)yield e}r+=n.decode();let{frames:e}=gX(r,!0);for(let t of e)yield t}finally{t.releaseLock()}}function gX(e,t=!1){let n=e.split(/\r?\n\r?\n/),r=n.pop()??``,i=[];for(let e of n){let t=mX(e);t&&i.push(t)}if(t&&r.trim()){let e=mX(r);return e&&i.push(e),{frames:i,rest:``}}return{frames:i,rest:r}}var _X=`/ncp/agent`,vX=class extends Error{ncpError;alreadyPublished;constructor(e,t=!1){super(e.message),this.name=`NcpHttpAgentClientError(${e.code})`,this.ncpError=e,this.alreadyPublished=t}};function yX(e){let t=e.trim();if(!t)throw Error(`NcpHttpAgentClient requires a non-empty baseUrl.`);return new URL(t)}function bX(e){if(e)return e;if(typeof globalThis.fetch==`function`)return globalThis.fetch.bind(globalThis);throw Error(`No fetch implementation found. Pass options.fetchImpl explicitly.`)}function xX(e){let t=(e??`/ncp/agent`).trim();if(!t)return _X;let n=t.startsWith(`/`)?t:`/${t}`;return n.endsWith(`/`)?n.slice(0,-1):n}async function SX(e){try{return(await e.text()).trim()}catch{return``}}function CX(e){if(DX(e))return e.ncpError;if(TX(e))return e;let t=e instanceof Error?e.message:String(e??`Unknown error`);return{code:kX(void 0),message:t,...e instanceof Error&&e.stack?{details:{stack:e.stack}}:{}}}function wX(e,t={}){return new vX(e,t.alreadyPublished??!1)}function TX(e){return EX(e)&&typeof e.code==`string`&&typeof e.message==`string`}function EX(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function DX(e){return e instanceof vX}var OX={"config-error":`config-error`,"auth-error":`auth-error`,"runtime-error":`runtime-error`,"timeout-error":`timeout-error`,"abort-error":`abort-error`};function kX(e){if(!e)return`runtime-error`;let t=OX[e];if(t)return t;let n=e.toLowerCase();return n.includes(`timeout`)?`timeout-error`:n.includes(`abort`)||n.includes(`cancel`)?`abort-error`:n.includes(`auth`)?`auth-error`:n.includes(`config`)?`config-error`:`runtime-error`}function AX(e){let t=MX(e);return!t||typeof t.type!=`string`||!t.type.trim()?null:t}function jX(e){let t=MX(e);if(!t)return{code:`runtime-error`,message:e||`Unknown stream error.`};let n=typeof t.code==`string`?t.code:void 0,r=kX(n),i=EX(t.details)?t.details:{};return n&&n!==r&&(i.originalCode=n),{code:r,message:typeof t.message==`string`&&t.message?t.message:`Unknown stream error.`,...Object.keys(i).length>0?{details:i}:{}}}function MX(e){try{let t=JSON.parse(e);return EX(t)?t:null}catch{return null}}var NX=[`text`,`file`,`source`,`step-start`,`reasoning`,`tool-invocation`,`card`,`rich-text`,`action`,`extension`],PX=class{manifest;baseUrl;basePath;fetchImpl;defaultHeaders;subscribers=new Set;activeControllers=new Set;started=!1;constructor(e){this.baseUrl=yX(e.baseUrl),this.basePath=xX(e.basePath),this.fetchImpl=bX(e.fetchImpl),this.defaultHeaders=e.headers??{},this.manifest={endpointKind:`custom`,endpointId:e.endpointId?.trim()||`ncp-http-agent-client`,version:`0.1.0`,supportsStreaming:!0,supportsAbort:!0,supportsProactiveMessages:!1,supportsLiveSessionStream:!0,supportedPartTypes:NX,expectedLatency:`seconds`,metadata:{transport:`http+sse`,scope:`agent`}}}async start(){this.started||(this.started=!0,this.publish(bK({type:yK.EndpointReady})))}async stop(){if(this.started){this.started=!1;for(let e of this.activeControllers)e.abort();this.activeControllers.clear()}}async emit(e){switch(e.type){case`message.request`:await this.send(e.payload);return;case`message.stream-request`:await this.stream(e.payload);return;case`message.abort`:await this.abort(e.payload);return;default:this.publish(e);return}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}async send(e){await this.ensureStarted();let t=new AbortController;this.activeControllers.add(t);try{let n=await this.fetchImpl(this.resolveUrl(`/send`),{method:`POST`,headers:{...this.defaultHeaders,accept:`application/json`,"content-type":`application/json`},body:JSON.stringify(e),signal:t.signal});if(!n.ok)throw Error(`NCP send command failed with HTTP ${n.status}: ${await SX(n)}`);let r=await n.json();if(!r.ok||!r.data)throw Error(r.error?.message??`NCP send command returned an invalid handle.`);return r.data}catch(e){if(t.signal.aborted)throw Error(`NCP send command was cancelled.`);if(DX(e))throw e;let n=CX(e);throw this.publish(bK({type:yK.EndpointError,payload:n})),wX(n)}finally{this.activeControllers.delete(t)}}async stream(e){await this.ensureStarted();let t=new URLSearchParams({sessionId:e.sessionId});await this.streamRequest({path:`/stream?${t.toString()}`,method:`GET`})}async abort(e){await this.ensureStarted();let t=new AbortController;this.activeControllers.add(t);try{let n=await this.fetchImpl(this.resolveUrl(`/abort`),{method:`POST`,headers:{...this.defaultHeaders,"content-type":`application/json`,accept:`application/json`},body:JSON.stringify(e),signal:t.signal});if(!n.ok)throw Error(`Abort request failed with HTTP ${n.status}: ${await SX(n)}`)}catch(e){if(t.signal.aborted)return;let n=CX(e);throw this.publish(bK({type:yK.EndpointError,payload:n})),wX(n)}finally{this.activeControllers.delete(t)}}async ensureStarted(){this.started||await this.start()}publish(e){for(let t of this.subscribers)t(e)}resolveUrl(e){return new URL(`${this.basePath}${e}`,this.baseUrl)}async streamRequest(e){let t=new AbortController;this.activeControllers.add(t);try{let n=await this.fetchImpl(this.resolveUrl(e.path),{method:e.method,headers:{...this.defaultHeaders,accept:`text/event-stream`,...e.body===void 0?{}:{"content-type":`application/json`}},body:e.body===void 0?void 0:JSON.stringify(e.body),signal:t.signal});if(!n.ok)throw Error(`NCP stream request failed with HTTP ${n.status}: ${await SX(n)}`);if(!n.body)throw Error(`NCP stream response has no body.`);for await(let e of hX(n.body)){if(t.signal.aborted)return;this.handleSseFrame(e)}}catch(e){if(t.signal.aborted)return;if(DX(e))throw e;let n=CX(e);throw this.publish(bK({type:yK.EndpointError,payload:n})),wX(n)}finally{this.activeControllers.delete(t)}}handleSseFrame(e){if(e.event===`ncp-event`){let t=AX(e.data);if(!t){this.publish(bK({type:yK.EndpointError,payload:{code:`runtime-error`,message:`Received malformed ncp-event frame.`}}));return}this.publish(t);return}if(e.event===`error`){let t=jX(e.data);throw this.publish(bK({type:yK.EndpointError,payload:t})),wX(t,{alreadyPublished:!0})}}};function FX(e){return{...e,parts:[...e.parts],lifecycle:e.lifecycle?{...e.lifecycle}:void 0,metadata:e.metadata?{...e.metadata}:void 0}}function IX(e){return FX(TK(e))}var LX=class{execution=null;get isEmpty(){return!this.execution}clear=()=>{this.execution=null};observe=e=>{let t=vK(e.metadata);t&&(!e.runId||e.runId===t.runId)&&(this.execution=structuredClone(t))};take=e=>{let t=this.execution;return this.execution=null,!t||e?.trim()&&t.runId!==e?null:t};attach=(e,t)=>t?{...e,metadata:{...e.metadata??{},[pK]:structuredClone(t)}}:e},RX=`__nextclaw_aborted_tool_call__`;function zX(e){let t=e.error?.trim();return{code:`runtime-error`,message:t&&t.length>0?t:`Agent run failed.`,details:{sessionId:e.sessionId,messageId:e.messageId,threadId:e.threadId,runId:e.runId}}}function BX(e){if(!(!e.startedAt&&!e.endedAt))return{startedAt:e.startedAt,endedAt:e.endedAt}}function VX(e,t,n){return n?{...e,status:t,lifecycle:n}:{...e,status:t}}function HX(e,t){let n=Date.parse(t.timestamp);if(!Number.isFinite(n))return e.length;let r=e.findIndex(e=>{let t=Date.parse(e.timestamp);return Number.isFinite(t)&&t>n});return r<0?e.length:r}function UX(e,t){let n=[...e];return n.splice(HX(e,t),0,t),n}function WX(e,t,n){let r=new Set(e.map(e=>e.id));t&&r.add(t.id);let i=e;for(let e of n)r.has(e.id)||(r.add(e.id),i=UX(i,IX(e)));return i}function GX(e,t){return t.trim()?e.id.startsWith(`tool-`)?!0:e.parts.some(e=>e.type===`tool-invocation`):!1}function KX(e,t){for(let n=e.length-1;n>=0;--n){let r=e[n];if(r.type===`tool-invocation`&&r.toolCallId===t)return r}return null}function qX(e,t){return KX(e,t)?.toolName??null}function JX(e,t){let n=[...e];for(let e=n.length-1;e>=0;--e){let r=n[e];if(r.type===`tool-invocation`&&r.toolCallId===t.toolCallId)return n[e]={...r,...t},n}return n.push(t),n}function YX(e){let t=[];return{parts:e.map(e=>e.type!==`tool-invocation`||!e.toolCallId||e.state===`result`||e.state===`cancelled`?e:(t.push(e.toolCallId),{...e,state:`cancelled`})),toolCallIds:t}}var XX=class{messageIdByCallId=new Map;argsRawByCallId=new Map;constructor(e){this.port=e}isEmpty=()=>this.messageIdByCallId.size===0&&this.argsRawByCallId.size===0;clear=()=>{this.messageIdByCallId.clear(),this.argsRawByCallId.clear()};hydrate=e=>{this.clear(),e.forEach(e=>{e.parts.forEach(t=>{if(t.type!==`tool-invocation`||!t.toolCallId||t.state===`result`||t.state===`cancelled`)return;let n=typeof t.args==`string`?t.args:JSON.stringify(t.args??{});this.messageIdByCallId.set(t.toolCallId,e.id),this.argsRawByCallId.set(t.toolCallId,n)})})};clearByMessageId=e=>{for(let[t,n]of this.messageIdByCallId)n===e&&(this.messageIdByCallId.delete(t),this.argsRawByCallId.delete(t))};markAborted=e=>{e.forEach(e=>this.argsRawByCallId.set(e,RX))};remapMessageId=(e,t)=>{for(let[n,r]of this.messageIdByCallId)r===e&&this.messageIdByCallId.set(n,t)};handleToolCallStart=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let t=this.resolveToolCallTargetMessage(e.sessionId,e.toolCallId,e.messageId);this.argsRawByCallId.set(e.toolCallId,``),this.port.replaceStreamingMessage({...t,parts:JX(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:e.toolName,state:`partial-call`,args:``}),status:`streaming`})};handleToolCallArgs=e=>{this.argsRawByCallId.get(e.toolCallId)!==`__nextclaw_aborted_tool_call__`&&(this.argsRawByCallId.set(e.toolCallId,e.args),this.applyToolCallArgs(e.sessionId,e.toolCallId,e.args))};handleToolCallArgsDelta=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let t=`${this.argsRawByCallId.get(e.toolCallId)??``}${e.delta}`;this.argsRawByCallId.set(e.toolCallId,t),this.applyToolCallArgs(e.sessionId,e.toolCallId,t,e.messageId)};handleToolCallEnd=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let t=this.resolveToolCallTargetMessage(e.sessionId,e.toolCallId),n=this.argsRawByCallId.get(e.toolCallId)??``;this.port.replaceStreamingMessage({...t,parts:JX(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:qX(t.parts,e.toolCallId)??`unknown`,state:`call`,args:n}),status:`streaming`})};handleToolCallResult=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`||this.port.updateMessageContainingToolCall(e.toolCallId,(t,n)=>JX(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:n.toolName,state:`result`,args:n.args,result:e.content,resultContentItems:e.contentItems})))return;let t=this.resolveToolCallTargetMessage(e.sessionId,e.toolCallId);this.port.replaceStreamingMessage({...t,parts:JX(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:`unknown`,state:`result`,result:e.content,resultContentItems:e.contentItems}),status:`streaming`})};applyToolCallArgs=(e,t,n,r)=>{let i=this.resolveToolCallTargetMessage(e,t,r),a=qX(i.parts,t)??`unknown`;this.port.replaceStreamingMessage({...i,parts:JX(i.parts,{type:`tool-invocation`,toolCallId:t,toolName:a,state:`partial-call`,args:n}),status:`streaming`})};resolveToolCallTargetMessage=(e,t,n)=>{let r=n?.trim()||this.messageIdByCallId.get(t)||this.port.readStreamingMessageId()||`tool-${t}`;return this.messageIdByCallId.set(t,r),this.port.ensureStreamingMessage(e,r,`streaming`)}},ZX=`assistant`,QX=class{messages=[];streamingMessage=null;error=null;activeRun=null;contextWindow=null;listeners=new Set;runExecution=new LX;toolCalls;lastSettledRunId=null;snapshotCache=null;snapshotVersion=-1;stateVersion=0;constructor(){this.toolCalls=new XX({ensureStreamingMessage:this.ensureStreamingMessage,readStreamingMessageId:()=>this.streamingMessage?.id??null,replaceStreamingMessage:this.replaceStreamingMessage,updateMessageContainingToolCall:this.updateMessageContainingToolCall})}getSnapshot=()=>{if(this.snapshotCache&&this.snapshotVersion===this.stateVersion)return this.snapshotCache;let e={messages:this.messages,streamingMessage:this.streamingMessage,error:this.error?{...this.error,details:this.error.details?{...this.error.details}:void 0}:null,activeRun:this.activeRun?{...this.activeRun}:null,contextWindow:this.contextWindow?{...this.contextWindow}:null};return this.snapshotCache=e,this.snapshotVersion=this.stateVersion,e};subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));reset=()=>{this.messages.length===0&&!this.streamingMessage&&!this.error&&!this.activeRun&&this.runExecution.isEmpty&&!this.contextWindow&&this.toolCalls.isEmpty()||(this.messages=[],this.streamingMessage=null,this.error=null,this.activeRun=null,this.runExecution.clear(),this.contextWindow=null,this.toolCalls.clear(),this.lastSettledRunId=null,this.stateVersion+=1,this.notifyListeners())};clearError=()=>{let e=this.stateVersion;this.setError(null),this.stateVersion!==e&&this.notifyListeners()};hydrate=e=>{this.messages=e.messages.map(e=>IX(e)),this.streamingMessage=null,this.error=null,this.contextWindow=e.contextWindow?{...e.contextWindow}:null,this.activeRun=e.activeRun?{...e.activeRun,sessionId:e.activeRun.sessionId??e.sessionId,abortDisabledReason:e.activeRun.abortDisabledReason??null}:null,this.runExecution.clear(),this.toolCalls.hydrate(this.messages),this.lastSettledRunId=null,this.stateVersion+=1,this.notifyListeners()};prependHistory=e=>{let t=WX(this.messages,this.streamingMessage,e);t!==this.messages&&(this.messages=t,this.toolCalls.hydrate(this.messages),this.stateVersion+=1,this.notifyListeners())};dispatch=e=>this.dispatchBatch([e]);dispatchBatch=async e=>{if(!e.length)return;let t=this.stateVersion;e.forEach(this.applyEvent),this.stateVersion!==t&&this.notifyListeners()};applyEvent=e=>{switch(e.type){case yK.MessageSent:this.handleMessageSent(e.payload);break;case yK.MessageAbort:this.handleMessageAbort(e.payload);break;case yK.MessageTextStart:this.handleMessageTextStart(e.payload);break;case yK.MessageTextDelta:this.handleMessageTextDelta(e.payload);break;case yK.MessageTextEnd:this.handleMessageTextEnd(e.payload);break;case yK.MessageReasoningStart:this.handleMessageReasoningStart(e.payload);break;case yK.MessageReasoningDelta:this.handleMessageReasoningDelta(e.payload);break;case yK.MessageReasoningEnd:this.handleMessageReasoningEnd(e.payload);break;case yK.MessageToolCallStart:this.handleMessageToolCallStart(e.payload);break;case yK.MessageToolCallArgs:this.handleMessageToolCallArgs(e.payload);break;case yK.MessageToolCallArgsDelta:this.handleMessageToolCallArgsDelta(e.payload);break;case yK.MessageToolCallEnd:this.handleMessageToolCallEnd(e.payload);break;case yK.MessageToolCallResult:this.handleMessageToolCallResult(e.payload);break;case yK.RunStarted:this.handleRunStarted(e.payload);break;case yK.RunFinished:this.handleRunFinished(e.payload);break;case yK.RunError:this.handleRunError(e.payload);break;case yK.RunMetadata:this.handleRunMetadata(e.payload);break;case yK.ContextWindowUpdated:this.handleContextWindowUpdated(e.payload);break;case yK.EndpointError:this.handleEndpointError(e.payload);break;default:break}};handleMessageSent=e=>{this.upsertMessage(e.message),this.setError(null)};handleMessageAbort=e=>{let t=e.messageId?.trim(),n=this.runExecution.take(e.runId??this.activeRun?.runId);if(this.clearActiveRun(),this.setError(null),this.streamingMessage&&(!t||this.streamingMessage.id===t)){let e=this.streamingMessage.id,{parts:r,toolCallIds:i}=YX(this.streamingMessage.parts);this.upsertMessage(this.runExecution.attach({...this.streamingMessage,status:`final`,parts:r},n)),this.replaceStreamingMessage(null),t?this.toolCalls.clearByMessageId(t):this.toolCalls.clearByMessageId(e),this.toolCalls.markAborted(i)}};handleMessageTextStart=e=>{let t=this.streamingMessage?.id===e.messageId,n=this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`),r=n.parts[n.parts.length-1];t&&r?.type===`text`&&r.text.length>0&&this.replaceStreamingMessage({...n,parts:[...n.parts,{type:`text`,text:``}],status:`streaming`}),this.setError(null)};handleMessageTextDelta=e=>{if(!e.delta)return;let t=this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`),n=[...t.parts],r=n[n.length-1];r?.type===`text`?n[n.length-1]={type:`text`,text:`${r.text}${e.delta}`}:n.push({type:`text`,text:e.delta}),this.replaceStreamingMessage({...t,parts:n,status:`streaming`})};handleMessageTextEnd=e=>{this.streamingMessage?.id===e.messageId&&this.streamingMessage.status===`streaming`&&this.replaceStreamingMessage({...this.streamingMessage,status:`pending`})};handleMessageReasoningStart=e=>{this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`)};handleMessageReasoningDelta=e=>{if(!e.delta)return;let t=this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`),n=[...t.parts],r=n[n.length-1];r?.type===`reasoning`?n[n.length-1]={type:`reasoning`,text:`${r.text}${e.delta}`}:n.push({type:`reasoning`,text:e.delta}),this.replaceStreamingMessage({...t,parts:n,status:`streaming`})};handleMessageReasoningEnd=e=>{this.streamingMessage?.id,e.messageId};handleMessageToolCallStart=e=>{this.toolCalls.handleToolCallStart(e),this.setError(null)};handleMessageToolCallArgs=e=>{this.toolCalls.handleToolCallArgs(e)};handleMessageToolCallArgsDelta=e=>{this.toolCalls.handleToolCallArgsDelta(e)};handleMessageToolCallEnd=e=>{this.toolCalls.handleToolCallEnd(e)};handleMessageToolCallResult=e=>{this.toolCalls.handleToolCallResult(e)};handleRunStarted=e=>{this.isSettledRunId(e.runId)||(this.runExecution.clear(),this.setError(null),this.activeRun={runId:e.runId??null,sessionId:e.sessionId},this.stateVersion+=1)};handleRunFinished=e=>{this.markRunAsSettled(e.runId??this.activeRun?.runId??null),this.settleStreamingMessage(`final`,BX(e),e.runId??this.activeRun?.runId),this.setError(null),this.clearActiveRun()};handleRunError=e=>{this.markRunAsSettled(e.runId??this.activeRun?.runId??null),this.settleStreamingMessage(`error`,BX(e),e.runId??this.activeRun?.runId),this.setError(zX(e)),this.clearActiveRun()};handleRunMetadata=e=>{this.runExecution.observe(e);let t=e.metadata;if(t?.kind===`ready`){let e=t;if(this.isSettledRunId(e.runId))return;this.activeRun={runId:e.runId??this.activeRun?.runId??null,sessionId:e.sessionId??this.activeRun?.sessionId,abortDisabledReason:e.supportsAbort===!1?e.abortDisabledReason??`Unsupported`:null},this.stateVersion+=1}else t?.kind===`final`&&(this.markRunAsSettled(e.runId??this.activeRun?.runId??null),this.clearActiveRun())};handleContextWindowUpdated=e=>{this.contextWindow={...e.contextWindow},this.stateVersion+=1};handleEndpointError=e=>{if(e.code===`abort-error`){this.handleMessageAbort({sessionId:this.activeRun?.sessionId??this.streamingMessage?.sessionId??``,...this.streamingMessage?.id?{messageId:this.streamingMessage.id}:{}});return}this.settleStreamingMessage(`error`),this.clearActiveRun(),this.setError(e)};ensureStreamingMessage=(e,t,n)=>{if(this.streamingMessage?.id===t){if(this.streamingMessage.status===n)return this.streamingMessage;let e={...this.streamingMessage,status:n};return this.replaceStreamingMessage(e),e}let r=this.messages.findIndex(e=>e.id===t);if(r>=0){let t=FX(this.messages[r]),i=[...this.messages];i.splice(r,1),this.messages=i,this.stateVersion+=1;let a={...t,sessionId:e,status:n};return this.replaceStreamingMessage(a),a}let i=this.streamingMessage;if(i&&i.id!==t&&i.sessionId===e&&GX(i,t)){let r={...i,id:t,sessionId:e,status:n};return this.toolCalls.remapMessageId(i.id,t),this.replaceStreamingMessage(r),r}let a={id:t,sessionId:e,role:ZX,status:n,parts:[],timestamp:new Date().toISOString()};return this.replaceStreamingMessage(a),a};updateMessageContainingToolCall=(e,t)=>{if(this.streamingMessage){let n=KX(this.streamingMessage.parts,e);if(n){let e=t(this.streamingMessage,n);return this.replaceStreamingMessage({...this.streamingMessage,parts:e}),!0}}for(let n=this.messages.length-1;n>=0;--n){let r=this.messages[n],i=KX(r.parts,e);if(!i)continue;let a=[...this.messages];return a[n]={...r,parts:t(r,i)},this.messages=a,this.stateVersion+=1,!0}return!1};upsertMessage=e=>{let t=IX(e);this.streamingMessage?.id===t.id&&(this.streamingMessage=null);let n=this.messages.findIndex(e=>e.id===t.id);if(n<0){this.messages=UX(this.messages,t),this.stateVersion+=1;return}let r=[...this.messages];r[n]=t,this.messages=r,this.stateVersion+=1};replaceStreamingMessage=e=>{!e&&!this.streamingMessage||(this.streamingMessage=e?IX(e):null,this.stateVersion+=1)};setError=e=>{this.error?.code===e?.code&&this.error?.message===e?.message&&this.error?.details===e?.details&&this.error?.cause===e?.cause||(this.error=e?{...e,details:e.details?{...e.details}:void 0}:null,this.stateVersion+=1)};clearActiveRun=()=>{this.activeRun&&(this.activeRun=null,this.stateVersion+=1)};isSettledRunId=e=>!!e?.trim()&&e===this.lastSettledRunId;markRunAsSettled=e=>{this.lastSettledRunId=e?.trim()||null};settleStreamingMessage=(e,t,n)=>{let r=this.runExecution.take(n);if(!this.streamingMessage)return;let i=this.runExecution.attach(VX(this.streamingMessage,e,t),r);this.upsertMessage(i),this.replaceStreamingMessage(null),this.toolCalls.clearByMessageId(i.id)};notifyListeners=()=>{let e=this.getSnapshot();for(let t of this.listeners)t(e)}},$X=16,eZ={code:`abort-error`,message:`User stopped the current run.`,details:{source:`chat-ui`}},tZ=class{constructor(e){this.dispatchBatch=e,this.queue=[],this.flushTimerId=null,this.isFlushing=!1,this.isDisposed=!1,this.enqueue=e=>{this.isDisposed||(this.queue.push(e),this.scheduleFlush())},this.dispose=()=>{this.isDisposed=!0,this.flushTimerId!==null&&(window.clearTimeout(this.flushTimerId),this.flushTimerId=null),this.queue.length=0},this.scheduleFlush=()=>{this.flushTimerId!==null||this.isFlushing||this.queue.length===0||(this.flushTimerId=window.setTimeout(()=>{this.flushTimerId=null,this.flush()},$X))},this.flush=async()=>{if(!(this.isDisposed||this.isFlushing||this.queue.length===0)){this.isFlushing=!0;try{for(;this.queue.length>0;){let e=this.queue.splice(0);await this.dispatchBatch(e)}}finally{this.isFlushing=!1,this.scheduleFlush()}}}}};function nZ(e,t){if(!t)return!0;let n=`payload`in e?e.payload:null;return!n||typeof n!=`object`||!(`sessionId`in n)||typeof n.sessionId!=`string`?!0:n.sessionId===t}function rZ(e){return e.parts.some(e=>e.type===`text`||e.type===`rich-text`||e.type===`reasoning`?e.text.trim().length>0:!0)}function iZ(e,t){if(typeof e==`string`){let n=e.trim();return n?{...t?{sessionId:t}:{},message:{id:`user-${Date.now().toString(36)}`,...t?{sessionId:t}:{},role:`user`,status:`final`,parts:[{type:`text`,text:n}],timestamp:new Date().toISOString()}}:null}if(!rZ(e.message))return null;let n=e.sessionId||e.message.sessionId||t;return{...e,...n?{sessionId:n}:{},message:{...e.message,...n?{sessionId:n}:{}}}}function aZ(e,t){return{...e.message,sessionId:t}}function oZ(e){let t=(0,L.useRef)();return t.current?e&&t.current.sessionId===null?t.current.sessionId=e:t.current.sessionId!==(e??null)&&(t.current={sessionId:e??null,manager:new QX}):t.current={sessionId:e??null,manager:new QX},t.current.manager}function sZ({sessionId:e,client:t,manager:n}){let r=(0,L.useRef)(e),i=(0,L.useSyncExternalStore)(e=>n.subscribe(()=>e()),()=>n.getSnapshot(),()=>n.getSnapshot()),[a,o]=(0,L.useState)(null),[s,c]=(0,L.useState)(null);(0,L.useEffect)(()=>{r.current=e},[e]),(0,L.useEffect)(()=>{let e=new tZ(async e=>{await n.dispatchBatch(e),e.forEach(e=>{e.type===yK.MessageSent&&c(t=>t?.id===e.payload.message.id?null:t)})}),i=t.subscribe(t=>{nZ(t,r.current)&&e.enqueue(t)});return()=>{i(),e.dispose(),t.stop()}},[t,n]);let l=s&&s.sessionId===e&&!i.messages.some(e=>e.id===s.id)?[...i.messages,s]:i.messages,u=i.streamingMessage?[...l,i.streamingMessage]:l,d=i.activeRun?.runId??null,f=!!i.activeRun,p=a===e;return{snapshot:i,visibleMessages:u,activeRunId:d,isRunning:f,isSending:p,send:async r=>{if(p)return null;let i=iZ(r,e);if(!i)return null;n.clearError(),o(e);let a=i.sessionId?aZ(i,i.sessionId):null,s=async()=>{a&&(c(null),await n.dispatch({type:yK.MessageSent,payload:{sessionId:a.sessionId,message:{...a,status:`error`}}}))};c(f?null:a);try{let e=await t.send(i);return e?(e.runId===null?c(null):i.sessionId||await n.dispatch({type:yK.MessageSent,payload:{sessionId:e.sessionId,message:aZ(i,e.sessionId)}}),e):(await s(),null)}catch(e){throw await s(),e}finally{o(t=>t===e?null:t)}},abort:async()=>{e&&await t.abort({sessionId:e,runId:d??void 0,reason:eZ})},streamRun:async()=>{e&&(await t.stop(),await t.stream({sessionId:e}))}}}var cZ=500;function lZ(e){return e instanceof Error?e:Error(String(e))}function uZ(e,t){let n=e.getSnapshot();return n.activeRun?.sessionId===t||n.streamingMessage?.sessionId===t||n.messages.some(e=>e.sessionId===t)}function dZ(){return new Promise(e=>window.setTimeout(e,cZ))}function fZ({sessionId:e,client:t,loadSeed:n}){let r=oZ(e),i=sZ({sessionId:e,client:t,manager:r}),[a,o]=(0,L.useState)({sessionId:null,error:null});(0,L.useEffect)(()=>{let i=new AbortController,{signal:a}=i,s=t=>{o({sessionId:e??null,error:t})};return(async()=>{if(!e){r.reset(),s(null),await t.stop();return}let i=!uZ(r,e);for(i?(r.reset(),o({sessionId:null,error:null})):s(null),await t.stop();!a.aborted;){try{if(i){let t=await n(e,a);if(a.aborted)return;r.hydrate({sessionId:e,messages:t.messages,activeRun:t.status===`running`?{runId:null,sessionId:e,abortDisabledReason:null}:null}),s(null),i=!1}if(await t.stream({sessionId:e}),a.aborted)return;throw Error(`Live conversation stream disconnected.`)}catch(e){if(a.aborted)return;s(lZ(e))}i=!0,await dZ()}})().catch(e=>{a.aborted||s(lZ(e))}),()=>{i.abort()}},[t,n,r,e]);let s=(0,L.useCallback)(e=>r.prependHistory(e),[r]);return{...i,isHydrating:!!(e&&a.sessionId!==e),hydrateError:a.error,prependHistory:s}}var pZ=200*1024*1024,mZ=`application/octet-stream`;function hZ(e){let t=e.type.trim().toLowerCase();return t.length>0?t:mZ}function gZ(e,t){let n=t.acceptedMimeTypes&&t.acceptedMimeTypes.length>0?new Set(t.acceptedMimeTypes.map(e=>e.trim().toLowerCase())):null,r=t.maxBytes??209715200,i=hZ(e);return n&&!n.has(i)?{ok:!1,rejected:{fileName:e.name,mimeType:i,sizeBytes:e.size,reason:`unsupported-type`}}:e.size>r?{ok:!1,rejected:{fileName:e.name,mimeType:i,sizeBytes:e.size,reason:`too-large`}}:{ok:!0,mimeType:i}}function _Z(e){let t=e.parts&&e.parts.length>0?e.parts.map(e=>structuredClone(e)):[...e.text?.trim()??``?[{type:`text`,text:e.text.trim()}]:[],...(e.attachments??[]).map(e=>({type:`file`,name:e.name,mimeType:e.mimeType,...e.assetUri?.trim()?{assetUri:e.assetUri.trim()}:{},...e.url?.trim()?{url:e.url.trim()}:{},...e.contentBase64?.trim()?{contentBase64:e.contentBase64.trim()}:{},sizeBytes:e.sizeBytes}))];if(t.length===0)return null;let n=e.timestamp??new Date().toISOString(),r=e.messageId??`user-${Date.now().toString(36)}`;return{...e.sessionId?{sessionId:e.sessionId}:{},message:{id:r,...e.sessionId?{sessionId:e.sessionId}:{},role:`user`,status:`final`,parts:t,timestamp:n,...e.metadata?{metadata:e.metadata}:{}},...e.metadata?{metadata:e.metadata}:{}}}async function vZ(e,t){let n=[],r=[];for(let i of e){let e=gZ(i,t);if(!e.ok){r.push(e.rejected);continue}n.push(i)}if(n.length===0)return{attachments:[],rejected:r};try{return{attachments:await t.uploadBatch(n),rejected:r}}catch{return r.push(...n.map(e=>({fileName:e.name,mimeType:hZ(e),sizeBytes:e.size,reason:`read-failed`}))),{attachments:[],rejected:r}}}function yZ(e){return typeof e==`string`?e:e instanceof URL?e.toString():e.url}function bZ(e){if(e instanceof Error){let t=e.name?.trim(),n=e.message?.trim();return t&&n?`${t}: ${n}`:n||t||`Unknown Error`}return String(e??`Unknown error`)}function xZ(e,t){let n=Error(e);return t!==void 0&&(n.cause=t),n}function SZ(){return async(e,t)=>{try{return await fetch(e,{credentials:`include`,...t})}catch(n){throw ne.reportTransportFailure(bZ(n)),xZ(`NCP fetch failed for ${(t?.method||`GET`).toUpperCase()} ${yZ(e)}: ${bZ(n)}`,n)}}}var CZ={sessionId:null,contextWindow:null,total:0,cursor:null,hasPreviousPage:!1,isLoading:!1,error:null};function wZ(e){return e instanceof Error&&e.message.includes(`ncp session not found:`)}async function TZ(e,t,n=80){t.throwIfAborted();try{let r=await fe(e,{limit:n,signal:t});return t.throwIfAborted(),{messages:r.messages,status:r.status??`idle`,contextWindow:r.contextWindow??null,total:r.total,pageInfo:r.pageInfo}}catch(e){if(t.throwIfAborted(),!wZ(e))throw e;return{messages:[],status:`idle`,total:0,pageInfo:{startCursor:null,hasPreviousPage:!1}}}}function EZ(e){let{hydrationRetryVersion:t,messageLimit:n,sessionId:r}=e,[i,a]=(0,L.useState)(CZ),o=(0,L.useRef)(CZ),s=(0,L.useRef)(null),c=(0,L.useCallback)((e,t)=>{let n=t(o.current.sessionId===e?o.current:{...CZ,sessionId:e});o.current=n,a(n)},[]);return(0,L.useEffect)(()=>(s.current?.abort(),s.current=null,()=>s.current?.abort()),[r]),{loadSeed:(0,L.useCallback)(async(e,t)=>{let r=await TZ(e,t,n);return t.aborted||c(e,e=>({...e,contextWindow:r.contextWindow??null,total:r.total,cursor:r.pageInfo.startCursor,hasPreviousPage:r.pageInfo.hasPreviousPage,error:null})),{messages:r.messages,status:r.status}},[t,n,c]),loadPreviousMessages:(0,L.useCallback)(async e=>{let t=o.current;if(!r||t.sessionId!==r||!t.hasPreviousPage||!t.cursor||s.current)return;let i=new AbortController;s.current=i,c(r,e=>({...e,isLoading:!0,error:null}));try{let a=await fe(r,{limit:n,cursor:t.cursor,signal:i.signal});if(i.signal.aborted||s.current!==i)return;e(a.messages),c(r,e=>({...e,contextWindow:a.contextWindow??e.contextWindow,total:a.total,cursor:a.pageInfo.startCursor,hasPreviousPage:a.pageInfo.hasPreviousPage}))}catch(e){i.signal.aborted||c(r,t=>({...t,error:e instanceof Error?e:Error(String(e))}))}finally{s.current===i&&(s.current=null,c(r,e=>({...e,isLoading:!1})))}},[n,r,c]),state:i.sessionId===r?i:CZ}}var DZ=`ncp agent unavailable during startup`;function OZ(e){return e?.trim().toLowerCase().includes(DZ)??!1}function kZ(){return new PX({baseUrl:ue,basePath:`/api/ncp/agent`,fetchImpl:SZ()})}function AZ(e,t){let n=(0,L.useRef)(null),r=(0,L.useCallback)(e=>{if(!e){n.current=null;return}n.current!==e&&(n.current=e,t())},[t]);(0,L.useEffect)(()=>{r(e)},[e,r])}function jZ(e,t={}){let[n]=(0,L.useState)(()=>kZ()),r=ce(),[i,a]=(0,L.useState)(0),{loadSeed:o,loadPreviousMessages:s,state:c}=EZ({sessionId:e,messageLimit:t.messageLimit??80,hydrationRetryVersion:i}),l=fZ({sessionId:e,client:n,loadSeed:o}),u=(0,L.useCallback)(async()=>await s(l.prependHistory),[l.prependHistory,s]),d=l.hydrateError?.message??l.snapshot.error?.message??null;return AZ(e&&r.phase===`ready`&&OZ(d)?`${e}:${r.lastReadyAt??0}`:null,()=>{a(e=>e+1)}),(0,L.useMemo)(()=>({...l,snapshot:{...l.snapshot,contextWindow:l.snapshot.contextWindow??c.contextWindow},hasPreviousMessages:c.hasPreviousPage,historyError:c.error,isLoadingPreviousMessages:c.isLoading,loadPreviousMessages:u,messageTotal:c.total}),[l,u,c])}function MZ(e){return e.bootstrapStatus?.ncpAgent.state!==`ready`}function NZ(e){return e.activeSystemAction?.message?.trim()||(e.lifecyclePhase===`cold-starting`?b(`chatRuntimeInitializing`):e.lifecyclePhase===`startup-failed`?e.bootstrapStatus?.ncpAgent.error?.trim()||e.bootstrapStatus?.lastError?.trim()||e.lastError?.trim()||b(`chatRuntimeInitializationFailed`):null)}function PZ(e){let{message:t,status:n}=e,r=t?.trim();if(!r)return NZ(n);let i=n.activeSystemAction?.message?.trim();if(n.phase===`service-transitioning`&&i)return i;let a=$e(r);return n.phase===`recovering`&&a?b(`runtimeControlRecoveringHelp`):n.phase===`stalled`&&a?null:r}function FZ(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function IZ(e){if(!e||e.totalContextTokens<=0)return null;let t=e.usedContextTokens/e.totalContextTokens,n=Math.max(0,Math.min(1,t)),r=`${Math.round(n*100)}%`,i=n>=.9?`danger`:n>=.75?`warning`:`neutral`,a=[{label:b(`chatContextWindowUsed`),value:FZ(e.usedContextTokens)},{label:b(`chatContextWindowTotal`),value:FZ(e.totalContextTokens)},{label:b(`chatContextWindowAvailable`),value:FZ(e.availableContextTokens)}];return e.prunedUsedContextTokens!==e.usedContextTokens&&a.push({label:b(`chatContextWindowPruned`),value:FZ(e.prunedUsedContextTokens)}),e.droppedHistoryCount>0&&a.push({label:b(`chatContextWindowDroppedHistory`),value:String(e.droppedHistoryCount)}),e.truncatedToolResultCount>0&&a.push({label:b(`chatContextWindowTruncatedTools`),value:String(e.truncatedToolResultCount)}),{label:b(`chatContextWindow`),percentLabel:r,ratio:n,tone:i,details:a}}var LZ=an(`18rem`);function RZ({agents:e,selectedAgent:t,selectedAgentId:n,onSelectAgent:r}){return(0,R.jsxs)(ln,{value:n,onValueChange:r,children:[(0,R.jsxs)(en,{"aria-label":b(`chatDraftAgentTitle`),className:`h-auto w-auto min-w-0 gap-1 rounded-lg border-0 bg-transparent px-2 py-1.5 text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground focus:ring-0`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:b(`chatDraftAgentTitle`)}),(0,R.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:t?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Gd,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-5 w-5 shrink-0`}),(0,R.jsx)(`span`,{className:`max-w-28 truncate text-sm font-medium`,children:t.displayName?.trim()||t.id})]}):null})]}),(0,R.jsx)(rn,{className:`rounded-xl border-border shadow-lg`,style:{maxHeight:LZ},children:e.map(e=>(0,R.jsx)(sn,{value:e.id,className:`rounded-lg pr-10`,children:(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(Gd,{agentId:e.id,displayName:e.displayName,avatarUrl:e.avatarUrl,className:`h-5 w-5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.displayName?.trim()||e.id})]})},e.id))})]})}var zZ=[{icon:xs,titleKey:`chatWelcomeCapability1Title`,descKey:`chatWelcomeCapability1Desc`,promptKey:`chatWelcomeCapability1Prompt`},{icon:wo,titleKey:`chatWelcomeCapability2Title`,descKey:`chatWelcomeCapability2Desc`,promptKey:`chatWelcomeCapability2Prompt`},{icon:_o,titleKey:`chatWelcomeCapability3Title`,descKey:`chatWelcomeCapability3Desc`,promptKey:`chatWelcomeCapability3Prompt`}];function BZ({onSelectPrompt:e}){return(0,R.jsx)(`div`,{className:`mt-8 grid grid-cols-[repeat(auto-fit,minmax(min(100%,9.5rem),1fr))] gap-3`,children:zZ.map(t=>{let n=t.icon;return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>e(b(t.promptKey)),className:r(`min-w-0 rounded-xl border border-border/75 bg-card p-3 text-left text-card-foreground shadow-none transition-colors sm:p-3.5`,`hover:bg-muted/40`),children:[(0,R.jsx)(`div`,{className:`mb-2.5 flex h-8 w-8 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,R.jsx)(n,{className:`h-4 w-4`})}),(0,R.jsx)(`div`,{className:`mb-1 text-sm font-medium text-foreground`,children:b(t.titleKey)}),(0,R.jsx)(`div`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:b(t.descKey)})]},t.titleKey)})})}var VZ=tt(`20rem`);function HZ({defaultProjectRoot:e,isSaving:t,projectOptions:n,projectRoot:r,selectable:i,onOpenProjectDialog:a,onSelectProjectRoot:o}){let[s,c]=(0,L.useState)(!1),l=hl(r)??b(`chatWelcomeProjectPickerPlaceholder`),u=e!=null&&r===e,d=async e=>{c(!1),await o(e)};return(0,R.jsxs)(ct,{open:s,onOpenChange:c,children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,title:r??void 0,"aria-label":b(`chatWelcomeProjectPickerLabel`),disabled:!i||t,children:[(0,R.jsx)(es,{className:`h-4 w-4 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:l}),u?(0,R.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-muted-foreground/70`,children:b(`chatWelcomeProjectDefaultBadge`)}):null,(0,R.jsx)(Wt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/70`})]})}),(0,R.jsxs)(ot,{align:`start`,className:`flex w-[min(20rem,calc(100vw-1rem))] flex-col overflow-hidden rounded-2xl border border-border bg-popover p-0 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,style:{maxHeight:VZ},children:[(0,R.jsx)(`div`,{className:`shrink-0 px-3 pb-2 pt-3 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:b(`chatWelcomeProjectRecentTitle`)}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-1.5 pb-1.5`,children:n.length>0?n.map(e=>(0,R.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-start gap-2 rounded-xl px-2 py-2 text-left transition-colors hover:bg-accent`,title:e.projectRoot,onClick:()=>{d(e.projectRoot)},children:[(0,R.jsx)(es,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,R.jsx)(`span`,{className:`truncate text-[13px] font-semibold text-foreground`,children:e.projectName})}),(0,R.jsx)(`span`,{className:`block truncate text-[11px] leading-4 text-muted-foreground`,children:e.projectRoot})]}),e.sessionCount>0?(0,R.jsx)(`span`,{className:`mt-0.5 shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground`,children:e.sessionCount}):null]},e.projectRoot)):(0,R.jsx)(`div`,{className:`px-2 py-5 text-center text-xs text-muted-foreground`,children:b(`chatWelcomeProjectNoRecent`)})}),(0,R.jsx)(`div`,{className:`shrink-0 border-t border-border p-1.5`,children:(0,R.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-xl px-2.5 py-2 text-left text-[13px] font-semibold text-foreground transition-colors hover:bg-accent`,onClick:()=>{c(!1),a()},children:[(0,R.jsx)(es,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,R.jsx)(`span`,{children:b(`chatWelcomeProjectOpenFolder`)})]})})]})]})}function UZ(e){let{disabled:t=!1,option:n,onSelect:i,selected:a=!1}=e,o=n.ready===!1?n.reasonMessage?.trim()||b(`statusSetup`):null;return(0,R.jsx)(`button`,{type:`button`,"aria-pressed":a,disabled:t,onClick:i,className:r(`w-full rounded-2xl px-3 py-2.5 text-left transition-colors`,a?`bg-gray-50`:`hover:bg-gray-50`,t?`cursor-not-allowed opacity-70`:null),children:(0,R.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2.5`,children:[n.icon?.src?(0,R.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center pt-0.5`,children:(0,R.jsx)(Fu,{icon:{kind:`runtime-image`,src:n.icon.src,alt:n.icon.alt??null,name:n.label}})}):(0,R.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center pt-0.5 text-muted-foreground`,children:(0,R.jsx)(So,{className:`h-4 w-4`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,R.jsx)(`div`,{className:`truncate text-[13px] font-semibold text-gray-900`,children:n.label}),(0,R.jsx)(Jn,{status:n.ready===!1?`warning`:`ready`,label:n.ready===!1?b(`statusSetup`):b(`statusReady`),className:`bg-transparent px-0`})]}),o?(0,R.jsx)(`div`,{className:`mt-1 pr-4 text-[11px] leading-4 text-gray-500`,children:o}):null]})]}),a?(0,R.jsx)(fn,{className:`mt-1 h-3.5 w-3.5 shrink-0 text-primary`}):null]})})}var WZ=tt(`18rem`);function GZ({options:e,selectedSessionType:t,onSelectSessionType:n}){let[r,i]=(0,L.useState)(!1),a=e.find(e=>e.value===t)??e[0]??null;return a?(0,R.jsxs)(ct,{open:r,onOpenChange:i,children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-label":b(`chatWelcomeSessionTypePickerLabel`),children:[a.icon?.src?(0,R.jsx)(Fu,{icon:{kind:`runtime-image`,src:a.icon.src,alt:a.icon.alt??null,name:a.label},className:`h-4 w-4`}):(0,R.jsx)(So,{className:`h-4 w-4 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:a.label}),(0,R.jsx)(Wt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/70`})]})}),(0,R.jsx)(ot,{align:`start`,className:`flex w-[min(16rem,calc(100vw-1rem))] flex-col overflow-hidden rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,style:{maxHeight:WZ},children:(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:e.map(e=>(0,R.jsx)(UZ,{option:e,onSelect:()=>{n(e.value),i(!1)}},e.value))})})]}):null}function KZ({agents:e,defaultProjectRoot:t,inputSlot:n,projectOptions:r,selectedAgentId:i,selectedProjectRoot:a,selectedSessionType:o,sessionTypeOptions:s,onSelectAgent:c,onSelectPrompt:l,onSelectProjectRoot:u,onSelectSessionType:d}){let f=e.find(e=>e.id===i)??null,[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(!1),_=a??t??null,v=async e=>{if(u){g(!0);try{await u(e),m(!1)}finally{g(!1)}}},y=!!u;return(0,R.jsxs)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8 sm:p-8`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 w-full max-w-[min(760px,100%)]`,children:[(0,R.jsxs)(`div`,{className:`text-center`,children:[(0,R.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground sm:text-3xl`,children:b(`chatWelcomeTitle`)}),(0,R.jsx)(`p`,{className:`mt-3 text-sm font-medium text-muted-foreground sm:text-base`,children:b(`chatWelcomeSubtitle`)})]}),n?(0,R.jsx)(`div`,{className:`mt-8`,children:n}):null,(0,R.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2 px-1 text-sm text-muted-foreground`,children:[u?(0,R.jsx)(HZ,{defaultProjectRoot:t,isSaving:h,projectOptions:r,projectRoot:_,selectable:y,onOpenProjectDialog:()=>m(!0),onSelectProjectRoot:v}):null,(0,R.jsx)(RZ,{agents:e,selectedAgent:f,selectedAgentId:i,onSelectAgent:c}),(0,R.jsx)(GZ,{options:s,selectedSessionType:o,onSelectSessionType:d})]}),(0,R.jsx)(BZ,{onSelectPrompt:l})]}),u?(0,R.jsx)(Xc,{open:p,currentProjectRoot:_,defaultWorkspacePath:t,isSaving:h,onOpenChange:m,onSave:v}):null]})}function qZ(e){let{agents:t,fallbackAgentId:n}=e;return(t?.length??0)>0?t??[]:[{id:n}]}function JZ(e){return e.agents.find(t=>t.id===e.agentId)??null}function YZ(e,t){if(typeof e!=`string`||e.trim().length===0)return null;let n=yu(e);return t.some(e=>e.value===n)?n:null}function XZ(e){let{agentId:t,agents:n,defaultSessionType:r,pendingSessionType:i,selectedSessionType:a,sessionTypeOptions:o}=e;return(YZ(a,o)??YZ(i,o))||((n&&t?YZ(bu(JZ({agents:n,agentId:t}),r),o):null)??YZ(r,o)??o[0]?.value??yu(r))}function ZZ(e){return new Date(e.lastMessageAt??e.createdAt).getTime()}function QZ(e){let{defaultProjectRoot:t,projects:n=[],sessionSummaries:r}=e,i=new Map;for(let e of n)e.rootPath!==t&&i.set(e.rootPath,{projectRoot:e.rootPath,projectName:e.name,sessionCount:0,latestUpdatedAt:new Date(e.updatedAt).getTime()});for(let e of ql([...r])){let n=e.projectRoot?.trim();if(!n||n===t)continue;let r=i.get(n),a=ZZ(e);if(r){r.sessionCount+=1,r.latestUpdatedAt=Math.max(r.latestUpdatedAt,a);continue}i.set(n,{projectRoot:n,projectName:e.projectName?.trim()||hl(n)||n,sessionCount:1,latestUpdatedAt:a})}return[...i.values()].sort((e,t)=>t.latestUpdatedAt-e.latestUpdatedAt).map(({latestUpdatedAt:e,...t})=>t)}var $Z=[];function eQ({inputSlot:e,pendingProjectRoot:t,pendingSessionType:n,selectedSessionTypeValue:r,onSelectProjectRoot:i,onSelectPrompt:a,onSelectSessionType:o}){let s=rl(),c=z(e=>e.snapshot.selectedAgentId),l=Hd(e=>e.snapshot),u=Uu(e=>e.snapshot.configQuery?.data??null),d=Uu(e=>e.snapshot.sessionsQuery?.data?.sessions??$Z),f=Uu(e=>e.snapshot.sessionTypesQuery?.data??null),p=Kd(),m=Gu(),h=l.agentId??c,g=qZ({agents:p.data?.agents,fallbackAgentId:h}),_=ml(u?.agents.defaults.workspace),v=ml(t),y=Su(f?.options??[]),b=yu(f?.defaultType??`native`),x=XZ({defaultSessionType:b,pendingSessionType:n,selectedSessionType:r,sessionTypeOptions:y}),S=QZ({defaultProjectRoot:_,projects:m.data?.projects??[],sessionSummaries:d});return(0,R.jsx)(KZ,{agents:g,defaultProjectRoot:_,inputSlot:e,projectOptions:S,selectedAgentId:h,selectedProjectRoot:v,selectedSessionType:x,sessionTypeOptions:y,onSelectAgent:e=>{s.chatSessionListManager.setSelectedAgentId(e),o(XZ({agents:g,agentId:e,defaultSessionType:b,pendingSessionType:null,selectedSessionType:null,sessionTypeOptions:y}))},onSelectPrompt:a,onSelectProjectRoot:i,onSelectSessionType:o})}function tQ(e,t){if(t.length===0)return e;let n=e[e.length-1];return n?.type===`text`?[...e.slice(0,-1),{...n,text:n.text+t}]:[...e,{type:`text`,text:t}]}function nQ(e){return xg(e)}function rQ(e){return wg(e)}function iQ(e){return Tg(e,`skill`)}function aQ(e){return Tg(e,`file`)}function oQ(e,t,n){let r=new Set(t),i=Mg(e,e=>e.tokenKind===`skill`&&!r.has(e.tokenKey)),a=Tg(i,`skill`),o=new Map(n.map(e=>[e.ref,e])),s=t.filter(e=>!a.includes(e)).map(e=>vg({tokenKind:`skill`,tokenKey:e,label:o.get(e)?.name||e}));return s.length===0?i:Sg([...i,...s])}function sQ(e,t){let n=new Set(aQ(e));return t.filter(e=>n.has(e.id))}function cQ(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[];for(let t of e){if(t.type===`text`){r=tQ(r,t.text);continue}let e=qU(t);if(e){r=tQ(r,e);continue}if(t.tokenKind!==`file`)continue;let i=n.get(t.tokenKey);i&&r.push({type:`file`,name:i.name,mimeType:i.mimeType,...i.assetUri?{assetUri:i.assetUri}:{},...i.url?{url:i.url}:{},...i.contentBase64?{contentBase64:i.contentBase64}:{},sizeBytes:i.sizeBytes})}return r}function lQ(e){return e.modelOptions.length>0}function uQ(e){return!e.isProviderStateResolved&&!lQ(e)}function dQ(e){return e.isProviderStateResolved&&!lQ(e)}function fQ(e){return!1}function pQ(e){let{hasSendableDraft:t,isRuntimeBlocked:n}=e;return n||!t}function mQ(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function hQ(e,t){return e?Object.fromEntries(t.map(t=>[t,e])):{}}function gQ(e){let t=ml(e.projectRoot),n={...hQ(e.model?.trim(),[`model`,`preferred_model`]),...hQ(e.thinkingLevel?.trim(),[`thinkingEffort`,`thinking`,`preferred_thinking`]),...hQ(e.sessionType?.trim(),[`agentRuntimeId`,`session_type`,`runtime`]),...hQ(e.agentId?.trim(),[`agentId`,`agent_id`]),...hQ(t??void 0,[`projectRoot`,`project_root`])},r=mQ(e.requestedSkills);r.length>0&&(n.requested_skill_refs=r);let i=e.composerNodes?nW(e.composerNodes,e.skillRecords):[];return i.length>0&&(n[m]=lW(i)),e.sessionMaterialization&&(n[u]=e.sessionMaterialization),n}function _Q(e,t){let n=[],r=0;for(;r<e.length;){let i=t.flatMap(t=>{let n=e.indexOf(t.rawText,r);return n<0?[]:[{index:n,token:t}]}).sort((e,t)=>e.index-t.index||t.token.rawText.length-e.token.rawText.length)[0];if(!i)return n.push(_g(e.slice(r))),n;i.index>r&&n.push(_g(e.slice(r,i.index))),n.push(vg({tokenKind:i.token.kind,tokenKey:`ref`in i.token?i.token.ref:i.token.key,label:i.token.label})),r=i.index+i.token.rawText.length}return n}function vQ(e){return{...e.metadata,...e.message.metadata}}function yQ(e){let t=vQ(e).requested_skill_refs;return mQ(Array.isArray(t)?t.filter(e=>typeof e==`string`):void 0)}function bQ(e){let t=oW(vQ(e)),n=e.message.parts.flatMap(e=>e.type===`text`||e.type===`rich-text`||e.type===`reasoning`?[e.text]:[]).join(` `);return t.reduce((e,t)=>e.split(t.rawText).join(``),n).replace(/\s+/g,` `).trim()||e.message.parts.flatMap(e=>e.type===`file`&&e.name?[e.name]:[]).join(`, `)}function xQ(e,t){let n=[],r=[],i=oW(vQ(e));e.message.parts.forEach((t,a)=>{if(t.type===`text`||t.type===`rich-text`||t.type===`reasoning`){n.push(..._Q(t.text,aW(t.text,i)));return}if(t.type!==`file`)return;let o=`queued-attachment-${e.id}-${a}`,s={id:o,name:t.name??`attachment`,mimeType:t.mimeType??`application/octet-stream`,sizeBytes:t.sizeBytes??0,assetUri:t.assetUri,url:t.url,contentBase64:t.contentBase64};r.push(s),n.push(vg({tokenKind:`file`,tokenKey:o,label:s.name}))});let a=Sg(n),o=yQ(e),s=new Map(t.map(({ref:e,name:t})=>[e,t]));return{text:rQ(a),nodes:a,selectedSkills:o,skillRecords:o.map(e=>({ref:e,name:s.get(e)??e})),attachments:r}}var SQ=e=>e.some(e=>e.type!==`text`||e.text.trim().length>0),CQ=e=>e?.trim()||void 0;function wQ(e){return{isProviderStateResolved:e.isProviderStateResolved,modelOptions:e.modelOptions,sessionTypeUnavailable:e.sessionTypeState.sessionTypeUnavailable}}function TQ(e){let{agentIsSending:t,inputQuery:n,inputSnapshot:r,isRuntimeBlocked:i,materializationContext:a,selectedAgentId:o,sessionKey:s}=e,c=cQ([...r.nodes],r.attachments);return pQ({snapshot:wQ(n),hasSendableDraft:SQ(c),isRuntimeBlocked:i})||t?null:{composerSnapshot:{text:r.text,nodes:[...r.nodes],selectedSkills:[...r.selectedSkills],skillRecords:[...r.skillRecords],attachments:[...r.attachments]},metadata:gQ({agentId:a?void 0:o,model:CQ(a?r.selectedModel:r.selectedModel??n.fallbackPreferredModel??n.defaultModel),thinkingLevel:a?r.selectedThinkingLevel??void 0:r.selectedThinkingLevel??n.fallbackPreferredThinking??void 0,sessionType:a?void 0:n.sessionTypeState.selectedSessionType,projectRoot:a?r.pendingProjectRoot:s?n.selectedSession?.projectRoot??null:r.pendingProjectRoot,requestedSkills:[...r.selectedSkills],skillRecords:n.skillRecords.filter(e=>r.selectedSkills.includes(e.ref)),composerNodes:[...r.nodes],sessionMaterialization:a?{kind:a.kind,parentSessionId:a.parentSessionKey,inheritContext:a.inheritContext}:null})}}function EQ(e,t){return _Z({sessionId:t??void 0,text:e.composerSnapshot.text.trim(),attachments:[...e.composerSnapshot.attachments],parts:cQ([...e.composerSnapshot.nodes],e.composerSnapshot.attachments),metadata:e.metadata})}function DQ(e){let{agent:t,inputSnapshot:n,inputQuery:r,isRuntimeBlocked:i,materializationContext:a,runQueue:o,selectedAgentId:s,sessionKey:c,onSessionMaterialized:l,resetComposer:u,restoreComposer:d,setSendError:f}=e,p=SQ((0,L.useMemo)(()=>cQ([...n.nodes],n.attachments),[n.attachments,n.nodes])),m=t.isSending||t.isRunning,h=pQ({snapshot:wQ(r),hasSendableDraft:p,isRuntimeBlocked:i})||t.isSending,g=(0,L.useCallback)(async()=>{let e=TQ({agentIsSending:t.isSending,inputSnapshot:n,inputQuery:r,isRuntimeBlocked:i,materializationContext:a,selectedAgentId:s,sessionKey:c});if(!e)return;let o=EQ(e,c);if(o){u(),f(null);try{let e=(await t.send(o))?.sessionId?.trim()||t.snapshot.activeRun?.sessionId?.trim()||null;!c&&e&&l?.(e)}catch(t){throw d(e.composerSnapshot),f(t instanceof Error?t.message:String(t)),t}}},[t,r,n,i,a,l,u,d,s,c,f]),_=(0,L.useCallback)(e=>{o.inputs.find(t=>t.id===e)&&o.removeQueuedInput(e).then(e=>{e&&(d(xQ(e,r.skillRecords)),f(null))}).catch(e=>{f(e instanceof Error?e.message:String(e))})},[r.skillRecords,d,o,f]),v=(0,L.useCallback)(e=>{o.removeQueuedInput(e).then(()=>{f(null)}).catch(e=>{f(e instanceof Error?e.message:String(e))})},[o,f]),y=(0,L.useCallback)(async()=>{await t.abort()},[t]);return{canStopGeneration:t.isRunning,deleteQueuedInput:v,editQueuedInput:_,hasSendableDraft:p,isSending:m,queuedInputs:o.inputs.map(e=>({id:e.id,preview:bQ(e)})),send:g,sendDisabled:h,stop:y,stopDisabled:!t.isRunning}}function OQ(e,t){return{value:C,modelLabel:e,providerLabel:``,isRuntimeDefault:!0,thinkingCapability:t??null}}function kQ(e){let t=new Set;return hr({providersView:e.providersView??void 0,templatesView:e.templatesView??void 0,config:e.config??void 0,onlyConfigured:!0}).flatMap(e=>e.models.map(n=>{let r=gr(e.prefix,n);return!r||t.has(r)?null:(t.add(r),{value:r,modelLabel:n,providerLabel:e.displayName,thinkingCapability:mr(e.modelThinking,n,e.aliases)})})).filter(e=>e!==null).sort((e,t)=>{let n=e.providerLabel.localeCompare(t.providerLabel);return n===0?e.modelLabel.localeCompare(t.modelLabel):n})}function AQ(e){let{modelOptions:t,modelSelectionMode:n,runtimeDefaultThinkingCapability:r,runtimeDefaultModelLabel:i=`Runtime default`,supportedModels:a}=e,o=OQ(i,r);if(n===`runtime-default`)return[o];if(!a||a.length===0)return n===`optional`?[o,...t]:t;let s=new Set(a),c=t.filter(e=>s.has(e.value)),l=c.length>0?c:t;return n===`optional`?[o,...l]:l}function jQ(e){return e?.trim().toLowerCase()||`native`}function MQ(e,t){if(typeof t!=`string`)return!1;let n=t.trim();return n?e.some(e=>e.value===n):!1}function NQ(e,t){return typeof t==`string`&&e.includes(t)}function PQ(e){return e.length===0?null:e.includes(`off`)?`off`:e[0]??null}function FQ(e){let{currentValue:t,selectedSessionPreferredValue:n,fallbackPreferredValue:r,defaultValue:i,isValueSupported:a,firstAvailableValue:o,preferSessionPreferredValue:s=!1,preserveCurrentValueOnSessionChange:c=!1}=e;return a(t)&&(!s||c)?t:a(n)?n:a(r)?r:a(i)?i:o}function IQ(e){let{modelOptions:t,currentSelectedModel:n,selectedSessionPreferredModel:r,fallbackPreferredModel:i,defaultModel:a,preferSessionPreferredModel:o,preserveCurrentSelectedModelOnSessionChange:s}=e;return t.length===0?``:FQ({currentValue:n,selectedSessionPreferredValue:r,fallbackPreferredValue:i,defaultValue:a,isValueSupported:e=>MQ(t,e),firstAvailableValue:t[0]?.value??``,preferSessionPreferredValue:o,preserveCurrentValueOnSessionChange:s})}function LQ(e){let{supportedThinkingLevels:t,currentSelectedThinkingLevel:n,selectedSessionPreferredThinking:r,fallbackPreferredThinking:i,defaultThinkingLevel:a,preferSessionPreferredThinking:o,preserveCurrentSelectedThinkingOnSessionChange:s}=e;return t.length===0?null:FQ({currentValue:n,selectedSessionPreferredValue:r,fallbackPreferredValue:i,defaultValue:a,isValueSupported:e=>NQ(t,e),firstAvailableValue:PQ(t)??`off`,preferSessionPreferredValue:o,preserveCurrentValueOnSessionChange:s})}function RQ(e){let{sessions:t,selectedSessionKey:n,sessionType:r,readPreference:i}=e,a=jQ(r),o,s=-1/0;for(let e of t){if(e.key===n||jQ(e.sessionType)!==a)continue;let t=i(e);if(t==null)continue;let r=Date.parse(e.updatedAt),c=Number.isFinite(r)?r:-1/0;(o===void 0||c>s)&&(o=t,s=c)}return o}function zQ(e){let{selectedSession:t,pendingSessionType:n,setPendingSessionType:r,sessionTypesData:i}=e,a=(0,L.useMemo)(()=>Su(i?.options??[]),[i?.options]),o=(0,L.useMemo)(()=>{let e=[...a],n=yu(t?.sessionType);return e.some(e=>e.value===n)||e.push({value:n,label:xu(n),icon:null,ready:!0,reason:null,reasonMessage:null,supportedModels:void 0,recommendedModel:null,modelSelectionMode:`nextclaw`,runtimeDefaultThinking:null,cta:null}),e.sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))},[a,t?.sessionType]),s=(0,L.useMemo)(()=>yu(i?.defaultType??`native`),[i?.defaultType]),c=(0,L.useRef)(null),l=typeof n==`string`&&n.trim().length>0?n:void 0,u=(0,L.useMemo)(()=>yu(t?.sessionType??l??s),[s,l,t?.sessionType]),d=(0,L.useMemo)(()=>o.find(e=>e.value===u)??null,[u,o]);(0,L.useEffect)(()=>{if(t)return;let e=typeof n==`string`?n.trim():``,i=yu(n);(e.length===0||c.current===i||c.current===null&&i===`native`)&&(c.current=s,i!==s&&r(s))},[s,n,t,r]);let f=!t||!!t.sessionTypeMutable,p=(0,L.useMemo)(()=>new Set(a.map(e=>e.value)),[a]),m=(0,L.useMemo)(()=>t&&!p.has(yu(t.sessionType))?!0:d?.ready===!1,[p,t,d?.ready]),h=(0,L.useMemo)(()=>t&&!p.has(yu(t.sessionType))?`${xu(u)} ${b(`chatSessionTypeUnavailableSuffix`)}`:d?.ready===!1?d.reasonMessage?.trim()||`${d.label} setup required`:null,[p,t,u,d]);return(0,L.useMemo)(()=>({sessionTypeOptions:o,selectedSessionTypeOption:d,defaultSessionType:s,selectedSessionType:u,canEditSessionType:f,sessionTypeUnavailable:m,sessionTypeUnavailableMessage:h}),[f,s,u,d,o,m,h])}var BQ=`nextclaw.chat.recent-selection.store`;function VQ(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function HQ(e,t){return Array.isArray(e)?Array.from(new Set(e.map(VQ).filter(e=>!!e))).slice(0,t):[]}function UQ(e,t){let n=VQ(t?.namespace);return n?`${e.storageKey}.${encodeURIComponent(n.toLowerCase())}`:e.storageKey}function WQ(e){if(!e||typeof e!=`object`)return{};let t={};for(let[n,r]of Object.entries(e)){let e=VQ(n);if(!e)continue;let i=HQ(r,1/0);i.length>0&&(t[e]=i)}return t}var GQ=x()(Zn(e=>({entriesByKey:{},setEntries:(t,n)=>e(e=>({entriesByKey:{...e.entriesByKey,[t]:HQ(n,1/0)}}))}),{name:BQ,storage:Qn(()=>window.localStorage),partialize:e=>({entriesByKey:e.entriesByKey}),merge:(e,t)=>({...t,entriesByKey:WQ(e?.entriesByKey)})})),KQ=class{constructor(e){this.options=e,this.read=(e={})=>{let t=UQ(this.options,e);return HQ(GQ.getState().entriesByKey[t],this.options.limit)},this.remember=(e,t={})=>{let n=VQ(e);if(!n)return this.read(t);let r=UQ(this.options,t),i=[n,...this.read(t).filter(e=>e!==n)].slice(0,this.options.limit);return GQ.getState().setEntries(r,i),i},this.resolveVisible=e=>{let t=HQ(e.availableValues,1/0);if(t.length<=e.minAvailableCount)return[];let n=new Set(t),r=[],i=Math.max(1,e.limit??this.options.limit);for(let t of this.read(e))if(!(!n.has(t)||r.includes(t))&&(r.push(t),r.length>=i))break;return r}}},qQ=new KQ({storageKey:`nextclaw.chat.recent-models`,limit:3}),JQ=[],YQ=[];function XQ(e){let{sessionKey:t,inputSnapshot:n,setPendingSessionType:r}=e,i=t??null,a=sd(),o=Uu(e=>e.snapshot),s=o.configQuery?.data??null,c=o.sessionsQuery?.data?.sessions??YQ,l=ou({sessionId:i?.trim()||`draft-session`,projectRoot:ml(n.pendingProjectRoot)}),u=l.data?.records??JQ,d=!!(l.isLoading||l.isFetching),f=(0,L.useMemo)(()=>ql(c),[c]),p=(0,L.useMemo)(()=>f.find(e=>e.key===i)??null,[i,f]),m=zQ({selectedSession:p,pendingSessionType:n.pendingSessionType,setPendingSessionType:r,sessionTypesData:o.sessionTypesQuery?.data??null}),h=(0,L.useMemo)(()=>kQ({config:s,providersView:o.providersQuery?.data??null,templatesView:o.providerTemplatesQuery?.data??null}),[s,o.providerTemplatesQuery?.data,o.providersQuery?.data]),g=(0,L.useMemo)(()=>AQ({modelOptions:h,modelSelectionMode:m.selectedSessionTypeOption?.modelSelectionMode,runtimeDefaultThinkingCapability:m.selectedSessionTypeOption?.runtimeDefaultThinking??null,runtimeDefaultModelLabel:b(`chatRuntimeDefaultModel`),supportedModels:m.selectedSessionTypeOption?.supportedModels}),[h,m.selectedSessionTypeOption?.modelSelectionMode,m.selectedSessionTypeOption?.runtimeDefaultThinking,m.selectedSessionTypeOption?.supportedModels]),_=(0,L.useMemo)(()=>new Set(g.map(e=>e.value)),[g]),v=qQ.read({namespace:m.selectedSessionType}).find(e=>_.has(e)),y=(0,L.useMemo)(()=>v??RQ({sessions:f,selectedSessionKey:i,sessionType:m.selectedSessionType,readPreference:e=>e.preferredModel?.trim()||void 0}),[v,i,m.selectedSessionType,f]),x=(0,L.useMemo)(()=>RQ({sessions:f,selectedSessionKey:i,sessionType:m.selectedSessionType,readPreference:e=>e.preferredThinking??void 0}),[i,m.selectedSessionType,f]),S=ml(s?.agents.defaults.workspace);return(0,L.useMemo)(()=>({defaultModel:m.selectedSessionTypeOption?.recommendedModel??s?.agents.defaults.model,defaultProjectRoot:S,fallbackPreferredModel:y,fallbackPreferredThinking:x,isProviderStateResolved:a,isSkillsLoading:d,modelOptions:g,selectedSession:p,selectedSessionKey:i,sessionTypeState:m,skillRecords:u}),[s?.agents.defaults.model,S,y,x,a,d,g,p,i,m,u])}var ZQ=({selectedModel:e,selectedThinkingLevel:t,updatePreferences:n})=>{let r=(0,L.useRef)(void 0),i=(0,L.useCallback)(e=>{n({selectedThinkingLevel:e})},[n]),a=(0,L.useCallback)(({defaultModel:i,fallbackPreferredModel:a,fallbackPreferredThinking:o,modelOptions:s,selectedSessionExists:c,selectedSessionKey:l,selectedSessionType:u,selectedSessionPreferredModel:d,selectedSessionPreferredThinking:f})=>{let p=l??null,m=JSON.stringify([u,p]),h=r.current!==m,g=h&&!!p&&!c,_=IQ({currentSelectedModel:e??void 0,modelOptions:s,selectedSessionPreferredModel:d,fallbackPreferredModel:a,defaultModel:i,preferSessionPreferredModel:h,preserveCurrentSelectedModelOnSessionChange:g}),v=s.find(e=>e.value===_),y=LQ({currentSelectedThinkingLevel:t,supportedThinkingLevels:v?.thinkingCapability?.supported??[],selectedSessionPreferredThinking:f,fallbackPreferredThinking:o,defaultThinkingLevel:v?.thinkingCapability?.default??null,preferSessionPreferredThinking:h,preserveCurrentSelectedThinkingOnSessionChange:g});(e!==_||t!==y)&&n({selectedModel:_,selectedThinkingLevel:y}),(!p||c)&&(r.current=m)},[e,t,n]);return(0,L.useMemo)(()=>({setSelectedThinkingLevel:i,syncSessionPreferences:a}),[i,a])},QQ={text:``,nodes:[],selectedSkills:[],skillRecords:[]},$Q=e=>{let t=e?.trim()??``;return{...t?{...QQ,text:t,nodes:nQ(t)}:QQ,attachments:[],selectedModel:void 0,selectedThinkingLevel:null,pendingSessionType:vu,selectedSessionType:vu,pendingProjectRoot:null,composerFocusRequestId:t?1:0,sendError:null}},e$=e=>e?.trim()||vu,t$=e=>[e.assetUri??``,e.url??``,e.name,e.mimeType,String(e.sizeBytes),e.contentBase64??``].join(`:`),n$=(e,t)=>{let n=new Set(e.map(t$)),r=[...e];return t.forEach(e=>{let t=t$(e);n.has(t)||(n.add(t),r.push(e))}),r},r$=e=>{let[t,n]=(0,L.useState)(()=>$Q(e)),r=(0,L.useCallback)(e=>{n(t=>{let n=typeof e==`function`?e(t):e;return{...t,...n}})},[]),i=(0,L.useCallback)(e=>{r({text:e.text,nodes:e.nodes,selectedSkills:e.selectedSkills,skillRecords:e.skillRecords,sendError:null})},[r]),a=(0,L.useCallback)(()=>{r({...QQ,attachments:[],sendError:null})},[r]),o=(0,L.useCallback)(e=>{r({...e})},[r]),s=(0,L.useCallback)(e=>{r({text:e,nodes:nQ(e),selectedSkills:[],skillRecords:[],sendError:null,composerFocusRequestId:Date.now()})},[r]),c=(0,L.useCallback)(()=>{r(e=>({composerFocusRequestId:e.composerFocusRequestId+1}))},[r]),l=(0,L.useCallback)(()=>{r({composerFocusRequestId:0})},[r]),u=(0,L.useCallback)(e=>{r({attachments:e})},[r]),d=(0,L.useCallback)(e=>{if(e.length===0)return[];let n=new Set(t.attachments.map(t$)),i=n$(t.attachments,e),a=i.filter(e=>!n.has(t$(e)));return a.length>0&&r({attachments:i}),a},[t.attachments,r]),f=(0,L.useCallback)(e=>{r(t=>({attachments:t.attachments.filter(t=>t.id!==e)}))},[r]),p=ZQ({selectedModel:t.selectedModel,selectedThinkingLevel:t.selectedThinkingLevel,updatePreferences:r}),m=(0,L.useCallback)(e=>{r(t=>{let n=e$(typeof e==`function`?e(t.pendingSessionType):e);return{pendingSessionType:n,selectedSessionType:n}})},[r]),h=(0,L.useCallback)(e=>{r({pendingProjectRoot:e})},[r]),g=(0,L.useCallback)((e,t)=>{r({selectedSkills:e,skillRecords:t,sendError:null})},[r]),_=(0,L.useCallback)(e=>{r({sendError:e})},[r]);return{inputSnapshot:t,inputActions:(0,L.useMemo)(()=>({update:r,syncComposer:i,resetComposer:a,restoreComposer:o,applyPromptSuggestion:s,requestComposerFocusAtEnd:c,consumeComposerFocusRequest:l,setAttachments:u,addAttachments:d,removeAttachment:f,...p,setPendingSessionType:m,setPendingProjectRoot:h,setSelectedSkills:g,setSendError:_}),[r,i,a,o,s,c,l,u,d,f,p,m,h,g,_])}},i$=`ncp-session-run-queue`;function a$(e){let t=Ke(),n=e?.trim()||null,r=O({queryKey:[i$,n],queryFn:()=>Je.sessions.listQueuedInputs(n),enabled:!!n,retry:!1,staleTime:5e3});(0,L.useEffect)(()=>{if(n)return Je.eventBus.on(T.sessionRunQueueUpdated,({sessionKey:e})=>{e===n&&t.invalidateQueries({queryKey:[i$,n],exact:!0})})},[n,t]);let i=(0,L.useCallback)(async e=>n?await Je.sessions.deleteQueuedInput(n,e):null,[n]);return{inputs:r.data?.inputs??[],isLoading:r.isLoading,removeQueuedInput:i}}var o$={exactId:1200,exactLabel:1150,prefixId:1e3,prefixLabel:950,prefixToken:900,containsId:800,containsLabel:760,containsDescription:500,subsequence:300,fallback:1};function s$(e){return(e??``).trim().toLowerCase()}function c$(e,t){if(!e||!t)return!1;let n=0;for(let r of t)if(r===e[n]&&(n+=1,n>=e.length))return!0;return!1}function l$(e,t){let n=s$(t);if(!n)return o$.fallback;let r=s$(e.id),i=s$(e.label||e.id),a=s$(e.description),o=(e.aliases??[]).map(s$).filter(Boolean),s=i.split(/[\s/_-]+/).filter(Boolean),c=[r,...o];return c.some(e=>e===n)?o$.exactId:i===n?o$.exactLabel:c.some(e=>e.startsWith(n))?o$.prefixId:i.startsWith(n)?o$.prefixLabel:s.some(e=>e.startsWith(n))?o$.prefixToken:c.some(e=>e.includes(n))?o$.containsId:i.includes(n)?o$.containsLabel:a.includes(n)?o$.containsDescription:c$(n,i)||c.some(e=>c$(n,e))?o$.subsequence:0}function u$(e){return e>=o$.exactLabel?4:e>=o$.prefixToken?3:e>=o$.containsLabel?2:e>0?1:0}var d$=`context-reference:navigate:files`,f$=`context-reference:navigate:root`,p$=`workspace`,m$=`panel-apps`,h$={key:`context-reference`,marker:`@`};function g$(e){return Date.parse(e.lastOpenedAt??e.updatedAt)||0}function _$(e){return e.split(/[\\/]+/).filter(Boolean).at(-1)??e}function v$(e){let t=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0});return e.entries.map((t,n)=>({entry:t,order:n,score:l$({id:t.appId,label:t.title||t.appId,description:t.description,aliases:[t.id,t.fileName]},e.query)})).filter(e=>e.score>0).sort((e,n)=>{let r=u$(e.score),i=u$(n.score);if(i!==r)return i-r;if(e.entry.favorite!==n.entry.favorite)return e.entry.favorite?-1:1;let a=g$(n.entry),o=g$(e.entry);return a===o?n.score===e.score?t.compare(e.entry.title||e.entry.appId,n.entry.title||n.entry.appId)||e.order-n.order:n.score-e.score:a-o}).map(({entry:e})=>e)}function y$(e){let t=e.keyPrefix??`panel-app`;return v$({entries:e.entries,query:e.query}).map(n=>({entry:n,item:{key:`${t}:${n.appId}`,icon:`panel-app`,title:n.title||n.appId,subtitle:e.texts.subtitle,description:(n.description??``).trim()||e.texts.noDescriptionLabel,detailLines:[`${e.texts.appIdLabel}: ${n.appId}`,`${e.texts.fileLabel}: ${n.fileName}`]}}))}function b$(e){return y$(e).map(({item:e})=>e)}function x$(e){return y$(e).map(({entry:t,item:n})=>({...n,sectionKey:m$,sectionLabel:e.sectionLabel,tokenKind:`panel_app`,tokenKey:t.appId,value:t.appId}))}function S$(e){let{kind:t,projectRoot:n,relativePath:r}=e,i=r.split(`/`).filter(Boolean);return{rootLabel:_$(n),segments:i.map((e,n)=>({label:e,kind:n===i.length-1?t:`directory`}))}}function C$(e){let t=_$(e.projectRoot);return e.entries.map(n=>{let r=e.navigateDirectories&&n.kind===`directory`;return{key:`workspace:${n.kind}:${n.relativePath}`,icon:n.kind===`directory`?`folder`:`file`,title:n.name,subtitle:n.parentRelativePath||t,description:n.kind===`directory`?e.texts.directoryDescription:e.texts.fileDescription,detailLines:[`${e.texts.projectRootLabel}: ${e.projectRoot}`,n.relativePath],sectionKey:p$,sectionLabel:e.texts.workspaceSectionLabel,value:n.relativePath,tokenKind:r?void 0:n.kind===`directory`?p:c,tokenKey:r?void 0:n.relativePath,selectionBehavior:r?`navigate`:void 0,pathPreview:S$({kind:n.kind,projectRoot:e.projectRoot,relativePath:n.relativePath})}})}function w$(e){let t=e.split(`/`).filter(Boolean);return t.length===0?null:t.slice(0,-1).join(`/`)}function T$(e){let{projectRoot:t,referencePath:n,texts:r}=e,i=n.split(`/`).filter(Boolean).at(-1)??n;return{key:`context-reference:current-directory:${n}`,icon:`folder`,title:r.currentDirectoryLabel,subtitle:i,description:r.directoryDescription,detailLines:[`${r.projectRootLabel}: ${t}`,n],sectionKey:p$,sectionLabel:r.workspaceSectionLabel,value:n,tokenKind:p,tokenKey:n,pathPreview:S$({kind:`directory`,projectRoot:t,relativePath:n})}}function E$(e){return{key:d$,icon:`files`,title:e.filesLabel,subtitle:e.filesSubtitle,description:e.filesDescription,detailLines:[],hintLabel:e.filesHintLabel,selectionBehavior:`navigate`}}function D$(e){let{referencePath:t,texts:n}=e,r=!t;return{key:f$,icon:`back`,title:r?n.backLabel:n.parentLabel,subtitle:``,description:r?n.backDescription:n.parentDescription,detailLines:[],hintLabel:r?n.backHintLabel:n.parentHintLabel,value:w$(t)??``,selectionBehavior:`navigate`}}function O$(e){return PU({key:`context-reference`,trigger:h$,resolvePanel:({data:t,trigger:n})=>{let r=t.referencePath!==null,i=r&&!n.query.trim(),a=C$({entries:t.serverPathEntries,navigateDirectories:i,projectRoot:t.projectRoot,texts:e.itemTexts.context}),o=i&&t.referencePath?T$({projectRoot:t.projectRoot,referencePath:t.referencePath,texts:e.itemTexts.context}):null,s=r?[D$({referencePath:t.referencePath??``,texts:e.itemTexts.context}),...o?[o]:[],...a]:[E$(e.itemTexts.context),...n.query?a:[],...x$({entries:t.panelApps,query:n.query,sectionLabel:e.itemTexts.context.panelAppSectionLabel,texts:e.itemTexts.panelApp})],c=r?t.isServerPathSearchLoading:t.isPanelAppsLoading||!!n.query&&t.isServerPathSearchLoading;return{isLoading:r?c:c&&s.length===0,items:s,notice:t.serverPathSearchError?{message:`${e.itemTexts.context.searchFailedLabel}: ${t.serverPathSearchError}`,tone:`error`}:void 0,onSelectItem:n=>{n.key===d$?e.onNavigate(``):n.key===f$?e.onNavigate(t.referencePath?n.value??``:null):n.selectionBehavior===`navigate`&&n.value&&e.onNavigate(n.value)},texts:e.menuTexts}}})}function k$(e){let t=e.modelLabel.trim(),n=e.providerLabel.trim();return n?`${n}/${t}`:t}function A$(e){let t=[];for(let n of[`off`,...e])t.includes(n)||t.push(n);return t}function j$(e){let{isModelOptionsEmpty:t,isModelOptionsLoading:n,onGoToProviders:r,texts:i}=e;return!n&&!t?null:n?{tone:`neutral`,loading:!0}:{tone:`warning`,text:i.noModelOptionsLabel,actionLabel:i.configureProviderLabel,onAction:r}}function M$({modelOptions:e,favoriteModelValues:t,recentModelValues:n,selectedModel:r,isModelOptionsLoading:i,hasModelOptions:a,onFavoriteToggle:o,onValueChange:s,texts:c}){let l=e.find(e=>e.value===r)??e[0],u=a?l?.value:void 0,d=new Map(e.map(e=>[e.value,e])),f=(t??[]).map(e=>d.get(e)).filter(e=>!!e),p=new Set(f.map(e=>e.value)),m=(n??[]).map(e=>d.get(e)).filter(e=>e!==void 0&&!p.has(e.value)),h=new Set(m.map(e=>e.value)),g=e.filter(e=>!p.has(e.value)&&!h.has(e.value)),_=f.length>0||m.length>0?[{key:`favorite-models`,label:c.favoriteModelsLabel,options:f.map(e=>({value:e.value,label:k$(e)}))},{key:`recent-models`,label:c.recentModelsLabel,options:m.map(e=>({value:e.value,label:k$(e)}))},{key:`all-models`,label:c.allModelsLabel,options:g.map(e=>({value:e.value,label:k$(e)}))}].filter(e=>e.options.length>0):void 0;return{key:`model`,value:u,placeholder:c.modelSelectPlaceholder,selectedLabel:l?k$(l):void 0,icon:`sparkles`,options:e.map(e=>({value:e.value,label:k$(e)})),groups:_,disabled:!a,loading:i,emptyLabel:c.modelNoOptionsLabel,search:{placeholder:c.modelSearchPlaceholder,emptyLabel:c.modelSearchEmptyLabel},optionAction:o?{kind:`favorite`,activeValues:f.map(e=>e.value),activeLabel:c.unfavoriteModelLabel,inactiveLabel:c.favoriteModelLabel,onToggle:o}:void 0,onValueChange:s}}function N$(e){let{defaultThinkingLevel:t,onValueChange:n,selectedThinkingLevel:r,supportedLevels:i,texts:a}=e;if(i.length===0)return null;let o=A$(i),s=o.includes(`off`)?`off`:o[0],c=r&&o.includes(r)&&r||t&&o.includes(t)&&t||s;return{key:`thinking`,value:c,placeholder:a.thinkingLabels[c],selectedLabel:a.thinkingLabels[c],icon:`brain`,options:o.map(e=>({value:e,label:a.thinkingLabels[e]})),onValueChange:e=>n(e)}}var P$={exactSpec:1200,exactLabel:1150,prefixSpec:1e3,prefixLabel:950,prefixToken:900,containsSpec:800,containsLabel:760,containsDescription:500,subsequence:300,fallback:1};function F$(e){return(e??``).trim().toLowerCase()}function I$(e,t){if(!e||!t)return!1;let n=0;for(let r of t)if(r===e[n]&&(n+=1,n>=e.length))return!0;return!1}function L$(e,t){let n=F$(t);if(!n)return P$.fallback;let r=F$(e.key),i=F$(e.label||e.key),a=F$(`${e.descriptionZh??``} ${e.description??``}`),o=i.split(/[\s/_-]+/).filter(Boolean);return r===n?P$.exactSpec:i===n?P$.exactLabel:r.startsWith(n)?P$.prefixSpec:i.startsWith(n)?P$.prefixLabel:o.some(e=>e.startsWith(n))?P$.prefixToken:r.includes(n)?P$.containsSpec:i.includes(n)?P$.containsLabel:a.includes(n)?P$.containsDescription:I$(n,i)||I$(n,r)?P$.subsequence:0}function R$(e){return e>=P$.exactLabel?4:e>=P$.prefixToken?3:e>=P$.containsLabel?2:e>0?1:0}function z$(e){return new Map(e.map((e,t)=>[e,t]))}function B$(e,t){let n=z$(t),r=[],i=[];for(let t of e){if(n.has(t.key)){r.push(t);continue}i.push(t)}return r.sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0)),[...r,...i]}function V$(e,t,n,r=[]){let i=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0}),a=z$(r),o=new Map;for(let t of e){let e=t.groupKey?.trim();e&&!o.has(e)&&o.set(e,o.size)}return e.map((e,n)=>({record:e,order:n,score:L$(e,t)})).filter(e=>e.score>0).sort((e,t)=>{let n=o.get(e.record.groupKey?.trim()??``)??1/0,r=o.get(t.record.groupKey?.trim()??``)??1/0;if(n!==r)return n-r;let s=R$(e.score),c=R$(t.score);if(c!==s)return c-s;let l=a.get(e.record.key)??1/0,u=a.get(t.record.key)??1/0;if(l!==u)return l-u;if(t.score!==e.score)return t.score-e.score;let d=(e.record.label||e.record.key).trim(),f=(t.record.label||t.record.key).trim(),p=i.compare(d,f);return p===0?e.order-t.order:p}).map(({record:e})=>({key:`skill:${e.key}`,title:e.label||e.key,subtitle:n.slashSkillSubtitle,description:(e.descriptionZh??e.description??``).trim()||n.noSkillDescription,detailLines:[`${n.slashSkillSpecLabel}: ${e.key}`,...e.scopeLabel?[`${n.slashSkillScopeLabel}: ${e.scopeLabel}`]:[]],sectionKey:e.groupKey,sectionLabel:e.groupLabel,tokenKind:`skill`,tokenKey:e.key,value:e.key}))}function H$(e){return e.map(e=>({key:e.key,label:e.label,description:e.descriptionZh||e.description||``,badgeLabel:e.badgeLabel}))}function U$(e){let{allSkillsLabel:t,recentKeySet:n,recentSkillsLabel:r,skillRecords:i}=e,a=i.filter(e=>n.has(e.key)),o=new Map;for(let e of i){if(n.has(e.key))continue;let r=e.groupKey?.trim()||`all-skills`,i=e.groupLabel?.trim()||t,a=o.get(r)??{label:i,records:[]};a.records.push(e),o.set(r,a)}let s=[...o].map(([e,t])=>({key:e,label:t.label,options:H$(t.records)})),c=s.some(e=>e.key!==`all-skills`);if(!(a.length===0&&!c))return[...a.length>0?[{key:`recent-skills`,label:r,options:H$(a)}]:[],...s].filter(e=>e.options.length>0)}function W$(e){let{groupedRecentSkillValues:t,isLoading:n,onSelectedKeysChange:r,recentSkillValues:i,selectedSkills:a,skillRecords:o,texts:s}=e,c=B$(o,i??[]),l=new Set(t??[]);return{title:s.title,allGroupsLabel:s.allSkillsLabel,searchPlaceholder:s.searchPlaceholder,emptyLabel:s.emptyLabel,loadingLabel:s.loadingLabel,isLoading:n,manageLabel:s.manageLabel,manageHref:`/marketplace/skills`,options:H$(c),groups:U$({skillRecords:c,recentKeySet:l,recentSkillsLabel:s.recentSkillsLabel,allSkillsLabel:s.allSkillsLabel}),selectedKeys:a,onSelectedKeysChange:r}}var G$=`commands`,K$=`panel-app-action`,q$=`panel-apps`,J$=`skills`;function Y$(e){let t=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0});return e.commands.map((t,n)=>({command:t,order:n,score:l$({id:t.key,label:t.title,description:t.description,aliases:t.keywords},e.query)})).filter(e=>e.score>0).sort((e,n)=>{let r=u$(e.score),i=u$(n.score);return i===r?n.score===e.score?t.compare(e.command.title,n.command.title)||e.order-n.order:n.score-e.score:i-r}).map(({command:t})=>({key:`command:${t.key}`,icon:`command`,title:t.title,subtitle:e.texts.commandSubtitle,description:t.description,detailLines:[...t.detailLines??[]],hintLabel:e.texts.commandHintLabel,sectionKey:G$,sectionLabel:e.texts.commandSectionLabel}))}function X$(e){let{data:t,itemTexts:n,query:r,skillHintLabel:i,skillSectionLabel:a}=e;return V$([...t.skillRecords],r,n,[...t.recentSkillValues]).map(e=>({...e,icon:`skill`,hintLabel:i,sectionKey:e.sectionKey?`${J$}:${e.sectionKey}`:J$,sectionLabel:e.sectionLabel||a}))}function Z$(e){return b$({entries:e.data.panelApps,keyPrefix:K$,query:e.query,texts:e.itemTexts}).map(t=>({...t,icon:`panel-app`,hintLabel:e.panelAppHintLabel,sectionKey:q$,sectionLabel:e.panelAppSectionLabel}))}function Q$(e){let t=`${K$}:`;return e.key.startsWith(t)?e.key.slice(t.length):null}function $$(e){return PU({key:`slash-command`,trigger:hg,resolvePanel:t=>{let{data:n,trigger:r}=t,i=X$({data:n,itemTexts:e.itemTexts.skillTexts,query:r.query,skillHintLabel:e.labels.skillHintLabel,skillSectionLabel:e.labels.skillSectionLabel}),a=[...new Set(i.flatMap(e=>e.sectionKey?[e.sectionKey]:[]))];return{filterOptions:[{key:`all`,label:e.labels.filterAllLabel},{key:G$,label:e.labels.filterCommandsLabel,sectionKeys:[G$]},{key:J$,label:e.labels.filterSkillsLabel,sectionKeys:a.length>0?a:[J$]},{key:q$,label:e.labels.filterPanelAppsLabel,sectionKeys:[q$]}],isLoading:n.isPanelAppsLoading||n.isSkillsLoading,items:[...Y$({commands:e.commands,query:r.query,texts:{commandHintLabel:e.labels.commandHintLabel,commandSectionLabel:e.labels.commandSectionLabel,commandSubtitle:e.labels.commandSubtitle}}),...i,...Z$({data:n,itemTexts:e.itemTexts.panelAppTexts,panelAppHintLabel:e.labels.panelAppHintLabel,panelAppSectionLabel:e.labels.panelAppSectionLabel,query:r.query})],onSelectItem:t=>{if(t.key.startsWith(`command:`)){e.commands.find(e=>t.key===`command:${e.key}`)?.onSelect();return}let n=Q$(t);if(n){e.onSelectPanelApp(n);return}let r=t.tokenKey??t.value;r&&e.onSelectSkill?.(r)},texts:e.menuTexts}}})}function e1(e){return[`server-path-search`,e.basePath.trim(),e.query?.trim()??``,e.limit??null]}function t1(e){let{enabled:t,limit:n}=e,r=e.basePath.trim(),i=e.query?.trim()??``;return O({queryKey:e1({basePath:r,query:i,limit:n}),queryFn:()=>Ce({basePath:r,query:i,limit:n}),enabled:(t??!0)&&!!r,staleTime:5e3})}function n1(e){let{commands:t,language:n,onNavigate:r,onSelectPanelApp:i,onSelectSkill:a,slashTexts:o}=e,s={appIdLabel:b(`chatPanelAppReferenceAppId`,n),fileLabel:b(`chatPanelAppReferenceFile`,n),noDescriptionLabel:b(`chatPanelAppReferenceNoDescription`,n),subtitle:b(`chatPanelAppReferenceType`,n)};return[$$({commands:t,itemTexts:{panelAppTexts:s,skillTexts:o},menuTexts:{loadingLabel:b(`chatSlashLoading`,n),sectionLabel:b(`chatSlashSection`,n),emptyLabel:b(`chatSlashNoResult`,n),hintLabel:b(`chatSlashHint`,n),itemHintLabel:b(`chatSlashSkillHint`,n)},labels:{commandHintLabel:b(`chatSlashCommandHint`,n),commandSectionLabel:b(`chatSlashSectionCommands`,n),commandSubtitle:b(`chatSlashTypeCommand`,n),filterAllLabel:b(`chatSlashFilterAll`,n),filterCommandsLabel:b(`chatSlashFilterCommands`,n),filterPanelAppsLabel:b(`chatSlashFilterPanelApps`,n),filterSkillsLabel:b(`chatSlashFilterSkills`,n),panelAppHintLabel:b(`chatSlashPanelAppHint`,n),panelAppSectionLabel:b(`chatPanelAppReferenceSection`,n),skillHintLabel:b(`chatSlashSkillHint`,n),skillSectionLabel:b(`chatSlashSectionSkills`,n)},onSelectPanelApp:i,onSelectSkill:a}),O$({itemTexts:{context:{backLabel:b(`chatContextReferenceBack`,n),backDescription:b(`chatContextReferenceBackDescription`,n),backHintLabel:b(`chatContextReferenceBackHint`,n),currentDirectoryLabel:b(`chatContextReferenceCurrentDirectory`,n),directoryDescription:b(`chatContextReferenceDirectoryDescription`,n),fileDescription:b(`chatContextReferenceFileDescription`,n),filesDescription:b(`chatContextReferenceFilesDescription`,n),filesHintLabel:b(`chatContextReferenceFilesHint`,n),filesLabel:b(`chatContextReferenceFilesLabel`,n),filesSubtitle:b(`chatContextReferenceFilesType`,n),panelAppSectionLabel:b(`chatPanelAppReferenceSection`,n),parentLabel:b(`chatContextReferenceParent`,n),parentDescription:b(`chatContextReferenceParentDescription`,n),parentHintLabel:b(`chatContextReferenceParentHint`,n),projectRootLabel:b(`chatContextReferenceProjectRoot`,n),searchFailedLabel:b(`chatContextReferenceSearchFailed`,n),workspaceSectionLabel:b(`chatContextReferenceWorkspaceSection`,n)},panelApp:s},menuTexts:{loadingLabel:b(`chatContextReferenceLoading`,n),sectionLabel:b(`chatContextReferenceSection`,n),emptyLabel:b(`chatContextReferenceNoResult`,n),hintLabel:b(`chatContextReferenceHint`,n),itemHintLabel:b(`chatContextReferenceItemHint`,n)},onNavigate:r})]}function r1(e){let t=e.parentRelativePath.split(`/`).filter(Boolean).join(`/`);return e.entries.map(e=>({name:e.name,path:e.path,relativePath:[t,e.name].filter(Boolean).join(`/`),parentRelativePath:t,kind:e.kind,hidden:e.hidden}))}function i1(e){let{isSkillsLoading:t,itemTexts:n,language:r,onSelectPanelApp:i,onSelectSkill:a,projectRoot:o,recentSkillValues:s,skillRecords:c,commands:l}=e,[u,d]=(0,L.useState)(null),[f,p]=(0,L.useState)(null),m=(0,L.useRef)(`null`),h=(0,L.useCallback)(e=>{let t=JSON.stringify(e?[e.key,e.marker,e.query,e.start,e.end]:null);m.current!==t&&(m.current=t,e||d(null),p(e))},[]),g=f?.key===h$.key,_=(0,L.useDeferredValue)(g?f.query:``),v=!!(g&&o&&u!==null&&!_.trim()),y=!!(g&&o&&_.trim()),b=Ic({path:u||`.`,basePath:o,includeFiles:!0,enabled:v}),x=t1({basePath:o,query:_,enabled:y}),S=v?b:x,C=(0,L.useMemo)(()=>v?r1({entries:b.data?.entries??[],parentRelativePath:u??``}):x.data?.entries??[],[v,u,b.data?.entries,x.data?.entries]),w=Nq({enabled:g||f?.key===hg.key}),T=(0,L.useMemo)(()=>n1({commands:l,language:r,onNavigate:d,onSelectPanelApp:i,onSelectSkill:a,slashTexts:n.slashTexts}),[l,n.slashTexts,r,i,a]);return{inputSurfaceState:(0,L.useMemo)(()=>FU({data:{isPanelAppsLoading:w.isLoading||w.isFetching,isServerPathSearchLoading:S.isLoading||S.isFetching,isSkillsLoading:t,panelApps:w.data?.entries??[],projectRoot:o,recentSkillValues:s,referencePath:u,serverPathEntries:C,serverPathSearchError:S.error instanceof Error?S.error.message:null,skillRecords:c},plugins:T,trigger:f}),[T,f,w.data?.entries,w.isFetching,w.isLoading,o,S.error,S.isFetching,S.isLoading,u,C,t,s,c]),setInputSurfaceTrigger:h}}var a1=xe.chat.modelFavorites,o1=[`preference`,a1];function s1(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();e&&!t.includes(e)&&t.push(e)}return t}function c1(e){let t=Ke(),n=(0,L.useMemo)(()=>new Set(e),[e]),r=O({queryKey:o1,queryFn:()=>qe(a1),staleTime:3e4}),i=(0,L.useMemo)(()=>s1(r.data?.value),[r.data?.value]),a=(0,L.useMemo)(()=>i.filter(e=>n.has(e)),[n,i]),o=le({mutationFn:async e=>await Qe(a1,e),onMutate:async e=>{await t.cancelQueries({queryKey:o1});let n=t.getQueryData(o1);return t.setQueryData(o1,{key:a1,value:e,updatedAt:new Date().toISOString()}),{previous:n}},onError:(e,n,r)=>{r?.previous&&t.setQueryData(o1,r.previous)},onSuccess:e=>{t.setQueryData(o1,e)}}),s=(0,L.useCallback)((e,t)=>{let n=e.trim();if(!n)return;let r=t?[n,...i.filter(e=>e!==n)]:i.filter(e=>e!==n);o.mutate(r)},[i,o]);return{favoriteModelValues:a,isLoading:r.isLoading,setModelFavorite:s}}var l1=new KQ({storageKey:`nextclaw.chat.recent-skills`,limit:5});function u1(e){let{addAttachments:t,attachmentSupported:n,inputBarRef:r}=e,i=(0,L.useCallback)(e=>{if(e===`unsupported-type`){P.error(b(`chatInputAttachmentUnsupported`));return}if(e===`too-large`){P.error(b(`chatInputAttachmentTooLarge`).replace(`{maxMb}`,String(pZ/(1024*1024))));return}P.error(b(`chatInputAttachmentReadFailed`))},[]),a=(0,L.useCallback)(async e=>{if(!n||e.length===0)return;let a=await vZ(e,{uploadBatch:Pe});if(a.attachments.length>0){let e=t(a.attachments);e.length>0&&r.current?.insertFileTokens(e.map(e=>({tokenKey:e.id,label:e.name})))}a.rejected.length>0&&i(a.rejected[0].reason)},[t,n,r,i]);return{handleFilesAdd:a,handleFileInputChange:(0,L.useCallback)(async e=>{let t=Array.from(e.target.files??[]);e.currentTarget.value=``,await a(t)},[a])}}function d1(e){let{language:t,onContextCompactingChange:n,selectedSessionKey:r}=e,i=rl(),a=(0,L.useRef)(new Set),o=(0,L.useCallback)(async e=>{if(!a.current.has(e)){a.current.add(e),n?.(e,!0);try{await A(e),P.success(b(`chatSlashCommandCompactContextSuccess`,t))}catch(e){let n=e instanceof Error?e.message:String(e);P.error(`${b(`chatSlashCommandCompactContextFailed`,t)}: ${n}`)}finally{a.current.delete(e),n?.(e,!1)}}},[t,n]);return(0,L.useMemo)(()=>{let e=r?.trim();return e?[{key:`side-chat`,title:b(`chatSlashCommandSideChatTitle`,t),description:b(`chatSlashCommandSideChatDescription`,t),detailLines:[b(`chatSlashCommandSideChatDetail`,t)],keywords:[`side`,`chat`,`child`,`branch`,`new`],onSelect:()=>i.chatThreadManager.openSideChatDraft(e)},{key:`compact-context`,title:b(`chatSlashCommandCompactContextTitle`,t),description:b(`chatSlashCommandCompactContextDescription`,t),detailLines:[b(`chatSlashCommandCompactContextDetail`,t)],keywords:[`compact`,`compress`,`context`,`summary`,`压缩`,`上下文`],onSelect:()=>void o(e)}]:[]},[o,t,i.chatThreadManager,r])}function f1(){return{off:b(`chatThinkingLevelOff`),minimal:b(`chatThinkingLevelMinimal`),low:b(`chatThinkingLevelLow`),medium:b(`chatThinkingLevelMedium`),high:b(`chatThinkingLevelHigh`),adaptive:b(`chatThinkingLevelAdaptive`),xhigh:b(`chatThinkingLevelXhigh`)}}function p1(e){let{allModelsLabel:t,favoriteModelLabel:n,favoriteModelValues:r,favoriteModelsLabel:i,hasModelOptions:a,isModelOptionsLoading:o,modelRecords:s,modelSearchEmptyLabel:c,modelSearchPlaceholder:l,onFavoriteModelToggle:u,onModelChange:d,onThinkingChange:f,recentModelValues:p,recentModelsLabel:m,selectedModel:h,selectedThinkingLevel:g,thinkingDefaultLevel:_,thinkingSupportedLevels:v,unfavoriteModelLabel:y}=e;return[M$({modelOptions:s,favoriteModelValues:r,recentModelValues:p,selectedModel:h,isModelOptionsLoading:o,hasModelOptions:a,onFavoriteToggle:u,onValueChange:d,texts:{modelSelectPlaceholder:b(`chatSelectModel`),modelNoOptionsLabel:b(`chatModelNoOptions`),modelSearchPlaceholder:l,modelSearchEmptyLabel:c,favoriteModelsLabel:i,favoriteModelLabel:n,unfavoriteModelLabel:y,recentModelsLabel:m,allModelsLabel:t}}),N$({supportedLevels:v,selectedThinkingLevel:g,defaultThinkingLevel:_,onValueChange:f,texts:{thinkingLabels:f1()}})].filter(e=>e!==null)}function m1(e){let{allSkillsLabel:t,isSkillsLoading:n,onSelectedKeysChange:r,recentSkillGroupValues:i,recentSkillValues:a,recentSkillsLabel:o,selectedSkills:s,skillRecords:c}=e;return W$({skillRecords:c,recentSkillValues:a,groupedRecentSkillValues:i,selectedSkills:[...s],isLoading:n,onSelectedKeysChange:r,texts:{title:b(`chatSkillsPickerTitle`),searchPlaceholder:b(`chatSkillsPickerSearchPlaceholder`),emptyLabel:b(`chatSkillsPickerEmpty`),loadingLabel:b(`sessionsLoading`),manageLabel:b(`chatSkillsPickerManage`),recentSkillsLabel:o,allSkillsLabel:t}})}function h1(e,t){let n=e?.thinkingCapability;return!n||n.supported.length===0?null:t===`off`?`off`:t&&n.supported.includes(t)?t:n.default&&n.supported.includes(n.default)?n.default:`off`}function g1({children:e,disabled:t=!1,label:n,onClick:r}){return(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(`span`,{className:`inline-flex`,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":n,disabled:t,onClick:r,className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed disabled:text-muted-foreground/50`,children:e})})}),(0,R.jsx)(Lt,{side:`top`,children:n})]})}function _1({controller:e}){return e.queuedInputs.length===0?null:(0,R.jsx)(Bt,{delayDuration:120,children:(0,R.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:e.queuedInputs.map(t=>(0,R.jsxs)(`div`,{className:`flex min-h-8 min-w-0 items-center gap-2 text-sm`,children:[(0,R.jsx)(Bo,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-foreground/80`,children:t.preview||b(`chatQueuedBannerAttachmentFallback`)}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,R.jsx)(g1,{label:b(`chatQueuedEdit`),onClick:()=>e.editQueuedInput(t.id),children:(0,R.jsx)(Ps,{className:`h-4 w-4`})}),(0,R.jsx)(g1,{label:b(`chatQueuedDelete`),onClick:()=>e.deleteQueuedInput(t.id),children:(0,R.jsx)(Kn,{className:`h-4 w-4`})})]})]},t.id))})})}function v1(e,t,n){return e.map(e=>({key:e.ref,label:e.name,scopeLabel:t[e.source],groupKey:e.source,groupLabel:n[e.source],description:e.description,descriptionZh:e.descriptionZh,badgeLabel:t[e.source]}))}function y1(e){return e.map(e=>({value:e.value,modelLabel:e.modelLabel,providerLabel:e.providerLabel,thinkingCapability:e.thinkingCapability?{supported:e.thinkingCapability.supported,default:e.thinkingCapability.default??null}:null}))}function b1(e){let{skillGroupLabels:t,skillScopeLabels:n}=(0,L.useMemo)(()=>({skillScopeLabels:{builtin:b(`chatSkillScopeBuiltin`),global:b(`chatSkillScopeGlobal`),project:b(`chatSkillScopeProject`),workspace:b(`chatSkillScopeWorkspace`)},skillGroupLabels:{builtin:b(`chatSkillGroupBuiltin`),global:b(`chatSkillGroupGlobal`),project:b(`chatSkillGroupProject`),workspace:b(`chatSkillGroupWorkspace`)}}),[e]);return{skillScopeLabels:n,skillGroupLabels:t,slashTexts:(0,L.useMemo)(()=>({slashSkillSubtitle:b(`chatSlashTypeSkill`),slashSkillSpecLabel:b(`chatSlashSkillSpec`),slashSkillScopeLabel:b(`chatSlashSkillScope`),noSkillDescription:b(`chatSkillsPickerNoDescription`)}),[e]),recentModelsLabel:b(`chatPickerRecentModels`),allModelsLabel:b(`chatPickerAllModels`),favoriteModelsLabel:b(`chatPickerFavoriteModels`),modelSearchPlaceholder:b(`chatModelSearchPlaceholder`),modelSearchEmptyLabel:b(`chatModelSearchEmpty`),favoriteModelLabel:b(`chatFavoriteModel`),unfavoriteModelLabel:b(`chatUnfavoriteModel`),recentSkillsLabel:b(`chatPickerRecent`),allSkillsLabel:b(`chatPickerAllSkills`)}}function x1(e){let{modelOptions:t,skillGroupLabels:n,skillRecords:r,skillScopeLabels:i}=e,a=(0,L.useMemo)(()=>v1(r,i,n),[n,i,r]),o=(0,L.useMemo)(()=>y1(t),[t]);return{skillRecords:a,modelRecords:o,recentModelValues:qQ.resolveVisible({availableValues:o.map(e=>e.value),minAvailableCount:5}),recentSkillValues:l1.resolveVisible({availableValues:a.map(e=>e.key),minAvailableCount:0}),recentSkillGroupValues:l1.resolveVisible({availableValues:a.map(e=>e.key),minAvailableCount:4})}}var S1=(0,L.memo)(function(e){let{contextWindow:t,controller:n,inputActions:r,inputQuery:i,inputSnapshot:a,onContextCompactingChange:o,surface:s=`default`}=e,c=rl(),{language:l}=vn(),u=EY(e=>e.layout),{isMobile:d}=Hn(),f=(0,L.useRef)(null),p=(0,L.useRef)(null),m=b1(l),{skillRecords:h,modelRecords:g,recentModelValues:_,recentSkillValues:v,recentSkillGroupValues:y}=x1({modelOptions:i.modelOptions,skillRecords:i.skillRecords,skillGroupLabels:m.skillGroupLabels,skillScopeLabels:m.skillScopeLabels}),x=d1({language:l,onContextCompactingChange:o,selectedSessionKey:i.selectedSessionKey}),S=(0,L.useCallback)(e=>void c.chatUiManager.showContent({target:{type:`panel_app`,payload:{appId:e}}}),[c.chatUiManager]),C=i.selectedSessionKey?i.selectedSession?.projectRoot??i.defaultProjectRoot??``:a.pendingProjectRoot??i.defaultProjectRoot??``,{inputSurfaceState:w,setInputSurfaceTrigger:T}=i1({commands:x,isSkillsLoading:i.isSkillsLoading,itemTexts:{slashTexts:m.slashTexts},language:l,onSelectPanelApp:S,onSelectSkill:l1.remember,projectRoot:C,recentSkillValues:v,skillRecords:h}),{favoriteModelValues:D,setModelFavorite:O}=c1((0,L.useMemo)(()=>g.map(e=>e.value),[g])),k=a.selectedModel??``,A=a.selectedThinkingLevel,ee={isProviderStateResolved:i.isProviderStateResolved,modelOptions:i.modelOptions,sessionTypeUnavailable:i.sessionTypeState.sessionTypeUnavailable},j=lQ(ee),M=uQ(ee),N=dQ(ee),te=fQ(ee),ne=b(N?`chatModelNoOptions`:d?`chatInputPlaceholderCompact`:`chatInputPlaceholder`),re=g.find(e=>e.value===k),ie=re?.thinkingCapability?.supported??[],{handleFilesAdd:ae,handleFileInputChange:oe}=u1({attachmentSupported:!0,inputBarRef:f,addAttachments:r.addAttachments}),ce=(0,L.useCallback)(e=>{!i.selectedSessionKey||!i.selectedSession||se(i.selectedSessionKey,e).catch(()=>void 0)},[i.selectedSession,i.selectedSessionKey]),le=(0,L.useCallback)(e=>{let t=[...e];r.update(e=>({nodes:t,attachments:sQ(t,e.attachments),text:rQ(t),selectedSkills:iQ(t),sendError:null}))},[r]),ue=(0,L.useCallback)(e=>{let t=h1(g.find(t=>t.value===e),A);r.update({selectedModel:e,selectedThinkingLevel:t,sendError:null}),qQ.remember(e,{namespace:i.sessionTypeState.selectedSessionType}),E(e)||qQ.remember(e),ce({preferredModel:E(e)?null:e,preferredThinking:t})},[r,i.sessionTypeState.selectedSessionType,g,A,ce]),de=(0,L.useCallback)(e=>{r.setSelectedThinkingLevel(e),ce({preferredThinking:e})},[r,ce]),fe=(0,L.useCallback)(e=>{let t=a.selectedSkills;e.filter(e=>!t.includes(e)).forEach(e=>l1.remember(e)),le(oQ([...a.nodes],e,i.skillRecords.map(e=>({ref:e.ref,name:e.name}))))},[le,i.skillRecords,a.nodes,a.selectedSkills]);(0,L.useEffect)(()=>{a.composerFocusRequestId&&(f.current?.focusComposerAtEnd([...a.nodes]),r.consumeComposerFocusRequest())},[r,a.composerFocusRequestId,a.nodes]);let pe=p1({allModelsLabel:m.allModelsLabel,favoriteModelLabel:m.favoriteModelLabel,favoriteModelValues:D,favoriteModelsLabel:m.favoriteModelsLabel,hasModelOptions:j,isModelOptionsLoading:M,modelRecords:g,modelSearchEmptyLabel:m.modelSearchEmptyLabel,modelSearchPlaceholder:m.modelSearchPlaceholder,onFavoriteModelToggle:O,onModelChange:ue,onThinkingChange:de,recentModelValues:_,recentModelsLabel:m.recentModelsLabel,selectedModel:k,selectedThinkingLevel:A,thinkingSupportedLevels:ie,thinkingDefaultLevel:re?.thinkingCapability?.default??null,unfavoriteModelLabel:m.unfavoriteModelLabel}),me=m1({allSkillsLabel:m.allSkillsLabel,onSelectedKeysChange:fe,recentSkillGroupValues:y,recentSkillValues:v,recentSkillsLabel:m.recentSkillsLabel,isSkillsLoading:i.isSkillsLoading,skillRecords:h,selectedSkills:a.selectedSkills}),he=(0,L.useMemo)(()=>[...a.nodes],[a.nodes]),ge=s===`default`&&u===`flat`,_e=(0,R.jsx)(EO,{ref:f,surface:ge?`embedded`:s,sendError:a.sendError,sendErrorDetailsLabel:b(`chatErrorDetails`,l),topSlot:n.queuedInputs.length>0?(0,R.jsx)(_1,{controller:n}):null,composer:{nodes:he,placeholder:ne,disabled:te,onNodesChange:le,onFilesAdd:ae,inputSurfaceTriggerSpecs:w.triggerSpecs,onInputSurfaceTriggerChange:T},inputSurface:w.panel??void 0,hint:j$({isModelOptionsLoading:M,isModelOptionsEmpty:N,onGoToProviders:c.chatUiManager.goToProviders,texts:{noModelOptionsLabel:b(`chatModelNoOptions`),configureProviderLabel:b(`chatGoConfigureProvider`)}}),toolbar:{selects:[],trailingSelects:pe,accessories:[{key:`attach`,label:b(`chatInputAttach`),icon:`paperclip`,iconOnly:!0,disabled:te,onClick:()=>p.current?.click()}],skillPicker:me,actions:{isSending:n.isSending,canStopGeneration:n.canStopGeneration,sendDisabled:n.sendDisabled,stopDisabled:n.stopDisabled,stopHint:b(`chatStopUnavailable`),sendButtonLabel:n.isSending?b(`chatQueueSend`):b(`chatSend`),stopButtonLabel:b(`chatStop`),contextWindow:t,onSend:n.send,onStop:n.stop}}});return(0,R.jsxs)(R.Fragment,{children:[ge?(0,R.jsx)(fX,{className:`pb-4 pt-2`,width:`composer`,children:_e}):_e,(0,R.jsx)(`input`,{ref:p,type:`file`,multiple:!0,className:`hidden`,onChange:oe})]})});function C1(e){let{applyPromptSuggestion:t,consumeDraftIntent:n}=e,r=s6(),i=rl();(0,L.useEffect)(()=>{if(!n)return;let e=e=>{i.chatSessionListManager.createSession(),i.chatSessionListManager.setSelectedAgentId(`main`),t(e.prompt),r.chatDraftIntentManager.markConsumed(e.id)},a=r.chatDraftIntentManager.subscribe(e),o=r.chatDraftIntentManager.consumePending();return o&&e(o),a},[r,t,n,i])}function w1(e){if(!e||typeof e!=`object`)return null;let t=e.chatDraft;return!t||typeof t!=`object`?null:t}function T1(e){let{sessionKey:t,setPendingProjectRoot:n,setPendingSessionType:r}=e,i=Ai(),a=(0,L.useRef)(null);(0,L.useEffect)(()=>{if(t)return;let e=w1(i.state);if(!e)return;let o=[i.key,typeof e.sessionType==`string`?e.sessionType:``,typeof e.projectRoot==`string`?e.projectRoot:``,typeof e.prompt==`string`?e.prompt:``].join(`:`);a.current!==o&&(a.current=o,typeof e.sessionType==`string`&&e.sessionType.trim()&&r(e.sessionType),n(typeof e.projectRoot==`string`&&e.projectRoot.trim()?e.projectRoot:null))},[i.key,i.state,t,n,r])}function E1({inputQuery:e}){let t=rl(),n=e.isProviderStateResolved&&e.modelOptions.length===0,r=e.sessionTypeState.sessionTypeUnavailableMessage?.trim()||null;return(0,R.jsxs)(R.Fragment,{children:[n?(0,R.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-amber-200/70 bg-amber-50/70 flex items-center justify-between gap-3 shrink-0 sm:px-5`,children:[(0,R.jsx)(`span`,{className:`text-xs text-amber-800`,children:b(`chatModelNoOptions`)}),(0,R.jsx)(`button`,{type:`button`,onClick:t.chatUiManager.goToProviders,className:`text-xs font-semibold text-amber-900 underline-offset-2 hover:underline`,children:b(`chatGoConfigureProvider`)})]}):null,e.sessionTypeState.sessionTypeUnavailable&&r?(0,R.jsx)(`div`,{className:`px-4 py-2.5 border-b border-amber-200/70 bg-amber-50/70 shrink-0 sm:px-5`,children:(0,R.jsx)(`span`,{className:`text-xs text-amber-800`,children:r})}):null]})}function D1(e){let{consumeDraftIntent:t=!1,materializationContext:n=null,onSessionMaterialized:r,sessionKey:i,showWelcomeForDraft:a=!0}=e,o=Ai(),s=i?null:w1(o.state),c=typeof s?.prompt==`string`?s.prompt:null,l=ce(),u=z(e=>e.snapshot.selectedAgentId),d=jZ(i??void 0),f=a$(i),{inputActions:p,inputSnapshot:m}=r$(c),h=XQ({sessionKey:i,inputSnapshot:m,setPendingSessionType:p.setPendingSessionType}),[g,_]=(0,L.useState)(()=>new Set),v=(0,L.useCallback)((e,t)=>{_(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]);(0,L.useEffect)(()=>{p.syncSessionPreferences({defaultModel:h.defaultModel,fallbackPreferredModel:h.fallbackPreferredModel,fallbackPreferredThinking:h.fallbackPreferredThinking,modelOptions:h.modelOptions,selectedSessionExists:!!h.selectedSession,selectedSessionKey:h.selectedSessionKey,selectedSessionType:h.sessionTypeState.selectedSessionType,selectedSessionPreferredModel:h.selectedSession?.preferredModel??void 0,selectedSessionPreferredThinking:h.selectedSession?.preferredThinking??null})},[p,h.defaultModel,h.fallbackPreferredModel,h.fallbackPreferredThinking,h.modelOptions,h.selectedSession,h.selectedSessionKey,h.sessionTypeState.selectedSessionType]),T1({sessionKey:i,setPendingProjectRoot:p.setPendingProjectRoot,setPendingSessionType:p.setPendingSessionType});let y=MZ(l),x=d.isRunning||h.selectedSession?.status===`running`,S=d.hydrateError?.message??d.snapshot.error?.message??null,C=l.phase===`ready`&&OZ(S)?null:S,w=y?null:l.phase===`ready`?C:PZ({message:C,status:l}),T=DQ({agent:(0,L.useMemo)(()=>({...d,isRunning:x,isSending:d.isSending}),[d,x]),inputSnapshot:m,inputQuery:h,isRuntimeBlocked:y,materializationContext:n,runQueue:f,selectedAgentId:u,sessionKey:i,onSessionMaterialized:r,resetComposer:p.resetComposer,restoreComposer:p.restoreComposer,setSendError:p.setSendError}),E=(0,L.useRef)(T);(0,L.useEffect)(()=>{E.current=T},[T]);let D=(0,L.useMemo)(()=>({canStopGeneration:T.canStopGeneration,deleteQueuedInput:e=>E.current.deleteQueuedInput(e),editQueuedInput:e=>E.current.editQueuedInput(e),isSending:T.isSending,queuedInputs:T.queuedInputs,send:()=>E.current.send(),sendDisabled:T.sendDisabled,stop:()=>E.current.stop(),stopDisabled:T.stopDisabled}),[T.canStopGeneration,T.isSending,T.queuedInputs,T.sendDisabled,T.stopDisabled]),O=(0,L.useMemo)(()=>IZ(LK(d.snapshot.contextWindow)),[d.snapshot.contextWindow]),k=(0,L.useMemo)(()=>({...m,sendError:w??m.sendError}),[m,w]),A=h.selectedSession?.activityPreview,ee=A?.state===`failed`&&(A.statusText?.trim()||A.replyText?.trim())||null,j=ee?(0,R.jsxs)(`div`,{className:`rounded-lg border border-red-200/80 bg-red-50/80 px-3 py-2.5 shadow-sm`,children:[(0,R.jsx)(`div`,{className:`text-xs font-semibold text-red-800`,children:b(`chatSessionErrorTitle`)}),(0,R.jsx)(`div`,{className:`mt-1 whitespace-pre-wrap break-words text-xs leading-5 text-red-700`,children:ee})]}):null;C1({consumeDraftIntent:t,applyPromptSuggestion:p.applyPromptSuggestion});let M=(0,L.useCallback)(e=>(0,R.jsx)(S1,{contextWindow:O,controller:D,inputActions:p,inputQuery:h,inputSnapshot:k,onContextCompactingChange:v,surface:e}),[O,k,D,p,h,v]),N=a&&!i&&d.visibleMessages.length===0&&!d.isHydrating;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(E1,{inputQuery:h}),(0,R.jsx)(pX,{hasPreviousMessages:d.hasPreviousMessages,historyError:d.historyError,isAwaitingAssistantOutput:T.isSending&&x,isHistoryLoading:d.isHydrating,isLoadingPreviousMessages:d.isLoadingPreviousMessages,isSending:T.isSending,isContextCompacting:!!(i&&g.has(i)),bottomSlot:j,messages:d.visibleMessages,sessionKey:i,showWelcome:N,onLoadPreviousMessages:d.loadPreviousMessages,welcomeSlot:(0,R.jsx)(eQ,{inputSlot:M(`embedded`),pendingProjectRoot:m.pendingProjectRoot,pendingSessionType:m.pendingSessionType,selectedSessionTypeValue:m.selectedSessionType,onSelectProjectRoot:p.setPendingProjectRoot,onSelectPrompt:p.applyPromptSuggestion,onSelectSessionType:p.setPendingSessionType})}),N?null:M(`default`)]})}var O1=yt,k1=pt,A1=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(ft,{ref:n,className:r(`fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/35 backdrop-blur-[1px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));A1.displayName=ft.displayName;var j1=re(`fixed z-[var(--z-modal,10050)] bg-background shadow-2xl transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),M1=L.forwardRef(({children:e,className:t,closeLabel:n=`Close`,side:i,...a},o)=>(0,R.jsxs)(k1,{children:[(0,R.jsx)(A1,{}),(0,R.jsxs)(ht,{ref:o,className:r(j1({side:i}),t),...a,children:[e,(0,R.jsxs)(dt,{className:`absolute right-4 top-4 rounded-lg p-1.5 text-muted-foreground opacity-75 transition-colors hover:bg-muted hover:text-foreground hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:pointer-events-none`,children:[(0,R.jsx)(qn,{className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`sr-only`,children:n})]})]})]}));M1.displayName=ht.displayName;function N1({className:e,...t}){return(0,R.jsx)(`div`,{className:r(`flex flex-col space-y-2 text-left`,e),...t})}N1.displayName=`SheetHeader`;function P1({className:e,...t}){return(0,R.jsx)(`div`,{className:r(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}P1.displayName=`SheetFooter`;var F1=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(gt,{ref:n,className:r(`text-lg font-semibold tracking-tight text-foreground`,e),...t}));F1.displayName=gt.displayName;var I1=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Ct,{ref:n,className:r(`text-sm leading-relaxed text-muted-foreground`,e),...t}));I1.displayName=Ct.displayName;function L1(e){return _(e??void 0)}function R1(e){if(!e)return`-`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`-`;let n=Date.now(),r=t.getTime()-n,i=l(),a=Math.abs(r);if(a<6e4)return i===`zh`?`刚刚`:`just now`;if(a<36e5){let e=Math.round(a/6e4);return r>0?i===`zh`?`${e}分钟后`:`in ${e}m`:i===`zh`?`${e}分钟前`:`${e}m ago`}if(a<864e5){let e=Math.round(a/36e5);return r>0?i===`zh`?`${e}小时后`:`in ${e}h`:i===`zh`?`${e}小时前`:`${e}h ago`}let o=Math.round(a/864e5);return r>0?i===`zh`?`${o}天后`:`in ${o}d`:i===`zh`?`${o}天前`:`${o}d ago`}function z1(e){return typeof e!=`number`||!Number.isFinite(e)?`-`:_(new Date(e))}function B1(e){if(typeof e!=`number`||!Number.isFinite(e))return`-`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<24?`${r}h`:`${Math.round(r/24)}d`}var V1=[`周日`,`周一`,`周二`,`周三`,`周四`,`周五`,`周六`],H1=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function U1(e){return e.padStart(2,`0`)}function W1(e,t){let n=e.trim().split(/\s+/);if(n.length!==5)return null;let[r,i,a,o,s]=n,c=t===`zh`;if(r===`*`&&i===`*`&&a===`*`&&o===`*`&&s===`*`)return c?`每分钟`:`every minute`;if(r.startsWith(`*/`)&&i===`*`&&a===`*`&&o===`*`&&s===`*`){let e=parseInt(r.slice(2),10);if(Number.isFinite(e)&&e>0)return c?`每 ${e} 分钟`:`every ${e}m`}if(r===`0`&&i===`*`&&a===`*`&&o===`*`&&s===`*`)return c?`每小时`:`every hour`;let l=`${U1(i)}:${U1(r)}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&s===`*`)return c?`每天 ${l}`:`daily ${l}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&s===`1-5`)return c?`工作日 ${l}`:`weekdays ${l}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&(s===`0,6`||s===`6,0`))return c?`周末 ${l}`:`weekends ${l}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&/^\d$/.test(s)){let e=parseInt(s,10),t=c?V1[e]:H1[e];return t?`${t} ${l}`:null}return r!==`*`&&i!==`*`&&a!==`*`&&o===`*`&&s===`*`?c?`每月 ${a} 日 ${l}`:`monthly ${a} ${l}`:null}function G1(e){let t=l(),n=t===`zh`,{schedule:r}=e;if(r.kind===`cron`)return r.expr?W1(r.expr,t)??`cron ${r.expr}`:`cron`;if(r.kind===`every`){let e=B1(r.everyMs);return n?`每 ${e}`:`every ${e}`}return r.kind===`at`?`${n?`定时`:`at`} ${z1(r.atMs)}`:`-`}function K1(e){return e.payload.sessionId?.trim()||`cron:${e.id}`}function q1(e,t){let n=t?.trim();return!!(n&&e.payload.sessionId?.trim()===n)}function J1({label:e,value:t}){return(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border/50 py-3 last:border-b-0`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,R.jsx)(`span`,{className:`max-w-[65%] break-words text-right text-xs font-medium text-foreground`,children:t})]})}function Y1({job:e,open:t,onDelete:n,onOpenChange:i,onOpenSession:a,onRun:o,onToggle:s}){if(!e)return null;let c=K1(e),l=!!e.payload.sessionId?.trim(),u=l||!!e.state.lastRunAt,d=e.state.lastStatus?b(`cronLastStatus${e.state.lastStatus[0].toUpperCase()}${e.state.lastStatus.slice(1)}`):b(`cronNeverRun`);return(0,R.jsx)(O1,{open:t,onOpenChange:i,children:(0,R.jsxs)(M1,{side:`right`,closeLabel:b(`cronCloseDetails`),className:`flex w-full flex-col overflow-hidden p-0 sm:max-w-[510px]`,children:[(0,R.jsxs)(N1,{className:`shrink-0 border-b border-border/60 px-5 pb-5 pt-6 pr-14 sm:px-7 sm:pt-7`,children:[(0,R.jsxs)(`div`,{className:`mb-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{children:G1(e)}),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,R.jsx)(`span`,{children:b(l?`cronBoundSession`:`cronDedicatedSession`)})]}),(0,R.jsx)(F1,{children:e.name||e.id}),(0,R.jsx)(I1,{children:b(`cronDetailDescription`)})]}),(0,R.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto px-5 py-6 sm:px-7`,children:[(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:b(`cronTaskPrompt`)}),(0,R.jsx)(`div`,{className:`rounded-2xl bg-muted/55 px-4 py-3 text-sm leading-6 text-foreground`,children:e.payload.message})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:b(`cronTaskDetails`)}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(J1,{label:b(`cronScheduleLabel`),value:G1(e)}),(0,R.jsx)(J1,{label:b(`cronNextRun`),value:L1(e.state.nextRunAt)}),(0,R.jsx)(J1,{label:b(`cronAgentLabel`),value:e.payload.agentId?.trim()||`main`}),(0,R.jsx)(J1,{label:b(`cronSessionLabel`),value:c}),(0,R.jsx)(J1,{label:b(`cronCreatedAt`),value:L1(e.createdAt)})]})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:b(`cronLatestRun`)}),(0,R.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:b(`cronLatestRunHint`)})]}),(0,R.jsx)(`span`,{className:r(`rounded-full px-2.5 py-1 text-xs font-medium`,e.state.lastStatus===`error`?`bg-red-50 text-red-700`:e.state.lastStatus===`ok`?`bg-emerald-50 text-emerald-700`:`bg-muted text-muted-foreground`),children:d})]}),(0,R.jsxs)(`div`,{className:`rounded-2xl border border-border/60 px-4 py-1`,children:[(0,R.jsx)(J1,{label:b(`cronLastRun`),value:L1(e.state.lastRunAt)}),e.state.lastError?(0,R.jsx)(J1,{label:b(`cronLastError`),value:e.state.lastError}):null]})]}),(0,R.jsxs)(`section`,{className:`flex items-center justify-between rounded-2xl border border-border/60 px-4 py-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.enabled?b(`cronEnabledState`):b(`cronPaused`)}),(0,R.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:b(`cronToggleHint`)})]}),(0,R.jsx)(Xe,{checked:e.enabled,onCheckedChange:t=>s(e,t),"aria-label":e.enabled?b(`cronDisable`):b(`cronEnable`)})]}),u?null:(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b(`cronSessionAvailableAfterRun`)})]}),(0,R.jsxs)(P1,{className:`shrink-0 border-t border-border/60 bg-background px-5 py-4 sm:px-7`,children:[(0,R.jsxs)(F,{variant:`ghost`,className:`text-red-600 hover:bg-red-50 hover:text-red-700`,onClick:()=>n(e),children:[(0,R.jsx)(Kn,{className:`mr-2 h-4 w-4`}),b(`delete`)]}),(0,R.jsxs)(F,{variant:`outline`,onClick:()=>a(e),disabled:!u,children:[(0,R.jsx)(kn,{className:`mr-2 h-4 w-4`}),b(`cronOpenSession`)]}),(0,R.jsxs)(F,{onClick:()=>o(e),children:[(0,R.jsx)(Fs,{className:`mr-2 h-4 w-4`}),b(`cronRunNow`)]})]})]})})}function X1({job:e}){let t=e.state.lastStatus===`error`,n=t?b(`cronNeedsAttention`):e.enabled?b(`cronRunningNormally`):b(`cronPaused`);return(0,R.jsxs)(`span`,{className:r(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium`,t?`bg-red-50 text-red-700`:e.enabled?`bg-emerald-50 text-emerald-700`:`bg-muted text-muted-foreground`),children:[(0,R.jsx)(`span`,{className:r(`h-1.5 w-1.5 rounded-full`,t?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-muted-foreground/50`)}),n]})}function Z1({expanded:e,job:t,onDelete:n,onEdit:i,onRun:a,onToggleExpanded:o,onToggle:s}){let[c,l]=(0,L.useState)(!1),u=!!t.payload.sessionId?.trim(),d=t.state.lastStatus===`error`,f=d?Xs:fn,p=t.name||t.id,m=`cron-job-preview-${t.id}`;return(0,R.jsxs)(`div`,{className:r(`group relative rounded-xl border-b border-border/55 transition-colors duration-150 last:border-b-0 hover:bg-muted/35 focus-within:bg-muted/35`,e&&`bg-muted/35`),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 px-1 py-3.5`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`grid min-w-0 flex-1 grid-cols-[36px_minmax(0,1fr)] items-center gap-3 rounded-lg pr-16 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-controls":m,"aria-expanded":e,"aria-label":`${b(e?`cronCollapseTask`:`cronExpandTask`)} ${p}`,onClick:()=>o(t),children:[(0,R.jsx)(`span`,{className:r(`flex h-9 w-9 items-center justify-center rounded-xl`,d?`bg-amber-50 text-amber-600`:`bg-emerald-50 text-emerald-600`),children:(0,R.jsx)(f,{className:`h-4 w-4`,"aria-hidden":`true`})}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(`strong`,{className:`truncate text-[13px] font-semibold text-foreground`,children:p}),(0,R.jsx)(X1,{job:t}),(0,R.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground`,children:b(u?`cronBoundSession`:`cronDedicatedSession`)}),t.deleteAfterRun?(0,R.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground`,children:b(`cronOneShot`)}):null]}),(0,R.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,R.jsx)(Eo,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),G1(t)]}),t.state.nextRunAt?(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,R.jsx)(Fo,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),b(`cronNextRun`),` `,R1(t.state.nextRunAt)]}):null]})]})]}),(0,R.jsx)(Bt,{delayDuration:250,children:(0,R.jsxs)(`div`,{className:`relative flex shrink-0 items-center`,children:[(0,R.jsxs)(`div`,{className:`absolute right-11 top-1/2 flex -translate-y-1/2 items-center gap-0.5 opacity-100 transition-opacity duration-150 [@media(hover:hover)]:pointer-events-none [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-focus-within:pointer-events-auto [@media(hover:hover)]:group-focus-within:opacity-100 [@media(hover:hover)]:group-hover:pointer-events-auto [@media(hover:hover)]:group-hover:opacity-100`,children:[(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(F,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>i(t),"aria-label":`${b(`edit`)} ${p}`,children:(0,R.jsx)(Ps,{className:`h-3.5 w-3.5`})})}),(0,R.jsx)(Lt,{children:b(`cronEditDetails`)})]}),(0,R.jsxs)(ct,{open:c,onOpenChange:l,children:[(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(F,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":`${b(`cronMoreActions`)} ${p}`,children:(0,R.jsx)(jt,{className:`h-4 w-4`})})})}),(0,R.jsx)(Lt,{children:b(`cronMoreActions`)})]}),(0,R.jsxs)(ot,{align:`end`,sideOffset:4,className:`w-40 p-1`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{l(!1),a(t)},className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted`,children:[(0,R.jsx)(Fs,{className:`h-3.5 w-3.5 text-muted-foreground`}),b(`cronRunNow`)]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{l(!1),n(t)},className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-red-600 transition-colors hover:bg-red-50`,children:[(0,R.jsx)(Kn,{className:`h-3.5 w-3.5`}),b(`delete`)]})]})]})]}),(0,R.jsx)(Xe,{checked:t.enabled,onCheckedChange:e=>s(t,e),"aria-label":t.enabled?b(`cronDisable`):b(`cronEnable`)})]})})]}),(0,R.jsx)(`div`,{id:m,"aria-hidden":!e,className:r(`grid transition-[grid-template-rows,opacity] duration-200 ease-out`,e?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`),children:(0,R.jsx)(`div`,{className:`overflow-hidden`,children:(0,R.jsxs)(`div`,{className:`mb-3 ml-12 mr-1 rounded-xl bg-background/70 px-4 py-3`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.1em] text-muted-foreground`,children:b(`cronTaskPrompt`)}),(0,R.jsx)(`p`,{className:`mt-1.5 line-clamp-4 text-xs leading-5 text-foreground`,children:t.payload.message}),(0,R.jsxs)(`dl`,{className:`mt-3 grid gap-x-5 gap-y-2 border-t border-border/50 pt-3 text-[11px] sm:grid-cols-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:b(`cronAgentLabel`)}),(0,R.jsx)(`dd`,{className:`mt-0.5 truncate font-medium text-foreground`,children:t.payload.agentId?.trim()||`main`})]}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:b(`cronSessionLabel`)}),(0,R.jsx)(`dd`,{className:`mt-0.5 truncate font-medium text-foreground`,children:K1(t)})]}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:b(`cronLastRun`)}),(0,R.jsx)(`dd`,{className:`mt-0.5 truncate font-medium text-foreground`,children:L1(t.state.lastRunAt)})]})]}),t.state.lastError?(0,R.jsx)(`p`,{className:`mt-3 line-clamp-2 border-t border-red-100 pt-3 text-[11px] leading-5 text-red-700`,children:t.state.lastError}):null]})})})]})}var Q1=[{titleKey:`cronTemplateAiNewsTitle`,descriptionKey:`cronTemplateAiNewsDescription`,promptKey:`cronTemplateAiNewsPrompt`,icon:Ds},{titleKey:`cronTemplateWeeklyReviewTitle`,descriptionKey:`cronTemplateWeeklyReviewDescription`,promptKey:`cronTemplateWeeklyReviewPrompt`,icon:Oo},{titleKey:`cronTemplateMeetingPrepTitle`,descriptionKey:`cronTemplateMeetingPrepDescription`,promptKey:`cronTemplateMeetingPrepPrompt`,icon:Do},{titleKey:`cronTemplateLearningTitle`,descriptionKey:`cronTemplateLearningDescription`,promptKey:`cronTemplateLearningPrompt`,icon:Ut},{titleKey:`cronTemplateCompetitorTitle`,descriptionKey:`cronTemplateCompetitorDescription`,promptKey:`cronTemplateCompetitorPrompt`,icon:gs},{titleKey:`cronTemplateFamilyTitle`,descriptionKey:`cronTemplateFamilyDescription`,promptKey:`cronTemplateFamilyPrompt`,icon:us}],$1=(0,L.forwardRef)(function({prominent:e=!1,value:t,onChange:n,onSubmit:i},a){return(0,R.jsxs)(`form`,{className:r(`relative w-full`,e&&`mx-auto max-w-3xl`),onSubmit:e=>{e.preventDefault(),i()},children:[(0,R.jsx)(_n,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`,"aria-hidden":`true`}),(0,R.jsx)(ae,{ref:a,value:t,onChange:e=>n(e.target.value),className:`pl-9 pr-11 focus:border-border/75`,placeholder:b(`cronComposerPlaceholder`),"aria-label":b(`cronComposerLabel`)}),(0,R.jsx)(F,{type:`submit`,size:`icon`,className:`absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full shadow-none`,disabled:!t.trim(),"aria-label":b(`cronComposerSubmit`),children:(0,R.jsx)(xo,{className:`h-4 w-4`})})]})});function e0({compact:e=!1,onSelect:t}){return(0,R.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,17.5rem),1fr))] gap-3`,children:(e?Q1.slice(0,4):Q1).map(e=>{let n=e.icon;return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(b(e.promptKey)),className:`group grid min-h-24 grid-cols-[38px_minmax(0,1fr)] items-center gap-3 rounded-2xl border border-border/60 bg-card px-4 py-4 text-left transition-all hover:-translate-y-0.5 hover:border-primary/20 hover:shadow-[0_12px_30px_rgba(30,45,52,0.08)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,R.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground transition-colors group-hover:bg-primary/10 group-hover:text-primary`,children:(0,R.jsx)(n,{className:`h-4 w-4`,"aria-hidden":`true`})}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`strong`,{className:`block text-sm font-medium text-foreground`,children:b(e.titleKey)}),(0,R.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-muted-foreground`,children:b(e.descriptionKey)})]})]},e.titleKey)})})}function t0(e={all:!0}){return O({queryKey:[`cron`,e],queryFn:()=>ve(e),placeholderData:e=>e,staleTime:1e4})}function n0(){let e=Ke();return{onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),P.success(b(`configSavedApplied`))},onError:e=>{P.error(b(`configSaveFailed`)+`: `+e.message)}}}function r0(){return le({mutationFn:({id:e})=>me(e),...n0()})}function i0(){return le({mutationFn:({id:e,enabled:t})=>He(e,{enabled:t}),...n0()})}function a0(){return le({mutationFn:({id:e,force:t})=>Re(e,{force:t}),...n0()})}var o0=10;function s0({summary:e}){let{attention:t,disabled:n,enabled:i,total:a}=e,o=[{label:b(`cronSummaryTotal`),value:a},{label:b(`cronSummaryEnabled`),value:i},{label:b(`cronSummaryPaused`),value:n}],s=t>0?gn:jo;return(0,R.jsxs)(`section`,{"aria-label":b(`cronSummaryLabel`),className:`grid grid-cols-3 overflow-hidden rounded-2xl bg-border/60 sm:grid-cols-[minmax(220px,1.35fr)_repeat(3,minmax(100px,0.55fr))] sm:gap-px`,children:[(0,R.jsxs)(`div`,{className:`col-span-3 flex items-center gap-3 bg-muted/40 px-4 py-3.5 sm:col-span-1`,children:[(0,R.jsx)(`span`,{className:r(`flex h-9 w-9 shrink-0 items-center justify-center rounded-xl`,t>0?`bg-amber-50 text-amber-600`:`bg-emerald-50 text-emerald-600`),children:(0,R.jsx)(s,{className:`h-4 w-4`,"aria-hidden":`true`})}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`strong`,{className:`block truncate text-xs font-semibold text-foreground`,children:t>0?`${t} ${b(`cronAttentionSummary`)}`:b(`cronAllHealthy`)}),(0,R.jsx)(`span`,{className:`mt-1 block truncate text-[11px] text-muted-foreground`,children:b(t>0?`cronAttentionSummaryHint`:`cronAllHealthyHint`)})]})]}),o.map(e=>(0,R.jsxs)(`div`,{className:`bg-muted/40 px-4 py-3.5 sm:px-5`,children:[(0,R.jsx)(`div`,{className:`text-lg font-semibold tabular-nums text-foreground`,children:e.value}),(0,R.jsx)(`div`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e.label})]},e.label))]})}function c0({page:e,total:t,disabled:n,onPageChange:r}){let i=Math.ceil(t/o0);if(i<=1)return null;let a=e*o0+1,o=Math.min(t,a+o0-1);return(0,R.jsxs)(`nav`,{"aria-label":b(`cronPaginationLabel`),className:`flex items-center justify-between gap-3 border-b border-border/60 py-3 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[a,`–`,o,` / `,t]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(F,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8`,disabled:n||e===0,onClick:()=>r(e-1),"aria-label":b(`cronPreviousPage`),children:(0,R.jsx)(ko,{className:`h-4 w-4`})}),(0,R.jsxs)(`span`,{className:`min-w-14 text-center tabular-nums text-foreground`,children:[e+1,` / `,i]}),(0,R.jsx)(F,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8`,disabled:n||e>=i-1,onClick:()=>r(e+1),"aria-label":b(`cronNextPage`),children:(0,R.jsx)(Ao,{className:`h-4 w-4`})})]})]})}function l0(){let[e,t]=(0,L.useState)(``),[n,i]=(0,L.useState)(``),[a,o]=(0,L.useState)(`all`),[s,c]=(0,L.useState)(0),[l,u]=(0,L.useState)(null),[d,f]=(0,L.useState)(null),p=(0,L.useDeferredValue)(n.trim()),m=(0,L.useRef)(null),h=rl(),g=t0({all:!0,limit:o0,offset:s*o0,query:p,status:a}),_=r0(),v=i0(),y=a0(),{confirm:x,ConfirmDialog:S}=bn(),C=g.data?.jobs??[],w=g.data?.total??0,T=g.data?.summary,E=C.find(e=>e.id===d)??null,D=()=>{let t=e.trim();if(!t){m.current?.focus();return}h.chatSessionListManager.createSession({prompt:t})},O=e=>{t(e),m.current?.focus()},k=async e=>{await x({title:`${b(`cronDeleteConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,variant:`destructive`,confirmLabel:b(`delete`)})&&(u(null),f(null),C.length===1&&s>0&&c(s-1),_.mutate({id:e.id}))},A=(e,t)=>{(a===`enabled`&&!t||a===`disabled`&&t)&&C.length===1&&s>0&&c(s-1),v.mutate({id:e.id,enabled:t})},ee=async e=>{let t=!e.enabled;t&&!await x({title:`${b(`cronRunForceConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,confirmLabel:b(`cronRunNow`)})||y.mutate({id:e.id,force:t})},j=e=>{h.chatSessionListManager.selectSession(K1(e))},M=e=>{u(null),c(e)},N=e=>{u(t=>t===e.id?null:e.id)},te=(T?.total??0)>0;return(0,R.jsxs)(_e,{className:`space-y-7`,children:[(0,R.jsxs)(`header`,{className:`flex items-start justify-between gap-6 pt-2`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-[0.12em] text-primary`,children:b(`cronWorkspaceEyebrow`)}),(0,R.jsx)(`h1`,{className:`text-3xl font-semibold tracking-[-0.035em] text-foreground sm:text-4xl`,children:b(`cronPageTitle`)}),(0,R.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:b(`cronPageDescription`)})]}),(0,R.jsx)(`div`,{className:`pt-5`,children:(0,R.jsx)(F,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>{s===0?(u(null),g.refetch()):M(0)},"aria-label":b(`refresh`),children:(0,R.jsx)(Gn,{className:r(`h-4 w-4`,g.isFetching&&`animate-spin`)})})})]}),te?(0,R.jsx)($1,{ref:m,value:e,onChange:t,onSubmit:D}):null,g.isLoading?(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 text-muted-foreground`,children:[(0,R.jsx)(Gn,{className:`mb-3 h-5 w-5 animate-spin`}),(0,R.jsx)(`span`,{className:`text-sm`,children:b(`cronLoading`)})]}):te?(0,R.jsxs)(R.Fragment,{children:[T?(0,R.jsx)(s0,{summary:T}):null,(0,R.jsxs)(`section`,{className:`pt-1`,children:[(0,R.jsx)(`div`,{className:`mb-3 flex items-end justify-between gap-4`,children:(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:b(`cronMyTasks`)}),(0,R.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[w,` `,b(`cronTaskCountUnit`)]})]})}),(0,R.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2.5`,children:[(0,R.jsxs)(`div`,{className:`relative min-w-[220px] flex-1`,children:[(0,R.jsx)(Tt,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,R.jsx)(ae,{value:n,onChange:e=>{i(e.target.value),M(0)},placeholder:b(`cronSearchPlaceholder`),className:`pl-9`})]}),(0,R.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,"aria-label":b(`cronStatusLabel`),children:[[`all`,`cronStatusAll`],[`enabled`,`cronStatusEnabled`],[`disabled`,`cronStatusDisabled`],[`attention`,`cronStatusAttention`]].map(([e,t])=>(0,R.jsx)(`button`,{type:`button`,"aria-pressed":a===e,onClick:()=>{o(e),M(0)},className:r(`rounded-lg px-2.5 py-2 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,a===e&&`bg-muted text-foreground`),children:b(t)},e))})]}),C.length>0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{"aria-busy":g.isFetching,className:r(`border-y border-border/60 transition-opacity`,g.isFetching&&`opacity-60`),children:C.map(e=>(0,R.jsx)(Z1,{expanded:l===e.id,job:e,onDelete:k,onEdit:e=>f(e.id),onRun:ee,onToggleExpanded:N,onToggle:A},e.id))}),(0,R.jsx)(c0,{page:s,total:w,disabled:g.isFetching,onPageChange:M})]}):(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-center text-muted-foreground`,children:[(0,R.jsx)(Tt,{className:`mb-3 h-5 w-5`}),(0,R.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:b(`cronNoMatchingTasks`)}),(0,R.jsx)(`span`,{className:`mt-1 text-xs`,children:b(`cronNoMatchingTasksHint`)})]})]}),(0,R.jsxs)(`section`,{className:`pt-2`,children:[(0,R.jsxs)(`div`,{className:`mb-3`,children:[(0,R.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:b(`cronNeedInspiration`)}),(0,R.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:b(`cronTemplateSelectionHint`)})]}),(0,R.jsx)(e0,{compact:!0,onSelect:O})]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`section`,{className:`flex min-h-[270px] flex-col items-center justify-center rounded-3xl bg-muted/25 px-4 py-10 text-center sm:px-8`,children:[(0,R.jsx)(`span`,{className:`mb-4 flex h-11 w-11 items-center justify-center rounded-2xl bg-card shadow-sm`,children:(0,R.jsx)(vs,{className:`h-5 w-5 text-primary`})}),(0,R.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:b(`cronEmptyHeroTitle`)}),(0,R.jsx)(`p`,{className:`mb-6 mt-2 max-w-2xl text-sm leading-6 text-muted-foreground`,children:b(`cronEmptyHeroDescription`)}),(0,R.jsx)($1,{ref:m,prominent:!0,value:e,onChange:t,onSubmit:D}),(0,R.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:b(`cronComposerHint`)})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`div`,{className:`mb-3`,children:[(0,R.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:b(`cronStartFromResult`)}),(0,R.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:b(`cronTemplateSelectionHint`)})]}),(0,R.jsx)(e0,{onSelect:O})]})]}),(0,R.jsx)(Y1,{job:E,open:!!E,onOpenChange:e=>{e||f(null)},onDelete:k,onOpenSession:j,onRun:ee,onToggle:A}),(0,R.jsx)(S,{})]})}function u0({jobs:e}){let t=r0(),{confirm:n,ConfirmDialog:r}=bn(),i=async e=>{await n({title:`${b(`cronDeleteConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,confirmLabel:b(`delete`)})&&t.mutate({id:e.id})};return(0,R.jsxs)(`div`,{className:`h-full overflow-y-auto custom-scrollbar px-4 py-4`,children:[(0,R.jsxs)(`div`,{className:`mb-4`,children:[(0,R.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:b(`chatWorkspaceSessionCronJobs`)}),(0,R.jsxs)(`div`,{className:`mt-1 text-xs text-gray-500`,children:[b(`cronTotalLabel`),`: `,e.length]})]}),e.length===0?(0,R.jsx)(`div`,{className:`py-8 text-center text-sm text-gray-500`,children:b(`chatWorkspaceCronJobEmpty`)}):(0,R.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,R.jsxs)(`div`,{className:`rounded-lg border border-gray-200 bg-white px-3 py-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`truncate text-sm font-semibold text-gray-900`,children:e.name||e.id}),(0,R.jsx)(`div`,{className:`mt-1 text-[11px] text-gray-400`,children:e.id})]}),(0,R.jsxs)(F,{type:`button`,variant:`subtle`,size:`sm`,className:`h-7 gap-1 rounded-lg px-2`,onClick:()=>void i(e),disabled:t.isPending,children:[(0,R.jsx)(Kn,{className:`h-3.5 w-3.5`}),b(`delete`)]})]}),(0,R.jsxs)(`div`,{className:`mt-3 space-y-1.5 text-xs text-gray-500`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[b(`cronScheduleLabel`),`:`]}),` `,G1(e)]}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[b(`cronNextRun`),`:`]}),` `,L1(e.state.nextRunAt)]}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[b(`cronLastRun`),`:`]}),` `,L1(e.state.lastRunAt)]}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[b(`cronLastStatus`),`:`]}),` `,e.state.lastStatus??`-`]}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[b(`cronSessionLabel`),`:`]}),` `,K1(e)]})]}),(0,R.jsx)(`div`,{className:`mt-3 whitespace-pre-wrap break-words text-sm text-gray-700`,children:e.payload.message})]},e.id))}),(0,R.jsx)(r,{})]})}function d0({count:e,description:t,icon:n,onClick:r,title:i}){return(0,R.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center gap-3 rounded-lg border border-gray-200/80 bg-white px-3 py-3 text-left transition-colors hover:border-gray-300 hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25`,onClick:r,children:[(0,R.jsx)(`span`,{className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-600`,children:n}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:i}),typeof e==`number`?(0,R.jsx)(`span`,{className:`rounded-full bg-gray-100 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-gray-500`,children:e}):null]}),(0,R.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-gray-500`,children:t})]}),(0,R.jsx)(Ao,{className:`h-4 w-4 shrink-0 text-gray-300 transition-transform group-hover:translate-x-0.5 group-hover:text-gray-500`})]})}function f0({childSessionTabs:e,sessionCronJobs:t,sessionKey:n}){let r=rl();return(0,R.jsx)(`div`,{className:`h-full overflow-auto bg-gray-50/45 px-4 py-5 custom-scrollbar`,children:(0,R.jsxs)(`div`,{className:`mx-auto max-w-xl`,children:[(0,R.jsx)(`h2`,{className:`text-base font-semibold text-gray-900`,children:b(`chatWorkspaceOverview`)}),(0,R.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-gray-500`,children:b(`chatWorkspaceOverviewDescription`)}),(0,R.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,R.jsx)(d0,{count:e.length,description:b(`chatWorkspaceChildSessionsDescription`),icon:(0,R.jsx)(os,{className:`h-4 w-4`}),title:b(`chatWorkspaceChildSessions`),onClick:()=>{n&&r.chatThreadManager.openChildSessions(n)}}),(0,R.jsx)(d0,{count:t.length,description:b(`chatWorkspaceSessionCronJobsDescription`),icon:(0,R.jsx)(_o,{className:`h-4 w-4`}),title:b(`chatWorkspaceSessionCronJobs`),onClick:()=>{n&&r.chatThreadManager.openSessionCronPanel(n)}}),(0,R.jsx)(d0,{description:b(`chatWorkspaceProjectFilesDescription`),icon:(0,R.jsx)(ns,{className:`h-4 w-4`}),title:b(`chatWorkspaceProjectFiles`),onClick:()=>{n&&r.chatThreadManager.openProjectFiles(n)}})]})]})})}function p0({childSessionTabs:e}){let t=rl();return(0,R.jsx)(`div`,{className:`h-full overflow-auto bg-gray-50/45 px-4 py-5 custom-scrollbar`,children:(0,R.jsxs)(`div`,{className:`mx-auto max-w-xl`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`h2`,{className:`text-base font-semibold text-gray-900`,children:b(`chatWorkspaceChildSessions`)}),(0,R.jsx)(`span`,{className:`rounded-full bg-gray-100 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-gray-500`,children:e.length})]}),e.length===0?(0,R.jsx)(`div`,{className:`py-10 text-center text-sm text-gray-500`,children:b(`chatWorkspaceChildSessionsEmpty`)}):(0,R.jsx)(`div`,{className:`mt-4 space-y-2`,children:e.map(e=>(0,R.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center gap-3 rounded-lg border border-gray-200/80 bg-white px-3 py-3 text-left transition-colors hover:border-gray-300 hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25`,onClick:()=>t.chatThreadManager.selectChildSessionDetail(e.sessionKey),children:[(0,R.jsx)(`span`,{className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-600`,children:(0,R.jsx)(os,{className:`h-4 w-4`})}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm font-medium text-gray-900`,children:e.title}),e.projectName||e.sessionTypeLabel?(0,R.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-gray-500`,children:[e.sessionTypeLabel,e.projectName].filter(Boolean).join(` · `)}):null]}),(0,R.jsx)(Ao,{className:`h-4 w-4 shrink-0 text-gray-300 transition-transform group-hover:translate-x-0.5 group-hover:text-gray-500`})]},e.sessionKey))})]})})}function m0({projectRoot:e,workingDir:t}){let n=rl(),i=e??t,a=Ic({path:i,includeFiles:!0,enabled:!!i});return i?(0,R.jsx)(GK,{browseQuery:a,onFileOpen:n.chatThreadManager.openFilePreview,renderStatus:({text:e,tone:t=`muted`})=>(0,R.jsx)(`div`,{className:r(`flex h-full items-center justify-center px-6 text-center text-sm`,t===`error`?`text-rose-600`:`text-gray-500`),children:e}),showRoot:!0}):(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-center text-sm text-gray-500`,children:b(`chatWorkspaceProjectFilesUnavailable`)})}function h0({value:e}){return(0,R.jsx)(`span`,{className:`inline-flex max-w-full shrink-0 items-center rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 text-[10px] font-medium text-gray-600`,children:(0,R.jsx)(`span`,{className:`truncate`,children:e})})}function g0({tab:e}){let t=[e.sessionTypeLabel,e.preferredModel,e.projectName].filter(e=>!!e?.trim());return t.length===0&&!e.projectRoot?null:(0,R.jsxs)(`div`,{className:`flex min-h-9 min-w-0 items-center gap-1.5 border-b border-gray-200/70 px-3 py-1.5 text-[11px] text-gray-500`,children:[t.map(e=>(0,R.jsx)(h0,{value:e},e)),e.projectRoot?(0,R.jsx)(`span`,{title:e.projectRoot,className:`min-w-0 flex-1 truncate rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 font-mono text-[10px] text-gray-500`,children:e.projectRoot}):null]})}function _0(){return(0,R.jsxs)(`div`,{className:`border-b border-gray-200/70 px-4 py-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm font-semibold text-gray-900`,children:[(0,R.jsx)(Ss,{className:`h-4 w-4 shrink-0 text-primary`}),(0,R.jsx)(`span`,{className:`truncate`,children:b(`chatWorkspaceSideChatDraftTitle`)})]}),(0,R.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-gray-500`,children:b(`chatWorkspaceSideChatDraftSubtitle`)})]})}function v0({activeSelection:e,childSessionTabs:t,filePreviewRefreshVersion:n,sessionKey:r,sessionCronJobs:i,sessionProjectRoot:a,sessionWorkingDir:o}){let s=rl();return e.kind===`overview`?(0,R.jsx)(f0,{childSessionTabs:t,sessionCronJobs:i,sessionKey:r}):e.kind===`project-files`?(0,R.jsx)(m0,{projectRoot:a,workingDir:o}):e.kind===`child-sessions`?(0,R.jsx)(p0,{childSessionTabs:t}):e.kind===`side-chat-draft`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(_0,{}),(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,R.jsx)(D1,{materializationContext:{kind:`child`,parentSessionKey:e.draft.parentSessionKey,inheritContext:!0},sessionKey:null,showWelcomeForDraft:!1,onSessionMaterialized:t=>s.chatThreadManager.materializeSideChatDraft({draftKey:e.draft.draftKey,sessionKey:t})})})]}):e.kind===`child-session`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(g0,{tab:e.tab}),(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,R.jsx)(D1,{sessionKey:e.tab.sessionKey})})]}):e.kind===`file`?(0,R.jsx)(xq,{file:e.file,refreshVersion:n,sessionProjectRoot:a,sessionWorkingDir:o,onFileOpen:s.chatThreadManager.openFilePreview}):(0,R.jsx)(u0,{jobs:i})}function y0({sessionKey:e,childSessionTabs:t,activeChildSessionKey:n,activeSideChatDraft:i,workspaceFileTabs:a,activeWorkspaceFileKey:o,closedWorkspaceTabEntries:s,workspaceNavigationHistory:c=[],workspaceNavigationHistoryIndex:l=0,activePanelKind:u,sessionCronJobs:d=[],sessionProjectRoot:f,sessionWorkingDir:p,workspacePanelWidth:m=480,displayMode:h=`docked`}){let g=rl(),_=Ke(),[v,y]=(0,L.useState)(!1),[b,x]=(0,L.useState)(0),S=tf(t),C=z(e=>e.optimisticReadAtBySessionKey),w=cf({activeChildSessionKey:n,activeSideChatDraft:i,activeWorkspaceFileKey:o,activePanelKind:u,childSessionTabs:S,workspaceFileTabs:a}),T={entries:c,index:l};(0,L.useEffect)(()=>{g.chatThreadManager.syncVisibleWorkspaceSelection(w)},[w,g]);let E=(0,L.useMemo)(()=>uf({resolvedChildTabs:S,activeSideChatDraft:i,closedWorkspaceTabEntries:s,workspaceFileTabs:a,activeSelection:w,optimisticReadAtBySessionKey:C,onSelectSession:g.chatThreadManager.selectChildSessionDetail,onSelectFile:g.chatThreadManager.selectWorkspaceFile,onOpenFileViewer:g.chatThreadManager.openWorkspaceFileViewer,onCloseTab:g.chatThreadManager.closeWorkspaceTab,onSelectOverview:()=>{e&&g.chatThreadManager.openWorkspaceOverview(e)},onSelectChildSessions:()=>{e&&g.chatThreadManager.openChildSessions(e)},onSelectProjectFiles:()=>{e&&g.chatThreadManager.openProjectFiles(e)},onSelectCronJobs:()=>{e&&g.chatThreadManager.openSessionCronPanel(e)}}),[w,i,s,C,g.chatThreadManager,S,e,a]);if(!w)return null;let D=h===`docked`&&v,O=h===`overlay`||D,k=w.kind===`file`&&w.file.viewMode===`preview`?w.file:null,A=k?()=>{_.invalidateQueries({queryKey:uq({path:k.path,basePath:p})}),_.invalidateQueries({queryKey:Fc({path:k.path,basePath:p,includeFiles:!0})}),x(e=>e+1)}:void 0;return(0,R.jsxs)(It,{"data-testid":`chat-session-workspace-panel`,className:r(O?`bg-white`:`hidden border-gray-200/70 bg-white/95 backdrop-blur-sm md:flex`,D?`shadow-xl`:null),defaultWidth:m,width:m,minWidth:360,maxWidth:860,onWidthCommit:g.chatThreadManager.setWorkspacePanelWidth,overlay:O,overlayScope:D?`container`:`viewport`,children:[(0,R.jsx)(mg,{tabs:E,canGoBack:yd(T),canGoForward:bd(T),isMaximized:D,onGoBack:g.chatThreadManager.goBackWorkspacePanel,onGoForward:g.chatThreadManager.goForwardWorkspacePanel,onRefreshFile:A,onToggleMaximize:h===`docked`?()=>y(e=>!e):void 0,onClose:g.chatThreadManager.closeWorkspacePanel}),(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-white`,children:(0,R.jsx)(v0,{activeSelection:w,childSessionTabs:S,filePreviewRefreshVersion:b,sessionKey:e,sessionCronJobs:d,sessionProjectRoot:f,sessionWorkingDir:p})})]})}var b0=[];function x0(e,t){let n=Uu(e=>e.snapshot.sessionsQuery?.data?.sessions??b0),r=(0,L.useMemo)(()=>{let r=e.childSessionTabs.filter(e=>e.parentSessionKey===t),i=new Set(r.map(e=>e.sessionKey));return[...r,...ql(n).filter(e=>e.parentSessionId===t&&!i.has(e.key)).map(e=>({sessionKey:e.key,parentSessionKey:t}))]},[t,n,e.childSessionTabs]),i=(0,L.useMemo)(()=>e.workspaceFileTabs.filter(e=>e.parentSessionKey===t),[t,e.workspaceFileTabs]),a=e.activeSideChatDraft?.parentSessionKey===t?e.activeSideChatDraft:null,o=t0({all:!0});return{childSessionTabs:r,activeSideChatDraft:a,workspaceFileTabs:i,sessionCronJobs:(0,L.useMemo)(()=>(o.data?.jobs??[]).filter(e=>q1(e,t)),[o.data?.jobs,t]),showWorkspacePanel:e.workspacePanelParentKey===t&&e.activeWorkspacePanelKind!=null}}function S0({layoutMode:e,sessionKey:t}){let n=Hd(e=>e.snapshot),r=cd(t),{childSessionTabs:i,activeSideChatDraft:a,workspaceFileTabs:o,sessionCronJobs:s,showWorkspacePanel:c}=x0(n,t);return c?(0,R.jsx)(y0,{sessionKey:t,childSessionTabs:i,activeChildSessionKey:n.activeChildSessionKey??null,activeSideChatDraft:a,workspaceFileTabs:o,activeWorkspaceFileKey:n.activeWorkspaceFileKey??null,closedWorkspaceTabEntries:n.closedWorkspaceTabEntries,workspaceNavigationHistory:n.workspaceNavigationHistory,workspaceNavigationHistoryIndex:n.workspaceNavigationHistoryIndex,activePanelKind:n.activeWorkspacePanelKind??null,sessionCronJobs:s,sessionProjectRoot:r?.projectRoot??null,sessionWorkingDir:r?.workingDir??r?.projectRoot??null,workspacePanelWidth:n.workspacePanelWidth,displayMode:e===`mobile`?`overlay`:`docked`}):null}function C0({layoutMode:e=`desktop`,onBackToList:t}){let n=rl(),r=z(e=>e.snapshot.selectedSessionKey),i=(0,L.useCallback)(e=>{n.chatUiManager.isAtChatRoot()&&n.chatUiManager.goToSession(e,{replace:!0})},[n]);return(0,R.jsxs)(`section`,{className:`relative flex-1 min-h-0 flex overflow-hidden bg-background`,children:[(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,R.jsx)($d,{}),(0,R.jsx)(Qd,{layoutMode:e,onBackToList:t}),(0,R.jsx)(D1,{consumeDraftIntent:!0,sessionKey:r,onSessionMaterialized:i})]}),(0,R.jsx)(S0,{layoutMode:e,sessionKey:r})]})}function w0(){let e=Ac(),[t,n]=(0,L.useState)(null),[r,i]=(0,L.useState)(``),[a,o]=(0,L.useState)(null),s=e=>{n(e.key),i(e.label?.trim()??``)},c=()=>{n(null),i(``),o(null)};return{editingSessionKey:t,draftLabel:r,savingSessionKey:a,setDraftLabel:i,startEditingSessionLabel:s,cancelEditingSessionLabel:c,saveSessionLabel:async t=>{let n=r.trim();if(n===(t.label?.trim()??``)){c();return}o(t.key);try{await e({sessionKey:t.key,label:n||null}),c()}catch{o(null)}}}}var T0=`nextclaw.ui.theme`,E0=`work`,D0=[{value:`work`,labelKey:`themeWork`,appearance:`light`},{value:`night`,labelKey:`themeNight`,appearance:`dark`},{value:`natural`,labelKey:`themeNatural`,appearance:`light`},{value:`minimal`,labelKey:`themeMinimal`,appearance:`light`},{value:`warm`,labelKey:`themeWarm`,appearance:`light`},{value:`cool`,labelKey:`themeCool`,appearance:`light`},{value:`dawn`,labelKey:`themeDawn`,appearance:`light`},{value:`graphite`,labelKey:`themeGraphite`,appearance:`light`},{value:`probe`,labelKey:`themeProbe`,appearance:`light`}],O0=D0.map(({value:e})=>e),k0=D0.map(({value:e,labelKey:t})=>({value:e,labelKey:t}));function A0(e){return typeof e==`string`?O0.includes(e)?e:e===`leaf`?`warm`:null:null}function j0(e){return D0.find(t=>t.value===e)?.appearance??`light`}var M0=new class{constructor(){this.activeTheme=E0,this.initialized=!1,this.listeners=new Set,this.resolveInitialTheme=()=>{if(typeof window>`u`)return E0;try{let e=A0(window.localStorage.getItem(T0));if(e)return e}catch{}return E0},this.initializeTheme=()=>(this.initialized||=(this.activeTheme=this.resolveInitialTheme(),this.applyThemeAttribute(this.activeTheme),!0),this.activeTheme),this.getTheme=()=>this.initialized?this.activeTheme:this.initializeTheme(),this.setTheme=e=>{this.initializeTheme(),e!==this.activeTheme&&(this.activeTheme=e,this.applyThemeAttribute(this.activeTheme),this.saveTheme(this.activeTheme),this.listeners.forEach(e=>e(this.activeTheme)))},this.subscribeThemeChange=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.applyThemeAttribute=e=>{if(typeof document>`u`)return;let t=j0(e);document.documentElement.setAttribute(`data-theme`,e),document.documentElement.setAttribute(`data-theme-appearance`,t),document.documentElement.style.colorScheme=t},this.saveTheme=e=>{if(!(typeof window>`u`))try{window.localStorage.setItem(T0,e)}catch{}}}};function N0(){return M0.initializeTheme()}function P0(){return M0.getTheme()}function F0(e){M0.setTheme(e)}function I0(e){return M0.subscribeThemeChange(e)}var L0=`nextclaw-pwa-install-banner-dismissed`,R0=`nextclaw-pwa-install-banner-dismissed-until`;function z0(){let e=H0();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:U0(e):!1}function B0(){let e=H0();e?.setItem(L0,`1`),e?.removeItem(R0)}function V0(){let e=H0();e?.removeItem(L0),e?.removeItem(R0)}function H0(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function U0(e){let t=e.getItem(R0);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(R0),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(L0,`1`),!0)}function W0(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:z0()}}var G0=x(()=>W0()),K0=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),G0.setState(W0())},this.refreshState=()=>{let e=this.resolveInstallability();G0.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:z0()}))},this.dismissInstallPrompt=()=>{B0(),G0.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let e=this.resolveInstallability();if(e.installability!==`available`)return`unavailable`;if(e.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let t=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,t.outcome===`accepted`?(V0(),this.refreshState(),P.success(b(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,V0(),G0.setState({dismissedInstallPrompt:!0}),P.success(b(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}};function q0(){let e=G0(e=>e.installability);return(0,R.jsx)(`span`,{className:r(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:J0(e)})}function J0(e){return b(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function Y0(e,t,n){return b(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function X0(){let e=G0(e=>e.installability),t=G0(e=>e.installMethod),n=G0(e=>e.blockedReason);return(0,R.jsx)(te,{title:b(`pwaInstallTitle`),description:b(`pwaInstallDescription`),actions:(0,R.jsx)(q0,{}),children:(0,R.jsx)(ge,{children:(0,R.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,R.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:Y0(e,t,n)}),e===`available`&&t===`prompt`?(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,R.jsxs)(F,{type:`button`,className:`gap-2`,onClick:()=>void K0.promptInstall(),children:[(0,R.jsx)(wn,{className:`h-4 w-4`}),b(`pwaInstallAction`)]}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:b(`pwaInstallPromptHint`)})]}):null,e===`available`&&t===`manual`?(0,R.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-background/65 p-4`,children:[(0,R.jsx)(Ws,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,R.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:b(`pwaInstallManualHint`)})]}):null]})})})}function Z0(){let e=G0(e=>e.installability),t=G0(e=>e.installMethod),n=G0(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||n?null:(0,R.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:b(`pwaInstallBannerTitle`)}),(0,R.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:b(`pwaInstallBannerDescription`)})]}),(0,R.jsx)(`button`,{type:`button`,"aria-label":b(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{K0.dismissInstallPrompt()},children:(0,R.jsx)(qn,{className:`h-4 w-4`})})]}),(0,R.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,R.jsxs)(F,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{K0.promptInstall()},children:[(0,R.jsx)(wn,{className:`h-4 w-4`}),b(`pwaInstallAction`)]}),(0,R.jsx)(F,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{K0.dismissInstallPrompt()},children:b(`pwaInstallDismiss`)})]})]})}var Q0=new class{constructor(){this.started=!1,this.registration=null,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{this.registration=await navigator.serviceWorker.register(`/sw.js`)}catch{return}}},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(this.started=!1,this.registration=null)},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));await Promise.all(e.map(async e=>await e.unregister())),e.length>0&&await this.clearNextClawCaches()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))}}},$0=!1;function e2(){$0||typeof window>`u`||($0=!0,K0.start(),Q0.start())}var t2={natural:`#FAF9F7`,work:`#FFFFFF`,minimal:`#FFFFFF`,warm:`#FAF8F4`,cool:`#F8FAFC`,dawn:`#FAF7F4`,graphite:`#F8F8F7`,night:`#101318`,probe:`#FEFCF6`},n2=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=t2[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=j0(e)},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`);this.syncTheme(A0(e)??`work`)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}},r2=(0,L.createContext)(null);function i2({children:e}){let[t,n]=(0,L.useState)(()=>N0());(0,L.useEffect)(()=>{n2.syncTheme(t)},[t]),(0,L.useEffect)(()=>I0(e=>{n(e)}),[]);let r=(0,L.useCallback)(e=>{F0(e),n(P0())},[]),i=(0,L.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,R.jsx)(r2.Provider,{value:i,children:e})}function a2(){let e=(0,L.useContext)(r2);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function o2({sessionKey:e,draftLabel:t,isSaving:n,onDraftLabelChange:r,onSave:i,onCancel:a}){return(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(ae,{value:t,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),i()):e.key===`Escape`&&(e.preventDefault(),a())},placeholder:b(`sessionsLabelPlaceholder`),className:`h-8 rounded-lg border-gray-300 bg-white text-xs`,autoFocus:!0,disabled:n}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`div`,{className:`min-w-0 text-[11px] text-gray-400 truncate`,children:e}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(Nt,{icon:(0,R.jsx)(fn,{className:`h-3.5 w-3.5`}),label:b(`save`),tooltip:!1,onClick:()=>void i(),disabled:n}),(0,R.jsx)(Nt,{icon:(0,R.jsx)(qn,{className:`h-3.5 w-3.5`}),label:b(`cancel`),tooltip:!1,onClick:a,disabled:n})]})]})]})}function s2({active:e,showUnreadDot:t,runStatus:n,context:i,isPinned:a,title:o,previewText:s,trailingText:c,agentId:l,agentLabel:u,agentAvatarUrl:d,childSessionCount:f=0,onSelect:p,onOpenChildSessions:m,onStartEditing:h,onTogglePinned:g}){return(0,R.jsxs)(`div`,{className:`group/session relative`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:p,className:`w-full text-left`,children:[(0,R.jsx)(`div`,{className:r(`flex min-h-6 min-w-0 items-center`,f>0&&m?`pr-20`:`pr-12`),children:(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[l?.trim()&&l.trim().toLowerCase()!==`main`?(0,R.jsx)(Gd,{agentId:l,displayName:u,avatarUrl:d,className:`h-5 w-5 shrink-0`}):null,(0,R.jsx)(`span`,{className:`truncate leading-6 font-medium`,children:o}),i.label?(0,R.jsx)(`span`,{className:r(`shrink-0 rounded-full border px-1.5 py-0.5 text-[10px] font-semibold leading-none`,e?`border-gray-300 bg-white/80 text-gray-700`:`border-gray-200 bg-gray-100 text-gray-500`),children:i.label}):null,i.icon?(0,R.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,R.jsx)(Fu,{icon:i.icon,className:r(`h-[13px] w-[13px]`,e?`text-gray-700`:`text-gray-500`)})}):null]})}),(0,R.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[11px] text-gray-400`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t?(0,R.jsx)(`span`,{"aria-label":b(`chatSessionUnread`),className:`ml-auto h-2 w-2 shrink-0 rounded-full bg-primary`}):(0,R.jsx)(`span`,{className:`ml-auto shrink-0`,children:c})]})]}),f>0&&m?(0,R.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),m()},className:`pointer-events-none absolute right-12 top-0 inline-flex h-6 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium text-muted-foreground opacity-0 transition-colors hover:bg-black/10 hover:text-foreground group-hover/session:pointer-events-auto group-hover/session:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100`,"aria-label":b(`chatSessionOpenChildSessions`),title:b(`chatSessionOpenChildSessions`),children:[(0,R.jsx)(os,{className:`h-3.5 w-3.5`}),(0,R.jsx)(`span`,{children:f})]}):null,n?(0,R.jsx)(`span`,{className:`absolute right-0 top-0 inline-flex h-6 w-6 items-center justify-center transition-opacity group-hover/session:opacity-0`,children:(0,R.jsx)(Lu,{status:n})}):null,(0,R.jsxs)(`div`,{className:`pointer-events-none absolute right-0 top-0 flex h-6 items-center gap-0.5 opacity-0 transition-opacity group-hover/session:pointer-events-auto group-hover/session:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100`,children:[(0,R.jsx)(Nt,{size:`sm`,tone:`strong`,icon:(0,R.jsx)(Ft,{className:r(`h-3.5 w-3.5`,a&&`fill-current text-foreground`)}),label:b(a?`chatSidebarUnpinSession`:`chatSidebarPinSession`),tooltipSide:`right`,onClick:e=>{e.stopPropagation(),g()}}),(0,R.jsx)(Nt,{size:`sm`,tone:`strong`,icon:(0,R.jsx)(Ps,{className:`h-3.5 w-3.5`}),label:b(`edit`),tooltipSide:`right`,onClick:e=>{e.stopPropagation(),h()}})]})]})}function c2({sessionKey:e,active:t,showUnreadDot:n,runStatus:i,context:a,isPinned:o,title:s,previewText:c,trailingText:l,agentId:u,agentLabel:d,agentAvatarUrl:f,childSessionCount:p,isEditing:m,draftLabel:h,isSaving:g,onSelect:_,onOpenChildSessions:v,onStartEditing:y,onDraftLabelChange:b,onSave:x,onCancel:S,onTogglePinned:C}){return(0,R.jsx)(`div`,{className:r(`w-full rounded-xl px-3 py-2.5 text-left transition-all text-[13px]`,t?`bg-gray-200/80 text-gray-900 font-semibold shadow-sm`:`text-gray-700 hover:bg-gray-200/60 hover:text-gray-900`),children:m?(0,R.jsx)(o2,{sessionKey:e,draftLabel:h,isSaving:g,onDraftLabelChange:b,onSave:x,onCancel:S}):(0,R.jsx)(s2,{active:t,showUnreadDot:n,runStatus:i,context:a,isPinned:o,title:s,previewText:c,trailingText:l,agentId:u,agentLabel:d,agentAvatarUrl:f,onSelect:_,childSessionCount:p,onOpenChildSessions:v,onStartEditing:y,onTogglePinned:C})})}function l2(e){let{item:t,selectedSessionKey:n,optimisticReadAtBySessionKey:r,agentsById:i,childSessionsByParentKey:a,editingSessionKey:o,draftLabel:s,savingSessionKey:c,sessionTypeOptions:l,isPinned:u,sessionTitle:d,onSelectSession:f,onOpenChildSessions:p,onStartEditingSessionLabel:m,onDraftLabelChange:h,onSaveSessionLabel:g,onCancelEditingSessionLabel:_,onTogglePinned:v}=e,{session:y,runStatus:b}=t,x=n===y.key,S=r[y.key],C=S&&y.readAt?S.localeCompare(y.readAt)>0?S:y.readAt:S??y.readAt,w=a.get(y.key)??[],T=y.agentId?i.get(y.agentId)?.displayName??y.agentId:null,E=al(y)??`${T?.trim()?`${T} · `:``}${y.messageCount}`;return(0,R.jsx)(c2,{sessionKey:y.key,active:x,showUnreadDot:eu({active:x,lastMessageAt:y.lastMessageAt,readAt:C,runStatus:b}),runStatus:b,context:ju(y,l),isPinned:u,title:d(y),previewText:E,trailingText:ll(y.lastMessageAt??y.createdAt),agentId:y.agentId??null,agentLabel:T,agentAvatarUrl:y.agentId?i.get(y.agentId)?.avatarUrl??null:null,childSessionCount:w.length,isEditing:o===y.key,draftLabel:s,isSaving:c===y.key,onSelect:()=>f(y.key),onOpenChildSessions:()=>p(y.key,w[0]?.session.key??null),onStartEditing:()=>m(y),onDraftLabelChange:h,onSave:()=>g(y),onCancel:_,onTogglePinned:v})}var u2={maxHeight:tt(`18rem`)};function d2({className:e,onSelect:t,options:n,selectedSessionType:i,title:a=b(`chatSessionTypeLabel`),titleClassName:o}){return(0,R.jsxs)(`div`,{className:r(`space-y-1 overflow-y-auto overscroll-contain`,e),style:u2,children:[(0,R.jsx)(`div`,{className:r(`px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.18em] text-gray-400`,o),children:a}),n.map(e=>(0,R.jsx)(UZ,{disabled:e.ready===!1,option:e,selected:e.value===i,onSelect:()=>t(e.value)},e.value))]})}var f2=`w-[56px]`,p2=`px-2`,m2=`h-9 w-9 rounded-xl`,h2=`h-4 w-4`,g2=`space-y-1`,_2=`gap-1`,v2=`[mask-image:linear-gradient(to_bottom,black_calc(100%_-_28px),transparent)] [-webkit-mask-image:linear-gradient(to_bottom,black_calc(100%_-_28px),transparent)]`,y2=`text-muted-foreground transition-colors duration-base hover:bg-gray-200/60 hover:text-gray-900 active:bg-gray-200/80 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,b2=`bg-gray-200/80 text-gray-900`,x2=`brandSoft`,S2={neutralSurface:{leftVariant:`ghost`,leftClassName:`bg-card text-foreground shadow-none transition-[background-color,color,box-shadow] hover:bg-accent hover:text-accent-foreground hover:shadow-sm active:bg-accent`,rightClassName:`bg-card text-muted-foreground shadow-none transition-[background-color,color,box-shadow] hover:bg-accent hover:text-accent-foreground hover:shadow-sm active:bg-accent`},brandSoft:{leftVariant:`ghost`,leftClassName:`bg-primary/10 text-primary shadow-none ring-1 ring-primary/10 transition-[background-color,color,box-shadow] hover:bg-primary/15 hover:text-primary-700 hover:shadow-sm active:bg-primary/20`,rightClassName:`bg-primary/10 text-primary shadow-none ring-1 ring-primary/10 transition-[background-color,color,box-shadow] hover:bg-primary/15 hover:text-primary-700 hover:shadow-sm active:bg-primary/20`},brandTextSurface:{leftVariant:`ghost`,leftClassName:`bg-card text-primary shadow-none transition-[background-color,color,box-shadow] hover:bg-accent hover:text-primary-700 hover:shadow-sm active:bg-primary/15`,rightClassName:`bg-card text-primary shadow-none transition-[background-color,color,box-shadow] hover:bg-accent hover:text-primary-700 hover:shadow-sm active:bg-primary/15`},brandSolid:{leftVariant:`primary`,leftClassName:``,rightClassName:`bg-primary text-primary-foreground shadow-sm hover:bg-primary-600 hover:text-primary-foreground active:bg-primary-700`}};function C2({option:e}){return e?.icon?.src?(0,R.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,R.jsx)(Fu,{icon:{kind:`runtime-image`,src:e.icon.src,alt:e.icon.alt??null,name:e.label},className:`h-4 w-4`})}):(0,R.jsx)(So,{className:`h-4 w-4 shrink-0`})}function w2(e){let{query:t,selectedNewSessionType:n,selectedNewSessionTypeOption:i,sessionTypeOptions:a,isCreateMenuOpen:o,onCreateMenuOpenChange:s,onCreateSession:c,onSelectNewSessionType:l,onQueryChange:u,collapsed:d=!1}=e,f=a.length>1,p=S2[x2];return d?(0,R.jsx)(`div`,{className:`px-2 pb-2`,children:(0,R.jsxs)(`div`,{className:r(`flex flex-col items-center`,_2),children:[(0,R.jsx)(Nt,{icon:(0,R.jsx)(Wn,{className:h2}),label:b(`chatSidebarNewTask`),className:r(m2,y2),onClick:()=>{s(!1),c(n)}}),f?(0,R.jsxs)(ct,{open:o,onOpenChange:s,children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(Nt,{icon:(0,R.jsx)(C2,{option:i}),label:b(`chatSessionTypeLabel`),className:r(m2,y2)})}),(0,R.jsx)(ot,{align:`start`,side:`right`,className:`w-56 rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,children:(0,R.jsx)(d2,{options:a,selectedSessionType:n,onSelect:e=>{l(e),s(!1)}})})]}):null]})}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`px-4 pb-3`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(F,{variant:p.leftVariant,className:r(`min-w-0 rounded-xl`,p.leftClassName,f?`flex-1 rounded-r-md`:`w-full`),onClick:()=>{s(!1),c(n)},children:[(0,R.jsx)(Wn,{className:`mr-2 h-4 w-4`}),b(`chatSidebarNewTask`)]}),f?(0,R.jsxs)(ct,{open:o,onOpenChange:s,children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(Nt,{icon:(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,R.jsx)(C2,{option:i}),(0,R.jsx)(Wt,{className:`h-3 w-3 opacity-60`})]}),label:b(`chatSessionTypeLabel`),tooltip:b(`chatSessionTypeLabel`),className:r(`h-9 w-12 shrink-0 rounded-xl rounded-l-md`,p.rightClassName)})}),(0,R.jsx)(ot,{align:`end`,className:`w-56 rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,children:(0,R.jsx)(d2,{options:a,selectedSessionType:n,onSelect:e=>{l(e),s(!1)}})})]}):null]})}),(0,R.jsx)(`div`,{className:`px-4 pb-3`,children:(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(Tt,{className:`pointer-events-none absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground/70`}),(0,R.jsx)(ae,{value:t,onChange:e=>u(e.target.value),placeholder:b(`chatSidebarSearchPlaceholder`),className:`h-9 rounded-lg pl-8 text-xs`})]})})]})}function T2(e){let{query:t,defaultSessionType:n,sessionTypeOptions:r,isCreateMenuOpen:i,onCreateMenuOpenChange:a,onCreateSession:o,onQueryChange:s}=e,c=r.length>1;return(0,R.jsx)(`div`,{className:`px-4 pb-2 pt-1`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,R.jsx)(Tt,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/70`}),(0,R.jsx)(ae,{value:t,onChange:e=>s(e.target.value),placeholder:b(`chatSidebarSearchPlaceholder`),className:`h-9 rounded-full border-transparent bg-muted pl-9 pr-3 text-[13px] shadow-none focus:border-border focus:bg-card`})]}),c?(0,R.jsxs)(ct,{open:i,onOpenChange:a,children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(Nt,{icon:(0,R.jsx)(Wn,{className:`h-4 w-4`}),label:b(`chatSidebarNewTask`),tooltip:!1,className:`h-9 w-9 shrink-0 rounded-full bg-muted text-foreground shadow-none hover:bg-accent hover:text-accent-foreground`})}),(0,R.jsx)(ot,{align:`end`,className:`w-60 rounded-3xl border border-border bg-popover p-2 text-popover-foreground shadow-[0_24px_70px_-30px_rgba(15,23,42,0.45)]`,children:(0,R.jsx)(d2,{options:r,selectedSessionType:n,title:b(`chatSidebarNewTask`),titleClassName:`pb-1.5 text-[11px] font-medium normal-case tracking-normal`,onSelect:e=>{o(e),a(!1)}})})]}):(0,R.jsx)(Nt,{icon:(0,R.jsx)(Wn,{className:`h-4 w-4`}),label:b(`chatSidebarNewTask`),className:`h-9 w-9 shrink-0 rounded-full bg-muted text-foreground shadow-none hover:bg-accent hover:text-accent-foreground`,onClick:()=>o(n)})]})})}function E2(){return O({queryKey:[`app-meta`],queryFn:ie,staleTime:1/0})}var D2={healthy:`bg-emerald-500 shadow-[0_0_0_3px_rgba(16,185,129,0.14)]`,attention:`bg-amber-400 shadow-[0_0_0_3px_rgba(251,191,36,0.16)]`,inactive:`bg-muted-foreground/45 shadow-[0_0_0_3px_rgba(156,163,175,0.12)]`};function O2(){let e=oe(),t=e.actionLabel===b(`runtimeStatusRestartAction`),n=()=>{e.tone!==`healthy`&&ne.requestRuntimeBootstrapProbeNow()},i=async()=>{if(t)try{let e=await ne.runRuntimeControlAction(`restart-service`);P.success(e.message)}catch(e){let t=e instanceof Error?e.message:b(`runtimeControlActionFailed`);P.error(`${b(`runtimeControlActionFailed`)}: ${t}`)}};return(0,R.jsxs)(ct,{children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,className:`inline-flex items-center justify-center rounded-full p-0.5 transition-transform hover:scale-105`,"aria-label":e.title,title:e.title,"data-testid":`runtime-status-entry`,onClick:n,children:(0,R.jsx)(`span`,{className:r(`h-2.5 w-2.5 rounded-full`,D2[e.tone])})})}),(0,R.jsxs)(ot,{align:`start`,sideOffset:10,className:`w-[290px] space-y-3 rounded-2xl border border-border bg-popover p-4 text-popover-foreground`,children:[(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.title}),(0,R.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:e.description})]}),e.reasonLines.length>0?(0,R.jsx)(`div`,{className:`space-y-2`,children:e.reasonLines.map(e=>(0,R.jsx)(`div`,{className:`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-xs leading-5 text-amber-900`,children:e},e))}):null,e.actionLabel?(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border/70 pt-1`,children:[(0,R.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:b(`runtimeStatusActionHint`)}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>void i(),disabled:e.isBusy,className:`text-sm font-semibold text-primary transition-colors hover:text-primary-hover disabled:text-muted-foreground/45`,children:e.isBusy?b(`runtimeStatusRestartingAction`):e.actionLabel})]}):null]})]})}function k2({className:e,density:t=`sidebar`,suffix:n}){let{data:i}=E2(),{supported:a,busyAction:o,snapshot:s}=Ne(),c=i?.name??`NextClaw`,l=i?.productVersion?.trim(),u=l?`v${l}`:null,d=pe(l),f=n??(0,R.jsx)(O2,{}),p=typeof window<`u`&&window.nextclawDesktop?.platform===`darwin`,m=t===`chrome`;return(0,R.jsxs)(`div`,{className:r(e??`flex min-w-0 items-center gap-2`,p&&`pl-[58px]`),children:[(0,R.jsx)(`div`,{className:r(`flex shrink-0 items-center justify-center overflow-hidden`,`h-6 w-6 rounded-md`),children:(0,R.jsx)(`img`,{src:`/logo.svg`,alt:c,className:`h-full w-full object-contain`})}),(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,R.jsx)(`span`,{className:r(`shrink-0 font-semibold text-gray-800`,m?`text-[15px]`:`text-[14px]`),children:c}),u?(0,R.jsx)(A2,{versionLabel:u,density:t,releaseNotesLink:d}):null]}),(0,R.jsx)(j2,{supported:a,busyAction:o,snapshot:s}),f?(0,R.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:f}):null]})]})}function A2({versionLabel:e,density:t,releaseNotesLink:n}){let i=r(`block min-w-0 flex-1 truncate font-medium text-gray-500 outline-none`,`text-[12px]`,n&&`cursor-pointer rounded-sm transition-colors hover:text-gray-700 hover:underline focus-visible:ring-2 focus-visible:ring-gray-300`),a=n?[b(`desktopUpdatesVersionTooltipCurrent`).replace(`{version}`,e),b(`desktopUpdatesVersionTooltipReleaseNotes`).replace(`{version}`,n.versionLabel)].join(`
|
|
105
|
-
`):e;return(0,R.jsx)(Bt,{delayDuration:250,children:(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:n?(0,R.jsx)(An,{href:n.url,external:!0,icon:null,"aria-label":b(`desktopUpdatesVersionReleaseNotesLabel`).replace(`{currentVersion}`,e).replace(`{releaseVersion}`,n.versionLabel),className:r(i,`p-0 text-left`),children:e}):(0,R.jsx)(`span`,{tabIndex:0,"aria-label":e,className:i,children:e})}),(0,R.jsx)(Lt,{side:`bottom`,className:`max-w-72 whitespace-pre-line text-xs leading-relaxed`,children:a})]})})}function j2({supported:e,busyAction:t,snapshot:n}){if(!e||!n)return null;let r=Fe(n);return n.status===`downloading`?(0,R.jsx)(N2,{snapshot:n,releaseNotesLink:r}):n.status===`blocked`||n.status===`failed`?(0,R.jsx)(N2,{snapshot:n}):n.status===`downloaded`?(0,R.jsx)(M2,{link:r,children:(0,R.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-emerald-50 px-2 text-[11px] font-semibold leading-none text-emerald-700 ring-1 ring-emerald-100 transition-colors hover:bg-emerald-100 disabled:opacity-70`,disabled:t===`applying`,onClick:()=>void k.applyDownloadedUpdate(),children:b(t===`applying`?`desktopUpdatesInlineApplying`:`desktopUpdatesInlineReady`)})}):n.status===`update-available`?(0,R.jsx)(M2,{link:r,children:(0,R.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 transition-colors hover:bg-amber-100 disabled:opacity-70`,disabled:t===`downloading`,onClick:()=>void k.downloadUpdate(),children:b(t===`downloading`?`desktopUpdatesInlineDownloading`:`desktopUpdatesInlineDownload`)})}):null}function M2({children:e,link:t}){if(!t)return e;let n=b(`desktopUpdatesUpdateReleaseNotesLabel`).replace(`{version}`,t.versionLabel);return(0,R.jsxs)(`span`,{className:`group/update-release-notes relative inline-flex shrink-0`,children:[e,(0,R.jsx)(`span`,{"data-update-release-notes-hover":`true`,className:`invisible pointer-events-none absolute left-1/2 top-full z-[var(--z-tooltip,10150)] -translate-x-1/2 pt-1 opacity-0 transition-opacity group-hover/update-release-notes:visible group-hover/update-release-notes:pointer-events-auto group-hover/update-release-notes:opacity-100 group-focus-within/update-release-notes:visible group-focus-within/update-release-notes:pointer-events-auto group-focus-within/update-release-notes:opacity-100`,children:(0,R.jsx)(An,{href:t.url,external:!0,icon:null,"aria-label":n,className:`whitespace-nowrap rounded-md border bg-popover px-3 py-1.5 text-left text-xs font-medium text-popover-foreground shadow-md outline-none transition-colors hover:bg-gray-100 focus-visible:ring-2 focus-visible:ring-gray-300`,children:n})})]})}function N2({snapshot:e,releaseNotesLink:t}){if(e.status===`blocked`||e.status===`failed`)return(0,R.jsx)(P2,{snapshot:e});let n=e.status===`downloading`?I2(e):null;return n?(0,R.jsx)(M2,{link:t??null,children:(0,R.jsx)(`span`,{tabIndex:t?0:void 0,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 outline-none transition-colors hover:bg-amber-100 focus-visible:ring-2 focus-visible:ring-amber-300`,children:n})}):null}function P2({snapshot:e}){let t=F2(e),n=e.recoveryCommand?.trim()||null,r=e.diagnosticCommand?.trim()?b(`desktopUpdatesDiagnosticCommand`).replace(`{command}`,e.diagnosticCommand.trim()):null,i=e.errorMessage?.trim()||e.blockReason?.trim()||null,a=[t,e.status===`blocked`&&e.blockReason?b(`desktopUpdatesBlockedRootCause.${e.blockReason}`):null,i,n,r].filter(Boolean).join(`
|
|
106
|
-
`);return(0,R.jsx)(Bt,{delayDuration:250,children:(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(`span`,{role:`img`,"aria-label":t,tabIndex:0,className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-50 text-[13px] font-bold leading-none text-amber-700 ring-1 ring-amber-100 outline-none focus-visible:ring-2 focus-visible:ring-amber-300`,children:`!`})}),(0,R.jsx)(Lt,{side:`bottom`,className:`max-w-80 whitespace-pre-line break-words text-xs leading-relaxed`,children:a})]})})}function F2(e){return e.status===`blocked`?b(`desktopUpdatesStatusBlocked`):b(e.failureStage?`desktopUpdatesFailureStage.${e.failureStage}`:`desktopUpdatesStatusFailed`)}function I2(e){let t=e.progress?.percent;return t==null?b(`desktopUpdatesInlineDownloading`):b(`desktopUpdatesInlineDownloadingPercent`).replace(`{percent}`,String(t))}var L2={connected:{dotClass:`bg-emerald-500`},disconnected:{dotClass:`h-2.5 w-2.5 rounded-full border border-gray-400 bg-transparent`},connecting:{dotClass:`text-amber-600`}};function R2({status:e,className:t}){let n=L2[e],i=b(e===`connected`?`connected`:e===`disconnected`?`disconnected`:`connecting`);return(0,R.jsx)(Bt,{delayDuration:250,children:(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(`span`,{role:`status`,"aria-label":i,className:r(`inline-flex h-5 w-5 items-center justify-center`,t),children:e===`connecting`?(0,R.jsx)(Un,{className:r(`h-3 w-3 animate-spin`,n.dotClass)}):(0,R.jsx)(`span`,{className:r(e===`connected`?`h-2 w-2 rounded-full`:``,n.dotClass)})})}),(0,R.jsx)(Lt,{side:`bottom`,className:`text-xs`,children:i})]})})}var z2={default:{row:`gap-3 px-3 py-2.5 text-[14px]`,icon:`h-[17px] w-[17px]`,value:`text-xs`,gap:`gap-3`,stack:`space-y-1`},compact:{row:`gap-2.5 px-3 py-2 text-[13px]`,icon:`h-4 w-4`,value:`text-[11px]`,gap:`gap-2.5`,stack:`space-y-0.5`}};function B2(e){return z2[e]}function V2(e){return B2(e).stack}function H2(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function U2({children:e,label:t,side:n=`right`}){return(0,R.jsx)(Bt,{delayDuration:250,children:(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:e}),(0,R.jsx)(Lt,{side:n,className:`text-xs`,children:t})]})})}function W2({to:e,label:t,icon:n,density:i=`default`,className:a,collapsed:o=!1}){let s=B2(i),{pathname:c}=Ai(),l=H2(c,e),u=(0,R.jsxs)(Qa,{to:e,"aria-label":t,"aria-current":l?`page`:void 0,className:r(`group flex w-full items-center rounded-xl font-medium transition-colors duration-base focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,o?r(m2,`justify-center px-0 py-0`):s.row,l?o?b2:`bg-gray-200/80 text-gray-900 shadow-sm`:o?y2:`text-muted-foreground hover:bg-gray-200/60 hover:text-gray-900`,a),children:[(0,R.jsx)(n,{className:r(o?h2:s.icon,`shrink-0 transition-colors`,l?`text-gray-700`:`text-muted-foreground group-hover:text-gray-700`)}),(0,R.jsx)(`span`,{className:o?`sr-only`:`min-w-0 flex-1 text-left`,children:t})]});return o?(0,R.jsx)(U2,{label:t,children:u}):u}function G2({isCollapsed:e,items:t,density:n,className:i}){return(0,R.jsx)(`ul`,{className:r(V2(n),i),children:t.map(t=>(0,R.jsx)(`li`,{className:e?`flex justify-center`:void 0,children:(0,R.jsx)(W2,{to:t.target,label:t.label,icon:t.icon,density:n,collapsed:e})},t.target))})}function K2({label:e,icon:t,onClick:n,density:i=`default`,className:a,labelClassName:o,trailing:s,trailingClassName:c,testId:l,trailingTestId:u,collapsed:d=!1}){let f=B2(i),p=(0,R.jsxs)(`button`,{type:`button`,onClick:n,"aria-label":e,className:r(`group flex w-full items-center rounded-xl font-medium text-muted-foreground transition-colors duration-base hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,d?r(m2,`justify-center px-0 py-0`,y2):f.row,a),"data-testid":l,children:[(0,R.jsx)(t,{className:r(d?h2:f.icon,`shrink-0 text-muted-foreground transition-colors group-hover:text-gray-700`)}),(0,R.jsx)(`span`,{className:r(d?`sr-only`:`min-w-0 flex-1 text-left`,o),children:e}),!d&&s?(0,R.jsx)(`span`,{className:r(`shrink-0 text-muted-foreground`,f.value,c),"data-testid":u,children:s}):null]});return d?(0,R.jsx)(U2,{label:e,children:p}):p}function q2(e,t){return t.some(t=>t.value===e)?e:t[0]?.value??e}function J2(e){let{groups:t,defaultSessionType:n,sessionTypeOptions:r,renderSessionItem:i}=e,a=rl(),o=z(e=>e.snapshot.collapsedProjectRoots),[s,c]=(0,L.useState)(null),l=(0,L.useMemo)(()=>q2(n,r),[n,r]),u=r.length>1;return(0,R.jsx)(`div`,{className:`space-y-0.5`,children:t.map(e=>{let t=`${b(`chatSidebarNewTask`)} · ${e.projectName}`,n=o.includes(e.projectRoot),d=b(e.isPinned?`chatSidebarUnpinProject`:`chatSidebarPinProject`);return(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`group/project relative h-8 rounded-lg px-2 text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":!n,"aria-label":b(n?`chatSidebarExpandProject`:`chatSidebarCollapseProject`),className:`flex h-full w-full min-w-0 items-center gap-1.5 pr-14 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>a.chatSessionListManager.toggleProjectCollapsed(e.projectRoot),children:[(0,R.jsx)(as,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`truncate text-[11px] font-medium uppercase tracking-wider`,title:e.projectRoot,children:e.projectName}),n?(0,R.jsx)(Ao,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):(0,R.jsx)(Wt,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground/70`,children:e.items.length})]}),(0,R.jsxs)(`div`,{className:`pointer-events-none absolute right-2 top-1/2 flex -translate-y-1/2 items-center opacity-0 transition-opacity group-hover/project:pointer-events-auto group-hover/project:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100`,children:[u?(0,R.jsxs)(ct,{open:s===e.projectRoot,onOpenChange:t=>{c(t?e.projectRoot:null)},children:[(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(Nt,{icon:(0,R.jsx)(Wn,{className:`h-3.5 w-3.5`}),label:t})}),(0,R.jsx)(ot,{align:`end`,className:`w-56 rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,children:(0,R.jsx)(d2,{options:r,selectedSessionType:l,onSelect:t=>{a.chatSessionListManager.createSession({projectRoot:e.projectRoot,sessionType:t}),c(null)}})})]}):(0,R.jsx)(Nt,{icon:(0,R.jsx)(Wn,{className:`h-3.5 w-3.5`}),label:t,onClick:()=>a.chatSessionListManager.createSession({projectRoot:e.projectRoot,sessionType:l})}),(0,R.jsx)(Nt,{icon:(0,R.jsx)(Ft,{className:e.isPinned?`h-3.5 w-3.5 fill-current text-foreground`:`h-3.5 w-3.5`}),label:d,tooltipSide:`right`,onClick:()=>a.chatSessionListManager.toggleProjectPinned(e.projectRoot)})]})]}),n?null:(0,R.jsx)(`div`,{className:`mt-0.5 space-y-0.5 pl-2`,children:e.items.map(i)})]},e.projectRoot)})})}function Y2({label:e}){return(0,R.jsxs)(`div`,{className:`p-4 text-center`,children:[(0,R.jsx)(Cs,{className:`mx-auto mb-2 h-6 w-6 text-muted-foreground/45`}),(0,R.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e})]})}function X2({defaultSessionType:e,groups:t,isLoading:n,isProjectFirstView:r,projectGroups:i,renderSessionItem:a,sessionTypeOptions:o}){return n?(0,R.jsx)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:b(`sessionsLoading`)}):r?i.length===0?(0,R.jsx)(Y2,{label:b(`chatSidebarProjectViewEmpty`)}):(0,R.jsx)(J2,{groups:i,defaultSessionType:e,sessionTypeOptions:o,renderSessionItem:a}):t.length===0?(0,R.jsx)(Y2,{label:b(`sessionsEmpty`)}):(0,R.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`px-2 py-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/70`,children:e.label}),(0,R.jsx)(`div`,{className:`space-y-0.5`,children:e.items.map(a)})]},e.label))})}function Z2({isOpen:e,onOpenChange:t,currentTheme:n,currentThemeLabel:i,themeOptions:a,onSelectTheme:o,currentLanguage:s,currentLanguageLabel:c,languageOptions:l,onSelectLanguage:u,onOpenDocs:d,onOpenApps:f,collapsed:p=!1}){return(0,R.jsxs)(ct,{open:e,onOpenChange:t,children:[p?(0,R.jsx)(Bt,{delayDuration:250,children:(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":b(`settingsMenu`),className:r(`flex items-center justify-center`,m2,y2),children:(0,R.jsx)(Fn,{className:r(h2,`shrink-0 text-muted-foreground`)})})})}),(0,R.jsx)(Lt,{side:`right`,className:`text-xs`,children:b(`settingsMenu`)})]})}):(0,R.jsx)(rt,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"aria-label":b(`settingsMenu`),className:`flex w-full items-center gap-2.5 rounded-xl px-3 py-2 text-[13px] font-medium text-muted-foreground transition-colors duration-base hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,R.jsx)(Fn,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:b(`settings`)}),(0,R.jsxs)(`span`,{className:`max-w-[112px] truncate text-[13px] text-muted-foreground`,children:[i,` / `,c]})]})}),(0,R.jsxs)(ot,{side:p?`right`:`top`,align:p?`end`:`start`,className:`w-64 p-2`,children:[(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsxs)($a,{to:`/settings`,onClick:()=>t(!1),className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,R.jsx)(Fn,{className:`h-4 w-4 text-muted-foreground/70`}),(0,R.jsx)(`span`,{className:`flex-1 text-left`,children:b(`settings`)})]}),[{key:`docs`,icon:Ut,label:b(`docBrowserHelp`),action:d},{key:`apps`,icon:Et,label:b(`appsTitle`),action:f}].map(({key:e,icon:n,label:r,action:i})=>(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{i(),t(!1)},className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,R.jsx)(n,{className:`h-4 w-4 text-muted-foreground/70`}),(0,R.jsx)(`span`,{className:`flex-1 text-left`,children:r})]},e))]}),(0,R.jsx)(`div`,{className:`my-2 h-px bg-border`}),(0,R.jsx)(Q2,{icon:Os,label:b(`theme`),options:a,value:n,valueLabel:i,onSelect:o,onCloseMenu:()=>t(!1)}),(0,R.jsx)(Q2,{icon:ps,label:b(`language`),options:l,value:s,valueLabel:c,onSelect:u,onCloseMenu:()=>t(!1)})]})]})}function Q2({icon:e,label:t,options:n,value:r,valueLabel:i,onSelect:a,onCloseMenu:o}){return(0,R.jsxs)(ln,{value:r,onOpenChange:e=>{e||o()},onValueChange:e=>a(e),children:[(0,R.jsxs)(en,{"aria-label":t,className:`h-auto w-full rounded-lg border-0 bg-transparent px-3 py-2 text-[13px] font-medium text-foreground shadow-none hover:bg-gray-200/60 hover:text-gray-900 focus:ring-0`,indicator:(0,R.jsx)(Ao,{className:`h-4 w-4 text-muted-foreground/70`}),children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,R.jsx)(e,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,R.jsx)(`span`,{className:`text-left`,children:t})]}),(0,R.jsx)(`span`,{className:`ml-auto max-w-[96px] truncate text-[13px] text-muted-foreground`,children:i})]}),(0,R.jsx)(rn,{side:`right`,align:`center`,sideOffset:6,className:`z-[var(--z-tooltip)] min-w-[7rem] rounded-lg`,viewportClassName:`h-auto min-w-[7rem] w-auto`,children:n.map(e=>(0,R.jsx)(sn,{value:e.value,className:`text-[13px]`,children:e.label},e.value))})]})}var $2=x(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null})),e4=new class{constructor(){this.start=async()=>{let e=this.getDesktopApi();if(!e){this.markUnsupported();return}$2.setState({supported:!0,initialized:!1,busyAction:`loading`});try{let t=await e.getPresenceState();$2.setState({supported:!0,initialized:!0,busyAction:null,snapshot:t})}catch(e){$2.setState({supported:!0,initialized:!0,busyAction:null}),P.error(`${b(`runtimePresenceLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.markUnsupported=()=>{$2.setState({supported:!1,initialized:!0,busyAction:null,snapshot:null})},this.updatePreferences=async e=>{let t=this.getDesktopApi();if(!t)throw Error(b(`runtimePresenceLaunchAtLoginUnavailable`));$2.setState({busyAction:`saving-preferences`});try{let n=await t.updatePresencePreferences(e);return $2.setState({supported:!0,initialized:!0,snapshot:n}),P.success(b(`runtimePresenceSaved`)),n}catch(e){throw P.error(`${b(`runtimePresenceSaveFailed`)}: ${this.getErrorMessage(e)}`),e}finally{$2.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:b(`error`)}},t4=x(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null}));new class{constructor(){this.unsubscribe=null,this.subscriptionCount=0,this.start=async()=>{this.subscriptionCount+=1;let e=this.getDesktopApi();if(!e){t4.setState({supported:!1,initialized:!0,snapshot:null});return}this.unsubscribe||=e.onUpdateStateChanged(e=>{t4.setState({supported:!0,initialized:!0,snapshot:e})}),t4.setState({supported:!0,initialized:!1});try{let t=await e.getUpdateState();t4.setState({supported:!0,initialized:!0,snapshot:t})}catch(e){t4.setState({supported:!0,initialized:!0}),P.error(`${b(`desktopUpdatesLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.stop=()=>{this.subscriptionCount=Math.max(0,this.subscriptionCount-1),!(this.subscriptionCount>0)&&(this.unsubscribe?.(),this.unsubscribe=null)},this.checkForUpdates=async()=>{let e;try{e=await this.runSnapshotCommand(`checking`,b(`desktopUpdatesCheckFailed`),async e=>await e.checkForUpdates())}catch{return}if(e.status===`up-to-date`){P.success(b(`desktopUpdatesAlreadyLatest`));return}if(e.status===`update-available`){P.success(b(`desktopUpdatesAvailable`).replace(`{version}`,e.availableVersion??b(`desktopUpdatesUnknownVersion`)));return}if(e.status===`downloaded`){P.success(b(`desktopUpdatesReadyToApply`));return}e.status===`failed`&&e.errorMessage&&P.error(e.errorMessage)},this.downloadUpdate=async()=>{let e;try{e=await this.runSnapshotCommand(`downloading`,b(`desktopUpdatesDownloadFailed`),async e=>await e.downloadUpdate())}catch{return}e.status===`downloaded`&&P.success(b(`desktopUpdatesReadyToApply`))},this.applyDownloadedUpdate=async()=>{try{await this.runSnapshotCommand(`applying`,b(`desktopUpdatesApplyFailed`),async e=>await e.applyDownloadedUpdate())}catch{return}},this.updateChannel=async e=>{if(t4.getState().snapshot?.channel===e)return;let t;try{t=await this.runSnapshotCommand(`switching-channel`,b(`desktopUpdatesChannelChangeFailed`),async t=>await t.updateChannel(e))}catch{return}if(t.status===`update-available`&&t.availableVersion){P.success(b(`desktopUpdatesChannelChangedWithUpdate`).replace(`{channel}`,this.getChannelLabel(e)).replace(`{version}`,t.availableVersion));return}P.success(b(`desktopUpdatesChannelChanged`).replace(`{channel}`,this.getChannelLabel(e)))},this.runSnapshotCommand=async(e,t,n)=>{let r=this.getDesktopApi();if(!r)throw Error(b(`desktopUpdatesDesktopOnlyDescription`));t4.setState({busyAction:e});try{let e=await n(r);return t4.setState({snapshot:e}),e}catch(e){throw P.error(`${t}: ${this.getErrorMessage(e)}`),e}finally{t4.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:b(`error`),this.getChannelLabel=e=>b(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}};function n4(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function r4(e){let t=e.toLowerCase();return t===`/chat`||t.startsWith(`/chat/`)||t===`/skills`||t.startsWith(`/skills/`)||t===`/cron`||t.startsWith(`/cron/`)||t===`/agents`||t.startsWith(`/agents/`)}function i4(e){let t=e.toLowerCase();return t.startsWith(`/chat/`)&&t!==`/chat`}function a4(e){return[{target:`/chat`,label:e(`chat`),icon:xs},{target:`/skills`,label:e(`marketplaceFilterSkills`),icon:wo},{target:`/agents`,label:e(`agentsPageTitle`),icon:So},{target:`/settings`,label:e(`settings`),icon:Fn}]}function o4(e){return[{target:`/model`,label:e(`model`),icon:Vo},{target:`/providers`,label:e(`providers`),icon:_n},{target:`/channels`,label:e(`channels`),icon:Ln},{target:`/appearance`,label:e(`appearance`),icon:Os},{target:`/security`,label:e(`security`),icon:Us},{target:`/search`,label:e(`searchChannels`),icon:Tt},{target:`/updates`,label:e(`updates`),icon:wn},{target:`/remote`,label:e(`remote`),icon:$s},{target:`/runtime`,label:e(`runtime`),icon:Vo},{target:`/secrets`,label:e(`secrets`),icon:zn},{target:`/marketplace/mcp`,label:e(`marketplaceFilterMcp`),icon:tc}]}function s4(e){let t=o4(e);return[{label:e(`settingsGroupBasic`),items:t.slice(0,3)},{label:e(`settingsGroupAdvanced`),items:t.slice(3)}]}function c4(e){let t=e.toLowerCase();return t===`/settings`?!0:o4(e=>e).some(e=>n4(t,e.target))}function l4(e,t){let n=e.toLowerCase(),r=o4(t);if(i4(n))return{title:t(`chat`),backTarget:`/chat`,backLabel:t(`chat`)};if(n===`/chat`)return{title:t(`chat`),backTarget:null,backLabel:null};if(n===`/skills`||n.startsWith(`/skills/`))return{title:t(`marketplaceFilterSkills`),backTarget:null,backLabel:null};if(n===`/agents`||n.startsWith(`/agents/`))return{title:t(`agentsPageTitle`),backTarget:null,backLabel:null};if(n===`/settings`)return{title:t(`settings`),backTarget:null,backLabel:null};for(let e of r)if(n4(n,e.target))return{title:e.label,backTarget:`/settings`,backLabel:t(`settings`)};return{title:t(`settings`),backTarget:null,backLabel:null}}function u4({isCollapsed:e,onToggle:t}){let n=b(e?`sidebarExpand`:`sidebarCollapse`);return(0,R.jsx)(Nt,{icon:(0,R.jsx)(e?As:ks,{className:h2}),label:n,className:r(y2,e&&`h-9 w-9 rounded-xl`),onClick:t})}function d4({isCollapsed:e,onToggle:t}){return(0,R.jsx)(`div`,{className:r(`shrink-0`,e?`px-0 py-1.5`:`px-2 py-2`),children:(0,R.jsxs)(`div`,{className:r(`flex items-center py-1`,e?r(`flex-col px-0`,_2):`gap-2 px-1`),"data-testid":`settings-sidebar-header`,children:[e?(0,R.jsx)(u4,{isCollapsed:e,onToggle:t}):null,(0,R.jsxs)($a,{to:`/chat`,"aria-label":b(`backToMain`),className:r(`group inline-flex min-w-0 items-center rounded-lg text-[12px] font-medium text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e?r(m2,y2,`justify-center p-0`):`gap-1.5 px-1 py-1`),children:[(0,R.jsx)(wt,{className:r(e?h2:`h-3.5 w-3.5`,`shrink-0 text-muted-foreground/75 group-hover:text-gray-700`)}),(0,R.jsx)(`span`,{className:e?`sr-only`:`truncate`,children:b(`backToMain`)})]}),e?null:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`h-4 w-px shrink-0 bg-border`,"aria-hidden":`true`}),(0,R.jsx)(`h1`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-foreground`,children:b(`settings`)}),(0,R.jsx)(`div`,{className:`ml-auto`,children:(0,R.jsx)(u4,{isCollapsed:e,onToggle:t})})]})]})})}function f4({isCollapsed:e,sections:t}){return(0,R.jsx)(`nav`,{className:r(`custom-scrollbar min-h-0 flex-1 overflow-y-auto`,e?`pr-0`:`pr-1`,v2),children:e?(0,R.jsx)(G2,{isCollapsed:e,items:t.flatMap(e=>e.items),density:`compact`,className:r(g2,`pb-3`)}):(0,R.jsx)(`div`,{className:`space-y-3 pb-3`,children:t.map(t=>(0,R.jsxs)(`section`,{"aria-label":t.label,className:`space-y-1`,children:[(0,R.jsx)(`h2`,{className:`px-3 text-[11px] font-semibold text-muted-foreground/70`,children:t.label}),(0,R.jsx)(G2,{isCollapsed:e,items:t.items,density:`compact`})]},t.label))})})}function p4(){let e=s6(),t=sr(),n=nc(),i=Vn(e=>e.isSidebarCollapsed),a=Bn.toggleSidebarCollapsed,o=n.data?.account.email?.trim(),s=!!n.data?.account.loggedIn,c=s4(b),l=i?g2:V2(`compact`);return(0,R.jsxs)(`aside`,{className:r(`shrink-0 flex h-full min-h-0 flex-col overflow-hidden bg-secondary pb-6 transition-[width] duration-200 ease-out`,i?r(f2,p2):`w-[240px] px-4`),"data-sidebar-collapsed":i?`true`:`false`,children:[(0,R.jsx)(d4,{isCollapsed:i,onToggle:a}),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,R.jsx)(f4,{isCollapsed:i,sections:c}),(0,R.jsxs)(`div`,{className:r(`shrink-0 bg-secondary`,i?`mt-2 flex flex-col items-center pt-2`:`mt-2 pt-3`,l),children:[(0,R.jsx)(K2,{onClick:()=>t.open(void 0,{kind:`docs`,title:b(`docBrowserHelp`)}),icon:Ut,label:b(`docBrowserHelp`),density:`compact`,collapsed:i}),(0,R.jsx)(K2,{onClick:()=>e.accountManager.openAccountPanel(),icon:zn,label:b(`remoteAccountEntryManage`),density:`compact`,trailing:s?o||b(`remoteAccountEntryConnected`):b(`remoteAccountEntryDisconnected`),trailingClassName:`max-w-[92px] truncate text-right`,testId:`settings-sidebar-account-entry`,trailingTestId:`settings-sidebar-account-status`,collapsed:i})]})]})]})}var m4=[{action:`minimize`,label:`Minimize`,icon:Ts},{action:`close`,label:`Close`,icon:qn,variant:`danger`}];function h4({sidebarCollapsed:e=!1}){let t=_4()?{action:`toggle-maximize`,label:`Restore`,icon:zo}:{action:`toggle-maximize`,label:`Maximize`,icon:qs};return(0,R.jsxs)(`header`,{className:`desktop-window-drag relative flex h-[var(--desktop-titlebar-height)] shrink-0 bg-secondary after:absolute after:bottom-0 after:left-[var(--desktop-sidebar-width)] after:right-0 after:border-b after:border-border/80`,"data-testid":`desktop-window-chrome`,children:[(0,R.jsx)(`div`,{className:`desktop-window-no-drag absolute left-0 right-0 top-0 h-1`,"data-testid":`desktop-window-chrome-resize-strip`}),(0,R.jsx)(`div`,{className:r(`desktop-window-drag relative z-10 flex h-full w-[var(--desktop-sidebar-width)] shrink-0 items-center bg-secondary text-secondary-foreground`,e?`justify-center px-0`:`pl-4 pr-3`),"data-testid":`desktop-window-chrome-sidebar`,children:e?(0,R.jsx)(`img`,{src:`/logo.svg`,alt:`NextClaw`,className:`h-6 w-6 shrink-0 object-contain`}):(0,R.jsx)(k2,{className:`flex min-w-0 shrink-0 items-center gap-2.5`,density:`chrome`})}),(0,R.jsx)(`div`,{className:`desktop-window-no-drag absolute right-0 top-0 z-20 flex h-full w-[var(--desktop-caption-safe-right)] items-start justify-end`,"data-testid":`desktop-window-controls`,children:[m4[0],t,m4[1]].map(e=>(0,R.jsx)(g4,{control:e},e.action))})]})}function g4({control:e}){let t=e.icon;return(0,R.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,className:e.variant===`danger`?`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-red-500 hover:text-white`:`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-black/10`,onClick:()=>{window.nextclawDesktop?.controlWindow?.(e.action)},children:(0,R.jsx)(t,{className:`h-3.5 w-3.5`})})}function _4(){let[e,t]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{let e=!0,n=window.nextclawDesktop;n?.getWindowState?.().then(n=>{e&&t(n.isMaximized)});let r=n?.onWindowStateChanged?.(e=>{t(e.isMaximized)});return()=>{e=!1,r?.()}},[]),e}function v4(){return typeof window>`u`?null:b4()??window.nextclawDesktop?.platform??null}function y4(){return v4()===`win32`}function b4(){return null}function x4(){let{pathname:e}=Ai(),t=sr();return(0,R.jsx)(`nav`,{"data-testid":`mobile-bottom-nav`,"aria-label":b(`settings`),className:`shrink-0 border-t border-gray-200/80 bg-white/95 backdrop-blur-sm`,style:{paddingBottom:`calc(env(safe-area-inset-bottom, 0px) + 0.25rem)`},children:(0,R.jsxs)(`ul`,{className:`grid grid-cols-5 gap-1 px-2 pt-1`,children:[a4(b).map(t=>{let n=t.target===`/settings`?c4(e):n4(e,t.target);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(Qa,{to:t.target,"aria-current":n?`page`:void 0,"data-testid":n?`mobile-nav-active-indicator`:void 0,className:r(`group flex min-h-[2.875rem] flex-col items-center justify-center gap-0.5 rounded-xl px-2 py-1 text-[10px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,n?`bg-gray-100 text-gray-900`:`text-gray-500 hover:bg-gray-50 hover:text-gray-800`),children:[(0,R.jsx)(t.icon,{className:r(`h-3.5 w-3.5`,n?`text-gray-900`:`text-gray-400`)}),(0,R.jsx)(`span`,{className:`max-w-full truncate`,children:t.label})]})},t.target)}),(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>hY(t),className:`group flex min-h-[2.875rem] w-full flex-col items-center justify-center gap-0.5 rounded-xl px-2 py-1 text-[10px] font-medium text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-800 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,R.jsx)(Et,{className:`h-3.5 w-3.5 text-gray-400`}),(0,R.jsx)(`span`,{className:`max-w-full truncate`,children:b(`appsTitle`)})]})})]})})}function S4({leadingInset:e}){let t=Ni(),{pathname:n}=Ai(),r=l4(n,b);return(0,R.jsx)(`header`,{"data-testid":`mobile-topbar`,className:`shrink-0 border-b border-gray-200/80 bg-white/95 backdrop-blur-sm`,style:{paddingTop:`calc(env(safe-area-inset-top, 0px) + 0.25rem)`},children:(0,R.jsxs)(`div`,{className:`flex min-h-[2.75rem] items-center gap-2 py-1.5 pl-3 pr-3`,style:{paddingLeft:e?`calc(${e} + 0.75rem)`:void 0},children:[r.backTarget?(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(r.backTarget),className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-gray-200 text-gray-600 transition-colors hover:bg-gray-50 hover:text-gray-900`,"aria-label":r.backLabel??b(`backToMain`),children:(0,R.jsx)(wt,{className:`h-4 w-4`})}):null,(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(`h1`,{className:`truncate text-center text-[15px] font-semibold text-gray-900`,children:r.title})}),r.backTarget?(0,R.jsx)(`div`,{className:`h-8 w-8 shrink-0`,"aria-hidden":`true`}):null]})})}var C4=(0,L.lazy)(async()=>({default:(await D(async()=>{let{DocBrowser:e}=await import(`./doc-browser-DsVF1DrS.js`);return{DocBrowser:e}},__vite__mapDeps([25,26,4,27,28,29,30,31,32,33,34,35,36,37]))).DocBrowser}));function w4({pathname:e,isDocBrowserOpen:t,docBrowserDockControls:n,docBrowserRenderers:r={},topbarLeadingInset:i,children:a}){let o=r4(e),s=!i4(e),c=!i4(e);return(0,R.jsxs)(`div`,{className:`flex h-[100svh] flex-col bg-background font-sans text-foreground supports-[height:100dvh]:h-[100dvh]`,children:[s?(0,R.jsx)(S4,{leadingInset:i}):null,(0,R.jsx)(`div`,{className:`relative flex-1 min-h-0 overflow-hidden`,children:o?(0,R.jsx)(`div`,{className:`h-full min-h-0 overflow-hidden`,children:a}):(0,R.jsx)(`main`,{className:`h-full overflow-auto px-4 py-4 custom-scrollbar`,children:(0,R.jsx)(`div`,{className:`mx-auto max-w-3xl animate-fade-in`,children:a})})}),c?(0,R.jsx)(x4,{}):null,t?(0,R.jsx)(L.Suspense,{fallback:null,children:(0,R.jsx)(C4,{customTabRenderers:r,displayMode:`fullscreen`,dockControls:n})}):null]})}function T4(){let e=o4(b);return(0,R.jsx)(`div`,{"data-testid":`mobile-settings-shell`,className:`space-y-3 pb-4`,children:e.map(e=>(0,R.jsxs)($a,{to:e.target,className:({isActive:e})=>r(`flex items-center gap-3 rounded-2xl border border-gray-200/80 bg-white px-4 py-4 shadow-card transition-colors`,e?`border-gray-300 bg-gray-50`:`hover:border-gray-300 hover:bg-gray-50/70`),children:[(0,R.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-gray-100 text-gray-600`,children:(0,R.jsx)(e.icon,{className:`h-4 w-4`})}),(0,R.jsx)(`div`,{className:`min-w-0`,children:(0,R.jsx)(`p`,{className:`truncate text-sm font-semibold text-gray-900`,children:e.label})})]},e.target))})}function E4(){let{pathname:e}=Ai(),t=Ni();return i4(e)?(0,R.jsx)(C0,{layoutMode:`mobile`,onBackToList:()=>t(`/chat`)}):(0,R.jsx)(R4,{variant:`mobile`})}var D4=(0,L.lazy)(async()=>({default:(await D(async()=>{let{DocBrowser:e}=await import(`./doc-browser-DsVF1DrS.js`);return{DocBrowser:e}},__vite__mapDeps([25,26,4,27,28,29,30,31,32,33,34,35,36,37]))).DocBrowser}));function O4({pathname:e,isMobileLayout:t=!1,isDocBrowserOpen:n,docBrowserMode:i,docBrowserDockControls:a,docBrowserRenderers:o={},sideDock:s,children:c}){let l=r4(e),u=Vn(e=>e.isSidebarCollapsed),d=t&&!i4(e),f=y4(),p=u?`56px`:l?`280px`:`240px`;return(0,R.jsxs)(`div`,{className:r(`h-screen flex flex-col overflow-hidden bg-background font-sans text-foreground`,f?`rounded-[10px]`:null),style:f?{"--desktop-titlebar-height":`40px`,"--desktop-caption-safe-right":`140px`,"--desktop-sidebar-width":p}:void 0,children:[f?(0,R.jsx)(h4,{sidebarCollapsed:u}):null,(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[!l&&(0,R.jsx)(p4,{}),(0,R.jsxs)(`div`,{className:`flex-1 flex min-w-0 overflow-hidden relative`,children:[(0,R.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:l?(0,R.jsx)(`div`,{className:`flex-1 h-full overflow-hidden`,children:c}):(0,R.jsx)(`main`,{className:`flex-1 overflow-auto p-8 pb-16 custom-scrollbar`,children:(0,R.jsx)(`div`,{className:`mx-auto h-full max-w-6xl animate-fade-in`,children:c})})}),n&&i===`docked`?(0,R.jsx)(L.Suspense,{fallback:null,children:(0,R.jsx)(D4,{customTabRenderers:o,dockControls:a})}):null,s]})]}),d?(0,R.jsx)(x4,{}):null,n&&i===`floating`?(0,R.jsx)(L.Suspense,{fallback:null,children:(0,R.jsx)(D4,{customTabRenderers:o,dockControls:a})}):null]})}var k4=[{target:`/cron`,label:()=>b(`chatSidebarScheduledTasks`),icon:_o},{target:`/skills`,label:()=>b(`chatSidebarSkills`),icon:wo},{target:`/agents`,label:()=>b(`agentsPageTitle`),icon:So}];function A4({isCollapsed:e}){let t=b(e?`sidebarExpand`:`sidebarCollapse`);return(0,R.jsx)(Nt,{icon:(0,R.jsx)(e?As:ks,{className:h2}),label:t,className:r(y2,e&&`h-9 w-9 rounded-xl`),onClick:Bn.toggleSidebarCollapsed})}function j4({connectionStatus:e,isCollapsed:t}){let n=y4(),i=typeof window<`u`&&window.nextclawDesktop?.platform===`darwin`;return(0,R.jsxs)(`div`,{className:r(`flex items-center`,t?`justify-center px-2 py-1.5`:n?`justify-end px-3 py-1.5`:`gap-2 px-5 py-2`,t&&i?`pt-8`:null),children:[t||n?null:(0,R.jsx)(k2,{className:`flex min-w-0 flex-1 items-center gap-2`,suffix:(0,R.jsx)(R2,{status:e})}),(0,R.jsx)(A4,{isCollapsed:t})]})}function M4({isCollapsed:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:r(`pb-2`,e?`px-0`:`px-3`),children:(0,R.jsx)(`ul`,{className:e?g2:`space-y-0.5`,children:k4.map(t=>(0,R.jsx)(`li`,{className:e?`flex justify-center`:void 0,children:(0,R.jsx)(W2,{to:t.target,label:t.label(),icon:t.icon,density:`compact`,collapsed:e})},t.target))})}),(0,R.jsx)(`div`,{className:r(`border-t border-border/70`,e?`mx-2 my-1.5`:`mx-4`)})]})}function N4({defaultSessionType:e,groups:t,isCollapsed:n,isLoading:i,isProjectFirstView:a,onAddProject:o,onSelectMode:s,projectGroups:c,renderSessionItem:l,sessionTypeOptions:u}){return n?(0,R.jsx)(`div`,{className:`min-h-0 flex-1`,"aria-hidden":`true`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-5 pb-2 pt-3`,children:[(0,R.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground/75`,children:b(`chatSidebarTaskRecords`)}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[a?(0,R.jsx)(Nt,{icon:(0,R.jsx)(Wn,{className:`h-3.5 w-3.5`}),label:b(`chatProjectAdd`),onClick:o}):null,(0,R.jsx)(_u,{isProjectFirstView:a,onSelectMode:s})]})]}),(0,R.jsx)(`div`,{className:r(`custom-scrollbar min-h-0 flex-1 overflow-y-auto px-3 pb-7 pt-2`,v2),children:(0,R.jsx)(X2,{isLoading:i,isProjectFirstView:a,groups:t,projectGroups:c,defaultSessionType:e,sessionTypeOptions:u,renderSessionItem:l})})]})}function P4({currentLanguage:e,currentLanguageLabel:t,currentTheme:n,currentThemeLabel:i,isCollapsed:a,isOpen:o,languageOptions:s,onOpenApps:c,onOpenChange:l,onOpenDocs:u,onSelectLanguage:d,onSelectTheme:f,themeOptions:p}){return(0,R.jsx)(`div`,{className:r(`py-3`,a?r(`flex justify-center`,p2):`px-3`),children:(0,R.jsx)(Z2,{isOpen:o,onOpenChange:l,currentTheme:n,currentThemeLabel:i,themeOptions:p,onSelectTheme:f,currentLanguage:e,currentLanguageLabel:t,languageOptions:s,onSelectLanguage:d,onOpenDocs:u,onOpenApps:c,collapsed:a})})}function F4(e){return b(e===`knowledge-base`?`chatProjectTemplateKnowledgeBase`:`chatProjectTemplateEmpty`)}function I4({open:e,defaultWorkspacePath:t,templates:n,isCreating:r,isAddingExisting:i,createErrorMessage:a,addExistingErrorMessage:o,onOpenChange:s,onCreate:c,onAddExisting:l}){let[u,d]=(0,L.useState)(`create`),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(``),[g,_]=(0,L.useState)(``),[v,y]=(0,L.useState)(!1),[x,S]=(0,L.useState)(`empty`),C=n.length>0?n.map(e=>e.id):[`empty`],w=f.trim(),T=m.trim(),E=g.trim(),D=r||i,O=D||(u===`create`?!w:!E),k=u===`create`?a:o,A=()=>{d(`create`),p(``),h(``),_(``),S(`empty`),y(!1)},ee=()=>{D||(A(),s(!1))};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(_t,{open:e,onOpenChange:e=>{if(e){s(!0);return}ee()},children:(0,R.jsxs)(bt,{className:`sm:max-w-lg`,children:[(0,R.jsxs)(vt,{children:[(0,R.jsx)(xt,{children:b(`chatProjectAddTitle`)}),(0,R.jsx)(mt,{children:b(`chatProjectAddDescription`)})]}),(0,R.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),!O&&(u===`create`?c({name:w,template:x,rootPath:T||void 0}):l({rootPath:E})).then(A).catch(()=>void 0)},children:[(0,R.jsxs)(Rn,{value:u,onValueChange:e=>{D||d(e===`existing`?`existing`:`create`)},children:[(0,R.jsxs)(In,{className:`grid w-full grid-cols-2`,children:[(0,R.jsx)(Nn,{value:`create`,children:b(`chatProjectCreateMode`)}),(0,R.jsx)(Nn,{value:`existing`,children:b(`chatProjectExistingMode`)})]}),(0,R.jsxs)(Pn,{value:`create`,className:`mt-4 space-y-4`,children:[(0,R.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:b(`chatProjectCreateModeDescription`)}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(N,{htmlFor:`chat-project-name`,children:b(`chatProjectNameLabel`)}),(0,R.jsx)(ae,{id:`chat-project-name`,value:f,onChange:e=>p(e.target.value),placeholder:b(`chatProjectNamePlaceholder`),autoFocus:!0,disabled:D})]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(N,{htmlFor:`chat-project-template`,children:b(`chatProjectTemplateLabel`)}),(0,R.jsxs)(ln,{value:x,onValueChange:e=>S(e),disabled:D,children:[(0,R.jsx)(en,{id:`chat-project-template`,children:(0,R.jsx)(qt,{})}),(0,R.jsx)(rn,{children:C.map(e=>(0,R.jsx)(sn,{value:e,children:F4(e)},e))})]})]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(N,{htmlFor:`chat-project-create-root-path`,children:b(`chatProjectCreatePathLabel`)}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(ae,{id:`chat-project-create-root-path`,value:m,onChange:e=>h(e.target.value),placeholder:b(`chatProjectCreatePathPlaceholder`),disabled:D}),(0,R.jsxs)(F,{type:`button`,variant:`outline`,onClick:()=>y(!0),disabled:D,children:[(0,R.jsx)(es,{className:`mr-2 h-4 w-4`}),b(`browse`)]})]}),(0,R.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:b(`chatProjectCreatePathHint`)})]})]}),(0,R.jsxs)(Pn,{value:`existing`,className:`mt-4 space-y-4`,children:[(0,R.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:b(`chatProjectExistingModeDescription`)}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(N,{htmlFor:`chat-project-existing-root-path`,children:b(`chatProjectExistingPathLabel`)}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(ae,{id:`chat-project-existing-root-path`,value:g,onChange:e=>_(e.target.value),placeholder:b(`chatProjectExistingPathPlaceholder`),autoFocus:!0,disabled:D}),(0,R.jsxs)(F,{type:`button`,variant:`outline`,onClick:()=>y(!0),disabled:D,children:[(0,R.jsx)(es,{className:`mr-2 h-4 w-4`}),b(`browse`)]})]}),(0,R.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:b(`chatProjectExistingPathHint`)})]})]})]}),k?(0,R.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:k}):null,(0,R.jsxs)(ut,{children:[(0,R.jsx)(F,{type:`button`,variant:`outline`,onClick:ee,disabled:D,children:b(`cancel`)}),(0,R.jsx)(F,{type:`submit`,disabled:O,children:b(D?`saving`:u===`create`?`chatProjectCreateAction`:`chatProjectExistingAction`)})]})]})]})}),(0,R.jsx)(Jc,{open:v,allowCreateDirectory:u===`create`,currentPath:u===`create`?m:g,defaultWorkspacePath:t,isSaving:!1,onOpenChange:y,onConfirm:e=>{u===`create`?h(e):_(e),y(!1)},title:b(u===`create`?`chatProjectCreatePathPickerTitle`:`chatProjectExistingPathPickerTitle`),description:b(u===`create`?`chatProjectCreatePathPickerDescription`:`chatProjectExistingPathPickerDescription`),pathLabel:b(u===`create`?`chatProjectCreatePathLabel`:`chatProjectExistingPathLabel`),pathPlaceholder:b(u===`create`?`chatProjectCreatePathPlaceholder`:`chatProjectExistingPathPlaceholder`),confirmLabel:b(`selectCurrentDirectory`),hint:b(u===`create`?`chatProjectCreatePathHint`:`chatProjectExistingPathHint`)})]})}function L4(e,t,n){let r=z(e=>e.optimisticReadAtBySessionKey);return(0,L.useEffect)(()=>{(()=>{if(!t)return;let r=e.find(({session:e})=>e.key===t);if(!r||r.runStatus===`running`)return;let{session:i}=r;n(i.key,i.lastMessageAt,i.readAt)})()},[e,n,t]),r}function R4({variant:e=`desktop`}){let t=e===`mobile`,n=rl(),i=sr(),a=Vn(e=>e.isSidebarCollapsed),[o,s]=(0,L.useState)(!1),[c,l]=(0,L.useState)(!1),[u,d]=(0,L.useState)(!1),f=z(e=>e.snapshot),p=Uu(e=>e.snapshot.sessionTypesQuery?.data??null),m=Uu(e=>e.snapshot.configQuery?.data??null),g=ce(),_=Kd(),v=Gu(),y=Ku(),x=qu(),{isLoading:S,items:C}=lu(),{language:w,setLanguage:T}=vn(),{theme:E,setTheme:D}=a2(),O=b(k0.find(e=>e.value===E)?.labelKey??`themeWork`),k=h.find(e=>e.value===w)?.label??w,A=(0,L.useMemo)(()=>k0.map(e=>({value:e.value,label:b(e.labelKey)})),[]),ee=(0,L.useMemo)(()=>h.map(e=>({value:e.value,label:e.label})),[]),j=(0,L.useMemo)(()=>new Map((_.data?.agents??[]).map(e=>[e.id,e])),[_.data?.agents]),M=(0,L.useMemo)(()=>new Set(f.pinnedSessionKeys),[f.pinnedSessionKeys]),N=(0,L.useMemo)(()=>new Set(f.pinnedProjectRoots),[f.pinnedProjectRoots]),te=(0,L.useMemo)(()=>du(C),[C]),ne=(0,L.useMemo)(()=>hu(C),[C]),re=(0,L.useMemo)(()=>pu(te,M),[M,te]),ie=(0,L.useMemo)(()=>mu(te,M,N,v.data?.projects??[]),[N,M,v.data?.projects,te]),ae=(0,L.useMemo)(()=>Su(p?.options??[]),[p?.options]),oe=(0,L.useMemo)(()=>yu(p?.defaultType??`native`),[p?.defaultType]),se=ad({defaultSessionType:oe,sessionTypeOptions:ae}),le=f.listMode===`project-first`,ue=!t&&a,de=L4(C,f.selectedSessionKey,n.chatSessionListManager.markSessionRead),{editingSessionKey:fe,draftLabel:pe,savingSessionKey:me,setDraftLabel:he,startEditingSessionLabel:ge,cancelEditingSessionLabel:_e,saveSessionLabel:ve}=w0(),ye=e=>{w!==e&&(T(e),window.location.reload())},be=e=>(0,R.jsx)(l2,{item:e,selectedSessionKey:f.selectedSessionKey,optimisticReadAtBySessionKey:de,agentsById:j,childSessionsByParentKey:ne,editingSessionKey:fe,draftLabel:pe,savingSessionKey:me,sessionTypeOptions:ae,isPinned:M.has(e.session.key),sessionTitle:gu,onSelectSession:n.chatSessionListManager.selectSession,onOpenChildSessions:(e,t)=>n.chatThreadManager.openChildSessionPanel({parentSessionKey:e,activeChildSessionKey:t}),onStartEditingSessionLabel:ge,onDraftLabelChange:he,onSaveSessionLabel:ve,onCancelEditingSessionLabel:_e,onTogglePinned:()=>n.chatSessionListManager.toggleSessionPinned(e.session.key)},e.session.key),P=(e,t)=>{n.chatSessionListManager.createSession({projectRoot:typeof t==`string`?t:void 0,sessionType:e})},xe=()=>{y.reset(),x.reset(),l(!0)},Se=async e=>{await y.mutateAsync(e),l(!1)},Ce=async e=>{await x.mutateAsync(e),l(!1)};return(0,R.jsxs)(`aside`,{className:r(`flex h-full min-h-0 flex-col bg-secondary transition-[width] duration-200 ease-out`,t?`flex-1 overflow-hidden`:ue?r(f2,`shrink-0`):`w-[280px] shrink-0`),"data-sidebar-collapsed":ue?`true`:`false`,children:[t?null:(0,R.jsx)(j4,{connectionStatus:g.connectionStatus,isCollapsed:ue}),t?(0,R.jsx)(T2,{query:f.query,defaultSessionType:se.selectedSessionType,sessionTypeOptions:ae,selectedNewSessionType:se.selectedSessionType,selectedNewSessionTypeOption:se.selectedSessionTypeOption,isCreateMenuOpen:o,onCreateMenuOpenChange:s,onCreateSession:P,onSelectNewSessionType:se.setSelectedSessionType,onQueryChange:n.chatSessionListManager.setQuery}):(0,R.jsx)(w2,{query:f.query,defaultSessionType:oe,sessionTypeOptions:ae,selectedNewSessionType:se.selectedSessionType,selectedNewSessionTypeOption:se.selectedSessionTypeOption,isCreateMenuOpen:o,onCreateMenuOpenChange:s,onCreateSession:P,onSelectNewSessionType:se.setSelectedSessionType,onQueryChange:n.chatSessionListManager.setQuery,collapsed:ue}),t?null:(0,R.jsx)(M4,{isCollapsed:ue}),(0,R.jsx)(N4,{defaultSessionType:se.selectedSessionType,groups:re,isCollapsed:ue,isLoading:S,isProjectFirstView:le,onAddProject:xe,onSelectMode:n.chatSessionListManager.setListMode,projectGroups:ie,renderSessionItem:be,sessionTypeOptions:ae}),t?null:(0,R.jsx)(P4,{currentLanguage:w,currentLanguageLabel:k,currentTheme:E,currentThemeLabel:O,isCollapsed:ue,isOpen:u,languageOptions:ee,onOpenApps:()=>hY(i),onOpenChange:d,onOpenDocs:()=>i.open(void 0,{kind:`docs`,title:b(`docBrowserHelp`)}),onSelectLanguage:ye,onSelectTheme:D,themeOptions:A}),(0,R.jsx)(I4,{open:c,defaultWorkspacePath:ml(m?.agents.defaults.workspace),templates:v.data?.templates??[],isCreating:y.isPending,isAddingExisting:x.isPending,createErrorMessage:y.error?.message,addExistingErrorMessage:x.error?.message,onOpenChange:l,onCreate:Se,onAddExisting:Ce})]})}var z4=`sid_`,B4=`/chat/draft`,V4=B4.slice(6);function H4(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return`${z4}${btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/g,``)}`}function U4(e){if(!e.startsWith(z4))return null;let t=e.slice(4).replace(/-/g,`+`).replace(/_/g,`/`),n=`=`.repeat((4-t.length%4)%4);try{let e=atob(t+n),r=Uint8Array.from(e,e=>e.charCodeAt(0));return new TextDecoder().decode(r)}catch{return null}}function W4(e){if(!e||e===V4)return null;let t=U4(e);if(t)return t;try{return decodeURIComponent(e)}catch{return e}}function G4(e){return`/chat/${H4(e)}`}function K4(e,t){let n=t.trim();return n?e.includes(n)?e.filter(e=>e!==n):[n,...e]:e}var q4=class{constructor(e){this.uiManager=e,this.syncDraftThreadState=()=>{Hd.getState().setSnapshot({sessionKey:null,sessionDisplayName:void 0,canDeleteSession:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.resolveUpdateValue=(e,t)=>typeof t==`function`?t(e):t,this.shouldPersistReadAt=(e,t,n)=>{let r=z.getState().optimisticReadAtBySessionKey[e],i=r&&n?r.localeCompare(n)>0?r:n:r??n??void 0;return i?t.localeCompare(i)>0:!0},this.setSelectedAgentId=e=>{let t=z.getState().snapshot.selectedAgentId,n=this.resolveUpdateValue(t,e);n!==t&&z.getState().setSnapshot({selectedAgentId:n})},this.syncSelectedSessionAgent=()=>{let e=Hd.getState().snapshot.agentId?.trim();e&&this.setSelectedAgentId(e)},this.setSelectedSessionKey=e=>{let t=z.getState().snapshot.selectedSessionKey,n=this.resolveUpdateValue(t,e);n!==t&&z.getState().setSnapshot({selectedSessionKey:n})},this.syncRouteSessionSelection=e=>{let{isChatView:t,routeSessionKey:n}=e;if(!t)return;let{selectedSessionKey:r}=z.getState().snapshot;if(n){r!==n&&this.setSelectedSessionKey(n);return}r!==null&&this.setSelectedSessionKey(null)},this.setListMode=e=>{let t=z.getState().snapshot.listMode,n=this.resolveUpdateValue(t,e);n!==t&&z.getState().setSnapshot({listMode:n})},this.toggleSessionPinned=e=>{let{pinnedSessionKeys:t}=z.getState().snapshot;z.getState().setSnapshot({pinnedSessionKeys:K4(t,e)})},this.toggleProjectPinned=e=>{let{pinnedProjectRoots:t}=z.getState().snapshot;z.getState().setSnapshot({pinnedProjectRoots:K4(t,e)})},this.toggleProjectCollapsed=e=>{let{collapsedProjectRoots:t}=z.getState().snapshot;z.getState().setSnapshot({collapsedProjectRoots:K4(t,e)})},this.markSessionRead=(e,t,n)=>{let r=e?.trim(),i=t?.trim();!r||!i||this.shouldPersistReadAt(r,i,n)&&(z.getState().markSessionRead(r,i),se(r,{uiReadAt:i}).catch(()=>void 0))},this.markVisibleWorkspaceChildRead=e=>{this.markSessionRead(e.sessionKey,e.runStatus===`running`?null:e.lastMessageAt,e.readAt)},this.createSession=(e={})=>{let{projectRoot:t,prompt:n,sessionType:r}=e,i=yu(r??`native`),a=ml(t),o=n?.trim()||null;z.getState().setSnapshot({selectedSessionKey:null}),this.syncDraftThreadState(),this.uiManager.navigateTo(B4,{replace:this.uiManager.isAtChatRoot(),state:{chatDraft:{sessionType:i,projectRoot:a,prompt:o}}})},this.startAgentDraftChat=(e,t)=>{let n=e.trim()||`main`;this.createSession({sessionType:t}),this.setSelectedAgentId(n)},this.selectSession=e=>{this.uiManager.goToSession(e)},this.setQuery=e=>{let t=z.getState().snapshot.query,n=this.resolveUpdateValue(t,e);n!==t&&z.getState().setSnapshot({query:n})}}},J4=async()=>!1,Y4=class{constructor(e){this.docBrowserManager=e,this.state={pathname:``},this.actions={navigate:null,confirm:J4},this.syncState=e=>{this.state={...this.state,...e}},this.bindActions=e=>{this.actions={...this.actions,...e}},this.confirm=async e=>this.actions.confirm(e),this.navigateTo=(e,t)=>{this.actions.navigate&&(this.state.pathname===e&&!t?.replace||(this.actions.navigate(e,t),this.state.pathname=e))},this.goToProviders=()=>{this.navigateTo(`/providers`)},this.isCompactViewport=()=>Bn.getSnapshot().mode===`mobile`,this.resolvePanelAppEntry=async e=>{let t=e.trim();if(!t)return null;try{return Zq((await Je.panelApps.listPanelApps()).entries,t)}catch{return null}},this.showContent=async e=>{let{target:t,title:n}=e;if(t.type===`url`){this.docBrowserManager.open(t.payload.url,{dedupeKey:`browser:${t.payload.url}`,kind:`content`,title:n});return}let{appId:r,params:i,path:a}=t.payload;if(a){this.docBrowserManager.open(VJ(r,a),{contentParams:i,title:n});return}let o=await this.resolvePanelAppEntry(r);if(o){this.docBrowserManager.openTarget({...GJ(o),contentParams:i},{title:n});return}this.docBrowserManager.open(VJ(r),{contentParams:i,title:n})},this.goToChatRoot=e=>{this.navigateTo(`/chat`,e)},this.isAtChatRoot=()=>this.state.pathname===`/chat`||this.state.pathname===`/chat/draft`,this.goToSession=(e,t)=>{this.navigateTo(G4(e),t)}}};function X4(e){let t=e=>{if(!e||typeof e!=`object`)return e;let t=e,n=t.error instanceof Error?{name:t.error.name,message:t.error.message}:t.error;return{data:t.data,error:n,status:t.status,fetchStatus:t.fetchStatus,isLoading:t.isLoading,isFetching:t.isFetching,isFetched:t.isFetched,isSuccess:t.isSuccess}};return{configQuery:t(e.configQuery),providersQuery:t(e.providersQuery),providerTemplatesQuery:t(e.providerTemplatesQuery),sessionsQuery:t(e.sessionsQuery),sessionTypesQuery:t(e.sessionTypesQuery),sessionSkillsSessionId:e.sessionSkillsSessionId,sessionSkillsQuery:t(e.sessionSkillsQuery)}}function Z4(e,t){return JSON.stringify(X4(e))!==JSON.stringify(X4({...e,...t}))}var Q4=class{constructor(){this.syncSnapshot=e=>{let t=Uu.getState();Z4(t.snapshot,e)&&t.setSnapshot(e)}}},$4=class{constructor(e,t,n){this.uiManager=e,this.sessionListManager=t,this.onWorkspacePanelOpened=n,this.handledUiShowContentEventIds=new Set,this.hasSnapshotChanges=e=>{let t=Hd.getState().snapshot;for(let[n,r]of Object.entries(e))if(!Object.is(t[n],r))return!0;return!1},this.syncSnapshot=e=>{this.hasSnapshotChanges(e)&&Hd.getState().setSnapshot(e)},this.clearDeletedSessionState=e=>{z.getState().snapshot.selectedSessionKey===e&&this.sessionListManager.setSelectedSessionKey(null),Hd.getState().setSnapshot({sessionKey:null,sessionTypeLabel:null,agentId:null,sessionDisplayName:void 0,sessionProjectRoot:null,sessionProjectName:null,canDeleteSession:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeSideChatDraft:null,workspaceFileTabs:[],activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.resolveWorkspaceParentSessionKey=()=>z.getState().snapshot.selectedSessionKey?.trim()||Hd.getState().snapshot.sessionKey?.trim()||(z.getState().snapshot.selectedSessionKey??null),this.activateWorkspaceFileTab=(e,t)=>{let{parentSessionKey:n}=e,{workspaceFileTabs:r}=Hd.getState().snapshot;this.setWorkspaceSelection({workspacePanelParentKey:n,activeWorkspacePanelKind:`file`,workspaceFileTabs:Tq(r,e,t),activeWorkspaceFileKey:e.key,activeChildSessionKey:null,activeSideChatDraft:null},{kind:`file`,key:e.key}),this.ensureWorkspaceParentRoute(n),this.onWorkspacePanelOpened?.()},this.ensureWorkspaceParentRoute=e=>{if(!e)return;let{snapshot:{selectedSessionKey:t}}=z.getState();t!==e&&this.uiManager.goToSession(e)},this.setWorkspaceSelection=(e,t)=>{let{snapshot:n}=Hd.getState(),r=xd({entries:n.workspaceNavigationHistory,index:n.workspaceNavigationHistoryIndex},t,Td),i=e.workspacePanelParentKey&&e.workspacePanelParentKey!==n.workspacePanelParentKey?[]:n.closedWorkspaceTabEntries.filter(e=>!Td(e,t));Hd.getState().setSnapshot({...e,closedWorkspaceTabEntries:i,workspaceNavigationHistory:[...r.entries],workspaceNavigationHistoryIndex:r.index})},this.openWorkspacePage=(e,t)=>{let n=e.trim();n&&(this.setWorkspaceSelection({workspacePanelParentKey:n,activeWorkspacePanelKind:t,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null},{kind:t}),this.ensureWorkspaceParentRoute(n),this.onWorkspacePanelOpened?.())},this.openWorkspaceOverview=e=>{this.openWorkspacePage(e,`overview`)},this.toggleWorkspacePanel=e=>{let t=e.trim();if(!t)return;let{snapshot:n}=Hd.getState();if(n.workspacePanelParentKey===t&&n.activeWorkspacePanelKind){this.closeWorkspacePanel();return}this.openWorkspaceOverview(t)},this.setWorkspacePanelWidth=e=>{this.syncSnapshot({workspacePanelWidth:vd(e)})},this.openChildSessions=e=>{this.openWorkspacePage(e,`child-sessions`)},this.openProjectFiles=e=>{this.openWorkspacePage(e,`project-files`)},this.openChildSessionPanel=e=>{let{activeChildSessionKey:t,childSessionTab:n,parentSessionKey:r}=e,i=r.trim();if(!i)return;let a=t?.trim()||null,o={workspacePanelParentKey:i,activeWorkspacePanelKind:`child-session`,activeChildSessionKey:a,activeSideChatDraft:null,activeWorkspaceFileKey:null};a&&n&&(o.childSessionTabs=Ad(Hd.getState().snapshot.childSessionTabs,{sessionKey:a,parentSessionKey:i,label:n.label?.trim()||null,agentId:n.agentId?.trim()||null})),a?this.setWorkspaceSelection(o,{kind:`child-session`,key:a}):Hd.getState().setSnapshot(o),this.ensureWorkspaceParentRoute(i),this.onWorkspacePanelOpened?.()},this.openSideChatDraft=e=>{let t=e?.trim()||this.resolveWorkspaceParentSessionKey()?.trim();if(!t)return;let n=kd(t);this.setWorkspaceSelection({workspacePanelParentKey:t,activeWorkspacePanelKind:`side-chat-draft`,activeChildSessionKey:null,activeSideChatDraft:n,activeWorkspaceFileKey:null},{kind:`side-chat-draft`,key:n.draftKey}),this.ensureWorkspaceParentRoute(t),this.onWorkspacePanelOpened?.()},this.materializeSideChatDraft=e=>{let t=jd({snapshot:Hd.getState().snapshot,...e});t&&(Hd.getState().setSnapshot(t.patch),this.ensureWorkspaceParentRoute(t.parentSessionKey))},this.openFilePreview=e=>{let t=wq(e,this.resolveWorkspaceParentSessionKey());t&&this.activateWorkspaceFileTab(t)},this.openWorkspaceFileViewer=(e,t)=>{let n=Hd.getState().snapshot.workspaceFileTabs.find(t=>t.key===e.trim());if(!n||n.viewMode!==`preview`)return;let r=t??of(n.path,n.previewViewer);if(!r)return;let i=wq({path:n.path,label:n.label??void 0,viewMode:`preview`,previewViewer:r,line:n.line??void 0,column:n.column??void 0,params:n.params??void 0,rawText:n.rawText??void 0,contentUrl:n.contentUrl??void 0,mimeType:n.mimeType??void 0},n.parentSessionKey);i&&this.activateWorkspaceFileTab(i,n.key)},this.openSessionFromToolAction=e=>{if(e.kind!==`open-session`)return;let t=e.sessionId.trim();if(t){if(e.sessionKind===`child`&&!this.uiManager.isCompactViewport()){let n=e.parentSessionId?.trim()||z.getState().snapshot.selectedSessionKey||null;if(n){this.openChildSessionPanel({parentSessionKey:n,activeChildSessionKey:t,childSessionTab:{label:e.label,agentId:e.agentId}});return}}this.closeWorkspacePanel(),this.uiManager.goToSession(t)}},this.handleToolAction=async e=>{if(e.kind===`show-content`){await this.showContent(e.request);return}this.openSessionFromToolAction(e)},this.handleUiShowContentEvent=async e=>{let t=e.id.trim();!t||this.handledUiShowContentEventIds.has(t)||(this.handledUiShowContentEventIds.add(t),await this.showContent({target:e.target,title:e.title,purpose:e.purpose,placement:e.placement}))},this.showContent=async e=>{if(e.placement!==`inline`){if(e.target.type===`file`){this.openFilePreview({path:e.target.payload.path,label:e.title,viewMode:`preview`,previewViewer:e.target.payload.viewer,line:e.target.payload.line,column:e.target.payload.column,params:e.target.payload.params});return}await this.uiManager.showContent({target:e.target,title:e.title})}},this.syncVisibleWorkspaceSelection=e=>{e?.kind===`child-session`&&this.sessionListManager.markVisibleWorkspaceChildRead(e.tab)},this.selectChildSessionDetail=e=>{let t=e.trim();t&&this.setWorkspaceSelection({activeChildSessionKey:t,activeWorkspaceFileKey:null,activeWorkspacePanelKind:`child-session`,activeSideChatDraft:null},{kind:`child-session`,key:t})},this.selectWorkspaceFile=e=>{let t=e.trim();if(!t)return;let{workspaceFileTabs:n}=Hd.getState().snapshot;n.some(e=>e.key===t)&&this.setWorkspaceSelection({activeWorkspaceFileKey:t,activeChildSessionKey:null,activeWorkspacePanelKind:`file`,activeSideChatDraft:null},{kind:`file`,key:t})},this.closeWorkspaceTab=e=>{let{snapshot:t}=Hd.getState(),n=Od(t,e);n&&Hd.getState().setSnapshot(n)},this.closeWorkspacePanel=()=>{Hd.getState().setSnapshot({workspacePanelParentKey:null,activeWorkspacePanelKind:null,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.openSessionCronPanel=e=>{this.openWorkspacePage(e,`cron`)},this.goBackWorkspacePanel=()=>{this.restoreWorkspaceNavigationStep(`back`)},this.goForwardWorkspacePanel=()=>{this.restoreWorkspaceNavigationStep(`forward`)},this.restoreWorkspaceNavigationStep=e=>{let{snapshot:t}=Hd.getState(),n=Sd({entries:t.workspaceNavigationHistory,index:t.workspaceNavigationHistoryIndex},e);if(!n)return;let r=Dd(n.entry,t);r&&Hd.getState().setSnapshot({...r,workspaceNavigationHistory:[...n.history.entries],workspaceNavigationHistoryIndex:n.history.index})},this.goToParentSession=()=>{let{parentSessionKey:e,activeSideChatDraft:t,childSessionTabs:n,activeChildSessionKey:r}=Hd.getState().snapshot,i=n.find(e=>e.sessionKey===r)?.parentSessionKey??null,a=e??t?.parentSessionKey??i;a&&(this.closeWorkspacePanel(),this.uiManager.goToSession(a))},this.deleteSession=async()=>{let{snapshot:{selectedSessionKey:e}}=z.getState();if(e&&await this.uiManager.confirm({title:b(`chatDeleteSessionConfirm`),variant:`destructive`,confirmLabel:b(`delete`)})){Hd.getState().setSnapshot({isDeletePending:!0});try{await Ye(e),Ae(ye,e),ye.removeQueries({queryKey:[`ncp-session-messages`,e]}),this.clearDeletedSessionState(e),this.uiManager.goToChatRoot({replace:!0})}finally{Hd.getState().setSnapshot({isDeletePending:!1})}}}}},e3=class{constructor(e){this.chatUiManager=new Y4(e.docBrowserManager),this.chatSessionListManager=new q4(this.chatUiManager),this.chatQueryManager=new Q4,this.chatThreadManager=new $4(this.chatUiManager,this.chatSessionListManager,e.notifyRightPanelOpened)}},t3=class{constructor(){this.nextId=0,this.pendingIntent=null,this.listeners=new Set,this.requestDraft=e=>{let t=e.trim();if(!t)return;let n={id:this.nextId+1,prompt:t};this.nextId=n.id,this.pendingIntent=n,this.listeners.forEach(e=>e(n))},this.consumePending=()=>{let e=this.pendingIntent;return this.pendingIntent=null,e},this.markConsumed=e=>{this.pendingIntent?.id===e&&(this.pendingIntent=null)},this.subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})}};function n3(){return O({queryKey:[`ncp-session-types`],queryFn:be,staleTime:1e4,retry:!1})}var r3=`nextclaw://docs`,i3=`github-project`,a3=`https://github.com/Peiiii/nextclaw`;function o3(){return[{builtIn:!0,icon:{type:`builtin`,name:`apps`},id:`apps`,label:b(`appsTitle`),removable:!1,target:{type:`right-panel-resource`,uri:NJ}},{builtIn:!0,icon:{type:`builtin`,name:`service-apps`},id:`service-apps`,label:b(`serviceAppsTitle`),removable:!1,target:{type:`right-panel-resource`,uri:PJ}},{builtIn:!0,icon:{type:`builtin`,name:`docs`},id:`docs`,label:b(`docBrowserHelp`),removable:!1,target:{type:`right-panel-resource`,uri:r3}},{builtIn:!0,icon:{type:`builtin`,name:`new-tab`},id:`new-tab`,label:b(`docBrowserHomeTitle`),removable:!1,target:{type:`right-panel-resource`,uri:jJ}},{builtIn:!0,icon:{type:`builtin`,name:`github`},id:i3,label:b(`sideDockGitHubProject`),removable:!1,target:{type:`external-url`,url:a3}}]}var s3=[`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`];function c3(e){return!!e&&typeof e==`object`}function l3(e){return s3.includes(e)}function u3(e){return!c3(e)||typeof e.type!=`string`?null:e.type===`builtin`&&l3(e.name)?{type:`builtin`,name:e.name}:e.type===`url`&&typeof e.url==`string`&&e.url.trim().length>0?{type:`url`,url:e.url.trim()}:e.type===`text`&&typeof e.value==`string`&&e.value.trim().length>0?{type:`text`,value:e.value.trim()}:null}function d3(e){if(!c3(e)||typeof e.id!=`string`||e.id.trim().length===0||typeof e.label!=`string`||e.label.trim().length===0||typeof e.createdAt!=`string`||e.createdAt.trim().length===0||!c3(e.target)||e.target.type!==`right-panel-resource`||typeof e.target.uri!=`string`||e.target.uri.trim().length===0)return null;let t=u3(e.icon);return t?{createdAt:e.createdAt,icon:t,id:e.id.trim(),label:e.label.trim(),target:{type:`right-panel-resource`,uri:e.target.uri.trim()}}:null}function f3(e){if(!Array.isArray(e))return[];let t=new Map;return e.forEach(e=>{let n=d3(e);n&&t.set(n.id,n)}),Array.from(t.values())}function p3(e,t){return{createdAt:t,icon:e.icon,id:e.id,label:e.label,target:e.target}}function m3(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function h3(e){return{builtIn:!1,icon:e.icon,id:e.id,label:e.label,removable:!0,target:e.target}}function g3(e,t){let n=new Set(e.map(e=>e.id)),r=new Set(e.map(m3).filter(e=>e!==null)),i=t.filter(e=>!n.has(e.id)&&!r.has(e.target.uri)).map(h3);return[...e,...i]}var _3=`nextclaw.side-dock.state`,v3=1;function y3(e){return!!e&&typeof e==`object`}var b3=x()(Zn(e=>({isVisible:!0,pinnedItems:[],setVisible:t=>e({isVisible:t}),setPinnedItems:t=>e({pinnedItems:f3(t)})}),{name:_3,version:v3,storage:Qn(()=>window.localStorage),partialize:e=>({isVisible:e.isVisible,pinnedItems:e.pinnedItems}),merge:(e,t)=>{let n=y3(e)?f3(e.pinnedItems):[],r=y3(e)&&typeof e.isVisible==`boolean`?e.isVisible:!0;return{...t,isVisible:r,pinnedItems:n}}})),x3={apps:Et,docs:Ut,github:ss,"new-tab":Wn,"panel-app":vo,"service-apps":vo},S3=new Set([i3]),C3=/^\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?(?:\u200D\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?)*$/u;function w3(e){return C3.test(e.trim())}function T3({icon:e}){if(e.type===`url`)return(0,R.jsx)(`img`,{src:e.url,alt:``,className:`h-5 w-5 rounded object-cover`});if(e.type===`text`)return w3(e.value)?(0,R.jsx)(`span`,{className:`flex h-7 w-7 items-center justify-center text-[20px] leading-none`,"aria-hidden":`true`,children:e.value}):(0,R.jsx)(`span`,{className:`max-w-7 truncate text-center text-[13px] font-semibold leading-none`,"aria-hidden":`true`,children:e.value});let t=x3[e.name];return(0,R.jsx)(t,{className:`h-5 w-5`,"aria-hidden":`true`})}function E3({active:e,item:t,onOpen:n,onUnpin:i}){let{label:a}=t;return(0,R.jsxs)(Dt,{children:[(0,R.jsxs)(`div`,{className:`group relative`,children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":a,title:a,"data-side-dock-item-id":t.id,onClick:()=>n(t),className:r(`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors`,`hover:bg-primary/10 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e?`bg-primary/10 text-primary`:`bg-transparent`),children:(0,R.jsx)(T3,{icon:t.icon})})}),t.removable?(0,R.jsx)(`button`,{type:`button`,"aria-label":b(`sideDockUnpinItem`),title:b(`sideDockUnpinItem`),onClick:e=>{e.stopPropagation(),i(t)},className:`absolute -right-1 -top-1 hidden h-4 w-4 items-center justify-center rounded-full bg-background text-muted-foreground shadow-sm ring-1 ring-border/70 transition-colors hover:bg-muted hover:text-foreground group-hover:flex focus-visible:flex focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:(0,R.jsx)(qn,{className:`h-3 w-3`,"aria-hidden":`true`})}):null]}),(0,R.jsx)(Lt,{side:`left`,children:a})]})}function D3({icon:e,label:t,onClick:n}){return(0,R.jsxs)(Dt,{children:[(0,R.jsx)(Ot,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":t,title:t,"data-side-dock-action":`hide`,onClick:n,className:r(`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors`,`hover:bg-primary/10 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`),children:(0,R.jsx)(e,{className:`h-5 w-5`,"aria-hidden":`true`})})}),(0,R.jsx)(Lt,{side:`left`,children:t})]})}function O3(e){return e?.trim()??``}function k3(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function A3(e,t,n,r=!1){if(!t||!n)return!1;let i=O3(k3(e)??void 0);if(!i)return!1;let a=O3(n.resourceUri);return a&&a===i||O3(n.currentUrl)===i?!0:r?!1:e.id===`docs`&&n.kind===`docs`}function j3(e,t){if(!t)return!1;let n=O3(t.resourceUri),r=O3(t.currentUrl);return e.some(e=>{let t=O3(k3(e)??void 0);return t===n||t===r})}function M3(e){return S3.has(e.id)}function N3({manager:e}){let t=b3(e=>e.pinnedItems),n=b3(e=>e.setVisible),{currentTab:r,isOpen:i}=sr(),{confirm:a,ConfirmDialog:o}=bn(),s=g3(o3(),t),c=s.filter(e=>!M3(e)),l=s.filter(M3),u=j3(s,r),d=async()=>{await a({title:b(`sideDockHideConfirmTitle`),description:b(`sideDockHideConfirmDescription`),confirmLabel:b(`sideDockHideConfirmAction`),cancelLabel:b(`cancel`)})&&n(!1)};return(0,R.jsx)(Bt,{delayDuration:250,children:(0,R.jsxs)(`aside`,{"data-testid":`side-dock`,className:`z-30 flex h-full w-14 shrink-0 flex-col items-center gap-1 border-l border-border/60 bg-background/95 px-2 py-3`,children:[(0,R.jsx)(`div`,{className:`flex w-full flex-col items-center gap-1`,children:c.map(t=>(0,R.jsx)(E3,{active:A3(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id))}),l.length>0?(0,R.jsxs)(`div`,{"data-testid":`side-dock-utility`,className:`mt-auto flex w-full flex-col items-center gap-1`,children:[l.map(t=>(0,R.jsx)(E3,{active:A3(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id)),(0,R.jsx)(D3,{icon:js,label:b(`sideDockHide`),onClick:()=>{d()}})]}):null,(0,R.jsx)(o,{})]})})}var P3=`pinned`,F3=new Set([`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`]);function I3(e){return e.trim()}function L3(e){let t=0;return Array.from(I3(e)).forEach(e=>{t=t*31+e.charCodeAt(0)>>>0}),`${P3}-${I3(e).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()||`resource`}-${t.toString(36)}`}function R3(e){return e?.type===`builtin`&&F3.has(e.name)?{type:`builtin`,name:e.name}:e?.type===`url`&&e.url.trim().length>0?{type:`url`,url:e.url.trim()}:e?.type===`text`&&e.value.trim().length>0?{type:`text`,value:e.value.trim()}:null}function z3(e){return e.kind===`docs`?`docs`:e.kind===`home`?`new-tab`:e.kind===`apps`?e.resourceUri?.includes(`service-apps`)?`service-apps`:`apps`:e.kind===`panel-app`?`panel-app`:`apps`}var B3=class{constructor(e){this.docBrowserManager=e,this.getItems=()=>g3(o3(),b3.getState().pinnedItems),this.openItem=async e=>{if(e.target.type===`right-panel-resource`){this.docBrowserManager.open(e.target.uri,{dockIcon:e.icon,title:e.label});return}e.target.type===`external-url`&&await Xn.openExternalUrl(e.target.url)},this.getDockState=e=>{let t=this.getTabResourceUri(e);if(!t)return{canDock:!1,isDocked:!1,removable:!1};let n=this.findItemByUri(t);return{canDock:!0,isDocked:!!n,removable:n?.removable===!0}},this.pinTab=(e,t=new Date().toISOString())=>{let n=this.getTabResourceUri(e);!e||!n||this.findItemByUri(n)||this.pinItem({builtIn:!1,icon:R3(e.dockIcon)??{type:`builtin`,name:z3(e)},id:L3(n),label:e.title.trim()||n,removable:!0,target:{type:`right-panel-resource`,uri:n}},t)},this.unpinTab=e=>{let t=this.getTabResourceUri(e),n=t?this.findItemByUri(t):void 0;n?.removable&&this.unpinItem(n.id)},this.pinItem=(e,t=new Date().toISOString())=>{if(!e.removable||e.target.type!==`right-panel-resource`)return;let n=I3(e.target.uri),r={...e,target:{type:`right-panel-resource`,uri:n}};this.setPinnedItems(i=>i.some(t=>t.id===e.id||I3(t.target.uri)===n)?i:[...i,p3(r,t)])},this.unpinItem=e=>{this.setPinnedItems(t=>t.filter(t=>t.id!==e))},this.reorderPinnedItems=e=>{this.setPinnedItems(t=>{let n=new Map(t.map(e=>[e.id,e])),r=e.map(e=>n.get(e)).filter(e=>e!==void 0),i=new Set(r.map(e=>e.id)),a=t.filter(e=>!i.has(e.id));return[...r,...a]})},this.setPinnedItems=e=>{let{pinnedItems:t,setPinnedItems:n}=b3.getState();n(e(t))},this.getTabResourceUri=e=>{let t=e?.resourceUri??e?.currentUrl,n=t?I3(t):``;return n.length>0?n:null},this.findItemByUri=e=>{let t=I3(e);return this.getItems().find(e=>e.target.type===`right-panel-resource`&&I3(e.target.uri)===t)}}},V3=new class{constructor(){this.resolveOpenTarget=e=>{let{activeTab:t,kind:n,url:r}=e,i=n??(r?void 0:t?.kind)??(r&&rr(r)?`docs`:`home`),a=r?.trim()||(!n&&t&&t.kind!==`docs`?t.currentUrl:i===`home`?`nextclaw://new-tab`:i===`docs`?lr():`about:blank`),o=i===`docs`?pr(a,`docs`):a;return{historyPolicy:`managed`,kind:i,title:i===`home`?b(`docBrowserHomeTitle`):ir(o,i,i===`docs`?b(`docBrowserHelp`):`Detail`),url:o}},this.areUrlsEquivalent=(e,t,n,r)=>n===r?n===`docs`?$n(e)===$n(t):e===t:!1,this.usesManagedHistory=e=>e.currentUrl!==fr}};function H3(e,t,n){return{...e,tabs:e.tabs.map(e=>e.id===t?n(e):e)}}function U3(e,t){return H3(e,e.activeTabId,t)}function W3(e,t,n){let r=t.resourceUri??t.url,i=n.resourceUri??n.url;return t.tabId===n.tabId&&t.kind===n.kind&&e.areUrlsEquivalent(r,i,t.kind,n.kind)}function G3(e,t){return{kind:t.kind,resourceUri:t.resourceUri??t.url,tabId:e,url:t.url}}function K3(e,t,n){let r=xd({entries:t.activeHistory,index:t.activeHistoryIndex},n,(t,n)=>W3(e,t,n));return{...t,activeHistory:[...r.entries],activeHistoryIndex:r.index}}function q3(e,t,n){for(let r=t.history.length-1;r>=0;--r)if(e.areUrlsEquivalent(t.history[r],n,t.kind,t.kind))return r;return-1}function J3(e,t,n){let r=t.tabs.find(e=>e.id===n.tabId);if(!r)return t;let i=n.resourceUri??n.url,a=e.resolveOpenTarget({activeTab:r,kind:n.kind,url:i}),o=q3(e,r,a.url),s=n.resourceUri!==void 0&&n.resourceUri===r.resourceUri;return H3({...t,activeTabId:r.id,isOpen:!0},r.id,e=>({...e,currentUrl:a.url,dedupeKey:a.dedupeKey,dockIcon:a.dockIcon??e.dockIcon,historyIndex:o>=0?o:e.historyIndex,kind:a.kind,resourceUri:a.resourceUri??a.url,title:s?e.title:a.title}))}function Y3(e,t){return!e.isOpen&&e.tabs.length===1&&t?.kind===`home`&&t.currentUrl===`nextclaw://new-tab`}function X3(e,t,n,r){let{activate:i,dedupeKey:a,newTab:o,title:s}=r??{},c=a?.trim()||n.dedupeKey,l=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0],u=c?t.tabs.find(e=>e.dedupeKey===c):void 0;if(u){let a=H3(t,u.id,t=>or(e,t,n,r,c)),o=i!==!1,s=o?u.id:t.activeTabId,l={...a,activeTabId:s,isOpen:!0};return o||u.id===t.activeTabId?K3(e,l,G3(u.id,n)):l}if(o||c||!l||l.kind!==n.kind){let i=dr(n.url,n.kind,s??n.title,c,n.resourceUri??n.url,r?.dockIcon??n.dockIcon,n.contentParams);return Y3(t,l)?{...t,isOpen:!0,tabs:[i],activeTabId:i.id,activeHistory:[cr(i)],activeHistoryIndex:0}:K3(e,{...t,isOpen:!0,tabs:[...t.tabs,i],activeTabId:i.id},cr(i))}return K3(e,{...U3(t,t=>or(e,t,n,r,c)),isOpen:!0},G3(t.activeTabId,n))}function Z3(e,t,n,r){let i=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0];return X3(e,t,{...e.resolveOpenTarget({activeTab:i,kind:r?.kind,url:n}),contentParams:r?.contentParams},r)}var Q3=class{constructor(e=V3,t){this.routeResolver=e,this.onRightPanelOpened=t,this.setSnapshot=e=>{ur.getState().setSnapshot(e)},this.open=(e,t)=>{this.setSnapshot(n=>Z3(this.routeResolver,n,e,t)),this.onRightPanelOpened?.()},this.openTarget=(e,t)=>{this.setSnapshot(n=>X3(this.routeResolver,n,e,{...t,dedupeKey:t?.dedupeKey??e.dedupeKey,kind:t?.kind??e.kind,title:t?.title??e.title})),this.onRightPanelOpened?.()},this.openNewTab=()=>{this.open(void 0,{kind:nr,newTab:!0})},this.close=()=>{this.setSnapshot(e=>({...e,isOpen:!1}))},this.toggleMode=()=>{this.setSnapshot(e=>({...e,mode:e.mode===`floating`?`docked`:`floating`})),this.onRightPanelOpened?.()},this.setDockedWidth=e=>{this.setSnapshot(t=>({...t,dockedWidth:tr(e)}))},this.navigate=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=dr(lr(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id,isOpen:!0}}let n=U3(t,t=>{if(!this.routeResolver.usesManagedHistory(t))return t;let n=this.routeResolver.resolveOpenTarget({activeTab:t,url:e});return this.routeResolver.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?t:{...t,currentUrl:n.url,dedupeKey:n.dedupeKey,dockIcon:n.dockIcon,...ar(t,n.url),kind:n.kind,navVersion:t.navVersion+1,resourceUri:n.resourceUri??n.url,title:n.title}}),r=n.tabs.find(e=>e.id===n.activeTabId);return r?K3(this.routeResolver,n,cr(r)):n})},this.syncUrl=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=dr(lr(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id}}let n=U3(t,t=>{if(!this.routeResolver.usesManagedHistory(t))return t;let n=this.routeResolver.resolveOpenTarget({activeTab:t,kind:t.kind,url:e});return this.routeResolver.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?t:{...t,currentUrl:n.url,dedupeKey:n.dedupeKey,dockIcon:n.dockIcon,...ar(t,n.url),kind:n.kind,resourceUri:n.resourceUri??n.url,title:n.title}}),r=n.tabs.find(e=>e.id===n.activeTabId);return r?K3(this.routeResolver,n,cr(r)):n})},this.goBack=()=>{this.setSnapshot(e=>{let t=Sd({entries:e.activeHistory,index:e.activeHistoryIndex},`back`);return t?J3(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.goForward=()=>{this.setSnapshot(e=>{let t=Sd({entries:e.activeHistory,index:e.activeHistoryIndex},`forward`);return t?J3(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.closeTab=e=>{this.setSnapshot(t=>{if(t.tabs.length<=1)return{...er(),isOpen:!1};let n=t.tabs.findIndex(t=>t.id===e);if(n<0)return t;let r=t.tabs.filter(t=>t.id!==e),i=t.activeTabId===e?r[Math.max(0,n-1)]?.id??r[0].id:t.activeTabId,a={...t,tabs:r,activeTabId:i},o=r.find(e=>e.id===i)??r[0],s=Cd({entries:a.activeHistory,index:a.activeHistoryIndex},t=>t.tabId!==e,cr(o)),c={...a,activeHistory:[...s.entries],activeHistoryIndex:s.index};return t.activeTabId===e?K3(this.routeResolver,c,cr(o)):c})},this.setActiveTab=e=>{this.setSnapshot(t=>{if(!t.tabs.some(t=>t.id===e))return t;let n=t.tabs.find(t=>t.id===e);return n?K3(this.routeResolver,{...t,activeTabId:e,isOpen:!0},cr(n)):t})}}};function $3(e){return e.activeWorkspacePanelKind!=null}var e6=class{constructor(){this.accountManager=new Ec,this.rightPanelResourceRouteResolver=new cY,this.notifyRightPanelOpened=()=>{let e=ur.getState().snapshot,t=Hd.getState().snapshot;Bn.collapseSidebarForDenseRightPanels({isDocBrowserDocked:e.mode===`docked`,isDocBrowserOpen:e.isOpen,isWorkspacePanelOpen:$3(t)})},this.docBrowserManager=new Q3(this.rightPanelResourceRouteResolver,this.notifyRightPanelOpened),this.sideDockManager=new B3(this.docBrowserManager),this.chatDraftIntentManager=new t3,this.serviceActionAuthorizationManager=new aJ,this.panelAppBridgeManager=new Yq(this.serviceActionAuthorizationManager),this.remoteAccessManager=new mc({accountManager:this.accountManager})}},t6=null;function n6(){return t6??=new e6,t6}function r6(){return n6()}var i6=globalThis,a6=i6.__NEXTCLAW_APP_PRESENTER_CONTEXT__??(0,L.createContext)(null);i6.__NEXTCLAW_APP_PRESENTER_CONTEXT__=a6;function o6({children:e}){let t=(0,L.useMemo)(()=>n6(),[]);return(0,R.jsx)(a6.Provider,{value:t,children:e})}function s6(){let e=(0,L.useContext)(a6);if(!e)throw Error(`useAppPresenter must be used inside AppPresenterProvider`);return e}export{qs as $,qd as A,Tc as B,C0 as C,nJ as D,gY as E,xu as F,pc as G,yc as H,ou as I,lc as J,ac as K,au as L,Su as M,yu as N,Kd as O,bu as P,nc as Q,nl as R,k0 as S,EY as T,vc as U,wc as V,mc as W,fc as X,uc as Y,ic as Z,i2 as _,Fi as _t,b3 as a,Ho as at,Z0 as b,W4 as c,To as ct,E4 as d,aa as dt,Hs as et,T4 as f,oa as ft,$2 as g,Ni as gt,e4 as h,Ai as ht,N3 as i,ds as it,Gd as j,Jd as k,R4 as l,So as lt,v4 as m,la as mt,s6 as n,Ps as nt,n3 as o,Vo as ot,w4 as p,sa as pt,cc as q,r6 as r,xs as rt,e3 as s,jo as st,o6 as t,Fs as tt,O4 as u,Ya as ut,a2 as v,l0 as w,X0 as x,e2 as y,rl as z};
|