@mduan/paseo-cli 0.11.0-fork.26 → 0.11.0-fork.27
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/node_modules/@getpaseo/client/package.json +3 -3
- package/node_modules/@getpaseo/highlight/package.json +1 -1
- package/node_modules/@getpaseo/plugin/package.json +3 -3
- package/node_modules/@getpaseo/protocol/package.json +1 -1
- package/node_modules/@getpaseo/relay/package.json +1 -1
- package/node_modules/@getpaseo/server/dist/server/builtin-plugins/package.json +1 -1
- package/node_modules/@getpaseo/server/dist/server/server/agent/providers/jsonl-frame-decoder.d.ts +1 -1
- package/node_modules/@getpaseo/server/dist/server/server/agent/providers/jsonl-frame-decoder.js +15 -6
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-e40f9469d927082127392a99cdf31e38.js → index-7e4ab792ea6f53cd25ad3ad933be47d6.js} +10 -10
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/index-7e4ab792ea6f53cd25ad3ad933be47d6.js.br +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/index-7e4ab792ea6f53cd25ad3ad933be47d6.js.gz +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/index.html +1 -1
- package/node_modules/@getpaseo/server/dist/server/web-ui/index.html.br +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/index.html.gz +0 -0
- package/node_modules/@getpaseo/server/package.json +6 -6
- package/package.json +7 -7
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/index-e40f9469d927082127392a99cdf31e38.js.br +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/index-e40f9469d927082127392a99cdf31e38.js.gz +0 -0
|
@@ -344,7 +344,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
344
344
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DefaultServerUnistylesSettings",{enumerable:!0,get:function(){return t}});const t={}},303,[]);
|
|
345
345
|
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"hydrateServerUnistyles",{enumerable:!0,get:function(){return n}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),t=r(_d[1]);const n=()=>{if((0,t.isServer)())throw(0,t.error)('Server styles should only be hydrated on the client');e.services.registry.css.hydrate(window.__UNISTYLES_STATE__),document.querySelector('#unistyles-script')?.remove()}},304,[123,138]);
|
|
346
346
|
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"resetServerUnistyles",{enumerable:!0,get:function(){return n}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),t=r(_d[1]);const n=()=>{if(!(0,t.isServer)())throw(0,t.error)('Server styles should only be reset on the server');e.services.registry.reset()}},305,[123,138]);
|
|
347
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"baseColors",{enumerable:!0,get:function(){return c}}),e.buildLightSemanticColors=E,e.buildDarkSemanticColors=k,Object.defineProperty(e,"SPACING",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"FONT_SIZE",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"LINE_HEIGHT",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"ICON_SIZE",{enumerable:!0,get:function(){return F}}),Object.defineProperty(e,"FONT_WEIGHT",{enumerable:!0,get:function(){return v}}),Object.defineProperty(e,"BORDER_RADIUS",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"BORDER_WIDTH",{enumerable:!0,get:function(){return N}}),Object.defineProperty(e,"OPACITY",{enumerable:!0,get:function(){return C}}),Object.defineProperty(e,"DEFAULT_UI_FONT_STACK",{enumerable:!0,get:function(){return x}}),Object.defineProperty(e,"DEFAULT_MONO_FONT_STACK",{enumerable:!0,get:function(){return R}}),Object.defineProperty(e,"DEFAULT_CONTENT_MAX_WIDTH",{enumerable:!0,get:function(){return H}}),e.buildDarkTheme=G,Object.defineProperty(e,"darkTheme",{enumerable:!0,get:function(){return L}}),Object.defineProperty(e,"darkZincTheme",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"darkMidnightTheme",{enumerable:!0,get:function(){return $}}),Object.defineProperty(e,"darkClaudeTheme",{enumerable:!0,get:function(){return z}}),Object.defineProperty(e,"darkGhosttyTheme",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(e,"darkPureBlackTheme",{enumerable:!0,get:function(){return Z}}),e.buildLightTheme=X,Object.defineProperty(e,"lightTheme",{enumerable:!0,get:function(){return q}}),Object.defineProperty(e,"theme",{enumerable:!0,get:function(){return J}}),Object.defineProperty(e,"THEME_OPTIONS",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,"PLUGIN_THEME_PREFERENCE",{enumerable:!0,get:function(){return V}}),Object.defineProperty(e,"PLUGIN_THEME_NAMES",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(e,"THEME_TO_UNISTYLES",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(e,"THEME_SWATCHES",{enumerable:!0,get:function(){return te}}),Object.defineProperty(e,"REGISTERED_THEMES",{enumerable:!0,get:function(){return ce}}),e.getNextThemePreference=function(t){const c=(Q.findIndex(c=>c.name===t)+1)%Q.length;return Q[c]?.name??Q[0].name},r(d[0]);var t=r(d[1]);const c={white:"#ffffff",black:"#000000",zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",850:"#1a1a1d",900:"#18181b",950:"#121214"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},slate:{200:"#e2e8f0"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},green:{100:"#dcfce7",200:"#bbf7d0",400:"#4ade80",500:"#22c55e",600:"#16a34a",800:"#166534",900:"#14532d"},red:{100:"#fee2e2",200:"#fecaca",300:"#fca5a5",500:"#ef4444",600:"#dc2626",800:"#991b1b",900:"#7f1d1d"},teal:{200:"#99f6e4"},amber:{500:"#f59e0b",700:"#b45309"},yellow:{400:"#fbbf24"},purple:{500:"#a855f7",600:"#9333ea"},orange:{500:"#f97316",600:"#ea580c"}},n={diffAddition:"#15803d",diffDeletion:"#b91c1c"},f={diffAddition:"#4ade80",diffDeletion:"#ef4444"},u={statusSuccess:"#3e704a",statusDanger:"#9d433b",statusWarning:"#7b5d39",statusMerged:"#7347af"},o={statusSuccess:"#6cb17b",statusDanger:"#d8847b",statusWarning:"#c09664",statusMerged:"#a890d5"};function s(t,c){return{statusSuccessTint:`${t.statusSuccess}${c}`,statusDangerTint:`${t.statusDanger}${c}`,statusWarningTint:`${t.statusWarning}${c}`}}const b=s(u,"1f"),l=s(o,"29"),h={statusDotSuccess:"#299f51",statusDotDanger:"#f12e2f",statusDotWarning:"#b37824",statusDotRunning:"#268ae0"},p={statusDotSuccess:"#35c264",statusDotDanger:"#f7796d",statusDotWarning:"#db932e",statusDotRunning:"#5caaf6"},y={red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#ffffff",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#f59e0b",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#fafafa"};function E(t){return Object.assign({surface0:t.surface0,surface1:t.surface1,surface2:t.surface2,surface3:t.surface3,surface4:t.surface4,surfaceDiffEmpty:t.surfaceDiffEmpty,surfaceSidebar:t.surfaceSidebar,surfaceSidebarHover:t.surface1,surfaceSidebarSelected:t.surface3,surfaceSidebarGroupSelected:"#ededee",surfaceWorkspace:t.surface0,interactionHighlight:"rgba(0, 0, 0, 0.06)",foreground:t.foreground,foregroundMuted:t.foregroundMuted,foregroundExtraMuted:t.foregroundExtraMuted,border:t.border,borderAccent:t.borderAccent,accent:t.accent,accentBright:t.accentBright,accentForeground:t.accentForeground??t.surface0,destructive:t.destructive,destructiveForeground:t.surface0,success:t.accent,successForeground:t.surface0,background:t.surface0,popover:t.surface0,popoverForeground:t.foreground,primary:t.primary,primaryForeground:t.primaryForeground,secondary:t.surface2,secondaryForeground:t.foreground,muted:t.surface2,mutedForeground:t.foregroundMuted,accentBorder:t.borderAccent,input:t.surface2,ring:t.ring},n,u,b,h,{terminal:Object.assign({background:t.surface0,foreground:t.foreground,cursor:t.foreground,cursorAccent:t.surface0,selectionBackground:"rgba(0, 0, 0, 0.15)",selectionForeground:t.foreground,black:t.terminalBlack},y,{brightBlack:t.terminalBrightBlack})})}const O=E({surface0:"#ffffff",surface1:"#fafafa",surface2:"#f4f4f5",surface3:"#e4e4e7",surface4:"#d4d4d8",surfaceDiffEmpty:"#f6f6f6",surfaceSidebar:"#f4f4f5",foreground:"#1a1a1e",foregroundMuted:"#71717a",foregroundExtraMuted:"#a1a1aa",border:"#e4e4e7",borderAccent:"#ececf1",accent:"#20744A",accentBright:"#239956",accentForeground:"#ffffff",primary:"#18181b",primaryForeground:"#fafafa",destructive:"#b04138",terminalBlack:"#1a1a1e",terminalBrightBlack:"#3f3f46",ring:"#18181b"}),B={red:"#e07070",green:"#5dba80",yellow:"#d4a44a",blue:"#6a9de0",magenta:"#b07ad0",cyan:"#4aabb8",white:"#d4d4d8",brightRed:"#e89090",brightGreen:"#7ecf9a",brightYellow:"#e0be6e",brightBlue:"#8ab4e8",brightMagenta:"#c49ae0",brightCyan:"#6ec2cc",brightWhite:"#f0f0f2"};function k(t){const c=t.foreground??"#fafafa",n=t.ring??"#d4d4d8";return Object.assign({surface0:t.surface0,surface1:t.surface1,surface2:t.surface2,surface3:t.surface3,surface4:t.surface4,surfaceDiffEmpty:t.surfaceDiffEmpty,surfaceSidebar:t.surfaceSidebar,surfaceSidebarHover:t.surface1,surfaceSidebarSelected:t.surface2,surfaceSidebarGroupSelected:t.surface0,surfaceWorkspace:t.surface1,interactionHighlight:"rgba(255, 255, 255, 0.08)",foreground:c,foregroundMuted:t.foregroundMuted,foregroundExtraMuted:t.foregroundExtraMuted,border:t.border,borderAccent:t.borderAccent,accent:t.accent,accentBright:t.accentBright,accentForeground:t.accentForeground??"#ffffff",destructive:t.destructive,destructiveForeground:"#ffffff",success:t.accent,successForeground:"#ffffff",background:t.surface0,popover:t.surface2,popoverForeground:c,primary:c,primaryForeground:t.surface0,secondary:t.surface2,secondaryForeground:c,muted:t.surface2,mutedForeground:t.foregroundMuted,accentBorder:t.borderAccent,input:t.surface2,ring:n},f,o,l,p,{terminal:Object.assign({background:t.surface0,foreground:c,cursor:c,cursorAccent:t.surface0,selectionBackground:"rgba(255, 255, 255, 0.2)",selectionForeground:c,black:t.terminalBlack},B,{brightBlack:t.terminalBrightBlack})})}const S=k({surface0:"#181B1A",surface1:"#1E2120",surface2:"#272A29",surface3:"#434645",surface4:"#595B5B",surfaceDiffEmpty:"#252827",surfaceSidebar:"#141716",foregroundMuted:"#A1A5A4",foregroundExtraMuted:"#717574",border:"#252B2A",borderAccent:"#2F3534",accent:"#20744A",accentBright:"#7ccba0",destructive:"#c64f43",terminalBlack:"#141716",terminalBrightBlack:"#434645"}),M=k({surface0:"#18181b",surface1:"#1f1f22",surface2:"#27272a",surface3:"#3f3f46",surface4:"#52525b",surfaceDiffEmpty:"#242427",surfaceSidebar:"#131316",foregroundMuted:"#a1a1aa",foregroundExtraMuted:"#71717a",border:"#27272a",borderAccent:"#303036",accent:"#e4e4e7",accentBright:"#fafafa",accentForeground:"#18181b",destructive:"#c44a4a",terminalBlack:"#131316",terminalBrightBlack:"#3f3f46"}),w=k({surface0:"#161820",surface1:"#1c1e27",surface2:"#252731",surface3:"#3c3e4c",surface4:"#535564",surfaceDiffEmpty:"#222430",surfaceSidebar:"#121420",foregroundMuted:"#9a9db0",foregroundExtraMuted:"#6b6e82",border:"#242636",borderAccent:"#2e3040",accent:"#3b6fcf",accentBright:"#7eaaeb",destructive:"#c44a52",terminalBlack:"#121420",terminalBrightBlack:"#3c3e4c"}),D=k({surface0:"#1f1f1e",surface1:"#262523",surface2:"#2f2d2b",surface3:"#4a4745",surface4:"#605d5b",surfaceDiffEmpty:"#2a2826",surfaceSidebar:"#1a1918",foregroundMuted:"#ada9a5",foregroundExtraMuted:"#78746f",border:"#2c2a27",borderAccent:"#36332f",accent:"#d97757",accentBright:"#e89a7f",destructive:"#cf513e",terminalBlack:"#1a1918",terminalBrightBlack:"#4a4745"}),A=k({surface0:"#282c34",surface1:"#2f333d",surface2:"#383c48",surface3:"#4a4f5e",surface4:"#5b6175",surfaceDiffEmpty:"#323643",surfaceSidebar:"#21252d",foregroundMuted:"#c8ccd8",foregroundExtraMuted:"#a0a4b2",border:"#353a47",borderAccent:"#3f4454",accent:"#89b4fa",accentBright:"#b4d0fc",destructive:"#c44a55",terminalBlack:"#21252d",terminalBrightBlack:"#4a4f5e"}),T={0:0,.5:2,1:4,1.5:6,2:8,3:12,4:16,6:24,8:32,12:48,16:64,20:80,24:96,32:128},j={code:12,content:15,sm:12,base:14,lg:16,xl:18,"2xl":20,"3xl":22,"4xl":26},P={diff:22},F={xs:12,sm:14,md:16,lg:20},v={normal:"normal",medium:"500",semibold:"600",bold:"bold"},_={none:0,sm:2,base:4,md:6,lg:8,xl:12,"2xl":16,full:9999},N={0:0,1:1,2:2},C={0:0,50:.5,100:1},x="system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",R="SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",H=820,I={spacing:T,fontSize:j,fontFamily:{ui:x,mono:R},lineHeight:P,contentMaxWidth:H,iconSize:F,fontWeight:v,borderRadius:_,borderWidth:N,opacity:C},W={sm:{shadowColor:"rgba(0, 0, 0, 0.25)",shadowOffset:{width:0,height:2},shadowRadius:4,elevation:2},md:{shadowColor:"rgba(0, 0, 0, 0.20)",shadowOffset:{width:0,height:4},shadowRadius:8,elevation:8},lg:{shadowColor:"rgba(0, 0, 0, 0.40)",shadowOffset:{width:0,height:12},shadowRadius:24,elevation:8}};function G(n){return Object.assign({colorScheme:"dark",colors:Object.assign({},n,{palette:c,syntax:t.darkHighlightColors}),shadow:W},I)}const L=G(S),U=G(M),$=G(w),z=G(D),Y=G(A),Z=G(k({surface0:"#000000",surface1:"#0a0a0a",surface2:"#111111",surface3:"#202020",surface4:"#2d2d2d",surfaceDiffEmpty:"#0c0c0c",surfaceSidebar:"#000000",foregroundMuted:"#a1a1aa",foregroundExtraMuted:"#71717a",border:"#1c1c1c",borderAccent:"#242424",accent:"#20744A",accentBright:"#7ccba0",destructive:"#c44a4a",terminalBlack:"#595959",terminalBrightBlack:"#8a8a8a"})),K={sm:{shadowColor:"rgba(0, 0, 0, 0.02)",shadowOffset:{width:0,height:2},shadowRadius:8,elevation:2},md:{shadowColor:"rgba(0, 0, 0, 0.04)",shadowOffset:{width:0,height:4},shadowRadius:16,elevation:4},lg:{shadowColor:"rgba(0, 0, 0, 0.08)",shadowOffset:{width:0,height:8},shadowRadius:24,elevation:8}};function X(n){return Object.assign({colorScheme:"light",colors:Object.assign({},n,{palette:c,syntax:t.lightHighlightColors}),shadow:K},I)}const q=X(O),J=L,Q=[{name:"light",group:"primary",unistylesName:"light",theme:q,swatch:"#ffffff"},{name:"dark",group:"primary",unistylesName:"dark",theme:L,swatch:"#2D8B62"},{name:"auto",group:"primary"},{name:"zinc",group:"variant",unistylesName:"darkZinc",theme:U,swatch:"#808080"},{name:"midnight",group:"variant",unistylesName:"darkMidnight",theme:$,swatch:"#4A6BA8"},{name:"claude",group:"variant",unistylesName:"darkClaude",theme:z,swatch:"#D97757"},{name:"ghostty",group:"variant",unistylesName:"darkGhostty",theme:Y,swatch:"#8caaee"},{name:"pureBlack",group:"variant",unistylesName:"darkPureBlack",theme:Z,swatch:"#000000"}],V="plugin",ee={light:"pluginLight",dark:"pluginDark"},re=Q.filter(t=>"auto"!==t.name),ae=Object.fromEntries(re.map(t=>[t.name,t.unistylesName])),te=Object.fromEntries(re.map(t=>[t.name,t.swatch])),ce=Object.assign({},Object.fromEntries(re.map(t=>[t.unistylesName,t.theme])),{[ee.light]:q,[ee.dark]:L})},306,[26,307]);
|
|
347
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"baseColors",{enumerable:!0,get:function(){return c}}),e.buildLightSemanticColors=B,e.buildDarkSemanticColors=O,Object.defineProperty(e,"SPACING",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"FONT_SIZE",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"LINE_HEIGHT",{enumerable:!0,get:function(){return F}}),Object.defineProperty(e,"ICON_SIZE",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"FONT_WEIGHT",{enumerable:!0,get:function(){return v}}),Object.defineProperty(e,"BORDER_RADIUS",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"BORDER_WIDTH",{enumerable:!0,get:function(){return N}}),Object.defineProperty(e,"OPACITY",{enumerable:!0,get:function(){return C}}),Object.defineProperty(e,"DEFAULT_UI_FONT_STACK",{enumerable:!0,get:function(){return x}}),Object.defineProperty(e,"DEFAULT_MONO_FONT_STACK",{enumerable:!0,get:function(){return R}}),Object.defineProperty(e,"DEFAULT_CONTENT_MAX_WIDTH",{enumerable:!0,get:function(){return H}}),e.buildDarkTheme=G,Object.defineProperty(e,"darkTheme",{enumerable:!0,get:function(){return L}}),Object.defineProperty(e,"darkZincTheme",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"darkMidnightTheme",{enumerable:!0,get:function(){return $}}),Object.defineProperty(e,"darkClaudeTheme",{enumerable:!0,get:function(){return z}}),Object.defineProperty(e,"darkGhosttyTheme",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(e,"darkPureBlackTheme",{enumerable:!0,get:function(){return Z}}),e.buildLightTheme=X,Object.defineProperty(e,"lightTheme",{enumerable:!0,get:function(){return q}}),Object.defineProperty(e,"theme",{enumerable:!0,get:function(){return J}}),Object.defineProperty(e,"THEME_OPTIONS",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,"PLUGIN_THEME_PREFERENCE",{enumerable:!0,get:function(){return V}}),Object.defineProperty(e,"PLUGIN_THEME_NAMES",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(e,"THEME_TO_UNISTYLES",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(e,"THEME_SWATCHES",{enumerable:!0,get:function(){return te}}),Object.defineProperty(e,"REGISTERED_THEMES",{enumerable:!0,get:function(){return ce}}),e.getNextThemePreference=function(t){const c=(Q.findIndex(c=>c.name===t)+1)%Q.length;return Q[c]?.name??Q[0].name},r(d[0]);var t=r(d[1]);const c={white:"#ffffff",black:"#000000",zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",850:"#1a1a1d",900:"#18181b",950:"#121214"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},slate:{200:"#e2e8f0"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},green:{100:"#dcfce7",200:"#bbf7d0",400:"#4ade80",500:"#22c55e",600:"#16a34a",800:"#166534",900:"#14532d"},red:{100:"#fee2e2",200:"#fecaca",300:"#fca5a5",500:"#ef4444",600:"#dc2626",800:"#991b1b",900:"#7f1d1d"},teal:{200:"#99f6e4"},amber:{500:"#f59e0b",700:"#b45309"},yellow:{400:"#fbbf24"},purple:{500:"#a855f7",600:"#9333ea"},orange:{500:"#f97316",600:"#ea580c"}},n={diffAddition:"#15803d",diffDeletion:"#b91c1c"},f={diffAddition:"#4ade80",diffDeletion:"#ef4444"},u={statusSuccess:"#3e704a",statusDanger:"#9d433b",statusWarning:"#7b5d39",statusMerged:"#7347af"},o={statusSuccess:"#6cb17b",statusDanger:"#d8847b",statusWarning:"#c09664",statusMerged:"#a890d5"};function s(t,c){return{statusSuccessTint:`${t.statusSuccess}${c}`,statusDangerTint:`${t.statusDanger}${c}`,statusWarningTint:`${t.statusWarning}${c}`}}const b=s(u,"1f"),l=s(o,"29"),h={statusDotSuccess:"#299f51",statusDotDanger:"#f12e2f",statusDotWarning:"#b37824",statusDotRunning:"#268ae0"},p={statusDotSuccess:"#35c264",statusDotDanger:"#f7796d",statusDotWarning:"#db932e",statusDotRunning:"#5caaf6"},y={red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#ffffff",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#f59e0b",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#fafafa"};function B(t){return Object.assign({surface0:t.surface0,surface1:t.surface1,surface2:t.surface2,surface3:t.surface3,surface4:t.surface4,surfaceDiffEmpty:t.surfaceDiffEmpty,surfaceSidebar:t.surfaceSidebar,surfaceSidebarHover:t.surface1,surfaceSidebarSelected:t.surface3,surfaceSidebarGroupSelected:"#ededee",surfaceWorkspace:t.surface0,interactionHighlight:"rgba(0, 0, 0, 0.06)",searchMatchBackground:"#fff0a3",searchMatchForeground:"#342600",searchSelectedMatchBackground:"#edaa35",searchSelectedMatchForeground:"#322000",foreground:t.foreground,foregroundMuted:t.foregroundMuted,foregroundExtraMuted:t.foregroundExtraMuted,border:t.border,borderAccent:t.borderAccent,accent:t.accent,accentBright:t.accentBright,accentForeground:t.accentForeground??t.surface0,destructive:t.destructive,destructiveForeground:t.surface0,success:t.accent,successForeground:t.surface0,background:t.surface0,popover:t.surface0,popoverForeground:t.foreground,primary:t.primary,primaryForeground:t.primaryForeground,secondary:t.surface2,secondaryForeground:t.foreground,muted:t.surface2,mutedForeground:t.foregroundMuted,accentBorder:t.borderAccent,input:t.surface2,ring:t.ring},n,u,b,h,{terminal:Object.assign({background:t.surface0,foreground:t.foreground,cursor:t.foreground,cursorAccent:t.surface0,selectionBackground:"rgba(0, 0, 0, 0.15)",selectionForeground:t.foreground,black:t.terminalBlack},y,{brightBlack:t.terminalBrightBlack})})}const k=B({surface0:"#ffffff",surface1:"#fafafa",surface2:"#f4f4f5",surface3:"#e4e4e7",surface4:"#d4d4d8",surfaceDiffEmpty:"#f6f6f6",surfaceSidebar:"#f4f4f5",foreground:"#1a1a1e",foregroundMuted:"#71717a",foregroundExtraMuted:"#a1a1aa",border:"#e4e4e7",borderAccent:"#ececf1",accent:"#20744A",accentBright:"#239956",accentForeground:"#ffffff",primary:"#18181b",primaryForeground:"#fafafa",destructive:"#b04138",terminalBlack:"#1a1a1e",terminalBrightBlack:"#3f3f46",ring:"#18181b"}),E={red:"#e07070",green:"#5dba80",yellow:"#d4a44a",blue:"#6a9de0",magenta:"#b07ad0",cyan:"#4aabb8",white:"#d4d4d8",brightRed:"#e89090",brightGreen:"#7ecf9a",brightYellow:"#e0be6e",brightBlue:"#8ab4e8",brightMagenta:"#c49ae0",brightCyan:"#6ec2cc",brightWhite:"#f0f0f2"};function O(t){const c=t.foreground??"#fafafa",n=t.ring??"#d4d4d8";return Object.assign({surface0:t.surface0,surface1:t.surface1,surface2:t.surface2,surface3:t.surface3,surface4:t.surface4,surfaceDiffEmpty:t.surfaceDiffEmpty,surfaceSidebar:t.surfaceSidebar,surfaceSidebarHover:t.surface1,surfaceSidebarSelected:t.surface2,surfaceSidebarGroupSelected:t.surface0,surfaceWorkspace:t.surface1,interactionHighlight:"rgba(255, 255, 255, 0.08)",searchMatchBackground:"#50481a",searchMatchForeground:"#fff2b5",searchSelectedMatchBackground:"#e9a43a",searchSelectedMatchForeground:"#322000",foreground:c,foregroundMuted:t.foregroundMuted,foregroundExtraMuted:t.foregroundExtraMuted,border:t.border,borderAccent:t.borderAccent,accent:t.accent,accentBright:t.accentBright,accentForeground:t.accentForeground??"#ffffff",destructive:t.destructive,destructiveForeground:"#ffffff",success:t.accent,successForeground:"#ffffff",background:t.surface0,popover:t.surface2,popoverForeground:c,primary:c,primaryForeground:t.surface0,secondary:t.surface2,secondaryForeground:c,muted:t.surface2,mutedForeground:t.foregroundMuted,accentBorder:t.borderAccent,input:t.surface2,ring:n},f,o,l,p,{terminal:Object.assign({background:t.surface0,foreground:c,cursor:c,cursorAccent:t.surface0,selectionBackground:"rgba(255, 255, 255, 0.2)",selectionForeground:c,black:t.terminalBlack},E,{brightBlack:t.terminalBrightBlack})})}const M=O({surface0:"#181B1A",surface1:"#1E2120",surface2:"#272A29",surface3:"#434645",surface4:"#595B5B",surfaceDiffEmpty:"#252827",surfaceSidebar:"#141716",foregroundMuted:"#A1A5A4",foregroundExtraMuted:"#717574",border:"#252B2A",borderAccent:"#2F3534",accent:"#20744A",accentBright:"#7ccba0",destructive:"#c64f43",terminalBlack:"#141716",terminalBrightBlack:"#434645"}),S=O({surface0:"#18181b",surface1:"#1f1f22",surface2:"#27272a",surface3:"#3f3f46",surface4:"#52525b",surfaceDiffEmpty:"#242427",surfaceSidebar:"#131316",foregroundMuted:"#a1a1aa",foregroundExtraMuted:"#71717a",border:"#27272a",borderAccent:"#303036",accent:"#e4e4e7",accentBright:"#fafafa",accentForeground:"#18181b",destructive:"#c44a4a",terminalBlack:"#131316",terminalBrightBlack:"#3f3f46"}),w=O({surface0:"#161820",surface1:"#1c1e27",surface2:"#252731",surface3:"#3c3e4c",surface4:"#535564",surfaceDiffEmpty:"#222430",surfaceSidebar:"#121420",foregroundMuted:"#9a9db0",foregroundExtraMuted:"#6b6e82",border:"#242636",borderAccent:"#2e3040",accent:"#3b6fcf",accentBright:"#7eaaeb",destructive:"#c44a52",terminalBlack:"#121420",terminalBrightBlack:"#3c3e4c"}),D=O({surface0:"#1f1f1e",surface1:"#262523",surface2:"#2f2d2b",surface3:"#4a4745",surface4:"#605d5b",surfaceDiffEmpty:"#2a2826",surfaceSidebar:"#1a1918",foregroundMuted:"#ada9a5",foregroundExtraMuted:"#78746f",border:"#2c2a27",borderAccent:"#36332f",accent:"#d97757",accentBright:"#e89a7f",destructive:"#cf513e",terminalBlack:"#1a1918",terminalBrightBlack:"#4a4745"}),A=O({surface0:"#282c34",surface1:"#2f333d",surface2:"#383c48",surface3:"#4a4f5e",surface4:"#5b6175",surfaceDiffEmpty:"#323643",surfaceSidebar:"#21252d",foregroundMuted:"#c8ccd8",foregroundExtraMuted:"#a0a4b2",border:"#353a47",borderAccent:"#3f4454",accent:"#89b4fa",accentBright:"#b4d0fc",destructive:"#c44a55",terminalBlack:"#21252d",terminalBrightBlack:"#4a4f5e"}),T={0:0,.5:2,1:4,1.5:6,2:8,3:12,4:16,6:24,8:32,12:48,16:64,20:80,24:96,32:128},j={code:12,content:15,sm:12,base:14,lg:16,xl:18,"2xl":20,"3xl":22,"4xl":26},F={diff:22},P={xs:12,sm:14,md:16,lg:20},v={normal:"normal",medium:"500",semibold:"600",bold:"bold"},_={none:0,sm:2,base:4,md:6,lg:8,xl:12,"2xl":16,full:9999},N={0:0,1:1,2:2},C={0:0,50:.5,100:1},x="system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",R="SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",H=820,I={spacing:T,fontSize:j,fontFamily:{ui:x,mono:R},lineHeight:F,contentMaxWidth:H,iconSize:P,fontWeight:v,borderRadius:_,borderWidth:N,opacity:C},W={sm:{shadowColor:"rgba(0, 0, 0, 0.25)",shadowOffset:{width:0,height:2},shadowRadius:4,elevation:2},md:{shadowColor:"rgba(0, 0, 0, 0.20)",shadowOffset:{width:0,height:4},shadowRadius:8,elevation:8},lg:{shadowColor:"rgba(0, 0, 0, 0.40)",shadowOffset:{width:0,height:12},shadowRadius:24,elevation:8}};function G(n){return Object.assign({colorScheme:"dark",colors:Object.assign({},n,{palette:c,syntax:t.darkHighlightColors}),shadow:W},I)}const L=G(M),U=G(S),$=G(w),z=G(D),Y=G(A),Z=G(O({surface0:"#000000",surface1:"#0a0a0a",surface2:"#111111",surface3:"#202020",surface4:"#2d2d2d",surfaceDiffEmpty:"#0c0c0c",surfaceSidebar:"#000000",foregroundMuted:"#a1a1aa",foregroundExtraMuted:"#71717a",border:"#1c1c1c",borderAccent:"#242424",accent:"#20744A",accentBright:"#7ccba0",destructive:"#c44a4a",terminalBlack:"#595959",terminalBrightBlack:"#8a8a8a"})),K={sm:{shadowColor:"rgba(0, 0, 0, 0.02)",shadowOffset:{width:0,height:2},shadowRadius:8,elevation:2},md:{shadowColor:"rgba(0, 0, 0, 0.04)",shadowOffset:{width:0,height:4},shadowRadius:16,elevation:4},lg:{shadowColor:"rgba(0, 0, 0, 0.08)",shadowOffset:{width:0,height:8},shadowRadius:24,elevation:8}};function X(n){return Object.assign({colorScheme:"light",colors:Object.assign({},n,{palette:c,syntax:t.lightHighlightColors}),shadow:K},I)}const q=X(k),J=L,Q=[{name:"light",group:"primary",unistylesName:"light",theme:q,swatch:"#ffffff"},{name:"dark",group:"primary",unistylesName:"dark",theme:L,swatch:"#2D8B62"},{name:"auto",group:"primary"},{name:"zinc",group:"variant",unistylesName:"darkZinc",theme:U,swatch:"#808080"},{name:"midnight",group:"variant",unistylesName:"darkMidnight",theme:$,swatch:"#4A6BA8"},{name:"claude",group:"variant",unistylesName:"darkClaude",theme:z,swatch:"#D97757"},{name:"ghostty",group:"variant",unistylesName:"darkGhostty",theme:Y,swatch:"#8caaee"},{name:"pureBlack",group:"variant",unistylesName:"darkPureBlack",theme:Z,swatch:"#000000"}],V="plugin",ee={light:"pluginLight",dark:"pluginDark"},re=Q.filter(t=>"auto"!==t.name),ae=Object.fromEntries(re.map(t=>[t.name,t.unistylesName])),te=Object.fromEntries(re.map(t=>[t.name,t.swatch])),ce=Object.assign({},Object.fromEntries(re.map(t=>[t.unistylesName,t.theme])),{[ee.light]:q,[ee.dark]:L})},306,[26,307]);
|
|
348
348
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"getLanguageForFile",{enumerable:!0,get:function(){return t.getLanguageForFile}}),Object.defineProperty(e,"getParserForFile",{enumerable:!0,get:function(){return t.getParserForFile}}),Object.defineProperty(e,"isLanguageSupported",{enumerable:!0,get:function(){return t.isLanguageSupported}}),Object.defineProperty(e,"getSupportedExtensions",{enumerable:!0,get:function(){return t.getSupportedExtensions}}),Object.defineProperty(e,"createCodeMirrorHighlightStyle",{enumerable:!0,get:function(){return n.createCodeMirrorHighlightStyle}}),Object.defineProperty(e,"highlightCode",{enumerable:!0,get:function(){return o.highlightCode}}),Object.defineProperty(e,"highlightLine",{enumerable:!0,get:function(){return o.highlightLine}}),Object.defineProperty(e,"darkHighlightColors",{enumerable:!0,get:function(){return u.darkHighlightColors}}),Object.defineProperty(e,"lightHighlightColors",{enumerable:!0,get:function(){return u.lightHighlightColors}}),Object.defineProperty(e,"SYNTAX_THEME_IDS",{enumerable:!0,get:function(){return l.SYNTAX_THEME_IDS}}),Object.defineProperty(e,"SYNTAX_THEME_OPTIONS",{enumerable:!0,get:function(){return l.SYNTAX_THEME_OPTIONS}}),Object.defineProperty(e,"isSyntaxThemeId",{enumerable:!0,get:function(){return l.isSyntaxThemeId}}),Object.defineProperty(e,"resolveSyntaxColors",{enumerable:!0,get:function(){return l.resolveSyntaxColors}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),u=r(d[3]),l=r(d[4])},307,[308,351,352,353,354]);
|
|
349
349
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getLanguageForFile=C,e.getParserForFile=E,e.isLanguageSupported=function(s){return null!==E(s)},e.getSupportedExtensions=function(){return Object.keys(k)};var s=r(d[0]),p=r(d[1]),n=r(d[2]),t=r(d[3]),u=r(d[4]),c=r(d[5]),o=r(d[6]),l=r(d[7]),f=r(d[8]),x=r(d[9]),j=r(d[10]),L=r(d[11]),h=r(d[12]),w=r(d[13]),y=r(d[14]),F=r(d[15]),v=r(d[16]),S=r(d[17]),_=r(d[18]),P=r(d[19]),b=r(d[20]),N=r(d[21]);function O(p){return new s.Language((0,s.defineLanguageFacet)(),p)}const k={js:O(t.parser),jsx:O(t.parser.configure({dialect:"jsx"})),ts:O(t.parser.configure({dialect:"ts"})),tsx:O(t.parser.configure({dialect:"ts jsx"})),mjs:O(t.parser),cjs:O(t.parser),c:O(o.parser),h:O(o.parser),cc:O(o.parser),cpp:O(o.parser),cxx:O(o.parser),hpp:O(o.parser),hxx:O(o.parser),m:O(o.parser),mm:O(o.parser),json:O(u.parser),css:O(c.parser),scss:O(c.parser),html:O(f.parser),htm:O(f.parser),svelte:O(b.parser.configure({wrap:(0,N.configureNesting)(N.defaultNesting)})),astro:O(_.astroParser),xml:O(y.parser),java:O(x.parser),py:O(j.parser),go:O(l.parser),php:O(h.parser),yaml:O(F.parser),yml:O(F.parser),rs:O(w.parser),swift:s.StreamLanguage.define(n.swift),dart:s.StreamLanguage.define(p.dart),cs:S.csharpLanguage,nix:P.nixLanguage,ex:O(v.parser),exs:O(v.parser),md:O(L.parser),mdx:O(L.parser)};function C(s){const p=s.split(".").pop()?.toLowerCase();return p?k[p]??null:null}function E(s){return C(s)?.parser??null}},308,[309,318,319,320,322,323,324,325,326,327,328,329,330,331,332,333,334,335,340,341,346,350]);
|
|
350
350
|
__d(function(g,_r,_i,_a2,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DocInput",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"HighlightStyle",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(_e,"IndentContext",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"LRLanguage",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"Language",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"LanguageDescription",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"LanguageSupport",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"ParseContext",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"StreamLanguage",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(_e,"StringStream",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(_e,"TreeIndentContext",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"bidiIsolates",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(_e,"bracketMatching",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(_e,"bracketMatchingHandle",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(_e,"codeFolding",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_e,"continuedIndent",{enumerable:!0,get:function(){return K}}),Object.defineProperty(_e,"defaultHighlightStyle",{enumerable:!0,get:function(){return We}}),Object.defineProperty(_e,"defineLanguageFacet",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"delimitedIndent",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"ensureSyntaxTree",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"flatIndent",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"foldAll",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_e,"foldCode",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(_e,"foldEffect",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(_e,"foldGutter",{enumerable:!0,get:function(){return je}}),Object.defineProperty(_e,"foldInside",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(_e,"foldKeymap",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(_e,"foldNodeProp",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(_e,"foldService",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(_e,"foldState",{enumerable:!0,get:function(){return le}}),Object.defineProperty(_e,"foldable",{enumerable:!0,get:function(){return re}}),Object.defineProperty(_e,"foldedRanges",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(_e,"forceParsing",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"getIndentUnit",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"getIndentation",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"highlightingFor",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(_e,"indentNodeProp",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"indentOnInput",{enumerable:!0,get:function(){return X}}),Object.defineProperty(_e,"indentRange",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"indentService",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"indentString",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"indentUnit",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"language",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"languageDataProp",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"matchBrackets",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(_e,"sublanguageProp",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"syntaxHighlighting",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(_e,"syntaxParserRunning",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"syntaxTree",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"syntaxTreeAvailable",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"toggleFold",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(_e,"unfoldAll",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(_e,"unfoldCode",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(_e,"unfoldEffect",{enumerable:!0,get:function(){return se}});var e,t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]);const s=new t.NodeProp;function a(e){return n.Facet.define({combine:e?t=>t.concat(e):void 0})}const l=new t.NodeProp;class u{constructor(e,t,r=[],i=""){this.data=e,this.name=i,n.EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(n.EditorState.prototype,"tree",{get(){return f(this)}}),this.parser=t,this.extension=[A.of(this),n.EditorState.languageData.of((e,t,n)=>{let r=c(e,t,n),i=r.type.prop(s);if(!i)return[];let o=e.facet(i),a=r.type.prop(l);if(a){let i=r.resolve(t-r.from,n);for(let t of a)if(t.test(i,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(o)}}return o})].concat(r)}isActiveAt(e,t,n=-1){return c(e,t,n).type.prop(s)==this.data}findRegions(e){let n=e.facet(A);if((null==n?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(e,n)=>{if(e.prop(s)==this.data)return void r.push({from:n,to:n+e.length});let o=e.prop(t.NodeProp.mounted);if(o){if(o.tree.prop(s)==this.data){if(o.overlay)for(let e of o.overlay)r.push({from:e.from+n,to:e.to+n});else r.push({from:n,to:n+e.length});return}if(o.overlay){let e=r.length;if(i(o.tree,o.overlay[0].from+n),r.length>e)return}}for(let r=0;r<e.children.length;r++){let o=e.children[r];o instanceof t.Tree&&i(o,e.positions[r]+n)}};return i(f(e),0),r}get allowsNesting(){return!0}}function c(e,n,r){let i=e.facet(A),o=f(e).topNode;if(!i||i.allowsNesting)for(let e=o;e;e=e.enter(n,r,t.IterMode.ExcludeBuffers|t.IterMode.EnterBracketed))e.type.isTop&&(o=e);return o}u.setState=n.StateEffect.define();class h extends u{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=a(e.languageData);return new h(t,e.parser.configure({props:[s.add(e=>e.isTop?t:void 0)]}),e.name)}configure(e,t){return new h(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function f(e){let n=e.field(u.state,!1);return n?n.tree:t.Tree.empty}function d(e,t,n=50){var r;let i=null===(r=e.field(u.state,!1))||void 0===r?void 0:r.context;if(!i)return null;let o=i.viewport;i.updateViewport({from:0,to:t});let s=i.isDone(t)||i.work(n,t)?i.tree:null;return i.updateViewport(o),s}function p(e,t=e.doc.length){var n;return(null===(n=e.field(u.state,!1))||void 0===n?void 0:n.context.isDone(t))||!1}function b(e,t=e.viewport.to,n=100){let r=d(e.state,t,n);return r!=f(e.state)&&e.dispatch({}),!!r}function k(e){var t;return(null===(t=e.plugin(T))||void 0===t?void 0:t.isWorking())||!1}class w{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let v=null;class y{constructor(e,t,n=[],r,i,o,s,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new y(e,n,[],t.Tree.empty,0,r,[],null)}startParse(){return this.parser.startParse(new w(this.state.doc),this.fragments)}work(e,n){return null!=n&&n>=this.state.doc.length&&(n=void 0),this.tree!=t.Tree.empty&&this.isDone(null!=n?n:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=n&&(null==this.parse.stoppedAt||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(t.TreeFragment.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(r=this.parse.stoppedAt)&&void 0!==r?r:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=n?n:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(t.TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=v;v=this;try{return e()}finally{v=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=P(e,t.from,t.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let n=[];if(e.iterChangedRanges((e,t,r,i)=>n.push({fromA:e,toA:t,fromB:r,toB:i})),r=t.TreeFragment.applyChanges(r,n),i=t.Tree.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&a.push({from:n,to:r})}}}return new y(this.parser,n,r,i,o,s,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=P(this.fragments,n,r),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends t.Parser{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let n=v;if(n){for(let e of i)n.tempSkipped.push(e);e&&(n.scheduleOn=n.scheduleOn?Promise.all([n.scheduleOn,e]):e)}return this.parsedPos=s,new t.Tree(t.NodeType.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return v}}function P(e,n,r){return t.TreeFragment.applyChanges(e,[{fromA:n,toA:r,fromB:n,toB:r}])}class x{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new x(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=y.create(e.facet(A).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new x(n)}}u.state=n.StateField.define({create:x.init,update(e,t){for(let e of t.effects)if(e.is(u.setState))return e.value;return t.startState.facet(A)!=t.state.facet(A)?x.init(t.state):e.apply(t)}});let S=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(S=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const O="undefined"!=typeof navigator&&(null===(e=navigator.scheduling)||void 0===e?void 0:e.isInputPending)?()=>navigator.scheduling.isInputPending():null,T=r.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(u.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(u.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=S(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(u.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!O?Math.max(25,e.timeRemaining()-5):1e9),s=i.context.treeLen<r&&n.doc.length>r+1e3,a=i.context.work(()=>O&&O()||Date.now()>o,r+(s?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:u.setState.of(new x(i.context))})),this.chunkBudget>0&&(!a||s)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>(0,r.logException)(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),A=n.Facet.define({combine:e=>e.length?e[0]:null,enables:e=>[u.state,T,r.EditorView.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class C{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class D{constructor(e,t,n,r,i,o=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new D(e.name,(e.alias||[]).concat(e.name).map(e=>e.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let n=/\.([^.]+)$/.exec(t);if(n)for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t;return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(e=>e==t))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}}const j=n.Facet.define(),I=n.Facet.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function N(e){let t=e.facet(I);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function E(e,t){let n="",r=e.tabSize,i=e.facet(I)[0];if("\t"==i){for(;t>=r;)n+="\t",t-=r;i=" "}for(let e=0;e<t;e++)n+=i;return n}function B(e,t){e instanceof n.EditorState&&(e=new M(e));for(let n of e.state.facet(j)){let r=n(e,t);if(void 0!==r)return r}let r=f(e.state);return r.length>=t?F(e,r,t):null}function L(e,t,n){let r=Object.create(null),i=new M(e,{overrideIndentation:e=>{var t;return null!==(t=r[e])&&void 0!==t?t:-1}}),o=[];for(let s=t;s<=n;){let t=e.doc.lineAt(s);s=t.to+1;let n=B(i,t.from);if(null==n)continue;/\S/.test(t.text)||(n=0);let a=/^\s*/.exec(t.text)[0],l=E(e,n);a!=l&&(r[t.from]=n,o.push({from:t.from,to:t.from+a.length,insert:l}))}return e.changes(o)}class M{constructor(e,t={}){this.state=e,this.options=t,this.unit=N(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return null!=r&&r>=n.from&&r<=n.to?i&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(i+=o-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return(0,n.countColumn)(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const R=new t.NodeProp;function F(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return V(r,e,n)}function V(e,t,n){for(let r=e;r;r=r.next){let e=U(r.node);if(e)return e(z.create(t,n,r))}return 0}function W(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function U(e){let n=e.type.prop(R);if(n)return n;let r,i=e.firstChild;if(i&&(r=i.type.prop(t.NodeProp.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>J(e,!0,1,void 0,n&&!W(e)?t.from:void 0)}return null==e.parent?$:null}function $(){return 0}class z extends M{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new z(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(H(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return V(this.context.next,this.base,this.pos)}}function H(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function G(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=null==i||i<=o.from?o.to:Math.min(o.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=s)return null;let e=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function q({closing:e,align:t=!0,units:n=1}){return r=>J(r,t,n,e)}function J(e,t,n,r,i){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==e.pos+s,l=t?G(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}const _=e=>e.baseIndent;function K({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}const Q=200;function X(){return n.EditorState.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+Q)return e;let o=n.sliceString(i.from,r);if(!t.some(e=>e.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=B(s,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],i=E(s,n);r!=i&&l.push({from:t.from,to:t.from+r.length,insert:i})}return l.length?[e,{changes:l,sequential:!0}]:e})}const Y=n.Facet.define(),Z=new t.NodeProp;function ee(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function te(e,t,n){let r=f(e);if(r.length<n)return null;let i=null;for(let o=r.resolveStack(n,1);o;o=o.next){let s=o.node;if(s.to<=n||s.from>n)continue;if(i&&s.from<t)break;let a=s.type.prop(Z);if(a&&(s.to<r.length-50||r.length==e.doc.length||!ne(s))){let r=a(s,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(i=r)}}return i}function ne(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function re(e,t,n){for(let r of e.facet(Y)){let i=r(e,t,n);if(i)return i}return te(e,t,n)}function ie(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const oe=n.StateEffect.define({map:ie}),se=n.StateEffect.define({map:ie});function ae(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}const le=n.StateField.define({create:()=>r.Decoration.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=ue(e,t,n)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(oe)&&!fe(e,r.value.from,r.value.to)?n.push(r.value):r.is(se)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(xe),o=n.map(e=>(i?r.Decoration.replace({widget:new Ae(i(t.state,e))}):Te).range(e.from,e.to));e=e.update({add:o})}return t.selection&&(e=ue(e,t.selection.main.head)),e},provide:e=>r.EditorView.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if("number"!=typeof r||"number"!=typeof i)throw new RangeError("Invalid JSON for fold state");t.push(Te.range(r,i))}return r.Decoration.set(t,!0)}});function ue(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function ce(e){return e.field(le,!1)||n.RangeSet.empty}function he(e,t,n){var r;let i=null;return null===(r=e.field(le,!1))||void 0===r||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function fe(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function de(e,t){return e.field(le,!1)?t:t.concat(n.StateEffect.appendConfig.of(Se()))}const pe=e=>{for(let t of ae(e)){let n=re(e.state,t.from,t.to);if(n)return e.dispatch({effects:de(e.state,[oe.of(n),me(e,n)])}),!0}return!1},ge=e=>{if(!e.state.field(le,!1))return!1;let t=[];for(let n of ae(e)){let r=he(e.state,n.from,n.to);r&&t.push(se.of(r),me(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function me(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,o=e.state.doc.lineAt(t.to).number;return r.EditorView.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${o}.`)}const be=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),o=re(t,i.from,i.to);o&&n.push(oe.of(o)),r=(o?e.lineBlockAt(o.to):i).to+1}return n.length&&e.dispatch({effects:de(e.state,n)}),!!n.length},ke=e=>{let t=e.state.field(le,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(se.of({from:e,to:t}))}),e.dispatch({effects:n}),!0};function we(e,t){for(let n=t;;){let r=re(e.state,n.from,n.to);if(r&&r.to>t.from)return r;if(!n.from)return null;n=e.lineBlockAt(n.from-1)}}const ve=e=>{let t=[];for(let n of ae(e)){let r=he(e.state,n.from,n.to);if(r)t.push(se.of(r),me(e,r,!1));else{let r=we(e,n);r&&t.push(oe.of(r),me(e,r))}}return t.length>0&&e.dispatch({effects:de(e.state,t)}),!!t.length},ye=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:pe},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ge},{key:"Ctrl-Alt-[",run:be},{key:"Ctrl-Alt-]",run:ke}],Pe={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},xe=n.Facet.define({combine:e=>(0,n.combineConfig)(e,Pe)});function Se(e){let t=[le,Ie];return e&&t.push(xe.of(e)),t}function Oe(e,t){let{state:n}=e,r=n.facet(xe),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=he(e.state,n.from,n.to);r&&e.dispatch({effects:se.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const Te=r.Decoration.replace({widget:new class extends r.WidgetType{toDOM(e){return Oe(e,null)}}});class Ae extends r.WidgetType{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Oe(e,this.value)}}const Ce={openText:"\u2304",closedText:"\u203a",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class De extends r.GutterMarker{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function je(e={}){let t=Object.assign({},Ce,e),i=new De(t,!0),o=new De(t,!1),s=r.ViewPlugin.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(A)!=e.state.facet(A)||e.startState.field(le,!1)!=e.state.field(le,!1)||f(e.startState)!=f(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new n.RangeSetBuilder;for(let n of e.viewportLineBlocks){let r=he(e.state,n.from,n.to)?o:re(e.state,n.from,n.to)?i:null;r&&t.add(n.from,n.from,r)}return t.finish()}}),{domEventHandlers:a}=t;return[s,(0,r.gutter)({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(s))||void 0===t?void 0:t.markers)||n.RangeSet.empty},initialSpacer:()=>new De(t,!1),domEventHandlers:Object.assign({},a,{click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=he(e.state,t.from,t.to);if(r)return e.dispatch({effects:se.of(r)}),!0;let i=re(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:oe.of(i)}),!0)}})}),Se()]}const Ie=r.EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Ne{constructor(e,t){let n;function r(e){let t=o.StyleModule.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const a="string"==typeof t.all?t.all:t.all?r(t.all):void 0,l=t.scope;this.scope=l instanceof u?e=>e.prop(s)==l.data:l?e=>e==l:void 0,this.style=(0,i.tagHighlighter)(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:a}).style,this.module=n?new o.StyleModule(n):null,this.themeType=t.themeType}static define(e,t){return new Ne(e,t||{})}}const Ee=n.Facet.define(),Be=n.Facet.define({combine:e=>e.length?[e[0]]:null});function Le(e){let t=e.facet(Ee);return t.length?t:e.facet(Be)}function Me(e,t){let n,i=[Ve];return e instanceof Ne&&(e.module&&i.push(r.EditorView.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?i.push(Be.of(e)):n?i.push(Ee.computeN([r.EditorView.darkTheme],t=>t.facet(r.EditorView.darkTheme)==("dark"==n)?[e]:[])):i.push(Ee.of(e)),i}function Re(e,t,n){let r=Le(e),i=null;if(r)for(let e of r)if(!e.scope||n&&e.scope(n)){let n=e.style(t);n&&(i=i?i+" "+n:n)}return i}class Fe{constructor(e){this.markCache=Object.create(null),this.tree=f(e.state),this.decorations=this.buildDeco(e,Le(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=f(e.state),n=Le(e.state),r=n!=Le(e.startState),{viewport:i}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&o>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return r.Decoration.none;let o=new n.RangeSetBuilder;for(let{from:n,to:s}of e.visibleRanges)(0,i.highlightTree)(this.tree,t,(e,t,n)=>{o.add(e,t,this.markCache[n]||(this.markCache[n]=r.Decoration.mark({class:n})))},n,s);return o.finish()}}const Ve=n.Prec.high(r.ViewPlugin.fromClass(Fe,{decorations:e=>e.decorations})),We=Ne.define([{tag:i.tags.meta,color:"#404740"},{tag:i.tags.link,textDecoration:"underline"},{tag:i.tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:i.tags.emphasis,fontStyle:"italic"},{tag:i.tags.strong,fontWeight:"bold"},{tag:i.tags.strikethrough,textDecoration:"line-through"},{tag:i.tags.keyword,color:"#708"},{tag:[i.tags.atom,i.tags.bool,i.tags.url,i.tags.contentSeparator,i.tags.labelName],color:"#219"},{tag:[i.tags.literal,i.tags.inserted],color:"#164"},{tag:[i.tags.string,i.tags.deleted],color:"#a11"},{tag:[i.tags.regexp,i.tags.escape,i.tags.special(i.tags.string)],color:"#e40"},{tag:i.tags.definition(i.tags.variableName),color:"#00f"},{tag:i.tags.local(i.tags.variableName),color:"#30a"},{tag:[i.tags.typeName,i.tags.namespace],color:"#085"},{tag:i.tags.className,color:"#167"},{tag:[i.tags.special(i.tags.variableName),i.tags.macroName],color:"#256"},{tag:i.tags.definition(i.tags.propertyName),color:"#00c"},{tag:i.tags.comment,color:"#940"},{tag:i.tags.invalid,color:"#f00"}]),Ue=r.EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),$e=1e4,ze="()[]{}",He=n.Facet.define({combine:e=>(0,n.combineConfig)(e,{afterCursor:!0,brackets:ze,maxScanDistance:$e,renderMatch:Je})}),Ge=r.Decoration.mark({class:"cm-matchingBracket"}),qe=r.Decoration.mark({class:"cm-nonmatchingBracket"});function Je(e){let t=[],n=e.matched?Ge:qe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function Ke(e){let t=[],n=e.facet(He);for(let r of e.selection.ranges){if(!r.empty)continue;let i=tt(e,r.head,-1,n)||r.head>0&&tt(e,r.head-1,1,n)||n.afterCursor&&(tt(e,r.head,1,n)||r.head<e.doc.length&&tt(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return r.Decoration.set(t,!0)}const Qe=[r.ViewPlugin.fromClass(class{constructor(e){this.paused=!1,this.decorations=Ke(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=Ke(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),Ue];function Xe(e={}){return[He.of(e),Qe]}const Ye=new t.NodeProp;function Ze(e,n,r){let i=e.prop(n<0?t.NodeProp.openedBy:t.NodeProp.closedBy);if(i)return i;if(1==e.name.length){let t=r.indexOf(e.name);if(t>-1&&t%2==(n<0?1:0))return[r[t+n]]}return null}function et(e){let t=e.type.prop(Ye);return t?t(e.node):e}function tt(e,t,n,r={}){let i=r.maxScanDistance||$e,o=r.brackets||ze,s=f(e),a=s.resolveInner(t,n);for(let r=a;r;r=r.parent){let i=Ze(r.type,n,o);if(i&&r.from<r.to){let s=et(r);if(s&&(n>0?t>=s.from&&t<s.to:t>s.from&&t<=s.to))return nt(e,t,n,r,s,i,o)}}return rt(e,t,n,s,a.type,i,o)}function nt(e,t,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},u=0,c=null==a?void 0:a.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do{if(n<0?c.to<=r.from:c.from>=r.to){if(0==u&&o.indexOf(c.type.name)>-1&&c.from<c.to){let e=et(c);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(Ze(c.type,n,s))u++;else if(Ze(c.type,-n,s)){if(0==u){let e=et(c);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}u--}}}while(n<0?c.prevSibling():c.nextSibling());return{start:l,matched:!1}}function rt(e,t,n,r,i,o,s){if(n<0?!t:t==e.doc.length)return null;let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),h=0;for(let e=0;!c.next().done&&e<=o;){let o=c.value;n<0&&(e+=o.length);let a=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=s.indexOf(o[e]);if(!(t<0||r.resolveInner(a+e,1).type!=i))if(t%2==0==n>0)h++;else{if(1==h)return{start:u,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};h--}}n>0&&(e+=o.length)}return c.done?{start:u,matched:!1}:null}function it(e,t,n,r=0,i=0){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);let o=i;for(let i=r;i<t;i++)9==e.charCodeAt(i)?o+=n-o%n:o++;return o}class ot{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t,n=this.string.charAt(this.pos);if(t="string"==typeof e?n==e:n&&(e instanceof RegExp?e.test(n):e(n)),t)return++this.pos,n}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=it(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return null!==(e=this.overrideIndent)&&void 0!==e?e:it(this.string,null,this.tabSize)}match(e,t,n){if("string"==typeof e){let r=e=>n?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(!1!==t&&(this.pos+=e.length),!0):null}{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function st(e){if("object"!=typeof e)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}const at=new WeakMap;class lt extends u{constructor(e){let n,r=a(e.languageData),i={name:(o=e).name||"",token:o.token,blankLine:o.blankLine||(()=>{}),startState:o.startState||(()=>!0),copyState:o.copyState||st,indent:o.indent||(()=>null),languageData:o.languageData||{},tokenTable:o.tokenTable||pt,mergeTokens:!1!==o.mergeTokens};var o;super(r,new class extends t.Parser{createParse(e,t,r){return new ft(n,e,t,r)}},[],e.name),this.topNode=St(r,this),n=this,this.streamParser=i,this.stateAfter=new t.NodeProp({perNode:!0}),this.tokenTable=e.tokenTable?new vt(i.tokenTable):yt}static define(e){return new lt(e)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=at.get(e.state),null!=t&&t<e.pos-1e4&&(t=void 0));let r,i,o=ut(this,e.node.tree,e.node.from,e.node.from,null!=t?t:e.pos);if(o?(i=o.state,r=o.pos+1):(i=this.streamParser.startState(e.unit),r=e.node.from),e.pos-r>1e4)return null;for(;r<e.pos;){let t=e.state.doc.lineAt(r),o=Math.min(e.pos,t.to);if(t.length){let r=n?n(t.from):-1,s=new ot(t.text,e.state.tabSize,e.unit,r<0?void 0:r);for(;s.pos<o-t.from;)dt(this.streamParser.token,s,i)}else this.streamParser.blankLine(i,e.unit);if(o==e.pos)break;r=t.to+1}let s=e.lineAt(e.pos);return n&&null==t&&at.set(e.state,s.from),this.streamParser.indent(i,/^\s*(.*)/.exec(s.text)[1],e)}get allowsNesting(){return!1}}function ut(e,n,r,i,o){let s=r>=i&&r+n.length<=o&&n.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:r+n.length};for(let s=n.children.length-1;s>=0;s--){let a=n.children[s],l=r+n.positions[s],u=a instanceof t.Tree&&l<o&&ut(e,a,l,i,o);if(u)return u}return null}function ct(e,n,r,i,o){if(o&&r<=0&&i>=n.length)return n;o||0!=r||n.type!=e.topNode||(o=!0);for(let s=n.children.length-1;s>=0;s--){let a,l=n.positions[s],u=n.children[s];if(l<i&&u instanceof t.Tree){if(!(a=ct(e,u,r-l,i-l,o)))break;return o?new t.Tree(n.type,n.children.slice(0,s).concat(a),n.positions.slice(0,s+1),l+a.length):a}}return null}function ht(e,n,r,i,o){for(let t of n){let n,o=t.from+(t.openStart?25:0),s=t.to-(t.openEnd?25:0),a=o<=r&&s>r&&ut(e,t.tree,0-t.offset,r,s);if(a&&a.pos<=i&&(n=ct(e,t.tree,r+t.offset,a.pos+t.offset,!1)))return{state:a.state,tree:n}}return{state:e.streamParser.startState(o?N(o):4),tree:t.Tree.empty}}class ft{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=y.get(),o=r[0].from,{state:s,tree:a}=ht(e,n,o,this.to,null==i?void 0:i.state);this.state=s,this.parsedPos=this.chunkStart=o+a.length;for(let e=0;e<a.children.length;e++)this.chunks.push(a.children[e]),this.chunkPos.push(a.positions[e]);i&&this.parsedPos<i.viewport.from-1e5&&r.some(e=>e.from<=i.viewport.from&&e.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(N(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=y.get(),t=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)"\n"==t&&(t="");else{let e=t.indexOf("\n");e>-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let e=this.rangeIndex;;){let r=this.ranges[e].to;if(r>=n)break;if(t=t.slice(0,r-(n-t.length)),e++,e==this.ranges.length)break;let i=this.ranges[e].from,o=this.lineAfter(i);t+=o,n=i+o.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;t+=this.ranges[++this.rangeIndex].from-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,r){let i=4;if(this.ranges.length>1){t+=r=this.skipGapsTo(t,r,1);let e=this.chunk.length;n+=r=this.skipGapsTo(n,r,-1),i+=this.chunk.length-e}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&4==i&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=n:this.chunk.push(e,t,n,i),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang,o=new ot(t,e?e.state.tabSize:4,e?N(e.state):2);if(o.eol())i.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let e=dt(i.token,o,this.state);if(e&&(r=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=t.Tree.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:mt,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new t.Tree(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new t.Tree(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function dt(e,t,n){t.start=t.pos;for(let r=0;r<10;r++){let r=e(t,n);if(t.pos>t.start)return r}throw new Error("Stream parser failed to advance stream.")}const pt=Object.create(null),gt=[t.NodeType.none],mt=new t.NodeSet(gt),bt=[],kt=Object.create(null),wt=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])wt[e]=xt(pt,t);class vt{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),wt)}resolve(e){return e?this.table[e]||(this.table[e]=xt(this.extra,e)):0}}const yt=new vt(pt);function Pt(e,t){bt.indexOf(e)>-1||(bt.push(e),console.warn(t))}function xt(e,n){let r=[];for(let t of n.split(" ")){let n=[];for(let r of t.split(".")){let t=e[r]||i.tags[r];t?"function"==typeof t?n.length?n=n.map(t):Pt(r,`Modifier ${r} used at start of tag`):n.length?Pt(r,`Tag ${r} used as modifier`):n=Array.isArray(t)?t:[t]:Pt(r,`Unknown highlighting tag ${r}`)}for(let e of n)r.push(e)}if(!r.length)return 0;let o=n.replace(/ /g,"_"),s=o+" "+r.map(e=>e.id),a=kt[s];if(a)return a.id;let l=kt[s]=t.NodeType.define({id:gt.length,name:o,props:[(0,i.styleTags)({[o]:r})]});return gt.push(l),l.id}function St(e,n){let r=t.NodeType.define({id:gt.length,name:"Document",props:[s.add(()=>e),R.add(()=>e=>n.getIndent(e))],top:!0});return gt.push(r),r}function Ot(e){return e.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(e)}function Tt(e){for(let t=e.iter();!t.next().done;)if(Ot(t.value))return!0;return!1}function At(e){let t=!1;return e.iterChanges((e,n,r,i,o)=>{!t&&Tt(o)&&(t=!0)}),t}const Ct=n.Facet.define({combine:e=>e.some(e=>e)});function Dt(e={}){let t=[jt];return e.alwaysIsolate&&t.push(Ct.of(!0)),t}const jt=r.ViewPlugin.fromClass(class{constructor(e){this.always=e.state.facet(Ct)||e.textDirection!=r.Direction.LTR||e.state.facet(r.EditorView.perLineTextDirection),this.hasRTL=!this.always&&Tt(e.state.doc),this.tree=f(e.state),this.decorations=this.always||this.hasRTL?It(e,this.tree,this.always):r.Decoration.none}update(e){let t=e.state.facet(Ct)||e.view.textDirection!=r.Direction.LTR||e.state.facet(r.EditorView.perLineTextDirection);if(t||this.hasRTL||!At(e.changes)||(this.hasRTL=!0),!t&&!this.hasRTL)return;let n=f(e.state);(t!=this.always||n!=this.tree||e.docChanged||e.viewportChanged)&&(this.tree=n,this.always=t,this.decorations=It(e.view,n,t))}},{provide:e=>{function t(t){var n,i;return null!==(i=null===(n=t.plugin(e))||void 0===n?void 0:n.decorations)&&void 0!==i?i:r.Decoration.none}return[r.EditorView.outerDecorations.of(t),n.Prec.lowest(r.EditorView.bidiIsolatedRanges.of(t))]}});function It(e,r,i){let o=new n.RangeSetBuilder,s=e.visibleRanges;i||(s=Nt(s,e.state.doc));for(let{from:e,to:n}of s)r.iterate({enter:e=>{let n=e.type.prop(t.NodeProp.isolate);n&&o.add(e.from,e.to,Et[n])},from:e,to:n});return o.finish()}function Nt(e,t){let n=t.iter(),r=0,i=[],o=null;for(let{from:t,to:s}of e)if(!(o&&o.to>t&&(t=o.to,t>=s)))for(r+n.value.length<t&&(n.next(t-(r+n.value.length)),r=t);;){let e=r,t=r+n.value.length;if(!n.lineBreak&&Ot(n.value)&&(o&&o.to>e-10?o.to=Math.min(s,t):i.push(o={from:e,to:Math.min(s,t)})),t>=s)break;r=t,n.next()}return i}const Et={rtl:r.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:r.Direction.RTL}),ltr:r.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:r.Direction.LTR}),auto:r.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})}},309,[310,311,313,317,314]);
|
|
@@ -14647,7 +14647,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
14647
14647
|
__d(function(g,r,i,a,m,e,d){"use strict";function t(t,u){return t instanceof Error?n(t,u):"string"==typeof t?t:null==t||"object"!=typeof t&&"function"!=typeof t?f(t):o(t,u)??f(t)}function n(n,h){if(h.has(n))return"[Circular Error]";h.add(n);const p=[],y=u(Reflect.get(n,"name"),h),v=u(Reflect.get(n,"message"),h),b=u(Reflect.get(n,"stack"),h);y&&p.push(`Name: ${y}`),v&&p.push(`Message: ${v}`),b&&p.push(`Stack:\n${b}`);const R=s(n);R.hasCause&&p.push(`Cause:\n${t(R.value,h)}`);const $=c(n);$.hasErrors&&p.push(`Errors:\n${t($.value,h)}`);const k=l(n);return null!==k&&p.push(`Fields:\n${o(k,h)??f(k)}`),h.delete(n),p.join("\n\n")||f(n)}function u(t,n){if("string"==typeof t){return t.trim()||null}return void 0===t?null:o(t,n)??f(t)}function s(t){return Reflect.has(t,"cause")?{hasCause:!0,value:Reflect.get(t,"cause")}:{hasCause:!1,value:null}}function c(t){return Reflect.has(t,"errors")?{hasErrors:!0,value:Reflect.get(t,"errors")}:{hasErrors:!1,value:null}}function l(t){const n={};for(const u of Object.keys(t))"name"!==u&&"message"!==u&&"stack"!==u&&"cause"!==u&&"errors"!==u&&(n[u]=Reflect.get(t,u));return Object.keys(n).length>0?n:null}function o(t,u){const s=new WeakSet;try{const c=JSON.stringify(t,(t,c)=>{if(c instanceof Error)return n(c,u);if("bigint"==typeof c)return String(c);if(null!==c&&"object"==typeof c){if(s.has(c))return"[Circular]";s.add(c)}return c},2);return"string"==typeof c?c:null}catch{return null}}function f(t){try{return String(t)}catch{return"[Unserializable value]"}}function h(t,n){const u=f(t),s=f(n);return"[Unserializable value]"===s?u:`${u}\n\nDetails unavailable:\n${s}`}Object.defineProperty(e,'__esModule',{value:!0}),e.formatCaughtValue=function(n){try{return t(n,new WeakSet)}catch(t){return h(n,t)}}},3030,[]);
|
|
14648
14648
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ctx",{enumerable:!0,get:function(){return t}});const t=r(d[0])},3031,[3032]);
|
|
14649
14649
|
__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./_layout.tsx":{enumerable:!0,get:()=>r(d[0])},"./h/[serverId]/_layout.tsx":{enumerable:!0,get:()=>r(d[1])},"./h/[serverId]/agent/[agentId].tsx":{enumerable:!0,get:()=>r(d[2])},"./h/[serverId]/index.tsx":{enumerable:!0,get:()=>r(d[3])},"./h/[serverId]/open-project.tsx":{enumerable:!0,get:()=>r(d[4])},"./h/[serverId]/plugin/[pluginId]/[contributionKind]/[contributionId].tsx":{enumerable:!0,get:()=>r(d[5])},"./h/[serverId]/plugin/[pluginId]/[surfaceId].tsx":{enumerable:!0,get:()=>r(d[6])},"./h/[serverId]/sessions.tsx":{enumerable:!0,get:()=>r(d[7])},"./h/[serverId]/settings.tsx":{enumerable:!0,get:()=>r(d[8])},"./h/[serverId]/workspace/[workspaceId]/index.tsx":{enumerable:!0,get:()=>r(d[9])},"./index.tsx":{enumerable:!0,get:()=>r(d[10])},"./new.tsx":{enumerable:!0,get:()=>r(d[11])},"./open-project.tsx":{enumerable:!0,get:()=>r(d[12])},"./pair-scan.tsx":{enumerable:!0,get:()=>r(d[13])},"./schedules.tsx":{enumerable:!0,get:()=>r(d[14])},"./sessions.tsx":{enumerable:!0,get:()=>r(d[15])},"./settings/[section].tsx":{enumerable:!0,get:()=>r(d[16])},"./settings/hosts/[serverId]/[hostSection].tsx":{enumerable:!0,get:()=>r(d[17])},"./settings/hosts/[serverId]/index.tsx":{enumerable:!0,get:()=>r(d[18])},"./settings/hosts/[serverId]/plugins/[pluginId]/[screenId].tsx":{enumerable:!0,get:()=>r(d[19])},"./settings/hosts/[serverId]/projects/[projectId].tsx":{enumerable:!0,get:()=>r(d[20])},"./settings/hosts/[serverId]/projects/index.tsx":{enumerable:!0,get:()=>r(d[21])},"./settings/index.tsx":{enumerable:!0,get:()=>r(d[22])},"./usage.tsx":{enumerable:!0,get:()=>r(d[23])},"./welcome.tsx":{enumerable:!0,get:()=>r(d[24])}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},3032,[3033,4948,4950,4957,4958,4959,4960,4961,4962,4963,5016,5017,5035,5068,5085,5103,5115,5175,5176,5177,5178,5179,5180,5181,5182]);
|
|
14650
|
-
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t}function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return Bt}}),_e.useEarliestOnlineHostServerId=nt,_e.useStoreReady=dt,_e.useHostRuntimeBootstrapState=function(){return(0,h.useContext)(Qe)};var n=r(_d[0]),o=r(_d[1]);r(_d[2]);var s=r(_d[3]),c=r(_d[4]),l=e(r(_d[5])),u=e(r(_d[6])),d=r(_d[7]),h=r(_d[8]),f=t(r(_d[9])),S=t(r(_d[10]));r(_d[11]);var p=r(_d[12]),v=r(_d[13]),x=r(_d[14]),b=r(_d[15]),j=r(_d[16]),y=r(_d[17]),k=r(_d[18]),I=r(_d[19]),_=r(_d[20]),C=r(_d[21]),E=r(_d[22]),w=r(_d[23]),P=r(_d[24]),H=r(_d[25]),R=r(_d[26]),D=r(_d[27]),W=r(_d[28]),A=r(_d[29]),L=r(_d[30]),O=r(_d[31]),T=r(_d[32]),F=r(_d[33]),M=r(_d[34]),N=r(_d[35]),B=r(_d[36]),V=r(_d[37]),G=r(_d[38]),U=r(_d[39]),K=r(_d[40]),q=r(_d[41]),z=r(_d[42]),Q=r(_d[43]),Y=r(_d[44]),Z=r(_d[45]),J=r(_d[46]),X=r(_d[47]),$=r(_d[48]),ee=r(_d[49]),te=r(_d[50]),ne=r(_d[51]),oe=r(_d[52]),re=r(_d[53]),se=r(_d[54]),ie=r(_d[55]),ce=r(_d[56]),ae=r(_d[57]),le=r(_d[58]),ue=r(_d[59]),de=r(_d[60]),me=r(_d[61]),he=r(_d[62]),fe=r(_d[63]),Se=r(_d[64]),pe=r(_d[65]),ge=r(_d[66]),ve=r(_d[67]),xe=r(_d[68]),be=r(_d[69]),je=r(_d[70]),ye=r(_d[71]),ke=r(_d[72]),Ie=r(_d[73]),Ce=r(_d[74]),Ee=r(_d[75]),we=r(_d[76]),Pe=r(_d[77]),He=r(_d[78]),Re=r(_d[79]),De=r(_d[80]),We=r(_d[81]),Ae=r(_d[82]),Le=r(_d[83]),Oe=r(_d[84]),Te=r(_d[85]),Fe=r(_d[86]),Me=r(_d[87]),Ne=r(_d[88]),Be=r(_d[89]),Ve=r(_d[90]),Ge=r(_d[91]),Ue=r(_d[92]),Ke=r(_d[93]),qe=r(_d[94]),ze=r(_d[95]);(0,We.polyfillCrypto)();const Qe=(0,h.createContext)({splashError:null,retry:()=>{},hasGivenUpWaitingForHost:!1,storeReady:!1,startupBlocker:{kind:"none"}});function Ye(){const e=(0,o.c)(5),t=(0,d.useRouter)(),n=(0,h.useRef)(null);let s;e[0]!==t?(s=e=>{const n=(0,Ge.resolveNotificationTarget)(e),o=n.serverId,s=n.workspaceId,c=n.agentId;o&&s&&c?(0,Ue.navigateToAgent)({serverId:o,workspaceId:s,agentId:c,pin:!0}):o&&s&&n.terminalId?(0,re.navigateToWorkspace)({serverId:o,workspaceId:s,target:{kind:"terminal",terminalId:n.terminalId}}):t.navigate((0,Ge.buildNotificationRoute)(e))},e[0]=t,e[1]=s):s=e[1];const c=(0,Pe.useStableEvent)(s);let l,f;return e[2]!==c?(l=()=>{if(Z.isWeb){let e=null,t=!1;if((0,Q.getIsElectronRuntime)()){(0,qe.ensureOsNotificationPermission)();const n=(0,he.getDesktopHost)()?.events?.on?.("notification-click",e=>{const t="object"==typeof e&&null!==e&&"data"in e&&"object"==typeof e.data&&null!==e.data?e.data:void 0;c(t)});Promise.resolve(n).then(n=>{"function"==typeof n&&(t?n():e=n)})}const n=e=>{const t=e;e.preventDefault(),c(t.detail?.data)};return window.addEventListener(qe.WEB_NOTIFICATION_CLICK_EVENT,n),()=>{t=!0,e?.(),window.removeEventListener(qe.WEB_NOTIFICATION_CLICK_EVENT,n)}}u.setNotificationHandler({handleNotification:Ze});const e=e=>{const t=e.notification.request.identifier;if(n.current===t)return;n.current=t;const o=e.notification.request.content.data;c(o)},t=u.addNotificationResponseReceivedListener(e);return u.getLastNotificationResponseAsync().then(t=>{t&&e(t)}),()=>{t.remove()}},f=[c],e[2]=c,e[3]=l,e[4]=f):(l=e[3],f=e[4]),(0,h.useEffect)(l,f),null}async function Ze(){return{shouldShowAlert:!1,shouldShowBanner:!1,shouldShowList:!1,shouldPlaySound:!1,shouldSetBadge:!1}}function Je(e){const t=(0,o.c)(9),{daemon:n}=e,s=(0,Ae.useHostRuntimeClient)(n.serverId);if(!s)return null;let c,l,u;return t[0]!==s||t[1]!==n.serverId?(c=(0,ze.jsx)(Xe,{serverId:n.serverId,client:s}),l=(0,ze.jsx)(Ke.PluginCatalogSync,{serverId:n.serverId,client:s}),t[0]=s,t[1]=n.serverId,t[2]=c,t[3]=l):(c=t[2],l=t[3]),t[4]!==s||t[5]!==n.serverId||t[6]!==c||t[7]!==l?(u=(0,ze.jsxs)(X.SessionProvider,{serverId:n.serverId,client:s,children:[c,l]},n.serverId),t[4]=s,t[5]=n.serverId,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function Xe(e){const t=(0,o.c)(8),{serverId:n,client:s}=e;let c;t[0]!==n?(c=e=>e.sessions[n]?.serverInfo??null,t[0]=n,t[1]=c):c=t[1];const l=(0,Me.useSessionStore)(c),u=(0,Ae.useHostRuntimeIsConnected)(n);let d,f;return t[2]!==s||t[3]!==u||t[4]!==n||t[5]!==l?(d=()=>{l&&u&&ue.legacyFavoriteProfileMigration.migrateHost(n,s).catch($e)},f=[s,u,n,l],t[2]=s,t[3]=u,t[4]=n,t[5]=l,t[6]=d,t[7]=f):(d=t[6],f=t[7]),(0,h.useEffect)(d,f),null}function $e(e){console.warn("[AgentProfiles] Failed to migrate legacy favourites",e)}function et(){const e=(0,o.c)(4),t=(0,Ae.useHosts)();if(0===t.length)return null;let n,s;return e[0]!==t?(n=t.map(tt),e[0]=t,e[1]=n):n=e[1],e[2]!==n?(s=(0,ze.jsx)(ze.Fragment,{children:n}),e[2]=n,e[3]=s):s=e[3],s}function tt(e){return(0,ze.jsx)(Je,{daemon:e},e.serverId)}function nt(){const e=(0,o.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,Ae.getHostRuntimeStore)(),e[0]=t):t=e[0];const n=t;let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{const t=n.subscribeAll(e),o=n.subscribeHostList(e);return()=>{t(),o()}},e[1]=s):s=e[1];const c=s;let l,u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>n.getEarliestOnlineHostServerId(),u=()=>n.getEarliestOnlineHostServerId(),e[2]=l,e[3]=u):(l=e[2],u=e[3]),(0,h.useSyncExternalStore)(c,l,u)}function ot(){const e=(0,o.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,Le.getDaemonStartService)({store:(0,Ae.getHostRuntimeStore)()}),e[0]=t):t=e[0];const n=t;let s,c,l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=e=>n.subscribe(e),c=()=>n.getLastError(),l=()=>n.getLastError(),e[1]=s,e[2]=c,e[3]=l):(s=e[1],c=e[2],l=e[3]),(0,h.useSyncExternalStore)(s,c,l)}function rt(){const e=(0,o.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,Le.getDaemonStartService)({store:(0,Ae.getHostRuntimeStore)()}),e[0]=t):t=e[0];const n=t;let s,c,l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=e=>n.subscribe(e),c=()=>n.isRunning(),l=()=>n.isRunning(),e[1]=s,e[2]=c,e[3]=l):(s=e[1],c=e[2],l=e[3]),(0,h.useSyncExternalStore)(s,c,l)}const st=5e3;async function it(){if(!(0,ie.shouldUseDesktopDaemon)())return!1;if((0,Ae.hasConfiguredLocalDaemonOverride)())return!1;return(await(0,fe.loadDesktopSettings)()).daemon.manageBuiltInDaemon}function ct(e){const t=(0,o.c)(24),{children:n}=e;let s,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[0]=s):s=t[0],(0,h.useEffect)(ut,s),t[1]===Symbol.for("react.memo_cache_sentinel")?(c=[],t[1]=c):c=t[1],(0,h.useEffect)(lt,c);const l=nt(),u=ot(),d=rt(),[f,S]=(0,h.useState)(!1);let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p=(0,ie.shouldUseDesktopDaemon)(),t[2]=p):p=t[2];const v=p;let x;t[3]!==l||t[4]!==u||t[5]!==d?(x=(0,ne.resolveStartupBlocker)({isDesktopRuntime:v,anyOnlineHostServerId:l,daemonStartIsRunning:d,daemonStartError:u}),t[3]=l,t[4]=u,t[5]=d,t[6]=x):x=t[6];const b=x;let j;t[7]!==l||t[8]!==f||t[9]!==b?(j=(0,ne.shouldRunStartupGiveUpTimer)({startupBlocker:b,anyOnlineHostServerId:l,hasGivenUpWaitingForHost:f}),t[7]=l,t[8]=f,t[9]=b,t[10]=j):j=t[10];const y=j;let k,I;t[11]!==y?(k=()=>{if(!y)return;const e=setTimeout(()=>{S(!0)},st);return()=>{clearTimeout(e)}},I=[y],t[11]=y,t[12]=k,t[13]=I):(k=t[12],I=t[13]),(0,h.useEffect)(k,I);const _=at,C="managed-daemon-error"===b.kind?b.message:null;let E;t[14]!==b?(E=(0,ne.resolveStartupNavigationReady)({startupBlocker:b}),t[14]=b,t[15]=E):E=t[15];const w=E;let P;t[16]!==f||t[17]!==C||t[18]!==b||t[19]!==w?(P={splashError:C,retry:_,hasGivenUpWaitingForHost:f,storeReady:w,startupBlocker:b},t[16]=f,t[17]=C,t[18]=b,t[19]=w,t[20]=P):P=t[20];const H=P;let R;return t[21]!==n||t[22]!==H?(R=(0,ze.jsx)(Qe.Provider,{value:H,children:n}),t[21]=n,t[22]=H,t[23]=R):R=t[23],R}function at(){(0,Le.getDaemonStartService)({store:(0,Ae.getHostRuntimeStore)()}).startIfEnabled({shouldStart:it})}function lt(){const e=(0,Ae.getHostRuntimeStore)(),t=(0,Le.getDaemonStartService)({store:e});(0,ne.startHostRuntimeBootstrap)({store:e,daemonStartService:t,shouldStartDaemon:it})}function ut(){const e=(0,Ae.getHostRuntimeStore)();return(0,ne.bindHostRuntimeAppState)(e,f.default)}function dt(){return(0,h.useContext)(Qe).storeReady}const mt={flex:1,flexDirection:"row"},ht={flex:1},ft=Z.isWeb?"auto":"pan-y",St=12;function pt(e){const t=(0,o.c)(63),{children:s,chromeEnabled:c}=e,l=(0,De.useKeyboardActionDispatcher)(),u=(0,Ae.useHosts)(),{settings:h,updateSettings:f}=(0,we.useAppSettings)(),p=(0,Oe.usePanelStore)(yt),v=(0,Oe.usePanelStore)(jt),x=(0,Oe.usePanelStore)(bt),b=(0,Oe.usePanelStore)(xt),A=(0,Oe.usePanelStore)(vt),T=(0,Oe.usePanelStore)(gt),{width:F}=(0,S.default)();let U;t[0]!==h.theme||t[1]!==f?(U=()=>{f({theme:(0,Fe.getNextThemePreference)(h.theme)})},t[0]=h.theme,t[1]=f,t[2]=U):U=t[2];const J=U,X=(0,Q.useIsCompactFormFactor)();let $;t[3]!==X?($=(0,ke.resolveExplorerSidebarPresentation)({isCompact:X}),t[3]=X,t[4]=$):$=t[4];const ee=$,te="pane"!==ee;(0,Ce.useCompactWebViewportZoomLock)(X);const ne=(0,d.usePathname)();let oe;t[5]!==ne?(oe=(0,Ve.parseHostWorkspaceRouteFromPathname)(ne),t[5]=ne,t[6]=oe):oe=t[6];const re=null!==oe&&b,se=c??u.length>0,ie=(0,xe.useLatchedBoolean)(se),ce=X?p:v;let ae;t[7]!==l||t[8]!==ce?(ae=()=>{l.dispatch({id:"sidebar.toggle.both",scope:"sidebar"})||ce()},t[7]=l,t[8]=ce,t[9]=ae):ae=t[9];const ue=ae;let de;t[10]!==se||t[11]!==ne?(de=se||ne.startsWith("/settings"),t[10]=se,t[11]=ne,t[12]=de):de=t[12];const me=de;let he;t[13]!==J||t[14]!==x||t[15]!==X||t[16]!==re||t[17]!==me||t[18]!==ce||t[19]!==ue?(he={enabled:me,isMobile:X,isWorkspaceFocusModeEnabled:re,toggleAgentList:ce,toggleBothSidebars:ue,exitFocusMode:x,cycleTheme:J},t[13]=J,t[14]=x,t[15]=X,t[16]=re,t[17]=me,t[18]=ce,t[19]=ue,t[20]=he):he=t[20],(0,ye.useKeyboardShortcuts)(he),(0,ge.useActiveWorktreeNewAction)(),(0,ve.useGlobalNewWorkspaceAction)();const fe=(0,Y.resolveDesktopAppContentMinimum)({isSettingsRoute:ne.includes("/settings")}),be=ie&&!re,je=(0,Y.resolveDesktopSidebarVisibility)({chromeEnabled:se,isCompactLayout:X,isMounted:be,isOpen:A,canShare:(0,Y.canDesktopAppSidebarShare)({contentMinimumWidth:fe,requestedSidebarWidth:T,viewportWidth:F})}),Ie=(0,Be.useHasWindowChromeObstruction)("top-left"),Ee=!je;let Pe;t[21]!==se||t[22]!==be||t[23]!==X||t[24]!==Ee?(Pe=(0,Y.resolveDesktopSidebarVisibility)({chromeEnabled:se,isCompactLayout:X,isMounted:be,isOpen:Ee,canShare:!0}),t[21]=se,t[22]=be,t[23]=X,t[24]=Ee,t[25]=Pe):Pe=t[25];const He=Pe,Re=(0,Y.resolveDesktopAppChromeLayout)({desktopSidebarRendered:je,hasTopLeftWindowControls:Ie,sidebarControlsEnabled:se&&!re}),We=X?se:be,Le=X?se:je;let Te;t[26]!==me||t[27]!==He||t[28]!==Le||t[29]!==We?(Te=(0,ze.jsx)(kt,{mounted:We,visible:Le,overlay:He,keyboardShortcutsEnabled:me}),t[26]=me,t[27]=He,t[28]=Le,t[29]=We,t[30]=Te):Te=t[30];const Me=Te;let Ne,Ge,Ue,Ke=Me;if(Z.isWeb){let e;t[31]!==Me?(e=(0,ze.jsx)(W.AppearanceStyleBoundary,{children:Me}),t[31]=Me,t[32]=e):e=t[32],Ke=e}t[33]!==Re||t[34]!==X||t[35]!==He||t[36]!==Ke?(Ne=X?null:(0,ze.jsx)(Be.WindowChromeRegion,{corners:He?"top-left":Re.sidebarCorners,children:Ke}),t[33]=Re,t[34]=X,t[35]=He,t[36]=Ke,t[37]=Ne):Ne=t[37],t[38]!==Re||t[39]!==s||t[40]!==se||t[41]!==ee||t[42]!==te?(Ge=te?(0,ze.jsx)(B.CompactExplorerSidebarHost,{enabled:se,presentation:"dock"===ee?"dock":"overlay",children:(0,ze.jsx)(Be.WindowChromeRegion,{corners:se?"both":Re.contentCorners,children:(0,ze.jsx)(n.View,{style:ht,children:s})})}):(0,ze.jsx)(Be.WindowChromeRegion,{corners:Re.contentCorners,children:(0,ze.jsx)(n.View,{style:ht,children:s})}),t[38]=Re,t[39]=s,t[40]=se,t[41]=ee,t[42]=te,t[43]=Ge):Ge=t[43],t[44]!==Ne||t[45]!==Ge?(Ue=(0,ze.jsxs)(n.View,{style:mt,children:[Ne,Ge]}),t[44]=Ne,t[45]=Ge,t[46]=Ue):Ue=t[46];const qe=Ue;let Qe,Ye,Ze,Je;t[47]!==Re||t[48]!==X?(Qe=X||"window"!==Re.sidebarToggleOwner?null:(0,ze.jsx)(Be.WindowChromeRegion,{corners:"top-left",children:(0,ze.jsx)(Be.WindowChromeSafeArea,{placement:"inline",horizontalPadding:St,pointerEvents:"box-none",style:Kt.windowSidebarToggle,children:(0,ze.jsx)(L.WindowSidebarMenuToggle,{})})}),t[47]=Re,t[48]=X,t[49]=Qe):Qe=t[49],t[50]===Symbol.for("react.memo_cache_sentinel")?(Ye=(0,ze.jsx)(O.DesktopWindowControls,{}),Ze=(0,ze.jsx)(K.FloatingPanelPortalHost,{}),t[50]=Ye,t[51]=Ze):(Ye=t[50],Ze=t[51]),t[52]!==Qe?(Je=(0,ze.jsxs)(W.AppearanceStyleBoundary,{children:[Qe,Ye,Ze]}),t[52]=Qe,t[53]=Je):Je=t[53];const Xe=X?Ke:null;let $e,et;t[54]===Symbol.for("react.memo_cache_sentinel")?($e=(0,ze.jsxs)(W.AppearanceStyleBoundary,{children:[(0,ze.jsx)(w.DownloadToast,{}),(0,ze.jsx)(Se.RosettaCalloutSource,{}),(0,ze.jsx)(pe.UpdateCalloutSource,{}),(0,ze.jsx)(le.LegacyAgentSkillsMigration,{}),(0,ze.jsx)(E.WorktreeSetupCalloutSource,{}),(0,ze.jsx)(y.CommandCenterRootActions,{}),(0,ze.jsx)(I.CommandCenterWorkspaceActions,{}),(0,ze.jsx)(_.PluginCommandCenterActions,{}),(0,ze.jsx)(M.WorkspacePinShortcutHandler,{}),(0,ze.jsx)(N.WorkspaceRenameHost,{}),(0,ze.jsx)(j.CommandCenter,{}),(0,ze.jsx)(C.AddProjectFlowHost,{}),(0,ze.jsx)(q.HostChooserModal,{}),(0,ze.jsx)(z.HostConfirmationSheet,{}),(0,ze.jsx)(V.ProviderSettingsHost,{}),(0,ze.jsx)(G.WorkspaceSetupDialog,{}),(0,ze.jsx)(H.KeyboardShortcutsDialog,{}),(0,ze.jsx)(D.AppDiagnosticHost,{}),(0,ze.jsx)(R.ChangelogHost,{}),(0,ze.jsx)(P.QuittingOverlay,{})]}),t[54]=$e):$e=t[54],t[55]!==Je||t[56]!==Xe||t[57]!==qe?(et=(0,ze.jsxs)(n.View,{style:Kt.surfaceFill,children:[qe,Je,Xe,$e]}),t[55]=Je,t[56]=Xe,t[57]=qe,t[58]=et):et=t[58];const tt=et;let nt;if(t[59]!==se||t[60]!==X||t[61]!==tt){const e=X?(0,ze.jsx)(It,{chromeEnabled:se,children:tt}):tt;nt=(0,ze.jsx)(k.CommandCenterProvider,{children:e}),t[59]=se,t[60]=X,t[61]=tt,t[62]=nt}else nt=t[62];return nt}function gt(e){return e.sidebarWidth}function vt(e){return e.desktop.agentListOpen}function xt(e){return e.desktop.focusModeEnabled}function bt(e){return e.exitFocusMode}function jt(e){return e.toggleDesktopAgentList}function yt(e){return e.toggleMobileAgentList}function kt(e){const t=(0,o.c)(21),{mounted:s,visible:c,overlay:l,keyboardShortcutsEnabled:u}=e,d=(0,Q.useIsCompactFormFactor)(),h=(0,Re.useIsMobilePanelActive)("agent-list");let f;t[0]!==l?(f={enabled:l},t[0]=l,t[1]=f):f=t[1];const{revealed:S,canReveal:p,revealOnPointerMove:v,dismiss:x}=(0,be.useSidebarEdgeHover)(f),b=d?c&&h:c||S;let j;t[2]!==b||t[3]!==s||t[4]!==l?(j=s?(0,ze.jsx)(A.LeftSidebar,{active:b,overlay:l}):null,t[2]=b,t[3]=s,t[4]=l,t[5]=j):j=t[5];const y=j;let k,I;t[6]!==p||t[7]!==v?(k=p?(0,ze.jsx)(n.View,{testID:"sidebar-edge-trigger",style:Kt.sidebarEdgeTrigger,onPointerMove:v}):null,t[6]=p,t[7]=v,t[8]=k):k=t[8],t[9]!==b||t[10]!==x||t[11]!==l||t[12]!==y||t[13]!==k?(I=(0,ze.jsxs)(F.DesktopSidebarSurface,{overlay:l,active:b,onDismiss:x,children:[k,y]}),t[9]=b,t[10]=x,t[11]=l,t[12]=y,t[13]=k,t[14]=I):I=t[14];const _=d?y:I;let C,E;return t[15]!==u?(C=(0,ze.jsx)(U.WorkspaceShortcutTargetsSubscriber,{enabled:u}),t[15]=u,t[16]=C):C=t[16],t[17]!==b||t[18]!==_||t[19]!==C?(E=(0,ze.jsxs)(T.SidebarModelProvider,{active:b,children:[_,C]}),t[17]=b,t[18]=_,t[19]=C,t[20]=E):E=t[20],E}function It(e){const t=(0,o.c)(5),{children:s,chromeEnabled:c}=e,l=(0,He.useOpenAgentListGesture)(c);let u,d;return t[0]!==s?(u=(0,ze.jsx)(n.View,{collapsable:!1,style:Kt.surfaceFill,children:s}),t[0]=s,t[1]=u):u=t[1],t[2]!==l||t[3]!==u?(d=(0,ze.jsx)(p.GestureDetector,{gesture:l,touchAction:ft,children:u}),t[2]=l,t[3]=u,t[4]=d):d=t[4],d}function _t(e){const t=(0,o.c)(6),{children:n}=e;let s,c,l,u,d;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,ze.jsx)(Ct,{}),c=(0,ze.jsx)(wt,{}),l=(0,ze.jsx)(et,{}),u=(0,ze.jsx)(Dt,{}),t[0]=s,t[1]=c,t[2]=l,t[3]=u):(s=t[0],c=t[1],l=t[2],u=t[3]),t[4]!==n?(d=(0,ze.jsx)(b.AppearanceProvider,{children:(0,ze.jsxs)(te.VoiceProvider,{children:[s,c,l,u,n]})}),t[4]=n,t[5]=d):d=t[5],d}function Ct(){const e=(0,o.c)(4),{isLoading:t}=(0,we.useAppSettings)(),{theme:n}=(0,x.useUnistyles)(),s=n.colors.surface0;let c,l;return e[0]!==t||e[1]!==s?(c=()=>{t||Z.isNative||(0,me.updateDesktopWindowChrome)({backgroundColor:s,trafficLightOffsetY:-4}).catch(Et)},l=[t,s],e[0]=t,e[1]=s,e[2]=c,e[3]=l):(c=e[2],l=e[3]),(0,h.useEffect)(c,l),null}function Et(e){console.warn("[DesktopWindow] Failed to update window controls overlay",e)}function wt(){const e=(0,d.useRouter)();return(0,h.useEffect)(()=>{let t=!1;const n=async n=>{if(n&&(n.includes("#offer=")||n.includes("#connect=")||n.startsWith("relay://")))try{const o=await(0,Ae.getHostRuntimeStore)().importConnectionLink(n,"openProject");t||"connected"!==o.status||e.replace((0,Ve.buildOpenProjectRoute)())}catch(e){console.warn("[OfferLinkListener] Pairing link failed",e)}};l.getInitialURL().then(e=>n(e)).catch(()=>{});const o=l.addEventListener("url",e=>{n(e.url)});return()=>{t=!0,o.remove()}},[e]),null}let Pt=1;function Ht(){const e=(0,q.useHostChooser)(),t=(0,Ae.useHostRegistryLoaded)(),[n,o]=(0,h.useState)(null),[s,c]=(0,h.useState)(null),l=(0,Ee.useOpenProject)(n?.serverId??null),u=(0,h.useCallback)(n=>{const s=n.trim();s&&(t?e({title:"Choose host",onChooseHost:e=>{o({id:Pt++,serverId:e,path:s})}}):c(s))},[e,t]);return(0,h.useEffect)(()=>{if(!t||!s)return;const e=s;c(null),u(e)},[t,u,s]),(0,h.useEffect)(()=>{if(!n)return;let e=!1;return l(n.path).then(t=>e?null:t.ok?(o(e=>e?.id===n.id?null:e),null):(o(e=>e?.id===n.id?null:e),null)),()=>{e=!0}},[l,n]),(0,h.useEffect)(()=>{let e=!1,t=null;return(0,he.getDesktopHost)()?.getPendingOpenProject?.()?.then(t=>{!e&&t&&u(t)}).catch(()=>{}),(0,de.listenToDesktopEvent)("open-project",t=>{if(e)return;const n="string"==typeof t?.path?t.path.trim():"";u(n)}).then(n=>{e?n():t=n}).catch(()=>{}),()=>{e=!0,t?.()}},[u]),null}function Rt(e){const t=(0,o.c)(8),{children:n}=e,s=(0,d.usePathname)();(0,re.useTrackForegroundWorkspaceSelection)();const c=(0,Ae.useHosts)(),l=dt();let u;t[0]!==s?(u=(0,Ve.parseServerIdFromPathname)(s),t[0]=s,t[1]=u):u=t[1];const h=u;let f;t[2]!==c||t[3]!==h?(f=null!==h&&c.some(e=>e.serverId===h),t[2]=c,t[3]=h,t[4]=f):f=t[4];const S=l&&("/open-project"===s||"/new"===s||"/sessions"===s||"/schedules"===s||"/usage"===s||f);let p;return t[5]!==n||t[6]!==S?(p=(0,ze.jsx)(pt,{chromeEnabled:S,children:n}),t[5]=n,t[6]=S,t[7]=p):p=t[7],p}function Dt(){return(0,je.useFaviconStatus)(),null}const Wt={headerShown:!1,animation:"none"},At=["h/[serverId]"];function Lt(){const e=(0,o.c)(20),t=dt();let n,s,c,l,u,h,f,S,p,v,x,b,j,y,k,I,_,C;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,ze.jsx)(d.Stack.Screen,{name:"index"}),e[0]=n):n=e[0],e[1]===Symbol.for("react.memo_cache_sentinel")?(s=(0,ze.jsx)(d.Stack.Screen,{name:"welcome"}),c=(0,ze.jsx)(d.Stack.Screen,{name:"settings/index"}),l=(0,ze.jsx)(d.Stack.Screen,{name:"settings/[section]"}),u=(0,ze.jsx)(d.Stack.Screen,{name:"new"}),h=(0,ze.jsx)(d.Stack.Screen,{name:"open-project"}),f=(0,ze.jsx)(d.Stack.Screen,{name:"sessions"}),S=(0,ze.jsx)(d.Stack.Screen,{name:"schedules"}),p=(0,ze.jsx)(d.Stack.Screen,{name:"usage"}),v=(0,ze.jsx)(d.Stack.Screen,{name:"pair-scan"}),e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=h,e[6]=f,e[7]=S,e[8]=p,e[9]=v):(s=e[1],c=e[2],l=e[3],u=e[4],h=e[5],f=e[6],S=e[7],p=e[8],v=e[9]),e[10]!==t?(x=(0,ze.jsxs)(d.Stack.Protected,{guard:t,children:[s,c,l,u,h,f,S,p,v]}),e[10]=t,e[11]=x):x=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(b=(0,ze.jsx)(d.Stack.Screen,{name:"h/[serverId]"}),j=(0,ze.jsx)(d.Stack.Screen,{name:"settings/hosts/[serverId]/index"}),y=(0,ze.jsx)(d.Stack.Screen,{name:"settings/hosts/[serverId]/[hostSection]"}),k=(0,ze.jsx)(d.Stack.Screen,{name:"settings/hosts/[serverId]/plugins/[pluginId]/[screenId]"}),I=(0,ze.jsx)(d.Stack.Screen,{name:"settings/hosts/[serverId]/projects/index"}),_=(0,ze.jsx)(d.Stack.Screen,{name:"settings/hosts/[serverId]/projects/[projectId]"}),e[12]=b,e[13]=j,e[14]=y,e[15]=k,e[16]=I,e[17]=_):(b=e[12],j=e[13],y=e[14],k=e[15],I=e[16],_=e[17]),e[18]!==x?(C=(0,ze.jsxs)(se.ThemedStack,{screenOptions:Wt,nestedNavigatorScreens:At,children:[n,x,b,j,y,k,I,_]}),e[18]=x,e[19]=C):C=e[19],C}function Ot(){const e=(0,o.c)(3),t=(0,d.useNavigationContainerRef)();let n,s;return e[0]!==t?(n=()=>(0,oe.registerWorkspaceRouteNavigationRef)(t),s=[t],e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]),(0,h.useEffect)(n,s),null}function Tt(){const e=(0,o.c)(4);let t,n,s,c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,ze.jsx)(Ht,{}),n=(0,ze.jsx)(ce.AgentNavigationListener,{}),s=(0,ze.jsx)(ae.DesktopContentContextMenuHost,{}),e[0]=t,e[1]=n,e[2]=s):(t=e[0],n=e[1],s=e[2]),e[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,ze.jsx)(Re.MobilePanelsProvider,{children:(0,ze.jsxs)(J.HorizontalScrollProvider,{children:[t,n,s,(0,ze.jsxs)(Rt,{children:[(0,ze.jsx)(Ot,{}),(0,ze.jsx)(Lt,{})]})]})}),e[3]=c):c=e[3],c}function Ft(e){const t=(0,o.c)(3),{children:n}=e;let s,c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,ze.jsx)(Ye,{}),t[0]=s):s=t[0],t[1]!==n?(c=(0,ze.jsxs)(ct,{children:[s,(0,ze.jsx)($.SidebarCalloutProvider,{children:(0,ze.jsx)(_t,{children:n})})]}),t[1]=n,t[2]=c):c=t[2],c}function Mt(e){const t=(0,o.c)(2),{children:n}=e;let l;return t[0]!==n?(l=(0,ze.jsx)(De.KeyboardActionDispatcherProvider,{children:(0,ze.jsx)(Be.WindowChromeProvider,{children:(0,ze.jsx)(v.KeyboardProvider,{children:(0,ze.jsx)(Ie.KeyboardShiftProvider,{children:(0,ze.jsx)(ee.ToastProvider,{children:(0,ze.jsx)(c.PortalProvider,{children:(0,ze.jsx)(s.BottomSheetModalProvider,{children:n})})})})})})}),t[0]=n,t[1]=l):l=t[1],l}function Nt(){const e=(0,o.c)(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,ze.jsx)(p.GestureHandlerRootView,{style:ht,children:(0,ze.jsx)(n.View,{style:Kt.surfaceFill,children:(0,ze.jsx)(Mt,{children:(0,ze.jsx)(Ft,{children:(0,ze.jsx)(Tt,{})})})})}),e[0]=t):t=e[0],t}function Bt(){const e=(0,o.c)(3);let t,n,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0],(0,h.useEffect)(Ut,t),e[1]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[1]=n):n=e[1],(0,h.useEffect)(Vt,n),e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,ze.jsx)(Nt,{}),e[2]=s):s=e[2],s}function Vt(){const e=f.default.addEventListener("change",Gt);return()=>e.remove()}function Gt(e){"active"!==e&&(0,Te.flushDraftPersistStorage)()}function Ut(){return(0,Ne.installWebScrollbarStyles)()}const Kt=x.StyleSheet.create(e=>({sidebarEdgeTrigger:{position:"absolute",top:0,bottom:0,left:0,width:Y.SIDEBAR_EDGE_WIDTH,pointerEvents:"auto"},surfaceFill:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},windowSidebarToggle:{position:"absolute",top:1,left:0,zIndex:20,height:Q.HEADER_INNER_HEIGHT,flexDirection:"row",alignItems:"center",borderBottomWidth:e.borderWidth[1],borderBottomColor:"transparent",uni__dependencies:[0]}}))},3033,[896,454,56,3034,3228,730,3267,456,37,398,451,147,3037,3402,57,3453,3753,3803,3790,3847,3898,3901,3908,3914,3932,3934,3936,4104,4109,4110,4112,4878,4122,4879,4880,4882,4883,4890,4893,4894,4445,3838,4895,1217,4118,881,4161,4896,3909,894,4426,4918,3679,3671,4919,3540,4920,4921,4922,4923,3933,4051,882,891,4924,4925,4929,4930,4931,4932,4933,4941,4258,4446,4945,3843,884,3911,4160,4163,3783,2,3529,4946,3797,3620,306,3459,4947,4050,3675,4916,3787,4474,4903,280]);
|
|
14650
|
+
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t}function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return Bt}}),_e.useEarliestOnlineHostServerId=nt,_e.useStoreReady=dt,_e.useHostRuntimeBootstrapState=function(){return(0,h.useContext)(Qe)};var n=r(_d[0]),o=r(_d[1]);r(_d[2]);var s=r(_d[3]),c=r(_d[4]),l=e(r(_d[5])),u=e(r(_d[6])),d=r(_d[7]),h=r(_d[8]),f=t(r(_d[9])),S=t(r(_d[10]));r(_d[11]);var p=r(_d[12]),b=r(_d[13]),v=r(_d[14]),x=r(_d[15]),j=r(_d[16]),y=r(_d[17]),k=r(_d[18]),I=r(_d[19]),_=r(_d[20]),E=r(_d[21]),C=r(_d[22]),w=r(_d[23]),P=r(_d[24]),H=r(_d[25]),R=r(_d[26]),D=r(_d[27]),W=r(_d[28]),A=r(_d[29]),L=r(_d[30]),O=r(_d[31]),T=r(_d[32]),F=r(_d[33]),M=r(_d[34]),N=r(_d[35]),B=r(_d[36]),V=r(_d[37]),G=r(_d[38]),U=r(_d[39]),K=r(_d[40]),q=r(_d[41]),z=r(_d[42]),Q=r(_d[43]),Y=r(_d[44]),Z=r(_d[45]),J=r(_d[46]),X=r(_d[47]),$=r(_d[48]),ee=r(_d[49]),te=r(_d[50]),ne=r(_d[51]),oe=r(_d[52]),re=r(_d[53]),se=r(_d[54]),ie=r(_d[55]),ce=r(_d[56]),ae=r(_d[57]),le=r(_d[58]),ue=r(_d[59]),de=r(_d[60]),me=r(_d[61]),he=r(_d[62]),fe=r(_d[63]),Se=r(_d[64]),pe=r(_d[65]),ge=r(_d[66]),be=r(_d[67]),ve=r(_d[68]),xe=r(_d[69]),je=r(_d[70]),ye=r(_d[71]),ke=r(_d[72]),Ie=r(_d[73]),Ee=r(_d[74]),Ce=r(_d[75]),we=r(_d[76]),Pe=r(_d[77]),He=r(_d[78]),Re=r(_d[79]),De=r(_d[80]),We=r(_d[81]),Ae=r(_d[82]),Le=r(_d[83]),Oe=r(_d[84]),Te=r(_d[85]),Fe=r(_d[86]),Me=r(_d[87]),Ne=r(_d[88]),Be=r(_d[89]),Ve=r(_d[90]),Ge=r(_d[91]),Ue=r(_d[92]),Ke=r(_d[93]),qe=r(_d[94]),ze=r(_d[95]);(0,We.polyfillCrypto)();const Qe=(0,h.createContext)({splashError:null,retry:()=>{},hasGivenUpWaitingForHost:!1,storeReady:!1,startupBlocker:{kind:"none"}});function Ye(){const e=(0,o.c)(5),t=(0,d.useRouter)(),n=(0,h.useRef)(null);let s;e[0]!==t?(s=e=>{const n=(0,Ge.resolveNotificationTarget)(e),o=n.serverId,s=n.workspaceId,c=n.agentId;o&&s&&c?(0,Ue.navigateToAgent)({serverId:o,workspaceId:s,agentId:c,pin:!0}):o&&s&&n.terminalId?(0,re.navigateToWorkspace)({serverId:o,workspaceId:s,target:{kind:"terminal",terminalId:n.terminalId}}):t.navigate((0,Ge.buildNotificationRoute)(e))},e[0]=t,e[1]=s):s=e[1];const c=(0,Pe.useStableEvent)(s);let l,f;return e[2]!==c?(l=()=>{if(Z.isWeb){let e=null,t=!1;if((0,Q.getIsElectronRuntime)()){(0,qe.ensureOsNotificationPermission)();const n=(0,he.getDesktopHost)()?.events?.on?.("notification-click",e=>{const t="object"==typeof e&&null!==e&&"data"in e&&"object"==typeof e.data&&null!==e.data?e.data:void 0;c(t)});Promise.resolve(n).then(n=>{"function"==typeof n&&(t?n():e=n)})}const n=e=>{const t=e;e.preventDefault(),c(t.detail?.data)};return window.addEventListener(qe.WEB_NOTIFICATION_CLICK_EVENT,n),()=>{t=!0,e?.(),window.removeEventListener(qe.WEB_NOTIFICATION_CLICK_EVENT,n)}}u.setNotificationHandler({handleNotification:Ze});const e=e=>{const t=e.notification.request.identifier;if(n.current===t)return;n.current=t;const o=e.notification.request.content.data;c(o)},t=u.addNotificationResponseReceivedListener(e);return u.getLastNotificationResponseAsync().then(t=>{t&&e(t)}),()=>{t.remove()}},f=[c],e[2]=c,e[3]=l,e[4]=f):(l=e[3],f=e[4]),(0,h.useEffect)(l,f),null}async function Ze(){return{shouldShowAlert:!1,shouldShowBanner:!1,shouldShowList:!1,shouldPlaySound:!1,shouldSetBadge:!1}}function Je(e){const t=(0,o.c)(9),{daemon:n}=e,s=(0,Ae.useHostRuntimeClient)(n.serverId);if(!s)return null;let c,l,u;return t[0]!==s||t[1]!==n.serverId?(c=(0,ze.jsx)(Xe,{serverId:n.serverId,client:s}),l=(0,ze.jsx)(Ke.PluginCatalogSync,{serverId:n.serverId,client:s}),t[0]=s,t[1]=n.serverId,t[2]=c,t[3]=l):(c=t[2],l=t[3]),t[4]!==s||t[5]!==n.serverId||t[6]!==c||t[7]!==l?(u=(0,ze.jsxs)(X.SessionProvider,{serverId:n.serverId,client:s,children:[c,l]},n.serverId),t[4]=s,t[5]=n.serverId,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function Xe(e){const t=(0,o.c)(8),{serverId:n,client:s}=e;let c;t[0]!==n?(c=e=>e.sessions[n]?.serverInfo??null,t[0]=n,t[1]=c):c=t[1];const l=(0,Me.useSessionStore)(c),u=(0,Ae.useHostRuntimeIsConnected)(n);let d,f;return t[2]!==s||t[3]!==u||t[4]!==n||t[5]!==l?(d=()=>{l&&u&&ue.legacyFavoriteProfileMigration.migrateHost(n,s).catch($e)},f=[s,u,n,l],t[2]=s,t[3]=u,t[4]=n,t[5]=l,t[6]=d,t[7]=f):(d=t[6],f=t[7]),(0,h.useEffect)(d,f),null}function $e(e){console.warn("[AgentProfiles] Failed to migrate legacy favourites",e)}function et(){const e=(0,o.c)(4),t=(0,Ae.useHosts)();if(0===t.length)return null;let n,s;return e[0]!==t?(n=t.map(tt),e[0]=t,e[1]=n):n=e[1],e[2]!==n?(s=(0,ze.jsx)(ze.Fragment,{children:n}),e[2]=n,e[3]=s):s=e[3],s}function tt(e){return(0,ze.jsx)(Je,{daemon:e},e.serverId)}function nt(){const e=(0,o.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,Ae.getHostRuntimeStore)(),e[0]=t):t=e[0];const n=t;let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{const t=n.subscribeAll(e),o=n.subscribeHostList(e);return()=>{t(),o()}},e[1]=s):s=e[1];const c=s;let l,u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>n.getEarliestOnlineHostServerId(),u=()=>n.getEarliestOnlineHostServerId(),e[2]=l,e[3]=u):(l=e[2],u=e[3]),(0,h.useSyncExternalStore)(c,l,u)}function ot(){const e=(0,o.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,Le.getDaemonStartService)({store:(0,Ae.getHostRuntimeStore)()}),e[0]=t):t=e[0];const n=t;let s,c,l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=e=>n.subscribe(e),c=()=>n.getLastError(),l=()=>n.getLastError(),e[1]=s,e[2]=c,e[3]=l):(s=e[1],c=e[2],l=e[3]),(0,h.useSyncExternalStore)(s,c,l)}function rt(){const e=(0,o.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,Le.getDaemonStartService)({store:(0,Ae.getHostRuntimeStore)()}),e[0]=t):t=e[0];const n=t;let s,c,l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=e=>n.subscribe(e),c=()=>n.isRunning(),l=()=>n.isRunning(),e[1]=s,e[2]=c,e[3]=l):(s=e[1],c=e[2],l=e[3]),(0,h.useSyncExternalStore)(s,c,l)}const st=5e3;async function it(){if(!(0,ie.shouldUseDesktopDaemon)())return!1;if((0,Ae.hasConfiguredLocalDaemonOverride)())return!1;return(await(0,fe.loadDesktopSettings)()).daemon.manageBuiltInDaemon}function ct(e){const t=(0,o.c)(24),{children:n}=e;let s,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[0]=s):s=t[0],(0,h.useEffect)(ut,s),t[1]===Symbol.for("react.memo_cache_sentinel")?(c=[],t[1]=c):c=t[1],(0,h.useEffect)(lt,c);const l=nt(),u=ot(),d=rt(),[f,S]=(0,h.useState)(!1);let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p=(0,ie.shouldUseDesktopDaemon)(),t[2]=p):p=t[2];const b=p;let v;t[3]!==l||t[4]!==u||t[5]!==d?(v=(0,ne.resolveStartupBlocker)({isDesktopRuntime:b,anyOnlineHostServerId:l,daemonStartIsRunning:d,daemonStartError:u}),t[3]=l,t[4]=u,t[5]=d,t[6]=v):v=t[6];const x=v;let j;t[7]!==l||t[8]!==f||t[9]!==x?(j=(0,ne.shouldRunStartupGiveUpTimer)({startupBlocker:x,anyOnlineHostServerId:l,hasGivenUpWaitingForHost:f}),t[7]=l,t[8]=f,t[9]=x,t[10]=j):j=t[10];const y=j;let k,I;t[11]!==y?(k=()=>{if(!y)return;const e=setTimeout(()=>{S(!0)},st);return()=>{clearTimeout(e)}},I=[y],t[11]=y,t[12]=k,t[13]=I):(k=t[12],I=t[13]),(0,h.useEffect)(k,I);const _=at,E="managed-daemon-error"===x.kind?x.message:null;let C;t[14]!==x?(C=(0,ne.resolveStartupNavigationReady)({startupBlocker:x}),t[14]=x,t[15]=C):C=t[15];const w=C;let P;t[16]!==f||t[17]!==E||t[18]!==x||t[19]!==w?(P={splashError:E,retry:_,hasGivenUpWaitingForHost:f,storeReady:w,startupBlocker:x},t[16]=f,t[17]=E,t[18]=x,t[19]=w,t[20]=P):P=t[20];const H=P;let R;return t[21]!==n||t[22]!==H?(R=(0,ze.jsx)(Qe.Provider,{value:H,children:n}),t[21]=n,t[22]=H,t[23]=R):R=t[23],R}function at(){(0,Le.getDaemonStartService)({store:(0,Ae.getHostRuntimeStore)()}).startIfEnabled({shouldStart:it})}function lt(){const e=(0,Ae.getHostRuntimeStore)(),t=(0,Le.getDaemonStartService)({store:e});(0,ne.startHostRuntimeBootstrap)({store:e,daemonStartService:t,shouldStartDaemon:it})}function ut(){const e=(0,Ae.getHostRuntimeStore)();return(0,ne.bindHostRuntimeAppState)(e,f.default)}function dt(){return(0,h.useContext)(Qe).storeReady}const mt={flex:1,flexDirection:"row"},ht={flex:1},ft=Z.isWeb?"auto":"pan-y",St=12;function pt(e){const t=(0,o.c)(64),{children:s,chromeEnabled:c}=e,l=(0,De.useKeyboardActionDispatcher)(),u=(0,Ae.useHosts)(),{settings:h,updateSettings:f}=(0,we.useAppSettings)(),p=(0,Oe.usePanelStore)(yt),b=(0,Oe.usePanelStore)(jt),v=(0,Oe.usePanelStore)(xt),x=(0,Oe.usePanelStore)(vt),A=(0,Oe.usePanelStore)(bt),T=(0,Oe.usePanelStore)(gt),{width:F}=(0,S.default)();let U;t[0]!==h.theme||t[1]!==f?(U=()=>{f({theme:(0,Fe.getNextThemePreference)(h.theme)})},t[0]=h.theme,t[1]=f,t[2]=U):U=t[2];const J=U,X=(0,Q.useIsCompactFormFactor)();let $;t[3]!==X?($=(0,ke.resolveExplorerSidebarPresentation)({isCompact:X}),t[3]=X,t[4]=$):$=t[4];const ee=$,te="pane"!==ee;(0,Ee.useCompactWebViewportZoomLock)(X);const ne=(0,d.usePathname)();let oe;t[5]!==ne?(oe=(0,Ve.parseHostWorkspaceRouteFromPathname)(ne),t[5]=ne,t[6]=oe):oe=t[6];const re=null!==oe&&x,se=c??u.length>0,ie=(0,ve.useLatchedBoolean)(se),ce=X?p:b;let ae;t[7]!==l||t[8]!==ce?(ae=()=>{l.dispatch({id:"sidebar.toggle.both",scope:"sidebar"})||ce()},t[7]=l,t[8]=ce,t[9]=ae):ae=t[9];const ue=ae;let de;t[10]!==se||t[11]!==ne?(de=se||ne.startsWith("/settings"),t[10]=se,t[11]=ne,t[12]=de):de=t[12];const me=de;let he;t[13]!==J||t[14]!==v||t[15]!==X||t[16]!==re||t[17]!==me||t[18]!==ce||t[19]!==ue?(he={enabled:me,isMobile:X,isWorkspaceFocusModeEnabled:re,toggleAgentList:ce,toggleBothSidebars:ue,exitFocusMode:v,cycleTheme:J},t[13]=J,t[14]=v,t[15]=X,t[16]=re,t[17]=me,t[18]=ce,t[19]=ue,t[20]=he):he=t[20],(0,ye.useKeyboardShortcuts)(he),(0,ge.useActiveWorktreeNewAction)(),(0,be.useGlobalNewWorkspaceAction)();const fe=(0,Y.resolveDesktopAppContentMinimum)({isSettingsRoute:ne.includes("/settings")}),xe=ie&&!re,je=(0,Y.resolveDesktopSidebarVisibility)({chromeEnabled:se,isCompactLayout:X,isMounted:xe,isOpen:A,canShare:(0,Y.canDesktopAppSidebarShare)({contentMinimumWidth:fe,requestedSidebarWidth:T,viewportWidth:F})}),Ie=(0,Be.useHasWindowChromeObstruction)("top-left"),Ce=!je;let Pe;t[21]!==se||t[22]!==xe||t[23]!==X||t[24]!==Ce?(Pe=(0,Y.resolveDesktopSidebarVisibility)({chromeEnabled:se,isCompactLayout:X,isMounted:xe,isOpen:Ce,canShare:!0}),t[21]=se,t[22]=xe,t[23]=X,t[24]=Ce,t[25]=Pe):Pe=t[25];const He=Pe,Re=(0,Y.resolveDesktopAppChromeLayout)({desktopSidebarRendered:je,hasTopLeftWindowControls:Ie,sidebarControlsEnabled:se&&!re}),We=X?se:xe,Le=X?se:je;let Te;t[26]!==se||t[27]!==me||t[28]!==He||t[29]!==Le||t[30]!==We?(Te=(0,ze.jsx)(kt,{chromeEnabled:se,mounted:We,visible:Le,overlay:He,keyboardShortcutsEnabled:me}),t[26]=se,t[27]=me,t[28]=He,t[29]=Le,t[30]=We,t[31]=Te):Te=t[31];const Me=Te;let Ne,Ge,Ue,Ke=Me;if(Z.isWeb){let e;t[32]!==Me?(e=(0,ze.jsx)(W.AppearanceStyleBoundary,{children:Me}),t[32]=Me,t[33]=e):e=t[33],Ke=e}t[34]!==Re||t[35]!==X||t[36]!==He||t[37]!==Ke?(Ne=X?null:(0,ze.jsx)(Be.WindowChromeRegion,{corners:He?"top-left":Re.sidebarCorners,children:Ke}),t[34]=Re,t[35]=X,t[36]=He,t[37]=Ke,t[38]=Ne):Ne=t[38],t[39]!==Re||t[40]!==s||t[41]!==se||t[42]!==ee||t[43]!==te?(Ge=te?(0,ze.jsx)(B.CompactExplorerSidebarHost,{enabled:se,presentation:"dock"===ee?"dock":"overlay",children:(0,ze.jsx)(Be.WindowChromeRegion,{corners:se?"both":Re.contentCorners,children:(0,ze.jsx)(n.View,{style:ht,children:s})})}):(0,ze.jsx)(Be.WindowChromeRegion,{corners:Re.contentCorners,children:(0,ze.jsx)(n.View,{style:ht,children:s})}),t[39]=Re,t[40]=s,t[41]=se,t[42]=ee,t[43]=te,t[44]=Ge):Ge=t[44],t[45]!==Ne||t[46]!==Ge?(Ue=(0,ze.jsxs)(n.View,{style:mt,children:[Ne,Ge]}),t[45]=Ne,t[46]=Ge,t[47]=Ue):Ue=t[47];const qe=Ue;let Qe,Ye,Ze,Je;t[48]!==Re||t[49]!==X?(Qe=X||"window"!==Re.sidebarToggleOwner?null:(0,ze.jsx)(Be.WindowChromeRegion,{corners:"top-left",children:(0,ze.jsx)(Be.WindowChromeSafeArea,{placement:"inline",horizontalPadding:St,pointerEvents:"box-none",style:Kt.windowSidebarToggle,children:(0,ze.jsx)(L.WindowSidebarMenuToggle,{})})}),t[48]=Re,t[49]=X,t[50]=Qe):Qe=t[50],t[51]===Symbol.for("react.memo_cache_sentinel")?(Ye=(0,ze.jsx)(O.DesktopWindowControls,{}),Ze=(0,ze.jsx)(K.FloatingPanelPortalHost,{}),t[51]=Ye,t[52]=Ze):(Ye=t[51],Ze=t[52]),t[53]!==Qe?(Je=(0,ze.jsxs)(W.AppearanceStyleBoundary,{children:[Qe,Ye,Ze]}),t[53]=Qe,t[54]=Je):Je=t[54];const Xe=X?Ke:null;let $e,et;t[55]===Symbol.for("react.memo_cache_sentinel")?($e=(0,ze.jsxs)(W.AppearanceStyleBoundary,{children:[(0,ze.jsx)(w.DownloadToast,{}),(0,ze.jsx)(Se.RosettaCalloutSource,{}),(0,ze.jsx)(pe.UpdateCalloutSource,{}),(0,ze.jsx)(le.LegacyAgentSkillsMigration,{}),(0,ze.jsx)(C.WorktreeSetupCalloutSource,{}),(0,ze.jsx)(y.CommandCenterRootActions,{}),(0,ze.jsx)(I.CommandCenterWorkspaceActions,{}),(0,ze.jsx)(_.PluginCommandCenterActions,{}),(0,ze.jsx)(M.WorkspacePinShortcutHandler,{}),(0,ze.jsx)(N.WorkspaceRenameHost,{}),(0,ze.jsx)(j.CommandCenter,{}),(0,ze.jsx)(E.AddProjectFlowHost,{}),(0,ze.jsx)(q.HostChooserModal,{}),(0,ze.jsx)(z.HostConfirmationSheet,{}),(0,ze.jsx)(V.ProviderSettingsHost,{}),(0,ze.jsx)(G.WorkspaceSetupDialog,{}),(0,ze.jsx)(H.KeyboardShortcutsDialog,{}),(0,ze.jsx)(D.AppDiagnosticHost,{}),(0,ze.jsx)(R.ChangelogHost,{}),(0,ze.jsx)(P.QuittingOverlay,{})]}),t[55]=$e):$e=t[55],t[56]!==Je||t[57]!==Xe||t[58]!==qe?(et=(0,ze.jsxs)(n.View,{style:Kt.surfaceFill,children:[qe,Je,Xe,$e]}),t[56]=Je,t[57]=Xe,t[58]=qe,t[59]=et):et=t[59];const tt=et;let nt;if(t[60]!==se||t[61]!==X||t[62]!==tt){const e=X?(0,ze.jsx)(It,{chromeEnabled:se,children:tt}):tt;nt=(0,ze.jsx)(k.CommandCenterProvider,{children:e}),t[60]=se,t[61]=X,t[62]=tt,t[63]=nt}else nt=t[63];return nt}function gt(e){return e.sidebarWidth}function bt(e){return e.desktop.agentListOpen}function vt(e){return e.desktop.focusModeEnabled}function xt(e){return e.exitFocusMode}function jt(e){return e.toggleDesktopAgentList}function yt(e){return e.toggleMobileAgentList}function kt(e){const t=(0,o.c)(22),{chromeEnabled:s,mounted:c,visible:l,overlay:u,keyboardShortcutsEnabled:d}=e,h=(0,Q.useIsCompactFormFactor)(),f=(0,Re.useIsMobilePanelActive)("agent-list");let S;t[0]!==u?(S={enabled:u},t[0]=u,t[1]=S):S=t[1];const{revealed:p,canReveal:b,revealOnPointerMove:v,dismiss:x}=(0,xe.useSidebarEdgeHover)(S),j=h?l&&f:l||p;let y;t[2]!==j||t[3]!==s||t[4]!==c||t[5]!==u?(y=c?(0,ze.jsx)(A.LeftSidebar,{chromeEnabled:s,active:j,overlay:u}):null,t[2]=j,t[3]=s,t[4]=c,t[5]=u,t[6]=y):y=t[6];const k=y;let I,_;t[7]!==b||t[8]!==v?(I=b?(0,ze.jsx)(n.View,{testID:"sidebar-edge-trigger",style:Kt.sidebarEdgeTrigger,onPointerMove:v}):null,t[7]=b,t[8]=v,t[9]=I):I=t[9],t[10]!==j||t[11]!==x||t[12]!==u||t[13]!==k||t[14]!==I?(_=(0,ze.jsxs)(F.DesktopSidebarSurface,{overlay:u,active:j,onDismiss:x,children:[I,k]}),t[10]=j,t[11]=x,t[12]=u,t[13]=k,t[14]=I,t[15]=_):_=t[15];const E=h?k:_;let C,w;return t[16]!==d?(C=(0,ze.jsx)(U.WorkspaceShortcutTargetsSubscriber,{enabled:d}),t[16]=d,t[17]=C):C=t[17],t[18]!==j||t[19]!==E||t[20]!==C?(w=(0,ze.jsxs)(T.SidebarModelProvider,{active:j,children:[E,C]}),t[18]=j,t[19]=E,t[20]=C,t[21]=w):w=t[21],w}function It(e){const t=(0,o.c)(5),{children:s,chromeEnabled:c}=e,l=(0,He.useOpenAgentListGesture)(c);let u,d;return t[0]!==s?(u=(0,ze.jsx)(n.View,{collapsable:!1,style:Kt.surfaceFill,children:s}),t[0]=s,t[1]=u):u=t[1],t[2]!==l||t[3]!==u?(d=(0,ze.jsx)(p.GestureDetector,{gesture:l,touchAction:ft,children:u}),t[2]=l,t[3]=u,t[4]=d):d=t[4],d}function _t(e){const t=(0,o.c)(6),{children:n}=e;let s,c,l,u,d;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,ze.jsx)(Et,{}),c=(0,ze.jsx)(wt,{}),l=(0,ze.jsx)(et,{}),u=(0,ze.jsx)(Dt,{}),t[0]=s,t[1]=c,t[2]=l,t[3]=u):(s=t[0],c=t[1],l=t[2],u=t[3]),t[4]!==n?(d=(0,ze.jsx)(x.AppearanceProvider,{children:(0,ze.jsxs)(te.VoiceProvider,{children:[s,c,l,u,n]})}),t[4]=n,t[5]=d):d=t[5],d}function Et(){const e=(0,o.c)(4),{isLoading:t}=(0,we.useAppSettings)(),{theme:n}=(0,v.useUnistyles)(),s=n.colors.surface0;let c,l;return e[0]!==t||e[1]!==s?(c=()=>{t||Z.isNative||(0,me.updateDesktopWindowChrome)({backgroundColor:s,trafficLightOffsetY:-4}).catch(Ct)},l=[t,s],e[0]=t,e[1]=s,e[2]=c,e[3]=l):(c=e[2],l=e[3]),(0,h.useEffect)(c,l),null}function Ct(e){console.warn("[DesktopWindow] Failed to update window controls overlay",e)}function wt(){const e=(0,d.useRouter)();return(0,h.useEffect)(()=>{let t=!1;const n=async n=>{if(n&&(n.includes("#offer=")||n.includes("#connect=")||n.startsWith("relay://")))try{const o=await(0,Ae.getHostRuntimeStore)().importConnectionLink(n,"openProject");t||"connected"!==o.status||e.replace((0,Ve.buildOpenProjectRoute)())}catch(e){console.warn("[OfferLinkListener] Pairing link failed",e)}};l.getInitialURL().then(e=>n(e)).catch(()=>{});const o=l.addEventListener("url",e=>{n(e.url)});return()=>{t=!0,o.remove()}},[e]),null}let Pt=1;function Ht(){const e=(0,q.useHostChooser)(),t=(0,Ae.useHostRegistryLoaded)(),[n,o]=(0,h.useState)(null),[s,c]=(0,h.useState)(null),l=(0,Ce.useOpenProject)(n?.serverId??null),u=(0,h.useCallback)(n=>{const s=n.trim();s&&(t?e({title:"Choose host",onChooseHost:e=>{o({id:Pt++,serverId:e,path:s})}}):c(s))},[e,t]);return(0,h.useEffect)(()=>{if(!t||!s)return;const e=s;c(null),u(e)},[t,u,s]),(0,h.useEffect)(()=>{if(!n)return;let e=!1;return l(n.path).then(t=>e?null:t.ok?(o(e=>e?.id===n.id?null:e),null):(o(e=>e?.id===n.id?null:e),null)),()=>{e=!0}},[l,n]),(0,h.useEffect)(()=>{let e=!1,t=null;return(0,he.getDesktopHost)()?.getPendingOpenProject?.()?.then(t=>{!e&&t&&u(t)}).catch(()=>{}),(0,de.listenToDesktopEvent)("open-project",t=>{if(e)return;const n="string"==typeof t?.path?t.path.trim():"";u(n)}).then(n=>{e?n():t=n}).catch(()=>{}),()=>{e=!0,t?.()}},[u]),null}function Rt(e){const t=(0,o.c)(8),{children:n}=e,s=(0,d.usePathname)();(0,re.useTrackForegroundWorkspaceSelection)();const c=(0,Ae.useHosts)(),l=dt();let u;t[0]!==s?(u=(0,Ve.parseServerIdFromPathname)(s),t[0]=s,t[1]=u):u=t[1];const h=u;let f;t[2]!==c||t[3]!==h?(f=null!==h&&c.some(e=>e.serverId===h),t[2]=c,t[3]=h,t[4]=f):f=t[4];const S=l&&("/open-project"===s||"/new"===s||"/sessions"===s||"/schedules"===s||"/usage"===s||f);let p;return t[5]!==n||t[6]!==S?(p=(0,ze.jsx)(pt,{chromeEnabled:S,children:n}),t[5]=n,t[6]=S,t[7]=p):p=t[7],p}function Dt(){return(0,je.useFaviconStatus)(),null}const Wt={headerShown:!1,animation:"none"},At=["h/[serverId]"];function Lt(){const e=(0,o.c)(20),t=dt();let n,s,c,l,u,h,f,S,p,b,v,x,j,y,k,I,_,E;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,ze.jsx)(d.Stack.Screen,{name:"index"}),e[0]=n):n=e[0],e[1]===Symbol.for("react.memo_cache_sentinel")?(s=(0,ze.jsx)(d.Stack.Screen,{name:"welcome"}),c=(0,ze.jsx)(d.Stack.Screen,{name:"settings/index"}),l=(0,ze.jsx)(d.Stack.Screen,{name:"settings/[section]"}),u=(0,ze.jsx)(d.Stack.Screen,{name:"new"}),h=(0,ze.jsx)(d.Stack.Screen,{name:"open-project"}),f=(0,ze.jsx)(d.Stack.Screen,{name:"sessions"}),S=(0,ze.jsx)(d.Stack.Screen,{name:"schedules"}),p=(0,ze.jsx)(d.Stack.Screen,{name:"usage"}),b=(0,ze.jsx)(d.Stack.Screen,{name:"pair-scan"}),e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=h,e[6]=f,e[7]=S,e[8]=p,e[9]=b):(s=e[1],c=e[2],l=e[3],u=e[4],h=e[5],f=e[6],S=e[7],p=e[8],b=e[9]),e[10]!==t?(v=(0,ze.jsxs)(d.Stack.Protected,{guard:t,children:[s,c,l,u,h,f,S,p,b]}),e[10]=t,e[11]=v):v=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(x=(0,ze.jsx)(d.Stack.Screen,{name:"h/[serverId]"}),j=(0,ze.jsx)(d.Stack.Screen,{name:"settings/hosts/[serverId]/index"}),y=(0,ze.jsx)(d.Stack.Screen,{name:"settings/hosts/[serverId]/[hostSection]"}),k=(0,ze.jsx)(d.Stack.Screen,{name:"settings/hosts/[serverId]/plugins/[pluginId]/[screenId]"}),I=(0,ze.jsx)(d.Stack.Screen,{name:"settings/hosts/[serverId]/projects/index"}),_=(0,ze.jsx)(d.Stack.Screen,{name:"settings/hosts/[serverId]/projects/[projectId]"}),e[12]=x,e[13]=j,e[14]=y,e[15]=k,e[16]=I,e[17]=_):(x=e[12],j=e[13],y=e[14],k=e[15],I=e[16],_=e[17]),e[18]!==v?(E=(0,ze.jsxs)(se.ThemedStack,{screenOptions:Wt,nestedNavigatorScreens:At,children:[n,v,x,j,y,k,I,_]}),e[18]=v,e[19]=E):E=e[19],E}function Ot(){const e=(0,o.c)(3),t=(0,d.useNavigationContainerRef)();let n,s;return e[0]!==t?(n=()=>(0,oe.registerWorkspaceRouteNavigationRef)(t),s=[t],e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]),(0,h.useEffect)(n,s),null}function Tt(){const e=(0,o.c)(4);let t,n,s,c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,ze.jsx)(Ht,{}),n=(0,ze.jsx)(ce.AgentNavigationListener,{}),s=(0,ze.jsx)(ae.DesktopContentContextMenuHost,{}),e[0]=t,e[1]=n,e[2]=s):(t=e[0],n=e[1],s=e[2]),e[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,ze.jsx)(Re.MobilePanelsProvider,{children:(0,ze.jsxs)(J.HorizontalScrollProvider,{children:[t,n,s,(0,ze.jsxs)(Rt,{children:[(0,ze.jsx)(Ot,{}),(0,ze.jsx)(Lt,{})]})]})}),e[3]=c):c=e[3],c}function Ft(e){const t=(0,o.c)(3),{children:n}=e;let s,c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,ze.jsx)(Ye,{}),t[0]=s):s=t[0],t[1]!==n?(c=(0,ze.jsxs)(ct,{children:[s,(0,ze.jsx)($.SidebarCalloutProvider,{children:(0,ze.jsx)(_t,{children:n})})]}),t[1]=n,t[2]=c):c=t[2],c}function Mt(e){const t=(0,o.c)(2),{children:n}=e;let l;return t[0]!==n?(l=(0,ze.jsx)(De.KeyboardActionDispatcherProvider,{children:(0,ze.jsx)(Be.WindowChromeProvider,{children:(0,ze.jsx)(b.KeyboardProvider,{children:(0,ze.jsx)(Ie.KeyboardShiftProvider,{children:(0,ze.jsx)(ee.ToastProvider,{children:(0,ze.jsx)(c.PortalProvider,{children:(0,ze.jsx)(s.BottomSheetModalProvider,{children:n})})})})})})}),t[0]=n,t[1]=l):l=t[1],l}function Nt(){const e=(0,o.c)(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,ze.jsx)(p.GestureHandlerRootView,{style:ht,children:(0,ze.jsx)(n.View,{style:Kt.surfaceFill,children:(0,ze.jsx)(Mt,{children:(0,ze.jsx)(Ft,{children:(0,ze.jsx)(Tt,{})})})})}),e[0]=t):t=e[0],t}function Bt(){const e=(0,o.c)(3);let t,n,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0],(0,h.useEffect)(Ut,t),e[1]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[1]=n):n=e[1],(0,h.useEffect)(Vt,n),e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,ze.jsx)(Nt,{}),e[2]=s):s=e[2],s}function Vt(){const e=f.default.addEventListener("change",Gt);return()=>e.remove()}function Gt(e){"active"!==e&&(0,Te.flushDraftPersistStorage)()}function Ut(){return(0,Ne.installWebScrollbarStyles)()}const Kt=v.StyleSheet.create(e=>({sidebarEdgeTrigger:{position:"absolute",top:0,bottom:0,left:0,width:Y.SIDEBAR_EDGE_WIDTH,pointerEvents:"auto"},surfaceFill:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},windowSidebarToggle:{position:"absolute",top:1,left:0,zIndex:20,height:Q.HEADER_INNER_HEIGHT,flexDirection:"row",alignItems:"center",borderBottomWidth:e.borderWidth[1],borderBottomColor:"transparent",uni__dependencies:[0]}}))},3033,[896,454,56,3034,3228,730,3267,456,37,398,451,147,3037,3402,57,3453,3753,3803,3790,3847,3898,3901,3908,3914,3932,3934,3936,4104,4109,4110,4112,4878,4122,4879,4880,4882,4883,4890,4893,4894,4445,3838,4895,1217,4118,881,4161,4896,3909,894,4426,4918,3679,3671,4919,3540,4920,4921,4922,4923,3933,4051,882,891,4924,4925,4929,4930,4931,4932,4933,4941,4258,4446,4945,3843,884,3911,4160,4163,3783,2,3529,4946,3797,3620,306,3459,4947,4050,3675,4916,3787,4474,4903,280]);
|
|
14651
14651
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(_e,"BottomSheetModal",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(_e,"BottomSheetModalProvider",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(_e,"useBottomSheet",{enumerable:!0,get:function(){return u.useBottomSheet}}),Object.defineProperty(_e,"useBottomSheetModal",{enumerable:!0,get:function(){return l.useBottomSheetModal}}),Object.defineProperty(_e,"useBottomSheetSpringConfigs",{enumerable:!0,get:function(){return c.useBottomSheetSpringConfigs}}),Object.defineProperty(_e,"useBottomSheetTimingConfigs",{enumerable:!0,get:function(){return f.useBottomSheetTimingConfigs}}),Object.defineProperty(_e,"useBottomSheetInternal",{enumerable:!0,get:function(){return b.useBottomSheetInternal}}),Object.defineProperty(_e,"useBottomSheetModalInternal",{enumerable:!0,get:function(){return s.useBottomSheetModalInternal}}),Object.defineProperty(_e,"useScrollEventsHandlersDefault",{enumerable:!0,get:function(){return S.useScrollEventsHandlersDefault}}),Object.defineProperty(_e,"useGestureEventsHandlersDefault",{enumerable:!0,get:function(){return h.useGestureEventsHandlersDefault}}),Object.defineProperty(_e,"useBottomSheetGestureHandlers",{enumerable:!0,get:function(){return p.useBottomSheetGestureHandlers}}),Object.defineProperty(_e,"useScrollHandler",{enumerable:!0,get:function(){return B.useScrollHandler}}),Object.defineProperty(_e,"useScrollableSetter",{enumerable:!0,get:function(){return y.useScrollableSetter}}),Object.defineProperty(_e,"useBottomSheetScrollableCreator",{enumerable:!0,get:function(){return O.useBottomSheetScrollableCreator}}),Object.defineProperty(_e,"BottomSheetScrollView",{enumerable:!0,get:function(){return j.BottomSheetScrollView}}),Object.defineProperty(_e,"BottomSheetSectionList",{enumerable:!0,get:function(){return j.BottomSheetSectionList}}),Object.defineProperty(_e,"BottomSheetFlatList",{enumerable:!0,get:function(){return j.BottomSheetFlatList}}),Object.defineProperty(_e,"BottomSheetVirtualizedList",{enumerable:!0,get:function(){return j.BottomSheetVirtualizedList}}),Object.defineProperty(_e,"BottomSheetFlashList",{enumerable:!0,get:function(){return j.BottomSheetFlashList}}),Object.defineProperty(_e,"BottomSheetHandle",{enumerable:!0,get:function(){return P.BottomSheetHandle}}),Object.defineProperty(_e,"BottomSheetDraggableView",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(_e,"BottomSheetView",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(_e,"BottomSheetTextInput",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(_e,"BottomSheetBackdrop",{enumerable:!0,get:function(){return L.BottomSheetBackdrop}}),Object.defineProperty(_e,"BottomSheetFooter",{enumerable:!0,get:function(){return T.BottomSheetFooter}}),Object.defineProperty(_e,"BottomSheetFooterContainer",{enumerable:!0,get:function(){return T.BottomSheetFooterContainer}}),Object.defineProperty(_e,"createBottomSheetScrollableComponent",{enumerable:!0,get:function(){return j.createBottomSheetScrollableComponent}}),Object.defineProperty(_e,"enableLogging",{enumerable:!0,get:function(){return V.enableLogging}}),Object.defineProperty(_e,"TouchableHighlight",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"TouchableOpacity",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"TouchableWithoutFeedback",{enumerable:!0,get:function(){return w}});var t=e(r(d[0])),n=e(r(d[1])),o=e(r(d[2])),u=r(d[3]),l=r(d[4]),c=r(d[5]),f=r(d[6]),b=r(d[7]),s=r(d[8]),S=r(d[9]),h=r(d[10]),p=r(d[11]),B=r(d[12]),y=r(d[13]),O=r(d[14]),j=r(d[15]),P=r(d[16]),H=e(r(d[17])),C=e(r(d[18])),F=e(r(d[19])),L=r(d[20]),T=r(d[21]),v=e(r(d[22])),M=r(d[23]);Object.keys(M).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return M[e]}})});var V=r(d[24]);const{TouchableHighlight:_,TouchableOpacity:k,TouchableWithoutFeedback:w}=v.default},3034,[3035,3226,3240,3174,3176,3242,3243,3175,3177,3244,3190,3193,3188,3187,3245,3246,3213,3224,3256,3259,3261,3207,3265,3166,3183]);
|
|
14652
14652
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},3035,[3036]);
|
|
14653
14653
|
__d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return tt}});var e=t(r(d[0])),n=r(d[1]),o=t(r(d[2])),s=t(r(d[3])),_=t(r(d[4])),u=r(d[5]),A=r(d[6]),S=t(A),l=r(d[7]),I=r(d[8]),c=r(d[9]),T=r(d[10]),O=r(d[11]),N=r(d[12]),h=t(r(d[13])),E=r(d[14]),P=r(d[15]),D=r(d[16]),f=r(d[17]),C=r(d[18]),U=r(d[19]);S.default.addWhitelistedUIProps({decelerationRate:!0});const R={code:"function gorhom_BottomSheetJs1(){const{animatedLayoutState,animatedDetentsState,INITIAL_LAYOUT_VALUE}=this.__closure;const{containerHeight:containerHeight}=animatedLayoutState.get();const{highestDetentPosition:highestDetentPosition}=animatedDetentsState.get();if(highestDetentPosition===undefined){return INITIAL_LAYOUT_VALUE;}return containerHeight-highestDetentPosition;}"},x={code:"function gorhom_BottomSheetJs2(){const{animatedLayoutState,INITIAL_LAYOUT_VALUE,handleComponent,animatedDetentsState}=this.__closure;let isContainerHeightCalculated=false;const{containerHeight:containerHeight,handleHeight:handleHeight}=animatedLayoutState.get();if(containerHeight!==null&&containerHeight!==undefined&&containerHeight!==INITIAL_LAYOUT_VALUE){isContainerHeightCalculated=true;}let isHandleHeightCalculated=false;if(handleComponent===null){isHandleHeightCalculated=true;}if(handleHeight!==INITIAL_LAYOUT_VALUE){isHandleHeightCalculated=true;}let isSnapPointsNormalized=false;const{detents:detents}=animatedDetentsState.get();if(detents){isSnapPointsNormalized=true;}return isContainerHeightCalculated&&isHandleHeightCalculated&&isSnapPointsNormalized;}"},v={code:"function gorhom_BottomSheetJs3(){const{animatedDetentsState,SHEET_STATE,animatedPosition,animatedLayoutState,animatedSheetHeight,animatedKeyboardState,keyboardBehavior,KEYBOARD_BEHAVIOR,isInTemporaryPosition}=this.__closure;const{detents:detents,closedDetentPosition:closedDetentPosition}=animatedDetentsState.get();if(!detents||detents.length===0||closedDetentPosition===undefined){return SHEET_STATE.CLOSED;}if(animatedPosition.value>=closedDetentPosition){return SHEET_STATE.CLOSED;}const{containerHeight:containerHeight}=animatedLayoutState.get();const extendedPosition=containerHeight-animatedSheetHeight.value;if(animatedPosition.value===extendedPosition){return SHEET_STATE.EXTENDED;}const keyboardHeightInContainer=animatedKeyboardState.get().heightWithinContainer;const extendedPositionWithKeyboard=Math.max(0,containerHeight-(animatedSheetHeight.value+keyboardHeightInContainer));if(keyboardBehavior===KEYBOARD_BEHAVIOR.interactive&&isInTemporaryPosition.value&&animatedPosition.value===extendedPositionWithKeyboard){return SHEET_STATE.EXTENDED;}if(animatedPosition.value===0){return SHEET_STATE.FILL_PARENT;}if(animatedPosition.value<extendedPosition){return SHEET_STATE.OVER_EXTENDED;}return SHEET_STATE.OPENED;}"},p={code:"function gorhom_BottomSheetJs4(){const{animatedDetentsState,animatedLayoutState,isLayoutCalculated,interpolate,animatedPosition,Extrapolation,animatedAnimationState,android_keyboardInputMode,KEYBOARD_INPUT_MODE,ANIMATION_STATUS,ANIMATION_SOURCE,isInTemporaryPosition,animatedCurrentIndex}=this.__closure;const{detents:detents}=animatedDetentsState.get();if(!detents||detents.length===0){return-1;}const adjustedSnapPoints=detents.slice().reverse();const adjustedSnapPointsIndexes=detents.slice().map(function(_,index){return index;}).reverse();const{containerHeight:containerHeight}=animatedLayoutState.get();adjustedSnapPoints.push(containerHeight);adjustedSnapPointsIndexes.push(-1);const currentIndex=isLayoutCalculated.value?interpolate(animatedPosition.value,adjustedSnapPoints,adjustedSnapPointsIndexes,Extrapolation.CLAMP):-1;const{status:animationStatus,source:animationSource,nextIndex:nextIndex,nextPosition:nextPosition}=animatedAnimationState.get();if(android_keyboardInputMode===KEYBOARD_INPUT_MODE.adjustResize&&animationStatus===ANIMATION_STATUS.RUNNING&&animationSource===ANIMATION_SOURCE.KEYBOARD&&isInTemporaryPosition.value){return Math.max(animatedCurrentIndex.value,currentIndex);}if(animationStatus===ANIMATION_STATUS.RUNNING&&animationSource===ANIMATION_SOURCE.SNAP_POINT_CHANGE&&nextIndex!==undefined&&nextPosition!==undefined){return nextIndex;}return currentIndex;}"},B={code:"function gorhom_BottomSheetJs5(){const{cancelAnimation,animatedPosition,animatedAnimationState,ANIMATION_STATUS,ANIMATION_SOURCE}=this.__closure;cancelAnimation(animatedPosition);animatedAnimationState.set({status:ANIMATION_STATUS.STOPPED,source:ANIMATION_SOURCE.NONE});}"},M={code:"function animateToPositionCompleted_Gorhom_BottomSheetJs6(isFinished){const{animatedAnimationState,__DEV__,runOnJS,print,animatedCurrentIndex,handleOnChange,handleOnClose,animatedContainerHeightDidChange,didAnimateOnMount,ANIMATION_STATUS,ANIMATION_SOURCE}=this.__closure;if(!isFinished){return;}const{nextIndex:nextIndex,nextPosition:nextPosition}=animatedAnimationState.get();if(__DEV__){runOnJS(print)({component:'BottomSheet',method:'animateToPositionCompleted',params:{currentIndex:animatedCurrentIndex.value,nextIndex:nextIndex,nextPosition:nextPosition}});}if(nextIndex===undefined||nextPosition===undefined){return;}if(nextIndex!==animatedCurrentIndex.get()){runOnJS(handleOnChange)(nextIndex,nextPosition);}if(nextIndex===-1){runOnJS(handleOnClose)();}animatedCurrentIndex.set(nextIndex);animatedContainerHeightDidChange.set(false);didAnimateOnMount.set(true);animatedAnimationState.set({status:ANIMATION_STATUS.STOPPED,source:ANIMATION_SOURCE.NONE,nextIndex:undefined,nextPosition:undefined,isForcedClosing:undefined});}"},y={code:"function gorhom_BottomSheetJs7(state){const{ANIMATION_STATUS,source,index,position}=this.__closure;return{...state,status:ANIMATION_STATUS.RUNNING,source:source,nextIndex:index,nextPosition:position};}"},H={code:"function animateToPosition_Gorhom_BottomSheetJs8(position,source,velocity=0,configs){const{__DEV__,runOnJS,print,animatedPosition,animatedAnimationState,ANIMATION_STATUS,stopAnimation,animatedKeyboardState,animatedSheetState,KEYBOARD_STATUS,keyboardBehavior,KEYBOARD_BEHAVIOR,ANIMATION_SOURCE,SHEET_STATE,animatedDetentsState,DEFAULT_KEYBOARD_INDEX,_worklet_3054184197869_init_data,handleOnAnimate,animate,_providedAnimationConfigs,_providedOverrideReduceMotion,animateToPositionCompleted}=this.__closure;var _detents$indexOf;if(__DEV__){runOnJS(print)({component:'BottomSheet',method:'animateToPosition',params:{currentPosition:animatedPosition.value,nextPosition:position,source:source}});}if(position===undefined){return;}if(position===animatedPosition.get()){return;}const{status:animationStatus,nextPosition:nextPosition}=animatedAnimationState.get();if(animationStatus===ANIMATION_STATUS.RUNNING&&position===nextPosition){return;}if(animationStatus===ANIMATION_STATUS.RUNNING){stopAnimation();}let offset=0;const{status:status,heightWithinContainer:heightWithinContainer}=animatedKeyboardState.get();const sheetState=animatedSheetState.get();if(status===KEYBOARD_STATUS.SHOWN&&keyboardBehavior!==KEYBOARD_BEHAVIOR.extend&&([ANIMATION_SOURCE.KEYBOARD,ANIMATION_SOURCE.SNAP_POINT_CHANGE].includes(source)||sheetState===SHEET_STATE.OVER_EXTENDED)){offset=heightWithinContainer;}const{detents:detents,closedDetentPosition:closedDetentPosition,highestDetentPosition:highestDetentPosition}=animatedDetentsState.get();let index=(_detents$indexOf=detents===null||detents===void 0?void 0:detents.indexOf(position+offset))!==null&&_detents$indexOf!==void 0?_detents$indexOf:-1;if(index===-1&&status===KEYBOARD_STATUS.SHOWN&&position!==closedDetentPosition){if(detents!==undefined&&highestDetentPosition!==undefined){index=detents.indexOf(highestDetentPosition);}if(index===-1){index=DEFAULT_KEYBOARD_INDEX;}}animatedAnimationState.set(function animateToPosition_Gorhom_BottomSheetJs8({_worklet_3054184197869_init_data:_worklet_3054184197869_init_data,ANIMATION_STATUS:ANIMATION_STATUS,source:source,index:index,position:position}){const gorhom_BottomSheetJs7=function(state){return{...state,status:ANIMATION_STATUS.RUNNING,source:source,nextIndex:index,nextPosition:position};};gorhom_BottomSheetJs7.__closure={ANIMATION_STATUS:ANIMATION_STATUS,source:source,index:index,position:position};gorhom_BottomSheetJs7.__workletHash=3054184197869;gorhom_BottomSheetJs7.__initData=_worklet_3054184197869_init_data;return gorhom_BottomSheetJs7;}({_worklet_3054184197869_init_data:_worklet_3054184197869_init_data,ANIMATION_STATUS:ANIMATION_STATUS,source:source,index:index,position:position}));runOnJS(handleOnAnimate)(index,position);animatedPosition.value=animate({point:position,configs:configs||_providedAnimationConfigs,velocity:velocity,overrideReduceMotion:_providedOverrideReduceMotion,onComplete:animateToPositionCompleted});}"},b={code:"function gorhom_BottomSheetJs9(state){const{targetPosition,index}=this.__closure;return{...state,nextPosition:targetPosition,nextIndex:index};}"},L={code:"function setToPosition_Gorhom_BottomSheetJs10(targetPosition){const{animatedPosition,animatedAnimationState,ANIMATION_STATUS,__DEV__,runOnJS,print,animatedDetentsState,_worklet_3650511913251_init_data,stopAnimation,animatedContainerHeightDidChange}=this.__closure;var _detents$indexOf;if(!targetPosition){return;}if(targetPosition===animatedPosition.get()){return;}const{status:animationStatus,nextPosition:nextPosition}=animatedAnimationState.get();if(animationStatus===ANIMATION_STATUS.RUNNING&&targetPosition===nextPosition){return;}if(__DEV__){runOnJS(print)({component:'BottomSheet',method:'setToPosition',params:{currentPosition:animatedPosition.value,targetPosition:targetPosition}});}const{detents:detents}=animatedDetentsState.get();const index=(_detents$indexOf=detents===null||detents===void 0?void 0:detents.indexOf(targetPosition))!==null&&_detents$indexOf!==void 0?_detents$indexOf:-1;animatedAnimationState.set(function setToPosition_Gorhom_BottomSheetJs10({_worklet_3650511913251_init_data:_worklet_3650511913251_init_data,targetPosition:targetPosition,index:index}){const gorhom_BottomSheetJs9=function(state){return{...state,nextPosition:targetPosition,nextIndex:index};};gorhom_BottomSheetJs9.__closure={targetPosition:targetPosition,index:index};gorhom_BottomSheetJs9.__workletHash=3650511913251;gorhom_BottomSheetJs9.__initData=_worklet_3650511913251_init_data;return gorhom_BottomSheetJs9;}({_worklet_3650511913251_init_data:_worklet_3650511913251_init_data,targetPosition:targetPosition,index:index}));stopAnimation();animatedPosition.value=targetPosition;animatedContainerHeightDidChange.value=false;}"},k={code:"function getEvaluatedPosition_Gorhom_BottomSheetJs11(source){const{animatedCurrentIndex,animatedDetentsState,animatedKeyboardState,ANIMATION_SOURCE,keyboardBlurBehavior,KEYBOARD_BLUR_BEHAVIOR,KEYBOARD_STATUS,animatedContentGestureState,State,animatedHandleGestureState,isInTemporaryPosition,keyboardBehavior,KEYBOARD_BEHAVIOR,Platform,android_keyboardInputMode,animatedPosition,didAnimateOnMount,_providedIndex,animatedAnimationState,ANIMATION_STATUS}=this.__closure;const currentIndex=animatedCurrentIndex.value;const{detents:detents,highestDetentPosition:highestDetentPosition,closedDetentPosition:closedDetentPosition}=animatedDetentsState.get();const keyboardStatus=animatedKeyboardState.get().status;if(detents===undefined||highestDetentPosition===undefined||closedDetentPosition===undefined){return;}if(source===ANIMATION_SOURCE.KEYBOARD&&keyboardBlurBehavior===KEYBOARD_BLUR_BEHAVIOR.restore&&keyboardStatus===KEYBOARD_STATUS.HIDDEN&&animatedContentGestureState.value!==State.ACTIVE&&animatedHandleGestureState.value!==State.ACTIVE){isInTemporaryPosition.value=false;const nextPosition=detents[currentIndex];return nextPosition;}if(keyboardBehavior===KEYBOARD_BEHAVIOR.extend&&keyboardStatus===KEYBOARD_STATUS.SHOWN){return highestDetentPosition;}if(keyboardBehavior===KEYBOARD_BEHAVIOR.fillParent&&keyboardStatus===KEYBOARD_STATUS.SHOWN){isInTemporaryPosition.value=true;return 0;}if(keyboardBehavior===KEYBOARD_BEHAVIOR.interactive&&keyboardStatus===KEYBOARD_STATUS.SHOWN&&!(Platform.OS==='android'&&android_keyboardInputMode==='adjustResize')){isInTemporaryPosition.value=true;const keyboardHeightInContainer=animatedKeyboardState.get().heightWithinContainer;return Math.max(0,highestDetentPosition-keyboardHeightInContainer);}if(isInTemporaryPosition.value){return animatedPosition.value;}if(!didAnimateOnMount.value){return _providedIndex===-1?closedDetentPosition:detents[_providedIndex];}const{status:status,nextIndex:nextIndex,nextPosition:nextPosition}=animatedAnimationState.get();if(source===ANIMATION_SOURCE.SNAP_POINT_CHANGE&&status===ANIMATION_STATUS.RUNNING&&nextIndex!==undefined&&nextPosition!==undefined&&detents[nextIndex]!==nextPosition){return detents[nextIndex];}return detents[currentIndex];}"},K={code:"function evaluatePosition_Gorhom_BottomSheetJs12(source,animationConfigs){const{animatedAnimationState,animatedDetentsState,ANIMATION_SOURCE,isLayoutCalculated,getEvaluatedPosition,didAnimateOnMount,ANIMATION_STATUS,animateOnMount,animateToPosition,setToPosition,INITIAL_VALUE,isInTemporaryPosition,animatedCurrentIndex,reduceMotion,animatedIndex,animatedPosition,animatedContainerHeightDidChange}=this.__closure;const{status:animationStatus,nextIndex:nextIndex,isForcedClosing:isForcedClosing}=animatedAnimationState.get();const{detents:detents,closedDetentPosition:closedDetentPosition}=animatedDetentsState.get();if(detents===undefined||detents.length===0||closedDetentPosition===undefined){return;}if(isForcedClosing&&source!==ANIMATION_SOURCE.USER){return;}if(!isLayoutCalculated.value){return;}const proposedPosition=getEvaluatedPosition(source);if(proposedPosition===undefined){return;}if(!didAnimateOnMount.value){if(animationStatus===ANIMATION_STATUS.RUNNING&&(isForcedClosing||nextIndex===-1)){return;}if(animateOnMount){animateToPosition(proposedPosition,ANIMATION_SOURCE.MOUNT,undefined,animationConfigs);}else{setToPosition(proposedPosition);didAnimateOnMount.value=true;}return;}if(animationStatus===ANIMATION_STATUS.RUNNING){const nextPositionIndex=nextIndex!==null&&nextIndex!==void 0?nextIndex:INITIAL_VALUE;if(nextPositionIndex===-1&&!isInTemporaryPosition.value){setToPosition(closedDetentPosition);return;}if(nextPositionIndex!==animatedCurrentIndex.value){animateToPosition(detents[nextPositionIndex],source,undefined,animationConfigs);return;}}if(animationStatus!==ANIMATION_STATUS.RUNNING&&animatedCurrentIndex.value===-1){if(reduceMotion&&detents[animatedIndex.value]!==animatedPosition.value){return;}setToPosition(closedDetentPosition);return;}if(animatedContainerHeightDidChange.value){setToPosition(proposedPosition);return;}animateToPosition(proposedPosition,source,undefined,animationConfigs);}"},V={code:"function handleSnapToPosition_Gorhom_BottomSheetJs13(position,animationConfigs){const{__DEV__,print,animatedLayoutState,normalizeSnapPoint,animatedAnimationState,isLayoutCalculated,isInTemporaryPosition,runOnUI,animateToPosition,ANIMATION_SOURCE}=this.__closure;if(__DEV__){print({component:'BottomSheet',method:'handleSnapToPosition',params:{position:position}});}const{containerHeight:containerHeight}=animatedLayoutState.get();const targetPosition=normalizeSnapPoint(position,containerHeight);const{nextPosition:nextPosition,isForcedClosing:isForcedClosing}=animatedAnimationState.get();if(!isLayoutCalculated||targetPosition===nextPosition||isForcedClosing){return;}isInTemporaryPosition.value=true;runOnUI(animateToPosition)(targetPosition,ANIMATION_SOURCE.USER,0,animationConfigs);}"},Y={code:"function gorhom_BottomSheetJs14(state){return{...state,isForcedClosing:true};}"},w={code:"function gorhom_BottomSheetJs15(){const{animatedLayoutState}=this.__closure;return animatedLayoutState.get().containerHeight;}"},G={code:"function gorhom_BottomSheetJs16(result,previous){const{INITIAL_LAYOUT_VALUE,animatedContainerHeightDidChange,animatedDetentsState,animatedAnimationState,ANIMATION_STATUS,ANIMATION_SOURCE,animateToPosition}=this.__closure;if(result===INITIAL_LAYOUT_VALUE){return;}animatedContainerHeightDidChange.value=result!==previous;const{closedDetentPosition:closedDetentPosition}=animatedDetentsState.get();if(closedDetentPosition===undefined){return;}const{status:animationStatus,source:animationSource,nextIndex:nextIndex}=animatedAnimationState.get();if(animationStatus===ANIMATION_STATUS.RUNNING&&animationSource===ANIMATION_SOURCE.GESTURE&&nextIndex===-1){animateToPosition(closedDetentPosition,ANIMATION_SOURCE.GESTURE);}}"},J={code:"function gorhom_BottomSheetJs17(){const{animatedDetentsState}=this.__closure;return animatedDetentsState.get().detents;}"},F={code:"function gorhom_BottomSheetJs18(result,previous){const{didAnimateOnMount,isLayoutCalculated,__DEV__,runOnJS,print,evaluatePosition,ANIMATION_SOURCE}=this.__closure;if(JSON.stringify(result)===JSON.stringify(previous)&&didAnimateOnMount.value){return;}if(!isLayoutCalculated.value){return;}if(__DEV__){runOnJS(print)({component:'BottomSheet',method:'useAnimatedReaction::OnSnapPointChange',category:'effect',params:{result:result}});}evaluatePosition(ANIMATION_SOURCE.SNAP_POINT_CHANGE);}"},W={code:"function gorhom_BottomSheetJs19(){const{animatedKeyboardState}=this.__closure;return animatedKeyboardState.get().status+animatedKeyboardState.get().height;}"},j={code:"function gorhom_BottomSheetJs20(result,_previousResult){const{animatedKeyboardState,KEYBOARD_STATUS,animatedAnimationState,ANIMATION_STATUS,ANIMATION_SOURCE,animatedLayoutState,$modal,bottomInset,__DEV__,runOnJS,print,Platform,android_keyboardInputMode,KEYBOARD_INPUT_MODE,keyboardBehavior,KEYBOARD_BEHAVIOR,animatedContentGestureState,State,animatedHandleGestureState,keyboardBlurBehavior,KEYBOARD_BLUR_BEHAVIOR,getKeyboardAnimationConfigs,evaluatePosition}=this.__closure;if(result===_previousResult){return;}const{status:status,height:height,easing:easing,duration:duration,target:target}=animatedKeyboardState.get();if(status===KEYBOARD_STATUS.UNDETERMINED){return;}const{status:animationStatus,source:animationSource}=animatedAnimationState.get();if(status===KEYBOARD_STATUS.HIDDEN&&animationStatus===ANIMATION_STATUS.RUNNING&&animationSource===ANIMATION_SOURCE.GESTURE){return;}const containerOffset=animatedLayoutState.get().containerOffset;let heightWithinContainer=height===0?0:$modal?Math.abs(height-Math.abs(bottomInset-containerOffset.bottom)):Math.abs(height-containerOffset.bottom);if(__DEV__){runOnJS(print)({component:'BottomSheet',method:'useAnimatedReaction::OnKeyboardStateChange',category:'effect',params:{status:status,height:height,heightWithinContainer:heightWithinContainer,containerOffset:containerOffset}});}if(Platform.OS==='android'&&android_keyboardInputMode===KEYBOARD_INPUT_MODE.adjustResize){heightWithinContainer=0;if(keyboardBehavior===KEYBOARD_BEHAVIOR.interactive){animatedKeyboardState.set({target:target,status:status,height:height,easing:easing,duration:duration,heightWithinContainer:heightWithinContainer});return;}}animatedKeyboardState.set(function(state){return{...state,heightWithinContainer:heightWithinContainer};});const hasActiveGesture=animatedContentGestureState.value===State.ACTIVE||animatedContentGestureState.value===State.BEGAN||animatedHandleGestureState.value===State.ACTIVE||animatedHandleGestureState.value===State.BEGAN;if(hasActiveGesture){return;}if(status===KEYBOARD_STATUS.HIDDEN&&keyboardBlurBehavior===KEYBOARD_BLUR_BEHAVIOR.none){return;}const animationConfigs=getKeyboardAnimationConfigs(easing,duration);evaluatePosition(ANIMATION_SOURCE.KEYBOARD,animationConfigs);}"},X={code:"function gorhom_BottomSheetJs21(){const{animatedPosition}=this.__closure;return animatedPosition.value;}"},z={code:"function gorhom_BottomSheetJs22(_animatedPosition){const{_providedAnimatedPosition,topInset}=this.__closure;if(_providedAnimatedPosition){_providedAnimatedPosition.value=_animatedPosition+topInset;}}"},$={code:"function gorhom_BottomSheetJs23(){const{animatedIndex}=this.__closure;return animatedIndex.value;}"},Z={code:"function gorhom_BottomSheetJs24(_animatedIndex){const{_providedAnimatedIndex}=this.__closure;if(_providedAnimatedIndex){_providedAnimatedIndex.value=_animatedIndex;}}"},q=(0,n.forwardRef)(function(t,S){const{animationConfigs:q,index:Q=0,snapPoints:tt,animateOnMount:et=C.DEFAULT_ANIMATE_ON_MOUNT,enableContentPanningGesture:nt=C.DEFAULT_ENABLE_CONTENT_PANNING_GESTURE,enableHandlePanningGesture:it,enableOverDrag:at=C.DEFAULT_ENABLE_OVER_DRAG,enablePanDownToClose:ot=C.DEFAULT_ENABLE_PAN_DOWN_TO_CLOSE,enableDynamicSizing:st=C.DEFAULT_DYNAMIC_SIZING,overDragResistanceFactor:dt=C.DEFAULT_OVER_DRAG_RESISTANCE_FACTOR,overrideReduceMotion:rt,style:_t,containerStyle:ut,backgroundStyle:At,handleStyle:mt,handleIndicatorStyle:St,gestureEventsHandlersHook:lt,keyboardBehavior:It=C.DEFAULT_KEYBOARD_BEHAVIOR,keyboardBlurBehavior:ct=C.DEFAULT_KEYBOARD_BLUR_BEHAVIOR,android_keyboardInputMode:Tt=C.DEFAULT_KEYBOARD_INPUT_MODE,enableBlurKeyboardOnGesture:Ot=C.DEFAULT_ENABLE_BLUR_KEYBOARD_ON_GESTURE,containerLayoutState:Nt,topInset:ht=0,bottomInset:Et=0,maxDynamicContentSize:gt,containerHeight:Pt,containerOffset:Dt,animatedPosition:ft,animatedIndex:Ct,simultaneousHandlers:Ut,waitFor:Rt,activeOffsetX:xt,activeOffsetY:vt,failOffsetX:pt,failOffsetY:Bt,onChange:Mt,onClose:yt,onAnimate:Ht,$modal:bt=!1,detached:Lt=!1,handleComponent:kt=E.BottomSheetHandle,backdropComponent:Kt,backgroundComponent:Vt,footerComponent:Yt,children:wt,accessible:Gt=C.DEFAULT_ACCESSIBLE,accessibilityLabel:Jt=C.DEFAULT_ACCESSIBILITY_LABEL,accessibilityRole:Ft=C.DEFAULT_ACCESSIBILITY_ROLE}=t,Wt=(0,c.useAnimatedLayout)(Nt,ht,Et,bt,null===kt),jt=(0,c.useAnimatedDetents)(tt,Wt,st,gt,Lt,bt,Et),Xt=(0,A.useDerivedValue)((function({_worklet_4739220383715_init_data:t,animatedLayoutState:e,animatedDetentsState:n,INITIAL_LAYOUT_VALUE:o}){const s=function(){const{containerHeight:t}=e.get(),{highestDetentPosition:s}=n.get();return void 0===s?o:t-s};return s.__closure={animatedLayoutState:e,animatedDetentsState:n,INITIAL_LAYOUT_VALUE:o},s.__workletHash=4739220383715,s.__initData=t,s})({_worklet_4739220383715_init_data:R,animatedLayoutState:Wt,animatedDetentsState:jt,INITIAL_LAYOUT_VALUE:l.INITIAL_LAYOUT_VALUE}),[Wt,jt]),zt=(0,c.useReactiveSharedValue)(et?-1:Q),$t=(0,A.useSharedValue)(o.default.get('window').height),Zt=(0,A.useSharedValue)(!et||-1===Q),qt=(0,A.useDerivedValue)((function({_worklet_5675370605537_init_data:t,animatedLayoutState:e,INITIAL_LAYOUT_VALUE:n,handleComponent:o,animatedDetentsState:s}){const _=function(){let t=!1;const{containerHeight:_,handleHeight:u}=e.get();null!=_&&_!==n&&(t=!0);let A=!1;null===o&&(A=!0),u!==n&&(A=!0);let S=!1;const{detents:l}=s.get();return l&&(S=!0),t&&A&&S};return _.__closure={animatedLayoutState:e,INITIAL_LAYOUT_VALUE:n,handleComponent:o,animatedDetentsState:s},_.__workletHash=5675370605537,_.__initData=t,_})({_worklet_5675370605537_init_data:x,animatedLayoutState:Wt,INITIAL_LAYOUT_VALUE:l.INITIAL_LAYOUT_VALUE,handleComponent:kt,animatedDetentsState:jt}),[Wt,jt,kt]),Qt=(0,A.useSharedValue)(!1),te=(0,A.useSharedValue)(!1),ee=(0,A.useSharedValue)(u.State.UNDETERMINED),ne=(0,A.useSharedValue)(u.State.UNDETERMINED),{state:ie,textInputNodesRef:ae}=(0,c.useAnimatedKeyboard)(),oe=(0,A.useReducedMotion)(),se=(0,n.useMemo)(()=>rt&&rt!==A.ReduceMotion.System?rt===A.ReduceMotion.Always:oe,[oe,rt]),de=(0,A.useSharedValue)({status:l.ANIMATION_STATUS.UNDETERMINED,source:l.ANIMATION_SOURCE.MOUNT}),re=(0,A.useDerivedValue)((function({_worklet_13452930535016_init_data:t,animatedDetentsState:e,SHEET_STATE:n,animatedPosition:o,animatedLayoutState:s,animatedSheetHeight:_,animatedKeyboardState:u,keyboardBehavior:A,KEYBOARD_BEHAVIOR:S,isInTemporaryPosition:l}){const I=function(){const{detents:t,closedDetentPosition:I}=e.get();if(!t||0===t.length||void 0===I)return n.CLOSED;if(o.value>=I)return n.CLOSED;const{containerHeight:c}=s.get(),T=c-_.value;if(o.value===T)return n.EXTENDED;const O=u.get().heightWithinContainer,N=Math.max(0,c-(_.value+O));return A===S.interactive&&l.value&&o.value===N?n.EXTENDED:0===o.value?n.FILL_PARENT:o.value<T?n.OVER_EXTENDED:n.OPENED};return I.__closure={animatedDetentsState:e,SHEET_STATE:n,animatedPosition:o,animatedLayoutState:s,animatedSheetHeight:_,animatedKeyboardState:u,keyboardBehavior:A,KEYBOARD_BEHAVIOR:S,isInTemporaryPosition:l},I.__workletHash=0xc3c41254e68,I.__initData=t,I})({_worklet_13452930535016_init_data:v,animatedDetentsState:jt,SHEET_STATE:l.SHEET_STATE,animatedPosition:$t,animatedLayoutState:Wt,animatedSheetHeight:Xt,animatedKeyboardState:ie,keyboardBehavior:It,KEYBOARD_BEHAVIOR:l.KEYBOARD_BEHAVIOR,isInTemporaryPosition:Qt}),[Wt,jt,ie,$t,Xt,Qt,It]),{state:ue,status:Ae,setScrollableRef:me,removeScrollableRef:Se}=(0,c.useScrollable)(nt,re,ie,de),le=(0,A.useDerivedValue)((function({_worklet_14040060957476_init_data:t,animatedDetentsState:e,animatedLayoutState:n,isLayoutCalculated:o,interpolate:s,animatedPosition:_,Extrapolation:u,animatedAnimationState:A,android_keyboardInputMode:S,KEYBOARD_INPUT_MODE:l,ANIMATION_STATUS:I,ANIMATION_SOURCE:c,isInTemporaryPosition:T,animatedCurrentIndex:O}){const N=function(){const{detents:t}=e.get();if(!t||0===t.length)return-1;const N=t.slice().reverse(),h=t.slice().map((t,e)=>e).reverse(),{containerHeight:E}=n.get();N.push(E),h.push(-1);const P=o.value?s(_.value,N,h,u.CLAMP):-1,{status:D,source:f,nextIndex:C,nextPosition:U}=A.get();return S===l.adjustResize&&D===I.RUNNING&&f===c.KEYBOARD&&T.value?Math.max(O.value,P):D===I.RUNNING&&f===c.SNAP_POINT_CHANGE&&void 0!==C&&void 0!==U?C:P};return N.__closure={animatedDetentsState:e,animatedLayoutState:n,isLayoutCalculated:o,interpolate:s,animatedPosition:_,Extrapolation:u,animatedAnimationState:A,android_keyboardInputMode:S,KEYBOARD_INPUT_MODE:l,ANIMATION_STATUS:I,ANIMATION_SOURCE:c,isInTemporaryPosition:T,animatedCurrentIndex:O},N.__workletHash=0xcc4f4d89324,N.__initData=t,N})({_worklet_14040060957476_init_data:p,animatedDetentsState:jt,animatedLayoutState:Wt,isLayoutCalculated:qt,interpolate:A.interpolate,animatedPosition:$t,Extrapolation:A.Extrapolation,animatedAnimationState:de,android_keyboardInputMode:Tt,KEYBOARD_INPUT_MODE:l.KEYBOARD_INPUT_MODE,ANIMATION_STATUS:l.ANIMATION_STATUS,ANIMATION_SOURCE:l.ANIMATION_SOURCE,isInTemporaryPosition:Qt,animatedCurrentIndex:zt}),[Tt,de,Wt,zt,$t,jt,Qt,qt]),Ie=(0,n.useCallback)(function(t,e){if(!Mt)return;const{dynamicDetentIndex:n}=jt.get();Mt(t,e,t===n?l.SNAP_POINT_TYPE.DYNAMIC:l.SNAP_POINT_TYPE.PROVIDED)},[Mt,jt]),ce=(0,n.useCallback)(function(t,e){t!==zt.get()&&Ht&&Ht(zt.value,t,$t.value,e)},[Ht,zt,$t]),Te=(0,n.useCallback)(function(){yt&&yt()},[yt]),Oe=(0,n.useCallback)((function({_worklet_12445268428881_init_data:t,cancelAnimation:e,animatedPosition:n,animatedAnimationState:o,ANIMATION_STATUS:s,ANIMATION_SOURCE:_}){const u=function(){e(n),o.set({status:s.STOPPED,source:_.NONE})};return u.__closure={cancelAnimation:e,animatedPosition:n,animatedAnimationState:o,ANIMATION_STATUS:s,ANIMATION_SOURCE:_},u.__workletHash=0xb51a3cdc851,u.__initData=t,u})({_worklet_12445268428881_init_data:B,cancelAnimation:A.cancelAnimation,animatedPosition:$t,animatedAnimationState:de,ANIMATION_STATUS:l.ANIMATION_STATUS,ANIMATION_SOURCE:l.ANIMATION_SOURCE}),[$t,de]),Ne=(0,n.useCallback)((function({_worklet_6749885698847_init_data:t,animatedAnimationState:e,__DEV__:n,runOnJS:o,print:s,animatedCurrentIndex:_,handleOnChange:u,handleOnClose:A,animatedContainerHeightDidChange:S,didAnimateOnMount:l,ANIMATION_STATUS:I,ANIMATION_SOURCE:c}){const T=function(t){if(!t)return;const{nextIndex:T,nextPosition:O}=e.get();n&&o(s)({component:'BottomSheet',method:'animateToPositionCompleted',params:{currentIndex:_.value,nextIndex:T,nextPosition:O}}),void 0!==T&&void 0!==O&&(T!==_.get()&&o(u)(T,O),-1===T&&o(A)(),_.set(T),S.set(!1),l.set(!0),e.set({status:I.STOPPED,source:c.NONE,nextIndex:void 0,nextPosition:void 0,isForcedClosing:void 0}))};return T.__closure={animatedAnimationState:e,__DEV__:n,runOnJS:o,print:s,animatedCurrentIndex:_,handleOnChange:u,handleOnClose:A,animatedContainerHeightDidChange:S,didAnimateOnMount:l,ANIMATION_STATUS:I,ANIMATION_SOURCE:c},T.__workletHash=6749885698847,T.__initData=t,T})({_worklet_6749885698847_init_data:M,animatedAnimationState:de,__DEV__:!1,runOnJS:A.runOnJS,print:T.print,animatedCurrentIndex:zt,handleOnChange:Ie,handleOnClose:Te,animatedContainerHeightDidChange:te,didAnimateOnMount:Zt,ANIMATION_STATUS:l.ANIMATION_STATUS,ANIMATION_SOURCE:l.ANIMATION_SOURCE}),[Ie,Te,zt,de,te,Zt]),he=(0,n.useCallback)((function({_worklet_7080750884016_init_data:t,__DEV__:e,runOnJS:n,print:o,animatedPosition:s,animatedAnimationState:_,ANIMATION_STATUS:u,stopAnimation:A,animatedKeyboardState:S,animatedSheetState:l,KEYBOARD_STATUS:I,keyboardBehavior:c,KEYBOARD_BEHAVIOR:T,ANIMATION_SOURCE:O,SHEET_STATE:N,animatedDetentsState:h,DEFAULT_KEYBOARD_INDEX:E,_worklet_3054184197869_init_data:P,handleOnAnimate:D,animate:f,_providedAnimationConfigs:C,_providedOverrideReduceMotion:U,animateToPositionCompleted:R}){const x=function(t,x,v=0,p){if(e&&n(o)({component:'BottomSheet',method:'animateToPosition',params:{currentPosition:s.value,nextPosition:t,source:x}}),void 0===t)return;if(t===s.get())return;const{status:B,nextPosition:M}=_.get();if(B===u.RUNNING&&t===M)return;B===u.RUNNING&&A();let y=0;const{status:H,heightWithinContainer:b}=S.get(),L=l.get();H!==I.SHOWN||c===T.extend||![O.KEYBOARD,O.SNAP_POINT_CHANGE].includes(x)&&L!==N.OVER_EXTENDED||(y=b);const{detents:k,closedDetentPosition:K,highestDetentPosition:V}=h.get();let Y=k?.indexOf(t+y)??-1;-1===Y&&H===I.SHOWN&&t!==K&&(void 0!==k&&void 0!==V&&(Y=k.indexOf(V)),-1===Y&&(Y=E)),_.set((function({_worklet_3054184197869_init_data:t,ANIMATION_STATUS:e,source:n,index:o,position:s}){const _=function(t){return Object.assign({},t,{status:e.RUNNING,source:n,nextIndex:o,nextPosition:s})};return _.__closure={ANIMATION_STATUS:e,source:n,index:o,position:s},_.__workletHash=3054184197869,_.__initData=t,_})({_worklet_3054184197869_init_data:P,ANIMATION_STATUS:u,source:x,index:Y,position:t})),n(D)(Y,t),s.value=f({point:t,configs:p||C,velocity:v,overrideReduceMotion:U,onComplete:R})};return x.__closure={__DEV__:e,runOnJS:n,print:o,animatedPosition:s,animatedAnimationState:_,ANIMATION_STATUS:u,stopAnimation:A,animatedKeyboardState:S,animatedSheetState:l,KEYBOARD_STATUS:I,keyboardBehavior:c,KEYBOARD_BEHAVIOR:T,ANIMATION_SOURCE:O,SHEET_STATE:N,animatedDetentsState:h,DEFAULT_KEYBOARD_INDEX:E,_worklet_3054184197869_init_data:P,handleOnAnimate:D,animate:f,_providedAnimationConfigs:C,_providedOverrideReduceMotion:U,animateToPositionCompleted:R},x.__workletHash=7080750884016,x.__initData=t,x})({_worklet_7080750884016_init_data:H,__DEV__:!1,runOnJS:A.runOnJS,print:T.print,animatedPosition:$t,animatedAnimationState:de,ANIMATION_STATUS:l.ANIMATION_STATUS,stopAnimation:Oe,animatedKeyboardState:ie,animatedSheetState:re,KEYBOARD_STATUS:l.KEYBOARD_STATUS,keyboardBehavior:It,KEYBOARD_BEHAVIOR:l.KEYBOARD_BEHAVIOR,ANIMATION_SOURCE:l.ANIMATION_SOURCE,SHEET_STATE:l.SHEET_STATE,animatedDetentsState:jt,DEFAULT_KEYBOARD_INDEX:C.DEFAULT_KEYBOARD_INDEX,_worklet_3054184197869_init_data:y,handleOnAnimate:ce,animate:T.animate,_providedAnimationConfigs:q,_providedOverrideReduceMotion:rt,animateToPositionCompleted:Ne}),[ce,Oe,Ne,It,q,rt,jt,de,ie,$t,re]),Ee=(0,n.useCallback)((function({_worklet_17559292240469_init_data:t,animatedPosition:e,animatedAnimationState:n,ANIMATION_STATUS:o,__DEV__:s,runOnJS:_,print:u,animatedDetentsState:A,_worklet_3650511913251_init_data:S,stopAnimation:l,animatedContainerHeightDidChange:I}){const c=function(t){if(!t)return;if(t===e.get())return;const{status:c,nextPosition:T}=n.get();if(c===o.RUNNING&&t===T)return;s&&_(u)({component:'BottomSheet',method:'setToPosition',params:{currentPosition:e.value,targetPosition:t}});const{detents:O}=A.get(),N=O?.indexOf(t)??-1;n.set((function({_worklet_3650511913251_init_data:t,targetPosition:e,index:n}){const o=function(t){return Object.assign({},t,{nextPosition:e,nextIndex:n})};return o.__closure={targetPosition:e,index:n},o.__workletHash=3650511913251,o.__initData=t,o})({_worklet_3650511913251_init_data:S,targetPosition:t,index:N})),l(),e.value=t,I.value=!1};return c.__closure={animatedPosition:e,animatedAnimationState:n,ANIMATION_STATUS:o,__DEV__:s,runOnJS:_,print:u,animatedDetentsState:A,_worklet_3650511913251_init_data:S,stopAnimation:l,animatedContainerHeightDidChange:I},c.__workletHash=0xff857606255,c.__initData=t,c})({_worklet_17559292240469_init_data:L,animatedPosition:$t,animatedAnimationState:de,ANIMATION_STATUS:l.ANIMATION_STATUS,__DEV__:!1,runOnJS:A.runOnJS,print:T.print,animatedDetentsState:jt,_worklet_3650511913251_init_data:b,stopAnimation:Oe,animatedContainerHeightDidChange:te}),[Oe,$t,te,de,jt]),ge=(0,n.useCallback)((function({_worklet_14289569669057_init_data:t,animatedCurrentIndex:e,animatedDetentsState:n,animatedKeyboardState:o,ANIMATION_SOURCE:s,keyboardBlurBehavior:_,KEYBOARD_BLUR_BEHAVIOR:u,KEYBOARD_STATUS:A,animatedContentGestureState:S,State:l,animatedHandleGestureState:I,isInTemporaryPosition:c,keyboardBehavior:T,KEYBOARD_BEHAVIOR:O,Platform:N,android_keyboardInputMode:h,animatedPosition:E,didAnimateOnMount:P,_providedIndex:D,animatedAnimationState:f,ANIMATION_STATUS:C}){const U=function(t){const N=e.value,{detents:h,highestDetentPosition:U,closedDetentPosition:R}=n.get(),x=o.get().status;if(void 0===h||void 0===U||void 0===R)return;if(t===s.KEYBOARD&&_===u.restore&&x===A.HIDDEN&&S.value!==l.ACTIVE&&I.value!==l.ACTIVE){c.value=!1;return h[N]}if(T===O.extend&&x===A.SHOWN)return U;if(T===O.fillParent&&x===A.SHOWN)return c.value=!0,0;if(T===O.interactive&&x===A.SHOWN){c.value=!0;const t=o.get().heightWithinContainer;return Math.max(0,U-t)}if(c.value)return E.value;if(!P.value)return-1===D?R:h[D];const{status:v,nextIndex:p,nextPosition:B}=f.get();return t===s.SNAP_POINT_CHANGE&&v===C.RUNNING&&void 0!==p&&void 0!==B&&h[p]!==B?h[p]:h[N]};return U.__closure={animatedCurrentIndex:e,animatedDetentsState:n,animatedKeyboardState:o,ANIMATION_SOURCE:s,keyboardBlurBehavior:_,KEYBOARD_BLUR_BEHAVIOR:u,KEYBOARD_STATUS:A,animatedContentGestureState:S,State:l,animatedHandleGestureState:I,isInTemporaryPosition:c,keyboardBehavior:T,KEYBOARD_BEHAVIOR:O,Platform:N,android_keyboardInputMode:h,animatedPosition:E,didAnimateOnMount:P,_providedIndex:D,animatedAnimationState:f,ANIMATION_STATUS:C},U.__workletHash=0xcff0cb95fc1,U.__initData=t,U})({_worklet_14289569669057_init_data:k,animatedCurrentIndex:zt,animatedDetentsState:jt,animatedKeyboardState:ie,ANIMATION_SOURCE:l.ANIMATION_SOURCE,keyboardBlurBehavior:ct,KEYBOARD_BLUR_BEHAVIOR:l.KEYBOARD_BLUR_BEHAVIOR,KEYBOARD_STATUS:l.KEYBOARD_STATUS,animatedContentGestureState:ee,State:u.State,animatedHandleGestureState:ne,isInTemporaryPosition:Qt,keyboardBehavior:It,KEYBOARD_BEHAVIOR:l.KEYBOARD_BEHAVIOR,Platform:s.default,android_keyboardInputMode:Tt,animatedPosition:$t,didAnimateOnMount:Zt,_providedIndex:Q,animatedAnimationState:de,ANIMATION_STATUS:l.ANIMATION_STATUS}),[ee,zt,ne,de,ie,$t,jt,Qt,Zt,It,ct,Q,Tt]),Pe=(0,n.useCallback)((function({_worklet_11430790997000_init_data:t,animatedAnimationState:e,animatedDetentsState:n,ANIMATION_SOURCE:o,isLayoutCalculated:s,getEvaluatedPosition:_,didAnimateOnMount:u,ANIMATION_STATUS:A,animateOnMount:S,animateToPosition:l,setToPosition:I,INITIAL_VALUE:c,isInTemporaryPosition:T,animatedCurrentIndex:O,reduceMotion:N,animatedIndex:h,animatedPosition:E,animatedContainerHeightDidChange:P}){const D=function(t,D){const{status:f,nextIndex:C,isForcedClosing:U}=e.get(),{detents:R,closedDetentPosition:x}=n.get();if(void 0===R||0===R.length||void 0===x)return;if(U&&t!==o.USER)return;if(!s.value)return;const v=_(t);if(void 0!==v)if(u.value){if(f===A.RUNNING){const e=C??c;if(-1===e&&!T.value)return void I(x);if(e!==O.value)return void l(R[e],t,void 0,D)}if(f===A.RUNNING||-1!==O.value)P.value?I(v):l(v,t,void 0,D);else{if(N&&R[h.value]!==E.value)return;I(x)}}else{if(f===A.RUNNING&&(U||-1===C))return;S?l(v,o.MOUNT,void 0,D):(I(v),u.value=!0)}};return D.__closure={animatedAnimationState:e,animatedDetentsState:n,ANIMATION_SOURCE:o,isLayoutCalculated:s,getEvaluatedPosition:_,didAnimateOnMount:u,ANIMATION_STATUS:A,animateOnMount:S,animateToPosition:l,setToPosition:I,INITIAL_VALUE:c,isInTemporaryPosition:T,animatedCurrentIndex:O,reduceMotion:N,animatedIndex:h,animatedPosition:E,animatedContainerHeightDidChange:P},D.__workletHash=0xa65703ca408,D.__initData=t,D})({_worklet_11430790997000_init_data:K,animatedAnimationState:de,animatedDetentsState:jt,ANIMATION_SOURCE:l.ANIMATION_SOURCE,isLayoutCalculated:qt,getEvaluatedPosition:ge,didAnimateOnMount:Zt,ANIMATION_STATUS:l.ANIMATION_STATUS,animateOnMount:et,animateToPosition:he,setToPosition:Ee,INITIAL_VALUE:C.INITIAL_VALUE,isInTemporaryPosition:Qt,animatedCurrentIndex:zt,reduceMotion:se,animatedIndex:le,animatedPosition:$t,animatedContainerHeightDidChange:te}),[ge,he,Ee,se,et,de,te,zt,le,$t,jt,Zt,Qt,qt]),De=(0,c.useStableCallback)(function(t,n){const{detents:o}=jt.get(),s=qt.get();if(void 0===o||0===o.length)return;if(!s)return;(0,e.default)(t>=-1&&t<=o.length-1,"'index' was provided but out of the provided snap points range! expected value to be between -1, "+(o.length-1));const _=o[t],{nextPosition:u,nextIndex:S,isForcedClosing:I}=de.get();qt.value&&t!==S&&_!==u&&!I&&(Qt.value=!1,(0,A.runOnUI)(he)(_,l.ANIMATION_SOURCE.USER,0,n))}),fe=(0,n.useCallback)((function({_worklet_11461861112613_init_data:t,__DEV__:e,print:n,animatedLayoutState:o,normalizeSnapPoint:s,animatedAnimationState:_,isLayoutCalculated:u,isInTemporaryPosition:A,runOnUI:S,animateToPosition:l,ANIMATION_SOURCE:I}){const c=function(t,c){e&&n({component:'BottomSheet',method:'handleSnapToPosition',params:{position:t}});const{containerHeight:T}=o.get(),O=s(t,T),{nextPosition:N,isForcedClosing:h}=_.get();u&&O!==N&&!h&&(A.value=!0,S(l)(O,I.USER,0,c))};return c.__closure={__DEV__:e,print:n,animatedLayoutState:o,normalizeSnapPoint:s,animatedAnimationState:_,isLayoutCalculated:u,isInTemporaryPosition:A,runOnUI:S,animateToPosition:l,ANIMATION_SOURCE:I},c.__workletHash=0xa6cac28fb25,c.__initData=t,c})({_worklet_11461861112613_init_data:V,__DEV__:!1,print:T.print,animatedLayoutState:Wt,normalizeSnapPoint:T.normalizeSnapPoint,animatedAnimationState:de,isLayoutCalculated:qt,isInTemporaryPosition:Qt,runOnUI:A.runOnUI,animateToPosition:he,ANIMATION_SOURCE:l.ANIMATION_SOURCE}),[he,Qt,qt,Wt,de]),Ce=(0,n.useCallback)(function(t){const e=jt.get().closedDetentPosition;if(void 0===e)return;const n=e,{nextPosition:o,isForcedClosing:s}=de.get();qt.value&&n!==o&&!s&&(Qt.value=!1,(0,A.runOnUI)(he)(n,l.ANIMATION_SOURCE.USER,0,t))},[he,qt,Qt,jt,de]),Ue=(0,n.useCallback)(function(t){const e=jt.get().closedDetentPosition;if(void 0===e)return;const n=e,{nextPosition:o,isForcedClosing:s}=de.get();n===o||s||(Qt.value=!1,de.set((function({_worklet_11886015550520_init_data:t}){const e=function(t){return Object.assign({},t,{isForcedClosing:!0})};return e.__closure={},e.__workletHash=0xacf6dbc1438,e.__initData=t,e})({_worklet_11886015550520_init_data:Y})),(0,A.runOnUI)(he)(n,l.ANIMATION_SOURCE.USER,0,t))},[he,Qt,jt,de]),Re=(0,n.useCallback)(function(t){const{detents:e}=jt.get();if(void 0===e||0===e.length)return;const n=e.length-1,o=e[n],{nextPosition:s,nextIndex:_,isForcedClosing:u}=de.get();qt.value&&n!==_&&o!==s&&!u&&(Qt.value=!1,(0,A.runOnUI)(he)(o,l.ANIMATION_SOURCE.USER,0,t))},[he,Qt,qt,jt,de]),xe=(0,n.useCallback)(function(t){const{detents:e}=jt.get();if(void 0===e||0===e.length)return;const n=e[0],{nextPosition:o,nextIndex:s,isForcedClosing:_}=de.get();qt&&0!==s&&n!==o&&!_&&(Qt.value=!1,(0,A.runOnUI)(he)(n,l.ANIMATION_SOURCE.USER,0,t))},[he,qt,Qt,jt,de]);(0,n.useImperativeHandle)(S,()=>({snapToIndex:De,snapToPosition:fe,expand:Re,collapse:xe,close:Ce,forceClose:Ue}));const ve=(0,n.useMemo)(()=>({textInputNodesRef:ae,enableContentPanningGesture:nt,enableDynamicSizing:st,overDragResistanceFactor:dt,enableOverDrag:at,enablePanDownToClose:ot,animatedAnimationState:de,animatedSheetState:re,animatedScrollableState:ue,animatedScrollableStatus:Ae,animatedContentGestureState:ee,animatedHandleGestureState:ne,animatedKeyboardState:ie,animatedLayoutState:Wt,animatedIndex:le,animatedPosition:$t,animatedSheetHeight:Xt,animatedDetentsState:jt,isInTemporaryPosition:Qt,simultaneousHandlers:Ut,waitFor:Rt,activeOffsetX:xt,activeOffsetY:vt,failOffsetX:pt,failOffsetY:Bt,enableBlurKeyboardOnGesture:Ot,animateToPosition:he,stopAnimation:Oe,setScrollableRef:me,removeScrollableRef:Se}),[ae,le,$t,Xt,Wt,ee,ne,de,ie,re,ue,Ae,jt,Qt,nt,dt,at,ot,st,Ot,Ut,Rt,xt,vt,pt,Bt,me,Se,he,Oe]),pe=(0,n.useMemo)(()=>({animatedIndex:le,animatedPosition:$t,snapToIndex:De,snapToPosition:fe,expand:Re,collapse:xe,close:Ce,forceClose:Ue}),[le,$t,De,fe,Re,xe,Ce,Ue]);return(0,A.useAnimatedReaction)((function({_worklet_3740846712338_init_data:t,animatedLayoutState:e}){const n=()=>e.get().containerHeight;return n.__closure={animatedLayoutState:e},n.__workletHash=3740846712338,n.__initData=t,n})({_worklet_3740846712338_init_data:w,animatedLayoutState:Wt}),(function({_worklet_7305691804640_init_data:t,INITIAL_LAYOUT_VALUE:e,animatedContainerHeightDidChange:n,animatedDetentsState:o,animatedAnimationState:s,ANIMATION_STATUS:_,ANIMATION_SOURCE:u,animateToPosition:A}){const S=function(t,S){if(t===e)return;n.value=t!==S;const{closedDetentPosition:l}=o.get();if(void 0===l)return;const{status:I,source:c,nextIndex:T}=s.get();I===_.RUNNING&&c===u.GESTURE&&-1===T&&A(l,u.GESTURE)};return S.__closure={INITIAL_LAYOUT_VALUE:e,animatedContainerHeightDidChange:n,animatedDetentsState:o,animatedAnimationState:s,ANIMATION_STATUS:_,ANIMATION_SOURCE:u,animateToPosition:A},S.__workletHash=7305691804640,S.__initData=t,S})({_worklet_7305691804640_init_data:G,INITIAL_LAYOUT_VALUE:l.INITIAL_LAYOUT_VALUE,animatedContainerHeightDidChange:te,animatedDetentsState:jt,animatedAnimationState:de,ANIMATION_STATUS:l.ANIMATION_STATUS,ANIMATION_SOURCE:l.ANIMATION_SOURCE,animateToPosition:he}),[te,de,jt]),(0,A.useAnimatedReaction)((function({_worklet_2047626166417_init_data:t,animatedDetentsState:e}){const n=()=>e.get().detents;return n.__closure={animatedDetentsState:e},n.__workletHash=2047626166417,n.__initData=t,n})({_worklet_2047626166417_init_data:J,animatedDetentsState:jt}),(function({_worklet_2736065060575_init_data:t,didAnimateOnMount:e,isLayoutCalculated:n,__DEV__:o,runOnJS:s,print:_,evaluatePosition:u,ANIMATION_SOURCE:A}){const S=function(t,S){JSON.stringify(t)===JSON.stringify(S)&&e.value||n.value&&(o&&s(_)({component:'BottomSheet',method:'useAnimatedReaction::OnSnapPointChange',category:'effect',params:{result:t}}),u(A.SNAP_POINT_CHANGE))};return S.__closure={didAnimateOnMount:e,isLayoutCalculated:n,__DEV__:o,runOnJS:s,print:_,evaluatePosition:u,ANIMATION_SOURCE:A},S.__workletHash=2736065060575,S.__initData=t,S})({_worklet_2736065060575_init_data:F,didAnimateOnMount:Zt,isLayoutCalculated:qt,__DEV__:!1,runOnJS:A.runOnJS,print:T.print,evaluatePosition:Pe,ANIMATION_SOURCE:l.ANIMATION_SOURCE}),[qt,Zt,jt]),(0,A.useAnimatedReaction)((function({_worklet_3372124159444_init_data:t,animatedKeyboardState:e}){const n=()=>e.get().status+e.get().height;return n.__closure={animatedKeyboardState:e},n.__workletHash=3372124159444,n.__initData=t,n})({_worklet_3372124159444_init_data:W,animatedKeyboardState:ie}),(function({_worklet_784372441099_init_data:t,animatedKeyboardState:e,KEYBOARD_STATUS:n,animatedAnimationState:o,ANIMATION_STATUS:s,ANIMATION_SOURCE:_,animatedLayoutState:u,$modal:A,bottomInset:S,__DEV__:l,runOnJS:I,print:c,Platform:T,android_keyboardInputMode:O,KEYBOARD_INPUT_MODE:N,keyboardBehavior:h,KEYBOARD_BEHAVIOR:E,animatedContentGestureState:P,State:D,animatedHandleGestureState:f,keyboardBlurBehavior:C,KEYBOARD_BLUR_BEHAVIOR:U,getKeyboardAnimationConfigs:R,evaluatePosition:x}){const v=function(t,T){if(t===T)return;const{status:O,height:N,easing:h,duration:E,target:v}=e.get();if(O===n.UNDETERMINED)return;const{status:p,source:B}=o.get();if(O===n.HIDDEN&&p===s.RUNNING&&B===_.GESTURE)return;const M=u.get().containerOffset;let y=0===N?0:A?Math.abs(N-Math.abs(S-M.bottom)):Math.abs(N-M.bottom);l&&I(c)({component:'BottomSheet',method:'useAnimatedReaction::OnKeyboardStateChange',category:'effect',params:{status:O,height:N,heightWithinContainer:y,containerOffset:M}}),e.set(t=>Object.assign({},t,{heightWithinContainer:y}));if(P.value===D.ACTIVE||P.value===D.BEGAN||f.value===D.ACTIVE||f.value===D.BEGAN)return;if(O===n.HIDDEN&&C===U.none)return;const H=R(h,E);x(_.KEYBOARD,H)};return v.__closure={animatedKeyboardState:e,KEYBOARD_STATUS:n,animatedAnimationState:o,ANIMATION_STATUS:s,ANIMATION_SOURCE:_,animatedLayoutState:u,$modal:A,bottomInset:S,__DEV__:l,runOnJS:I,print:c,Platform:T,android_keyboardInputMode:O,KEYBOARD_INPUT_MODE:N,keyboardBehavior:h,KEYBOARD_BEHAVIOR:E,animatedContentGestureState:P,State:D,animatedHandleGestureState:f,keyboardBlurBehavior:C,KEYBOARD_BLUR_BEHAVIOR:U,getKeyboardAnimationConfigs:R,evaluatePosition:x},v.__workletHash=784372441099,v.__initData=t,v})({_worklet_784372441099_init_data:j,animatedKeyboardState:ie,KEYBOARD_STATUS:l.KEYBOARD_STATUS,animatedAnimationState:de,ANIMATION_STATUS:l.ANIMATION_STATUS,ANIMATION_SOURCE:l.ANIMATION_SOURCE,animatedLayoutState:Wt,$modal:bt,bottomInset:Et,__DEV__:!1,runOnJS:A.runOnJS,print:T.print,Platform:s.default,android_keyboardInputMode:Tt,KEYBOARD_INPUT_MODE:l.KEYBOARD_INPUT_MODE,keyboardBehavior:It,KEYBOARD_BEHAVIOR:l.KEYBOARD_BEHAVIOR,animatedContentGestureState:ee,State:u.State,animatedHandleGestureState:ne,keyboardBlurBehavior:ct,KEYBOARD_BLUR_BEHAVIOR:l.KEYBOARD_BLUR_BEHAVIOR,getKeyboardAnimationConfigs:T.getKeyboardAnimationConfigs,evaluatePosition:Pe}),[bt,Et,It,ct,Tt,ie,Wt,ge]),(0,A.useAnimatedReaction)((function({_worklet_150016498047_init_data:t,animatedPosition:e}){const n=()=>e.value;return n.__closure={animatedPosition:e},n.__workletHash=150016498047,n.__initData=t,n})({_worklet_150016498047_init_data:X,animatedPosition:$t}),(function({_worklet_14307923316202_init_data:t,_providedAnimatedPosition:e,topInset:n}){const o=function(t){e&&(e.value=t+n)};return o.__closure={_providedAnimatedPosition:e,topInset:n},o.__workletHash=0xd0352afcdea,o.__initData=t,o})({_worklet_14307923316202_init_data:z,_providedAnimatedPosition:ft,topInset:ht}),[ft,ht]),(0,A.useAnimatedReaction)((function({_worklet_1413329246429_init_data:t,animatedIndex:e}){const n=()=>e.value;return n.__closure={animatedIndex:e},n.__workletHash=1413329246429,n.__initData=t,n})({_worklet_1413329246429_init_data:$,animatedIndex:le}),(function({_worklet_11790345600748_init_data:t,_providedAnimatedIndex:e}){const n=function(t){e&&(e.value=t)};return n.__closure={_providedAnimatedIndex:e},n.__workletHash=0xab9275c7eec,n.__initData=t,n})({_worklet_11790345600748_init_data:Z,_providedAnimatedIndex:Ct}),[Ct]),(0,n.useEffect)(()=>{et&&!Zt.value||De(Q)},[et,Q,Zt,De]),(0,U.jsx)(I.BottomSheetProvider,{value:pe,children:(0,U.jsx)(I.BottomSheetInternalProvider,{value:ve,children:(0,U.jsxs)(h.default,{gestureEventsHandlersHook:lt,children:[Kt?(0,U.jsx)(Kt,{animatedIndex:le,animatedPosition:$t,style:_.default.absoluteFill}):null,(0,U.jsx)(P.BottomSheetHostingContainer,{shouldCalculateHeight:!bt,layoutState:Wt,containerLayoutState:Nt,topInset:ht,bottomInset:Et,detached:Lt,style:ut,children:(0,U.jsxs)(D.BottomSheetBody,{style:_t,children:[null===Vt?null:(0,U.jsx)(O.BottomSheetBackgroundContainer,{animatedIndex:le,animatedPosition:$t,backgroundComponent:Vt,backgroundStyle:At},"BottomSheetBackgroundContainer"),(0,U.jsxs)(f.BottomSheetContent,{pointerEvents:"box-none",accessible:Gt??void 0,accessibilityRole:Ft??void 0,accessibilityLabel:Jt??void 0,keyboardBehavior:It,detached:Lt,children:[wt,Yt?(0,U.jsx)(N.BottomSheetFooterContainer,{footerComponent:Yt}):null]}),null!==kt?(0,U.jsx)(E.BottomSheetHandleContainer,{animatedIndex:le,animatedPosition:$t,enableHandlePanningGesture:it,enableOverDrag:at,enablePanDownToClose:ot,overDragResistanceFactor:dt,keyboardBehavior:It,handleComponent:kt,handleStyle:mt,handleIndicatorStyle:St},"BottomSheetHandleContainer"):null]})},"BottomSheetContainer")]})})})}),Q=(0,n.memo)(q);Q.displayName='BottomSheet';var tt=Q},3036,[43,37,184,26,60,3037,899,3166,3167,3173,3179,3203,3207,3211,3213,3218,3221,3223,3198,280]);
|
|
@@ -15169,7 +15169,7 @@ __d(function(g,r,i,_a,m,e,d){'use strict';const t=r(d[0]);m.exports=(s,c,n)=>t(s
|
|
|
15169
15169
|
__d(function(g,r,i,_a,m,e,d){'use strict';const t=r(d[0]);m.exports=(s,c,n)=>t(s,c,n)<=0},3524,[2992]);
|
|
15170
15170
|
__d(function(g,r,i,a,m,e,d){'use strict';const t=r(d[0]);m.exports=(n,c,s)=>{try{c=new t(c,s)}catch(t){return!1}return c.test(n)}},3525,[3516]);
|
|
15171
15171
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.resolveAppVersion=function(){const e=u(t.default?.version);if(e)return e;const o=u(n.default.expoConfig?.version);if(o)return o;const f=u(n.default.manifest?.version);if(f)return f;return null};var n=e(r(d[0])),t=e(r(d[1]));function u(e){if("string"!=typeof e)return null;const n=e.trim();return 0===n.length?null:n}},3526,[702,3527]);
|
|
15172
|
-
__d(function(e,t,r,o,i,a,n){i.exports={name:"@getpaseo/app",version:"0.11.0-fork.
|
|
15172
|
+
__d(function(e,t,r,o,i,a,n){i.exports={name:"@getpaseo/app",version:"0.11.0-fork.27",private:!0,main:"index.ts",scripts:{start:"npm run start:expo","start:expo":"cross-env APP_VARIANT=development expo start","reset-project":"node ./scripts/reset-project.js","eas-build-post-install":"npm --prefix ../.. run build:app-deps && npm run build:terminal-webview",android:"npm run android:development","android:development":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=development expo prebuild --platform android --clean --non-interactive && cross-env APP_VARIANT=development expo run:android --variant=debug","android:production":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=production expo prebuild --platform android --clean --non-interactive && cross-env APP_VARIANT=production expo run:android --variant=release","android:release":"npm run android:production","android:clear":"node -e \"require('node:fs').rmSync('android', { recursive: true, force: true })\"",ios:"npm --prefix ../.. run build:client && expo run:ios","ios:release":"npm --prefix ../.. run build:client && expo run:ios --configuration Release",web:"npm --prefix ../.. run build:client && concurrently --kill-others --names protocol,client,expo --prefix-colors yellow,blue,magenta \"npm --prefix ../.. run watch:protocol\" \"npm --prefix ../.. run watch:client\" \"npm run web:expo\"","web:expo":"expo start --web",lint:"expo lint",typecheck:"tsgo --noEmit",test:"vitest run","test:browser":"vitest run --project browser","test:e2e":"playwright test --project=browser","test:e2e:diff-performance":"cross-env PASEO_DIFF_PERF_E2E=1 playwright test --project=browser e2e/browser/diff-performance.spec.ts","test:e2e:stream-smoothness":"cross-env PASEO_AGENT_STREAM_PERF_E2E=1 playwright test --project=browser e2e/browser/agent-stream-smoothness.spec.ts","test:e2e:real":"cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=real-provider","test:e2e:relay-deployment":"npm --prefix ../.. run build:server && npm --prefix ../.. run build:daemon-web-ui && cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=relay-deployment e2e/browser/relay-deployment-reconnect.real.spec.ts","test:e2e:ui":"playwright test --ui",build:"npm run build:web","build:web":"npm --prefix ../.. run build:app-deps && expo export --platform web","profile:composer-typing":"node ./scripts/profile-composer-typing.mjs","profile:explorer-toggle":"node ./scripts/profile-explorer-toggle.mjs","profile:side-pane":"playwright test --config playwright.profile.config.ts side-pane-performance.spec.ts","profile:workspace-switching":"node ./scripts/profile-workspace-switching.mjs","profile:workspace-tabs":"node ./scripts/profile-workspace-tabs.mjs","deploy:web":"npm run build:web && wrangler pages deploy dist --project-name paseo-app --branch main","build:terminal-webview":"node ./scripts/build-terminal-webview-html.mjs","build:mermaid-runtime":"node ./src/components/markdown/fence/mermaid/build-runtime.mjs"},dependencies:{"@codemirror/commands":"6.10.4","@codemirror/language":"6.12.4","@codemirror/search":"6.7.1","@codemirror/state":"6.7.1","@codemirror/view":"6.43.6","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@floating-ui/react-native":"^0.10.7","@getpaseo/client":"*","@getpaseo/expo-two-way-audio":"*","@getpaseo/highlight":"*","@getpaseo/plugin":"*","@getpaseo/protocol":"*","@gorhom/bottom-sheet":"^5.2.14","@gorhom/portal":"^1.0.14","@marijn/find-cluster-break":"^1.0.2","@mattermost/react-native-paste-input":"2.0.1","@react-native-async-storage/async-storage":"2.2.0","@react-native-masked-view/masked-view":"^0.3.2","@react-native/normalize-colors":"^0.81.5","@react-navigation/native":"^7.1.8","@replit/codemirror-vim":"6.3.0","@shopify/react-native-skia":"2.2.12","@tanstack/react-query":"^5.90.11","@tanstack/react-virtual":"^3.13.21","@xterm/addon-clipboard":"^0.3.0-beta.213","@xterm/addon-fit":"^0.12.0-beta.213","@xterm/addon-image":"^0.10.0-beta.213","@xterm/addon-ligatures":"^0.11.0-beta.213","@xterm/addon-search":"^0.17.0-beta.213","@xterm/addon-unicode11":"^0.10.0-beta.213","@xterm/addon-web-links":"^0.13.0-beta.213","@xterm/addon-webgl":"^0.20.0-beta.212","@xterm/xterm":"^6.1.0-beta.213",buffer:"^6.0.3",expo:"^54.0.18","expo-asset":"~12.0.12","expo-audio":"~1.0.13","expo-build-properties":"^1.0.9","expo-camera":"~17.0.10","expo-clipboard":"~8.0.7","expo-constants":"~18.0.9","expo-crypto":"^15.0.8","expo-dev-client":"^6.0.15","expo-document-picker":"~14.0.8","expo-file-system":"~19.0.17","expo-haptics":"~15.0.7","expo-image":"~3.0.10","expo-image-manipulator":"~14.0.8","expo-image-picker":"^17.0.8","expo-keep-awake":"^15.0.7","expo-linking":"~8.0.8","expo-localization":"~17.0.9","expo-notifications":"^0.32.16","expo-router":"~6.0.13","expo-sharing":"^14.0.8","expo-splash-screen":"~31.0.10","expo-sqlite":"~16.0.10","expo-system-ui":"~6.0.7","fast-deep-equal":"^3.1.3",htmlparser2:"^12.0.0",i18next:"^26.3.0","lucide-react-native":"^0.546.0","markdown-it":"^10.0.0",mermaid:"^11.16.0","mnemonic-id":"^3.2.7",qrcode:"^1.5.4",react:"19.1.0","react-dom":"19.1.0","react-freeze":"1.0.4","react-i18next":"^17.0.8","react-native":"0.81.5","react-native-draggable-flatlist":"^4.0.3","react-native-edge-to-edge":"^1.7.0","react-native-gesture-handler":"~2.28.0","react-native-keyboard-controller":"1.21.12","react-native-markdown-display":"^7.0.2","react-native-nitro-modules":"0.35.5","react-native-reanimated":"~4.3.1","react-native-safe-area-context":"~5.6.0","react-native-screens":"~4.16.0","react-native-svg":"^15.14.0","react-native-uitextview":"^2.2.0","react-native-unistyles":"^3.2.4","react-native-web":"~0.21.0","react-native-webview":"^13.16.0","react-native-worklets":"~0.8.3","tiny-invariant":"^1.3.3",turndown:"^7.2.4","turndown-plugin-gfm":"^1.0.2","use-sync-external-store":"^1.6.0",yaml:"^2.8.4",zod:"^4.4.3",zustand:"^5.0.9"},devDependencies:{"@playwright/test":"^1.56.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/markdown-it":"^14.1.2","@types/node":"~22.19.0","@types/qrcode":"^1.5.6","@types/react":"~19.2.0","@types/turndown":"^5.0.6","@types/ws":"^8.18.1","@vitest/browser":"^4.1.7","@vitest/browser-playwright":"^4.1.7","@xterm/headless":"^6.1.0-beta.213",dotenv:"^17.2.3","eas-cli":"^16.24.1",esbuild:"0.28.1",eslint:"^9.25.0","eslint-config-expo":"~10.0.0","expo-gradle-jvmargs":"^1.1.2","fake-indexeddb":"^6.2.5",jsdom:"^20.0.3","material-icon-theme":"^5.32.0",playwright:"^1.56.1","serve-sim":"^0.1.40",typescript:"~5.9.2",vitest:"^4.1.6",wrangler:"^4.105.0",ws:"^8.20.0"},reanimated:{staticFeatureFlags:{FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS:!1}}}},3527,[]);
|
|
15173
15173
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createPluginClientRuntime=function(p){const I=(0,l.createPluginClientStateSource)(p.serverId),P=(0,o.createPluginCapabilities)(p,(0,s.createPluginNavigation)({serverId:p.serverId,workspaceId:null}));return Object.assign({},P,{hosts:(0,n.createPluginHosts)((0,t.getHostRuntimeStore)(),p.lifetime.signal),addComposerPill:t=>u.pluginButtonStore.addComposerPill(p,t),addHeaderButton:t=>u.pluginButtonStore.addHeaderButton(p,t),openPanel(t,n){c({installation:p,state:I,panelId:t,options:n})}})};var t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),s=r(d[4]),u=r(d[5]);function c(t){const{installation:n,state:l,panelId:u,options:c}=t,p=c.workspaceId.trim(),I=c.agentId?.trim(),P=(0,s.createPluginNavigation)({serverId:n.serverId,workspaceId:p}),v=I?(0,o.createPluginAgentActionContext)({plugin:n,navigation:P,state:l,workspaceId:p,agentId:I}):(0,o.createPluginWorkspaceActionContext)({plugin:n,navigation:P,state:l,workspaceId:p});if(!v)throw new Error("Plugin panel context is unavailable");v.openPanel(u,{location:c.location})}},3528,[3529,3652,3653,3664,3669,3680]);
|
|
15174
15174
|
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["password"];function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.isHostRuntimeConnected=te,_e.isHostRuntimeDirectoryLoading=ne,Object.defineProperty(_e,"HostRuntimeController",{enumerable:!0,get:function(){return ye}}),_e.readInitialDaemonConnectionHint=be,_e.hasConfiguredLocalDaemonOverride=function(){return null!==we()},Object.defineProperty(_e,"HostRuntimeStore",{enumerable:!0,get:function(){return De}}),_e.getHostRuntimeStore=Pe,_e.getHostRuntimeConnectionStatusSince=function(e){return Pe().getConnectionStatusSince(e)},_e.useHostRuntimeSnapshot=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>o.getSnapshot(e),u=()=>o.getSnapshot(e),t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeClient=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>o.getSnapshot(e)?.client??null,u=()=>o.getSnapshot(e)?.client??null,t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeIsConnected=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>te(o.getSnapshot(e)),u=()=>te(o.getSnapshot(e)),t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeConnectionStatus=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>o.getSnapshot(e)?.connectionStatus??"connecting",u=()=>o.getSnapshot(e)?.connectionStatus??"connecting",t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeConnectionStatuses=function(e){const t=(0,s.c)(7);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c;t[1]!==e?(c=()=>e.map(e=>o.getSnapshot(e)?.connectionStatus??"connecting").join("\n"),t[1]=e,t[2]=c):c=t[2];const h=c;let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=e=>o.subscribeAll(e),t[3]=u):u=t[3];const p=(0,l.useSyncExternalStore)(u,h,h);let y;if(t[4]!==e||t[5]!==p){const n=p.split("\n");y=new Map(e.map((e,t)=>[e,n[t]])),t[4]=e,t[5]=p,t[6]=y}else y=t[6];return y},_e.useHostRuntimeLastError=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>o.getSnapshot(e)?.lastError??null,u=()=>o.getSnapshot(e)?.lastError??null,t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeAgentDirectoryStatus=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>o.getSnapshot(e)?.agentDirectoryStatus??"idle",u=()=>o.getSnapshot(e)?.agentDirectoryStatus??"idle",t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeIsDirectoryLoading=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>ne(o.getSnapshot(e)),u=()=>ne(o.getSnapshot(e)),t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHosts=function(){const e=(0,s.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Pe(),e[0]=t):t=e[0];const n=t;let o,c,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=e=>n.subscribeHostList(e),c=()=>n.getHosts(),h=()=>n.getHosts(),e[1]=o,e[2]=c,e[3]=h):(o=e[1],c=e[2],h=e[3]);return(0,l.useSyncExternalStore)(o,c,h)},_e.useHostRegistryStatus=function(){const e=(0,s.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Pe(),e[0]=t):t=e[0];const n=t;let o,c,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=e=>n.subscribeHostList(e),c=()=>n.getHostRegistryStatus(),h=()=>n.getHostRegistryStatus(),e[1]=o,e[2]=c,e[3]=h):(o=e[1],c=e[2],h=e[3]);return(0,l.useSyncExternalStore)(o,c,h)},_e.useHostRegistryLoaded=function(){const e=(0,s.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Pe(),e[0]=t):t=e[0];const n=t;let o,c,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=e=>n.subscribeHostList(e),c=()=>n.isHostRegistryLoaded(),h=()=>n.isHostRegistryLoaded(),e[1]=o,e[2]=c,e[3]=h):(o=e[1],c=e[2],h=e[3]);return(0,l.useSyncExternalStore)(o,c,h)},_e.useHostConfirmation=function(){const e=(0,s.c)(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Pe(),e[0]=t):t=e[0];const n=t;let o,c,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=e=>n.subscribeHostConfirmation(e),c=()=>n.getPendingHostConfirmation(),h=()=>n.getPendingHostConfirmation(),e[1]=o,e[2]=c,e[3]=h):(o=e[1],c=e[2],h=e[3]);const u=(0,l.useSyncExternalStore)(o,c,h);let p,y;e[4]!==u?(p=e=>{u&&n.answerHostConfirmation(u.id,e)},e[4]=u,e[5]=p):p=e[5];e[6]!==u||e[7]!==p?(y={pending:u,answer:p},e[6]=u,e[7]=p,e[8]=y):y=e[8];return y},_e.useHostMutations=function(){const e=(0,s.c)(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Pe(),e[0]=t):t=e[0];const n=t;let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={upsertDirectConnection:e=>n.upsertDirectConnection(e),probeAndUpsertDirectConnection:e=>n.probeAndUpsertDirectConnection(e),probeAndUpsertRemoteSshConnection:e=>n.probeAndUpsertRemoteSshConnection(e),beginLinkPairing:()=>n.beginLinkPairing(),renameHost:(e,t)=>n.renameHost(e,t),setHostColor:(e,t)=>n.setHostColor(e,t),setHostBadgeDisplay:(e,t)=>n.setHostBadgeDisplay(e,t),removeHost:e=>n.removeHost(e),removeConnection:(e,t)=>n.removeConnection(e,t)},e[1]=o):o=e[1];return o};var n=t(r(d[0])),s=r(d[1]),o=r(d[2]),c=r(d[3]),l=r(d[4]),h=t(r(d[5])),u=t(r(d[6])),p=r(d[7]),y=r(d[8]),S=r(d[9]),f=r(d[10]),C=r(d[11]),v=r(d[12]),b=r(d[13]),w=r(d[14]),I=r(d[15]),A=r(d[16]),H=r(d[17]),R=r(d[18]),D=r(d[19]),E=r(d[20]),L=r(d[21]),P=r(d[22]),O=r(d[23]),_=r(d[24]),M=r(d[25]),k=r(d[26]),T=r(d[27]),B=r(d[28]),F=r(d[29]),j=r(d[30]),q=r(d[31]),x=r(d[32]),U=r(d[33]),V=r(d[34]),W=r(d[35]),N=r(d[36]),$=r(d[37]),G=r(d[38]),z=r(d[39]),K=r(d[40]),Q=r(d[41]),J=r(d[42]),X=r(d[43]),Y=r(d[44]),Z=r(d[45]);function ee(e,t,n){e[t]=n}function te(e){return"online"===e?.connectionStatus}function ne(e){return!e||("initial_loading"===e.agentDirectoryStatus||"revalidating"===e.agentDirectoryStatus||!e.hasEverLoadedAgentDirectory&&("connecting"===e.connectionStatus||"online"===e.connectionStatus))}function se(e){return e instanceof Error?e.message:String(e)}function ie(e){let t=0;for(let n=0;n<e.length;n+=1)t=31*t+e.charCodeAt(n)|0;return`h_${Math.abs(t).toString(16)}`}function oe(e){return"directSocket"===e.type?{type:"directSocket",endpoint:e.path,display:"socket"}:"directPipe"===e.type?{type:"directPipe",endpoint:e.path,display:"pipe"}:"remoteSsh"===e.type?{type:"remoteSsh",endpoint:e.host,display:e.host}:"directTcp"===e.type?{type:"directTcp",endpoint:e.endpoint,display:e.endpoint}:{type:"relay",endpoint:e.relayEndpoint,display:"relay"}}function re(e){return"connecting"===e.tag||"online"===e.tag||"offline"===e.tag||"error"===e.tag?{id:e.activeConnectionId,connection:e.activeConnection}:{id:null,connection:null}}function ce(e,t,n){const s=n.state.status;return"connected"===s?{tag:"online",activeConnectionId:e,activeConnection:t,lastOnlineAt:(new Date).toISOString()}:"connecting"===s||"idle"===s?{tag:"connecting",activeConnectionId:e,activeConnection:t}:"disposed"===s?{tag:"offline",activeConnectionId:e,activeConnection:t}:null}function ae(e,t,n){const s=ce(e,t,n);if(s)return s;const o=("disconnected"===n.state.status?n.state.reason??null:null)??n.lastError??null;return o&&"client_closed"!==o?{tag:"error",activeConnectionId:e,activeConnection:t,message:o}:{tag:"offline",activeConnectionId:e,activeConnection:t}}function le(e){const{state:t,event:n}=e;if("select_connection"===n.type)return{tag:"connecting",activeConnectionId:n.connectionId,activeConnection:n.connection};if("connect_failed"===n.type){const e=re(t);return{tag:"error",activeConnectionId:e.id,activeConnection:e.connection,message:n.message}}if("no_connections"===n.type||"stopped"===n.type)return{tag:"offline",activeConnectionId:null,activeConnection:null};const s=re(t);return s.id&&s.connection?ae(s.id,s.connection,n):"booting"===t.tag?t:{tag:"offline",activeConnectionId:null,activeConnection:null}}function he(e,t){return"booting"===e.tag?{activeConnectionId:null,activeConnection:null,connectionStatus:"connecting",lastError:null,lastOnlineAt:null,connectionEpoch:t}:"connecting"===e.tag?{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"connecting",lastError:null,lastOnlineAt:null,connectionEpoch:t}:"online"===e.tag?{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"online",lastError:null,lastOnlineAt:e.lastOnlineAt,connectionEpoch:t}:"offline"===e.tag?{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"offline",lastError:null,lastOnlineAt:null,connectionEpoch:t}:{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"error",lastError:e.message,lastOnlineAt:null,connectionEpoch:t}}function de(e){return e.connections.map(e=>({connectionId:e.id,connection:e}))}function ue(e,t){return t?e.connections.find(e=>e.id===t)??null:null}function pe(e,t,n,s){if(t)return 1e4;if(n)return 12e4;const o=s-e;return o<1e4?2e3:o<3e4?5e3:o<6e4?1e4:3e4}function ge(){const e="function"==typeof(0,P.getDesktopHost)()?.browser?.executeAutomationCommand?{[_.CLIENT_CAPS.browserHost]:{supportedCommands:[...M.BROWSER_AUTOMATION_COMMAND_NAMES],hostKind:"desktop app"}}:void 0,t=Object.assign({},e);return{createClient:({host:e,connection:n,clientId:s,runtimeGeneration:l})=>{const h=(0,L.createDesktopDaemonTransportFactory)(),u={webSocketFactory:(0,Z.createAppWebSocketFactory)()},y=Object.assign({suppressSendErrors:!0,clientId:s,clientType:"mobile",appVersion:(0,C.resolveAppVersion)()??void 0,deviceLabel:o.getAppDeviceLabel,deviceKind:(0,o.getAppDeviceKind)(),connectionTransport:"remoteSsh"===n.type?c.ConnectionTransport.SshTunnel:void 0,runtimeGeneration:l,capabilities:t,trace:X.nativePerformanceTrace,providerSnapshots:"wire"},e.password?{password:e.password}:{},{localCredential:()=>(0,O.readDesktopManagedLocalCredential)(n)});if("directSocket"===n.type||"directPipe"===n.type)return new p.DaemonClient(Object.assign({},y,h?{transportFactory:h}:{},{url:(0,L.buildDesktopDaemonTransportUrl)({transportType:"directSocket"===n.type?"socket":"pipe",transportPath:n.path})}));if("remoteSsh"===n.type){if(!h)throw new Error("Remote SSH is only available in the desktop app.");return new p.DaemonClient(Object.assign({},y,{transportFactory:h,url:(0,L.buildDesktopDaemonTransportUrl)(Object.assign({transportType:"ssh",host:n.host},void 0!==n.sshPort?{sshPort:n.sshPort}:{},void 0!==n.daemonPort?{daemonPort:n.daemonPort}:{}))}))}return"directTcp"===n.type?new p.DaemonClient(Object.assign({},y,u,{url:(0,f.buildDaemonWebSocketUrl)(n.endpoint,{useTls:n.useTls??!1})})):new p.DaemonClient(Object.assign({},y,u,{url:(0,f.buildRelayWebSocketUrl)({endpoint:n.relayEndpoint,useTls:n.useTls??(0,f.shouldUseTlsForDefaultHostedRelay)(n.relayEndpoint),serverId:e.serverId}),e2ee:{enabled:!0,daemonPublicKeyB64:n.daemonPublicKeyB64}}))},connectToDaemon:({host:e,connection:n,timeoutMs:s})=>(0,A.connectToDaemon)(n,Object.assign({},e.serverId?{serverId:e.serverId}:{},e.password?{password:e.password}:{},{localCredential:()=>(0,O.readDesktopManagedLocalCredential)(n)},void 0!==s?{timeoutMs:s}:{},{capabilities:t,trace:X.nativePerformanceTrace})),getClientId:()=>(0,H.getOrCreateClientId)(),mountClientHandlers:({client:t,host:n})=>{const s=(0,j.mountServerDataPushRouter)({client:t,queryClient:F.queryClient,serverId:n.serverId});if(!e)return s;const o=(0,q.mountBrowserAutomationDaemonClientHandler)(t,{serverId:n.serverId});return()=>{o(),s()}}}}class ye{connectionEpoch=0;listeners=new Set;activeClient=null;unsubscribeClientStatus=null;unsubscribeClientHandlers=null;probeIntervalHandle=null;started=!1;connectionFirstSeenAt=new Map;connectionLastProbedAt=new Map;switchCandidateConnectionId=null;switchCandidateHitCount=0;clientIdPromise=null;clientIdHash=null;switchRequestVersion=0;probeRequestVersion=0;probeCycleInFlight=null;authRejectedConnectionIds=new Set;constructor(e){this.host=e.host,this.deps=e.deps??ge(),this.onReconcileServerId=e.onReconcileServerId??null,this.connectionMachineState={tag:"booting"},this.snapshot=Object.assign({serverId:this.host.serverId},he(this.connectionMachineState,this.connectionEpoch),{client:null,agentDirectoryStatus:"idle",agentDirectoryError:null,hasEverLoadedAgentDirectory:!1,probeByConnectionId:new Map,clientGeneration:0})}getSnapshot(){return this.snapshot}getClient(){return this.snapshot.client}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}async start(e){this.started||(this.started=!0,this.trackConnectionFirstSeen(),e?.initialConnection&&(await this.switchToConnection({connectionId:e.initialConnection.connectionId,existingClient:e.initialConnection.existingClient}),!this.started)||(await this.runProbeCycleNow(),this.started&&!1!==e?.autoProbe&&(this.probeIntervalHandle=setInterval(()=>{this.runProbeCycleNow()},2e3))))}async stop(){if(this.switchRequestVersion+=1,this.probeRequestVersion+=1,this.started=!1,this.probeIntervalHandle&&(clearInterval(this.probeIntervalHandle),this.probeIntervalHandle=null),this.unsubscribeClientStatus&&(this.unsubscribeClientStatus(),this.unsubscribeClientStatus=null),this.unsubscribeClientHandlers&&(this.unsubscribeClientHandlers(),this.unsubscribeClientHandlers=null),this.activeClient){const e=this.activeClient;this.activeClient=null,await e.close().catch(()=>{})}this.applyConnectionEvent({type:"stopped"}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),{client:null}))}async updateHost(e){const t=this.host.password!==e.password;t&&(this.probeRequestVersion+=1,this.authRejectedConnectionIds.clear(),this.updateSnapshot({authFailureReason:null}));const n=this.snapshot.activeConnectionId,s=ue(this.host,n);this.host=e,this.trackConnectionFirstSeen();const o=ue(this.host,n);n&&s&&o&&(!(0,u.default)(s,o)||t)&&(this.connectionLastProbedAt.delete(n),await this.switchToConnection({connectionId:n})),t&&this.connectionLastProbedAt.clear(),t&&await this.probeCycleInFlight,await this.runProbeCycleNow()}ensureConnected(e){this.activeClient?.ensureConnected(e)}markAgentDirectorySyncLoading(){const e=this.snapshot.hasEverLoadedAgentDirectory?"revalidating":"initial_loading";this.updateSnapshot({agentDirectoryStatus:e,agentDirectoryError:null})}markAgentDirectorySyncReady(){this.updateSnapshot({agentDirectoryStatus:"ready",agentDirectoryError:null,hasEverLoadedAgentDirectory:!0})}markAgentDirectorySyncError(e){const t=this.snapshot.hasEverLoadedAgentDirectory;this.updateSnapshot({agentDirectoryStatus:t?"error_after_ready":"error_before_first_success",agentDirectoryError:e,hasEverLoadedAgentDirectory:t})}markAgentDirectorySyncIdle(){this.updateSnapshot({agentDirectoryStatus:this.snapshot.hasEverLoadedAgentDirectory?"ready":"idle",agentDirectoryError:null})}markStartupError(e){this.applyConnectionEvent({type:"connect_failed",message:e}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch)))}async activateConnection(e){await this.switchToConnection(e)}async runProbeCycleNow(){if(this.probeCycleInFlight)return this.probeCycleInFlight;const e=this.runProbeCycle().finally(()=>{this.probeCycleInFlight===e&&(this.probeCycleInFlight=null)});return this.probeCycleInFlight=e,e}async runProbeCycle(){const e=++this.probeRequestVersion;if(0===this.host.connections.length){if(!this.isCurrentProbeRequest(e))return;return this.applyConnectionEvent({type:"no_connections"}),void this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),{probeByConnectionId:new Map}))}const t=performance.now(),n="online"===this.snapshot.connectionStatus,s=this.snapshot.activeConnectionId,o=n&&null!==s,c=this.host.connections.filter(e=>{if(this.authRejectedConnectionIds.has(e.id))return!1;const c=this.connectionLastProbedAt.get(e.id);if(null==c)return!0;const l=pe(this.connectionFirstSeenAt.get(e.id)??t,n&&e.id===s,o,t);return t-c>=l});if(0===c.length)return;const l=new Map(this.snapshot.probeByConnectionId);for(const e of c){this.connectionLastProbedAt.set(e.id,performance.now());const t=l.get(e.id);n&&e.id===s&&"available"===t?.status||l.set(e.id,{status:"pending",latencyMs:null})}this.updateSnapshot({probeByConnectionId:new Map(l)});let h=c.length,u=null,y=null;const S=()=>{this.isCurrentProbeRequest(e)&&this.updateSnapshot({probeByConnectionId:new Map(l)})},f=async(t,n)=>{for(;!this.snapshot.activeConnectionId;){if(!y)return y=this.switchToConnection({connectionId:t,expectedProbeVersion:e,existingClient:n}).finally(()=>{y=null}),await y,this.snapshot.activeConnectionId===t;await y}return!1},C=async()=>{if(h>0||!this.isCurrentProbeRequest(e))return;const t=this.snapshot.activeConnectionId,n=t?l.get(t):null;if(!t||!ue(this.host,t)){const t=(0,E.selectBestConnection)({candidates:de(this.host),probeByConnectionId:l});if(t)await this.switchToConnection({connectionId:t,expectedProbeVersion:e});else if(u){const e=new p.DaemonAuthenticationError(u).message;this.applyConnectionEvent({type:"connect_failed",message:e}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),{authFailureReason:u}))}return}if(this.isConnectionUnavailable(t,n)){const n=(0,E.selectBestConnection)({candidates:de(this.host),probeByConnectionId:l});return n&&n!==t&&await this.switchToConnection({connectionId:n,expectedProbeVersion:e}),this.switchCandidateConnectionId=null,void(this.switchCandidateHitCount=0)}if(!n||"available"!==n.status)return;const s=Array.from(l.entries()).filter(e=>"available"===e[1].status).map(([e,t])=>({connectionId:e,latencyMs:t.latencyMs})).sort((e,t)=>e.latencyMs-t.latencyMs)[0]??null;if(!s||s.connectionId===t)return this.switchCandidateConnectionId=null,void(this.switchCandidateHitCount=0);if(n.latencyMs-s.latencyMs<40)return this.switchCandidateConnectionId=null,void(this.switchCandidateHitCount=0);this.switchCandidateConnectionId===s.connectionId?this.switchCandidateHitCount+=1:(this.switchCandidateConnectionId=s.connectionId,this.switchCandidateHitCount=1),this.switchCandidateHitCount>=3&&(this.switchCandidateConnectionId=null,this.switchCandidateHitCount=0,await this.switchToConnection({connectionId:s.connectionId,expectedProbeVersion:e}))};await new Promise(t=>{for(const n of c)(async()=>{let s=null,o=!1;try{const t=this.snapshot.activeConnectionId===n.id?this.snapshot.client:null;if(t)s=t;else{const{client:e,serverId:t}=await this.deps.connectToDaemon({host:this.host,connection:n});if(t!==this.host.serverId){if(!Ae(this.host.serverId)||!this.onReconcileServerId)throw await e.close().catch(()=>{}),new Error(`Connection resolved to ${t}, expected ${this.host.serverId}.`);this.onReconcileServerId(this.host.serverId,t)}s=e,o=!0}if(!this.isCurrentProbeRequest(e))return;const c=await f(n.id,s);if(o=o&&!c,t){const s=t.getLastLivenessRttMs();if(!this.isCurrentProbeRequest(e))return;return void(null!==s&&(l.set(n.id,{status:"available",latencyMs:s}),S()))}const h=await s.measureLatency({timeoutMs:5e3});if(!this.isCurrentProbeRequest(e))return;l.set(n.id,{status:"available",latencyMs:h}),S()}catch(t){if(this.isCurrentProbeRequest(e)){const e=(0,A.getConnectionAuthFailureReason)(t);e&&(this.authRejectedConnectionIds.add(n.id),u=e),l.set(n.id,{status:"unavailable",latencyMs:null}),S()}}finally{s&&o&&await s.close().catch(()=>{}),h-=1,C().finally(()=>{0===h&&t()})}})()})}isConnectionUnavailable(e,t){return"unavailable"===t?.status||this.authRejectedConnectionIds.has(e)}updateSnapshot(e){const t=Object.assign({},e);let n=this.host.serverId!==this.snapshot.serverId;for(const s of Object.keys(e)){const o=e[s];(0,u.default)(this.snapshot[s],o)?ee(t,s,this.snapshot[s]):n=!0}if(n){this.snapshot=Object.assign({},this.snapshot,t,{serverId:this.host.serverId});for(const e of this.listeners)e()}}applyConnectionEvent(e){const t=this.connectionMachineState,n=le({state:t,event:e});"online"!==t.tag&&"online"===n.tag&&(this.connectionEpoch+=1),this.connectionMachineState=n,this.logConnectionTransition({from:t.tag,to:n.tag,event:e})}logConnectionTransition(e){}trackConnectionFirstSeen(){const e=performance.now(),t=new Set(this.host.connections.map(e=>e.id));for(const e of this.connectionFirstSeenAt.keys())t.has(e)||(this.connectionFirstSeenAt.delete(e),this.connectionLastProbedAt.delete(e));for(const t of this.host.connections)this.connectionFirstSeenAt.has(t.id)||this.connectionFirstSeenAt.set(t.id,e)}isCurrentSwitchRequest(e){return e===this.switchRequestVersion}isCurrentProbeRequest(e){return e===this.probeRequestVersion}canProceedForProbe(e){return void 0===e||this.isCurrentProbeRequest(e)}async abortSwitchWithClient(e){e&&await e.close().catch(()=>{})}isSwitchStillValid(e,t){return this.isCurrentSwitchRequest(e)&&this.canProceedForProbe(t)}async resolveClientIdForSwitch(e){try{return await this.resolveClientId()}catch(t){if(await this.abortSwitchWithClient(e.existingClient),!this.isCurrentSwitchRequest(e.requestVersion))return null;const n=se(t);return this.applyConnectionEvent({type:"connect_failed",message:`Failed to resolve client id: ${n}`}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch))),null}}async disposePreviousActiveClient(){if(this.unsubscribeClientStatus&&(this.unsubscribeClientStatus(),this.unsubscribeClientStatus=null),this.unsubscribeClientHandlers&&(this.unsubscribeClientHandlers(),this.unsubscribeClientHandlers=null),this.activeClient){const e=this.activeClient;this.activeClient=null,await e.close().catch(()=>{})}}buildAgentDirectoryStatusPatch(){if(this.snapshot.hasEverLoadedAgentDirectory)return{};const e=this.connectionMachineState.tag;return"connecting"===e||"online"===e?{agentDirectoryStatus:"initial_loading",agentDirectoryError:null}:"error"===e?{agentDirectoryStatus:"error_before_first_success",agentDirectoryError:this.connectionMachineState.message}:{agentDirectoryStatus:"idle",agentDirectoryError:null}}async switchToConnection(e){const{connectionId:t,expectedProbeVersion:n,existingClient:s}=e;if(!this.canProceedForProbe(n))return void await this.abortSwitchWithClient(s);const o=ue(this.host,t);if(!o)return void await this.abortSwitchWithClient(s);const c=++this.switchRequestVersion,l=await this.resolveClientIdForSwitch({existingClient:s,requestVersion:c});if(null===l)return;if(!this.isSwitchStillValid(c,n))return void await this.abortSwitchWithClient(s);if(await this.disposePreviousActiveClient(),!this.isSwitchStillValid(c,n))return void await this.abortSwitchWithClient(s);const h=this.snapshot.clientGeneration+1,u=s??this.deps.createClient({host:this.host,connection:o,clientId:l,runtimeGeneration:h});if(u.setReconnectEnabled(!0),!this.isSwitchStillValid(c,n))return void await u.close().catch(()=>{});this.activeClient=u,this.applyConnectionEvent({type:"select_connection",connectionId:o.id,connection:oe(o)}),this.snapshot=Object.assign({},this.snapshot,{clientGeneration:h}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),{client:null}));const y=async e=>{if(!this.isCurrentSwitchRequest(c)||this.activeClient!==u)return;const t=(0,A.getConnectionAuthFailureReason)(e);if(t&&this.authRejectedConnectionIds.add(o.id),this.unsubscribeClientStatus?.(),this.unsubscribeClientStatus=null,this.unsubscribeClientHandlers?.(),this.unsubscribeClientHandlers=null,u.setReconnectEnabled(!1),this.applyConnectionEvent({type:"connect_failed",message:se(e)}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),{client:null,authFailureReason:t})),t){const e=new Map(this.snapshot.probeByConnectionId);e.set(o.id,{status:"unavailable",latencyMs:null}),this.updateSnapshot({probeByConnectionId:e});for(const e of this.host.connections)this.authRejectedConnectionIds.has(e.id)||this.connectionLastProbedAt.delete(e.id)}try{await u.close()}catch{}t&&this.host.connections.some(e=>!this.authRejectedConnectionIds.has(e.id))&&this.runProbeCycleNow()};try{if(s||await u.connect(),!this.isCurrentSwitchRequest(c)||this.activeClient!==u)return;this.unsubscribeClientHandlers=this.deps.mountClientHandlers?.({client:u,host:this.host,connection:o})??null,this.unsubscribeClientStatus=u.subscribeConnectionStatus(e=>{this.isCurrentSwitchRequest(c)&&this.activeClient===u&&(u.authFailureReason?y(new p.DaemonAuthenticationError(u.authFailureReason)):(this.applyConnectionEvent({type:"client_state",state:e,lastError:u.lastError}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),this.buildAgentDirectoryStatusPatch(),{client:u,authFailureReason:null}))))})}catch(e){await y(e)}}adoptReconciledServerId(e){this.host=Object.assign({},this.host,{serverId:e}),this.snapshot=Object.assign({},this.snapshot,{serverId:e});for(const e of this.listeners)e()}resolveClientId(){return this.clientIdPromise||(this.clientIdPromise=this.deps.getClientId().then(e=>(this.clientIdHash=ie(e),e))),this.clientIdPromise}}const Se="@paseo:daemon-registry",fe="localhost:6767",Ce=2500,ve="__PASEO_INITIAL_DAEMON_CONNECTION__",me=R.z.object({listen:R.z.string().trim().min(1),useTls:R.z.boolean().optional().default(!1)});function be(e){if(!(e?.isWebRuntime??I.isWeb)||"undefined"==typeof globalThis)return null;const t=me.safeParse(Reflect.get(globalThis,ve));return t.success?t.data:null}function we(){return null}function Ie(e){if(e.trim().startsWith("relay://")||e.includes("#connect="))return(0,f.parseRelayConnectionUri)(e);const t="#offer=",n=e.indexOf(t);if(-1===n)throw new Error("Missing #offer= fragment");const s=e.slice(n+7).trim();if(!s)throw new Error("Offer payload is empty");const o=(0,f.decodeOfferFragmentPayload)(s);return{offer:v.ConnectionOfferSchema.parse(o)}}function Ae(e){return e.startsWith("local:")}function He(e){return new Promise(t=>setTimeout(t,e))}function Re(e,t,n){const s=e.get(t);void 0!==s&&(e.delete(t),e.set(n,s))}class De{controllers=new Map;serverListeners=new Map;globalListeners=new Set;hostListListeners=new Set;version=0;hostListVersion=0;hostRegistryLoaded=!1;hosts=[];hostAppearanceMutationTail=Promise.resolve();hostRegistryStatus="loading";lastConnectionStatusByServer=new Map;connectionStatusStartedAtByServer=new Map;queuedAgentDrainInFlight=new Set;directorySyncByServer=new Map;nextCancellationRequestId=0;timelineReplicaByServer=new Map;configuredOverrideBootstrapInFlight=null;bootPromise=null;registryLoad=null;hostConfirmations=new b.HostConfirmations;constructor(e){this.deps=e?.deps??ge(),this.storage=e?.storage??h.default,this.replicaCache=new z.ReplicaCache(e?.replicaRowStore??(0,K.createReplicaRowStore)()),this.revokePushNotifications=e?.revokePushNotifications??Y.revokePushNotifications}getHosts(){return this.hosts}getHostRegistryStatus(){return this.hostRegistryStatus}subscribeHostList(e){return this.hostListListeners.add(e),()=>{this.hostListListeners.delete(e)}}getHostListVersion(){return this.hostListVersion}isHostRegistryLoaded(){return this.hostRegistryLoaded}boot(){return this.bootPromise||(this.bootPromise=this.runBoot()),this.bootPromise}async runBoot(){await this.loadRegistry();let e=null;try{e=await(0,D.readValidatedString)(this.storage,"@paseo:e2e",R.z.string().min(1))}catch{return}if(e)return;if((0,w.shouldUseDesktopDaemon)())return;const t=this.deps.readInitialConnectionHint?this.deps.readInitialConnectionHint():be();if(t){if(await this.bootstrapInitialConnectionHint(t))return}await this.bootstrapDefaultLocalhost()}loadRegistry(){return this.registryLoad||(this.registryLoad=this.loadFromStorage().then(()=>this.markHostRegistryLoaded())),this.registryLoad}async loadFromStorage(){let e=!1,t=[];try{const n=await(0,D.readValidatedJson)(this.storage,Se,y.StoredHostRegistrySchema);if(n){const s=[];for(const t of n){const n=(0,y.normalizeStoredHostProfile)(t);if(!n){await this.storage.removeItem(Se),s.length=0;break}t.connections.some(e=>"directTcp"===e.type&&e.password)&&(e=!0),s.push(n)}t=s.filter(e=>!Ae(e.serverId)),t.length!==s.length&&(e=!0)}this.hosts=t,this.replicaCache.setHosts(t.map(e=>e.serverId)),J.projectIconCache.setHosts(t.map(e=>e.serverId)),await J.projectIconCache.restore(),this.syncHosts(t);for(const e of t)this.directorySyncByServer.get(e.serverId)?.restoreCachedDirectory().catch(()=>{})}catch(e){console.error("[HostRuntime] Failed to load host registry from storage",e)}finally{this.hostRegistryStatus="ready",this.emitHostList(),e&&this.persistHosts().catch(e=>console.error("[HostRuntime] Failed to persist host registry",e))}}markHostRegistryLoaded(){this.hostRegistryLoaded||(this.hostRegistryLoaded=!0,this.emitHostList())}async bootstrapDefaultLocalhost(){const e=(0,y.connectionFromListen)(fe);if(e&&!(0,y.registryHasConnection)(this.hosts,e))try{await this.probeAndUpsertConnection({connection:e,timeoutMs:Ce})}catch(e){console.warn("[HostRuntime] bootstrap probe failed",{endpoint:fe,error:e})}}bootstrapConfiguredOverride(e){const t=(0,y.connectionFromListen)(e);if(!t)return;if((0,y.registryHasConnection)(this.hosts,t))return;if(this.configuredOverrideBootstrapInFlight)return;const n=this.runConfiguredOverrideBootstrap(e,t).finally(()=>{this.configuredOverrideBootstrapInFlight===n&&(this.configuredOverrideBootstrapInFlight=null)});this.configuredOverrideBootstrapInFlight=n}async runConfiguredOverrideBootstrap(e,t){let n=0;for(;!(0,y.registryHasConnection)(this.hosts,t);){n+=1;try{return void await this.probeAndUpsertConnection({connection:t,timeoutMs:Ce})}catch(t){1!==n&&n%10!=0||console.warn("[HostRuntime] configured bootstrap probe failed",{endpoint:e,attempt:n,error:t}),await He(1e3)}}}async bootstrapInitialConnectionHint(e){const t=(0,y.connectionFromListen)(e.listen);if(!t)return!1;const n="directTcp"===t.type?Object.assign({},t,{useTls:e.useTls??t.useTls??!1}):t;if((0,y.registryHasConnection)(this.hosts,n))return!0;try{return await this.probeAndUpsertConnection({connection:n,timeoutMs:Ce}),!0}catch(t){return console.warn("[HostRuntime] initial connection hint probe failed",{listen:e.listen,useTls:e.useTls,error:t}),!1}}reconcileServerId(e,t){if(e===t)return;const n=this.controllers.get(e);if(!n)return;if(this.controllers.has(t))return;Re(this.controllers,e,t),Re(this.lastConnectionStatusByServer,e,t),Re(this.connectionStatusStartedAtByServer,e,t),this.replicaCache.reconcileServerId(e,t),J.projectIconCache.reconcileServerId(e,t),this.directorySyncByServer.get(e)?.dispose(),this.directorySyncByServer.delete(e),this.timelineReplicaByServer.delete(e);const s=new G.DirectorySync(t,{onAgentStoppedRunning:e=>this.drainQueuedAgentMessage(t,e),markAgentLoading:()=>n.markAgentDirectorySyncLoading(),markAgentReady:()=>n.markAgentDirectorySyncReady(),markAgentError:e=>n.markAgentDirectorySyncError(e)},this.replicaCache);this.directorySyncByServer.set(t,s),this.timelineReplicaByServer.set(t,(0,Q.createTimelineReplica)({serverId:t,storage:this.replicaCache,prepareAgent:e=>s.prepareAgentRoute(e)})),n.adoptReconciledServerId(t);const o=n.getSnapshot();this.clearHostReplica(e),this.syncSessionReplica(t,o),s.connectionChanged({client:o.client,status:"online"===o.connectionStatus?"online":"offline",source:{clientGeneration:o.clientGeneration,connectionEpoch:o.connectionEpoch}});const c=this.serverListeners.get(e);if(c){this.serverListeners.delete(e);const n=this.serverListeners.get(t)??new Set;for(const e of c)n.add(e);this.serverListeners.set(t,n)}this.hosts=this.hosts.map(n=>n.serverId===e?Object.assign({},n,{serverId:t,updatedAt:(new Date).toISOString()}):n),this.emitHostList(),this.emit(t),this.persistHosts().catch(e=>console.error("[HostRuntime] Failed to persist host registry",e))}async upsertDirectConnection(e){const t=(0,f.normalizeHostPort)(e.endpoint),n=e.password?.trim();return this.upsertHostConnection({serverId:e.serverId,label:e.label,password:n,connection:{id:`direct:${t}`,type:"directTcp",endpoint:t,useTls:e.useTls??!1},existingClient:e.existingClient})}async probeAndUpsertConnection(e){if("relay"===e.connection.type)throw new Error("Cannot probe a relay connection without a server id.");const t=Object.assign({serverId:""},e.password?{password:e.password}:{},{label:e.label??e.connection.id,appearance:(0,S.defaultHostAppearance)(),lifecycle:{},connections:[e.connection],preferredConnectionId:e.connection.id,createdAt:new Date(0).toISOString(),updatedAt:new Date(0).toISOString()}),{client:n,serverId:s,hostname:o}=await this.deps.connectToDaemon(Object.assign({host:t,connection:e.connection},void 0!==e.timeoutMs?{timeoutMs:e.timeoutMs}:{}));return{profile:await this.upsertHostConnection({serverId:s,label:e.label??o??void 0,password:e.password,connection:e.connection,existingClient:n}),serverId:s,hostname:o}}async probeAndUpsertDirectConnection(e){const t=(0,f.normalizeHostPort)(e.endpoint),n=e.password?.trim();return this.probeAndUpsertConnection({label:e.label,password:n,connection:{id:`direct:${t}`,type:"directTcp",endpoint:t,useTls:e.useTls??!1}})}async probeAndUpsertRemoteSshConnection(e){return this.probeAndUpsertConnection({label:e.label,connection:(0,y.createRemoteSshHostConnection)(e)})}async upsertRelayConnection(e){const t=(0,f.normalizeHostPort)(e.relayEndpoint),n=e.useTls??!1,s=e.daemonPublicKeyB64.trim();if(!s)throw new Error("daemonPublicKeyB64 is required");const o=void 0!==e.useTls,c=await this.upsertHostConnection({serverId:e.serverId,label:e.label,connection:Object.assign({id:n?`relay:wss:${t}`:`relay:${t}`,type:"relay",relayEndpoint:t},o?{useTls:n}:{},{daemonPublicKeyB64:s})});return e.password?(await this.setHostPassword(c.serverId,e.password),this.hosts.find(e=>e.serverId===c.serverId)??c):c}async confirmLink(e){return await this.loadRegistry(),this.hostConfirmations.confirmLink(e,this.hosts)}getPendingHostConfirmation(){return this.hostConfirmations.getPending()}subscribeHostConfirmation(e){return this.hostConfirmations.subscribe(e)}answerHostConfirmation(e,t){this.hostConfirmations.answer(e,t)}beginLinkPairing(){let e=null;return{submit:async(t,n)=>{const{offer:s,password:o}=Ie(t);if(!e||(l=s,(c=e).serverId!==l.serverId||!(0,u.default)((0,y.relayConnectionFromOffer)(c),(0,y.relayConnectionFromOffer)(l)))){if(!await this.confirmLink(s))return{status:"cancelled"};e=s}var c,l;const h=await this.probeAndUpsertOffer(s,n??o);return Object.assign({status:"connected"},h)}}}async importConnectionLink(e,t){if("openProject"===t){const{offer:t,password:n}=Ie(e);if(!await this.confirmLink(t))return{status:"cancelled"};return{status:"connected",serverId:(await this.upsertConnectionFromOffer(t,void 0,n)).serverId}}const n=this.beginLinkPairing();try{const t=await n.submit(e);return"cancelled"===t.status?t:{status:"connected",serverId:t.serverId}}catch(t){if(!(0,A.getConnectionAuthFailureReason)(t))throw t;return{status:"password_required",link:e,pairing:n}}}async upsertConnectionFromOffer(e,t,n){const s=(0,y.relayConnectionFromOffer)(e);return this.upsertRelayConnection({serverId:e.serverId,relayEndpoint:s.relayEndpoint,useTls:s.useTls,daemonPublicKeyB64:s.daemonPublicKeyB64,label:t,password:n})}async probeAndUpsertOffer(e,t){const n=(0,y.relayConnectionFromOffer)(e),s=Object.assign({serverId:e.serverId},t?{password:t}:{},{label:e.serverId,appearance:(0,S.defaultHostAppearance)(),lifecycle:{},connections:[n],preferredConnectionId:n.id,createdAt:new Date(0).toISOString(),updatedAt:new Date(0).toISOString()}),{client:o,hostname:c}=await this.deps.connectToDaemon({host:s,connection:n});await o.close().catch(()=>{});return{profile:await this.upsertConnectionFromOffer(e,c??void 0,t),serverId:e.serverId,hostname:c}}async upsertConnectionFromListen(e){const t=e.listenAddress.trim(),n=e.serverId.trim(),s=(0,y.connectionFromListen)(t);if(!s)throw new Error(`Unsupported listen address: ${e.listenAddress}`);if(!n)throw new Error("Desktop daemon did not return a server id.");return this.upsertHostConnection({serverId:n,label:e.hostname??void 0,connection:s})}async updateHost(e,t){const n=(new Date).toISOString(),s=this.hosts.map(s=>s.serverId===e?Object.assign({},t(s),{updatedAt:n}):s);this.setHostsAndSync(s),await this.persistHosts()}async renameHost(e,t){await this.updateHost(e,e=>Object.assign({},e,{label:t}))}async setHostPassword(t,s){await this.updateHost(t,t=>{const o=(0,n.default)(t,e);return s?Object.assign({},o,{password:s}):o})}async setHostColor(e,t){await this.updateHostAppearance(e,e=>Object.assign({},e,{appearance:Object.assign({},e.appearance,{color:t})}))}async setHostBadgeDisplay(e,t){await this.updateHostAppearance(e,e=>Object.assign({},e,{appearance:Object.assign({},e.appearance,{badgeDisplay:t})}))}updateHostAppearance(e,t){const n=this.hostAppearanceMutationTail.then(()=>this.applyHostAppearance(e,t));return this.hostAppearanceMutationTail=n.catch(()=>{}),n}async applyHostAppearance(e,t){const n=(new Date).toISOString(),s=this.hosts.map(s=>s.serverId===e?Object.assign({},t(s),{updatedAt:n}):s);await this.persistHosts(s),this.setHostsAndSync(s)}async removeHost(e){await this.revokePushNotifications({client:this.getClient(e),serverId:e});const t=this.hosts.filter(t=>t.serverId!==e);this.setHostsAndSync(t),await this.persistHosts()}async removeConnection(e,t){const n=this.hosts.find(t=>t.serverId===e);if(1===n?.connections.length&&n.connections[0]?.id===t)return void await this.removeHost(e);const s=(new Date).toISOString(),o=this.hosts.map(n=>{if(n.serverId!==e)return n;const o=n.connections.filter(e=>e.id!==t);if(0===o.length)return null;const c=n.preferredConnectionId===t?o[0]?.id??null:n.preferredConnectionId;return Object.assign({},n,{connections:o,preferredConnectionId:c,updatedAt:s})}).filter(e=>null!==e);this.setHostsAndSync(o),await this.persistHosts()}async upsertHostConnection(e){const t=(new Date).toISOString(),n=(0,y.upsertHostConnectionInProfiles)({profiles:this.hosts,serverId:e.serverId,label:e.label,connection:e.connection,password:e.password,now:t});this.setHostsAndSync(n,{initialConnectionByServerId:e.existingClient?new Map([[e.serverId,{connectionId:e.connection.id,existingClient:e.existingClient}]]):void 0}),this.persistHosts().catch(e=>console.error("[HostRuntime] Failed to persist host registry",e));const s=n.find(t=>t.serverId===e.serverId);if(!s)throw new Error(`Host ${e.serverId} was not inserted`);return s}setHostsAndSync(e,t){this.hosts=e,this.syncHosts(e,t),this.emitHostList()}async persistHosts(e=this.hosts){await this.storage.setItem(Se,JSON.stringify(e))}emitHostList(){this.hostListVersion+=1;for(const e of this.hostListListeners)e()}syncHosts(e,t){this.replicaCache.setHosts(e.map(e=>e.serverId)),J.projectIconCache.setHosts(e.map(e=>e.serverId));const n=new Set(e.map(e=>e.serverId));for(const[e,t]of this.controllers)n.has(e)||(this.controllers.delete(e),this.lastConnectionStatusByServer.delete(e),this.connectionStatusStartedAtByServer.delete(e),this.directorySyncByServer.get(e)?.dispose(),this.directorySyncByServer.delete(e),this.timelineReplicaByServer.delete(e),this.clearHostReplica(e),t.stop(),this.emit(e));for(const n of e){const e=t?.initialConnectionByServerId?.get(n.serverId),s=this.controllers.get(n.serverId);if(s){s.updateHost(n),e&&s.activateConnection(e).catch(()=>{e.existingClient.close().catch(()=>{})});continue}const o=new ye({host:n,deps:this.deps,onReconcileServerId:(e,t)=>this.reconcileServerId(e,t)});this.controllers.set(n.serverId,o),k.useSessionStore.getState().initializeSession(n.serverId,null);const c=new G.DirectorySync(n.serverId,{onAgentStoppedRunning:e=>this.drainQueuedAgentMessage(n.serverId,e),markAgentLoading:()=>o.markAgentDirectorySyncLoading(),markAgentReady:()=>o.markAgentDirectorySyncReady(),markAgentError:e=>o.markAgentDirectorySyncError(e)},this.replicaCache);this.directorySyncByServer.set(n.serverId,c),this.timelineReplicaByServer.set(n.serverId,(0,Q.createTimelineReplica)({serverId:n.serverId,storage:this.replicaCache,prepareAgent:e=>c.prepareAgentRoute(e)}));const l=o.getSnapshot();this.lastConnectionStatusByServer.set(n.serverId,l.connectionStatus),this.connectionStatusStartedAtByServer.set(n.serverId,Date.now()),o.subscribe(()=>{const e=o.getSnapshot();this.syncSessionReplica(e.serverId,e),this.syncDirectoryConnection(e.serverId),this.emit(e.serverId)}),o.start(e?{initialConnection:e}:{}).catch(e=>{const t=e instanceof Error?e.message:String(e);o.markStartupError(t)}),this.emit(n.serverId)}}syncSessionReplica(e,t){if(!t.client)return;const n=k.useSessionStore.getState();n.initializeSession(e,t.client,t.clientGeneration),n.updateSessionClient(e,t.client,t.clientGeneration);const s=t.client.getLastServerInfoMessage();s&&n.updateSessionServerInfo(e,(0,k.toDaemonServerInfo)(s))}clearHostReplica(e){k.useSessionStore.getState().clearSession(e),T.useWorkspaceSetupStore.getState().clearServer(e)}syncDirectoryConnection(e){const t=this.controllers.get(e);if(!t)return this.lastConnectionStatusByServer.delete(e),void this.connectionStatusStartedAtByServer.delete(e);const n=t.getSnapshot(),s=this.directorySyncByServer.get(e);s?.connectionChanged({client:n.client,status:"online"===n.connectionStatus?"online":"offline",source:{clientGeneration:n.clientGeneration,connectionEpoch:n.connectionEpoch}});const o=this.lastConnectionStatusByServer.get(e),c=o!==n.connectionStatus,l="online"!==n.connectionStatus&&"idle"!==n.connectionStatus;!c||void 0!==o&&"online"!==o&&"idle"!==o&&l||this.connectionStatusStartedAtByServer.set(e,Date.now()),this.lastConnectionStatusByServer.set(e,n.connectionStatus);"online"===n.connectionStatus&&"online"!==o&&(k.useSessionStore.getState().bumpHistorySyncGeneration(e),(0,B.invalidateCheckoutGitQueriesForServer)(F.queryClient,e),(0,j.invalidateServerDataQueriesAfterReconnect)({queryClient:F.queryClient,serverId:e}),F.queryClient.invalidateQueries({queryKey:x.schedulesQueryBaseKey}))}drainQueuedAgentMessage(e,t){const n=`${e}:${t}`;if(this.queuedAgentDrainInFlight.has(n))return;const s=k.useSessionStore.getState().sessions[e],o=s?.queuedMessages.get(t),c=s?.client;if(!c||!o?.length||!0===s.initializingAgents.get(t))return;if((0,W.getActiveMessageSubmissions)(s.messageSubmissions.get(t)).length>0)return;this.queuedAgentDrainInFlight.add(n);const l=o[0];(0,U.sendQueuedComposerMessageNow)({agentId:t,messageId:l.id,queue:{read:t=>k.useSessionStore.getState().sessions[e]?.queuedMessages.get(t)??[],write:t=>k.useSessionStore.getState().setQueuedMessages(e,t)},submitMessage:async({text:n,attachments:s})=>{const o=!0===k.useSessionStore.getState().sessions[e]?.serverInfo?.features?.forgeSearch;await(0,U.dispatchComposerAgentMessage)({client:c,agentId:t,text:n,attachments:s,attachmentSubmitFormat:(0,N.resolveComposerAttachmentSubmitFormat)({supportsForgeAttachments:o}),encodeImages:$.encodeImages,submission:(0,V.createMessageSubmissionWriter)(e)})}}).then(n=>("failed"===n.status&&console.error("[HostRuntime] failed to drain queued agent message",{serverId:e,agentId:t,error:n.errorMessage}),n)).finally(()=>{this.queuedAgentDrainInFlight.delete(n)})}applyAgentTurnLiveness(e,t,n){this.directorySyncByServer.get(e)?.applyAgentTurnLiveness(t,n)}beginAgentCancellation(e,t){const n=++this.nextCancellationRequestId;return this.applyAgentTurnLiveness(e,t,{type:"cancellation_started",requestId:n}),n}settleAgentCancellation(e,t,n){this.applyAgentTurnLiveness(e,t,{type:"cancellation_settled",requestId:n})}acceptAgentSnapshot(e,t){return this.requireDirectory(e).acceptAgent(t)}archiveAgentSnapshot(e,t,n){this.requireDirectory(e).archiveAgent(t,n)}restoreAgentSnapshot(e,t,n){const s=this.requireDirectory(e);n?s.acceptAgent(n):s.removeAgent(t)}acceptWorkspaceSnapshots(e,t){this.requireDirectory(e).acceptWorkspaces(t)}acceptProjectSnapshot(e,t){this.requireDirectory(e).acceptProject(t)}removeWorkspaceSnapshot(e,t){this.requireDirectory(e).removeWorkspace(t)}requireDirectory(e){const t=this.directorySyncByServer.get(e);if(!t)throw new Error(`Unknown host runtime for serverId ${e}`);return t}getSnapshot(e){return this.controllers.get(e)?.getSnapshot()??null}getConnectionStatusSince(e){return this.connectionStatusStartedAtByServer.get(e)??null}getVersion(){return this.version}getClient(e){return this.controllers.get(e)?.getClient()??null}subscribe(e,t){const n=this.serverListeners.get(e)??new Set;return n.add(t),this.serverListeners.set(e,n),()=>{const n=this.serverListeners.get(e);n&&(n.delete(t),0===n.size&&this.serverListeners.delete(e))}}subscribeAll(e){return this.globalListeners.add(e),()=>{this.globalListeners.delete(e)}}getEarliestOnlineHostServerId(){let e=null,t=null;for(const n of this.hosts){const s=this.getSnapshot(n.serverId);te(s)&&s?.lastOnlineAt&&((!t||s.lastOnlineAt<t)&&(t=s.lastOnlineAt,e=n.serverId))}return e}ensureConnectedAll(e){for(const t of this.controllers.values())t.ensureConnected(e)}setAppVisible(e){e?this.ensureConnectedAll({verify:!0}):this.replicaCache.flush()}runProbeCycleNow(e){return e?this.controllers.get(e)?.runProbeCycleNow()??Promise.resolve():Promise.all(Array.from(this.controllers.values(),e=>e.runProbeCycleNow())).then(()=>{})}async refreshAgentDirectory(e){const t=this.directorySyncByServer.get(e.serverId);if(!t)throw new Error(`Unknown host runtime for serverId ${e.serverId}`);return t.refreshAgents(e)}async refreshWorkspaceDirectory(e){const t=this.directorySyncByServer.get(e.serverId);if(!t)throw new Error(`Unknown host runtime for serverId ${e.serverId}`);await t.refreshWorkspaces({subscribe:e.subscribe})}async refreshDirectories(e){const t=this.directorySyncByServer.get(e);if(!t)throw new Error(`Unknown host runtime for serverId ${e}`);await t.refreshDemand()}acquireDirectoryDemand(e){const t=this.directorySyncByServer.get(e);if(!t)return()=>{};const n={};return t.setDemand(n,!0),()=>t.setDemand(n,!1)}async prepareAgentRoute(e,t){const n=this.directorySyncByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);await n.prepareAgentRoute(t)}async prepareWorkspaceRoute(e,t){const n=this.directorySyncByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);await n.prepareWorkspaceRoute(t)}async prepareAgentTimeline(e,t){const n=this.timelineReplicaByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);await n.prepare(t)}async fetchAgentTimeline(e,t,n){const s=this.directorySyncByServer.get(e);if(!s)throw new Error(`Unknown host runtime for serverId ${e}`);const o=k.useSessionStore.getState().sessions[e]?.viewedTimelineSync,c=await s.fetchTimeline(t,n);return o&&k.useSessionStore.getState().sessions[e]?.viewedTimelineSync===o&&(o.flushStreamAgent(t),o.applyTimelineResponse(c)),c}createViewedTimelineOwner(e,t){const n=this.directorySyncByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);const s=this.timelineReplicaByServer.get(e);if(!s)throw new Error(`Unknown host runtime for serverId ${e}`);return(0,Q.createViewedTimelineOwner)({serverId:e,replica:s,replaceDemandedAgentIds:e=>n.setAgentRouteDemand(e),drainQueuedAgentMessage:t=>this.drainQueuedAgentMessage(e,t),ports:t})}emit(e){this.version+=1;const t=this.serverListeners.get(e);if(t){for(const e of t)e();for(const e of this.globalListeners)e()}else for(const e of this.globalListeners)e()}}let Ee=null;const Le="__paseoHostRuntimeStore";function Pe(){if(Ee)return Ee;const e=Reflect.get(globalThis,Le);return e instanceof De?(Ee=e,e):(Ee=new De,Reflect.set(globalThis,Le,Ee),Ee)}},3529,[36,454,3530,2982,37,885,3531,3482,3532,3535,3537,3526,3538,3539,3540,881,3542,3543,2898,3018,3546,3544,882,3547,2994,3007,3459,3548,3555,849,3557,3567,3585,3587,3600,3467,3591,3601,3607,3637,3641,3642,3646,3648,3650,3651]);
|
|
15175
15175
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getAppDeviceKind=function(){return(0,n.getIsElectron)()?o.DeviceKind.Desktop:n.isWeb?o.DeviceKind.Browser:o.DeviceKind.Mobile},_e.getAppDeviceLabel=async function(){if((0,n.getIsElectron)()){const e=await((0,s.getDesktopHost)()?.invoke?.("desktop_get_computer_name").catch(()=>{}));return"string"==typeof e?`Paseo Desktop \xb7 ${e}`:"Paseo Desktop"}if(n.isWeb){let e="Web";return/Safari\//.test(navigator.userAgent)&&(e="Safari"),/Chrome\//.test(navigator.userAgent)&&(e="Chrome"),/Firefox\//.test(navigator.userAgent)&&(e="Firefox"),/Edg\//.test(navigator.userAgent)&&(e="Edge"),`Browser \xb7 ${e}`}return"Android"};var e,t=r(d[0]),o=((e=t)&&e.__esModule,r(d[1])),n=r(d[2]),s=r(d[3])},3530,[26,2982,881,882]);
|
|
@@ -15762,7 +15762,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";function t(t){return void 0===t?"unknow
|
|
|
15762
15762
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.collectDesktopDiagnosticSections=async function(t=n){const l=[];let c=!1;const[D,v,b,S]=await Promise.allSettled([Promise.all([t.getStatus(),t.getDaemonLogs()]),t.getAppLogs(),t.getUpdaterDiagnostics(),t.getSandboxDiagnostics()]);if("fulfilled"===S.status){const t=S.value;l.push((0,o.formatDiagnosticSection)("Chromium sandbox",[{label:"State",value:t.enabled?"Enabled":"Disabled"},{label:"Reason",value:t.reason}]))}else c=!0,l.push((0,o.formatDiagnosticSection)("Chromium sandbox",[{label:"Error",value:f(S.reason)}]));if("fulfilled"===D.status){const[t,o]=D.value,n="fulfilled"===v.status?v.value:null;l.unshift(...u({status:t,daemonLogs:o,appLogs:n}))}else c=!0,l.unshift((0,o.formatDiagnosticSection)("Desktop",[{label:"Error",value:f(D.reason)}]));"fulfilled"===v.status?l.push(p("Desktop app log tail",v.value.contents)):(c=!0,l.push((0,o.formatDiagnosticSection)("Desktop app log tail",[{label:"Error",value:f(v.reason)}])));"fulfilled"===b.status?l.push(...s(b.value)):(c=!0,l.push((0,o.formatDiagnosticSection)("Desktop updater",[{label:"Error",value:f(b.reason)}])));return{status:c?"failed":"done",sections:l}};var t=r(d[0]),o=r(d[1]);const n={getSandboxDiagnostics:t.getDesktopSandboxDiagnostics,getStatus:t.getDesktopDaemonStatus,getDaemonLogs:t.getDesktopDaemonLogs,getAppLogs:t.getDesktopAppLogs,getUpdaterDiagnostics:t.getDesktopUpdaterDiagnostics};function s(t){const n=[{label:"Platform",value:t.platform},{label:"Current version",value:t.currentVersion},{label:"Target version",value:t.targetVersion??"unknown"},{label:"ShipIt directory",value:t.shipItDirectory??"not applicable"}];t.targetVersionError&&n.push({label:"Target version error",value:t.targetVersionError});const s=[(0,o.formatDiagnosticSection)("Desktop updater",n)];return"darwin"!==t.platform||s.push(l("ShipItState.plist",t.state),l("ShipIt stdout log tail",t.stdout),l("ShipIt stderr log tail",t.stderr)),s}function l(t,n){if(!n)return(0,o.formatDiagnosticSection)(t,[{label:"Status",value:"unavailable"}]);const s=(0,o.formatDiagnosticSection)(t,[{label:"Path",value:n.path||"unknown"},{label:"Modified",value:n.modifiedAt??"unknown"}]);return n.error?`${s}\n Error: ${n.error}`:n.exists?n.contents?`${s}\n${c(n.contents)}`:`${s}\n No contents found`:`${s}\n File not found`}function u(t){const{status:n,daemonLogs:s,appLogs:l}=t;return[(0,o.formatDiagnosticSection)("Desktop",[{label:"Daemon status",value:n.status},{label:"Desktop managed",value:String(n.desktopManaged)},{label:"Daemon PID",value:null===n.pid?"none":String(n.pid)},{label:"Daemon version",value:n.version??"unknown"},{label:"Daemon home",value:n.home||"unknown"},{label:"Log path",value:s.logPath||"unknown"},{label:"App log path",value:l?.logPath||"unavailable"},{label:"Error",value:n.error??"none"}]),p("Desktop daemon log tail",s.contents)]}function p(t,o){return[t,o?c(o):" No log lines found"].join("\n")}function c(t){return t.split("\n").filter(Boolean).map(t=>` ${t}`).join("\n")}function f(t){return t instanceof Error?t.message:String(t)}},4107,[3540,4106]);
|
|
15763
15763
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useAppDiagnosticStore",{enumerable:!0,get:function(){return t}});const t=(0,r(d[0]).create)(t=>({visible:!1,open:()=>t({visible:!0}),close:()=>t({visible:!1})}))},4108,[3460]);
|
|
15764
15764
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.appearanceStyleBoundaryKey=c,e.AppearanceStyleBoundary=function(n){const t=(0,o.c)(2),{children:c}=n;let u;t[0]!==c?(u=(0,s.jsx)(y,{uniProps:l,children:c}),t[0]=c,t[1]=u):u=t[1];return u};var o=r(d[0]),n=r(d[1]),t=r(d[2]),s=r(d[3]);function c(o){return[o.fontFamily.ui,o.fontFamily.mono,o.fontSize.sm,o.fontSize.base,o.fontSize.lg,o.fontSize.xl,o.fontSize["2xl"],o.fontSize["3xl"],o.fontSize["4xl"],o.fontSize.content,o.fontSize.code,o.lineHeight.diff,o.colors.foreground,o.colors.foregroundMuted,o.colors.mutedForeground,o.colors.surface1,o.colors.surface2,o.colors.border,o.colors.accentBright,o.colors.syntax.keyword,o.colors.syntax.comment,o.colors.syntax.string,o.colors.syntax.number,o.colors.syntax.literal,o.colors.syntax.function,o.colors.syntax.definition,o.colors.syntax.class,o.colors.syntax.type,o.colors.syntax.tag,o.colors.syntax.attribute,o.colors.syntax.property,o.colors.syntax.variable,o.colors.syntax.operator,o.colors.syntax.punctuation,o.colors.syntax.regexp,o.colors.syntax.escape,o.colors.syntax.meta,o.colors.syntax.heading,o.colors.syntax.link].join("\0")}function l(o){return{appearanceKey:c(o)}}const y=(0,t.withUnistyles)(function(t){const c=(0,o.c)(3),{appearanceKey:l,children:y}=t;let u;return c[0]!==l||c[1]!==y?(u=(0,s.jsx)(n.Fragment,{children:y},l),c[0]=l,c[1]=y,c[2]=u):u=c[2],u})},4109,[454,37,57,280]);
|
|
15765
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"LeftSidebar",{enumerable:!0,get:function(){return se}});var t=r(d[0]),o=r(d[1]),s=r(d[2]),n=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]),h=r(d[7]);r(d[8]);var p=e(r(d[9]));r(d[10]);var b=e(r(d[11]));r(d[12]);var f=r(d[13]),S=r(d[14]),_=e(S),v=r(d[15]),j=r(d[16]),w=r(d[17]),W=r(d[18]),y=r(d[19]),R=r(d[20]),x=r(d[21]),k=r(d[22]),I=r(d[23]),P=r(d[24]),H=r(d[25]),D=r(d[26]),T=r(d[27]),O=r(d[28]),A=r(d[29]),z=r(d[30]),B=r(d[31]),C=r(d[32]),E=r(d[33]),F=r(d[34]),G=r(d[35]),M=r(d[36]),N=r(d[37]),K=r(d[38]),V=r(d[39]),L=r(d[40]),X=r(d[41]),q=r(d[42]),U=r(d[43]),J=r(d[44]),Z=r(d[45]),$=r(d[46]),Y=r(d[47]),Q=r(d[48]),ee=r(d[49]),te=r(d[50]),oe=r(d[51]);const se=(0,h.memo)(function(e){const t=(0,n.c)(87),{active:o,overlay:s}=e,{theme:c}=(0,w.useUnistyles)(),{t:p}=(0,u.useTranslation)(),b=(0,j.useSafeAreaInsets)(),f=(0,z.useIsCompactFormFactor)(),S=(0,X.usePanelStore)(ye),{projects:_,hasProjectsBeforeFilter:v,resolvedProjectFilters:W,workspaceEntriesByKey:y,isInitialLoad:R,isRevalidating:x,refreshAll:k,workspaceGroups:I,projectIconTargets:P,pinnedGroups:H,collapsedProjectKeys:D,toggleProjectCollapsed:T,groupMode:O,shortcutModel:A}=(0,F.useSidebarModel)(),{shortcutIndexByWorkspaceKey:E}=A,[M,N]=(0,h.useState)(!1);let K;t[0]!==k?(K=()=>{N(!0),k()},t[0]=k,t[1]=K):K=t[1];const L=K;let q,U;t[2]!==M||t[3]!==x?(q=()=>{!x&&M&&N(!1)},U=[x,M],t[2]=M,t[3]=x,t[4]=q,t[5]=U):(q=t[4],U=t[5]),(0,h.useEffect)(q,U);const J=(0,B.useOpenAddProject)(),{open:Y,sheet:Q}=(0,C.useImportSession)();let ee;t[6]!==J||t[7]!==S?(ee=()=>{S(),J()},t[6]=J,t[7]=S,t[8]=ee):ee=t[8];const te=ee;let se;t[9]!==J?(se=()=>{J()},t[9]=J,t[10]=se):se=t[10];const ie=se;let re;t[11]!==S?(re=()=>{S(),l.router.push((0,Z.buildSettingsRoute)())},t[11]=S,t[12]=re):re=t[12];const ne=re,ae=Re;let de;t[13]!==S?(de=()=>{S(),l.router.push((0,Z.buildSettingsAddHostRoute)(Date.now()))},t[13]=S,t[14]=de):de=t[14];const le=de,ue=xe;let he;t[15]!==S?(he=e=>{S(),(0,$.openHostOverview)(e)},t[15]=S,t[16]=he):he=t[16];const pe=he,ge=ke;let be;t[17]!==Y||t[18]!==S?(be=()=>{S(),Y()},t[17]=Y,t[18]=S,t[19]=be):be=t[19];const fe=be;let Se,me,je,we,We,Ie,Pe;t[20]!==p?(Se=p("sidebar.actions.addProject"),t[20]=p,t[21]=Se):Se=t[21],t[22]!==p?(me=p("sidebar.actions.hosts"),t[22]=p,t[23]=me):me=t[23],t[24]!==p?(je=p("sidebar.actions.settings"),t[24]=p,t[25]=je):je=t[25],t[26]!==p?(we=p("sidebar.host.searchPlaceholder"),t[26]=p,t[27]=we):we=t[27],t[28]!==p?(We=p((0,V.builtinSidebarNavLabelKey)("usage")),t[28]=p,t[29]=We):We=t[29],t[30]!==p?(Ie=p("sidebar.actions.closeSidebar"),t[30]=p,t[31]=Ie):Ie=t[31],t[32]!==Se||t[33]!==me||t[34]!==je||t[35]!==we||t[36]!==We||t[37]!==Ie?(Pe={addProject:Se,hosts:me,settings:je,searchHosts:we,usage:We,closeSidebar:Ie},t[32]=Se,t[33]=me,t[34]=je,t[35]=we,t[36]=We,t[37]=Ie,t[38]=Pe):Pe=t[38];const He=Pe,De=0!==W?.length;let Te;t[39]!==D||t[40]!==O||t[41]!==L||t[42]!==v||t[43]!==R||t[44]!==M||t[45]!==x||t[46]!==He||t[47]!==H||t[48]!==P||t[49]!==_||t[50]!==E||t[51]!==De||t[52]!==c||t[53]!==T||t[54]!==y||t[55]!==I?(Te={theme:c,workspaceGroups:I,projectIconTargets:P,pinnedGroups:H,projects:_,hasProjectsBeforeFilter:v,hasActiveProjectFilter:De,workspaceEntriesByKey:y,isInitialLoad:R,isRevalidating:x,isManualRefresh:M,groupMode:O,collapsedProjectKeys:D,shortcutIndexByWorkspaceKey:E,toggleProjectCollapsed:T,handleRefresh:L,labels:He},t[39]=D,t[40]=O,t[41]=L,t[42]=v,t[43]=R,t[44]=M,t[45]=x,t[46]=He,t[47]=H,t[48]=P,t[49]=_,t[50]=E,t[51]=De,t[52]=c,t[53]=T,t[54]=y,t[55]=I,t[56]=Te):Te=t[56];const Oe=Te;if(f){let e,s,n;return t[57]!==o||t[58]!==le||t[59]!==fe||t[60]!==pe||t[61]!==te||t[62]!==ne||t[63]!==b.bottom||t[64]!==b.top||t[65]!==Oe||t[66]!==S?(e=(0,oe.jsx)(ce,Object.assign({},Oe,{active:o,insetsTop:b.top,insetsBottom:b.bottom,closeSidebar:S,handleOpenProject:te,handleImportSession:fe,handleSettings:ne,handleAddHost:le,handleOpenHostSettings:pe})),t[57]=o,t[58]=le,t[59]=fe,t[60]=pe,t[61]=te,t[62]=ne,t[63]=b.bottom,t[64]=b.top,t[65]=Oe,t[66]=S,t[67]=e):e=t[67],t[68]!==o||t[69]!==e?(s=(0,oe.jsx)(G.RetainedPanelActivity,{active:o,children:e}),t[68]=o,t[69]=e,t[70]=s):s=t[70],t[71]!==Q||t[72]!==s?(n=(0,oe.jsxs)(oe.Fragment,{children:[s,Q]}),t[71]=Q,t[72]=s,t[73]=n):n=t[73],n}let Ae,ze,Be;return t[74]!==o||t[75]!==ie||t[76]!==b.top||t[77]!==Y||t[78]!==s||t[79]!==Oe?(Ae=(0,oe.jsx)(ve,Object.assign({},Oe,{insetsTop:b.top,active:o,overlay:s,handleOpenProject:ie,handleImportSession:Y,handleSettings:ae,handleAddHost:ue,handleOpenHostSettings:ge})),t[74]=o,t[75]=ie,t[76]=b.top,t[77]=Y,t[78]=s,t[79]=Oe,t[80]=Ae):Ae=t[80],t[81]!==o||t[82]!==Ae?(ze=(0,oe.jsx)(G.RetainedPanelActivity,{active:o,children:Ae}),t[81]=o,t[82]=Ae,t[83]=ze):ze=t[83],t[84]!==Q||t[85]!==ze?(Be=(0,oe.jsxs)(oe.Fragment,{children:[ze,Q]}),t[84]=Q,t[85]=ze,t[86]=Be):Be=t[86],Be});function ie(e){return`sidebar-host-row-${e}`}function re(e){const t=(0,n.c)(21),{buttonRef:o,onPress:l,testID:c,label:u,icon:h,iconSize:p,shortcutKeys:b,theme:f}=e;let S,_;t[0]!==h||t[1]!==p||t[2]!==f.colors.foreground||t[3]!==f.colors.foregroundMuted||t[4]!==f.iconSize?(S=e=>{const{hovered:t}=e;return(0,oe.jsx)(h,{size:p??f.iconSize.md,color:t?f.colors.foreground:f.colors.foregroundMuted})},t[0]=h,t[1]=p,t[2]=f.colors.foreground,t[3]=f.colors.foregroundMuted,t[4]=f.iconSize,t[5]=S):S=t[5],t[6]!==o||t[7]!==u||t[8]!==l||t[9]!==S||t[10]!==c?(_=(0,oe.jsx)(A.TooltipTrigger,{asChild:!0,children:(0,oe.jsx)(s.Pressable,{ref:o,style:We.footerIconButton,testID:c,nativeID:c,collapsable:!1,accessible:!0,accessibilityLabel:u,accessibilityRole:"button",onPress:l,children:S})}),t[6]=o,t[7]=u,t[8]=l,t[9]=S,t[10]=c,t[11]=_):_=t[11];const v=`${c}-tooltip`;let j,w,W;return t[12]!==u||t[13]!==b?(j=(0,oe.jsx)(ae,{label:u,shortcutKeys:b}),t[12]=u,t[13]=b,t[14]=j):j=t[14],t[15]!==v||t[16]!==j?(w=(0,oe.jsx)(A.TooltipContent,{side:"top",align:"center",offset:8,testID:v,children:j}),t[15]=v,t[16]=j,t[17]=w):w=t[17],t[18]!==_||t[19]!==w?(W=(0,oe.jsxs)(A.Tooltip,{delayDuration:300,children:[_,w]}),t[18]=_,t[19]=w,t[20]=W):W=t[20],W}function ne(e){const t=(0,n.c)(14),{theme:o,label:s,onAddHost:l,onOpenHostSettings:u}=e,p=(0,N.useHosts)(),b=(0,h.useRef)(null),[f,S]=(0,h.useState)(!1);let _;t[0]!==u?(_=e=>{u(e)},t[0]=u,t[1]=_):_=t[1];const v=_;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>S(!0),t[2]=j):j=t[2];const w=j,W=o.iconSize.md-1;let y,R;return t[3]!==s||t[4]!==W||t[5]!==o?(y=(0,oe.jsx)(re,{buttonRef:b,onPress:w,testID:"sidebar-hosts-trigger",label:s,icon:c.Server,iconSize:W,theme:o}),t[3]=s,t[4]=W,t[5]=o,t[6]=y):y=t[6],t[7]!==v||t[8]!==p||t[9]!==f||t[10]!==l||t[11]!==u||t[12]!==y?(R=(0,oe.jsx)(k.HostPicker,{hosts:p,value:"",onSelect:v,open:f,onOpenChange:S,anchorRef:b,includeAddHost:!0,onAddHost:l,showActiveConnection:!0,onOpenHostSettings:u,searchable:!0,desktopPlacement:"top-start",desktopMinWidth:240,addHostTestID:"sidebar-host-add",hostOptionTestID:ie,children:y}),t[7]=v,t[8]=p,t[9]=f,t[10]=l,t[11]=u,t[12]=y,t[13]=R):R=t[13],R}function ae(e){const s=(0,n.c)(7),{label:l,shortcutKeys:c}=e;let u,h,p;return s[0]!==l?(u=(0,oe.jsx)(o.Text,{style:We.tooltipText,children:l}),s[0]=l,s[1]=u):u=s[1],s[2]!==c?(h=c?(0,oe.jsx)(O.Shortcut,{chord:c}):null,s[2]=c,s[3]=h):h=s[3],s[4]!==u||s[5]!==h?(p=(0,oe.jsxs)(t.View,{style:We.tooltipRow,children:[u,h]}),s[4]=u,s[5]=h,s[6]=p):p=s[6],p}function de(e){const o=(0,n.c)(31),{theme:s,handleOpenProject:l,handleSettings:u,labels:h,handleAddHost:p,handleOpenHostSettings:b,onBeforeNavigate:f}=e,S=(0,E.useShortcutKeys)("new-agent"),_=(0,E.useShortcutKeys)("toggle-settings"),v=(0,Y.useOpenUsageScreen)();let j,w,W,y,R,x,k,I,P;return o[0]!==f?(j=(0,oe.jsx)(le,{onBeforeNavigate:f}),o[0]=f,o[1]=j):j=o[1],o[2]!==l||o[3]!==h.addProject||o[4]!==S||o[5]!==s?(w=(0,oe.jsx)(re,{onPress:l,testID:"sidebar-add-project",label:h.addProject,icon:c.FolderPlus,shortcutKeys:S,theme:s}),o[2]=l,o[3]=h.addProject,o[4]=S,o[5]=s,o[6]=w):w=o[6],o[7]!==h.usage||o[8]!==v||o[9]!==s?(W=(0,oe.jsx)(re,{onPress:v,testID:"sidebar-usage-icon",label:h.usage,icon:c.CircleGauge,theme:s}),o[7]=h.usage,o[8]=v,o[9]=s,o[10]=W):W=o[10],o[11]!==p||o[12]!==b||o[13]!==h.hosts||o[14]!==s?(y=(0,oe.jsx)(ne,{theme:s,label:h.hosts,onAddHost:p,onOpenHostSettings:b}),o[11]=p,o[12]=b,o[13]=h.hosts,o[14]=s,o[15]=y):y=o[15],o[16]===Symbol.for("react.memo_cache_sentinel")?(R=(0,oe.jsx)(t.View,{style:We.footerSpacer}),x=(0,oe.jsx)(D.SidebarHelpMenu,{}),o[16]=R,o[17]=x):(R=o[16],x=o[17]),o[18]!==u||o[19]!==h.settings||o[20]!==_||o[21]!==s?(k=(0,oe.jsx)(re,{onPress:u,testID:"sidebar-settings",label:h.settings,icon:c.Settings,shortcutKeys:_,theme:s}),o[18]=u,o[19]=h.settings,o[20]=_,o[21]=s,o[22]=k):k=o[22],o[23]!==w||o[24]!==W||o[25]!==y||o[26]!==k?(I=(0,oe.jsxs)(t.View,{style:We.sidebarFooter,testID:"sidebar-footer-bottom-line",children:[w,W,y,R,x,k]}),o[23]=w,o[24]=W,o[25]=y,o[26]=k,o[27]=I):I=o[27],o[28]!==j||o[29]!==I?(P=(0,oe.jsxs)(t.View,{style:We.footerContainer,testID:"sidebar-footer",children:[j,I]}),o[28]=j,o[29]=I,o[30]=P):P=o[30],P}function le(e){const o=(0,n.c)(20),{onBeforeNavigate:s}=e,{items:l}=(0,L.useSidebarNavItems)("footer"),c=(0,Y.useHasUsageSummary)();(0,Y.useUsageAutoRefresh)((0,Y.useUsageHostId)());const u=(0,h.useRef)(null);let p,b,f,S,_,v,j,w,W;if(o[0]!==c||o[1]!==l||o[2]!==s){v=Symbol.for("react.early_return_sentinel");{let e;o[9]!==c?(e=e=>e.visible&&("plugin"===e.kind||c),o[9]=c,o[10]=e):e=o[10];const n=l.filter(e);0!==n.length?(p=t.View,b=u,f=!1,S=We.footerRows,_=n.map(e=>"plugin"===e.kind?(0,oe.jsx)(K.PluginSidebarItem,{group:e.group,section:"footer",fallbackAnchorRef:u,onBeforeNavigate:s},e.key):(0,oe.jsx)(Y.UsageSidebarItem,{},e.key))):v=null}o[0]=c,o[1]=l,o[2]=s,o[3]=p,o[4]=b,o[5]=f,o[6]=S,o[7]=_,o[8]=v}else p=o[3],b=o[4],f=o[5],S=o[6],_=o[7],v=o[8];return v!==Symbol.for("react.early_return_sentinel")?v:(o[11]!==p||o[12]!==b||o[13]!==f||o[14]!==S||o[15]!==_?(j=(0,oe.jsx)(p,{ref:b,collapsable:f,style:S,children:_}),o[11]=p,o[12]=b,o[13]=f,o[14]=S,o[15]=_,o[16]=j):j=o[16],o[17]===Symbol.for("react.memo_cache_sentinel")?(w=(0,oe.jsx)(P.SidebarSeparator,{testID:"sidebar-footer-separator"}),o[17]=w):w=o[17],o[18]!==j?(W=(0,oe.jsxs)(oe.Fragment,{children:[j,w]}),o[18]=j,o[19]=W):W=o[19],W)}function ce(e){const o=(0,n.c)(56),{active:l,theme:u,workspaceGroups:h,projectIconTargets:p,pinnedGroups:b,projects:f,hasProjectsBeforeFilter:S,hasActiveProjectFilter:_,workspaceEntriesByKey:v,isInitialLoad:j,isRevalidating:w,isManualRefresh:W,groupMode:y,collapsedProjectKeys:R,shortcutIndexByWorkspaceKey:x,toggleProjectCollapsed:k,handleRefresh:I,handleOpenProject:P,handleImportSession:D,handleSettings:T,labels:O,handleAddHost:A,handleOpenHostSettings:z,insetsTop:B,insetsBottom:C,closeSidebar:E}=e,F=(0,M.useSidebarViewStore)(ue),{gesture:G,gestureRef:N}=(0,U.useCloseAgentListGesture)();let K;o[0]!==E?(K=()=>{E()},o[0]=E,o[1]=K):K=o[1];const V=K;let L;o[2]!==C||o[3]!==B||o[4]!==u.colors.surfaceSidebar?(L={paddingTop:B,paddingBottom:C,backgroundColor:u.colors.surfaceSidebar},o[2]=C,o[3]=B,o[4]=u.colors.surfaceSidebar,o[5]=L):L=o[5];const X=L;let Z,$,Y,ee,se,ie,re,ne;return o[6]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,oe.jsx)(q.WindowChromeSafeArea,{placement:"below"}),o[6]=Z):Z=o[6],o[7]!==E?($=(0,oe.jsx)(H.SidebarNavRows,{style:We.sidebarHeaderGroup,onBeforeNavigate:E}),o[7]=E,o[8]=$):$=o[8],o[9]!==u.colors.foreground||o[10]!==u.colors.foregroundMuted||o[11]!==u.iconSize.md?(Y=e=>{const{hovered:t,pressed:o}=e;return(0,oe.jsx)(c.X,{size:u.iconSize.md,color:t||o?u.colors.foreground:u.colors.foregroundMuted})},o[9]=u.colors.foreground,o[10]=u.colors.foregroundMuted,o[11]=u.iconSize.md,o[12]=Y):Y=o[12],o[13]!==E||o[14]!==O.closeSidebar||o[15]!==Y?(ee=(0,oe.jsx)(q.WindowChromeSafeArea,{placement:"inline",pointerEvents:"box-none",style:We.mobileCloseButtonRow,children:(0,oe.jsx)(s.Pressable,{style:We.mobileCloseButton,onPress:E,testID:"sidebar-close",nativeID:"sidebar-close",accessible:!0,accessibilityRole:"button",accessibilityLabel:O.closeSidebar,hitSlop:8,children:Y})}),o[13]=E,o[14]=O.closeSidebar,o[15]=Y,o[16]=ee):ee=o[16],o[17]!==l||o[18]!==N||o[19]!==R||o[20]!==y||o[21]!==D||o[22]!==P||o[23]!==I||o[24]!==V||o[25]!==F||o[26]!==_||o[27]!==S||o[28]!==j||o[29]!==W||o[30]!==w||o[31]!==b||o[32]!==p||o[33]!==f||o[34]!==x||o[35]!==k||o[36]!==v||o[37]!==h?(se=j&&!F?(0,oe.jsx)(Q.SidebarAgentListSkeleton,{}):(0,oe.jsx)(te.SidebarWorkspaceList,{collapsedProjectKeys:R,onToggleProjectCollapsed:k,shortcutIndexByWorkspaceKey:x,groupMode:y,workspaceGroups:h,projectIconTargets:p,pinnedGroups:b,projects:f,hasProjectsBeforeFilter:S,hasActiveProjectFilter:_,workspaceEntriesByKey:v,isRefreshing:W&&w,onRefresh:I,onWorkspacePress:V,onAddProject:P,onImportSession:D,parentGestureRef:N,dragGestureHostActive:l,listHeaderComponent:je}),o[17]=l,o[18]=N,o[19]=R,o[20]=y,o[21]=D,o[22]=P,o[23]=I,o[24]=V,o[25]=F,o[26]=_,o[27]=S,o[28]=j,o[29]=W,o[30]=w,o[31]=b,o[32]=p,o[33]=f,o[34]=x,o[35]=k,o[36]=v,o[37]=h,o[38]=se):se=o[38],o[39]!==E||o[40]!==A||o[41]!==z||o[42]!==P||o[43]!==T||o[44]!==O||o[45]!==u?(ie=(0,oe.jsx)(de,{theme:u,handleOpenProject:P,handleSettings:T,labels:O,handleAddHost:A,handleOpenHostSettings:z,onBeforeNavigate:E}),o[39]=E,o[40]=A,o[41]=z,o[42]=P,o[43]=T,o[44]=O,o[45]=u,o[46]=ie):ie=o[46],o[47]!==$||o[48]!==ee||o[49]!==se||o[50]!==ie?(re=(0,oe.jsxs)(t.View,{style:We.sidebarContent,pointerEvents:"auto",children:[Z,$,ee,se,ie]}),o[47]=$,o[48]=ee,o[49]=se,o[50]=ie,o[51]=re):re=o[51],o[52]!==G||o[53]!==X||o[54]!==re?(ne=(0,oe.jsx)(J.MobilePanelOverlay,{panel:"agent-list",closeGesture:G,panelStyle:X,children:re}),o[52]=G,o[53]=X,o[54]=re,o[55]=ne):ne=o[55],ne}function ue(e){return e.hostFilters.length>0}const he={code:"function leftSidebarTsx1(){const{scheduleOnRN,hideResizeGrip}=this.__closure;scheduleOnRN(hideResizeGrip);}"},pe={code:"function leftSidebarTsx2(event_1){const{startWidthRef,runOnJS,setSidebarWidth,resolveDesktopSidebarWidth,viewportWidth}=this.__closure;const requestedWidth=startWidthRef.current+event_1.absoluteX;runOnJS(setSidebarWidth)(resolveDesktopSidebarWidth({requestedWidth:requestedWidth,viewportWidth:viewportWidth}));}"},ge={code:"function leftSidebarTsx3(event_0){const{startWidthRef,resizeWidth,resolveDesktopSidebarWidth,viewportWidth}=this.__closure;const newWidth=startWidthRef.current+event_0.absoluteX;resizeWidth.value=resolveDesktopSidebarWidth({requestedWidth:newWidth,viewportWidth:viewportWidth});}"},be={code:"function leftSidebarTsx4(event){const{startWidthRef,visibleSidebarWidth,resizeWidth}=this.__closure;startWidthRef.current=visibleSidebarWidth-event.absoluteX;resizeWidth.value=visibleSidebarWidth;}"},fe={code:"function leftSidebarTsx5(){const{scheduleOnRN,showResizeGrip}=this.__closure;scheduleOnRN(showResizeGrip);}"},Se={code:"function leftSidebarTsx6(){const{active,revealProgress,resizeWidth}=this.__closure;const isVisible=active||revealProgress.value>0;return{width:resizeWidth.value,transform:[{translateX:(revealProgress.value-1)*resizeWidth.value}],display:isVisible?\"flex\":\"none\"};}"};function ve({theme:e,workspaceGroups:o,projectIconTargets:s,pinnedGroups:n,projects:l,hasProjectsBeforeFilter:c,hasActiveProjectFilter:u,workspaceEntriesByKey:p,isInitialLoad:j,isRevalidating:w,isManualRefresh:k,groupMode:I,collapsedProjectKeys:P,shortcutIndexByWorkspaceKey:D,toggleProjectCollapsed:O,handleRefresh:A,handleOpenProject:z,handleImportSession:B,handleSettings:C,labels:E,handleAddHost:F,handleOpenHostSettings:G,insetsTop:N,active:K,overlay:V}){const L=(0,q.useOwnsWindowChromeCorner)("top-left"),U=(0,M.useSidebarViewStore)(e=>e.hostFilters.length>0),J=(0,X.usePanelStore)(e=>e.sidebarWidth),Z=(0,X.usePanelStore)(e=>e.setSidebarWidth),{width:$}=(0,b.default)(),Y=(0,R.resolveDesktopSidebarWidth)({requestedWidth:J,viewportWidth:$}),se=(0,h.useRef)(Y),ie=(0,S.useSharedValue)(Y),re=(0,S.useSharedValue)(K?1:0),[ne,ae]=(0,h.useState)(!1),le=(0,h.useCallback)(()=>ae(!0),[]),ce=(0,h.useCallback)(()=>ae(!1),[]);(0,h.useEffect)(()=>{ie.value=Y},[ie,Y]),(0,h.useEffect)(()=>{re.value=(0,S.withTiming)(K?1:0,{duration:160})},[K,re]);const ue=(0,h.useMemo)(()=>f.Gesture.Pan().hitSlop({left:8,right:8,top:0,bottom:0}).onBegin((function({_worklet_9902008124979_init_data:e,scheduleOnRN:t,showResizeGrip:o}){const s=function(){t(o)};return s.__closure={scheduleOnRN:t,showResizeGrip:o},s.__workletHash=9902008124979,s.__initData=e,s})({_worklet_9902008124979_init_data:fe,scheduleOnRN:v.scheduleOnRN,showResizeGrip:le})).activeOffsetX([-x.SIDEBAR_RESIZE_ACTIVATION_OFFSET,x.SIDEBAR_RESIZE_ACTIVATION_OFFSET]).failOffsetY([-x.SIDEBAR_RESIZE_FAIL_OFFSET,x.SIDEBAR_RESIZE_FAIL_OFFSET]).onStart((function({_worklet_6867788022184_init_data:e,startWidthRef:t,visibleSidebarWidth:o,resizeWidth:s}){const n=function(e){t.current=o-e.absoluteX,s.value=o};return n.__closure={startWidthRef:t,visibleSidebarWidth:o,resizeWidth:s},n.__workletHash=6867788022184,n.__initData=e,n})({_worklet_6867788022184_init_data:be,startWidthRef:se,visibleSidebarWidth:Y,resizeWidth:ie})).onUpdate((function({_worklet_3927158530349_init_data:e,startWidthRef:t,resizeWidth:o,resolveDesktopSidebarWidth:s,viewportWidth:n}){const l=function(e){const l=t.current+e.absoluteX;o.value=s({requestedWidth:l,viewportWidth:n})};return l.__closure={startWidthRef:t,resizeWidth:o,resolveDesktopSidebarWidth:s,viewportWidth:n},l.__workletHash=3927158530349,l.__initData=e,l})({_worklet_3927158530349_init_data:ge,startWidthRef:se,resizeWidth:ie,resolveDesktopSidebarWidth:R.resolveDesktopSidebarWidth,viewportWidth:$})).onEnd((function({_worklet_4066979490328_init_data:e,startWidthRef:t,runOnJS:o,setSidebarWidth:s,resolveDesktopSidebarWidth:n,viewportWidth:l}){const c=function(e){const c=t.current+e.absoluteX;o(s)(n({requestedWidth:c,viewportWidth:l}))};return c.__closure={startWidthRef:t,runOnJS:o,setSidebarWidth:s,resolveDesktopSidebarWidth:n,viewportWidth:l},c.__workletHash=4066979490328,c.__initData=e,c})({_worklet_4066979490328_init_data:pe,startWidthRef:se,runOnJS:S.runOnJS,setSidebarWidth:Z,resolveDesktopSidebarWidth:R.resolveDesktopSidebarWidth,viewportWidth:$})).onFinalize((function({_worklet_528571758775_init_data:e,scheduleOnRN:t,hideResizeGrip:o}){const s=function(){t(o)};return s.__closure={scheduleOnRN:t,hideResizeGrip:o},s.__workletHash=528571758775,s.__initData=e,s})({_worklet_528571758775_init_data:he,scheduleOnRN:v.scheduleOnRN,hideResizeGrip:ce})),[ce,ie,Z,le,$,Y]),ve=(0,S.useAnimatedStyle)((function({_worklet_15263543826749_init_data:e,active:t,revealProgress:o,resizeWidth:s}){const n=function(){const e=t||o.value>0;return{width:s.value,transform:[{translateX:(o.value-1)*s.value}],display:e?"flex":"none"}};return n.__closure={active:t,revealProgress:o,resizeWidth:s},n.__workletHash=0xde1d21b993d,n.__initData=e,n})({_worklet_15263543826749_init_data:Se,active:K,revealProgress:re,resizeWidth:ie})),me=(0,h.useMemo)(()=>[we.desktopSidebar,ve],[ve]),ye=(0,h.useMemo)(()=>[We.desktopSidebarBorder,{flex:1,paddingTop:N}],[N]),Re=(0,h.useMemo)(()=>[We.sidebarHeaderGroup,L&&We.sidebarHeaderGroupBelowChrome],[L]);return(0,oe.jsx)(_.default.View,{testID:"left-sidebar",accessibilityElementsHidden:!K,importantForAccessibility:K?"auto":"no-hide-descendants",pointerEvents:K?"auto":"none",style:me,children:(0,oe.jsxs)(t.View,{style:ye,children:[(0,oe.jsxs)(t.View,{style:We.sidebarDragArea,children:[L||V?(0,oe.jsxs)(t.View,{style:We.desktopChromeRow,children:[(0,oe.jsx)(W.TitlebarDragRegion,{}),V?(0,oe.jsx)(q.WindowChromeSafeArea,{placement:"inline",horizontalPadding:12,style:We.overlaySidebarToggle,children:(0,oe.jsx)(y.WindowSidebarMenuToggle,{})}):null,null]}):(0,oe.jsx)(W.TitlebarDragRegion,{}),(0,oe.jsx)(H.SidebarNavRows,{style:Re})]}),j&&!U?(0,oe.jsx)(Q.SidebarAgentListSkeleton,{}):(0,oe.jsx)(te.SidebarWorkspaceList,{collapsedProjectKeys:P,onToggleProjectCollapsed:O,shortcutIndexByWorkspaceKey:D,groupMode:I,workspaceGroups:o,projectIconTargets:s,pinnedGroups:n,projects:l,hasProjectsBeforeFilter:c,hasActiveProjectFilter:u,workspaceEntriesByKey:p,isRefreshing:k&&w,onRefresh:A,onAddProject:z,onImportSession:B,listHeaderComponent:je}),(0,oe.jsx)(ee.SidebarCalloutSlot,{}),(0,oe.jsx)(de,{theme:e,handleOpenProject:z,handleSettings:C,labels:E,handleAddHost:F,handleOpenHostSettings:G}),(0,oe.jsx)(T.SidebarResizeHandle,{edge:"right",gesture:ue,pressed:ne,testID:"left-sidebar-resize-handle"})]})})}function me(){const e=(0,n.c)(3);let s,l,c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,oe.jsx)(o.Text,{style:We.workspacesSectionTitle,children:"Workspaces"}),e[0]=s):s=e[0],e[1]===Symbol.for("react.memo_cache_sentinel")?(l=(0,oe.jsx)(A.TooltipTrigger,{asChild:!0,children:(0,oe.jsx)(t.View,{children:(0,oe.jsx)(I.SidebarDisplayPreferencesMenu,{})})}),e[1]=l):l=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,oe.jsxs)(t.View,{style:We.workspacesSectionHeader,children:[s,(0,oe.jsx)(t.View,{style:We.workspacesSectionActions,children:(0,oe.jsxs)(A.Tooltip,{delayDuration:300,children:[l,(0,oe.jsx)(A.TooltipContent,{side:"bottom",align:"center",offset:8,children:(0,oe.jsx)(ae,{label:"Display preferences"})})]})})]}),e[2]=c):c=e[2],c}const je=(0,oe.jsx)(me,{}),we=p.default.create({desktopSidebar:{position:"relative"}}),We=w.StyleSheet.create(e=>({sidebarHeaderGroup:{paddingTop:e.spacing[2],gap:2,paddingBottom:e.spacing[1.5],borderBottomWidth:1,borderBottomColor:e.colors.border,uni__dependencies:[0]},sidebarHeaderGroupBelowChrome:{paddingTop:0},workspacesSectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:e.spacing[2],paddingLeft:e.spacing[2],paddingRight:4,paddingTop:e.spacing[1],paddingBottom:e.spacing[1],uni__dependencies:[0]},workspacesSectionTitle:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.normal,uni__dependencies:[0]},workspacesSectionActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],uni__dependencies:[0]},sidebarContent:{flex:1,minHeight:0},mobileCloseButtonRow:{position:"absolute",top:e.spacing[3],left:0,right:0,zIndex:2,alignItems:"flex-end",uni__dependencies:[0]},mobileCloseButton:{marginRight:e.spacing[2]+1.5,width:32,height:32,alignItems:"center",justifyContent:"center",borderRadius:e.borderRadius.lg,backgroundColor:e.colors.surfaceSidebar,uni__dependencies:[0]},desktopSidebarBorder:{borderRightWidth:1,borderRightColor:e.colors.border,backgroundColor:e.colors.surfaceSidebar,uni__dependencies:[0]},sidebarDragArea:{position:"relative"},desktopChromeRow:{position:"relative",height:z.HEADER_INNER_HEIGHT,flexDirection:"row",alignItems:"center",justifyContent:"flex-end",paddingHorizontal:e.spacing[3],borderBottomWidth:e.borderWidth[1],borderBottomColor:"transparent",uni__dependencies:[0]},overlaySidebarToggle:{position:"absolute",left:0,height:z.HEADER_INNER_HEIGHT,flexDirection:"row",alignItems:"center"},devBuildBadge:{maxWidth:"60%",flexDirection:"row",alignItems:"center",gap:e.spacing[1],paddingHorizontal:e.spacing[2],paddingVertical:2,borderRadius:e.borderRadius.full,backgroundColor:e.colors.accent,uni__dependencies:[0]},devBuildBadgeText:{minWidth:0,flexShrink:1,color:e.colors.accentForeground,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},footerContainer:{borderTopWidth:1,borderTopColor:e.colors.border,uni__dependencies:[0]},sidebarFooter:{flexDirection:"row",alignItems:"center",paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1.5],uni__dependencies:[0]},footerSpacer:{flex:1},footerRows:{paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1.5],gap:2,uni__dependencies:[0]},footerIconButton:{width:28,height:28,alignItems:"center",justifyContent:"center",paddingVertical:e.spacing[1],paddingHorizontal:e.spacing[1],uni__dependencies:[0]},tooltipRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},tooltipText:{fontSize:e.fontSize.base,color:e.colors.popoverForeground,uni__dependencies:[0]}}));function ye(e){return e.showMobileAgent}function Re(){l.router.push((0,Z.buildSettingsRoute)())}function xe(){l.router.push((0,Z.buildSettingsAddHostRoute)(Date.now()))}function ke(e){(0,$.openHostOverview)(e)}},4110,[896,897,898,454,456,1218,854,37,426,60,235,451,147,3037,899,902,627,57,4111,4112,4118,4119,3839,4120,3737,4142,4155,4158,3731,3711,1217,3808,3810,4143,4122,3709,3845,3529,4144,4153,4154,3797,4050,4160,4165,3675,4166,4167,4193,4196,4197,280]);
|
|
15765
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"LeftSidebar",{enumerable:!0,get:function(){return se}});var t=r(d[0]),o=r(d[1]),s=r(d[2]),n=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]),h=r(d[7]);r(d[8]);var p=e(r(d[9]));r(d[10]);var b=e(r(d[11]));r(d[12]);var f=r(d[13]),S=r(d[14]),_=e(S),v=r(d[15]),j=r(d[16]),w=r(d[17]),W=r(d[18]),y=r(d[19]),R=r(d[20]),x=r(d[21]),k=r(d[22]),I=r(d[23]),P=r(d[24]),H=r(d[25]),D=r(d[26]),T=r(d[27]),O=r(d[28]),A=r(d[29]),z=r(d[30]),B=r(d[31]),C=r(d[32]),E=r(d[33]),F=r(d[34]),G=r(d[35]),M=r(d[36]),N=r(d[37]),K=r(d[38]),V=r(d[39]),L=r(d[40]),X=r(d[41]),q=r(d[42]),U=r(d[43]),J=r(d[44]),Z=r(d[45]),$=r(d[46]),Y=r(d[47]),Q=r(d[48]),ee=r(d[49]),te=r(d[50]),oe=r(d[51]);const se=(0,h.memo)(function(e){const t=(0,n.c)(88),{chromeEnabled:o,active:s,overlay:c}=e,{theme:p}=(0,w.useUnistyles)(),{t:b}=(0,u.useTranslation)(),f=(0,j.useSafeAreaInsets)(),S=(0,z.useIsCompactFormFactor)(),_=(0,X.usePanelStore)(ye),{projects:v,hasProjectsBeforeFilter:W,resolvedProjectFilters:y,workspaceEntriesByKey:R,isInitialLoad:x,isRevalidating:k,refreshAll:I,workspaceGroups:P,projectIconTargets:H,pinnedGroups:D,collapsedProjectKeys:T,toggleProjectCollapsed:O,groupMode:A,shortcutModel:E}=(0,F.useSidebarModel)(),{shortcutIndexByWorkspaceKey:M}=E,[N,K]=(0,h.useState)(!1);let L;t[0]!==I?(L=()=>{K(!0),I()},t[0]=I,t[1]=L):L=t[1];const q=L;let U,J;t[2]!==N||t[3]!==k?(U=()=>{!k&&N&&K(!1)},J=[k,N],t[2]=N,t[3]=k,t[4]=U,t[5]=J):(U=t[4],J=t[5]),(0,h.useEffect)(U,J);const Y=(0,B.useOpenAddProject)(),{open:Q,sheet:ee}=(0,C.useImportSession)();let te;t[6]!==Y||t[7]!==_?(te=()=>{_(),Y()},t[6]=Y,t[7]=_,t[8]=te):te=t[8];const se=te;let re;t[9]!==Y?(re=()=>{Y()},t[9]=Y,t[10]=re):re=t[10];const ie=re;let ne;t[11]!==_?(ne=()=>{_(),l.router.push((0,Z.buildSettingsRoute)())},t[11]=_,t[12]=ne):ne=t[12];const ae=ne,de=Re;let le;t[13]!==_?(le=()=>{_(),l.router.push((0,Z.buildSettingsAddHostRoute)(Date.now()))},t[13]=_,t[14]=le):le=t[14];const ue=le,he=xe;let pe;t[15]!==_?(pe=e=>{_(),(0,$.openHostOverview)(e)},t[15]=_,t[16]=pe):pe=t[16];const ge=pe,be=ke;let fe;t[17]!==Q||t[18]!==_?(fe=()=>{_(),Q()},t[17]=Q,t[18]=_,t[19]=fe):fe=t[19];const Se=fe;let ve,je,we,We,Ie,Pe,He;t[20]!==b?(ve=b("sidebar.actions.addProject"),t[20]=b,t[21]=ve):ve=t[21],t[22]!==b?(je=b("sidebar.actions.hosts"),t[22]=b,t[23]=je):je=t[23],t[24]!==b?(we=b("sidebar.actions.settings"),t[24]=b,t[25]=we):we=t[25],t[26]!==b?(We=b("sidebar.host.searchPlaceholder"),t[26]=b,t[27]=We):We=t[27],t[28]!==b?(Ie=b((0,V.builtinSidebarNavLabelKey)("usage")),t[28]=b,t[29]=Ie):Ie=t[29],t[30]!==b?(Pe=b("sidebar.actions.closeSidebar"),t[30]=b,t[31]=Pe):Pe=t[31],t[32]!==ve||t[33]!==je||t[34]!==we||t[35]!==We||t[36]!==Ie||t[37]!==Pe?(He={addProject:ve,hosts:je,settings:we,searchHosts:We,usage:Ie,closeSidebar:Pe},t[32]=ve,t[33]=je,t[34]=we,t[35]=We,t[36]=Ie,t[37]=Pe,t[38]=He):He=t[38];const De=He,Te=0!==y?.length;let Oe;t[39]!==T||t[40]!==A||t[41]!==q||t[42]!==W||t[43]!==x||t[44]!==N||t[45]!==k||t[46]!==De||t[47]!==D||t[48]!==H||t[49]!==v||t[50]!==M||t[51]!==Te||t[52]!==p||t[53]!==O||t[54]!==R||t[55]!==P?(Oe={theme:p,workspaceGroups:P,projectIconTargets:H,pinnedGroups:D,projects:v,hasProjectsBeforeFilter:W,hasActiveProjectFilter:Te,workspaceEntriesByKey:R,isInitialLoad:x,isRevalidating:k,isManualRefresh:N,groupMode:A,collapsedProjectKeys:T,shortcutIndexByWorkspaceKey:M,toggleProjectCollapsed:O,handleRefresh:q,labels:De},t[39]=T,t[40]=A,t[41]=q,t[42]=W,t[43]=x,t[44]=N,t[45]=k,t[46]=De,t[47]=D,t[48]=H,t[49]=v,t[50]=M,t[51]=Te,t[52]=p,t[53]=O,t[54]=R,t[55]=P,t[56]=Oe):Oe=t[56];const Ae=Oe;if(S){let e,o,n;return t[57]!==s||t[58]!==ue||t[59]!==Se||t[60]!==ge||t[61]!==se||t[62]!==ae||t[63]!==f.bottom||t[64]!==f.top||t[65]!==Ae||t[66]!==_?(e=(0,oe.jsx)(ce,Object.assign({},Ae,{active:s,insetsTop:f.top,insetsBottom:f.bottom,closeSidebar:_,handleOpenProject:se,handleImportSession:Se,handleSettings:ae,handleAddHost:ue,handleOpenHostSettings:ge})),t[57]=s,t[58]=ue,t[59]=Se,t[60]=ge,t[61]=se,t[62]=ae,t[63]=f.bottom,t[64]=f.top,t[65]=Ae,t[66]=_,t[67]=e):e=t[67],t[68]!==s||t[69]!==e?(o=(0,oe.jsx)(G.RetainedPanelActivity,{active:s,children:e}),t[68]=s,t[69]=e,t[70]=o):o=t[70],t[71]!==ee||t[72]!==o?(n=(0,oe.jsxs)(oe.Fragment,{children:[o,ee]}),t[71]=ee,t[72]=o,t[73]=n):n=t[73],n}let ze,Be,Ce;return t[74]!==s||t[75]!==o||t[76]!==ie||t[77]!==f.top||t[78]!==Q||t[79]!==c||t[80]!==Ae?(ze=(0,oe.jsx)(me,Object.assign({},Ae,{chromeEnabled:o,insetsTop:f.top,active:s,overlay:c,handleOpenProject:ie,handleImportSession:Q,handleSettings:de,handleAddHost:he,handleOpenHostSettings:be})),t[74]=s,t[75]=o,t[76]=ie,t[77]=f.top,t[78]=Q,t[79]=c,t[80]=Ae,t[81]=ze):ze=t[81],t[82]!==s||t[83]!==ze?(Be=(0,oe.jsx)(G.RetainedPanelActivity,{active:s,children:ze}),t[82]=s,t[83]=ze,t[84]=Be):Be=t[84],t[85]!==ee||t[86]!==Be?(Ce=(0,oe.jsxs)(oe.Fragment,{children:[Be,ee]}),t[85]=ee,t[86]=Be,t[87]=Ce):Ce=t[87],Ce});function re(e){return`sidebar-host-row-${e}`}function ie(e){const t=(0,n.c)(21),{buttonRef:o,onPress:l,testID:c,label:u,icon:h,iconSize:p,shortcutKeys:b,theme:f}=e;let S,_;t[0]!==h||t[1]!==p||t[2]!==f.colors.foreground||t[3]!==f.colors.foregroundMuted||t[4]!==f.iconSize?(S=e=>{const{hovered:t}=e;return(0,oe.jsx)(h,{size:p??f.iconSize.md,color:t?f.colors.foreground:f.colors.foregroundMuted})},t[0]=h,t[1]=p,t[2]=f.colors.foreground,t[3]=f.colors.foregroundMuted,t[4]=f.iconSize,t[5]=S):S=t[5],t[6]!==o||t[7]!==u||t[8]!==l||t[9]!==S||t[10]!==c?(_=(0,oe.jsx)(A.TooltipTrigger,{asChild:!0,children:(0,oe.jsx)(s.Pressable,{ref:o,style:We.footerIconButton,testID:c,nativeID:c,collapsable:!1,accessible:!0,accessibilityLabel:u,accessibilityRole:"button",onPress:l,children:S})}),t[6]=o,t[7]=u,t[8]=l,t[9]=S,t[10]=c,t[11]=_):_=t[11];const v=`${c}-tooltip`;let j,w,W;return t[12]!==u||t[13]!==b?(j=(0,oe.jsx)(ae,{label:u,shortcutKeys:b}),t[12]=u,t[13]=b,t[14]=j):j=t[14],t[15]!==v||t[16]!==j?(w=(0,oe.jsx)(A.TooltipContent,{side:"top",align:"center",offset:8,testID:v,children:j}),t[15]=v,t[16]=j,t[17]=w):w=t[17],t[18]!==_||t[19]!==w?(W=(0,oe.jsxs)(A.Tooltip,{delayDuration:300,children:[_,w]}),t[18]=_,t[19]=w,t[20]=W):W=t[20],W}function ne(e){const t=(0,n.c)(14),{theme:o,label:s,onAddHost:l,onOpenHostSettings:u}=e,p=(0,N.useHosts)(),b=(0,h.useRef)(null),[f,S]=(0,h.useState)(!1);let _;t[0]!==u?(_=e=>{u(e)},t[0]=u,t[1]=_):_=t[1];const v=_;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>S(!0),t[2]=j):j=t[2];const w=j,W=o.iconSize.md-1;let y,R;return t[3]!==s||t[4]!==W||t[5]!==o?(y=(0,oe.jsx)(ie,{buttonRef:b,onPress:w,testID:"sidebar-hosts-trigger",label:s,icon:c.Server,iconSize:W,theme:o}),t[3]=s,t[4]=W,t[5]=o,t[6]=y):y=t[6],t[7]!==v||t[8]!==p||t[9]!==f||t[10]!==l||t[11]!==u||t[12]!==y?(R=(0,oe.jsx)(k.HostPicker,{hosts:p,value:"",onSelect:v,open:f,onOpenChange:S,anchorRef:b,includeAddHost:!0,onAddHost:l,showActiveConnection:!0,onOpenHostSettings:u,searchable:!0,desktopPlacement:"top-start",desktopMinWidth:240,addHostTestID:"sidebar-host-add",hostOptionTestID:re,children:y}),t[7]=v,t[8]=p,t[9]=f,t[10]=l,t[11]=u,t[12]=y,t[13]=R):R=t[13],R}function ae(e){const s=(0,n.c)(7),{label:l,shortcutKeys:c}=e;let u,h,p;return s[0]!==l?(u=(0,oe.jsx)(o.Text,{style:We.tooltipText,children:l}),s[0]=l,s[1]=u):u=s[1],s[2]!==c?(h=c?(0,oe.jsx)(O.Shortcut,{chord:c}):null,s[2]=c,s[3]=h):h=s[3],s[4]!==u||s[5]!==h?(p=(0,oe.jsxs)(t.View,{style:We.tooltipRow,children:[u,h]}),s[4]=u,s[5]=h,s[6]=p):p=s[6],p}function de(e){const o=(0,n.c)(31),{theme:s,handleOpenProject:l,handleSettings:u,labels:h,handleAddHost:p,handleOpenHostSettings:b,onBeforeNavigate:f}=e,S=(0,E.useShortcutKeys)("new-agent"),_=(0,E.useShortcutKeys)("toggle-settings"),v=(0,Y.useOpenUsageScreen)();let j,w,W,y,R,x,k,I,P;return o[0]!==f?(j=(0,oe.jsx)(le,{onBeforeNavigate:f}),o[0]=f,o[1]=j):j=o[1],o[2]!==l||o[3]!==h.addProject||o[4]!==S||o[5]!==s?(w=(0,oe.jsx)(ie,{onPress:l,testID:"sidebar-add-project",label:h.addProject,icon:c.FolderPlus,shortcutKeys:S,theme:s}),o[2]=l,o[3]=h.addProject,o[4]=S,o[5]=s,o[6]=w):w=o[6],o[7]!==h.usage||o[8]!==v||o[9]!==s?(W=(0,oe.jsx)(ie,{onPress:v,testID:"sidebar-usage-icon",label:h.usage,icon:c.CircleGauge,theme:s}),o[7]=h.usage,o[8]=v,o[9]=s,o[10]=W):W=o[10],o[11]!==p||o[12]!==b||o[13]!==h.hosts||o[14]!==s?(y=(0,oe.jsx)(ne,{theme:s,label:h.hosts,onAddHost:p,onOpenHostSettings:b}),o[11]=p,o[12]=b,o[13]=h.hosts,o[14]=s,o[15]=y):y=o[15],o[16]===Symbol.for("react.memo_cache_sentinel")?(R=(0,oe.jsx)(t.View,{style:We.footerSpacer}),x=(0,oe.jsx)(D.SidebarHelpMenu,{}),o[16]=R,o[17]=x):(R=o[16],x=o[17]),o[18]!==u||o[19]!==h.settings||o[20]!==_||o[21]!==s?(k=(0,oe.jsx)(ie,{onPress:u,testID:"sidebar-settings",label:h.settings,icon:c.Settings,shortcutKeys:_,theme:s}),o[18]=u,o[19]=h.settings,o[20]=_,o[21]=s,o[22]=k):k=o[22],o[23]!==w||o[24]!==W||o[25]!==y||o[26]!==k?(I=(0,oe.jsxs)(t.View,{style:We.sidebarFooter,testID:"sidebar-footer-bottom-line",children:[w,W,y,R,x,k]}),o[23]=w,o[24]=W,o[25]=y,o[26]=k,o[27]=I):I=o[27],o[28]!==j||o[29]!==I?(P=(0,oe.jsxs)(t.View,{style:We.footerContainer,testID:"sidebar-footer",children:[j,I]}),o[28]=j,o[29]=I,o[30]=P):P=o[30],P}function le(e){const o=(0,n.c)(20),{onBeforeNavigate:s}=e,{items:l}=(0,L.useSidebarNavItems)("footer"),c=(0,Y.useHasUsageSummary)();(0,Y.useUsageAutoRefresh)((0,Y.useUsageHostId)());const u=(0,h.useRef)(null);let p,b,f,S,_,v,j,w,W;if(o[0]!==c||o[1]!==l||o[2]!==s){v=Symbol.for("react.early_return_sentinel");{let e;o[9]!==c?(e=e=>e.visible&&("plugin"===e.kind||c),o[9]=c,o[10]=e):e=o[10];const n=l.filter(e);0!==n.length?(p=t.View,b=u,f=!1,S=We.footerRows,_=n.map(e=>"plugin"===e.kind?(0,oe.jsx)(K.PluginSidebarItem,{group:e.group,section:"footer",fallbackAnchorRef:u,onBeforeNavigate:s},e.key):(0,oe.jsx)(Y.UsageSidebarItem,{},e.key))):v=null}o[0]=c,o[1]=l,o[2]=s,o[3]=p,o[4]=b,o[5]=f,o[6]=S,o[7]=_,o[8]=v}else p=o[3],b=o[4],f=o[5],S=o[6],_=o[7],v=o[8];return v!==Symbol.for("react.early_return_sentinel")?v:(o[11]!==p||o[12]!==b||o[13]!==f||o[14]!==S||o[15]!==_?(j=(0,oe.jsx)(p,{ref:b,collapsable:f,style:S,children:_}),o[11]=p,o[12]=b,o[13]=f,o[14]=S,o[15]=_,o[16]=j):j=o[16],o[17]===Symbol.for("react.memo_cache_sentinel")?(w=(0,oe.jsx)(P.SidebarSeparator,{testID:"sidebar-footer-separator"}),o[17]=w):w=o[17],o[18]!==j?(W=(0,oe.jsxs)(oe.Fragment,{children:[j,w]}),o[18]=j,o[19]=W):W=o[19],W)}function ce(e){const o=(0,n.c)(56),{active:l,theme:u,workspaceGroups:h,projectIconTargets:p,pinnedGroups:b,projects:f,hasProjectsBeforeFilter:S,hasActiveProjectFilter:_,workspaceEntriesByKey:v,isInitialLoad:j,isRevalidating:w,isManualRefresh:W,groupMode:y,collapsedProjectKeys:R,shortcutIndexByWorkspaceKey:x,toggleProjectCollapsed:k,handleRefresh:I,handleOpenProject:P,handleImportSession:D,handleSettings:T,labels:O,handleAddHost:A,handleOpenHostSettings:z,insetsTop:B,insetsBottom:C,closeSidebar:E}=e,F=(0,M.useSidebarViewStore)(ue),{gesture:G,gestureRef:N}=(0,U.useCloseAgentListGesture)();let K;o[0]!==E?(K=()=>{E()},o[0]=E,o[1]=K):K=o[1];const V=K;let L;o[2]!==C||o[3]!==B||o[4]!==u.colors.surfaceSidebar?(L={paddingTop:B,paddingBottom:C,backgroundColor:u.colors.surfaceSidebar},o[2]=C,o[3]=B,o[4]=u.colors.surfaceSidebar,o[5]=L):L=o[5];const X=L;let Z,$,Y,ee,se,re,ie,ne;return o[6]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,oe.jsx)(q.WindowChromeSafeArea,{placement:"below"}),o[6]=Z):Z=o[6],o[7]!==E?($=(0,oe.jsx)(H.SidebarNavRows,{style:We.sidebarHeaderGroup,onBeforeNavigate:E}),o[7]=E,o[8]=$):$=o[8],o[9]!==u.colors.foreground||o[10]!==u.colors.foregroundMuted||o[11]!==u.iconSize.md?(Y=e=>{const{hovered:t,pressed:o}=e;return(0,oe.jsx)(c.X,{size:u.iconSize.md,color:t||o?u.colors.foreground:u.colors.foregroundMuted})},o[9]=u.colors.foreground,o[10]=u.colors.foregroundMuted,o[11]=u.iconSize.md,o[12]=Y):Y=o[12],o[13]!==E||o[14]!==O.closeSidebar||o[15]!==Y?(ee=(0,oe.jsx)(q.WindowChromeSafeArea,{placement:"inline",pointerEvents:"box-none",style:We.mobileCloseButtonRow,children:(0,oe.jsx)(s.Pressable,{style:We.mobileCloseButton,onPress:E,testID:"sidebar-close",nativeID:"sidebar-close",accessible:!0,accessibilityRole:"button",accessibilityLabel:O.closeSidebar,hitSlop:8,children:Y})}),o[13]=E,o[14]=O.closeSidebar,o[15]=Y,o[16]=ee):ee=o[16],o[17]!==l||o[18]!==N||o[19]!==R||o[20]!==y||o[21]!==D||o[22]!==P||o[23]!==I||o[24]!==V||o[25]!==F||o[26]!==_||o[27]!==S||o[28]!==j||o[29]!==W||o[30]!==w||o[31]!==b||o[32]!==p||o[33]!==f||o[34]!==x||o[35]!==k||o[36]!==v||o[37]!==h?(se=j&&!F?(0,oe.jsx)(Q.SidebarAgentListSkeleton,{}):(0,oe.jsx)(te.SidebarWorkspaceList,{collapsedProjectKeys:R,onToggleProjectCollapsed:k,shortcutIndexByWorkspaceKey:x,groupMode:y,workspaceGroups:h,projectIconTargets:p,pinnedGroups:b,projects:f,hasProjectsBeforeFilter:S,hasActiveProjectFilter:_,workspaceEntriesByKey:v,isRefreshing:W&&w,onRefresh:I,onWorkspacePress:V,onAddProject:P,onImportSession:D,parentGestureRef:N,dragGestureHostActive:l,listHeaderComponent:je}),o[17]=l,o[18]=N,o[19]=R,o[20]=y,o[21]=D,o[22]=P,o[23]=I,o[24]=V,o[25]=F,o[26]=_,o[27]=S,o[28]=j,o[29]=W,o[30]=w,o[31]=b,o[32]=p,o[33]=f,o[34]=x,o[35]=k,o[36]=v,o[37]=h,o[38]=se):se=o[38],o[39]!==E||o[40]!==A||o[41]!==z||o[42]!==P||o[43]!==T||o[44]!==O||o[45]!==u?(re=(0,oe.jsx)(de,{theme:u,handleOpenProject:P,handleSettings:T,labels:O,handleAddHost:A,handleOpenHostSettings:z,onBeforeNavigate:E}),o[39]=E,o[40]=A,o[41]=z,o[42]=P,o[43]=T,o[44]=O,o[45]=u,o[46]=re):re=o[46],o[47]!==$||o[48]!==ee||o[49]!==se||o[50]!==re?(ie=(0,oe.jsxs)(t.View,{style:We.sidebarContent,pointerEvents:"auto",children:[Z,$,ee,se,re]}),o[47]=$,o[48]=ee,o[49]=se,o[50]=re,o[51]=ie):ie=o[51],o[52]!==G||o[53]!==X||o[54]!==ie?(ne=(0,oe.jsx)(J.MobilePanelOverlay,{panel:"agent-list",closeGesture:G,panelStyle:X,children:ie}),o[52]=G,o[53]=X,o[54]=ie,o[55]=ne):ne=o[55],ne}function ue(e){return e.hostFilters.length>0}const he={code:"function leftSidebarTsx1(){const{scheduleOnRN,hideResizeGrip}=this.__closure;scheduleOnRN(hideResizeGrip);}"},pe={code:"function leftSidebarTsx2(event_1){const{startWidthRef,runOnJS,setSidebarWidth,resolveDesktopSidebarWidth,viewportWidth}=this.__closure;const requestedWidth=startWidthRef.current+event_1.absoluteX;runOnJS(setSidebarWidth)(resolveDesktopSidebarWidth({requestedWidth:requestedWidth,viewportWidth:viewportWidth}));}"},ge={code:"function leftSidebarTsx3(event_0){const{startWidthRef,resizeWidth,resolveDesktopSidebarWidth,viewportWidth}=this.__closure;const newWidth=startWidthRef.current+event_0.absoluteX;resizeWidth.value=resolveDesktopSidebarWidth({requestedWidth:newWidth,viewportWidth:viewportWidth});}"},be={code:"function leftSidebarTsx4(event){const{startWidthRef,visibleSidebarWidth,resizeWidth}=this.__closure;startWidthRef.current=visibleSidebarWidth-event.absoluteX;resizeWidth.value=visibleSidebarWidth;}"},fe={code:"function leftSidebarTsx5(){const{scheduleOnRN,showResizeGrip}=this.__closure;scheduleOnRN(showResizeGrip);}"},Se={code:"function leftSidebarTsx6(){const{chromeEnabled,active,revealProgress,resizeWidth}=this.__closure;const isVisible=chromeEnabled&&(active||revealProgress.value>0);return{width:resizeWidth.value,transform:[{translateX:(revealProgress.value-1)*resizeWidth.value}],display:isVisible?\"flex\":\"none\"};}"};function me({chromeEnabled:e,theme:o,workspaceGroups:s,projectIconTargets:n,pinnedGroups:l,projects:c,hasProjectsBeforeFilter:u,hasActiveProjectFilter:p,workspaceEntriesByKey:j,isInitialLoad:w,isRevalidating:k,isManualRefresh:I,groupMode:P,collapsedProjectKeys:D,shortcutIndexByWorkspaceKey:O,toggleProjectCollapsed:A,handleRefresh:z,handleOpenProject:B,handleImportSession:C,handleSettings:E,labels:F,handleAddHost:G,handleOpenHostSettings:N,insetsTop:K,active:V,overlay:L}){const U=(0,q.useOwnsWindowChromeCorner)("top-left"),J=(0,M.useSidebarViewStore)(e=>e.hostFilters.length>0),Z=(0,X.usePanelStore)(e=>e.sidebarWidth),$=(0,X.usePanelStore)(e=>e.setSidebarWidth),{width:Y}=(0,b.default)(),se=(0,R.resolveDesktopSidebarWidth)({requestedWidth:Z,viewportWidth:Y}),re=(0,h.useRef)(se),ie=(0,S.useSharedValue)(se),ne=(0,S.useSharedValue)(V?1:0),ae=(0,h.useRef)(e),[le,ce]=(0,h.useState)(!1),ue=(0,h.useCallback)(()=>ce(!0),[]),me=(0,h.useCallback)(()=>ce(!1),[]);(0,h.useEffect)(()=>{ie.value=se},[ie,se]),(0,h.useLayoutEffect)(()=>{const t=e&&ae.current;ae.current=e;const o=V?1:0;ne.value=t?(0,S.withTiming)(o,{duration:160}):o},[V,e,ne]);const ve=(0,h.useMemo)(()=>f.Gesture.Pan().hitSlop({left:8,right:8,top:0,bottom:0}).onBegin((function({_worklet_9902008124979_init_data:e,scheduleOnRN:t,showResizeGrip:o}){const s=function(){t(o)};return s.__closure={scheduleOnRN:t,showResizeGrip:o},s.__workletHash=9902008124979,s.__initData=e,s})({_worklet_9902008124979_init_data:fe,scheduleOnRN:v.scheduleOnRN,showResizeGrip:ue})).activeOffsetX([-x.SIDEBAR_RESIZE_ACTIVATION_OFFSET,x.SIDEBAR_RESIZE_ACTIVATION_OFFSET]).failOffsetY([-x.SIDEBAR_RESIZE_FAIL_OFFSET,x.SIDEBAR_RESIZE_FAIL_OFFSET]).onStart((function({_worklet_6867788022184_init_data:e,startWidthRef:t,visibleSidebarWidth:o,resizeWidth:s}){const n=function(e){t.current=o-e.absoluteX,s.value=o};return n.__closure={startWidthRef:t,visibleSidebarWidth:o,resizeWidth:s},n.__workletHash=6867788022184,n.__initData=e,n})({_worklet_6867788022184_init_data:be,startWidthRef:re,visibleSidebarWidth:se,resizeWidth:ie})).onUpdate((function({_worklet_3927158530349_init_data:e,startWidthRef:t,resizeWidth:o,resolveDesktopSidebarWidth:s,viewportWidth:n}){const l=function(e){const l=t.current+e.absoluteX;o.value=s({requestedWidth:l,viewportWidth:n})};return l.__closure={startWidthRef:t,resizeWidth:o,resolveDesktopSidebarWidth:s,viewportWidth:n},l.__workletHash=3927158530349,l.__initData=e,l})({_worklet_3927158530349_init_data:ge,startWidthRef:re,resizeWidth:ie,resolveDesktopSidebarWidth:R.resolveDesktopSidebarWidth,viewportWidth:Y})).onEnd((function({_worklet_4066979490328_init_data:e,startWidthRef:t,runOnJS:o,setSidebarWidth:s,resolveDesktopSidebarWidth:n,viewportWidth:l}){const c=function(e){const c=t.current+e.absoluteX;o(s)(n({requestedWidth:c,viewportWidth:l}))};return c.__closure={startWidthRef:t,runOnJS:o,setSidebarWidth:s,resolveDesktopSidebarWidth:n,viewportWidth:l},c.__workletHash=4066979490328,c.__initData=e,c})({_worklet_4066979490328_init_data:pe,startWidthRef:re,runOnJS:S.runOnJS,setSidebarWidth:$,resolveDesktopSidebarWidth:R.resolveDesktopSidebarWidth,viewportWidth:Y})).onFinalize((function({_worklet_528571758775_init_data:e,scheduleOnRN:t,hideResizeGrip:o}){const s=function(){t(o)};return s.__closure={scheduleOnRN:t,hideResizeGrip:o},s.__workletHash=528571758775,s.__initData=e,s})({_worklet_528571758775_init_data:he,scheduleOnRN:v.scheduleOnRN,hideResizeGrip:me})),[me,ie,$,ue,Y,se]),ye=(0,S.useAnimatedStyle)((function({_worklet_1749567392304_init_data:e,chromeEnabled:t,active:o,revealProgress:s,resizeWidth:n}){const l=function(){const e=t&&(o||s.value>0);return{width:n.value,transform:[{translateX:(s.value-1)*n.value}],display:e?"flex":"none"}};return l.__closure={chromeEnabled:t,active:o,revealProgress:s,resizeWidth:n},l.__workletHash=1749567392304,l.__initData=e,l})({_worklet_1749567392304_init_data:Se,chromeEnabled:e,active:V,revealProgress:ne,resizeWidth:ie})),Re=(0,h.useMemo)(()=>[we.desktopSidebar,ye],[ye]),xe=(0,h.useMemo)(()=>[We.desktopSidebarBorder,{flex:1,paddingTop:K}],[K]),ke=(0,h.useMemo)(()=>[We.sidebarHeaderGroup,U&&We.sidebarHeaderGroupBelowChrome],[U]);return(0,oe.jsx)(_.default.View,{testID:"left-sidebar",accessibilityElementsHidden:!V,importantForAccessibility:V?"auto":"no-hide-descendants",pointerEvents:V?"auto":"none",style:Re,children:(0,oe.jsxs)(t.View,{style:xe,children:[(0,oe.jsxs)(t.View,{style:We.sidebarDragArea,children:[U||L?(0,oe.jsxs)(t.View,{style:We.desktopChromeRow,children:[(0,oe.jsx)(W.TitlebarDragRegion,{}),L?(0,oe.jsx)(q.WindowChromeSafeArea,{placement:"inline",horizontalPadding:12,style:We.overlaySidebarToggle,children:(0,oe.jsx)(y.WindowSidebarMenuToggle,{})}):null,null]}):(0,oe.jsx)(W.TitlebarDragRegion,{}),(0,oe.jsx)(H.SidebarNavRows,{style:ke})]}),w&&!J?(0,oe.jsx)(Q.SidebarAgentListSkeleton,{}):(0,oe.jsx)(te.SidebarWorkspaceList,{collapsedProjectKeys:D,onToggleProjectCollapsed:A,shortcutIndexByWorkspaceKey:O,groupMode:P,workspaceGroups:s,projectIconTargets:n,pinnedGroups:l,projects:c,hasProjectsBeforeFilter:u,hasActiveProjectFilter:p,workspaceEntriesByKey:j,isRefreshing:I&&k,onRefresh:z,onAddProject:B,onImportSession:C,listHeaderComponent:je}),(0,oe.jsx)(ee.SidebarCalloutSlot,{}),(0,oe.jsx)(de,{theme:o,handleOpenProject:B,handleSettings:E,labels:F,handleAddHost:G,handleOpenHostSettings:N}),(0,oe.jsx)(T.SidebarResizeHandle,{edge:"right",gesture:ve,pressed:le,testID:"left-sidebar-resize-handle"})]})})}function ve(){const e=(0,n.c)(3);let s,l,c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,oe.jsx)(o.Text,{style:We.workspacesSectionTitle,children:"Workspaces"}),e[0]=s):s=e[0],e[1]===Symbol.for("react.memo_cache_sentinel")?(l=(0,oe.jsx)(A.TooltipTrigger,{asChild:!0,children:(0,oe.jsx)(t.View,{children:(0,oe.jsx)(I.SidebarDisplayPreferencesMenu,{})})}),e[1]=l):l=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,oe.jsxs)(t.View,{style:We.workspacesSectionHeader,children:[s,(0,oe.jsx)(t.View,{style:We.workspacesSectionActions,children:(0,oe.jsxs)(A.Tooltip,{delayDuration:300,children:[l,(0,oe.jsx)(A.TooltipContent,{side:"bottom",align:"center",offset:8,children:(0,oe.jsx)(ae,{label:"Display preferences"})})]})})]}),e[2]=c):c=e[2],c}const je=(0,oe.jsx)(ve,{}),we=p.default.create({desktopSidebar:{position:"relative"}}),We=w.StyleSheet.create(e=>({sidebarHeaderGroup:{paddingTop:e.spacing[2],gap:2,paddingBottom:e.spacing[1.5],borderBottomWidth:1,borderBottomColor:e.colors.border,uni__dependencies:[0]},sidebarHeaderGroupBelowChrome:{paddingTop:0},workspacesSectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:e.spacing[2],paddingLeft:e.spacing[2],paddingRight:4,paddingTop:e.spacing[1],paddingBottom:e.spacing[1],uni__dependencies:[0]},workspacesSectionTitle:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.normal,uni__dependencies:[0]},workspacesSectionActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],uni__dependencies:[0]},sidebarContent:{flex:1,minHeight:0},mobileCloseButtonRow:{position:"absolute",top:e.spacing[3],left:0,right:0,zIndex:2,alignItems:"flex-end",uni__dependencies:[0]},mobileCloseButton:{marginRight:e.spacing[2]+1.5,width:32,height:32,alignItems:"center",justifyContent:"center",borderRadius:e.borderRadius.lg,backgroundColor:e.colors.surfaceSidebar,uni__dependencies:[0]},desktopSidebarBorder:{borderRightWidth:1,borderRightColor:e.colors.border,backgroundColor:e.colors.surfaceSidebar,uni__dependencies:[0]},sidebarDragArea:{position:"relative"},desktopChromeRow:{position:"relative",height:z.HEADER_INNER_HEIGHT,flexDirection:"row",alignItems:"center",justifyContent:"flex-end",paddingHorizontal:e.spacing[3],borderBottomWidth:e.borderWidth[1],borderBottomColor:"transparent",uni__dependencies:[0]},overlaySidebarToggle:{position:"absolute",left:0,height:z.HEADER_INNER_HEIGHT,flexDirection:"row",alignItems:"center"},devBuildBadge:{maxWidth:"60%",flexDirection:"row",alignItems:"center",gap:e.spacing[1],paddingHorizontal:e.spacing[2],paddingVertical:2,borderRadius:e.borderRadius.full,backgroundColor:e.colors.accent,uni__dependencies:[0]},devBuildBadgeText:{minWidth:0,flexShrink:1,color:e.colors.accentForeground,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},footerContainer:{borderTopWidth:1,borderTopColor:e.colors.border,uni__dependencies:[0]},sidebarFooter:{flexDirection:"row",alignItems:"center",paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1.5],uni__dependencies:[0]},footerSpacer:{flex:1},footerRows:{paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1.5],gap:2,uni__dependencies:[0]},footerIconButton:{width:28,height:28,alignItems:"center",justifyContent:"center",paddingVertical:e.spacing[1],paddingHorizontal:e.spacing[1],uni__dependencies:[0]},tooltipRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},tooltipText:{fontSize:e.fontSize.base,color:e.colors.popoverForeground,uni__dependencies:[0]}}));function ye(e){return e.showMobileAgent}function Re(){l.router.push((0,Z.buildSettingsRoute)())}function xe(){l.router.push((0,Z.buildSettingsAddHostRoute)(Date.now()))}function ke(e){(0,$.openHostOverview)(e)}},4110,[896,897,898,454,456,1218,854,37,426,60,235,451,147,3037,899,902,627,57,4111,4112,4118,4119,3839,4120,3737,4142,4155,4158,3731,3711,1217,3808,3810,4143,4122,3709,3845,3529,4144,4153,4154,3797,4050,4160,4165,3675,4166,4167,4193,4196,4197,280]);
|
|
15766
15766
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"titlebarDragSurfaceStyle",{enumerable:!0,get:function(){return l}}),e.TitlebarDragRegion=function(){const l=(0,t.c)(1);if(o.isNative||!(0,n.getIsElectronRuntime)())return null;let b;l[0]===Symbol.for("react.memo_cache_sentinel")?(b=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:c}),(0,s.jsx)("div",{style:u})]}),l[0]=b):b=l[0];return b};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]);const l={cursor:"default",WebkitAppRegion:"drag"},c=Object.assign({},l,{top:0,left:0,display:"block",position:"absolute",width:"100%",height:"100%"}),u={position:"absolute",top:0,width:"100%",height:4,WebkitAppRegion:"no-drag"}},4111,[454,1217,881,280]);
|
|
15767
15767
|
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["style"],t=["style"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.SidebarMenuToggle=C,_e.WindowSidebarMenuToggle=function(e){const o=(0,c.c)(10);let n,s,u,f;o[0]!==e?(n=void 0===e?{}:e,o[0]=e,o[1]=n):n=o[1];if(o[2]!==n){var b=n;({style:u}=b),s=(0,l.default)(b,t),o[2]=n,o[3]=s,o[4]=u}else s=o[3],u=o[4];o[5]!==u?(f=[T.leadingToggle,u],o[5]=u,o[6]=f):f=o[6];const h=f;let y;o[7]!==s||o[8]!==h?(y=(0,v.jsx)(w,Object.assign({},s,{isMobile:!1,extraMutedIdleIcon:!0,resolvedStyle:h})),o[7]=s,o[8]=h,o[9]=y):y=o[9];return y},_e.MenuHeader=function(e){const t=(0,c.c)(9),{title:o,rightContent:n,borderless:l}=e;let s,u,f,b;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,v.jsx)(C,{}),t[0]=s):s=t[0];t[1]!==o?(u=o&&(0,v.jsx)(y.ScreenTitle,{children:o}),t[1]=o,t[2]=u):u=t[2];t[3]!==u?(f=(0,v.jsxs)(v.Fragment,{children:[s,u]}),t[3]=u,t[4]=f):f=t[4];t[5]!==l||t[6]!==n||t[7]!==f?(b=(0,v.jsx)(h.ScreenHeader,{left:f,right:n,leftStyle:T.left,borderless:l}),t[5]=l,t[6]=n,t[7]=f,t[8]=b):b=t[8];return b};var o,n=r(d[0]),l=(o=n)&&o.__esModule?o:{default:o},s=r(d[1]),c=r(d[2]);r(d[3]);var u=r(d[4]);r(d[5]);var f=r(d[6]),b=r(d[7]),h=r(d[8]),y=r(d[9]),S=r(d[10]),p=r(d[11]),M=r(d[12]),x=r(d[13]),_=r(d[14]),j=r(d[15]),v=r(d[16]);function I(e){const t=(0,c.c)(13),{color:o}=e;let n;t[0]!==o?(n=[T.mobileMenuLine,{backgroundColor:o}],t[0]=o,t[1]=n):n=t[1];const l=n;let u;t[2]!==o?(u=[T.mobileMenuLine,T.mobileMenuLineShort,{backgroundColor:o}],t[2]=o,t[3]=u):u=t[3];const f=u;let b,h,y,S;return t[4]!==l?(b=(0,v.jsx)(s.View,{style:l}),h=(0,v.jsx)(s.View,{style:l}),t[4]=l,t[5]=b,t[6]=h):(b=t[5],h=t[6]),t[7]!==f?(y=(0,v.jsx)(s.View,{style:f}),t[7]=f,t[8]=y):y=t[8],t[9]!==b||t[10]!==h||t[11]!==y?(S=(0,v.jsxs)(s.View,{style:T.mobileMenuIcon,pointerEvents:"none",children:[b,h,y]}),t[9]=b,t[10]=h,t[11]=y,t[12]=S):S=t[12],S}function w(e){const t=(0,c.c)(28),{isMobile:o,extraMutedIdleIcon:n,resolvedStyle:l,tooltipSide:s,testID:h,nativeID:y}=e,M=void 0!==n&&n,_=void 0===s?"right":s,w=void 0===h?"menu-button":h,C=void 0===y?"menu-button":y,{theme:T}=(0,f.useUnistyles)(),{t:O}=(0,u.useTranslation)();let E;t[0]!==o?(E=e=>(0,p.selectIsAgentListOpen)(e,{isCompact:o}),t[0]=o,t[1]=E):E=t[1];const V=(0,p.usePanelStore)(E),k=(0,p.usePanelStore)(L);let P;t[2]===Symbol.for("react.memo_cache_sentinel")?(P="mac"===(0,x.getShortcutOs)()?["mod","B"]:["mod","."],t[2]=P):P=t[2];const z=P;let D;t[3]!==o||t[4]!==k?(D=()=>{k({isCompact:o})},t[3]=o,t[4]=k,t[5]=D):D=t[5];const F=D;let H;t[6]!==V?(H={expanded:V},t[6]=V,t[7]=H):H=t[7];const W=H;let B,R,A,G;return t[8]!==O?(B=O("shell.menu.toggleSidebar"),t[8]=O,t[9]=B):B=t[9],t[10]!==V||t[11]!==O?(R=O(V?"shell.menu.close":"shell.menu.open"),t[10]=V,t[11]=O,t[12]=R):R=t[12],t[13]!==M||t[14]!==o||t[15]!==T.colors.foregroundExtraMuted||t[16]!==T.colors.foregroundMuted?(A=o?(0,v.jsx)(I,{color:M?T.colors.foregroundExtraMuted:T.colors.foregroundMuted}):(0,v.jsx)(b.PanelLeft,{size:(0,j.iconButtonChromeGlyphSize)("large"),strokeWidth:1.5,color:M?T.colors.foregroundExtraMuted:T.colors.foregroundMuted}),t[13]=M,t[14]=o,t[15]=T.colors.foregroundExtraMuted,t[16]=T.colors.foregroundMuted,t[17]=A):A=t[17],t[18]!==W||t[19]!==F||t[20]!==C||t[21]!==l||t[22]!==R||t[23]!==A||t[24]!==B||t[25]!==w||t[26]!==_?(G=(0,v.jsx)(S.HeaderToggleButton,{onPress:F,tooltipLabel:B,tooltipKeys:z,tooltipSide:_,testID:w,nativeID:C,style:l,accessible:!0,accessibilityRole:"button",accessibilityLabel:R,accessibilityState:W,children:A}),t[18]=W,t[19]=F,t[20]=C,t[21]=l,t[22]=R,t[23]=A,t[24]=B,t[25]=w,t[26]=_,t[27]=G):G=t[27],G}function L(e){return e.toggleAgentListForLayout}function C(t){const o=(0,c.c)(16);let n,u,f;if(o[0]!==t?(n=void 0===t?{}:t,o[0]=t,o[1]=n):n=o[1],o[2]!==n){var b=n;({style:f}=b),u=(0,l.default)(b,e),o[2]=n,o[3]=u,o[4]=f}else u=o[3],f=o[4];const h=(0,M.useIsCompactFormFactor)(),y=(0,_.useOwnsWindowChromeCorner)("top-left"),p=(0,_.useHasWindowChromeObstruction)("top-left");let x;o[5]!==f?(x=[T.leadingToggle,f],o[5]=f,o[6]=x):x=o[6];const j=x;let I;o[7]!==j?(I=[S.headerIconSlotStyle.slot,j],o[7]=j,o[8]=I):I=o[8];const L=I;if(!h&&!y)return null;if(!h&&p){let e,t;return o[9]===Symbol.for("react.memo_cache_sentinel")?(e=(0,v.jsx)(s.View,{style:T.desktopMenuIconSpace}),o[9]=e):e=o[9],o[10]!==L?(t=(0,v.jsx)(s.View,{pointerEvents:"none",style:L,children:e}),o[10]=L,o[11]=t):t=o[11],t}let C;return o[12]!==h||o[13]!==u||o[14]!==j?(C=(0,v.jsx)(w,Object.assign({},u,{isMobile:h,resolvedStyle:j})),o[12]=h,o[13]=u,o[14]=j,o[15]=C):C=o[15],C}const T=f.StyleSheet.create(e=>({leadingToggle:{marginLeft:{xs:0,md:-e.spacing[2]},uni__dependencies:[0]},left:{gap:e.spacing[2],uni__dependencies:[0]},mobileMenuIcon:{width:16,height:12,justifyContent:"space-between",alignItems:"flex-start"},desktopMenuIconSpace:{width:e.iconSize.md,height:e.iconSize.md,uni__dependencies:[0]},mobileMenuLine:{width:16,height:1.5,borderRadius:e.borderRadius.full,uni__dependencies:[0]},mobileMenuLineShort:{width:8}}))},4112,[36,896,454,37,854,147,57,1218,4113,4116,4117,3797,1217,3735,4050,4048,280]);
|
|
15768
15768
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ScreenHeader=function(f){const y=(0,n.c)(24),{left:b,right:I,leftStyle:x,rightStyle:E,borderless:w,onRowLayout:D}=f,{theme:S}=(0,l.useUnistyles)(),j=(0,s.useSafeAreaInsets)(),H=(0,c.useIsCompactFormFactor)(),C=H?c.HEADER_TOP_PADDING_MOBILE:0,R=H?S.spacing[2]:S.spacing[3],A=j.top+C;let B;y[0]!==A?(B=[u.inner,{paddingTop:A}],y[0]=A,y[1]=B):B=y[1];const k=B,N=w&&u.borderless;let T;y[2]!==N?(T=[u.row,N],y[2]=N,y[3]=T):T=y[3];const v=T;let L;y[4]!==x?(L=[u.left,x],y[4]=x,y[5]=L):L=y[5];const O=L;let P;y[6]!==E?(P=[u.right,E],y[6]=E,y[7]=P):P=y[7];const W=P;let G,M,V,F,z;y[8]===Symbol.for("react.memo_cache_sentinel")?(G=(0,p.jsx)(_.TitlebarDragRegion,{}),y[8]=G):G=y[8];y[9]!==b||y[10]!==O?(M=(0,p.jsx)(t.View,{style:O,children:b}),y[9]=b,y[10]=O,y[11]=M):M=y[11];y[12]!==I||y[13]!==W?(V=(0,p.jsx)(t.View,{style:W,children:I}),y[12]=I,y[13]=W,y[14]=V):V=y[14];y[15]!==R||y[16]!==D||y[17]!==v||y[18]!==M||y[19]!==V?(F=(0,p.jsxs)(h.WindowChromeSafeArea,{placement:"inline",horizontalPadding:R,onLayout:D,style:v,children:[G,M,V]}),y[15]=R,y[16]=D,y[17]=v,y[18]=M,y[19]=V,y[20]=F):F=y[20];y[21]!==k||y[22]!==F?(z=(0,p.jsx)(o.ComposerDockBackground,{style:u.header,testID:"composer-dock-header",children:(0,p.jsx)(t.View,{style:k,children:F})}),y[21]=k,y[22]=F,y[23]=z):z=y[23];return z};var t=r(d[0]),n=r(d[1]),o=r(d[2]);r(d[3]),r(d[4]);var s=r(d[5]),l=r(d[6]),c=r(d[7]),h=r(d[8]),_=r(d[9]),p=r(d[10]);const u=l.StyleSheet.create(t=>({header:{backgroundColor:t.colors.surface0,uni__dependencies:[0]},inner:{},row:{position:"relative",height:{xs:c.HEADER_INNER_HEIGHT_MOBILE,md:c.HEADER_INNER_HEIGHT},flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderBottomWidth:t.borderWidth[1],borderBottomColor:t.colors.border,userSelect:"none",uni__dependencies:[0]},left:{flex:1,flexDirection:"row",alignItems:"center",gap:t.spacing[2],minWidth:0,uni__dependencies:[0]},right:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],flexShrink:0,uni__dependencies:[0]},borderless:{borderBottomColor:"transparent"}}))},4113,[896,454,4114,37,147,627,57,1217,4050,4111,280]);
|
|
@@ -15891,17 +15891,17 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',
|
|
|
15891
15891
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ensurePanelsRegistered=function(){if(v)return;(0,R.registerPanel)(l.draftPanelRegistration),(0,R.registerPanel)(_.newTabPanelRegistration),(0,R.registerPanel)(t.agentPanelRegistration),(0,R.registerPanel)(c.providerSubagentPanelRegistration),(0,R.registerPanel)(f.setupPanelRegistration),(0,R.registerPanel)(u.terminalPanelRegistration),(0,R.registerPanel)(n.browserPanelRegistration),(0,R.registerPanel)(P.filePanelRegistration),(0,R.registerPanel)(o.filesPanelRegistration),(0,R.registerPanel)(p.pullRequestPanelRegistration),(0,R.registerPanel)(s.commitDiffPanelRegistration),(0,R.registerPanel)(s.turnDiffPanelRegistration),(0,R.registerPanel)(s.workingDiffPanelRegistration),(0,R.registerPanel)(s.changesTreePanelRegistration),(0,R.registerPanel)(b.pluginPanelRegistration),v=!0};var t=r(d[0]),n=r(d[1]),s=r(d[2]),l=r(d[3]),P=r(d[4]),o=r(d[5]),R=r(d[6]),f=r(d[7]),u=r(d[8]),c=r(d[9]),p=r(d[10]),b=r(d[11]),_=r(d[12]);let v=!1},4236,[4237,4584,4586,4647,4648,4750,4553,4760,4761,4798,4799,4820,4821]);
|
|
15892
15892
|
__d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AgentConversationPanel=be,Object.defineProperty(_e,"agentPanelRegistration",{enumerable:!0,get:function(){return ke}}),_e.useDraftPanelDescriptor=function(e,t){const n=(0,s.c)(5);let o;n[0]!==t.serverId||n[1]!==e.draftId?(o=n=>{const s=n.pendingByDraftId[e.draftId];return s?.serverId!==t.serverId||"active"!==s.lifecycle?{isCreating:!1,pendingPrompt:null}:{isCreating:!0,pendingPrompt:s.text}},n[0]=t.serverId,n[1]=e.draftId,n[2]=o):o=n[2];const a=(0,Y.useCreateFlowStore)((0,v.useShallow)(o));let c;n[3]!==a?(c=(0,G.buildDraftPanelDescriptor)(Object.assign({},a,{icon:p.SquarePen})),n[3]=a,n[4]=c):c=n[4];return c};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),a=r(d[4]),c=r(d[5]),l=r(d[6]),u=r(d[7]),p=r(d[8]),f=r(d[9]),h=r(d[10]),I=e(r(d[11]));r(d[12]),r(d[13]);var S=r(d[14]),y=e(r(d[15])),v=r(d[16]),A=r(d[17]),x=r(d[18]),w=r(d[19]),C=r(d[20]),b=r(d[21]),k=r(d[22]),P=r(d[23]),T=r(d[24]),j=r(d[25]),R=r(d[26]),F=r(d[27]),_=r(d[28]),D=r(d[29]),O=r(d[30]),W=r(d[31]),H=r(d[32]),M=r(d[33]),V=r(d[34]),z=r(d[35]),B=r(d[36]),q=r(d[37]),E=r(d[38]),L=r(d[39]),K=r(d[40]),$=r(d[41]),U=r(d[42]),N=r(d[43]),J=r(d[44]),G=r(d[45]),Z=r(d[46]),Q=r(d[47]),X=r(d[48]),Y=r(d[49]),ee=r(d[50]),te=r(d[51]),ne=r(d[52]),se=r(d[53]),re=r(d[54]),ie=r(d[55]),oe=r(d[56]),ae=r(d[57]),ce=r(d[58]),le=r(d[59]),de=r(d[60]),ue=r(d[61]),ge=r(d[62]),pe=r(d[63]);function fe(e,t,n){if(!n)return null;const s=e.sessions[t];return s?.agents?.get(n)??s?.agentDetails?.get(n)??null}const he={serverId:null,id:null,status:null,cwd:null,lastError:null,archivedAt:null,requiresAttention:!1,attentionReason:null};function Ie(e,t,n){const s=fe(e,t,n);return s?{serverId:s.serverId,id:s.id,provider:s.provider,status:s.status,cwd:s.cwd,workspaceId:s.workspaceId,capabilities:s.capabilities,currentModeId:s.currentModeId,model:s.model,thinkingOptionId:s.thinkingOptionId,runtimeInfo:s.runtimeInfo,features:s.features,lastError:s.lastError??null,archivedAt:s.archivedAt??null,requiresAttention:s.requiresAttention??!1,attentionReason:s.attentionReason??null}:he}function me(e,t){return e.serverId&&e.id&&e.status&&e.cwd?{serverId:e.serverId,id:e.id,provider:e.provider,status:e.status,cwd:e.cwd,workspaceId:e.workspaceId,capabilities:e.capabilities,currentModeId:e.currentModeId,model:e.model,thinkingOptionId:e.thinkingOptionId,runtimeInfo:e.runtimeInfo,features:e.features,lastError:e.lastError??null,projectPlacement:t}:null}function Se(e){const o=(0,s.c)(15),{message:a,onRetry:c}=e,{t:u}=(0,h.useTranslation)();let p,f,I,S,y,v;return o[0]!==u?(p=u("agentPanel.states.failedToLoad"),o[0]=u,o[1]=p):p=o[1],o[2]!==p?(f=(0,pe.jsx)(n.Text,{style:Ye.errorText,children:p}),o[2]=p,o[3]=f):f=o[3],o[4]!==a?(I=(0,pe.jsx)(n.Text,{style:Ye.statusText,children:a}),o[4]=a,o[5]=I):I=o[5],o[6]!==u?(S=u("common.actions.retry"),o[6]=u,o[7]=S):S=o[7],o[8]!==c||o[9]!==S?(y=(0,pe.jsx)(t.View,{style:Ye.errorAction,children:(0,pe.jsx)(l.Button,{size:"sm",variant:"secondary",onPress:c,testID:"agent-load-error-retry",children:S})}),o[8]=c,o[9]=S,o[10]=y):y=o[10],o[11]!==f||o[12]!==I||o[13]!==y?(v=(0,pe.jsx)(t.View,{style:Ye.container,testID:"agent-load-error",children:(0,pe.jsxs)(t.View,{style:Ye.errorContainer,children:[f,I,y]})}),o[11]=f,o[12]=I,o[13]=y,o[14]=v):v=o[14],v}function ye(e){const{viewState:s,effectiveAgent:o,t:a,onRetryLoad:c}=e;return"not_found"===s.tag?(0,pe.jsx)(t.View,{style:Ye.container,testID:"agent-not-found",children:(0,pe.jsx)(t.View,{style:Ye.errorContainer,children:(0,pe.jsx)(n.Text,{style:Ye.errorText,children:a("agentPanel.states.notFound")})})}):"error"===s.tag?(0,pe.jsx)(Se,{message:s.message,onRetry:c}):"boot"!==s.tag&&o?null:(0,pe.jsx)(t.View,{style:Ye.container,testID:"agent-loading",children:(0,pe.jsx)(t.View,{style:Ye.errorContainer,children:(0,pe.jsx)(Ge,{size:"large",uniProps:Ze})})})}function ve(e){return e?e.split(/[-_\s]+/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):"Agent"}function Ae(e){if("string"!=typeof e)return null;const t=e.trim();return t?"new agent"===t.toLowerCase()?null:t:null}function xe(e){return"running"===e.status}function we(){const e=(0,s.c)(6),{serverId:t,workspaceId:n,target:o,openFileInWorkspace:a}=(0,$.usePaneContext)(),{isInteractive:c}=(0,$.usePaneFocus)();let l;return(0,y.default)("agent"===o.kind,"AgentPanel requires agent target"),e[0]!==c||e[1]!==a||e[2]!==t||e[3]!==o.agentId||e[4]!==n?(l=(0,pe.jsx)(P.RetainedChatContent,{children:(0,pe.jsx)(We,{serverId:t,workspaceId:n,agentId:o.agentId,isPaneFocused:c,onOpenWorkspaceFile:a})}),e[0]=c,e[1]=a,e[2]=t,e[3]=o.agentId,e[4]=n,e[5]=l):l=e[5],l}function Ce(){const e=(0,s.c)(13),{serverId:t,workspaceId:n,tabId:o,target:a,openFileInWorkspace:l,openImportSheet:u,retargetCurrentTab:p}=(0,$.usePaneContext)(),{isInteractive:f}=(0,$.usePaneFocus)();let h;(0,y.default)("draft"===a.kind,"DraftPanel requires draft target"),e[0]!==p||e[1]!==t?(h=e=>{const n=(0,ce.normalizeAgentSnapshot)(e,t),s=(0,de.applyLegacyDaemonWorkspaceOwnership)({serverId:t,agent:n});(0,c.getHostRuntimeStore)().acceptAgentSnapshot(t,s),p({kind:"agent",agentId:e.id})},e[0]=p,e[1]=t,e[2]=h):h=e[2];const I=h;let S;return e[3]!==I||e[4]!==f||e[5]!==l||e[6]!==u||e[7]!==t||e[8]!==o||e[9]!==a.draftId||e[10]!==a.setup||e[11]!==n?(S=(0,pe.jsx)(Q.WorkspaceDraftAgentTab,{serverId:t,workspaceId:n,tabId:o,draftId:a.draftId,initialSetup:a.setup,isPaneFocused:f,onOpenWorkspaceFile:l,onCreated:I,onOpenImportSheet:u}),e[3]=I,e[4]=f,e[5]=l,e[6]=u,e[7]=t,e[8]=o,e[9]=a.draftId,e[10]=a.setup,e[11]=n,e[12]=S):S=e[12],S}function be(){const e=(0,s.c)(2),{target:t}=(0,$.usePaneContext)();if("draft"===t.kind){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,pe.jsx)(Ce,{}),e[0]=t):t=e[0],t}if("agent"===t.kind){let t;return e[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,pe.jsx)(we,{}),e[1]=t):t=e[1],t}(0,y.default)(!1,"AgentConversationPanel requires an agent or draft target")}const ke=(0,U.definePanel)("agent",{component:be,useDescriptor:function(e,t){const n=(0,s.c)(32),{t:c}=(0,h.useTranslation)();let l;n[0]!==t.serverId||n[1]!==e.agentId?(l={serverId:t.serverId,parentAgentId:e.agentId,includeDescendants:!0},n[0]=t.serverId,n[1]=e.agentId,n[2]=l):l=n[2];const u=(0,oe.useSubagentsForParent)(l);let p;n[3]!==t.serverId||n[4]!==e.agentId?(p=n=>{const s=n.sessions[t.serverId],o=s?.agents?.get(e.agentId)??s?.agentDetails?.get(e.agentId)??null;return{provider:o?.provider??"codex",title:o?.title??null,status:o?.status??null,pendingPermissionCount:o?.pendingPermissions.length??0,requiresAttention:o?.requiresAttention??!1,attentionReason:o?.attentionReason??null,isTurnActive:(0,te.selectAgentTurnPresentation)(s,e.agentId).isActive}},n[3]=t.serverId,n[4]=e.agentId,n[5]=p):p=n[5];const f=(0,te.useSessionStore)((0,v.useShallow)(p));let I;n[6]!==t.serverId||n[7]!==e.agentId?(I={serverId:t.serverId,target:o.ConversationTitleTarget.Agent,id:e.agentId},n[6]=t.serverId,n[7]=e.agentId,n[8]=I):I=n[8];const S=(0,a.useAiRenamePending)(I),y=f.provider;let A;n[9]!==S||n[10]!==f.title||n[11]!==c?(A=S?c("common.states.renaming"):Ae(f.title),n[9]=S,n[10]=f.title,n[11]=c,n[12]=A):A=n[12];const x=A,w=(0,D.useProviderIcon)(y,t.serverId),C=x??"";let b;n[13]!==y?(b=ve(y),n[13]=y,n[14]=b):b=n[14];const k=`${b} agent`;let P;n[15]!==x||n[16]!==y?(P=x??`${ve(y)} agent`,n[15]=x,n[16]=y,n[17]=P):P=n[17];const T=x?"ready":"loading";let j,R;return n[18]!==f.attentionReason||n[19]!==f.isTurnActive||n[20]!==f.pendingPermissionCount||n[21]!==f.requiresAttention||n[22]!==f.status||n[23]!==u?(j=f.status?(0,ue.deriveSidebarStateBucket)({status:f.isTurnActive?"running":f.status,pendingPermissionCount:f.pendingPermissionCount,requiresAttention:f.requiresAttention,attentionReason:f.attentionReason,hasRunningSubagents:u.some(xe)}):null,n[18]=f.attentionReason,n[19]=f.isTurnActive,n[20]=f.pendingPermissionCount,n[21]=f.requiresAttention,n[22]=f.status,n[23]=u,n[24]=j):j=n[24],n[25]!==w||n[26]!==C||n[27]!==k||n[28]!==P||n[29]!==T||n[30]!==j?(R={label:C,subtitle:k,tooltip:P,titleState:T,icon:w,statusBucket:j},n[25]=w,n[26]=C,n[27]=k,n[28]=P,n[29]=T,n[30]=j,n[31]=R):R=n[31],R}});const Pe=[],Te=[],je=new Map,Re=[];function Fe(e){return!!e.agentId&&Object.values(e.pendingByDraftId).some(t=>"sent"===t.lifecycle&&t.serverId===e.serverId&&t.agentId===e.agentId)}function De(e){return e instanceof Error?e.message:String(e)}function Oe(e){return/agent not found|not found/i.test(e)}function We(e){const t=(0,s.c)(28),{serverId:n,workspaceId:o,agentId:a,isPaneFocused:l,onOpenWorkspaceFile:u}=e,{t:p}=(0,h.useTranslation)();let f;t[0]!==a?(f=a.trim()||void 0,t[0]=a,t[1]=f):f=t[1];const I=f;let S;t[2]!==n?(S=n.trim()||void 0,t[2]=n,t[3]=S):S=t[3];const y=S,v=(0,c.useHosts)(),A=y??"",x=(0,c.useHostRuntimeClient)(A),w=(0,c.useHostRuntimeIsConnected)(A),C=(0,c.useHostRuntimeConnectionStatus)(A),b=(0,c.useHostRuntimeLastError)(A);let k;t[4]!==I||t[5]!==y?(k=e=>{if(!y||!I)return!1;const t=e.sessions[y];return Boolean(t?.agents.has(I)||t?.agentDetails.has(I))},t[4]=I,t[5]=y,t[6]=k):k=t[6];const P=(0,te.useSessionStore)(k),T=y??null;let j;t[7]!==T||t[8]!==v?(j=T?v.find(e=>e.serverId===T)??null:null,t[7]=T,t[8]=v,t[9]=j):j=t[9];const R=j;let F;t[10]!==T||t[11]!==R?.label||t[12]!==p?(F=R?.label??T??p("agentPanel.unavailable.selectedHost"),t[10]=T,t[11]=R?.label,t[12]=p,t[13]=F):F=t[13];const _=F,D=Boolean(T&&!R),O=D&&"connecting"===C?"offline":C,W=b;if(!y||!x&&!P){let e;return t[14]!==O||t[15]!==D||t[16]!==W||t[17]!==_||t[18]!==p?(e=(0,pe.jsx)(Je,{serverLabel:_,connectionStatus:O,lastError:W,isUnknownDaemon:D,t:p}),t[14]=O,t[15]=D,t[16]=W,t[17]=_,t[18]=p,t[19]=e):e=t[19],e}let H;return t[20]!==l||t[21]!==u||t[22]!==I||t[23]!==y||t[24]!==x||t[25]!==w||t[26]!==o?(H=(0,pe.jsx)(He,{serverId:y,workspaceId:o,agentId:I,isPaneFocused:l,client:x,isConnected:w,onOpenWorkspaceFile:u}),t[20]=l,t[21]=u,t[22]=I,t[23]=y,t[24]=x,t[25]=w,t[26]=o,t[27]=H):H=t[27],H}function He({serverId:e,workspaceId:s,agentId:o,isPaneFocused:a,client:c,isConnected:l,onOpenWorkspaceFile:u}){const{t:p}=(0,h.useTranslation)(),{isArchivingAgent:I}=(0,q.useArchiveAgent)(),S=(0,te.useSessionStore)(t=>Boolean(t.sessions[e])),y=(0,A.useStoreWithEqualityFn)(te.useSessionStore,t=>{if(!o)return null;const n=t.sessions[e];return n?.agents?.get(o)?.projectPlacement??n?.agentDetails?.get(o)?.projectPlacement??null},(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t)),x=(0,te.useSessionStore)((0,v.useShallow)(t=>Ie(t,e,o))),[w,C]=(0,f.useState)({tag:"idle"}),b=(0,f.useRef)(0),k=(0,f.useCallback)(()=>C({tag:"idle"}),[]);if((0,f.useEffect)(()=>{b.current+=1,C({tag:"idle"})},[o,e]),(0,f.useEffect)(()=>{if(!o)return;if(x.id)return void("idle"!==w.tag&&C({tag:"idle"}));if(!c||!l||!S)return;if("loading"===w.tag||"not_found"===w.tag)return;C({tag:"loading"});const t=++b.current;c.fetchAgent({agentId:o}).then(n=>{t===b.current&&(n?((0,le.storeFetchedAgentDetail)({serverId:e,result:n}),C({tag:"idle"})):C({tag:"not_found",message:`Agent not found: ${o}`}))}).catch(e=>{if(t!==b.current)return;const n=De(e);Oe(n)?C({tag:"not_found",message:n}):C({tag:"error",message:n})})},[o,x.id,c,S,l,w.tag,e]),"not_found"===w.tag)return(0,pe.jsx)(t.View,{style:Ye.container,testID:"agent-not-found",children:(0,pe.jsx)(t.View,{style:Ye.errorContainer,children:(0,pe.jsx)(n.Text,{style:Ye.errorText,children:p("agentPanel.states.notFound")})})});if("error"===w.tag)return(0,pe.jsx)(Se,{message:w.message,onRetry:k});return(x.serverId&&x.id&&x.status&&x.cwd?{serverId:x.serverId,id:x.id,provider:x.provider,status:x.status,cwd:x.cwd,workspaceId:x.workspaceId,capabilities:x.capabilities,currentModeId:x.currentModeId,model:x.model,thinkingOptionId:x.thinkingOptionId,runtimeInfo:x.runtimeInfo,features:x.features,lastError:x.lastError??null,projectPlacement:y}:null)?(0,pe.jsx)(Me,{serverId:e,workspaceId:s,agentId:o,isPaneFocused:a,client:c,isConnected:l,onOpenWorkspaceFile:u}):(0,pe.jsx)(t.View,{style:Ye.container,testID:"agent-loading",children:(0,pe.jsx)(t.View,{style:Ye.errorContainer,children:(0,pe.jsx)(Ge,{size:"large",uniProps:Ze})})})}function Me({serverId:e,workspaceId:t,agentId:n,isPaneFocused:s,client:o,isConnected:a,onOpenWorkspaceFile:c}){const{t:l}=(0,h.useTranslation)(),u=(0,k.useRetainedPanelActive)(),{api:p,toast:I,dismiss:S}=(0,O.useToastHost)(),{isArchivingAgent:x}=(0,q.useArchiveAgent)(),w=(0,f.useRef)(null),C=(0,f.useRef)(()=>{}),b=(0,f.useRef)(s),P=(0,f.useRef)(0),T=(0,f.useRef)(null),j=(0,te.useSessionStore)((0,v.useShallow)(t=>Ie(t,e,n))),R=(0,A.useStoreWithEqualityFn)(te.useSessionStore,t=>{if(!n)return null;const s=t.sessions[e];return s?.agents?.get(n)?.projectPlacement??s?.agentDetails?.get(n)?.projectPlacement??null},(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t)),F=(0,te.useSessionStore)(t=>!!n&&(t.sessions[e]?.initializingAgents?.get(n)??!1)),_=(0,te.useSessionStore)(t=>t.sessions[e]?.historySyncGeneration??0),D=(0,te.useSessionStore)(t=>n?(0,te.selectAgentTimelineState)(t.sessions[e],n).status:"cold"),W="synced"===D,H=(0,te.useSessionStore)(t=>n?t.sessions[e]?.agentHistorySyncGeneration?.get(n)??-1:-1),M=(0,te.useSessionStore)(t=>t.sessions[e]?.viewedTimelineSync??null),z=(0,f.useCallback)(e=>M?.subscribe(e)??(()=>{}),[M]),E=(0,f.useCallback)(()=>n&&M?M.getAgentTimelineStatus(n):"ready",[n,M]),K=(0,f.useSyncExternalStore)(z,E,E),$=u?K:"ready",U=(N={agentId:n,status:$,sync:M}).agentId&&"error"===N.status&&N.sync?N.sync.getAgentTimelineError(N.agentId):null;var N;const J=(0,Y.useCreateFlowStore)(t=>Fe({pendingByDraftId:t.pendingByDraftId,serverId:e,agentId:n})),G=(0,te.useSessionStore)(t=>Boolean(t.sessions[e])),[Q,X]=(0,f.useState)({kind:"idle"}),ee=W||"painted"===D,ne=(0,V.useAgentAttentionClear)({agentId:n,client:o,isConnected:a,requiresAttention:j.requiresAttention,attentionReason:j.attentionReason,isScreenFocused:s});(0,f.useEffect)(()=>{C.current=ne.clearOnAgentBlur},[ne.clearOnAgentBlur]);const se=Boolean(n&&x({serverId:e,agentId:n}));(0,f.useEffect)(()=>{b.current&&!s&&C.current(),b.current=s},[s]),(0,f.useEffect)(()=>()=>{b.current&&C.current()},[]);const re=!!n&&F,oe=(0,f.useMemo)(()=>{if(!n||!re)return!1;const t=(0,ae.getInitKey)(e,n);return Boolean((0,ae.getInitDeferred)(t))},[n,re,e]),ce=(0,f.useMemo)(()=>!!n&&H<_,[H,n,_]),de=(0,f.useMemo)(()=>me(j,R),[j,R]),ue=(0,f.useMemo)(()=>J&&n?{kind:"optimistic-create",agent:{serverId:e,id:n,status:"running",cwd:de?.cwd??".",projectPlacement:de?.projectPlacement??null}}:{kind:"none"},[de,n,J,e]),ge=(0,B.useAgentScreenStateMachine)({routeKey:`${e}:${n??""}`,input:{agent:de??null,isArchived:null!==j.archivedAt,missingAgentState:Q,isConnected:a,isArchivingCurrentAgent:se,isHistorySyncing:oe,needsAuthoritativeSync:ce,visibilityCatchUpStatus:$,visibilityCatchUpError:U,continuity:ue,hasHydratedHistoryBefore:ee}}),fe="ready"===ge.tag?ge.agent:null,he=n?`${e}:${n}`:null;T.current=(0,Z.deriveRouteBottomAnchorIntent)({cachedIntent:T.current,routeKey:he,hasAppliedAuthoritativeHistoryAtEntry:W});const Se=(0,f.useMemo)(()=>(0,Z.deriveRouteBottomAnchorRequest)({intent:T.current,effectiveAgentId:fe?.id??null}),[fe?.id]),ve=(0,f.useCallback)(e=>{n&&w.current?.prepareForViewportChange()},[n]),Ae=(0,ie.useSettings)(e=>e.keepChatPosition),xe=(0,f.useCallback)(()=>{n&&!Ae&&w.current?.scrollToBottom("message-sent")},[n,Ae]),we=(0,f.useCallback)(()=>{w.current?.scrollToBottom("rewind")},[]),Ce=(0,f.useCallback)(()=>{X({kind:"idle"}),n&&M&&M.retryVisibleAgentTimeline(n)},[n,M]),be=(0,f.useCallback)(()=>{n&&M&&M.retryVisibleAgentTimeline(n)},[n,M]);(0,f.useEffect)(()=>{P.current+=1,X({kind:"idle"})},[n,e]),(0,f.useEffect)(()=>{if(!n)return;if(j.archivedAt)return;if(j.id&&W)return void("resolving"!==Q.kind&&"not_found"!==Q.kind&&"error"!==Q.kind||X(L.reconcileMissingAgentStateWithPresentAgent));if(!(o&&M&&u&&a&&G&&"ready"===$))return;if("resolving"===Q.kind||"not_found"===Q.kind||"error"===Q.kind)return;X({kind:"resolving"});const t=++P.current;Promise.resolve().then(async()=>{if(t!==P.current)return;const s=te.useSessionStore.getState().sessions[e];if(!(s?.agents.get(n)??s?.agentDetails.get(n))){const s=await o.fetchAgent({agentId:n});if(t!==P.current)return;if(!s)return void X({kind:"not_found",message:`Agent not found: ${n}`});(0,le.storeFetchedAgentDetail)({serverId:e,result:s})}t===P.current&&X({kind:"idle"})}).catch(e=>{if(t!==P.current)return;const n=De(e);Oe(n)?X({kind:"not_found",message:n}):X({kind:"error",message:n})})},[j.id,j.archivedAt,W,n,o,G,a,u,Q.kind,e,M,$]);const ke=ye({viewState:ge,effectiveAgent:fe,t:l,onRetryLoad:Ce});if(ke)return ke;(0,y.default)(n,"agent id is defined when agent content is ready"),(0,y.default)(fe,"effectiveAgent is defined when the non-ready view is absent");const Pe=j.cwd;(0,y.default)(Pe,"agent cwd is defined when agent content is ready");const Te="ready"===ge.tag&&"catching_up"===ge.sync.status&&"overlay"===ge.sync.ui,je="ready"===ge.tag&&"sync_error"===ge.sync.status,Re="ready"===ge.tag&&"sync_error"===ge.sync.status&&ge.sync.isRetrying;return(0,pe.jsx)(Ve,{serverId:e,workspaceId:t,agentId:n,isPaneFocused:s,isArchivingCurrentAgent:se,agentState:j,effectiveAgent:fe,routeBottomAnchorRequest:Se,hasAppliedAuthoritativeHistory:W,toastApi:p,toast:I,dismiss:S,streamViewRef:w,handleComposerHeightChange:ve,handleMessageSent:xe,handleRewindComplete:we,timelineSync:u&&"ready"===ge.tag?ge.sync:null,showHistorySyncOverlay:Te,showHistorySyncError:je,isRetryingHistorySync:Re,cwd:Pe,retryTimelineSync:be,onAttentionInputFocus:ne.clearOnInputFocus,onAttentionPromptSend:ne.clearOnPromptSend,onOpenWorkspaceFile:c})}const Ve=(0,f.memo)(function(e){const o=(0,s.c)(107),{serverId:a,workspaceId:c,agentId:l,isPaneFocused:u,isArchivingCurrentAgent:p,agentState:f,effectiveAgent:I,routeBottomAnchorRequest:S,hasAppliedAuthoritativeHistory:y,toastApi:v,toast:A,dismiss:x,streamViewRef:w,handleComposerHeightChange:C,handleMessageSent:b,handleRewindComplete:k,timelineSync:P,showHistorySyncOverlay:T,showHistorySyncError:j,isRetryingHistorySync:R,retryTimelineSync:F,cwd:D,onAttentionInputFocus:O,onAttentionPromptSend:W,onOpenWorkspaceFile:H}=e,{t:M}=(0,h.useTranslation)();let V;o[0]!==l||o[1]!==a?(V={serverId:a,parentAgentId:l},o[0]=l,o[1]=a,o[2]=V):V=o[2];const B=(0,oe.useSubagentsForParent)(V);let q;o[3]!==l||o[4]!==a?(q=e=>e.sessions[a]?.agentTasks.get(l),o[3]=l,o[4]=a,o[5]=q):q=o[5];const E=(0,te.useSessionStore)(q);let L;o[6]!==l||o[7]!==a||o[8]!==B?(L={serverId:a,parentAgentId:l,rows:B},o[6]=l,o[7]=a,o[8]=B,o[9]=L):L=o[9];const $=(0,oe.useArchiveFinishedSubagents)(L),U=(0,J.useHasPluginComposerPills)(a,c,l),G=!f.archivedAt&&!p;let Z;o[10]!==$.status||o[11]!==U||o[12]!==B||o[13]!==E?(Z=(0,X.hasAgentTracks)({subagentRows:B,tasks:E,archiveFinishedStatus:$.status,hasPluginComposerPills:U}),o[10]=$.status,o[11]=U,o[12]=B,o[13]=E,o[14]=Z):Z=o[14];const Q=Z;let Y,ne;o[15]!==l||o[16]!==a?(Y=(0,ee.buildDraftStoreKey)({serverId:a,agentId:l}),o[15]=l,o[16]=a,o[17]=Y):Y=o[17],o[18]!==Y?(ne={draftKey:Y},o[18]=Y,o[19]=ne):ne=o[19];const se=(0,z.useAgentInputDraft)(ne),{textSource:re,editText:ie,replaceText:ae,textReplacement:ce,attachments:le,setAttachments:de,clear:ue,isHydrated:ge,attachmentFocusRequestId:fe,composerState:he}=se;let Ie;o[20]!==fe||o[21]!==le||o[22]!==ue||o[23]!==he||o[24]!==ie||o[25]!==ge||o[26]!==ae||o[27]!==de||o[28]!==ce||o[29]!==re?(Ie={textSource:re,editText:ie,replaceText:ae,textReplacement:ce,attachments:le,setAttachments:de,clear:ue,isHydrated:ge,attachmentFocusRequestId:fe,composerState:he},o[20]=fe,o[21]=le,o[22]=ue,o[23]=he,o[24]=ie,o[25]=ge,o[26]=ae,o[27]=de,o[28]=ce,o[29]=re,o[30]=Ie):Ie=o[30];const me=Ie,Se=`AgentComposerSection:${l}`;let ye,ve;o[31]!==l||o[32]!==me||o[33]!==f.archivedAt||o[34]!==D||o[35]!==C||o[36]!==b||o[37]!==p||o[38]!==u||o[39]!==O||o[40]!==W||o[41]!==a?(ye=(0,pe.jsx)(Ee,{agentId:l,serverId:a,isPaneFocused:u,isArchivingCurrentAgent:p,archivedAt:f.archivedAt,cwd:D,isSubmitLoading:!1,agentInputDraft:me,onAttentionInputFocus:O,onAttentionPromptSend:W,onComposerHeightChange:C,onMessageSent:b}),o[31]=l,o[32]=me,o[33]=f.archivedAt,o[34]=D,o[35]=C,o[36]=b,o[37]=p,o[38]=u,o[39]=O,o[40]=W,o[41]=a,o[42]=ye):ye=o[42],o[43]!==Se||o[44]!==ye?(ve=(0,pe.jsx)(N.RenderProfile,{id:Se,children:ye}),o[43]=Se,o[44]=ye,o[45]=ve):ve=o[45];const Ae=ve,xe=`AgentStreamSection:${l}`;let we,Ce,be,ke;o[46]!==l||o[47]!==I||o[48]!==G||o[49]!==y||o[50]!==Q||o[51]!==H||o[52]!==S||o[53]!==a||o[54]!==w||o[55]!==v||o[56]!==c?(we=(0,pe.jsx)(qe,{streamViewRef:w,serverId:a,workspaceId:c,agentId:l,agent:I,routeBottomAnchorRequest:S,hasAppliedAuthoritativeHistory:y,hasActiveComposer:G,hasVisibleAgentTracks:Q,toast:v,onOpenWorkspaceFile:H}),o[46]=l,o[47]=I,o[48]=G,o[49]=y,o[50]=Q,o[51]=H,o[52]=S,o[53]=a,o[54]=w,o[55]=v,o[56]=c,o[57]=we):we=o[57],o[58]!==xe||o[59]!==we?(Ce=(0,pe.jsx)(N.RenderProfile,{id:xe,children:we}),o[58]=xe,o[59]=we,o[60]=Ce):Ce=o[60],o[61]!==l||o[62]!==$.archiveFinished||o[63]!==$.status||o[64]!==D||o[65]!==G||o[66]!==U||o[67]!==a||o[68]!==B||o[69]!==E||o[70]!==c?(be=G?(0,pe.jsx)(X.AgentTracks,{serverId:a,workspaceId:c,agentId:l,cwd:D,subagentRows:B,tasks:E,archiveFinishedStatus:$.status,onArchiveFinished:$.archiveFinished,hasPluginComposerPills:U}):null,o[61]=l,o[62]=$.archiveFinished,o[63]=$.status,o[64]=D,o[65]=G,o[66]=U,o[67]=a,o[68]=B,o[69]=E,o[70]=c,o[71]=be):be=o[71],o[72]!==Ce||o[73]!==be?(ke=(0,pe.jsxs)(t.View,{style:Xe.content,children:[Ce,be]}),o[72]=Ce,o[73]=be,o[74]=ke):ke=o[74];const Pe=ke;let Te,je;o[75]!==R||o[76]!==F||o[77]!==j?(Te=j?(0,pe.jsx)(Be,{isRetrying:R,onRetry:F}):null,o[75]=R,o[76]=F,o[77]=j,o[78]=Te):Te=o[78],o[79]!==Pe||o[80]!==Te?(je=(0,pe.jsxs)(t.View,{style:Ye.contentContainer,children:[Pe,Te]}),o[79]=Pe,o[80]=Te,o[81]=je):je=o[81];const Re=je;let Fe,De,Oe;o[82]!==T?(Fe=T?(0,pe.jsx)(t.View,{style:Ye.historySyncOverlay,testID:"agent-history-overlay",children:(0,pe.jsx)(Ge,{size:"large",uniProps:Ze})}):null,o[82]=T,o[83]=Fe):Fe=o[83],o[84]!==x||o[85]!==P||o[86]!==A?(De=(0,pe.jsx)(K.TimelineSyncStatus,{sync:P,toast:A,onDismiss:x}),o[84]=x,o[85]=P,o[86]=A,o[87]=De):De=o[87],o[88]!==Fe||o[89]!==De?(Oe=(0,pe.jsxs)(pe.Fragment,{children:[Fe,De]}),o[88]=Fe,o[89]=De,o[90]=Oe):Oe=o[90];const We=Oe;let He;o[91]!==Ae||o[92]!==Re||o[93]!==We||o[94]!==p?(He=(0,pe.jsxs)(ze,{disabled:p,children:[Re,Ae,We]}),o[91]=Ae,o[92]=Re,o[93]=We,o[94]=p,o[95]=He):He=o[95];const Me=He;let Ve,Le,Ke;return o[96]!==p||o[97]!==M?(Ve=p?(0,pe.jsxs)(t.View,{style:Ye.archivingOverlay,testID:"agent-archiving-overlay",children:[(0,pe.jsx)(Ge,{size:"large",uniProps:Qe}),(0,pe.jsx)(n.Text,{style:Ye.archivingTitle,children:M("agentPanel.states.archivingTitle")}),(0,pe.jsx)(n.Text,{style:Ye.archivingSubtitle,children:M("agentPanel.states.archivingSubtitle")})]}):null,o[96]=p,o[97]=M,o[98]=Ve):Ve=o[98],o[99]!==Me||o[100]!==Ve?(Le=(0,pe.jsxs)(t.View,{style:Ye.root,children:[Me,Ve]}),o[99]=Me,o[100]=Ve,o[101]=Le):Le=o[101],o[102]!==me.replaceText||o[103]!==me.textSource||o[104]!==k||o[105]!==Le?(Ke=(0,pe.jsx)(_.RewindComposerRestoreProvider,{textSource:me.textSource,setText:me.replaceText,onRewindComplete:k,children:Le}),o[102]=me.replaceText,o[103]=me.textSource,o[104]=k,o[105]=Le,o[106]=Ke):Ke=o[106],Ke});function ze(e){const t=(0,s.c)(5),{children:n,disabled:o}=e;let a,c;return t[0]!==n?(a=(0,pe.jsx)(C.ComposerDock,{children:n}),t[0]=n,t[1]=a):a=t[1],t[2]!==o||t[3]!==a?(c=(0,pe.jsx)(b.FileDropZone,{style:Ye.container,disabled:o,children:a}),t[2]=o,t[3]=a,t[4]=c):c=t[4],c}function Be(e){const o=(0,s.c)(14),{isRetrying:a,onRetry:c}=e,{t:u}=(0,h.useTranslation)();let p,f,I,S,y;return o[0]!==u?(p=u("agentPanel.states.timelineSyncFailed"),o[0]=u,o[1]=p):p=o[1],o[2]!==p?(f=(0,pe.jsx)(n.Text,{style:Ye.timelineSyncCalloutText,children:p}),o[2]=p,o[3]=f):f=o[3],o[4]!==a||o[5]!==u?(I=u(a?"agentPanel.states.timelineSyncRetrying":"common.actions.retry"),o[4]=a,o[5]=u,o[6]=I):I=o[6],o[7]!==a||o[8]!==c||o[9]!==I?(S=(0,pe.jsx)(l.Button,{size:"sm",variant:"secondary",onPress:c,disabled:a,testID:"agent-timeline-sync-retry",children:I}),o[7]=a,o[8]=c,o[9]=I,o[10]=S):S=o[10],o[11]!==f||o[12]!==S?(y=(0,pe.jsx)(t.View,{style:Ye.timelineSyncCalloutRail,children:(0,pe.jsx)(t.View,{style:Ye.timelineSyncCalloutContent,children:(0,pe.jsxs)(t.View,{style:Ye.timelineSyncCallout,testID:"agent-timeline-sync-error",children:[f,S]})})}),o[11]=f,o[12]=S,o[13]=y):y=o[13],y}const qe=(0,f.memo)(function({streamViewRef:e,serverId:t,workspaceId:n,agentId:s,agent:o,routeBottomAnchorRequest:a,hasAppliedAuthoritativeHistory:c,hasActiveComposer:l,hasVisibleAgentTracks:u,toast:p,onOpenWorkspaceFile:h}){const I=(0,H.useIsCompactFormFactor)(),S=(0,ie.useSettings)(e=>e.turnDiffOpenLocation),{tabId:y}=(0,$.usePaneContext)(),w=(0,f.useCallback)(({turnId:e,focusPath:o,destination:a})=>{if(!s)return;a&&(0,ie.persistAppSettings)({turnDiffOpenLocation:a}).catch(e=>{p.error(String(e))});const c=(0,se.buildWorkspaceTabPersistenceKey)({serverId:t,workspaceId:n}),l=(0,re.openTurnDiff)({isCompact:I,workspaceKey:c,target:Object.assign({kind:"turn_diff",agentId:s,turnId:e},o?{focusPath:o,focusRequestId:Date.now()}:{}),destination:a??S,sourceTabId:y});l&&c&&ne.useWorkspaceLayoutStore.getState().focusTab(c,l)},[s,I,t,y,p,S,n]),C=(0,j.useWorkspaceHasDiffStat)(t,n),b=l&&(u||C),k=b?(0,R.resolveComposerTrackTailClearance)(I):0,P=b?(0,R.resolveComposerTrackControlClearance)(I):0,T=(0,te.useSessionStore)(e=>s?e.sessions[t]?.agentStreamTail?.get(s):void 0),_=(0,te.useSessionStore)((0,v.useShallow)(e=>s?(0,F.getActiveMessageSubmissions)(e.sessions[t]?.messageSubmissions.get(s)):Te)),D=(0,te.useSessionStore)((0,v.useShallow)(e=>s?(0,te.selectAgentTurnPresentation)(e.sessions[t],s):{isActive:!1,isCancelling:!1,startedAt:null,turnId:null})),O=T??Pe,W=(0,A.useStoreWithEqualityFn)(te.useSessionStore,e=>{if(!s)return Re;const n=e.sessions[t]?.pendingPermissions;if(!n)return Re;const o=[];for(const e of n.values())e.agentId===s&&o.push(e);return o.length>0?o:Re},v.shallow),M=(0,f.useMemo)(()=>0===W.length?je:new Map(W.map(e=>[e.key,e])),[W]);return(0,pe.jsx)(x.AgentStreamView,{ref:e,agentId:o.id,serverId:t,context:o,streamItems:O,pendingPermissions:M,routeBottomAnchorRequest:a,isAuthoritativeHistoryReady:c,bottomOverlayTailClearance:k,bottomOverlayControlClearance:P,toast:p,pendingMessageSubmissions:_,turnPresentation:D,onOpenWorkspaceFile:h,onOpenTurnDiff:w})}),Ee=(0,f.memo)(function(e){const t=(0,s.c)(14),{agentId:n,serverId:o,isPaneFocused:a,isArchivingCurrentAgent:c,archivedAt:l,cwd:u,isSubmitLoading:p,agentInputDraft:f,onAttentionInputFocus:h,onAttentionPromptSend:I,onComposerHeightChange:S,onMessageSent:y}=e;if(!n)return null;if(l){let e;return t[0]!==n||t[1]!==o?(e=(0,pe.jsx)(w.ArchivedAgentCallout,{serverId:o,agentId:n}),t[0]=n,t[1]=o,t[2]=e):e=t[2],e}if(c)return null;let v;return t[3]!==n||t[4]!==f||t[5]!==u||t[6]!==a||t[7]!==p||t[8]!==h||t[9]!==I||t[10]!==S||t[11]!==y||t[12]!==o?(v=(0,pe.jsx)(Le,{agentId:n,serverId:o,isPaneFocused:a,cwd:u,isSubmitLoading:p,agentInputDraft:f,onAttentionInputFocus:h,onAttentionPromptSend:I,onComposerHeightChange:S,onMessageSent:y}),t[3]=n,t[4]=f,t[5]=u,t[6]=a,t[7]=p,t[8]=h,t[9]=I,t[10]=S,t[11]=y,t[12]=o,t[13]=v):v=t[13],v});function Le(e){const n=(0,s.c)(49),{agentId:o,serverId:a,isPaneFocused:c,cwd:l,isSubmitLoading:u,agentInputDraft:p,onAttentionInputFocus:f,onAttentionPromptSend:h,onComposerHeightChange:I,onMessageSent:S}=e,y=(0,H.useIsCompactFormFactor)();let v;n[0]!==y?(v={initialIsBelow:y},n[0]=y,n[1]=v):v=n[1];const{onLayout:A,isBelow:x}=(0,E.useContainerWidthBelow)(H.COMPACT_FORM_FACTOR_WIDTH,v),w=(0,$.usePaneContext)(),C=(0,ie.useSettings)(Ne),{workspaceId:b,tabId:k,retargetCurrentTab:P}=w,{archiveAgent:j}=(0,q.useArchiveAgent)(),R=(0,ne.useWorkspaceLayoutStore)(Ue),F=(0,ne.useWorkspaceLayoutStore)($e),_=(0,ne.useWorkspaceLayoutStore)(Ke);let D;n[2]!==l||n[3]!==a||n[4]!==b?(D={serverId:a,cwd:l,workspaceId:b},n[2]=l,n[3]=a,n[4]=b,n[5]=D):D=n[5];const O=(0,W.useWorkspaceAttachmentScopeKey)(D);let V;n[6]!==O?(V=[O],n[6]=O,n[7]=V):V=n[7];const z=V;let B;n[8]!==l||n[9]!==y||n[10]!==C||n[11]!==a||n[12]!==b?(B=e=>{"review"===e.kind&&(0,re.openWorkspaceChanges)({isCompact:y,workspaceKey:(0,se.buildWorkspaceTabPersistenceKey)({serverId:a,workspaceId:b}),checkout:{serverId:a,cwd:l,isGit:!0},preferences:C})},n[8]=l,n[9]=y,n[10]=C,n[11]=a,n[12]=b,n[13]=B):B=n[13];const L=B;let K;n[14]!==o||n[15]!==j||n[16]!==R||n[17]!==F||n[18]!==P||n[19]!==a||n[20]!==k||n[21]!==_||n[22]!==b?(K=async e=>{const t=fe(te.useSessionStore.getState(),a,o);if(!t)throw new Error("Agent not found");const n=(0,se.buildWorkspaceTabPersistenceKey)({serverId:a,workspaceId:b});n&&(_(n,o),F(n,o)),"replace-agent-with-draft"===e.kind?P({kind:"draft",draftId:(0,ee.generateDraftId)(),setup:(0,ge.buildDraftAgentSetup)(t)}):n&&R(n,k),await j({serverId:a,agentId:o})},n[14]=o,n[15]=j,n[16]=R,n[17]=F,n[18]=P,n[19]=a,n[20]=k,n[21]=_,n[22]=b,n[23]=K):K=n[23];const U=K,N=p.textSource,J=p.editText,G=p.textReplacement,Z=p.attachments,Q=p.setAttachments,X=p.clear,Y=String(p.attachmentFocusRequestId);let oe,ae;return n[24]!==o||n[25]!==p.attachments||n[26]!==p.clear||n[27]!==p.editText||n[28]!==p.setAttachments||n[29]!==p.textReplacement||n[30]!==p.textSource||n[31]!==z||n[32]!==l||n[33]!==U||n[34]!==L||n[35]!==x||n[36]!==c||n[37]!==u||n[38]!==f||n[39]!==h||n[40]!==I||n[41]!==S||n[42]!==a||n[43]!==Y||n[44]!==b?(oe=(0,pe.jsx)(T.Composer,{agentId:o,serverId:a,workspaceId:b,blurOnSubmit:M.isNative,isPaneFocused:c,textSource:N,onChangeText:J,textReplacement:G,attachments:Z,attachmentScopeKeys:z,onOpenWorkspaceAttachment:L,onChangeAttachments:Q,cwd:l,clearDraft:X,autoFocus:!0,autoFocusKey:Y,isSubmitLoading:u,onAttentionInputFocus:f,onAttentionPromptSend:h,onComposerHeightChange:I,onMessageSent:S,onClientSlashCommand:U,isCompactLayout:x}),n[24]=o,n[25]=p.attachments,n[26]=p.clear,n[27]=p.editText,n[28]=p.setAttachments,n[29]=p.textReplacement,n[30]=p.textSource,n[31]=z,n[32]=l,n[33]=U,n[34]=L,n[35]=x,n[36]=c,n[37]=u,n[38]=f,n[39]=h,n[40]=I,n[41]=S,n[42]=a,n[43]=Y,n[44]=b,n[45]=oe):oe=n[45],n[46]!==A||n[47]!==oe?(ae=(0,pe.jsx)(t.View,{style:Xe.inputAreaWrapper,onLayout:A,children:oe}),n[46]=A,n[47]=oe,n[48]=ae):ae=n[48],ae}function Ke(e){return e.unpinAgent}function $e(e){return e.hideAgent}function Ue(e){return e.closeTab}function Ne(e){return e.openInSidePane}function Je(e){const o=(0,s.c)(18),{serverLabel:a,connectionStatus:c,lastError:l,isUnknownDaemon:u,t:p}=e;if(void 0!==u&&u){let e,s,c,l,u;return o[0]!==a||o[1]!==p?(e=p("agentPanel.unavailable.unknownHost",{serverLabel:a}),o[0]=a,o[1]=p,o[2]=e):e=o[2],o[3]!==e?(s=(0,pe.jsx)(n.Text,{style:Ye.errorText,children:e}),o[3]=e,o[4]=s):s=o[4],o[5]!==p?(c=p("agentPanel.unavailable.addHost"),o[5]=p,o[6]=c):c=o[6],o[7]!==c?(l=(0,pe.jsx)(n.Text,{style:Ye.statusText,children:c}),o[7]=c,o[8]=l):l=o[8],o[9]!==s||o[10]!==l?(u=(0,pe.jsx)(t.View,{style:Ye.container,children:(0,pe.jsxs)(t.View,{style:Ye.centerState,children:[s,l]})}),o[9]=s,o[10]=l,o[11]=u):u=o[11],u}const f="connecting"===c,h="online"===c;let I;return o[12]!==f||o[13]!==h||o[14]!==l||o[15]!==a||o[16]!==p?(I=(0,pe.jsx)(t.View,{style:Ye.container,children:(0,pe.jsx)(t.View,{style:Ye.centerState,children:f||h?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ge,{size:"large",uniProps:Ze}),(0,pe.jsx)(n.Text,{style:Ye.loadingText,children:p(h?"agentPanel.unavailable.preparingSession":"agentPanel.unavailable.connecting",{serverLabel:a})}),(0,pe.jsx)(n.Text,{style:Ye.statusText,children:p(h?"agentPanel.unavailable.showSoon":"agentPanel.unavailable.showWhenOnline")})]}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(n.Text,{style:Ye.offlineTitle,children:p("agentPanel.unavailable.reconnectingTo",{serverLabel:a})}),(0,pe.jsx)(n.Text,{style:Ye.offlineDescription,children:p("agentPanel.unavailable.showAgainWhenReachable")}),l?(0,pe.jsx)(n.Text,{style:Ye.offlineDetails,children:l}):null]})})}),o[12]=f,o[13]=h,o[14]=l,o[15]=a,o[16]=p,o[17]=I):I=o[17],I}const Ge=(0,S.withUnistyles)(u.LoadingSpinner),Ze=e=>({color:e.colors.foregroundMuted}),Qe=e=>({color:e.colors.foreground}),Xe=I.default.create({content:{flex:1},inputAreaWrapper:{width:"100%",flexShrink:1}}),Ye=S.StyleSheet.create(e=>({root:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},container:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},contentContainer:Object.assign({flex:1,overflow:"hidden"},M.isWeb?{userSelect:"none"}:{}),timelineSyncCalloutRail:{width:"100%",alignItems:"center",paddingHorizontal:e.spacing[4],paddingTop:e.spacing[2],uni__dependencies:[0]},timelineSyncCalloutContent:{width:"100%",maxWidth:e.contentMaxWidth,uni__dependencies:[0]},timelineSyncCallout:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:e.spacing[3],backgroundColor:e.colors.surface1,borderWidth:e.borderWidth[1],borderColor:e.colors.statusDanger,borderRadius:e.borderRadius["2xl"],paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[4],uni__dependencies:[0]},timelineSyncCalloutText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.base,uni__dependencies:[0]},historySyncOverlay:{position:"absolute",top:0,right:0,bottom:0,left:0,backgroundColor:e.colors.surface0,alignItems:"center",justifyContent:"center",zIndex:40,uni__dependencies:[0]},archivingOverlay:{position:"absolute",top:0,right:0,bottom:0,left:0,backgroundColor:"rgba(8, 10, 14, 0.86)",alignItems:"center",justifyContent:"center",paddingHorizontal:e.spacing[8],gap:e.spacing[3],zIndex:50,uni__dependencies:[0]},archivingTitle:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.semibold,color:e.colors.foreground,textAlign:"center",uni__dependencies:[0]},archivingSubtitle:{fontSize:e.fontSize.base,color:e.colors.foregroundMuted,textAlign:"center",uni__dependencies:[0]},loadingText:{fontSize:e.fontSize.base,color:e.colors.foregroundMuted,uni__dependencies:[0]},centerState:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:e.spacing[6],gap:e.spacing[3],uni__dependencies:[0]},errorContainer:{flex:1,alignItems:"center",justifyContent:"center"},errorText:{fontSize:e.fontSize.base,color:e.colors.foregroundMuted,textAlign:"center",uni__dependencies:[0]},errorAction:{marginTop:e.spacing[4],uni__dependencies:[0]},statusText:{marginTop:e.spacing[2],textAlign:"center",fontSize:e.fontSize.base,color:e.colors.foregroundMuted,uni__dependencies:[0]},offlineTitle:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.semibold,color:e.colors.foreground,textAlign:"center",uni__dependencies:[0]},offlineDescription:{fontSize:e.fontSize.base,color:e.colors.foregroundMuted,textAlign:"center",uni__dependencies:[0]},offlineDetails:{fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,textAlign:"center",uni__dependencies:[0]}}))},4237,[896,897,454,2977,4206,3529,3022,3023,1218,37,854,60,235,147,57,3576,3456,3764,4238,4538,4114,4336,3709,4540,4341,4542,4483,3467,4324,3819,895,3622,1217,881,4543,4545,4550,3610,4395,4551,4552,4245,4553,4283,4474,4554,4555,4556,4565,3621,3553,3459,3572,3554,4562,884,4573,3628,3612,4539,3617,3476,4455,280]);
|
|
15893
15893
|
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["itemId","onInlineDetailsExpandedChangeByItemId"];function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"AgentStreamView",{enumerable:!0,get:function(){return Me}});var n=t(r(d[0])),o=r(d[1]),s=r(d[2]),l=r(d[3]),c=r(d[4]),u=r(d[5]),p=r(d[6]),h=r(d[7]),I=t(h),y=r(d[8]);r(d[9]),r(d[10]),r(d[11]),r(d[12]);var f=r(d[13]),x=r(d[14]),v=r(d[15]),S=r(d[16]),w=t(S),b=r(d[17]),T=r(d[18]),k=r(d[19]),j=r(d[20]),C=r(d[21]),P=r(d[22]),_=r(d[23]),O=r(d[24]),F=r(d[25]),B=r(d[26]),R=r(d[27]),H=r(d[28]),A=r(d[29]),M=r(d[30]),D=r(d[31]),E=r(d[32]),W=r(d[33]),L=r(d[34]),q=r(d[35]),z=r(d[36]),V=r(d[37]),K=r(d[38]),G=r(d[39]),N=r(d[40]),U=r(d[41]),$=r(d[42]),J=r(d[43]),Q=r(d[44]),X=r(d[45]),Y=r(d[46]),Z=r(d[47]),ee=r(d[48]),te=r(d[49]),ne=r(d[50]),oe=r(d[51]),se=r(d[52]),re=r(d[53]),ie=r(d[54]),ae=r(d[55]),le=r(d[56]),de=r(d[57]),ce=r(d[58]),ue=r(d[59]),pe=r(d[60]),me=r(d[61]);function ge(e){return e.pendingPermissions||e.turnFooter||0!==e.bottomOverlayInset?(0,me.jsxs)(me.Fragment,{children:[e.turnFooter,e.pendingPermissions?(0,me.jsx)(l.View,{style:Qe.contentWrapper,children:(0,me.jsx)(l.View,{style:Qe.listHeaderContent,children:e.pendingPermissions})}):null,e.bottomOverlayInset>0?(0,me.jsx)(he,{height:e.bottomOverlayInset}):null]}):null}function he(e){const t=(0,c.c)(4),{height:n}=e;let o;t[0]!==n?(o={height:n},t[0]=n,t[1]=o):o=t[1];const s=o;let u;return t[2]!==s?(u=(0,me.jsx)(l.View,{style:s}),t[2]=s,t[3]=u):u=t[3],u}function Ie(e){if(!e.content)return null;const t=e.layoutItem.completedFooter,n=t?(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(ue.TurnDiffCardSlot,{itemId:t.itemId}),(0,me.jsx)(G.CompletedTurnFooterRow,{strategy:e.strategy,items:t.items,timing:t.timing,startIndex:t.startIndex,supportsTimelineCursor:e.supportsTimelineCursor,onForkAssistantTurn:e.onForkAssistantTurn})]}):null,o=(0,me.jsx)(Ye,{itemId:e.layoutItem.item.id,belowItemId:e.layoutItem.belowItem?.id,gapBelow:e.layoutItem.gapBelow,responseMessageId:"assistant_message"===e.layoutItem.item.kind?(0,D.getStreamItemMessageId)(e.layoutItem.item):void 0,children:e.content});return"footer-then-content"===e.layoutItem.frameOrder?(0,me.jsxs)(me.Fragment,{children:[n,o]}):(0,me.jsxs)(me.Fragment,{children:[o,n]})}function ye(e){return e.renderModel.boundary.hasVirtualizedHistory||e.renderModel.boundary.hasMountedHistory||e.renderModel.boundary.hasLiveHead||e.renderModel.auxiliary.pendingPermissions||e.renderModel.auxiliary.turnFooter?null:(0,me.jsx)(l.View,{style:e.emptyStateStyle,children:(0,me.jsx)(s.Text,{style:Qe.emptyStateText,children:e.emptyText})})}const fe=(0,h.memo)(function(e){const t=(0,c.c)(5),{layoutItem:n,renderStreamItem:o}=e;let s,l;return t[0]!==n||t[1]!==o?(s=o(n),t[0]=n,t[1]=o,t[2]=s):s=t[2],t[3]!==s?(l=(0,me.jsx)(me.Fragment,{children:s}),t[3]=s,t[4]=l):l=t[4],l});function xe(e){const t=e.layoutItemById.get(e.item.id);return t?(0,me.jsx)(fe,{item:e.item,layoutItem:t,renderStreamItem:e.renderStreamItem}):null}function ve(e){const t=e.layoutItemById.get(e.item.id);return t?e.renderStreamItem(t):null}const Se=["supportsStreaming","supportsSessionPersistence","supportsDynamicModes","supportsMcpServers","supportsReasoningStream","supportsToolInvocations","supportsRewindConversation","supportsRewindFiles","supportsRewindBoth","supportsFork"],we=[];function be(e,t){const n=(0,h.useRef)(e);return t&&(n.current=e),t?e:n.current}const Te=[];function ke(e){const t=(0,c.c)(2),n=!0===e.capabilities?.supportsFork;let o;return t[0]!==n?(o={supportsFullHistory:n},t[0]=n,t[1]=o):o=t[1],o}const je=(0,h.forwardRef)(function(e,t){const n=(0,c.c)(273),{agentId:s,serverId:p,context:f,streamItems:v,streamHead:C,pendingPermissions:_,pendingMessageSubmissions:H,turnPresentation:A,routeBottomAnchorRequest:se,isAuthoritativeHistoryReady:re,bottomOverlayTailClearance:he,bottomOverlayControlClearance:fe,toast:Se,onOpenWorkspaceFile:je,onOpenTurnDiff:Pe,readOnly:Oe,historyPagination:Fe}=e,Be=void 0===H?Te:H,Re=void 0===se?null:se,He=void 0===re||re,Ae=void 0===he?0:he,Me=void 0!==Oe&&Oe,{t:We}=(0,y.useTranslation)(),Le=(0,B.useSettings)(st),qe=(0,B.useSettings)(rt),ze=(0,B.useSettings)(it),Ve=(0,B.useSettings)(B.resolveContentMaxWidth),Ke=(0,h.useRef)(null);let Ge;n[0]!==Be?(Ge=new Set(Be.map(at)),n[0]=Be,n[1]=Ge):Ge=n[1];const Ue=Ge,$e=(0,x.useIsCompactFormFactor)();let Je;n[2]!==$e?(Je=(0,L.resolveStreamRenderStrategy)({platform:"web",isMobileBreakpoint:$e}),n[2]=$e,n[3]=Je):Je=n[3];const Xe=Je,[Ye,Ze]=(0,h.useState)(!0);let et;n[4]===Symbol.for("react.memo_cache_sentinel")?(et=new Set,n[4]=et):et=n[4];const[tt,nt]=(0,h.useState)(et);let ot;n[5]===Symbol.for("react.memo_cache_sentinel")?(ot=new Set,n[5]=ot):ot=n[5];const[lt,dt]=(0,h.useState)(ot),ct=p??f.serverId??"",ut=(0,de.useInstalledTimelineTransform)(ct);let pt;n[6]!==ct?(pt=e=>e.sessions[ct]?.client??null,n[6]=ct,n[7]=pt):pt=n[7];const mt=(0,P.useSessionStore)(pt);let gt;n[8]!==s||n[9]!==ct?(gt=e=>e.sessions[ct]?.agentStreamHead?.get(s),n[8]=s,n[9]=ct,n[10]=gt):gt=n[10];const ht=(0,P.useSessionStore)(gt),It=C??ht;let yt;n[11]!==Me||n[12]!==ct||n[13]!==Se?(yt={serverId:ct,toast:Se,readOnly:Me},n[11]=Me,n[12]=ct,n[13]=Se,n[14]=yt):yt=n[14];const ft=(0,ee.useForkAgent)(yt);let xt;n[15]!==ct?(xt=e=>!0===e.sessions[ct]?.serverInfo?.features?.agentForkContextCursor,n[15]=ct,n[16]=xt):xt=n[16];const vt=(0,P.useSessionStore)(xt);let St;n[17]!==ct?(St=e=>!0===e.sessions[ct]?.serverInfo?.features?.agentTimelinePromptIndex,n[17]=ct,n[18]=St):St=n[18];const wt=(0,P.useSessionStore)(St);let bt;n[19]!==s||n[20]!==ct?(bt=e=>e.sessions[ct]?.agentTimelineCursor.get(s)?.epoch??null,n[19]=s,n[20]=ct,n[21]=bt):bt=n[21];const Tt=(0,P.useSessionStore)(bt);let kt;n[22]!==s||n[23]!==ct?(kt=e=>!0===e.sessions[ct]?.agentTimelineHasNewer.get(s),n[22]=s,n[23]=ct,n[24]=kt):kt=n[24];const jt=(0,P.useSessionStore)(kt);let Ct;n[25]!==f.cwd?(Ct=f.cwd?.trim()||"",n[25]=f.cwd,n[26]=Ct):Ct=n[26];const Pt=Ct;let _t;n[27]!==f.workspaceId||n[28]!==ct||n[29]!==Pt?(_t={serverId:ct,workspaceId:f.workspaceId,workspaceRoot:Pt},n[27]=f.workspaceId,n[28]=ct,n[29]=Pt,n[30]=_t):_t=n[30];const{requestDirectoryListing:Ot}=(0,O.useFileExplorerActions)(_t);let Ft;n[31]!==s||n[32]!==ct||n[33]!==Se?(Ft={serverId:ct,agentId:s,toast:Se},n[31]=s,n[32]=ct,n[33]=Se,n[34]=Ft):Ft=n[34];const Bt=(0,F.useLoadOlderAgentHistory)(Ft),{isLoadingOlder:Rt,hasOlder:Ht,progressKey:At,loadOlder:Mt}=Fe?{isLoadingOlder:Fe.isLoadingOlder,hasOlder:Fe.hasOlder,progressKey:Fe.progressKey,loadOlder:Fe.onLoadOlder}:Bt;let Dt;n[35]===Symbol.for("react.memo_cache_sentinel")?(Dt=S.FadeIn.duration(200),n[35]=Dt):Dt=n[35];const Et=Dt;let Wt;n[36]===Symbol.for("react.memo_cache_sentinel")?(Wt=S.FadeOut.duration(200),n[36]=Wt):Wt=n[36];const Lt=Wt;let qt,zt,Vt;n[37]===Symbol.for("react.memo_cache_sentinel")?(qt=()=>{Ze(!0),nt(new Set),dt(new Set)},n[37]=qt):qt=n[37],n[38]!==s?(zt=[s],n[38]=s,n[39]=zt):zt=n[39],(0,h.useEffect)(qt,zt),n[40]!==f.cwd||n[41]!==f.projectPlacement?.checkout?.isGit||n[42]!==f.workspaceId||n[43]!==$e||n[44]!==je||n[45]!==Ot||n[46]!==ct?(Vt=(e,t)=>{if(!e.path)return;const n=(0,Q.normalizeInlinePathTarget)(e.path,f.cwd);if(n){if(n.file){const o=(0,X.normalizeWorkspaceFileLocation)({path:n.file,lineStart:e.lineStart,lineEnd:e.lineEnd});if(!o)return;return je?void je({location:o,disposition:t}):void(f.workspaceId&&(0,Y.navigateToWorkspace)({serverId:ct,workspaceId:f.workspaceId,target:(0,X.createWorkspaceFileTabTarget)(o)}))}Ot(n.directory,{recordHistory:!1,setCurrentPath:!1}),(0,k.openExplorerSidebarView)({isCompact:$e,workspaceKey:(0,T.buildWorkspaceTabPersistenceKey)({serverId:ct,workspaceId:f.workspaceId??""}),checkout:{serverId:ct,cwd:f.cwd,isGit:f.projectPlacement?.checkout?.isGit??!0},view:"files"})}},n[40]=f.cwd,n[41]=f.projectPlacement?.checkout?.isGit,n[42]=f.workspaceId,n[43]=$e,n[44]=je,n[45]=Ot,n[46]=ct,n[47]=Vt):Vt=n[47];const Kt=(0,Z.useStableEvent)(Vt);let Gt;n[48]!==Kt?(Gt=e=>{Kt({raw:e,path:e},"preferred")},n[48]=Kt,n[49]=Gt):Gt=n[49];const Nt=(0,Z.useStableEvent)(Gt);let Ut;n[50]!==s||n[51]!==f||n[52]!==ft?(Ut=async e=>{const{target:t,mode:n,boundary:o}=e;await ft({agentId:s,agent:f,workspaceId:f.workspaceId,target:t,mode:n,boundary:o})},n[50]=s,n[51]=f,n[52]=ft,n[53]=Ut):Ut=n[53];const $t=(0,Z.useStableEvent)(Ut);let Jt;n[54]!==s||n[55]!==f||n[56]!==ft?(Jt=async e=>{const{target:t,mode:n}=e;await ft({agentId:s,agent:f,workspaceId:f.workspaceId,target:t,mode:n})},n[54]=s,n[55]=f,n[56]=ft,n[57]=Jt):Jt=n[57];const Qt=(0,Z.useStableEvent)(Jt),Xt=ke(f),Yt=(0,ie.useRetainedPanelActive)(),Zt=be(v,Yt),en=be(It,Yt),tn=be(A,Yt),nn=tn.isActive;let on;n[58]===Symbol.for("react.memo_cache_sentinel")?(on=(0,D.createStreamPresentation)(),n[58]=on):on=n[58];const sn=on,rn=en??we;let an;n[59]!==Zt||n[60]!==nn||n[61]!==rn||n[62]!==qe||n[63]!==ut?(an=sn({tail:Zt,head:rn,transform:ut,level:qe,isTurnActive:nn}),n[59]=Zt,n[60]=nn,n[61]=rn,n[62]=qe,n[63]=ut,n[64]=an):an=n[64];const ln=an;let dn;n[65]===Symbol.for("react.memo_cache_sentinel")?(dn=()=>(Ke.current?.detachFromBottom?.(),Ke.current?.captureScrollAnchor?.()),n[65]=dn):dn=n[65];const cn=dn,un=(0,pe.useTurnDiffsEnabled)(ct);let pn;n[66]!==s||n[67]!==ct||n[68]!==un?(pn={serverId:ct,agentId:s,enabled:un},n[66]=s,n[67]=ct,n[68]=un,n[69]=pn):pn=n[69];const mn=(0,pe.useAgentTurnDiffs)(pn);let gn;n[70]!==Pe||n[71]!==ln.tail||n[72]!==mn||n[73]!==un?(gn=un?{anchors:(0,ce.anchorTurnDiffs)({tail:ln.tail,turns:mn}),onOpen:Pe}:void 0,n[70]=Pe,n[71]=ln.tail,n[72]=mn,n[73]=un,n[74]=gn):gn=n[74];const hn=gn,In=`${ct}:${s}`;let yn;n[75]!==tn.turnId||n[76]!==nn||n[77]!==ln.head||n[78]!==ln.tail||n[79]!==In?(yn={chatKey:In,tail:ln.tail,head:ln.head,isTurnActive:nn,activeTurnId:tn.turnId,onBeforeToggle:cn},n[75]=tn.turnId,n[76]=nn,n[77]=ln.head,n[78]=ln.tail,n[79]=In,n[80]=yn):yn=n[80];const{tail:fn,workToggles:xn,expandedTurnKeys:vn,expand:Sn}=(0,le.useFoldedTail)(yn),{start:wn,hasLocalHistory:bn,revealLoadedHistory:Tn,loadOlder:kn}=(0,ae.useStreamHistoryWindow)({agentId:s,items:fn,loadRemoteOlder:Mt}),jn=Rt,Cn=bn||Ht,Pn=`${At??"local"}:${wn}`;let _n;n[81]!==fn||n[82]!==tn.startedAt||n[83]!==wn||n[84]!==$e||n[85]!==nn||n[86]!==ln.head?(_n=(0,W.buildAgentStreamRenderModel)({isTurnActive:nn,activeTurnStartedAt:tn.startedAt,tail:fn,head:ln.head,platform:oe.isWeb?"web":"native",isMobileBreakpoint:$e,historyStart:wn}),n[81]=fn,n[82]=tn.startedAt,n[83]=wn,n[84]=$e,n[85]=nn,n[86]=ln.head,n[87]=_n):_n=n[87];const On=_n;let Fn;n[88]!==On.history||n[89]!==On.segments.liveHead||n[90]!==On.turnTiming.byAssistantId||n[91]!==nn||n[92]!==Xe?(Fn=(0,U.layoutStream)({strategy:Xe,isTurnActive:nn,history:On.history,liveHead:On.segments.liveHead,timingByAssistantId:On.turnTiming.byAssistantId}),n[88]=On.history,n[89]=On.segments.liveHead,n[90]=On.turnTiming.byAssistantId,n[91]=nn,n[92]=Xe,n[93]=Fn):Fn=n[93];const Bn=Fn;let Rn;n[94]!==We||n[95]!==Se?(Rn=()=>{Se?.error(We("agentStream.historyLoadFailed"))},n[94]=We,n[95]=Se,n[96]=Rn):Rn=n[96];const Hn=Rn;let An;n[97]!==On.history||n[98]!==On.segments.liveHead?(An=new Set([...On.history,...On.segments.liveHead].map(D.getStreamItemMessageId)),n[97]=On.history,n[98]=On.segments.liveHead,n[99]=An):An=n[99];const Mn=An,Dn=wt&&ze;let En;n[100]!==s||n[101]!==en||n[102]!==Zt||n[103]!==Hn||n[104]!==ct||n[105]!==Tn||n[106]!==Dn||n[107]!==Tt||n[108]!==Mn?(En={agentId:s,serverId:ct,timelineEpoch:Tt,tail:Zt,head:en,enabled:Dn,viewportRef:Ke,onJumpError:Hn,visibleMessageIds:Mn,revealLoadedMessage:Tn},n[100]=s,n[101]=en,n[102]=Zt,n[103]=Hn,n[104]=ct,n[105]=Tn,n[106]=Dn,n[107]=Tt,n[108]=Mn,n[109]=En):En=n[109];const Wn=(0,z.useChatOutline)(En);let Ln,qn,zn;n[110]===Symbol.for("react.memo_cache_sentinel")?(Ln=()=>({scrollToBottom(e){const t=void 0===e?"jump-to-bottom":e;Ke.current?.scrollToBottom(t)},prepareForViewportChange(){Ke.current?.prepareForViewportChange()}}),qn=[],n[110]=Ln,n[111]=qn):(Ln=n[110],qn=n[111]),(0,h.useImperativeHandle)(t,Ln,qn),n[112]!==s||n[113]!==Hn||n[114]!==jt||n[115]!==ct?(zn=()=>{jt?(0,R.returnToTimelineTail)({fetchTail:()=>(0,V.getHostRuntimeStore)().fetchAgentTimeline(ct,s,Object.assign({},(0,K.planTimelineTailFetch)())),scrollToBottom:()=>Ke.current?.scrollToBottom("jump-to-bottom"),onError:Hn}):Ke.current?.scrollToBottom("jump-to-bottom")},n[112]=s,n[113]=Hn,n[114]=jt,n[115]=ct,n[116]=zn):zn=n[116];const Vn=zn;let Kn;n[117]!==Xe?(Kn=(e,t)=>{Xe.shouldDisableParentScrollOnInlineDetailsExpansion()&&nt(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o})},n[117]=Xe,n[118]=Kn):Kn=n[118];const Gn=Kn;let Nn;n[119]===Symbol.for("react.memo_cache_sentinel")?(Nn=(e,t)=>{dt(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o})},n[119]=Nn):Nn=n[119];const Un=Nn;let $n;n[120]!==s||n[121]!==mt||n[122]!==f.capabilities||n[123]!==Ue||n[124]!==ct?($n=(e,t)=>(0,me.jsx)(j.UserMessage,{serverId:ct,agentId:s,messageId:t.messageId,message:t.text,images:t.images,imageSources:t.imageSources,attachments:t.attachments,timestamp:t.timestamp.getTime(),capabilities:f.capabilities,client:mt,isFirstInGroup:e.isFirstInUserGroup,isPending:void 0!==t.clientMessageId&&Ue.has(t.clientMessageId)}),n[120]=s,n[121]=mt,n[122]=f.capabilities,n[123]=Ue,n[124]=ct,n[125]=$n):$n=n[125];const Jn=$n;let Qn;n[126]!==s||n[127]!==mt||n[128]!==Kt||n[129]!==ct||n[130]!==Se||n[131]!==Pt?(Qn=(e,t)=>(0,me.jsx)(Q.AssistantFileLinkResolverProvider,{client:mt,serverId:ct,workspaceRoot:Pt,onOpenWorkspaceFile:Kt,toast:Se,children:(0,me.jsx)(u.ChatFindExpansion,{messageId:(0,D.getStreamItemMessageId)(t),children:n=>(0,me.jsx)(j.AssistantMessage,{renderFullContent:n,occurrenceKey:(0,$.createAssistantImageOccurrenceKey)({agentId:s,itemId:t.id}),message:t.text,timestamp:t.timestamp.getTime(),workspaceRoot:Pt,serverId:ct,client:mt,phase:e.phase})})}),n[126]=s,n[127]=mt,n[128]=Kt,n[129]=ct,n[130]=Se,n[131]=Pt,n[132]=Qn):Qn=n[132];const Xn=Qn;let Yn;n[133]!==Le||n[134]!==Gn?(Yn=(e,t)=>(0,me.jsx)(De,{itemId:t.id,onInlineDetailsExpandedChangeByItemId:Gn,text:t.text,status:t.status,defaultExpanded:Le}),n[133]=Le,n[134]=Gn,n[135]=Yn):Yn=n[135];const Zn=Yn;let eo;n[136]!==f.cwd||n[137]!==Nt||n[138]!==Gn?(eo=(e,t)=>{const{payload:n}=e;if("agent"===n.source){const o=n.data;return"speak"===o.name&&"unknown"===o.detail.type&&"string"==typeof o.detail.input&&o.detail.input.trim()?(0,me.jsx)(j.SpeakMessage,{message:o.detail.input,timestamp:e.timestamp.getTime()}):(0,me.jsx)(Ee,{itemId:e.id,onInlineDetailsExpandedChangeByItemId:Gn,toolName:o.name,error:o.error,status:o.status,detail:o.detail,cwd:f.cwd,metadata:o.metadata,onOpenFilePath:Nt,maxDetailHeight:t})}const o=n.data;return(0,me.jsx)(Ee,{itemId:e.id,onInlineDetailsExpandedChangeByItemId:Gn,toolName:o.toolName,args:o.arguments,result:o.result,status:o.status,onOpenFilePath:Nt,maxDetailHeight:t})},n[136]=f.cwd,n[137]=Nt,n[138]=Gn,n[139]=eo):eo=n[139];const to=eo;let no;n[140]!==ln.groupsByHostId?(no=e=>ln.groupsByHostId.get(e),n[140]=ln.groupsByHostId,n[141]=no):no=n[141];const oo=(0,Z.useStableEvent)(no);let so;n[142]!==lt||n[143]!==oo||n[144]!==to?(so=(e,t)=>{const n=oo(t.id);if(!n)return to(t);const o=lt.has(n.run.id);return(0,me.jsx)(E.OverviewToolCallGroupView,{group:n,expanded:o,onExpandedChange:Un,children:o?n.run.calls.map(e=>(0,me.jsx)(I.default.Fragment,{children:to(e,200)},e.id)):null})},n[142]=lt,n[143]=oo,n[144]=to,n[145]=so):so=n[145];const ro=so;let io;n[146]!==s||n[147]!==Xn||n[148]!==Zn||n[149]!==ro||n[150]!==Jn||n[151]!==ct?(io=e=>{const t=e.item;switch(t.kind){case"user_message":return Jn(e,t);case"assistant_message":return Xn(e,t);case"thought":return Zn(e,t);case"tool_call":return ro(e,t);case"notification":return(0,me.jsx)(j.Notification,{level:t.level,message:t.message});case"todo_list":return(0,me.jsx)(j.TodoListCard,{items:t.items,activity:t.activity});case"fork_marker":return(0,me.jsx)(te.ForkMarker,{serverId:ct,sourceAgentId:t.sourceAgentId,mode:t.mode});case"compaction":return(0,me.jsx)(j.CompactionMarker,{status:t.status,trigger:t.trigger,preTokens:t.preTokens});case"plugin":return(0,me.jsx)(de.PluginTimelineItemView,{agentId:s,item:t,serverId:ct});default:return null}},n[146]=s,n[147]=Xn,n[148]=Zn,n[149]=ro,n[150]=Jn,n[151]=ct,n[152]=io):io=n[152];const ao=io,lo=Bn.auxiliaryTurnFooter;let co;n[153]!==$t||n[154]!==Me||n[155]!==ao||n[156]!==Xe||n[157]!==vt?(co=e=>Ie({content:ao(e),layoutItem:e,strategy:Xe,supportsTimelineCursor:vt,onForkAssistantTurn:Me?void 0:$t}),n[153]=$t,n[154]=Me,n[155]=ao,n[156]=Xe,n[157]=vt,n[158]=co):co=n[158];const uo=co;let po,mo;n[159]!==_?(po=Array.from(_.values()),n[159]=_,n[160]=po):po=n[160],n[161]!==s||n[162]!==po?(mo=po.filter(e=>e.agentId===s),n[161]=s,n[162]=po,n[163]=mo):mo=n[163];const go=mo;let ho;var Io;n[164]!==mt||n[165]!==f||n[166]!==go||n[167]!==ct?(ho=0===(Io={pendingPermissions:go,client:mt,serverId:ct,context:f}).pendingPermissions.length?null:(0,me.jsx)(l.View,{style:Qe.permissionsContainer,children:Io.pendingPermissions.map(e=>(0,me.jsx)(Ne,{permission:e,client:Io.client,serverId:Io.serverId,context:Io.context},e.key))}),n[164]=mt,n[165]=f,n[166]=go,n[167]=ct,n[168]=ho):ho=n[168];const yo=ho;let fo;n[169]!==On.turnTiming.runningStartedAt||n[170]!==lo||n[171]!==$t||n[172]!==Qt||n[173]!==nn||n[174]!==Me||n[175]!==Xe||n[176]!==vt?(fo=nn||lo?(0,me.jsxs)(me.Fragment,{children:[!nn&&lo?(0,me.jsx)(ue.TurnDiffCardSlot,{itemId:lo.itemId}):null,(0,me.jsx)(G.TurnFooter,{isRunning:nn,inFlightTurnStartedAt:On.turnTiming.runningStartedAt,host:lo,strategy:Xe,supportsTimelineCursor:vt,onForkAssistantTurn:Me?void 0:$t,onForkInFlightTurn:Me?void 0:Qt})]}):null,n[169]=On.turnTiming.runningStartedAt,n[170]=lo,n[171]=$t,n[172]=Qt,n[173]=nn,n[174]=Me,n[175]=Xe,n[176]=vt,n[177]=fo):fo=n[177];const xo=fo;let vo,So;n[178]!==yo||n[179]!==xo?(vo={pendingPermissions:yo,turnFooter:xo},n[178]=yo,n[179]=xo,n[180]=vo):vo=n[180],n[181]!==On||n[182]!==vo?(So=Object.assign({},On,{boundary:On.boundary,auxiliary:vo}),n[181]=On,n[182]=vo,n[183]=So):So=n[183];const wo=So;let bo;n[184]===Symbol.for("react.memo_cache_sentinel")?(bo=[Qe.emptyState,Qe.contentWrapper],n[184]=bo):bo=n[184];const To=bo;let ko;var jo;let Co;n[185]!==fe?(jo=fe,ko=Math.max(16,jo??0),n[185]=fe,n[186]=ko):ko=n[186],n[187]!==ko?(Co=[Qe.scrollToBottomContainer,{bottom:ko}],n[187]=ko,n[188]=Co):Co=n[188];const Po=Co;let _o;n[189]!==wo||n[190]!==We?(_o=ye({renderModel:wo,emptyStateStyle:To,emptyText:We("agentStream.empty")}),n[189]=wo,n[190]=We,n[191]=_o):_o=n[191];const Oo=_o,{boundary:Fo,auxiliary:Bo}=wo;let Ro;if(n[192]!==Bn.history){Ro=new Map;for(const e of Bn.history)Ro.set(e.item.id,e);n[192]=Bn.history,n[193]=Ro}else Ro=n[193];const Ho=Ro;let Ao;if(n[194]!==Bn.liveHead){Ao=new Map;for(const e of Bn.liveHead)Ao.set(e.item.id,e);n[194]=Bn.liveHead,n[195]=Ao}else Ao=n[195];const Mo=Ao;let Do;n[196]!==Wn||n[197]!==Ho||n[198]!==Mo?(Do=e=>{const t=null===e?void 0:Ho.get(e)??Mo.get(e);Wn.reportReadingPosition(t?.item.timelineCursor?.seq??null)},n[196]=Wn,n[197]=Ho,n[198]=Mo,n[199]=Do):Do=n[199];const Eo=(0,Z.useStableEvent)(Do);let Wo;n[200]!==Ho||n[201]!==uo?(Wo=e=>xe({item:e,layoutItemById:Ho,renderStreamItem:uo}),n[200]=Ho,n[201]=uo,n[202]=Wo):Wo=n[202];const Lo=Wo;let qo;n[203]!==Lo?(qo=e=>Lo(e),n[203]=Lo,n[204]=qo):qo=n[204];const zo=qo;let Vo;n[205]!==Lo?(Vo=e=>Lo(e),n[205]=Lo,n[206]=Vo):Vo=n[206];const Ko=Vo;let Go;n[207]!==Mo||n[208]!==uo?(Go=e=>ve({item:e,layoutItemById:Mo,renderStreamItem:uo}),n[207]=Mo,n[208]=uo,n[209]=Go):Go=n[209];const No=(0,Z.useStableEvent)(Go);let Uo;n[210]!==Bo.pendingPermissions||n[211]!==Bo.turnFooter||n[212]!==Ae?(Uo=()=>{const e=Bo.turnFooter&&!Bo.pendingPermissions?G.TURN_FOOTER_BOTTOM_SPACING:0,t=(0,N.resolveBottomOverlayTailInset)({requiredTailClearance:Ae,existingTailSpacing:e});return ge({pendingPermissions:Bo.pendingPermissions,turnFooter:Bo.turnFooter,bottomOverlayInset:t})},n[210]=Bo.pendingPermissions,n[211]=Bo.turnFooter,n[212]=Ae,n[213]=Uo):Uo=n[213];const $o=Uo;let Jo;n[214]!==Ko||n[215]!==zo||n[216]!==$o||n[217]!==No?(Jo={renderHistoryVirtualizedRow:zo,renderHistoryMountedRow:Ko,renderLiveHeadRow:No,renderLiveAuxiliary:$o},n[214]=Ko,n[215]=zo,n[216]=$o,n[217]=No,n[218]=Jo):Jo=n[218];const Qo=Jo;let Xo;n[219]!==tt||n[220]!==Xe?(Xo=!Xe.shouldDisableParentScrollOnInlineDetailsExpansion()||0===tt.size,n[219]=tt,n[220]=Xe,n[221]=Xo):Xo=n[221];const Yo=Xo;let Zo;n[222]!==lt||n[223]!==$e||n[224]!==ln.historyGroupUpdatesByHostId?(Zo={contentById:ln.historyGroupUpdatesByHostId,displayStateById:lt,globalDisplayState:$e},n[222]=lt,n[223]=$e,n[224]=ln.historyGroupUpdatesByHostId,n[225]=Zo):Zo=n[225];const es=Zo;let ts,ns;n[226]!==en?(ts=en??[],n[226]=en,n[227]=ts):ts=n[227],n[228]!==Zt||n[229]!==ts?(ns=[...Zt,...ts],n[228]=Zt,n[229]=ts,n[230]=ns):ns=n[230];const os=ns,ss=u.ChatFind,rs=M.ToolCallSheetProvider,is=J.AssistantSelectionCopySurface,as=Qe,ls=j.MessageOuterSpacingProvider,ds=Xe.render({agentId:s,segments:wo.segments,historyRowRevision:es,liveHeadRowRevision:lt,boundary:Fo,renderers:Qo,listEmptyComponent:Oo,viewportRef:Ke,routeBottomAnchorRequest:Re,isAuthoritativeHistoryReady:He,onNearBottomChange:Ze,onReadingPositionChange:Eo,onNearHistoryStart:kn,isLoadingOlderHistory:jn,hasOlderHistory:Cn,olderHistoryProgressKey:Pn,scrollEnabled:Yo,listStyle:Qe.list,baseListContentContainerStyle:Qe.listContentContainer,forwardListContentContainerStyle:Qe.forwardListContentContainer,contentMaxWidth:Ve});let cs,us,ps,ms,gs,hs;n[231]!==ls||n[232]!==ds?(cs=(0,me.jsx)(ls,{disableOuterSpacing:true,children:ds}),n[231]=ls,n[232]=ds,n[233]=cs):cs=n[233],n[234]!==Wn.activePrompt||n[235]!==Wn.jumpToPrompt||n[236]!==Wn.prompts?(us=(0,me.jsx)(q.ChatOutlineRail,{prompts:Wn.prompts,activePrompt:Wn.activePrompt,onJumpToPrompt:Wn.jumpToPrompt}),n[234]=Wn.activePrompt,n[235]=Wn.jumpToPrompt,n[236]=Wn.prompts,n[237]=us):us=n[237],n[238]!==Ye||n[239]!==jt||n[240]!==Et||n[241]!==Lt||n[242]!==Vn||n[243]!==Po||n[244]!==We?(ps=(!Ye||jt)&&(0,me.jsx)(l.View,{style:Po,pointerEvents:"box-none",children:(0,me.jsx)(w.default.View,{entering:Et,exiting:Lt,children:(0,me.jsx)(o.Pressable,{style:Qe.scrollToBottomButton,onPress:Vn,accessibilityRole:"button",accessibilityLabel:We("agentStream.scrollToBottom"),testID:"scroll-to-bottom-button",children:(0,me.jsx)(b.ChevronDown,{size:24,color:Qe.scrollToBottomIcon.color})})})}),n[238]=Ye,n[239]=jt,n[240]=Et,n[241]=Lt,n[242]=Vn,n[243]=Po,n[244]=We,n[245]=ps):ps=n[245],n[246]!==is||n[247]!==as.container||n[248]!==cs||n[249]!==us||n[250]!==ps?(ms=(0,me.jsxs)(is,{style:as.container,children:[cs,us,ps]}),n[246]=is,n[247]=as.container,n[248]=cs,n[249]=us,n[250]=ps,n[251]=ms):ms=n[251],n[252]!==rs||n[253]!==ms?(gs=(0,me.jsx)(rs,{children:ms}),n[252]=rs,n[253]=ms,n[254]=gs):gs=n[254],n[255]!==ss||n[256]!==s||n[257]!==Sn||n[258]!==vn||n[259]!==os||n[260]!==ct||n[261]!==Tn||n[262]!==gs||n[263]!==Tt||n[264]!==Mn?(hs=(0,me.jsx)(ss,{agentId:s,serverId:ct,epoch:Tt,items:os,viewportRef:Ke,revealLoadedMessage:Tn,visibleMessageIds:Mn,expandedTurnKeys:vn,expandTurn:Sn,children:gs}),n[255]=ss,n[256]=s,n[257]=Sn,n[258]=vn,n[259]=os,n[260]=ct,n[261]=Tn,n[262]=gs,n[263]=Tt,n[264]=Mn,n[265]=hs):hs=n[265];const Is=hs;let ys,fs;return n[266]!==Xt||n[267]!==Is?(ys=(0,me.jsx)(ne.AssistantForkMenuContext.Provider,{value:Xt,children:Is}),n[266]=Xt,n[267]=Is,n[268]=ys):ys=n[268],n[269]!==ys||n[270]!==hn||n[271]!==xn?(fs=(0,me.jsx)(Ce,{workToggles:xn,turnDiffCards:hn,children:ys}),n[269]=ys,n[270]=hn,n[271]=xn,n[272]=fs):fs=n[272],fs});function Ce(e){const t=(0,c.c)(6);let n,o;return t[0]!==e.children||t[1]!==e.turnDiffCards?(n=(0,me.jsx)(ue.TurnDiffCardsContext.Provider,{value:e.turnDiffCards,children:e.children}),t[0]=e.children,t[1]=e.turnDiffCards,t[2]=n):n=t[2],t[3]!==e.workToggles||t[4]!==n?(o=(0,me.jsx)(le.WorkToggleContext.Provider,{value:e.workToggles,children:n}),t[3]=e.workToggles,t[4]=n,t[5]=o):o=t[5],o}function Pe(e,t){return Se.every(n=>e?.[n]===t?.[n])}function Oe(e,t){const n=[];return e?.checkout?.cwd!==t?.checkout?.cwd&&n.push("agent.projectPlacement.checkout.cwd"),e?.checkout?.isGit!==t?.checkout?.isGit&&n.push("agent.projectPlacement.checkout.isGit"),e?.projectName!==t?.projectName&&n.push("agent.projectPlacement.projectName"),e?.projectKey!==t?.projectKey&&n.push("agent.projectPlacement.projectKey"),n}function Fe(e,t){const n=[];return e.provider!==t.provider&&n.push("agent.provider"),e.currentModeId!==t.currentModeId&&n.push("agent.currentModeId"),e.model!==t.model&&n.push("agent.model"),e.thinkingOptionId!==t.thinkingOptionId&&n.push("agent.thinkingOptionId"),e.runtimeInfo?.modeId!==t.runtimeInfo?.modeId&&n.push("agent.runtimeInfo.modeId"),e.runtimeInfo?.model!==t.runtimeInfo?.model&&n.push("agent.runtimeInfo.model"),e.runtimeInfo?.thinkingOptionId!==t.runtimeInfo?.thinkingOptionId&&n.push("agent.runtimeInfo.thinkingOptionId"),e.features!==t.features&&n.push("agent.features"),n}function Be(e,t){const n=[];return e.serverId!==t.serverId&&n.push("agent.serverId"),e.id!==t.id&&n.push("agent.id"),e.workspaceId!==t.workspaceId&&n.push("agent.workspaceId"),e.status!==t.status&&n.push("agent.status"),e.cwd!==t.cwd&&n.push("agent.cwd"),Pe(e.capabilities,t.capabilities)||n.push("agent.capabilities"),e.lastError!==t.lastError&&n.push("agent.lastError"),n.push(...Fe(e,t)),n.push(...Oe(e.projectPlacement,t.projectPlacement)),n}function Re(e,t){return e?.agentId===t?.agentId&&e?.reason===t?.reason&&e?.requestKey===t?.requestKey}function He(e,t){return e?.hasOlder===t?.hasOlder&&e?.isLoadingOlder===t?.isLoadingOlder&&e?.progressKey===t?.progressKey&&e?.onLoadOlder===t?.onLoadOlder}function Ae(e,t){const n=[];return e.agentId!==t.agentId&&n.push("agentId"),e.serverId!==t.serverId&&n.push("serverId"),n.push(...Be(e.context,t.context)),e.streamItems!==t.streamItems&&n.push("streamItems"),e.streamHead!==t.streamHead&&n.push("streamHead"),e.pendingPermissions!==t.pendingPermissions&&n.push("pendingPermissions"),e.pendingMessageSubmissions!==t.pendingMessageSubmissions&&n.push("pendingMessageSubmissions"),e.turnPresentation!==t.turnPresentation&&n.push("turnPresentation"),Re(e.routeBottomAnchorRequest,t.routeBottomAnchorRequest)||n.push("routeBottomAnchorRequest"),e.isAuthoritativeHistoryReady!==t.isAuthoritativeHistoryReady&&n.push("isAuthoritativeHistoryReady"),e.toast!==t.toast&&n.push("toast"),e.onOpenWorkspaceFile!==t.onOpenWorkspaceFile&&n.push("onOpenWorkspaceFile"),e.onOpenTurnDiff!==t.onOpenTurnDiff&&n.push("onOpenTurnDiff"),e.readOnly!==t.readOnly&&n.push("readOnly"),He(e.historyPagination,t.historyPagination)||n.push("historyPagination"),(0,re.recordRenderProfileReasons)(`AgentStreamView:${t.agentId}`,n),0===n.length}const Me=(0,h.memo)(je,Ae);function De(e){const t=(0,c.c)(6),{itemId:n,onInlineDetailsExpandedChangeByItemId:o,text:s,status:l,defaultExpanded:u}=e,p=(0,_.useRevealedText)(s,"ready"===l?"complete":"streaming"),h="ready"===l?"completed":"executing";let I;return t[0]!==u||t[1]!==n||t[2]!==o||t[3]!==p||t[4]!==h?(I=(0,me.jsx)(Ee,{itemId:n,onInlineDetailsExpandedChangeByItemId:o,toolName:"thinking",args:p,status:h,defaultExpanded:u,forceInline:u}),t[0]=u,t[1]=n,t[2]=o,t[3]=p,t[4]=h,t[5]=I):I=t[5],I}function Ee(t){const o=(0,c.c)(10);let s,l,u,p;if(o[0]!==t){var h=t;({itemId:s,onInlineDetailsExpandedChangeByItemId:l}=h),u=(0,n.default)(h,e),o[0]=t,o[1]=s,o[2]=l,o[3]=u}else s=o[1],l=o[2],u=o[3];o[4]!==s||o[5]!==l?(p=e=>l(s,e),o[4]=s,o[5]=l,o[6]=p):p=o[6];const I=p;let y;return o[7]!==I||o[8]!==u?(y=(0,me.jsx)(j.ToolCall,Object.assign({},u,{onInlineDetailsExpandedChange:I})),o[7]=I,o[8]=u,o[9]=y):y=o[9],y}Me.displayName="AgentStreamView";const We=(0,f.withUnistyles)(p.LoadingSpinner),Le=(0,f.withUnistyles)(b.Check),qe=(0,f.withUnistyles)(b.X),ze=e=>({color:e.colors.foreground}),Ve=e=>({color:e.colors.foregroundMuted}),Ke=({pressed:e,hovered:t=!1})=>[Xe.optionButton,t?Xe.optionButtonHovered:null,e?Xe.optionButtonPressed:null];function Ge(e){const t=(0,c.c)(16),{action:n,isRespondingAction:u,isResponding:p,isPrimary:h,Icon:I,testID:y,onPress:f}=e;let x;t[0]!==n||t[1]!==f?(x=()=>f(n),t[0]=n,t[1]=f,t[2]=x):x=t[2];const v=x;let S;t[3]!==h?(S=h?[Xe.optionText,Xe.optionTextPrimary]:Xe.optionText,t[3]=h,t[4]=S):S=t[4];const w=S,b=h?ze:Ve;let T,k;return t[5]!==I||t[6]!==n||t[7]!==b||t[8]!==u||t[9]!==w?(T=u?(0,me.jsx)(We,{size:"small",uniProps:b}):(0,me.jsxs)(l.View,{style:Xe.optionContent,children:[(0,me.jsx)(I,{size:14,uniProps:b}),(0,me.jsx)(s.Text,{style:w,children:n.label})]}),t[5]=I,t[6]=n,t[7]=b,t[8]=u,t[9]=w,t[10]=T):T=t[10],t[11]!==v||t[12]!==p||t[13]!==T||t[14]!==y?(k=(0,me.jsx)(o.Pressable,{accessibilityRole:"button",testID:y,style:Ke,onPress:v,disabled:p,children:T}),t[11]=v,t[12]=p,t[13]=T,t[14]=y,t[15]=k):k=t[15],k}function Ne(e){const t=(0,c.c)(85),{permission:n,client:o,serverId:u,context:p}=e,{t:I}=(0,y.useTranslation)(),f=(0,x.useIsCompactFormFactor)(),{request:S}=n,w="plan"===S.kind;let b;t[0]!==w||t[1]!==S.name||t[2]!==S.title||t[3]!==I?(b=w?I("agentStream.permission.plan"):S.title??S.name??I("agentStream.permission.required"),t[0]=w,t[1]=S.name,t[2]=S.title,t[3]=I,t[4]=b):b=t[4];const T=b,k=S.description??"";let j;t[5]!==S.detail||t[6]!==S.input?(j=S.detail??{type:"unknown",input:S.input??null,output:null},t[5]=S.detail,t[6]=S.input,t[7]=j):j=t[7];const P=j;let _;e:{if("question"===S.kind){let e;t[8]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[8]=e):e=t[8],_=e;break e}if(Array.isArray(S.actions)&&S.actions.length>0){_=S.actions;break e}let e,n,o,s,l;t[9]!==I?(e=I("agentStream.permission.deny"),t[9]=I,t[10]=e):e=t[10],t[11]!==e?(n={id:"reject",label:e,behavior:"deny",variant:"danger",intent:"dismiss"},t[11]=e,t[12]=n):n=t[12],t[13]!==w||t[14]!==I?(o=I(w?"agentStream.permission.implement":"agentStream.permission.accept"),t[13]=w,t[14]=I,t[15]=o):o=t[15],t[16]!==o?(s={id:"accept",label:o,behavior:"allow",variant:"primary"},t[16]=o,t[17]=s):s=t[17],t[18]!==n||t[19]!==s?(l=[n,s],t[18]=n,t[19]=s,t[20]=l):l=t[20],_=l}const O=_;let F;e:{if(!S){F=void 0;break e}const e="string"==typeof S.metadata?.planText?S.metadata.planText:void 0;if(e){F=e;break e}const t=S.input?.plan;"string"!=typeof t?F=void 0:F=t}const B=F;let R;t[21]!==o||t[22]!==I?(R={mutationFn:async e=>{if(!o)throw new Error(I("common.errors.daemonClientUnavailable"));return o.respondToPermissionAndWait(e.agentId,e.requestId,e.response,15e3)}},t[21]=o,t[22]=I,t[23]=R):R=t[23];const M=(0,v.useMutation)(R),{reset:D,mutateAsync:E,isPending:W}=M,[L,q]=(0,h.useState)(null);let z,V,K;t[24]!==D?(z=()=>{D(),q(null)},t[24]=D,t[25]=z):z=t[25],t[26]!==n.request.id||t[27]!==D?(V=[n.request.id,D],t[26]=n.request.id,t[27]=D,t[28]=V):V=t[28],(0,h.useEffect)(z,V),t[29]!==n.agentId||t[30]!==n.request.id||t[31]!==E?(K=e=>E({agentId:n.agentId,requestId:n.request.id,response:e}).catch(Je),t[29]=n.agentId,t[30]=n.request.id,t[31]=E,t[32]=K):K=t[32];const G=K;let N;t[33]!==G?(N=e=>{q(e.id),"allow"!==e.behavior?G({behavior:"deny",selectedActionId:e.id,message:"Denied by user"}).catch(Ue):G({behavior:"allow",selectedActionId:e.id}).catch($e)},t[33]=G,t[34]=N):N=t[34];const U=N,$=!f&&Xe.optionsContainerDesktop;let J;t[35]!==$?(J=[Xe.optionsContainer,$],t[35]=$,t[36]=J):J=t[36];const Q=J;if("question"===S.kind){const e=p.workspaceId??void 0;let s;return t[37]!==o||t[38]!==p.cwd||t[39]!==G||t[40]!==W||t[41]!==n||t[42]!==u||t[43]!==e?(s=(0,me.jsx)(A.QuestionFormCard,{permission:n,serverId:u,workspaceId:e,cwd:p.cwd,client:o,onRespond:G,isResponding:W}),t[37]=o,t[38]=p.cwd,t[39]=G,t[40]=W,t[41]=n,t[42]=u,t[43]=e,t[44]=s):s=t[44],s}let X,Y,Z,ee,te;if(t[45]!==I?(X=I("agentStream.permission.question"),t[45]=I,t[46]=X):X=t[46],t[47]!==X?(Y=(0,me.jsx)(s.Text,{testID:"permission-request-question",style:Xe.question,children:X}),t[47]=X,t[48]=Y):Y=t[48],t[49]!==U||t[50]!==W||t[51]!==O||t[52]!==L){let e;t[54]!==U||t[55]!==W||t[56]!==L?(e=e=>{const t="primary"===e.variant,n=L===e.id,o="allow"===e.behavior?Le:qe;let s;return s="deny"===e.behavior?"permission-request-deny":"accept"===e.id||"implement"===e.id?"permission-request-accept":`permission-request-action-${e.id}`,(0,me.jsx)(Ge,{action:e,isRespondingAction:n,isResponding:W,isPrimary:t,Icon:o,testID:s,onPress:U},e.id)},t[54]=U,t[55]=W,t[56]=L,t[57]=e):e=t[57],Z=O.map(e),t[49]=U,t[50]=W,t[51]=O,t[52]=L,t[53]=Z}else Z=t[53];t[58]!==Q||t[59]!==Z?(ee=(0,me.jsx)(l.View,{style:Q,children:Z}),t[58]=Q,t[59]=Z,t[60]=ee):ee=t[60],t[61]!==Y||t[62]!==ee?(te=(0,me.jsxs)(me.Fragment,{children:[Y,ee]}),t[61]=Y,t[62]=ee,t[63]=te):te=t[63];const ne=te;if(w&&B){let e;return t[64]!==k||t[65]!==ne||t[66]!==B||t[67]!==T?(e=(0,me.jsx)(C.PlanCard,{title:T,description:k,text:B,outcome:"pending",footer:ne,testID:"permission-plan-card",disableOuterSpacing:!0}),t[64]=k,t[65]=ne,t[66]=B,t[67]=T,t[68]=e):e=t[68],e}let oe,se,re,ie,ae;return t[69]!==T?(oe=(0,me.jsx)(s.Text,{style:Xe.title,children:T}),t[69]=T,t[70]=oe):oe=t[70],t[71]!==k?(se=k?(0,me.jsx)(s.Text,{style:Xe.description,children:k}):null,t[71]=k,t[72]=se):se=t[72],t[73]!==B||t[74]!==I?(re=B?(0,me.jsx)(C.PlanCard,{title:I("agentStream.permission.proposedPlan"),text:B,testID:"permission-plan-card",disableOuterSpacing:!0}):null,t[73]=B,t[74]=I,t[75]=re):re=t[75],t[76]!==w||t[77]!==P?(ie=w?null:(0,me.jsx)(H.ToolCallDetailsContent,{detail:P,maxHeight:200}),t[76]=w,t[77]=P,t[78]=ie):ie=t[78],t[79]!==ne||t[80]!==oe||t[81]!==se||t[82]!==re||t[83]!==ie?(ae=(0,me.jsxs)(l.View,{style:Xe.container,children:[oe,se,re,ie,ne]}),t[79]=ne,t[80]=oe,t[81]=se,t[82]=re,t[83]=ie,t[84]=ae):ae=t[84],ae}function Ue(){}function $e(){}function Je(e){throw console.error("[PermissionRequestCard] Failed to respond to permission:",e),e}const Qe=f.StyleSheet.create(e=>({container:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},contentWrapper:{width:"100%",maxWidth:e.contentMaxWidth,alignSelf:"center",paddingHorizontal:e.spacing[2],uni__dependencies:[0]},listContentContainer:{paddingVertical:0,flexGrow:1,paddingHorizontal:{xs:e.spacing[3],md:e.spacing[4]},uni__dependencies:[0]},forwardListContentContainer:{paddingTop:e.spacing[4],paddingBottom:e.spacing[4],uni__dependencies:[0]},list:{flex:1},responseHoverTarget:{position:"relative"},streamItemWrapper:{width:"100%",maxWidth:e.contentMaxWidth,alignSelf:"center",paddingHorizontal:e.spacing[2],uni__dependencies:[0]},workToggle:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],marginTop:e.spacing[1],marginBottom:e.spacing[4],paddingBottom:e.spacing[2],borderBottomWidth:1,borderBottomColor:e.colors.border,uni__dependencies:[0]},workToggleText:{flexShrink:1,color:e.colors.foregroundMuted,fontSize:e.fontSize.base,uni__dependencies:[0]},emptyState:{flex:1,alignItems:"center",justifyContent:"center",paddingVertical:e.spacing[12],uni__dependencies:[0]},permissionsContainer:{gap:e.spacing[2],uni__dependencies:[0]},listHeaderContent:{gap:e.spacing[3],uni__dependencies:[0]},syncingIndicator:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],paddingVertical:e.spacing[1],paddingLeft:e.spacing[2],uni__dependencies:[0]},syncingIndicatorText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.base,uni__dependencies:[0]},invertedWrapper:{transform:[{scaleY:-1}],width:"100%"},emptyStateText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.base,textAlign:"center",uni__dependencies:[0]},scrollToBottomContainer:{position:"absolute",left:0,right:0,alignItems:"center"},scrollToBottomButton:Object.assign({width:48,height:48,borderRadius:24,backgroundColor:e.colors.surface2,alignItems:"center",justifyContent:"center"},e.shadow.sm,{uni__dependencies:[0]}),scrollToBottomIcon:{color:e.colors.foreground,uni__dependencies:[0]}})),Xe=f.StyleSheet.create(e=>({container:{marginVertical:e.spacing[3],padding:e.spacing[3],borderRadius:e.spacing[2],borderWidth:1,gap:e.spacing[2],backgroundColor:e.colors.surface1,borderColor:e.colors.border,uni__dependencies:[0]},title:{fontSize:e.fontSize.base,lineHeight:22,color:e.colors.foreground,uni__dependencies:[0]},description:{fontSize:e.fontSize.base,lineHeight:20,color:e.colors.foregroundMuted,uni__dependencies:[0]},section:{gap:e.spacing[2],uni__dependencies:[0]},sectionTitle:{fontSize:e.fontSize.sm,uni__dependencies:[0]},question:{fontSize:e.fontSize.base,marginTop:e.spacing[1],marginBottom:e.spacing[1],color:e.colors.foregroundMuted,uni__dependencies:[0]},optionsContainer:{gap:e.spacing[2],uni__dependencies:[0]},optionsContainerDesktop:{flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"center",width:"100%"},optionButton:{paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[3],borderRadius:e.borderRadius.md,alignItems:"center",borderWidth:e.borderWidth[1],backgroundColor:e.colors.surface1,borderColor:e.colors.borderAccent,uni__dependencies:[0]},optionButtonHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},optionButtonPressed:{opacity:.9},optionContent:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},optionText:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.normal,color:e.colors.foregroundMuted,uni__dependencies:[0]},optionTextPrimary:{color:e.colors.foreground,uni__dependencies:[0]}}));function Ye(e){const t=(0,c.c)(12),{itemId:n,belowItemId:o,gapBelow:s,responseMessageId:u,children:p}=e,h=void 0!==(0,le.useWorkToggle)(o)?0:s,I=u?0:h;let y;t[0]!==I?(y=[Qe.streamItemWrapper,{marginBottom:I}],t[0]=I,t[1]=y):y=t[1];const f=y;let x,v,S;return t[2]!==n?(x=(0,me.jsx)(nt,{itemId:n}),t[2]=n,t[3]=x):x=t[3],t[4]!==p||t[5]!==h||t[6]!==u?(v=u?(0,me.jsx)(Ze,{messageId:u,paddingBottom:h,children:p}):p,t[4]=p,t[5]=h,t[6]=u,t[7]=v):v=t[7],t[8]!==x||t[9]!==v||t[10]!==f?(S=(0,me.jsxs)(l.View,{style:f,children:[x,v]}),t[8]=x,t[9]=v,t[10]=f,t[11]=S):S=t[11],S}function Ze(e){const t=(0,c.c)(11),{messageId:n,paddingBottom:o,children:s}=e;let u;t[0]!==n?(u=()=>G.useHoveredResponseStore.setState({messageId:n}),t[0]=n,t[1]=u):u=t[1];const p=u;let h;t[2]!==n?(h=()=>{G.useHoveredResponseStore.getState().messageId===n&&G.useHoveredResponseStore.setState({messageId:void 0})},t[2]=n,t[3]=h):h=t[3];const I=h;let y;t[4]!==o?(y=[Qe.responseHoverTarget,{paddingBottom:o}],t[4]=o,t[5]=y):y=t[5];const f=y;let x;return t[6]!==s||t[7]!==p||t[8]!==I||t[9]!==f?(x=(0,me.jsx)(l.View,{style:f,onPointerEnter:p,onPointerLeave:I,children:s}),t[6]=s,t[7]=p,t[8]=I,t[9]=f,t[10]=x):x=t[10],x}const et=(0,f.withUnistyles)(b.ChevronRight),tt=(0,f.withUnistyles)(b.ChevronDown);function nt(e){const t=(0,c.c)(2),{itemId:n}=e,o=(0,le.useWorkToggle)(n);let s;return t[0]!==o?(s=o?(0,me.jsx)(ot,Object.assign({},o)):null,t[0]=o,t[1]=s):s=t[1],s}function ot(e){const t=(0,c.c)(24),{turnKey:n,expanded:u,hasWork:p,durationMs:I,onToggle:f,onToggleLayout:x}=e,{t:v}=(0,y.useTranslation)(),S=(0,h.useRef)(null);let w;t[0]!==f||t[1]!==n?(w=()=>{if(oe.isWeb)return void f({turnKey:n});const e=S.current;e?.measureInWindow((t,o)=>{S.current===e&&f({turnKey:n,top:o})})},t[0]=f,t[1]=n,t[2]=w):w=t[2];const b=w;let T,k,j;t[3]!==x||t[4]!==n?(T=()=>{if(oe.isWeb)return;const e=S.current;e?.measureInWindow((t,o)=>{S.current===e&&x({turnKey:n,top:o})})},k=[x,n],t[3]=x,t[4]=n,t[5]=T,t[6]=k):(T=t[5],k=t[6]),(0,h.useLayoutEffect)(T,k),t[7]!==u?(j={expanded:u},t[7]=u,t[8]=j):j=t[8];const C=j;let P;t[9]!==I||t[10]!==u||t[11]!==v?(P=null!==I?v("agentStream.workedFor",{duration:(0,se.formatDuration)(I)}):v(u?"settings.customizations.hideWork":"settings.customizations.showWork"),t[9]=I,t[10]=u,t[11]=v,t[12]=P):P=t[12];const _=P;if(!p){let e;return t[13]!==_?(e=(0,me.jsx)(l.View,{style:Qe.workToggle,testID:"work-toggle",children:(0,me.jsx)(s.Text,{numberOfLines:1,style:Qe.workToggleText,children:_})}),t[13]=_,t[14]=e):e=t[14],e}const O=u?tt:et;let F,B,R;return t[15]!==_?(F=(0,me.jsx)(s.Text,{numberOfLines:1,style:Qe.workToggleText,children:_}),t[15]=_,t[16]=F):F=t[16],t[17]!==O?(B=(0,me.jsx)(O,{size:14,uniProps:Ve}),t[17]=O,t[18]=B):B=t[18],t[19]!==C||t[20]!==b||t[21]!==F||t[22]!==B?(R=(0,me.jsxs)(o.Pressable,{ref:S,accessibilityRole:"button",accessibilityState:C,onPress:b,style:Qe.workToggle,testID:"work-toggle",children:[F,B]}),t[19]=C,t[20]=b,t[21]=F,t[22]=B,t[23]=R):R=t[23],R}function st(e){return e.autoExpandReasoning}function rt(e){return e.toolCallDetailLevel}function it(e){return e.chatOutlineEnabled}function at(e){return e.clientMessageId}},4238,[36,898,897,896,454,4239,3023,37,854,147,235,426,26,57,1217,800,899,1218,3554,4258,4259,4292,3459,3749,4328,4330,884,4331,4294,4332,4293,4250,4485,4487,4493,4511,4514,3529,3643,4515,4519,4520,4314,4522,4300,3580,3671,3911,4526,4528,4326,881,3012,4283,3709,4529,4530,4531,4534,4535,4537,280]);
|
|
15894
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useChatFindSelectedMessageId=
|
|
15894
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useChatFindSelectedMessageId=T,e.ChatFindExpansion=function(n){const t=(0,o.c)(3),{messageId:s,children:c}=n,l=T()===s;let u;t[0]!==c||t[1]!==l?(u=c(l),t[0]=c,t[1]=l,t[2]=u):u=t[2];return u},e.ChatFind=function({agentId:o,serverId:c,epoch:T,items:O,viewportRef:$,revealLoadedMessage:A,visibleMessageIds:H,expandedTurnKeys:L,expandTurn:B,children:z}){const{t:D}=(0,l.useTranslation)(),K=(0,s.useRef)(null),N=(0,s.useRef)(null),V=(0,s.useRef)({viewportRef:$,revealLoadedMessage:A,visibleMessageIds:H,items:O,expandTurn:B});V.current={viewportRef:$,revealLoadedMessage:A,visibleMessageIds:H,items:O,expandTurn:B};const W=(0,h.useSessionStore)(n=>!0===n.sessions[c]?.serverInfo?.features?.chatFindOptions),[Q]=(0,s.useState)(()=>"paseo-chat-find-"+ ++R),{isInteractive:G}=(0,v.usePaneFocus)(),J=(0,y.useRetainedPanelActive)(),U=(0,s.useMemo)(()=>new M.ChatFindModel({operations:Object.assign({search({query:n,cursor:t,options:s}){const l=(0,S.getHostRuntimeStore)().getClient(c);return l?l.searchAgentTimeline({agentId:o,query:n,cursor:t,options:s}):Promise.reject(new Error("Host disconnected"))},load:(n,t)=>(0,S.getHostRuntimeStore)().fetchAgentTimeline(c,o,(0,C.planTimelinePromptJump)({epoch:n,seq:t}))},(0,I.createFindViewport)({getBindings:()=>V.current,getRoot:()=>N.current,highlightName:Q})),optionsSupported:W}),[o,c,Q,W]),X=(0,s.useSyncExternalStore)(U.subscribe,U.getSnapshot,U.getSnapshot),Y=`${Q}-matches`,Z=J&&X.open&&Boolean(X.query.trim())&&X.phase!==M.ChatFindPhase.Invalid&&X.phase!==M.ChatFindPhase.Error;(0,s.useEffect)(()=>{const n=N.current;if(!Z||!n)return;const t=(0,b.createPhrasePattern)({query:X.query,options:X.options});let o;function s(n){o=void 0;const s=new Highlight(...(0,P.findRenderedMatches)(n,t));s.priority=-1,CSS.highlights.set(Y,s)}const c=new MutationObserver(()=>{void 0===o&&(o=requestAnimationFrame(()=>s(n)))});return c.observe(n,{subtree:!0,childList:!0,characterData:!0}),s(n),()=>{c.disconnect(),void 0!==o&&cancelAnimationFrame(o),CSS.highlights.delete(Y)}},[Z,Y,X.query,X.options]),(0,s.useEffect)(()=>{U.updateHistory({epoch:T,items:O,expandedTurnKeys:L})},[U,T,O,L]),(0,s.useEffect)(()=>()=>U.close(),[U]),(0,s.useEffect)(()=>{J||U.close()},[J,U]),(0,s.useEffect)(()=>{if(!J||!G)return;const n=n=>{n.defaultPrevented||(0,x.hasActiveWebOverlay)()||(0,F.isImeComposingKeyboardEvent)(n)||(0,u.isFindShortcut)(n,(0,u.findShortcutPlatform)())&&(n.preventDefault(),U.open(),K.current?.focus())};return document.addEventListener("keydown",n,!0),()=>document.removeEventListener("keydown",n,!0)},[J,G,U]);const ee=(0,s.useCallback)(()=>{U.close(),N.current?.focus({preventScroll:!0})},[U]),ne=(0,s.useMemo)(()=>(0,_.jsx)(p.SearchOptionGroup,{value:X.options,supported:W,onChange:U.setOptions,includeFolded:!0,dense:!0,testIDPrefix:"chat-find"}),[X.options,W,U]);let te="";"searching"===X.phase?te=D("paneFind.searching"):"loading"===X.phase?te=D("paneFind.loading"):"invalid"===X.phase?te=D("paneFind.invalidRegex"):"error"===X.phase?te=D("paneFind.failed"):X.query.trim()&&(te=X.count?D("paneFind.position",{current:X.occurrence+1,total:X.count}):D("paneFind.noMatches"));return(0,_.jsxs)("div",{ref:N,tabIndex:-1,style:E,children:[(0,_.jsx)("style",{children:`\n ::highlight(${Y}) { background-color: ${q.match.backgroundColor}; color: ${q.match.color}; }\n ::highlight(${Q}) { background-color: ${q.selectedMatch.backgroundColor}; color: ${q.selectedMatch.color}; }\n `}),(0,_.jsx)(w.Provider,{value:X.selectedItemId,children:z}),X.open&&(0,_.jsxs)(t.View,{style:q.overlay,dataSet:k,children:[(0,_.jsx)(u.PaneFind,{ref:K,query:X.query,status:te,invalid:"invalid"===X.phase,options:ne,canNavigate:"ready"===X.phase&&X.count>0,onQueryChange:U.setQuery,onNext:U.next,onPrevious:U.previous,onClose:ee}),X.failure&&(0,_.jsxs)(t.View,{style:q.error,children:[(0,_.jsx)(n.Text,{style:q.errorText,children:D(j[X.failure])}),(0,_.jsx)(f.Button,{size:"xs",variant:"ghost",onPress:U.retry,children:D("paneFind.retry")})]})]})]})};var n=r(d[0]),t=r(d[1]),o=r(d[2]),s=r(d[3]);r(d[4]),r(d[5]);var c=r(d[6]),l=r(d[7]),u=r(d[8]),h=r(d[9]),p=r(d[10]),f=r(d[11]),v=r(d[12]),y=r(d[13]),x=r(d[14]),F=r(d[15]),S=r(d[16]),C=r(d[17]),b=r(d[18]),M=r(d[19]),I=r(d[20]),P=r(d[21]),_=r(d[22]);const w=(0,s.createContext)(null),j={connection:"paneFind.connectionFailure",historyChanged:"paneFind.historyChangedFailure",reveal:"paneFind.revealFailure"},k={chatFindWidget:"true"},E={display:"flex",flex:1,minHeight:0,position:"relative",outline:"none"};let R=0;function T(){return(0,s.useContext)(w)}const q=c.StyleSheet.create(n=>({overlay:{position:"absolute",top:n.spacing[2],right:n.spacing[3],zIndex:10,maxWidth:"100%",uni__dependencies:[0]},error:{flexDirection:"row",alignItems:"center",padding:n.spacing[2],backgroundColor:n.colors.surface1,uni__dependencies:[0]},errorText:{color:n.colors.foreground,fontSize:n.fontSize.sm,flex:1,uni__dependencies:[0]},match:{backgroundColor:n.colors.searchMatchBackground,color:n.colors.searchMatchForeground,uni__dependencies:[0]},selectedMatch:{backgroundColor:n.colors.searchSelectedMatchBackground,color:n.colors.searchSelectedMatchForeground,uni__dependencies:[0]}}))},4239,[897,896,454,37,147,235,57,854,4240,3459,4243,3022,4245,3709,2882,4241,3529,3643,4246,4247,4249,4257,280]);
|
|
15895
15895
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"isFindShortcut",{enumerable:!0,get:function(){return _.isFindShortcut}}),e.findShortcutPlatform=S,Object.defineProperty(e,"PaneFind",{enumerable:!0,get:function(){return D}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]);r(d[4]),r(d[5]);var l=r(d[6]),c=r(d[7]),u=r(d[8]),p=r(d[9]),h=r(d[10]),y=r(d[11]),f=r(d[12]),b=r(d[13]),x=r(d[14]),v=r(d[15]),j=r(d[16]),w=r(d[17]),_=r(d[18]),C=r(d[19]);function S(){return{isMac:"mac"===(0,w.getShortcutOs)()}}const T=(0,c.withUnistyles)(h.EditingTextInput,t=>({placeholderTextColor:t.colors.foregroundMuted})),F=(0,c.withUnistyles)(l.ArrowUp,f.mutedIconColorMapping),K=(0,c.withUnistyles)(l.ArrowDown,f.mutedIconColorMapping),P=(0,c.withUnistyles)(l.X,f.mutedIconColorMapping),R=(0,c.withUnistyles)(l.ChevronDown,f.mutedIconColorMapping),I=(0,c.withUnistyles)(l.ChevronRight,f.mutedIconColorMapping),z=(0,s.forwardRef)(function(n,l){const c=(0,o.c)(23),{label:u,initialValue:p,height:h,trailing:f,onChangeText:b,onKeyPress:x,autoFocus:v,returnKeyType:j,invalid:w}=n,[_,S]=(0,s.useState)(!1);let F;c[0]===Symbol.for("react.memo_cache_sentinel")?(F=()=>S(!0),c[0]=F):F=c[0];const K=F;let P;c[1]===Symbol.for("react.memo_cache_sentinel")?(P=()=>S(!1),c[1]=P):P=c[1];const R=P;let I,z;c[2]!==h?(I={minHeight:h},c[2]=h,c[3]=I):I=c[3],c[4]!==_?(z=(0,y.resolveControlInteractionStyles)({controlRest:A.controlRest,controlHover:A.controlHover,controlActive:A.controlActive},{focused:_}),c[4]=_,c[5]=z):z=c[5];const D=w&&A.invalid;let O;c[6]!==I||c[7]!==z||c[8]!==D?(O=[A.field,I,z,D],c[6]=I,c[7]=z,c[8]=D,c[9]=O):O=c[9];const E=O;let V,k;return c[10]!==v||c[11]!==p||c[12]!==w||c[13]!==u||c[14]!==b||c[15]!==x||c[16]!==l||c[17]!==j?(V=(0,C.jsx)(T,{ref:l,autoFocus:v,selectTextOnFocus:!0,initialValue:p,onChangeText:b,onKeyPress:x,onFocus:K,onBlur:R,accessibilityLabel:u,"aria-invalid":w,placeholder:u,autoCapitalize:"none",autoCorrect:!1,blurOnSubmit:!1,returnKeyType:j,style:A.input}),c[10]=v,c[11]=p,c[12]=w,c[13]=u,c[14]=b,c[15]=x,c[16]=l,c[17]=j,c[18]=V):V=c[18],c[19]!==E||c[20]!==V||c[21]!==f?(k=(0,C.jsxs)(t.View,{style:E,children:[V,f]}),c[19]=E,c[20]=V,c[21]=f,c[22]=k):k=c[22],k}),D=(0,s.forwardRef)(function(l,c){const h=(0,o.c)(104),{query:y,status:w,canNavigate:T,onQueryChange:D,onNext:V,onPrevious:k,onClose:M,replace:H,options:W,invalid:B}=l,{t:U}=(0,u.useTranslation)(),L=(0,x.useIsCompactFormFactor)();let N;h[0]!==L?(N=(0,f.smallIconButtonChromeFrameSize)(L),h[0]=L,h[1]=N):N=h[1];const q=N;let G;h[2]!==L?(G=(0,b.paneContentToolbarIconSize)(L),h[2]=L,h[3]=G):G=h[3];const Q=G,X=Math.max(O,q),J=L?"sm":"xs",Y=(0,s.useRef)(null),Z=(0,s.useRef)(null);let $,ee,te,ne;h[4]!==y?($=()=>{Y.current?.getText()!==y&&Y.current?.replaceText(y)},ee=[y],h[4]=y,h[5]=$,h[6]=ee):($=h[5],ee=h[6]),(0,s.useLayoutEffect)($,ee),h[7]!==H?(te=()=>{H&&Z.current?.getText()!==H.value&&Z.current?.replaceText(H.value)},ne=[H],h[7]=H,h[8]=te,h[9]=ne):(te=h[8],ne=h[9]),(0,s.useLayoutEffect)(te,ne);const[oe,ie]=(0,s.useState)(!1);let re;h[10]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{Y.current?.focus();const t=Y.current?.getText()??"";Y.current?.replaceText(t,{start:0,end:t.length})},h[10]=re):re=h[10];const se=re;let le,ae,ce;h[11]===Symbol.for("react.memo_cache_sentinel")?(le=()=>({focus:se}),ae=[se],h[11]=le,h[12]=ae):(le=h[11],ae=h[12]),(0,s.useImperativeHandle)(c,le,ae),h[13]!==M||h[14]!==V||h[15]!==k?(ce=t=>{const n=t.nativeEvent;if((0,j.isImeComposingKeyboardEvent)(n))return;const o={key:n.key,metaKey:!0===n.metaKey,ctrlKey:!0===n.ctrlKey,shiftKey:!0===n.shiftKey,altKey:!0===n.altKey};(0,_.isFindShortcut)(o,S())?(t.preventDefault(),t.stopPropagation(),se()):"Escape"!==n.key&&"Enter"!==n.key||(t.preventDefault(),t.stopPropagation(),"Escape"===n.key?M():n.shiftKey?k():V())},h[13]=M,h[14]=V,h[15]=k,h[16]=ce):ce=h[16];const ue=ce;let de;h[17]===Symbol.for("react.memo_cache_sentinel")?(de=()=>ie(E),h[17]=de):de=h[17];const pe=de;let ge;h[18]!==q||h[19]!==X?(ge=[A.gutter,{width:q,height:X}],h[18]=q,h[19]=X,h[20]=ge):ge=h[20];const he=ge,ye=B&&A.invalidStatus;let fe,me,be;h[21]!==ye?(fe=[A.status,ye],h[21]=ye,h[22]=fe):fe=h[22],h[23]!==U?(me=U("paneFind.matches"),h[23]=U,h[24]=me):me=h[24],h[25]!==w||h[26]!==fe||h[27]!==me?(be=(0,C.jsx)(n.Text,{style:fe,role:"status",accessibilityLabel:me,accessibilityLiveRegion:"polite",children:w}),h[25]=w,h[26]=fe,h[27]=me,h[28]=be):be=h[28];const xe=be;let ve,je,we,_e;h[29]!==U?(ve=U("paneFind.title"),h[29]=U,h[30]=ve):ve=h[30],h[31]!==M?(je=v.isWeb?{onKeyDown:t=>{"Escape"!==t.key||(0,j.isImeComposingKeyboardEvent)(t.nativeEvent)||(t.preventDefault(),t.stopPropagation(),M())}}:{},h[31]=M,h[32]=je):je=h[32],h[33]!==Q||h[34]!==he||h[35]!==L||h[36]!==H||h[37]!==oe||h[38]!==U?(we=H?(0,C.jsx)(t.View,{style:he,children:(0,C.jsx)(b.ToolbarButton,{label:U("paneFind.toggleReplace"),"aria-expanded":oe,compact:L,onPress:pe,children:oe?(0,C.jsx)(R,{size:Q}):(0,C.jsx)(I,{size:Q})})}):null,h[33]=Q,h[34]=he,h[35]=L,h[36]=H,h[37]=oe,h[38]=U,h[39]=we):we=h[39],h[40]!==U?(_e=U("paneFind.placeholder"),h[40]=U,h[41]=_e):_e=h[41];const Ce=B?null:xe;let Se,Te,Fe;h[42]!==W||h[43]!==Ce?(Se=(0,C.jsxs)(C.Fragment,{children:[Ce,W]}),h[42]=W,h[43]=Ce,h[44]=Se):Se=h[44],h[45]!==B||h[46]!==ue||h[47]!==D||h[48]!==y||h[49]!==X||h[50]!==_e||h[51]!==Se?(Te=(0,C.jsx)(z,{ref:Y,autoFocus:!0,label:_e,initialValue:y,height:X,returnKeyType:"search",invalid:B,trailing:Se,onChangeText:D,onKeyPress:ue}),h[45]=B,h[46]=ue,h[47]=D,h[48]=y,h[49]=X,h[50]=_e,h[51]=Se,h[52]=Te):Te=h[52],h[53]!==U?(Fe=U("paneFind.previous"),h[53]=U,h[54]=Fe):Fe=h[54];const Ke=!T;let Pe,Re,Ie;h[55]!==Q?(Pe=(0,C.jsx)(F,{size:Q}),h[55]=Q,h[56]=Pe):Pe=h[56],h[57]!==L||h[58]!==k||h[59]!==Fe||h[60]!==Ke||h[61]!==Pe?(Re=(0,C.jsx)(b.ToolbarButton,{label:Fe,compact:L,disabled:Ke,onPress:k,children:Pe}),h[57]=L,h[58]=k,h[59]=Fe,h[60]=Ke,h[61]=Pe,h[62]=Re):Re=h[62],h[63]!==U?(Ie=U("paneFind.next"),h[63]=U,h[64]=Ie):Ie=h[64];const ze=!T;let De,Oe,Ae,Ee,Ve,ke;h[65]!==Q?(De=(0,C.jsx)(K,{size:Q}),h[65]=Q,h[66]=De):De=h[66],h[67]!==L||h[68]!==V||h[69]!==Ie||h[70]!==ze||h[71]!==De?(Oe=(0,C.jsx)(b.ToolbarButton,{label:Ie,compact:L,disabled:ze,onPress:V,children:De}),h[67]=L,h[68]=V,h[69]=Ie,h[70]=ze,h[71]=De,h[72]=Oe):Oe=h[72],h[73]!==U?(Ae=U("paneFind.close"),h[73]=U,h[74]=Ae):Ae=h[74],h[75]!==Q?(Ee=(0,C.jsx)(P,{size:Q}),h[75]=Q,h[76]=Ee):Ee=h[76],h[77]!==L||h[78]!==M||h[79]!==Ae||h[80]!==Ee?(Ve=(0,C.jsx)(b.ToolbarButton,{label:Ae,compact:L,onPress:M,children:Ee}),h[77]=L,h[78]=M,h[79]=Ae,h[80]=Ee,h[81]=Ve):Ve=h[81],h[82]!==Te||h[83]!==Re||h[84]!==Oe||h[85]!==Ve?(ke=(0,C.jsxs)(t.View,{style:A.row,children:[Te,Re,Oe,Ve]}),h[82]=Te,h[83]=Re,h[84]=Oe,h[85]=Ve,h[86]=ke):ke=h[86];const Me=B?xe:null;let He,We,Be;return h[87]!==J||h[88]!==T||h[89]!==ue||h[90]!==H||h[91]!==oe||h[92]!==X||h[93]!==U?(He=H&&oe?(0,C.jsxs)(t.View,{style:A.row,children:[(0,C.jsx)(z,{ref:Z,label:U("paneFind.replaceWith"),initialValue:H.value,height:X,onChangeText:H.onChange,onKeyPress:ue}),(0,C.jsx)(p.Button,{variant:"ghost",size:J,style:A.replaceAction,disabled:!T,onPress:H.onReplace,children:U("paneFind.replace")}),(0,C.jsx)(p.Button,{variant:"ghost",size:J,style:A.replaceAction,disabled:!T,onPress:H.onReplaceAll,children:U("paneFind.replaceAll")})]}):null,h[87]=J,h[88]=T,h[89]=ue,h[90]=H,h[91]=oe,h[92]=X,h[93]=U,h[94]=He):He=h[94],h[95]!==ke||h[96]!==Me||h[97]!==He?(We=(0,C.jsxs)(t.View,{style:A.rows,children:[ke,Me,He]}),h[95]=ke,h[96]=Me,h[97]=He,h[98]=We):We=h[98],h[99]!==ve||h[100]!==je||h[101]!==we||h[102]!==We?(Be=(0,C.jsxs)(t.View,Object.assign({style:A.widget,accessibilityLabel:ve},je,{children:[we,We]})),h[99]=ve,h[100]=je,h[101]=we,h[102]=We,h[103]=Be):Be=h[103],Be}),O=28,A=c.StyleSheet.create(t=>{const n=(0,y.createControlGeometry)(t);return{widget:Object.assign({width:400,maxWidth:"100%",flexDirection:"row",padding:t.spacing[1.5],gap:t.spacing[1],backgroundColor:t.colors.surface1,borderWidth:t.borderWidth[1],borderColor:t.colors.border,borderRadius:t.borderRadius.lg},t.shadow.md,{uni__dependencies:[0]}),gutter:{alignItems:"center",justifyContent:"center",flexShrink:0},rows:{flex:1,minWidth:0,gap:t.spacing[1],uni__dependencies:[0]},row:{flexDirection:"row",alignItems:"center",gap:t.spacing[1],uni__dependencies:[0]},field:{flex:1,minWidth:0,flexDirection:"row",alignItems:"center",gap:t.spacing[2],paddingHorizontal:t.spacing[2],backgroundColor:t.colors.surface2,borderRadius:t.borderRadius.md,uni__dependencies:[0]},invalid:{borderColor:t.colors.statusDanger,outlineColor:t.colors.statusDanger,uni__dependencies:[0]},controlRest:Object.assign({},n.controlRest),controlHover:Object.assign({},n.controlHover),controlActive:Object.assign({},n.controlActive),input:Object.assign({flex:1,minWidth:0,paddingHorizontal:0,paddingVertical:0,color:t.colors.foreground,outlineWidth:0,outlineColor:"transparent"},n.fieldTextSm,{uni__dependencies:[0]}),status:{flexShrink:0,color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},invalidStatus:{color:t.colors.statusDanger,uni__dependencies:[0]},replaceAction:{paddingHorizontal:t.spacing[2],uni__dependencies:[0]}}});function E(t){return!t}},4240,[896,897,454,37,235,147,1218,57,854,3022,3700,3025,4048,4175,1217,881,4241,3735,4242,280]);
|
|
15896
15896
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isImeComposingKeyboardEvent=function(o){return Boolean(o.isComposing)||229===o.keyCode}},4241,[]);
|
|
15897
15897
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isFindShortcut=function(t,c){return(c.isMac?t.metaKey&&!t.ctrlKey:t.ctrlKey&&!t.metaKey)&&!t.shiftKey&&!t.altKey&&"f"===t.key.toLowerCase()}},4242,[]);
|
|
15898
15898
|
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["includeFolded"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.SearchOptionGroup=C,_e.HistorySearchField=function(e){const s=(0,c.c)(27),{search:t,supported:o,leading:u,onCommit:h}=e,{t:b}=(0,p.useTranslation)();let f;s[0]!==t.options||s[1]!==t.setOptions||s[2]!==o?(f=(0,y.jsx)(C,{value:t.options,supported:o,onChange:t.setOptions}),s[0]=t.options,s[1]=t.setOptions,s[2]=o,s[3]=f):f=s[3];const v=f,_=t.invalid,j=t.input,S=t.setInput;let I,O,W,D,F,w;s[4]!==b?(I=b("sessions.searchPlaceholder"),s[4]=b,s[5]=I):I=s[5];s[6]!==b?(O=b("sessions.actions.clearSearch"),s[6]=b,s[7]=O):O=s[7];s[8]!==u||s[9]!==h||s[10]!==t.input||s[11]!==t.invalid||s[12]!==t.setInput||s[13]!==I||s[14]!==O||s[15]!==v?(W=(0,y.jsx)(x.SearchField,{fullWidth:!0,autoFocus:!0,invalid:_,trailing:v,leading:u,onCommit:h,value:j,onChangeText:S,placeholder:I,clearAccessibilityLabel:O,testID:"sessions-search-input",clearTestID:"sessions-search-clear"}),s[8]=u,s[9]=h,s[10]=t.input,s[11]=t.invalid,s[12]=t.setInput,s[13]=I,s[14]=O,s[15]=v,s[16]=W):W=s[16];s[17]!==o||s[18]!==b?(D=o?null:(0,y.jsx)(n.Text,{style:T.hint,testID:"sessions-search-update-host",children:b("sessions.searchOptions.updateHost")}),s[17]=o,s[18]=b,s[19]=D):D=s[19];s[20]!==t.invalid||s[21]!==b?(F=t.invalid?(0,y.jsx)(n.Text,{style:T.error,accessibilityRole:"alert",testID:"sessions-search-error",children:b("sessions.searchOptions.invalidRegex")}):null,s[20]=t.invalid,s[21]=b,s[22]=F):F=s[22];s[23]!==W||s[24]!==D||s[25]!==F?(w=(0,y.jsxs)(l.View,{style:T.field,children:[W,D,F]}),s[23]=W,s[24]=D,s[25]=F,s[26]=w):w=s[26];return w};var s,t=r(d[0]),o=(s=t)&&s.__esModule?s:{default:s},n=r(d[1]),l=r(d[2]),c=r(d[3]);r(d[4]),r(d[5]),r(d[6]);var p=r(d[7]),u=r(d[8]),h=r(d[9]),b=r(d[10]),f=r(d[11]),v=r(d[12]),x=r(d[13]),_=r(d[14]),y=r(d[15]),j=(function(e){return e.CaseSensitive="caseSensitive",e.WholeWord="wholeWord",e.Regex="regex",e.IncludeFolded="includeFolded",e})(j||{});const S=[{option:j.CaseSensitive,label:"Aa"},{option:j.WholeWord,label:"ab"},{option:j.Regex,label:".*"}],I=(0,h.withUnistyles)(u.ChevronsUpDown,b.mutedIconColorMapping);function O(e){const s=(0,c.c)(34),{value:t,supported:o,onChange:l,option:u,label:h,testIDPrefix:f,dense:x}=e,S=void 0===f?"sessions-search":f,O=void 0!==x&&x,{t:C}=(0,p.useTranslation)(),W=!o,D=Boolean(t[u])&&!W;let F;s[0]!==u||s[1]!==C?(F=u===j.IncludeFolded?C("paneFind.includeCollapsedWork"):C(`sessions.searchOptions.${u}`),s[0]=u,s[1]=C,s[2]=F):F=s[2];const w=F;let z,R=w;if(!o){let e;s[3]!==C?(e=C("sessions.searchOptions.updateHost"),s[3]=C,s[4]=e):e=s[4],R=e}s[5]!==O||s[6]!==W||s[7]!==D?(z=e=>(0,b.iconButtonChromeStyle)({size:v.isNative?"small":"large",compact:v.isNative,state:Object.assign({},e,{active:D}),disabled:W,style:O?T.dense:void 0}),s[5]=O,s[6]=W,s[7]=D,s[8]=z):z=s[8];const H=z;let M;s[9]!==W||s[10]!==D?(M={selected:D,disabled:W},s[9]=W,s[10]=D,s[11]=M):M=s[11];const L=M;let P;s[12]!==l||s[13]!==u||s[14]!==t?(P=()=>l(Object.assign({},t,{[u]:!t[u]})),s[12]=l,s[13]=u,s[14]=t,s[15]=P):P=s[15];const A=`${S}-${u}`,E=W?void 0:P;let N,V,$,k;return s[16]!==u||s[17]!==h?(N=u===j.IncludeFolded?(0,y.jsx)(I,{size:14}):(0,y.jsx)(n.Text,{style:[T.symbol,u===j.WholeWord&&T.wholeWord],children:h}),s[16]=u,s[17]=h,s[18]=N):N=s[18],s[19]!==L||s[20]!==H||s[21]!==W||s[22]!==R||s[23]!==w||s[24]!==D||s[25]!==A||s[26]!==E||s[27]!==N?(V=(0,y.jsx)(_.TooltipTrigger,{"aria-disabled":W,accessibilityRole:"button",accessibilityLabel:w,accessibilityHint:R,accessibilityState:L,"aria-pressed":D,testID:A,style:H,onPress:E,children:N}),s[19]=L,s[20]=H,s[21]=W,s[22]=R,s[23]=w,s[24]=D,s[25]=A,s[26]=E,s[27]=N,s[28]=V):V=s[28],s[29]!==R?($=(0,y.jsx)(_.TooltipContent,{children:(0,y.jsx)(n.Text,{style:T.tooltip,children:R})}),s[29]=R,s[30]=$):$=s[30],s[31]!==V||s[32]!==$?(k=(0,y.jsxs)(_.Tooltip,{children:[V,$]}),s[31]=V,s[32]=$,s[33]=k):k=s[33],k}function C(s){const t=(0,c.c)(12);let n,p;if(t[0]!==s){var u=s;({includeFolded:p}=u),n=(0,o.default)(u,e),t[0]=s,t[1]=n,t[2]=p}else n=t[1],p=t[2];const h=void 0!==p&&p;let b,f,v,x;return t[3]===Symbol.for("react.memo_cache_sentinel")?(b=(0,y.jsx)(l.View,{style:T.separator}),t[3]=b):b=t[3],t[4]!==n?(f=S.map(e=>{const{option:s,label:t}=e;return(0,y.jsx)(O,Object.assign({option:s,label:t},n),s)}),t[4]=n,t[5]=f):f=t[5],t[6]!==h||t[7]!==n?(v=h?(0,y.jsx)(O,Object.assign({option:j.IncludeFolded},n)):null,t[6]=h,t[7]=n,t[8]=v):v=t[8],t[9]!==f||t[10]!==v?(x=(0,y.jsxs)(l.View,{style:T.options,children:[b,f,v]}),t[9]=f,t[10]=v,t[11]=x):x=t[11],x}const T=h.StyleSheet.create(e=>({field:{gap:e.spacing[2],uni__dependencies:[0]},options:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],uni__dependencies:[0]},separator:{width:e.borderWidth[1],height:e.spacing[4],marginRight:e.spacing[1],backgroundColor:e.colors.border,uni__dependencies:[0]},symbol:{fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,uni__dependencies:[0]},wholeWord:{textDecorationLine:"underline"},dense:{height:f.HEADER_CONTROL_HEIGHT-4},tooltip:{fontSize:e.fontSize.sm,color:e.colors.foreground,uni__dependencies:[0]},hint:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},error:{color:e.colors.statusDanger,fontSize:e.fontSize.sm,uni__dependencies:[0]}}))},4243,[36,897,896,454,37,147,235,854,1218,57,4048,3025,881,4244,3711,280]);
|
|
15899
15899
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SearchField=function(n){const s=(0,o.c)(39),{value:f,onChangeText:C,placeholder:S,accessibilityLabel:T,clearAccessibilityLabel:W,testID:F,clearTestID:I,fullWidth:j,autoFocus:z,invalid:D,trailing:w,leading:L,onCommit:P}=n,B=void 0!==j&&j,E=void 0!==z&&z,M=void 0!==D&&D,[N,R]=(0,l.useState)(!1),U=(0,l.useRef)(null);let V,k,A;s[0]!==f?(V=()=>{U.current?.getText()!==f&&U.current?.replaceText(f)},k=[f],s[0]=f,s[1]=V,s[2]=k):(V=s[1],k=s[2]);(0,l.useLayoutEffect)(V,k),s[3]===Symbol.for("react.memo_cache_sentinel")?(A=()=>R(!0),s[3]=A):A=s[3];const H=A;let K;s[4]!==P||s[5]!==f?(K=()=>{P?.(U.current?.getText()??f)},s[4]=P,s[5]=f,s[6]=K):K=s[6];const O=K;let X;s[7]!==O?(X=()=>{R(!1),O()},s[7]=O,s[8]=X):X=s[8];const q=X;let G;s[9]!==O||s[10]!==C?(G=()=>{O(),U.current?.replaceText(""),C(""),U.current?.focus()},s[9]=O,s[10]=C,s[11]=G):G=s[11];const J=G,Q=B&&_.fieldFullWidth,Y=N&&_.fieldFocused,Z=M&&_.fieldInvalid;let $,ee;s[12]!==Q||s[13]!==Y||s[14]!==Z?($=[_.field,Q,Y,Z],s[12]=Q,s[13]=Y,s[14]=Z,s[15]=$):$=s[15];s[16]!==L?(ee=L??(0,p.jsx)(b,{size:14,uniProps:v}),s[16]=L,s[17]=ee):ee=s[17];const te=T??S;let oe,ie,le;s[18]!==E||s[19]!==q||s[20]!==O||s[21]!==M||s[22]!==C||s[23]!==S||s[24]!==te||s[25]!==F||s[26]!==f?(oe=(0,p.jsx)(y,{testID:F,ref:U,initialValue:f,onChangeText:C,onFocus:H,onBlur:q,onSubmitEditing:O,placeholder:S,accessibilityLabel:te,autoFocus:E,"aria-invalid":M,autoCapitalize:"none",autoCorrect:!1,returnKeyType:"search",style:_.input}),s[18]=E,s[19]=q,s[20]=O,s[21]=M,s[22]=C,s[23]=S,s[24]=te,s[25]=F,s[26]=f,s[27]=oe):oe=s[27];s[28]!==W||s[29]!==I||s[30]!==J||s[31]!==f.length?(ie=f.length>0?(0,p.jsx)(c.ToolbarButton,{testID:I,onPress:J,label:W,compact:h.isNative,style:(0,u.iconButtonChromeFrameStyle)(h.isNative?"small":"large",h.isNative),hitSlop:8,children:(0,p.jsx)(x,{size:14,uniProps:v})}):null,s[28]=W,s[29]=I,s[30]=J,s[31]=f.length,s[32]=ie):ie=s[32];s[33]!==$||s[34]!==ee||s[35]!==oe||s[36]!==ie||s[37]!==w?(le=(0,p.jsxs)(t.View,{style:$,children:[ee,oe,ie,w]}),s[33]=$,s[34]=ee,s[35]=oe,s[36]=ie,s[37]=w,s[38]=le):le=s[38];return le};var t=r(d[0]),o=r(d[1]),l=r(d[2]);r(d[3]);var n=r(d[4]),s=r(d[5]),c=r(d[6]),u=r(d[7]),h=r(d[8]),f=r(d[9]),p=r(d[10]);const b=(0,s.withUnistyles)(n.Search),x=(0,s.withUnistyles)(n.X),y=(0,s.withUnistyles)(f.EditingTextInput,t=>({placeholderTextColor:t.colors.foregroundMuted,selectionColor:t.colors.foreground})),v=t=>({color:t.colors.foregroundMuted});const _=s.StyleSheet.create(t=>({field:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],flex:1,minWidth:0,maxWidth:420,paddingVertical:t.spacing[1.5],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,backgroundColor:t.colors.surface1,borderWidth:t.borderWidth[1],borderColor:t.colors.border,uni__dependencies:[0]},fieldFocused:{borderColor:t.colors.borderAccent,backgroundColor:t.colors.surface2,uni__dependencies:[0]},fieldInvalid:{borderColor:t.colors.statusDanger,uni__dependencies:[0]},fieldFullWidth:{maxWidth:"100%"},input:{flex:1,minWidth:0,padding:0,height:20,outlineWidth:0,color:t.colors.foreground,fontSize:t.fontSize.base,uni__dependencies:[0]}}))},4244,[896,454,37,147,1218,57,4175,4048,881,3700,280]);
|
|
15900
15900
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.createPaneFocusContextValue=function(e){return{isWorkspaceFocused:e.isWorkspaceFocused,isPaneFocused:e.isPaneFocused,isInteractive:e.isWorkspaceFocused&&e.isPaneFocused,focusPane:e.onFocusPane??P}},_e.PaneProvider=function(e){const t=(0,n.c)(3),{value:u,children:o}=e;let l;t[0]!==o||t[1]!==u?(l=(0,s.jsx)(c.Provider,{value:u,children:o}),t[0]=o,t[1]=u,t[2]=l):l=t[2];return l},_e.PaneFocusProvider=function(e){const t=(0,n.c)(3),{value:u,children:o}=e;let c;t[0]!==o||t[1]!==u?(c=(0,s.jsx)(l.Provider,{value:u,children:o}),t[0]=o,t[1]=u,t[2]=c):c=t[2];return c},_e.usePaneContext=function(){const e=(0,t.useContext)(c);return(0,o.default)(e,"PaneContext is required"),e},_e.usePaneFocus=function(){const e=(0,t.useContext)(l);return(0,o.default)(e,"PaneFocusContext is required"),e};var e,n=r(d[0]),t=r(d[1]),u=r(d[2]),o=(e=u)&&e.__esModule?e:{default:e},s=r(d[3]);const c=(0,t.createContext)(null),l=(0,t.createContext)(null),P=()=>{}},4245,[454,37,3576,280]);
|
|
15901
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"
|
|
15902
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"
|
|
15901
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SearchQueryError",{enumerable:!0,get:function(){return t}}),e.createPhrasePattern=function({query:n,options:o={}}){let s=n;o.regex||(s=n.trim().split(/\s+/).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("\\s+"));o.wholeWord&&(s=String.raw`(?<![\p{L}\p{M}\p{N}_])(?:${s})(?![\p{L}\p{M}\p{N}_])`);try{return new RegExp(s,o.caseSensitive?"gu":"giu")}catch(n){if(n instanceof SyntaxError)throw new t(n.message);throw n}};class t extends Error{}},4246,[]);
|
|
15902
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ChatFindPhase",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ChatFindModel",{enumerable:!0,get:function(){return c}});var t=r(d[0]),s=r(d[1]);class o extends Error{constructor(t,s){super(`Chat find failed: ${t}`,s),this.failure=t}}function n(t,s){return s.catch(s=>{throw s instanceof o?s:new o(t,{cause:s})})}let h=(function(t){return t.Idle="idle",t.Searching="searching",t.Loading="loading",t.Ready="ready",t.Error="error",t.Invalid="invalid",t})({});class c{state={open:!1,query:"",options:{},phase:h.Idle,selectedItemId:null,occurrence:0,count:0,failure:null};listeners=new Set;historyListeners=new Set;items=[];turnKeysBySeq=new Map;expandedTurnKeys=new Set;epoch=null;resultEpoch=null;locations=[];resolved=new Map;current=-1;inMessage={occurrence:0,count:0};abort=new AbortController;constructor({operations:t,optionsSupported:s=!0}){this.operations=t,this.optionsSupported=s}getSnapshot=()=>this.state;subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});publish(t){this.state=Object.assign({},this.state,t),this.listeners.forEach(t=>t())}cancel(){this.abort.abort(),this.abort=new AbortController,clearTimeout(this.timer),this.operations.clear()}open=()=>{this.state.open||(this.publish({open:!0}),this.state.query&&this.setQuery(this.state.query))};close=()=>{this.cancel(),this.publish({options:{},open:!1,phase:h.Idle,selectedItemId:null,count:0,failure:null})};setOptions=t=>{this.optionsSupported&&(this.publish({options:t}),this.setQuery(this.state.query))};setQuery=s=>{this.cancel(),this.locations=[],this.resultEpoch=null,this.resolved.clear(),this.current=-1,this.inMessage={occurrence:0,count:0};const o=Boolean(s.trim());if(this.publish({query:s,phase:o?h.Searching:h.Idle,selectedItemId:o?this.state.selectedItemId:null,occurrence:0,count:0,failure:null}),!o)return;try{(0,t.createPhrasePattern)({query:s,options:this.state.options})}catch(s){if(!(s instanceof t.SearchQueryError))throw s;return void this.publish({phase:h.Invalid})}const n=this.abort.signal;this.timer=setTimeout(()=>{this.search(n)},120)};retry=()=>this.setQuery(this.state.query);fail(t,s){s.aborted||(this.cancel(),this.publish({phase:h.Error,selectedItemId:null,failure:t instanceof o?t.failure:"connection"}))}async search(t){try{let s;do{const h=await n("connection",this.operations.search({query:this.state.query,cursor:s,options:this.optionsSupported?this.state.options:void 0}));if(t.aborted)return;const c=null!==this.epoch&&h.epoch!==this.epoch,l=null!==this.resultEpoch&&h.epoch!==this.resultEpoch;if(c||l)throw new o("historyChanged");this.resultEpoch=h.epoch,this.locations.push(...h.locations.filter(t=>{const s=t.turnId??this.turnKeysBySeq.get(t.seq),o=void 0!==s&&this.expandedTurnKeys.has(s);return!t.folded||this.state.options.includeFolded||o}).map(t=>({folded:t.folded,turnId:t.turnId,seq:t.seq,role:t.role,count:t.count??1}))),s=h.nextCursor??void 0}while(void 0!==s);await this.navigate(0,1,t)}catch(s){this.fail(s,t)}}updateHistory({epoch:t,items:n,expandedTurnKeys:c=this.expandedTurnKeys}){const l=this.expandedTurnKeys!==c;if(this.expandedTurnKeys=c,null!==this.resultEpoch&&null!==t&&t!==this.resultEpoch&&this.state.open&&this.fail(new o("historyChanged"),this.abort.signal),this.epoch=t,this.items!==n){this.turnKeysBySeq.clear();for(const t of(0,s.completedTurnFolds)({items:n,getMessageId:t=>t.id})){const s=t.items[0],o=s.turnId??s.id;for(const s of t.items)s.timelineCursor&&this.turnKeysBySeq.set(s.timelineCursor.seq,o)}}this.items=n,this.historyListeners.forEach(t=>t()),l&&this.state.open&&this.state.phase===h.Ready&&!this.state.options.includeFolded&&this.setQuery(this.state.query)}target(t,s){let o=0;for(const n of this.items){if(n.timelineCursor?.epoch!==this.resultEpoch)continue;const h=n.timelineCursor.seq;if(h<t.seq){o=Math.max(o,h);continue}if(n.kind===`${t.role}_message`&&(!s||h===t.seq))return{id:n.id,seq:h,before:o};if("user_message"===n.kind)return null}return null}waitForTarget(t,s){return new Promise((n,h)=>{const c=t=>{clearTimeout(p),this.historyListeners.delete(l),s.removeEventListener("abort",u),t?n(t):h(new o("reveal"))},l=()=>{const s=this.target(t,!1);s&&c(s)},u=()=>c(),p=setTimeout(()=>c(),5e3);this.historyListeners.add(l),s.addEventListener("abort",u,{once:!0}),s.aborted?u():l()})}async navigate(t,s,o){const c=this.resultEpoch;if(null===c)return;this.publish({phase:h.Loading,failure:null});let l=this.locations.length;for(;l-- >0&&this.locations.length;){t=(t+this.locations.length)%this.locations.length;const l=this.locations[t],u=this.resolved.get(l);let p=u&&this.items.some(t=>t.id===u.id&&t.timelineCursor?.seq===u.seq)?u:this.target(l,!0);if(!p){if(await n("connection",this.operations.load(c,l.seq)),o.aborted)return;p=await this.waitForTarget(l,o)}if(o.aborted)return;this.resolved.set(l,p),this.locations=this.locations.filter(t=>t===l||t.role!==l.role||t.seq<=p.before||t.seq>p.seq),t=this.locations.indexOf(l),this.publish({selectedItemId:p.id});const f=await n("reveal",this.operations.reveal({messageId:p.id,query:this.state.query,options:this.state.options,occurrence:1===s?0:-1,signal:o}));if(o.aborted)return;if(f.count)return this.current=t,void this.publish(Object.assign({phase:h.Ready},this.position(l,f)));this.locations.splice(t,1),-1===s&&t--}this.operations.clear(),this.publish({phase:h.Ready,selectedItemId:null,count:0,occurrence:0})}position(t,s){this.inMessage=s,t.count=s.count;let o=0,n=0;for(const s of this.locations)s===t&&(o=n),n+=s.count;return{occurrence:o+s.occurrence,count:n}}async move(t){if(this.state.phase!==h.Ready||!this.state.count)return;this.cancel();const s=this.abort.signal;try{const o=this.inMessage.occurrence+t;if(o>=0&&o<this.inMessage.count&&this.state.selectedItemId){this.publish({phase:h.Loading});const t=await n("reveal",this.operations.reveal({messageId:this.state.selectedItemId,query:this.state.query,options:this.state.options,occurrence:o,signal:s}));if(s.aborted)return;if(t.count)return void this.publish(Object.assign({phase:h.Ready},this.position(this.locations[this.current],t)))}await this.navigate(this.current+t,t,s)}catch(t){this.fail(t,s)}}next=()=>{this.move(1)};previous=()=>{this.move(-1)}}},4247,[4246,4248]);
|
|
15903
15903
|
__d(function(g,r,i,a,m,e,d){"use strict";function n(n,t){return!(!n||!t)&&(void 0!==n.turnId&&void 0!==t.turnId?n.turnId===t.turnId:"fork_marker"===n.kind||"user_message"!==t.kind&&"fork_marker"!==t.kind)}Object.defineProperty(e,'__esModule',{value:!0}),e.continuesTurn=n,e.completedTurnFolds=function({items:s,getMessageId:u,lastTurnIsLive:o=!1,activeTurnId:f}){const c=[];return s.forEach((t,u)=>{n(s[u-1]??null,t)||c.push([]),c[c.length-1].push(t)}),c.map((n,s)=>{const l=void 0!==f&&n[0].turnId===f||o&&s===c.length-1,k=n.findLast(n=>"assistant_message"===n.kind),_=new Set;if(l||!k)return{items:n,finalStart:null,folded:_};const I=n.findIndex(n=>u(n)===u(k));return n.forEach((n,s)=>{if("user_message"===n.kind||"fork_marker"===n.kind)return;const u=s===I&&"assistant_message"===n.kind&&t.test(n.text??"");(s<I||u)&&_.add(n)}),{items:n,finalStart:I,folded:_}})};const t=/^\s*---\s*$/},4248,[]);
|
|
15904
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createFindViewport=function({getBindings:l,getRoot:u,highlightName:h}){return{clear(){CSS.highlights.delete(h)},reveal({messageId:f,query:v,options:M,occurrence:p,signal:w}){const S=(0,t.createPhrasePattern)({query:v,options:M}),I=l();if(!I.visibleMessageIds.has(f)){const t=(0,n.completedTurnFolds)({items:I.items,getMessageId:s.getStreamItemMessageId}).find(({folded:t})=>[...t].some(t=>(0,s.getStreamItemMessageId)(t)===f)),o=t?.items[0];o&&I.expandTurn(o.turnId??o.id)}return new Promise((t,n)=>{let s=0,v=!1;const M=performance.now()+5e3,I=()=>{cancelAnimationFrame(s),w.removeEventListener("abort",C)},C=()=>{I(),n(new Error("Search cancelled"))},R=()=>{if(w.aborted)return void C();if(performance.now()>=M)return I(),void n(new Error("Could not reveal this match; retry"));const b=l();if(!b.visibleMessageIds.has(f))return b.revealLoadedMessage(f),void(s=requestAnimationFrame(R));if(!(0,o.findMessageRows)(u(),f).some(t=>t.getBoundingClientRect().height))return v||(b.viewportRef.current?.scrollToMessage?.(f),v=!0),void(s=requestAnimationFrame(R));const q=(0,o.findMessageMatches)(u(),f,S),y=p<0?q.length-1:Math.min(p,q.length-1),F=q[y];if(I(),!F)return void t({occurrence:0,count:0});const E=c(F),T=q.slice(0,y).filter(t=>c(t)===E).length;b.viewportRef.current?.scrollToMessage?.(f,{signal:w,targetTop(){const t=E?(0,o.findRenderedMatches)(E,S)[T]:void 0;if(!t)return null;CSS.highlights.set(h,new Highlight(t));const n=u()?.querySelector('[data-chat-find-widget="true"]'),s=n?n.getBoundingClientRect().height+8:0;return t.getBoundingClientRect().top-s}}),CSS.highlights.set(h,new Highlight(F)),t({occurrence:y,count:q.length})};w.addEventListener("abort",C,{once:!0}),s=requestAnimationFrame(R)})}}};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]);function c(t){return t.startContainer.parentElement?.closest("[data-history-row-id]")??null}},4249,[
|
|
15904
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createFindViewport=function({getBindings:l,getRoot:u,highlightName:h}){return{clear(){CSS.highlights.delete(h)},reveal({messageId:f,query:v,options:M,occurrence:p,signal:w}){const S=(0,t.createPhrasePattern)({query:v,options:M}),I=l();if(!I.visibleMessageIds.has(f)){const t=(0,n.completedTurnFolds)({items:I.items,getMessageId:s.getStreamItemMessageId}).find(({folded:t})=>[...t].some(t=>(0,s.getStreamItemMessageId)(t)===f)),o=t?.items[0];o&&I.expandTurn(o.turnId??o.id)}return new Promise((t,n)=>{let s=0,v=!1;const M=performance.now()+5e3,I=()=>{cancelAnimationFrame(s),w.removeEventListener("abort",C)},C=()=>{I(),n(new Error("Search cancelled"))},R=()=>{if(w.aborted)return void C();if(performance.now()>=M)return I(),void n(new Error("Could not reveal this match; retry"));const b=l();if(!b.visibleMessageIds.has(f))return b.revealLoadedMessage(f),void(s=requestAnimationFrame(R));if(!(0,o.findMessageRows)(u(),f).some(t=>t.getBoundingClientRect().height))return v||(b.viewportRef.current?.scrollToMessage?.(f),v=!0),void(s=requestAnimationFrame(R));const q=(0,o.findMessageMatches)(u(),f,S),y=p<0?q.length-1:Math.min(p,q.length-1),F=q[y];if(I(),!F)return void t({occurrence:0,count:0});const E=c(F),T=q.slice(0,y).filter(t=>c(t)===E).length;b.viewportRef.current?.scrollToMessage?.(f,{signal:w,targetTop(){const t=E?(0,o.findRenderedMatches)(E,S)[T]:void 0;if(!t)return null;CSS.highlights.set(h,new Highlight(t));const n=u()?.querySelector('[data-chat-find-widget="true"]'),s=n?n.getBoundingClientRect().height+8:0;return t.getBoundingClientRect().top-s}}),CSS.highlights.set(h,new Highlight(F)),t({occurrence:y,count:q.length})};w.addEventListener("abort",C,{once:!0}),s=requestAnimationFrame(R)})}}};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]);function c(t){return t.startContainer.parentElement?.closest("[data-history-row-id]")??null}},4249,[4246,4248,4250,4257]);
|
|
15905
15905
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getStreamItemMessageId=function(t){return"assistant_message"===t.kind?t.blockGroupId??t.id:t.id},e.createStreamPresentation=function(){const l=new WeakMap;function c(t){const s=l.get(t);if(s)return s;const n=/^\s*<spoken-input>([\s\S]*?)<\/spoken-input>(?:\s*<instruction>This message was spoken by the user\.[\s\S]*?<\/instruction>)?\s*$/.exec(t.text),o=n?Object.assign({},t,{text:n[1].trim()}):t;return l.set(t,o),o}const u=new WeakMap;let p,h,f,k,x,v=new Map,I=[],T=[],_=[],b=null;function M(t){if("user_message"===t.kind)return[c(t)];if("assistant_message"!==t.kind)return[t];const n=u.get(t);if(n)return n;const l=v.get(t.id),p=l&&u.get(l),h=l&&p&&t.text.startsWith(l.text);let f=[],k=t.text;h&&(f=p.slice(0,-1),k=p[p.length-1].text+t.text.slice(l.text.length));const x=(0,s.splitMarkdownBlocks)(k),I=x.length>0||f.length>0?x:[""],T=[...f];for(const[s,n]of I.entries()){const l=f.length+s;let c=n;if(s===I.length-1){c+=/\n\s*$/.exec(t.text)?.[0]??""}const u=p?.[l],h=`${t.id}:block:${l}`;u?.text===c&&o(u,t,h)?T.push(u):T.push(Object.assign({},t,{id:h,blockGroupId:t.id,blockIndex:l,text:c}))}return u.set(t,T),T}return s=>{p===s.tail&&h===s.transform||(I=(0,t.projectPluginTimelineItems)(s.tail,s.transform).flatMap(M),p=s.tail,h=s.transform);const o=[],l=[],c=new Map;for(const n of(0,t.projectPluginTimelineItems)(s.head,s.transform,"streaming")){const t=M(n);"assistant_message"===n.kind&&c.set(n.id,n),"assistant_message"===n.kind&&t.length>1?(l.push(...t.slice(0,-1)),o.push(t[t.length-1])):o.push(...t)}v=c;const u=(w=l,(j=_).length===w.length&&j.every((t,s)=>t===w[s])?j:w);var j,w;return f===I&&u===_||(T=I,u.length>0&&(T=[...I,...u]),f=I,_=u),k===T&&x===s.level||(b=(0,n.prepareToolCallHistory)(s.level,T),k=T,x=s.level),(0,n.projectToolCallDetailLevel)({level:s.level,tail:T,head:o,preparedHistory:b,isTurnActive:s.isTurnActive})}};var t=r(d[0]),s=r(d[1]),n=r(d[2]);function o(t,s,n){return t.id===n&&t.turnId===s.turnId&&t.timestamp.getTime()===s.timestamp.getTime()&&t.timelineCursor?.epoch===s.timelineCursor?.epoch&&t.timelineCursor?.seq===s.timelineCursor?.seq}},4250,[4251,4252,4253]);
|
|
15906
15906
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.projectPluginTimelineItems=function(s,n,o="complete"){if(!n)return s;let u=t.get(n);u||(u=new WeakMap,t.set(n,u));let l=!1;const p=s.flatMap(t=>{const s=u.get(t)?.[o];if(s)return l=l||1!==s.length||s[0]!==t,s;const p=c(t,n,o);return u.set(t,Object.assign({},u.get(t),{[o]:p})),l=l||1!==p.length||p[0]!==t,p});return l?p:s};const t=new WeakMap;function s(t){return Array.isArray(t)?Object.freeze(t.map(t=>s(t))):null!==t&&"object"==typeof t?Object.freeze(Object.fromEntries(Object.entries(t).map(([t,n])=>[t,s(n)]))):t}function n(t){const{callId:s,name:n,status:o,error:c,detail:u,metadata:l}=t,p=Object.assign({type:"tool_call",callId:s,name:n,detail:u},l?{metadata:l}:{});switch(o){case"running":case"completed":case"canceled":return Object.assign({},p,{status:o,error:null});case"failed":return Object.assign({},p,{status:o,error:c})}}function o(t){switch(t.kind){case"user_message":return Object.assign({type:"user_message",text:t.text},t.messageId?{messageId:t.messageId}:{},t.clientMessageId?{clientMessageId:t.clientMessageId}:{});case"assistant_message":return Object.assign({type:"assistant_message",text:t.text},t.messageId?{messageId:t.messageId}:{});case"thought":return{type:"reasoning",text:t.text};case"tool_call":return"agent"!==t.payload.source?null:n(t.payload.data);case"todo_list":return{type:"todo",items:t.items};case"notification":return"error"===t.sourceType?{type:"error",message:t.message}:{type:"notification",level:t.level,message:t.message};case"compaction":return Object.assign({type:"compaction",status:t.status},t.trigger?{trigger:t.trigger}:{},void 0!==t.preTokens?{preTokens:t.preTokens}:{});case"fork_marker":case"plugin":return null}}function c(t,n,c){const u=o(t);if(!u)return[t];const l="thought"===t.kind&&"loading"===t.status,p="tool_call"===t.kind&&"agent"===t.payload.source&&"running"===t.payload.data.status,I="assistant_message"===t.kind&&"streaming"===c||l||p?"streaming":"complete",f=n({item:s(u),phase:I,sourceId:t.id});return void 0===f?[t]:f.map(s=>{const n={kind:"plugin",id:`${s.pluginId}/${s.id}`,timestamp:t.timestamp,pluginId:s.pluginId,pluginItemId:s.id,itemKind:s.kind,version:s.version,data:s.data};return t.timelineCursor&&(n.timelineCursor=t.timelineCursor),t.turnId&&(n.turnId=t.turnId),n})}},4251,[]);
|
|
15907
15907
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.splitMarkdownBlocks=function(n){if(0===n.length)return[];const e=[];let t=[],o=!1;const u=n.split("\n"),c=l(n,u);for(const[n,s]of u.entries()){const l=0===s.trim().length;l&&c.has(n)?t.push(s):l?t.length>0&&(o=!0):(o&&(e.push(t.join("\n")),t=[],o=!1),t.push(s))}t.length>0&&e.push(t.join("\n"));return s(e.filter(n=>n.length>0))};var n,e=r(d[0]);const t=new((n=e)&&n.__esModule?n:{default:n}).default;function o(n){const e={};return 0===t.parse(n,e).length&&Object.keys(e.references??{}).length>0}function s(n){const e=[];let t=[];for(const s of n)o(s)?e.length>0?e[e.length-1]+=`\n\n${s}`:t.push(s):(e.push([...t,s].join("\n\n")),t=[]);return t.length>0&&e.push(t.join("\n\n")),e}function l(n,e){const o=new Set;for(const s of t.parse(n,{})){if(0!==s.level||!s.map)continue;const[n,t]=s.map;for(let s=n;s<t-1;s+=1)0===e[s]?.trim().length&&o.add(s)}return o}t.core.ruler.disable("inline")},4252,[3967]);
|
|
@@ -16163,7 +16163,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
16163
16163
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.computeOverlayScrollbarGeometry=function(s){const n=Number.isFinite(s.viewportSize)?Math.max(0,s.viewportSize):0,u=Number.isFinite(s.contentSize)?Math.max(0,s.contentSize):0,o=Number.isFinite(s.minThumbSize)?Math.max(0,s.minThumbSize??t):t,l=Math.max(0,u-n);if(l<=0||n<=0||u<=0)return{isVisible:!1,maxScrollOffset:0,thumbSize:0,thumbOffset:0,maxThumbOffset:0};const c=f(n*n/u,o,n),h=Math.max(0,n-c),b=f(s.offset,0,l)/l*h;return{isVisible:!0,maxScrollOffset:l,thumbSize:c,thumbOffset:b,maxThumbOffset:h}},e.scrollOffsetFromThumbDrag=function(t){if(t.maxScrollOffset<=0||t.maxThumbOffset<=0)return f(t.startOffset,0,Math.max(0,t.maxScrollOffset));return f(t.startOffset+t.dragDelta*(t.maxScrollOffset/t.maxThumbOffset),0,t.maxScrollOffset)};const t=36;function f(t,f,s){return Math.min(s,Math.max(f,t))}},4508,[]);
|
|
16164
16164
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useScrollToMessage=function({active:c,scrollContainerRef:l,rowVirtualizer:u,historyVirtualized:p,cancelPendingStickToBottom:v,setFollowOutput:f,onNearBottomChange:T}){const w=(0,t.useRef)(void 0),S=(0,t.useRef)(null),E=(0,t.useMemo)(()=>(0,o.createPromptJumpSettleController)({viewport:{findTargetTop(t){const n=w.current;if(n?.signal.aborted)return null;if(n)return n.targetTop();const o=l.current?.querySelector(`[data-message-id="${CSS.escape(t)}"]`);return o?o.getBoundingClientRect().top:null},getContainerTop:()=>l.current?.getBoundingClientRect().top??0,getScrollMetrics(){const t=l.current;return{clientHeight:t?.clientHeight??0,scrollHeight:t?.scrollHeight??0,scrollTop:t?.scrollTop??0}},setScrollTop(t){const n=l.current;n&&(n.scrollTop=t)},subscribeToUserIntent(t){const n=l.current;if(!n)return()=>{};const o=n=>{s.has(n.key)&&t()};return n.addEventListener("wheel",t,{passive:!0}),n.addEventListener("touchstart",t,{passive:!0}),n.addEventListener("keydown",o,{passive:!0}),()=>{n.removeEventListener("wheel",t),n.removeEventListener("touchstart",t),n.removeEventListener("keydown",o)}}},requestFrame:t=>window.requestAnimationFrame(t),cancelFrame:t=>window.cancelAnimationFrame(t)}),[l]);(0,t.useEffect)(()=>()=>{S.current?.(),E.cancel()},[E]),(0,t.useLayoutEffect)(()=>{c||E.cancel()},[c,E]);const h=(0,t.useCallback)((t,s)=>{w.current=s,S.current?.();const h=()=>E.cancel();if(s?.signal.addEventListener("abort",h,{once:!0}),S.current=()=>s?.signal.removeEventListener("abort",h),!c)return;const C=l.current;if(!C)return;v(),f(!1);const P=C.querySelector(`[data-message-id="${CSS.escape(t)}"]`);if(P){let n=P.getBoundingClientRect().top;if(s&&(n=s.targetTop()),null!==n){const t=n-C.getBoundingClientRect().top-o.PROMPT_JUMP_TOP_INSET_PX;C.scrollTop+=t}return E.start(t),void T(!1)}const L=p.findIndex(o=>(0,n.getStreamItemMessageId)(o)===t);L>=0&&(u.scrollToIndex(L,{align:"start"}),E.start(t),T(!1))},[c,v,p,T,u,l,E,f]);return{isJumpSettling:E.isActive,scrollToMessage:h}};var t=r(d[0]),n=r(d[1]),o=r(d[2]);const s=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "])},4509,[37,4250,4510]);
|
|
16165
16165
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PROMPT_JUMP_TOP_INSET_PX",{enumerable:!0,get:function(){return o}}),e.createPromptJumpSettleController=function(o){let u=null,s=null,p=0,f=0,T=null;function v(){null!==s&&o.cancelFrame(s),T?.(),u=null,s=null,p=0,f=0,T=null}function w(){s=o.requestFrame(P)}function P(){s=null;const T=u;if(null===T)return;p+=1;const P=o.viewport.findTargetTop(T);if(null!==P){const l=c(P,o.viewport.getContainerTop());if(Math.abs(l)<=t){if(f+=1,f>=n)return void v()}else{f=0;const n=o.viewport.getScrollMetrics();o.viewport.setScrollTop(n.scrollTop+l);const u=o.viewport.getScrollMetrics(),s=o.viewport.findTargetTop(T);let p=0;null!==s&&(p=c(s,o.viewport.getContainerTop()));const w=Math.max(0,u.scrollHeight-u.clientHeight),P=u.scrollTop>=w-t;if(p>t&&P)return void v()}}p>=l?v():w()}return{start(t){v(),u=t,T=o.viewport.subscribeToUserIntent(v),w()},cancel:v,isActive:()=>null!==u}};const t=1,n=2,l=24,o=8;function c(t,n){return t-n-o}},4510,[]);
|
|
16166
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ChatOutlineRail",{enumerable:!0,get:function(){return
|
|
16166
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ChatOutlineRail",{enumerable:!0,get:function(){return w}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),s=r(d[4]);r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),u=r(d[9]),p=r(d[10]),b=r(d[11]),h=r(d[12]),f=r(d[13]),v=r(d[14]),_=r(d[15]),y=r(d[16]);const w=(0,s.memo)(function(n){const o=(0,l.c)(22),{prompts:c,activePrompt:p,onJumpToPrompt:f}=n,[w,P]=(0,s.useState)(null),[A,T]=(0,s.useState)(null),I=(0,s.useSyncExternalStore)(p.subscribe,p.getActiveSeq),R=(0,u.useReducedMotion)(),{onLayout:k,isBelow:B}=(0,b.useContainerWidthBelow)(918),D=(0,h.usePanelStore)(C);let L;o[0]===Symbol.for("react.memo_cache_sentinel")?(L=(0,v.createChatOutlineHoverIntent)({activate:P,schedule:j,cancel:E}),o[0]=L):L=o[0];const M=L;let O;o[1]===Symbol.for("react.memo_cache_sentinel")?(O=t=>M.pointAt(t),o[1]=O):O=o[1];const q=O;let H;o[2]===Symbol.for("react.memo_cache_sentinel")?(H=t=>{M.enter({x:t.nativeEvent.clientX,y:t.nativeEvent.clientY})},o[2]=H):H=o[2];const V=H;let z;o[3]===Symbol.for("react.memo_cache_sentinel")?(z=t=>{M.move({x:t.nativeEvent.clientX,y:t.nativeEvent.clientY})},o[3]=z):z=o[3];const F=z;let W;o[4]===Symbol.for("react.memo_cache_sentinel")?(W=()=>M.leave(),o[4]=W):W=o[4];const $=W;let J,X,Y,G,U;o[5]===Symbol.for("react.memo_cache_sentinel")?(J=()=>()=>M.dispose(),X=[M],o[5]=J,o[6]=X):(J=o[5],X=o[6]),(0,s.useEffect)(J,X),o[7]!==B?(Y=()=>{B&&M.leave()},G=[M,B],o[7]=B,o[8]=Y,o[9]=G):(Y=o[8],G=o[9]),(0,s.useEffect)(Y,G),o[10]===Symbol.for("react.memo_cache_sentinel")?(U=(t,n)=>{T(o=>n?t:o===t?null:o)},o[10]=U):U=o[10];const K=U,N=w??A;if(c.length<2)return null;let Q,Z;return o[11]!==I||o[12]!==N||o[13]!==B||o[14]!==D||o[15]!==f||o[16]!==R||o[17]!==c?(Q=B?null:(0,y.jsx)(t.View,{style:[S.rail,!D&&S.railBesideCollapsedSidebar],role:"tablist",testID:"chat-outline-rail",onPointerEnter:V,onPointerMove:F,onPointerLeave:$,children:c.map((t,n)=>(0,y.jsx)(x,{index:n,seq:t.seq,preview:t.preview,label:`${n+1} of ${c.length}: ${t.preview}`,isActive:t.seq===I,hasAttention:n===N,magnification:R||null===N?0:(0,_.promptTickMagnification)(n-N),onHover:q,onFocusChange:K,onJumpToPrompt:f},t.seq))}),o[11]=I,o[12]=N,o[13]=B,o[14]=D,o[15]=f,o[16]=R,o[17]=c,o[18]=Q):Q=o[18],o[19]!==k||o[20]!==Q?(Z=(0,y.jsx)(t.View,{style:S.panelMeasure,pointerEvents:"box-none",onLayout:k,children:Q}),o[19]=k,o[20]=Q,o[21]=Z):Z=o[21],Z}),x=(0,s.memo)(function(s){const c=(0,l.c)(36),{index:u,seq:p,preview:b,label:h,isActive:v,hasAttention:_,magnification:w,onHover:x,onFocusChange:C,onJumpToPrompt:j}=s;let E;c[0]!==u||c[1]!==C||c[2]!==j||c[3]!==p?(E=()=>{j(p),C(u,!1)},c[0]=u,c[1]=C,c[2]=j,c[3]=p,c[4]=E):E=c[4];const P=E;let A;c[5]!==u||c[6]!==x?(A=()=>x(u),c[5]=u,c[6]=x,c[7]=A):A=c[7];const T=A;let I;c[8]!==u||c[9]!==C?(I=()=>C(u,!0),c[8]=u,c[9]=C,c[10]=I):I=c[10];const R=I;let k;c[11]!==u||c[12]!==C?(k=()=>C(u,!1),c[11]=u,c[12]=C,c[13]=k):k=c[13];const B=k,D=v?18:10,L=D+w*(26-D),M=2+2*w,O=`chat-outline-tick-${p}`,q=v&&S.pillActive,H=_&&S.pillAttention;let V,z,F,W,$;return c[14]!==M||c[15]!==L?(V=(0,f.inlineUnistylesStyle)({width:L,height:M}),c[14]=M,c[15]=L,c[16]=V):V=c[16],c[17]!==q||c[18]!==H||c[19]!==V?(z=(0,y.jsx)(t.View,{style:[S.pill,q,H,V]}),c[17]=q,c[18]=H,c[19]=V,c[20]=z):z=c[20],c[21]!==B||c[22]!==R||c[23]!==P||c[24]!==v||c[25]!==h||c[26]!==O||c[27]!==z?(F=(0,y.jsx)(o.Pressable,{style:S.target,onPress:P,onFocus:R,onBlur:B,accessibilityRole:"tab","aria-selected":v,accessibilityLabel:h,testID:O,children:z}),c[21]=B,c[22]=R,c[23]=P,c[24]=v,c[25]=h,c[26]=O,c[27]=z,c[28]=F):F=c[28],c[29]!==_||c[30]!==b?(W=_?(0,y.jsx)(t.View,{style:S.preview,pointerEvents:"none","aria-hidden":!0,testID:"chat-outline-preview",children:(0,y.jsx)(n.Text,{style:S.previewText,numberOfLines:2,children:b})}):null,c[29]=_,c[30]=b,c[31]=W):W=c[31],c[32]!==T||c[33]!==F||c[34]!==W?($=(0,y.jsxs)(t.View,{style:S.slot,onPointerEnter:T,children:[F,W]}),c[32]=T,c[33]=F,c[34]=W,c[35]=$):$=c[35],$}),S=c.StyleSheet.create(t=>({panelMeasure:{position:"absolute",inset:0},rail:{position:"absolute",left:t.spacing[2],top:"10%",bottom:"10%",width:36,alignItems:"center",justifyContent:"center",zIndex:2,uni__dependencies:[0]},railBesideCollapsedSidebar:{left:p.SIDEBAR_EDGE_WIDTH+t.spacing[2],uni__dependencies:[0]},slot:{width:36,flexBasis:8,flexShrink:1,alignItems:"center",justifyContent:"center"},target:{width:"100%",height:"100%",alignItems:"flex-start",justifyContent:"center",paddingLeft:t.spacing[1],borderRadius:t.borderRadius.base,uni__dependencies:[0]},pill:{borderRadius:t.borderRadius.full,backgroundColor:t.colors.borderAccent,transitionProperty:"width, height, background-color",transitionDuration:"140ms",transitionTimingFunction:"ease-out",uni__dependencies:[0]},pillActive:{backgroundColor:t.colors.foregroundExtraMuted,uni__dependencies:[0]},pillAttention:{backgroundColor:t.colors.foreground,uni__dependencies:[0]},preview:Object.assign({position:"absolute",left:40,top:"50%",marginTop:-24,width:260,height:48,justifyContent:"center",paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.lg,borderWidth:t.borderWidth[1],borderColor:t.colors.border,backgroundColor:t.colors.surface2},t.shadow.md,{uni__dependencies:[0]}),previewText:{fontSize:t.fontSize.sm,color:t.colors.foreground,uni__dependencies:[0]}}));function C(t){return t.desktop.agentListOpen}function j(t,n){return window.setTimeout(t,n)}function E(t){return window.clearTimeout(t)}},4511,[896,897,898,454,37,426,235,147,57,899,4118,4395,3797,3029,4512,4513,280]);
|
|
16167
16167
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createChatOutlineHoverIntent=function(t){let u=null,c=null,o=null,s=!1;function v(){null!==u&&(t.cancel(u),u=null)}function f(){null!==c&&(v(),u=t.schedule(()=>{u=null,s=!0,null!==c&&t.activate(c)},l))}return{enter(l){o=l},pointAt(l){c=l,s?t.activate(l):null===u&&f()},move(l){if(s||null===o)return;const t=l.x-o.x,u=l.y-o.y;Math.abs(u)>=Math.abs(t)?o=l:Math.abs(t)<n||(o=l,f())},leave(){v(),c=null,o=null,s=!1,t.activate(null)},dispose(){v(),c=null,o=null,s=!1}}};const l=150,n=4},4512,[]);
|
|
16168
16168
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shouldAcceptPromptIndexEpoch=function(t,n){return t===n},Object.defineProperty(e,"OUTLINE_MAGNIFY_RADIUS",{enumerable:!0,get:function(){return t}}),e.promptTickMagnification=function(n){const o=Math.abs(n);if(!Number.isFinite(o)||o>=t)return 0;return(1+Math.cos(Math.PI*o/t))/2},e.resolveActivePromptSeq=function(t,n){if(null===n)return null;let o=null;for(const u of t){if(u.seq>n)break;o=u.seq}return o},e.createActivePromptPublisher=function(){const t=new Set;let n=null;return{subscribe:n=>(t.add(n),()=>{t.delete(n)}),getActiveSeq:()=>n,publish(o){if(o!==n){n=o;for(const n of t)n()}}}};const t=3},4513,[]);
|
|
16169
16169
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useChatOutline=function(v){const S=(0,t.c)(61),{agentId:q,serverId:b,timelineEpoch:E,tail:P,head:I,enabled:C,viewportRef:R,onJumpError:_,visibleMessageIds:M,revealLoadedMessage:T}=v,[A,j]=(0,n.useState)(null),[w,O]=(0,n.useState)(null),[y]=(0,n.useState)(c.createActivePromptPublisher),x=(0,n.useRef)(null),H=(0,n.useRef)(0),J=(0,n.useRef)(0),k=I??h;let F;S[0]!==k||S[1]!==P?(F=[...P,...k],S[0]=k,S[1]=P,S[2]=F):F=S[2];const L=F,W=C?A?.prompts??f:f;let z;if(S[3]!==L||S[4]!==E){let t;S[6]!==E?(t=(t,n)=>"user_message"===n.kind&&n.timelineCursor?.epoch===E?Math.max(t,n.timelineCursor.seq):t,S[6]=E,S[7]=t):t=S[7],z=L.reduce(t,-1),S[3]=L,S[4]=E,S[5]=z}else z=S[5];const B=z;let D,G,K,N,Q;S[8]===Symbol.for("react.memo_cache_sentinel")?(D=()=>j(null),S[8]=D):D=S[8];S[9]!==q||S[10]!==C||S[11]!==b||S[12]!==E?(G=[q,C,b,E],S[9]=q,S[10]=C,S[11]=b,S[12]=E,S[13]=G):G=S[13];(0,n.useEffect)(D,G),S[14]!==q||S[15]!==C||S[16]!==b||S[17]!==E?(K=()=>{if(!s.isWeb||!C||null===E)return void j(null);const t=(0,u.getHostRuntimeStore)().getClient(b);if(!t)return;let n=!0;return(()=>{const s=J.current=J.current+1;t.listAgentTimelinePrompts(q).then(t=>{n&&s===J.current&&(0,c.shouldAcceptPromptIndexEpoch)(E,t.epoch)&&j(t)}).catch(p)})(),()=>{n=!1}},S[14]=q,S[15]=C,S[16]=b,S[17]=E,S[18]=K):K=S[18];S[19]!==q||S[20]!==C||S[21]!==B||S[22]!==b||S[23]!==E?(N=[q,C,b,E,B],S[19]=q,S[20]=C,S[21]=B,S[22]=b,S[23]=E,S[24]=N):N=S[24];(0,n.useEffect)(K,N),S[25]!==y||S[26]!==W?(Q=()=>{y.publish((0,c.resolveActivePromptSeq)(W,x.current))},S[25]=y,S[26]=W,S[27]=Q):Q=S[27];const U=(0,l.useStableEvent)(Q);let V;S[28]!==U?(V=t=>{x.current=t,U()},S[28]=U,S[29]=V):V=S[29];const X=(0,l.useStableEvent)(V);let Y,Z,$,ee,te,re,ne;S[30]!==y?(Y=()=>{H.current=H.current+1,O(null),x.current=null,y.publish(null)},S[30]=y,S[31]=Y):Y=S[31];S[32]!==y||S[33]!==q||S[34]!==E?(Z=[y,q,E],S[32]=y,S[33]=q,S[34]=E,S[35]=Z):Z=S[35];(0,n.useEffect)(Y,Z),S[36]!==U?($=()=>{U()},S[36]=U,S[37]=$):$=S[37];S[38]!==W||S[39]!==U?(ee=[W,U],S[38]=W,S[39]=U,S[40]=ee):ee=S[40];(0,n.useEffect)($,ee),S[41]!==L||S[42]!==w||S[43]!==T||S[44]!==R||S[45]!==M?(te=()=>{if(null===w)return;const t=L.find(t=>t.timelineCursor?.seq===w.seq);if(t){if(w.hasScrolled)return;return!1===M?.has(t.id)?void T?.(t.id):(R.current?.scrollToMessage?.(t.id),void O(t=>t?.requestId!==w.requestId?t:Object.assign({},t,{hasScrolled:!0})))}w.fetchSettled&&O(null)},re=[L,w,T,R,M],S[41]=L,S[42]=w,S[43]=T,S[44]=R,S[45]=M,S[46]=te,S[47]=re):(te=S[46],re=S[47]);(0,n.useEffect)(te,re),S[48]!==q||S[49]!==A||S[50]!==L||S[51]!==_||S[52]!==T||S[53]!==b||S[54]!==R?(ne=t=>{H.current=H.current+1,O(null);const n=L.find(n=>n.timelineCursor?.seq===t);if(n){if(T?.(n.id)){const n=H.current;return void O({requestId:n,seq:t,fetchSettled:!0,hasScrolled:!1})}return void R.current?.scrollToMessage?.(n.id)}if(!A)return;const s=H.current;O({requestId:s,seq:t,fetchSettled:!1,hasScrolled:!1}),(0,u.getHostRuntimeStore)().fetchAgentTimeline(b,q,(0,o.planTimelinePromptJump)({epoch:A.epoch,seq:t})).catch(t=>{console.warn("Failed to load a Chat outline window",t),_()}).finally(()=>{O(t=>t?.requestId!==s?t:Object.assign({},t,{fetchSettled:!0}))})},S[48]=q,S[49]=A,S[50]=L,S[51]=_,S[52]=T,S[53]=b,S[54]=R,S[55]=ne):ne=S[55];const se=ne;let le;S[56]!==y||S[57]!==se||S[58]!==W||S[59]!==X?(le={prompts:W,activePrompt:y,jumpToPrompt:se,reportReadingPosition:X},S[56]=y,S[57]=se,S[58]=W,S[59]=X,S[60]=le):le=S[60];return le};var t=r(d[0]),n=r(d[1]),s=r(d[2]),l=r(d[3]),u=r(d[4]),o=r(d[5]),c=r(d[6]);const f=[],h=[];function p(){}},4514,[454,37,881,3911,3529,3643,4513]);
|
|
@@ -16870,7 +16870,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
16870
16870
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.HistorySearchMenu=function(n){const o=(0,s.c)(22),{searches:l,onSelect:b}=n,{t:j}=(0,t.useTranslation)();let x,M,w,D,f,_,I,v,T;o[0]!==j?(x=j("sessions.recentSearches"),o[0]=j,o[1]=x):x=o[1];o[2]===Symbol.for("react.memo_cache_sentinel")?(M=(0,u.jsx)(h,{size:14,uniProps:S}),o[2]=M):M=o[2];o[3]!==x?(w=(0,u.jsx)(c.DropdownMenuTrigger,{accessibilityRole:"button",accessibilityLabel:x,testID:"sessions-search-history-trigger",hitSlop:8,style:y,children:M}),o[3]=x,o[4]=w):w=o[4];o[5]!==j?(D=j("sessions.recentSearches"),o[5]=j,o[6]=D):D=o[6];o[7]!==j?(f=j("sessions.recentSearches"),o[7]=j,o[8]=f):f=o[8];o[9]!==f?(_=(0,u.jsx)(c.DropdownMenuLabel,{children:f}),o[9]=f,o[10]=_):_=o[10];o[11]!==b||o[12]!==l||o[13]!==j?(I=l.length?l.map(s=>(0,u.jsx)(p,{query:s,onSelect:b},s)):(0,u.jsx)(c.DropdownMenuItem,{disabled:!0,children:j("sessions.noRecentSearches")}),o[11]=b,o[12]=l,o[13]=j,o[14]=I):I=o[14];o[15]!==D||o[16]!==_||o[17]!==I?(v=(0,u.jsxs)(c.DropdownMenuContent,{align:"start",width:320,maxHeight:360,scrollable:!0,sheetTitle:D,testID:"sessions-search-history-menu",children:[_,I]}),o[15]=D,o[16]=_,o[17]=I,o[18]=v):v=o[18];o[19]!==w||o[20]!==v?(T=(0,u.jsxs)(c.DropdownMenu,{children:[w,v]}),o[19]=w,o[20]=v,o[21]=T):T=o[21];return T};var s=r(d[0]);r(d[1]);var n=r(d[2]),t=r(d[3]),o=r(d[4]),c=r(d[5]),l=r(d[6]),u=r(d[7]);const h=(0,o.withUnistyles)(n.Search),S=s=>({color:s.colors.foregroundMuted});function y(s){return(0,l.iconButtonChromeStyle)({size:"small",state:s})}function p(n){const t=(0,s.c)(6),{query:o,onSelect:l}=n;let h;t[0]!==l||t[1]!==o?(h=()=>l(o),t[0]=l,t[1]=o,t[2]=h):h=t[2];const S=h;let y;return t[3]!==o||t[4]!==S?(y=(0,u.jsx)(c.DropdownMenuItem,{onSelect:S,children:o}),t[3]=o,t[4]=S,t[5]=y):y=t[5],y}},5111,[454,37,1218,854,57,3702,4048,280]);
|
|
16871
16871
|
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fetchAgentHistoryPage=O,e.collectAgentHistoryHostErrors=y,e.fetchAgentHistoryBatch=S,e.useAgentHistory=function(u){const h=(0,t.c)(103),{t:f}=(0,a.useTranslation)(),v=(0,c.useHosts)();let O;h[0]===Symbol.for("react.memo_cache_sentinel")?(O=(0,c.getHostRuntimeStore)(),h[0]=O):O=h[0];const C=O;let E;h[1]!==v||h[2]!==u.serverIds?(E=u.serverIds?.length?u.serverIds:v.map(F),h[1]=v,h[2]=u.serverIds,h[3]=E):E=h[3];const L=E,x=(0,c.useHostRuntimeConnectionStatuses)(L),B=u.enabled??!0;let q,D,N;h[4]!==B||h[5]!==L?(q=()=>{if(!B)return;const t=L.map(t=>C.acquireDirectoryDemand(t));return()=>t.forEach(k)},D=[B,L,C],h[4]=B,h[5]=L,h[6]=q,h[7]=D):(q=h[6],D=h[7]);(0,n.useEffect)(q,D),h[8]!==L?(N=t=>{const s={};for(const n of L)s[n]=t.sessions[n]?.agents;return s},h[8]=L,h[9]=N):N=h[9];const R=(0,l.useSessionStore)((0,o.useShallow)(N));let _;h[10]!==v?(_=new Map(v.map(T)),h[10]=v,h[11]=_):_=h[11];const K=_;let Q;if(h[12]!==x||h[13]!==L||h[14]!==K){const t=[],s=[];for(const n of L){const o=C.getClient(n),a=K.get(n)??n;o&&"online"===x.get(n)?t.push({serverId:n,serverLabel:a,client:o}):s.push({serverId:n,serverName:a})}Q={targetHosts:t,unreachableHosts:s},h[12]=x,h[13]=L,h[14]=K,h[15]=Q}else Q=h[15];const{targetHosts:U,unreachableHosts:z}=Q;let G;h[16]!==U?(G=U.map(M),h[16]=U,h[17]=G):G=h[17];const J=G;let V;h[18]!==J?(V=t=>J.length>0&&J.every(s=>!0===t.sessions[s]?.serverInfo?.features?.agentHistorySearch),h[18]=J,h[19]=V):V=h[19];const W=(0,l.useSessionStore)(V);let X;h[20]!==J?(X=t=>J.length>0&&J.every(s=>!0===t.sessions[s]?.serverInfo?.features?.agentHistoryFilters),h[20]=J,h[21]=X):X=h[21];const Y=(0,l.useSessionStore)(X);let Z;h[22]!==J?(Z=t=>J.length>0&&J.every(s=>!0===t.sessions[s]?.serverInfo?.features?.agentHistoryAgentTypeFilter),h[22]=J,h[23]=Z):Z=h[23];const $=(0,l.useSessionStore)(Z);let ee;h[24]!==J?(ee=t=>J.length>0&&J.every(s=>!0===t.sessions[s]?.serverInfo?.features?.agentHistorySearchOptions),h[24]=J,h[25]=ee):ee=h[25];const te=(0,l.useSessionStore)(ee),se=Object.values(u.searchOptions??{}).some(Boolean),re=!se||te;let ne;e:{if(!Y||!u.filter){ne=void 0;break e}const t=$?u.filter.isSubagent:void 0;let s;h[26]!==u.filter||h[27]!==t?(s=Object.assign({},u.filter,{isSubagent:t}),h[26]=u.filter,h[27]=t,h[28]=s):s=h[28],ne=s}const oe=ne;let ae,ie;h[29]!==W||h[30]!==u.search||h[31]!==u.searchOptions?.regex?(ae=()=>{const t=u.searchOptions?.regex?u.search??"":u.search?.trim()??"";return W?t:""},h[29]=W,h[30]=u.search,h[31]=u.searchOptions?.regex,h[32]=ae):ae=h[32];u.searchOptions,h[33]!==ae?(ie=ae(),h[33]=ae,h[34]=ie):ie=h[34];const ce=ie;let le;h[35]!==re||h[36]!==oe||h[37]!==Y||h[38]!==u.searchOptions||h[39]!==ce||h[40]!==J?(le=[...1===J.length?(0,p.agentHistoryQueryKey)(J[0]):(0,p.allAgentHistoryQueryKey)(J),ce,u.searchOptions,re,oe,Y],h[35]=re,h[36]=oe,h[37]=Y,h[38]=u.searchOptions,h[39]=ce,h[40]=J,h[41]=le):le=h[41];const ue=le;let pe;h[42]!==v?(pe=new Map(v.map(w)),h[42]=v,h[43]=pe):pe=h[43];const ge=pe,de=Boolean(B&&re&&U.length>0);let he,fe;h[44]!==oe||h[45]!==se||h[46]!==Y||h[47]!==u.searchOptions||h[48]!==ce||h[49]!==f||h[50]!==U?(he=async t=>{const{pageParam:s}=t;if(0===U.length)throw new Error(f("workspace.terminal.hostDisconnected"));return S(Object.assign({hosts:U,cursorByServerId:s,filter:oe,includeFilterOptions:Y},ce?{search:ce}:{},se?{searchOptions:u.searchOptions}:{}))},h[44]=oe,h[45]=se,h[46]=Y,h[47]=u.searchOptions,h[48]=ce,h[49]=f,h[50]=U,h[51]=he):he=h[51];h[52]!==ue||h[53]!==de||h[54]!==he?(fe={queryKey:ue,enabled:de,staleTime:3e4,placeholderData:s.keepPreviousData,initialPageParam:null,getNextPageParam:b,queryFn:he},h[52]=ue,h[53]=de,h[54]=he,h[55]=fe):fe=h[55];const ve=(0,s.useInfiniteQuery)(fe),{data:me,fetchNextPage:Oe,hasNextPage:Ie,isError:ye,isFetching:be,isFetchingNextPage:Se,isLoading:Ae,isPlaceholderData:je,refetch:He}=ve;let Pe;h[56]!==re||h[57]!==B||h[58]!==He||h[59]!==U.length?(Pe=async()=>{B&&re&&0!==U.length&&await He()},h[56]=re,h[57]=B,h[58]=He,h[59]=U.length,h[60]=Pe):Pe=h[60];const we=Pe;let Me;h[61]!==re||h[62]!==B||h[63]!==Oe||h[64]!==Ie||h[65]!==Se||h[66]!==U.length?(Me=()=>{B&&re&&0!==U.length&&Ie&&!Se&&Oe()},h[61]=re,h[62]=B,h[63]=Oe,h[64]=Ie,h[65]=Se,h[66]=U.length,h[67]=Me):Me=h[67];const Te=Me;let ke;if(h[68]!==me?.pages||h[69]!==R||h[70]!==ge){const t=(me?.pages??[]).flatMap(P);let s;h[72]!==R||h[73]!==ge?(s=t=>{const s=R[t.serverId]?.get(t.id),n=Object.assign({},t,{serverLabel:ge.get(t.serverId)??t.serverLabel});return s&&Object.assign(n,{status:s.status,turn:s.turn,turnCount:s.turnCount??t.turnCount,requiresAttention:s.requiresAttention,attentionReason:s.attentionReason,pendingPermissionCount:s.pendingPermissions.length}),n},h[72]=R,h[73]=ge,h[74]=s):s=h[74];ke=I(t.map(s)),h[68]=me?.pages,h[69]=R,h[70]=ge,h[71]=ke}else ke=h[71];const Fe=ke;let Ce,Ee;h[75]!==me?.pages?(Ce=()=>({projects:me?.pages.flatMap(H)??[],models:me?.pages.flatMap(j)??[]}),h[75]=me?.pages,h[76]=Ce):Ce=h[76];h[77]!==Ce?(Ee=Ce(),h[77]=Ce,h[78]=Ee):Ee=h[78];const Le=Ee,xe=je||Ae&&0===Fe.length,Be=be&&!Se&&Fe.length>0;let qe;h[79]!==me?.pages||h[80]!==ce?(qe=ce&&me?.pages.some(A),h[79]=me?.pages,h[80]=ce,h[81]=qe):qe=h[81];const De=Boolean(qe);let Ne;h[82]!==me?.pages||h[83]!==z?(Ne=y({pages:me?.pages??[],unreachableHosts:z}),h[82]=me?.pages,h[83]=z,h[84]=Ne):Ne=h[84];const Re=Ne,_e=!B||!re;let Ke;h[85]!==Fe||h[86]!==Le||h[87]!==Ie||h[88]!==Re||h[89]!==$||h[90]!==ye||h[91]!==Se||h[92]!==Y||h[93]!==xe||h[94]!==Ae||h[95]!==Be||h[96]!==te||h[97]!==W||h[98]!==De||h[99]!==Te||h[100]!==we||h[101]!==_e?(Ke={agents:Fe,isLoading:Ae,isInitialLoad:xe,isRevalidating:Be,isError:ye,hasMore:Ie,isLoadingMore:Se,isSearchSupported:W,isSearchOptionsSupported:te,isSearchPaused:_e,isFilterSupported:Y,isAgentTypeFilterSupported:$,filterOptions:Le,isSearchTruncated:De,hostErrors:Re,refreshAll:we,loadMore:Te},h[85]=Fe,h[86]=Le,h[87]=Ie,h[88]=Re,h[89]=$,h[90]=ye,h[91]=Se,h[92]=Y,h[93]=xe,h[94]=Ae,h[95]=Be,h[96]=te,h[97]=W,h[98]=De,h[99]=Te,h[100]=we,h[101]=_e,h[102]=Ke):Ke=h[102];return Ke};var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),a=r(d[4]),c=r(d[5]),l=r(d[6]),u=r(d[7]),p=r(d[8]);const h=200,f=[{key:"updated_at",direction:"desc"}],v="No connected hosts could load agent history";async function O(t){const s=await t.client.fetchAgentHistory(Object.assign({},t.search?{search:t.search}:{},t.searchOptions?{searchOptions:t.searchOptions}:{},t.filter?{filter:t.filter}:{},t.includeFilterOptions?{includeFilterOptions:!0}:{},{sort:f,page:t.cursor?{limit:h,cursor:t.cursor}:{limit:h}})),{agents:n}=(0,u.buildAgentDirectoryState)({serverId:t.serverId,entries:s.entries}),o=new Map(s.entries.map(({agent:t})=>[t.id,t.effectiveThinkingOptionId??t.runtimeInfo?.thinkingOptionId??t.thinkingOptionId]));return{filterOptions:s.filterOptions,isSearchTruncated:!0===s.searchTruncated,agents:Array.from(n.values(),s=>({id:s.id,serverId:t.serverId,serverLabel:t.serverId,title:s.title??null,status:s.status,turn:s.turn,turnCount:s.turnCount,lastActivityAt:s.lastActivityAt,cwd:s.cwd,workspaceId:s.workspaceId,provider:s.provider,model:s.runtimeInfo?.model??s.model,thinkingOptionId:o.get(s.id),lastUsage:s.lastUsage,pendingPermissionCount:s.pendingPermissions.length,requiresAttention:s.requiresAttention,attentionReason:s.attentionReason,attentionTimestamp:s.attentionTimestamp??null,archivedAt:s.archivedAt??null,createdAt:s.createdAt,labels:s.labels,projectPlacement:s.projectPlacement})),pageInfo:s.pageInfo}}function I(t){return[...t].sort((t,s)=>s.lastActivityAt.getTime()-t.lastActivityAt.getTime())}function y(t){const s=new Map;for(const n of t.unreachableHosts)s.set(n.serverId,n);for(const n of t.pages)for(const t of n.hostErrors)s.set(t.serverId,t);return[...s.values()]}function b(t){const s={};for(const[n,o]of Object.entries(t.pageInfoByServerId))o.hasMore&&o.nextCursor&&(s[n]=o.nextCursor);return Object.keys(s).length>0?s:null}async function S(t){const s=t.cursorByServerId??{},n=Object.keys(s).length>0?t.hosts.filter(t=>Object.hasOwn(s,t.serverId)):t.hosts,o=await Promise.allSettled(n.map(async n=>({host:n,page:await O(Object.assign({client:n.client,serverId:n.serverId,cursor:s[n.serverId]??null,filter:t.filter,includeFilterOptions:t.includeFilterOptions&&!t.cursorByServerId},t.search?{search:t.search}:{},t.searchOptions?{searchOptions:t.searchOptions}:{}))}))),a=o.flatMap(t=>"fulfilled"===t.status?[t.value]:[]);if(0===a.length)throw new Error(v);const c=o.flatMap((t,s)=>"rejected"===t.status?[{serverId:n[s].serverId,serverName:n[s].serverLabel}]:[]),l=a.flatMap(({host:t,page:s})=>s.agents.map(s=>Object.assign({},s,{serverLabel:t.serverLabel}))),u=Object.fromEntries(a.map(({host:t,page:s})=>[t.serverId,s.pageInfo]));return Object.assign({filterOptions:{projects:a.flatMap(({page:t})=>t.filterOptions?.projects??[]),models:a.flatMap(({page:t})=>t.filterOptions?.models??[])},agents:I(l),pageInfoByServerId:u,hostErrors:c},t.search?{isSearchTruncated:a.some(({page:t})=>t.isSearchTruncated)}:{})}function A(t){return t.isSearchTruncated}function j(t){return t.filterOptions?.models??[]}function H(t){return t.filterOptions?.projects??[]}function P(t){return t.agents}function w(t){return[t.serverId,t.label]}function M(t){return t.serverId}function T(t){return[t.serverId,t.label]}function k(t){return t()}function F(t){return t.serverId}},5112,[454,800,37,3458,854,3529,3459,3619,3611]);
|
|
16872
16872
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useHistorySearch=function(){const s=(0,t.c)(15),[u,l]=(0,n.useState)("");let y;s[0]===Symbol.for("react.memo_cache_sentinel")?(y={},s[0]=y):y=s[0];const[h,p]=(0,n.useState)(y);let v;if(s[1]!==u||s[2]!==h){const t=h.regex?u:u.trim();try{v={query:t,options:h,matcher:(0,o.createTextSearch)({query:t,options:h}),invalid:!1}}catch(S){const n=S;if(!(n instanceof o.SearchQueryError))throw n;let c;s[4]!==h||s[5]!==t?(c={query:t,options:h,matcher:void 0,invalid:!0},s[4]=h,s[5]=t,s[6]=c):c=s[6],v=c}s[1]=u,s[2]=h,s[3]=v}else v=s[3];const q=v,f=(0,c.useDebouncedValue)(q,200),S=!q.invalid&&!f.invalid;let _;s[7]!==q.invalid||s[8]!==f.matcher||s[9]!==f.options||s[10]!==f.query||s[11]!==u||s[12]!==h||s[13]!==S?(_={input:u,setInput:l,options:h,setOptions:p,query:f.query,queryOptions:f.options,matcher:f.matcher,invalid:q.invalid,enabled:S},s[7]=q.invalid,s[8]=f.matcher,s[9]=f.options,s[10]=f.query,s[11]=u,s[12]=h,s[13]=S,s[14]=_):_=s[14];return _};var t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3])},5113,[454,37,5114,3833]);
|
|
16873
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SearchQueryError",{enumerable:!0,get:function(){return t.SearchQueryError}}),e.createTextSearch=function({query:s,options:c={}}){if(!c.regex&&!c.wholeWord&&!c.caseSensitive)return{matches:t=>null!==(0,n.scoreTextFields)(s,[...t],{typoTolerant:!0}),ranges:t=>o((0,n.tokenizeQuery)(s).flatMap(o=>{const s=(0,n.scoreMatch)(o,t,{fuzzy:(0,n.fuzzyPolicyForToken)(o)});return s?(0,n.matchRanges)(o,t,s):[]}))};const l=(c.regex?[s]:s.trim().split(/\s+/).filter(Boolean)).map(n=>(0,t.createPhrasePattern)({query:n,options:c}));function u(t,n){const o=[];for(const s of n.matchAll(t))s[0].length&&o.push({start:s.index,length:s[0].length});return o}return{matches:t=>l.every(n=>t.some(t=>u(n,t).length>0)),ranges:t=>o(l.flatMap(n=>u(n,t)).filter(t=>t.length>0))}};var t=r(d[0]),n=r(d[1]);function o(t){t.sort((t,n)=>t.start-n.start);const n=[];for(const o of t){const t=n.at(-1);t&&o.start<=t.start+t.length?t.length=Math.max(t.length,o.start+o.length-t.start):n.push(Object.assign({},o))}return n}},5114,[
|
|
16873
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SearchQueryError",{enumerable:!0,get:function(){return t.SearchQueryError}}),e.createTextSearch=function({query:s,options:c={}}){if(!c.regex&&!c.wholeWord&&!c.caseSensitive)return{matches:t=>null!==(0,n.scoreTextFields)(s,[...t],{typoTolerant:!0}),ranges:t=>o((0,n.tokenizeQuery)(s).flatMap(o=>{const s=(0,n.scoreMatch)(o,t,{fuzzy:(0,n.fuzzyPolicyForToken)(o)});return s?(0,n.matchRanges)(o,t,s):[]}))};const l=(c.regex?[s]:s.trim().split(/\s+/).filter(Boolean)).map(n=>(0,t.createPhrasePattern)({query:n,options:c}));function u(t,n){const o=[];for(const s of n.matchAll(t))s[0].length&&o.push({start:s.index,length:s[0].length});return o}return{matches:t=>l.every(n=>t.some(t=>u(n,t).length>0)),ranges:t=>o(l.flatMap(n=>u(n,t)).filter(t=>t.length>0))}};var t=r(d[0]),n=r(d[1]);function o(t){t.sort((t,n)=>t.start-n.start);const n=[];for(const o of t){const t=n.at(-1);t&&o.start<=t.start+t.length?t.length=Math.max(t.length,o.start+o.length-t.start):n.push(Object.assign({},o))}return n}},5114,[4246,3794]);
|
|
16874
16874
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var e=r(d[0]),t=r(d[1]);r(d[2]);var s,o=r(d[3]),n=r(d[4]),u=r(d[5]),c=r(d[6]),l=r(d[7]),f=(s=l)&&s.__esModule?s:{default:s},S=r(d[8]),v=r(d[9]),p=r(d[10]);function _(){const s=(0,e.c)(7),n=(0,c.useHosts)(),l=(0,u.useLocalDaemonServerIdState)(),f=(0,o.useHostRuntimeBootstrapState)();if("loading"===l.status){let e;return s[0]!==f?(e=(0,p.jsx)(S.StartupSplashScreen,{bootstrapState:f}),s[0]=f,s[1]=e):e=s[1],e}if("resolved"===l.status&&null!==l.serverId&&n.some(e=>e.serverId===l.serverId)){let e,o;return s[2]!==l.serverId?(e=(0,v.buildSettingsHostSectionRoute)(l.serverId,"host"),s[2]=l.serverId,s[3]=e):e=s[3],s[4]!==e?(o=(0,p.jsx)(t.Redirect,{href:e}),s[4]=e,s[5]=o):o=s[5],o}let _;return s[6]===Symbol.for("react.memo_cache_sentinel")?(_=(0,p.jsx)(t.Redirect,{href:(0,v.buildSettingsRoute)()}),s[6]=_):_=s[6],_}function b(){const s=(0,e.c)(8),o=(0,t.useLocalSearchParams)(),u="string"==typeof o.section?o.section:"";let c;s[0]!==u?(c=(0,v.isSettingsSectionSlug)(u)?u:"general",s[0]=u,s[1]=c):c=s[1];const l=c,S="string"==typeof o.addHost?o.addHost:null;let b;s[2]!==l?(b={kind:"section",section:l},s[2]=l,s[3]=b):b=s[3];const h=b;if("daemon"===u){let e;return s[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(n.HostRouteBootstrapBoundary,{children:(0,p.jsx)(_,{})}),s[4]=e):e=s[4],e}let j;return s[5]!==S||s[6]!==h?(j=(0,p.jsx)(f.default,{view:h,openAddHostIntent:S}),s[5]=S,s[6]=h,s[7]=j):j=s[7],j}},5115,[454,456,37,3033,4951,3841,3529,5116,4952,3675,280]);
|
|
16875
16875
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return it}});var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]),u=e(r(d[6]));r(d[7]),r(d[8]),r(d[9]),r(d[10]);var p=r(d[11]),b=r(d[12]),h=r(d[13]),y=r(d[14]),S=r(d[15]),x=r(d[16]),f=r(d[17]),j=r(d[18]),v=r(d[19]),w=r(d[20]),k=r(d[21]),T=r(d[22]),I=r(d[23]),C=r(d[24]),H=r(d[25]),_=r(d[26]),V=r(d[27]),P=r(d[28]),D=r(d[29]),L=r(d[30]),z=r(d[31]),R=r(d[32]),A=r(d[33]),B=r(d[34]),K=r(d[35]),O=r(d[36]),M=r(d[37]),W=r(d[38]),E=r(d[39]),F=r(d[40]),U=r(d[41]),N=r(d[42]),G=r(d[43]),$=r(d[44]),q=r(d[45]),Q=r(d[46]),J=r(d[47]),X=r(d[48]),Y=r(d[49]),Z=r(d[50]),ee=r(d[51]),te=r(d[52]),se=r(d[53]),ne=r(d[54]),ie=r(d[55]),oe=r(d[56]),le=r(d[57]),re=r(d[58]),ae=r(d[59]),ce=r(d[60]),de=r(d[61]),ue=r(d[62]),ge=r(d[63]),pe=r(d[64]),be=r(d[65]),he=r(d[66]),ye=r(d[67]),Se=r(d[68]),xe=r(d[69]),fe=e(r(d[70])),me=e(r(d[71])),je=r(d[72]),ve=r(d[73]),we=r(d[74]),ke=r(d[75]),Te=r(d[76]),Ie=r(d[77]),Ce=r(d[78]),He=r(d[79]);const Ve=[{id:"general",labelKey:"settings.sections.general",icon:f.Settings},{id:"appearance",labelKey:"settings.sections.appearance",icon:f.Palette,Content:C.AppearanceSection},{id:"sidebar",labelKey:"settings.sections.sidebar",icon:f.PanelLeft,Content:D.SidebarNavSection},{id:"chat",labelKey:"settings.sections.chat",icon:f.MessageSquare,Content:V.ChatSection},{id:"terminal",labelKey:"settings.sections.terminal",icon:f.SquareTerminal,Content:_.TerminalSection},{id:"browser",labelKey:"settings.sections.browser",icon:f.Globe,desktopOnly:!0,Content:se.BrowserDataSection},{id:"editor",labelKey:"settings.sections.editor",icon:f.Code2,webOnly:!0,Content:q.EditorSection},{id:"shortcuts",labelKey:"settings.sections.shortcuts",icon:f.Keyboard,desktopOnly:!0,Content:$.KeyboardShortcutsSection},{id:"integrations",labelKey:"settings.sections.integrations",icon:f.Puzzle,desktopOnly:!0,Content:ne.IntegrationsSection},{id:"notifications",labelKey:"settings.sections.notifications",icon:f.Bell,desktopOnly:!0,Content:te.DesktopNotificationsSection},{id:"permissions",labelKey:"settings.sections.permissions",icon:f.Shield,desktopOnly:!0,Content:ee.DesktopPermissionsSection},{id:"diagnostics",labelKey:"settings.sections.diagnostics",icon:f.Stethoscope},{id:"about",labelKey:"settings.sections.about",icon:f.Info}],Pe=[{id:"customizations",labelKey:"settings.customizations.all",icon:f.SlidersHorizontal,Content:P.CustomizationsSection}],De=[...Ve,...Pe];function Le(e,t){return(!e.desktopOnly||t)&&(!e.webOnly||Ce.isWeb)}const ze=[{id:"host",labelKey:"settings.hostSections.host",icon:f.Server},{id:"projects",labelKey:"settings.hostSections.projects",icon:f.FolderGit2},{id:"connections",labelKey:"settings.hostSections.connections",icon:f.Network},{id:"pair-device",labelKey:"openProject.tiles.pairDevice.title",icon:f.Smartphone},{id:"agents",labelKey:"settings.hostSections.agents",icon:f.Bot},{id:"metadata",labelKey:"settings.hostSections.metadata",icon:f.Sparkles},{id:"workspaces",labelKey:"settings.hostSections.workspaces",icon:f.FolderGit2},{id:"providers",labelKey:"settings.hostSections.providers",icon:f.Boxes},{id:"usage",labelKey:"settings.hostSections.usage",icon:f.Gauge},{id:"terminals",labelKey:"settings.hostSections.terminals",icon:f.SquareTerminal},{id:"plugins",labelKey:"settings.hostSections.plugins",icon:f.Blocks}];function Re(e,t){switch(e.section){case"projects":return(0,He.jsx)(fe.default,{serverId:e.serverId});case"connections":return(0,He.jsx)(be.HostConnectionsPage,{serverId:e.serverId});case"pair-device":return(0,He.jsx)(be.HostPairDevicePage,{serverId:e.serverId});case"agents":return(0,He.jsx)(be.HostAgentsPage,{serverId:e.serverId});case"metadata":return(0,He.jsx)(xe.MetadataGenerationPage,{serverId:e.serverId});case"workspaces":return(0,He.jsx)(be.HostWorkspacesPage,{serverId:e.serverId});case"providers":return(0,He.jsx)(be.HostProvidersPage,{serverId:e.serverId});case"usage":return(0,He.jsx)(be.HostUsagePage,{serverId:e.serverId});case"terminals":return(0,He.jsx)(be.HostTerminalsPage,{serverId:e.serverId});case"plugins":return(0,He.jsx)(Se.HostPluginsPage,{serverId:e.serverId});case"host":return(0,He.jsx)(be.HostSettingsPage,{serverId:e.serverId,onHostRemoved:t})}}function Ae({hovered:e}){return[rt.item,Boolean(e)&&rt.itemHovered]}function Be({hovered:e}){return[rt.item,Boolean(e)&&rt.itemHovered,rt.itemSelected]}function Ke(e){const t=(0,pe.parseAppLanguage)(e);return t&&"system"!==t?t:"en"}function Oe(e){const t=(0,l.c)(13),{value:s,activeLocale:n,selected:o,onChange:c}=e,{t:u}=(0,S.useTranslation)();let p;t[0]!==c||t[1]!==s?(p=()=>{c(s)},t[0]=c,t[1]=s,t[2]=p):p=t[2];const b=p;let h;if(t[3]!==n||t[4]!==u||t[5]!==s){let e;t[7]!==s?(e=e=>e.value===s,t[7]=s,t[8]=e):e=t[8];const o=pe.LANGUAGE_OPTIONS.find(e);h=o?(0,pe.formatLanguageOptionLabel)(o,n,u(o.labelKey)):s,t[3]=n,t[4]=u,t[5]=s,t[6]=h}else h=t[6];const y=h;let x;return t[9]!==b||t[10]!==y||t[11]!==o?(x=(0,He.jsx)(Z.DropdownMenuItem,{selected:o,onSelect:b,children:y}),t[9]=b,t[10]=y,t[11]=o,t[12]=x):x=t[12],x}function Me(e){const n=(0,l.c)(37),{settings:o,handleLanguageChange:c}=e,{t:u,i18n:p}=(0,S.useTranslation)();let b,h;if(n[0]!==p.language||n[1]!==o||n[2]!==u){let e;b=Ke(p.language),n[5]!==o?(e=e=>e.value===o.language,n[5]=o,n[6]=e):e=n[6];const t=pe.LANGUAGE_OPTIONS.find(e);h=t?(0,pe.formatLanguageOptionLabel)(t,b,u(t.labelKey)):o.language,n[0]=p.language,n[1]=o,n[2]=u,n[3]=b,n[4]=h}else b=n[3],h=n[4];const y=h;let x,f,v,w,k,T,C,H,_,V,P,D;return n[7]!==u?(x=u("settings.general.title"),n[7]=u,n[8]=x):x=n[8],n[9]!==u?(f=u("settings.general.language.label"),n[9]=u,n[10]=f):f=n[10],n[11]!==f?(v=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowTitle,children:f}),n[11]=f,n[12]=v):v=n[12],n[13]!==u?(w=u("settings.general.language.description"),n[13]=u,n[14]=w):w=n[14],n[15]!==w?(k=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowHint,children:w}),n[15]=w,n[16]=k):k=n[16],n[17]!==v||n[18]!==k?(T=(0,He.jsxs)(t.View,{style:de.settingsStyles.rowContent,children:[v,k]}),n[17]=v,n[18]=k,n[19]=T):T=n[19],n[20]!==y?(C=(0,He.jsx)(j.DropdownTrigger,{accessibilityRole:"button",accessibilityLabel:y,children:y}),n[20]=y,n[21]=C):C=n[21],n[22]!==b||n[23]!==c||n[24]!==o?(H=pe.LANGUAGE_OPTIONS.map(e=>(0,He.jsx)(Oe,{value:e.value,activeLocale:b,selected:o.language===e.value,onChange:c},e.value)),n[22]=b,n[23]=c,n[24]=o,n[25]=H):H=n[25],n[26]!==H?(_=(0,He.jsx)(Z.DropdownMenuContent,{side:"bottom",align:"end",width:300,children:H}),n[26]=H,n[27]=_):_=n[27],n[28]!==_||n[29]!==C?(V=(0,He.jsxs)(Z.DropdownMenu,{children:[C,_]}),n[28]=_,n[29]=C,n[30]=V):V=n[30],n[31]!==V||n[32]!==T?(P=(0,He.jsx)(t.View,{style:de.settingsStyles.card,children:(0,He.jsxs)(t.View,{style:de.settingsStyles.row,children:[T,V]})}),n[31]=V,n[32]=T,n[33]=P):P=n[33],n[34]!==P||n[35]!==x?(D=(0,He.jsx)(I.SettingsSection,{title:x,children:P}),n[34]=P,n[35]=x,n[36]=D):D=n[36],D}function We(e){const n=(0,l.c)(53),{useLegacyTerminalRenderer:o,onUseLegacyTerminalRendererChange:c,voiceAudioEngine:u,isPlaybackTestRunning:p,playbackTestResult:b,handlePlaybackTest:h}=e,{t:y}=(0,S.useTranslation)(),x=(0,ce.useAppDiagnosticStore)(Ee);let f;n[0]!==h?(f=()=>{h()},n[0]=h,n[1]=f):f=n[1];const j=f;let v,w,k,T,C,H,_,V,P,D,L,z,R,A;n[2]!==y?(v=y("settings.diagnostics.title"),n[2]=y,n[3]=v):v=n[3],n[4]!==c||n[5]!==y||n[6]!==o?(w=Ce.isNative?(0,He.jsxs)(t.View,{style:de.settingsStyles.row,testID:"legacy-terminal-renderer-row",children:[(0,He.jsxs)(t.View,{style:de.settingsStyles.rowContent,children:[(0,He.jsx)(s.Text,{style:de.settingsStyles.rowTitle,children:y("settings.diagnostics.legacyTerminalRenderer.label")}),(0,He.jsx)(s.Text,{style:de.settingsStyles.rowHint,children:y("settings.diagnostics.legacyTerminalRenderer.description")})]}),(0,He.jsx)(J.Switch,{value:o,onValueChange:c,accessibilityLabel:y("settings.diagnostics.legacyTerminalRenderer.accessibilityLabel"),testID:"legacy-terminal-renderer-switch"})]}):null,n[4]=c,n[5]=y,n[6]=o,n[7]=w):w=n[7],n[8]!==y?(k=y("settings.diagnostics.app.rowTitle"),n[8]=y,n[9]=k):k=n[9],n[10]!==k?(T=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowTitle,children:k}),n[10]=k,n[11]=T):T=n[11],n[12]!==y?(C=y("settings.diagnostics.app.rowHint"),n[12]=y,n[13]=C):C=n[13],n[14]!==C?(H=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowHint,children:C}),n[14]=C,n[15]=H):H=n[15],n[16]!==T||n[17]!==H?(_=(0,He.jsxs)(t.View,{style:de.settingsStyles.rowContent,children:[T,H]}),n[16]=T,n[17]=H,n[18]=_):_=n[18],n[19]!==y?(V=y("settings.diagnostics.app.run"),n[19]=y,n[20]=V):V=n[20],n[21]!==x||n[22]!==V?(P=(0,He.jsx)(Q.Button,{variant:"secondary",size:"sm",onPress:x,children:V}),n[21]=x,n[22]=V,n[23]=P):P=n[23],n[24]!==P||n[25]!==_?(D=(0,He.jsxs)(t.View,{style:de.settingsStyles.row,testID:"app-diagnostic-row",children:[_,P]}),n[24]=P,n[25]=_,n[26]=D):D=n[26],n[27]!==y?(L=y("settings.diagnostics.testAudio"),n[27]=y,n[28]=L):L=n[28],n[29]!==L?(z=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowTitle,children:L}),n[29]=L,n[30]=z):z=n[30],n[31]!==b?(R=b?(0,He.jsx)(s.Text,{style:de.settingsStyles.rowHint,children:b}):null,n[31]=b,n[32]=R):R=n[32],n[33]!==z||n[34]!==R?(A=(0,He.jsxs)(t.View,{style:de.settingsStyles.rowContent,children:[z,R]}),n[33]=z,n[34]=R,n[35]=A):A=n[35];const B=!u||p;let K,O,M,W,E;return n[36]!==p||n[37]!==y?(K=y(p?"settings.diagnostics.playing":"settings.diagnostics.playTest"),n[36]=p,n[37]=y,n[38]=K):K=n[38],n[39]!==j||n[40]!==B||n[41]!==K?(O=(0,He.jsx)(Q.Button,{variant:"secondary",size:"sm",onPress:j,disabled:B,children:K}),n[39]=j,n[40]=B,n[41]=K,n[42]=O):O=n[42],n[43]!==A||n[44]!==O?(M=(0,He.jsxs)(t.View,{style:de.settingsStyles.row,children:[A,O]}),n[43]=A,n[44]=O,n[45]=M):M=n[45],n[46]!==D||n[47]!==M||n[48]!==w?(W=(0,He.jsxs)(t.View,{style:de.settingsStyles.card,children:[w,D,M]}),n[46]=D,n[47]=M,n[48]=w,n[49]=W):W=n[49],n[50]!==v||n[51]!==W?(E=(0,He.jsx)(I.SettingsSection,{title:v,children:W}),n[50]=v,n[51]=W,n[52]=E):E=n[52],E}function Ee(e){return e.open}function Fe(e){const n=(0,l.c)(33),{appVersion:o,appVersionText:c,isDesktopApp:u}=e,{t:p}=(0,S.useTranslation)();let b,h,y,x,f,j,v,w,k,T,C,H,_,V,P;return n[0]!==p?(b=p("settings.about.title"),n[0]=p,n[1]=b):b=n[1],n[2]!==p?(h=p("settings.about.appVersion"),n[2]=p,n[3]=h):h=n[3],n[4]!==h?(y=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowTitle,children:h}),n[4]=h,n[5]=y):y=n[5],n[6]!==p?(x=p("settings.about.thisDevice"),n[6]=p,n[7]=x):x=n[7],n[8]!==x?(f=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowHint,children:x}),n[8]=x,n[9]=f):f=n[9],n[10]!==y||n[11]!==f?(j=(0,He.jsxs)(t.View,{style:de.settingsStyles.rowContent,children:[y,f]}),n[10]=y,n[11]=f,n[12]=j):j=n[12],n[13]!==c?(v=(0,He.jsx)(s.Text,{style:ot.aboutValue,children:c}),n[13]=c,n[14]=v):v=n[14],n[15]!==j||n[16]!==v?(w=(0,He.jsxs)(t.View,{style:de.settingsStyles.row,children:[j,v]}),n[15]=j,n[16]=v,n[17]=w):w=n[17],n[18]===Symbol.for("react.memo_cache_sentinel")?(k=(0,He.jsx)(Ue,{}),n[18]=k):k=n[18],n[19]!==u?(T=u?(0,He.jsx)(Qe,{}):null,n[19]=u,n[20]=T):T=n[20],n[21]!==T||n[22]!==w?(C=(0,He.jsxs)(t.View,{style:de.settingsStyles.card,children:[w,k,T]}),n[21]=T,n[22]=w,n[23]=C):C=n[23],n[24]!==b||n[25]!==C?(H=(0,He.jsx)(I.SettingsSection,{title:b,children:C}),n[24]=b,n[25]=C,n[26]=H):H=n[26],n[27]!==o?(_=(0,He.jsx)(Ge,{clientVersion:o}),n[27]=o,n[28]=_):_=n[28],n[29]===Symbol.for("react.memo_cache_sentinel")?(V=(0,He.jsx)(t.View,{style:ot.aboutCommunity,children:(0,He.jsx)(X.CommunityLinks,{})}),n[29]=V):V=n[29],n[30]!==H||n[31]!==_?(P=(0,He.jsxs)(He.Fragment,{children:[H,_,V]}),n[30]=H,n[31]=_,n[32]=P):P=n[32],P}function Ue(){const e=(0,l.c)(6),{t:n}=(0,S.useTranslation)(),{theme:c}=(0,y.useUnistyles)();let u,p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=[de.settingsStyles.row,de.settingsStyles.rowBorder],e[0]=u):u=e[0],e[1]!==n||e[2]!==c.colors.foreground||e[3]!==c.colors.foregroundMuted||e[4]!==c.iconSize.sm?(p=(0,He.jsx)(o.Pressable,{style:u,onPress:ae.openChangelog,accessibilityRole:"button",testID:"settings-whats-new",children:e=>{const{hovered:o}=e;return(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(t.View,{style:de.settingsStyles.rowContent,children:[(0,He.jsx)(s.Text,{style:de.settingsStyles.rowTitle,children:n("changelog.title")}),(0,He.jsx)(s.Text,{style:de.settingsStyles.rowHint,children:n("settings.about.whatsNewHint")})]}),(0,He.jsx)(f.ChevronRight,{size:c.iconSize.sm,color:o?c.colors.foreground:c.colors.foregroundMuted})]})}}),e[1]=n,e[2]=c.colors.foreground,e[3]=c.colors.foregroundMuted,e[4]=c.iconSize.sm,e[5]=p):p=e[5],p}function Ne(e){const t=e?.trim();return t?t.replace(/^v/i,""):null}function Ge(e){const s=(0,l.c)(12),{clientVersion:n}=e,{t:o}=(0,S.useTranslation)(),c=(0,R.useHosts)();if(0===c.length)return null;let u,p,b,h;if(s[0]!==o?(u=o("settings.about.connectedHosts"),s[0]=o,s[1]=u):u=s[1],s[2]!==n||s[3]!==c){let e;s[5]!==n?(e=(e,t)=>(0,He.jsx)($e,{host:e,showBorder:t>0,clientVersion:n},e.serverId),s[5]=n,s[6]=e):e=s[6],p=c.map(e),s[2]=n,s[3]=c,s[4]=p}else p=s[4];return s[7]!==p?(b=(0,He.jsx)(t.View,{style:de.settingsStyles.card,children:p}),s[7]=p,s[8]=b):b=s[8],s[9]!==u||s[10]!==b?(h=(0,He.jsx)(I.SettingsSection,{title:u,children:b}),s[9]=u,s[10]=b,s[11]=h):h=s[11],h}function $e(e){const n=(0,l.c)(31),{host:o,showBorder:c,clientVersion:u}=e,{t:p}=(0,S.useTranslation)(),b=(0,R.useHostRuntimeIsConnected)(o.serverId);let h;n[0]!==o.serverId?(h=e=>e.sessions[o.serverId]?.serverInfo?.version??null,n[0]=o.serverId,n[1]=h):h=n[1];const y=(0,A.useSessionStore)(h),x=c&&de.settingsStyles.rowBorder;let f;n[2]!==x?(f=[de.settingsStyles.row,x],n[2]=x,n[3]=f):f=n[3];const j=f;let v,w;if(n[4]!==u||n[5]!==y||n[6]!==b||n[7]!==p){const e=Ne(y);let t;n[10]!==u?(t=Ne(u),n[10]=u,n[11]=t):t=n[11];if(v=null!==e&&null!==t&&e!==t,b)w=e?(0,le.formatVersionWithPrefix)(e):"\u2014";else{let e;n[12]!==p?(e=p("settings.about.offline"),n[12]=p,n[13]=e):e=n[13],w=e}n[4]=u,n[5]=y,n[6]=b,n[7]=p,n[8]=v,n[9]=w}else v=n[8],w=n[9];const k=v&&ot.aboutVersionMismatch;let T;n[14]!==k?(T=[ot.aboutValue,k],n[14]=k,n[15]=T):T=n[15];const I=T;let C,H,_,V,P;return n[16]!==o.label?(C=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowTitle,numberOfLines:1,children:o.label}),n[16]=o.label,n[17]=C):C=n[17],n[18]!==v||n[19]!==p?(H=v?(0,He.jsx)(s.Text,{style:de.settingsStyles.rowHint,children:p("settings.about.versionDiffers")}):null,n[18]=v,n[19]=p,n[20]=H):H=n[20],n[21]!==C||n[22]!==H?(_=(0,He.jsxs)(t.View,{style:de.settingsStyles.rowContent,children:[C,H]}),n[21]=C,n[22]=H,n[23]=_):_=n[23],n[24]!==I||n[25]!==w?(V=(0,He.jsx)(s.Text,{style:I,children:w}),n[24]=I,n[25]=w,n[26]=V):V=n[26],n[27]!==j||n[28]!==_||n[29]!==V?(P=(0,He.jsxs)(t.View,{style:j,children:[_,V]}),n[27]=j,n[28]=_,n[29]=V,n[30]=P):P=n[30],P}function qe(e,t,s){return t?e("settings.about.updates.installing"):s?e("settings.about.updates.updateTo",{version:(0,le.formatVersionWithPrefix)(s)}):e("settings.about.updates.update")}function Qe(){const e=(0,l.c)(83),{t:n}=(0,S.useTranslation)(),{settings:o,updateSettings:c}=(0,z.useSettings)(),{isDesktopApp:p,statusText:h,availableUpdate:y,errorMessage:x,isChecking:f,isInstalling:j,checkForUpdates:v,installUpdate:w}=(0,oe.useDesktopAppUpdater)();let k,T;e[0]!==v||e[1]!==p?(k=()=>{p&&v({intent:"automatic",silent:!0})},e[0]=v,e[1]=p,e[2]=k):k=e[2],(0,b.useFocusEffect)(k),e[3]!==v||e[4]!==p?(T=()=>{p&&v()},e[3]=v,e[4]=p,e[5]=T):T=e[5];const I=T;let C;e[6]!==c?(C=e=>{c({releaseChannel:e})},e[6]=c,e[7]=C):C=e[7];const H=C;let _,V,P,D,L;e[8]!==n?(_=n("settings.about.releaseChannel.stable"),e[8]=n,e[9]=_):_=e[9],e[10]!==_?(V={value:"stable",label:_},e[10]=_,e[11]=V):V=e[11],e[12]!==n?(P=n("settings.about.releaseChannel.beta"),e[12]=n,e[13]=P):P=e[13],e[14]!==P?(D={value:"beta",label:P},e[14]=P,e[15]=D):D=e[15],e[16]!==V||e[17]!==D?(L=[V,D],e[16]=V,e[17]=D,e[18]=L):L=e[18];const R=L;let A;e[19]!==w||e[20]!==p||e[21]!==n?(A=()=>{p&&(0,M.confirmDialog)({title:n("settings.about.updates.installTitle"),message:n("settings.about.updates.installMessage"),confirmLabel:n("settings.about.updates.installConfirm"),cancelLabel:n("common.actions.cancel")}).then(e=>{e&&w()}).catch(e=>{console.error("[Settings] Failed to open app update confirmation",e),u.default.alert(n("settings.about.updates.alertTitle"),n("settings.about.updates.alertMessage"))})},e[19]=w,e[20]=p,e[21]=n,e[22]=A):A=e[22];const B=A,K=!0===y?.readyToInstall,O=K?y?.latestVersion:null;if(!p)return null;let W,E,F,U,N,G,$,q,J,X,Z,ee,te,se,ne;e[23]===Symbol.for("react.memo_cache_sentinel")?(W=[de.settingsStyles.row,de.settingsStyles.rowBorder],e[23]=W):W=e[23],e[24]!==n?(E=n("settings.about.releaseChannel.label"),e[24]=n,e[25]=E):E=e[25],e[26]!==E?(F=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowTitle,children:E}),e[26]=E,e[27]=F):F=e[27],e[28]!==n?(U=n("settings.about.releaseChannel.description"),e[28]=n,e[29]=U):U=e[29],e[30]!==U?(N=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowHint,children:U}),e[30]=U,e[31]=N):N=e[31],e[32]!==F||e[33]!==N?(G=(0,He.jsxs)(t.View,{style:de.settingsStyles.rowContent,children:[F,N]}),e[32]=F,e[33]=N,e[34]=G):G=e[34],e[35]!==H||e[36]!==R||e[37]!==o.releaseChannel?($=(0,He.jsx)(Y.SegmentedControl,{size:"sm",value:o.releaseChannel,onValueChange:H,options:R}),e[35]=H,e[36]=R,e[37]=o.releaseChannel,e[38]=$):$=e[38],e[39]!==G||e[40]!==$?(q=(0,He.jsxs)(t.View,{style:W,children:[G,$]}),e[39]=G,e[40]=$,e[41]=q):q=e[41],e[42]===Symbol.for("react.memo_cache_sentinel")?(J=[de.settingsStyles.row,de.settingsStyles.rowBorder],e[42]=J):J=e[42],e[43]!==n?(X=n("settings.about.updates.label"),e[43]=n,e[44]=X):X=e[44],e[45]!==X?(Z=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowTitle,children:X}),e[45]=X,e[46]=Z):Z=e[46],e[47]!==h?(ee=(0,He.jsx)(s.Text,{style:de.settingsStyles.rowHint,children:h}),e[47]=h,e[48]=ee):ee=e[48],e[49]!==O||e[50]!==n?(te=O?(0,He.jsx)(s.Text,{style:de.settingsStyles.rowHint,children:n("settings.about.updates.readyToInstall",{version:(0,le.formatVersionWithPrefix)(O)})}):null,e[49]=O,e[50]=n,e[51]=te):te=e[51],e[52]!==x?(se=x?(0,He.jsx)(s.Text,{style:ot.aboutErrorText,children:x}):null,e[52]=x,e[53]=se):se=e[53],e[54]!==Z||e[55]!==ee||e[56]!==te||e[57]!==se?(ne=(0,He.jsxs)(t.View,{style:de.settingsStyles.rowContent,children:[Z,ee,te,se]}),e[54]=Z,e[55]=ee,e[56]=te,e[57]=se,e[58]=ne):ne=e[58];const ie=f||j;let re,ae;e[59]!==f||e[60]!==n?(re=n(f?"settings.about.updates.checking":"settings.about.updates.check"),e[59]=f,e[60]=n,e[61]=re):re=e[61],e[62]!==I||e[63]!==ie||e[64]!==re?(ae=(0,He.jsx)(Q.Button,{variant:"outline",size:"sm",onPress:I,disabled:ie,children:re}),e[62]=I,e[63]=ie,e[64]=re,e[65]=ae):ae=e[65];const ce=f||j||!K;let ue,ge,pe,be,he;return e[66]!==j||e[67]!==O||e[68]!==n?(ue=qe(n,j,O),e[66]=j,e[67]=O,e[68]=n,e[69]=ue):ue=e[69],e[70]!==B||e[71]!==ce||e[72]!==ue?(ge=(0,He.jsx)(Q.Button,{variant:"default",size:"sm",onPress:B,disabled:ce,children:ue}),e[70]=B,e[71]=ce,e[72]=ue,e[73]=ge):ge=e[73],e[74]!==ae||e[75]!==ge?(pe=(0,He.jsxs)(t.View,{style:ot.aboutUpdateActions,children:[ae,ge]}),e[74]=ae,e[75]=ge,e[76]=pe):pe=e[76],e[77]!==ne||e[78]!==pe?(be=(0,He.jsxs)(t.View,{style:J,children:[ne,pe]}),e[77]=ne,e[78]=pe,e[79]=be):be=e[79],e[80]!==q||e[81]!==be?(he=(0,He.jsxs)(He.Fragment,{children:[q,be]}),e[80]=q,e[81]=be,e[82]=he):he=e[82],he}function Je(e,t){const s=(0,l.c)(3);let n;return s[0]!==e||s[1]!==t?(n=(0,B.orderHostsLocalFirst)(e,t),s[0]=e,s[1]=t,s[2]=n):n=s[2],n}const Xe=1.5;function Ye(e){const t=(0,l.c)(23),{itemId:n,label:c,icon:u,isSelected:p,onSelect:b}=e,{theme:h}=(0,y.useUnistyles)();let S;t[0]!==n||t[1]!==b?(S=()=>{b(n)},t[0]=n,t[1]=b,t[2]=S):S=t[2];const x=S;let f;t[3]!==p?(f={selected:p},t[3]=p,t[4]=f):f=t[4];const j=f;let v,w;t[5]!==p||t[6]!==h.colors.foreground?(v=p&&{color:h.colors.foreground},t[5]=p,t[6]=h.colors.foreground,t[7]=v):v=t[7],t[8]!==v?(w=[rt.label,v],t[8]=v,t[9]=w):w=t[9];const k=w,T=p?Be:Ae,I=p?h.colors.foreground:h.colors.foregroundMuted;let C,H,_;return t[10]!==u||t[11]!==I||t[12]!==h.iconSize.md?(C=(0,He.jsx)(u,{size:h.iconSize.md,color:I,strokeWidth:Xe}),t[10]=u,t[11]=I,t[12]=h.iconSize.md,t[13]=C):C=t[13],t[14]!==c||t[15]!==k?(H=(0,He.jsx)(s.Text,{style:k,numberOfLines:1,children:c}),t[14]=c,t[15]=k,t[16]=H):H=t[16],t[17]!==j||t[18]!==x||t[19]!==T||t[20]!==C||t[21]!==H?(_=(0,He.jsxs)(o.Pressable,{accessibilityRole:"button",accessibilityState:j,onPress:x,style:T,children:[C,H]}),t[17]=j,t[18]=x,t[19]=T,t[20]=C,t[21]=H,t[22]=_):_=t[22],_}function Ze(e){const t=(0,l.c)(24),{itemId:n,label:c,icon:u,isSelected:p,onSelect:b}=e,{theme:h}=(0,y.useUnistyles)();let S;t[0]!==n||t[1]!==b?(S=()=>{b(n)},t[0]=n,t[1]=b,t[2]=S):S=t[2];const x=S;let f;t[3]!==p?(f={selected:p},t[3]=p,t[4]=f):f=t[4];const j=f;let v,w;t[5]!==p||t[6]!==h.colors.foreground?(v=p&&{color:h.colors.foreground},t[5]=p,t[6]=h.colors.foreground,t[7]=v):v=t[7],t[8]!==v?(w=[rt.label,v],t[8]=v,t[9]=w):w=t[9];const k=w,T=`settings-host-section-${n}`,I=p?Be:Ae,C=p?h.colors.foreground:h.colors.foregroundMuted;let H,_,V;return t[10]!==u||t[11]!==C||t[12]!==h.iconSize.md?(H=(0,He.jsx)(u,{size:h.iconSize.md,color:C,strokeWidth:Xe}),t[10]=u,t[11]=C,t[12]=h.iconSize.md,t[13]=H):H=t[13],t[14]!==c||t[15]!==k?(_=(0,He.jsx)(s.Text,{style:k,numberOfLines:1,children:c}),t[14]=c,t[15]=k,t[16]=_):_=t[16],t[17]!==j||t[18]!==x||t[19]!==T||t[20]!==I||t[21]!==H||t[22]!==_?(V=(0,He.jsxs)(o.Pressable,{accessibilityRole:"button",accessibilityState:j,onPress:x,testID:T,style:I,children:[H,_]}),t[17]=j,t[18]=x,t[19]=T,t[20]=I,t[21]=H,t[22]=_,t[23]=V):V=t[23],V}function et(e){const n=(0,l.c)(29),{activeServerId:o,sortedHosts:u,onSelectHost:p,onAddHost:b,enableBuiltInDaemonOption:h}=e,{t:y}=(0,S.useTranslation)(),[x,f]=(0,c.useState)(!1),j=(0,c.useRef)(null);let w;n[0]!==o||n[1]!==u?(w=u.find(e=>e.serverId===o)??u[0]??null,n[0]=o,n[1]=u,n[2]=w):w=n[2];const I=w;let C;n[3]===Symbol.for("react.memo_cache_sentinel")?(C=()=>f(!0),n[3]=C):C=n[3];const H=C,_=st,V=tt,P=o??"",D=h.visible,L=h.onPress;let z,R,A,B,K,O,M;return n[4]!==y?(z=y("settings.hostPicker.switchHost"),n[4]=y,n[5]=z):z=n[5],n[6]!==y?(R=y("settings.hostPicker.switchHost"),n[6]=y,n[7]=R):R=n[7],n[8]!==I?(A=I?(0,He.jsx)(t.View,{style:rt.pickerTriggerDot,children:(0,He.jsx)(T.HostStatusDot,{serverId:I.serverId})}):null,n[8]=I,n[9]=A):A=n[9],n[10]!==I?.label||n[11]!==y?(B=I?.label??y("settings.groups.host"),n[10]=I?.label,n[11]=y,n[12]=B):B=n[12],n[13]!==B?(K=(0,He.jsx)(s.Text,{style:rt.pickerTriggerLabel,numberOfLines:1,children:B}),n[13]=B,n[14]=K):K=n[14],n[15]!==K||n[16]!==R||n[17]!==A?(O=(0,He.jsxs)(v.ComboboxTrigger,{ref:j,block:!0,style:V,onPress:H,accessibilityRole:"button",accessibilityLabel:R,testID:"settings-host-picker",children:[A,K]}),n[15]=K,n[16]=R,n[17]=A,n[18]=O):O=n[18],n[19]!==h.onPress||n[20]!==h.visible||n[21]!==x||n[22]!==b||n[23]!==p||n[24]!==u||n[25]!==O||n[26]!==P||n[27]!==z?(M=(0,He.jsx)(k.HostPicker,{hosts:u,value:P,onSelect:p,open:x,onOpenChange:f,anchorRef:j,includeAddHost:!0,onAddHost:b,includeEnableBuiltInDaemon:D,onEnableBuiltInDaemon:L,showActiveConnection:!0,searchable:!1,title:z,desktopMinWidth:240,addHostTestID:"settings-add-host",hostOptionTestID:_,children:O}),n[19]=h.onPress,n[20]=h.visible,n[21]=x,n[22]=b,n[23]=p,n[24]=u,n[25]=O,n[26]=P,n[27]=z,n[28]=M):M=n[28],M}function tt(e){const{hovered:t}=e,s=void 0!==t&&t;return[rt.pickerTrigger,s&&rt.pickerTriggerHovered]}function st(e){return`settings-host-picker-item-${e}`}function nt(e){const c=(0,l.c)(62),{view:u,onSelectSection:p,onSelectHostSection:b,onSelectHost:x,onAddHost:j,onBackToWorkspace:v,activeHostServerId:k,layout:T}=e,{theme:I}=(0,y.useUnistyles)(),{t:C}=(0,S.useTranslation)(),H=Je((0,R.useHosts)(),(0,ve.useLocalDaemonServerId)()),_=H.length>0,V=(0,we.useEnableBuiltInDaemonOption)(),P=(0,ie.isElectronRuntime)(),D=Ve.filter(e=>Le(e,P)),L=(0,h.useSafeAreaInsets)(),z="desktop"===T,A=z?rt.desktopContainer:rt.mobileContainer;let B;c[0]!==A?(B=[A],c[0]=A,c[1]=B):B=c[1];const M=B;let W,E,F;c[2]===Symbol.for("react.memo_cache_sentinel")?(W={flex:1},c[2]=W):W=c[2],c[3]!==L.top||c[4]!==z?(E=z?{paddingTop:L.top}:null,c[3]=L.top,c[4]=z,c[5]=E):E=c[5],c[6]!==E?(F=[W,E],c[6]=E,c[7]=F):F=c[7];const U=F,N="section"===u.kind?u.section:null;let G;c[8]!==u.kind||c[9]!==u.section?(G=null,"host"===u.kind&&(G=u.section),"project"===u.kind&&(G="projects"),"plugin"===u.kind&&(G="plugins"),c[8]=u.kind,c[9]=u.section,c[10]=G):G=c[10];const $=t.View,q=rt;let Q,J,X;c[11]!==C?(Q=C("settings.groups.app"),c[11]=C,c[12]=Q):Q=c[12],c[13]!==Q?(J=(0,He.jsx)(s.Text,{style:rt.groupLabel,children:Q}),c[13]=Q,c[14]=J):J=c[14],c[15]!==p||c[16]!==N||c[17]!==C?(X=e=>(0,He.jsx)(Ye,{itemId:e.id,label:C(e.labelKey),icon:e.icon,isSelected:N===e.id,onSelect:p},e.id),c[15]=p,c[16]=N,c[17]=C,c[18]=X):X=c[18];const Y=D.map(X);let Z,ee,te,se,ne,oe,le;c[19]!==$||c[20]!==Y||c[21]!==q.list||c[22]!==J?(Z=(0,He.jsxs)($,{style:q.list,children:[J,Y]}),c[19]=$,c[20]=Y,c[21]=q.list,c[22]=J,c[23]=Z):Z=c[23],c[24]!==k||c[25]!==V||c[26]!==_||c[27]!==j||c[28]!==x||c[29]!==b||c[30]!==G||c[31]!==H||c[32]!==C||c[33]!==I?(ee=_?(0,He.jsxs)(t.View,{style:rt.list,children:[(0,He.jsx)(s.Text,{style:rt.groupLabel,children:C("settings.groups.host")}),(0,He.jsx)(et,{activeServerId:k,sortedHosts:H,onSelectHost:x,onAddHost:j,enableBuiltInDaemonOption:V}),ze.map(e=>(0,He.jsx)(Ze,{itemId:e.id,label:C(e.labelKey),icon:e.icon,isSelected:G===e.id,onSelect:b},e.id))]}):(0,He.jsxs)(t.View,{style:rt.list,children:[(0,He.jsxs)(o.Pressable,{accessibilityRole:"button",accessibilityLabel:C("settings.addHost"),onPress:j,testID:"settings-add-host",style:Ae,children:[(0,He.jsx)(f.Plus,{size:I.iconSize.md,color:I.colors.foregroundMuted,strokeWidth:Xe}),(0,He.jsx)(s.Text,{style:rt.label,numberOfLines:1,children:C("settings.addHost")})]}),V.visible?(0,He.jsxs)(o.Pressable,{accessibilityRole:"button",accessibilityLabel:C("settings.enableBuiltInDaemon"),onPress:V.onPress,testID:"settings-enable-built-in-daemon",style:Ae,children:[(0,He.jsx)(f.Server,{size:I.iconSize.md,color:I.colors.foregroundMuted,strokeWidth:Xe}),(0,He.jsx)(s.Text,{style:rt.label,numberOfLines:1,children:C("settings.enableBuiltInDaemon")})]}):null]}),c[24]=k,c[25]=V,c[26]=_,c[27]=j,c[28]=x,c[29]=b,c[30]=G,c[31]=H,c[32]=C,c[33]=I,c[34]=ee):ee=c[34],c[35]!==C?(te=C("settings.customizations.group"),c[35]=C,c[36]=te):te=c[36],c[37]!==te?(se=(0,He.jsx)(s.Text,{style:rt.groupLabel,children:te}),c[37]=te,c[38]=se):se=c[38],c[39]!==p||c[40]!==N||c[41]!==C?(ne=Pe.map(e=>(0,He.jsx)(Ye,{itemId:e.id,label:C(e.labelKey),icon:e.icon,isSelected:N===e.id,onSelect:p},e.id)),c[39]=p,c[40]=N,c[41]=C,c[42]=ne):ne=c[42],c[43]!==se||c[44]!==ne?(oe=(0,He.jsxs)(t.View,{style:rt.list,children:[se,ne]}),c[43]=se,c[44]=ne,c[45]=oe):oe=c[45],c[46]!==Z||c[47]!==ee||c[48]!==oe?(le=(0,He.jsxs)(He.Fragment,{children:[Z,ee,oe]}),c[46]=Z,c[47]=ee,c[48]=oe,c[49]=le):le=c[49];const re=le;let ae,ce,de;return c[50]!==C?(ae=C("settings.title"),c[50]=C,c[51]=ae):ae=c[51],c[52]!==U||c[53]!==z||c[54]!==v||c[55]!==re||c[56]!==C?(ce=z?(0,He.jsxs)(t.View,{style:U,children:[(0,He.jsxs)(t.View,{style:rt.sidebarDragArea,children:[(0,He.jsx)(K.TitlebarDragRegion,{}),(0,He.jsx)(O.WindowChromeSafeArea,{placement:"below"}),(0,He.jsx)(w.SidebarHeaderRow,{icon:f.ArrowLeft,label:C("settings.backToWorkspace"),onPress:v,testID:"settings-back-to-workspace"})]}),(0,He.jsx)(n.ScrollView,{style:rt.scrollBody,showsVerticalScrollIndicator:!1,testID:"settings-sidebar-scroll-body",children:re})]}):re,c[52]=U,c[53]=z,c[54]=v,c[55]=re,c[56]=C,c[57]=ce):ce=c[57],c[58]!==M||c[59]!==ae||c[60]!==ce?(de=(0,He.jsx)(t.View,{accessibilityLabel:ae,role:"navigation",style:M,testID:"settings-sidebar",children:ce}),c[58]=M,c[59]=ae,c[60]=ce,c[61]=de):de=c[61],de}function it({view:e,openAddHostIntent:o=null}){const l=(0,p.useRouter)(),{t:u}=(0,S.useTranslation)(),y=(0,ge.useVoiceAudioEngineOptional)(),{settings:f,isLoading:j,updateSettings:v}=(0,z.useAppSettings)(),[w,k]=(0,c.useState)(!1),[T,I]=(0,c.useState)(!1),[C,_]=(0,c.useState)(!1),[V,P]=(0,c.useState)(!1),[D,A]=(0,c.useState)(!1),[K,M]=(0,c.useState)(null),$=(0,c.useRef)(null),q=(0,ie.isElectronRuntime)(),Q=(0,re.resolveAppVersion)(),J=(0,le.formatVersionWithPrefix)(Q),X=(0,je.useIsCompactFormFactor)(),Y=(0,h.useSafeAreaInsets)(),Z=(0,c.useMemo)(()=>({paddingBottom:Y.bottom}),[Y.bottom]),ee=(0,R.useHosts)(),te=(0,ve.useLocalDaemonServerId)(),se=Je(ee,te),ne=(0,Te.useLastWorkspaceSelection)(),oe="host"===e.kind||"project"===e.kind||"plugin"===e.kind?e.serverId:null,[ae,ce]=(0,c.useState)(oe??ne?.serverId??null);(0,b.useFocusEffect)((0,c.useCallback)(()=>{ce(oe??ne?.serverId??null)},[ne?.serverId,oe]));const de=(0,c.useMemo)(()=>"host"===e.kind||"project"===e.kind||"plugin"===e.kind?e.serverId:(0,B.resolveActiveHostServerId)({selectedServerId:ae,localServerId:te,hosts:ee,orderedHosts:se}),[e,ae,te,ee,se]),pe=(0,c.useCallback)(e=>{v({language:e})},[v]),be=(0,c.useCallback)(e=>{v({useLegacyTerminalRenderer:e})},[v]),Se=(0,c.useCallback)(async()=>{if(y&&!D){A(!0),M(null);try{const e=x.Buffer.from(ue.THINKING_TONE_NATIVE_PCM_BASE64,"base64");await y.initialize(),y.stop(),await y.play({type:"audio/pcm;rate=16000;bits=16",size:e.byteLength,arrayBuffer:async()=>Uint8Array.from(e).buffer}),M(null)}catch(e){const t=e instanceof Error?e.message:String(e);console.error("[Settings] Playback test failed",e),M(u("settings.diagnostics.playbackFailed",{message:t}))}finally{A(!1)}}},[D,u,y]),xe=(0,c.useCallback)(()=>{k(!1),I(!1),_(!1),P(!1)},[]),fe=(0,c.useCallback)(()=>{I(!1),_(!1),P(!1),k(!0)},[]),we=(0,c.useCallback)(()=>{k(!0)},[]);(0,c.useEffect)(()=>{o&&$.current!==o&&($.current=o,we())},[we,o]);const Ce=(0,c.useCallback)(()=>{k(!1),I(!0)},[]),Ve=(0,c.useCallback)(()=>{k(!1),_(!0)},[]),Pe=(0,c.useCallback)(()=>{k(!1),P(!0)},[]),Ae=(0,c.useCallback)(({serverId:e})=>{const t=(0,ke.buildSettingsHostSectionRoute)(e,"connections");X?l.push(t):l.replace(t)},[X,l]),Be=(0,c.useCallback)(e=>{const t=(0,ke.buildSettingsSectionRoute)(e);X?l.push(t):l.replace(t)},[X,l]),Ke=(0,c.useCallback)(t=>{if(ce(t),"project"===e.kind){const e=(0,ke.buildSettingsHostSectionRoute)(t,"projects");return void(X?l.push(e):l.replace(e))}if("host"!==e.kind)return;const s=(0,ke.buildSettingsHostSectionRoute)(t,e.section);X?l.push(s):l.replace(s)},[X,l,e]),Oe=(0,c.useCallback)(e=>{if(!de)return void we();const t=(0,ke.buildSettingsHostSectionRoute)(de,e);X?l.push(t):l.replace(t)},[de,we,X,l]),Ee=(0,c.useCallback)(()=>{xe(),l.push({pathname:"/pair-scan",params:{source:"settings"}})},[xe,l]),Ue=(0,c.useCallback)(()=>{const e=(0,ke.buildSettingsSectionRoute)("general");X?l.replace("/settings"):l.replace(e)},[X,l]),Ne=(0,c.useCallback)(()=>{(0,Ie.returnFromSettings)(e)},[e]),Ge=(0,c.useCallback)(()=>{(0,Ie.returnFromSettings)({kind:"root"})},[]),$e=(0,ye.useInstalledPlugins)(),qe=(()=>{if("plugin"===e.kind){const t=$e.find(t=>t.serverId===e.serverId&&t.id===e.pluginId)?.settingsScreens.find(t=>t.id===e.screenId);return`${e.pluginId} \xb7 ${t?.title??u("settings.title")}`}if("host"===e.kind){const t=ze.find(t=>t.id===e.section);return t?u(t.labelKey):void 0}if("section"===e.kind){const t=De.find(t=>t.id===e.section);return t?u(t.labelKey):void 0}if("project"===e.kind)return u("settings.projects")})(),Qe=(()=>{if("plugin"===e.kind)return(0,He.jsx)(he.PluginSettingsContent,{serverId:e.serverId,pluginId:e.pluginId,screenId:e.screenId,onBackToPlugins:Ne,showBackToPlugins:!X});if("host"===e.kind)return Re(e,Ue);if("project"===e.kind)return(0,He.jsx)(me.default,{serverId:e.serverId,projectId:e.projectId,onBackToProjects:Ne,showBackToProjects:!X});if("section"===e.kind){const t=De.find(t=>t.id===e.section);if(!t||!Le(t,q))return null;switch(e.section){case"general":return(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Me,{settings:f,handleLanguageChange:pe}),(0,He.jsx)(L.SendingSection,{}),q?(0,He.jsx)(H.OpenLocationSection,{}):null]});case"diagnostics":return(0,He.jsx)(We,{useLegacyTerminalRenderer:f.useLegacyTerminalRenderer,onUseLegacyTerminalRendererChange:be,voiceAudioEngine:y,isPlaybackTestRunning:D,playbackTestResult:K,handlePlaybackTest:Se});case"about":return(0,He.jsx)(Fe,{appVersion:Q,appVersionText:J,isDesktopApp:q});default:return t.Content?(0,He.jsx)(t.Content,{}):null}}return null})();if(j)return(0,He.jsx)(t.View,{style:ot.loadingContainer,children:(0,He.jsx)(s.Text,{style:ot.loadingText,children:u("settings.loading")})});const Xe=(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(F.AddHostMethodModal,{visible:w,onClose:xe,onDirectConnection:Ce,onRemoteSsh:Ve,onPasteLink:Pe,onScanQr:Ee}),(0,He.jsx)(U.AddHostModal,{visible:T,onClose:xe,onCancel:fe,onSaved:Ae}),(0,He.jsx)(N.AddRemoteSshHostModal,{visible:C,onClose:xe,onCancel:fe,onSaved:Ae}),(0,He.jsx)(G.PairLinkModal,{visible:V,onClose:xe,onCancel:fe,onSaved:Ae})]});return X&&"root"===e.kind?(0,He.jsxs)(t.View,{style:ot.container,children:[(0,He.jsx)(W.BackHeader,{title:u("settings.title"),onBack:Ge}),(0,He.jsx)(n.ScrollView,{style:ot.scrollView,contentContainerStyle:Z,children:(0,He.jsx)(nt,{view:e,onSelectSection:Be,onSelectHostSection:Oe,onSelectHost:Ke,onAddHost:we,onBackToWorkspace:Ge,activeHostServerId:de,layout:"mobile"})}),Xe]}):X?(0,He.jsxs)(t.View,{style:ot.container,children:[(0,He.jsx)(E.PageLayout,{title:qe,onBack:Ne,children:Qe}),Xe]}):(0,He.jsxs)(t.View,{style:ot.container,children:[(0,He.jsxs)(t.View,{style:lt.row,children:[(0,He.jsx)(O.WindowChromeRegion,{corners:"top-left",children:(0,He.jsx)(nt,{view:e,onSelectSection:Be,onSelectHostSection:Oe,onSelectHost:Ke,onAddHost:we,onBackToWorkspace:Ge,activeHostServerId:de,layout:"desktop"})}),(0,He.jsx)(O.WindowChromeRegion,{corners:"top-right",children:(0,He.jsx)(t.View,{style:lt.contentPane,testID:"settings-detail-pane",children:(0,He.jsx)(E.PageLayout,{title:qe,titleTestID:"settings-detail-header-title",children:Qe})})})]}),Xe]})}const ot=y.StyleSheet.create(e=>({loadingContainer:{flex:1,backgroundColor:e.colors.surface0,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},loadingText:{color:e.colors.foreground,fontSize:e.fontSize.base,uni__dependencies:[0]},container:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},scrollView:{flex:1},aboutValue:{color:e.colors.foregroundMuted,fontSize:e.fontSize.base,uni__dependencies:[0]},aboutVersionMismatch:{color:e.colors.palette.amber[500],uni__dependencies:[0]},aboutErrorText:{color:e.colors.palette.red[300],fontSize:e.fontSize.sm,marginTop:e.spacing[1],uni__dependencies:[0]},aboutCommunity:{marginTop:e.spacing[4],uni__dependencies:[0]},aboutUpdateActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},placeholder:{flex:1,alignItems:"center",justifyContent:"center",paddingVertical:e.spacing[8],uni__dependencies:[0]},placeholderText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.base,uni__dependencies:[0]}})),lt=y.StyleSheet.create({row:{flex:1,flexDirection:"row"},contentPane:{flex:1}}),rt=y.StyleSheet.create(e=>({desktopContainer:{width:je.SETTINGS_DESKTOP_SIDEBAR_WIDTH,borderRightWidth:1,borderRightColor:e.colors.border,backgroundColor:e.colors.surfaceSidebar,uni__dependencies:[0]},scrollBody:{flex:1},sidebarDragArea:{position:"relative"},mobileContainer:{paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],uni__dependencies:[0]},list:{paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],gap:e.spacing[.5],uni__dependencies:[0]},groupLabel:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.normal,color:e.colors.foregroundExtraMuted,paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],uni__dependencies:[0]},item:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],minHeight:28,paddingVertical:e.spacing[1],paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius.lg,uni__dependencies:[0]},itemHovered:{backgroundColor:e.colors.surfaceSidebarHover,uni__dependencies:[0]},itemSelected:{backgroundColor:e.colors.surfaceSidebarHover,uni__dependencies:[0]},label:{fontSize:e.fontSize.base,color:e.colors.foregroundMuted,fontWeight:e.fontWeight.normal,flex:1,uni__dependencies:[0]},pickerTrigger:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],minHeight:28,paddingVertical:e.spacing[1],paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius.lg,uni__dependencies:[0]},pickerTriggerHovered:{backgroundColor:e.colors.surfaceSidebarHover,uni__dependencies:[0]},pickerTriggerLabel:{flex:1,minWidth:0,fontSize:e.fontSize.base,color:e.colors.foreground,fontWeight:e.fontWeight.normal,uni__dependencies:[0]},pickerTriggerDot:{width:e.iconSize.md,height:e.iconSize.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]}}))},5116,[896,897,1144,898,454,37,396,426,183,235,147,456,461,627,57,854,53,1218,3721,4356,3730,3839,3840,3725,5117,5120,5121,5122,5123,5124,5125,884,3529,3459,3532,4111,4050,3541,4188,4187,5126,5127,5128,5083,5129,5130,3022,3689,5037,4190,3702,5131,5135,5136,5137,882,4927,4157,3526,3936,4108,3722,4433,4426,3019,5139,5161,3480,5162,5166,5167,5168,1217,3841,5174,3675,3671,4166,881,280]);
|
|
16876
16876
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AppearanceSection=function(){const n=(0,o.c)(152),{t:c}=(0,l.useTranslation)(),{settings:u,updateSettings:h}=(0,b.useAppSettings)(),{options:p,selected:S,select:f}=(0,x.useContributedThemes)(),F=!w.isNative;let z;n[0]!==c?(z=V(c,T.DEFAULT_UI_FONT_STACK),n[0]=c,n[1]=z):z=n[1];const E=z;let I;n[2]!==c?(I=V(c,T.DEFAULT_MONO_FONT_STACK),n[2]=c,n[3]=I):I=n[3];const M=I,[N,O]=(0,s.useState)(u.uiFontFamily),[D,H]=(0,s.useState)(u.monoFontFamily),[W,B]=(0,s.useState)(String(u.uiBaseFontSize)),[Z,k]=(0,s.useState)(String(u.contentFontSize)),[G,K]=(0,s.useState)(String(u.codeFontSize));let Y,$,q,J,Q,ee,te;n[4]!==u.uiBaseFontSize?(Y=()=>{B(String(u.uiBaseFontSize))},$=[u.uiBaseFontSize],n[4]=u.uiBaseFontSize,n[5]=Y,n[6]=$):(Y=n[5],$=n[6]);(0,s.useEffect)(Y,$),n[7]!==u.contentFontSize?(q=()=>{k(String(u.contentFontSize))},J=[u.contentFontSize],n[7]=u.contentFontSize,n[8]=q,n[9]=J):(q=n[8],J=n[9]);(0,s.useEffect)(q,J),n[10]!==u.codeFontSize?(Q=()=>{K(String(u.codeFontSize))},ee=[u.codeFontSize],n[10]=u.codeFontSize,n[11]=Q,n[12]=ee):(Q=n[11],ee=n[12]);(0,s.useEffect)(Q,ee),n[13]!==h?(te=t=>{h({theme:t})},n[13]=h,n[14]=te):te=n[14];const ne=te;let ie;n[15]!==f?(ie=t=>{f(t)},n[15]=f,n[16]=ie):ie=n[16];const oe=ie;let se;n[17]!==h?(se=t=>{h({contentMaxWidth:t})},n[17]=h,n[18]=se):se=n[18];const le=se;let re;n[19]!==h?(re=t=>{h({syntaxTheme:t})},n[19]=h,n[20]=re):re=n[20];const ae=re;let ce;n[21]!==u.uiFontFamily||n[22]!==h?(ce=t=>{const n=(0,b.sanitizeFontFamily)(t);null!==n?(O(n),n!==u.uiFontFamily&&h({uiFontFamily:n})):O(u.uiFontFamily)},n[21]=u.uiFontFamily,n[22]=h,n[23]=ce):ce=n[23];const de=ce;let ue;n[24]!==u.monoFontFamily||n[25]!==h?(ue=t=>{const n=(0,b.sanitizeFontFamily)(t);null!==n?(H(n),n!==u.monoFontFamily&&h({monoFontFamily:n})):H(u.monoFontFamily)},n[24]=u.monoFontFamily,n[25]=h,n[26]=ue):ue=n[26];const he=ue;let ge;n[27]===Symbol.for("react.memo_cache_sentinel")?(ge=t=>{B(t.replace(/[^\d]/g,""))},n[27]=ge):ge=n[27];const pe=ge;let me;n[28]===Symbol.for("react.memo_cache_sentinel")?(me=t=>{K(t.replace(/[^\d]/g,""))},n[28]=me):me=n[28];const Se=me;let ye;n[29]===Symbol.for("react.memo_cache_sentinel")?(ye=t=>{k(t.replace(/[^\d]/g,""))},n[29]=ye):ye=n[29];const xe=ye;let fe;n[30]!==u.uiBaseFontSize||n[31]!==W||n[32]!==h?(fe=()=>{const t=(0,b.parseClampedFontSize)(W,{min:b.MIN_UI_BASE_FONT_SIZE,max:b.MAX_UI_BASE_FONT_SIZE})??u.uiBaseFontSize;B(String(t)),t!==u.uiBaseFontSize&&h({uiBaseFontSize:t})},n[30]=u.uiBaseFontSize,n[31]=W,n[32]=h,n[33]=fe):fe=n[33];const Fe=fe;let be;n[34]!==G||n[35]!==u.codeFontSize||n[36]!==h?(be=()=>{const t=(0,b.parseClampedFontSize)(G,{min:b.MIN_CODE_FONT_SIZE,max:b.MAX_CODE_FONT_SIZE})??u.codeFontSize;K(String(t)),t!==u.codeFontSize&&h({codeFontSize:t})},n[34]=G,n[35]=u.codeFontSize,n[36]=h,n[37]=be):be=n[37];const Te=be;let we;n[38]!==Z||n[39]!==u.contentFontSize||n[40]!==h?(we=()=>{const t=(0,b.parseClampedFontSize)(Z,{min:b.MIN_CONTENT_FONT_SIZE,max:b.MAX_CONTENT_FONT_SIZE})??u.contentFontSize;k(String(t)),t!==u.contentFontSize&&h({contentFontSize:t})},n[38]=Z,n[39]=u.contentFontSize,n[40]=h,n[41]=we):we=n[41];const _e=we;let je,Ce,ze;n[42]!==Z?(je=A(Z),n[42]=Z,n[43]=je):je=n[43];n[44]!==G?(Ce=A(G),n[44]=G,n[45]=Ce):Ce=n[45];n[46]!==D||n[47]!==je||n[48]!==Ce?(ze={contentFontSize:je,monoFontFamily:D,codeFontSize:Ce},n[46]=D,n[47]=je,n[48]=Ce,n[49]=ze):ze=n[49];const Ee=ze;let Ie,Me,Ne,Oe,Ve,Ae,De,He,We,Be,ve,Le,Pe,Re,Ze,ke,Ue,Xe,Ge,Ke,Ye,$e,qe,Je,Qe,et,tt,nt,it,ot,st;n[50]!==c?(Ie=c("settings.appearance.theme.title"),n[50]=c,n[51]=Ie):Ie=n[51];n[52]!==oe||n[53]!==ne||n[54]!==p||n[55]!==S||n[56]!==u.theme?(Me=(0,C.jsx)(t.View,{style:_.settingsStyles.card,children:(0,C.jsx)(v,{value:u.theme,pluginThemes:p,selectedPluginTheme:S,onChange:ne,onSelectPluginTheme:oe})}),n[52]=oe,n[53]=ne,n[54]=p,n[55]=S,n[56]=u.theme,n[57]=Me):Me=n[57];n[58]!==Ie||n[59]!==Me?(Ne=(0,C.jsx)(y.SettingsSection,{title:Ie,children:Me}),n[58]=Ie,n[59]=Me,n[60]=Ne):Ne=n[60];n[61]!==c?(Oe=c("settings.appearance.fonts.title"),n[61]=c,n[62]=Oe):Oe=n[62];n[63]!==de||n[64]!==u.uiFontFamily||n[65]!==c||n[66]!==N||n[67]!==E?(Ve=F?(0,C.jsx)(L,{title:c("settings.appearance.fonts.interfaceFont"),hint:c("settings.appearance.fonts.interfaceFontHint"),accessibilityLabel:c("settings.appearance.fonts.interfaceFontAccessibility"),placeholder:E,value:u.uiFontFamily,draft:N,withBorder:!1,onChangeDraft:O,onCommit:de}):null,n[63]=de,n[64]=u.uiFontFamily,n[65]=c,n[66]=N,n[67]=E,n[68]=Ve):Ve=n[68];n[69]!==c?(Ae=c("settings.appearance.fonts.interfaceSize"),n[69]=c,n[70]=Ae):Ae=n[70];n[71]!==c?(De=c("settings.appearance.fonts.interfaceSizeHint"),n[71]=c,n[72]=De):De=n[72];n[73]!==c?(He=c("settings.appearance.fonts.interfaceSizeAccessibility"),n[73]=c,n[74]=He):He=n[74];n[75]!==Fe||n[76]!==Ae||n[77]!==De||n[78]!==He||n[79]!==W?(We=(0,C.jsx)(P,{title:Ae,hint:De,accessibilityLabel:He,draft:W,withBorder:F,onChangeDraft:pe,onCommit:Fe}),n[75]=Fe,n[76]=Ae,n[77]=De,n[78]=He,n[79]=W,n[80]=We):We=n[80];n[81]!==c?(Be=c("settings.appearance.fonts.contentSize"),n[81]=c,n[82]=Be):Be=n[82];n[83]!==c?(ve=c("settings.appearance.fonts.contentSizeHint"),n[83]=c,n[84]=ve):ve=n[84];n[85]!==c?(Le=c("settings.appearance.fonts.contentSizeAccessibility"),n[85]=c,n[86]=Le):Le=n[86];n[87]!==_e||n[88]!==Z||n[89]!==Be||n[90]!==ve||n[91]!==Le?(Pe=(0,C.jsx)(P,{title:Be,hint:ve,accessibilityLabel:Le,draft:Z,onChangeDraft:xe,onCommit:_e}),n[87]=_e,n[88]=Z,n[89]=Be,n[90]=ve,n[91]=Le,n[92]=Pe):Pe=n[92];n[93]!==c?(Re=c("settings.appearance.fonts.codeFont"),n[93]=c,n[94]=Re):Re=n[94];n[95]!==c?(Ze=c("settings.appearance.fonts.codeFontHint"),n[95]=c,n[96]=Ze):Ze=n[96];n[97]!==c?(ke=c("settings.appearance.fonts.codeFontAccessibility"),n[97]=c,n[98]=ke):ke=n[98];n[99]!==he||n[100]!==D||n[101]!==M||n[102]!==u.monoFontFamily||n[103]!==Re||n[104]!==Ze||n[105]!==ke?(Ue=(0,C.jsx)(L,{title:Re,hint:Ze,accessibilityLabel:ke,placeholder:M,value:u.monoFontFamily,draft:D,withBorder:!0,onChangeDraft:H,onCommit:he}),n[99]=he,n[100]=D,n[101]=M,n[102]=u.monoFontFamily,n[103]=Re,n[104]=Ze,n[105]=ke,n[106]=Ue):Ue=n[106];n[107]!==c?(Xe=c("settings.appearance.fonts.codeSize"),n[107]=c,n[108]=Xe):Xe=n[108];n[109]!==c?(Ge=c("settings.appearance.fonts.codeSizeHint"),n[109]=c,n[110]=Ge):Ge=n[110];n[111]!==c?(Ke=c("settings.appearance.fonts.codeSizeAccessibility"),n[111]=c,n[112]=Ke):Ke=n[112];n[113]!==G||n[114]!==Te||n[115]!==Xe||n[116]!==Ge||n[117]!==Ke?(Ye=(0,C.jsx)(P,{title:Xe,hint:Ge,accessibilityLabel:Ke,draft:G,onChangeDraft:Se,onCommit:Te}),n[113]=G,n[114]=Te,n[115]=Xe,n[116]=Ge,n[117]=Ke,n[118]=Ye):Ye=n[118];n[119]!==Ve||n[120]!==We||n[121]!==Pe||n[122]!==Ue||n[123]!==Ye?($e=(0,C.jsxs)(t.View,{style:_.settingsStyles.card,children:[Ve,We,Pe,Ue,Ye]}),n[119]=Ve,n[120]=We,n[121]=Pe,n[122]=Ue,n[123]=Ye,n[124]=$e):$e=n[124];n[125]!==Oe||n[126]!==$e?(qe=(0,C.jsx)(y.SettingsSection,{title:Oe,children:$e}),n[125]=Oe,n[126]=$e,n[127]=qe):qe=n[127];n[128]!==c?(Je=c("settings.appearance.layout.title"),n[128]=c,n[129]=Je):Je=n[129];n[130]!==le||n[131]!==u.contentMaxWidth?(Qe=(0,C.jsx)(t.View,{style:_.settingsStyles.card,children:(0,C.jsx)(R,{value:u.contentMaxWidth,onChange:le})}),n[130]=le,n[131]=u.contentMaxWidth,n[132]=Qe):Qe=n[132];n[133]!==Je||n[134]!==Qe?(et=(0,C.jsx)(y.SettingsSection,{title:Je,children:Qe}),n[133]=Je,n[134]=Qe,n[135]=et):et=n[135];n[136]!==c?(tt=c("settings.appearance.syntax.title"),n[136]=c,n[137]=tt):tt=n[137];n[138]!==ae||n[139]!==u.syntaxTheme?(nt=(0,C.jsx)(t.View,{style:_.settingsStyles.card,children:(0,C.jsx)(U,{value:u.syntaxTheme,onChange:ae})}),n[138]=ae,n[139]=u.syntaxTheme,n[140]=nt):nt=n[140];n[141]!==Ee?(it=(0,C.jsx)(t.View,{style:X.preview,children:(0,C.jsx)(j.AppearancePreview,{overrides:Ee})}),n[141]=Ee,n[142]=it):it=n[142];n[143]!==tt||n[144]!==nt||n[145]!==it?(ot=(0,C.jsxs)(y.SettingsSection,{title:tt,children:[nt,it]}),n[143]=tt,n[144]=nt,n[145]=it,n[146]=ot):ot=n[146];n[147]!==Ne||n[148]!==qe||n[149]!==et||n[150]!==ot?(st=(0,C.jsxs)(t.View,{children:[Ne,qe,et,ot]}),n[147]=Ne,n[148]=qe,n[149]=et,n[150]=ot,n[151]=st):st=n[151];return st};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]);r(d[5]),r(d[6]);var c=r(d[7]),u=r(d[8]),h=r(d[9]),p=r(d[10]),S=r(d[11]),y=r(d[12]),x=r(d[13]),f=r(d[14]),F=r(d[15]),b=r(d[16]),T=r(d[17]),w=r(d[18]),_=r(d[19]),j=r(d[20]),C=r(d[21]);const z=(0,c.withUnistyles)(u.Sun),E=(0,c.withUnistyles)(u.Moon),I=(0,c.withUnistyles)(u.Monitor),M=t=>({color:t.colors.foregroundMuted});function N(t,n){return t(`settings.appearance.theme.options.${n}`)}const O=new Set(["normal","monospace"]);function V(t,n){return O.has(n)?t("settings.appearance.fonts.systemDefault"):n}function A(t){if(0===t.length)return;const n=Number.parseInt(t,10);return Number.isFinite(n)?n:void 0}function D(t){const n=(0,o.c)(5),{themeValue:s}=t;switch(s){case"light":{let t;return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,C.jsx)(z,{size:T.ICON_SIZE.md,uniProps:M}),n[0]=t):t=n[0],t}case"dark":{let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,C.jsx)(E,{size:T.ICON_SIZE.md,uniProps:M}),n[1]=t):t=n[1],t}case"auto":{let t;return n[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,C.jsx)(I,{size:T.ICON_SIZE.md,uniProps:M}),n[2]=t):t=n[2],t}default:{const t=T.THEME_SWATCHES[s];let o;return n[3]!==t?(o=(0,C.jsx)(H,{color:t}),n[3]=t,n[4]=o):o=n[4],o}}}function H(n){const s=(0,o.c)(4),{color:l}=n;let c;s[0]!==l?(c=[X.swatch,{backgroundColor:l}],s[0]=l,s[1]=c):c=s[1];const u=c;let h;return s[2]!==u?(h=(0,C.jsx)(t.View,{style:u}),s[2]=u,s[3]=h):h=s[3],h}function W(t){const n=(0,o.c)(13),{themeValue:s,selected:c,onChange:u}=t,{t:h}=(0,l.useTranslation)();let S;n[0]!==u||n[1]!==s?(S=()=>{u(s)},n[0]=u,n[1]=s,n[2]=S):S=n[2];const y=S;let x;n[3]!==s?(x=(0,C.jsx)(D,{themeValue:s}),n[3]=s,n[4]=x):x=n[4];const f=x;let F,b;return n[5]!==h||n[6]!==s?(F=N(h,s),n[5]=h,n[6]=s,n[7]=F):F=n[7],n[8]!==y||n[9]!==f||n[10]!==c||n[11]!==F?(b=(0,C.jsx)(p.DropdownMenuItem,{selected:c,onSelect:y,leading:f,children:F}),n[8]=y,n[9]=f,n[10]=c,n[11]=F,n[12]=b):b=n[12],b}function B(t){const n=(0,o.c)(10),{option:s,selected:l,onSelect:c}=t;let u;n[0]!==c||n[1]!==s?(u=()=>{c(s)},n[0]=c,n[1]=s,n[2]=u):u=n[2];const h=u;let S;n[3]!==s.swatch?(S=(0,C.jsx)(H,{color:s.swatch}),n[3]=s.swatch,n[4]=S):S=n[4];const y=S;let x;return n[5]!==h||n[6]!==y||n[7]!==s.name||n[8]!==l?(x=(0,C.jsx)(p.DropdownMenuItem,{selected:l,onSelect:h,leading:y,children:s.name}),n[5]=h,n[6]=y,n[7]=s.name,n[8]=l,n[9]=x):x=n[9],x}function v(c){const u=(0,o.c)(49),{value:h,pluginThemes:y,selectedPluginTheme:x,onChange:f,onSelectPluginTheme:F}=c,{t:w}=(0,l.useTranslation)(),j=h===T.PLUGIN_THEME_PREFERENCE?b.DEFAULT_THEME_PREFERENCE:h;let z,E,I,M,O,V,A,v,L,P,R,Z,k,U,X;if(u[0]!==j||u[1]!==x||u[2]!==w){let o,s;O=x?x.name:N(w,j),u[11]!==j||u[12]!==x?(o=x?(0,C.jsx)(H,{color:x.swatch}):(0,C.jsx)(D,{themeValue:j}),u[11]=j,u[12]=x,u[13]=o):o=u[13],M=o,I=t.View,A=_.settingsStyles.row,u[14]!==w?(s=w("settings.appearance.theme.title"),u[14]=w,u[15]=s):s=u[15],u[16]!==s?(v=(0,C.jsx)(t.View,{style:_.settingsStyles.rowContent,children:(0,C.jsx)(n.Text,{style:_.settingsStyles.rowTitle,children:s})}),u[16]=s,u[17]=v):v=u[17],E=p.DropdownMenu,z=S.DropdownTrigger,V=w("settings.appearance.theme.accessibilityLabel",{value:O}),u[0]=j,u[1]=x,u[2]=w,u[3]=z,u[4]=E,u[5]=I,u[6]=M,u[7]=O,u[8]=V,u[9]=A,u[10]=v}else z=u[3],E=u[4],I=u[5],M=u[6],O=u[7],V=u[8],A=u[9],v=u[10];if(u[18]!==z||u[19]!==M||u[20]!==O||u[21]!==V?(L=(0,C.jsx)(z,{accessibilityLabel:V,leading:M,children:O}),u[18]=z,u[19]=M,u[20]=O,u[21]=V,u[22]=L):L=u[22],u[23]!==j||u[24]!==f||u[25]!==x?(P=T.THEME_OPTIONS.map((t,n)=>{const o=T.THEME_OPTIONS[n-1];return(0,C.jsxs)(s.Fragment,{children:[o&&o.group!==t.group?(0,C.jsx)(p.DropdownMenuSeparator,{}):null,(0,C.jsx)(W,{themeValue:t.name,selected:null===x&&j===t.name,onChange:f})]},t.name)}),u[23]=j,u[24]=f,u[25]=x,u[26]=P):P=u[26],u[27]!==y.length?(R=y.length>0?(0,C.jsx)(p.DropdownMenuSeparator,{}):null,u[27]=y.length,u[28]=R):R=u[28],u[29]!==F||u[30]!==y||u[31]!==x?.id){let t;u[33]!==F||u[34]!==x?.id?(t=t=>(0,C.jsx)(B,{option:t,selected:x?.id===t.id,onSelect:F},t.id),u[33]=F,u[34]=x?.id,u[35]=t):t=u[35],Z=y.map(t),u[29]=F,u[30]=y,u[31]=x?.id,u[32]=Z}else Z=u[32];return u[36]!==P||u[37]!==R||u[38]!==Z?(k=(0,C.jsxs)(p.DropdownMenuContent,{side:"bottom",align:"end",width:200,scrollable:!0,children:[P,R,Z]}),u[36]=P,u[37]=R,u[38]=Z,u[39]=k):k=u[39],u[40]!==E||u[41]!==L||u[42]!==k?(U=(0,C.jsxs)(E,{children:[L,k]}),u[40]=E,u[41]=L,u[42]=k,u[43]=U):U=u[43],u[44]!==I||u[45]!==A||u[46]!==v||u[47]!==U?(X=(0,C.jsxs)(I,{style:A,children:[v,U]}),u[44]=I,u[45]=A,u[46]=v,u[47]=U,u[48]=X):X=u[48],X}function L({title:o,hint:l,accessibilityLabel:c,placeholder:u,value:h,draft:p,withBorder:S,onChangeDraft:y,onCommit:x}){const f=(0,s.useCallback)(()=>{x(p)},[p,x]);return(0,s.useEffect)(()=>{y(h)},[h]),(0,C.jsxs)(t.View,{style:S?X.rowWithBorder:_.settingsStyles.row,children:[(0,C.jsxs)(t.View,{style:_.settingsStyles.rowContent,children:[(0,C.jsx)(n.Text,{style:_.settingsStyles.rowTitle,children:o}),(0,C.jsx)(n.Text,{style:_.settingsStyles.rowHint,children:l})]}),(0,C.jsx)(F.EditingTextInput,{initialValue:p,onChangeText:y,onBlur:f,onSubmitEditing:f,placeholder:u,placeholderTextColor:X.placeholderColor.color,autoCapitalize:"none",autoCorrect:!1,spellCheck:!1,style:X.fontFamilyInput,accessibilityLabel:c})]})}function P(s){const l=(0,o.c)(19),{title:c,hint:u,accessibilityLabel:h,draft:p,withBorder:S,onChangeDraft:y,onCommit:x}=s,f=void 0===S||S?X.rowWithBorder:_.settingsStyles.row;let b,T,w,j,z,E,I;return l[0]!==c?(b=(0,C.jsx)(n.Text,{style:_.settingsStyles.rowTitle,children:c}),l[0]=c,l[1]=b):b=l[1],l[2]!==u?(T=(0,C.jsx)(n.Text,{style:_.settingsStyles.rowHint,children:u}),l[2]=u,l[3]=T):T=l[3],l[4]!==b||l[5]!==T?(w=(0,C.jsxs)(t.View,{style:_.settingsStyles.rowContent,children:[b,T]}),l[4]=b,l[5]=T,l[6]=w):w=l[6],l[7]!==h||l[8]!==p||l[9]!==y||l[10]!==x?(j=(0,C.jsx)(F.EditingTextInput,{initialValue:p,onChangeText:y,onBlur:x,onSubmitEditing:x,keyboardType:"number-pad",inputMode:"numeric",selectTextOnFocus:!0,style:X.sizeInput,accessibilityLabel:h}),l[7]=h,l[8]=p,l[9]=y,l[10]=x,l[11]=j):j=l[11],l[12]===Symbol.for("react.memo_cache_sentinel")?(z=(0,C.jsx)(n.Text,{style:X.unit,children:"px"}),l[12]=z):z=l[12],l[13]!==j?(E=(0,C.jsxs)(t.View,{style:X.sizeField,children:[j,z]}),l[13]=j,l[14]=E):E=l[14],l[15]!==f||l[16]!==w||l[17]!==E?(I=(0,C.jsxs)(t.View,{style:f,children:[w,E]}),l[15]=f,l[16]=w,l[17]=E,l[18]=I):I=l[18],I}function R(c){const u=(0,o.c)(38),{value:h,onChange:p}=c,{t:S}=(0,l.useTranslation)();let y;u[0]!==h?(y=(0,b.resolveContentMaxWidth)({contentMaxWidth:h}),u[0]=h,u[1]=y):y=u[1];const x=y,T=(0,s.useRef)(null);let w,j,z;u[2]!==x?(w=()=>{T.current?.replaceText(String(x))},j=[x],u[2]=x,u[3]=w,u[4]=j):(w=u[3],j=u[4]),(0,s.useEffect)(w,j),u[5]!==p||u[6]!==x?(z=()=>{const t=(0,b.parseContentMaxWidth)(T.current?.getText())??x;T.current?.replaceText(String(t)),t!==x&&p(t)},u[5]=p,u[6]=x,u[7]=z):z=u[7];const E=z;let I;u[8]!==p?(I=()=>{p(null)},u[8]=p,u[9]=I):I=u[9];const M=I;let N,O,V,A,D,H;u[10]!==S?(N=S("settings.appearance.layout.contentWidth"),u[10]=S,u[11]=N):N=u[11],u[12]!==N?(O=(0,C.jsx)(n.Text,{style:_.settingsStyles.rowTitle,children:N}),u[12]=N,u[13]=O):O=u[13],u[14]!==S?(V=S("settings.appearance.layout.contentWidthHint"),u[14]=S,u[15]=V):V=u[15],u[16]!==V?(A=(0,C.jsx)(n.Text,{style:_.settingsStyles.rowHint,children:V}),u[16]=V,u[17]=A):A=u[17],u[18]!==O||u[19]!==A?(D=(0,C.jsxs)(t.View,{style:_.settingsStyles.rowContent,children:[O,A]}),u[18]=O,u[19]=A,u[20]=D):D=u[20],u[21]!==M||u[22]!==S||u[23]!==h?(H=null===h?null:(0,C.jsx)(f.Button,{variant:"ghost",size:"sm",onPress:M,accessibilityLabel:S("settings.appearance.layout.resetAccessibility"),children:S("settings.appearance.layout.reset")}),u[21]=M,u[22]=S,u[23]=h,u[24]=H):H=u[24];const W=String(x);let B,v,L,P,R;return u[25]!==S?(B=S("settings.appearance.layout.contentWidthAccessibility"),u[25]=S,u[26]=B):B=u[26],u[27]!==E||u[28]!==W||u[29]!==B?(v=(0,C.jsx)(F.EditingTextInput,{ref:T,initialValue:W,onBlur:E,onSubmitEditing:E,keyboardType:"number-pad",inputMode:"numeric",selectTextOnFocus:!0,style:X.widthInput,accessibilityLabel:B}),u[27]=E,u[28]=W,u[29]=B,u[30]=v):v=u[30],u[31]===Symbol.for("react.memo_cache_sentinel")?(L=(0,C.jsx)(n.Text,{style:X.unit,children:"px"}),u[31]=L):L=u[31],u[32]!==H||u[33]!==v?(P=(0,C.jsxs)(t.View,{style:X.sizeField,children:[H,v,L]}),u[32]=H,u[33]=v,u[34]=P):P=u[34],u[35]!==D||u[36]!==P?(R=(0,C.jsxs)(t.View,{style:_.settingsStyles.row,children:[D,P]}),u[35]=D,u[36]=P,u[37]=R):R=u[37],R}function Z(t){const n=h.SYNTAX_THEME_OPTIONS.find(n=>n.id===t);return n?n.label:t}function k(t){const n=(0,o.c)(7),{option:s,selected:l,onChange:c}=t;let u;n[0]!==c||n[1]!==s.id?(u=()=>{c(s.id)},n[0]=c,n[1]=s.id,n[2]=u):u=n[2];const h=u;let S;return n[3]!==h||n[4]!==s.label||n[5]!==l?(S=(0,C.jsx)(p.DropdownMenuItem,{selected:l,onSelect:h,children:s.label}),n[3]=h,n[4]=s.label,n[5]=l,n[6]=S):S=n[6],S}function U(s){const c=(0,o.c)(38),{value:u,onChange:y}=s,{t:x}=(0,l.useTranslation)();let f,F,b,T,w,j,z,E,I,M,N,O;if(c[0]!==x||c[1]!==u){let o,s,l,h;T=Z(u),b=t.View,j=_.settingsStyles.row,c[9]!==x?(o=x("settings.appearance.syntax.highlightTheme"),c[9]=x,c[10]=o):o=c[10],c[11]!==o?(s=(0,C.jsx)(n.Text,{style:_.settingsStyles.rowTitle,children:o}),c[11]=o,c[12]=s):s=c[12],c[13]!==x?(l=x("settings.appearance.syntax.highlightThemeHint"),c[13]=x,c[14]=l):l=c[14],c[15]!==l?(h=(0,C.jsx)(n.Text,{style:_.settingsStyles.rowHint,children:l}),c[15]=l,c[16]=h):h=c[16],c[17]!==s||c[18]!==h?(z=(0,C.jsxs)(t.View,{style:_.settingsStyles.rowContent,children:[s,h]}),c[17]=s,c[18]=h,c[19]=z):z=c[19],F=p.DropdownMenu,f=S.DropdownTrigger,w=x("settings.appearance.syntax.highlightThemeAccessibility",{value:T}),c[0]=x,c[1]=u,c[2]=f,c[3]=F,c[4]=b,c[5]=T,c[6]=w,c[7]=j,c[8]=z}else f=c[2],F=c[3],b=c[4],T=c[5],w=c[6],j=c[7],z=c[8];return c[20]!==f||c[21]!==T||c[22]!==w?(E=(0,C.jsx)(f,{accessibilityLabel:w,children:T}),c[20]=f,c[21]=T,c[22]=w,c[23]=E):E=c[23],c[24]!==y||c[25]!==u?(I=h.SYNTAX_THEME_OPTIONS.map(t=>(0,C.jsx)(k,{option:t,selected:u===t.id,onChange:y},t.id)),c[24]=y,c[25]=u,c[26]=I):I=c[26],c[27]!==I?(M=(0,C.jsx)(p.DropdownMenuContent,{side:"bottom",align:"end",width:200,children:I}),c[27]=I,c[28]=M):M=c[28],c[29]!==F||c[30]!==E||c[31]!==M?(N=(0,C.jsxs)(F,{children:[E,M]}),c[29]=F,c[30]=E,c[31]=M,c[32]=N):N=c[32],c[33]!==b||c[34]!==j||c[35]!==z||c[36]!==N?(O=(0,C.jsxs)(b,{style:j,children:[z,N]}),c[33]=b,c[34]=j,c[35]=z,c[36]=N,c[37]=O):O=c[37],O}const X=c.StyleSheet.create(t=>({preview:{marginTop:t.spacing[4],uni__dependencies:[0]},rowWithBorder:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:t.spacing[4],paddingHorizontal:t.spacing[4],borderTopWidth:t.borderWidth[1],borderTopColor:t.colors.border,uni__dependencies:[0]},swatch:{width:T.ICON_SIZE.md,height:T.ICON_SIZE.md,borderRadius:T.ICON_SIZE.md/2,borderWidth:t.borderWidth[1],borderColor:t.colors.border,uni__dependencies:[0]},fontFamilyInput:{flexGrow:1,flexShrink:1,maxWidth:280,minHeight:36,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:t.borderWidth[1],borderColor:t.colors.border,backgroundColor:t.colors.surface2,color:t.colors.foreground,fontSize:t.fontSize.base,textAlign:"left",uni__dependencies:[0]},sizeField:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],uni__dependencies:[0]},sizeInput:{width:64,minHeight:36,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:t.borderWidth[1],borderColor:t.colors.border,backgroundColor:t.colors.surface2,color:t.colors.foreground,fontSize:t.fontSize.base,textAlign:"right",uni__dependencies:[0]},widthInput:{width:80,minHeight:36,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:t.borderWidth[1],borderColor:t.colors.border,backgroundColor:t.colors.surface2,color:t.colors.foreground,fontSize:t.fontSize.base,textAlign:"right",uni__dependencies:[0]},unit:{color:t.colors.foregroundMuted,fontSize:t.fontSize.base,uni__dependencies:[0]},placeholderColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]}}))},5117,[896,897,454,37,854,235,147,57,1218,307,3702,3721,3725,3453,3022,3700,884,306,881,3722,5118,280]);
|