@yuriai/web 0.2.29-beta.6 → 0.2.29-beta.7

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 (110) hide show
  1. package/dist/assets/{AgentAvatar-GVufO03R.js → AgentAvatar-BNk56-Uq.js} +1 -1
  2. package/dist/assets/AssistantContactStatus-D0cP0UOu.js +3 -0
  3. package/dist/assets/{AssistantUnreadBadge-DTMRKZCr.js → AssistantUnreadBadge-doY0Hft6.js} +1 -1
  4. package/dist/assets/{AssistantView-uufzeb1u.js → AssistantView-B4mEblYi.js} +1 -1
  5. package/dist/assets/{DiagramView-IJ0lkLlX.js → DiagramView-Diyf4LSt.js} +1 -1
  6. package/dist/assets/{FadeInOnReveal-8NiBU75a.js → FadeInOnReveal-l6XCssmS.js} +1 -1
  7. package/dist/assets/{GuiPluginSurface-D_2lOySl.js → GuiPluginSurface-rMZtD1SR.js} +1 -1
  8. package/dist/assets/{GuiPluginWindow-CW0-Tapi.js → GuiPluginWindow-DXfru2tW.js} +1 -1
  9. package/dist/assets/Icon-p_czvEI7.js +1 -0
  10. package/dist/assets/{ImageLoadingPlaceholder-DTWzB26a.js → ImageLoadingPlaceholder-Dg_CU5VT.js} +1 -1
  11. package/dist/assets/{LoadingImage-B89ghYMH.js → LoadingImage-CcML4X1d.js} +1 -1
  12. package/dist/assets/{MarkdownRenderer-BG5J2mhU.js → MarkdownRenderer-DVKRLcN5.js} +2 -2
  13. package/dist/assets/{MarkdownRendererImpl-eHz56xHD.js → MarkdownRendererImpl-CzpxCCAo.js} +1 -1
  14. package/dist/assets/{MarkstreamRendererImpl-DchZmgl0.js → MarkstreamRendererImpl-BRsSpYVn.js} +1 -1
  15. package/dist/assets/{MobileDetailNavigation-1eLMIXsT.js → MobileDetailNavigation-D_fj0utf.js} +1 -1
  16. package/dist/assets/{MobileResizableSheet-CAj4YGtu.js → MobileResizableSheet-B2GU_fkU.js} +1 -1
  17. package/dist/assets/{MobileShareBridge-gZSJfJFe.js → MobileShareBridge-Cr4nh-gT.js} +2 -2
  18. package/dist/assets/MobileTabPageHeader-l9R9cIsn.js +2 -0
  19. package/dist/assets/{MultiRunWindow-DawaRhCU.js → MultiRunWindow-D22yagDA.js} +1 -1
  20. package/dist/assets/{OnboardingScreen-BdU6Tyax.js → OnboardingScreen-BYD95kJF.js} +1 -1
  21. package/dist/assets/{OverlayScrollbar-CzQC0JQI.js → OverlayScrollbar-CvwSam3X.js} +1 -1
  22. package/dist/assets/{SettingsView-iZoHP7ZH.js → SettingsView-wm-g9vvT.js} +11 -11
  23. package/dist/assets/{SettingsWindow-DcOkFGsW.js → SettingsWindow-B_pQHcHp.js} +1 -1
  24. package/dist/assets/{TerminalView-Cy-KXoO8.js → TerminalView-C8T2MbNS.js} +1 -1
  25. package/dist/assets/{ToolOutputDialog-CMYmDCR4.js → ToolOutputDialog-CwOZ2rK4.js} +1 -1
  26. package/dist/assets/{YuriLogo-BZC0ckt0.js → YuriLogo-Bw8_KAED.js} +1 -1
  27. package/dist/assets/{appThemeRegistry-DeWACE9-.js → appThemeRegistry-CAryUA-D.js} +1 -1
  28. package/dist/assets/{assistant-attachment-cache-DMw2Smc8.js → assistant-attachment-cache-oatc8F4t.js} +1 -1
  29. package/dist/assets/{button-BF2cNEuq.js → button-DC4BhJtL.js} +1 -1
  30. package/dist/assets/{capgoAdapter-7QGwb_Ft.js → capgoAdapter-n0GPI3Ea.js} +1 -1
  31. package/dist/assets/{collapsible-CS5qCQRU.js → collapsible-D87ZOJIG.js} +1 -1
  32. package/dist/assets/{context-menu-C6l4ycZG.js → context-menu-CD5IEDb5.js} +1 -1
  33. package/dist/assets/{diagram-D9-jif9d.js → diagram-BzzPtmNA.js} +1 -1
  34. package/dist/assets/{dialog-r7RRePv5.js → dialog-BCMKa538.js} +1 -1
  35. package/dist/assets/{dropdown-menu.styles-CX8oXdks.js → dropdown-menu.styles-DEOmf_B_.js} +1 -1
  36. package/dist/assets/{es-C8kGYKZo.js → es-C1m4Kl9P.js} +1 -1
  37. package/dist/assets/{fileMentionTouchSelection-dpFpcetU.js → fileMentionTouchSelection-PLpnmqHg.js} +1 -1
  38. package/dist/assets/{fileQueries-DWj9yB2g.js → fileQueries-C2Rs6TPz.js} +1 -1
  39. package/dist/assets/{fileReferenceActions-BBLYnGEx.js → fileReferenceActions-CvDFcgBH.js} +1 -1
  40. package/dist/assets/{fr-BV_9HcN9.js → fr-CnTFShIJ.js} +1 -1
  41. package/dist/assets/{gitApi-7_CLu286.js → gitApi-CP5napwr.js} +3 -3
  42. package/dist/assets/{gitApiHttp-DGAlAuET.js → gitApiHttp-Ddik7PM_.js} +1 -1
  43. package/dist/assets/{host-DB6QzbOw.js → host-D776RHTx.js} +1 -1
  44. package/dist/assets/{image-loading-BUouaouB.js → image-loading-DKQOYtti.js} +1 -1
  45. package/dist/assets/{input-DvF_mp0Y.js → input-BuAMQD1i.js} +1 -1
  46. package/dist/assets/insertionBoundaries-DxuIUK0X.js +1 -0
  47. package/dist/assets/{ja-CIMpz4Z2.js → ja-C975DGmU.js} +1 -1
  48. package/dist/assets/{ko-DPUsuWV1.js → ko-Donv-MLw.js} +1 -1
  49. package/dist/assets/{main-DIWLptmb.js → main-CKdt6zYu.js} +2 -2
  50. package/dist/assets/{main-CDhqjr2O.js → main-CSNJQF6u.js} +12 -12
  51. package/dist/assets/{markdownHeightCache-D02GlOiy.js → markdownHeightCache-gGCb2TW0.js} +1 -1
  52. package/dist/assets/{mcpQueries-ZP9RYRpN.js → mcpQueries-BbNEHTru.js} +1 -1
  53. package/dist/assets/{miniChat-CUOtrJxd.js → miniChat-Qg-TMzPz.js} +2 -2
  54. package/dist/assets/mobile-LXYsDpBs.js +2 -0
  55. package/dist/assets/{mobileBackNavigation-DFGZEe-t.js → mobileBackNavigation-BFnxHmcJ.js} +1 -1
  56. package/dist/assets/{multirun-Bm50cLcf.js → multirun-B1BNFN80.js} +1 -1
  57. package/dist/assets/native-DsqzO52u.js +1 -0
  58. package/dist/assets/{native-config-DPpUUZUE.js → native-config-CxrxYHct.js} +1 -1
  59. package/dist/assets/{persistence-Dta0OwIa.js → persistence-D-rnhgr4.js} +2 -2
  60. package/dist/assets/{pl-ChxP5OZm.js → pl-D22JxKm-.js} +1 -1
  61. package/dist/assets/{projectMeta-BJmwM0K0.js → projectMeta-D4-hBAf0.js} +1 -1
  62. package/dist/assets/{pt-BR-9N8nJVqC.js → pt-BR-D6NkqDFy.js} +1 -1
  63. package/dist/assets/{queryRuntime-CTcigFdj.js → queryRuntime-2dx7jbt9.js} +1 -1
  64. package/dist/assets/{queue-abort-optimistic-mL8MaoCr.js → queue-abort-optimistic-Bix-IUrI.js} +1 -1
  65. package/dist/assets/{readiness-ZMfy8K84.js → readiness-Bo2P-IXf.js} +1 -1
  66. package/dist/assets/{renderElectronMiniChatApp-1hIEJ9QD.js → renderElectronMiniChatApp-C1vzQUQn.js} +2 -2
  67. package/dist/assets/{renderMobileApp-DtZxMBPw.js → renderMobileApp-Bxlepbqn.js} +7 -7
  68. package/dist/assets/{runtime-file-download-o29morT6.js → runtime-file-download-D6bwc3Kj.js} +1 -1
  69. package/dist/assets/{runtime-file-resource-qB_oVdE6.js → runtime-file-resource-BP4P52ry.js} +1 -1
  70. package/dist/assets/{runtimeConfig-pLw4gnz5.js → runtimeConfig-DmZoakxE.js} +1 -1
  71. package/dist/assets/{runtimeEndpointReset-5JI5Tj-e.js → runtimeEndpointReset-CGWAfy_Y.js} +15 -15
  72. package/dist/assets/{scheduledTaskNavigation-BqkeRfVc.js → scheduledTaskNavigation-Bp5rGr3m.js} +1 -1
  73. package/dist/assets/sessionLookup-CgL50yRb.js +1 -0
  74. package/dist/assets/{sortable-tabs-strip-Dc4Jr4ml.js → sortable-tabs-strip-2alRozPo.js} +1 -1
  75. package/dist/assets/{speechSettingsQueries-HRIksqYz.js → speechSettingsQueries-BHjkhNvX.js} +3 -3
  76. package/dist/assets/{src-DME3XM8W.css → src-EZMbcCtg.css} +1 -1
  77. package/dist/assets/{store-BPYoxYhv.js → store-XWRveCM0.js} +2 -2
  78. package/dist/assets/{terminalApi-CPVNQ5DH.js → terminalApi-ChZhb60_.js} +1 -1
  79. package/dist/assets/{textarea-CIhiRPB2.js → textarea-Cj7oz4TZ.js} +1 -1
  80. package/dist/assets/{tooltip-BoAbDVNP.js → tooltip-BUDeDvMc.js} +1 -1
  81. package/dist/assets/{types-YPHToBnK.js → types-D7m_3iXu.js} +1 -1
  82. package/dist/assets/{uk-C-aeGNQI.js → uk-DEV7vjeo.js} +1 -1
  83. package/dist/assets/{useAppFontEffects-B1m1Chi0.js → useAppFontEffects-DupRRD7K.js} +28 -28
  84. package/dist/assets/{useAssistantUIStore-CYyXdd5c.js → useAssistantUIStore-BI_dAUjx.js} +1 -1
  85. package/dist/assets/{useDesktopWindowControlsLayout-BTfHr7J0.js → useDesktopWindowControlsLayout-DBGiDEmg.js} +1 -1
  86. package/dist/assets/{useEffectiveDirectory-Yn0r_C4_.js → useEffectiveDirectory-DB5tS-o5.js} +1 -1
  87. package/dist/assets/{useFontPreferences-UzjDmx4b.js → useFontPreferences-EsJ4FlIp.js} +1 -1
  88. package/dist/assets/{useMobileNavigationStore-BA7xNhOy.js → useMobileNavigationStore-BsWXpW7G.js} +14 -14
  89. package/dist/assets/useUIStore-CoWJ3ROq.js +1 -0
  90. package/dist/assets/{useWorkerHighlightedLines-CmzpUaxp.js → useWorkerHighlightedLines-B76dqB8T.js} +1 -1
  91. package/dist/assets/vendor-tanstack-query-core-Y_YoRHtC.js +1 -0
  92. package/dist/assets/vendor-tanstack-react-query-B-Wpqq5J.js +1 -0
  93. package/dist/assets/{zh-CN-DOchDQti.js → zh-CN-6GRNLBLK.js} +1 -1
  94. package/dist/assets/{zh-TW-Dtigv2CE.js → zh-TW-7oorZFq9.js} +1 -1
  95. package/dist/index.html +16 -16
  96. package/dist/mini-chat.html +16 -16
  97. package/dist/mobile.html +16 -16
  98. package/package.json +1 -1
  99. package/server/lib/opencode/settings-helpers.js +0 -3
  100. package/server/lib/opencode/settings-helpers.test.js +8 -0
  101. package/dist/assets/AssistantContactStatus-CgOdvIWb.js +0 -3
  102. package/dist/assets/Icon-CLLDJn-P.js +0 -1
  103. package/dist/assets/MobileTabPageHeader-DiMMm7-i.js +0 -2
  104. package/dist/assets/insertionBoundaries-MbOUMCNs.js +0 -1
  105. package/dist/assets/mobile-BTUerqBN.js +0 -2
  106. package/dist/assets/native-CILcYDJz.js +0 -1
  107. package/dist/assets/sessionLookup-8R_5W-vC.js +0 -1
  108. package/dist/assets/useUIStore-BDZCXouA.js +0 -1
  109. package/dist/assets/vendor-tanstack-query-core-BWz0ose6.js +0 -1
  110. package/dist/assets/vendor-tanstack-react-query-B2psfNaU.js +0 -1
@@ -0,0 +1 @@
1
+ import{g as e,r as t}from"./runtime-switch-DEZ1K7qW.js";import{a as n,i as r,r as i}from"./vendor-zustand-vDaAPGfl.js";import"./brand-storage-bootstrap-D4BW3w-M.js";var a=null,o=null,s=null,c=new Set,l=!1,u=e=>{if(c.add(e),l||typeof window>`u`)return;l=!0;let t=()=>{for(let e of c)e()};try{window.addEventListener(`pagehide`,t,{capture:!0}),window.addEventListener(`beforeunload`,t,{capture:!0}),window.addEventListener(`visibilitychange`,()=>{typeof document<`u`&&document.visibilityState===`hidden`&&t()}),window.addEventListener(`freeze`,t)}catch{}},d=(e,t)=>{let n;try{n=e()}catch{return}let r=new Map,i=new Set,a,o=()=>{if(a=void 0,r.size===0&&i.size===0)return!0;let e=Array.from(r.entries()),o=Array.from(i);r.clear(),i.clear();let c=!0;for(let[i,a]of e)try{n.setItem(i,JSON.stringify(a,t?.replacer))}catch(e){console.error(`Failed to persist deferred storage value`,e),r.set(i,a),c=!1}for(let e of o)try{n.removeItem(e)}catch(t){console.error(`Failed to remove deferred storage value`,t),i.add(e),c=!1}return c||s(),c},s=()=>{a===void 0&&(a=setTimeout(o,0))};return u(o),{getItem:e=>{if(r.has(e))return r.get(e)??null;if(i.has(e))return null;let a=e=>e===null?null:JSON.parse(e,t?.reviver),o=n.getItem(e);return o instanceof Promise?o.then(a):a(o)},setItem:(e,t)=>{r.set(e,t),i.delete(e),s()},removeItem:e=>{r.delete(e),i.add(e),s()},flush:o}},f=e=>d(()=>h(),e),ee=e=>{let t=new Map,n=new Set,r,i=()=>{if(r=void 0,t.size===0&&n.size===0)return;let i=Array.from(t.entries()),a=Array.from(n);t.clear(),n.clear();for(let[t,n]of i)try{e.setItem(t,n)}catch(e){console.error(`Failed to persist deferred storage value`,e)}for(let t of a)try{e.removeItem(t)}catch(e){console.error(`Failed to remove deferred storage value`,e)}},a=()=>{r===void 0&&(r=setTimeout(i,0))};return u(i),{getItem:r=>t.has(r)?t.get(r)??null:n.has(r)?null:e.getItem(r),setItem:(e,r)=>{t.set(e,r),n.delete(e),a()},removeItem:e=>{t.delete(e),n.add(e),a()},clear:()=>{t.clear(),n.clear(),r!==void 0&&(clearTimeout(r),r=void 0),e.clear()},key:t=>e.key(t),get length(){return e.length}}},p=e=>{if(typeof window>`u`)return null;try{return window[e]??null}catch{return null}},m=()=>{let e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,n)=>{e.set(t,n)},removeItem:t=>{e.delete(t)},clear:()=>{e.clear()},key:t=>Array.from(e.keys())[t]??null,get length(){return e.size}}},te=()=>{let e=p(`localStorage`);if(!e)return m();let t=m(),n=!0,r=()=>{n=!1};return{getItem:i=>{if(n)try{let t=e.getItem(i);if(t!==null)return t}catch{r()}return t.getItem(i)},setItem:(i,a)=>{if(n)try{e.setItem(i,a),t.removeItem(i);return}catch{r();try{e.removeItem(i)}catch{}}t.setItem(i,a)},removeItem:n=>{try{e.removeItem(n)}catch{r()}t.removeItem(n)},clear:()=>{try{e.clear()}catch{r()}t.clear()},key:i=>{if(n)try{return e.key(i)}catch{r()}return t.key(i)},get length(){if(n)try{return e.length+t.length}catch{r()}return t.length}}},h=()=>(a||=te(),a),ne=()=>(s||=ee(h()),s),re=()=>{let e=p(`sessionStorage`);if(!e)return m();let t=m(),n=!0,r=()=>{n=!1};return{getItem:i=>{if(n)try{let t=e.getItem(i);if(t!==null)return t}catch{r()}return t.getItem(i)},setItem:(i,a)=>{if(n)try{e.setItem(i,a),t.removeItem(i);return}catch{r();try{e.removeItem(i)}catch{}}t.setItem(i,a)},removeItem:n=>{try{e.removeItem(n)}catch{r()}t.removeItem(n)},clear:()=>{try{e.clear()}catch{r()}t.clear()},key:i=>{if(n)try{return e.key(i)}catch{r()}return t.key(i)},get length(){if(n)try{return e.length+t.length}catch{r()}return t.length}}},ie=()=>(o||=re(),o);function ae(e,t){return t>=12?e:(e.chatRenderMode===`live`&&(e.chatRenderMode=`sorted`),e.activityRenderMode===`summary`&&(e.activityRenderMode=`collapsed`),e.showTurnChangedFiles===!1&&(e.showTurnChangedFiles=!0),e)}var g={markdown:`0.875rem`,code:`0.75rem`,uiHeader:`0.9375rem`,uiLabel:`0.8750rem`,meta:`0.875rem`,micro:`0.875rem`},oe={markdown:`0.9375rem`,code:`0.8125rem`,uiHeader:`0.875rem`,uiLabel:`0.8125rem`,meta:`0.8125rem`,micro:`0.75rem`},se={markdown:`0.9063rem`,code:`0.8750rem`,uiHeader:`0.9063rem`,uiLabel:`0.8438rem`,meta:`0.8438rem`,micro:`0.7813rem`};function _(e){return`--text-${e.replace(/([A-Z])/g,`-$1`).toLowerCase()}`}function v(e=document.documentElement){return e.classList.contains(`mobile-pointer`)&&!e.classList.contains(`desktop-runtime`)}function ce(e,t){return t?.mobile?oe[e]:g[e]}var y={semanticMarkdown:{fontSize:`var(--text-markdown)`},semanticCode:{fontSize:`var(--text-code)`},uiHeader:{fontSize:`var(--text-ui-header)`},uiLabel:{fontSize:`var(--text-ui-label)`},meta:{fontSize:`var(--text-meta)`},micro:{fontSize:`var(--text-micro)`},ui:{button:{fontSize:`var(--text-ui-label)`,lineHeight:`var(--ui-button-line-height)`,letterSpacing:`var(--ui-button-letter-spacing)`,fontWeight:`var(--ui-button-font-weight)`},buttonSmall:{fontSize:`var(--text-meta)`,lineHeight:`var(--ui-button-small-line-height)`,letterSpacing:`var(--ui-button-small-letter-spacing)`,fontWeight:`var(--ui-button-small-font-weight)`},buttonLarge:{fontSize:`var(--text-ui-label)`,lineHeight:`var(--ui-button-large-line-height)`,letterSpacing:`var(--ui-button-large-letter-spacing)`,fontWeight:`var(--ui-button-large-font-weight)`},label:{fontSize:`var(--text-meta)`,lineHeight:`var(--ui-label-line-height)`,letterSpacing:`var(--ui-label-letter-spacing)`,fontWeight:`var(--ui-label-font-weight)`},caption:{fontSize:`var(--text-micro)`,lineHeight:`var(--ui-caption-line-height)`,letterSpacing:`var(--ui-caption-letter-spacing)`,fontWeight:`var(--ui-caption-font-weight)`},badge:{fontSize:`var(--text-micro)`,lineHeight:`var(--ui-badge-line-height)`,letterSpacing:`var(--ui-badge-letter-spacing)`,fontWeight:`var(--ui-badge-font-weight)`},tooltip:{fontSize:`var(--text-micro)`,lineHeight:`var(--ui-tooltip-line-height)`,letterSpacing:`var(--ui-tooltip-letter-spacing)`,fontWeight:`var(--ui-tooltip-font-weight)`},input:{fontSize:`var(--text-ui-label)`,lineHeight:`var(--ui-input-line-height)`,letterSpacing:`var(--ui-input-letter-spacing)`,fontWeight:`var(--ui-input-font-weight)`},helperText:{fontSize:`var(--text-meta)`,lineHeight:`var(--ui-helper-text-line-height)`,letterSpacing:`var(--ui-helper-text-letter-spacing)`,fontWeight:`var(--ui-helper-text-font-weight)`}},code:{inline:{fontSize:`var(--text-code)`,lineHeight:`var(--code-inline-line-height)`,letterSpacing:`var(--code-inline-letter-spacing)`,fontWeight:`var(--code-inline-font-weight)`},block:{fontSize:`var(--text-code)`,lineHeight:`var(--code-block-line-height)`,letterSpacing:`var(--code-block-letter-spacing)`,fontWeight:`var(--code-block-font-weight)`},lineNumbers:{fontSize:`var(--text-micro)`,lineHeight:`var(--code-line-numbers-line-height)`,letterSpacing:`var(--code-line-numbers-letter-spacing)`,fontWeight:`var(--code-line-numbers-font-weight)`}},markdown:{body:{fontSize:`var(--text-markdown)`,lineHeight:`var(--markdown-body-line-height)`,letterSpacing:`var(--markdown-body-letter-spacing)`,fontWeight:`var(--markdown-body-font-weight)`},bodySmall:{fontSize:`var(--text-meta)`,lineHeight:`var(--markdown-body-small-line-height)`,letterSpacing:`var(--markdown-body-small-letter-spacing)`,fontWeight:`var(--markdown-body-small-font-weight)`},bodyLarge:{fontSize:`var(--text-markdown)`,lineHeight:`var(--markdown-body-large-line-height)`,letterSpacing:`var(--markdown-body-large-letter-spacing)`,fontWeight:`var(--markdown-body-large-font-weight)`},blockquote:{fontSize:`var(--text-markdown)`,lineHeight:`var(--markdown-blockquote-line-height)`,letterSpacing:`var(--markdown-blockquote-letter-spacing)`,fontWeight:`var(--markdown-blockquote-font-weight)`},list:{fontSize:`var(--text-markdown)`,lineHeight:`var(--markdown-list-line-height)`,letterSpacing:`var(--markdown-list-letter-spacing)`,fontWeight:`var(--markdown-list-font-weight)`},link:{fontSize:`var(--text-markdown)`,lineHeight:`var(--markdown-link-line-height)`,letterSpacing:`var(--markdown-link-letter-spacing)`,fontWeight:`var(--markdown-link-font-weight)`},code:{fontSize:`var(--text-code)`,lineHeight:`var(--markdown-code-line-height)`,letterSpacing:`var(--markdown-code-letter-spacing)`,fontWeight:`var(--markdown-code-font-weight)`},codeBlock:{fontSize:`var(--text-code)`,lineHeight:`var(--markdown-code-block-line-height)`,letterSpacing:`var(--markdown-code-block-letter-spacing)`,fontWeight:`var(--markdown-code-block-font-weight)`}},tool:{collapsed:{fontSize:`var(--text-code)`,lineHeight:`var(--code-block-line-height)`,letterSpacing:`var(--code-block-letter-spacing)`,fontWeight:`var(--code-block-font-weight)`},popup:{fontSize:`var(--text-code)`,lineHeight:`var(--code-block-line-height)`,letterSpacing:`var(--code-block-letter-spacing)`,fontWeight:`var(--code-block-font-weight)`},inline:{fontSize:`var(--text-code)`,lineHeight:`var(--code-inline-line-height)`,letterSpacing:`var(--code-inline-letter-spacing)`,fontWeight:`var(--code-inline-font-weight)`}}},b={padding:{collapsed:`0.375rem`,popup:`0.75rem`,popupContainer:`1rem`},backgroundOpacity:{muted:`30`,mutedAlt:`50`},getCollapsedStyles:()=>({...y.tool.collapsed,background:`transparent`,backgroundColor:`transparent`,margin:0,padding:b.padding.collapsed,borderRadius:0}),getPopupStyles:()=>({...y.tool.popup,background:`transparent`,backgroundColor:`transparent`,margin:0,padding:b.padding.popup,borderRadius:`0.75rem`}),getPopupContainerStyles:()=>({...y.tool.popup,background:`transparent`,backgroundColor:`transparent`,margin:0,padding:b.padding.popupContainer,borderRadius:`0.5rem`,overflowX:`auto`}),getInlineStyles:()=>({...y.tool.inline})},x=[{id:`inter`,label:`Inter`,description:`Modern UI sans with excellent readability at small sizes.`,stack:`"Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,source:{family:`Inter`,packageName:`@fontsource/inter`,filePrefix:`inter`,weights:[400,500,600]}},{id:`geist-sans`,label:`Geist Sans`,description:`Crisp sans-serif with a technical interface feel.`,stack:`"Geist Sans", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,source:{family:`Geist Sans`,packageName:`@fontsource/geist-sans`,filePrefix:`geist-sans`,weights:[400,500,600]}},{id:`atkinson-hyperlegible`,label:`Atkinson Hyperlegible`,description:`Accessibility-focused sans-serif optimized for character distinction.`,stack:`"Atkinson Hyperlegible", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,source:{family:`Atkinson Hyperlegible`,packageName:`@fontsource/atkinson-hyperlegible`,filePrefix:`atkinson-hyperlegible`,weights:[400,700]}},{id:`source-sans-3`,label:`Source Sans 3`,description:`Adobe sans-serif tuned for clean, readable interfaces.`,stack:`"Source Sans 3", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,source:{family:`Source Sans 3`,packageName:`@fontsource/source-sans-3`,filePrefix:`source-sans-3`,weights:[400,500,600]}},{id:`roboto`,label:`Roboto`,description:`Familiar Material-style sans-serif with broad UI usage.`,stack:`"Roboto", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,source:{family:`Roboto`,packageName:`@fontsource/roboto`,filePrefix:`roboto`,weights:[400,500,600]}},{id:`noto-sans`,label:`Noto Sans`,description:`Readable sans-serif with strong international coverage.`,stack:`"Noto Sans", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,source:{family:`Noto Sans`,packageName:`@fontsource/noto-sans`,filePrefix:`noto-sans`,weights:[400,500,600]}},{id:`dm-sans`,label:`DM Sans`,description:`Modern product UI sans-serif with friendly proportions.`,stack:`"DM Sans", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,source:{family:`DM Sans`,packageName:`@fontsource/dm-sans`,filePrefix:`dm-sans`,weights:[400,500,600]}},{id:`manrope`,label:`Manrope`,description:`Polished geometric sans-serif for modern app interfaces.`,stack:`"Manrope", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,source:{family:`Manrope`,packageName:`@fontsource/manrope`,filePrefix:`manrope`,weights:[400,500,600]}},{id:`system`,label:`System`,description:`Native operating system interface font.`,stack:`-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`}],le=[{id:`jetbrains-mono`,label:`JetBrains Mono`,description:`Developer-focused monospace with strong punctuation clarity.`,stack:`"JetBrains Mono", "SFMono-Regular", "Menlo", monospace`,source:{family:`JetBrains Mono`,packageName:`@fontsource/jetbrains-mono`,filePrefix:`jetbrains-mono`,weights:[400,500,600]}},{id:`fira-code`,label:`Fira Code`,description:`Readable coding font with ligature support.`,stack:`"Fira Code", "SFMono-Regular", "Menlo", monospace`,source:{family:`Fira Code`,packageName:`@fontsource/fira-code`,filePrefix:`fira-code`,weights:[400,500,600]}},{id:`geist-mono`,label:`Geist Mono`,description:`Sharp monospace pair for Geist Sans.`,stack:`"Geist Mono", "SFMono-Regular", "Menlo", monospace`,source:{family:`Geist Mono`,packageName:`@fontsource/geist-mono`,filePrefix:`geist-mono`,weights:[400,500,600]}},{id:`commit-mono`,label:`Commit Mono`,description:`Code-oriented monospace with polished editor ergonomics.`,stack:`"Commit Mono", "SFMono-Regular", "Menlo", monospace`,source:{family:`Commit Mono`,packageName:`@fontsource/commit-mono`,filePrefix:`commit-mono`,weights:[400,500,600]}},{id:`source-code-pro`,label:`Source Code Pro`,description:`Adobe monospace designed for source code readability.`,stack:`"Source Code Pro", "SFMono-Regular", "Menlo", monospace`,source:{family:`Source Code Pro`,packageName:`@fontsource/source-code-pro`,filePrefix:`source-code-pro`,weights:[400,500,600]}},{id:`cascadia-code`,label:`Cascadia Code`,description:`Microsoft coding font popular in terminals and editors.`,stack:`"Cascadia Code", "SFMono-Regular", "Menlo", monospace`,source:{family:`Cascadia Code`,packageName:`@fontsource/cascadia-code`,filePrefix:`cascadia-code`,weights:[400,500,600]}},{id:`roboto-mono`,label:`Roboto Mono`,description:`Neutral monospace companion to Roboto.`,stack:`"Roboto Mono", "SFMono-Regular", "Menlo", monospace`,source:{family:`Roboto Mono`,packageName:`@fontsource/roboto-mono`,filePrefix:`roboto-mono`,weights:[400,500,600]}},{id:`iosevka`,label:`Iosevka`,description:`Compact monospace for dense code and terminal layouts.`,stack:`"Iosevka", "SFMono-Regular", "Menlo", monospace`,source:{family:`Iosevka`,packageName:`@fontsource/iosevka`,filePrefix:`iosevka`,weights:[400,500,600]}},{id:`system-mono`,label:`System Mono`,description:`Native operating system monospace font.`,stack:`ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`}],ue=e=>Object.fromEntries(e.map(e=>[e.id,e])),de=ue(x),S=ue(le),C=`system`,w=`system-mono`,fe=e=>typeof e==`string`&&e in de,pe=e=>typeof e==`string`&&e in S,T=`yuri.mobileKeyboardMode`,me=`meta[name="viewport"]`,E=`width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover`,he=()=>!0;function D(e,t=`resize-content`){return e===`native`||e===`resize-content`?e:t}var ge=e=>D(e)===`resize-content`?`${E}, interactive-widget=resizes-content`:E,_e=()=>{if(typeof window>`u`)return`resize-content`;try{return D(localStorage.getItem(T))}catch{return`resize-content`}},O=e=>{let t=D(e);if(typeof window<`u`)try{t===`resize-content`?localStorage.removeItem(T):localStorage.setItem(T,t)}catch{}return t},ve=e=>{let t=O(e);if(typeof document>`u`)return t;document.documentElement.setAttribute(`data-yuri-mobile-keyboard-mode`,t);let n=document.querySelector(me);if(n instanceof HTMLMetaElement){let e=ge(t);n.getAttribute(`content`)!==e&&n.setAttribute(`content`,e)}return t};function k(e){return e===`vim`?`vim`:`default`}var ye={completion:{title:`{agent_name} is ready`,message:`{last_message}`},error:{title:`Tool error`,message:`{last_message}`},question:{title:`{agent_name} needs input`,message:`{last_message}`},subtask:{title:`Subtask complete`,message:`{last_message}`}},be={completion:{title:`Task completed`,message:`{session_name}`},error:{title:`Something went wrong`,message:`{session_name}`},question:{title:`Needs your answer`,message:`{session_name}`},subtask:{title:`Task completed`,message:`{session_name}`}},xe={completion:{title:`{agent_name} is ready`,message:`{model_name} completed the task`},error:{title:`Tool error`,message:`{last_message}`},question:{title:`Input needed`,message:`{last_message}`},subtask:{title:`{agent_name} is ready`,message:`{model_name} completed the task`}},A={completion:{title:``,message:``},error:{title:``,message:``},question:{title:``,message:``},subtask:{title:``,message:``}},j=(e,t)=>e?e.title===t.title&&e.message===t.message:!1,Se=e=>{if(!e||typeof e!=`object`)return!1;let t=e,n=e=>j(t.completion,e.completion)&&j(t.error,e.error)&&j(t.question,e.question)&&j(t.subtask,e.subtask);return n(ye)||n(be)||n(xe)},M=600,Ce=300,we=1400,Te=12,Ee=40,De=120,N=260,P=360,F=new Map,I=e=>(e??t()).trim()||`default`,L=e=>{if(!e)return``;let t=e.replace(/\\/g,`/`),n=t.startsWith(`//`),r=t.replace(/\/+$/g,``);return r=r.replace(/\/+/g,`/`),n&&!r.startsWith(`//`)&&(r=`/${r}`),r===``?t.startsWith(`/`)?`/`:``:r},R=e=>Number.isFinite(e)?Math.min(we,Math.max(Ce,Math.round(e))):M,z=e=>{if(typeof e!=`string`)return null;let t=e.trim();return t?t.replace(/\\/g,`/`):null},B=e=>{if(typeof e!=`string`)return null;let t=e.trim();return t?t.length>De?t.slice(0,De):t:null},V=e=>e===`working`||e===`staged`||e===`turn`?e:null,H=e=>typeof e==`string`&&e.trim()||null,U=e=>typeof e==`string`&&e.trim()||null,Oe=(e,t)=>(e===`file`||e===`preview`)&&t||e,ke=(e,t,n)=>{if(e===`diff`||e===`file-diff`)return e;if(typeof n==`string`){let e=n.trim();if(e)return e}return Oe(e,t)},W=(e,t)=>t===e?e:`${e}:${t}`,G=e=>e===`turn-diff-outside-workspace`?e:null,Ae=e=>{let t=z(e.targetPath),n=ke(e.mode,t,e.dedupeKey);return{id:W(e.mode,n),mode:e.mode,targetPath:t,dedupeKey:n,label:B(e.label),sessionTitleFallback:B(e.sessionTitleFallback),readOnly:e.readOnly===!0,stagedDiff:e.stagedDiff===!0,diffScope:V(e.diffScope)??(e.stagedDiff===!0?`staged`:`working`),diffTargetLine:typeof e.diffTargetLine==`number`&&Number.isFinite(e.diffTargetLine)?Math.max(1,Math.trunc(e.diffTargetLine)):null,diffTurnMessageId:H(e.diffTurnMessageId),diffSessionId:U(e.diffSessionId),fileNotice:e.mode===`file`?G(e.fileNotice):null,touchedAt:Date.now()}},je=(e,t,n)=>{if(e.length<=t)return e;let r=[...e].sort((e,t)=>e.touchedAt-t.touchedAt).filter(e=>e.id!==n),i=e.length-t;if(i<=0||r.length===0)return e.slice(-t);let a=new Set(r.slice(0,i).map(e=>e.id));return e.filter(e=>!a.has(e.id))},Me=e=>{if(!Array.isArray(e))return[];let t=[],n=new Set;for(let r of e){if(!r||typeof r!=`object`)continue;let e=r;if(e.mode!==`diff`&&e.mode!==`file-diff`&&e.mode!==`file`&&e.mode!==`context`&&e.mode!==`chat`&&e.mode!==`preview`&&e.mode!==`browser`&&e.mode!==`btw`)continue;let i=z(typeof e.targetPath==`string`?e.targetPath:null),a=ke(e.mode,i,typeof e.dedupeKey==`string`?e.dedupeKey:null),o=W(e.mode,a);!o||n.has(o)||(n.add(o),t.push({id:o,mode:e.mode,targetPath:i,dedupeKey:a,label:B(typeof e.label==`string`?e.label:null),sessionTitleFallback:B(typeof e.sessionTitleFallback==`string`?e.sessionTitleFallback:null),readOnly:e.readOnly===!0,stagedDiff:e.stagedDiff===!0,diffScope:V(e.diffScope)??(e.stagedDiff===!0?`staged`:`working`),diffTargetLine:typeof e.diffTargetLine==`number`&&Number.isFinite(e.diffTargetLine)?Math.max(1,Math.trunc(e.diffTargetLine)):null,diffTurnMessageId:H(e.diffTurnMessageId),diffSessionId:U(e.diffSessionId),fileNotice:e.mode===`file`?G(e.fileNotice):null,touchedAt:typeof e.touchedAt==`number`&&Number.isFinite(e.touchedAt)?e.touchedAt:Date.now()}))}return t},K=(e,t)=>t&&e.some(e=>e.id===t)?t:e.length===0?null:e[e.length-1].id,q=e=>{if(e){let t=Me(e.tabs),n=K(t,e.activeTabId);return{...e,tabs:t,activeTabId:n,touchedAt:Date.now()}}return{isOpen:!1,expanded:!1,tabs:[],activeTabId:null,width:M,touchedAt:Date.now()}},Ne={isOpen:!0,activeView:`rail`,expanded:!1,tabs:[],activeTabId:null,width:M,touchedAt:0},J=(e,t)=>{let n=L(t.trim());if(n)return e.contextPanelByDirectory[n]??(e.isRightSidebarOpen&&Object.keys(e.contextPanelByDirectory).length===0?Ne:void 0)},Pe=e=>{let t=e;for(let[n,r]of Object.entries(e))!r.isOpen||r.activeView!==`preview`||(t===e&&(t={...e}),t[n]={...r,activeView:`rail`});return t},Fe=(e,t)=>{let n=Ae(t),r=e.tabs.findIndex(e=>e.id===n.id),i=r===-1?[...e.tabs,n]:e.tabs.map((e,t)=>t===r?{...e,diffTargetLine:n.diffTargetLine,diffTurnMessageId:n.diffTurnMessageId,diffSessionId:n.diffSessionId,mode:n.mode,targetPath:n.targetPath||e.targetPath,dedupeKey:n.dedupeKey,label:n.label,sessionTitleFallback:n.sessionTitleFallback||e.sessionTitleFallback,stagedDiff:n.stagedDiff,diffScope:n.diffScope,readOnly:n.readOnly,fileNotice:n.mode===`file`?n.fileNotice:null,touchedAt:Date.now()}:e),a=n.id,o=je(i,Te,a);return{...e,isOpen:!0,activeView:`preview`,tabs:o,activeTabId:K(o,a),touchedAt:Date.now()}},Ie=(e,t)=>{let n=e.tabs.filter(e=>e.id!==t),r=e.activeTabId===t?n[n.length-1]?.id??null:K(n,e.activeTabId);return{...e,tabs:n,isOpen:e.isOpen&&n.length>0,activeTabId:r,touchedAt:Date.now()}},Le=(e,t,n)=>{if(t===n)return e;let r=e.tabs.findIndex(e=>e.id===t),i=e.tabs.findIndex(e=>e.id===n);if(r===-1||i===-1)return e;let a=[...e.tabs],[o]=a.splice(r,1);return o?(a.splice(i,0,o),{...e,tabs:a,touchedAt:Date.now()}):e},Re=(e,t,n)=>({...e,tabs:e.tabs.map(e=>e.id===t?{...e,targetPath:n}:e)}),Y=e=>{if(!e||typeof e!=`object`)return{};let t=e,n={};for(let[e,r]of Object.entries(t)){let t=L(e);if(!t||!r||typeof r!=`object`)continue;let i=r,a=Me(i.tabs).filter(e=>e.mode!==`btw`),o=typeof i.activeTabId==`string`?i.activeTabId:null;a.length===0&&(i.mode===`diff`||i.mode===`file-diff`||i.mode===`file`||i.mode===`context`||i.mode===`chat`)&&(a=[Ae({mode:i.mode,targetPath:typeof i.targetPath==`string`?i.targetPath:null,dedupeKey:typeof i.dedupeKey==`string`?i.dedupeKey:null,label:typeof i.label==`string`?i.label:null})],o=a[0]?.id??null);let s=K(a,o),c=je(a,Te,s);n[t]={isOpen:i.isOpen===!0&&(c.length>0||Array.isArray(i.tabs)&&i.tabs.length===0),expanded:i.expanded===!0,tabs:c,activeTabId:K(c,s),width:R(typeof i.width==`number`?i.width:M),touchedAt:typeof i.touchedAt==`number`&&Number.isFinite(i.touchedAt)?i.touchedAt:Date.now()}}return n},X=(e,t)=>{let n=Object.entries(e);if(n.length<=t)return e;n.sort((e,t)=>(t[1]?.touchedAt??0)-(e[1]?.touchedAt??0));let r={};for(let[e,i]of n.slice(0,t))r[e]=i;return r},ze=(e,t)=>{let n=Object.entries(e);if(n.length<=t)return e;n.sort((e,t)=>(t[1]?.touchedAt??0)-(e[1]?.touchedAt??0));let r={};for(let[e,i]of n.slice(0,t))r[e]=i;return r},Be=(e,t)=>{let n=L((t||``).trim())||null,r=n?J(e,n):void 0;return{isRightSidebarOpen:e.isRightSidebarOpen,rightSidebarTab:e.rightSidebarTab,contextPanelDirectory:n,contextPanel:r??null,contextToolDiff:n?e.contextToolDiffByDirectory[n]??null:null,touchedAt:Date.now()}},Ve=(e,t,n)=>{let r=L((t||``).trim());if(!r)return e;let i=e[r],a=n?.contextPanelDirectory===r?n.contextPanel:null;return!i&&!a?e:{...e,[r]:a??{...q(),width:i?.width??M}}},Z=(e,t,n,r)=>{let i=e.contextPanelByDirectory[t],a=i?.tabs.find(e=>e.id===i.activeTabId);return a?.mode===`file`&&a.targetPath===n?!0:e.mainTabGuard?.(`files`,r)??!0},Q=n()(i(r((t,n)=>({theme:`system`,isMultiRunLauncherOpen:!1,isSidebarOpen:!0,sidebarWidth:N,hasManuallyResizedLeftSidebar:!1,isRightSidebarOpen:!0,rightSidebarWidth:P,hasManuallyResizedRightSidebar:!1,rightSidebarTab:`git`,contextPanelByDirectory:{},contextToolDiffByDirectory:{},sessionWorkspacePanelById:{},isBottomTerminalOpen:!1,isBottomTerminalExpanded:!1,bottomTerminalHeight:300,hasManuallyResizedBottomTerminal:!1,isSessionSwitcherOpen:!1,isSessionDropdownOpen:!1,activeMainTab:`chat`,activeGuiPage:null,guiPageReturnTab:`chat`,mainTabGuard:null,sidebarOpenBeforeFullscreenTab:null,pendingDiffFile:null,pendingDiffStaged:!1,pendingDiffScope:null,pendingDiffLine:null,pendingDiagramFile:null,pendingFileNavigation:null,pendingFileFocusPath:null,pendingFileViewerMode:null,isMobile:!1,isCommandPaletteOpen:!1,isHelpDialogOpen:!1,isAboutDialogOpen:!1,isOpenCodeStatusDialogOpen:!1,openCodeStatusText:``,isSessionCreateDialogOpen:!1,isScheduledTasksDialogOpen:!1,scheduledTaskOpenRequest:null,isArchivedSessionsDialogOpen:!1,isSettingsDialogOpen:!1,isNewWorktreeDialogOpen:!1,isModelSelectorOpen:!1,isAgentSelectorOpen:!1,isModelSelectorInstant:!1,isAgentSelectorInstant:!1,sidebarSection:`sessions`,settingsPage:`home`,devicePairingRequested:!1,settingsHasOpenedOnce:!1,settingsProjectsSelectedId:null,settingsRemoteInstancesSelectedId:null,eventStreamStatus:`idle`,eventStreamHint:null,showReasoningTraces:!0,sessionTitleRefreshEnabled:!0,sessionGoalEnabled:!0,collapsibleThinkingBlocks:!0,chatRenderMode:`sorted`,activityRenderMode:`collapsed`,showDeletionDialog:!0,autoDeleteEnabled:!1,autoDeleteAfterDays:30,sessionRetentionAction:`archive`,autoDeleteLastRunAt:null,messageLimit:200,fontSize:100,codeFontSize:100,globalDraftStarters:null,terminalFontSize:13,editorFontSize:13,uiFont:C,monoFont:w,padding:100,cornerRadius:18,inputBarOffset:0,mobileKeyboardMode:_e(),favoriteModels:[],hiddenModels:[],providerOrder:[],collapsedModelProviders:[],recentModels:[],recentAgents:[],recentEfforts:{},diffLayoutPreference:`inline`,diffFileLayout:{},diffWrapLines:!1,gitChangesViewMode:`tree`,isTimelineDialogOpen:!1,isPromptNavigatorPanelOpen:!1,isImagePreviewOpen:!1,nativeNotificationsEnabled:!1,notificationMode:`hidden-only`,notifyOnSubtasks:!1,dockBadgeEnabled:!0,notifyOnCompletion:!0,notifyOnError:!0,notifyOnQuestion:!0,notifyOnPermission:!0,notifyOnScheduledTasks:!0,notifyOnAssistants:!0,notifyOnGoals:!0,notificationTemplates:{completion:{...A.completion},error:{...A.error},question:{...A.question},subtask:{...A.subtask}},summarizeLastMessage:!1,summaryThreshold:200,summaryLength:100,maxLastMessageLength:250,showTerminalQuickKeysOnDesktop:!1,persistChatDraft:!0,showOpenCodeUpdateNotifications:!0,inputSpellcheckEnabled:!1,wideChatLayoutEnabled:!1,codeBlockLineWrap:!0,showToolFileIcons:!0,showTurnChangedFiles:!0,showExpandedBashTools:!1,showSubagentTaskDetails:!1,timeFormatPreference:`auto`,weekStartPreference:`auto`,desktopWindowControlsPosition:`auto`,userMessageRenderingMode:`markdown`,collapsibleUserMessages:!0,stickyUserHeader:!1,promptNavigatorEnabled:!1,showSplitAssistantMessageActions:!1,showAssistantTps:!0,allowPromptingSubagentSessions:!1,isMobileSessionStatusBarCollapsed:!1,mobileSessionPanelOpen:!1,mobileSessionFilterProjectId:null,otaChannelOverride:null,isExpandedInput:!1,workStatusPanelEnabled:!0,workStatusHiddenSections:[],workStatusSectionOrder:[],workStatusExpandedSections:{},workStatusScrollTop:0,workStatusPanelVisible:!1,workStatusPanelFits:!1,workStatusOverlayOpen:!1,reportUsage:!1,shortcutOverrides:{},fileEditorKeymap:`default`,setTheme:e=>{t({theme:e}),n().applyTheme()},toggleSidebar:()=>{t(e=>{let t=!e.isSidebarOpen;return t&&!e.hasManuallyResizedLeftSidebar?{isSidebarOpen:t,sidebarWidth:N}:{isSidebarOpen:t}})},setSidebarOpen:e=>{t(t=>t.isSidebarOpen===e?e&&!t.hasManuallyResizedLeftSidebar&&t.sidebarWidth!==N?{isSidebarOpen:e,sidebarWidth:N}:t:e&&!t.hasManuallyResizedLeftSidebar?{isSidebarOpen:e,sidebarWidth:N}:{isSidebarOpen:e})},setSidebarWidth:e=>{t({sidebarWidth:e,hasManuallyResizedLeftSidebar:!0})},toggleRightSidebar:()=>{n().setRightSidebarOpen(!n().isRightSidebarOpen)},setRightSidebarOpen:e=>{t(t=>{let n=e?Pe(t.contextPanelByDirectory):t.contextPanelByDirectory;return t.isRightSidebarOpen===e&&n===t.contextPanelByDirectory?t:{isRightSidebarOpen:e,contextPanelByDirectory:n,rightSidebarWidth:e&&!t.hasManuallyResizedRightSidebar&&t.rightSidebarWidth!==P?P:t.rightSidebarWidth}})},setRightSidebarWidth:e=>{t({rightSidebarWidth:Math.min(860,Math.max(240,e)),hasManuallyResizedRightSidebar:!0})},setRightSidebarTab:e=>{t(t=>{let n=Pe(t.contextPanelByDirectory);return t.rightSidebarTab===e&&n===t.contextPanelByDirectory?t:{rightSidebarTab:e,contextPanelByDirectory:n}})},syncWorkspacePanelsForSessionSwitch:({previousSessionId:e,previousDirectory:n,nextSessionId:r,nextDirectory:i})=>{let a=typeof e==`string`?e.trim():``,o=typeof r==`string`?r.trim():``;if(a===o)return;let s=e=>JSON.stringify([I(),e]);t(e=>{let t=e.sessionWorkspacePanelById;a&&(t={...t,[s(a)]:Be(e,n)});let r=o?t[s(o)]:void 0;if(!a&&!r&&Object.keys(t).length===0)return e;let c=Ve(e.contextPanelByDirectory,i,r),l=L((n||``).trim()),u=L((i||``).trim()),d=c;if(l&&l!==u){let e=d[l];e&&(d={...d,[l]:{...q(),width:e.width}})}let f=r?r.isRightSidebarOpen:!1,ee=r?.rightSidebarTab??e.rightSidebarTab,p={...e.contextToolDiffByDirectory};return l&&delete p[l],u&&(delete p[u],r?.contextPanelDirectory===u&&r.contextToolDiff&&(p[u]=r.contextToolDiff)),{sessionWorkspacePanelById:ze(t,Ee),contextPanelByDirectory:d,contextToolDiffByDirectory:p,isRightSidebarOpen:f,rightSidebarTab:ee,pendingFileFocusPath:null,pendingFileViewerMode:null,pendingFileNavigation:null}})},openContextPanel:e=>{let n=L((e||``).trim());n&&t(e=>{let t=e.contextPanelByDirectory[n];return t?.isOpen?e:{contextPanelByDirectory:X({...e.contextPanelByDirectory,[n]:{...q(t),isOpen:!0,activeView:`rail`}},20),...t?.tabs.length?{}:{isRightSidebarOpen:!0}}})},toggleContextPanel:e=>{let t=L((e||``).trim());t&&(J(n(),t)?.isOpen?n().closeContextPanel(t):n().openContextPanel(t))},openContextPanelTab:(e,n)=>{let r=L((e||``).trim());r&&t(e=>{let t=e.contextPanelByDirectory[r],i=q(t),a={...e.contextPanelByDirectory,[r]:Fe(i,n)};if(n.mode===`diff`||n.mode===`file-diff`){let t={...e.contextToolDiffByDirectory};return delete t[r],{contextPanelByDirectory:X(a,20),contextToolDiffByDirectory:t}}return{contextPanelByDirectory:X(a,20)}})},openContextDiff:(e,t,r=!1,i=null,a,o,s)=>{let c=L((e||``).trim()),l=(t||``).trim();if(!c||!l)return;let u=V(i)??(r?`staged`:`working`);n().openContextPanelTab(c,{mode:`diff`,targetPath:l,stagedDiff:u===`staged`,diffScope:u,diffTargetLine:a,diffTurnMessageId:o,diffSessionId:s})},openContextToolDiff:(e,n,r,i,a,o)=>{let s=L((e||``).trim()),c=(n||``).trim(),l=r.flatMap(e=>{let t=z(e.path),n=typeof e.patch==`string`?e.patch:``;return t&&n.trim()?[{path:t,patch:n}]:[]});if(!s||!c||l.length===0)return;let u={mode:`diff`,targetPath:c,stagedDiff:!1,diffScope:`turn`,diffTargetLine:i,diffTurnMessageId:a,diffSessionId:o};t(e=>{let t=e.contextPanelByDirectory[s],n=q(t),r=X({...e.contextPanelByDirectory,[s]:Fe(n,u)},20),i=new Set(Object.keys(r)),o=Object.fromEntries(Object.entries(e.contextToolDiffByDirectory).filter(([e])=>i.has(e)));return o[s]={targetPath:c,patches:l,turnMessageId:H(a)},{contextPanelByDirectory:r,contextToolDiffByDirectory:o}})},openContextFileDiff:(e,t,r=!1,i=null)=>{let a=L((e||``).trim()),o=(t||``).trim();if(!a||!o)return;let s=V(i)??(r?`staged`:`working`);n().openContextPanelTab(a,{mode:`file-diff`,targetPath:o,stagedDiff:s===`staged`,diffScope:s})},openContextFile:(e,t,r)=>{let i=L((e||``).trim()),a=z(t);!i||!a||Z(n(),i,a,()=>n().openContextFile(e,t,r))&&(n().openContextPanelTab(i,{mode:`file`,targetPath:a,fileNotice:G(r?.fileNotice)}),n().setPendingFileFocusPath(a),n().setPendingFileNavigation(null),n().setPendingFileViewerMode(r?.viewerMode??null))},openContextFileAtLine:(e,t,r,i)=>{let a=L((e||``).trim()),o=z(t),s=Number.isFinite(r)?Math.max(1,Math.trunc(r)):1,c=Number.isFinite(i)?Math.max(1,Math.trunc(i)):1;!a||!o||Z(n(),a,o,()=>n().openContextFileAtLine(e,t,r,i))&&(n().openContextPanelTab(a,{mode:`file`,targetPath:o}),n().setPendingFileFocusPath(null),n().setPendingFileNavigation({path:o,line:s,column:c}))},openContextOverview:e=>{let t=L((e||``).trim());t&&n().openContextPanelTab(t,{mode:`context`})},openContextPreview:(e,t)=>{let r=L((e||``).trim()),i=(t||``).trim();if(!r||!i)return;let a=null;try{let e=new URL(i);(e.protocol===`http:`||e.protocol===`https:`)&&(a=e.host||e.hostname||`Preview`)}catch{}n().openContextPanelTab(r,{mode:`preview`,targetPath:i,dedupeKey:i,label:a})},openContextBrowser:(e,t=``)=>{let r=L((e||``).trim());if(!r)return;let i=typeof t==`string`&&t.trim().length>0?t.trim():``;n().openContextPanelTab(r,{mode:`browser`,targetPath:i,dedupeKey:`desktop-browser`,label:`Browser`})},setContextPanelTabTargetPath:(e,n,r)=>{let i=L((e||``).trim()),a=(n||``).trim();!i||!a||t(e=>{let t=e.contextPanelByDirectory[i];return t?{contextPanelByDirectory:{...e.contextPanelByDirectory,[i]:Re(t,a,r)}}:e})},setActiveContextPanelTab:(e,r)=>{let i=L((e||``).trim()),a=(r||``).trim();if(!i||!a)return;let o=n().contextPanelByDirectory[i]?.tabs.find(e=>e.id===a);o?.mode===`file`&&!Z(n(),i,o.targetPath,()=>n().setActiveContextPanelTab(e,r))||t(e=>{let t=e.contextPanelByDirectory[i],n=q(t);return!n.tabs.some(e=>e.id===a)||n.activeTabId===a&&n.isOpen&&n.activeView===`preview`?e:{contextPanelByDirectory:X({...e.contextPanelByDirectory,[i]:{...n,isOpen:!0,activeView:`preview`,activeTabId:a,touchedAt:Date.now(),tabs:n.tabs.map(e=>e.id===a?{...e,touchedAt:Date.now()}:e)}},20)}})},reorderContextPanelTabs:(e,n,r)=>{let i=L((e||``).trim()),a=(n||``).trim(),o=(r||``).trim();!i||!a||!o||t(e=>{let t=e.contextPanelByDirectory[i],n=q(t);if(!n.tabs.some(e=>e.id===a)||!n.tabs.some(e=>e.id===o))return e;let r=Le(n,a,o);return r.tabs===n.tabs?e:{contextPanelByDirectory:X({...e.contextPanelByDirectory,[i]:r},20)}})},closeContextPanelTab:(e,n)=>{let r=L((e||``).trim()),i=(n||``).trim();!r||!i||t(e=>{let t=e.contextPanelByDirectory[r],n=q(t);if(!n.tabs.some(e=>e.id===i))return e;let a={...e.contextPanelByDirectory,[r]:Ie(n,i)};if(i===`diff`){let t={...e.contextToolDiffByDirectory};return delete t[r],{contextPanelByDirectory:X(a,20),contextToolDiffByDirectory:t}}return{contextPanelByDirectory:X(a,20)}})},closeActiveContextPanelTab:e=>{let t=L((e||``).trim());if(!t)return!1;let r=J(n(),t);if(!r?.isOpen)return!1;if(r.tabs.length===0)return n().closeContextPanel(t),!0;let i=K(r.tabs,r.activeTabId);return i?(n().closeContextPanelTab(t,i),!0):!1},closeContextPanel:e=>{let n=L((e||``).trim());n&&t(e=>{let t=J(e,n);return!t||!t.isOpen?e:{contextPanelByDirectory:X({...e.contextPanelByDirectory,[n]:{...q(t),isOpen:!1}},20)}})},toggleContextPanelExpanded:e=>{let n=L((e||``).trim());n&&t(e=>{let t=q(J(e,n));return{contextPanelByDirectory:X({...e.contextPanelByDirectory,[n]:{...t,expanded:!t.expanded}},20)}})},setContextPanelWidth:(e,n)=>{let r=L((e||``).trim());r&&t(e=>{let t=q(J(e,r));return{contextPanelByDirectory:X({...e.contextPanelByDirectory,[r]:{...t,width:R(n)}},20)}})},toggleBottomTerminal:()=>{t(e=>{let t=!e.isBottomTerminalOpen;return t&&typeof window<`u`?{isBottomTerminalOpen:t,bottomTerminalHeight:Math.floor(window.innerHeight*.32),hasManuallyResizedBottomTerminal:!1}:{isBottomTerminalOpen:t}})},setBottomTerminalOpen:e=>{t(t=>{if(t.isBottomTerminalOpen===e){if(!e)return t;if(!t.hasManuallyResizedBottomTerminal&&typeof window<`u`){let n=Math.floor(window.innerHeight*.32);return t.bottomTerminalHeight===n&&t.hasManuallyResizedBottomTerminal===!1?t:{isBottomTerminalOpen:e,bottomTerminalHeight:n,hasManuallyResizedBottomTerminal:!1}}return t}return e&&typeof window<`u`?{isBottomTerminalOpen:e,bottomTerminalHeight:Math.floor(window.innerHeight*.32),hasManuallyResizedBottomTerminal:!1}:{isBottomTerminalOpen:e}})},setBottomTerminalExpanded:e=>{t({isBottomTerminalExpanded:e})},setBottomTerminalHeight:e=>{t({bottomTerminalHeight:e,hasManuallyResizedBottomTerminal:!0})},setSessionSwitcherOpen:e=>{n().isSessionSwitcherOpen!==e&&t({isSessionSwitcherOpen:e})},setSessionDropdownOpen:e=>{n().isSessionDropdownOpen!==e&&t({isSessionDropdownOpen:e})},setMainTabGuard:e=>{n().mainTabGuard!==e&&t({mainTabGuard:e})},setActiveMainTab:e=>{let r=n().mainTabGuard;return r&&!r(e)?!1:(F.set(I(),e),t({activeMainTab:e}),!0)},openGuiPage:e=>{let r=n();return r.mainTabGuard&&!r.mainTabGuard(`plugin`)?!1:(F.set(I(),`plugin`),t({activeMainTab:`plugin`,activeGuiPage:e,guiPageReturnTab:r.activeMainTab===`plugin`?r.guiPageReturnTab:r.activeMainTab,isSettingsDialogOpen:!1,mobileSessionPanelOpen:!1}),!0)},closeGuiPage:()=>n().setActiveMainTab(n().guiPageReturnTab),prepareForRuntimeSwitch:e=>{F.set(I(e),n().activeMainTab),t(e=>({contextToolDiffByDirectory:{},sessionWorkspacePanelById:Object.fromEntries(Object.entries(e.sessionWorkspacePanelById).map(([e,t])=>[e,t.contextToolDiff?{...t,contextToolDiff:null}:t]))}))},restoreForRuntimeSwitch:e=>{let n=F.get(I(e))??`chat`;t({activeMainTab:n===`plugin`?`chat`:n,activeGuiPage:null,guiPageReturnTab:`chat`})},setPendingDiffFile:(e,n=!1,r=null,i)=>{t({pendingDiffFile:e,pendingDiffStaged:e?n:!1,pendingDiffScope:e?r:null,pendingDiffLine:e&&typeof i==`number`&&Number.isFinite(i)?Math.max(1,Math.trunc(i)):null})},setPendingDiagramFile:e=>{t({pendingDiagramFile:e})},setPendingFileNavigation:e=>{t({pendingFileNavigation:e})},setPendingFileFocusPath:e=>{t({pendingFileFocusPath:e})},setPendingFileViewerMode:e=>{t({pendingFileViewerMode:e})},navigateToDiff:(e,r=!1,i=null,a)=>{let o=n().mainTabGuard;o&&!o(`diff`)||t({pendingDiffFile:e,pendingDiffStaged:r,pendingDiffScope:i,pendingDiffLine:typeof a==`number`&&Number.isFinite(a)?Math.max(1,Math.trunc(a)):null,activeMainTab:`diff`})},consumePendingDiffFile:()=>{let{pendingDiffFile:e}=n();return e&&t({pendingDiffFile:null,pendingDiffStaged:!1,pendingDiffScope:null,pendingDiffLine:null}),e},navigateToDiagram:e=>{let r=n().mainTabGuard;r&&!r(`diagram`)||t({pendingDiagramFile:e,activeMainTab:`diagram`})},consumePendingDiagramFile:()=>{let{pendingDiagramFile:e}=n();return e&&t({pendingDiagramFile:null}),e},setIsMobile:e=>{t({isMobile:e})},toggleCommandPalette:()=>{t(e=>({isCommandPaletteOpen:!e.isCommandPaletteOpen}))},setCommandPaletteOpen:e=>{t({isCommandPaletteOpen:e})},toggleHelpDialog:()=>{t(e=>({isHelpDialogOpen:!e.isHelpDialogOpen}))},setHelpDialogOpen:e=>{t({isHelpDialogOpen:e})},setAboutDialogOpen:e=>{t({isAboutDialogOpen:e})},setOpenCodeStatusDialogOpen:e=>{t({isOpenCodeStatusDialogOpen:e})},setOpenCodeStatusText:e=>{t({openCodeStatusText:e})},setSessionCreateDialogOpen:e=>{t({isSessionCreateDialogOpen:e})},setScheduledTasksDialogOpen:e=>{t({isScheduledTasksDialogOpen:e})},setScheduledTaskOpenRequest:e=>{t({scheduledTaskOpenRequest:e})},setArchivedSessionsDialogOpen:e=>{t({isArchivedSessionsDialogOpen:e})},setSettingsDialogOpen:e=>{t(t=>e?t.settingsHasOpenedOnce?{isSettingsDialogOpen:!0}:{isSettingsDialogOpen:!0,settingsHasOpenedOnce:!0}:{isSettingsDialogOpen:!1})},setNewWorktreeDialogOpen:e=>{t({isNewWorktreeDialogOpen:e})},setModelSelectorOpen:(e,n)=>{t(t=>e?{isModelSelectorOpen:!0,isAgentSelectorOpen:!1,isModelSelectorInstant:n?.instant===!0}:{isModelSelectorOpen:!1,isModelSelectorInstant:n?.instant===!0||n?.instant!==!1&&t.isModelSelectorInstant})},setAgentSelectorOpen:(e,n)=>{t(t=>e?{isAgentSelectorOpen:!0,isModelSelectorOpen:!1,isAgentSelectorInstant:n?.instant===!0}:{isAgentSelectorOpen:!1,isAgentSelectorInstant:n?.instant!==!1&&t.isAgentSelectorInstant})},setSidebarSection:e=>{t({sidebarSection:e})},setSettingsPage:e=>{t({settingsPage:e})},setSettingsProjectsSelectedId:e=>{t({settingsProjectsSelectedId:e})},setSettingsRemoteInstancesSelectedId:e=>{t({settingsRemoteInstancesSelectedId:e})},setEventStreamStatus:(e,n)=>{t({eventStreamStatus:e,eventStreamHint:n??null})},setShowReasoningTraces:n=>{t({showReasoningTraces:n}),e(n)},setSessionTitleRefreshEnabled:e=>{t({sessionTitleRefreshEnabled:e})},setSessionGoalEnabled:e=>{t({sessionGoalEnabled:e})},setCollapsibleThinkingBlocks:e=>{t({collapsibleThinkingBlocks:e})},setChatRenderMode:e=>{t({chatRenderMode:e})},setActivityRenderMode:e=>{t({activityRenderMode:e})},setShowDeletionDialog:e=>{t({showDeletionDialog:e})},setAutoDeleteEnabled:e=>{t({autoDeleteEnabled:e})},setAutoDeleteAfterDays:e=>{t({autoDeleteAfterDays:Math.max(1,Math.min(365,e))})},setSessionRetentionAction:e=>{t({sessionRetentionAction:e})},setAutoDeleteLastRunAt:e=>{t({autoDeleteLastRunAt:e})},setMessageLimit:e=>{t({messageLimit:Math.max(10,Math.min(500,Math.round(e)))})},setFontSize:e=>{t({fontSize:Math.max(50,Math.min(200,e))}),n().applyTypography()},setCodeFontSize:e=>{t({codeFontSize:Math.max(50,Math.min(200,e))}),n().applyTypography()},setGlobalDraftStarters:e=>{t({globalDraftStarters:e})},setTerminalFontSize:e=>{t({terminalFontSize:Math.max(9,Math.min(52,Math.round(e)))})},setEditorFontSize:e=>{t({editorFontSize:Math.max(9,Math.min(32,Math.round(e)))})},setUiFont:e=>{t({uiFont:e})},setMonoFont:e=>{t({monoFont:e})},setPadding:e=>{t({padding:Math.max(50,Math.min(200,e))}),n().applyPadding()},setCornerRadius:e=>{t({cornerRadius:e})},applyTypography:()=>{let{fontSize:e,codeFontSize:t}=n(),r=document.documentElement,i=e/100,a=t/100,o=typeof document<`u`&&v(r),s=Object.keys(g);if(i===1&&a===1){for(let e of s)r.style.removeProperty(_(e));return}for(let e of s){let t=ce(e,{mobile:o}),n=parseFloat(t);if(!Number.isFinite(n))continue;let s=e===`code`?a:i;if(s===1){r.style.removeProperty(_(e));continue}if(o){let t=n*16*s;r.style.setProperty(_(e),`calc(${Math.round(t*1e3)/1e3} * var(--dpt))`)}else r.style.setProperty(_(e),`${n*s}rem`)}},applyPadding:()=>{let{padding:e}=n(),t=document.documentElement,r=e/100;if(r===1){t.style.removeProperty(`--user-padding-scale`),t.style.removeProperty(`--line-height-tight`),t.style.removeProperty(`--line-height-normal`),t.style.removeProperty(`--line-height-relaxed`),t.style.removeProperty(`--line-height-loose`);return}let i=Math.sqrt(r);t.style.setProperty(`--user-padding-scale`,i.toString());let a=1+(r-1)*.15;t.style.setProperty(`--line-height-tight`,(1.25*a).toFixed(3)),t.style.setProperty(`--line-height-normal`,(1.5*a).toFixed(3)),t.style.setProperty(`--line-height-relaxed`,(1.625*a).toFixed(3)),t.style.setProperty(`--line-height-loose`,(2*a).toFixed(3))},setDiffLayoutPreference:e=>{t({diffLayoutPreference:e})},setDiffFileLayout:(e,n)=>{t(t=>({diffFileLayout:{...t.diffFileLayout,[e]:n}}))},setDiffWrapLines:e=>{t({diffWrapLines:e})},setGitChangesViewMode:e=>{t({gitChangesViewMode:e})},setInputBarOffset:e=>{t({inputBarOffset:e})},setMobileKeyboardMode:e=>{t(t=>t.mobileKeyboardMode===e?t:{mobileKeyboardMode:e})},toggleFavoriteModel:(e,n,r)=>{t(t=>t.favoriteModels.some(t=>t.providerID===e&&t.modelID===n)?{favoriteModels:t.favoriteModels.filter(t=>t.providerID!==e||t.modelID!==n)}:{favoriteModels:[r===void 0?{providerID:e,modelID:n}:{providerID:e,modelID:n,variant:r},...t.favoriteModels]})},reorderFavoriteModel:(e,n,r,i)=>{t(t=>{let a=t.favoriteModels.findIndex(t=>t.providerID===e&&t.modelID===n),o=t.favoriteModels.findIndex(e=>e.providerID===r&&e.modelID===i);if(a===-1||o===-1||a===o)return t;let s=t.favoriteModels.slice(),[c]=s.splice(a,1);return c?(s.splice(o,0,c),{favoriteModels:s}):t})},setProviderOrder:e=>{t(t=>{let n=e.filter(e=>typeof e==`string`&&e.length>0),r=t.providerOrder;return r.length===n.length&&r.every((e,t)=>e===n[t])?t:{providerOrder:n}})},toggleHiddenModel:(e,n)=>{t(t=>t.hiddenModels.some(t=>t.providerID===e&&t.modelID===n)?{hiddenModels:t.hiddenModels.filter(t=>t.providerID!==e||t.modelID!==n)}:{hiddenModels:[{providerID:e,modelID:n},...t.hiddenModels]})},isHiddenModel:(e,t)=>{let{hiddenModels:r}=n();return r.some(n=>n.providerID===e&&n.modelID===t)},hideAllModels:(e,n)=>{t(t=>{let r=t.hiddenModels.filter(t=>t.providerID!==e);return{hiddenModels:[...n.filter(e=>typeof e==`string`&&e.length>0).map(t=>({providerID:e,modelID:t})),...r]}})},showAllModels:e=>{t(t=>({hiddenModels:t.hiddenModels.filter(t=>t.providerID!==e)}))},toggleModelProviderCollapsed:e=>{let n=typeof e==`string`?e.trim():``;n&&t(e=>e.collapsedModelProviders.includes(n)?{collapsedModelProviders:e.collapsedModelProviders.filter(e=>e!==n)}:{collapsedModelProviders:[...e.collapsedModelProviders,n]})},setModelProvidersCollapsed:(e,n)=>{let r=Array.from(new Set(e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean)));r.length!==0&&t(e=>{let t=new Set(r),i=e.collapsedModelProviders.filter(e=>!t.has(e));return{collapsedModelProviders:n?[...i,...r]:i}})},isFavoriteModel:(e,t)=>{let{favoriteModels:r}=n();return r.some(n=>n.providerID===e&&n.modelID===t)},addRecentModel:(e,n,r)=>{t(t=>{let i=[r===void 0?{providerID:e,modelID:n}:{providerID:e,modelID:n,variant:r},...t.recentModels.filter(t=>t.providerID!==e||t.modelID!==n)].slice(0,5),a=t.favoriteModels.findIndex(t=>t.providerID===e&&t.modelID===n);if(a===-1)return{recentModels:i};let o=t.favoriteModels[a];if(o.variant===r)return{recentModels:i};let s=r===void 0?{providerID:o.providerID,modelID:o.modelID}:{providerID:o.providerID,modelID:o.modelID,variant:r},c=t.favoriteModels.slice();return c[a]=s,{recentModels:i,favoriteModels:c}})},addRecentAgent:e=>{let n=typeof e==`string`?e.trim():``;n&&t(e=>{if(e.recentAgents.includes(n))return e;let t=e.recentAgents;return{recentAgents:[n,...t].slice(0,5)}})},addRecentEffort:(e,n,r)=>{let i=typeof e==`string`?e.trim():``,a=typeof n==`string`?n.trim():``;if(!i||!a)return;let o=`${i}/${a}`,s=typeof r==`string`&&r.trim().length>0?r.trim():`default`;t(e=>{let t=e.recentEfforts[o]??[];if(t.includes(s))return e;let n=t;return{recentEfforts:{...e.recentEfforts,[o]:[s,...n].slice(0,5)}}})},updateProportionalSidebarWidths:()=>{typeof window>`u`||t(e=>{let t={};if(e.isBottomTerminalOpen&&!e.hasManuallyResizedBottomTerminal){let n=Math.floor(window.innerHeight*.32);e.bottomTerminalHeight!==n&&(t.bottomTerminalHeight=n)}return Object.keys(t).length>0?t:e})},applyTheme:()=>{let{theme:e}=n(),t=document.documentElement;if(t.classList.remove(`light`,`dark`),e===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;t.classList.add(e)}else t.classList.add(e)},setMultiRunLauncherOpen:e=>{t({isMultiRunLauncherOpen:e})},openMultiRunLauncher:()=>{t({isMultiRunLauncherOpen:!0,isSessionSwitcherOpen:!1})},setTimelineDialogOpen:e=>{t({isTimelineDialogOpen:e})},setPromptNavigatorPanelOpen:e=>{t({isPromptNavigatorPanelOpen:e})},togglePromptNavigatorPanel:()=>{t(e=>({isPromptNavigatorPanelOpen:!e.isPromptNavigatorPanelOpen}))},setImagePreviewOpen:e=>{t({isImagePreviewOpen:e})},setNativeNotificationsEnabled:e=>{t({nativeNotificationsEnabled:e})},setNotificationMode:e=>{t({notificationMode:e})},setShowTerminalQuickKeysOnDesktop:e=>{t({showTerminalQuickKeysOnDesktop:e})},setNotifyOnSubtasks:e=>{t({notifyOnSubtasks:e})},setDockBadgeEnabled:e=>{t({dockBadgeEnabled:e})},setNotifyOnCompletion:e=>{t({notifyOnCompletion:e})},setNotifyOnError:e=>{t({notifyOnError:e})},setNotifyOnQuestion:e=>{t({notifyOnQuestion:e})},setNotifyOnPermission:e=>{t({notifyOnPermission:e})},setNotifyOnScheduledTasks:e=>{t({notifyOnScheduledTasks:e})},setNotifyOnAssistants:e=>{t({notifyOnAssistants:e})},setNotifyOnGoals:e=>{t({notifyOnGoals:e})},setNotificationTemplates:e=>{t({notificationTemplates:e})},setSummarizeLastMessage:e=>{t({summarizeLastMessage:e})},setSummaryThreshold:e=>{t({summaryThreshold:e})},setSummaryLength:e=>{t({summaryLength:e})},setMaxLastMessageLength:e=>{t({maxLastMessageLength:e})},setPersistChatDraft:e=>{t({persistChatDraft:e})},setShowOpenCodeUpdateNotifications:e=>{t({showOpenCodeUpdateNotifications:e})},setInputSpellcheckEnabled:e=>{t({inputSpellcheckEnabled:e})},setWideChatLayoutEnabled:e=>{t({wideChatLayoutEnabled:e})},setCodeBlockLineWrap:e=>{t({codeBlockLineWrap:e})},setShowToolFileIcons:e=>{t({showToolFileIcons:e})},setShowTurnChangedFiles:e=>{t({showTurnChangedFiles:e})},setShowExpandedBashTools:e=>{t({showExpandedBashTools:e})},setShowSubagentTaskDetails:e=>{t({showSubagentTaskDetails:e})},setTimeFormatPreference:e=>{t({timeFormatPreference:e})},setWeekStartPreference:e=>{t({weekStartPreference:e})},setDesktopWindowControlsPosition:e=>{t({desktopWindowControlsPosition:e})},setUserMessageRenderingMode:e=>{t({userMessageRenderingMode:e})},setCollapsibleUserMessages:e=>{t({collapsibleUserMessages:e})},setStickyUserHeader:e=>{t({stickyUserHeader:e})},setPromptNavigatorEnabled:e=>{t({promptNavigatorEnabled:e})},setShowSplitAssistantMessageActions:e=>{t({showSplitAssistantMessageActions:e})},setShowAssistantTps:e=>{t({showAssistantTps:e})},setAllowPromptingSubagentSessions:e=>{t({allowPromptingSubagentSessions:e})},setIsMobileSessionStatusBarCollapsed:e=>{t({isMobileSessionStatusBarCollapsed:e})},setMobileSessionPanelOpen:e=>{t({mobileSessionPanelOpen:e})},setMobileSessionFilterProjectId:e=>{t({mobileSessionFilterProjectId:e})},setOtaChannelOverride:e=>{t({otaChannelOverride:e})},setReportUsage:e=>{t({reportUsage:e})},viewPagerPage:`center`,setViewPagerPage:e=>{t({viewPagerPage:e}),t(e===`left`?{isSessionSwitcherOpen:!0,isRightSidebarOpen:!1}:e===`right`?{isRightSidebarOpen:!0,isSessionSwitcherOpen:!1}:{isSessionSwitcherOpen:!1,isRightSidebarOpen:!1})},setShortcutOverride:(e,n)=>{t(t=>({shortcutOverrides:{...t.shortcutOverrides,[e]:n}}))},clearShortcutOverride:e=>{t(t=>{let n={...t.shortcutOverrides};return delete n[e],{shortcutOverrides:n}})},resetAllShortcutOverrides:()=>{t({shortcutOverrides:{}})},setFileEditorKeymap:e=>{t({fileEditorKeymap:k(e)})},toggleExpandedInput:()=>{t(e=>({isExpandedInput:!e.isExpandedInput}))},setExpandedInput:e=>{t({isExpandedInput:e})},setWorkStatusPanelEnabled:e=>{t({workStatusPanelEnabled:e,workStatusOverlayOpen:!1})},setWorkStatusPanelVisible:e=>{t(t=>t.workStatusPanelVisible===e?t:{workStatusPanelVisible:e})},setWorkStatusPanelFits:e=>{t(t=>t.workStatusPanelFits===e?t:{workStatusPanelFits:e})},setWorkStatusOverlayOpen:e=>{t({workStatusOverlayOpen:e})},setWorkStatusSectionVisible:(e,n)=>{t(t=>{let r=t.workStatusHiddenSections.filter(t=>t!==e);return n||r.push(e),{workStatusHiddenSections:r}})},setWorkStatusHiddenSections:e=>{t({workStatusHiddenSections:e})},setWorkStatusSectionOrder:e=>{t({workStatusSectionOrder:e})},setWorkStatusSectionExpanded:(e,n)=>{t(t=>({workStatusExpandedSections:{...t.workStatusExpandedSections,[e]:n}}))},setWorkStatusScrollTop:e=>{t({workStatusScrollTop:e})}}),{name:`ui-store`,storage:f(),version:14,migrate:(e,t)=>{if(!e||typeof e!=`object`)return e;let n=e;if(delete n.mermaidRenderingMode,ae(n,t),t<11&&n.sidebarWidth===280&&(n.sidebarWidth=N),t<10&&delete n.diffViewMode,t<13&&(delete n.notesPanelHeight,delete n.todoPanelHeight,(n.activeMainTab===`plan`||n.activeMainTab===`context`)&&(n.activeMainTab=`chat`),n.rightSidebarTab===`context`&&(n.rightSidebarTab=`files`)),t<1&&Se(n.notificationTemplates)&&(n.notificationTemplates={completion:{...A.completion},error:{...A.error},question:{...A.question},subtask:{...A.subtask}}),t<3){let e=new Set([90,120,180,220]),t=n.memoryLimitHistorical,r=n.memoryLimitActiveSession;typeof t==`number`&&!e.has(t)?n.messageLimit=t:typeof r==`number`&&!e.has(r)&&(n.messageLimit=r),delete n.memoryLimitHistorical,delete n.memoryLimitViewport,delete n.memoryLimitActiveSession}if((typeof n.rightSidebarTab!=`string`||n.rightSidebarTab!==`git`&&n.rightSidebarTab!==`files`&&n.rightSidebarTab!==`browser`)&&(n.rightSidebarTab=`files`),n.contextPanelByDirectory=Y(n.contextPanelByDirectory),t<5)if(!n.shortcutOverrides||typeof n.shortcutOverrides!=`object`)n.shortcutOverrides={};else{let e=n.shortcutOverrides,t={};for(let[n,r]of Object.entries(e))typeof n==`string`&&typeof r==`string`&&(t[n]=r);n.shortcutOverrides=t}return t<6&&(n.contextPanelByDirectory=Y(n.contextPanelByDirectory)),t<7&&(n.contextPanelByDirectory=Y(n.contextPanelByDirectory)),t<8&&n.gitChangesViewMode!==`flat`&&n.gitChangesViewMode!==`tree`&&(n.gitChangesViewMode=`tree`),n.fileEditorKeymap=k(n.fileEditorKeymap),n},partialize:e=>({theme:e.theme,isSidebarOpen:e.isSidebarOpen,sidebarWidth:e.sidebarWidth,isRightSidebarOpen:e.isRightSidebarOpen,rightSidebarWidth:e.rightSidebarWidth,rightSidebarTab:e.rightSidebarTab,contextPanelByDirectory:Object.fromEntries(Object.entries(e.contextPanelByDirectory).map(([e,t])=>{let n=t.tabs.filter(e=>e.mode!==`btw`),{activeView:r,...i}=t;return[e,{...i,tabs:n,activeTabId:K(n,t.activeTabId),isOpen:t.isOpen&&(t.tabs.length===0||n.length>0)}]})),isBottomTerminalOpen:e.isBottomTerminalOpen,isBottomTerminalExpanded:e.isBottomTerminalExpanded,bottomTerminalHeight:e.bottomTerminalHeight,isSessionSwitcherOpen:e.isSessionSwitcherOpen,activeMainTab:e.activeMainTab===`plugin`?`chat`:e.activeMainTab,sidebarSection:e.sidebarSection,settingsPage:e.settingsPage,settingsHasOpenedOnce:e.settingsHasOpenedOnce,settingsProjectsSelectedId:e.settingsProjectsSelectedId,settingsRemoteInstancesSelectedId:e.settingsRemoteInstancesSelectedId,isSessionCreateDialogOpen:e.isSessionCreateDialogOpen,showReasoningTraces:e.showReasoningTraces,sessionTitleRefreshEnabled:e.sessionTitleRefreshEnabled,sessionGoalEnabled:e.sessionGoalEnabled,collapsibleThinkingBlocks:e.collapsibleThinkingBlocks,chatRenderMode:e.chatRenderMode,activityRenderMode:e.activityRenderMode,showDeletionDialog:e.showDeletionDialog,autoDeleteEnabled:e.autoDeleteEnabled,autoDeleteAfterDays:e.autoDeleteAfterDays,sessionRetentionAction:e.sessionRetentionAction,autoDeleteLastRunAt:e.autoDeleteLastRunAt,messageLimit:e.messageLimit,fontSize:e.fontSize,codeFontSize:e.codeFontSize,globalDraftStarters:e.globalDraftStarters,terminalFontSize:e.terminalFontSize,editorFontSize:e.editorFontSize,uiFont:e.uiFont,monoFont:e.monoFont,padding:e.padding,cornerRadius:e.cornerRadius,favoriteModels:e.favoriteModels,hiddenModels:e.hiddenModels,providerOrder:e.providerOrder,collapsedModelProviders:e.collapsedModelProviders,recentModels:e.recentModels,recentAgents:e.recentAgents,recentEfforts:e.recentEfforts,diffLayoutPreference:e.diffLayoutPreference,diffWrapLines:e.diffWrapLines,gitChangesViewMode:e.gitChangesViewMode,nativeNotificationsEnabled:e.nativeNotificationsEnabled,notificationMode:e.notificationMode,showTerminalQuickKeysOnDesktop:e.showTerminalQuickKeysOnDesktop,notifyOnSubtasks:e.notifyOnSubtasks,dockBadgeEnabled:e.dockBadgeEnabled,notifyOnCompletion:e.notifyOnCompletion,notifyOnError:e.notifyOnError,notifyOnQuestion:e.notifyOnQuestion,notifyOnPermission:e.notifyOnPermission,notifyOnScheduledTasks:e.notifyOnScheduledTasks,notifyOnAssistants:e.notifyOnAssistants,notifyOnGoals:e.notifyOnGoals,notificationTemplates:e.notificationTemplates,summarizeLastMessage:e.summarizeLastMessage,summaryThreshold:e.summaryThreshold,summaryLength:e.summaryLength,maxLastMessageLength:e.maxLastMessageLength,persistChatDraft:e.persistChatDraft,showOpenCodeUpdateNotifications:e.showOpenCodeUpdateNotifications,inputSpellcheckEnabled:e.inputSpellcheckEnabled,wideChatLayoutEnabled:e.wideChatLayoutEnabled,workStatusPanelEnabled:e.workStatusPanelEnabled,workStatusHiddenSections:e.workStatusHiddenSections,workStatusSectionOrder:e.workStatusSectionOrder,workStatusExpandedSections:e.workStatusExpandedSections,workStatusScrollTop:e.workStatusScrollTop,codeBlockLineWrap:e.codeBlockLineWrap,showToolFileIcons:e.showToolFileIcons,showTurnChangedFiles:e.showTurnChangedFiles,showExpandedBashTools:e.showExpandedBashTools,showSubagentTaskDetails:e.showSubagentTaskDetails,timeFormatPreference:e.timeFormatPreference,weekStartPreference:e.weekStartPreference,desktopWindowControlsPosition:e.desktopWindowControlsPosition,userMessageRenderingMode:e.userMessageRenderingMode,collapsibleUserMessages:e.collapsibleUserMessages,stickyUserHeader:e.stickyUserHeader,promptNavigatorEnabled:e.promptNavigatorEnabled,showSplitAssistantMessageActions:e.showSplitAssistantMessageActions,showAssistantTps:e.showAssistantTps,allowPromptingSubagentSessions:e.allowPromptingSubagentSessions,isMobileSessionStatusBarCollapsed:e.isMobileSessionStatusBarCollapsed,mobileSessionFilterProjectId:e.mobileSessionFilterProjectId,otaChannelOverride:e.otaChannelOverride,shortcutOverrides:e.shortcutOverrides,fileEditorKeymap:e.fileEditorKeymap})}),{name:`ui-store`}));e(Q.getState().showReasoningTraces);var $=Q.persist;$?.hasHydrated?.()&&e(Q.getState().showReasoningTraces),typeof $?.onFinishHydration==`function`&&$.onFinishHydration(()=>{e(Q.getState().showReasoningTraces)});export{ie as C,ne as S,se as _,D as a,v as b,le as c,C as d,x as f,g,fe as h,ve as i,S as l,pe as m,L as n,O as o,de as p,Q as r,he as s,J as t,w as u,b as v,h as w,f as x,y};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{y as r}from"./useUIStore-BDZCXouA.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{f as a,r as o,t as s}from"./button-BF2cNEuq.js";import{n as c}from"./useThemeSystem-CNzUUkFn.js";import{n as l}from"./Icon-CLLDJn-P.js";import{n as u}from"./MarkdownRenderer-BG5J2mhU.js";import{n as d,r as f}from"./toolHelpers-iEHVHQ9p.js";import{n as p}from"./markdownTheme-CHNl6tUv.js";import{n as m,t as h}from"./markdown-worker-oBGEB9Eg.js";var g=e(n(),1),_=i(),v=t(),y=e=>e===`in_progress`||e===`completed`||e===`cancelled`?e:`pending`,b=e=>e.status===`completed`||e.status===`cancelled`,x={in_progress:`chat.statusRow.todo.status.inProgress`,pending:`chat.statusRow.todo.status.pending`,completed:`chat.statusRow.todo.status.completed`,cancelled:`chat.statusRow.todo.status.cancelled`},S={in_progress:`text-foreground`,pending:`text-muted-foreground/60`,completed:`text-muted-foreground`,cancelled:`text-muted-foreground/60`},C={in_progress:`text-foreground`,pending:`text-muted-foreground`,completed:`text-muted-foreground/60 line-through decoration-1`,cancelled:`text-muted-foreground/60 line-through decoration-1`},w=1.2,T=24,E=`1 1`,D=e=>{let t=(0,_.c)(23),{status:n,className:r}=e,{t:i}=a(),s=x[n],c;t[0]!==i||t[1]!==s?(c=i(s),t[0]=i,t[1]=s,t[2]=c):c=t[2];let l=S[n],u;t[3]!==r||t[4]!==l?(u=o(`size-[1em] shrink-0 transition-colors duration-300`,l,r),t[3]=r,t[4]=l,t[5]=u):u=t[5];let d=n===`pending`?w:void 0,f=n===`pending`?T:void 0,p=n===`pending`?E:void 0,m;t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,v.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:d,pathLength:f,strokeDasharray:p}),t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]===n?h=t[11]:(h=n===`in_progress`?(0,v.jsx)(`path`,{d:`M4.8 8h6.4M8.6 5.4 11.2 8l-2.6 2.6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[10]=n,t[11]=h);let g;t[12]===n?g=t[13]:(g=n===`completed`?(0,v.jsx)(`path`,{d:`M5 8 7.5 11 11 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[12]=n,t[13]=g);let y;t[14]===n?y=t[15]:(y=n===`cancelled`?(0,v.jsx)(`path`,{d:`M3.5 12.5 12.5 3.5`,stroke:`currentColor`}):null,t[14]=n,t[15]=y);let b;return t[16]!==g||t[17]!==y||t[18]!==c||t[19]!==u||t[20]!==m||t[21]!==h?(b=(0,v.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,role:`img`,"aria-label":c,className:u,children:[m,h,g,y]}),t[16]=g,t[17]=y,t[18]=c,t[19]=u,t[20]=m,t[21]=h,t[22]=b):b=t[22],b},O=3.2,k=e=>{let t=Math.PI*2*e,n=8+O*Math.sin(t),r=8-O*Math.cos(t);return`M8 8 L8 4.8 A${O} ${O} 0 ${+(e>.5)} 1 ${n.toFixed(3)} ${r.toFixed(3)} Z`},A=e=>{let t=(0,_.c)(11),{done:n,total:r,spinning:i,className:a}=e,s=n===void 0?0:n,c=r===void 0?0:r,l=i!==void 0&&i,u=c>0?Math.min(1,s/c):0,d;t[0]===a?d=t[1]:(d=o(`size-[1.15em] shrink-0 text-foreground`,a),t[0]=a,t[1]=d);let f=l?`yuri-todo-spin`:void 0,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p={transformBox:`fill-box`,transformOrigin:`center`},t[2]=p):p=t[2];let m;t[3]===f?m=t[4]:(m=(0,v.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:w,pathLength:T,strokeDasharray:E,className:f,style:p}),t[3]=f,t[4]=m);let h;t[5]===u?h=t[6]:(h=u>0?(0,v.jsx)(`path`,{d:k(u),fill:`currentColor`,className:`transition-opacity duration-300`}):null,t[5]=u,t[6]=h);let g;return t[7]!==d||t[8]!==m||t[9]!==h?(g=(0,v.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:d,children:[m,h]}),t[7]=d,t[8]=m,t[9]=h,t[10]=g):g=t[10],g},j=({done:e,total:t,className:n,animate:r=!0})=>{let i=g.useRef(e),a=r&&i.current!==e;return g.useEffect(()=>{i.current=e},[e]),(0,v.jsxs)(`span`,{className:o(`shrink-0 tabular-nums`,n),children:[(0,v.jsx)(`span`,{className:o(a&&`yuri-todo-count-tick`),children:e},e),`/${t}`]})},ee=e=>{let t=(0,_.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=o(`flex size-[1.15em] shrink-0 items-center justify-center rounded-full bg-[var(--status-success)] text-[var(--status-success-foreground)]`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,v.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`size-[70%]`,children:(0,v.jsx)(`path`,{d:`M4.5 8.2 7 10.8 11.5 5.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,v.jsx)(`span`,{"data-todo-complete":!0,className:r,children:i}),t[3]=r,t[4]=a),a},M=e=>{let t=(0,_.c)(27),{todos:n,isWorking:r,animate:i,className:s,rowClassName:c,listRef:l,id:u}=e,d=r!==void 0&&r,f=i!==void 0&&i,{t:p}=a(),m=n.findIndex(N),h;t[0]!==m||t[1]!==n?(h=m>=0?m:n.findIndex(P),t[0]=m,t[1]=n,t[2]=h):h=t[2];let g=h,b;t[3]===n?b=t[4]:(b=n.some(F),t[3]=n,t[4]=b);let S=b,w;t[5]===s?w=t[6]:(w=o(`m-0 flex min-w-0 list-none flex-col gap-[0.125em] p-0`,s),t[5]=s,t[6]=w);let T;if(t[7]!==g||t[8]!==f||t[9]!==S||t[10]!==d||t[11]!==c||t[12]!==p||t[13]!==n){let e;t[15]!==g||t[16]!==f||t[17]!==S||t[18]!==d||t[19]!==c||t[20]!==p?(e=(e,t)=>{let n=y(e.status),r=d&&!S&&t===g&&n===`pending`?`in_progress`:n;return(0,v.jsxs)(`li`,{"data-status":r,"aria-current":t===g?`step`:void 0,className:o(`grid min-w-0 shrink-0 grid-cols-[auto_minmax(0,1fr)] items-start py-[0.25em]`,c??`gap-[0.6em] px-[0.5em]`,f&&`yuri-todo-row-in`),children:[(0,v.jsx)(`span`,{className:o(`flex h-[1.32em] w-[1.15em] items-center justify-center`,f&&`yuri-todo-icon-pop`),title:p(x[r]),children:(0,v.jsx)(D,{status:r})},r),(0,v.jsx)(`span`,{dir:`auto`,title:e.content,className:o(`line-clamp-3 min-w-0 whitespace-normal text-[0.88em] break-words leading-[1.5] transition-colors duration-300`,C[r]),children:(0,v.jsx)(`span`,{className:o(r===`in_progress`&&`animate-text-shimmer`),children:e.content})})]},e.id??`${t}:${e.content}`)},t[15]=g,t[16]=f,t[17]=S,t[18]=d,t[19]=c,t[20]=p,t[21]=e):e=t[21],T=n.map(e),t[7]=g,t[8]=f,t[9]=S,t[10]=d,t[11]=c,t[12]=p,t[13]=n,t[14]=T}else T=t[14];let E;return t[22]!==u||t[23]!==l||t[24]!==w||t[25]!==T?(E=(0,v.jsx)(`ul`,{id:u,ref:l,className:w,children:T}),t[22]=u,t[23]=l,t[24]=w,t[25]=T,t[26]=E):E=t[26],E};function N(e){return e.status===`in_progress`}function P(e){return e.status===`pending`}function F(e){return e.status===`in_progress`}var I=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),L=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,R=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=L(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},z=e=>`<pre><code>${I(e)}</code></pre>`,B=e=>{let t=(0,_.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=g.useRef(null),m;t[0]===d?m=t[1]:(m=p(d),t[0]=d,t[1]=m);let y=m,b,x;t[2]!==n||t[3]!==s||t[4]!==u?(b=()=>{let e=f.current;e&&(e.innerHTML=z(n),R(e,u,s))},x=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=b,t[6]=x):(b=t[5],x=t[6]),g.useLayoutEffect(b,x);let S,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(S=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return h(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,R(e,u,s))}),()=>{t=!1,i.abort()}},C=[n,r,u,s],t[7]=n,t[8]=s,t[9]=r,t[10]=u,t[11]=S,t[12]=C):(S=t[11],C=t[12]),g.useEffect(S,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=y,E;t[15]!==a||t[16]!==T?(E={...T,...a},t[15]=a,t[16]=T,t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==E?(D=(0,v.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},V=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},H=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},U=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,W=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,G=(e,t)=>!e||typeof e!=`object`?String(e):f(e,t||``),K=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},q=e=>{if(!e||typeof e!=`object`)return;let t=K(e.patch)??K(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=K(e.patch)??K(e.diff);if(t)return t}},J=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},Y=(e,t,n)=>{let r=V(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&U(r)&&(r=W(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=q(n);if(e)return e}return r},X=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{y as r}from"./useUIStore-CoWJ3ROq.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{f as a,r as o,t as s}from"./button-DC4BhJtL.js";import{n as c}from"./useThemeSystem-CNzUUkFn.js";import{n as l}from"./Icon-p_czvEI7.js";import{n as u}from"./MarkdownRenderer-DVKRLcN5.js";import{n as d,r as f}from"./toolHelpers-iEHVHQ9p.js";import{n as p}from"./markdownTheme-CHNl6tUv.js";import{n as m,t as h}from"./markdown-worker-oBGEB9Eg.js";var g=e(n(),1),_=i(),v=t(),y=e=>e===`in_progress`||e===`completed`||e===`cancelled`?e:`pending`,b=e=>e.status===`completed`||e.status===`cancelled`,x={in_progress:`chat.statusRow.todo.status.inProgress`,pending:`chat.statusRow.todo.status.pending`,completed:`chat.statusRow.todo.status.completed`,cancelled:`chat.statusRow.todo.status.cancelled`},S={in_progress:`text-foreground`,pending:`text-muted-foreground/60`,completed:`text-muted-foreground`,cancelled:`text-muted-foreground/60`},C={in_progress:`text-foreground`,pending:`text-muted-foreground`,completed:`text-muted-foreground/60 line-through decoration-1`,cancelled:`text-muted-foreground/60 line-through decoration-1`},w=1.2,T=24,E=`1 1`,D=e=>{let t=(0,_.c)(23),{status:n,className:r}=e,{t:i}=a(),s=x[n],c;t[0]!==i||t[1]!==s?(c=i(s),t[0]=i,t[1]=s,t[2]=c):c=t[2];let l=S[n],u;t[3]!==r||t[4]!==l?(u=o(`size-[1em] shrink-0 transition-colors duration-300`,l,r),t[3]=r,t[4]=l,t[5]=u):u=t[5];let d=n===`pending`?w:void 0,f=n===`pending`?T:void 0,p=n===`pending`?E:void 0,m;t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,v.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:d,pathLength:f,strokeDasharray:p}),t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]===n?h=t[11]:(h=n===`in_progress`?(0,v.jsx)(`path`,{d:`M4.8 8h6.4M8.6 5.4 11.2 8l-2.6 2.6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[10]=n,t[11]=h);let g;t[12]===n?g=t[13]:(g=n===`completed`?(0,v.jsx)(`path`,{d:`M5 8 7.5 11 11 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[12]=n,t[13]=g);let y;t[14]===n?y=t[15]:(y=n===`cancelled`?(0,v.jsx)(`path`,{d:`M3.5 12.5 12.5 3.5`,stroke:`currentColor`}):null,t[14]=n,t[15]=y);let b;return t[16]!==g||t[17]!==y||t[18]!==c||t[19]!==u||t[20]!==m||t[21]!==h?(b=(0,v.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,role:`img`,"aria-label":c,className:u,children:[m,h,g,y]}),t[16]=g,t[17]=y,t[18]=c,t[19]=u,t[20]=m,t[21]=h,t[22]=b):b=t[22],b},O=3.2,k=e=>{let t=Math.PI*2*e,n=8+O*Math.sin(t),r=8-O*Math.cos(t);return`M8 8 L8 4.8 A${O} ${O} 0 ${+(e>.5)} 1 ${n.toFixed(3)} ${r.toFixed(3)} Z`},A=e=>{let t=(0,_.c)(11),{done:n,total:r,spinning:i,className:a}=e,s=n===void 0?0:n,c=r===void 0?0:r,l=i!==void 0&&i,u=c>0?Math.min(1,s/c):0,d;t[0]===a?d=t[1]:(d=o(`size-[1.15em] shrink-0 text-foreground`,a),t[0]=a,t[1]=d);let f=l?`yuri-todo-spin`:void 0,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p={transformBox:`fill-box`,transformOrigin:`center`},t[2]=p):p=t[2];let m;t[3]===f?m=t[4]:(m=(0,v.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:w,pathLength:T,strokeDasharray:E,className:f,style:p}),t[3]=f,t[4]=m);let h;t[5]===u?h=t[6]:(h=u>0?(0,v.jsx)(`path`,{d:k(u),fill:`currentColor`,className:`transition-opacity duration-300`}):null,t[5]=u,t[6]=h);let g;return t[7]!==d||t[8]!==m||t[9]!==h?(g=(0,v.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:d,children:[m,h]}),t[7]=d,t[8]=m,t[9]=h,t[10]=g):g=t[10],g},j=({done:e,total:t,className:n,animate:r=!0})=>{let i=g.useRef(e),a=r&&i.current!==e;return g.useEffect(()=>{i.current=e},[e]),(0,v.jsxs)(`span`,{className:o(`shrink-0 tabular-nums`,n),children:[(0,v.jsx)(`span`,{className:o(a&&`yuri-todo-count-tick`),children:e},e),`/${t}`]})},ee=e=>{let t=(0,_.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=o(`flex size-[1.15em] shrink-0 items-center justify-center rounded-full bg-[var(--status-success)] text-[var(--status-success-foreground)]`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,v.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`size-[70%]`,children:(0,v.jsx)(`path`,{d:`M4.5 8.2 7 10.8 11.5 5.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,v.jsx)(`span`,{"data-todo-complete":!0,className:r,children:i}),t[3]=r,t[4]=a),a},M=e=>{let t=(0,_.c)(27),{todos:n,isWorking:r,animate:i,className:s,rowClassName:c,listRef:l,id:u}=e,d=r!==void 0&&r,f=i!==void 0&&i,{t:p}=a(),m=n.findIndex(N),h;t[0]!==m||t[1]!==n?(h=m>=0?m:n.findIndex(P),t[0]=m,t[1]=n,t[2]=h):h=t[2];let g=h,b;t[3]===n?b=t[4]:(b=n.some(F),t[3]=n,t[4]=b);let S=b,w;t[5]===s?w=t[6]:(w=o(`m-0 flex min-w-0 list-none flex-col gap-[0.125em] p-0`,s),t[5]=s,t[6]=w);let T;if(t[7]!==g||t[8]!==f||t[9]!==S||t[10]!==d||t[11]!==c||t[12]!==p||t[13]!==n){let e;t[15]!==g||t[16]!==f||t[17]!==S||t[18]!==d||t[19]!==c||t[20]!==p?(e=(e,t)=>{let n=y(e.status),r=d&&!S&&t===g&&n===`pending`?`in_progress`:n;return(0,v.jsxs)(`li`,{"data-status":r,"aria-current":t===g?`step`:void 0,className:o(`grid min-w-0 shrink-0 grid-cols-[auto_minmax(0,1fr)] items-start py-[0.25em]`,c??`gap-[0.6em] px-[0.5em]`,f&&`yuri-todo-row-in`),children:[(0,v.jsx)(`span`,{className:o(`flex h-[1.32em] w-[1.15em] items-center justify-center`,f&&`yuri-todo-icon-pop`),title:p(x[r]),children:(0,v.jsx)(D,{status:r})},r),(0,v.jsx)(`span`,{dir:`auto`,title:e.content,className:o(`line-clamp-3 min-w-0 whitespace-normal text-[0.88em] break-words leading-[1.5] transition-colors duration-300`,C[r]),children:(0,v.jsx)(`span`,{className:o(r===`in_progress`&&`animate-text-shimmer`),children:e.content})})]},e.id??`${t}:${e.content}`)},t[15]=g,t[16]=f,t[17]=S,t[18]=d,t[19]=c,t[20]=p,t[21]=e):e=t[21],T=n.map(e),t[7]=g,t[8]=f,t[9]=S,t[10]=d,t[11]=c,t[12]=p,t[13]=n,t[14]=T}else T=t[14];let E;return t[22]!==u||t[23]!==l||t[24]!==w||t[25]!==T?(E=(0,v.jsx)(`ul`,{id:u,ref:l,className:w,children:T}),t[22]=u,t[23]=l,t[24]=w,t[25]=T,t[26]=E):E=t[26],E};function N(e){return e.status===`in_progress`}function P(e){return e.status===`pending`}function F(e){return e.status===`in_progress`}var I=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),L=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,R=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=L(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},z=e=>`<pre><code>${I(e)}</code></pre>`,B=e=>{let t=(0,_.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=g.useRef(null),m;t[0]===d?m=t[1]:(m=p(d),t[0]=d,t[1]=m);let y=m,b,x;t[2]!==n||t[3]!==s||t[4]!==u?(b=()=>{let e=f.current;e&&(e.innerHTML=z(n),R(e,u,s))},x=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=b,t[6]=x):(b=t[5],x=t[6]),g.useLayoutEffect(b,x);let S,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(S=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return h(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,R(e,u,s))}),()=>{t=!1,i.abort()}},C=[n,r,u,s],t[7]=n,t[8]=s,t[9]=r,t[10]=u,t[11]=S,t[12]=C):(S=t[11],C=t[12]),g.useEffect(S,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=y,E;t[15]!==a||t[16]!==T?(E={...T,...a},t[15]=a,t[16]=T,t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==E?(D=(0,v.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},V=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},H=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},U=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,W=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,G=(e,t)=>!e||typeof e!=`object`?String(e):f(e,t||``),K=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},q=e=>{if(!e||typeof e!=`object`)return;let t=K(e.patch)??K(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=K(e.patch)??K(e.diff);if(t)return t}},J=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},Y=(e,t,n)=>{let r=V(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&U(r)&&(r=W(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=q(n);if(e)return e}return r},X=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),r=e=>/\(\s*File has more lines\..*offset.*\)/i.test(e.trim());return{type:t,lines:n.map(e=>{let n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);if(t!==`directory`){let t=e.match(/^(\d+):\s?(.*)$/);if(t){let e=t[2],n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);return{lineNumber:i?null:Number(t[1]),text:e,isInfo:i}}}return{lineNumber:null,text:e,isInfo:i}}).filter((e,t,n)=>{if(e.text.trim().length>0)return!0;let r=n[t-1],i=n[t+1],a=!!(r?.isInfo||i?.isInfo),o=e.lineNumber!==null;return!(a&&o)})}},Z=(e,t)=>{try{let n=e.trim().split(`
4
4
  `).filter(Boolean);if(n.length===0)return null;let i=[];return n.forEach(e=>{let t=e.match(/^(\s*)(.+)$/);if(t){let[,e,n]=t,r=Math.floor(e.length/2),a=!n.endsWith(`/`);i.push({name:n.replace(/\/$/,``),depth:r,isFile:a})}}),(0,v.jsx)(`div`,{className:o(`w-full min-w-0 font-mono space-y-0.5`,t?.unstyled?null:`p-3 bg-muted/20 rounded-xl border border-border/30`),style:r.tool.popup,children:i.map((e,t)=>(0,v.jsx)(`div`,{className:`min-w-0`,style:{paddingLeft:`${e.depth*20}px`},children:e.isFile?(0,v.jsx)(`span`,{className:`text-foreground/90 block truncate`,children:e.name}):(0,v.jsxs)(`span`,{className:`font-semibold text-foreground block truncate`,children:[e.name,`/`]})},t))})}catch{return null}},Q={backgroundColor:`var(--status-info)`,opacity:.6},te=(e,t,n)=>{try{let i=e.trim().split(`
@@ -0,0 +1 @@
1
+ var e=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},t=new class extends e{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=n;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function i(e){setTimeout(e,0)}var a=typeof window>`u`||`Deno`in globalThis;function o(){}function s(e,t){return typeof e==`function`?e(t):e}function c(e){return typeof e==`number`&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return typeof e==`function`?e(t):e}function d(e,t){return typeof e==`function`?e(t):e}function f(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==m(o,t.options))return!1}else if(!g(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function p(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(h(t.options.mutationKey)!==h(a))return!1}else if(!g(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function m(e,t){return(t?.queryKeyHashFn||h)(e)}function h(e){return JSON.stringify(e,(e,t)=>x(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function g(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>g(e[n],t[n])):!1}var _=Object.prototype.hasOwnProperty;function v(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=b(e)&&b(t);if(!r&&!(x(e)&&x(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:_.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=v(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function y(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function b(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function x(e){if(!S(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!S(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function S(e){return Object.prototype.toString.call(e)===`[object Object]`}function C(e){return new Promise(t=>{r.setTimeout(t,e)})}function w(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:v(e,t)}function T(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function E(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var D=Symbol();function O(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===D?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ee(e,t){return typeof e==`function`?e(...t):!!e}function k(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var A=(()=>{let e=()=>a;return{isServer(){return e()},setIsServer(t){e=t}}})();function j(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var te=i;function ne(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=te,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var M=ne(),N=new class extends e{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function P(e){return Math.min(1e3*2**e,3e4)}function F(e){return(e??`online`)!==`online`||N.isOnline()}var I=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function L(e){let n=!1,r=0,i,a=j(),o=()=>a.status!==`pending`,s=t=>{if(!o()){let n=new I(t);p(n),e.onCancel?.(n)}},c=()=>{n=!0},l=()=>{n=!1},u=()=>t.isFocused()&&(e.networkMode===`always`||N.isOnline())&&e.canRun(),d=()=>F(e.networkMode)&&e.canRun(),f=e=>{o()||(i?.(),a.resolve(e))},p=e=>{o()||(i?.(),a.reject(e))},m=()=>new Promise(t=>{i=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{i=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let t,i=r===0?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(f).catch(t=>{if(o())return;let i=e.retry??(A.isServer()?0:3),a=e.retryDelay??P,s=typeof a==`function`?a(r,t):a,c=i===!0||typeof i==`number`&&r<i||typeof i==`function`&&i(r,t);if(n||!c){p(t);return}r++,e.onFail?.(r,t),C(s).then(()=>u()?void 0:m()).then(()=>{n?p(t):h()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(i?.(),a),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),a)}}var R=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),c(this.gcTime)&&(this.#e=r.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(A.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(r.clearTimeout(this.#e),this.#e=void 0)}};function z(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{k(e,()=>t.signal,()=>n=!0)},u=O(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?E:T;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?V:B,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:B(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function B(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function V(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function H(e,t){return t?B(e,t)!=null:!1}function U(e,t){return!t||!e.getPreviousPageParam?!1:V(e,t)!=null}var re=class extends R{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=K(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=K(this.options);e.data!==void 0&&(this.setState(G(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=w(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(o).catch(o):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>d(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>u(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!l(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=O(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?z(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=L({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof I&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof I){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...W(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...G(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),M.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function W(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:F(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function G(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function K(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var q=class extends e{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=j(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),J(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Y(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Y(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof d(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!y(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&X(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||d(this.options.enabled,this.#t)!==d(t.enabled,this.#t)||u(this.options.staleTime,this.#t)!==u(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||d(this.options.enabled,this.#t)!==d(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ae(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o)),t}#g(){this.#b();let e=u(this.options.staleTime,this.#t);if(A.isServer()||this.#r.isStale||!c(e))return;let t=l(this.#r.dataUpdatedAt,e)+1;this.#d=r.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(A.isServer()||d(this.options.enabled,this.#t)===!1||!c(this.#p)||this.#p===0)&&(this.#f=r.setInterval(()=>{(this.options.refetchIntervalInBackground||t.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(r.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(r.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,f;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&J(e,t),o=i&&X(e,n,t,r);(a||o)&&(l={...l,...W(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:p,errorUpdatedAt:m,status:h}=l;f=l.data;let g=!1;if(t.placeholderData!==void 0&&f===void 0&&h===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,g=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(h=`success`,f=w(i?.data,e,t),u=!0)}if(t.select&&f!==void 0&&!g)if(i&&f===a?.data&&t.select===this.#c)f=this.#l;else try{this.#c=t.select,f=t.select(f),f=w(i?.data,f,t),this.#l=f,this.#s=null}catch(e){this.#s=e}this.#s&&(p=this.#s,f=this.#l,m=Date.now(),h=`error`);let _=l.fetchStatus===`fetching`,v=h===`pending`,y=h===`error`,b=v&&_,x=f!==void 0,S={status:h,fetchStatus:l.fetchStatus,isPending:v,isSuccess:h===`success`,isError:y,isInitialLoading:b,isLoading:b,data:f,dataUpdatedAt:l.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:Z(e,t),refetch:this.refetch,promise:this.#o,isEnabled:d(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=j();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a()}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!y(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){M.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ie(e,t){return d(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||d(t.retryOnMount,e)!==!1)}function J(e,t){return ie(e,t)||e.state.data!==void 0&&Y(e,t,t.refetchOnMount)}function Y(e,t,n){if(d(t.enabled,e)!==!1&&u(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Z(e,t)}return!1}function X(e,t,n,r){return(e!==t||d(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Z(e,n)}function Z(e,t){return d(t.enabled,e)!==!1&&e.isStaleByTime(u(t.staleTime,e))}function ae(e,t){return!y(e.getCurrentResult(),t)}var oe=class extends q{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:H(t,n.data),hasPreviousPage:U(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},se=class extends R{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Q(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=L({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),M.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Q(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ce=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new se({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=$(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=$(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=$(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=$(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){M.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>p(t,e))}findAll(e={}){return this.getAll().filter(t=>p(e,t))}notify(e){M.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return M.batch(()=>Promise.all(e.map(e=>e.continue().catch(o))))}};function $(e){return e.options.scope?.id}var le=class extends e{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),y(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&h(t.mutationKey)!==h(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Q();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){M.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},ue=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??m(r,t),a=this.get(i);return a||(a=new re({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){M.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>f(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>f(e,t)):t}notify(e){M.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){M.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){M.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},de=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ue,this.#t=e.mutationCache||new ce,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(u(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=s(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return M.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;M.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return M.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=M.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(o).catch(o)}invalidateQueries(e,t={}){return M.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=M.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(o)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(o)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(u(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(o).catch(o)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(o).catch(o)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return N.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(h(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(h(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=m(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===D&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};export{I as a,o as c,q as i,v as l,le as n,M as o,oe as r,A as s,de as t,ee as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{c as r,i,l as a,n as o,o as s,r as c,s as l,u}from"./vendor-tanstack-query-core-Y_YoRHtC.js";var d=e(n(),1),f=t(),p=d.createContext(void 0),m=e=>{let t=d.useContext(p);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},h=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,f.jsx)(p.Provider,{value:e,children:t})),g=d.createContext(!1),_=()=>d.useContext(g);g.Provider;function v(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var y=d.createContext(v()),b=()=>d.useContext(y),x=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?u(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},S=e=>{d.useEffect(()=>{e.clearReset()},[e])},C=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||u(n,[e.error,r])),w=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},T=(e,t)=>e.isLoading&&e.isFetching&&!t,E=(e,t)=>e?.suspense&&t.isPending,D=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function O(e,t,n){let i=_(),a=b(),o=m(n),c=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(c);let u=o.getQueryCache().get(c.queryHash),f=e.subscribed!==!1;c._optimisticResults=i?`isRestoring`:f?`optimistic`:void 0,w(c),x(c,a,u),S(a);let p=!o.getQueryCache().get(c.queryHash),[h]=d.useState(()=>new t(o,c)),g=h.getOptimisticResult(c),v=!i&&f;if(d.useSyncExternalStore(d.useCallback(e=>{let t=v?h.subscribe(s.batchCalls(e)):r;return h.updateResult(),t},[h,v]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),d.useEffect(()=>{h.setOptions(c)},[c,h]),E(c,g))throw D(c,h,a);if(C({result:g,errorResetBoundary:a,throwOnError:c.throwOnError,query:u,suspense:c.suspense}))throw g.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(c,g),c.experimental_prefetchInRender&&!l.isServer()&&T(g,i)&&(p?D(c,h,a):u?.promise)?.catch(r).finally(()=>{h.updateResult()}),c.notifyOnChangeProps?g:h.trackResult(g)}function k(e,t){return O(e,i,t)}function A(e){return e}function j(e){return e}function M(e,t){let n=m(t);return P({filters:{...e,status:`pending`}},n).length}function N(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function P(e={},t){let n=m(t).getMutationCache(),r=d.useRef(e),i=d.useRef(null);return i.current===null&&(i.current=N(n,e)),d.useEffect(()=>{r.current=e}),d.useSyncExternalStore(d.useCallback(e=>n.subscribe(()=>{let t=a(i.current,N(n,r.current));i.current!==t&&(i.current=t,s.schedule(e))}),[n]),()=>i.current,()=>i.current)}function F(e,t){let n=m(t),[i]=d.useState(()=>new o(n,e));d.useEffect(()=>{i.setOptions(e)},[i,e]);let a=d.useSyncExternalStore(d.useCallback(e=>i.subscribe(s.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),c=d.useCallback((e,t)=>{i.mutate(e,t).catch(r)},[i]);if(a.error&&u(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:c,mutateAsync:a.mutate}}function I(e,t){return O(e,c,t)}export{j as a,h as c,P as i,m as l,F as n,A as o,M as r,k as s,I as t};