@openchamber/web 1.13.1 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/assets/{DiagramView-la2P5DUr.js → DiagramView-l49NCoWI.js} +1 -1
  2. package/dist/assets/MarkdownRendererImpl-BspFAgXe.js +7 -0
  3. package/dist/assets/{MultiRunWindow-B9NPliTC.js → MultiRunWindow-BP1L8slG.js} +1 -1
  4. package/dist/assets/{NewWorktreeDialog-BnK_0_OO.js → NewWorktreeDialog-B2o615D_.js} +1 -1
  5. package/dist/assets/OnboardingScreen-DNQQWFmn.js +1 -0
  6. package/dist/assets/{SessionSwitcherDropdown-CuRsG7FM.js → SessionSwitcherDropdown-Bz03hrU9.js} +1 -1
  7. package/dist/assets/{SettingsWindow-Cs3xbqtf.js → SettingsWindow-L-jJDG3k.js} +1 -1
  8. package/dist/assets/{TerminalView-CLKpaKdm.js → TerminalView-CZYwjWYc.js} +1 -1
  9. package/dist/assets/index-Di3CDurc.css +1 -0
  10. package/dist/assets/index-DkRLSXEX.js +3 -0
  11. package/dist/assets/{main-B2rXVG8L.js → main-DmS7A2g8.js} +2 -2
  12. package/dist/assets/main-gqEqIL1b.js +214 -0
  13. package/dist/assets/miniChat-DZORfsku.js +2 -0
  14. package/dist/assets/mobile-DkitItmP.js +2 -0
  15. package/dist/assets/{renderElectronMiniChatApp-BLM-RCP0.js → renderElectronMiniChatApp-S7GCIhbH.js} +2 -2
  16. package/dist/assets/{renderMobileApp-BXScr4up.js → renderMobileApp-CxEnmaQL.js} +3 -3
  17. package/dist/assets/{useAppFontEffects-ByW8wOJM.js → useAppFontEffects-DkrfZHQv.js} +114 -114
  18. package/dist/assets/vendor--Dwc_TRgJ.css +1 -0
  19. package/dist/assets/{vendor-.bun-d5B0wgQr.js → vendor-.bun-CIlawBoH.js} +1 -1
  20. package/dist/index.html +5 -5
  21. package/dist/mini-chat.html +5 -5
  22. package/dist/mobile.html +5 -5
  23. package/package.json +1 -1
  24. package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  25. package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  26. package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  27. package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  28. package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  29. package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  30. package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  31. package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  32. package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  33. package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  34. package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  35. package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  36. package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  37. package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  38. package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  39. package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  40. package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  41. package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  42. package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  43. package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  44. package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  45. package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  46. package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  47. package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  48. package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  49. package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  50. package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  51. package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  52. package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  53. package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  54. package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  55. package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  56. package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  57. package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  58. package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  59. package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  60. package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  61. package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  62. package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  63. package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  64. package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  65. package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  66. package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  67. package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  68. package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  69. package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  70. package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  71. package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  72. package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  73. package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  74. package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  75. package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  76. package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  77. package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  78. package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  79. package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  80. package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  81. package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  82. package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  83. package/dist/assets/MarkdownRendererImpl-CkGSBGo5.js +0 -8
  84. package/dist/assets/OnboardingScreen-laLzQZgy.js +0 -1
  85. package/dist/assets/index-68ujKCUc.js +0 -3
  86. package/dist/assets/index-C-aQ_xRH.css +0 -1
  87. package/dist/assets/main-CuEzPtRt.js +0 -214
  88. package/dist/assets/miniChat-DVXSR0vu.js +0 -2
  89. package/dist/assets/mobile-BgYrNCOf.js +0 -2
  90. package/dist/assets/vendor--V65Sl9C2.css +0 -1
@@ -0,0 +1 @@
1
+ @font-face{font-family:IBM Plex Sans;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2) format("woff2"),url(/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff) format("woff")}@font-face{font-family:IBM Plex Sans;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2) format("woff2"),url(/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff) format("woff")}@font-face{font-family:IBM Plex Sans;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2) format("woff2"),url(/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff) format("woff")}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2) format("woff2"),url(/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff) format("woff")}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2) format("woff2"),url(/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff) format("woff")}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2) format("woff2"),url(/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff) format("woff")}
@@ -2896,4 +2896,4 @@ Example:
2896
2896
  For tests, pass a Ghostty instance directly:
2897
2897
  import { Ghostty, Terminal } from "ghostty-web";
2898
2898
  const ghostty = await Ghostty.load();
2899
- const term = new Terminal({ ghostty });`)}const e={},__viteBrowserExternal2447137e=Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"}));export{DrawIoEmbed as $,f1 as A,BC as B,CSS$1 as C,DndContext as D,d1 as E,File$1 as F,clientExports as G,reactExports as H,arrayMove as I,Je$2 as J,K1 as K,useShallow as L,Me$2 as M,processFile as N,trimPatchContext as O,P7 as P,Qi as Q,React as R,SortableContext as S,parsePatchFiles as T,Um as U,V2 as V,parseDiffFromFile as W,EditorView as X,EditorSelection as Y,Zs as Z,__vitePreload as _,create$2 as a,areFilesEqual as a$,getFontEmbedCSS as a0,toJpeg as a1,N$2 as a2,distExports as a3,useDraggable as a4,useDroppable as a5,DragOverlay as a6,ee$2 as a7,MenuPortal as a8,MenuPositioner as a9,history as aA,indentUnit as aB,keymap as aC,indentWithTab as aD,defaultKeymap as aE,historyKeymap as aF,searchPanelOpen as aG,getSearchQuery as aH,search as aI,ViewPlugin as aJ,RangeSetBuilder as aK,Decoration as aL,StateField as aM,searchKeymap as aN,forceParsing as aO,openSearchPanel as aP,closeSearchPanel as aQ,WidgetType as aR,HighlightStyle as aS,tags$1 as aT,syntaxHighlighting as aU,defaultHighlightStyle as aV,classHighlighter as aW,StateEffect as aX,stringify as aY,parse$1 as aZ,QRCode as a_,MenuPopup as aa,ContextMenuRoot as ab,ContextMenuTrigger as ac,MenuItem as ad,Separator as ae,MenuSubmenuRoot as af,MenuSubmenuTrigger as ag,useMotionValue as ah,animate as ai,motion as aj,WorkerUrl as ak,WorkerPoolManager as al,SwitchThumb as am,SwitchRoot as an,CollapsibleTrigger as ao,CollapsibleRoot as ap,CollapsiblePanel as aq,horizontalListSortingStrategy as ar,vim as as,showPanel as at,drawSelection as au,getCM as av,EditorState as aw,gutters as ax,Compartment as ay,lineNumbers as az,createJSONStorage as b,python$4 as b$,areOptionsEqual as b0,VirtualizedFileDiff as b1,FileDiff as b2,Virtualizer as b3,Toaster as b4,toast as b5,useStore$1 as b6,Fuse as b7,twMerge as b8,clsx as b9,MenuRadioItem as bA,MenuRadioItemIndicator as bB,MenuRadioGroup as bC,PatchDiff as bD,SelectRoot as bE,SelectTrigger as bF,SelectValue as bG,SelectPopup as bH,SelectItem as bI,SelectGroup as bJ,SelectGroupLabel as bK,SelectIcon as bL,SelectPositioner as bM,SelectPortal as bN,SelectItemIndicator as bO,SelectItemText as bP,_e$3 as bQ,MeasuringStrategy as bR,TouchSensor as bS,MouseSensor as bT,rectSortingStrategy as bU,StreamLanguage as bV,shell as bW,LanguageDescription as bX,languages as bY,html$4 as bZ,markdown$2 as b_,cva as ba,CheckboxIndicator as bb,CheckboxRoot as bc,DialogRoot as bd,DialogClose$1 as be,DialogPopup as bf,DialogTitle$1 as bg,DialogPortal$1 as bh,DialogDescription$1 as bi,DialogBackdrop as bj,DialogTrigger$1 as bk,TooltipProvider as bl,TooltipRoot as bm,TooltipTrigger as bn,TooltipPopup as bo,TooltipArrow as bp,TooltipPortal as bq,TooltipPositioner as br,startRegistration as bs,WebAuthnAbortService as bt,WebAuthnError as bu,startAuthentication as bv,browserSupportsWebAuthn as bw,registerCustomTheme as bx,MenuRoot as by,MenuTrigger as bz,createOpencodeClient as c,css$4 as c0,javascript$4 as c1,json$3 as c2,tagHighlighter as c3,highlightTree as c4,Language as c5,PopoverTrigger as c6,PopoverPositioner as c7,PopoverPopup as c8,PopoverPortal as c9,PopoverRoot as ca,toPng as cb,g$1 as cc,katex as cd,pr as ce,purify as cf,renderMermaidASCII as cg,renderMermaidSVG as ch,morphdom as ci,IA as cj,DA as ck,q as cl,workboxWindow_prod_es5 as cm,index$m as cn,transformers as co,devtools as d,compilerRuntimeExports as e,dZ as f,pv as g,heic2any$1 as h,B7 as i,jsxRuntimeExports as j,reactDomExports as k,useSensor as l,KeyboardSensor as m,PointerSensor as n,ky as o,persist as p,closestCenter as q,r2 as r,sortableKeyboardCoordinates as s,s7 as t,useSensors as u,verticalListSortingStrategy as v,useSortable as w,M6 as x,p$1 as y,_i$1 as z};
2899
+ const term = new Terminal({ ghostty });`)}const e={},__viteBrowserExternal2447137e=Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"}));export{DrawIoEmbed as $,f1 as A,BC as B,CSS$1 as C,DndContext as D,d1 as E,File$1 as F,clientExports as G,reactExports as H,arrayMove as I,Je$2 as J,K1 as K,useShallow as L,Me$2 as M,processFile as N,trimPatchContext as O,P7 as P,Qi as Q,React as R,SortableContext as S,parsePatchFiles as T,Um as U,V2 as V,parseDiffFromFile as W,EditorView as X,EditorSelection as Y,Zs as Z,__vitePreload as _,create$2 as a,areFilesEqual as a$,getFontEmbedCSS as a0,toJpeg as a1,N$2 as a2,distExports as a3,useDroppable as a4,useDraggable as a5,DragOverlay as a6,ee$2 as a7,MenuPortal as a8,MenuPositioner as a9,history as aA,indentUnit as aB,keymap as aC,indentWithTab as aD,defaultKeymap as aE,historyKeymap as aF,searchPanelOpen as aG,getSearchQuery as aH,search as aI,ViewPlugin as aJ,RangeSetBuilder as aK,Decoration as aL,StateField as aM,searchKeymap as aN,forceParsing as aO,openSearchPanel as aP,closeSearchPanel as aQ,WidgetType as aR,HighlightStyle as aS,tags$1 as aT,syntaxHighlighting as aU,defaultHighlightStyle as aV,classHighlighter as aW,StateEffect as aX,stringify as aY,parse$1 as aZ,QRCode as a_,MenuPopup as aa,ContextMenuRoot as ab,ContextMenuTrigger as ac,MenuItem as ad,Separator as ae,MenuSubmenuRoot as af,MenuSubmenuTrigger as ag,useMotionValue as ah,animate as ai,motion as aj,WorkerUrl as ak,WorkerPoolManager as al,SwitchThumb as am,SwitchRoot as an,CollapsibleTrigger as ao,CollapsibleRoot as ap,CollapsiblePanel as aq,horizontalListSortingStrategy as ar,vim as as,showPanel as at,drawSelection as au,getCM as av,EditorState as aw,gutters as ax,Compartment as ay,lineNumbers as az,createJSONStorage as b,python$4 as b$,areOptionsEqual as b0,VirtualizedFileDiff as b1,FileDiff as b2,Virtualizer as b3,Toaster as b4,toast as b5,useStore$1 as b6,Fuse as b7,twMerge as b8,clsx as b9,MenuRadioItem as bA,MenuRadioItemIndicator as bB,MenuRadioGroup as bC,PatchDiff as bD,SelectRoot as bE,SelectTrigger as bF,SelectValue as bG,SelectPopup as bH,SelectItem as bI,SelectGroup as bJ,SelectGroupLabel as bK,SelectIcon as bL,SelectPositioner as bM,SelectPortal as bN,SelectItemIndicator as bO,SelectItemText as bP,_e$3 as bQ,MeasuringStrategy as bR,TouchSensor as bS,MouseSensor as bT,rectSortingStrategy as bU,StreamLanguage as bV,shell as bW,LanguageDescription as bX,languages as bY,html$4 as bZ,markdown$2 as b_,cva as ba,CheckboxIndicator as bb,CheckboxRoot as bc,DialogRoot as bd,DialogClose$1 as be,DialogPopup as bf,DialogTitle$1 as bg,DialogPortal$1 as bh,DialogDescription$1 as bi,DialogBackdrop as bj,DialogTrigger$1 as bk,TooltipProvider as bl,TooltipRoot as bm,TooltipTrigger as bn,TooltipPopup as bo,TooltipArrow as bp,TooltipPortal as bq,TooltipPositioner as br,startRegistration as bs,WebAuthnAbortService as bt,WebAuthnError as bu,startAuthentication as bv,browserSupportsWebAuthn as bw,registerCustomTheme as bx,MenuRoot as by,MenuTrigger as bz,createOpencodeClient as c,css$4 as c0,javascript$4 as c1,json$3 as c2,tagHighlighter as c3,highlightTree as c4,Language as c5,PopoverTrigger as c6,PopoverPositioner as c7,PopoverPopup as c8,PopoverPortal as c9,PopoverRoot as ca,toPng as cb,g$1 as cc,katex as cd,purify as ce,pr as cf,renderMermaidASCII as cg,renderMermaidSVG as ch,morphdom as ci,IA as cj,DA as ck,q as cl,workboxWindow_prod_es5 as cm,index$m as cn,transformers as co,devtools as d,compilerRuntimeExports as e,dZ as f,pv as g,heic2any$1 as h,B7 as i,jsxRuntimeExports as j,reactDomExports as k,useSensor as l,KeyboardSensor as m,PointerSensor as n,ky as o,persist as p,closestCenter as q,r2 as r,sortableKeyboardCoordinates as s,s7 as t,useSensors as u,verticalListSortingStrategy as v,useSortable as w,M6 as x,p$1 as y,_i$1 as z};
package/dist/index.html CHANGED
@@ -515,12 +515,12 @@
515
515
  pointer-events: none;
516
516
  }
517
517
  </style>
518
- <script type="module" crossorigin src="/assets/main-B2rXVG8L.js"></script>
519
- <link rel="modulepreload" crossorigin href="/assets/vendor-.bun-d5B0wgQr.js">
520
- <link rel="modulepreload" crossorigin href="/assets/index-68ujKCUc.js">
518
+ <script type="module" crossorigin src="/assets/main-DmS7A2g8.js"></script>
519
+ <link rel="modulepreload" crossorigin href="/assets/vendor-.bun-CIlawBoH.js">
520
+ <link rel="modulepreload" crossorigin href="/assets/index-DkRLSXEX.js">
521
521
  <link rel="modulepreload" crossorigin href="/assets/mobileLayoutPreference-Dio-WWkI.js">
522
- <link rel="stylesheet" crossorigin href="/assets/vendor--V65Sl9C2.css">
523
- <link rel="stylesheet" crossorigin href="/assets/index-C-aQ_xRH.css">
522
+ <link rel="stylesheet" crossorigin href="/assets/vendor--Dwc_TRgJ.css">
523
+ <link rel="stylesheet" crossorigin href="/assets/index-Di3CDurc.css">
524
524
  </head>
525
525
  <body class="h-full bg-background text-foreground">
526
526
  <div id="root" class="h-full">
@@ -74,11 +74,11 @@
74
74
  }
75
75
  </style>
76
76
 
77
- <script type="module" crossorigin src="/assets/miniChat-DVXSR0vu.js"></script>
78
- <link rel="modulepreload" crossorigin href="/assets/vendor-.bun-d5B0wgQr.js">
79
- <link rel="modulepreload" crossorigin href="/assets/index-68ujKCUc.js">
80
- <link rel="stylesheet" crossorigin href="/assets/vendor--V65Sl9C2.css">
81
- <link rel="stylesheet" crossorigin href="/assets/index-C-aQ_xRH.css">
77
+ <script type="module" crossorigin src="/assets/miniChat-DZORfsku.js"></script>
78
+ <link rel="modulepreload" crossorigin href="/assets/vendor-.bun-CIlawBoH.js">
79
+ <link rel="modulepreload" crossorigin href="/assets/index-DkRLSXEX.js">
80
+ <link rel="stylesheet" crossorigin href="/assets/vendor--Dwc_TRgJ.css">
81
+ <link rel="stylesheet" crossorigin href="/assets/index-Di3CDurc.css">
82
82
  </head>
83
83
  <body class="h-full bg-background text-foreground">
84
84
  <div id="root" class="h-full">
package/dist/mobile.html CHANGED
@@ -4,11 +4,11 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
6
6
  <title>OpenChamber Mobile</title>
7
- <script type="module" crossorigin src="/assets/mobile-BgYrNCOf.js"></script>
8
- <link rel="modulepreload" crossorigin href="/assets/vendor-.bun-d5B0wgQr.js">
9
- <link rel="modulepreload" crossorigin href="/assets/index-68ujKCUc.js">
10
- <link rel="stylesheet" crossorigin href="/assets/vendor--V65Sl9C2.css">
11
- <link rel="stylesheet" crossorigin href="/assets/index-C-aQ_xRH.css">
7
+ <script type="module" crossorigin src="/assets/mobile-DkitItmP.js"></script>
8
+ <link rel="modulepreload" crossorigin href="/assets/vendor-.bun-CIlawBoH.js">
9
+ <link rel="modulepreload" crossorigin href="/assets/index-DkRLSXEX.js">
10
+ <link rel="stylesheet" crossorigin href="/assets/vendor--Dwc_TRgJ.css">
11
+ <link rel="stylesheet" crossorigin href="/assets/index-Di3CDurc.css">
12
12
  </head>
13
13
  <body class="h-full bg-background text-foreground">
14
14
  <div id="root" class="h-full"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openchamber/web",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./server/index.js",
@@ -1,8 +0,0 @@
1
- import{cc as Ie,cd as $e,ce as rt,cf as re,R as x,e as B,cg as ot,ch as at,ci as st,j as X}from"./vendor-.bun-d5B0wgQr.js";import{eO as it,eP as ct,eQ as lt,eR as dt,eS as Pe,eT as ut,eU as mt,p as ce,cQ as ft,cR as pt,a as Oe,b as De,eV as Be,m as He,du as ht,r as ye,u as bt,eW as gt,eX as wt,av as yt,eY as ke,eZ as kt,e_ as Et,e$ as At,f0 as vt,c2 as Ct}from"./useAppFontEffects-ByW8wOJM.js";import{w as be,b as ge,h as St,j as xt,e as Nt}from"./index-68ujKCUc.js";const G=t=>t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Mt=t=>/^\[[^\]]+\]:\s+\S+/m.test(t)||/^\[\^[^\]]+\]:\s+/m.test(t),Tt=t=>{const e=t.match(/^[ \t]{0,3}(`{3,}|~{3,})/);if(!e)return!1;const n=e[1];if(!n)return!1;const r=n[0],a=n.length,o=t.trimEnd().split(`
2
- `).at(-1)?.trim()??"";return!new RegExp(`^[\\t ]{0,3}${r}{${a},}[\\t ]*$`).test(o)},Z=t=>{try{return rt(t,{linkMode:"text-only"})}catch{return t}},Lt=(t,e)=>{if(!e)return[{raw:t,src:t,mode:"full",highlight:!0}];if(Mt(t))return[{raw:t,src:Z(t),mode:"live",highlight:!0}];let n;try{n=Ie.lexer(t)}catch{return[{raw:t,src:Z(t),mode:"live",highlight:!0}]}let r=-1;for(let o=n.length-1;o>=0;o-=1)if(n[o]?.type!=="space"){r=o;break}if(r<0)return[{raw:t,src:Z(t),mode:"live",highlight:!0}];const a=[];for(let o=0;o<n.length;o+=1){const i=n[o];if(!i||i.type==="space")continue;const s=i.raw??"",c=o===r,l=i.type==="code"&&Tt(s);a.push({raw:s,src:l?s:Z(s),mode:c?"live":"full",highlight:!l})}return a.length===0?[{raw:t,src:Z(t),mode:"live",highlight:!0}]:a},qe=(t,e,n)=>{try{return $e.renderToString(t,{displayMode:n,throwOnError:!1})}catch{return e}},Rt={name:"inlineMath",level:"inline",start(t){const e=t.indexOf("\\(");return e<0?void 0:e},tokenizer(t){const e=/^\\\(([\s\S]+?)\\\)/.exec(t);if(e)return{type:"inlineMath",raw:e[0],text:e[1]??""}},renderer(t){const e=t;return qe(e.text,e.raw,!1)}},_t={name:"blockMath",level:"block",start(t){const e=t.indexOf("\\[");return e<0?void 0:e},tokenizer(t){const e=/^\\\[([\s\S]+?)\\\]/.exec(t);if(e)return{type:"blockMath",raw:e[0],text:e[1]??""}},renderer(t){const e=t;return qe(e.text,e.raw,!0)}},Ft=Ie.use({gfm:!0,breaks:!1,extensions:[Rt,_t],renderer:{link({href:t,title:e,text:n}){const r=t??"",a=it(r);if(a)return`<a href="${G(lt(a))}" data-openchamber-agent-mention="true" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">${n}</a>`;const o=ct(r);if(o)return`<a href="${G(r)}" data-skill-name="${G(o)}" class="text-primary hover:underline">${n}</a>`;const i=e?` title="${G(e)}"`:"";return`<a href="${G(r)}"${i} class="external-link" target="_blank" rel="noopener noreferrer">${n}</a>`}}}),It=t=>t.replace(/\$\$([\s\S]*?)\$\$/g,(e,n)=>{try{return $e.renderToString(n,{displayMode:!0,throwOnError:!1})}catch{return`$$${n}$$`}}),$t=t=>{if(t.indexOf("$")===-1)return t;const e=/(<(?:pre|code|kbd)[^>]*>[\s\S]*?<\/(?:pre|code|kbd)>)/gi;return t.split(e).map((n,r)=>r%2===1?n:It(n)).join("")},Pt=/<pre><code(?:\s+class="language-([^"]*)")?>([\s\S]*?)<\/code><\/pre>/g,Ot=1200,Dt=200,Bt=(t,e)=>{let n=1;for(let r=0;r<t.length;r+=1)if(t.charCodeAt(r)===10&&++n>e)return!0;return!1},Ht=t=>t.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&amp;/g,"&"),qt=async t=>{const e=[...t.matchAll(Pt)];if(e.length===0)return t;const n=be()?Dt:Ot;let r=t;for(const a of e){const[o,i,s]=a,c=(i||"text").toLowerCase();if(c==="mermaid")continue;const l=Ht(s??"");if(Bt(l,n)){r=r.replace(o,()=>o.replace("<pre",`<pre data-md-lang="${c}"`));continue}const d=await dt(l,c);if(d){const m=d.replace(/^<pre/,`<pre data-md-lang="${c}"`);r=r.replace(o,()=>m)}}return r},Wt={USE_PROFILES:{html:!0,mathMl:!0,svg:!0},ADD_TAGS:["svg","path","g","rect","line","polygon","polyline","circle","ellipse","text","tspan","defs","marker"],ADD_ATTR:["d","viewBox","preserveAspectRatio","xmlns","target","fill","stroke","stroke-width","transform","points","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","style"],FORBID_TAGS:["script"],FORBID_CONTENTS:["script"]};let Ee=!1;const jt=()=>{Ee||typeof window>"u"||!re.isSupported||(Ee=!0,re.addHook("afterSanitizeAttributes",t=>{t instanceof HTMLAnchorElement&&t.target==="_blank"&&t.setAttribute("rel","noopener noreferrer")}))},zt=t=>re.isSupported?(jt(),re.sanitize(t,Wt)):"",Kt=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),Vt=t=>Kt(t).replace(/\r\n?/g,`
3
- `).replace(/\n/g,"<br>"),Ut=240,K=new Map,Gt=t=>{let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(36)},Ae=(t,e)=>{if(K.delete(t),K.set(t,e),K.size<=Ut)return;const n=K.keys().next().value;n&&K.delete(n)},Zt=async t=>{const e=await Promise.resolve(Ft.parse(t.src)),n=$t(e),r=t.highlight?await qt(n):n;return zt(r)},Xt=async(t,e,n)=>{if(!t)return[];const r=Lt(t,e);return Promise.all(r.map(async(a,o)=>{const i=Gt(a.raw),s=`${i}:${a.mode}:${a.highlight?1:0}`,c=`${n}:${o}:${a.mode}`,l=K.get(c);if(l&&l.hash===i)return Ae(c,l),{id:s,html:l.html};const d=await Zt(a);return Ae(c,{hash:i,html:d}),{id:s,html:d}}))},le=t=>`<svg class="remixicon size-3.5" viewBox="0 0 24 24" aria-hidden="true"><use href="#oc-${t}"></use></svg>`,oe={copy:le("file-copy"),check:le("check"),download:le("download")},We="p-1 rounded hover:bg-interactive-hover/60 text-muted-foreground hover:text-foreground transition-colors",Y=(t,e)=>{t.innerHTML=e},U=(t,e,n)=>{const r=document.createElement("button");return r.type="button",r.className=We,r.setAttribute("data-md-action",n),r.setAttribute("title",e),r.setAttribute("aria-label",e),Y(r,oe[t]),r},ve=(t,e,n,r)=>{Y(t,oe.check),t.setAttribute("title",e),window.setTimeout(()=>{Y(t,oe[n]),t.setAttribute("title",r)},2e3)},Yt=t=>{const e=t.querySelectorAll(":not(pre) > code");for(const n of Array.from(e))n.getAttribute("data-markdown")!=="inline-code"&&n.setAttribute("data-markdown","inline-code")},Qt=(t,e)=>{const n=t.querySelectorAll("pre");for(const r of Array.from(n)){if(r.querySelector("code.language-mermaid"))continue;const a=r.parentElement;if(!a||a.closest('[data-component="markdown-code"]'))continue;const o=r.getAttribute("data-md-lang")??"text",i=document.createElement("div");i.setAttribute("data-component","markdown-code"),i.className="my-4 group overflow-hidden rounded-2xl border border-border/80 bg-[var(--surface-elevated)]";const s=document.createElement("div");s.className="flex items-center justify-between border-b border-border/70 px-3 py-1.5";const c=document.createElement("span");c.className="font-mono text-[13px] text-muted-foreground",c.textContent=o;const l=U("copy",e.copy,"copy-code");s.appendChild(c),s.appendChild(l);const d=document.createElement("div");d.className="px-3 py-2.5 overflow-x-auto",a.replaceChild(i,r),r.style.margin="0",r.style.background="transparent",d.appendChild(r),i.appendChild(s),i.appendChild(d)}},Ce=t=>{const e=[],n=[],r=t.querySelectorAll("thead th");for(const o of Array.from(r))e.push((o.textContent??"").trim());const a=t.querySelectorAll("tbody tr");for(const o of Array.from(a)){const i=Array.from(o.querySelectorAll("td")).map(s=>(s.textContent??"").trim());i.length>0&&n.push(i)}return{headers:e,rows:n}},Jt=t=>/[",\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t,Se=({headers:t,rows:e})=>[t,...e].map(n=>n.map(Jt).join(",")).join(`
4
- `),en=({headers:t,rows:e})=>[t,...e].map(n=>n.join(" ")).join(`
5
- `),xe=({headers:t,rows:e})=>{const n=`| ${t.join(" | ")} |`,r=`| ${t.map(()=>"---").join(" | ")} |`,a=e.map(o=>`| ${o.join(" | ")} |`).join(`
6
- `);return`${n}
7
- ${r}
8
- ${a}`},Ne=(t,e)=>{const n=document.createElement("div");n.className=`absolute top-full right-0 mt-1 hidden ${ft}`,n.style.backgroundColor="var(--surface-elevated)",n.style.color="var(--surface-elevated-foreground)",n.setAttribute("data-md-menu",t);for(const r of e){const a=document.createElement("button");a.type="button",a.className=`w-full text-left ${pt}`,a.setAttribute("data-md-action",`${t}-${r.key}`),a.textContent=r.label,n.appendChild(a)}return n},tn=(t,e)=>{const n=t.querySelectorAll("table");for(const r of Array.from(n)){if(r.closest('[data-markdown="table-wrapper"]'))continue;const o=document.createElement("div");o.className="group my-4 flex flex-col space-y-2",o.setAttribute("data-markdown","table-wrapper");const i=document.createElement("div");i.className="flex items-center justify-end gap-1";const s=document.createElement("div");s.className="relative",s.appendChild(U("copy",e.copyTable,"table-copy-toggle")),s.appendChild(Ne("table-copy",[{key:"csv",label:"CSV"},{key:"tsv",label:"TSV"},{key:"markdown",label:"Markdown"}]));const c=document.createElement("div");c.className="relative",c.appendChild(U("download",e.downloadTable,"table-download-toggle")),c.appendChild(Ne("table-download",[{key:"csv",label:"CSV"},{key:"markdown",label:"Markdown"}])),i.appendChild(s),i.appendChild(c);const l=document.createElement("div");l.className="overflow-x-auto rounded-lg border border-border/80 bg-[var(--surface-elevated)]";const d=r.parentElement;if(!d)continue;d.replaceChild(o,r),r.setAttribute("data-markdown","table"),r.classList.add("w-full","border-collapse","text-sm");for(const p of Array.from(r.querySelectorAll("tr")))p.classList.add("border-b","border-border/60");const m=r.querySelector("tbody tr:last-child");m?.classList.remove("border-b"),m?.classList.add("border-0");for(const p of Array.from(r.querySelectorAll("th")))p.classList.add("border-r","border-border/60","px-4","py-2.5","text-left","align-middle","font-semibold","text-foreground","last:border-r-0");for(const p of Array.from(r.querySelectorAll("td")))p.classList.add("border-r","border-border/60","px-4","py-2.5","align-middle","text-foreground/90","last:border-r-0");l.appendChild(r),o.appendChild(i),o.appendChild(l)}},nn=(t,e)=>{const n=t.querySelectorAll("pre > code.language-mermaid");for(const r of Array.from(n)){const a=r.parentElement;if(!a)continue;const o=(r.textContent??"").replace(/\s+$/,""),i=e.renderMermaid(o),s=document.createElement("div");s.setAttribute("data-markdown","mermaid-block"),s.className="group relative";const c=document.createElement("div");c.setAttribute("data-markdown","mermaid-scroll");const l=document.createElement("div");if(l.className="absolute top-1 right-2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",i.svg){const m=document.createElement("div");m.setAttribute("data-markdown","mermaid"),Y(m,i.svg),c.appendChild(m);const p=U("copy",e.labels.copyDiagram,"mermaid-copy");p.setAttribute("data-md-source",o);const g=U("download",e.labels.downloadDiagram,"mermaid-download");g.setAttribute("data-md-svg","1"),l.appendChild(p),l.appendChild(g)}else{const m=document.createElement("pre");m.setAttribute("data-markdown","mermaid-ascii"),m.textContent=i.ascii||o,c.appendChild(m);const p=U("copy",e.labels.copyDiagram,"mermaid-copy");p.setAttribute("data-md-source",i.ascii||o),l.appendChild(p)}s.appendChild(c),s.appendChild(l);const d=a.parentElement;d&&d.replaceChild(s,a)}},rn=(t,e)=>{const n=t.querySelectorAll("a[href]");for(const r of Array.from(n)){if(r.getAttribute("data-md-link-decorated")==="true"||r.getAttribute("data-openchamber-file-link")==="true")continue;const a=r.getAttribute("href")??"";if(!Pe(a))continue;r.setAttribute("data-md-link-decorated","true");const o=ut(a);if(o){const i=document.createElement("span");i.className="mr-1 inline-flex size-[18px] items-center justify-center rounded border border-[var(--border)] bg-[var(--interactive-hover)] align-middle";const s=document.createElement("img");s.src=o,s.alt="",s.setAttribute("aria-hidden","true"),s.loading="lazy",s.decoding="async",s.className="size-3.5 rounded-sm",s.addEventListener("error",()=>i.remove(),{once:!0}),i.appendChild(s),r.parentNode?.insertBefore(i,r)}if(e.onPreviewLoopback&&mt(a)){const i=document.createElement("button");i.type="button",i.className=`ml-1 align-middle ${We}`,i.setAttribute("data-md-action","preview-loopback"),i.setAttribute("data-md-url",a),i.setAttribute("title",e.labels.previewTitle),i.setAttribute("aria-label",e.labels.previewLabel),Y(i,oe.download),r.parentNode?.insertBefore(i,r.nextSibling)}}},on=(t,e)=>{Yt(t),nn(t,e),Qt(t,e.labels),tn(t,e.labels),rn(t,e)},Me=(t,e,n)=>{const r=new Blob([e],{type:n}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},te=t=>{for(const e of Array.from(t.querySelectorAll("[data-md-menu]")))e.classList.add("hidden")},an=(t,e)=>{const n=r=>{const a=r.target;if(!(a instanceof Element))return;const o=a.closest("[data-md-action]");if(!o){te(t);return}const i=o.getAttribute("data-md-action")??"";if(i==="copy-code"){const c=o.closest('[data-component="markdown-code"]')?.querySelector("code")?.textContent??"";c&&ce(c).then(()=>ve(o,e.labels.copied,"copy",e.labels.copy));return}if(i==="table-copy-toggle"||i==="table-download-toggle"){r.preventDefault();const s=o.parentElement?.querySelector("[data-md-menu]")??null,c=s?.classList.contains("hidden")??!1;te(t),s&&c&&s.classList.remove("hidden");return}if(i.startsWith("table-copy-")){const s=i.replace("table-copy-",""),c=o.closest('[data-markdown="table-wrapper"]')?.querySelector("table");if(c instanceof HTMLTableElement){const l=Ce(c),d=s==="csv"?Se(l):s==="tsv"?en(l):xe(l);ce(d)}te(t);return}if(i.startsWith("table-download-")){const s=i.replace("table-download-",""),c=o.closest('[data-markdown="table-wrapper"]')?.querySelector("table");if(c instanceof HTMLTableElement){const l=Ce(c),d=s==="csv"?Se(l):xe(l);Me(s==="csv"?"table.csv":"table.md",d,s==="csv"?"text/csv":"text/markdown")}te(t);return}if(i==="mermaid-copy"){const s=o.getAttribute("data-md-source")??"";s&&ce(s).then(()=>ve(o,e.labels.copied,"copy",e.labels.copyDiagram));return}if(i==="mermaid-download"){const c=o.closest('[data-markdown="mermaid-block"]')?.querySelector('[data-markdown="mermaid"]')?.innerHTML??"";c&&Me("diagram.svg",c,"image/svg+xml;charset=utf-8");return}if(i==="preview-loopback"){r.preventDefault();const s=o.getAttribute("data-md-url")??"";s&&e.onPreviewLoopback?.(s);return}};return t.addEventListener("click",n),()=>t.removeEventListener("click",n)},je=()=>{const t=B.c(4),e=ht();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=ye(!1),t[0]=n):n=t[0];const r=n;let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=ye(!0),t[1]=a):a=t[1];const o=a;let i;return t[2]!==e?.currentTheme?(i=e?.currentTheme??(typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?o:r),t[2]=e?.currentTheme,t[3]=i):i=t[3],i},ze=t=>{const e=B.c(4),{containerRef:n,enabled:r}=t;let a,o;e[0]!==n||e[1]!==r?(a=()=>{if(r===!1)return;const i=n.current;if(!i)return;const s=In;return i.addEventListener("click",s),()=>{i.removeEventListener("click",s)}},o=[n,r],e[0]=n,e[1]=r,e[2]=a,e[3]=o):(a=e[2],o=e[3]),x.useEffect(a,o)},Ke=t=>{if(!t.includes("mermaid"))return[];const e=[],n=/(?:^|\r?\n)(`{3,}|~{3,})mermaid[^\n\r]*\r?\n([\s\S]*?)\r?\n\1(?=\r?\n|$)/gi;let r=n.exec(t);for(;r;){const a=(r[2]??"").replace(/\s+$/,"");e.push(a),r=n.exec(t)}return e},sn=t=>{const e=t.match(/^(?:\uFEFF)?(---|\+\+\+)[^\S\r\n]*\r?\n[\s\S]*?\r?\n\1[^\S\r\n]*(?:\r?\n|$)/);return e?t.slice(e[0].length):t},de='[data-markdown="mermaid-block"]',Te='[data-openchamber-file-link="true"]',Ve="data-openchamber-block-path-token",Ue=`[${Ve}]`,V="data-openchamber-block-paths-scanned",ue=/(?:[A-Za-z]:[\\/])?[\w.\-/@+]*[\w\-/@+]\.[A-Za-z0-9]{1,8}(?::\d+){0,2}/g,cn=2e5,ln=4,dn=1e3,un=200,mn=80,fn=40,Le=160,O=new Map;let ne=0;const Re=[],pn=()=>be()?un:dn,hn=()=>be()?fn:mn,Ge=new Set(["dockerfile","makefile","readme","license",".env",".gitignore",".npmrc"]),_e=Array.from(Ge).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),we=t=>vt(t),bn=t=>At(t),gn=(t,e)=>Ct(t,e),ae=t=>{let e=(t||"").trim();return e?((e.startsWith("`")&&e.endsWith("`")||e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1).trim()),e=e.replace(/[.,;!?]+$/g,""),e.endsWith(")")&&!e.includes("(")&&(e=e.slice(0,-1)),e.endsWith("]")&&!e.includes("[")&&(e=e.slice(0,-1)),e):""},me=t=>{let e=ae(t);if(!e)return"";const n=e.indexOf(";");n>=0&&(e=e.slice(0,n)),e=e.replace(/#.*$/,"");const r=e.match(/^(.*\.[A-Za-z0-9_-]{1,16}):.*$/);r&&(e=r[1]??e);const a=_e.length>0?e.match(new RegExp(`^(.*(?:/|^)(${_e})):.*$`,"i")):null;return a&&(e=a[1]??e),ae(e)},Ze=t=>{const e=ae(t);if(!e)return null;const n=e.indexOf(";"),r=n>=0?ae(e.slice(0,n)):e;if(!r)return null;const a=r.match(/^(.*)#L(\d+)(?:C(\d+))?$/i);if(a){const s=me(a[1]??""),c=Number.parseInt(a[2]??"",10),l=a[3]?Number.parseInt(a[3],10):void 0;return!s||!Number.isFinite(c)?null:{path:s,line:c,column:Number.isFinite(l??Number.NaN)?l:void 0}}const o=r.match(/^(.*):(\d+)(?::(\d+))?$/);if(o){const s=me(o[1]??""),c=Number.parseInt(o[2]??"",10),l=o[3]?Number.parseInt(o[3],10):void 0;return!s||!Number.isFinite(c)?null:{path:s,line:c,column:Number.isFinite(l??Number.NaN)?l:void 0}}const i=me(r);return i?{path:i}:null},wn=t=>{const e=t.split("/").filter(Boolean).pop()??"";return!e||e.endsWith(".")?!1:/\.[A-Za-z0-9_-]{1,16}$/.test(e)},Xe=t=>{if(!t||t.startsWith("--")||t.includes("://")||/[<>]/.test(t)||/\s{2,}/.test(t))return!1;const e=we(t),n=e.split("/").filter(Boolean).pop()??e;if(!n||n==="."||n==="..")return!1;const r=n.toLowerCase();return Ge.has(r)||r.startsWith(".")&&r.length>1?!0:wn(e)},Ye=t=>{const e=Ze(t);return e?Xe(e.path):!1},Fe=(t,e)=>{let n=0;for(const a of t){const o=n+a.data.length;if(e<=o)return{node:a,offset:Math.max(0,e-n)};n=o}const r=t.at(-1);return r?{node:r,offset:r.data.length}:null},yn=t=>{const e=t.querySelectorAll(Ue);for(const r of Array.from(e))r.replaceWith(t.ownerDocument.createTextNode(r.textContent??""));const n=t.querySelectorAll(`code[${V}]`);for(const r of Array.from(n))r.removeAttribute(V),r.normalize()},fe=t=>{if(t.tagName.toLowerCase()==="a"){const e=t.getAttribute("href")?.trim();if(e&&Ye(e))return e}return(t.textContent||"").trim()},kn=t=>{const e=t.querySelectorAll("pre code");if(e.length===0)return;const n=t.ownerDocument;if(n)for(const r of Array.from(e)){if(r.getAttribute(V)==="true")continue;if((r.textContent??"").length>cn){r.setAttribute(V,"true");continue}const a=n.createTreeWalker(r,NodeFilter.SHOW_TEXT),o=[];let i=a.nextNode();for(;i;)o.push(i),i=a.nextNode();const s=r.textContent??"";if(!s.includes(".")){r.setAttribute(V,"true");continue}ue.lastIndex=0;const c=[];let l=ue.exec(s);for(;l;){const d=l[0];d&&Ye(d)&&c.push({start:l.index,end:l.index+d.length,raw:d}),l=ue.exec(s)}for(const{start:d,end:m,raw:p}of c.reverse()){const g=Fe(o,d),v=Fe(o,m);if(!g||!v)continue;const w=n.createRange();w.setStart(g.node,g.offset),w.setEnd(v.node,v.offset);const y=n.createElement("span");y.setAttribute(Ve,"true"),y.textContent=p,w.deleteContents(),w.insertNode(y)}r.setAttribute(V,"true")}},pe=(t,e)=>{const n=Ze(t);if(!n||!Xe(n.path))return null;const r=bn(n.path)?we(n.path):gn(e,n.path);return r?{...n,resolvedPath:r}:null},En=t=>{const e=we(t);if(!e)return Promise.resolve(!1);const n=O.get(e);if(n)return O.delete(e),O.set(e,n),n;const r=new Promise(o=>{const i=()=>{ne+=1,Nt(`/api/fs/stat?path=${encodeURIComponent(e)}&optional=true`,{method:"GET",cache:"no-store"}).then(async s=>{if(!s.ok){o(!1);return}const c=await s.json().catch(()=>null);o(c?.exists!==!1)}).catch(()=>o(!1)).finally(()=>{ne=Math.max(0,ne-1),Re.shift()?.()})};if(ne<ln){i();return}Re.push(i)}),a=pn();for(;O.size>=a;){const o=O.keys().next().value;if(typeof o!="string")break;O.delete(o)}return O.set(e,r),r},An=(t,e)=>t||Et(t,e),Qe=t=>{const e=B.c(7),{containerRef:n,effectiveDirectory:r,editor:a,preferRuntimeEditor:o,enabled:i}=t,s=x.useRef(null);let c,l;e[0]!==n||e[1]!==a||e[2]!==r||e[3]!==i||e[4]!==o?(c=()=>{const d=n.current;if(!d)return;let m=!1;const p=hn(),g=$n,v=()=>{const h=d.querySelectorAll(Te);for(const f of Array.from(h))g(f);yn(d)};if(!i){v();return}const w=h=>{const f=h;if(s.current!==null&&typeof window<"u"&&window.clearTimeout(s.current),typeof window>"u"){y();return}s.current=window.setTimeout(()=>{s.current=null,window.requestAnimationFrame(()=>{m||y()})},f)},y=()=>{i&&kn(d);const h=d.querySelectorAll(`[data-markdown="inline-code"], a, ${Ue}`);let f=0;for(const u of Array.from(h)){const E=fe(u),A=pe(E,r);if(g(u),!A||f>=p)continue;f=f+1,(St()&&xt()&&!ke(A.resolvedPath,r)?Promise.resolve(!0):En(A.resolvedPath)).then(F=>{if(m||!F||!d.contains(u))return;const N=fe(u),M=pe(N,r);!M||M.resolvedPath!==A.resolvedPath||(u.setAttribute("data-openchamber-file-link","true"),u.setAttribute("data-openchamber-file-ref",N),u.setAttribute("data-openchamber-file-path",M.resolvedPath),u.setAttribute("title","Open file"),u.tagName.toLowerCase()!=="a"&&(u.setAttribute("role","button"),u.setAttribute("tabindex","0")))})}},b=async h=>{const f=h.getAttribute("data-openchamber-file-ref")||fe(h),u=pe(f,r);if(!u)return;const E=An(r,u.resolvedPath);if(o&&a){a.openFile(u.resolvedPath,Number.isFinite(u.line??Number.NaN)?Math.max(1,Math.trunc(u.line)):void 0,Number.isFinite(u.column??Number.NaN)?Math.max(1,Math.trunc(u.column)):void 0);return}ke(u.resolvedPath,r)||await kt(u.resolvedPath,r);const A=ge.getState();Number.isFinite(u.line??Number.NaN)?A.openContextFileAtLine(E,u.resolvedPath,Math.max(1,Math.trunc(u.line)),Number.isFinite(u.column??Number.NaN)?Math.max(1,Math.trunc(u.column)):1):A.openContextFile(E,u.resolvedPath)},C=h=>{const f=h.target;if(!(f instanceof Element))return;const u=f.closest(Te);u instanceof HTMLElement&&(h.preventDefault(),h.stopPropagation(),b(u))},k=h=>{if(h.key!=="Enter"&&h.key!==" ")return;const f=h.target;!(f instanceof HTMLElement)||f.getAttribute("data-openchamber-file-link")!=="true"||(h.preventDefault(),h.stopPropagation(),b(f))};w(Le);const S=new MutationObserver(()=>{w(Le)});return S.observe(d,{childList:!0,subtree:!0}),d.addEventListener("click",C),d.addEventListener("keydown",k),()=>{m=!0,s.current!==null&&typeof window<"u"&&window.clearTimeout(s.current),s.current=null,S.disconnect(),d.removeEventListener("click",C),d.removeEventListener("keydown",k)}},l=[n,a,r,o,i],e[0]=n,e[1]=a,e[2]=r,e[3]=i,e[4]=o,e[5]=c,e[6]=l):(c=e[5],l=e[6]),x.useEffect(c,l)},Je=t=>{const e=B.c(6),{containerRef:n,mermaidBlocks:r,onShowPopup:a,allowWheelZoom:o}=t;let i,s;e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==a?(i=()=>{const c=n.current;if(!c)return;const l=m=>{if(!a)return;const p=m.target;if(!(p instanceof Element)||p.closest('button, a, [role="button"]'))return;const g=p.closest(de);if(!g)return;const w=Array.from(c.querySelectorAll(de)).indexOf(g);if(w<0)return;const y=r[w];if(!y||y.trim().length===0)return;const b=`Diagram ${w+1}`;a({open:!0,title:b,content:"",metadata:{tool:"mermaid-preview",filename:b},mermaid:{url:`data:text/plain;charset=utf-8,${encodeURIComponent(y)}`,source:y,filename:b}})},d=m=>{if(o)return;const p=m.target;!(p instanceof Element)||!p.closest(de)||m.stopPropagation()};return c.addEventListener("click",l),c.addEventListener("wheel",d,{capture:!0,passive:!0}),()=>{c.removeEventListener("click",l),c.removeEventListener("wheel",d,!0)}},s=[o,n,r,a],e[0]=o,e[1]=n,e[2]=r,e[3]=a,e[4]=i,e[5]=s):(i=e[4],s=e[5]),x.useEffect(i,s)},he=64,vn=24,Cn=he/vn,Sn=/[\s.,!?;:)\]]/,xn=t=>{const e=t<=12?2:t<=48?4:t<=96?8:Math.min(24,Math.ceil(t/8));return Math.max(1,Math.round(e*Cn))},Nn=(t,e)=>{const n=Math.min(t.length,e+xn(t.length-e));for(let r=n;r<Math.min(t.length,n+8);r+=1)if(Sn.test(t[r]??""))return r+1;return n},Mn=(t,e)=>{const[n,r]=x.useState(()=>e?0:t.length),a=x.useRef(n);return a.current=n,x.useEffect(()=>{if(!e||typeof window>"u"){r(t.length);return}a.current>t.length&&r(t.length);let o=null;const i=()=>{const s=Math.min(a.current,t.length);if(s>=t.length){o=null;return}r(Nn(t,s)),o=window.setTimeout(i,he)};return a.current<t.length&&(o=window.setTimeout(i,he)),()=>{o!==null&&window.clearTimeout(o)}},[t,e]),e?t.slice(0,Math.min(n,t.length)):t},D=new Map,Tn=100,Ln=(t,e)=>{const n=D.get(t);if(n)return D.delete(t),D.set(t,n),n;const r=e();if(D.set(t,r),D.size>Tn){const a=D.keys().next().value;a&&D.delete(a)}return r},Rn=t=>({bg:t.colors.surface.elevated,fg:t.colors.surface.foreground,line:t.colors.interactive.border,accent:t.colors.primary.base,muted:t.colors.surface.mutedForeground,surface:t.colors.surface.muted,border:t.colors.interactive.border,transparent:!0,font:"IBM Plex Sans, sans-serif"}),et=(t,e)=>{const{t:n}=bt(),r=x.useMemo(()=>({copy:"Copy code",copied:"Copied",copyTable:n("markdownRenderer.table.actions.copyTitle"),downloadTable:n("markdownRenderer.table.actions.downloadTitle"),copyDiagram:n("markdownRenderer.mermaid.actions.copySourceTitle"),downloadDiagram:n("markdownRenderer.mermaid.actions.downloadSvgTitle"),previewLabel:n("terminalView.preview.open"),previewTitle:n("terminalView.preview.openTitle")}),[n]);return x.useMemo(()=>{const a=Rn(t),o=ge.getState().mermaidRenderingMode,i=t.metadata?.id??"theme";return{labels:r,renderMermaid:c=>Ln(`${i}:${o}:${c}`,()=>{try{return o==="ascii"?{ascii:ot(c)}:{svg:at(c,a)}}catch{return{}}}),onPreviewLoopback:e}},[t,r,e])},tt=t=>{const e=B.c(20),{containerRef:n,text:r,streaming:a,cacheKey:o,syntaxVars:i,ctx:s}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0],x.useEffect(Pn,c);let l,d;e[1]!==n||e[2]!==r?(l=()=>{const b=n.current,C=b?.querySelector("[data-markdown-content]")??b;if(C&&r&&C.childNodes.length===0){const k=document.createElement("div");k.setAttribute("data-md-block",""),k.style.display="contents",k.innerHTML=Vt(r),C.appendChild(k)}},d=[n,r],e[1]=n,e[2]=r,e[3]=l,e[4]=d):(l=e[3],d=e[4]),x.useLayoutEffect(l,d);let m,p;e[5]!==o||e[6]!==n||e[7]!==s||e[8]!==a||e[9]!==r?(m=()=>{const b=n.current;if(!b)return;const C=b.querySelector("[data-markdown-content]")??b;let k=!0;return Xt(r,a,o).then(S=>{if(!k)return;const h=Array.from(C.children);S.forEach((f,u)=>{let E=h[u];if(E||(E=document.createElement("div"),E.setAttribute("data-md-block",""),E.style.display="contents",C.appendChild(E)),E.getAttribute("data-md-id")===f.id)return;const A=document.createElement("div");A.innerHTML=f.html,on(A,s),st(E,A,{childrenOnly:!0,onBeforeElUpdated:On}),E.setAttribute("data-md-id",f.id)});for(let f=h.length-1;f>=S.length;f=f-1,f)h[f]?.remove()}),()=>{k=!1}},p=[n,r,a,o,s],e[5]=o,e[6]=n,e[7]=s,e[8]=a,e[9]=r,e[10]=m,e[11]=p):(m=e[10],p=e[11]),x.useEffect(m,p);let g,v;e[12]!==n||e[13]!==s?(g=()=>{const b=n.current;if(b)return an(b,s)},v=[n,s],e[12]=n,e[13]=s,e[14]=g,e[15]=v):(g=e[14],v=e[15]),x.useEffect(g,v);let w,y;e[16]!==n||e[17]!==i?(w=()=>{const b=n.current,C=b?.querySelector("[data-markdown-content]")??b;if(C)for(const[k,S]of Object.entries(i))C.style.setProperty(k,S)},y=[n,i],e[16]=n,e[17]=i,e[18]=w,e[19]=y):(w=e[18],y=e[19]),x.useEffect(w,y)},nt=t=>t==="tool"?"markdown-content markdown-tool":t==="reasoning"?"markdown-content markdown-reasoning":"markdown-content leading-relaxed",_n=t=>{const e=B.c(35),{content:n,part:r,messageId:a,isAnimated:o,skipFadeIn:i,className:s,isStreaming:c,disableStreamAnimation:l,variant:d,onShowPopup:m,enableFileReferences:p}=t,g=o===void 0?!0:o,v=i===void 0?!1:i,w=c===void 0?!1:c,y=l===void 0?!1:l,b=d===void 0?"assistant":d,C=p===void 0?!0:p,k=je(),{editor:S,runtime:h}=Oe(),f=x.useRef(null),u=De()??"",E=ge(Dn);let A;e[0]!==u||e[1]!==E?(A=z=>{u&&E(u,z)},e[0]=u,e[1]=E,e[2]=A):A=e[2];const P=A,R=w&&!y,F=Mn(n,R);let N;e[3]!==n?(N=Ke(n),e[3]=n,e[4]=N):N=e[4];const M=N;let I;e[5]!==M||e[6]!==m?(I={containerRef:f,mermaidBlocks:M,onShowPopup:m},e[5]=M,e[6]=m,e[7]=I):I=e[7],Je(I);const _=C&&!w;let T;e[8]!==S||e[9]!==u||e[10]!==h.isVSCode||e[11]!==_?(T={containerRef:f,effectiveDirectory:u,editor:S,preferRuntimeEditor:h.isVSCode,enabled:_},e[8]=S,e[9]=u,e[10]=h.isVSCode,e[11]=_,e[12]=T):T=e[12],Qe(T);let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L={containerRef:f},e[13]=L):L=e[13],ze(L);let $;e[14]!==k?($=Be(k),e[14]=k,e[15]=$):$=e[15];const se=$,ie=et(k,u?P:void 0),H=`markdown-${r?.id?`part-${r.id}`:`message-${a}`}`;let Q;e[16]!==H||e[17]!==ie||e[18]!==R||e[19]!==F||e[20]!==se?(Q={containerRef:f,text:F,streaming:R,cacheKey:H,syntaxVars:se,ctx:ie},e[16]=H,e[17]=ie,e[18]=R,e[19]=F,e[20]=se,e[21]=Q):Q=e[21],tt(Q);let q;e[22]!==s?(q=He("break-words w-full min-w-0",s),e[22]=s,e[23]=q):q=e[23];let W;e[24]!==b?(W=nt(b),e[24]=b,e[25]=W):W=e[25];let j;e[26]!==W?(j=X.jsx("div",{className:W,"data-markdown-content":!0}),e[26]=W,e[27]=j):j=e[27];let J;e[28]!==q||e[29]!==j?(J=X.jsx("div",{className:q,ref:f,children:j}),e[28]=q,e[29]=j,e[30]=J):J=e[30];const ee=J;if(g){let z;return e[31]!==H||e[32]!==ee||e[33]!==v?(z=X.jsx(wt,{skipAnimation:v,children:ee},H),e[31]=H,e[32]=ee,e[33]=v,e[34]=z):z=e[34],z}return ee},Wn=x.memo(_n,(t,e)=>t.content===e.content&&t.isStreaming===e.isStreaming&&t.disableStreamAnimation===e.disableStreamAnimation&&t.variant===e.variant&&t.isAnimated===e.isAnimated&&t.skipFadeIn===e.skipFadeIn&&t.className===e.className&&t.messageId===e.messageId&&t.onShowPopup===e.onShowPopup&&t.enableFileReferences===e.enableFileReferences&&t.part?.id===e.part?.id),Fn=t=>{const e=B.c(32),{content:n,className:r,variant:a,disableLinkSafety:o,stripFrontmatter:i,onShowPopup:s,allowMermaidWheelZoom:c,enableFileReferences:l}=t,d=a===void 0?"assistant":a,m=i===void 0?!1:i,p=c===void 0?!1:c,g=l===void 0?!0:l,{editor:v,runtime:w}=Oe(),y=je(),b=x.useRef(null),C=De()??"";let k;e[0]!==n||e[1]!==m?(k=m?sn(n):n,e[0]=n,e[1]=m,e[2]=k):k=e[2];const S=k;let h;e[3]!==S?(h=Ke(S),e[3]=S,e[4]=h):h=e[4];const f=h;let u;e[5]!==p||e[6]!==f||e[7]!==s?(u={containerRef:b,mermaidBlocks:f,onShowPopup:s,allowWheelZoom:p},e[5]=p,e[6]=f,e[7]=s,e[8]=u):u=e[8],Je(u);let E;e[9]!==v||e[10]!==C||e[11]!==g||e[12]!==w.isVSCode?(E={containerRef:b,effectiveDirectory:C,editor:v,preferRuntimeEditor:w.isVSCode,enabled:g},e[9]=v,e[10]=C,e[11]=g,e[12]=w.isVSCode,e[13]=E):E=e[13],Qe(E);const A=!o;let P;e[14]!==A?(P={containerRef:b,enabled:A},e[14]=A,e[15]=P):P=e[15],ze(P);let R;e[16]!==y?(R=Be(y),e[16]=y,e[17]=R):R=e[17];const F=R,N=et(y),M=`simple:${d}`;let I;e[18]!==N||e[19]!==S||e[20]!==F||e[21]!==M?(I={containerRef:b,text:S,streaming:!1,cacheKey:M,syntaxVars:F,ctx:N},e[18]=N,e[19]=S,e[20]=F,e[21]=M,e[22]=I):I=e[22],tt(I);let _;e[23]!==r?(_=He("break-words w-full min-w-0",r),e[23]=r,e[24]=_):_=e[24];let T;e[25]!==d?(T=nt(d),e[25]=d,e[26]=T):T=e[26];let L;e[27]!==T?(L=X.jsx("div",{className:T,"data-markdown-content":!0}),e[27]=T,e[28]=L):L=e[28];let $;return e[29]!==_||e[30]!==L?($=X.jsx("div",{className:_,ref:b,children:L}),e[29]=_,e[30]=L,e[31]=$):$=e[31],$},jn=x.memo(Fn,(t,e)=>t.content===e.content&&t.variant===e.variant&&t.className===e.className&&t.disableLinkSafety===e.disableLinkSafety&&t.stripFrontmatter===e.stripFrontmatter&&t.onShowPopup===e.onShowPopup&&t.allowMermaidWheelZoom===e.allowMermaidWheelZoom&&t.enableFileReferences===e.enableFileReferences);function In(t){if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.altKey||t.shiftKey)return;const e=t.target;if(!(e instanceof Element))return;const n=e.closest("a[href]");if(!(n instanceof HTMLAnchorElement)||n.getAttribute("data-openchamber-file-link")==="true")return;const r=n.getAttribute("href")??"";Pe(r)&&(t.preventDefault(),t.stopPropagation(),yt(r))}function $n(t){t.removeAttribute("data-openchamber-file-link"),t.removeAttribute("data-openchamber-file-ref"),t.removeAttribute("data-openchamber-file-path"),t.getAttribute("title")==="Open file"&&t.removeAttribute("title"),t.tagName.toLowerCase()!=="a"&&(t.removeAttribute("role"),t.removeAttribute("tabindex"))}function Pn(){gt()}function On(t,e){return!t.isEqualNode(e)}function Dn(t){return t.openContextPreview}export{Wn as MarkdownRenderer,jn as SimpleMarkdownRenderer};
@@ -1 +0,0 @@
1
- import{H as I,j as t,R as a,e as W}from"./vendor-.bun-d5B0wgQr.js";import{h as O,_ as B,e as M,z as re,C as ae,f as le}from"./index-68ujKCUc.js";import{u as V,e7 as me,f1 as oe,aH as Z,e6 as ee,B as U,n as z,p as ce,m as J,I as T,aK as Q}from"./useAppFontEffects-ByW8wOJM.js";function pe(r){switch(r){case"ok":return null;case"auth":return"onboarding.remoteConnection.probe.authMessage";case"update-recommended":return"onboarding.remoteConnection.probe.updateRecommendedMessage";case"incompatible":return"onboarding.remoteConnection.probe.incompatibleMessage";case"wrong-service":return"onboarding.remoteConnection.probe.wrongServiceMessage";case"unreachable":return"onboarding.remoteConnection.probe.unreachableMessage";default:return null}}function q(r){return r==="wrong-service"||r==="unreachable"||r==="incompatible"}function ie({onBack:r,showBackButton:e=!0,initialUrl:c="",initialLabel:n="",isRecoveryMode:o=!1,onConnect:b,onSwitchToLocal:i}){const{t:s}=V(),[h,y]=I.useState(c),[x,S]=I.useState(n),[N,f]=I.useState("idle"),[m,v]=I.useState(null),[R,C]=I.useState(""),j=me(h),p=j?.persistedUrl??null,w=I.useCallback(d=>{y(d.target.value),f("idle"),v(null),C("")},[]),g=I.useCallback(d=>{S(d.target.value)},[]),k=I.useCallback(async()=>{if(p){f("testing"),v(null),C("");try{const d=await oe(p);v(d),f(d.status==="ok"||d.status==="update-recommended"?"success":"error")}catch(d){C(d instanceof Error?d.message:s("onboarding.remoteConnection.errors.connectionTestFailed")),f("error")}}},[p,s]),K=I.useCallback(async()=>{if(!j)return;const d=j.persistedUrl;f("testing"),v(null),C("");try{const D=await oe(d);if(v(D),q(D.status)){f("error");return}const F=await Z(),de=x.trim()||d,G=F.hosts.find($=>$.url===d),Y=G?G.id:`host-${Date.now().toString(16)}`,te={id:Y,label:de,url:d,apiUrl:d},ue=G?F.hosts.map($=>$.id===Y?te:$):[...F.hosts,te];if(await ee({hosts:ue,defaultHostId:Y,initialHostChoiceCompleted:!0}),b?.(),j.redeemUrl){window.location.assign(j.redeemUrl);return}O()&&await B()}catch(D){C(D instanceof Error?D.message:s("onboarding.remoteConnection.errors.failedToSaveConnection")),f("error")}},[j,x,b,s]),L=N==="testing",A=p!==null&&!L,_=p!==null&&!L&&!q(m?.status??null),P=pe(m?.status??null),H=m?.status==="ok",u=m?.status==="update-recommended",E=m?.status==="auth",l=q(m?.status??null);return t.jsx("div",{className:"flex flex-col items-center justify-center h-full p-8",children:t.jsxs("div",{className:"w-full max-w-md space-y-6",children:[e&&t.jsx("div",{className:"flex items-center",children:t.jsx(U,{variant:"ghost",onClick:r,className:"p-0 text-muted-foreground hover:text-foreground",children:s("onboarding.common.actions.back")})}),t.jsxs("div",{className:"space-y-2 text-center",children:[t.jsx("h1",{className:"typography-ui-header text-xl font-semibold text-foreground",children:s(o?"onboarding.remoteConnection.titleRecovery":"onboarding.remoteConnection.title")}),t.jsx("p",{className:"text-muted-foreground text-sm",children:s("onboarding.remoteConnection.description")})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{htmlFor:"remote-url",className:"text-sm text-foreground",children:s("onboarding.remoteConnection.field.serverAddress")}),t.jsx(z,{id:"remote-url",type:"url",value:h,onChange:w,placeholder:s("onboarding.remoteConnection.field.serverAddressPlaceholder"),disabled:L})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{htmlFor:"remote-label",className:"text-sm text-foreground",children:s("onboarding.remoteConnection.field.nameOptional")}),t.jsx(z,{id:"remote-label",type:"text",value:x,onChange:g,placeholder:s("onboarding.remoteConnection.field.namePlaceholder"),disabled:L})]})]}),m&&H&&t.jsx("div",{className:"rounded-lg border p-3 text-sm",style:{borderColor:"var(--status-success)",color:"var(--status-success)"},children:s("onboarding.remoteConnection.status.connectedSuccessfully",{latencyMs:m.latencyMs})}),m&&E&&t.jsx("div",{className:"rounded-lg border p-3 text-sm",style:{borderColor:"var(--status-warning)",color:"var(--status-warning)"},children:s("onboarding.remoteConnection.status.authWarning")}),m&&u&&t.jsx("div",{className:"rounded-lg border p-3 text-sm",style:{borderColor:"var(--status-warning)",color:"var(--status-warning)"},children:P?s(P):null}),m&&l&&t.jsxs("div",{className:"rounded-lg border p-3 text-sm space-y-3",style:{borderColor:"var(--status-error)",color:"var(--status-error)"},children:[t.jsxs("div",{children:[t.jsx("div",{className:"font-semibold mb-1",children:s("onboarding.remoteConnection.status.connectionFailed")}),t.jsx("div",{className:"opacity-90",children:P?s(P):null})]}),t.jsx("div",{className:"text-xs opacity-80",children:m.status==="unreachable"?s("onboarding.remoteConnection.status.suggestionsUnreachable"):s("onboarding.remoteConnection.status.suggestionsWrongService")})]}),R&&t.jsx("div",{className:"rounded-lg border p-3 text-sm",style:{borderColor:"var(--status-error)",color:"var(--status-error)"},children:R}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx(U,{variant:"outline",onClick:k,disabled:!A,children:s(L?"onboarding.remoteConnection.actions.testing":"onboarding.remoteConnection.actions.testConnection")}),t.jsx(U,{onClick:K,disabled:!_,children:s("onboarding.remoteConnection.actions.connectAndRestart")})]}),l&&t.jsxs("div",{className:"flex flex-col gap-2 pt-2 border-t border-border",children:[t.jsx("div",{className:"text-xs text-muted-foreground text-center",children:s("onboarding.remoteConnection.actions.whatToDo")}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(U,{variant:"outline",size:"sm",onClick:r,className:"flex-1",children:s("onboarding.remoteConnection.actions.chooseDifferentServer")}),!o&&i&&t.jsx(U,{variant:"outline",size:"sm",onClick:i,className:"flex-1",children:s("onboarding.remoteConnection.actions.useLocalInstead")})]})]})]})})}const he="curl -fsSL https://opencode.ai/install | bash",fe="https://opencode.ai/docs",se=2500;function be(r){const e=W.c(5),{onCopy:c,copyTitle:n}=r;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("code",{className:"flex-1 text-left overflow-x-auto whitespace-nowrap",children:[t.jsx("span",{style:{color:"var(--syntax-keyword)"},children:"curl"}),t.jsx("span",{className:"text-muted-foreground",children:" -fsSL "}),t.jsx("span",{style:{color:"var(--syntax-string)"},children:"https://opencode.ai/install"}),t.jsx("span",{className:"text-muted-foreground",children:" | "}),t.jsx("span",{style:{color:"var(--syntax-keyword)"},children:"bash"})]}),e[0]=o):o=e[0];let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(T,{name:"file-copy",className:"h-4 w-4"}),e[1]=b):b=e[1];let i;return e[2]!==n||e[3]!==c?(i=t.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[o,t.jsx("button",{onClick:c,className:"inline-flex items-center text-muted-foreground hover:text-foreground transition-colors shrink-0",title:n,"aria-label":n,children:b})]}),e[2]=n,e[3]=c,e[4]=i):i=e[4],i}function xe({onCliAvailable:r}){const{t:e}=V(),[c,n]=a.useState(!1),[o,b]=a.useState(!1),[i,s]=a.useState(!1),[h,y]=a.useState(!1),[x,S]=a.useState(""),[N,f]=a.useState("unknown"),[m,v]=a.useState("local"),[R,C]=a.useState(!1),[j,p]=a.useState(!1);a.useEffect(()=>{b(O())},[]),a.useEffect(()=>{if(typeof navigator>"u"){f("unknown");return}const l=navigator.userAgent||"";/Windows/i.test(l)?f("windows"):/Macintosh|Mac OS X/i.test(l)?f("macos"):/Linux/i.test(l)?f("linux"):f("unknown")},[]),a.useEffect(()=>{let l=!1;return(async()=>{try{const d=await M("/api/config/settings",{method:"GET",headers:{Accept:"application/json"}});if(!d.ok)return;const D=await d.json().catch(()=>null);if(!D||l)return;const F=typeof D.opencodeBinary=="string"?D.opencodeBinary.trim():"";F&&S(F)}catch{}})(),()=>{l=!0}},[]);const w=a.useCallback(async l=>{const d=l.target;d.closest(".app-region-no-drag")||d.closest("button, a, input, select, textarea, code, summary, details")||l.button===0&&o&&await re()},[o]),g=a.useCallback(async()=>{try{const l=await M("/health");if(!l.ok)return!1;const d=await l.json();return d.openCodeRunning===!0||d.isOpenCodeReady===!0}catch{return!1}},[]),k=a.useCallback(async l=>{if(!o)return;const d=await Z();await ee({...d,...l==="local"?{defaultHostId:"local"}:{},initialHostChoiceCompleted:!0})},[o]),K=a.useCallback(async()=>{o&&await k("local"),r?.()},[o,r,k]);a.useEffect(()=>{if(m!=="local")return;let l=!1,d=null;const D=async()=>{if(!l){try{const F=await g();if(l)return;if(F){await K();return}}catch{}l||(d=setTimeout(D,se))}};return d=setTimeout(D,se),()=>{l=!0,d&&clearTimeout(d)}},[m,g,K]);const L=a.useCallback(async()=>{y(!0);try{await g()&&await K()}finally{y(!1)}},[g,K]),A=a.useCallback(async()=>{if(!(typeof window>"u")&&o)try{const l=await ae();l.success&&l.path&&l.path.trim().length>0&&S(l.path.trim())}catch{}},[o]),_=a.useCallback(async()=>{s(!0);try{if(await le({opencodeBinary:x.trim()}),o){await k("local"),await B();return}await M("/api/config/reload",{method:"POST"})}finally{setTimeout(()=>s(!1),1e3)}},[o,x,k]),P=a.useCallback(async()=>{const l=await ce(he);l.ok?(n(!0),setTimeout(()=>n(!1),2e3)):console.error("Failed to copy:",l.error)},[]),H=fe,u=N==="windows"?"C:\\Users\\you\\AppData\\Roaming\\npm\\opencode.cmd":N==="linux"?"/home/you/.bun/bin/opencode":"/Users/you/.bun/bin/opencode",E=!o||m==="local";return t.jsx("div",{className:"app-region-drag h-full flex items-center justify-center bg-transparent p-8 cursor-default select-none overflow-y-auto",onMouseDown:w,children:t.jsxs("div",{className:"w-full max-w-md space-y-7",children:[t.jsxs("header",{className:"text-center space-y-1.5",children:[t.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:e("onboarding.chooser.title")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:e("onboarding.chooser.description")})]}),o&&t.jsxs("div",{className:"app-region-no-drag flex gap-1.5",children:[t.jsx("button",{type:"button",className:J("flex-1 px-4 py-2 rounded-lg border transition-colors text-sm",m==="local"?"border-[var(--interactive-selection)] text-foreground bg-[var(--interactive-selection)]/10":"border-border text-muted-foreground hover:text-foreground hover:border-muted-foreground"),onClick:()=>v("local"),children:e("onboarding.chooser.tabs.localInstall")}),t.jsx("button",{type:"button",className:J("flex-1 px-4 py-2 rounded-lg border transition-colors text-sm",m==="remote"?"border-[var(--interactive-selection)] text-foreground bg-[var(--interactive-selection)]/10":"border-border text-muted-foreground hover:text-foreground hover:border-muted-foreground"),onClick:()=>v("remote"),children:e("onboarding.chooser.tabs.connectRemote")})]}),o&&m==="remote"?t.jsx("div",{className:"app-region-no-drag",children:t.jsx(ie,{onBack:()=>v("local"),showBackButton:!1,onSwitchToLocal:()=>v("local")})}):null,E&&t.jsxs("div",{className:"space-y-4",children:[N==="windows"&&t.jsxs("div",{className:"rounded-lg border border-border bg-background/50 p-4",children:[t.jsx("div",{className:"text-sm text-foreground",children:e("onboarding.localSetup.windows.title")}),t.jsxs("ol",{className:"mt-2 list-decimal space-y-1 pl-5 text-sm text-muted-foreground",children:[t.jsx("li",{children:e("onboarding.localSetup.windows.stepRunInstallInWsl")}),t.jsx("li",{children:e("onboarding.localSetup.windows.stepSetBinaryPath")})]})]}),t.jsx("p",{className:"text-sm text-muted-foreground text-center leading-relaxed",children:e("onboarding.localSetup.intro")}),t.jsx("div",{className:"app-region-no-drag rounded-lg border border-border bg-background/60 backdrop-blur-sm px-4 py-3 font-mono text-sm",children:c?t.jsxs("div",{className:"flex items-center gap-2",style:{color:"var(--status-success)"},children:[t.jsx(T,{name:"check",className:"h-4 w-4"}),e("onboarding.common.status.copiedToClipboard")]}):t.jsx(be,{onCopy:P,copyTitle:e("onboarding.common.copyToClipboard")})}),t.jsxs("div",{className:"app-region-no-drag flex items-center justify-between",children:[t.jsxs("a",{href:H,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-1",children:[e(N==="windows"?"onboarding.localSetup.docs.windows":"onboarding.localSetup.docs.default"),t.jsx(T,{name:"external-link",className:"h-3 w-3"})]}),t.jsx("button",{type:"button",onClick:L,disabled:h,className:"text-xs text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",children:e(h?"onboarding.localSetup.actions.checking":"onboarding.localSetup.actions.checkNow")})]}),t.jsxs("div",{className:"rounded-lg border px-4 py-3 flex items-center gap-3",style:{borderColor:"color-mix(in srgb, var(--primary-base) 20%, transparent)",backgroundColor:"color-mix(in srgb, var(--primary-base) 6%, transparent)"},role:"status","aria-live":"polite",children:[t.jsxs("span",{className:"relative inline-flex h-2.5 w-2.5 shrink-0","aria-hidden":!0,children:[t.jsx("span",{className:"absolute inset-0 rounded-full",style:{backgroundColor:"var(--primary-base)",animation:"pulse-opacity 1.6s ease-in-out infinite"}}),t.jsx("span",{className:"absolute inset-[-4px] rounded-full",style:{backgroundColor:"var(--primary-base)",animation:"pulse-opacity-dim 1.6s ease-in-out infinite",opacity:0}})]}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm text-foreground leading-tight",children:e("onboarding.localSetup.status.watching")}),t.jsx("div",{className:"text-xs text-muted-foreground leading-tight mt-0.5",children:e("onboarding.localSetup.status.autoContinue")})]})]}),t.jsxs("details",{className:"app-region-no-drag group rounded-lg border border-border/60 px-4 open:bg-background/40 transition-colors",open:R,onToggle:l=>C(l.currentTarget.open),children:[t.jsxs("summary",{className:"flex items-center justify-between cursor-pointer py-2.5 text-sm text-muted-foreground hover:text-foreground transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t.jsx("span",{children:e("onboarding.localSetup.advanced.title")}),t.jsx(T,{name:"arrow-down-s",className:"h-4 w-4 transition-transform group-open:rotate-180"})]}),t.jsxs("div",{className:"pb-4 space-y-2",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx(z,{value:x,onChange:l=>S(l.target.value),placeholder:u,disabled:i,className:"flex-1 font-mono text-xs"}),t.jsx(U,{type:"button",variant:"secondary",size:"sm",onClick:A,disabled:i||!o,children:e("onboarding.localSetup.actions.browse")}),t.jsx(U,{type:"button",size:"sm",onClick:_,disabled:i||!x.trim(),children:e("onboarding.localSetup.actions.apply")})]}),t.jsx("p",{className:"text-xs text-muted-foreground/70",children:e("onboarding.localSetup.helper.saveAndReload")})]})]}),t.jsxs("details",{className:"app-region-no-drag group rounded-lg border border-border/60 px-4 open:bg-background/40 transition-colors",open:j,onToggle:l=>p(l.currentTarget.open),children:[t.jsxs("summary",{className:"flex items-center justify-between cursor-pointer py-2.5 text-sm text-muted-foreground hover:text-foreground transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t.jsx("span",{children:e("onboarding.localSetup.troubleshoot.title")}),t.jsx(T,{name:"arrow-down-s",className:"h-4 w-4 transition-transform group-open:rotate-180"})]}),t.jsx("ul",{className:"pb-4 space-y-1.5 text-xs text-muted-foreground list-disc pl-4",children:N==="windows"?t.jsx(t.Fragment,{children:t.jsx("li",{children:e("onboarding.localSetup.windows.hintDetectionFailed")})}):t.jsxs(t.Fragment,{children:[t.jsx("li",{children:e("onboarding.localSetup.hint.ensurePath")}),t.jsx("li",{children:e("onboarding.localSetup.hint.setEnv")}),t.jsx("li",{children:e("onboarding.localSetup.hint.missingRuntime")})]})})]})]})]})})}const ge="curl -fsSL https://opencode.ai/install | bash",ye="https://opencode.ai/docs";function ve(r){const e=W.c(5),{onCopy:c,copyTitle:n}=r;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("code",{children:[t.jsx("span",{style:{color:"var(--syntax-keyword)"},children:"curl"}),t.jsx("span",{className:"text-muted-foreground",children:" -fsSL "}),t.jsx("span",{style:{color:"var(--syntax-string)"},children:"https://opencode.ai/install"}),t.jsx("span",{className:"text-muted-foreground",children:" | "}),t.jsx("span",{style:{color:"var(--syntax-keyword)"},children:"bash"})]}),e[0]=o):o=e[0];let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(T,{name:"file-copy",className:"h-4 w-4"}),e[1]=b):b=e[1];let i;return e[2]!==n||e[3]!==c?(i=t.jsxs("div",{className:"flex items-center justify-center gap-3",children:[o,t.jsx("button",{onClick:c,className:"inline-flex items-center text-muted-foreground hover:text-foreground transition-colors",title:n,children:b})]}),e[2]=n,e[3]=c,e[4]=i):i=e[4],i}const we=3e4;function je({onBack:r,onCliAvailable:e,isFromRecovery:c=!1,onSwitchToRemote:n}){const{t:o}=V(),[b,i]=a.useState(!1),[s,h]=a.useState(!1),[y,x]=a.useState(!1),[S,N]=a.useState(!1),[f,m]=a.useState(!1),[v,R]=a.useState(null),[C,j]=a.useState(""),[p,w]=a.useState("unknown");a.useEffect(()=>{const u=setTimeout(()=>h(!0),we);return()=>clearTimeout(u)},[]),a.useEffect(()=>{x(O())},[]),a.useEffect(()=>{if(typeof navigator>"u"){w("unknown");return}const u=navigator.userAgent||"";if(/Windows/i.test(u)){w("windows");return}if(/Macintosh|Mac OS X/i.test(u)){w("macos");return}if(/Linux/i.test(u)){w("linux");return}w("unknown")},[]),a.useEffect(()=>{let u=!1;return(async()=>{try{const E=await M("/api/config/settings",{method:"GET",headers:{Accept:"application/json"}});if(!E.ok)return;const l=await E.json().catch(()=>null);if(!l||u)return;const d=typeof l.opencodeBinary=="string"?l.opencodeBinary.trim():"";d&&j(d)}catch{}})(),()=>{u=!0}},[]);const g=a.useCallback(async u=>{u.target.closest("button, a, input, select, textarea, code")||u.button===0&&y&&await re()},[y]),k=a.useCallback(async()=>{try{const u=await M("/health");if(!u.ok)return!1;const E=await u.json();return E.openCodeRunning===!0||E.isOpenCodeReady===!0}catch{return!1}},[]),K=a.useCallback(async()=>{if(!(typeof window>"u")&&y)try{const u=await ae();u.success&&u.path&&u.path.trim().length>0&&j(u.path.trim())}catch{}},[y]),L=a.useCallback(async()=>{N(!0);try{if(await le({opencodeBinary:C.trim()}),y){await B();return}await M("/api/config/reload",{method:"POST"})}finally{setTimeout(()=>N(!1),1e3)}},[y,C]),A=a.useCallback(async()=>{const u=await ce(ge);u.ok?(i(!0),setTimeout(()=>i(!1),2e3)):console.error("Failed to copy:",u.error)},[]),_=a.useCallback(async()=>{m(!0),R(null);try{await k()?e?.():R(o("onboarding.localSetup.errors.cliNotReady"))}catch(u){R(u instanceof Error?u.message:o("onboarding.localSetup.errors.detectionFailed"))}finally{m(!1)}},[k,e,o]),P=ye,H=p==="windows"?"C:\\Users\\you\\AppData\\Roaming\\npm\\opencode.cmd":p==="linux"?"/home/you/.bun/bin/opencode":"/Users/you/.bun/bin/opencode";return t.jsxs("div",{className:"h-full flex items-center justify-center bg-transparent p-8 relative cursor-default select-none",onMouseDown:g,children:[t.jsxs("div",{className:"w-full max-w-lg space-y-4 text-center",children:[t.jsx("div",{className:"flex items-center",children:t.jsx(U,{variant:"ghost",onClick:r,className:"p-0 text-muted-foreground hover:text-foreground",children:o("onboarding.common.actions.back")})}),t.jsxs("div",{className:"space-y-4",children:[t.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-foreground",children:o("onboarding.localSetup.title")}),t.jsx("p",{className:"text-muted-foreground",children:o("onboarding.localSetup.description")})]}),p==="windows"&&t.jsxs("div",{className:"mx-auto max-w-2xl rounded-lg border border-border bg-background/50 p-4 text-left",children:[t.jsx("div",{className:"text-sm text-foreground",children:o("onboarding.localSetup.windows.title")}),t.jsxs("ol",{className:"mt-2 list-decimal space-y-1 pl-5 text-sm text-muted-foreground",children:[t.jsx("li",{children:o("onboarding.localSetup.windows.stepRunInstallInWsl")}),t.jsx("li",{children:o("onboarding.localSetup.windows.stepSetBinaryPath")})]})]}),t.jsx("div",{className:"flex justify-center",children:t.jsx("div",{className:"bg-background/60 backdrop-blur-sm border border-border rounded-lg px-5 py-3 font-mono text-sm w-fit",children:b?t.jsxs("div",{className:"flex items-center justify-center gap-2",style:{color:"var(--status-success)"},children:[t.jsx(T,{name:"check",className:"h-4 w-4"}),o("onboarding.common.status.copiedToClipboard")]}):t.jsx(ve,{onCopy:A,copyTitle:o("onboarding.common.copyToClipboard")})})}),t.jsxs("a",{href:P,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-1 justify-center",children:[o(p==="windows"?"onboarding.localSetup.docs.windows":"onboarding.localSetup.docs.default"),t.jsx(T,{name:"external-link",className:"h-3 w-3"})]}),v&&t.jsx("div",{className:"mx-auto max-w-md rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive",children:v}),t.jsxs("div",{className:"space-y-3",children:[t.jsx(U,{type:"button",onClick:_,disabled:f,className:"w-full max-w-xs",size:"lg",children:o(f?"onboarding.localSetup.actions.checking":"onboarding.localSetup.actions.checkAndContinue")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("onboarding.localSetup.helper.checkAndContinue")})]}),t.jsx("div",{className:"mx-auto w-full max-w-xl pt-4",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:o("onboarding.localSetup.field.alreadyInstalled")}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(z,{value:C,onChange:u=>j(u.target.value),placeholder:H,disabled:S,className:"flex-1 font-mono text-xs"}),t.jsx(U,{type:"button",variant:"secondary",onClick:K,disabled:S||!y,children:o("onboarding.localSetup.actions.browse")}),t.jsx(U,{type:"button",onClick:L,disabled:S,children:o("onboarding.localSetup.actions.apply")})]}),t.jsx("div",{className:"text-xs text-muted-foreground/70",children:o("onboarding.localSetup.helper.saveAndReload")})]})}),c&&n&&t.jsxs("div",{className:"text-center pt-4",children:[t.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:o("onboarding.localSetup.remotePreference")}),t.jsx(U,{variant:"link",onClick:n,children:o("onboarding.localSetup.actions.connectRemoteServer")})]})]}),s&&t.jsx("div",{className:"absolute bottom-8 left-0 right-0 text-center space-y-1",children:p==="windows"?t.jsx(t.Fragment,{children:t.jsx("p",{className:"text-sm text-muted-foreground/70",children:o("onboarding.localSetup.windows.hintDetectionFailed")})}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-sm text-muted-foreground/70",children:o("onboarding.localSetup.hint.ensurePath")}),t.jsx("p",{className:"text-sm text-muted-foreground/70",children:o("onboarding.localSetup.hint.setEnv")}),t.jsx("p",{className:"text-sm text-muted-foreground/70",children:o("onboarding.localSetup.hint.missingRuntime")})]})})]})}function X(r,e){if(r?.trim())return Q(r.trim());if(e)return Q(e)}function ke(r,e,c){switch(r){case"local-unavailable":return{title:"Local OpenCode Unavailable",description:"OpenCode CLI could not be started or is not installed. Install OpenCode or connect to a remote server instead.",titleKey:"onboarding.desktopRecovery.localUnavailable.title",descriptionKey:"onboarding.desktopRecovery.localUnavailable.description",iconKey:"local",showRetry:!0,retryLabel:"Retry Local",retryLabelKey:"onboarding.desktopRecovery.localUnavailable.retry",showUseLocal:!0,showUseRemote:!0,useLocalLabel:"Set Up Local",useLocalLabelKey:"onboarding.desktopRecovery.localUnavailable.useLocal",useRemoteLabel:"Use Remote",useRemoteLabelKey:"onboarding.desktopRecovery.common.useRemote"};case"remote-missing":return{title:"No Default Connection",description:"Your saved default connection could not be found. Choose how you want to connect.",titleKey:"onboarding.desktopRecovery.noDefaultConnection.title",descriptionKey:"onboarding.desktopRecovery.noDefaultConnection.description",iconKey:"local",showRetry:!1,showUseLocal:!0,showUseRemote:!0,useLocalLabel:"Use Local",useLocalLabelKey:"onboarding.desktopRecovery.common.useLocal",useRemoteLabel:"Use Remote",useRemoteLabelKey:"onboarding.desktopRecovery.common.useRemote"};case"remote-unreachable":{const n=X(e,c);return{title:"Remote Server Unreachable",description:`Could not connect to "${n||"the remote server"}". Check your network connection and verify the server address.`,titleKey:"onboarding.desktopRecovery.remoteUnreachable.title",descriptionKey:"onboarding.desktopRecovery.remoteUnreachable.description",descriptionParams:n?{host:n}:void 0,iconKey:"remote",showRetry:!0,retryLabel:"Retry Connection",retryLabelKey:"onboarding.desktopRecovery.remoteUnreachable.retry",showUseLocal:!0,showUseRemote:!0,useLocalLabel:"Use Local",useLocalLabelKey:"onboarding.desktopRecovery.common.useLocal",useRemoteLabel:"Use Remote",useRemoteLabelKey:"onboarding.desktopRecovery.common.useRemote"}}case"remote-wrong-service":{const n=X(e,c);return{title:"Incompatible Server",description:`The server at "${n||"unknown"}" is not running OpenChamber. Verify the address points to an OpenChamber server.`,titleKey:"onboarding.desktopRecovery.incompatibleServer.title",descriptionKey:"onboarding.desktopRecovery.incompatibleServer.description",descriptionParams:n?{host:n}:void 0,iconKey:"remote",showRetry:!1,showUseLocal:!0,showUseRemote:!0,useLocalLabel:"Use Local",useLocalLabelKey:"onboarding.desktopRecovery.common.useLocal",useRemoteLabel:"Use Remote",useRemoteLabelKey:"onboarding.desktopRecovery.common.useRemote"}}case"remote-incompatible":{const n=X(e,c);return{title:"Server Update Required",description:`The OpenChamber server at "${n||"unknown"}" is not compatible with this app version. Update OpenChamber on the server, then try again.`,titleKey:"onboarding.desktopRecovery.remoteIncompatible.title",descriptionKey:"onboarding.desktopRecovery.remoteIncompatible.description",descriptionParams:n?{host:n}:void 0,iconKey:"remote",showRetry:!0,retryLabel:"Retry Connection",retryLabelKey:"onboarding.desktopRecovery.remoteUnreachable.retry",showUseLocal:!0,showUseRemote:!0,useLocalLabel:"Use Local",useLocalLabelKey:"onboarding.desktopRecovery.common.useLocal",useRemoteLabel:"Use Remote",useRemoteLabelKey:"onboarding.desktopRecovery.common.useRemote"}}case"missing-default-host":return{title:"No Default Connection",description:"Your saved default connection could not be found. Choose how you want to connect.",titleKey:"onboarding.desktopRecovery.noDefaultConnection.title",descriptionKey:"onboarding.desktopRecovery.noDefaultConnection.description",iconKey:"local",showRetry:!1,showUseLocal:!0,showUseRemote:!0,useLocalLabel:"Use Local",useLocalLabelKey:"onboarding.desktopRecovery.common.useLocal",useRemoteLabel:"Use Remote",useRemoteLabelKey:"onboarding.desktopRecovery.common.useRemote"};default:{const n=r;throw new Error(`Unknown recovery variant: ${n}`)}}}function Ce(r){switch(r){case"local":return t.jsx(T,{name:"macbook",className:"h-8 w-8"});case"remote":return t.jsx(T,{name:"server",className:"h-8 w-8"})}}function Ne({variant:r,hostLabel:e,hostUrl:c,onRetry:n,onUseLocal:o,onUseRemote:b,isRetrying:i=!1}){const{t:s}=V(),h=ke(r,e,c),y=h.retryLabelKey??"onboarding.desktopRecovery.actions.retryConnection",x=a.useMemo(()=>{if(h.descriptionParams?.host)return h.descriptionParams;if(r==="remote-unreachable")return{host:s("onboarding.desktopRecovery.placeholders.remoteServer")};if(r==="remote-wrong-service"||r==="remote-incompatible")return{host:s("onboarding.desktopRecovery.placeholders.unknownServer")}},[h.descriptionParams,s,r]);return t.jsx("div",{className:"flex flex-col items-center justify-center h-full p-8",children:t.jsxs("div",{className:"w-full max-w-md space-y-6",children:[t.jsxs("div",{className:"flex flex-col items-center space-y-3 text-center",children:[t.jsx("div",{className:"p-3 rounded-full",style:{backgroundColor:"var(--status-warning)",opacity:.15},children:t.jsx("div",{style:{color:"var(--status-warning)"},children:Ce(h.iconKey)})}),t.jsx("h1",{className:"typography-ui-header text-xl font-semibold text-foreground",children:s(h.titleKey)}),t.jsx("p",{className:"text-muted-foreground text-sm max-w-sm",children:s(h.descriptionKey,x)})]}),c&&(r==="remote-unreachable"||r==="remote-wrong-service"||r==="remote-incompatible")&&t.jsxs("div",{className:"rounded-lg border border-border bg-background/50 p-3",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:s("onboarding.remoteConnection.field.serverAddress")}),t.jsx("div",{className:"font-mono text-sm text-foreground truncate",children:Q(c)})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[h.showRetry&&n&&t.jsxs(U,{onClick:n,disabled:i,className:"w-full",children:[t.jsx(T,{name:"refresh",className:J("h-4 w-4",i&&"animate-spin")}),s(i?"onboarding.desktopRecovery.actions.retrying":y)]}),t.jsxs("div",{className:"flex gap-2",children:[h.showUseLocal&&o&&t.jsxs(U,{variant:"outline",onClick:o,disabled:i,className:"flex-1",children:[t.jsx(T,{name:"macbook",className:"h-4 w-4"}),s(h.useLocalLabelKey)]}),h.showUseRemote&&b&&t.jsxs(U,{variant:"outline",onClick:b,disabled:i,className:"flex-1",children:[t.jsx(T,{name:"server",className:"h-4 w-4"}),s(h.useRemoteLabelKey)]})]})]})]})})}function ne(r,e){if(e==="use-remote")return{kind:"remote-form"};switch(r){case"local-unavailable":return{kind:"local-setup"};case"remote-unreachable":case"remote-incompatible":case"remote-wrong-service":case"remote-missing":case"missing-default-host":return{kind:"switch-default-to-local"};default:{const c=r;throw new Error(`Unhandled RecoveryVariant: ${c}`)}}}function Re(r){const e=W.c(27),{variant:c,hostUrl:n,hostLabel:o,onRetry:b,onChooseRemote:i,showRemoteForm:s,onCloseRemoteForm:h,onSwitchToLocalFromRemote:y,onEnterLocalSetup:x,isRetrying:S}=r,N=s===void 0?!1:s,f=S===void 0?!1:S,m=Se;let v;e[0]!==b?(v=async()=>{if(O()){await B();return}await M("/api/config/reload",{method:"POST"}),b?.()},e[0]=b,e[1]=v):v=e[1];const R=v;let C;e[2]!==x||e[3]!==c?(C=async()=>{if(ne(c,"use-local").kind==="local-setup"){x?.();return}if(await m("local"),O()){await B();return}window.location.reload()},e[2]=x,e[3]=c,e[4]=C):C=e[4];const j=C;let p;e[5]!==i||e[6]!==c?(p=()=>{ne(c,"use-remote").kind==="remote-form"&&i?.()},e[5]=i,e[6]=c,e[7]=p):p=e[7];const w=p;if(N){const k=c==="remote-wrong-service"?"":n||"",K=c==="remote-wrong-service"?"":o||"";let L;e[8]!==i||e[9]!==h?(L=h||(()=>i?.()),e[8]=i,e[9]=h,e[10]=L):L=e[10];let A;e[11]!==x||e[12]!==y?(A=y||(()=>{m("local").then(()=>{O()?B():x?.()})}),e[11]=x,e[12]=y,e[13]=A):A=e[13];let _;return e[14]!==K||e[15]!==k||e[16]!==L||e[17]!==A?(_=t.jsx(ie,{onBack:L,initialUrl:k,initialLabel:K,isRecoveryMode:!0,onSwitchToLocal:A}),e[14]=K,e[15]=k,e[16]=L,e[17]=A,e[18]=_):_=e[18],_}let g;return e[19]!==R||e[20]!==j||e[21]!==w||e[22]!==o||e[23]!==n||e[24]!==f||e[25]!==c?(g=t.jsx(Ne,{variant:c,hostLabel:o,hostUrl:n,onRetry:R,onUseLocal:j,onUseRemote:w,isRetrying:f}),e[19]=R,e[20]=j,e[21]=w,e[22]=o,e[23]=n,e[24]=f,e[25]=c,e[26]=g):g=e[26],g}async function Se(r){if(!O())return;const e=await Z();await ee({...e,...r==="local"?{defaultHostId:"local"}:{},initialHostChoiceCompleted:!0})}function Ke(r){const e=W.c(26),{onBack:c,onCliAvailable:n,mode:o,recoveryVariant:b,recoveryHostUrl:i,recoveryHostLabel:s,onEnterLocalSetup:h}=r,y=o===void 0?"first-launch":o,x=b===void 0?"missing-default-host":b,[S,N]=a.useState(!1),[f,m]=a.useState(!1);let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{m(!1),N(!1)},e[0]=v):v=e[0];let R;e[1]!==y||e[2]!==s||e[3]!==i||e[4]!==x?(R=[y,x,i,s],e[1]=y,e[2]=s,e[3]=i,e[4]=x,e[5]=R):R=e[5],a.useEffect(v,R);const C=f?"local-setup":y;if(C==="recovery"){let p,w;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=()=>N(!1),w=()=>{N(!1),m(!0)},e[6]=p,e[7]=w):(p=e[6],w=e[7]);let g;e[8]!==h?(g=()=>{m(!0),h?.()},e[8]=h,e[9]=g):g=e[9];let k;return e[10]!==s||e[11]!==i||e[12]!==x||e[13]!==S||e[14]!==g?(k=t.jsx(Re,{variant:x,hostUrl:i,hostLabel:s,showRemoteForm:S,onCloseRemoteForm:p,onSwitchToLocalFromRemote:w,onEnterLocalSetup:g}),e[10]=s,e[11]=i,e[12]=x,e[13]=S,e[14]=g,e[15]=k):k=e[15],k}if(C==="local-setup"){let p;e[16]!==c||e[17]!==f?(p=()=>{f?m(!1):c?.()},e[16]=c,e[17]=f,e[18]=p):p=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=()=>N(!0),e[19]=w):w=e[19];let g;return e[20]!==n||e[21]!==f||e[22]!==p?(g=t.jsx(je,{onBack:p,onCliAvailable:n,isFromRecovery:f,onSwitchToRemote:w}),e[20]=n,e[21]=f,e[22]=p,e[23]=g):g=e[23],g}let j;return e[24]!==n?(j=t.jsx(xe,{onCliAvailable:n}),e[24]=n,e[25]=j):j=e[25],j}export{Ke as OnboardingScreen};