blade-code 0.10.127 → 0.10.129

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 (147) hide show
  1. package/dist/blade.js +2 -2
  2. package/dist/chunk-0z9nqbd0.js +2 -0
  3. package/dist/chunk-1c11sbk3.js +2 -0
  4. package/dist/{chunk-g7f3nhg2.js → chunk-1q6sasj0.js} +2 -2
  5. package/dist/chunk-1y8x5q68.js +1 -0
  6. package/dist/chunk-2bnpn8be.js +1 -0
  7. package/dist/{chunk-hbafhk9y.js → chunk-2y1qngw7.js} +1 -1
  8. package/dist/{chunk-s20hq62y.js → chunk-440v1nhy.js} +3 -3
  9. package/dist/{chunk-s6562rsq.js → chunk-44jtpg8y.js} +1 -1
  10. package/dist/{chunk-q265drks.js → chunk-53h87fmt.js} +1 -1
  11. package/dist/chunk-54yagjc7.js +2 -0
  12. package/dist/chunk-606343xt.js +1 -0
  13. package/dist/{chunk-a552m4hx.js → chunk-651cnx1s.js} +2 -2
  14. package/dist/{chunk-p0khbmbc.js → chunk-67qdrjyy.js} +1 -1
  15. package/dist/chunk-6czf04er.js +1 -0
  16. package/dist/{chunk-zm2bbagg.js → chunk-6p6ts4kv.js} +2 -2
  17. package/dist/{chunk-sca5q3tt.js → chunk-77efqpdc.js} +1 -1
  18. package/dist/{chunk-85bamng3.js → chunk-93x9xbew.js} +1 -1
  19. package/dist/chunk-9gs4eqt8.js +1 -0
  20. package/dist/{chunk-hhmhs2q1.js → chunk-9kt66etm.js} +1 -1
  21. package/dist/chunk-9pzfv6nb.js +1 -0
  22. package/dist/{chunk-eq1anf88.js → chunk-9rj01jd1.js} +2 -2
  23. package/dist/chunk-9s8saznq.js +1 -0
  24. package/dist/{chunk-gna6njws.js → chunk-9snmrjg8.js} +2 -2
  25. package/dist/{chunk-pezzyyyk.js → chunk-a60cmnmz.js} +2 -2
  26. package/dist/{chunk-adkpwx6c.js → chunk-aaxc81jc.js} +1 -1
  27. package/dist/{chunk-7n7swtwg.js → chunk-ajsw4te2.js} +2 -2
  28. package/dist/{chunk-rw2sq3mf.js → chunk-amc5d34g.js} +1 -1
  29. package/dist/{chunk-68sf54n4.js → chunk-ar5np5h5.js} +2 -2
  30. package/dist/{chunk-t727txa9.js → chunk-bamj4e6v.js} +2 -2
  31. package/dist/{chunk-sv833k2e.js → chunk-dfjmvj3d.js} +2 -2
  32. package/dist/{chunk-dknmpacf.js → chunk-dg54m1y3.js} +2 -2
  33. package/dist/{chunk-8qp8v96d.js → chunk-edtxcqxa.js} +1 -1
  34. package/dist/chunk-f8gb685p.js +2 -0
  35. package/dist/chunk-fhafrrvs.js +1 -0
  36. package/dist/{chunk-2t6b962t.js → chunk-g4xny949.js} +1 -1
  37. package/dist/chunk-gfbkrk60.js +338 -0
  38. package/dist/{chunk-1b2dkwpv.js → chunk-gmqpfm52.js} +2 -2
  39. package/dist/{chunk-2xezz3nt.js → chunk-grhsv55v.js} +2 -2
  40. package/dist/{chunk-y94239bb.js → chunk-jkfkyedn.js} +1 -1
  41. package/dist/chunk-jxh9wf3c.js +1708 -0
  42. package/dist/{chunk-a3ewfebr.js → chunk-kbxqsf93.js} +2 -2
  43. package/dist/chunk-kd3k1q9z.js +1 -0
  44. package/dist/{chunk-ve4kvj1n.js → chunk-m5vpmvrs.js} +20 -20
  45. package/dist/chunk-m9mw8ppy.js +1 -0
  46. package/dist/{chunk-r5nvt35e.js → chunk-mawx6fa5.js} +2 -2
  47. package/dist/{chunk-ye4wyq1k.js → chunk-mdew58v9.js} +1 -1
  48. package/dist/{chunk-mpwyf1fe.js → chunk-mkzze9aq.js} +2 -2
  49. package/dist/{chunk-dh03cybw.js → chunk-mvm1rzc4.js} +2 -2
  50. package/dist/chunk-nz8wbcf1.js +1 -0
  51. package/dist/{chunk-g2jx4y8f.js → chunk-p00f53yq.js} +1 -1
  52. package/dist/{chunk-wmds1jq3.js → chunk-pa636c8e.js} +1 -1
  53. package/dist/chunk-pd1b8jrv.js +1 -0
  54. package/dist/chunk-pj69j4zp.js +2 -0
  55. package/dist/{chunk-t23n4wn0.js → chunk-q6xsfm60.js} +2 -2
  56. package/dist/{chunk-1g0d9yw0.js → chunk-qcvxff27.js} +2 -2
  57. package/dist/chunk-r1b4pnce.js +94 -0
  58. package/dist/{chunk-gqv0vkg9.js → chunk-rnmt44jm.js} +2 -2
  59. package/dist/chunk-s51h6n70.js +23 -0
  60. package/dist/chunk-s6158tg7.js +170 -0
  61. package/dist/{chunk-xvn80fge.js → chunk-sfe4810k.js} +1 -1
  62. package/dist/{chunk-cw2b3383.js → chunk-sj1dzeta.js} +1 -1
  63. package/dist/{chunk-0zzh482s.js → chunk-sx77dpxw.js} +1 -1
  64. package/dist/chunk-t6bg5b37.js +1 -0
  65. package/dist/{chunk-w7n73ag8.js → chunk-tkydv9k8.js} +1 -1
  66. package/dist/{chunk-z1zr4wts.js → chunk-v52wc8yg.js} +2 -2
  67. package/dist/chunk-wzcwxhhz.js +1 -0
  68. package/dist/{chunk-shd1ec3n.js → chunk-xcmadwjv.js} +2 -2
  69. package/dist/chunk-xdphpfrg.js +14 -0
  70. package/dist/chunk-xsjtjrt9.js +10 -0
  71. package/dist/{chunk-m76jmvsf.js → chunk-y4f99y85.js} +2 -2
  72. package/dist/{chunk-xdvn6yrd.js → chunk-z03dtyh6.js} +1 -1
  73. package/dist/chunk-za8gyypy.js +171 -0
  74. package/dist/{chunk-hmwz31tc.js → chunk-zkzhm39s.js} +1 -1
  75. package/dist/{chunk-6kwg4hcv.js → chunk-zwjrensv.js} +1 -1
  76. package/dist/chunk-zzgxy86p.js +1 -0
  77. package/dist/web/assets/ChatView-Bg36FUaj.js +53 -0
  78. package/dist/web/assets/{CodeBlockHighlighter-0VOa5Mes.js → CodeBlockHighlighter-D5rB73Eo.js} +2 -2
  79. package/dist/web/assets/FilePreview-BxaBSmap.js +65 -0
  80. package/dist/web/assets/KanbanBoard-B4gx3JMo.js +16 -0
  81. package/dist/web/assets/{MarkdownRenderer-3g4TPTeI.js → MarkdownRenderer-BRH7LHhN.js} +3 -3
  82. package/dist/web/assets/ScrollArea-DikU3QeQ.js +1 -0
  83. package/dist/web/assets/SessionHistorySurface-DG80d6-F.js +6 -0
  84. package/dist/web/assets/{SettingsModal-3GMy6V-E.js → SettingsModal-Bxqkok81.js} +3 -3
  85. package/dist/web/assets/Sidebar-DGaHGcHx.js +31 -0
  86. package/dist/web/assets/TaskSwitcher-DOnLPurk.js +26 -0
  87. package/dist/web/assets/TerminalPanel-BzhCF9vw.js +6 -0
  88. package/dist/web/assets/archive-BiDGrqry.js +6 -0
  89. package/dist/web/assets/{arrow-left-03GxbYI7.js → arrow-left-BY-esOAP.js} +1 -1
  90. package/dist/web/assets/{calendar-clock-8W4ostX1.js → calendar-clock-BCyxvfVt.js} +1 -1
  91. package/dist/web/assets/chevron-right-Bg-10yuN.js +6 -0
  92. package/dist/web/assets/{chevrons-up-down-BboZzEAk.js → chevrons-up-down-M5SAJq7T.js} +1 -1
  93. package/dist/web/assets/{clock-3-aXgeptZP.js → clock-3-v-nHTA0A.js} +1 -1
  94. package/dist/web/assets/copy-p1zc_rjZ.js +6 -0
  95. package/dist/web/assets/download-D_-kbJXR.js +6 -0
  96. package/dist/web/assets/{external-link-UkIIC2ds.js → external-link-wSGTIqe3.js} +1 -1
  97. package/dist/web/assets/{folder-BOCc5dv2.js → folder-Ltm9jCS5.js} +1 -1
  98. package/dist/web/assets/index-B4186fIT.css +1 -0
  99. package/dist/web/assets/index-_xnlrekR.js +210 -0
  100. package/dist/web/assets/{pause-DVIT6IIr.js → pause-_LvCZkxM.js} +1 -1
  101. package/dist/web/assets/pencil-DB6ICr_h.js +6 -0
  102. package/dist/web/assets/{play-DsdF5dji.js → play-BRXP1rHJ.js} +1 -1
  103. package/dist/web/assets/plus-BqvjEpLw.js +6 -0
  104. package/dist/web/assets/session-events-AGMXvPey.js +22 -0
  105. package/dist/web/assets/settings-LfQbDvBA.js +6 -0
  106. package/dist/web/assets/teamService-B5FnUcet.js +1 -0
  107. package/dist/web/assets/terminal-By4sO9Gw.js +6 -0
  108. package/dist/web/assets/vendor-radix-D6QrtXqd.js +45 -0
  109. package/dist/web/index.html +3 -3
  110. package/package.json +1 -1
  111. package/dist/chunk-23wg4jvz.js +0 -8
  112. package/dist/chunk-2a0vs0a0.js +0 -1
  113. package/dist/chunk-2j2mnzdg.js +0 -2
  114. package/dist/chunk-462sbp8t.js +0 -171
  115. package/dist/chunk-54f7t2g3.js +0 -1
  116. package/dist/chunk-8k26rhcp.js +0 -1
  117. package/dist/chunk-8zftskf2.js +0 -2
  118. package/dist/chunk-9cvq8w6k.js +0 -10
  119. package/dist/chunk-9hm3hy8d.js +0 -1
  120. package/dist/chunk-9rj1may5.js +0 -1
  121. package/dist/chunk-9xzw649r.js +0 -2
  122. package/dist/chunk-a0t558d4.js +0 -169
  123. package/dist/chunk-az5eb47t.js +0 -1
  124. package/dist/chunk-d4z5cp40.js +0 -2
  125. package/dist/chunk-d71gxct6.js +0 -118
  126. package/dist/chunk-hxfqcy5r.js +0 -23
  127. package/dist/chunk-k0n2028d.js +0 -1
  128. package/dist/chunk-mg4jnq0p.js +0 -1
  129. package/dist/chunk-mxkezzj9.js +0 -1
  130. package/dist/chunk-mzxwhhnc.js +0 -1
  131. package/dist/chunk-tqjrt537.js +0 -1
  132. package/dist/chunk-xba79vkf.js +0 -1703
  133. package/dist/chunk-xgp318dt.js +0 -1
  134. package/dist/chunk-xnbzrh8b.js +0 -140
  135. package/dist/chunk-y3jbc2xx.js +0 -1
  136. package/dist/chunk-yc64nfym.js +0 -1
  137. package/dist/chunk-yqh061d8.js +0 -1
  138. package/dist/web/assets/ChatView-DCHnicTP.js +0 -58
  139. package/dist/web/assets/FilePreview-C_3KHzzj.js +0 -65
  140. package/dist/web/assets/KanbanBoard-D_NTkUnD.js +0 -16
  141. package/dist/web/assets/TaskSwitcher-eCdxu5Eo.js +0 -26
  142. package/dist/web/assets/TerminalPanel-9q9Trmv9.js +0 -6
  143. package/dist/web/assets/index-DGf6Z2kM.css +0 -1
  144. package/dist/web/assets/index-DaiT-mmo.js +0 -275
  145. package/dist/web/assets/session-events-CWzF04l4.js +0 -22
  146. package/dist/web/assets/teamService-BliaDj1Z.js +0 -1
  147. package/dist/web/assets/vendor-radix-Bc1_Q9tz.js +0 -45
@@ -1,275 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/teamService-BliaDj1Z.js","assets/vendor-react-DofNRwfy.js","assets/vendor-radix-Bc1_Q9tz.js","assets/session-events-CWzF04l4.js","assets/SettingsModal-3GMy6V-E.js","assets/external-link-UkIIC2ds.js","assets/calendar-clock-8W4ostX1.js","assets/play-DsdF5dji.js","assets/team-QZ9byb3E.js","assets/arrow-left-03GxbYI7.js","assets/TaskSwitcher-eCdxu5Eo.js","assets/folder-BOCc5dv2.js","assets/clock-3-aXgeptZP.js","assets/FilePreview-C_3KHzzj.js","assets/chevrons-up-down-BboZzEAk.js","assets/TerminalPanel-9q9Trmv9.js","assets/vendor-xterm-DuYZoU4T.js","assets/vendor-xterm-9CEnUXvW.css","assets/ChatView-DCHnicTP.js","assets/pause-DVIT6IIr.js","assets/KanbanBoard-D_NTkUnD.js"])))=>i.map(i=>d[i]);
2
- import{r as y,j as a,d as M0,R as $0}from"./vendor-react-DofNRwfy.js";import{S as F0,O as xp,P as L0,C as yp,a as D0,T as wp,D as vp,R as _0,b as Sp,V as U0,c as B0,d as jp,e as H0,f as q0,g as Ip,h as z0,i as K0}from"./vendor-radix-Bc1_Q9tz.js";import{c as Dn,g as G0,w as lu,u as V0,a as W0,b as J0,d as du,e as Yo,f as wo,h as uu,i as Ga,t as Cp,j as Q0,k as Y0,l as on}from"./session-events-CWzF04l4.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const Z0="modulepreload",X0=function(e){return"/"+e},pu={},es=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),d=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(f=>{if(f=X0(f),f in pu)return;pu[f]=!0;const u=f.endsWith(".css"),m=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":Z0,u||(p.as="script"),p.crossOrigin="",p.href=f,d&&p.setAttribute("nonce",d),document.head.appendChild(p),u)return new Promise((h,b)=>{p.addEventListener("load",h),p.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function i(o){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=o,window.dispatchEvent(d),!d.defaultPrevented)throw o}return s.then(o=>{for(const d of o||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};/**
3
- * @license lucide-react v0.300.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */var ey={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
8
- * @license lucide-react v0.300.0 - ISC
9
- *
10
- * This source code is licensed under the ISC license.
11
- * See the LICENSE file in the root directory of this source tree.
12
- */const ty=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),se=(e,t)=>{const n=y.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:d="",children:f,...u},m)=>y.createElement("svg",{ref:m,...ey,width:s,height:s,stroke:r,strokeWidth:o?Number(i)*24/Number(s):i,className:["lucide",`lucide-${ty(e)}`,d].join(" "),...u},[...t.map(([p,h])=>y.createElement(p,h)),...Array.isArray(f)?f:[f]]));return n.displayName=`${e}`,n};/**
13
- * @license lucide-react v0.300.0 - ISC
14
- *
15
- * This source code is licensed under the ISC license.
16
- * See the LICENSE file in the root directory of this source tree.
17
- */const Ns=se("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
18
- * @license lucide-react v0.300.0 - ISC
19
- *
20
- * This source code is licensed under the ISC license.
21
- * See the LICENSE file in the root directory of this source tree.
22
- */const ny=se("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
23
- * @license lucide-react v0.300.0 - ISC
24
- *
25
- * This source code is licensed under the ISC license.
26
- * See the LICENSE file in the root directory of this source tree.
27
- */const Ep=se("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
28
- * @license lucide-react v0.300.0 - ISC
29
- *
30
- * This source code is licensed under the ISC license.
31
- * See the LICENSE file in the root directory of this source tree.
32
- */const ry=se("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
33
- * @license lucide-react v0.300.0 - ISC
34
- *
35
- * This source code is licensed under the ISC license.
36
- * See the LICENSE file in the root directory of this source tree.
37
- */const fu=se("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
38
- * @license lucide-react v0.300.0 - ISC
39
- *
40
- * This source code is licensed under the ISC license.
41
- * See the LICENSE file in the root directory of this source tree.
42
- */const sy=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/**
43
- * @license lucide-react v0.300.0 - ISC
44
- *
45
- * This source code is licensed under the ISC license.
46
- * See the LICENSE file in the root directory of this source tree.
47
- */const mu=se("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
48
- * @license lucide-react v0.300.0 - ISC
49
- *
50
- * This source code is licensed under the ISC license.
51
- * See the LICENSE file in the root directory of this source tree.
52
- */const Tp=se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
53
- * @license lucide-react v0.300.0 - ISC
54
- *
55
- * This source code is licensed under the ISC license.
56
- * See the LICENSE file in the root directory of this source tree.
57
- */const js=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
58
- * @license lucide-react v0.300.0 - ISC
59
- *
60
- * This source code is licensed under the ISC license.
61
- * See the LICENSE file in the root directory of this source tree.
62
- */const iy=se("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
63
- * @license lucide-react v0.300.0 - ISC
64
- *
65
- * This source code is licensed under the ISC license.
66
- * See the LICENSE file in the root directory of this source tree.
67
- */const oy=se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
68
- * @license lucide-react v0.300.0 - ISC
69
- *
70
- * This source code is licensed under the ISC license.
71
- * See the LICENSE file in the root directory of this source tree.
72
- */const ay=se("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
73
- * @license lucide-react v0.300.0 - ISC
74
- *
75
- * This source code is licensed under the ISC license.
76
- * See the LICENSE file in the root directory of this source tree.
77
- */const Ap=se("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
78
- * @license lucide-react v0.300.0 - ISC
79
- *
80
- * This source code is licensed under the ISC license.
81
- * See the LICENSE file in the root directory of this source tree.
82
- */const Pp=se("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
83
- * @license lucide-react v0.300.0 - ISC
84
- *
85
- * This source code is licensed under the ISC license.
86
- * See the LICENSE file in the root directory of this source tree.
87
- */const cy=se("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4",key:"702lig"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}]]);/**
88
- * @license lucide-react v0.300.0 - ISC
89
- *
90
- * This source code is licensed under the ISC license.
91
- * See the LICENSE file in the root directory of this source tree.
92
- */const hu=se("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
93
- * @license lucide-react v0.300.0 - ISC
94
- *
95
- * This source code is licensed under the ISC license.
96
- * See the LICENSE file in the root directory of this source tree.
97
- */const li=se("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
98
- * @license lucide-react v0.300.0 - ISC
99
- *
100
- * This source code is licensed under the ISC license.
101
- * See the LICENSE file in the root directory of this source tree.
102
- */const ly=se("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
103
- * @license lucide-react v0.300.0 - ISC
104
- *
105
- * This source code is licensed under the ISC license.
106
- * See the LICENSE file in the root directory of this source tree.
107
- */const Ro=se("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
108
- * @license lucide-react v0.300.0 - ISC
109
- *
110
- * This source code is licensed under the ISC license.
111
- * See the LICENSE file in the root directory of this source tree.
112
- */const Kc=se("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
113
- * @license lucide-react v0.300.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */const dy=se("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
118
- * @license lucide-react v0.300.0 - ISC
119
- *
120
- * This source code is licensed under the ISC license.
121
- * See the LICENSE file in the root directory of this source tree.
122
- */const uy=se("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
123
- * @license lucide-react v0.300.0 - ISC
124
- *
125
- * This source code is licensed under the ISC license.
126
- * See the LICENSE file in the root directory of this source tree.
127
- */const py=se("Hammer",[["path",{d:"m15 12-8.5 8.5c-.83.83-2.17.83-3 0 0 0 0 0 0 0a2.12 2.12 0 0 1 0-3L12 9",key:"1afvon"}],["path",{d:"M17.64 15 22 10.64",key:"zsji6s"}],["path",{d:"m20.91 11.7-1.25-1.25c-.6-.6-.93-1.4-.93-2.25v-.86L16.01 4.6a5.56 5.56 0 0 0-3.94-1.64H9l.92.82A6.18 6.18 0 0 1 12 8.4v1.56l2 2h2.47l2.26 1.91",key:"lehyy1"}]]);/**
128
- * @license lucide-react v0.300.0 - ISC
129
- *
130
- * This source code is licensed under the ISC license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */const fy=se("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0",key:"aigmz7"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v2",key:"1n6bmn"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v8",key:"a9iiix"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
133
- * @license lucide-react v0.300.0 - ISC
134
- *
135
- * This source code is licensed under the ISC license.
136
- * See the LICENSE file in the root directory of this source tree.
137
- */const my=se("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
138
- * @license lucide-react v0.300.0 - ISC
139
- *
140
- * This source code is licensed under the ISC license.
141
- * See the LICENSE file in the root directory of this source tree.
142
- */const gu=se("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
143
- * @license lucide-react v0.300.0 - ISC
144
- *
145
- * This source code is licensed under the ISC license.
146
- * See the LICENSE file in the root directory of this source tree.
147
- */const hy=se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
148
- * @license lucide-react v0.300.0 - ISC
149
- *
150
- * This source code is licensed under the ISC license.
151
- * See the LICENSE file in the root directory of this source tree.
152
- */const Np=se("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
153
- * @license lucide-react v0.300.0 - ISC
154
- *
155
- * This source code is licensed under the ISC license.
156
- * See the LICENSE file in the root directory of this source tree.
157
- */const mt=se("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
158
- * @license lucide-react v0.300.0 - ISC
159
- *
160
- * This source code is licensed under the ISC license.
161
- * See the LICENSE file in the root directory of this source tree.
162
- */const gy=se("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
163
- * @license lucide-react v0.300.0 - ISC
164
- *
165
- * This source code is licensed under the ISC license.
166
- * See the LICENSE file in the root directory of this source tree.
167
- */const by=se("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
168
- * @license lucide-react v0.300.0 - ISC
169
- *
170
- * This source code is licensed under the ISC license.
171
- * See the LICENSE file in the root directory of this source tree.
172
- */const ky=se("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
173
- * @license lucide-react v0.300.0 - ISC
174
- *
175
- * This source code is licensed under the ISC license.
176
- * See the LICENSE file in the root directory of this source tree.
177
- */const bu=se("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
178
- * @license lucide-react v0.300.0 - ISC
179
- *
180
- * This source code is licensed under the ISC license.
181
- * See the LICENSE file in the root directory of this source tree.
182
- */const xy=se("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
183
- * @license lucide-react v0.300.0 - ISC
184
- *
185
- * This source code is licensed under the ISC license.
186
- * See the LICENSE file in the root directory of this source tree.
187
- */const Gc=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
188
- * @license lucide-react v0.300.0 - ISC
189
- *
190
- * This source code is licensed under the ISC license.
191
- * See the LICENSE file in the root directory of this source tree.
192
- */const di=se("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
193
- * @license lucide-react v0.300.0 - ISC
194
- *
195
- * This source code is licensed under the ISC license.
196
- * See the LICENSE file in the root directory of this source tree.
197
- */const Zo=se("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
198
- * @license lucide-react v0.300.0 - ISC
199
- *
200
- * This source code is licensed under the ISC license.
201
- * See the LICENSE file in the root directory of this source tree.
202
- */const yy=se("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
203
- * @license lucide-react v0.300.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */const Vc=se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
208
- * @license lucide-react v0.300.0 - ISC
209
- *
210
- * This source code is licensed under the ISC license.
211
- * See the LICENSE file in the root directory of this source tree.
212
- */const wy=se("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
213
- * @license lucide-react v0.300.0 - ISC
214
- *
215
- * This source code is licensed under the ISC license.
216
- * See the LICENSE file in the root directory of this source tree.
217
- */const Op=se("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
218
- * @license lucide-react v0.300.0 - ISC
219
- *
220
- * This source code is licensed under the ISC license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */const Rp=se("ShieldAlert",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
223
- * @license lucide-react v0.300.0 - ISC
224
- *
225
- * This source code is licensed under the ISC license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */const vy=se("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
228
- * @license lucide-react v0.300.0 - ISC
229
- *
230
- * This source code is licensed under the ISC license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */const Mp=se("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
233
- * @license lucide-react v0.300.0 - ISC
234
- *
235
- * This source code is licensed under the ISC license.
236
- * See the LICENSE file in the root directory of this source tree.
237
- */const Wc=se("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
238
- * @license lucide-react v0.300.0 - ISC
239
- *
240
- * This source code is licensed under the ISC license.
241
- * See the LICENSE file in the root directory of this source tree.
242
- */const $p=se("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
243
- * @license lucide-react v0.300.0 - ISC
244
- *
245
- * This source code is licensed under the ISC license.
246
- * See the LICENSE file in the root directory of this source tree.
247
- */const Fp=se("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
248
- * @license lucide-react v0.300.0 - ISC
249
- *
250
- * This source code is licensed under the ISC license.
251
- * See the LICENSE file in the root directory of this source tree.
252
- */const ku=se("WifiOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 4.17-2.65",key:"11utq1"}],["path",{d:"M10.66 5c4.01-.36 8.14.9 11.34 3.76",key:"hxefdu"}],["path",{d:"M16.85 11.25a10 10 0 0 1 2.22 1.68",key:"q734kn"}],["path",{d:"M5 13a10 10 0 0 1 5.24-2.76",key:"piq4yl"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
253
- * @license lucide-react v0.300.0 - ISC
254
- *
255
- * This source code is licensed under the ISC license.
256
- * See the LICENSE file in the root directory of this source tree.
257
- */const Sy=se("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
258
- * @license lucide-react v0.300.0 - ISC
259
- *
260
- * This source code is licensed under the ISC license.
261
- * See the LICENSE file in the root directory of this source tree.
262
- */const ui=se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Lp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Lp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Dp(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Lp(e))&&(r&&(r+=" "),r+=t);return r}const xu=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yu=Dp,jy=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yu(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(u=>{const m=n==null?void 0:n[u],p=i==null?void 0:i[u];if(m===null)return null;const h=xu(m)||xu(p);return s[u][h]}),d=n&&Object.entries(n).reduce((u,m)=>{let[p,h]=m;return h===void 0||(u[p]=h),u},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,m)=>{let{class:p,className:h,...b}=m;return Object.entries(b).every(k=>{let[S,C]=k;return Array.isArray(C)?C.includes({...i,...d}[S]):{...i,...d}[S]===C})?[...u,p,h]:u},[]);return yu(e,o,f,n==null?void 0:n.class,n==null?void 0:n.className)},Jc="-",Iy=e=>{const t=Ey(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const d=o.split(Jc);return d[0]===""&&d.length!==1&&d.shift(),_p(d,t)||Cy(o)},getConflictingClassGroupIds:(o,d)=>{const f=n[o]||[];return d&&r[o]?[...f,...r[o]]:f}}},_p=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?_p(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Jc);return(o=t.validators.find(({validator:d})=>d(i)))==null?void 0:o.classGroupId},wu=/^\[(.+)\]$/,Cy=e=>{if(wu.test(e)){const t=wu.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ey=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Ay(Object.entries(e.classGroups),n).forEach(([i,o])=>{dc(o,r,i,t)}),r},dc=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:vu(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(Ty(s)){dc(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{dc(o,vu(t,i),n,r)})})},vu=(e,t)=>{let n=e;return t.split(Jc).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Ty=e=>e.isThemeGetter,Ay=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,d])=>[t+o,d])):i);return[n,s]}):e,Py=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},Up="!",Ny=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=d=>{const f=[];let u=0,m=0,p;for(let C=0;C<d.length;C++){let x=d[C];if(u===0){if(x===s&&(r||d.slice(C,C+i)===t)){f.push(d.slice(m,C)),m=C+i;continue}if(x==="/"){p=C;continue}}x==="["?u++:x==="]"&&u--}const h=f.length===0?d:d.substring(m),b=h.startsWith(Up),k=b?h.substring(1):h,S=p&&p>m?p-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:S}};return n?d=>n({className:d,parseClassName:o}):o},Oy=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Ry=e=>({cache:Py(e.cacheSize),parseClassName:Ny(e),...Iy(e)}),My=/\s+/,$y=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(My);let d="";for(let f=o.length-1;f>=0;f-=1){const u=o[f],{modifiers:m,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:b}=n(u);let k=!!b,S=r(k?h.substring(0,b):h);if(!S){if(!k){d=u+(d.length>0?" "+d:d);continue}if(S=r(h),!S){d=u+(d.length>0?" "+d:d);continue}k=!1}const C=Oy(m).join(":"),x=p?C+Up:C,P=x+S;if(i.includes(P))continue;i.push(P);const N=s(S,k);for(let M=0;M<N.length;++M){const D=N[M];i.push(x+D)}d=u+(d.length>0?" "+d:d)}return d};function Fy(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Bp(t))&&(r&&(r+=" "),r+=n);return r}const Bp=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Bp(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ly(e,...t){let n,r,s,i=o;function o(f){const u=t.reduce((m,p)=>p(m),e());return n=Ry(u),r=n.cache.get,s=n.cache.set,i=d,d(f)}function d(f){const u=r(f);if(u)return u;const m=$y(f,n);return s(f,m),m}return function(){return i(Fy.apply(null,arguments))}}const Ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Hp=/^\[(?:([a-z-]+):)?(.+)\]$/i,Dy=/^\d+\/\d+$/,_y=new Set(["px","full","screen"]),Uy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,By=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,qy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jn=e=>As(e)||_y.has(e)||Dy.test(e),hr=e=>Os(e,"length",Zy),As=e=>!!e&&!Number.isNaN(Number(e)),Va=e=>Os(e,"number",As),ri=e=>!!e&&Number.isInteger(Number(e)),Ky=e=>e.endsWith("%")&&As(e.slice(0,-1)),ge=e=>Hp.test(e),gr=e=>Uy.test(e),Gy=new Set(["length","size","percentage"]),Vy=e=>Os(e,Gy,qp),Wy=e=>Os(e,"position",qp),Jy=new Set(["image","url"]),Qy=e=>Os(e,Jy,ew),Yy=e=>Os(e,"",Xy),si=()=>!0,Os=(e,t,n)=>{const r=Hp.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Zy=e=>By.test(e)&&!Hy.test(e),qp=()=>!1,Xy=e=>qy.test(e),ew=e=>zy.test(e),tw=()=>{const e=Ye("colors"),t=Ye("spacing"),n=Ye("blur"),r=Ye("brightness"),s=Ye("borderColor"),i=Ye("borderRadius"),o=Ye("borderSpacing"),d=Ye("borderWidth"),f=Ye("contrast"),u=Ye("grayscale"),m=Ye("hueRotate"),p=Ye("invert"),h=Ye("gap"),b=Ye("gradientColorStops"),k=Ye("gradientColorStopPositions"),S=Ye("inset"),C=Ye("margin"),x=Ye("opacity"),P=Ye("padding"),N=Ye("saturate"),M=Ye("scale"),D=Ye("sepia"),j=Ye("skew"),I=Ye("space"),T=Ye("translate"),$=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",ge,t],O=()=>[ge,t],Q=()=>["",Jn,hr],ae=()=>["auto",As,ge],le=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],de=()=>["solid","dashed","dotted","double","none"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>["start","end","center","between","around","evenly","stretch"],he=()=>["","0",ge],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[As,ge];return{cacheSize:500,separator:":",theme:{colors:[si],spacing:[Jn,hr],blur:["none","",gr,ge],brightness:ce(),borderColor:[e],borderRadius:["none","","full",gr,ge],borderSpacing:O(),borderWidth:Q(),contrast:ce(),grayscale:he(),hueRotate:ce(),invert:he(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[Ky,hr],inset:te(),margin:te(),opacity:ce(),padding:O(),saturate:ce(),scale:ce(),sepia:he(),skew:ce(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",ge]}],container:["container"],columns:[{columns:[gr]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...le(),ge]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ri,ge]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ge]}],grow:[{grow:he()}],shrink:[{shrink:he()}],order:[{order:["first","last","none",ri,ge]}],"grid-cols":[{"grid-cols":[si]}],"col-start-end":[{col:["auto",{span:["full",ri,ge]},ge]}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":[si]}],"row-start-end":[{row:["auto",{span:[ri,ge]},ge]}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ge]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ge]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[P]}],px:[{px:[P]}],py:[{py:[P]}],ps:[{ps:[P]}],pe:[{pe:[P]}],pt:[{pt:[P]}],pr:[{pr:[P]}],pb:[{pb:[P]}],pl:[{pl:[P]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ge,t]}],"min-w":[{"min-w":[ge,t,"min","max","fit"]}],"max-w":[{"max-w":[ge,t,"none","full","min","max","fit","prose",{screen:[gr]},gr]}],h:[{h:[ge,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ge,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ge,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ge,t,"auto","min","max","fit"]}],"font-size":[{text:["base",gr,hr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Va]}],"font-family":[{font:[si]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ge]}],"line-clamp":[{"line-clamp":["none",As,Va]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jn,ge]}],"list-image":[{"list-image":["none",ge]}],"list-style-type":[{list:["none","disc","decimal",ge]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jn,hr]}],"underline-offset":[{"underline-offset":["auto",Jn,ge]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...le(),Wy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Vy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Qy]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[k]}],"gradient-via-pos":[{via:[k]}],"gradient-to-pos":[{to:[k]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...de(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:de()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...de()]}],"outline-offset":[{"outline-offset":[Jn,ge]}],"outline-w":[{outline:[Jn,hr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Jn,hr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",gr,Yy]}],"shadow-color":[{shadow:[si]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":me()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",gr,ge]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[N]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ge]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",ge]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[ri,ge]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ge]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Jn,hr,Va]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},nw=Ly(tw);function J(...e){return nw(Dp(e))}const rw=jy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Kr=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?F0:"button";return a.jsx(o,{className:J(rw({variant:t,size:n,className:e})),ref:i,...s})});Kr.displayName="Button";const Qc=_0,sw=L0,zp=y.forwardRef(({className:e,...t},n)=>a.jsx(xp,{ref:n,className:J("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));zp.displayName=xp.displayName;const Xo=y.forwardRef(({className:e,children:t,hideCloseButton:n,...r},s)=>a.jsxs(sw,{children:[a.jsx(zp,{}),a.jsxs(yp,{ref:s,"aria-modal":"true",className:J("fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100dvh-24px)] w-[calc(100vw-24px)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,!n&&a.jsxs(D0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(ui,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xo.displayName=yp.displayName;const Yc=({className:e,...t})=>a.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Yc.displayName="DialogHeader";const Kp=({className:e,...t})=>a.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Kp.displayName="DialogFooter";const ea=y.forwardRef(({className:e,...t},n)=>a.jsx(wp,{ref:n,className:J("text-lg font-semibold leading-none tracking-tight",e),...t}));ea.displayName=wp.displayName;const ta=y.forwardRef(({className:e,...t},n)=>a.jsx(vp,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));ta.displayName=vp.displayName;const iw={"app.restoring":"Restoring workspace…","layout.workspace.pathAria":"Workspace path","layout.workspace.empty":"No workspace","layout.action.rewind":"Rewind session","layout.action.openNavigation":"Open navigation","layout.action.previewRestore":"Restore preview","layout.action.previewMaximize":"Maximize preview","terminal.title":"Terminal","terminal.status.connected":"Terminal connected","terminal.status.disconnected":"Terminal disconnected","terminal.action.minimize":"Minimize terminal","terminal.action.restore":"Restore terminal","terminal.action.close":"Close terminal","sidebar.brand.badge":"WEB","sidebar.action.collapse":"Collapse sidebar","sidebar.action.expand":"Expand sidebar","sidebar.navigationAria":"Task navigation","sidebar.action.newTask":"New Task","sidebar.action.newTaskShort":"New task","sidebar.action.taskBoard":"Task board","sidebar.action.terminal":"Terminal","sidebar.action.terminalToggle":"Toggle terminal","sidebar.action.searchTasks":"Search tasks","sidebar.unreadTasks":"{count} unread tasks","sidebar.section.skills":"Skills","sidebar.section.mcp":"MCP","sidebar.section.settings":"Settings","sidebar.status.user":"User","sidebar.status.feedLive":"Task feed live","sidebar.status.feedOffline":"Task feed offline","sidebar.empty.title":"No tasks yet","sidebar.empty.hint":"Dispatch one from the home view","sidebar.group.running":"RUNNING","sidebar.group.queued":"QUEUED","sidebar.group.interrupted":"INTERRUPTED","sidebar.group.failed":"FAILED","sidebar.group.cancelled":"CANCELLED","sidebar.group.done":"DONE","sidebar.group.showMore":"Show {count} more","sidebar.group.showLess":"Show less","sidebar.view.project":"Projects","sidebar.view.status":"Status","sidebar.view.projectAria":"Group sessions by project","sidebar.view.statusAria":"Group sessions by status","sidebar.project.active":"active","sidebar.project.expand":"Expand {name}","sidebar.project.collapse":"Collapse {name}","sidebar.project.newTask":"New task in {name}","sidebar.project.reorder":"Reorder {name}, position {position} of {count}","sidebar.project.reorderHint":"Drag to reorder, or use Up and Down arrow keys","sidebar.project.reordered":"Moved {name} to position {position}","sidebar.project.projects":"Projects","sidebar.catalog.syncing":"Syncing task history…","sidebar.catalog.loaded":"{count} loaded","sidebar.catalog.incomplete":"Task history is incomplete","sidebar.catalog.retry":"Retry","projects.dialog.title":"Projects","projects.dialog.description":"Bind local folders to switch task context without restarting Blade.","projects.bind.placeholder":"/absolute/path/to/project","projects.bind.pathLabel":"Project path","projects.bind.action":"Bind","projects.bind.failed":"Failed to bind project","projects.pick.action":"Choose project folder","projects.pick.actionShort":"Choose","projects.pick.picking":"Choosing…","projects.pick.failed":"Failed to choose a project folder","projects.unbind.action":"Unbind project","projects.unavailable":"unavailable","sidebar.language.label":"Language","sidebar.language.aria":"Switch language","sidebar.language.en":"EN","sidebar.language.zh":"中","session.env.worktree":"worktree","session.env.local":"local","session.action.select":"Select {title}","session.action.save":"Save {title}","session.action.cancel":"Cancel {title}","session.action.more":"More actions for {title}","session.action.fork":"Fork {title}","session.action.forkShort":"Fork","session.action.rename":"Rename {title}","session.action.renameShort":"Rename","session.action.archive":"Archive {title}","session.action.archiveShort":"Archive","session.action.export":"Export {title} as Markdown","session.action.exportShort":"Export Markdown","session.action.exportingShort":"Exporting…","session.action.delete":"Delete {title}","session.action.deleteShort":"Delete","session.action.stop":"Stop {title}","session.action.stopping":"Stopping {title}","session.action.retry":"Retry {title}","session.action.retrying":"Retrying {title}","session.reason.cancelledByUser":"Cancelled by user","session.title.codeReview":"Code Review","session.forkedFrom":"Forked from","session.retriedFrom":"Retried from","session.retryShort":"retry","session.queued":"#{position}/{depth} queued","archive.title":"Archive","archive.subtitle":"Stored safely outside the active task list","archive.open":"Open session archive","archive.refresh":"Refresh archived sessions","archive.retry":"Retry","archive.loading":"Loading archive…","archive.empty":"No archived sessions","archive.restore":"Restore {title}","archive.restoreShort":"Restore","archive.restoreAncestor":"Restore the archive root first","archive.inherited":"Archived with {id}","taskSwitcher.title":"Task switcher","taskSwitcher.description":"Search and open tasks across every project.","taskSwitcher.searchAria":"Search tasks","taskSwitcher.placeholder":"Search title, project, branch, status, or session ID…","taskSwitcher.results":"{count} results","taskSwitcher.recent":"Recent tasks","taskSwitcher.scope":"{count} tasks indexed","taskSwitcher.indexing":"Indexing tasks…","taskSwitcher.resultsAria":"Task search results","taskSwitcher.current":"Current","taskSwitcher.unread":"{count} unread","taskSwitcher.needsAction":"{count} need action","taskSwitcher.new":"New","taskSwitcher.empty":"No matching tasks","taskSwitcher.emptyHint":"Try a project, branch, status, or shorter phrase.","taskSwitcher.hint.navigate":"navigate","taskSwitcher.hint.open":"open","taskSwitcher.hint.toggle":"toggle","taskSwitcher.action.failed":"Task action failed","commandCenter.title":"Command center","commandCenter.description":"Search tasks or run workspace and application actions.","commandCenter.searchAria":"Search actions","commandCenter.placeholder":"Search actions, settings, or tools…","commandCenter.modeAria":"Command center mode","commandCenter.mode.tasks":"Tasks","commandCenter.mode.commands":"Actions","commandCenter.actions":"{count} actions","commandCenter.resultsAria":"Action search results","commandCenter.empty":"No matching actions","commandCenter.emptyHint":"Try a tool, panel, or setting name.","commandCenter.action.newTask":"New task","commandCenter.action.newTaskDescription":"Open a clean task composer","commandCenter.action.preview":"Toggle preview","commandCenter.action.previewDescription":"Review files, diffs, run logs, and web pages","commandCenter.action.terminal":"Toggle terminal","commandCenter.action.terminalDescription":"Open or close the workspace shell","commandCenter.action.settings":"Open settings","commandCenter.action.settingsDescription":"Configure appearance and behavior","commandCenter.action.models":"Configure models","commandCenter.action.modelsDescription":"Select providers and task models","commandCenter.action.shortcuts":"View keyboard shortcuts","commandCenter.action.shortcutsDescription":"Browse global and contextual keys","commandCenter.action.skills":"Manage skills","commandCenter.action.skillsDescription":"Discover and configure agent capabilities","commandCenter.action.mcp":"Manage MCP servers","commandCenter.action.mcpDescription":"Configure connected tools and servers","commandCenter.action.sidebar":"Toggle sidebar","commandCenter.action.sidebarDescription":"Show or hide project navigation","taskHome.eyebrow":"Task dispatcher · Ready","taskHome.feed.connecting":"Task dispatcher · Connecting","taskHome.feed.reconnecting":"Task dispatcher · Reconnecting","taskHome.feed.offline":"Task dispatcher · Offline","taskHome.feed.offlineDescription":"Live task updates are paused. Running tasks continue on the server.","taskHome.feed.retry":"Reconnect","taskHome.hero.prefix":"What should Blade build in","taskHome.hero.projectFallback":"current workspace","taskHome.hero.subtitle":"Dispatch a task and keep moving. Each task runs in its own worktree, persists state, and returns with a reviewable workspace when it's done.","taskHome.templates.title":"Templates","taskHome.templates.hint":"1–4 to prefill","taskHome.template.explore.title":"Explore","taskHome.template.explore.description":"Trace behavior and explain the system","taskHome.template.explore.hint":"Trace a call · map a module","taskHome.template.build.title":"Build","taskHome.template.build.description":"Implement a production-ready feature","taskHome.template.build.hint":"Ship a feature end-to-end","taskHome.template.review.title":"Review","taskHome.template.review.description":"Find correctness and regression risks","taskHome.template.review.hint":"Audit current changes","taskHome.review.attachmentsUnsupported":"Code review does not accept attachments","taskHome.review.outputSchemaUnsupported":"Code review uses its own structured report schema","taskHome.review.usage":"Usage: /review [uncommitted | base <ref> | commit <sha>]","taskHome.review.running":"Read-only code review in progress","taskHome.review.stale":"Review target changed while the reviewer was running","taskHome.review.aborted":"Code review aborted","taskHome.review.interrupted":"Code review interrupted by process restart","taskHome.review.failed":"Code review failed","taskHome.review.startFailed":"Failed to start code review","taskHome.review.invalidTarget":"The selected review target is invalid or has no changes","taskHome.review.conflict":"This session already has active work","taskHome.template.fix.title":"Fix","taskHome.template.fix.description":"Diagnose and repair a concrete failure","taskHome.template.fix.hint":"Bisect · reproduce · patch","taskHome.context.isolationToggleTitle":"Toggle task isolation","taskHome.context.projectSelect":"Select target project","taskHome.context.isolation.worktree":"Isolated worktree","taskHome.context.isolation.local":"Local workspace","taskHome.context.branchFallback":"no branch","taskHome.context.preparing":"Preparing worktree","taskHome.setup.aria":"Task setup status","taskHome.setup.title":"Finish setup","taskHome.setup.description":"Keep drafting while Blade verifies the workspace and model.","taskHome.setup.workspace.title":"Workspace","taskHome.setup.workspace.loading":"Checking available workspaces…","taskHome.setup.workspace.ready":"{project} selected","taskHome.setup.workspace.required":"Choose an available project","taskHome.setup.workspace.empty":"No project","taskHome.setup.workspace.action":"Choose","taskHome.setup.workspace.retry":"Reload workspaces","taskHome.setup.model.title":"Model","taskHome.setup.model.loading":"Checking configuration…","taskHome.setup.model.ready":"Ready for this task","taskHome.setup.model.required":"Configure or select a model","taskHome.setup.model.action":"Configure","taskHome.setup.model.retry":"Retry","taskHome.composer.placeholder":"Describe the outcome, constraints, and verification you expect...","taskHome.error.dismiss":"Dismiss","taskHome.recent.title":"Recent tasks","taskHome.recent.total":"{count} total","taskHome.recent.partial":"{count} loaded · syncing","taskHome.recent.incomplete":"{count} loaded · history incomplete","taskSwitcher.indexingLoaded":"{count} loaded · syncing history","taskHome.footer.note":"Worktree isolation keeps parallel tasks from touching your active checkout","kanban.title":"Task board","kanban.subtitle":"Dispatch work across bound projects and focus on tasks that need intervention.","kanban.taskCount":"{count} tasks","kanban.searchAria":"Search task board","kanban.searchPlaceholder":"Search tasks...","kanban.projectFilterAria":"Filter task board by project","kanban.projectAll":"All projects","kanban.feed.offline":"Live updates are offline. Running tasks continue.","kanban.autoClaim.running":"Auto-claiming","kanban.autoClaim.paused":"Auto-claim paused","kanban.column.waiting":"Waiting","kanban.column.waitingDescription":"Queued for an execution slot","kanban.column.active":"In progress","kanban.column.activeDescription":"Agents currently working","kanban.column.blocked":"Blocked","kanban.column.blockedDescription":"Needs input, retry, or attention","kanban.column.review":"Ready for review","kanban.column.reviewDescription":"Completed work awaiting acceptance","kanban.column.empty":"No tasks in this stage","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","kanban.kind.feature":"Feature","kanban.kind.bug":"Bug","kanban.kind.maintenance":"Maintenance","kanban.kind.research":"Research","kanban.card.unread":"New task update","kanban.card.queuePosition":"Queue #{position} of {depth}","kanban.card.diff":"{files} files · +{additions} −{deletions}","kanban.action.newTask":"New task","kanban.action.open":"Open task","kanban.action.respond":"Respond to blocker","kanban.action.inspect":"Inspect changes","kanban.action.edit":"Edit task details","kanban.action.cancel":"Cancel task","kanban.action.retry":"Retry task","kanban.action.archive":"Accept and archive","kanban.dialog.createTitle":"Dispatch task","kanban.dialog.createDescription":"The task runs directly in the selected project workspace.","kanban.dialog.editTitle":"Edit task","kanban.dialog.editDescription":"Update planning metadata without interrupting the running agent.","kanban.dialog.localExecution":"Local workspace · no worktree isolation","kanban.dialog.cancel":"Cancel","kanban.dialog.dispatch":"Dispatch","kanban.dialog.save":"Save","kanban.dialog.submitFailed":"Task operation failed","kanban.field.title":"Title","kanban.field.titlePlaceholder":"Optional concise task title","kanban.field.prompt":"Task brief","kanban.field.promptPlaceholder":"Describe the outcome, constraints, and verification expected...","kanban.field.project":"Project","kanban.field.kind":"Type","kanban.field.priority":"Priority","kanban.field.dueAt":"Due","capacity.title":"{inFlight} running · {queued} queued · max {max}","capacity.suffix.running":" running","capacity.queued":"{queued} queued","recent.status.running":"running","recent.status.queued":"queued","recent.status.paused":"paused","recent.status.failed":"failed","recent.status.cancelled":"cancelled","recent.status.done":"done","recent.time.justNow":"just now","recent.time.minutes":"{n}m ago","recent.time.hours":"{n}h ago","recent.time.days":"{n}d ago","recent.session.fallbackShort":"Session {id}","recent.session.fallbackDated":"Session {y}-{m}-{d} {hh}:{mm}","attention.unreadAnnouncement":"{count} unread task updates","attention.notification.completed":"Task completed","attention.notification.failed":"Task failed","attention.notification.interrupted":"Task interrupted","attention.notification.permission":"Approval required","attention.notification.question":"Answer required","attention.notification.elicitation":"MCP input required","interaction.permission.title":"Permission required: {tool}","interaction.permission.once":"Allow once","interaction.permission.session":"Allow for session","interaction.permission.project":"Allow for project","interaction.permission.deny":"Deny","interaction.permission.failed":"Failed to respond to permission","interaction.question.answered":"Questions answered","interaction.question.other":"Other","interaction.question.submit":"Submit answers","interaction.question.failed":"Failed to submit answers","interaction.elicitation.title":"MCP input requested","interaction.elicitation.submit":"Submit to MCP","interaction.elicitation.open":"Open external URL","interaction.elicitation.decline":"Decline","interaction.elicitation.cancel":"Cancel","interaction.elicitation.responded":"MCP request answered","interaction.elicitation.cancelled":"MCP request cancelled","interaction.elicitation.failed":"Failed to respond to MCP request","interaction.elicitation.warning":"Only continue if you trust this MCP server and understand the request.","interaction.bar.permissionTitle":"Agent needs approval","interaction.bar.permissionHint":"Review the pending tool request before this task can continue.","interaction.bar.questionTitle":"Agent needs your answer","interaction.bar.questionHint":"Answer the pending question before this task can continue.","interaction.bar.elicitationTitle":"MCP server needs your input","interaction.bar.elicitationHint":"Review the MCP request before this task can continue.","interaction.bar.review":"Review request","interaction.badge.permission":"Needs approval","interaction.badge.question":"Needs answer","interaction.badge.elicitation":"MCP input","artifact.env.isolated":"isolated","artifact.env.local":"local","artifact.review":"Review changes","artifact.commits":"{count} commits","artifact.apply":"Apply","artifact.retryApply":"Retry apply","artifact.applying":"Applying","artifact.applied":"Applied","artifact.discard":"Discard task changes","artifact.discarded":"Discarded","artifact.conflict":"The task changes could not be applied safely.","artifact.conflictHint":"The isolated changes are preserved. Review them, resolve the source project, then retry or discard.","artifact.discardDialog.title":"Discard isolated changes?","artifact.discardDialog.description":"Remove {count} changed files from the isolated task workspace for {project}.","artifact.discardDialog.warning":"This permanently removes the task worktree and branch. Your source project is not modified.","artifact.discardDialog.cancel":"Keep changes","artifact.discardDialog.confirm":"Discard changes","chat.list.empty.eyebrow":"Blade · Ready","chat.list.empty.title":"Start a conversation to begin","chat.list.empty.hint":"Ask a question, describe a change, or paste a stack trace.","chat.list.loading.eyebrow":"Conversation history","chat.list.loading.title":"Restoring conversation…","chat.list.loading.hint":"Loading messages, task state, and live updates. Larger conversations may take a moment.","chat.list.showEarlier":"Show {count} earlier messages","chat.list.showEarlierWithRemaining":"Show {count} earlier messages, {remaining} hidden","chat.list.jumpLatest":"Jump to latest","chat.list.unreadMessage":"1 new message","chat.list.unreadMessages":"{count} new messages","chat.turns.aria":"Jump to a previous message","chat.turns.label":"Turn {n}","chat.timeline.thinking":"Thought process","chat.timeline.tools.runningOne":"Running 1 command","chat.timeline.tools.running":"Running {count} commands","chat.timeline.tools.completedOne":"Executed 1 command","chat.timeline.tools.completed":"Executed {count} commands","chat.timeline.tools.completedOneWithError":"Executed 1 command · failed","chat.timeline.tools.completedWithErrors":"Executed {count} commands · {errors} failed","chat.error.dismiss":"Dismiss error","chat.error.queueFull":"The guidance queue is full. Wait for pending instructions to start, then retry.","chat.error.turnChanged":"The active turn changed before this message was accepted. Review and retry it.","chat.error.title.submission":"Message not sent.","chat.error.title.execution":"Run stopped.","chat.error.title.navigation":"Task not opened.","chat.error.title.generic":"Action failed.","chat.error.action.returnDraft":"Return to draft","chat.error.action.editResend":"Edit and resend","chat.error.action.retryTask":"Retry task","chat.error.action.retryingTask":"Retrying…","chat.error.action.checkModels":"Check model settings","task.failure.authentication":"Provider authentication failed. Check model credentials.","task.failure.permission":"Provider rejected this request. Check account and model permissions.","task.failure.rateLimit":"Provider rate limit or quota exceeded.","task.failure.timeout":"Provider request timed out.","task.failure.network":"Provider connection failed.","task.failure.modelUnavailable":"The selected model is unavailable.","task.failure.contextLimit":"The request exceeded the model context limit.","task.failure.unsupportedInput":"The selected model does not support this input.","task.failure.workspaceUnavailable":"This Session workspace is no longer available.","task.failure.capacity":"Task admission capacity is full. Retry after running tasks complete.","task.failure.runtime":"Agent execution failed.","chat.connection.reconnecting":"Reconnecting live updates. The active run continues in the background.","chat.connection.offline":"Live updates are offline. Progress shown here may be stale.","chat.connection.retry":"Reconnect","chat.side.title":"Side conversation","chat.side.loading":"Answering side question...","chat.side.failed":"Side conversation failed.","chat.side.dismiss":"Dismiss side conversation","chat.footer.disclaimer":"Blade can make mistakes. Please check important information.","chat.input.placeholder.default":"Type @ for files, / for commands...","chat.input.placeholder.steering":"Add guidance to steer the active turn...","chat.input.steering.status":"Active turn is steerable","chat.input.steering.queued":"Guidance accepted · {count} pending","chat.input.steering.enterHint":" · Enter sends guidance","chat.input.followUp.queued":"Follow-up accepted · {count} queued for the next turn","chat.input.steering.recoveredOne":"Recovered {count} queued instruction after restart","chat.input.steering.recoveredMany":"Recovered {count} queued instructions after restart","chat.input.attachment.add":"Attach images","chat.input.attachment.remove":"Remove","chat.input.attachment.countLimit":"You can attach up to {count} images.","chat.input.attachment.sizeLimit":"Images must stay under {size} total. Remove an image or choose smaller files.","chat.input.attachment.readFailed":"Blade could not read one of these images.","chat.input.attachment.usage":"{count}/{limit} images · {used} of {budget}","chat.input.attachment.modelUnsupported":"{model} does not support images. Choose a vision model or remove the images.","chat.input.attachment.modelRequired":"Choose a vision-capable model before attaching images.","chat.input.model.placeholder":"Select Model","chat.input.model.empty":"No models configured","chat.input.model.vision":"Vision","chat.input.model.change":"Change model","chat.input.model.locked":"Wait for the active turn to finish before switching models","chat.input.effort.label":"Effort {effort}","chat.input.effort.heading":"Reasoning effort","chat.input.effort.change":"Change reasoning effort","chat.input.effort.locked":"Wait for the active turn to finish before changing reasoning effort","chat.input.effort.option":"Use {effort} reasoning effort","chat.input.serviceTier.label":"Speed {tier}","chat.input.serviceTier.heading":"Provider service tier","chat.input.serviceTier.change":"Change provider service tier","chat.input.serviceTier.locked":"Wait for the current turn to finish before changing service tier","chat.input.serviceTier.option":"Use {tier} service tier","chat.input.serviceTier.fastHint":"priority","chat.input.serviceTier.flexHint":"lower cost","chat.input.responseVerbosity.label":"Output {verbosity}","chat.input.responseVerbosity.heading":"Response verbosity","chat.input.responseVerbosity.change":"Change response verbosity","chat.input.responseVerbosity.locked":"Wait for the current turn to finish before changing response verbosity","chat.input.responseVerbosity.option":"Use {verbosity} response verbosity","chat.input.responseVerbosity.autoHint":"model default","chat.input.outputSchema.title":"Structured output","chat.input.outputSchema.description":"Require this turn to finish with an object that matches the JSON Schema.","chat.input.outputSchema.change":"Set structured output schema","chat.input.outputSchema.locked":"Wait for the current turn to finish before changing the output schema","chat.input.outputSchema.editor":"JSON Schema editor","chat.input.outputSchema.placeholder":"Paste a JSON Schema object","chat.input.outputSchema.example":"Use example","chat.input.outputSchema.clear":"Clear","chat.input.outputSchema.invalid":"Enter a valid JSON object. The server validates the complete schema.","chat.input.outputSchema.shellUnsupported":"Structured output cannot be combined with a shell command.","chat.structuredOutput.title":"Structured output","chat.structuredOutput.copy":"Copy structured output","chat.input.communicationStyle.label":"Style {style}","chat.input.communicationStyle.heading":"Communication style","chat.input.communicationStyle.change":"Change communication style","chat.input.communicationStyle.locked":"Wait for the current turn to finish before changing communication style","chat.input.communicationStyle.option":"Use {style} communication style","chat.input.communicationStyle.autoHint":"Blade default","chat.input.communicationStyle.pragmaticHint":"direct","chat.input.communicationStyle.friendlyHint":"warm","chat.input.communicationStyle.explanatoryHint":"explain choices","chat.notice.dismiss":"Dismiss notice","chat.input.mode.default":"Manual approval","chat.input.mode.default.desc":"Every important action needs your approval","chat.input.mode.autoEdit":"Auto approval","chat.input.mode.autoEdit.desc":"Let the AI review and approve important actions","chat.input.mode.yolo":"Full access","chat.input.mode.yolo.desc":"Run directly on your machine without asking","chat.input.mode.yolo.confirm.title":"Enable full access mode?","chat.input.mode.yolo.confirm.desc":"In this mode the agent will execute all actions — including file writes, shell commands, and network requests — without asking for permission. Only enable this if you trust the current context.","chat.input.mode.yolo.confirm.cancel":"Cancel","chat.input.mode.yolo.confirm.accept":"Enable","chat.input.mode.plan":"Plan","chat.input.mode.plan.desc":"Draft a plan first without making changes","chat.input.mode.aria":"Agent action approval","chat.input.action.stop":"Stop active turn","chat.input.action.stopping":"Stopping active turn","chat.input.action.steer":"Steer active turn","chat.input.action.send":"Send message","chat.input.action.submitting":"Submitting message","chat.review.title":"Code Review","chat.review.target":"Target","chat.review.target.uncommitted":"Uncommitted changes","chat.review.target.base":"Changes against {ref}","chat.review.target.commit":"Commit {ref}","chat.review.status":"Status","chat.review.status.completed":"Completed","chat.review.status.stale":"Stale","chat.review.status.failed":"Failed","chat.review.status.aborted":"Aborted","chat.review.status.interrupted":"Interrupted","chat.review.findings":"Findings","chat.review.noFindings":"No actionable findings","chat.review.confidence":"confidence {value}","chat.review.error":"Error","chat.subagent.resumedFromTitle":"Resumed from {id}","chat.subagent.resumedDepth":"resumed · depth {depth}","chat.subagent.loadingLogs":"Loading subagent logs...","chat.subagent.resumedAs":"Resumed as {id} · {status} · depth {depth}","chat.subagent.resume":"Resume","chat.subagent.resumeAria":"Resume subagent","chat.subagent.followUpAria":"Subagent follow-up","chat.subagent.followUpPlaceholder":"Describe the follow-up work","chat.subagent.cancel":"Cancel","chat.subagent.resumeAgent":"Resume agent","chat.subagent.resumeFailed":"Failed to resume subagent","chat.markdown.copyCode":"Copy code","chat.rewind.title":"Rewind session","chat.rewind.description":"Return to the point before a user message.","chat.rewind.loading":"Loading checkpoints","chat.rewind.empty":"Nothing to rewind to yet","chat.rewind.checkpointAria":"Rewind checkpoint","chat.rewind.userMessage":"User message","chat.rewind.fileCountOne":"{count} file","chat.rewind.fileCountMany":"{count} files","chat.rewind.restoreCode":"Restore code changes","chat.rewind.restoreCodeHint":"Revert files changed at and after this checkpoint.","chat.rewind.cancel":"Cancel","chat.rewind.confirm":"Rewind","chat.rewind.loadFailed":"Failed to load rewind checkpoints","chat.rewind.failed":"Rewind failed. Review the session error and try again.","status.context":"Context","status.tokenLimitTooltip":"Token limit is estimated. It updates when the model reports its context size.","status.cache":"Cache","status.cacheTooltip":"Cached input divided by total model input for this session.","status.cacheDetails":"Read {read} · Written {write} · Uncached {uncached}","status.cacheUnavailable":"The Provider has not reported prompt-cache usage for this session.","status.cacheBreak":"Last cache break: {reason} · cache read {previous} → {current}","status.cacheBreak.model":"model changed","status.cacheBreak.system":"system prompt changed","status.cacheBreak.tools":"tool definitions changed","status.cacheBreak.policy":"request policy changed","status.cacheBreak.ttl":"cache TTL expired","status.cacheBreak.server":"likely Provider routing or eviction","status.phase.running":"Generating...","status.phase.providerStall":"Provider stream paused","status.phase.actionStationarityRecovering":"Recovering","status.phase.actionStationarityStopped":"Stopped","status.phase.compacting":"Compacting context...","status.phase.recoveringContext":"Recovering context limit...","status.phase.switchingModel":"Switching model...","status.phase.waitingPermission":"Waiting for permission...","status.phase.error":"Run failed","status.recovery.review":"Recovery needs review","status.recovery.interruptedTool":"Interrupted tool state is uncertain","status.recovery.successfulTool":"A tool may already have changed state","preview.title":"Preview","preview.action.resize":"Resize preview","preview.action.close":"Close preview","preview.action.retry":"Retry","preview.tab.diff":"Diff","preview.tab.files":"Files","preview.tab.logs":"Logs","preview.tab.browser":"Browser","preview.diff.loadingTitle":"Loading task diff…","preview.diff.loadingHint":"Reading the durable worktree artifact.","preview.diff.failedTitle":"Failed to load task diff","preview.diff.discardedTitle":"Changes discarded","preview.diff.discardedHint":"The isolated workspace was removed. The source project was not changed.","preview.diff.emptyTitle":"No patch yet","preview.diff.emptyHint":"Run a tool that changes files to see diffs here.","preview.diff.searchAria":"Search changed files","preview.diff.searchPlaceholder":"Filter changed files…","preview.diff.changedFiles":"{count} changed files","preview.diff.expandAll":"Expand all","preview.diff.collapseAll":"Collapse all","preview.diff.showMoreFiles":"Show {count} more files","preview.diff.showMoreLines":"Show {count} more lines","preview.diff.noMatches":"No matching changed files","preview.diff.patch":"Patch","preview.diff.line":"Line {line}","preview.files.loadingTitle":"Loading files…","preview.files.loadingHint":"Fetching workspace tree.","preview.files.failedTitle":"Failed to load files","preview.files.emptyTitle":"No files yet","preview.files.emptyHint":"Select a project to load its workspace tree.","preview.files.treeFailed":"Failed to load workspace tree","preview.files.searchAria":"Search workspace files","preview.files.searchPlaceholder":"Find a file…","preview.files.searchResultsAria":"File search results","preview.files.searchFailed":"Failed to search workspace files","preview.files.noMatches":"No matching files","preview.files.directoryLoading":"Loading folder…","preview.files.directoryEmpty":"Empty folder","preview.files.selectTitle":"Select a file to preview","preview.files.status.loading":"Loading…","preview.files.status.truncated":"Truncated","preview.files.status.ready":"Ready","preview.files.truncatedNotice":"Preview truncated to 200k characters.","preview.files.pickHint":"Pick a file from the tree to preview.","preview.files.contentFailed":"Failed to load file","preview.files.editorLoading":"Loading editor…","preview.logs.searchAria":"Search tool logs","preview.logs.searchPlaceholder":"Search tool, summary, or output…","preview.logs.filterAria":"Filter logs by status","preview.logs.filter.all":"All","preview.logs.filter.running":"Running","preview.logs.filter.error":"Failed","preview.logs.filter.success":"Success","preview.logs.noMatches":"No matching logs","preview.logs.noMatchesHint":"Try another phrase or status.","preview.logs.emptyTitle":"No logs yet","preview.logs.emptyHint":"Tool runs will appear here.","preview.logs.expand":"Expand","preview.logs.collapse":"Collapse","preview.logs.showMore":"Show {count} more logs","preview.logs.status.running":"Running","preview.logs.status.error":"Failed","preview.logs.status.success":"Success","goal.aria.section":"Goal controls","goal.status.active":"Goal running","goal.status.paused":"Goal paused","goal.status.blocked":"Goal blocked","goal.status.usageLimited":"Usage limited","goal.status.budgetLimited":"Budget reached","goal.status.complete":"Goal complete","goal.field.objective":"Goal objective","goal.action.edit":"Edit goal","goal.action.pause":"Pause goal","goal.action.resume":"Resume goal","goal.action.delete":"Delete goal","goal.action.expand":"Expand goal details","goal.action.collapse":"Collapse goal details","goal.action.cancel":"Cancel","goal.action.save":"Save","goal.metrics.tokens":"tokens","goal.metrics.continuationOne":"{n} continuation","goal.metrics.continuationMany":"{n} continuations","goal.dialog.title":"Delete this goal?","goal.dialog.description":"The goal state will be removed. Session history and workspace files are not affected.","settings.title":"Settings","settings.nav.aria":"Settings sections","settings.action.back":"Back","settings.category.settings":"Settings","settings.category.integrations":"Integrations","settings.tab.general":"General","settings.tab.trust":"Security","settings.tab.models":"Models","settings.tab.shortcuts":"Shortcuts","settings.tab.mcp":"MCP","settings.tab.skills":"Skills","settings.tab.plugins":"Plugins","settings.tab.hooks":"Hooks","settings.tab.schedules":"Scheduled Tasks","settings.common.retry":"Retry","settings.common.dismiss":"Dismiss","settings.common.cancel":"Cancel","settings.common.enable":"Enable","settings.general.loading":"Loading settings...","settings.general.loadError":"Failed to load settings","settings.general.saveError":"Failed to save settings","settings.general.responseLanguage":"Response Language","settings.general.responseLanguageHint":"AI will respond in this language","settings.general.autoSave":"Auto-save sessions","settings.general.communicationStyle":"Communication Style","settings.general.communicationStyleHint":"How the agent phrases its replies across every session","settings.appearance.heading":"Appearance","settings.appearance.theme":"Theme Preference","settings.appearance.theme.dark":"Dark","settings.appearance.theme.light":"Light","settings.appearance.theme.system":"System","settings.appearance.compactSidebar":"Compact sidebar","settings.appearance.codeTheme":"Code theme","settings.appearance.codeThemeHint":"Syntax highlighting colors","settings.notifications.heading":"Notifications","settings.notifications.buildFinished":"Build finished","settings.notifications.errorsOnly":"Errors only","settings.notifications.systemSounds":"System sounds","settings.notifications.blocked":"Browser notifications are blocked","settings.notifications.unavailable":"Browser notifications are unavailable","settings.notifications.enablePrompt":"Enable alerts while this tab is in the background","settings.privacy.heading":"Privacy","settings.privacy.telemetry":"Telemetry","settings.privacy.crash":"Crash reports","settings.models.description":"Configure API keys and model settings for different providers.","settings.models.loading":"Loading models...","settings.models.loadChannelsFailed":"Failed to load provider channels","settings.models.saveFailed":"Failed to save model","settings.models.deleteFailed":"Failed to delete model","settings.models.updateFailed":"Failed to update model","settings.models.updateChannelFailed":"Failed to update provider channel","settings.models.probeFailed":"Provider probe failed","settings.models.deleteChannelFailed":"Failed to delete provider channel","settings.models.empty":"No models configured yet","settings.models.add":"+ Add New Model","settings.models.missingCredential":"Missing credential","settings.models.configured":"Configured","settings.models.deleting":"Deleting...","settings.models.deleteModel":"Delete model","settings.models.deleteChannel":"Delete channel","settings.models.deleteModelAria":"Delete {name}","settings.models.deleteModelPrompt":"Delete {name} and its saved configuration?","settings.models.deleteChannelAria":"Delete channel {name}","settings.models.deleteChannelPrompt":"Delete channel {name}, its credential, and {count} configured model(s)? Fallback references will also be removed.","settings.models.editModelAria":"Edit {name}","settings.models.editChannelAria":"Edit channel {name}","settings.models.testChannelAria":"Test {name}","settings.models.deleteChannelActionAria":"Delete channel {name}","settings.models.modelCountOne":"{count} model","settings.models.modelCountMany":"{count} models","settings.models.defaultEndpoint":"default endpoint","settings.shortcuts.searchPlaceholder":"Search actions...","settings.shortcuts.scope.all":"All scopes","settings.shortcuts.scope.global":"Global","settings.shortcuts.scope.chat":"Chat","settings.shortcuts.scope.layout":"Layout","settings.shortcuts.reset":"Reset","settings.shortcuts.col.action":"Action","settings.shortcuts.col.shortcut":"Shortcut","settings.shortcuts.col.scope":"Scope","settings.shortcuts.empty":"No shortcuts found.","settings.shortcuts.action.searchTasks":"Search tasks","settings.shortcuts.action.openCommands":"Open command center","settings.shortcuts.action.newTask":"New task","settings.shortcuts.action.focusComposer":"Focus composer","settings.shortcuts.action.toggleSidebar":"Toggle sidebar","settings.common.reload":"Reload","settings.trust.state.notRequired":"No trust required","settings.trust.state.trusted":"Workspace trusted","settings.trust.state.review":"Review required","settings.trust.state.error":"Trust store error","settings.trust.selectSession":"Select a project session to review folder trust.","settings.trust.heading":"Workspace trust","settings.trust.inheritedFrom":" · inherited from {source}","settings.trust.reloadAria":"Reload workspace trust","settings.trust.revoke":"Revoke","settings.trust.trustWorkspace":"Trust workspace","settings.trust.restartNotice":"Restart Blade to reload project models, MCP, LSP, permissions, and plugins.","settings.trust.revokeAria":"Revoke workspace trust","settings.trust.confirmTrust":"Allow {count} project source(s) to configure models, MCP, LSP, permissions, environment, instructions, commands, skills, agents, or plugins?","settings.trust.confirmRevoke":"Block project-controlled executable configuration after restart?","settings.trust.saving":"Saving...","settings.trust.trustReviewed":"Trust reviewed workspace","settings.trust.revokeTrust":"Revoke trust","settings.trust.empty":"No project-controlled executable configuration was found.","settings.trust.loadFailed":"Failed to load workspace trust","settings.trust.updateFailed":"Failed to update workspace trust","settings.hooks.state.disabled":"Hooks disabled","settings.hooks.state.notRequired":"No external hooks","settings.hooks.state.review":"Review required","settings.hooks.state.trusted":"Trusted","settings.hooks.state.modified":"Changed since approval","settings.hooks.state.error":"Trust store error","settings.hooks.selectSession":"Select a project session to review its hooks.","settings.hooks.heading":"Hook trust","settings.hooks.reloadAria":"Reload hook trust","settings.hooks.revoke":"Revoke","settings.hooks.trustDigest":"Trust digest","settings.hooks.currentSession":"Current session execution","settings.hooks.session.open":"Open a session to control its hooks.","settings.hooks.session.loading":"Loading session state...","settings.hooks.session.disabled":"Disabled by workspace configuration.","settings.hooks.session.paused":"Paused only for this session.","settings.hooks.session.active":"Hooks may run for this session after trust checks.","settings.hooks.session.unavailable":"Disabled by this session runtime or host policy.","settings.hooks.session.enableAria":"Enable hooks for current session","settings.hooks.session.pauseAria":"Pause hooks for current session","settings.hooks.session.unavailableAria":"Hooks unavailable for current session","settings.hooks.confirmTrustAria":"Trust project hooks","settings.hooks.confirmRevokeAria":"Revoke project hook trust","settings.hooks.confirmTrust":"Run these {count} hooks with your user permissions until their configuration changes?","settings.hooks.confirmRevoke":"Stop all configured hooks for this project until explicitly trusted again?","settings.hooks.saving":"Saving...","settings.hooks.trustReviewed":"Trust reviewed hooks","settings.hooks.revokeTrust":"Revoke trust","settings.hooks.empty":"No configured command, HTTP, or prompt hooks.","settings.hooks.loadFailed":"Failed to load hook trust","settings.hooks.updateFailed":"Failed to update hook trust","settings.hooks.sessionUpdateFailed":"Failed to update session hooks","settings.plugins.selectProject":"Select a project to manage its plugins.","settings.plugins.heading":"Workspace plugins","settings.plugins.changesNote":"Changes apply to future session snapshots and persist in the selected scope.","settings.plugins.reloadAria":"Reload plugins","settings.plugins.sourcePolicy":"Source policy","settings.plugins.savePolicyAria":"Save plugin source policy","settings.plugins.saving":"Saving…","settings.plugins.saveForProject":"Save for project","settings.plugins.restrictAria":"Restrict plugin sources","settings.plugins.restrictAllowlists":"Restrict to allowlists","settings.plugins.requireShaAria":"Require full Git commit SHA","settings.plugins.requireSha":"Require full Git SHA","settings.plugins.environmentLocked":" · environment locked","settings.plugins.gitHostsAria":"Allowed plugin Git hosts","settings.plugins.marketplacesAria":"Allowed plugin Marketplaces","settings.plugins.localRootsAria":"Allowed local plugin roots","settings.plugins.emptyAllowlists":"Empty allowlists deny every plugin source.","settings.plugins.installHeading":"Install trusted plugin","settings.plugins.sourceAria":"Plugin source","settings.plugins.install":"Install","settings.plugins.trustSource":"I trust this source to activate Hooks, MCP servers, skills, and commands.","settings.plugins.activationScope":"Activation write scope","settings.plugins.activationScopeHint":"Higher-priority layers continue to determine the effective state.","settings.plugins.scopeAria":"Plugin activation scope","settings.plugins.scope.local":"Local","settings.plugins.scope.project":"Project","settings.plugins.scope.global":"Global","settings.plugins.scope.localDesc":"Only this checkout","settings.plugins.scope.projectDesc":"Shared project settings","settings.plugins.scope.globalDesc":"All projects","settings.plugins.scope.invocation":"Invocation","settings.plugins.scope.default":"Default","settings.plugins.layer.on":"on","settings.plugins.layer.off":"off","settings.plugins.capability.commands":"{count} commands","settings.plugins.capability.skills":"{count} skills","settings.plugins.capability.agents":"{count} agents","settings.plugins.capability.hooks":"{count} hooks","settings.plugins.capability.mcp":"{count} MCP","settings.plugins.noResources":"No declared resources","settings.plugins.effective":"effective: {scope}","settings.plugins.managed":"managed","settings.plugins.invocationScoped":"Invocation-scoped via --plugin-dir","settings.plugins.enableAria":"Enable {name}","settings.plugins.disableAria":"Disable {name}","settings.plugins.unavailableAria":"Unavailable {name}","settings.plugins.updateAria":"Update {name}","settings.plugins.uninstallAria":"Uninstall {name}","settings.plugins.confirmUpdate":"Confirm update","settings.plugins.update":"Update","settings.plugins.confirmRemove":"Confirm remove","settings.plugins.empty":"No plugins discovered for this project.","settings.plugins.marketplaces":"Marketplaces","settings.plugins.configuredCount":"{count} configured","settings.plugins.marketplaceSourceAria":"Marketplace source","settings.plugins.addMarketplaceAria":"Add marketplace","settings.plugins.add":"Add","settings.plugins.noDescription":"No description","settings.plugins.refreshMarketplaceAria":"Refresh marketplace {name}","settings.plugins.removeMarketplaceAria":"Remove marketplace {name}","settings.plugins.confirm":"Confirm","settings.plugins.installedSuffix":" · installed","settings.plugins.marketplaceEmpty":"Add a Marketplace to discover installable plugins.","settings.plugins.loadFailed":"Failed to load plugins","settings.plugins.actionFailed":"Plugin action failed","settings.plugins.updateFailed":"Failed to update plugin","settings.models.addModal.title":"Add Model","settings.models.addModal.close":"Close add model","settings.models.addModal.loadProvidersError":"Failed to load providers","settings.models.addModal.loadModelsError":"Failed to load models","settings.models.addModal.provider":"Provider","settings.models.addModal.loadingProviders":"Loading providers...","settings.models.addModal.selectProvider":"Select provider","settings.models.addModal.configuredSuffix":" - configured","settings.models.addModal.customOpenAI":"Custom OpenAI Endpoint","settings.models.addModal.customAnthropic":"Custom Anthropic Endpoint","settings.models.addModal.channelId":"Channel ID","settings.models.addModal.channelIdHint":"Stable config and credential identifier.","settings.models.addModal.channelName":"Channel name","settings.models.addModal.baseUrl":"Base URL","settings.models.addModal.anthropicProtocol":"Uses the Anthropic Messages protocol.","settings.models.addModal.openaiProtocol":"Uses the OpenAI Chat Completions protocol.","settings.models.addModal.modelId":"Model ID","settings.models.addModal.model":"Model","settings.models.addModal.loadingModels":"Loading models...","settings.models.addModal.selectModel":"Select model","settings.models.addModal.reasoningSuffix":" - reasoning","settings.models.addModal.visionSuffix":" - vision","settings.models.addModal.displayName":"Display name","settings.models.addModal.displayNamePlaceholder":"Optional alias","settings.models.addModal.apiKey":"API Key","settings.models.addModal.apiKeyAria":"API key","settings.models.addModal.apiKeyPlaceholder":"Stored separately in auth.json","settings.models.addModal.showApiKey":"Show API key","settings.models.addModal.hideApiKey":"Hide API key","settings.models.addModal.oauthNote":"This provider requires OAuth or ambient credentials. Configure it externally before selecting the model.","settings.models.addModal.saveModel":"Save Model","settings.models.addModal.saving":"Saving...","settings.models.addModal.channelIdError":'Channel ID must start with a lowercase letter and contain only lowercase letters, numbers, ".", "_" or "-"',"settings.models.addModal.invalidBaseUrl":"Base URL must be an absolute HTTP(S) URL","settings.models.editModal.srTitle":"Edit Model","settings.models.editModal.title":"Edit Model Overrides","settings.models.editModal.close":"Close edit model","settings.models.editModal.displayName":"Display name","settings.models.editModal.replaceApiKey":"Replace provider API key","settings.models.editModal.replaceApiKeyPlaceholder":"Leave empty to keep current credential","settings.models.editModal.baseUrlOverride":"Base URL override","settings.models.editModal.baseUrlPlaceholder":"Leave empty to use default endpoint","settings.models.editModal.streamIdleTimeout":"Stream idle timeout (ms)","settings.models.editModal.save":"Save","settings.models.editModal.saving":"Saving...","settings.models.editModal.streamIdleTimeoutError":"Stream idle timeout must be at least 1000ms","settings.models.editModal.credentialError":"Failed to update provider credential","settings.models.editProvider.title":"Edit Provider Channel","settings.models.editProvider.close":"Close edit provider","settings.models.editProvider.channelName":"Channel name","settings.models.editProvider.channelNameRequired":"Channel name is required","settings.models.editProvider.wireApi":"Wire API","settings.models.editProvider.baseUrl":"Base URL","settings.models.editProvider.baseUrlAria":"Provider Base URL","settings.models.editProvider.invalidBaseUrl":"Base URL must be an absolute HTTP(S) URL","settings.models.editProvider.apiKeyEnv":"API key environment variable","settings.models.editProvider.apiKeyEnvPlaceholder":"Optional, for example TEAM_GATEWAY_API_KEY","settings.models.editProvider.replaceApiKey":"Replace API key","settings.models.editProvider.apiKeyAria":"Provider API key","settings.models.editProvider.apiKeyPlaceholder":"Leave empty to keep current credential","settings.models.editProvider.save":"Save channel","settings.models.editProvider.saving":"Saving...","settings.style.auto":"Auto","settings.style.pragmatic":"Pragmatic","settings.style.friendly":"Friendly","settings.style.explanatory":"Explanatory","mcp.status.connected":"Connected","mcp.status.connecting":"Connecting...","mcp.status.reconnecting":"Recovering...","mcp.status.offline":"Offline","mcp.status.error":"Error","mcp.status.recoveringAttempt":"Recovering {attempt}/{max}","mcp.oauth.status.disabled":"Not configured","mcp.oauth.status.unavailable":"Unavailable in this runtime","mcp.oauth.status.unauthenticated":"Authorization required","mcp.oauth.status.authorizing":"Waiting for authorization...","mcp.oauth.status.authenticated":"Authorized","mcp.oauth.status.error":"Authorization failed","mcp.catalog.tag.official":"Official","mcp.catalog.tag.popular":"Popular","mcp.catalog.tag.community":"Community","mcp.action.refreshServers":"Refresh MCP servers","mcp.action.addServer":"Add server","mcp.action.close":"Close MCP","mcp.action.dismiss":"Dismiss","mcp.action.retry":"Retry","mcp.action.disconnect":"Disconnect","mcp.action.disconnecting":"Disconnecting...","mcp.action.stopRecovery":"Stop recovery","mcp.action.connect":"Connect","mcp.action.connecting":"Connecting...","mcp.action.authorizeFirst":"Authorize first","mcp.action.delete":"Delete","mcp.action.cancel":"Cancel","mcp.action.deleting":"Deleting...","mcp.action.deleteServer":"Delete server","mcp.tab.installed":"Installed ({count})","mcp.tab.catalog":"Catalog","mcp.servers.title":"Servers","mcp.servers.searchAria":"Search installed MCP servers","mcp.servers.searchPlaceholder":"Search servers...","mcp.servers.loading":"Loading servers...","mcp.servers.noMatch":"No servers match your search","mcp.servers.none":"No MCP servers configured","mcp.server.errorLabel":"Error: {error}","mcp.server.deleteAria":"Delete {name}","mcp.server.selectPrompt":"Select a server to view details","mcp.instructions.title":"Server instructions","mcp.instructions.detailsOmittedByPolicy":"[details omitted by runtime policy]","mcp.instructions.detailsOmitted":"Details omitted","mcp.instructions.truncated":"Truncated to the safe display budget","mcp.tasks.title":"Experimental MCP Tasks","mcp.tasks.summary":"{count} per Session · {interval}ms poll","mcp.tasks.disabledByDefault":"Disabled by default","mcp.tasks.enabled":"Enabled","mcp.tasks.disabled":"Disabled","mcp.oauth.signingOut":"Signing out...","mcp.oauth.signOut":"Sign out","mcp.oauth.continueAuthorization":"Continue authorization","mcp.oauth.resumeAuthorization":"Resume authorization","mcp.oauth.opening":"Opening...","mcp.oauth.authorize":"Authorize","mcp.delete.confirm":"Remove this server and its saved configuration?","mcp.tools.title":"Tools ({count})","mcp.tools.none":"No tools available","mcp.completion.title":"Argument completion","mcp.completion.connectPrompt":"Connect the server to request suggestions","mcp.completion.unsupported":"Server does not advertise MCP completions","mcp.completion.noTargets":"No completable prompt arguments or template variables","mcp.completion.targetAria":"MCP completion target","mcp.completion.partialAria":"MCP completion partial value","mcp.completion.partialPlaceholder":"Partial value","mcp.completion.completing":"Completing...","mcp.completion.complete":"Complete","mcp.completion.suggestionsAria":"MCP completion suggestions","mcp.completion.empty":"[empty]","mcp.completion.noSuggestions":"No suggestions","mcp.meta.truncatedSuffix":" · truncated","mcp.meta.detailsOmittedSuffix":" · details omitted","mcp.diagnostics.title":"Diagnostics","mcp.diagnostics.refreshAria":"Refresh {name} MCP logs","mcp.diagnostics.logsAria":"{name} MCP logs","mcp.log.levelAria":"MCP logging level","mcp.log.setting":"Setting...","mcp.log.loading":"Loading logs...","mcp.log.none":"No logs captured","mcp.catalog.searchAria":"Search MCP server catalog","mcp.catalog.searchPlaceholder":"Search MCP servers on npm (min 3 chars)...","mcp.catalog.retry":"Retry catalog","mcp.catalog.noDescription":"No description","mcp.catalog.byAuthor":"by {author}","mcp.catalog.installed":"Installed","mcp.catalog.installing":"Installing...","mcp.catalog.install":"Install","mcp.catalog.noPackages":"No packages found","mcp.catalog.noMore":"No more packages","mcp.catalog.packagesFound":"{count} packages found","mcp.catalog.browseGlama":"Browse more on Glama","mcp.error.connectFailed":"Failed to connect server","mcp.error.disconnectFailed":"Failed to disconnect server","mcp.error.deleteFailed":"Failed to delete server","mcp.error.loginFailed":"Failed to login MCP OAuth","mcp.error.logoutFailed":"Failed to logout MCP OAuth","mcp.error.loggingLevelFailed":"Failed to set MCP logging level","mcp.error.completionFailed":"MCP completion failed","mcp.add.title":"Add MCP Server","mcp.add.closeAria":"Close add MCP server","mcp.add.modeForm":"Form","mcp.add.jsonConfig":"JSON config","mcp.add.jsonConfigAria":"JSON configuration","mcp.add.serverName":"Server name","mcp.add.command":"Command","mcp.add.commandAria":"Server command","mcp.add.argsLabel":"Arguments (space separated)","mcp.add.argsAria":"Server arguments","mcp.add.invalidJson":"Enter valid JSON with a server name and transport.","mcp.add.nameCommandRequired":"Name and command are required.","mcp.add.adding":"Adding...","mcp.add.submit":"Add Server","mcp.install.title":"Install MCP Server","mcp.install.titleWithName":"Install {name}","mcp.install.closeAria":"Close MCP installation","mcp.install.args":"Arguments","mcp.install.commandPreview":"Command: npx {args}","mcp.install.nameRequired":"Server name is required.","skills.title":"Skills","skills.action.install":"Install skill","skills.action.installShort":"Install","skills.action.refreshAria":"Refresh skills","skills.action.closeAria":"Close skills","skills.action.dismiss":"Dismiss","skills.action.retry":"Retry","skills.action.cancel":"Cancel","skills.action.close":"Close","skills.action.hide":"Hide","skills.action.enable":"Enable","skills.action.disable":"Disable","skills.action.saving":"Saving...","skills.status.enabled":"Enabled","skills.status.disabled":"Disabled","skills.status.installed":"Installed","skills.noDescriptionShort":"No description","skills.noDescription":"No description available","skills.installed.title":"Installed","skills.installed.searchAria":"Search installed skills","skills.installed.searchPlaceholder":"Search skills...","skills.installed.loading":"Loading skills...","skills.installed.noMatch":"No skills match your search","skills.installed.empty":"No skills installed","skills.uninstall.managedHint":"Only Blade user skills can be uninstalled","skills.uninstall.managed":"Managed","skills.uninstall.action":"Uninstall","skills.uninstall.confirmAria":"Uninstall {name}","skills.uninstall.confirmPrompt":"Remove this skill from ~/.blade/skills?","skills.uninstall.inProgress":"Uninstalling...","skills.uninstall.confirm":"Uninstall skill","skills.details.title":"Details","skills.details.provider":"Provider","skills.details.location":"Location","skills.details.capabilities":"Capabilities","skills.details.allowedTools":"Allowed Tools ({count})","skills.detail.emptyState":"Select a skill to view details","skills.install.title":"Install Skill","skills.install.closeAria":"Close skill installation","skills.install.tab.catalog":"Catalog","skills.install.tab.repo":"Repo","skills.install.tab.local":"Local","skills.install.catalog.searchAria":"Search skill catalog","skills.install.catalog.searchPlaceholder":"Search catalog...","skills.install.catalog.loading":"Loading catalog...","skills.install.catalog.empty":"No skills found","skills.install.catalog.byAuthor":"by {author}","skills.install.catalog.tag.official":"Official","skills.install.catalog.tag.popular":"Popular","skills.install.catalog.tag.community":"Community","skills.install.repo.label":"GitHub URL","skills.install.repo.inputAria":"Skill repository URL","skills.install.repo.credentialsHint":"Uses Git credentials available to the Blade process","skills.install.local.label":"Local path","skills.install.local.inputAria":"Local skill path","skills.status.dialogTitle":"Install Status","skills.status.confirm.title":"Confirm Install","skills.status.confirm.prompt":"Install selected skill?","skills.status.installing.title":"Installing","skills.status.installing.description":"Downloading and verifying…","skills.status.failed.title":"Install Failed","skills.status.failed.fallback":"Installation failed.","skills.status.failed.hint":"Check access and try again.","skills.error.deleteFailed":"Failed to delete skill","skills.error.toggleFailed":"Failed to toggle skill","skills.error.installFailed":"Failed to install skill","schedule.title":"Scheduled Tasks","schedule.description":"Run headless task prompts automatically on a cron, interval, or one-time trigger.","schedule.new":"New schedule","schedule.newAria":"Create a new schedule","schedule.refresh":"Refresh","schedule.reloadAria":"Reload schedules","schedule.create":"Create","schedule.save":"Save","schedule.cancel":"Cancel","schedule.confirmDelete":"Confirm?","schedule.empty":"No schedules yet","schedule.enabled":"Enabled","schedule.disabled":"Disabled","schedule.never":"never","schedule.nextRun":"Next run","schedule.lastRun":"Last run","schedule.runCount":"{count} runs","schedule.trigger.kindAria":"Trigger type","schedule.trigger.cron":"Cron","schedule.trigger.interval":"Interval","schedule.trigger.once":"Once","schedule.field.title":"Title (optional)","schedule.field.cron":"Cron expression","schedule.field.interval":"Interval","schedule.field.runAt":"Run at","schedule.field.prompt":"Prompt","schedule.field.project":"Project path","schedule.field.model":"Model (optional)","schedule.field.permissionMode":"Permission mode","schedule.field.isolation":"Isolation","schedule.placeholder.title":"Nightly dependency audit","schedule.placeholder.cron":"0 9 * * 1 (min hour dom mon dow)","schedule.placeholder.interval":"30m / 2h / 1d","schedule.placeholder.prompt":"Describe the task to run…","schedule.placeholder.project":"/path/to/project","schedule.placeholder.model":"e.g. anthropic/claude-sonnet","schedule.model.current":"Use current model","schedule.permission.default":"Default","schedule.permission.autoEdit":"Auto edit","schedule.permission.yolo":"Yolo","schedule.permission.plan":"Plan","schedule.isolation.local":"Local","schedule.isolation.worktree":"Worktree","schedule.cadence.cron":"cron: {expr}","schedule.cadence.interval":"every {interval}","schedule.cadence.once":"once at {time}","schedule.status.queued":"queued","schedule.status.running":"running","schedule.status.completed":"completed","schedule.status.failed":"failed","schedule.status.cancelled":"cancelled","schedule.status.interrupted":"interrupted","schedule.status.error":"error","schedule.status.never":"no runs yet","schedule.runNowAria":'Run "{title}" now',"schedule.editAria":'Edit "{title}"',"schedule.deleteAria":'Delete "{title}"',"schedule.enableAria":'Enable "{title}"',"schedule.disableAria":'Disable "{title}"',"schedule.error.promptRequired":"A prompt is required.","schedule.error.projectRequired":"A project path is required.","schedule.error.cronRequired":"A cron expression is required.","schedule.error.invalidInterval":"Enter an interval like 30m, 2h, or 1d.","schedule.error.runAtRequired":"Pick a valid run time.","schedule.error.loadFailed":"Failed to load scheduled tasks.","schedule.error.createFailed":"Failed to create scheduled task.","schedule.error.updateFailed":"Failed to update scheduled task.","schedule.error.deleteFailed":"Failed to delete scheduled task.","schedule.error.toggleFailed":"Failed to change scheduled task status.","schedule.error.runFailed":"Failed to run scheduled task."},ow={"app.restoring":"正在恢复工作区…","layout.workspace.pathAria":"工作区路径","layout.workspace.empty":"未选择工作区","layout.action.rewind":"回溯会话","layout.action.openNavigation":"打开导航","layout.action.previewRestore":"还原预览","layout.action.previewMaximize":"最大化预览","terminal.title":"终端","terminal.status.connected":"终端已连接","terminal.status.disconnected":"终端未连接","terminal.action.minimize":"最小化终端","terminal.action.restore":"恢复终端","terminal.action.close":"关闭终端","sidebar.brand.badge":"网页版","sidebar.action.collapse":"收起侧边栏","sidebar.action.expand":"展开侧边栏","sidebar.navigationAria":"任务导航","sidebar.action.newTask":"新建任务","sidebar.action.newTaskShort":"新建任务","sidebar.action.taskBoard":"任务看板","sidebar.action.terminal":"终端","sidebar.action.terminalToggle":"切换终端","sidebar.action.searchTasks":"搜索任务","sidebar.unreadTasks":"{count} 个未读任务","sidebar.section.skills":"技能","sidebar.section.mcp":"MCP","sidebar.section.settings":"设置","sidebar.status.user":"用户","sidebar.status.feedLive":"任务通道已连接","sidebar.status.feedOffline":"任务通道未连接","sidebar.empty.title":"暂无任务","sidebar.empty.hint":"在主页派发新任务","sidebar.group.running":"进行中","sidebar.group.queued":"排队中","sidebar.group.interrupted":"已暂停","sidebar.group.failed":"已失败","sidebar.group.cancelled":"已取消","sidebar.group.done":"已完成","sidebar.group.showMore":"再显示 {count} 条","sidebar.group.showLess":"收起","sidebar.view.project":"项目","sidebar.view.status":"状态","sidebar.view.projectAria":"按项目分组会话","sidebar.view.statusAria":"按状态分组会话","sidebar.project.active":"当前","sidebar.project.expand":"展开 {name}","sidebar.project.collapse":"收起 {name}","sidebar.project.newTask":"在 {name} 中新建任务","sidebar.project.reorder":"调整 {name} 的顺序,当前位置 {position}/{count}","sidebar.project.reorderHint":"拖拽调整顺序,或使用上下方向键移动","sidebar.project.reordered":"已将 {name} 移到第 {position} 位","sidebar.project.projects":"项目","sidebar.catalog.syncing":"正在同步任务历史…","sidebar.catalog.loaded":"已载入 {count} 条","sidebar.catalog.incomplete":"任务历史未完整加载","sidebar.catalog.retry":"重试","projects.dialog.title":"项目","projects.dialog.description":"绑定本地目录,无需重启 Blade 即可切换任务上下文。","projects.bind.placeholder":"/项目的绝对路径","projects.bind.pathLabel":"项目路径","projects.bind.action":"绑定","projects.bind.failed":"项目绑定失败","projects.pick.action":"选择项目文件夹","projects.pick.actionShort":"选择","projects.pick.picking":"选择中…","projects.pick.failed":"无法选择项目文件夹","projects.unbind.action":"解除项目绑定","projects.unavailable":"目录不可用","sidebar.language.label":"语言","sidebar.language.aria":"切换语言","sidebar.language.en":"EN","sidebar.language.zh":"中","session.env.worktree":"独立分支","session.env.local":"本地","session.action.select":"选择「{title}」","session.action.save":"保存「{title}」","session.action.cancel":"取消「{title}」","session.action.more":"「{title}」的更多操作","session.action.fork":"派生「{title}」","session.action.forkShort":"派生","session.action.rename":"重命名「{title}」","session.action.renameShort":"重命名","session.action.archive":"归档「{title}」","session.action.archiveShort":"归档","session.action.export":"将「{title}」导出为 Markdown","session.action.exportShort":"导出 Markdown","session.action.exportingShort":"正在导出…","session.action.delete":"删除「{title}」","session.action.deleteShort":"删除","session.action.stop":"停止「{title}」","session.action.stopping":"正在停止「{title}」","session.action.retry":"重试「{title}」","session.action.retrying":"正在重试「{title}」","session.reason.cancelledByUser":"已由用户取消","session.title.codeReview":"代码评审","session.forkedFrom":"派生自","session.retriedFrom":"重试自","session.retryShort":"重试","session.queued":"排队 #{position}/{depth}","archive.title":"归档","archive.subtitle":"安全保留,不占用当前任务列表","archive.open":"打开会话归档","archive.refresh":"刷新归档会话","archive.retry":"重试","archive.loading":"正在载入归档…","archive.empty":"暂无归档会话","archive.restore":"恢复「{title}」","archive.restoreShort":"恢复","archive.restoreAncestor":"请先恢复归档根会话","archive.inherited":"随 {id} 一同归档","taskSwitcher.title":"任务切换器","taskSwitcher.description":"跨项目搜索并打开任务。","taskSwitcher.searchAria":"搜索任务","taskSwitcher.placeholder":"搜索标题、项目、分支、状态或 Session ID…","taskSwitcher.results":"{count} 个结果","taskSwitcher.recent":"最近任务","taskSwitcher.scope":"已索引 {count} 个任务","taskSwitcher.indexing":"正在索引任务…","taskSwitcher.resultsAria":"任务搜索结果","taskSwitcher.current":"当前","taskSwitcher.unread":"{count} 个未读","taskSwitcher.needsAction":"{count} 个需要操作","taskSwitcher.new":"新","taskSwitcher.empty":"没有匹配的任务","taskSwitcher.emptyHint":"尝试项目、分支、状态或更短的关键词。","taskSwitcher.hint.navigate":"选择","taskSwitcher.hint.open":"打开","taskSwitcher.hint.toggle":"切换","taskSwitcher.action.failed":"任务操作失败","commandCenter.title":"命令中心","commandCenter.description":"搜索任务,或执行工作区与应用操作。","commandCenter.searchAria":"搜索操作","commandCenter.placeholder":"搜索操作、设置或工具…","commandCenter.modeAria":"命令中心模式","commandCenter.mode.tasks":"任务","commandCenter.mode.commands":"操作","commandCenter.actions":"{count} 个操作","commandCenter.resultsAria":"操作搜索结果","commandCenter.empty":"没有匹配的操作","commandCenter.emptyHint":"尝试工具、面板或设置名称。","commandCenter.action.newTask":"新建任务","commandCenter.action.newTaskDescription":"打开一个干净的任务编辑器","commandCenter.action.preview":"切换预览区","commandCenter.action.previewDescription":"审查文件、Diff、运行日志与网页","commandCenter.action.terminal":"切换终端","commandCenter.action.terminalDescription":"打开或关闭工作区 Shell","commandCenter.action.settings":"打开设置","commandCenter.action.settingsDescription":"配置外观与行为","commandCenter.action.models":"配置模型","commandCenter.action.modelsDescription":"选择 Provider 与任务模型","commandCenter.action.shortcuts":"查看键盘快捷键","commandCenter.action.shortcutsDescription":"浏览全局与上下文按键","commandCenter.action.skills":"管理 Skills","commandCenter.action.skillsDescription":"发现并配置 Agent 能力","commandCenter.action.mcp":"管理 MCP Server","commandCenter.action.mcpDescription":"配置已连接的工具与服务","commandCenter.action.sidebar":"切换侧边栏","commandCenter.action.sidebarDescription":"显示或隐藏项目导航","taskHome.eyebrow":"任务调度台 · 就绪","taskHome.feed.connecting":"任务调度台 · 正在连接","taskHome.feed.reconnecting":"任务调度台 · 正在重连","taskHome.feed.offline":"任务调度台 · 已离线","taskHome.feed.offlineDescription":"实时任务更新已暂停,服务端正在运行的任务不会停止。","taskHome.feed.retry":"重新连接","taskHome.hero.prefix":"要在这里让 Blade 做点什么:","taskHome.hero.projectFallback":"当前工作区","taskHome.hero.subtitle":"派发一个任务后即可继续手头的工作。每个任务在独立的 worktree 中运行、状态持久保存,完成时会以可复核的工作区形式返回。","taskHome.templates.title":"模板","taskHome.templates.hint":"按 1–4 快速填充","taskHome.template.explore.title":"探索","taskHome.template.explore.description":"追踪行为,梳理系统全貌","taskHome.template.explore.hint":"调用链 · 模块结构","taskHome.template.build.title":"开发","taskHome.template.build.description":"实现一个可上线的功能","taskHome.template.build.hint":"端到端交付特性","taskHome.template.review.title":"评审","taskHome.template.review.description":"找出正确性与回归风险","taskHome.template.review.hint":"审查当前改动","taskHome.review.attachmentsUnsupported":"代码评审不支持附件","taskHome.review.outputSchemaUnsupported":"代码评审使用内置结构化报告 Schema","taskHome.review.usage":"用法:/review [uncommitted | base <ref> | commit <sha>]","taskHome.review.running":"只读代码评审正在进行","taskHome.review.stale":"评审期间目标已发生变化","taskHome.review.aborted":"代码评审已中止","taskHome.review.interrupted":"代码评审因进程重启而中断","taskHome.review.failed":"代码评审失败","taskHome.review.startFailed":"启动代码评审失败","taskHome.review.invalidTarget":"评审目标无效或没有可评审的改动","taskHome.review.conflict":"当前会话已有任务正在运行","taskHome.template.fix.title":"修复","taskHome.template.fix.description":"定位并修好一个具体故障","taskHome.template.fix.hint":"二分 · 复现 · 打补丁","taskHome.context.isolationToggleTitle":"切换任务隔离方式","taskHome.context.projectSelect":"选择目标项目","taskHome.context.isolation.worktree":"独立 worktree","taskHome.context.isolation.local":"本地工作区","taskHome.context.branchFallback":"无分支","taskHome.context.preparing":"正在准备 worktree","taskHome.setup.aria":"任务准备状态","taskHome.setup.title":"完成准备","taskHome.setup.description":"你可以继续编辑草稿,Blade 正在核对工作区和模型。","taskHome.setup.workspace.title":"工作区","taskHome.setup.workspace.loading":"正在检查可用工作区…","taskHome.setup.workspace.ready":"已选择 {project}","taskHome.setup.workspace.required":"选择一个可用项目","taskHome.setup.workspace.empty":"无项目","taskHome.setup.workspace.action":"选择","taskHome.setup.workspace.retry":"重新加载工作区","taskHome.setup.model.title":"模型","taskHome.setup.model.loading":"正在检查配置…","taskHome.setup.model.ready":"可用于当前任务","taskHome.setup.model.required":"配置或选择一个模型","taskHome.setup.model.action":"配置","taskHome.setup.model.retry":"重试","taskHome.composer.placeholder":"描述目标、约束以及你期望的验收方式……","taskHome.error.dismiss":"关闭","taskHome.recent.title":"最近任务","taskHome.recent.total":"共 {count} 条","taskHome.recent.partial":"已载入 {count} 条 · 继续同步","taskHome.recent.incomplete":"已载入 {count} 条 · 历史不完整","taskSwitcher.indexingLoaded":"已载入 {count} 条 · 正在同步历史","taskHome.footer.note":"独立 worktree 让并行任务不会干扰你当前的工作副本","kanban.title":"任务看板","kanban.subtitle":"跨项目派发任务,优先处理需要人工介入的工作。","kanban.taskCount":"{count} 个任务","kanban.searchAria":"搜索任务看板","kanban.searchPlaceholder":"搜索任务…","kanban.projectFilterAria":"按项目筛选任务看板","kanban.projectAll":"全部项目","kanban.feed.offline":"实时更新已离线,服务端运行中的任务不会停止。","kanban.autoClaim.running":"自动认领中","kanban.autoClaim.paused":"自动认领已暂停","kanban.column.waiting":"等待认领","kanban.column.waitingDescription":"等待可用的执行槽位","kanban.column.active":"处理中","kanban.column.activeDescription":"Agent 正在执行任务","kanban.column.blocked":"遇到阻碍","kanban.column.blockedDescription":"需要输入、重试或人工处理","kanban.column.review":"等你确认","kanban.column.reviewDescription":"已完成,等待验收归档","kanban.column.empty":"此阶段暂无任务","kanban.priority.high":"高优先级","kanban.priority.medium":"中优先级","kanban.priority.low":"低优先级","kanban.kind.feature":"新功能","kanban.kind.bug":"缺陷","kanban.kind.maintenance":"维护","kanban.kind.research":"调研","kanban.card.unread":"有新的任务更新","kanban.card.queuePosition":"队列第 {position}/{depth} 位","kanban.card.diff":"{files} 个文件 · +{additions} −{deletions}","kanban.action.newTask":"新建任务","kanban.action.open":"打开任务","kanban.action.respond":"处理阻碍","kanban.action.inspect":"验收变更","kanban.action.edit":"编辑任务信息","kanban.action.cancel":"取消任务","kanban.action.retry":"重试任务","kanban.action.archive":"验收并归档","kanban.dialog.createTitle":"派发任务","kanban.dialog.createDescription":"任务会直接在选定项目的本地工作区中执行。","kanban.dialog.editTitle":"编辑任务","kanban.dialog.editDescription":"更新计划信息,不会中断正在执行的 Agent。","kanban.dialog.localExecution":"本地工作区 · 不使用 worktree 隔离","kanban.dialog.cancel":"取消","kanban.dialog.dispatch":"派发","kanban.dialog.save":"保存","kanban.dialog.submitFailed":"任务操作失败","kanban.field.title":"标题","kanban.field.titlePlaceholder":"可选的简短任务标题","kanban.field.prompt":"任务说明","kanban.field.promptPlaceholder":"描述目标、约束以及预期的验收方式…","kanban.field.project":"项目","kanban.field.kind":"类型","kanban.field.priority":"优先级","kanban.field.dueAt":"截止时间","capacity.title":"{inFlight} 进行中 · {queued} 排队 · 上限 {max}","capacity.suffix.running":" 进行中","capacity.queued":"排队 {queued}","recent.status.running":"进行中","recent.status.queued":"排队中","recent.status.paused":"已暂停","recent.status.failed":"已失败","recent.status.cancelled":"已取消","recent.status.done":"已完成","recent.time.justNow":"刚刚","recent.time.minutes":"{n} 分钟前","recent.time.hours":"{n} 小时前","recent.time.days":"{n} 天前","recent.session.fallbackShort":"会话 {id}","recent.session.fallbackDated":"会话 {y}-{m}-{d} {hh}:{mm}","attention.unreadAnnouncement":"{count} 个未读任务更新","attention.notification.completed":"任务已完成","attention.notification.failed":"任务失败","attention.notification.interrupted":"任务已中断","attention.notification.permission":"需要审批","attention.notification.question":"需要回答","attention.notification.elicitation":"MCP 需要输入","interaction.permission.title":"需要授权:{tool}","interaction.permission.once":"仅本次允许","interaction.permission.session":"本会话允许","interaction.permission.project":"本项目允许","interaction.permission.deny":"拒绝","interaction.permission.failed":"授权响应失败","interaction.question.answered":"问题已回答","interaction.question.other":"其他","interaction.question.submit":"提交回答","interaction.question.failed":"回答提交失败","interaction.elicitation.title":"MCP 请求输入","interaction.elicitation.submit":"提交给 MCP","interaction.elicitation.open":"打开外部链接","interaction.elicitation.decline":"拒绝","interaction.elicitation.cancel":"取消","interaction.elicitation.responded":"已响应 MCP 请求","interaction.elicitation.cancelled":"MCP 请求已取消","interaction.elicitation.failed":"响应 MCP 请求失败","interaction.elicitation.warning":"仅在信任该 MCP 服务器并理解请求用途时继续。","interaction.bar.permissionTitle":"Agent 正在等待审批","interaction.bar.permissionHint":"请检查待处理的工具请求,审批后任务才会继续。","interaction.bar.questionTitle":"Agent 正在等待回答","interaction.bar.questionHint":"请回答待处理的问题,任务才能继续。","interaction.bar.elicitationTitle":"MCP 服务器正在等待输入","interaction.bar.elicitationHint":"请检查 MCP 请求,响应后任务才会继续。","interaction.bar.review":"查看请求","interaction.badge.permission":"需要审批","interaction.badge.question":"需要回答","interaction.badge.elicitation":"MCP 输入","artifact.env.isolated":"独立分支","artifact.env.local":"本地","artifact.review":"查看变更","artifact.commits":"{count} 次提交","artifact.apply":"应用","artifact.retryApply":"重新应用","artifact.applying":"应用中","artifact.applied":"已应用","artifact.discard":"丢弃任务变更","artifact.discarded":"已丢弃","artifact.conflict":"任务变更无法安全应用。","artifact.conflictHint":"隔离变更已保留。请查看变更、处理源项目状态,然后重试或丢弃。","artifact.discardDialog.title":"丢弃隔离变更?","artifact.discardDialog.description":"将删除 {project} 隔离任务工作区中的 {count} 个变更文件。","artifact.discardDialog.warning":"此操作会永久删除任务 worktree 和分支,不会修改源项目。","artifact.discardDialog.cancel":"保留变更","artifact.discardDialog.confirm":"丢弃变更","chat.list.empty.eyebrow":"Blade · 就绪","chat.list.empty.title":"发送一条消息开始对话","chat.list.empty.hint":"提问、描述改动,或者粘贴一段错误堆栈。","chat.list.loading.eyebrow":"历史对话","chat.list.loading.title":"正在恢复对话…","chat.list.loading.hint":"正在加载消息、任务状态和实时更新。对话较长时可能需要一点时间。","chat.list.showEarlier":"显示更早的 {count} 条消息","chat.list.showEarlierWithRemaining":"显示更早的 {count} 条消息,当前隐藏 {remaining} 条","chat.list.jumpLatest":"回到最新消息","chat.list.unreadMessage":"1 条新消息","chat.list.unreadMessages":"{count} 条新消息","chat.turns.aria":"跳转到之前的消息","chat.turns.label":"第 {n} 轮","chat.timeline.thinking":"思考过程","chat.timeline.tools.runningOne":"正在执行 1 条命令","chat.timeline.tools.running":"正在执行 {count} 条命令","chat.timeline.tools.completedOne":"已执行 1 条命令","chat.timeline.tools.completed":"已执行 {count} 条命令","chat.timeline.tools.completedOneWithError":"已执行 1 条命令 · 执行失败","chat.timeline.tools.completedWithErrors":"已执行 {count} 条命令 · {errors} 条失败","chat.error.dismiss":"关闭错误","chat.error.queueFull":"指令队列已满。请等待已有指令开始执行后重试。","chat.error.turnChanged":"当前轮次已发生变化,此消息尚未接收。请确认内容后重试。","chat.error.title.submission":"消息未发送。","chat.error.title.execution":"本轮运行已停止。","chat.error.title.navigation":"未能打开任务。","chat.error.title.generic":"操作失败。","chat.error.action.returnDraft":"返回草稿","chat.error.action.editResend":"编辑后重发","chat.error.action.retryTask":"重试任务","chat.error.action.retryingTask":"正在重试…","chat.error.action.checkModels":"检查模型设置","task.failure.authentication":"模型服务认证失败,请检查模型凭据。","task.failure.permission":"模型服务拒绝了请求,请检查账号和模型权限。","task.failure.rateLimit":"模型服务达到速率或额度限制。","task.failure.timeout":"模型服务请求超时。","task.failure.network":"无法连接模型服务。","task.failure.modelUnavailable":"当前选择的模型不可用。","task.failure.contextLimit":"请求超出模型上下文限制。","task.failure.unsupportedInput":"当前模型不支持此类输入。","task.failure.workspaceUnavailable":"此会话的工作区已不可用。","task.failure.capacity":"任务准入容量已满,请在运行中的任务完成后重试。","task.failure.runtime":"Agent 运行失败。","chat.connection.reconnecting":"正在恢复实时更新,当前任务仍在后台继续运行。","chat.connection.offline":"实时更新已离线,当前显示的进度可能已经过期。","chat.connection.retry":"重新连接","chat.side.title":"旁路对话","chat.side.loading":"正在回答旁路问题……","chat.side.failed":"旁路对话失败。","chat.side.dismiss":"关闭旁路对话","chat.footer.disclaimer":"Blade 可能会出错,请核对重要信息。","chat.input.placeholder.default":"输入 @ 提及文件,/ 触发命令……","chat.input.placeholder.steering":"添加指令来引导当前轮次……","chat.input.steering.status":"当前轮次可被引导","chat.input.steering.queued":"引导指令已接收 · 待处理 {count} 条","chat.input.steering.enterHint":" · 回车下发指令","chat.input.followUp.queued":"后续指令已接收 · 下一轮排队 {count} 条","chat.input.steering.recoveredOne":"重启后已恢复 {count} 条排队指令","chat.input.steering.recoveredMany":"重启后已恢复 {count} 条排队指令","chat.input.attachment.add":"添加图片","chat.input.attachment.remove":"移除","chat.input.attachment.countLimit":"最多可添加 {count} 张图片。","chat.input.attachment.sizeLimit":"图片编码后总大小不能超过 {size},请移除图片或选择更小的文件。","chat.input.attachment.readFailed":"Blade 无法读取其中一张图片。","chat.input.attachment.usage":"{count}/{limit} 张图片 · 已用 {used} / {budget}","chat.input.attachment.modelUnsupported":"{model} 不支持图片输入,请选择视觉模型或移除图片。","chat.input.attachment.modelRequired":"请先选择支持图片输入的视觉模型。","chat.input.model.placeholder":"选择模型","chat.input.model.empty":"未配置模型","chat.input.model.vision":"视觉","chat.input.model.change":"切换模型","chat.input.model.locked":"请等待当前轮次结束后再切换模型","chat.input.effort.label":"推理 {effort}","chat.input.effort.heading":"推理强度","chat.input.effort.change":"切换推理强度","chat.input.effort.locked":"请等待当前轮次结束后再切换推理强度","chat.input.effort.option":"使用 {effort} 推理强度","chat.input.serviceTier.label":"速度 {tier}","chat.input.serviceTier.heading":"Provider 服务等级","chat.input.serviceTier.change":"切换 Provider 服务等级","chat.input.serviceTier.locked":"请等待当前轮次结束后再切换服务等级","chat.input.serviceTier.option":"使用 {tier} 服务等级","chat.input.serviceTier.fastHint":"优先通道","chat.input.serviceTier.flexHint":"低成本","chat.input.responseVerbosity.label":"输出 {verbosity}","chat.input.responseVerbosity.heading":"响应详略","chat.input.responseVerbosity.change":"切换响应详略","chat.input.responseVerbosity.locked":"请等待当前轮次结束后再切换响应详略","chat.input.responseVerbosity.option":"使用 {verbosity} 响应详略","chat.input.responseVerbosity.autoHint":"模型默认","chat.input.outputSchema.title":"结构化输出","chat.input.outputSchema.description":"要求本轮最终返回符合该 JSON Schema 的对象。","chat.input.outputSchema.change":"设置结构化输出 Schema","chat.input.outputSchema.locked":"请等待当前轮次结束后再修改输出 Schema","chat.input.outputSchema.editor":"JSON Schema 编辑器","chat.input.outputSchema.placeholder":"粘贴 JSON Schema 对象","chat.input.outputSchema.example":"使用示例","chat.input.outputSchema.clear":"清除","chat.input.outputSchema.invalid":"请输入有效的 JSON 对象;完整 Schema 将由服务端校验。","chat.input.outputSchema.shellUnsupported":"结构化输出不能与 Shell 命令同时使用。","chat.structuredOutput.title":"结构化输出","chat.structuredOutput.copy":"复制结构化输出","chat.input.communicationStyle.label":"风格 {style}","chat.input.communicationStyle.heading":"沟通风格","chat.input.communicationStyle.change":"切换沟通风格","chat.input.communicationStyle.locked":"请等待当前轮次结束后再切换沟通风格","chat.input.communicationStyle.option":"使用 {style} 沟通风格","chat.input.communicationStyle.autoHint":"Blade 默认","chat.input.communicationStyle.pragmaticHint":"直接","chat.input.communicationStyle.friendlyHint":"协作","chat.input.communicationStyle.explanatoryHint":"解释取舍","chat.notice.dismiss":"关闭提示","chat.input.mode.default":"手动审批","chat.input.mode.default.desc":"每个重要操作都需要你的批准","chat.input.mode.autoEdit":"自动审批","chat.input.mode.autoEdit.desc":"让 AI 审核并批准重要操作","chat.input.mode.yolo":"完全访问","chat.input.mode.yolo.desc":"无需询问,直接在你的电脑上运行","chat.input.mode.yolo.confirm.title":"启用完全访问模式?","chat.input.mode.yolo.confirm.desc":"在此模式下,Agent 将直接执行所有操作(包括文件写入、Shell 命令和网络请求)而不请求许可。仅在你信任当前上下文时启用。","chat.input.mode.yolo.confirm.cancel":"取消","chat.input.mode.yolo.confirm.accept":"启用","chat.input.mode.plan":"计划","chat.input.mode.plan.desc":"先拟定计划,暂不做任何改动","chat.input.mode.aria":"Agent 操作审批","chat.input.action.stop":"停止当前轮次","chat.input.action.stopping":"正在停止当前轮次","chat.input.action.steer":"引导当前轮次","chat.input.action.send":"发送消息","chat.input.action.submitting":"正在提交消息","chat.review.title":"代码评审","chat.review.target":"目标","chat.review.target.uncommitted":"未提交改动","chat.review.target.base":"相对 {ref} 的改动","chat.review.target.commit":"提交 {ref}","chat.review.status":"状态","chat.review.status.completed":"已完成","chat.review.status.stale":"已过期","chat.review.status.failed":"失败","chat.review.status.aborted":"已中止","chat.review.status.interrupted":"已中断","chat.review.findings":"问题","chat.review.noFindings":"未发现可执行问题","chat.review.confidence":"置信度 {value}","chat.review.error":"错误","chat.subagent.resumedFromTitle":"从 {id} 恢复","chat.subagent.resumedDepth":"已恢复 · 层级 {depth}","chat.subagent.loadingLogs":"正在加载子智能体日志…","chat.subagent.resumedAs":"已恢复为 {id} · {status} · 层级 {depth}","chat.subagent.resume":"恢复","chat.subagent.resumeAria":"恢复子智能体","chat.subagent.followUpAria":"子智能体后续指令","chat.subagent.followUpPlaceholder":"描述需要继续处理的工作","chat.subagent.cancel":"取消","chat.subagent.resumeAgent":"恢复智能体","chat.subagent.resumeFailed":"恢复子智能体失败","chat.markdown.copyCode":"复制代码","chat.rewind.title":"回溯会话","chat.rewind.description":"返回到某条用户消息之前的节点。","chat.rewind.loading":"正在加载检查点","chat.rewind.empty":"暂无可回溯的检查点","chat.rewind.checkpointAria":"回溯检查点","chat.rewind.userMessage":"用户消息","chat.rewind.fileCountOne":"{count} 个文件","chat.rewind.fileCountMany":"{count} 个文件","chat.rewind.restoreCode":"恢复代码变更","chat.rewind.restoreCodeHint":"回滚此检查点及之后更改的文件。","chat.rewind.cancel":"取消","chat.rewind.confirm":"回溯","chat.rewind.loadFailed":"加载回溯检查点失败","chat.rewind.failed":"回溯失败。请检查会话错误后重试。","status.context":"上下文","status.tokenLimitTooltip":"此为估算的 token 上限,模型回报上下文尺寸后会自动更新。","status.cache":"缓存","status.cacheTooltip":"本会话缓存读取输入占模型总输入的比例。","status.cacheDetails":"读取 {read} · 写入 {write} · 未缓存 {uncached}","status.cacheUnavailable":"Provider 尚未回报本会话的提示词缓存用量。","status.cacheBreak":"最近一次缓存中断:{reason} · 缓存读取 {previous} → {current}","status.cacheBreak.model":"模型发生变化","status.cacheBreak.system":"系统提示词发生变化","status.cacheBreak.tools":"工具定义发生变化","status.cacheBreak.policy":"请求策略发生变化","status.cacheBreak.ttl":"缓存 TTL 已过期","status.cacheBreak.server":"可能是 Provider 路由或缓存淘汰","status.phase.running":"生成中…","status.phase.providerStall":"Provider 流暂无数据","status.phase.actionStationarityRecovering":"正在纠正空转","status.phase.actionStationarityStopped":"已停止空转","status.phase.compacting":"正在压缩上下文…","status.phase.recoveringContext":"上下文超限,正在恢复…","status.phase.switchingModel":"正在切换模型…","status.phase.waitingPermission":"等待授权…","status.phase.error":"运行失败","status.recovery.review":"恢复前需要检查","status.recovery.interruptedTool":"中断工具的执行状态不确定","status.recovery.successfulTool":"工具可能已经改变了外部状态","preview.title":"预览","preview.action.resize":"调整预览区宽度","preview.action.close":"关闭预览区","preview.action.retry":"重试","preview.tab.diff":"变更","preview.tab.files":"文件","preview.tab.logs":"日志","preview.tab.browser":"浏览器","preview.diff.loadingTitle":"正在加载任务变更…","preview.diff.loadingHint":"正在读取持久化的 worktree 产物。","preview.diff.failedTitle":"任务变更加载失败","preview.diff.discardedTitle":"变更已丢弃","preview.diff.discardedHint":"隔离工作区已删除,源项目没有被修改。","preview.diff.emptyTitle":"暂无变更","preview.diff.emptyHint":"工具修改文件后,变更会显示在这里。","preview.diff.searchAria":"搜索变更文件","preview.diff.searchPlaceholder":"筛选变更文件…","preview.diff.changedFiles":"{count} 个变更文件","preview.diff.expandAll":"全部展开","preview.diff.collapseAll":"全部收起","preview.diff.showMoreFiles":"再显示 {count} 个文件","preview.diff.showMoreLines":"再显示 {count} 行","preview.diff.noMatches":"没有匹配的变更文件","preview.diff.patch":"补丁","preview.diff.line":"第 {line} 行","preview.files.loadingTitle":"正在加载文件…","preview.files.loadingHint":"正在获取工作区文件树。","preview.files.failedTitle":"文件加载失败","preview.files.emptyTitle":"暂无文件","preview.files.emptyHint":"选择项目后即可加载工作区文件树。","preview.files.treeFailed":"工作区文件树加载失败","preview.files.searchAria":"搜索工作区文件","preview.files.searchPlaceholder":"查找文件…","preview.files.searchResultsAria":"文件搜索结果","preview.files.searchFailed":"工作区文件搜索失败","preview.files.noMatches":"没有匹配的文件","preview.files.directoryLoading":"正在加载目录…","preview.files.directoryEmpty":"空目录","preview.files.selectTitle":"选择要预览的文件","preview.files.status.loading":"加载中…","preview.files.status.truncated":"已截断","preview.files.status.ready":"就绪","preview.files.truncatedNotice":"预览内容已截断至 20 万字符。","preview.files.pickHint":"从文件树中选择一个文件进行预览。","preview.files.contentFailed":"文件加载失败","preview.files.editorLoading":"正在加载编辑器…","preview.logs.searchAria":"搜索工具日志","preview.logs.searchPlaceholder":"搜索工具、摘要或输出…","preview.logs.filterAria":"按状态筛选日志","preview.logs.filter.all":"全部","preview.logs.filter.running":"进行中","preview.logs.filter.error":"失败","preview.logs.filter.success":"成功","preview.logs.noMatches":"没有匹配的日志","preview.logs.noMatchesHint":"尝试其他关键词或状态。","preview.logs.emptyTitle":"暂无日志","preview.logs.emptyHint":"工具运行记录会显示在这里。","preview.logs.expand":"展开","preview.logs.collapse":"收起","preview.logs.showMore":"再显示 {count} 条日志","preview.logs.status.running":"进行中","preview.logs.status.error":"失败","preview.logs.status.success":"成功","goal.aria.section":"目标控制条","goal.status.active":"目标进行中","goal.status.paused":"目标已暂停","goal.status.blocked":"目标已阻塞","goal.status.usageLimited":"用量受限","goal.status.budgetLimited":"预算已达上限","goal.status.complete":"目标已完成","goal.field.objective":"目标描述","goal.action.edit":"编辑目标","goal.action.pause":"暂停目标","goal.action.resume":"恢复目标","goal.action.delete":"删除目标","goal.action.expand":"展开目标详情","goal.action.collapse":"收起目标详情","goal.action.cancel":"取消","goal.action.save":"保存","goal.metrics.tokens":"tokens","goal.metrics.continuationOne":"续跑 {n} 次","goal.metrics.continuationMany":"续跑 {n} 次","goal.dialog.title":"删除此目标?","goal.dialog.description":"仅移除目标状态,会话历史与工作区文件不会受影响。","settings.title":"设置","settings.nav.aria":"设置分区","settings.action.back":"返回","settings.category.settings":"设置","settings.category.integrations":"集成","settings.tab.general":"通用","settings.tab.trust":"安全","settings.tab.models":"模型","settings.tab.shortcuts":"快捷键","settings.tab.mcp":"MCP","settings.tab.skills":"技能","settings.tab.plugins":"插件","settings.tab.hooks":"钩子","settings.tab.schedules":"定时任务","settings.common.retry":"重试","settings.common.dismiss":"忽略","settings.common.cancel":"取消","settings.common.enable":"启用","settings.general.loading":"正在加载设置…","settings.general.loadError":"加载设置失败","settings.general.saveError":"保存设置失败","settings.general.responseLanguage":"回复语言","settings.general.responseLanguageHint":"AI 将使用该语言回复","settings.general.autoSave":"自动保存会话","settings.general.communicationStyle":"沟通风格","settings.general.communicationStyleHint":"决定 Agent 在所有会话中的回复措辞","settings.appearance.heading":"外观","settings.appearance.theme":"主题偏好","settings.appearance.theme.dark":"深色","settings.appearance.theme.light":"浅色","settings.appearance.theme.system":"跟随系统","settings.appearance.compactSidebar":"紧凑侧边栏","settings.appearance.codeTheme":"代码主题","settings.appearance.codeThemeHint":"语法高亮配色","settings.notifications.heading":"通知","settings.notifications.buildFinished":"构建完成","settings.notifications.errorsOnly":"仅错误","settings.notifications.systemSounds":"系统提示音","settings.notifications.blocked":"浏览器通知已被拦截","settings.notifications.unavailable":"当前浏览器不支持通知","settings.notifications.enablePrompt":"在此标签页处于后台时接收提醒","settings.privacy.heading":"隐私","settings.privacy.telemetry":"遥测","settings.privacy.crash":"崩溃报告","settings.models.description":"为不同的服务商配置 API Key 与模型设置。","settings.models.loading":"正在加载模型…","settings.models.loadChannelsFailed":"加载服务商渠道失败","settings.models.saveFailed":"保存模型失败","settings.models.deleteFailed":"删除模型失败","settings.models.updateFailed":"更新模型失败","settings.models.updateChannelFailed":"更新服务商渠道失败","settings.models.probeFailed":"服务商渠道探测失败","settings.models.deleteChannelFailed":"删除服务商渠道失败","settings.models.empty":"尚未配置任何模型","settings.models.add":"+ 添加新模型","settings.models.missingCredential":"缺少凭据","settings.models.configured":"已配置","settings.models.deleting":"正在删除…","settings.models.deleteModel":"删除模型","settings.models.deleteChannel":"删除渠道","settings.models.deleteModelAria":"删除 {name}","settings.models.deleteModelPrompt":"删除 {name} 及其保存的配置?","settings.models.deleteChannelAria":"删除渠道 {name}","settings.models.deleteChannelPrompt":"删除渠道 {name}、其凭据以及 {count} 个已配置模型?相关的兜底引用也会一并移除。","settings.models.editModelAria":"编辑 {name}","settings.models.editChannelAria":"编辑渠道 {name}","settings.models.testChannelAria":"测试 {name}","settings.models.deleteChannelActionAria":"删除渠道 {name}","settings.models.modelCountOne":"{count} 个模型","settings.models.modelCountMany":"{count} 个模型","settings.models.defaultEndpoint":"默认端点","settings.shortcuts.searchPlaceholder":"搜索操作…","settings.shortcuts.scope.all":"全部范围","settings.shortcuts.scope.global":"全局","settings.shortcuts.scope.chat":"聊天","settings.shortcuts.scope.layout":"布局","settings.shortcuts.reset":"重置","settings.shortcuts.col.action":"操作","settings.shortcuts.col.shortcut":"快捷键","settings.shortcuts.col.scope":"范围","settings.shortcuts.empty":"未找到快捷键。","settings.shortcuts.action.searchTasks":"搜索任务","settings.shortcuts.action.openCommands":"打开命令中心","settings.shortcuts.action.newTask":"新建任务","settings.shortcuts.action.focusComposer":"聚焦输入框","settings.shortcuts.action.toggleSidebar":"切换侧边栏","settings.common.reload":"重新加载","settings.trust.state.notRequired":"无需信任","settings.trust.state.trusted":"工作区已信任","settings.trust.state.review":"需要审查","settings.trust.state.error":"信任存储错误","settings.trust.selectSession":"选择一个项目会话以查看文件夹信任。","settings.trust.heading":"工作区信任","settings.trust.inheritedFrom":" · 继承自 {source}","settings.trust.reloadAria":"重新加载工作区信任","settings.trust.revoke":"撤销","settings.trust.trustWorkspace":"信任工作区","settings.trust.restartNotice":"重启 Blade 以重新加载项目模型、MCP、LSP、权限和插件。","settings.trust.revokeAria":"撤销工作区信任","settings.trust.confirmTrust":"允许 {count} 个项目来源配置模型、MCP、LSP、权限、环境、指令、命令、技能、Agent 或插件?","settings.trust.confirmRevoke":"重启后阻止项目控制的可执行配置?","settings.trust.saving":"正在保存…","settings.trust.trustReviewed":"信任已审查的工作区","settings.trust.revokeTrust":"撤销信任","settings.trust.empty":"未找到项目控制的可执行配置。","settings.trust.loadFailed":"加载工作区信任失败","settings.trust.updateFailed":"更新工作区信任失败","settings.hooks.state.disabled":"钩子已禁用","settings.hooks.state.notRequired":"无外部钩子","settings.hooks.state.review":"需要审查","settings.hooks.state.trusted":"已信任","settings.hooks.state.modified":"批准后已变更","settings.hooks.state.error":"信任存储错误","settings.hooks.selectSession":"选择一个项目会话以查看其钩子。","settings.hooks.heading":"钩子信任","settings.hooks.reloadAria":"重新加载钩子信任","settings.hooks.revoke":"撤销","settings.hooks.trustDigest":"信任摘要","settings.hooks.currentSession":"当前会话执行","settings.hooks.session.open":"打开一个会话以控制其钩子。","settings.hooks.session.loading":"正在加载会话状态…","settings.hooks.session.disabled":"已被工作区配置禁用。","settings.hooks.session.paused":"仅在此会话中暂停。","settings.hooks.session.active":"通过信任检查后,钩子可在此会话运行。","settings.hooks.session.unavailable":"已被当前会话 runtime 或宿主策略禁用。","settings.hooks.session.enableAria":"为当前会话启用钩子","settings.hooks.session.pauseAria":"为当前会话暂停钩子","settings.hooks.session.unavailableAria":"当前会话无法使用钩子","settings.hooks.confirmTrustAria":"信任项目钩子","settings.hooks.confirmRevokeAria":"撤销项目钩子信任","settings.hooks.confirmTrust":"以你的用户权限运行这 {count} 个钩子,直到它们的配置发生变更?","settings.hooks.confirmRevoke":"停止此项目所有已配置的钩子,直到再次显式信任?","settings.hooks.saving":"正在保存…","settings.hooks.trustReviewed":"信任已审查的钩子","settings.hooks.revokeTrust":"撤销信任","settings.hooks.empty":"没有已配置的命令、HTTP 或提示词钩子。","settings.hooks.loadFailed":"加载钩子信任失败","settings.hooks.updateFailed":"更新钩子信任失败","settings.hooks.sessionUpdateFailed":"更新会话钩子失败","settings.plugins.selectProject":"选择一个项目以管理其插件。","settings.plugins.heading":"工作区插件","settings.plugins.changesNote":"更改将在后续会话快照生效并持久化到所选层级。","settings.plugins.reloadAria":"重新加载插件","settings.plugins.sourcePolicy":"来源策略","settings.plugins.savePolicyAria":"保存插件来源策略","settings.plugins.saving":"正在保存…","settings.plugins.saveForProject":"保存到项目","settings.plugins.restrictAria":"限制插件来源","settings.plugins.restrictAllowlists":"限制为允许列表","settings.plugins.requireShaAria":"要求完整 Git commit SHA","settings.plugins.requireSha":"要求完整 Git SHA","settings.plugins.environmentLocked":" · 环境已锁定","settings.plugins.gitHostsAria":"允许的插件 Git 主机","settings.plugins.marketplacesAria":"允许的插件市场","settings.plugins.localRootsAria":"允许的本地插件根目录","settings.plugins.emptyAllowlists":"空的允许列表将拒绝所有插件来源。","settings.plugins.installHeading":"安装可信插件","settings.plugins.sourceAria":"插件来源","settings.plugins.install":"安装","settings.plugins.trustSource":"我信任此来源可激活钩子、MCP 服务器、技能和命令。","settings.plugins.activationScope":"激活写入范围","settings.plugins.activationScopeHint":"更高优先级的层级仍将决定最终生效状态。","settings.plugins.scopeAria":"插件激活范围","settings.plugins.scope.local":"本地","settings.plugins.scope.project":"项目","settings.plugins.scope.global":"全局","settings.plugins.scope.localDesc":"仅当前检出","settings.plugins.scope.projectDesc":"共享的项目设置","settings.plugins.scope.globalDesc":"所有项目","settings.plugins.scope.invocation":"本次调用","settings.plugins.scope.default":"默认","settings.plugins.layer.on":"开","settings.plugins.layer.off":"关","settings.plugins.capability.commands":"{count} 个命令","settings.plugins.capability.skills":"{count} 个技能","settings.plugins.capability.agents":"{count} 个 Agent","settings.plugins.capability.hooks":"{count} 个钩子","settings.plugins.capability.mcp":"{count} 个 MCP","settings.plugins.noResources":"未声明任何资源","settings.plugins.effective":"生效范围:{scope}","settings.plugins.managed":"托管","settings.plugins.invocationScoped":"通过 --plugin-dir 限定为调用级","settings.plugins.enableAria":"启用 {name}","settings.plugins.disableAria":"停用 {name}","settings.plugins.unavailableAria":"{name} 不可用","settings.plugins.updateAria":"更新 {name}","settings.plugins.uninstallAria":"卸载 {name}","settings.plugins.confirmUpdate":"确认更新","settings.plugins.update":"更新","settings.plugins.confirmRemove":"确认移除","settings.plugins.empty":"未发现此项目的任何插件。","settings.plugins.marketplaces":"市场","settings.plugins.configuredCount":"{count} 个已配置","settings.plugins.marketplaceSourceAria":"市场来源","settings.plugins.addMarketplaceAria":"添加市场","settings.plugins.add":"添加","settings.plugins.noDescription":"无描述","settings.plugins.refreshMarketplaceAria":"刷新市场 {name}","settings.plugins.removeMarketplaceAria":"移除市场 {name}","settings.plugins.confirm":"确认","settings.plugins.installedSuffix":" · 已安装","settings.plugins.marketplaceEmpty":"添加市场以发现可安装的插件。","settings.plugins.loadFailed":"加载插件失败","settings.plugins.actionFailed":"插件操作失败","settings.plugins.updateFailed":"更新插件失败","settings.models.addModal.title":"添加模型","settings.models.addModal.close":"关闭添加模型","settings.models.addModal.loadProvidersError":"加载服务商失败","settings.models.addModal.loadModelsError":"加载模型失败","settings.models.addModal.provider":"服务商","settings.models.addModal.loadingProviders":"正在加载服务商…","settings.models.addModal.selectProvider":"选择服务商","settings.models.addModal.configuredSuffix":" - 已配置","settings.models.addModal.customOpenAI":"自定义 OpenAI 端点","settings.models.addModal.customAnthropic":"自定义 Anthropic 端点","settings.models.addModal.channelId":"渠道 ID","settings.models.addModal.channelIdHint":"稳定的配置与凭据标识符。","settings.models.addModal.channelName":"渠道名称","settings.models.addModal.baseUrl":"Base URL","settings.models.addModal.anthropicProtocol":"使用 Anthropic Messages 协议。","settings.models.addModal.openaiProtocol":"使用 OpenAI Chat Completions 协议。","settings.models.addModal.modelId":"模型 ID","settings.models.addModal.model":"模型","settings.models.addModal.loadingModels":"正在加载模型…","settings.models.addModal.selectModel":"选择模型","settings.models.addModal.reasoningSuffix":" - 推理","settings.models.addModal.visionSuffix":" - 视觉","settings.models.addModal.displayName":"显示名称","settings.models.addModal.displayNamePlaceholder":"可选别名","settings.models.addModal.apiKey":"API Key","settings.models.addModal.apiKeyAria":"API Key","settings.models.addModal.apiKeyPlaceholder":"单独存储在 auth.json 中","settings.models.addModal.showApiKey":"显示 API Key","settings.models.addModal.hideApiKey":"隐藏 API Key","settings.models.addModal.oauthNote":"该服务商需要 OAuth 或环境凭据,请在选择模型前在外部完成配置。","settings.models.addModal.saveModel":"保存模型","settings.models.addModal.saving":"正在保存…","settings.models.addModal.channelIdError":'渠道 ID 必须以小写字母开头,且只能包含小写字母、数字、"."、"_" 或 "-"。',"settings.models.addModal.invalidBaseUrl":"Base URL 必须是绝对的 HTTP(S) URL。","settings.models.editModal.srTitle":"编辑模型","settings.models.editModal.title":"编辑模型覆盖项","settings.models.editModal.close":"关闭编辑模型","settings.models.editModal.displayName":"显示名称","settings.models.editModal.replaceApiKey":"替换服务商 API Key","settings.models.editModal.replaceApiKeyPlaceholder":"留空则保留当前凭据","settings.models.editModal.baseUrlOverride":"Base URL 覆盖","settings.models.editModal.baseUrlPlaceholder":"留空则使用默认端点","settings.models.editModal.streamIdleTimeout":"流空闲超时(ms)","settings.models.editModal.save":"保存","settings.models.editModal.saving":"正在保存…","settings.models.editModal.streamIdleTimeoutError":"流空闲超时必须至少为 1000ms。","settings.models.editModal.credentialError":"更新服务商凭据失败","settings.models.editProvider.title":"编辑服务商渠道","settings.models.editProvider.close":"关闭编辑服务商","settings.models.editProvider.channelName":"渠道名称","settings.models.editProvider.channelNameRequired":"渠道名称不能为空","settings.models.editProvider.wireApi":"Wire API","settings.models.editProvider.baseUrl":"Base URL","settings.models.editProvider.baseUrlAria":"服务商 Base URL","settings.models.editProvider.invalidBaseUrl":"Base URL 必须是绝对的 HTTP(S) URL。","settings.models.editProvider.apiKeyEnv":"API Key 环境变量","settings.models.editProvider.apiKeyEnvPlaceholder":"可选,例如 TEAM_GATEWAY_API_KEY","settings.models.editProvider.replaceApiKey":"替换 API Key","settings.models.editProvider.apiKeyAria":"服务商 API Key","settings.models.editProvider.apiKeyPlaceholder":"留空则保留当前凭据","settings.models.editProvider.save":"保存渠道","settings.models.editProvider.saving":"正在保存…","settings.style.auto":"自动","settings.style.pragmatic":"务实","settings.style.friendly":"友好","settings.style.explanatory":"解释型","mcp.status.connected":"已连接","mcp.status.connecting":"连接中...","mcp.status.reconnecting":"恢复中...","mcp.status.offline":"离线","mcp.status.error":"错误","mcp.status.recoveringAttempt":"恢复中 {attempt}/{max}","mcp.oauth.status.disabled":"未配置","mcp.oauth.status.unavailable":"当前运行时不可用","mcp.oauth.status.unauthenticated":"需要授权","mcp.oauth.status.authorizing":"等待授权...","mcp.oauth.status.authenticated":"已授权","mcp.oauth.status.error":"授权失败","mcp.catalog.tag.official":"官方","mcp.catalog.tag.popular":"热门","mcp.catalog.tag.community":"社区","mcp.action.refreshServers":"刷新 MCP 服务器","mcp.action.addServer":"添加服务器","mcp.action.close":"关闭 MCP","mcp.action.dismiss":"忽略","mcp.action.retry":"重试","mcp.action.disconnect":"断开连接","mcp.action.disconnecting":"断开中...","mcp.action.stopRecovery":"停止恢复","mcp.action.connect":"连接","mcp.action.connecting":"连接中...","mcp.action.authorizeFirst":"请先授权","mcp.action.delete":"删除","mcp.action.cancel":"取消","mcp.action.deleting":"删除中...","mcp.action.deleteServer":"删除服务器","mcp.tab.installed":"已安装 ({count})","mcp.tab.catalog":"目录","mcp.servers.title":"服务器","mcp.servers.searchAria":"搜索已安装的 MCP 服务器","mcp.servers.searchPlaceholder":"搜索服务器...","mcp.servers.loading":"正在加载服务器...","mcp.servers.noMatch":"没有匹配的服务器","mcp.servers.none":"尚未配置 MCP 服务器","mcp.server.errorLabel":"错误:{error}","mcp.server.deleteAria":"删除 {name}","mcp.server.selectPrompt":"选择一个服务器以查看详情","mcp.instructions.title":"服务器说明","mcp.instructions.detailsOmittedByPolicy":"[详情已根据运行时策略省略]","mcp.instructions.detailsOmitted":"详情已省略","mcp.instructions.truncated":"已截断至安全显示上限","mcp.tasks.title":"实验性 MCP 任务","mcp.tasks.summary":"每会话 {count} 个 · {interval}ms 轮询","mcp.tasks.disabledByDefault":"默认禁用","mcp.tasks.enabled":"已启用","mcp.tasks.disabled":"已禁用","mcp.oauth.signingOut":"登出中...","mcp.oauth.signOut":"登出","mcp.oauth.continueAuthorization":"继续授权","mcp.oauth.resumeAuthorization":"恢复授权","mcp.oauth.opening":"打开中...","mcp.oauth.authorize":"授权","mcp.delete.confirm":"移除此服务器及其已保存的配置?","mcp.tools.title":"工具 ({count})","mcp.tools.none":"暂无可用工具","mcp.completion.title":"参数补全","mcp.completion.connectPrompt":"连接服务器后即可请求补全建议","mcp.completion.unsupported":"该服务器未声明支持 MCP 补全","mcp.completion.noTargets":"没有可补全的提示词参数或模板变量","mcp.completion.targetAria":"MCP 补全目标","mcp.completion.partialAria":"MCP 补全的部分值","mcp.completion.partialPlaceholder":"部分值","mcp.completion.completing":"补全中...","mcp.completion.complete":"补全","mcp.completion.suggestionsAria":"MCP 补全建议","mcp.completion.empty":"[空]","mcp.completion.noSuggestions":"暂无建议","mcp.meta.truncatedSuffix":" · 已截断","mcp.meta.detailsOmittedSuffix":" · 详情已省略","mcp.diagnostics.title":"诊断","mcp.diagnostics.refreshAria":"刷新 {name} 的 MCP 日志","mcp.diagnostics.logsAria":"{name} 的 MCP 日志","mcp.log.levelAria":"MCP 日志级别","mcp.log.setting":"设置中...","mcp.log.loading":"正在加载日志...","mcp.log.none":"未捕获到日志","mcp.catalog.searchAria":"搜索 MCP 服务器目录","mcp.catalog.searchPlaceholder":"在 npm 上搜索 MCP 服务器(至少 3 个字符)...","mcp.catalog.retry":"重试加载目录","mcp.catalog.noDescription":"暂无描述","mcp.catalog.byAuthor":"作者 {author}","mcp.catalog.installed":"已安装","mcp.catalog.installing":"安装中...","mcp.catalog.install":"安装","mcp.catalog.noPackages":"未找到任何包","mcp.catalog.noMore":"没有更多包了","mcp.catalog.packagesFound":"找到 {count} 个包","mcp.catalog.browseGlama":"在 Glama 上浏览更多","mcp.error.connectFailed":"连接服务器失败","mcp.error.disconnectFailed":"断开服务器失败","mcp.error.deleteFailed":"删除服务器失败","mcp.error.loginFailed":"MCP OAuth 登录失败","mcp.error.logoutFailed":"MCP OAuth 登出失败","mcp.error.loggingLevelFailed":"设置 MCP 日志级别失败","mcp.error.completionFailed":"MCP 补全失败","mcp.add.title":"添加 MCP 服务器","mcp.add.closeAria":"关闭添加 MCP 服务器","mcp.add.modeForm":"表单","mcp.add.jsonConfig":"JSON 配置","mcp.add.jsonConfigAria":"JSON 配置","mcp.add.serverName":"服务器名称","mcp.add.command":"命令","mcp.add.commandAria":"服务器命令","mcp.add.argsLabel":"参数(空格分隔)","mcp.add.argsAria":"服务器参数","mcp.add.invalidJson":"请输入包含服务器名称和传输方式的有效 JSON。","mcp.add.nameCommandRequired":"名称和命令为必填项。","mcp.add.adding":"添加中...","mcp.add.submit":"添加服务器","mcp.install.title":"安装 MCP 服务器","mcp.install.titleWithName":"安装 {name}","mcp.install.closeAria":"关闭 MCP 安装","mcp.install.args":"参数","mcp.install.commandPreview":"命令:npx {args}","mcp.install.nameRequired":"服务器名称为必填项。","skills.title":"技能","skills.action.install":"安装技能","skills.action.installShort":"安装","skills.action.refreshAria":"刷新技能","skills.action.closeAria":"关闭技能","skills.action.dismiss":"忽略","skills.action.retry":"重试","skills.action.cancel":"取消","skills.action.close":"关闭","skills.action.hide":"隐藏","skills.action.enable":"启用","skills.action.disable":"禁用","skills.action.saving":"保存中…","skills.status.enabled":"已启用","skills.status.disabled":"已禁用","skills.status.installed":"已安装","skills.noDescriptionShort":"暂无描述","skills.noDescription":"暂无可用描述","skills.installed.title":"已安装","skills.installed.searchAria":"搜索已安装的技能","skills.installed.searchPlaceholder":"搜索技能…","skills.installed.loading":"正在加载技能…","skills.installed.noMatch":"没有匹配的技能","skills.installed.empty":"尚未安装任何技能","skills.uninstall.managedHint":"仅可卸载 Blade 用户技能","skills.uninstall.managed":"受管理","skills.uninstall.action":"卸载","skills.uninstall.confirmAria":"卸载 {name}","skills.uninstall.confirmPrompt":"从 ~/.blade/skills 中移除此技能?","skills.uninstall.inProgress":"正在卸载…","skills.uninstall.confirm":"卸载技能","skills.details.title":"详情","skills.details.provider":"提供方","skills.details.location":"位置","skills.details.capabilities":"能力","skills.details.allowedTools":"允许的工具({count})","skills.detail.emptyState":"选择一个技能以查看详情","skills.install.title":"安装技能","skills.install.closeAria":"关闭技能安装","skills.install.tab.catalog":"目录","skills.install.tab.repo":"仓库","skills.install.tab.local":"本地","skills.install.catalog.searchAria":"搜索技能目录","skills.install.catalog.searchPlaceholder":"搜索目录…","skills.install.catalog.loading":"正在加载目录…","skills.install.catalog.empty":"未找到技能","skills.install.catalog.byAuthor":"作者:{author}","skills.install.catalog.tag.official":"官方","skills.install.catalog.tag.popular":"热门","skills.install.catalog.tag.community":"社区","skills.install.repo.label":"GitHub URL","skills.install.repo.inputAria":"技能仓库地址","skills.install.repo.credentialsHint":"使用 Blade 进程可用的 Git 凭据","skills.install.local.label":"本地路径","skills.install.local.inputAria":"本地技能路径","skills.status.dialogTitle":"安装状态","skills.status.confirm.title":"确认安装","skills.status.confirm.prompt":"安装所选技能?","skills.status.installing.title":"正在安装","skills.status.installing.description":"正在下载并校验…","skills.status.failed.title":"安装失败","skills.status.failed.fallback":"安装失败。","skills.status.failed.hint":"请检查访问权限后重试。","skills.error.deleteFailed":"删除技能失败","skills.error.toggleFailed":"切换技能状态失败","skills.error.installFailed":"安装技能失败","schedule.title":"定时任务","schedule.description":"按 cron、间隔或一次性触发器自动运行无界面任务提示词。","schedule.new":"新建定时任务","schedule.newAria":"创建新的定时任务","schedule.refresh":"刷新","schedule.reloadAria":"重新加载定时任务","schedule.create":"创建","schedule.save":"保存","schedule.cancel":"取消","schedule.confirmDelete":"确认?","schedule.empty":"暂无定时任务","schedule.enabled":"已启用","schedule.disabled":"已禁用","schedule.never":"从未","schedule.nextRun":"下次运行","schedule.lastRun":"上次运行","schedule.runCount":"已运行 {count} 次","schedule.trigger.kindAria":"触发器类型","schedule.trigger.cron":"Cron","schedule.trigger.interval":"间隔","schedule.trigger.once":"一次性","schedule.field.title":"标题(可选)","schedule.field.cron":"Cron 表达式","schedule.field.interval":"间隔","schedule.field.runAt":"运行时间","schedule.field.prompt":"提示词","schedule.field.project":"项目路径","schedule.field.model":"模型(可选)","schedule.field.permissionMode":"权限模式","schedule.field.isolation":"隔离方式","schedule.placeholder.title":"每晚依赖审查","schedule.placeholder.cron":"0 9 * * 1 (分 时 日 月 周)","schedule.placeholder.interval":"30m / 2h / 1d","schedule.placeholder.prompt":"描述要运行的任务…","schedule.placeholder.project":"/path/to/project","schedule.placeholder.model":"例如 anthropic/claude-sonnet","schedule.model.current":"使用当前模型","schedule.permission.default":"默认","schedule.permission.autoEdit":"自动编辑","schedule.permission.yolo":"Yolo","schedule.permission.plan":"规划","schedule.isolation.local":"本地","schedule.isolation.worktree":"工作树","schedule.cadence.cron":"cron:{expr}","schedule.cadence.interval":"每 {interval}","schedule.cadence.once":"于 {time} 运行一次","schedule.status.queued":"排队中","schedule.status.running":"运行中","schedule.status.completed":"已完成","schedule.status.failed":"失败","schedule.status.cancelled":"已取消","schedule.status.interrupted":"已中断","schedule.status.error":"出错","schedule.status.never":"尚未运行","schedule.runNowAria":"立即运行“{title}”","schedule.editAria":"编辑“{title}”","schedule.deleteAria":"删除“{title}”","schedule.enableAria":"启用“{title}”","schedule.disableAria":"禁用“{title}”","schedule.error.promptRequired":"提示词不能为空。","schedule.error.projectRequired":"项目路径不能为空。","schedule.error.cronRequired":"Cron 表达式不能为空。","schedule.error.invalidInterval":"请输入类似 30m、2h 或 1d 的间隔。","schedule.error.runAtRequired":"请选择有效的运行时间。","schedule.error.loadFailed":"加载定时任务失败。","schedule.error.createFailed":"创建定时任务失败。","schedule.error.updateFailed":"更新定时任务失败。","schedule.error.deleteFailed":"删除定时任务失败。","schedule.error.toggleFailed":"切换定时任务状态失败。","schedule.error.runFailed":"运行定时任务失败。"},aw=["en","zh"],Wa={en:iw,zh:ow},Gp="blade-ui-locale",Zc=typeof window<"u"&&typeof document<"u";function cw(){var e,t;if(Zc){try{const r=(e=window.localStorage)==null?void 0:e.getItem(Gp);if(r==="en"||r==="zh")return r}catch{}return(typeof navigator<"u"&&(navigator.language||((t=navigator.languages)==null?void 0:t[0]))||"").toLowerCase().startsWith("zh")?"zh":"en"}return"en"}let Gr=cw();const uc=new Set;function lw(){for(const e of uc)e()}function j3(){return Gr}function dw(e){var t;if(e!==Gr){if(Gr=e,Zc){try{(t=window.localStorage)==null||t.setItem(Gp,e)}catch{}document!=null&&document.documentElement&&(document.documentElement.lang=e==="zh"?"zh-CN":"en")}lw()}}function Vp(e){return uc.add(e),()=>uc.delete(e)}function uw(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>{const s=t[r];return s==null?n:String(s)}):e}function Ke(e,t){const r=(Wa[Gr]??Wa.en)[e]??Wa.en[e];return uw(r,t)}function Ut(){return y.useSyncExternalStore(Vp,()=>Gr,()=>"en"),Ke}function pw(){return{locale:y.useSyncExternalStore(Vp,()=>Gr,()=>"en"),setLocale:dw}}Zc&&(document!=null&&document.documentElement)&&(document.documentElement.lang=Gr==="zh"?"zh-CN":"en");function kt(e,t){return{...e,...t}}function Br(e,t,n){return e>=t&&e<=n}function fw(e){return e===8205}function mw(e){return Br(e,55296,56319)}function Su(e){return Br(e,127462,127487)}function Wp(e){return Br(e,65024,65039)}function Jp(e){return Br(e,768,879)||Br(e,6832,6911)||Br(e,7616,7679)||Br(e,65056,65071)}function Co(e){return e>65535?2:1}function ju(e,t){for(;t<e.length;){const n=e.codePointAt(t);if(Jp(n)||Wp(n))t+=Co(n);else break}return t}function Xc(e,t){const n=e.codePointAt(t);let r=t+Co(n);for(r=ju(e,r);r<e.length-1&&e[r]==="‍";){const s=e.codePointAt(r+1);r+=1+Co(s),r=ju(e,r)}return Su(n)&&r<e.length&&Su(e.codePointAt(r))&&(r+=Co(e.codePointAt(r))),r}function Qp(e){return mw(e)||Jp(e)||Wp(e)||fw(e)}function hw(e){let t=0,n=0;for(;n<e.length;)n=Xc(e,n),t++;return t}function gw(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=Xc(e,r),n++,n>=t)return!0;return!1}function bw(e,t){let n=0,r=0;for(;r<e.length;)if(r=Xc(e,r),n++,n>t)return!1;return!0}function kw(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Qp(e.charCodeAt(n)))return gw(e,t);if(n++,n>=t)return!0}return!1}function xw(e,t){let n=0;for(;n<e.length;){if(Qp(e.charCodeAt(n)))return bw(e,t);if(n++,n>t)return!1}return!0}function z(e){return Array.isArray(e)}function st(e){return g(typeof e,"bigint")}function xt(e){return g(typeof e,"boolean")}function na(e){if(Fe(e)||!Tn(e))return!1;const t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Tn(e){return g(typeof e,"function")}function el(e){return Number.isInteger(e)}function Xt(e){return g(e,null)}function Ie(e){return Number.isFinite(e)}function kn(e){return re(e)&&!z(e)}function re(e){return g(typeof e,"object")&&!Xt(e)}function pe(e){return g(typeof e,"string")}function tl(e){return g(typeof e,"symbol")}function Fe(e){return g(e,void 0)}function g(e,t){return e===t}function ts(e,t){return e>t}function Si(e,t){return e<t}function ir(e,t){return e<=t}function Rs(e,t){return e>=t}function Yp(e,t){if(st(e)||st(t))return BigInt(e)%BigInt(t)===0n;const n=1e-10;if(!Ie(e)||el(e)&&1/t%1===0)return!0;const r=e%t;return Math.min(Math.abs(r),Math.abs(r-t),Math.abs(r+t))<n}function Zp(e){if(!re(e))return!1;const t=globalThis.Object.getPrototypeOf(e);return Xt(t)?!1:g(typeof t.constructor,"function")&&!(g(t.constructor,globalThis.Object)||g(t.constructor.name,"Object"))}function Ms(e){return st(e)||xt(e)||Xt(e)||Ie(e)||pe(e)||Fe(e)}function yw(e){return hw(e)}function Xp(e,t){return xw(e,t)}function ef(e,t){return kw(e,t)}function ht(e,t,n){for(let r=t;r<e.length;r++)if(!n(e[r],r))return!1;return!0}function Pt(e,t,n){let r=!0;for(let s=t;s<e.length;s++)n(e[s],s)||(r=!1);return r}function $s(e,t){for(let n=0;n<e.length;n++)if(t(e[n],n))return!0;return!1}function tf(e,t){let n=!1;for(let r=0;r<e.length;r++)t(e[r],r)&&(n=!0);return n}function nl(e,t){return e.reduce((n,r,s)=>t(r,s)?++n:n,0)}function Ae(e,t,n){return g(e.length,0)?n():t(e[0],e.slice(1))}function er(e){return g(e,"__proto__")||g(e,"constructor")||g(e,"prototype")}function E(e,t){return er(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function rl(e){return U(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function it(e){return Object.entries(e)}function U(e){return Object.getOwnPropertyNames(e)}function sl(e){return Object.getOwnPropertySymbols(e)}function il(e){return Object.values(e)}function ww(e,t){if(!re(t))return!1;const n=U(e);return g(n.length,U(t).length)&&n.every(r=>ns(e[r],t[r]))}function vw(e,t){return z(t)&&g(e.length,t.length)&&e.every((n,r)=>ns(e[r],t[r]))}function ns(e,t){return z(e)?vw(e,t):re(e)?ww(e,t):g(e,t)}const Mo=Object.freeze(Object.defineProperty({__proto__:null,Counted:nl,Entries:it,EntriesRegExp:rl,Every:ht,EveryAll:Pt,GraphemeCount:yw,HasPropertyKey:E,IsArray:z,IsBigInt:st,IsBoolean:xt,IsClassInstance:Zp,IsConstructor:na,IsDeepEqual:ns,IsEqual:g,IsFunction:Tn,IsGreaterEqualThan:Rs,IsGreaterThan:ts,IsInteger:el,IsLessEqualThan:ir,IsLessThan:Si,IsMaxLength:Xp,IsMinLength:ef,IsMultipleOf:Yp,IsNull:Xt,IsNumber:Ie,IsObject:re,IsObjectNotArray:kn,IsString:pe,IsSymbol:tl,IsUndefined:Fe,IsUnsafePropertyKey:er,IsValueLike:Ms,Keys:U,ShiftLeft:Ae,Some:$s,SomeAll:tf,Symbols:sl,Values:il},Symbol.toStringTag,{value:"Module"})),Sw=/^[\p{ID_Start}_$][\p{ID_Continue}_$\u200C\u200D]*$/u;function jw(e){return Sw.test(e)}function Ct(e,t){return`(${e} && ${t})`}function Ge(e,t){return`(${e} || ${t})`}function $t(e){return`!(${e})`}function $o(e){return`Array.isArray(${e})`}function nf(e){return`typeof ${e} === "bigint"`}function Iw(e){return`typeof ${e} === "boolean"`}function Cw(e){return`Number.isInteger(${e})`}function Ew(e){return`${e} === null`}function rf(e){return`Number.isFinite(${e})`}function sf(e){return Ct(of(e),$t($o(e)))}function of(e){return`typeof ${e} === "object" && ${e} !== null`}function af(e){return`typeof ${e} === "string"`}function Tw(e){return`typeof ${e} === "symbol"`}function pc(e){return`${e} === undefined`}function Aw(e){return`typeof ${e} === "function"`}function Pw(e){return`Guard.IsConstructor(${e})`}function Zt(e,t){return`${e} === ${t}`}function cf(e,t){return`${e} > ${t}`}function ol(e,t){return`${e} < ${t}`}function rs(e,t){return`${e} <= ${t}`}function ji(e,t){return`${e} >= ${t}`}function Nw(e,t){return`Guard.IsMinLength(${e}, ${t})`}function Ow(e,t){return`Guard.IsMaxLength(${e}, ${t})`}function qn(e,t,n,r){return g(t,"0")?`${e}.every((${n[0]}, ${n[1]}) => ${r})`:`((value, callback) => { for(let index = ${t}; index < value.length; index++) if (!callback(value[index], index)) return false; return true })(${e}, (${n[0]}, ${n[1]}) => ${r})`}function Rw(e,t,n){return`${e}.some((${t[0]}, ${t[1]}) => ${n})`}function Mw(e,t,n){return`((value, callback) => { let result = false; for(let index = 0; index < value.length; index++) if (callback(value[index], index)) result = true; return result })(${e}, (${t[0]}, ${t[1]}) => ${n})`}function ra(e,t,n){return`${e}.reduce((result, ${t[0]}, ${t[1]}) => (${n}) ? ++result : result, 0)`}function lf(e){return`Object.entries(${e})`}function ss(e){return`Object.getOwnPropertyNames(${e})`}function Vr(e,t){return g(t,'"__proto__"')||g(t,'"constructor"')?`Object.prototype.hasOwnProperty.call(${e}, ${t})`:`${t} in ${e}`}function df(e,t){return`Guard.IsDeepEqual(${e}, ${t})`}function $w(e){return`[${e.join(", ")}]`}function xr(e,t){return`((${e.join(", ")}) => ${t})`}function Ve(e,t){return`${e}(${t.join(", ")})`}function al(e,t){return`new ${e}(${t.join(", ")})`}function ke(e,t){return`${e}${jw(t)?`.${t}`:`[${V(t)}]`}`}function V(e){if(!Ms(e))throw Error("Unsupported Constant");return pe(e)?JSON.stringify(e):`${e}`}function Fw(e,t,n){return`(${e} ? ${t} : ${n})`}function sa(e){return`{ ${e.join("; ")}; }`}function tr(e,t){return`const ${e} = ${t}`}function uf(e,t){return`if(${e}) { ${t} }`}function ia(e){return`return ${e}`}function Tt(e){return g(e.length,0)?"true":e.reduce((t,n)=>Ct(t,n))}function cl(e){return g(e.length,0)?"false":e.reduce((t,n)=>Ge(t,n))}function Lw(e,t){return`Guard.IsMultipleOf(${e}, ${t})`}function Dw(e){return e instanceof Boolean}function _w(e){return e instanceof Number}function Uw(e){return e instanceof String}function Ii(e){return globalThis.ArrayBuffer.isView(e)}function pf(e){return e instanceof globalThis.RegExp}function ff(e){return e instanceof globalThis.Date}function mf(e){return e instanceof globalThis.Set}function hf(e){return e instanceof globalThis.Map}function Bw(e){return E(e,"~kind")||E(e,"~unsafe")}function Hw(e){const t={},n=Object.getOwnPropertyDescriptors(e);for(const r of Object.keys(n)){if(er(r))continue;const s=n[r];E(s,"value")&&Object.defineProperty(t,r,{...s,value:Wr(s.value)})}return t}function qw(e){const t={};for(const n of U(e))er(n)||(t[n]=Wr(e[n]));for(const n of sl(e))t[n]=Wr(e[n]);return t}function zw(e){return Zp(e)?e:Bw(e)?Hw(e):qw(e)}function Kw(e){return e.map(t=>Wr(t))}function Gw(e){return e.slice()}function Vw(e){return new RegExp(e.source,e.flags)}function Ww(e){return new Map(Wr([...e.entries()]))}function Jw(e){return new Set(Wr([...e.values()]))}function Wr(e){return Ii(e)?Gw(e):pf(e)?Vw(e):hf(e)?Ww(e):mf(e)?Jw(e):z(e)?Kw(e):re(e)?zw(e):e}function ll(e){return Wr(e)}const Qw={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Ci(){return Qw}function Yw(e,t){for(const n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Zw(e,t){return{...e,...t}}function we(e,t,n={}){const r=Zw(t,n);return Yw(r,e)}function Mn(e,t){const n={},r=Object.getOwnPropertyDescriptors(ll(e)),s=new Set(t);for(const i of Object.keys(r))s.has(i)||Object.defineProperty(n,i,r[i]);return n}function xe(e,t,n){const r=Ci(),s=ll(e);for(const i of Object.keys(t))Object.defineProperty(s,i,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[i]});for(const i of Object.keys(n))Object.defineProperty(s,i,{configurable:!0,enumerable:!0,writable:!0,value:n[i]});return s}function Ce(e,t){return re(e)&&E(e,"~kind")&&g(e["~kind"],t)}function an(e){return re(e)}function Oe(e,t,n){return we({"~kind":"Deferred"},{type:"deferred",action:e,parameters:t,options:n},{})}function Ps(e){return Ce(e,"Deferred")}function Xw(e){return xe(e,{"~readonly":!0},{})}function dl(e,t){return xe(Xw(e),{},t)}function ev(e,t,n,r){const s=W(e,t,n);return dl(s,r)}function tv(e){return xe(e,{"~optional":!0},{})}function ul(e,t){return xe(tv(e),{},t)}function nv(e,t,n,r){const s=W(e,t,n);return ul(s,r)}function Ir(e,t){return we({"~kind":"Array"},{type:"array",items:e},t)}function gt(e){return Ce(e,"Array")}function pl(e){return Mn(e,["~kind","type","items"])}function Ei(e,t,n={}){return we({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},n)}function xn(e){return Ce(e,"Constructor")}function rv(e){return Mn(e,["~kind","type","parameters","instanceType"])}function Ti(e,t,n={}){return we({"~kind":"Function"},{type:"function",parameters:e,returnType:t},n)}function yn(e){return Ce(e,"Function")}function sv(e){return Mn(e,["~kind","type","parameters","returnType"])}function gn(e,t){return we({"~kind":"Ref"},{$ref:e},t)}function vt(e){return Ce(e,"Ref")}function Ai(e,t){return we({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function fl(e){return Ce(e,"Generic")}function ml(e){return we({"~kind":"Any"},{},e)}function $n(e){return Ce(e,"Any")}const iv="(?!)";function Nt(e){return we({"~kind":"Never"},{not:{}},e)}function Fs(e){return Ce(e,"Never")}function nr(e,t={}){return Oe("AddOptional",[e],t)}function Fo(e,t={}){return ul(e,t)}function ov(e){return Fo(e)}function cn(e){return an(e)&&E(e,"~optional")}function av(e){return U(e).filter(t=>!cn(e[t]))}function gf(e){return U(e)}function bf(e){return il(e)}function $e(e,t={}){const n=av(e),r=n.length>0?{required:n}:{};return we({"~kind":"Object"},{type:"object",...r,properties:e},t)}function Ue(e){return Ce(e,"Object")}function cv(e){return Mn(e,["~kind","type","properties","required"])}function Kt(e){return we({"~kind":"Unknown"},{},e)}function An(e){return Ce(e,"Unknown")}function Pi(e,t,n){const r=U(e).reduce((s,i)=>({...s,[i]:xe(e[i],{},{$id:i})}),{});return we({"~kind":"Cyclic"},{$defs:r,$ref:t},n)}function Gt(e){return Ce(e,"Cyclic")}function lv(e){return xe(e,{"~unsafe":null},{})}function kf(e){return kn(e)&&E(e,"~unsafe")&&Xt(e["~unsafe"])}function ut(e,t){var n;return((n=t[e.length])==null?void 0:n.call(t,...e))??(()=>{throw Error("Invalid Arguments")})()}function fc(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s,s],1:r=>[r,Kt(),Kt()]});return we({"~kind":"Infer"},{type:"infer",name:t,extends:n},{})}function ln(e){return Ce(e,"Infer")}function Lo(e,t,n,r={}){return we({"~kind":"Dependent"},{if:e,then:t,else:n},r)}function wn(e){return Ce(e,"Dependent")}function dv(e){return Mn(e,["~kind","if","then","else"])}function uv(e){return kn(e)}function pv(e){return U(e).filter(n=>isNaN(n)).reduce((n,r)=>[...n,e[r]],[])}function fv(e){return pe(e)||Ie(e)}function mv(e,t){const n=uv(e)?pv(e):e;return we({"~kind":"Enum"},{enum:n},t)}function vn(e){return Ce(e,"Enum")}function Hn(e,t={}){return we({"~kind":"Intersect"},{allOf:e},t)}function Be(e){return Ce(e,"Intersect")}function hv(e){return Mn(e,["~kind","allOf"])}let Ja;function gv(){try{return yf("null")(),!0}catch{return!1}}function xf(){return Fe(Ja)&&(Ja=gv()),Ja&&Ci().useAcceleration}function yf(...e){return new globalThis.Function(...e)}function Ft(){throw new Error("Unreachable")}function bv(e){const t=new Set;let n=e;for(;n&&n!==Object.prototype;){for(const r of Reflect.ownKeys(n))r!=="constructor"&&typeof r!="symbol"&&t.add(r);n=Object.getPrototypeOf(n)}return[...t]}function kv(e){return typeof e=="number"}var Lt;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(Lt||(Lt={}));let Es=BigInt("14695981039346656037");const[xv,yv]=[BigInt("1099511628211"),BigInt("18446744073709551616")],wv=Array.from({length:256}).map((e,t)=>BigInt(t)),wf=new Float64Array(1),vf=new DataView(wf.buffer),Sf=new Uint8Array(wf.buffer);function St(e){Es=Es^wv[e],Es=Es*xv%yv}function vv(e){St(Lt.Array);for(const t of e)yr(t)}function Sv(e){St(Lt.BigInt),vf.setBigInt64(0,e);for(const t of Sf)St(t)}function Iu(e){St(Lt.Boolean),St(e?1:0)}function jv(e){St(Lt.Constructor),yr(e.toString())}function Iv(e){St(Lt.Date),yr(e.getTime())}function Cv(e){St(Lt.Function),yr(e.toString())}function Ev(e){St(Lt.Null)}function Cu(e){St(Lt.Number),vf.setFloat64(0,e,!0);for(const t of Sf)St(t)}function Tv(e){St(Lt.Object);for(const t of bv(e).sort())yr(t),yr(e[t])}function Av(e){St(Lt.RegExp),mc(e.toString())}const Pv=new TextEncoder;function mc(e){St(Lt.String);for(const t of Pv.encode(e))St(t)}function Nv(e){St(Lt.Symbol),yr(e.toString())}function Ov(e){St(Lt.TypeArray);const t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)St(t[n])}function Rv(e){return St(Lt.Undefined)}function yr(e){return Ii(e)?Ov(e):ff(e)?Iv(e):pf(e)?Av(e):Dw(e)?Iu(e.valueOf()):Uw(e)?mc(e.valueOf()):_w(e)?Cu(e.valueOf()):kv(e)?Cu(e):z(e)?vv(e):xt(e)?Iu(e):st(e)?Sv(e):na(e)?jv(e):Xt(e)?Ev():re(e)?Tv(e):pe(e)?mc(e):tl(e)?Nv(e):Fe(e)?Rv():Tn(e)?Cv(e):Ft()}function jf(e){return Es=BigInt("14695981039346656037"),yr(e),Es}function oa(e){return jf(e).toString(16).padStart(16,"0")}const Mv=Object.freeze(Object.defineProperty({__proto__:null,Hash:oa,HashCode:jf},Symbol.toStringTag,{value:"Module"}));function $v(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}let Fv=$v;function Lv(){return Fv}class If{constructor(t,n){this.type=t,this.decode=n}Encode(t){const n=this.type,r=dn(n)?o=>this.decode(n["~codec"].decode(o)):this.decode,s=dn(n)?o=>n["~codec"].encode(t(o)):t,i={decode:r,encode:s};return xe(this.type,{"~codec":i},{})}}class Cf{constructor(t){this.type=t}Decode(t){return new If(this.type,t)}}function hl(e){return new Cf(e)}function Dv(e,t){return hl(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function _v(e,t){return hl(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function dn(e){return an(e)&&E(e,"~codec")&&re(e["~codec"])&&E(e["~codec"],"encode")&&E(e["~codec"],"decode")}function Uv(e){return rd(e)}function Do(e){return an(e)&&E(e,"~immutable")}function rr(e,t={}){return Oe("AddReadonly",[e],t)}function _o(e,t={}){return dl(e,t)}function Bv(e){return _o(e)}function Uo(e){return an(e)&&E(e,"~readonly")}function Hv(e,t){const n=gl(e)?[...e["~refine"],t]:[t];return xe(e,{"~refine":n},{})}function qv(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[s,i,()=>"Refine Error"]});return Hv(t,{check:n,error:r})}function zv(e){return kn(e)&&E(e,"check")&&E(e,"error")&&Tn(e.check)&&Tn(e.error)}function gl(e){return an(e)&&E(e,"~refine")&&z(e["~refine"])&&ht(e["~refine"],0,t=>zv(t))}const Kv="-?(?:0|[1-9][0-9]*)n";function bl(e){return we({"~kind":"BigInt"},{type:"bigint"},e)}function is(e){return Ce(e,"BigInt")}function Ef(e){return we({"~kind":"Boolean"},{type:"boolean"},e)}function Cr(e){return Ce(e,"Boolean")}function hc(e){return we({"~kind":"Identifier"},{name:e})}function Gv(e){return Ce(e,"Identifier")}const Tf="-?(?:0|[1-9][0-9]*)";function aa(e){return we({"~kind":"Integer"},{type:"integer"},e)}function zn(e){return Ce(e,"Integer")}class Vv extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}}function Wv(e){return st(e)?"bigint":xt(e)?"boolean":Ie(e)?"number":pe(e)?"string":(()=>{throw new Vv(e)})()}function De(e,t){return we({"~kind":"Literal"},{type:Wv(e),const:e},t)}function Af(e){return st(e)||xt(e)||Ie(e)||pe(e)}function Jv(e){return Qe(e)&&st(e.const)}function Qv(e){return Qe(e)&&xt(e.const)}function Pf(e){return Qe(e)&&Ie(e.const)}function Nf(e){return Qe(e)&&pe(e.const)}function Qe(e){return Ce(e,"Literal")}function kl(e){return we({"~kind":"Null"},{type:"null"},e)}function Ni(e){return Ce(e,"Null")}const Of="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function wr(e){return we({"~kind":"Number"},{type:"number"},e)}function pn(e){return Ce(e,"Number")}function xl(e){return we({"~kind":"Symbol"},{type:"symbol"},e)}function Oi(e){return Ce(e,"Symbol")}function Ri(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[s,i,i],1:s=>[s,Kt(),Kt()]});return we({"~kind":"Parameter"},{name:t,extends:n,equals:r},{})}function Yv(e){return Ce(e,"Parameter")}const Rf=".*";function Kn(e){return we({"~kind":"String"},{type:"string"},e)}function Fn(e){return Ce(e,"String")}function Je(e,t={}){return we({"~kind":"Union"},{anyOf:e},t)}function fe(e){return Ce(e,"Union")}function Zv(e){return Mn(e,["~kind","anyOf"])}function Mf(e){const t=$C(e);return g(t.length,2)?t[0]:[]}function Xv(e){return!0}function $f(e){return Ae(e,(t,n)=>eS(t)?$f(n):!1,()=>!0)}function Ff(e){return g(e.length,0)?!1:$f(e)}function eS(e){return fe(e)?Ff(e.anyOf):Qe(e)?Xv(e.const):!1}function Lf(e){return Ff(e)}function Df(e){return we({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function _f(e,t,n=[]){return Ae(e,(r,s)=>_f(s,t,[...n,`${r}${t}`]),()=>n)}function tS(e,t){return g(e.length,0)?[`${t}`]:_f(e,t)}function Uf(e,t,n=[]){return Ae(t,(r,s)=>Uf(e,s,[...n,...Bf(e,r)]),()=>n)}function Bf(e,t){return fe(t)?Uf(e,t.anyOf):Qe(t)?tS(e,t.const):Ft()}function Hf(e,t){return Ae(t,(n,r)=>Hf(Bf(e,n),r),()=>e)}function nS(e){return e.map(t=>De(t))}function rS(e){const t=Hf([],e),n=nS(t);return Je(n)}function sS(e){return g(e.length,0)?Ft():g(e.length,1)&&Qe(e[0])?e[0]:rS(e)}function qf(e){const t=Mf(e);return g(t.length,0)?Kn():Lf(t)?sS(t):Df(e)}function yl(e){const t=qf(e);return Wt(t)?Kn():t}function vr(e,t){const n="object",r={[e]:t};return we({"~kind":"Record"},{type:n,patternProperties:r})}function iS(e){return vr(Qr,e)}function oS(e){return $e({true:e,false:e})}function Sn(e,t={}){const[n,r,s]=[e,e.length,!1];return we({"~kind":"Tuple"},{type:"array",additionalItems:s,items:n,minItems:r},t)}function at(e){return Ce(e,"Tuple")}function aS(e){return Mn(e,["~kind","type","items","minItems","additionalItems"])}function cS(e){return Mn(e,["~readonly"])}function zf(e,t){return xe(cS(e),{},t)}function lS(e,t,n,r){const s=W(e,t,n);return zf(s,r)}function dS(e,t={}){return Oe("RemoveReadonly",[e],t)}function uS(e,t={}){return zf(e,t)}function pS(e){return Mn(e,["~optional"])}function Kf(e,t){return xe(pS(e),{},t)}function fS(e,t,n,r){const s=W(e,t,n);return Kf(s,r)}function mS(e,t={}){return Oe("RemoveOptional",[e],t)}function Gf(e,t={}){return Kf(e,t)}function Vf(e){return e.reduceRight((n,r,s)=>({[s]:r,...n}),{})}function hS(e){const t=Vf(e.items);return $e(t)}function gS(e,t){return Uo(e)?!!Uo(t):!1}function bS(e,t){return cn(e)?!!cn(t):!1}function kS(e,t){const n=gS(e,t),r=bS(e,t),s=fn([e,t]),i=uS(Gf(s));return n&&r?_o(Fo(i)):n&&!r?_o(i):!n&&r?Fo(i):i}function xS(e,t,n){return n in e?n in t?kS(e[n],t[n]):e[n]:n in t?t[n]:Nt()}function yS(e,t){return[...new Set([...U(t),...U(e)])].reduce((r,s)=>({...r,[s]:xS(e,t,s)}),{})}function Eu(e){return Ue(e)?e.properties:at(e)?Vf(e.items):Ft()}function wS(e,t){const n=Eu(e),r=Eu(t),s=yS(n,r);return $e(s)}function vS(e,t){const n=ba(e,t);return g(n,zl)?e:g(n,Kl)||g(n,ql)?t:Nt()}function Tu(e){return Ue(e)||at(e)}function SS(e,t){const n=fe(e),r=fe(t);return n||r}function jS(e,t){const n=Jr(e),r=Jr(t),s=SS(n,r),i=Tu(n),o=Tu(r);return s?fn([n,r]):i&&o?wS(n,r):i&&!o?n:!i&&o?r:vS(n,r)}function Wf(e,t,n=[]){return Ae(t,(r,s)=>Wf(e,s,[...n,jS(e,r)]),()=>g(n.length,0)?[e]:n)}function Jf(e,t,n=[]){return Ae(e,(r,s)=>Jf(s,t,[...n,...Bo([r],t)]),()=>n)}function Bo(e,t=[]){return Ae(e,(n,r)=>fe(n)?Bo(r,Jf(n.anyOf,t)):Bo(r,Wf(n,t)),()=>t)}function IS(e,t){const n=sr({},e,t);return Yt(n)?[]:[e]}function CS(e,t){return e.reduce((n,r)=>[...n,...IS(r,t)],[])}function Qf(e,t){const n=Jr(e),r=fe(n)?n.anyOf:[n],s=CS(r,t);return ar(s)}function Ls(e,t,n){const r=Hn([e,t]),s=Qf(n,e);return ar([r,s])}function Er(e){const t=e.map(n=>De(n));return ar(t)}function fn(e){const t=Bo(e),n=mh(t);return Ds(n)}function or(e){const t=yl(e);return Jr(t)}function ar(e){const t=mh(e);return Ds(t)}function Jr(e){return wn(e)?Ls(e.if,e.then,e.else):vn(e)?Er(e.enum):Be(e)?fn(e.allOf):Wt(e)?or(e.pattern):fe(e)?ar(e.anyOf):e}function Ds(e){return g(e.length,1)?e[0]:g(e.length,0)?Nt():Je(e)}function ES(e,t){const n=Er(e);return la(n,t)}function TS(e,t){return vr(Mi,t)}function AS(e,t){const n=fn(e);return la(n,t)}function PS(e,t){return pe(e)||Ie(e)?$e({[e]:t}):g(e,!1)?$e({false:t}):g(e,!0)?$e({true:t}):$e({})}function NS(e,t){return vr(da,t)}function OS(e,t){return E(e,"pattern")&&(pe(e.pattern)||e.pattern instanceof RegExp)?vr(e.pattern.toString(),t):vr(Qr,t)}function RS(e,t){const n=Mf(e);return Lf(n)?la(or(e),t):vr(e,t)}function MS(e){return fe(e)?ca(e.anyOf):[e]}function ca(e){return e.reduce((t,n)=>[...t,...MS(n)],[])}function $S(e){return e.some(t=>Fn(t)||pn(t)||zn(t))}function FS(e,t){return g($S(e),!0)?vr(Qr,t):void 0}function LS(e,t){return e.reduce((n,r)=>Qe(r)&&(pe(r.const)||Ie(r.const))?{...n,[r.const]:t}:n,{})}function DS(e,t){const n=LS(e,t);return $e(n)}function _S(e,t){const n=ca(e),r=FS(n,t);return an(r)?r:DS(n,t)}function la(e,t){return $n(e)?iS(t):Cr(e)?oS(t):vn(e)?ES(e.enum,t):zn(e)?TS(e,t):Be(e)?AS(e.allOf,t):Qe(e)?PS(e.const,t):pn(e)?NS(e,t):fe(e)?_S(e.anyOf,t):Fn(e)?OS(e,t):Wt(e)?RS(e.pattern,t):$e({})}function Yf(e,t,n){return Xe([e])?xe(la(e,t),{},n):Zf(e,t,n)}function US(e,t,n,r,s){const i=W(e,t,n),o=W(e,t,r);return Yf(i,o,s)}const Mi=`^${Tf}$`,da=`^${Of}$`,Qr=`^${Rf}$`;function Zf(e,t,n={}){return Oe("Record",[e,t],n)}function wl(e,t,n={}){return Yf(e,t,n)}function BS(e,t){return vr(e,t)}function gc(e){return g(e,Qr)?Kn():g(e,Mi)?aa():g(e,da)?wr():qf(e)}function jn(e){return U(e.patternProperties)[0]}function ua(e){const t=jn(e);return gc(t)}function Vt(e){return e.patternProperties[jn(e)]}function Ot(e){return Ce(e,"Record")}function pa(e){return we({"~kind":"Rest"},{type:"rest",items:e},{})}function fa(e){return Ce(e,"Rest")}function Xf(e){return we({"~kind":"This"},{$ref:"#"},e)}function em(e){return Ce(e,"This")}function vl(e){return we({"~kind":"Undefined"},{type:"undefined"},e)}function _s(e){return Ce(e,"Undefined")}function tm(e){return we({"~kind":"Void"},{type:"void"},e)}function os(e){return Ce(e,"Void")}function HS(e,t){return g(e,"Array")?Ir(t[0]):g(e,"Capitalize")?xh(t[0]):g(e,"ConstructorParameters")?Ah(t[0]):g(e,"Evaluate")?$P(t[0]):g(e,"Exclude")?Nh(t[0],t[1]):g(e,"Extract")?Oh(t[0],t[1]):g(e,"Index")?Ql(t[0],t[1]):g(e,"InstanceType")?_h(t[0]):g(e,"Lowercase")?yh(t[0]):g(e,"NonNullable")?zh(t[0]):g(e,"Omit")?Gh(t[0],t[1]):g(e,"Parameters")?Jh(t[0]):g(e,"Partial")?Yh(t[0]):g(e,"Pick")?Xh(t[0],t[1]):g(e,"Readonly")?tg(t[0]):g(e,"KeyOf")?ed(t[0]):g(e,"Record")?Zf(t[0],t[1]):g(e,"Required")?sg(t[0]):g(e,"ReturnType")?og(t[0]):g(e,"Uncapitalize")?wh(t[0]):g(e,"Uppercase")?vh(t[0]):Cc(gn(e),t)}function as(){throw Error("Unreachable")}function nm(e,t=[]){return Ae(e,(n,r)=>nm(r,[...t,n[1]]),()=>t)}function cr(e){return g(e.length,3)?[e[0],...nm(e[1])]:[]}function qS(e){return Ri(e[0],e[2],e[4])}function zS(e){return Ri(e[0],e[2],e[2])}function KS(e){return Ri(e[0],Kt(),e[2])}function GS(e){return Ri(e,Kt(),Kt())}function VS(e){return cr(e)}function WS(e){return e[1]}function JS(e){return cr(e)}function QS(e){return e[1]}function YS(e){return HS(e[0],e[1])}function ZS(e){return null}function XS(e){return Kn()}function e1(e){return wr()}function t1(e){return Ef()}function n1(e){return vl()}function r1(e){return kl()}function s1(e){return aa()}function i1(e){return bl()}function o1(e){return Kt()}function a1(e){return ml()}function c1(e){return $e({})}function l1(e){return Nt()}function d1(e){return xl()}function u1(e){return tm()}function p1(e){return Xf()}function f1(e){return De(BigInt(e))}function m1(e){return De(g(e,"true"))}function h1(e){return De(parseFloat(e))}function g1(e){return De(e)}function b1(e){return e[1]}function k1(e){return De(e)}function x1(e){return g(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function y1(e){return e[1]}function w1(e){return Xm(e)}function v1(e){return g(e.length,6)?Lo(e[1],e[3],e[5]):Lo(e[1],e[3],Kt())}function S1(e){return e.length>0}function j1(e){return e.reduce((t,n)=>g(n.length,3)?[...t,[n[1]]]:[...t,[]],[])}function I1(e){return g(e.length,6)?[e[1],e[3],e[5]]:[]}function C1(e){return z(e)&&g(e.length,3)?e[1]:e}function E1(e){return g(e.length,2)?e[1]:[]}function Au(e,t){return t.reduce((n,r)=>{const s=r;return g(s.length,1)?Ql(n,s[0]):g(s.length,0)?Ir(n):as()},e)}function Pu(e,t){return g(t.length,3)?Eh(e,t[0],t[1],t[2]):e}function T1(e,t){return z(t)&&g(t.length,0)?e:cg(e,t)}function A1(e){const[t,n,r,s,i]=e;return T1(Pu(t?ed(Au(n,r)):Au(n,r),s),i)}function Sl(e,t){return g(t.length,3)?(()=>{const[n,r,s]=t,i=Sl(r,s);if(g(n,"&"))return Be(i)?Hn([e,...i.allOf]):Hn([e,i]);if(g(n,"|"))return fe(i)?Je([e,...i.anyOf]):Je([e,i]);as()})():e}function P1(e){const[t,n]=e;return Sl(t,n)}function N1(e){const[t,n]=e;return Sl(t,n)}function O1(e){return MP(e[1])}function R1(e){return e[1]}function M1(e){return Ai(e[0],e[2])}function $1(e){return g(e.length,4)?fc(e[1],e[3]):g(e.length,2)?fc(e[1],Kt()):as()}function F1(e){return`${e}`}function L1(e){return zn(e[3])?Mi:pn(e[3])?da:Oi(e[3])||Fn(e[3])?Qr:as()}function D1(e){return e.length>0}function _1(e){return e.length>0}function U1(e){const[t,n,r,s,i]=e;return{[n]:t&&r?rr(nr(i)):t&&!r?rr(i):!t&&r?nr(i):i}}function B1(e){return cr(e)}function rm(e){return e.reduce((t,n)=>E(n,Mi)||E(n,da)||E(n,Qr)?[t[0],kt(t[1],n)]:[kt(t[0],n),t[1]],[{},{}])}function H1(e){return rm(e[1])}function q1(e){const[t,n]=e,r=g(U(n).length,0)?{}:{patternProperties:n};return $e(t,r)}function z1(e){return g(e.length,5)?rr(nr(e[4])):g(e.length,3)?e[2]:g(e.length,4)?g(e[2],"readonly")?rr(e[3]):nr(e[3]):as()}function K1(e){if(!z(e)||!g(e.length,3))return e;const[t,n,r]=e;return t&&r?rr(nr(n)):t&&!r?rr(n):!t&&r?nr(n):n}function G1(e){return g(e.length,2)?pa(e[1]):g(e.length,1)?e[0]:as()}function V1(e){return cr(e)}function W1(e){return Sn(e[1])}function J1(e){return rr(nr(e[4]))}function Q1(e){return rr(e[3])}function Y1(e){return nr(e[3])}function Z1(e){return e[2]}function X1(e){return g(e.length,2)?pa(e[1]):g(e.length,1)?e[0]:as()}function ej(e){return cr(e)}function tj(e){return Ti(e[1],e[4])}function nj(e){return Ei(e[2],e[5])}function Nu(e,t){return g(e,"remove")?dS(t):g(e,"add")?rr(t):t}function rj(e){return g(e.length,2)&&g(e[0],"-")?"remove":g(e.length,2)&&g(e[0],"+")||g(e.length,1)?"add":"none"}function Ou(e,t){return g(e,"remove")?mS(t):g(e,"add")?nr(t):t}function sj(e){return g(e.length,2)&&g(e[0],"-")?"remove":g(e.length,2)&&g(e[0],"+")||g(e.length,1)?"add":"none"}function ij(e){return g(e.length,2)?[e[1]]:[]}function oj(e){return z(e[6])&&g(e[6].length,1)?Ec(hc(e[3]),e[5],e[6][0],Nu(e[1],Ou(e[8],e[10]))):Ec(hc(e[3]),e[5],gn(e[3]),Nu(e[1],Ou(e[8],e[10])))}function aj(e){return gn(e)}function cj(e){return BigInt(e)}function lj(e){return parseFloat(e)}function dj(e){return g(e,"true")}function uj(e){return null}function pj(e){return{[e[0]]:e[2]}}function fj(e){return cr(e)}function mj(e){return e.reduce((t,n)=>kt(t,n),{})}function hj(e){return mj(e[1])}function gj(e){return cr(e)}function bj(e){return e[1]}function kj(e){return bl()}function xj(e){return Kn()}function yj(e){return wr()}function wj(e){return aa()}function vj(e){return Nt()}function Sj(e){return De(e)}function jj(e){return Je(e[1])}function Ij(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Cj(e){return[e[0],...e[1]]}function Ej(e){return e[1]}function Tj(e){return cr(e)}function Aj(e){return g(e.length,2)?e[1]:[]}function Pj(e){const t=e[2],n=e[3],[r,s]=e[4],i=g(U(s).length,0)?{}:{patternProperties:s};return{[e[1]]:Ai(t,Bl(n,r,i))}}function Nj(e){const t=e[2],[n,r]=e[3],s=g(U(r).length,0)?{}:{patternProperties:r};return{[e[1]]:Bl(t,n,s)}}function Oj(e){return{[e[1]]:Ai(e[2],e[4])}}function Rj(e){return{[e[1]]:e[3]}}function Mj(e){return null}function $j(e){return cr(e)}function Fj(e){return e[1]}function Lj(e){const[t,n]=[e[0],e[1]];return FP(kt(t,rm(n)[0]))}function jl(e){return g(e.length,2)}function Le(e,t,n){return jl(e)?t(e[0],e[1]):n()}function Dj(e,t){return g(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Dt(e,t){for(let n=0;n<e.length;n++){const r=Dj(e[n],t);if(jl(r))return r}return[]}function bc(e,t){return Array.from({length:t-e+1},(n,r)=>String.fromCharCode(e+r))}const _j=[...bc(97,122),...bc(65,90)],sm="0",im=bc(49,57),Il=[sm,...im],Uj=" ",Cl=`
263
- `,$i="_",El=".",Bj="$",om="-",am="//",cm="/*",Hj="*/";function lm(e){const t=e.indexOf(Hj);return g(t,-1)?"":e.slice(t+2)}function dm(e){const t=e.indexOf(Cl);return g(t,-1)?"":e.slice(t)}function qj(e){return e.replace(/^[ \t\r\f\v]+/,"")}function kc(e){const t=qj(e);return t.startsWith(cm)?kc(lm(t.slice(2))):t.startsWith(am)?kc(dm(t.slice(2))):t}function Pn(e){const t=e.trimStart();return t.startsWith(cm)?Pn(lm(t.slice(2))):t.startsWith(am)?Pn(dm(t.slice(2))):t}function um(e,t){return Le(Dt([e],t),(n,r)=>[n,r],()=>["",t])}function zj(e,t){return e.includes(t)}function Ho(e,t,n,r=""){return Le(Dt(e,n),(s,i)=>zj(t,s)?Ho(e,t,i,r):Ho(e,t,i,`${r}${s}`),()=>[r,n])}function Kj(e){return Dt(im,e)}const Gj=[...Il,$i];function Vj(e){return Ho(Gj,[$i],e)}function Wj(e){return Le(Dt([sm],e),(t,n)=>[t,n],()=>Le(Kj(e),(t,n)=>Le(Vj(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[]))}function pm(e){return Wj(Pn(e))}function Jj(e){return um(om,e)}function Qj(e){return Le(Jj(e),(t,n)=>Le(pm(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[])}function Yj(e){return Qj(Pn(e))}function Zj(e){return Le(Yj(e),(t,n)=>Le(Dt(["n"],n),(r,s)=>[`${t}`,s],()=>[]),()=>[])}function fm(e){return Zj(e)}function Qa(e,t){return Dt([e],t)}function v(e,t){return g(e,"")?["",t]:e.startsWith(Cl)?Qa(e,kc(t)):e.startsWith(Uj)?Qa(e,t):Qa(e,Pn(t))}const mm=[..._j,$i,Bj];function Xj(e){return Dt(mm,e)}const eI=[...mm,...Il];function hm(e,t=""){return Le(Dt(eI,e),(n,r)=>hm(r,`${t}${n}`),()=>[t,e])}function tI(e){return Le(Xj(e),(t,n)=>Le(hm(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[])}function rt(e){return tI(Pn(e))}const nI=[...Il,$i];function rI(e){return jl(Dt([El],e))}function gm(e){return Le(Ho(nI,[$i],e),(t,n)=>g(t,"")?[]:[t,n],()=>[])}function sI(e){return Le(Dt([El],e),(t,n)=>Le(gm(n),(r,s)=>[`0${t}${r}`,s],()=>[]),()=>[])}function iI(e){return Le(pm(e),(t,n)=>Le(Dt([El],n),(r,s)=>Le(gm(s),(i,o)=>[`${t}${r}${i}`,o],()=>[`${t}`,s]),()=>[`${t}`,n]),()=>[])}function oI(e){return rI(e)?sI(e):iI(e)}function aI(e){return oI(Pn(e))}function cI(e){return um(om,e)}function lI(e){return Le(cI(e),(t,n)=>Le(aI(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[])}function Tl(e){return lI(Pn(e))}function dI(e){return g(e,"")?[]:[e.slice(0,1),e.slice(1)]}function bm(e,t){return Ae(e,(n,r)=>t.startsWith(n)?!0:bm(r,t),()=>!1)}function Fi(e,t,n=""){return Le(dI(t),(r,s)=>bm(e,t)?[n,t]:Fi(e,s,`${n}${r}`),()=>[])}function uI(e,t,n){return Le(Dt([e],n),(r,s)=>Le(Fi([t],s),(i,o)=>Le(Dt([t],o),(d,f)=>[`${i}`,f],()=>[]),()=>[]),()=>[])}function pI(e,t,n){return Le(Dt([e],n),(r,s)=>Le(Fi([Cl,t],s),(i,o)=>Le(Dt([t],o),(d,f)=>[`${i}`,f],()=>[]),()=>[]),()=>[])}function fI(e,t,n,r){return n?uI(e,t,Pn(r)):pI(e,t,Pn(r))}function mI(e,t){return Dt(e,t)}function hI(e,t){return fI(e,e,!1,t)}function gI(e,t){return Le(mI(e,t),(n,r)=>hI(n,`${n}${r}`),()=>[])}function Al(e,t){return gI(e,Pn(t))}function bI(e,t){return Le(Fi(e,t),(n,r)=>g(n,"")?[]:[n,r],()=>[])}const l=(e,t,n=()=>[])=>e.length===2?t(e):n(),kI=e=>l(l(rt(e),([t,n])=>l(v("extends",n),([r,s])=>l(ye(s),([i,o])=>l(v("=",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[qS(t),n]),xI=e=>l(l(rt(e),([t,n])=>l(v("extends",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[zS(t),n]),yI=e=>l(l(rt(e),([t,n])=>l(v("=",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[KS(t),n]),wI=e=>l(rt(e),([t,n])=>[GS(t),n]),km=e=>l(l(kI(e),([t,n])=>[t,n],()=>l(xI(e),([t,n])=>[t,n],()=>l(yI(e),([t,n])=>[t,n],()=>l(wI(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),xm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(km(r),([s,i])=>[[n,s],i])),([n,r])=>xm(r,[...t,n]),()=>[t,e]),vI=e=>l(l(l(km(e),([t,n])=>l(xm(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[VS(t),n]),Pl=e=>l(l(v("<",e),([t,n])=>l(vI(n),([r,s])=>l(v(">",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[WS(t),n]),ym=(e,t=[])=>l(l(v(",",e),([n,r])=>l(ye(r),([s,i])=>[[n,s],i])),([n,r])=>ym(r,[...t,n]),()=>[t,e]),SI=e=>l(l(l(ye(e),([t,n])=>l(ym(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[JS(t),n]),jI=e=>l(l(v("<",e),([t,n])=>l(SI(n),([r,s])=>l(v(">",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[QS(t),n]),II=e=>l(l(rt(e),([t,n])=>l(jI(n),([r,s])=>[[t,r],s])),([t,n])=>[YS(t),n]),wm=e=>l(l(l(v(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[ZS(),n]),vm=e=>l(v("string",e),([t,n])=>[XS(),n]),Sm=e=>l(v("number",e),([t,n])=>[e1(),n]),CI=e=>l(v("boolean",e),([t,n])=>[t1(),n]),EI=e=>l(v("undefined",e),([t,n])=>[n1(),n]),TI=e=>l(v("null",e),([t,n])=>[r1(),n]),jm=e=>l(v("integer",e),([t,n])=>[s1(),n]),AI=e=>l(v("bigint",e),([t,n])=>[i1(),n]),PI=e=>l(v("unknown",e),([t,n])=>[o1(),n]),NI=e=>l(v("any",e),([t,n])=>[a1(),n]),OI=e=>l(v("object",e),([t,n])=>[c1(),n]),RI=e=>l(v("never",e),([t,n])=>[l1(),n]),Im=e=>l(v("symbol",e),([t,n])=>[d1(),n]),MI=e=>l(v("void",e),([t,n])=>[u1(),n]),$I=e=>l(v("this",e),([t,n])=>[p1(),n]),FI=e=>l(l(v("${",e),([t,n])=>l(ye(n),([r,s])=>l(v("}",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[b1(t),n]),Ya=e=>l(Fi(["${","`"],e),([t,n])=>[k1(t),n]),Cm=e=>l(l(l(Ya(e),([t,n])=>l(FI(n),([r,s])=>l(Cm(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l(l(Ya(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l(l(Ya(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[x1(t),n]),Em=e=>l(l(v("`",e),([t,n])=>l(Cm(n),([r,s])=>l(v("`",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[y1(t),n]),LI=e=>l(Em(e),([t,n])=>[w1(t),n]),DI=e=>l(l(l(v("if",e),([t,n])=>l(ye(n),([r,s])=>l(v("then",s),([i,o])=>l(ye(o),([d,f])=>l(v("else",f),([u,m])=>l(ye(m),([p,h])=>[[t,r,i,d,u,p],h])))))),([t,n])=>[t,n],()=>l(l(v("if",e),([t,n])=>l(ye(n),([r,s])=>l(v("then",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[t,n],()=>[])),([t,n])=>[v1(t),n]),_I=e=>l(fm(e),([t,n])=>[f1(t),n]),UI=e=>l(l(v("true",e),([t,n])=>[t,n],()=>l(v("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[m1(t),n]),BI=e=>l(Tl(e),([t,n])=>[h1(t),n]),HI=e=>l(Al(["'",'"'],e),([t,n])=>[g1(t),n]),qI=e=>l(l(l(v("keyof",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[S1(t),n]),Tm=(e,t=[])=>l(l(l(v("[",e),([n,r])=>l(ye(r),([s,i])=>l(v("]",i),([o,d])=>[[n,s,o],d]))),([n,r])=>[n,r],()=>l(l(v("[",e),([n,r])=>l(v("]",r),([s,i])=>[[n,s],i])),([n,r])=>[n,r],()=>[])),([n,r])=>Tm(r,[...t,n]),()=>[t,e]),zI=e=>l(Tm(e),([t,n])=>[j1(t),n]),KI=e=>l(l(l(v("extends",e),([t,n])=>l(ye(n),([r,s])=>l(v("?",s),([i,o])=>l(ye(o),([d,f])=>l(v(":",f),([u,m])=>l(ye(m),([p,h])=>[[t,r,i,d,u,p],h])))))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[I1(t),n]),GI=e=>l(l(l(v("(",e),([t,n])=>l(ye(n),([r,s])=>l(v(")",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l(vm(e),([t,n])=>[t,n],()=>l(Sm(e),([t,n])=>[t,n],()=>l(CI(e),([t,n])=>[t,n],()=>l(EI(e),([t,n])=>[t,n],()=>l(TI(e),([t,n])=>[t,n],()=>l(jm(e),([t,n])=>[t,n],()=>l(AI(e),([t,n])=>[t,n],()=>l(PI(e),([t,n])=>[t,n],()=>l(NI(e),([t,n])=>[t,n],()=>l(OI(e),([t,n])=>[t,n],()=>l(RI(e),([t,n])=>[t,n],()=>l(Im(e),([t,n])=>[t,n],()=>l(MI(e),([t,n])=>[t,n],()=>l($I(e),([t,n])=>[t,n],()=>l(_I(e),([t,n])=>[t,n],()=>l(UI(e),([t,n])=>[t,n],()=>l(BI(e),([t,n])=>[t,n],()=>l(HI(e),([t,n])=>[t,n],()=>l(LI(e),([t,n])=>[t,n],()=>l(DI(e),([t,n])=>[t,n],()=>l(rC(e),([t,n])=>[t,n],()=>l(oC(e),([t,n])=>[t,n],()=>l(pC(e),([t,n])=>[t,n],()=>l(uC(e),([t,n])=>[t,n],()=>l(gC(e),([t,n])=>[t,n],()=>l(II(e),([t,n])=>[t,n],()=>l(bC(e),([t,n])=>[t,n],()=>[])))))))))))))))))))))))))))),([t,n])=>[C1(t),n]),VI=e=>l(l(l(v("with",e),([t,n])=>l(Km(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[E1(t),n]),Am=e=>l(l(qI(e),([t,n])=>l(GI(n),([r,s])=>l(zI(s),([i,o])=>l(KI(o),([d,f])=>l(VI(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[A1(t),n]),Pm=e=>l(l(l(v("&",e),([t,n])=>l(Am(n),([r,s])=>l(Pm(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),Nm=e=>l(l(Am(e),([t,n])=>l(Pm(n),([r,s])=>[[t,r],s])),([t,n])=>[P1(t),n]),Om=e=>l(l(l(v("|",e),([t,n])=>l(Nm(n),([r,s])=>l(Om(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),ma=e=>l(l(Nm(e),([t,n])=>l(Om(n),([r,s])=>[[t,r],s])),([t,n])=>[N1(t),n]),WI=e=>l(l(v("readonly",e),([t,n])=>l(ma(n),([r,s])=>[[t,r],s])),([t,n])=>[O1(t),n]),JI=e=>l(l(v("|",e),([t,n])=>l(ma(n),([r,s])=>[[t,r],s])),([t,n])=>[R1(t),n]),QI=e=>l(l(Pl(e),([t,n])=>l(v("=",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[M1(t),n]),YI=e=>l(l(l(v("infer",e),([t,n])=>l(rt(n),([r,s])=>l(v("extends",s),([i,o])=>l(ma(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[t,n],()=>l(l(v("infer",e),([t,n])=>l(rt(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>[])),([t,n])=>[$1(t),n]),ye=e=>l(l(YI(e),([t,n])=>[t,n],()=>l(JI(e),([t,n])=>[t,n],()=>l(WI(e),([t,n])=>[t,n],()=>l(ma(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),ZI=e=>l(Tl(e),([t,n])=>[F1(t),n]),XI=e=>l(rt(e),([t,n])=>[t,n]),eC=e=>l(Al(["'",'"'],e),([t,n])=>[t,n]),tC=e=>l(l(v("[",e),([t,n])=>l(rt(n),([r,s])=>l(v(":",s),([i,o])=>l(l(jm(o),([d,f])=>[d,f],()=>l(Sm(o),([d,f])=>[d,f],()=>l(vm(o),([d,f])=>[d,f],()=>l(Im(o),([d,f])=>[d,f],()=>[])))),([d,f])=>l(v("]",f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[L1(t),n]),Rm=e=>l(l(ZI(e),([t,n])=>[t,n],()=>l(XI(e),([t,n])=>[t,n],()=>l(eC(e),([t,n])=>[t,n],()=>l(tC(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),Mm=e=>l(l(l(v("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[D1(t),n]),$m=e=>l(l(l(v("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[_1(t),n]),Fm=e=>l(l(Mm(e),([t,n])=>l(Rm(n),([r,s])=>l($m(s),([i,o])=>l(v(":",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[U1(t),n]),ha=e=>l(l(l(v(",",e),([t,n])=>l(v(`
264
- `,n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v(";",e),([t,n])=>l(v(`
265
- `,n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v(",",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l(l(v(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l(l(v(`
266
- `,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))))),([t,n])=>[t,n]),Lm=(e,t=[])=>l(l(ha(e),([n,r])=>l(Fm(r),([s,i])=>[[n,s],i])),([n,r])=>Lm(r,[...t,n]),()=>[t,e]),nC=e=>l(l(l(Fm(e),([t,n])=>l(Lm(n),([r,s])=>l(l(ha(s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[B1(t),n]),Nl=e=>l(l(v("{",e),([t,n])=>l(nC(n),([r,s])=>l(v("}",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[H1(t),n]),rC=e=>l(Nl(e),([t,n])=>[q1(t),n]),sC=e=>l(l(l(rt(e),([t,n])=>l(v("?",n),([r,s])=>l(v(":",s),([i,o])=>l(v("readonly",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[t,n],()=>l(l(rt(e),([t,n])=>l(v(":",n),([r,s])=>l(v("readonly",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[t,n],()=>l(l(rt(e),([t,n])=>l(v("?",n),([r,s])=>l(v(":",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[t,n],()=>l(l(rt(e),([t,n])=>l(v(":",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>[])))),([t,n])=>[z1(t),n]),Ru=e=>l(l(sC(e),([t,n])=>[t,n],()=>l(l(Mm(e),([t,n])=>l(ye(n),([r,s])=>l($m(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>[])),([t,n])=>[K1(t),n]),Dm=e=>l(l(l(v("...",e),([t,n])=>l(Ru(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(Ru(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[G1(t),n]),_m=(e,t=[])=>l(l(v(",",e),([n,r])=>l(Dm(r),([s,i])=>[[n,s],i])),([n,r])=>_m(r,[...t,n]),()=>[t,e]),iC=e=>l(l(l(Dm(e),([t,n])=>l(_m(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[V1(t),n]),oC=e=>l(l(v("[",e),([t,n])=>l(iC(n),([r,s])=>l(v("]",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[W1(t),n]),aC=e=>l(l(rt(e),([t,n])=>l(v("?",n),([r,s])=>l(v(":",s),([i,o])=>l(v("readonly",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[J1(t),n]),cC=e=>l(l(rt(e),([t,n])=>l(v(":",n),([r,s])=>l(v("readonly",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[Q1(t),n]),lC=e=>l(l(rt(e),([t,n])=>l(v("?",n),([r,s])=>l(v(":",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[Y1(t),n]),dC=e=>l(l(rt(e),([t,n])=>l(v(":",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[Z1(t),n]),Mu=e=>l(l(aC(e),([t,n])=>[t,n],()=>l(cC(e),([t,n])=>[t,n],()=>l(lC(e),([t,n])=>[t,n],()=>l(dC(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),Um=e=>l(l(l(v("...",e),([t,n])=>l(Mu(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(Mu(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[X1(t),n]),Bm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(Um(r),([s,i])=>[[n,s],i])),([n,r])=>Bm(r,[...t,n]),()=>[t,e]),Hm=e=>l(l(l(Um(e),([t,n])=>l(Bm(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[ej(t),n]),uC=e=>l(l(v("(",e),([t,n])=>l(Hm(n),([r,s])=>l(v(")",s),([i,o])=>l(v("=>",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[tj(t),n]),pC=e=>l(l(v("new",e),([t,n])=>l(v("(",n),([r,s])=>l(Hm(s),([i,o])=>l(v(")",o),([d,f])=>l(v("=>",f),([u,m])=>l(ye(m),([p,h])=>[[t,r,i,d,u,p],h])))))),([t,n])=>[nj(t),n]),fC=e=>l(l(l(v("+",e),([t,n])=>l(v("readonly",n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v("-",e),([t,n])=>l(v("readonly",n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])))),([t,n])=>[rj(t),n]),mC=e=>l(l(l(v("+",e),([t,n])=>l(v("?",n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v("-",e),([t,n])=>l(v("?",n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])))),([t,n])=>[sj(t),n]),hC=e=>l(l(l(v("as",e),([t,n])=>l(ye(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[ij(t),n]),gC=e=>l(l(v("{",e),([t,n])=>l(fC(n),([r,s])=>l(v("[",s),([i,o])=>l(rt(o),([d,f])=>l(v("in",f),([u,m])=>l(ye(m),([p,h])=>l(hC(h),([b,k])=>l(v("]",k),([S,C])=>l(mC(C),([x,P])=>l(v(":",P),([N,M])=>l(ye(M),([D,j])=>l(wm(j),([I,T])=>l(v("}",T),([$,F])=>[[t,r,i,d,u,p,b,S,x,N,D,I,$],F]))))))))))))),([t,n])=>[oj(t),n]),bC=e=>l(rt(e),([t,n])=>[aj(t),n]),kC=e=>l(fm(e),([t,n])=>[cj(t),n]),xC=e=>l(Tl(e),([t,n])=>[lj(t),n]),yC=e=>l(l(v("true",e),([t,n])=>[t,n],()=>l(v("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[dj(t),n]),wC=e=>l(Al(['"',"'"],e),([t,n])=>[t,n]),vC=e=>l(v("null",e),([t,n])=>[uj(),n]),SC=e=>l(v("undefined",e),([t,n])=>[void 0,n]),qm=e=>l(l(Rm(e),([t,n])=>l(v(":",n),([r,s])=>l(Ol(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[pj(t),n]),zm=(e,t=[])=>l(l(ha(e),([n,r])=>l(qm(r),([s,i])=>[[n,s],i])),([n,r])=>zm(r,[...t,n]),()=>[t,e]),jC=e=>l(l(l(qm(e),([t,n])=>l(zm(n),([r,s])=>l(l(ha(s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[fj(t),n]),Km=e=>l(l(v("{",e),([t,n])=>l(jC(n),([r,s])=>l(v("}",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[hj(t),n]),Gm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(Ol(r),([s,i])=>[[n,s],i])),([n,r])=>Gm(r,[...t,n]),()=>[t,e]),IC=e=>l(l(l(Ol(e),([t,n])=>l(Gm(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[gj(t),n]),CC=e=>l(l(v("[",e),([t,n])=>l(IC(n),([r,s])=>l(v("]",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[bj(t),n]),Ol=e=>l(l(kC(e),([t,n])=>[t,n],()=>l(xC(e),([t,n])=>[t,n],()=>l(yC(e),([t,n])=>[t,n],()=>l(wC(e),([t,n])=>[t,n],()=>l(vC(e),([t,n])=>[t,n],()=>l(SC(e),([t,n])=>[t,n],()=>l(Km(e),([t,n])=>[t,n],()=>l(CC(e),([t,n])=>[t,n],()=>[])))))))),([t,n])=>[t,n]),EC=e=>l(v("-?(?:0|[1-9][0-9]*)n",e),([t,n])=>[kj(),n]),TC=e=>l(v(".*",e),([t,n])=>[xj(),n]),AC=e=>l(v("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",e),([t,n])=>[yj(),n]),PC=e=>l(v("-?(?:0|[1-9][0-9]*)",e),([t,n])=>[wj(),n]),NC=e=>l(v("(?!)",e),([t,n])=>[vj(),n]),OC=e=>l(bI(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,n])=>[Sj(t),n]),RC=e=>l(l(EC(e),([t,n])=>[t,n],()=>l(TC(e),([t,n])=>[t,n],()=>l(AC(e),([t,n])=>[t,n],()=>l(PC(e),([t,n])=>[t,n],()=>l(NC(e),([t,n])=>[t,n],()=>l(MC(e),([t,n])=>[t,n],()=>l(OC(e),([t,n])=>[t,n],()=>[]))))))),([t,n])=>[t,n]),MC=e=>l(l(v("(",e),([t,n])=>l(Rl(n),([r,s])=>l(v(")",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[jj(t),n]),Vm=e=>l(l(l(xc(e),([t,n])=>l(v("|",n),([r,s])=>l(Vm(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l(l(xc(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[]))),([t,n])=>[Ij(t),n]),xc=e=>l(l(RC(e),([t,n])=>l(Rl(n),([r,s])=>[[t,r],s])),([t,n])=>[Cj(t),n]),Rl=e=>l(l(Vm(e),([t,n])=>[t,n],()=>l(xc(e),([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),$C=e=>l(l(v("^",e),([t,n])=>l(Rl(n),([r,s])=>l(v("$",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[Ej(t),n]),Wm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(ye(r),([s,i])=>[[n,s],i])),([n,r])=>Wm(r,[...t,n]),()=>[t,e]),FC=e=>l(l(l(ye(e),([t,n])=>l(Wm(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Tj(t),n]),Jm=e=>l(l(l(v("extends",e),([t,n])=>l(FC(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Aj(t),n]),LC=e=>l(l(v("interface",e),([t,n])=>l(rt(n),([r,s])=>l(Pl(s),([i,o])=>l(Jm(o),([d,f])=>l(Nl(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[Pj(t),n]),DC=e=>l(l(v("interface",e),([t,n])=>l(rt(n),([r,s])=>l(Jm(s),([i,o])=>l(Nl(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[Nj(t),n]),_C=e=>l(l(v("type",e),([t,n])=>l(rt(n),([r,s])=>l(Pl(s),([i,o])=>l(v("=",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[Oj(t),n]),UC=e=>l(l(v("type",e),([t,n])=>l(rt(n),([r,s])=>l(v("=",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[Rj(t),n]),BC=e=>l(l(l(v("export",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Mj(),n]),Qm=e=>l(l(l(v(";",e),([t,n])=>l(v(`
267
- `,n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l(l(v(`
268
- `,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]),Ym=(e,t=[])=>l(l(Qm(e),([n,r])=>l(Ml(r),([s,i])=>[[n,s],i])),([n,r])=>Ym(r,[...t,n]),()=>[t,e]),HC=e=>l(l(l(Ml(e),([t,n])=>l(Ym(n),([r,s])=>l(l(Qm(s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[$j(t),n]),Ml=e=>l(l(BC(e),([t,n])=>l(l(LC(n),([r,s])=>[r,s],()=>l(DC(n),([r,s])=>[r,s],()=>l(_C(n),([r,s])=>[r,s],()=>l(UC(n),([r,s])=>[r,s],()=>[])))),([r,s])=>l(wm(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[Fj(t),n]),qC=e=>l(l(Ml(e),([t,n])=>l(HC(n),([r,s])=>[[t,r],s])),([t,n])=>[Lj(t),n]),zC=e=>l(l(qC(e),([t,n])=>[t,n],()=>l(QI(e),([t,n])=>[t,n],()=>l(ye(e),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]);function KC(e){const t=Em(`\`${e}\``);return g(t.length,2)?t[0]:Ft()}function GC(e){return e.join("|")}function VC(e){return e.slice(1,e.length-1)}function WC(e,t,n){return Tr(t,`${n}${e}`)}function JC(e,t){return Tr(e,`${t}${Kv}`)}function QC(e,t){return Tr(e,`${t}${Tf}`)}function YC(e,t){return Tr(e,`${t}${Of}`)}function ZC(e,t){return Li(Je([De("false"),De("true")]),e,t)}function XC(e,t){return Tr(e,`${t}${Rf}`)}function e2(e,t,n){return Tr(t,`${n}${VC(e)}`)}function t2(e,t,n){const r=$l(e,{});return Li(r,t,n)}function n2(e,t,n){const r=Er(e);return Li(r,t,n)}function Zm(e,t,n,r=[]){return Ae(e,(s,i)=>Zm(i,t,n,[...r,Li(s,[],"")]),()=>Tr(t,`${n}(${GC(r)})`))}function Li(e,t,n){return vn(e)?n2(e.enum,t,n):zn(e)?QC(t,n):Qe(e)?WC(e.const,t,n):is(e)?JC(t,n):Cr(e)?ZC(t,n):pn(e)?YC(t,n):Fn(e)?XC(t,n):Wt(e)?e2(e.pattern,t,n):o2(e)?t2(e.parameters[0],t,n):fe(e)?Zm(e.anyOf,t,n):iv}function Tr(e,t){return Ae(e,(n,r)=>Li(n,r,t),()=>t)}function r2(e){return`^${Tr(e,"")}$`}function s2(e){const t=r2(e);return Df(t)}function $l(e,t){return Xe(e)?xe(s2(e),{},t):Xm(e,t)}function i2(e,t,n,r){const s=Xn(e,t,n);return $l(s,r)}function Xm(e,t={}){return Oe("TemplateLiteral",[e],t)}function o2(e){return an(e)&&E(e,"action")&&g(e.action,"TemplateLiteral")}function eh(e){return $l(e,{})}function a2(e){const t=KC(e);return eh(t)}function c2(e,t={}){const n=pe(e)?a2(e):eh(e);return xe(n,{},t)}function Wt(e){return Ce(e,"TemplateLiteral")}function th(e){return we({"~kind":"ExtendsUnion"},{inferred:e})}function Fl(e){return re(e)&&E(e,"~kind")&&E(e,"inferred")&&g(e["~kind"],"ExtendsUnion")&&re(e.inferred)}function ee(e){return we({"~kind":"ExtendsTrue"},{inferred:e})}function Ll(e){return re(e)&&E(e,"~kind")&&E(e,"inferred")&&g(e["~kind"],"ExtendsTrue")&&re(e.inferred)}function je(){return we({"~kind":"ExtendsFalse"},{})}function yc(e){return re(e)&&E(e,"~kind")&&g(e["~kind"],"ExtendsFalse")}function Yt(e){return Fl(e)||Ll(e)}function It(e,t,n){return Yt(e)?t(e.inferred):n()}const l2=Object.freeze(Object.defineProperty({__proto__:null,ExtendsFalse:je,ExtendsTrue:ee,ExtendsUnion:th,IsExtendsFalse:yc,IsExtendsTrue:Ll,IsExtendsTrueLike:Yt,IsExtendsUnion:Fl,Match:It},Symbol.toStringTag,{value:"Module"}));function d2(e,t,n,r){return It(Ze(e,n,r),s=>ee(kt(kt(e,s),{[t]:n})),()=>je())}function u2(e,t){return ee(e)}function p2(e,t,n,r,s){return It(Ze(e,t,n),i=>It(Ze(i,t,r),o=>ee(o),()=>je()),()=>It(Ze(e,t,s),i=>ee(i),()=>je()))}function f2(e,t,n){const r=Er(n);return Ze(e,t,r)}function nh(e,t,n){return Ae(n,(r,s)=>It(Ze(e,t,r),i=>nh(i,t,s),()=>je()),()=>ee(e))}function m2(e,t,n){const r=or(n);return Ze(e,t,r)}function rh(e,t,n){return Ae(n,(r,s)=>It(Ze(e,t,r),i=>ee(i),()=>rh(e,t,s)),()=>je())}function jt(e,t,n){return $n(n)?u2(e):wn(n)?p2(e,t,n.if,n.then,n.else):vn(n)?f2(e,t,n.enum):ln(n)?d2(e,n.name,t,n.extends):Be(n)?nh(e,t,n.allOf):Wt(n)?m2(e,t,n.pattern):fe(n)?rh(e,t,n.anyOf):An(n)?ee(e):je()}function h2(e,t,n){return ln(n)?jt(e,t,n):$n(n)||An(n)?ee(e):th(e)}function g2(e,t){const n=Do(e),r=Do(t);return n&&r||!n&&r?!0:!(n&&!r)}function b2(e,t,n,r){return gt(r)?g2(t,r)?Ze(e,n,r.items):je():jt(e,t,r)}function k2(e,t,n){return is(n)?ee(e):jt(e,t,n)}function x2(e,t,n){return Cr(n)?ee(e):jt(e,t,n)}function y2(e,t,n,r,s){const i=ln(r)?t:r,o=ln(r)?r:t,d=cn(t),f=cn(r);return!d&&f?je():It(Ze(e,i,o),u=>Dl(u,n,s),()=>je())}function w2(e,t,n,r){return Ae(r,(s,i)=>y2(e,t,n,s,i),()=>cn(t)?ee(e):je())}function v2(e,t,n){return Ae(t,(r,s)=>w2(e,r,s,n),()=>ee(e))}function Dl(e,t,n){return v2(e,t,n)}function sh(e,t,n){return os(n)?ee(e):Ze(e,t,n)}function S2(e,t,n,r){return $n(r)||An(r)?ee(e):xn(r)?It(Dl(e,t,r.parameters),s=>sh(s,n,r.instanceType),()=>je()):je()}function j2(e,t,n,r,s){return It(Ze(e,t,s),()=>Ze(e,n,s),()=>Ze(e,r,s))}function I2(e,t,n){const r=Er(t);return Ze(e,r,n)}function C2(e,t,n,r){return $n(r)||An(r)?ee(e):yn(r)?It(Dl(e,t,r.parameters),s=>sh(s,n,r.returnType),()=>je()):je()}function E2(e,t,n){return zn(n)||pn(n)?ee(e):jt(e,t,n)}function T2(e,t,n){const r=fn(t);return Ze(e,r,n)}function ga(e,t,n){return t===n?ee(e):je()}function A2(e,t,n){return Qe(n)?ga(e,t,n.const):is(n)?ee(e):jt(e,De(t),n)}function P2(e,t,n){return Qe(n)?ga(e,t,n.const):Cr(n)?ee(e):jt(e,De(t),n)}function N2(e,t,n){return Qe(n)?ga(e,t,n.const):pn(n)?ee(e):jt(e,De(t),n)}function O2(e,t,n){return Qe(n)?ga(e,t,n.const):Fn(n)?ee(e):jt(e,De(t),n)}function R2(e,t,n){return st(t.const)?A2(e,t.const,n):xt(t.const)?P2(e,t.const,n):Ie(t.const)?N2(e,t.const,n):pe(t.const)?O2(e,t.const,n):Ft()}function M2(e,t,n){return ln(n)?jt(e,t,n):ee(e)}function $2(e,t,n){return Ni(n)?ee(e):jt(e,t,n)}function F2(e,t,n){return pn(n)?ee(e):jt(e,t,n)}function L2(e,t,n){return cn(t)?cn(n)?ee(e):je():ee(e)}function D2(e,t,n){return ln(n)&&Fs(n.extends)?je():It(Ze(e,t,n),r=>L2(r,t,n),()=>je())}function _2(e,t){return e.reduce((n,r)=>r in t&&Yt(t[r])?{...n,...t[r].inferred}:Ft(),{})}function U2(e,t,n){const r={};for(const o of U(n))r[o]=o in t?D2({},t[o],n[o]):cn(n[o])?ln(n[o])?ee(kt(e,{[n[o].name]:n[o].extends})):ee(e):je();const s=il(r).every(o=>Yt(o)),i=s?_2(U(r),r):{};return s?ee(i):je()}function B2(e,t,n){const r=U2(e,t,n);return Yt(r)?ee(kt(e,r.inferred)):je()}function H2(e,t,n){return B2(e,t,n)}function q2(e,t){return U(t).reduce((n,r)=>({...n,[r]:E(e,r)?fe(n[r])?Je([...n[r].anyOf,t[r]]):Je([e[r],t[r]]):t[r]}),e)}function ih(e,t,n,r){return Ae(t,(s,i)=>It(Ze({},e[s],n),o=>ih(e,i,n,q2(r,o)),()=>je()),()=>ee(r))}function z2(e,t,n,r){const s=U(t);return ih(t,s,r,e)}function K2(e,t,n){return Ot(n)?z2(e,t,jn(n),Vt(n)):Ue(n)?H2(e,t,n.properties):jt(e,$e(t),n)}function G2(e,t){return g(U(t).length,0)?ee(e):je()}function V2(e,t,n,r,s){return Ze(e,n,s)}function W2(e,t,n,r){return Ot(r)?V2(e,gc(t),n,gc(jn(r)),Vt(r)):Ue(r)?G2(e,r.properties):$n(r)||An(r)?ee(e):je()}function J2(e,t,n){return Fn(n)?ee(e):jt(e,t,n)}function Q2(e,t,n){return Oi(n)?ee(e):jt(e,t,n)}function Y2(e,t,n){const r=or(t);return Ze(e,r,n)}function wc(e,t){return we({"~kind":"Inferrable"},{name:e,type:t},{})}function _l(e){return re(e)&&E(e,"~kind")&&E(e,"name")&&E(e,"type")&&g(e["~kind"],"Inferrable")&&pe(e.name)&&re(e.type)}function oh(e){return fa(e)?ln(e.items)?gt(e.items.extends)?wc(e.items.name,e.items.extends.items):An(e.items.extends)?wc(e.items.name,e.items.extends):void 0:Ft():void 0}function ah(e){return ln(e)?wc(e.name,e.extends):void 0}function Ul(e,t,n=[]){return Ae(e,(r,s)=>It(Ze({},r,t),()=>Ul(s,t,[...n,r]),()=>{}),()=>n)}function Z2(e,t,n,r){const s=Ul(n,r);return z(s)?ee(kt(e,{[t]:Sn(s)})):je()}function ch(e,t,n,r){const s=Ul(n,r);return z(s)?ee(kt(e,{[t]:Je(s)})):je()}function X2(e){return[...e].reverse()}function vc(e,t){return t?X2(e):e}function eE(e){const t=e.length>0?e[0]:void 0,n=an(t)?oh(t):void 0;return an(n)}function tE(e,t,n,r,s,i){return It(Ze(e,n,s),o=>lh(o,t,r,i),()=>je())}function nE(e,t,n,r,s){const i=oh(r);return _l(i)?Z2(e,i.name,vc(n,t),i.type):Ae(n,(o,d)=>tE(e,t,o,d,r,s),()=>je())}function rE(e,t,n,r){return Ae(r,(s,i)=>nE(e,t,n,s,i),()=>g(n.length,0)?ee(e):je())}function lh(e,t,n,r){return rE(e,t,n,r)}function sE(e,t,n){const r=Hi(e,_t([],[]),n),s=eE(r);return lh(e,s,vc(t,s),vc(r,s))}function dh(e,t,n){const r=ah(n);return _l(r)?ch(e,r.name,t,r.type):Ae(t,(s,i)=>It(Ze(e,s,n),o=>dh(o,i,n),()=>je()),()=>ee(e))}function iE(e,t,n){const r=Hi(e,_t([],[]),t);return at(n)?sE(e,r,n.items):gt(n)?dh(e,r,n.items):jt(e,Sn(r),n)}function oE(e,t,n){return os(n)||_s(n)?ee(e):jt(e,t,n)}function uh(e,t,n){return Ae(n,(r,s)=>It(Ze(e,t,r),i=>ee(i),()=>uh(e,t,s)),()=>je())}function Sc(e,t,n){return Ae(t,(r,s)=>It(uh(e,r,n),i=>Sc(i,s,n),()=>je()),()=>ee(e))}function aE(e,t,n){const r=ah(n);return _l(r)?ch(e,r.name,t,r.type):fe(n)?Sc(e,t,n.anyOf):Sc(e,t,[n])}function cE(e,t,n){return ln(n)?jt(e,t,n):$n(n)||An(n)?ee(e):je()}function lE(e,t,n){return os(n)?ee(e):jt(e,t,n)}function Ze(e,t,n){return $n(t)?h2(e,t,n):gt(t)?b2(e,t,t.items,n):is(t)?k2(e,t,n):Cr(t)?x2(e,t,n):xn(t)?S2(e,t.parameters,t.instanceType,n):wn(t)?j2(e,t.if,t.then,t.else,n):vn(t)?I2(e,t.enum,n):yn(t)?C2(e,t.parameters,t.returnType,n):zn(t)?E2(e,t,n):Be(t)?T2(e,t.allOf,n):Qe(t)?R2(e,t,n):Fs(t)?M2(e,t,n):Ni(t)?$2(e,t,n):pn(t)?F2(e,t,n):Ue(t)?K2(e,t.properties,n):Ot(t)?W2(e,jn(t),Vt(t),n):Fn(t)?J2(e,t,n):Oi(t)?Q2(e,t,n):Wt(t)?Y2(e,t.pattern,n):at(t)?iE(e,t.items,n):_s(t)?oE(e,t,n):fe(t)?aE(e,t.anyOf,n):An(t)?cE(e,t,n):os(t)?lE(e,t,n):je()}function dE(e,t){return fn([...e,$e(t)])}function ph(e,t,n){return Xe(e)?xe(dE(e,t),{},n):Bl(e,t,n)}function uE(e,t,n,r,s){const i=Xn(e,t,n),o=td(e,t,r);return ph(i,o,s)}function Bl(e,t,n={}){return Oe("Interface",[e,t],n)}function Hl(e){return an(e)&&E(e,"action")&&g(e.action,"Interface")}function pE(e,t,n={}){return ph(e,t,n)}function fE(e,t,n){return e.includes(n)?!0:ki([...e,n],t,t[n])}function $u(e,t,n){const r=bf(n);return Ur(e,t,r)}function Ur(e,t,n){return Ae(n,(r,s)=>ki(e,t,r)?!0:Ur(e,t,s),()=>!1)}function ki(e,t,n){return vt(n)?fE(e,t,n.$ref):gt(n)?ki(e,t,n.items):xn(n)?Ur(e,t,[...n.parameters,n.instanceType]):yn(n)?Ur(e,t,[...n.parameters,n.returnType]):Hl(n)?$u(e,t,n.parameters[1]):Be(n)?Ur(e,t,n.allOf):Ue(n)?$u(e,t,n.properties):fe(n)?Ur(e,t,n.anyOf):at(n)?Ur(e,t,n.items):Ot(n)?ki(e,t,Vt(n)):!1}function mE(e,t,n){return ki(e,t,n)}function hE(e,t){return t.reduce((n,r)=>mE([r],e,e[r])?[...n,r]:n,[])}function gE(e){const t=gf(e);return hE(e,t)}function bE(e,t,n){return n.includes(t)?n:t in e?xi(e,e[t],[...n,t]):Ft()}function Fu(e,t,n){const r=bf(t);return Is(e,r,n)}function Is(e,t,n){return t.reduce((r,s)=>xi(e,s,r),n)}function xi(e,t,n){return vt(t)?bE(e,t.$ref,n):gt(t)?xi(e,t.items,n):xn(t)?Is(e,[...t.parameters,t.instanceType],n):yn(t)?Is(e,[...t.parameters,t.returnType],n):Hl(t)?Fu(e,t.parameters[1],n):Be(t)?Is(e,t.allOf,n):Ue(t)?Fu(e,t.properties,n):fe(t)?Is(e,t.anyOf,n):at(t)?Is(e,t.items,n):Ot(t)?xi(e,Vt(t),n):n}function kE(e,t,n){return xi(e,n,[t])}function xE(e){return ml()}function yE(e){return U(e).reduce((t,n)=>({...t,[n]:Hr(e[n])}),{})}function ii(e){return e.reduce((t,n)=>[...t,Hr(n)],[])}function Hr(e){return vt(e)?xE(e.$ref):gt(e)?Ir(Hr(e.items),pl(e)):xn(e)?Ei(ii(e.parameters),Hr(e.instanceType)):yn(e)?Ti(ii(e.parameters),Hr(e.returnType)):Be(e)?Hn(ii(e.allOf)):Ue(e)?$e(yE(e.properties)):Ot(e)?wl(ua(e),Hr(Vt(e))):fe(e)?Je(ii(e.anyOf)):at(e)?Sn(ii(e.items)):e}function wE(e,t){return t in e?Hr(e[t]):Kt()}function vE(e){return wE(e.$defs,e.$ref)}function SE(e,t,n){const r=Xn(e,_t([],[]),t),s=td({},_t([],[]),n);return fn([...r,$e(s)])}function jE(e,t){return U(e).filter(r=>t.includes(r)).reduce((r,s)=>{const i=e[s],o=Hl(i)?SE(e,i.parameters[0],i.parameters[1]):i;return{...r,[s]:o}},{})}function IE(e,t,n){const r=kE(e,t,n),s=jE(e,r);return Pi(s,t)}function fh(e,t){return t in e?vt(e[t])?fh(e,e[t].$ref):e[t]:Nt()}function Di(e,t){return fh(e,t)}function Lu(e){return Gt(e)?vE(e):kf(e)?Kt():e}function sr(e,t,n){const r=Lu(t),s=Lu(n);return Ze(e,r,s)}const ql="equal",CE="disjoint",zl="left-inside",Kl="right-inside";function ba(e,t){const n=[An(e)?je():sr({},e,t),An(e)?ee({}):sr({},t,e)];return Yt(n[0])&&Yt(n[1])?ql:Yt(n[0])&&yc(n[1])?zl:yc(n[0])&&Yt(n[1])?Kl:CE}function EE(e,t){return t.filter(n=>ba(e,n)!==Kl)}function TE(e,t){const n=t.some(r=>{const s=ba(e,r);return g(s,zl)||g(s,ql)});return g(n,!1)}function AE(e,t){const n=Jr(e);return $n(n)?[n]:TE(n,t)?[...EE(n,t),n]:t}function PE(e){return e.reduce((t,n)=>Ue(n)?[...t,n]:Fs(n)?t:AE(n,t),[])}function mh(e){const t=PE(e);return ca(t)}function hh(e,t){return xe(Jr(e),{},t)}function NE(e,t,n,r){const s=W(e,t,n);return hh(s,r)}function ai(e,t=[]){return Ps(e)&&g(e.action,"Conditional")?vt(e.parameters[0])?ai(e.parameters[2],ai(e.parameters[3],[...t,e.parameters[0].$ref])):ai(e.parameters[2],ai(e.parameters[3],t)):Ps(e)&&g(e.action,"Mapped")&&Ps(e.parameters[1])&&g(e.parameters[1].action,"KeyOf")&&vt(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function OE(e,t){return e.reduce((n,r)=>[...n,t.includes(r.name)],[])}function gh(e,t,n=[]){return Ae(e,(r,s)=>Ae(t,(i,o)=>gh(s,o,[...n,[i,r]]),()=>n),()=>n)}function RE(e){return Wt(e)?or(e.pattern):vn(e)?Er(e.enum):e}function ME(e){const t=RE(e);return fe(t)?[...t.anyOf]:[t]}function $E(e,t){return e.reduce((n,r)=>[...n,[...r,t]],[])}function Du(e,t){return t.reduce((n,r)=>[...n,...$E(e,r)],[])}function _u(e){return e.reduce((t,n)=>g(n[0],!0)?Du(t,ME(n[1])):Du(t,[n[1]]),[[]])}function FE(e,t,n){const r=ai(n),s=OE(e,r),i=gh(t,s);return Ps(n)&&g(n.action,"Conditional")||Ps(n)&&g(n.action,"Mapped")?_u(i):[t]}function LE(){return["(not-resolvable)",Nt()]}function DE(){return["(not-generic)",Nt()]}function _E(e,t,n){return[e,Ai(t,n)]}function UE(e,t,n){return t in e?bh(e,t,e[t]):LE()}function bh(e,t,n,r){return fl(n)?_E(t,n.parameters,n.expression):vt(n)?UE(e,n.$ref):DE()}function BE(e,t,n){return bh(e,"(anonymous)",t)}function HE(e,t,n){if(ln(t)||Vl(t)||Yt(sr({},t,n)))return;const r={parameter:e,expect:n,actual:t};throw new Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Uu(e,t,n,r,s){const i=W(e,t,s);return HE(n,i,r),kt(e,{[n]:i})}function qE(e,t,n,r,s){const i=W(e,t,n.extends),o=W(e,t,n.equals);return Ae(s,(d,f)=>jc(Uu(e,t,n.name,i,d),t,r,f),()=>jc(Uu(e,t,n.name,i,o),t,r,[]))}function jc(e,t,n,r){return Ae(n,(s,i)=>qE(e,t,s,i,r),()=>e)}function zE(e,t,n,r){return jc(e,t,n,r)}let Ic=0,Gl=0;function KE(){if(!Si(Gl,Ci().maxInstantiationCount))throw Error("Type instantiation is excessively deep and possibly infinite")}function GE(){KE(),Gl++,Ic++}function VE(){Ic--,g(Ic,0)&&(Gl=0)}function WE(e){return ts(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function JE(e,t){return g(WE(e),t)}function QE(e,t,n,r,s,i){GE();try{const o=zE(e,t,r,i),d=W(o,_t([...t.callstack,n.$ref],t.visited),s);return W(o,_t([],[]),d)}finally{VE()}}function YE(e,t,n,r,s,i){return i.reduce((o,d)=>{const f=QE(e,t,n,r,s,d);return[...o,f]},[])}function ZE(e,t,n,r,s,i){const o=FE(r,i,s),d=YE(e,t,n,r,s,o);return g(d.length,1)?d[0]:ar(d)}function kh(e,t,n,r){const s=Xn(e,t,r),i=BE(e,n),o=i[0],d=i[1];return fl(d)?JE(t,o)?Cc(gn(o),s):ZE(e,t,gn(o),d.parameters,d.expression,s):Cc(n,s)}function Cc(e,t){return we({"~kind":"Call"},{type:"call",target:e,arguments:t},{})}function XE(e,t){return kh({},_t([],[]),e,t)}function Vl(e){return Ce(e,"Call")}function eT(e){return Mn(e,["~immutable"])}function tT(e,t){return xe(eT(e),{},t)}function nT(e,t,n,r){const s=W(e,t,n);return tT(s,r)}function rT(e,t){return e(t)}function sT(e,t){return pe(t)?De(rT(e,t)):De(t)}function iT(e,t){const n=or(t);return Us(e,n)}function oT(e,t){const n=t.map(r=>Us(e,r));return Je(n)}function Us(e,t){return Qe(t)?sT(e,t.const):Wt(t)?iT(e,t.pattern):fe(t)?oT(e,t.anyOf):t}function xh(e,t={}){return Oe("Capitalize",[e],t)}function aT(e,t={}){return Sh(e,t)}function yh(e,t={}){return Oe("Lowercase",[e],t)}function cT(e,t={}){return jh(e,t)}function wh(e,t={}){return Oe("Uncapitalize",[e],t)}function lT(e,t={}){return Ih(e,t)}function vh(e,t={}){return Oe("Uppercase",[e],t)}function dT(e,t={}){return Ch(e,t)}const uT=e=>e[0].toUpperCase()+e.slice(1),pT=e=>e.toLowerCase(),fT=e=>e[0].toLowerCase()+e.slice(1),mT=e=>e.toUpperCase();function Sh(e,t){return Xe([e])?xe(Us(uT,e),{},t):xh(e,t)}function jh(e,t){return Xe([e])?xe(Us(pT,e),{},t):yh(e,t)}function Ih(e,t){return Xe([e])?xe(Us(fT,e),{},t):wh(e,t)}function Ch(e,t){return Xe([e])?xe(Us(mT,e),{},t):vh(e,t)}function hT(e,t,n,r){const s=W(e,t,n);return Sh(s,r)}function gT(e,t,n,r){const s=W(e,t,n);return jh(s,r)}function bT(e,t,n,r){const s=W(e,t,n);return Ih(s,r)}function kT(e,t,n,r){const s=W(e,t,n);return Ch(s,r)}function Eh(e,t,n,r,s={}){return Oe("Conditional",[e,t,n,r],s)}function xT(e,t,n,r,s={}){return Th({},_t([],[]),e,t,n,r,s)}function yT(e,t,n,r,s,i){const o=sr(e,n,r);return Fl(o)?Je([W(o.inferred,t,s),W(e,t,i)]):Ll(o)?W(o.inferred,t,s):W(e,t,i)}function Th(e,t,n,r,s,i,o){return Xe([n,r])?xe(yT(e,t,n,r,s,i),{},o):Eh(n,r,s,i,o)}function wT(e,t,n,r,s,i,o){const d=W(e,t,n),f=W(e,t,r);return Th(e,t,d,f,s,i,o)}function Ah(e,t={}){return Oe("ConstructorParameters",[e],t)}function vT(e,t={}){return Ph(e,t)}function ST(e){const t=xn(e)?e.parameters:[],n=Hi({},_t([],[]),t);return Sn(n)}function Ph(e,t){return Xe([e])?xe(ST(e),{},t):Ah(e,t)}function jT(e,t,n,r){const s=W(e,t,n);return Ph(s,r)}function Nh(e,t,n={}){return Oe("Exclude",[e,t],n)}function IT(e,t,n={}){return Wl(e,t,n)}function Wl(e,t,n){return Xe([e,t])?xe(Qf(e,t),{},n):Nh(e,t,n)}function CT(e,t,n,r,s){const i=W(e,t,n),o=W(e,t,r);return Wl(i,o,s)}function Oh(e,t,n={}){return Oe("Extract",[e,t],n)}function ET(e,t,n={}){return Rh(e,t,n)}function TT(e,t){const n=sr({},e,t);return Yt(n)?[e]:[]}function AT(e,t){return e.reduce((n,r)=>[...n,...TT(r,t)],[])}function PT(e,t){const n=Jr(e),r=fe(n)?n.anyOf:[n],s=AT(r,t);return ar(s)}function Rh(e,t,n){return Xe([e,t])?xe(PT(e,t),{},n):Oh(e,t,n)}function NT(e,t,n,r,s){const i=W(e,t,n),o=W(e,t,r);return Rh(i,o,s)}function OT(e){return e.reduce((t,n)=>Af(n)?[...t,De(n)]:t,[])}function Jl(e){const t=OT(e);return Je(t)}function Ql(e,t,n={}){return Oe("Index",[e,t],n)}function RT(e,t,n={}){const r=z(t)?Jl(t):t;return Dh(e,r,n)}function MT(e,t){const n=Di(e,t);return cs(n)}function $T(e,t,n){const r=Ls(e,t,n);return cs(r)}function FT(e,t){const n=U(e).filter(m=>!E(t,m)),r=U(t).filter(m=>!E(e,m)),s=U(e).filter(m=>E(t,m)),i=n.reduce((m,p)=>({...m,[p]:e[p]}),{}),o=r.reduce((m,p)=>({...m,[p]:t[p]}),{}),d=s.reduce((m,p)=>({...m,[p]:fn([e[p],t[p]])}),{}),f=kt(i,o);return kt(f,d)}function LT(e){return e.reduce((t,n)=>FT(t,cs(n)),{})}function DT(e){const t=hS(Sn(e));return cs(t)}function _T(e,t){return U(e).filter(s=>s in t).reduce((s,i)=>({...s,[i]:ar([e[i],t[i]])}),{})}function Mh(e,t){return Ae(e,(n,r)=>Mh(r,_T(t,cs(n))),()=>t)}function UT(e){return Ae(e,(t,n)=>Mh(n,cs(t)),()=>Ft())}function cs(e){return Gt(e)?MT(e.$defs,e.$ref):wn(e)?$T(e.if,e.then,e.else):Be(e)?LT(e.allOf):fe(e)?UT(e.anyOf):at(e)?DT(e.items):Ue(e)?e.properties:{}}function Yl(e){const t=cs(e);return $e(t)}const BT=new RegExp("^(?:0|[1-9][0-9]*)$");function Zl(e){const t=`${e}`;return BT.test(t)?parseInt(t):e}function HT(e){return De(Zl(e))}function Bu(e){return e.map(t=>$h(t))}function $h(e){return Be(e)?Hn(Bu(e.allOf)):fe(e)?Je(Bu(e.anyOf)):Qe(e)?HT(e.const):e}function qT(e,t){const n=$h(t),r=sr({},n,wr());return Yt(r)?e:Qe(t)&&g(t.const,"length")?wr():Nt()}function zT(e,t){const n=Di(e,t);return ls(n)}function KT(e,t,n){const r=Ls(e,t,n);return ls(r)}function GT(e){const t=Er(e);return ls(t)}function VT(e){const t=fn(e);return ls(t)}function WT(e){return[`${e}`]}function JT(e){const t=or(e);return ls(t)}function QT(e){return e.reduce((t,n)=>[...t,...ls(n)],[])}function ls(e){return Gt(e)?zT(e.$defs,e.$ref):wn(e)?KT(e.if,e.then,e.else):vn(e)?GT(e.enum):Be(e)?VT(e.allOf):Qe(e)?WT(e.const):Wt(e)?JT(e.pattern):fe(e)?QT(e.anyOf):[]}function Xl(e){return ls(e)}function oi(e,t){return t.map(n=>pi(e,n))}function pi(e,t){return gt(t)?Ir(pi(e,t.items)):xn(t)?Ei(oi(e,t.parameters),pi(e,t.instanceType)):yn(t)?Ti(oi(e,t.parameters),pi(e,t.returnType)):at(t)?Sn(oi(e,t.items)):fe(t)?Je(oi(e,t.anyOf)):Be(t)?Hn(oi(e,t.allOf)):em(t)?$e(e):t}function YT(e,t){return pi(e,t)}function ZT(e,t){const n=t in e?e[t]:Nt();return YT(e,n)}function Fh(e,t){return t.reduce((n,r)=>[...n,ZT(e,r)],[])}function XT(e,t){const n=Xl(t),r=Fh(e,n);return ar(r)}const eA=new RegExp(Mi);function tA(e){return e.filter(n=>eA.test(n))}function nA(e){const t=gf(e),n=tA(t),r=Fh(e,n);return ar(r)}function rA(e,t){return pn(t)?nA(e):XT(e,t)}function sA(e){return De(Zl(e))}function Hu(e){return e.map(t=>Lh(t))}function Lh(e){return Be(e)?Hn(Hu(e.allOf)):fe(e)?Je(Hu(e.anyOf)):Qe(e)?sA(e.const):e}function iA(e,t){return e.reduceRight((n,r,s)=>{const i=sr({},De(s),t);return Yt(i)?[r,...n]:n},[])}function oA(e,t){const n=Lh(t),r=iA(e,n);return Ds(r)}function aA(e){return Ds(e)}function cA(e,t){return Qe(t)&&g(t.const,"length")?De(e.length):pn(t)||zn(t)?aA(e):oA(e,t)}function lA(e,t){return gt(e)?qT(e.items,t):Ue(e)?rA(e.properties,t):at(e)?cA(e.items,t):Nt()}function dA(e){return Gt(e)||wn(e)||Be(e)||fe(e)?Yl(e):e}function Dh(e,t,n){return Xe([e,t])?xe(lA(dA(e),t),{},n):Ql(e,t,n)}function uA(e,t,n,r,s){const i=W(e,t,n),o=W(e,t,r);return Dh(i,o,s)}function _h(e,t={}){return Oe("InstanceType",[e],t)}function pA(e,t={}){return Uh(e,t)}function fA(e){return xn(e)?e.instanceType:Nt()}function Uh(e,t){return Xe([e])?xe(fA(e),{},t):_h(e,t)}function mA(e,t,n,r={}){const s=W(e,t,n);return Uh(s,r)}function ed(e,t={}){return Oe("KeyOf",[e],t)}function hA(e,t={}){return Bh(e,t)}function gA(){return Je([wr(),Kn(),xl()])}function bA(e){return wr()}function kA(e){return e.reduce((n,r)=>Af(r)?[...n,De(Zl(r))]:Ft(),[])}function xA(e){const t=U(e),n=kA(t);return Ds(n)}function yA(e){return ua(e)}function wA(e){const t=e.map((n,r)=>De(r));return Ds(t)}function vA(e){return $n(e)?gA():gt(e)?bA(e.items):Ue(e)?xA(e.properties):Ot(e)?yA(e):at(e)?wA(e.items):Nt()}function SA(e){return Gt(e)||wn(e)||Be(e)||fe(e)?Yl(e):e}function Bh(e,t){return Xe([e])?xe(vA(SA(e)),{},t):ed(e,t)}function jA(e,t,n,r){const s=W(e,t,n);return Bh(s,r)}function Ec(e,t,n,r,s={}){return Oe("Mapped",[e,t,n,r],s)}function IA(e,t,n,r,s={}){return Hh({},_t([],[]),e,t,n,r,s)}function CA(e){const t=or(e);return ka(t)}function EA(e){return e.reduce((t,n)=>[...t,...ka(n)],[])}function TA(e){const t=Er(e);return ka(t)}function AA(e){return Ie(e)?[De(`${e}`)]:[De(e)]}function ka(e){return vn(e)?TA(e.enum):Qe(e)?AA(e.const):Wt(e)?CA(e.pattern):fe(e)?EA(e.anyOf):[e]}function PA(e){return ka(e)}function NA(e){return Wt(e)?or(e.pattern):e}function OA(e,t,n,r,s,i){const o=kt(e,{[n.name]:r}),d=W(o,t,s),f=NA(d),u=W(o,t,i);return Pf(f)||Nf(f)?{[f.const]:u}:{}}function RA(e,t,n,r,s,i){return r.reduce((o,d)=>[...o,OA(e,t,n,d,s,i)],[])}function MA(e){return e.reduce((t,n)=>[...t,$e(n)],[])}function $A(e,t,n,r,s,i){const o=PA(r),d=RA(e,t,n,o,s,i),f=MA(d);return fn(f)}function Hh(e,t,n,r,s,i,o){return Xe([r])?xe($A(e,t,n,r,s,i),{},o):Ec(n,r,s,i,o)}function FA(e,t,n,r,s,i,o){const d=W(e,t,r);return Hh(e,t,n,d,s,i,o)}function LA(e,t,n){const r=kt(e,t);return U(t).filter(i=>n.includes(i)).reduce((i,o)=>({...i,[o]:IE(r,o,t[o])}),{})}function DA(e,t,n){const r=kt(e,t);return U(t).filter(i=>!n.includes(i)).reduce((i,o)=>({...i,[o]:W(r,_t([],[]),t[o])}),{})}function _A(e,t,n){const r=gE(t),s=LA(e,t,r),i=DA(e,t,r),o={...s,...i};return xe(o,{},n)}function qh(e,t,n,r){return _A(e,n,r)}function zh(e,t={}){return Oe("NonNullable",[e],t)}function UA(e,t={}){return Kh(e,t)}function BA(e){const t=Je([kl(),vl()]);return Wl(e,t,{})}function Kh(e,t){return Xe([e])?xe(BA(e),{},t):zh(e,t)}function HA(e,t,n,r){const s=W(e,t,n);return Kh(s,r)}function Gh(e,t,n={}){return Oe("Omit",[e,t],n)}function qA(e,t,n={}){const r=z(t)?Jl(t):t;return Wh(e,r,n)}function Vh(e){const t=Yl(e);return Ue(t)?t.properties:Ft()}function zA(e,t){return U(e).reduce((r,s)=>t.includes(s)?r:{...r,[s]:e[s]},{})}function KA(e,t){const n=Vh(e),r=Xl(t),s=zA(n,r);return $e(s)}function Wh(e,t,n){return Xe([e,t])?xe(KA(e,t),{},n):Gh(e,t,n)}function GA(e,t,n,r,s){const i=W(e,t,n),o=W(e,t,r);return Wh(i,o,s)}function Jh(e,t={}){return Oe("Parameters",[e],t)}function VA(e,t={}){return Qh(e,t)}function WA(e){const t=yn(e)?e.parameters:[],n=Hi({},_t([],[]),t);return Sn(n)}function Qh(e,t){return Xe([e])?xe(WA(e),{},t):Jh(e,t)}function JA(e,t,n,r){const s=W(e,t,n);return Qh(s,r)}function Yh(e,t={}){return Oe("Partial",[e],t)}function QA(e,t={}){return Zh(e,t)}function YA(e,t){const n=Di(e,t),r=_i(n);return Pi(kt(e,{[t]:r}),t)}function ZA(e,t,n){const r=Ls(e,t,n);return _i(r)}function XA(e){const t=fn(e);return _i(t)}function eP(e){const t=e.map(n=>_i(n));return Je(t)}function tP(e){const t=U(e).reduce((r,s)=>({...r,[s]:Fo(e[s])}),{});return $e(t)}function _i(e){return Gt(e)?YA(e.$defs,e.$ref):wn(e)?ZA(e.if,e.then,e.else):Be(e)?XA(e.allOf):fe(e)?eP(e.anyOf):Ue(e)?tP(e.properties):$e({})}function Zh(e,t){return Xe([e])?xe(_i(e),{},t):Yh(e,t)}function nP(e,t,n,r){const s=W(e,t,n);return Zh(s,r)}function Xh(e,t,n={}){return Oe("Pick",[e,t],n)}function rP(e,t,n={}){const r=z(t)?Jl(t):t;return eg(e,r,n)}function sP(e,t){return U(e).reduce((r,s)=>t.includes(s)?kt(r,{[s]:e[s]}):r,{})}function iP(e,t){const n=Vh(e),r=Xl(t),s=sP(n,r);return $e(s)}function eg(e,t,n){return Xe([e,t])?xe(iP(e,t),{},n):Xh(e,t,n)}function oP(e,t,n,r,s){const i=W(e,t,n),o=W(e,t,r);return eg(i,o,s)}function tg(e,t={}){return Oe("ReadonlyObject",[e],t)}function ng(e,t={}){return rg(e,t)}const aP=ng;function cP(e){return rd(Ir(e))}function lP(e,t){const n=Di(e,t),r=Ui(n);return Pi(kt(e,{[t]:r}),t)}function dP(e,t,n){const r=Ls(e,t,n);return Ui(r)}function uP(e){const t=fn(e);return Ui(t)}function pP(e){const t=U(e).reduce((r,s)=>({...r,[s]:_o(e[s])}),{});return $e(t)}function fP(e){return rd(Sn(e))}function mP(e){const t=e.map(n=>Ui(n));return Je(t)}function Ui(e){return gt(e)?cP(e.items):Gt(e)?lP(e.$defs,e.$ref):wn(e)?dP(e.if,e.then,e.else):Be(e)?uP(e.allOf):Ue(e)?pP(e.properties):at(e)?fP(e.items):fe(e)?mP(e.anyOf):e}function rg(e,t){return Xe([e])?xe(Ui(e),{},t):tg(e)}function hP(e,t,n,r){const s=W(e,t,n);return rg(s,r)}function gP(e,t,n,r){return t.visited.includes(r)?n:r in e?W(e,_t(t.callstack,[...t.visited,r]),e[r]):n}function bP(e,t){const n=Di(e,t),r=Bi(n);return Pi(kt(e,{[t]:r}),t)}function kP(e,t,n){const r=Ls(e,t,n);return Bi(r)}function xP(e){const t=fn(e);return Bi(t)}function yP(e){const t=e.map(n=>Bi(n));return Je(t)}function wP(e){const t=U(e).reduce((r,s)=>({...r,[s]:Gf(e[s])}),{});return $e(t)}function Bi(e){return Gt(e)?bP(e.$defs,e.$ref):wn(e)?kP(e.if,e.then,e.else):Be(e)?xP(e.allOf):fe(e)?yP(e.anyOf):Ue(e)?wP(e.properties):$e({})}function sg(e,t={}){return Oe("Required",[e],t)}function vP(e,t={}){return ig(e,t)}function ig(e,t){return Xe([e])?xe(Bi(e),{},t):sg(e,t)}function SP(e,t,n,r){const s=W(e,t,n);return ig(s,r)}function og(e,t={}){return Oe("ReturnType",[e],t)}function jP(e,t={}){return ag(e,t)}function IP(e){return yn(e)?e.returnType:Nt()}function ag(e,t){return Xe([e])?xe(IP(e),{},t):og(e,t)}function CP(e,t,n,r={}){const s=W(e,t,n);return ag(s,r)}function cg(e,t){return Oe("With",[e,t],{})}function lg(e,t){return dg(e,t)}function dg(e,t){return Xe([e])?xe(e,{},t):cg(e,t)}function EP(e,t,n,r){const s=W(e,t,n);return dg(s,r)}function TP(e){return fa(e)?at(e.items)?ug(e.items.items):ln(e.items)?[e]:vt(e.items)?[e]:[Nt()]:[e]}function ug(e){return e.reduce((n,r)=>[...n,...TP(r)],[])}function _t(e,t){return{callstack:e,visited:t}}function Xe(e){return Ae(e,(t,n)=>vt(t)?!1:Xe(n),()=>!0)}function td(e,t,n){return U(n).reduce((r,s)=>({...r,[s]:W(e,t,n[s])}),{})}function Hi(e,t,n){const r=Xn(e,t,n);return ug(r)}function Xn(e,t,n){return n.map(r=>W(e,t,r))}function AP(e,t){const n=cn(e)?ul(t,{}):t,r=Uo(e)?dl(n,{}):n;return Do(e)?nd(r,{}):r}function PP(e,t,n,r,s){return g(n,"AddImmutable")?RP(e,t,r[0],s):g(n,"RemoveImmutable")?nT(e,t,r[0],s):g(n,"AddReadonly")?ev(e,t,r[0],s):g(n,"RemoveReadonly")?lS(e,t,r[0],s):g(n,"AddOptional")?nv(e,t,r[0],s):g(n,"RemoveOptional")?fS(e,t,r[0],s):g(n,"Capitalize")?hT(e,t,r[0],s):g(n,"Conditional")?wT(e,t,r[0],r[1],r[2],r[3],s):g(n,"ConstructorParameters")?jT(e,t,r[0],s):g(n,"Evaluate")?NE(e,t,r[0],s):g(n,"Exclude")?CT(e,t,r[0],r[1],s):g(n,"Extract")?NT(e,t,r[0],r[1],s):g(n,"Index")?uA(e,t,r[0],r[1],s):g(n,"InstanceType")?mA(e,t,r[0],s):g(n,"Interface")?uE(e,t,r[0],r[1],s):g(n,"KeyOf")?jA(e,t,r[0],s):g(n,"Lowercase")?gT(e,t,r[0],s):g(n,"Mapped")?FA(e,t,r[0],r[1],r[2],r[3],s):g(n,"Module")?qh(e,t,r[0],s):g(n,"NonNullable")?HA(e,t,r[0],s):g(n,"Pick")?oP(e,t,r[0],r[1],s):g(n,"Parameters")?JA(e,t,r[0],s):g(n,"Partial")?nP(e,t,r[0],s):g(n,"Omit")?GA(e,t,r[0],r[1],s):g(n,"ReadonlyObject")?hP(e,t,r[0],s):g(n,"Record")?US(e,t,r[0],r[1],s):g(n,"Required")?SP(e,t,r[0],s):g(n,"ReturnType")?CP(e,t,r[0],s):g(n,"TemplateLiteral")?i2(e,t,r[0],s):g(n,"Uncapitalize")?bT(e,t,r[0],s):g(n,"Uppercase")?kT(e,t,r[0],s):g(n,"With")?EP(e,t,r[0],r[1]):Oe(n,r,s)}function NP(e,t,n){const r=vt(n)?gP(e,t,n,n.$ref):gt(n)?Ir(W(e,t,n.items),pl(n)):Vl(n)?kh(e,t,n.target,n.arguments):xn(n)?Ei(Xn(e,t,n.parameters),W(e,t,n.instanceType),rv(n)):yn(n)?Ti(Xn(e,t,n.parameters),W(e,t,n.returnType),sv(n)):wn(n)?Lo(W(e,t,n.if),W(e,t,n.then),W(e,t,n.else),dv(n)):Be(n)?Hn(Xn(e,t,n.allOf),hv(n)):Ue(n)?$e(td(e,t,n.properties),cv(n)):Ot(n)?BS(jn(n),W(e,t,Vt(n))):fa(n)?pa(W(e,t,n.items)):at(n)?Sn(Hi(e,t,n.items),aS(n)):fe(n)?Je(Xn(e,t,n.anyOf),Zv(n)):n;return AP(n,r)}function W(e,t,n){return Ps(n)?PP(e,t,n.action,n.parameters,n.options):NP(e,t,n)}function Bs(e,t){return W(e,_t([],[]),t)}function OP(e){return xe(e,{"~immutable":!0},{})}function nd(e,t){return xe(OP(e),{},t)}function RP(e,t,n,r){const s=W(e,t,n);return nd(s,r)}function MP(e,t={}){return Oe("AddImmutable",[e],t)}function rd(e,t={}){return nd(e,t)}function $P(e,t={}){return Oe("Evaluate",[e],t)}function Gn(e,t={}){return hh(e,t)}function FP(e,t={}){return Oe("Module",[e],t)}function LP(e,t={}){return qh({},_t([],[]),e,t)}function DP(e,t){const n=ba(e,t);return g(n,"right-inside")||g(n,"disjoint")?1:0}function pg(e,t,n=[]){return Ae(t,(r,s)=>g(DP(e,r),1)?pg(e,s,[...n,r]):[...n,e,...t],()=>[...n,e])}function fg(e,t=[]){return Ae(e,(n,r)=>fg(r,pg(n,t)),()=>t)}function _P(e){return fg(e)}function UP(...e){const[t,n,r]=ut(e,{2:(o,d)=>pe(o)?[{},o,d]:[o,d,{}],3:(o,d,f)=>[o,d,f],1:o=>[{},o,{}]}),s=zC(n),i=z(s)&&g(s.length,2)?W(t,_t([],[]),s[0]):Nt();return xe(i,{},r)}const c=Object.freeze(Object.defineProperty({__proto__:null,Any:ml,Array:Ir,BigInt:bl,Boolean:Ef,Call:XE,Capitalize:aT,Codec:hl,Conditional:xT,Constructor:Ei,ConstructorParameters:vT,Cyclic:Pi,Decode:Dv,DecodeBuilder:Cf,Dependent:Lo,Encode:_v,EncodeBuilder:If,Enum:mv,Evaluate:Gn,Exclude:IT,Extends:sr,ExtendsResult:l2,Extract:ET,Function:Ti,Generic:Ai,Identifier:hc,Immutable:Uv,Index:RT,Infer:fc,InstanceType:pA,Instantiate:Bs,Integer:aa,Interface:pE,Intersect:Hn,IsAny:$n,IsArray:gt,IsBigInt:is,IsBoolean:Cr,IsCall:Vl,IsCodec:dn,IsConstructor:xn,IsCyclic:Gt,IsDependent:wn,IsEnum:vn,IsEnumValue:fv,IsFunction:yn,IsGeneric:fl,IsIdentifier:Gv,IsImmutable:Do,IsInfer:ln,IsInteger:zn,IsIntersect:Be,IsKind:Ce,IsLiteral:Qe,IsNever:Fs,IsNull:Ni,IsNumber:pn,IsObject:Ue,IsOptional:cn,IsParameter:Yv,IsReadonly:Uo,IsRecord:Ot,IsRef:vt,IsRefine:gl,IsRest:fa,IsSchema:an,IsString:Fn,IsSymbol:Oi,IsTemplateLiteral:Wt,IsThis:em,IsTuple:at,IsUndefined:_s,IsUnion:fe,IsUnknown:An,IsUnsafe:kf,IsVoid:os,KeyOf:hA,Literal:De,Lowercase:cT,Mapped:IA,Module:LP,Never:Nt,NonNullable:UA,Null:kl,Number:wr,Object:$e,Omit:qA,Optional:ov,Parameter:Ri,Parameters:VA,Partial:QA,Pick:rP,Readonly:Bv,ReadonlyObject:ng,ReadonlyType:aP,Record:wl,RecordKey:ua,RecordPattern:jn,RecordValue:Vt,Ref:gn,Refine:qv,Required:vP,Rest:pa,ReturnType:jP,Script:UP,String:Kn,Symbol:xl,TemplateLiteral:c2,This:Xf,Tuple:Sn,Uncapitalize:lT,Undefined:vl,Union:Je,Unknown:Kt,Unsafe:lv,Uppercase:dT,Void:tm,With:lg},Symbol.toStringTag,{value:"Module"}));function xa(e){return E(e,"~refine")&&z(e["~refine"])&&ht(e["~refine"],0,t=>re(t)&&E(t,"check")&&E(t,"error")&&Tn(t.check)&&Tn(t.error))}function un(e){return re(e)&&!z(e)}function qi(e){return xt(e)}function _e(e){return un(e)||qi(e)}function zi(e){return E(e,"additionalItems")&&_e(e.additionalItems)}function lr(e){return E(e,"additionalProperties")&&_e(e.additionalProperties)}function ya(e){return E(e,"allOf")&&z(e.allOf)&&e.allOf.every(t=>_e(t))}function qo(e){return E(e,"$anchor")&&pe(e.$anchor)}function wa(e){return E(e,"anyOf")&&z(e.anyOf)&&e.anyOf.every(t=>_e(t))}function va(e){return E(e,"const")}function ds(e){return E(e,"contains")&&_e(e.contains)}function BP(e){return E(e,"contentEncoding")&&pe(e.contentEncoding)}function HP(e){return E(e,"contentMediaType")&&pe(e.contentMediaType)}function Ar(e){return E(e,"default")}function qP(e){return E(e,"$defs")&&re(e.$defs)&&Object.values(e.$defs).every(t=>_e(t))}function Ki(e){return E(e,"dependencies")&&re(e.dependencies)&&Object.values(e.dependencies).every(t=>_e(t)||z(t)&&t.every(n=>pe(n)))}function Gi(e){return E(e,"dependentRequired")&&re(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>z(t)&&t.every(n=>pe(n)))}function Vi(e){return E(e,"dependentSchemas")&&re(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>_e(t))}function Yr(e){return E(e,"$dynamicAnchor")&&pe(e.$dynamicAnchor)}function Sa(e){return E(e,"$dynamicRef")&&pe(e.$dynamicRef)}function ja(e){return E(e,"else")&&_e(e.else)}function Ia(e){return E(e,"enum")&&z(e.enum)}function Wi(e){return E(e,"exclusiveMaximum")&&(Ie(e.exclusiveMaximum)||st(e.exclusiveMaximum))}function Pr(e){return E(e,"exclusiveMinimum")&&(Ie(e.exclusiveMinimum)||st(e.exclusiveMinimum))}function Hs(e){return E(e,"format")&&pe(e.format)}function Sr(e){return E(e,"$id")&&pe(e.$id)}function Ca(e){return E(e,"if")&&_e(e.if)}function Nr(e){return E(e,"items")&&(_e(e.items)||z(e.items)&&e.items.every(t=>_e(t)))}function Ea(e){return Nr(e)&&z(e.items)}function zP(e){return Nr(e)&&!z(e.items)}function Ji(e){return E(e,"maximum")&&(Ie(e.maximum)||st(e.maximum))}function Qi(e){return E(e,"maxContains")&&Ie(e.maxContains)}function qs(e){return E(e,"maxItems")&&Ie(e.maxItems)}function Yi(e){return E(e,"maxLength")&&Ie(e.maxLength)}function Zi(e){return E(e,"maxProperties")&&Ie(e.maxProperties)}function Or(e){return E(e,"minimum")&&(Ie(e.minimum)||st(e.minimum))}function us(e){return E(e,"minContains")&&Ie(e.minContains)}function ps(e){return E(e,"minItems")&&Ie(e.minItems)}function zs(e){return E(e,"minLength")&&Ie(e.minLength)}function Ks(e){return E(e,"minProperties")&&Ie(e.minProperties)}function Xi(e){return E(e,"multipleOf")&&(Ie(e.multipleOf)||st(e.multipleOf))}function Ta(e){return E(e,"not")&&_e(e.not)}function Aa(e){return E(e,"oneOf")&&z(e.oneOf)&&e.oneOf.every(t=>_e(t))}function Gs(e){return E(e,"pattern")&&(pe(e.pattern)||e.pattern instanceof RegExp)}function fs(e){return E(e,"patternProperties")&&re(e.patternProperties)&&Object.values(e.patternProperties).every(t=>_e(t))}function dr(e){return E(e,"prefixItems")&&z(e.prefixItems)&&e.prefixItems.every(t=>_e(t))}function ms(e){return E(e,"properties")&&re(e.properties)&&Object.values(e.properties).every(t=>_e(t))}function eo(e){return E(e,"propertyNames")&&(re(e.propertyNames)||_e(e.propertyNames))}function mg(e){return E(e,"$recursiveAnchor")&&xt(e.$recursiveAnchor)}function Eo(e){return mg(e)&&g(e.$recursiveAnchor,!0)}function Pa(e){return E(e,"$recursiveRef")&&pe(e.$recursiveRef)}function Na(e){return E(e,"$ref")&&pe(e.$ref)}function ur(e){return E(e,"required")&&z(e.required)&&e.required.every(t=>pe(t))}function Oa(e){return E(e,"then")&&_e(e.then)}function to(e){return E(e,"type")&&(pe(e.type)||z(e.type)&&e.type.every(t=>pe(t)))}function jr(e){return E(e,"uniqueItems")&&xt(e.uniqueItems)}function Vs(e){return E(e,"unevaluatedItems")&&_e(e.unevaluatedItems)}function Ws(e){return E(e,"unevaluatedProperties")&&_e(e.unevaluatedProperties)}function KP(e){return Vs(e)||Ws(e)||$s(U(e),t=>zo(e[t]))}function GP(e){return $s(e,t=>zo(t))}function zo(e){return z(e)?GP(e):re(e)?KP(e):!1}function hg(e,t){return zo(t)||$s(U(e),n=>zo(e[n]))}class gg{constructor(t){this.hasUnevaluated=t}UseUnevaluated(){return this.hasUnevaluated}Push(){return Ve(ke("context","Push"),[])}Pop(){return Ve(ke("context","Pop"),[])}AddIndex(t){return Ve(ke("context","AddIndex"),[t])}AddKey(t){return Ve(ke("context","AddKey"),[t])}Merge(t){return Ve(ke("context","Merge"),[t])}}class Vn{constructor(){const t=new Set,n=new Set;this.stack=[{indices:t,keys:n}]}Push(){const t=new Set,n=new Set;return this.stack.push({indices:t,keys:n}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(const n of t)n.GetIndices().forEach(r=>this.GetIndices().add(r)),n.GetKeys().forEach(r=>this.GetKeys().add(r));return!0}}class sd extends Vn{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}}class Wn extends sd{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}}const Ko={identifier:"External",variables:[]};function hs(e){const t=`External[${Ko.variables.length}]`;return Ko.variables.push(e),t}function bg(){Ko.variables=[]}function kg(){return{...Ko}}function xg(e,t,n,r){const s=hs(n["~refine"].map(i=>i));return qn(s,V(0),["refinement","_"],Ve(ke("refinement","check"),[r]))}function yg(e,t,n,r){return ht(n["~refine"],0,(s,i)=>s.check(r))}function wg(e,t,n,r,s,i){return Pt(s["~refine"],0,(o,d)=>o.check(i)||t.AddError({keyword:"~refine",schemaPath:n,instancePath:r,params:{index:d,message:o.error(i)}}))}let VP=0;function dt(){return`var_${VP++}`}function id(e){return Nr(e)&&z(e.items)}function WP(e,t,n,r){const[s,i]=[dt(),dt()],o=Ln(e,t,n.additionalItems,s),d=ol(i,V(n.items.length)),f=t.AddIndex(i);return qn(r,V(0),[s,i],Ge(d,Ct(o,f)))}function JP(e,t,n,r){const[s,i]=[dt(),dt()],o=Ln(e,t,n.additionalItems,s),d=ol(i,V(n.items.length));return qn(r,V(0),[s,i],Ge(d,o))}function vg(e,t,n,r){return id(n)?t.UseUnevaluated()?WP(e,t,n,r):JP(e,t,n,r):V(!0)}function Sg(e,t,n,r){return id(n)?ht(r,0,(i,o)=>Si(o,n.items.length)||Rr(e,t,n.additionalItems,i)&&t.AddIndex(o)):!0}function jg(e,t,n,r,s,i){return id(s)?ht(i,0,(d,f)=>{const u=`${n}/additionalItems`,m=`${r}/${f}`;return Si(f,s.items.length)||Mr(e,t,u,m,s.additionalItems,d)&&t.AddIndex(f)}):!0}function QP(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function od(e){const t=[];return fs(e)&&t.push(...U(e.patternProperties)),ms(e)&&t.push(...U(e.properties).map(QP)),g(t.length,0)?"(?!)":`(${t.join("|")})`}function Ig(e,t,n){return ur(t)&&ms(t)&&!fs(t)&&g(t.additionalProperties,!1)&&g(U(t.properties).length,t.required.length)}function Cg(e,t,n){return Zt(ke(Ve(ke("Object","getOwnPropertyNames"),[n]),"length"),V(t.required.length))}function Eg(e,t,n,r){const[s,i]=[dt(),dt()],o=hs(new RegExp(od(n))),d=Ln(e,t,n.additionalProperties,`${r}[${s}]`),f=Ve(ke(o,"test"),[s]),u=t.AddKey(s),m=t.UseUnevaluated()?Ge(f,Ct(d,u)):Ge(f,d);return qn(ss(r),V(0),[s,i],m)}function Tg(e,t,n,r){return Ig(t,n)?Cg(t,n,r):Eg(e,t,n,r)}function Ag(e,t,n,r){const s=new RegExp(od(n));return ht(U(r),0,(o,d)=>s.test(o)||Rr(e,t,n.additionalProperties,r[o])&&t.AddKey(o))}function Pg(e,t,n,r,s,i){const o=new RegExp(od(s)),d=[];return Pt(U(i),0,(u,m)=>{const p=`${n}/additionalProperties`,h=`${r}/${u}`,b=new Wn,k=o.test(u)||Mr(e,b,p,h,s.additionalProperties,i[u])&&t.AddKey(u);return k||d.push(u),k})||t.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:r,params:{additionalProperties:d}})}function no(e,t,n,r,s){const i=tr("results","[]"),o=n.map((m,p)=>tr(`context_${p}`,al("CheckContext",[]))),d=n.map((m,p)=>tr(`condition_${p}`,Ve(xr(["context"],ct(e,t,m,r)),[`context_${p}`]))),f=n.map((m,p)=>uf(`condition_${p}`,Ve(ke("results","push"),[`context_${p}`]))),u=ia(Ct(s,t.Merge("results")));return Ve(xr([],sa([i,...o,...d,...f,u])),[])}function YP(e,t,n,r){return no(e,t,n.allOf,r,Zt(ke("results","length"),V(n.allOf.length)))}function ZP(e,t,n,r){return Tt(n.allOf.map(s=>ct(e,t,s,r)))}function Ng(e,t,n,r){return t.UseUnevaluated()?YP(e,t,n,r):ZP(e,t,n,r)}function Og(e,t,n,r){const s=n.allOf.reduce((i,o)=>{const d=new Vn;return lt(e,d,o,r)?[...i,d]:i},[]);return g(s.length,n.allOf.length)&&t.Merge(s)}function Rg(e,t,n,r,s,i){const o=[],d=s.allOf.reduce((u,m,p)=>{const h=`${n}/allOf/${p}`,b=new Wn,k=At(e,b,h,r,m,i);return k||o.push(b),k?[...u,b]:u},[]),f=g(d.length,s.allOf.length)&&t.Merge(d);return f||o.forEach(u=>u.GetErrors().forEach(m=>t.AddError(m))),f}function XP(e,t,n,r){return no(e,t,n.anyOf,r,cf(ke("results","length"),V(0)))}function eN(e,t,n,r){return cl(n.anyOf.map(s=>ct(e,t,s,r)))}function Mg(e,t,n,r){return t.UseUnevaluated()?XP(e,t,n,r):eN(e,t,n,r)}function $g(e,t,n,r){const s=n.anyOf.reduce((i,o)=>{const d=new Vn;return lt(e,d,o,r)?[...i,d]:i},[]);return ts(s.length,0)&&t.Merge(s)}function Fg(e,t,n,r,s,i){const o=[],d=s.anyOf.reduce((u,m,p)=>{const h=new Wn,b=`${n}/anyOf/${p}`,k=At(e,h,b,r,m,i);return k||o.push(h),k?[...u,h]:u},[]),f=ts(d.length,0)&&t.Merge(d);return f||o.forEach(u=>u.GetErrors().forEach(m=>t.AddError(m))),f||t.AddError({keyword:"anyOf",schemaPath:n,instancePath:r,params:{}})}function Lg(e,t,n,r){return V(!!n)}function ad(e,t,n,r){return n}function Dg(e,t,n,r,s,i){return ad(e,t,s)||t.AddError({keyword:"boolean",schemaPath:n,instancePath:r,params:{}})}function _g(e,t,n,r){return Ms(n.const)?Zt(r,V(n.const)):df(r,hs(n.const))}function cd(e,t,n,r){return Ms(n.const)?g(r,n.const):ns(r,n.const)}function Ug(e,t,n,r,s,i){return cd(e,t,s,i)||t.AddError({keyword:"const",schemaPath:n,instancePath:r,params:{allowedValue:s.const}})}function Bg(e){return!(us(e)&&g(e.minContains,0))}function tN(e,t,n,r){const[s,i]=[dt(),dt()],o=$t(Zt(ke(r,"length"),V(0))),d=Mw(r,[s,i],Ct(ct(e,t,n.contains,s),t.AddIndex(i)));return Ct(o,d)}function nN(e,t,n,r){const[s]=[dt()],i=$t(Zt(ke(r,"length"),V(0))),o=Rw(r,[s,"_"],ct(e,t,n.contains,s));return Ct(i,o)}function Hg(e,t,n,r){return Bg(n)?t.UseUnevaluated()?tN(e,t,n,r):nN(e,t,n,r):V(!0)}function ld(e,t,n,r){return Bg(n)?!g(r.length,0)&&tf(r,(s,i)=>lt(e,t,n.contains,s)&&t.AddIndex(i)):!0}function qg(e,t,n,r,s,i){return ld(e,t,s,i)||t.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:1}})}function zg(e,t,n,r){const s=Zt(ke(ss(r),"length"),V(0)),i=Tt(it(n.dependencies).map(([o,d])=>{const f=$t(Vr(r,V(o))),u=ct(e,t,d,r),m=p=>Tt(p.map(h=>Vr(r,V(h))));return Ge(f,z(d)?m(d):u)}));return Ge(s,i)}function Kg(e,t,n,r){const s=g(U(r).length,0),i=ht(it(n.dependencies),0,([o,d])=>!E(r,o)||(z(d)?d.every(f=>E(r,f)):lt(e,t,d,r)));return s||i}function Gg(e,t,n,r,s,i){const o=g(U(i).length,0),d=Pt(it(s.dependencies),0,([f,u])=>{const m=`${n}/dependencies/${f}`;return!E(i,f)||(z(u)?u.every(p=>E(i,p)||t.AddError({keyword:"dependencies",schemaPath:n,instancePath:r,params:{property:f,dependencies:u}})):At(e,t,m,r,u,i))});return o||d}function Vg(e,t,n,r){const s=Zt(ke(ss(r),"length"),V(0)),i=Tt(it(n.dependentRequired).map(([o,d])=>{const f=$t(Vr(r,V(o))),u=Tt(d.map(m=>Vr(r,V(m))));return Ge(f,u)}));return Ge(s,i)}function Wg(e,t,n,r){const s=g(U(r).length,0),i=ht(it(n.dependentRequired),0,([o,d])=>!E(r,o)||d.every(f=>E(r,f)));return s||i}function Jg(e,t,n,r,s,i){const o=g(U(i).length,0),d=Pt(it(s.dependentRequired),0,([f,u])=>!E(i,f)||Pt(u,0,m=>E(i,m)||t.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:r,params:{property:f,dependencies:u}})));return o||d}function Qg(e,t,n,r){const s=Zt(ke(ss(r),"length"),V(0)),i=Tt(it(n.dependentSchemas).map(([o,d])=>{const f=$t(Vr(r,V(o))),u=ct(e,t,d,r);return Ge(f,u)}));return Ge(s,i)}function Yg(e,t,n,r){const s=g(U(r).length,0),i=ht(it(n.dependentSchemas),0,([o,d])=>!E(r,o)||lt(e,t,d,r));return s||i}function Zg(e,t,n,r,s,i){const o=g(U(i).length,0),d=Pt(it(s.dependentSchemas),0,([f,u])=>{const m=`${n}/dependentSchemas/${f}`;return!E(i,f)||At(e,t,m,r,u,i)});return o||d}function rN(e,t,n,r){const s=e.DynamicRef(n)??!1;return Js(e,t,s,r)}function sN(e,t,n,r){const s=e.DynamicRef(n)??!1;return _e(s)&&lt(e,t,s,r)}function iN(e,t,n,r,s,i){const o=e.DynamicRef(s)??!1;return _e(o)&&At(e,t,"#",r,o,i)}function Xg(e,t,n,r){return cl(n.enum.map(s=>{if(Ms(s))return Zt(r,V(s));const i=hs(s);return df(r,i)}))}function dd(e,t,n,r){return $s(n.enum,s=>Ms(s)?g(r,s):ns(r,s))}function eb(e,t,n,r,s,i){return dd(e,t,s,i)||t.AddError({keyword:"enum",schemaPath:n,instancePath:r,params:{allowedValues:s.enum}})}function tb(e,t,n,r){return ol(r,V(n.exclusiveMaximum))}function ud(e,t,n,r){return Si(r,n.exclusiveMaximum)}function nb(e,t,n,r,s,i){return ud(e,t,s,i)||t.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:r,params:{comparison:"<",limit:s.exclusiveMaximum}})}function rb(e,t,n,r){return cf(r,V(n.exclusiveMinimum))}function pd(e,t,n,r){return ts(r,n.exclusiveMinimum)}function sb(e,t,n,r,s,i){return pd(e,t,s,i)||t.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:r,params:{comparison:">",limit:s.exclusiveMinimum}})}const oN=[0,31,28,31,30,31,30,31,31,30,31,30,31],aN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function cN(e){return e%4===0&&(e%100!==0||e%400===0)}function fd(e){const t=aN.exec(e);if(!t)return!1;const n=+t[1],r=+t[2],s=+t[3];return r>=1&&r<=12&&s>=1&&s<=(r===2&&cN(n)?29:oN[r])}const lN=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function md(e,t=!0){const n=lN.exec(e);if(!n)return!1;const r=+n[1],s=+n[2],i=+n[3],o=n[4]==="-"?-1:1,d=+(n[5]||0),f=+(n[6]||0);if(d>23||f>59||t&&!n[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(r<=23&&s<=59&&i<60)return!0;const u=s-f*o,m=r-d*o-(u<0?1:0);return(m===23||m===-1)&&(u===59||u===-1)&&i<61}function ib(e,t=!0){const n=e.split(/T/i);return n.length===2&&fd(n[0])&&md(n[1],t)}const dN=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function ob(e){return dN.test(e)}const uN=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i;function ab(e){return uN.test(e)}const qr=36,To=1,Tc=26,pN=38,fN=700,mN=72,hN=128;function gN(e,t,n){e=n?Math.floor(e/fN):e>>1,e+=Math.floor(e/t);let r=0;for(;e>(qr-To)*Tc>>1;)e=Math.floor(e/(qr-To)),r+=qr;return r+Math.floor((qr-To+1)*e/(e+pN))}function bN(e){const t=[];let n=hN,r=0,s=mN;const i=e.lastIndexOf("-");if(i>0)for(let d=0;d<i;d++){const f=e.charCodeAt(d);if(f>=128)throw new Error("Invalid punycode: non-basic before delimiter");t.push(f)}let o=i<0?0:i+1;for(;o<e.length;){const d=r;let f=1,u=qr;for(;;){if(o>=e.length)throw new Error("Invalid punycode: unexpected end of input");const p=e.charCodeAt(o++);let h;if(p>=97&&p<=122)h=p-97;else if(p>=48&&p<=57)h=p-48+26;else if(p>=65&&p<=90)Ft();else throw new Error("Invalid punycode: bad digit character");r+=h*f;const b=u<=s?To:u>=s+Tc?Tc:u-s;if(h<b)break;f*=qr-b,u+=qr}const m=t.length+1;s=gN(r-d,m,d===0),n+=Math.floor(r/m),r%=m,t.splice(r,0,n),r++}return globalThis.String.fromCodePoint(...t)}function kN(e){return new RegExp("\\p{Mn}","u").test(String.fromCodePoint(e))}function xN(e){return new RegExp("\\p{Mc}","u").test(String.fromCodePoint(e))}function yN(e){return new RegExp("\\p{Me}","u").test(String.fromCodePoint(e))}function wN(e){return kN(e)||xN(e)||yN(e)}const vN=new Set([1600,2042,12334,12335,12337,12338,12339,12340,12341,12347]),SN=new Set([2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,6980,7082,7083,43456,69702,69759,69817,69939,69940,70080,70197,70477,70722,70850,71103,71231,71350,72767,73028,73029]);function jN(e){return new RegExp("\\p{Script=Greek}","u").test(String.fromCodePoint(e))}function IN(e){return new RegExp("\\p{Script=Hebrew}","u").test(String.fromCodePoint(e))}function CN(e){return new RegExp("\\p{Script=Hiragana}","u").test(String.fromCodePoint(e))}function EN(e){return new RegExp("\\p{Script=Katakana}","u").test(String.fromCodePoint(e))}function TN(e){return new RegExp("\\p{Script=Han}","u").test(String.fromCodePoint(e))}function AN(e){return e>=1632&&e<=1641}function PN(e){return e>=1776&&e<=1785}function qu(e){return SN.has(e)}function cb(e){if(e.length===0)return Ft();const t=[...e].map(o=>o.codePointAt(0)),n=t.length;if(t[0]===45||t[n-1]===45||n>=4&&t[2]===45&&t[3]===45||wN(t[0]))return!1;let r=!1,s=!1,i=!1;for(let o=0;o<n;o++){const d=t[o];if(vN.has(d))return!1;(CN(d)||EN(d)||TN(d))&&(r=!0),AN(d)&&(s=!0),PN(d)&&(i=!0);const f=t[o-1],u=t[o+1];switch(d){case 183:if(f!==108||u!==108)return!1;break;case 885:if(u===void 0||!jN(u))return!1;break;case 1523:case 1524:if(f===void 0||!IN(f))return!1;break;case 8204:if(f===void 0||f<128&&!qu(f))return!1;break;case 8205:if(f===void 0||!qu(f))return!1;break}}return!(e.includes("・")&&!r||s&&i)}function NN(e){if(e.charCodeAt(0)===45||e.charCodeAt(e.length-1)===45||e.length>=4&&e.charCodeAt(2)===45&&e.charCodeAt(3)===45)return!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||n===45))return!1}return!0}function lb(e){return e.toLowerCase().startsWith("xn--")}function db(e){try{const t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;const r=bN(t);return r?cb(r):!1}catch{return!1}}function ON(e){return e.length===0||e.length>63?!1:lb(e)?db(e):cb(e)}function RN(e){return e.length===0||e.length>63?!1:lb(e)?db(e):NN(e)}function ub(e){if(e.length===0||e.length>253||e.charCodeAt(e.length-1)===46)return!1;for(const t of e.split("."))if(!RN(t))return!1;return!0}const MN=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function pb(e){return MN.test(e)}function fb(e){if(e.length===0||e.includes(" "))return!1;const t=e.normalize("NFC").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".");if(t.length>253)return!1;for(const n of t.split("."))if(!ON(n))return!1;return!0}function mb(e,t,n){let r=0,s=0,i=0,o=0;for(let d=t;d<n;d++){const f=e.charCodeAt(d);if(f===46){if(i===0||s>255||o===48&&i>1)return!1;r++,s=0,i=0,o=0}else if(f>=48&&f<=57)i===0&&(o=f),s=s*10+(f-48),i++;else return!1}return r===3&&i>0&&s<=255&&!(o===48&&i>1)}function hb(e){return mb(e,0,e.length)}function $N(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function gb(e){const t=e.length;if(t===0)return!1;let n=0,r=!1,s=0;if(e.charCodeAt(0)===58&&e.charCodeAt(1)===58){if(t===2)return!0;r=!0,s=2}for(;s<t;){let i=0;const o=s;for(;s<t&&$N(e.charCodeAt(s));)s++,i++;if(i===0)return!1;const d=e.charCodeAt(s);if(d===46){if(!mb(e,o,t))return!1;n+=2,s=t;break}if(i>4)return!1;if(n++,s===t)break;if(d!==58)return!1;if(s++,e.charCodeAt(s)===58){if(r||e.charCodeAt(s+1)===58)return!1;if(r=!0,s++,s===t)break}}return r?n<=7:n===8}function zu(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function bb(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;const t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?zu(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:zu(e)}function kb(e){try{return new URL(e),!0}catch{return!1}}const FN=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function xb(e){return FN.test(e)}const LN=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function yb(e){return LN.test(e)}function wb(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}const DN=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function vb(e){return DN.test(e)}const _N=/^(?!.*[^\x00-\x7F])(?!.*\\)(?:(?:[a-z][a-z0-9+\-.]*:)?(?:\/\/[^\s[\]{}<>^`|]*)?|[^\s[\]{}<>^`|]*)(?:\?[^\s[\]{}<>^`|]*)?(?:#[^\s[\]{}<>^`|]*)?$/i;function Sb(e){return _N.test(e)}const UN=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;function jb(e){return UN.test(e)}function Ib(e){return e>=97&&e<=122||e>=65&&e<=90}function Cb(e){return Ib(e)||e>=48&&e<=57}function vo(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function BN(e){return Cb(e)||e===43||e===45||e===46}function Ac(e){return Cb(e)||e===45||e===46||e===95||e===126}function Pc(e){return e===33||e===36||e===38||e===39||e===40||e===41||e===42||e===43||e===44||e===59||e===61}function HN(e){return Ac(e)||Pc(e)||e===58||e===64}function Eb(e){const t=e.length;if(t===0||!Ib(e.charCodeAt(0)))return!1;let n=1;for(;n<t;){const r=e.charCodeAt(n);if(r===58)break;if(!BN(r))return!1;n++}if(e.charCodeAt(n)!==58)return!1;if(n++,e.charCodeAt(n)===47&&e.charCodeAt(n+1)===47){n+=2;const r=n;let s=-1;for(let i=n;i<t;i++){const o=e.charCodeAt(i);if(o===64){s=i;break}if(o===47||o===63||o===35)break}if(s!==-1){for(let i=r;i<s;i++){const o=e.charCodeAt(i);if(o===91||o===93)return!1;if(o===37){if(i+2>=s||!vo(e.charCodeAt(i+1))||!vo(e.charCodeAt(i+2)))return!1;i+=2}else if(!Ac(o)&&!Pc(o)&&o!==58)return!1}n=s+1}if(e.charCodeAt(n)===91){for(n++;n<t&&e.charCodeAt(n)!==93;)n++;if(e.charCodeAt(n)!==93)return!1;n++}else for(;n<t;){const i=e.charCodeAt(n);if(i===47||i===63||i===35||i===58)break;if(i<128&&!Ac(i)&&!Pc(i))return!1;n++}if(e.charCodeAt(n)===58)for(n++;n<t;){const i=e.charCodeAt(n);if(i===47||i===63||i===35)break;if(i<48||i>57)return!1;n++}}for(;n<t;){const r=e.charCodeAt(n);if(r===37){if(n+2>=t||!vo(e.charCodeAt(n+1))||!vo(e.charCodeAt(n+2)))return!1;n+=2}else{if(r>127)return!1;if(!(HN(r)||r===47||r===63||r===35))return!1}n++}return!0}const qN=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;function Tb(e){return qN.test(e)}const zN=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Ab(e){return zN.test(e)}const ze=new Map;function Pb(){ze.clear()}function KN(){return[...ze.entries()]}function GN(e,t){ze.set(e,t)}function VN(e){return ze.has(e)}function WN(e){return ze.get(e)}function Nb(e,t){var n;return((n=ze.get(e))==null?void 0:n(t))??!0}function Ob(){Pb(),ze.set("date-time",ib),ze.set("date",fd),ze.set("duration",ob),ze.set("email",ab),ze.set("hostname",ub),ze.set("idn-email",pb),ze.set("idn-hostname",fb),ze.set("ipv4",hb),ze.set("ipv6",gb),ze.set("iri-reference",bb),ze.set("iri",kb),ze.set("json-pointer-uri-fragment",xb),ze.set("json-pointer",yb),ze.set("regex",wb),ze.set("relative-json-pointer",vb),ze.set("time",md),ze.set("uri-reference",Sb),ze.set("uri-template",jb),ze.set("uri",Eb),ze.set("url",Tb),ze.set("uuid",Ab)}Ob();const JN=Object.freeze(Object.defineProperty({__proto__:null,Clear:Pb,Entries:KN,Get:WN,Has:VN,IsDate:fd,IsDateTime:ib,IsDuration:ob,IsEmail:ab,IsHostname:ub,IsIPv4:hb,IsIPv6:gb,IsIdnEmail:pb,IsIdnHostname:fb,IsIri:kb,IsIriReference:bb,IsJsonPointer:yb,IsJsonPointerUriFragment:xb,IsRegex:wb,IsRelativeJsonPointer:vb,IsTime:md,IsUri:Eb,IsUriReference:Sb,IsUriTemplate:jb,IsUrl:Tb,IsUuid:Ab,Reset:Ob,Set:GN,Test:Nb},Symbol.toStringTag,{value:"Module"}));function Rb(e,t,n,r){return Ve(ke("Format","Test"),[V(n.format),r])}function hd(e,t,n,r){return Nb(n.format,r)}function Mb(e,t,n,r,s,i){return hd(e,t,s,i)||t.AddError({keyword:"format",schemaPath:n,instancePath:r,params:{format:s.format}})}function $b(e,t,n,r){const s=Oa(n)?n.then:!0,i=ja(n)?n.else:!0;return Fw(ct(e,t,n.if,r),ct(e,t,s,r),ct(e,t,i,r))}function Fb(e,t,n,r){const s=Oa(n)?n.then:!0,i=ja(n)?n.else:!0;return lt(e,t,n.if,r)?lt(e,t,s,r):lt(e,t,i,r)}function Lb(e,t,n,r,s,i){const o=Oa(s)?s.then:!0,d=ja(s)?s.else:!0,f=new Wn,u=At(e,f,`${n}/if`,r,s.if,i)?At(e,f,`${n}/then`,r,o,i)||t.AddError({keyword:"if",schemaPath:n,instancePath:r,params:{failingKeyword:"then"}}):At(e,t,`${n}/else`,r,d,i)||t.AddError({keyword:"if",schemaPath:n,instancePath:r,params:{failingKeyword:"else"}});return u&&t.Merge([f]),u}function QN(e,t,n,r){return Tt(n.items.map((s,i)=>{const o=rs(ke(r,"length"),V(i)),d=Ln(e,t,s,`${r}[${i}]`),f=t.AddIndex(V(i));return Ge(o,Ct(d,f))}))}function YN(e,t,n,r){return Tt(n.items.map((s,i)=>{const o=rs(ke(r,"length"),V(i)),d=Ln(e,t,s,`${r}[${i}]`);return Ge(o,d)}))}function ZN(e,t,n,r){return t.UseUnevaluated()?QN(e,t,n,r):YN(e,t,n,r)}function XN(e,t,n,r){return ht(n.items,0,(s,i)=>ir(r.length,i)||Rr(e,t,s,r[i])&&t.AddIndex(i))}function eO(e,t,n,r,s,i){return Pt(s.items,0,(o,d)=>{const f=`${n}/items/${d}`,u=`${r}/${d}`;return ir(i.length,d)||Mr(e,t,f,u,o,i[d])&&t.AddIndex(d)})}function tO(e,t,n,r){const s=dr(n)?n.prefixItems.length:0,i=Ln(e,t,n.items,"element"),o=t.AddIndex("index");return qn(r,V(s),["element","index"],Ct(i,o))}function nO(e,t,n,r){const s=dr(n)?n.prefixItems.length:0,i=Ln(e,t,n.items,"element");return qn(r,V(s),["element","index"],i)}function rO(e,t,n,r){return t.UseUnevaluated()?tO(e,t,n,r):nO(e,t,n,r)}function sO(e,t,n,r){const s=dr(n)?n.prefixItems.length:0;return ht(r,s,(i,o)=>Rr(e,t,n.items,i)&&t.AddIndex(o))}function iO(e,t,n,r,s,i){const o=dr(s)?s.prefixItems.length:0;return Pt(i,o,(d,f)=>{const u=`${n}/items`,m=`${r}/${f}`;return Mr(e,t,u,m,s.items,d)&&t.AddIndex(f)})}function Db(e,t,n,r){return Ea(n)?ZN(e,t,n,r):rO(e,t,n,r)}function _b(e,t,n,r){return Ea(n)?XN(e,t,n,r):sO(e,t,n,r)}function Ub(e,t,n,r,s,i){return Ea(s)?eO(e,t,n,r,s,i):iO(e,t,n,r,s,i)}function Bb(e){return ds(e)}function Hb(e,t,n,r){if(!Bb(n))return V(!0);const[s]=[dt()],i=ra(r,[s,"_"],ct(e,t,n.contains,s));return rs(i,V(n.maxContains))}function gd(e,t,n,r){if(!Bb(n))return!0;const s=nl(r,i=>lt(e,t,n.contains,i));return ir(s,n.maxContains)}function qb(e,t,n,r,s,i){const o=us(s)?s.minContains:1;return gd(e,t,s,i)||t.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:o,maxContains:s.maxContains}})}function zb(e,t,n,r){return rs(r,V(n.maximum))}function bd(e,t,n,r){return ir(r,n.maximum)}function Kb(e,t,n,r,s,i){return bd(e,t,s,i)||t.AddError({keyword:"maximum",schemaPath:n,instancePath:r,params:{comparison:"<=",limit:s.maximum}})}function Gb(e,t,n,r){return rs(ke(r,"length"),V(n.maxItems))}function kd(e,t,n,r){return ir(r.length,n.maxItems)}function Vb(e,t,n,r,s,i){return kd(e,t,s,i)||t.AddError({keyword:"maxItems",schemaPath:n,instancePath:r,params:{limit:s.maxItems}})}function Wb(e,t,n,r){return Ow(r,V(n.maxLength))}function xd(e,t,n,r){return Xp(r,n.maxLength)}function Jb(e,t,n,r,s,i){return xd(e,t,s,i)||t.AddError({keyword:"maxLength",schemaPath:n,instancePath:r,params:{limit:s.maxLength}})}function Qb(e,t,n,r){return rs(ke(ss(r),"length"),V(n.maxProperties))}function yd(e,t,n,r){return ir(U(r).length,n.maxProperties)}function Yb(e,t,n,r,s,i){return yd(e,t,s,i)||t.AddError({keyword:"maxProperties",schemaPath:n,instancePath:r,params:{limit:s.maxProperties}})}function Zb(e){return ds(e)}function oO(e,t,n,r){const[s,i]=[dt(),dt()],o=ra(r,[s,i],Ct(ct(e,t,n.contains,s),t.AddIndex(i)));return ji(o,V(n.minContains))}function aO(e,t,n,r){const[s]=[dt()],i=ra(r,[s,"_"],ct(e,t,n.contains,s));return ji(i,V(n.minContains))}function Xb(e,t,n,r){return Zb(n)?t.UseUnevaluated()?oO(e,t,n,r):aO(e,t,n,r):V(!0)}function wd(e,t,n,r){if(!Zb(n))return!0;const s=nl(r,(i,o)=>lt(e,t,n.contains,i)&&t.AddIndex(o));return Rs(s,n.minContains)}function ek(e,t,n,r,s,i){return wd(e,t,s,i)||t.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:s.minContains}})}function tk(e,t,n,r){return ji(r,V(n.minimum))}function vd(e,t,n,r){return Rs(r,n.minimum)}function nk(e,t,n,r,s,i){return vd(e,t,s,i)||t.AddError({keyword:"minimum",schemaPath:n,instancePath:r,params:{comparison:">=",limit:s.minimum}})}function rk(e,t,n,r){return ji(ke(r,"length"),V(n.minItems))}function Sd(e,t,n,r){return Rs(r.length,n.minItems)}function sk(e,t,n,r,s,i){return Sd(e,t,s,i)||t.AddError({keyword:"minItems",schemaPath:n,instancePath:r,params:{limit:s.minItems}})}function ik(e,t,n,r){return Nw(r,V(n.minLength))}function jd(e,t,n,r){return ef(r,n.minLength)}function ok(e,t,n,r,s,i){return jd(e,t,s,i)||t.AddError({keyword:"minLength",schemaPath:n,instancePath:r,params:{limit:s.minLength}})}function ak(e,t,n,r){return ji(ke(ss(r),"length"),V(n.minProperties))}function Id(e,t,n,r){return Rs(U(r).length,n.minProperties)}function ck(e,t,n,r,s,i){return Id(e,t,s,i)||t.AddError({keyword:"minProperties",schemaPath:n,instancePath:r,params:{limit:s.minProperties}})}function lk(e,t,n,r){return Lw(r,V(n.multipleOf))}function Cd(e,t,n,r){return Yp(r,n.multipleOf)}function dk(e,t,n,r,s,i){return Cd(e,t,s,i)||t.AddError({keyword:"multipleOf",schemaPath:n,instancePath:r,params:{multipleOf:s.multipleOf}})}function cO(e,t,n,r){return no(e,t,[n.not],r,$t(Zt(ke("results","length"),V(1))))}function lO(e,t,n,r){return $t(ct(e,t,n.not,r))}function uk(e,t,n,r){return t.UseUnevaluated()?cO(e,t,n,r):lO(e,t,n,r)}function Ed(e,t,n,r){const s=new Vn;return!lt(e,s,n.not,r)&&t.Merge([s])}function pk(e,t,n,r,s,i){return Ed(e,t,s,i)||t.AddError({keyword:"not",schemaPath:n,instancePath:r,params:{}})}function dO(e,t,n,r){return no(e,t,n.oneOf,r,Zt(ke("results","length"),V(1)))}function uO(e,t,n,r){const[s]=[dt()],i=$w(n.oneOf.map(d=>ct(e,t,d,r))),o=ra(i,[s,"_"],Zt(s,V(!0)));return Zt(o,V(1))}function fk(e,t,n,r){return t.UseUnevaluated()?dO(e,t,n,r):uO(e,t,n,r)}function mk(e,t,n,r){const s=n.oneOf.reduce((i,o)=>{const d=new Vn;return lt(e,d,o,r)?[...i,d]:i},[]);return g(s.length,1)&&t.Merge(s)}function hk(e,t,n,r,s,i){const o=[],d=[],f=s.oneOf.reduce((m,p,h)=>{const b=new Wn,k=`${n}/oneOf/${h}`,S=At(e,b,k,r,p,i);return S&&d.push(h),S||o.push(b),S?[...m,b]:m},[]),u=g(f.length,1)&&t.Merge(f);return!u&&g(d.length,0)&&o.forEach(m=>m.GetErrors().forEach(p=>t.AddError(p))),u||t.AddError({keyword:"oneOf",schemaPath:n,instancePath:r,params:{passingSchemas:d}})}function gk(e,t,n,r){const s=hs(pe(n.pattern)?new RegExp(n.pattern,"u"):n.pattern);return Ve(ke(s,"test"),[r])}function Td(e,t,n,r){return(pe(n.pattern)?new RegExp(n.pattern,"u"):n.pattern).test(r)}function bk(e,t,n,r,s,i){return Td(e,t,s,i)||t.AddError({keyword:"pattern",schemaPath:n,instancePath:r,params:{pattern:s.pattern}})}function kk(e,t,n,r){return Tt(it(n.patternProperties).map(([s,i])=>{const[o,d]=[dt(),dt()],f=hs(new RegExp(s,"u")),u=$t(Ve(ke(f,"test"),[o])),m=Ln(e,t,i,d),p=t.AddKey(o),h=t.UseUnevaluated()?Ge(u,Ct(m,p)):Ge(u,m);return qn(lf(r),V(0),[`[${o}, ${d}]`,"_"],h)}))}function xk(e,t,n,r){return ht(it(n.patternProperties),0,([s,i])=>{const o=new RegExp(s,"u");return ht(it(r),0,([d,f])=>!o.test(d)||Rr(e,t,i,f)&&t.AddKey(d))})}function yk(e,t,n,r,s,i){return Pt(it(s.patternProperties),0,([o,d])=>{const f=`${n}/patternProperties/${o}`,u=new RegExp(o,"u");return Pt(it(i),0,([m,p])=>{const h=`${r}/${m}`;return!u.test(m)||Mr(e,t,f,h,d,p)&&t.AddKey(m)})})}function wk(e,t,n,r){return Tt(n.prefixItems.map((s,i)=>{const o=rs(ke(r,"length"),V(i)),d=Ln(e,t,s,`${r}[${i}]`),f=t.AddIndex(V(i)),u=t.UseUnevaluated()?Ct(d,f):d;return Ge(o,u)}))}function vk(e,t,n,r){return g(r.length,0)||ht(n.prefixItems,0,(s,i)=>ir(r.length,i)||Rr(e,t,s,r[i])&&t.AddIndex(i))}function Sk(e,t,n,r,s,i){return g(i.length,0)||Pt(s.prefixItems,0,(o,d)=>{const f=`${n}/prefixItems/${d}`,u=`${r}/${d}`;return ir(i.length,d)||Mr(e,t,f,u,o,i[d])&&t.AddIndex(d)})}function Ad(e,t){return e.includes(t)||Ci().exactOptionalPropertyTypes}function pO(e,t){return pc(ke(e,t))}function jk(e,t){return Fe(e[t])}function Ik(e,t,n,r){const s=ur(n)?n.required:[],i=it(n.properties).map(([o,d])=>{const f=$t(Vr(r,V(o))),u=Ln(e,t,d,ke(r,o)),m=t.AddKey(V(o)),p=t.UseUnevaluated()?Ct(u,m):u,h=s.includes(o)?p:Ge(f,p);return Ad(s,o)?h:Ge(pO(r,o),h)});return Tt(i)}function Ck(e,t,n,r){const s=ur(n)?n.required:[];return ht(it(n.properties),0,([o,d])=>{const f=!E(r,o)||Rr(e,t,d,r[o])&&t.AddKey(o);return Ad(s,o)?f:jk(r,o)||f})}function Ek(e,t,n,r,s,i){const o=ur(s)?s.required:[];return Pt(it(s.properties),0,([f,u])=>{const m=`${n}/properties/${f}`,p=`${r}/${f}`,h=()=>!E(i,f)||Mr(e,t,m,p,u,i[f])&&t.AddKey(f);return Ad(o,f)?h():jk(i,f)||h()})}function Tk(e,t,n,r){const[s,i]=[dt(),dt()];return qn(ss(r),V(0),[s,i],ct(e,t,n.propertyNames,s))}function Ak(e,t,n,r){return ht(U(r),0,(s,i)=>lt(e,t,n.propertyNames,s))}function Pk(e,t,n,r,s,i){const o=[];return Pt(U(i),0,(f,u)=>{const m=`${r}/${f}`,p=`${n}/propertyNames`,h=new Wn,b=At(e,h,p,m,s.propertyNames,f);return b||o.push(f),b})||t.AddError({keyword:"propertyNames",schemaPath:n,instancePath:r,params:{propertyNames:o}})}function Nk(e,t,n,r){const s=e.RecursiveRef(n)??!1;return Js(e,t,s,r)}function Ok(e,t,n,r){const s=e.RecursiveRef(n)??!1;return _e(s)&&lt(e,t,s,r)}function Rk(e,t,n,r,s,i){const o=e.RecursiveRef(s)??!1;return _e(o)&&At(e,t,"#",r,o,i)}function fO(e,t,n,r){const s=xr(["context","value"],Js(e,t,n,"value")),i=xr(["context","value"],sa([tr("nextContext",al("CheckContext",[])),tr("result",Ve(s,["nextContext","value"])),uf("result",t.Merge("[nextContext]")),ia("result")]));return Ve(i,["context",r])}function mO(e,t,n,r){return Js(e,t,n,r)}function Mk(e,t,n,r){const s=e.Ref(n)??!1;return t.UseUnevaluated()?fO(e,t,s,r):mO(e,t,s,r)}function $k(e,t,n,r){const s=e.Ref(n)??!1,i=new Vn,o=_e(s)&&lt(e,i,s,r);return o&&t.Merge([i]),o}function Fk(e,t,n,r,s,i){const o=e.Ref(s)??!1,d=new Wn,f=_e(o)&&At(e,d,"#",r,o,i);return f&&t.Merge([d]),f||d.GetErrors().forEach(u=>t.AddError(u)),f}function Lk(e,t,n,r){return Tt(n.required.map(s=>Vr(r,V(s))))}function Dk(e,t,n,r){return ht(n.required,0,s=>E(r,s))}function _k(e,t,n,r,s,i){const o=[];return Pt(s.required,0,f=>{const u=E(i,f);return u||o.push(f),u})||t.AddError({keyword:"required",schemaPath:n,instancePath:r,params:{requiredProperties:o}})}function Uk(e,t,n,r){return g(n,"object")?sf(r):g(n,"array")?$o(r):g(n,"boolean")?Iw(r):g(n,"integer")?Cw(r):g(n,"number")?rf(r):g(n,"null")?Ew(r):g(n,"string")?af(r):g(n,"bigint")?nf(r):g(n,"constructor")?Pw(r):g(n,"function")?Aw(r):g(n,"symbol")?Tw(r):g(n,"undefined")||g(n,"void")?pc(r):V(!0)}function Pd(e,t,n,r,s){return g(n,"object")?kn(s):g(n,"array")?z(s):g(n,"boolean")?xt(s):g(n,"integer")?el(s):g(n,"number")?Ie(s):g(n,"null")?Xt(s):g(n,"string")?pe(s):g(n,"bigint")?st(s):g(n,"constructor")?na(s):g(n,"function")?Tn(s):g(n,"symbol")?tl(s):g(n,"undefined")||g(n,"void")?Fe(s):!0}function hO(e,t,n,r){return cl(n.map(s=>Uk(e,t,s,r)))}function Bk(e,t,n,r,s){return $s(n,i=>Pd(e,t,i,r,s))}function Hk(e,t,n,r){return z(n.type)?hO(e,t,n.type,r):Uk(e,t,n.type,r)}function qk(e,t,n,r){return z(n.type)?Bk(e,t,n.type,n,r):Pd(e,t,n.type,n,r)}function zk(e,t,n,r,s,i){return(z(s.type)?Bk(e,t,s.type,s,i):Pd(e,t,s.type,s,i))||t.AddError({keyword:"type",schemaPath:n,instancePath:r,params:{type:s.type}})}function Kk(e,t,n,r){const[s,i]=[dt(),dt()],o=Ve(ke("context","GetIndices"),[]),d=Ve(ke("indices","has"),[s]),f=ct(e,t,n.unevaluatedItems,i),u=Ve(ke("context","AddIndex"),[s]),m=qn(r,V(0),[i,s],Ct(Ge(d,f),u));return Ve(xr(["context"],sa([tr("indices",o),ia(m)])),["context"])}function Gk(e,t,n,r){const s=t.GetIndices();return ht(r,0,(i,o)=>(s.has(o)||lt(e,t,n.unevaluatedItems,i))&&t.AddIndex(o))}function Vk(e,t,n,r,s,i){const o=t.GetIndices(),d=[];return Pt(i,0,(u,m)=>{const p=new Wn,h=(o.has(m)||At(e,p,n,r,s.unevaluatedItems,u))&&t.AddIndex(m);return h||d.push(m),h})||t.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:r,params:{unevaluatedItems:d}})}function Wk(e,t,n,r){const[s,i]=[dt(),dt()],o=Ve(ke("context","GetKeys"),[]),d=Ve(ke("keys","has"),[s]),f=Ve(ke("context","AddKey"),[s]),u=ct(e,t,n.unevaluatedProperties,i),m=qn(lf(r),V(0),[`[${s}, ${i}]`,"_"],Ge(d,Ct(u,f)));return Ve(xr(["context"],sa([tr("keys",o),ia(m)])),["context"])}function Jk(e,t,n,r){const s=t.GetKeys();return ht(it(r),0,([i,o])=>s.has(i)||lt(e,t,n.unevaluatedProperties,o)&&t.AddKey(i))}function Qk(e,t,n,r,s,i){const o=t.GetKeys(),d=[];return Pt(it(i),0,([u,m])=>{const p=new Wn,h=o.has(u)||At(e,p,n,r,s.unevaluatedProperties,m)&&t.AddKey(u);return h||d.push(u),h})||t.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:r,params:{unevaluatedProperties:d}})}function Nd(e){return!g(e.uniqueItems,!1)}function Yk(e,t,n,r){if(!Nd(n))return V(!0);const s=ke(al("Set",[Ve(ke(r,"map"),[ke("Hashing","Hash")])]),"size"),i=ke(r,"length");return Zt(s,i)}function Zk(e,t,n,r){if(!Nd(n))return!0;const s=new Set(r.map(oa)).size,i=r.length;return g(s,i)}function Xk(e,t,n,r,s,i){if(!Nd(s))return!0;const o=new Set,d=i.reduce((u,m,p)=>{const h=oa(m);return o.has(h)?[...u,p]:(o.add(h),u)},[]);return g(d.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:r,params:{duplicateItems:d}})}function yi(e,t){return to(e)&&(z(e.type)&&ts(e.type.length,0)&&ht(e.type,0,n=>g(n,t))||g(e.type,t))}function gO(e){return yi(e,"object")}function bO(e){return un(e)&&(lr(e)||Ki(e)||Gi(e)||Vi(e)||ms(e)||fs(e)||eo(e)||Ks(e)||Zi(e)||ur(e)||Ws(e))}function kO(e){return yi(e,"array")}function xO(e){return un(e)&&(zi(e)||Nr(e)||ds(e)||Qi(e)||qs(e)||us(e)||ps(e)||dr(e)||Vs(e)||jr(e))}function yO(e){return yi(e,"string")}function wO(e){return un(e)&&(zs(e)||Yi(e)||Hs(e)||Gs(e))}function vO(e){return yi(e,"number")||yi(e,"bigint")}function SO(e){return un(e)&&(Or(e)||Ji(e)||Wi(e)||Pr(e)||Xi(e))}function Ln(e,t,n,r){return t.UseUnevaluated()?Ct(Ct(t.Push(),ct(e,t,n,r)),t.Pop()):ct(e,t,n,r)}function ct(e,t,n,r){e.Push(n);const s=[];if(qi(n))return Lg(e,t,n);if(to(n)&&s.push(Hk(e,t,n,r)),bO(n)){const o=[];ur(n)&&o.push(Lk(e,t,n,r)),lr(n)&&o.push(Tg(e,t,n,r)),Ki(n)&&o.push(zg(e,t,n,r)),Gi(n)&&o.push(Vg(e,t,n,r)),Vi(n)&&o.push(Qg(e,t,n,r)),fs(n)&&o.push(kk(e,t,n,r)),ms(n)&&o.push(Ik(e,t,n,r)),eo(n)&&o.push(Tk(e,t,n,r)),Ks(n)&&o.push(ak(e,t,n,r)),Zi(n)&&o.push(Qb(e,t,n,r));const d=Tt(o),f=Ge($t(sf(r)),d);s.push(gO(n)?d:f)}if(xO(n)){const o=[];zi(n)&&o.push(vg(e,t,n,r)),ds(n)&&o.push(Hg(e,t,n,r)),Nr(n)&&o.push(Db(e,t,n,r)),Qi(n)&&o.push(Hb(e,t,n,r)),qs(n)&&o.push(Gb(e,t,n,r)),us(n)&&o.push(Xb(e,t,n,r)),ps(n)&&o.push(rk(e,t,n,r)),dr(n)&&o.push(wk(e,t,n,r)),jr(n)&&o.push(Yk(e,t,n,r));const d=Tt(o),f=Ge($t($o(r)),d);s.push(kO(n)?d:f)}if(wO(n)){const o=[];Yi(n)&&o.push(Wb(e,t,n,r)),zs(n)&&o.push(ik(e,t,n,r)),Hs(n)&&o.push(Rb(e,t,n,r)),Gs(n)&&o.push(gk(e,t,n,r));const d=Tt(o),f=Ge($t(af(r)),d);s.push(yO(n)?d:f)}if(SO(n)){const o=[];Wi(n)&&o.push(tb(e,t,n,r)),Pr(n)&&o.push(rb(e,t,n,r)),Ji(n)&&o.push(zb(e,t,n,r)),Or(n)&&o.push(tk(e,t,n,r)),Xi(n)&&o.push(lk(e,t,n,r));const d=Tt(o),f=Ge($t(Ge(rf(r),nf(r))),d);s.push(vO(n)?d:f)}Na(n)&&s.push(Mk(e,t,n,r)),Pa(n)&&s.push(Nk(e,t,n,r)),Sa(n)&&s.push(rN(e,t,n,r)),va(n)&&s.push(_g(e,t,n,r)),Ia(n)&&s.push(Xg(e,t,n,r)),Ca(n)&&s.push($b(e,t,n,r)),Ta(n)&&s.push(uk(e,t,n,r)),ya(n)&&s.push(Ng(e,t,n,r)),wa(n)&&s.push(Mg(e,t,n,r)),Aa(n)&&s.push(fk(e,t,n,r)),Vs(n)&&s.push(Ge($t($o(r)),Kk(e,t,n,r))),Ws(n)&&s.push(Ge($t(of(r)),Wk(e,t,n,r))),xa(n)&&s.push(xg(e,t,n,r));const i=Tt(s);return e.Pop(n),i}function Rr(e,t,n,r){return t.Push()&&lt(e,t,n,r)&&t.Pop()}function lt(e,t,n,r){e.Push(n);const s=qi(n)?ad(e,t,n):(!to(n)||qk(e,t,n,r))&&(!(re(r)&&!z(r))||(!ur(n)||Dk(e,t,n,r))&&(!lr(n)||Ag(e,t,n,r))&&(!Ki(n)||Kg(e,t,n,r))&&(!Gi(n)||Wg(e,t,n,r))&&(!Vi(n)||Yg(e,t,n,r))&&(!fs(n)||xk(e,t,n,r))&&(!ms(n)||Ck(e,t,n,r))&&(!eo(n)||Ak(e,t,n,r))&&(!Ks(n)||Id(e,t,n,r))&&(!Zi(n)||yd(e,t,n,r)))&&(!z(r)||(!zi(n)||Sg(e,t,n,r))&&(!ds(n)||ld(e,t,n,r))&&(!Nr(n)||_b(e,t,n,r))&&(!Qi(n)||gd(e,t,n,r))&&(!qs(n)||kd(e,t,n,r))&&(!us(n)||wd(e,t,n,r))&&(!ps(n)||Sd(e,t,n,r))&&(!dr(n)||vk(e,t,n,r))&&(!jr(n)||Zk(e,t,n,r)))&&(!pe(r)||(!Yi(n)||xd(e,t,n,r))&&(!zs(n)||jd(e,t,n,r))&&(!Hs(n)||hd(e,t,n,r))&&(!Gs(n)||Td(e,t,n,r)))&&(!(Ie(r)||st(r))||(!Wi(n)||ud(e,t,n,r))&&(!Pr(n)||pd(e,t,n,r))&&(!Ji(n)||bd(e,t,n,r))&&(!Or(n)||vd(e,t,n,r))&&(!Xi(n)||Cd(e,t,n,r)))&&(!Na(n)||$k(e,t,n,r))&&(!Pa(n)||Ok(e,t,n,r))&&(!Sa(n)||sN(e,t,n,r))&&(!va(n)||cd(e,t,n,r))&&(!Ia(n)||dd(e,t,n,r))&&(!Ca(n)||Fb(e,t,n,r))&&(!Ta(n)||Ed(e,t,n,r))&&(!ya(n)||Og(e,t,n,r))&&(!wa(n)||$g(e,t,n,r))&&(!Aa(n)||mk(e,t,n,r))&&(!Vs(n)||!z(r)||Gk(e,t,n,r))&&(!Ws(n)||!re(r)||Jk(e,t,n,r))&&(!xa(n)||yg(e,t,n,r));return e.Pop(n),s}function Mr(e,t,n,r,s,i){return t.Push()&&At(e,t,n,r,s,i)&&t.Pop()}function At(e,t,n,r,s,i){e.Push(s);const o=qi(s)?Dg(e,t,n,r,s):!!(+(!to(s)||zk(e,t,n,r,s,i))&+(!(re(i)&&!z(i))||!!(+(!ur(s)||_k(e,t,n,r,s,i))&+(!lr(s)||Pg(e,t,n,r,s,i))&+(!Ki(s)||Gg(e,t,n,r,s,i))&+(!Gi(s)||Jg(e,t,n,r,s,i))&+(!Vi(s)||Zg(e,t,n,r,s,i))&+(!fs(s)||yk(e,t,n,r,s,i))&+(!ms(s)||Ek(e,t,n,r,s,i))&+(!eo(s)||Pk(e,t,n,r,s,i))&+(!Ks(s)||ck(e,t,n,r,s,i))&+(!Zi(s)||Yb(e,t,n,r,s,i))))&+(!z(i)||!!(+(!zi(s)||jg(e,t,n,r,s,i))&+(!ds(s)||qg(e,t,n,r,s,i))&+(!Nr(s)||Ub(e,t,n,r,s,i))&+(!Qi(s)||qb(e,t,n,r,s,i))&+(!qs(s)||Vb(e,t,n,r,s,i))&+(!us(s)||ek(e,t,n,r,s,i))&+(!ps(s)||sk(e,t,n,r,s,i))&+(!dr(s)||Sk(e,t,n,r,s,i))&+(!jr(s)||Xk(e,t,n,r,s,i))))&+(!pe(i)||!!(+(!Yi(s)||Jb(e,t,n,r,s,i))&+(!zs(s)||ok(e,t,n,r,s,i))&+(!Hs(s)||Mb(e,t,n,r,s,i))&+(!Gs(s)||bk(e,t,n,r,s,i))))&+(!(Ie(i)||st(i))||!!(+(!Wi(s)||nb(e,t,n,r,s,i))&+(!Pr(s)||sb(e,t,n,r,s,i))&+(!Ji(s)||Kb(e,t,n,r,s,i))&+(!Or(s)||nk(e,t,n,r,s,i))&+(!Xi(s)||dk(e,t,n,r,s,i))))&+(!Na(s)||Fk(e,t,n,r,s,i))&+(!Pa(s)||Rk(e,t,n,r,s,i))&+(!Sa(s)||iN(e,t,n,r,s,i))&+(!va(s)||Ug(e,t,n,r,s,i))&+(!Ia(s)||eb(e,t,n,r,s,i))&+(!Ca(s)||Lb(e,t,n,r,s,i))&+(!Ta(s)||pk(e,t,n,r,s,i))&+(!ya(s)||Rg(e,t,n,r,s,i))&+(!wa(s)||Fg(e,t,n,r,s,i))&+(!Aa(s)||hk(e,t,n,r,s,i))&+(!Vs(s)||!z(i)||Vk(e,t,n,r,s,i))&+(!Ws(s)||!re(i)||Qk(e,t,n,r,s,i)))&&(!xa(s)||wg(e,t,n,r,s,i));return e.Pop(s),o}const ex=[0],Ao=new Map,fi=new Map;function jO(){return`${ex[0]++}`}function IO(e,t){Ao.has(e)||Ao.set(e,new Map);const n=Ao.get(e);if(n.has(t))return n.get(t);const r=jO();return n.set(t,r),r}function CO(e,t,n,r){return e.UseUnevaluated()?Ve(`check_${n}`,["context",r]):Ve(`check_${n}`,[r])}function EO(e,t,n,r){const s=ct(e,t,n,"value");return t.UseUnevaluated()?tr(`check_${r}`,xr(["context","value"],s)):tr(`check_${r}`,xr(["value"],s))}function tx(){ex[0]=0,Ao.clear(),fi.clear()}function nx(){return[...fi.values()]}function Js(e,t,n,r){const s=IO(n,e.BaseURL().href),i=CO(t,n,s,r);return fi.has(s)||(fi.set(s,""),fi.set(s,EO(e,t,n,s))),i}function rx(e){if(e.length===0)throw Error("Cannot set root")}function sx(e){if(!re(e))throw Error("Cannot set value")}function TO(e){if(er(e))throw Error("Pointer contains unsafe property key")}function ix(e){for(const t of e)TO(t)}function AO(e){return/^(0|[1-9]\d*)$/.test(e)}function ox(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function PO(e,t){return re(t)&&E(t,e)}function NO(e,t){return re(t)&&!er(e)?t[e]:void 0}function Od(e,t){return e.reduce((n,r)=>NO(r,n),t)}function ro(e){if(g(e.length,0))return[];const t=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function OO(e,t){let n=e;return ro(t).every(r=>PO(r,n)?(n=n[r],!0):!1)}function ax(e,t){const n=ro(t);return Od(n,e)}function Nc(e,t,n){const r=ro(t);rx(r),ix(r);const[s,i]=ox(r),o=Od(s,e);return sx(o),o[i]=n,e}function cx(e,t){const n=ro(t);rx(n),ix(n);const[r,s]=ox(n),i=Od(r,e);return sx(i),z(i)&&AO(s)?i.splice(+s,1):delete i[s],e}const lx=Object.freeze(Object.defineProperty({__proto__:null,Delete:cx,Get:ax,Has:OO,Indices:ro,Set:Nc},Symbol.toStringTag,{value:"Module"}));function RO(e,t,n){if(e.$id===n.hash)return e;const r=new URL(e.$id,t.href),s=new URL(n.href,t.href);if(g(r.pathname,s.pathname))return n.hash.startsWith("#")?dx(e,t,n):e}function MO(e,t,n){const r=new URL(`#${e.$anchor}`,t.href),s=new URL(n.href,t.href);return g(r.href,s.href)?e:void 0}function $O(e,t,n){const r=new URL(`#${e.$dynamicAnchor}`,t.href),s=new URL(n.href,t.href);return g(r.href,s.href)?e:void 0}function dx(e,t,n){if(n.href.endsWith("#"))return e;if(!n.hash.startsWith("#"))return;const r=decodeURIComponent(n.hash.slice(1));if(r.startsWith("/"))return ax(e,r)}function FO(e,t,n){if(Sr(e)){const r=RO(e,t,n);if(!Fe(r))return r}if(qo(e)){const r=MO(e,t,n);if(!Fe(r))return r}if(Yr(e)){const r=$O(e,t,n);if(!Fe(r))return r}return dx(e,t,n)}function LO(e,t,n){return e.reduce((r,s)=>{const i=Rd(s,t,n);return Fe(i)?r:i},void 0)}function DO(e,t,n){return U(e).reduce((r,s)=>{const i=Rd(e[s],t,n);return Fe(i)?r:i},void 0)}function Rd(e,t,n){const r=un(e)&&Sr(e)?new URL(e.$id,t.href):t;if(un(e)){const s=FO(e,r,n);if(!Fe(s))return s}if(z(e))return LO(e,r,n);if(re(e))return DO(e,r,n)}function Zr(e,t){const n=new URL("http://unknown/"),r=Sr(e)?new URL(e.$id,n.href):n,s=new URL(t,r.href);return Rd(e,r,s)}function ux(e,t,n,r){const s=n.$dynamicRef.startsWith("#")?Zr(t,n.$dynamicRef):Zr(e,n.$dynamicRef);return Fe(s)?void 0:!un(s)||!Yr(s)||new URL(n.$dynamicRef,"http://unknown/").hash.startsWith("#/")?s:r.find(d=>d.$dynamicAnchor===s.$dynamicAnchor)??s}const _O=Object.freeze(Object.defineProperty({__proto__:null,DynamicRef:ux,Ref:Zr},Symbol.toStringTag,{value:"Module"}));var Ts=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},br,px,fx,mx,hx;class so{constructor(t,n){br.add(this),this.context=t,this.schema=n,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,n)=>new URL(n.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){un(t)&&(Sr(t)&&(this.ids.push(t),Ts(this,br,"m",px).call(this,t)),qo(t)&&this.anchors.push(t),Eo(t)&&this.recursiveAnchors.push(t),Yr(t)&&this.dynamicAnchors.push(t))}Pop(t){un(t)&&(Sr(t)&&(this.ids.pop(),Ts(this,br,"m",fx).call(this,t)),qo(t)&&this.anchors.pop(),Eo(t)&&this.recursiveAnchors.pop(),Yr(t)&&this.dynamicAnchors.pop())}Ref(t){return Ts(this,br,"m",mx).call(this,t)??Ts(this,br,"m",hx).call(this,t)}RecursiveRef(t){return Eo(this.Base())?Zr(this.recursiveAnchors[0],t.$recursiveRef):Zr(this.Base(),t.$recursiveRef)}DynamicRef(t){const n=this.schema;return ux(n,this.Base(),t,this.dynamicAnchors)}}br=new WeakSet,px=function e(t,n=!0){if(!un(t))return;const r=t;if(!(!n&&Sr(r))){!n&&Yr(r)&&this.dynamicAnchors.push(r);for(const s of U(r))Ts(this,br,"m",e).call(this,r[s],!1)}},fx=function e(t,n=!0){if(!un(t))return;const r=t;if(!(!n&&Sr(r))){!n&&Yr(r)&&this.dynamicAnchors.pop();for(const s of U(r))Ts(this,br,"m",e).call(this,r[s],!1)}},mx=function(t){return E(this.context,t.$ref)?this.context[t.$ref]:void 0},hx=function(t){const n=this.schema;return t.$ref.startsWith("#")?Zr(this.Base(),t.$ref):Zr(n,t.$ref)};function UO(e){const t=e.Functions().join(`;
269
- `),n=e.UseUnevaluated()?["const context = new CheckContext({}, {})",`return ${e.Entry()}`]:[`return ${e.Entry()}`];return`${t}; return (value) => { ${n.join("; ")} }`}function BO(e,t){return yf("CheckContext","Guard","Format","Hashing",e.External().identifier,t)(Vn,Mo,JN,Mv,e.External().variables)}function HO(e){const t=new so(e.Context(),e.Schema()),n=new Vn;return r=>lt(t,n,e.Schema(),r)}function qO(e,t){return xf()?BO(e,t):HO(e)}class gx{constructor(t,n,r){this.isAccelerated=t,this.code=n,this.check=r}IsAccelerated(){return this.isAccelerated}Code(){return this.code}Check(t){return this.check(t)}}class bx{constructor(t,n,r,s,i,o){this.context=t,this.schema=n,this.external=r,this.functions=s,this.entry=i,this.useUnevaluated=o}Context(){return this.context}Schema(){return this.schema}UseUnevaluated(){return this.useUnevaluated}External(){return this.external}Functions(){return this.functions}Entry(){return this.entry}Evaluate(){const t=UO(this),n=qO(this,t);return new gx(xf(),t,n)}}function kx(...e){const[t,n]=ut(e,{2:(f,u)=>[f,u],1:f=>[{},f]});bg(),tx();const r=new so(t,n),s=new gg(hg(t,n)),i=Js(r,s,n,"value"),o=nx(),d=kg();return new bx(t,n,d,o,i,s.UseUnevaluated())}function wi(...e){const[t,n,r]=ut(e,{3:(m,p,h)=>[m,p,h],2:(m,p)=>[{},m,p]}),s=Ci(),i=Lv(),o=[],d=new so(t,n),f=new sd(m=>{if(!Rs(o.length,s.maxErrors))return o.push({...m,message:i(m)})});return[At(d,f,"#","",n,r),o]}function Md(...e){const[t,n,r]=ut(e,{3:(o,d,f)=>[o,d,f],2:(o,d)=>[{},o,d]}),s=new so(t,n),i=new Vn;return lt(s,i,n,r)}let $d=class{constructor(t,n,r){this.schema=t,this.value=n,this.errors=r}};function zO(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});if(!Md(t,n,r)){const[s,i]=wi(t,n,r);throw new $d(n,r,i)}return r}class xx{constructor(t,n){this.buildResult=kx(t,n),this.evaluateResult=this.buildResult.Evaluate()}IsAccelerated(){return this.evaluateResult.IsAccelerated()}Schema(){return this.buildResult.Schema()}Check(t){return this.evaluateResult.Check(t)}Parse(t){if(this.evaluateResult.Check(t))return t;const[n,r]=wi(this.buildResult.Context(),this.buildResult.Schema(),t);throw new $d(this.buildResult.Schema(),t,r)}Errors(t){return wi(this.buildResult.Context(),this.buildResult.Schema(),t)}}function KO(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s],1:r=>[{},r]});return new xx(t,n)}const GO=Object.freeze(Object.defineProperty({__proto__:null,AccumulatedErrorContext:Wn,Build:kx,BuildAdditionalItems:vg,BuildAdditionalProperties:Tg,BuildAdditionalPropertiesFast:Cg,BuildAdditionalPropertiesStandard:Eg,BuildAllOf:Ng,BuildAnyOf:Mg,BuildConst:_g,BuildContains:Hg,BuildContext:gg,BuildDependencies:zg,BuildDependentRequired:Vg,BuildDependentSchemas:Qg,BuildEnum:Xg,BuildExclusiveMaximum:tb,BuildExclusiveMinimum:rb,BuildFormat:Rb,BuildIf:$b,BuildItems:Db,BuildMaxContains:Hb,BuildMaxItems:Gb,BuildMaxLength:Wb,BuildMaxProperties:Qb,BuildMaximum:zb,BuildMinContains:Xb,BuildMinItems:rk,BuildMinLength:ik,BuildMinProperties:ak,BuildMinimum:tk,BuildMultipleOf:lk,BuildNot:uk,BuildOneOf:fk,BuildPattern:gk,BuildPatternProperties:kk,BuildPrefixItems:wk,BuildProperties:Ik,BuildPropertyNames:Tk,BuildRecursiveRef:Nk,BuildRef:Mk,BuildRefine:xg,BuildRequired:Lk,BuildResult:bx,BuildSchema:ct,BuildSchemaBoolean:Lg,BuildSchemaPushStack:Ln,BuildType:Hk,BuildUnevaluatedItems:Kk,BuildUnevaluatedProperties:Wk,BuildUniqueItems:Yk,CanAdditionalPropertiesFast:Ig,Check:Md,CheckAdditionalItems:Sg,CheckAdditionalProperties:Ag,CheckAllOf:Og,CheckAnyOf:$g,CheckConst:cd,CheckContains:ld,CheckContext:Vn,CheckDependencies:Kg,CheckDependentRequired:Wg,CheckDependentSchemas:Yg,CheckEnum:dd,CheckExclusiveMaximum:ud,CheckExclusiveMinimum:pd,CheckFormat:hd,CheckIf:Fb,CheckItems:_b,CheckMaxContains:gd,CheckMaxItems:kd,CheckMaxLength:xd,CheckMaxProperties:yd,CheckMaximum:bd,CheckMinContains:wd,CheckMinItems:Sd,CheckMinLength:jd,CheckMinProperties:Id,CheckMinimum:vd,CheckMultipleOf:Cd,CheckNot:Ed,CheckOneOf:mk,CheckPattern:Td,CheckPatternProperties:xk,CheckPrefixItems:vk,CheckProperties:Ck,CheckPropertyNames:Ak,CheckRecursiveRef:Ok,CheckRef:$k,CheckRefine:yg,CheckRequired:Dk,CheckSchema:lt,CheckSchemaBoolean:ad,CheckSchemaPushStack:Rr,CheckType:qk,CheckUnevaluatedItems:Gk,CheckUnevaluatedProperties:Jk,CheckUniqueItems:Zk,Compile:KO,CreateFunction:Js,CreateVariable:hs,ErrorAdditionalItems:jg,ErrorAdditionalProperties:Pg,ErrorAllOf:Rg,ErrorAnyOf:Fg,ErrorConst:Ug,ErrorContains:qg,ErrorContext:sd,ErrorDependencies:Gg,ErrorDependentRequired:Jg,ErrorDependentSchemas:Zg,ErrorEnum:eb,ErrorExclusiveMaximum:nb,ErrorExclusiveMinimum:sb,ErrorFormat:Mb,ErrorIf:Lb,ErrorItems:Ub,ErrorMaxContains:qb,ErrorMaxItems:Vb,ErrorMaxLength:Jb,ErrorMaxProperties:Yb,ErrorMaximum:Kb,ErrorMinContains:ek,ErrorMinItems:sk,ErrorMinLength:ok,ErrorMinProperties:ck,ErrorMinimum:nk,ErrorMultipleOf:dk,ErrorNot:pk,ErrorOneOf:hk,ErrorPattern:bk,ErrorPatternProperties:yk,ErrorPrefixItems:Sk,ErrorProperties:Ek,ErrorPropertyNames:Pk,ErrorRecursiveRef:Rk,ErrorRef:Fk,ErrorRefine:wg,ErrorRequired:_k,ErrorSchema:At,ErrorSchemaBoolean:Dg,ErrorSchemaPushStack:Mr,ErrorType:zk,ErrorUnevaluatedItems:Vk,ErrorUnevaluatedProperties:Qk,ErrorUniqueItems:Xk,Errors:wi,EvaluateResult:gx,GetExternal:kg,GetFunctions:nx,HasUnevaluated:hg,IsAdditionalItems:zi,IsAdditionalProperties:lr,IsAllOf:ya,IsAnchor:qo,IsAnyOf:wa,IsConst:va,IsContains:ds,IsContentEncoding:BP,IsContentMediaType:HP,IsDefault:Ar,IsDefs:qP,IsDependencies:Ki,IsDependentRequired:Gi,IsDependentSchemas:Vi,IsDynamicAnchor:Yr,IsDynamicRef:Sa,IsElse:ja,IsEnum:Ia,IsExclusiveMaximum:Wi,IsExclusiveMinimum:Pr,IsFormat:Hs,IsId:Sr,IsIf:Ca,IsItems:Nr,IsItemsSized:Ea,IsItemsUnsized:zP,IsMaxContains:Qi,IsMaxItems:qs,IsMaxLength:Yi,IsMaxProperties:Zi,IsMaximum:Ji,IsMinContains:us,IsMinItems:ps,IsMinLength:zs,IsMinProperties:Ks,IsMinimum:Or,IsMultipleOf:Xi,IsNot:Ta,IsOneOf:Aa,IsPattern:Gs,IsPatternProperties:fs,IsPrefixItems:dr,IsProperties:ms,IsPropertyNames:eo,IsRecursiveAnchor:mg,IsRecursiveAnchorTrue:Eo,IsRecursiveRef:Pa,IsRef:Na,IsRefine:xa,IsRequired:ur,IsSchema:_e,IsSchemaBoolean:qi,IsSchemaObject:un,IsThen:Oa,IsType:to,IsUnevaluatedItems:Vs,IsUnevaluatedProperties:Ws,IsUniqueItems:jr,Parse:zO,ParseError:$d,Pointer:lx,Reducer:no,ResetExternal:bg,ResetFunctions:tx,Resolve:_O,Stack:so,Validator:xx},Symbol.toStringTag,{value:"Module"}));function ot(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return Md(t,n,r)}function io(...e){const[t,n,r]=ut(e,{3:(o,d,f)=>[o,d,f],2:(o,d)=>[{},o,d]}),[s,i]=wi(t,n,r);return i}class Ra extends Error{constructor(t,n,r){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:r,value:n},writable:!1,configurable:!1,enumerable:!1})}}function yx(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]});if(!ot(t,n,r))throw new Ra("Assert",r,io(t,n,r))}function VO(e,t,n){return z(n)?n.map(r=>Nn(e,t.items,r)):n}function WO(e,t,n){return Nn({...e,...t.$defs},gn(t.$ref),n)}function JO(e,t){const n=E(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},r=Bs(e,t),s=Gn(r);return Ue(s)?lg(s,n):s}function QO(e,t,n){const r=JO(e,t);return Nn(e,r,n)}function wx(e){return E(e,"additionalProperties")?e.additionalProperties:void 0}function YO(e,t,n){if(!re(n)||z(n))return n;const r=wx(t);for(const s of U(n)){if(E(t.properties,s)){n[s]=Nn(e,t.properties[s],n[s]);continue}if(xt(r)&&g(r,!0)||an(r)&&ot(e,r,n[s])){n[s]=Nn(e,r,n[s]);continue}delete n[s]}return n}function ZO(e,t,n){if(!re(n))return n;const r=wx(t),[s,i]=[new RegExp(jn(t)),Vt(t)];for(const o of U(n)){if(s.test(o)){n[o]=Nn(e,i,n[o]);continue}if(xt(r)&&g(r,!0)||an(r)&&ot(e,r,n[o])){n[o]=Nn(e,r,n[o]);continue}delete n[o]}return n}function XO(e,t,n){return E(e,t.$ref)?Nn(e,e[t.$ref],n):n}function eR(e,t,n){if(!z(n))return n;const r=Math.min(n.length,t.items.length);for(let s=0;s<r;s++)n[s]=Nn(e,t.items[s],n[s]);return ts(n.length,r)?n.slice(0,r):n}function zt(e){return ll(e)}function tR(e,t,n){for(const r of t.anyOf){const s=Nn(e,r,zt(n));if(ot(e,r,s))return s}return n}function Nn(e,t,n){return gt(t)?VO(e,t,n):Gt(t)?WO(e,t,n):Be(t)?QO(e,t,n):Ue(t)?YO(e,t,n):Ot(t)?ZO(e,t,n):vt(t)?XO(e,t,n):at(t)?eR(e,t,n):fe(t)?tR(e,t,n):n}function nR(e,t){for(const n of Mo.Keys(e))Mo.HasPropertyKey(t,n)||(t[n]=e[n]);return t}function rR(e){const t={};for(const n of Mo.Keys(e))t[n]=vi(e[n]);return t}function sR(e){return Oc(_P(e))}function Oc(e){return e.map(t=>vi(t))}function vi(e){const t=gt(e)?Ir(vi(e.items),pl(e)):Be(e)?Hn(Oc(e.allOf)):fe(e)?Je(sR(e.anyOf)):Ue(e)?$e(rR(e.properties)):Ot(e)?wl(ua(e),vi(Vt(e))):at(e)?Sn(Oc(e.items)):e;return nR(e,t)}function Fd(e){return vi(e)}function oo(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]}),s=Fd(n);return Nn(t,s,r)}function mn(e){return re(e)&&E(e,"value")}function ne(e){return{value:e}}function iR(e){return z(e)?ne(e):ne([e])}function oR(e){return g(e,!0)?ne(BigInt(1)):ne(BigInt(0))}const aR=/^-?(0|[1-9]\d*)n$/,cR=/^-?(0|[1-9]\d*)\.\d+$/,lR=/^-?(0|[1-9]\d*)$/;function dR(e){return aR.test(e)}function uR(e){return cR.test(e)}function pR(e){return lR.test(e)}function fR(e){const t=e.toLowerCase();return dR(e)?ne(BigInt(e.slice(0,e.length-1))):uR(e)?ne(BigInt(e.split(".")[0])):pR(e)?ne(BigInt(e)):g(t,"false")?ne(BigInt(0)):g(t,"true")?ne(BigInt(1)):void 0}function Ld(e){return st(e)?ne(e):xt(e)?oR(e):Ie(e)?ne(BigInt(Math.trunc(e))):Xt(e)?ne(BigInt(0)):pe(e)?fR(e):Fe(e)?ne(BigInt(0)):void 0}function mR(e){return g(e,BigInt(0))?ne(!1):g(e,BigInt(1))?ne(!0):void 0}function hR(e){return g(e,0)?ne(!1):g(e,1)?ne(!0):void 0}function gR(e){return g(e.toLowerCase(),"false")?ne(!1):g(e.toLowerCase(),"true")?ne(!0):g(e,"0")?ne(!1):g(e,"1")?ne(!0):void 0}function vx(e){return st(e)?mR(e):xt(e)?ne(e):Ie(e)?hR(e):Xt(e)?ne(!1):pe(e)?gR(e):Fe(e)?ne(!1):void 0}function bR(e){return g(e,BigInt(0))?ne(null):void 0}function kR(e){return g(e,!1)?ne(null):void 0}function xR(e){return g(e,0)?ne(null):void 0}function yR(e){const t=e.toLowerCase();return g(t,"undefined")||g(t,"null")||g(e,"")||g(e,"0")?ne(null):void 0}function wR(e){return st(e)?bR(e):xt(e)?kR(e):Ie(e)?xR(e):Xt(e)?ne(null):pe(e)?yR(e):Fe(e)?ne(null):void 0}const Sx=BigInt(Number.MAX_SAFE_INTEGER),jx=BigInt(Number.MIN_SAFE_INTEGER);function vR(e){return e<=Sx&&e>=jx?ne(Number(e)):void 0}function SR(e){return ne(e?1:0)}function jR(e){const t=+e;if(Ie(t))return ne(t);const n=e.toLowerCase();if(g(n,"false"))return ne(0);if(g(n,"true"))return ne(1);const r=Ld(e);return mn(r)&&r.value<=Sx&&r.value>=jx?ne(Number(r.value)):void 0}function Dd(e){return st(e)?vR(e):xt(e)?SR(e):Ie(e)?ne(e):Xt(e)?ne(0):pe(e)?jR(e):Fe(e)?ne(0):void 0}function Ix(e){return st(e)||xt(e)||Ie(e)?ne(e.toString()):Xt(e)?ne("null"):pe(e)?ne(e):Fe(e)?ne(""):void 0}function IR(e){return g(e,BigInt(0))?ne(void 0):void 0}function CR(e){return g(e,!1)?ne(void 0):void 0}function ER(e){return g(e,0)?ne(void 0):void 0}function TR(e){const t=e.toLowerCase();return g(t,"undefined")||g(t,"null")||g(e,"")||g(e,"0")?ne(void 0):void 0}function Cx(e){return st(e)?IR(e):xt(e)?CR(e):Ie(e)?ER(e):Xt(e)?ne(void 0):pe(e)?TR(e):Fe(e)?ne(e):void 0}function AR(e,t,n){return iR(n).value.map(s=>In(e,t.items,s))}function PR(e,t,n){const r=Ld(n);return mn(r)?r.value:n}function NR(e,t,n){const r=vx(n);return mn(r)?r.value:n}function OR(e,t,n){return In({...e,...t.$defs},gn(t.$ref),n)}function RR(e,t,n){return In(e,Gn(t),n)}function MR(e,t,n){const r=Dd(n);return mn(r)?Math.trunc(r.value):n}function $R(e,t,n){const r=Bs(e,t),s=Gn(r);return In(e,s,n)}function FR(e,t,n){const r=Ld(n);return mn(r)&&g(t.const,r.value)?r.value:n}function LR(e,t,n){const r=vx(n);return mn(r)&&g(t.const,r.value)?r.value:n}function DR(e,t,n){const r=Dd(n);return mn(r)&&g(t.const,r.value)?r.value:n}function _R(e,t,n){const r=Ix(n);return mn(r)&&g(t.const,r.value)?r.value:n}function UR(e,t,n){return g(t.const,n)?n:Jv(t)?FR(e,t,n):Qv(t)?LR(e,t,n):Pf(t)?DR(e,t,n):Nf(t)?_R(e,t,n):Ft()}function BR(e,t,n){const r=wR(n);return mn(r)?r.value:n}function HR(e,t,n){const r=Dd(n);return mn(r)?r.value:n}function Ex(e,t,n,r){const s=U(r);for(const[i,o]of t)for(const d of s)i.test(d)||(r[d]=In(e,n,r[d]));return r}function _d(e,t,n){return cn(e)&&Fe(n[t])}function qR(e,t,n){const r=rl(t.properties),s=U(n);for(const[i,o]of r)for(const d of s)!i.test(d)||_d(o,d,n)||(n[d]=In(e,o,n[d]));return E(t,"additionalProperties")&&re(t.additionalProperties)?Ex(e,r,t.additionalProperties,n):n}function zR(e,t,n){return kn(n)?qR(e,t,n):n}function KR(e,t,n){const r=rl(t.patternProperties),s=U(n);for(const[i,o]of r)for(const d of s)i.test(d)&&(n[d]=In(e,o,n[d]));return E(t,"additionalProperties")&&re(t.additionalProperties)?Ex(e,r,t.additionalProperties,n):n}function GR(e,t,n){return kn(n)?KR(e,t,n):n}function VR(e,t,n){return E(e,t.$ref)?In(e,e[t.$ref],n):n}function WR(e,t,n){const r=Ix(n);return mn(r)?r.value:n}function JR(e,t,n){return In(e,Gn(t),n)}function QR(e,t,n){if(!z(n))return n;for(let r=0;r<Math.min(t.items.length,n.length);r++)n[r]=In(e,t.items[r],n[r]);return n}function YR(e,t,n){const r=Cx(n);return mn(r)?r.value:n}function ZR(e,t,n){if(t.anyOf.some(o=>ot(e,o,n)))return n;const i=t.anyOf.map(o=>In(e,o,zt(n))).find(o=>ot(e,t,o));return Fe(i)?n:i}function XR(e,t,n){const r=Cx(n);return mn(r)?void 0:n}function In(e,t,n){return gt(t)?AR(e,t,n):is(t)?PR(e,t,n):Cr(t)?NR(e,t,n):Gt(t)?OR(e,t,n):vn(t)?RR(e,t,n):zn(t)?MR(e,t,n):Be(t)?$R(e,t,n):Qe(t)?UR(e,t,n):Ni(t)?BR(e,t,n):pn(t)?HR(e,t,n):Ue(t)?zR(e,t,n):Ot(t)?GR(e,t,n):vt(t)?VR(e,t,n):Fn(t)?WR(e,t,n):Wt(t)?JR(e,t,n):at(t)?QR(e,t,n):_s(t)?YR(e,t,n):fe(t)?ZR(e,t,n):os(t)?XR(e,t,n):n}function Ma(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return In(t,n,r)}function eM(e,t,n){if(!z(n))return n;for(let r=0;r<n.length;r++)n[r]=On(e,t.items,n[r]);return n}function tM(e,t,n){return On({...e,...t.$defs},gn(t.$ref),n)}function nM(e,t){return Fe(t)?Tn(e.default)?e.default():zt(e.default):t}function rM(e,t,n){const r=Bs(e,t),s=Gn(r);return On(e,s,n)}function sM(e,t,n){if(!re(n))return n;const r=U(t.properties);for(const s of r){const i=On(e,t.properties[s],n[s]);Fe(i)&&(cn(t.properties[s])||!E(t.properties[s],"default"))||(n[s]=i)}if(!lr(t)||xt(t.additionalProperties))return n;for(const s of U(n))r.includes(s)||(n[s]=On(e,t.additionalProperties,n[s]));return n}function iM(e,t,n){if(!re(n))return n;const[r,s]=[new RegExp(jn(t)),Vt(t)];for(const i of U(n))r.test(i)&&Ar(s)&&(n[i]=On(e,s,n[i]));if(!lr(t))return n;for(const i of U(n))r.test(i)||(n[i]=On(e,t.additionalProperties,n[i]));return n}function oM(e,t,n){return E(e,t.$ref)?On(e,e[t.$ref],n):n}function aM(e,t,n){if(!z(n))return n;const[r,s]=[t.items,Math.max(t.items.length,n.length)];for(let i=0;i<s;i++)i<r.length&&(n[i]=On(e,r[i],n[i]));return n}function cM(e,t,n){for(const r of t.anyOf){const s=On(e,r,zt(n));if(ot(e,r,s))return s}return n}function On(e,t,n){const r=Ar(t)?nM(t,n):n;return gt(t)?eM(e,t,r):Gt(t)?tM(e,t,r):Be(t)?rM(e,t,r):Ue(t)?sM(e,t,r):Ot(t)?iM(e,t,r):vt(t)?oM(e,t,r):at(t)?aM(e,t,r):fe(t)?cM(e,t,r):r}function Ud(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return On(t,n,r)}function Tx(e){return(...t)=>{const[n,r,s]=ut(t,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]});return e.reduce((i,o)=>o(n,r,i),s)}}function lM(e,t,n){return t["~codec"].decode(n)}function dM(e,t,n){return t["~codec"].encode(n)}function Et(e,t,n,r){return dn(n)?g(e,"Decode")?lM(t,n,r):dM(t,n,r):r}function uM(e,t,n,r){if(!z(r))return r;for(let s=0;s<r.length;s++)r[s]=Bt(e,t,n.items,r[s]);return Et(e,t,n,r)}function pM(e,t,n,r){const s=Et(e,t,n,r);if(!z(s))return s;for(let i=0;i<s.length;i++)s[i]=Bt(e,t,n.items,s[i]);return s}function fM(e,t,n,r){return g(e,"Decode")?uM(e,t,n,r):pM(e,t,n,r)}function mM(e,t,n,r){return r=Bt(e,{...t,...n.$defs},gn(n.$ref),r),Et(e,t,n,r)}function Ax(e){return e.reduce((t,n)=>({...t,...n}),{})}function Px(e,t){for(const n of t)if(!ns(e,n))return n;return e}function hM(e,t,n,r){if(g(n.allOf.length,0))return Et(e,t,n,r);const s=n.allOf.map(d=>Bt(e,t,d,oo(d,zt(r)))),o=s.every(d=>re(d))?Ax(s):Px(r,s);return Et(e,t,n,o)}function gM(e,t,n,r){if(g(n.allOf.length,0))return Et(e,t,n,r);const s=Et(e,t,n,r),i=n.allOf.map(d=>Bt(e,t,d,oo(d,zt(s))));return i.every(d=>re(d))?Ax(i):Px(s,i)}function bM(e,t,n,r){return g(e,"Decode")?hM(e,t,n,r):gM(e,t,n,r)}function kM(e,t,n,r){if(!kn(r))return r;for(const s of U(n.properties))!E(r,s)||_d(n.properties[s],s,r)||(r[s]=Bt(e,t,n.properties[s],r[s]));return Et(e,t,n,r)}function xM(e,t,n,r){const s=Et(e,t,n,r);if(!kn(s))return s;for(const i of U(n.properties))!E(s,i)||_d(n.properties[i],i,s)||(s[i]=Bt(e,t,n.properties[i],s[i]));return s}function yM(e,t,n,r){return g(e,"Decode")?kM(e,t,n,r):xM(e,t,n,r)}function wM(e,t,n,r){if(!kn(r))return r;const s=new RegExp(jn(n));for(const i of U(r))s.test(i)&&(r[i]=Bt(e,t,Vt(n),r[i]));return Et(e,t,n,r)}function vM(e,t,n,r){const s=Et(e,t,n,r);if(!kn(s))return s;const i=new RegExp(jn(n));for(const o of U(s))i.test(o)&&(s[o]=Bt(e,t,Vt(n),s[o]));return s}function SM(e,t,n,r){return g(e,"Decode")?wM(e,t,n,r):vM(e,t,n,r)}function Ku(e,t,n,r){return E(t,n.$ref)?Bt(e,t,t[n.$ref],r):r}function jM(e,t,n,r){return g(e,"Decode")?Et(e,t,n,Ku(e,t,n,r)):Ku(e,t,n,Et(e,t,n,r))}function IM(e,t,n,r){if(!z(r))return r;for(let s=0;s<Math.min(n.items.length,r.length);s++)r[s]=Bt(e,t,n.items[s],r[s]);return Et(e,t,n,r)}function CM(e,t,n,r){const s=Et(e,t,n,r);if(!z(s))return r;for(let i=0;i<Math.min(n.items.length,s.length);i++)s[i]=Bt(e,t,n.items[i],s[i]);return s}function EM(e,t,n,r){return g(e,"Decode")?IM(e,t,n,r):CM(e,t,n,r)}function TM(e,t,n,r){for(const s of n.anyOf){if(!ot(t,s,r))continue;const i=Bt(e,t,s,r);return Et(e,t,n,i)}return r}function AM(e,t,n,r){const s=Et(e,t,n,r);for(const i of n.anyOf){const o=Bt(e,t,i,zt(s));if(ot(t,i,o))return o}return s}function PM(e,t,n,r){return g(e,"Decode")?TM(e,t,n,r):AM(e,t,n,r)}function Bt(e,t,n,r){return gt(n)?fM(e,t,n,r):Gt(n)?mM(e,t,n,r):Be(n)?bM(e,t,n,r):Ue(n)?yM(e,t,n,r):Ot(n)?SM(e,t,n,r):vt(n)?jM(e,t,n,r):at(n)?EM(e,t,n,r):fe(n)?PM(e,t,n,r):Et(e,t,n,r)}class NM extends Ra{constructor(t,n){super("Decode",t,n)}}function OM(e,t,n){if(!ot(e,t,n))throw new NM(n,io(e,t,n));return n}function RM(e,t,n){const r=Fd(t);return Bt("Decode",e,r,n)}const MM=Tx([(e,t,n)=>zt(n),(e,t,n)=>Ud(e,t,n),(e,t,n)=>Ma(e,t,n),(e,t,n)=>oo(e,t,n),(e,t,n)=>OM(e,t,n),(e,t,n)=>RM(e,t,n)]);function $M(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return MM(t,n,r)}class FM extends Ra{constructor(t,n){super("Encode",t,n)}}function LM(e,t,n){if(!ot(e,t,n))throw new FM(n,io(e,t,n));return n}function DM(e,t,n){const r=Fd(t);return Bt("Encode",e,r,n)}const _M=Tx([(e,t,n)=>zt(n),(e,t,n)=>DM(e,t,n),(e,t,n)=>Ud(e,t,n),(e,t,n)=>Ma(e,t,n),(e,t,n)=>oo(e,t,n),(e,t,n)=>LM(e,t,n)]);function UM(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return _M(t,n,r)}function BM(e,t){return dn(t)||$r(e,t.items)}function HM(e,t){return dn(t)||Nx({...e,...t.$defs},gn(t.$ref))}function qM(e,t){return dn(t)||t.allOf.some(n=>$r(e,n))}function zM(e,t){return dn(t)||U(t.properties).some(n=>$r(e,t.properties[n]))}function KM(e,t){return dn(t)||$r(e,Vt(t))}function Nx(e,t){return Rc.has(t.$ref)?!1:(Rc.add(t.$ref),dn(t)||E(e,t.$ref)&&$r(e,e[t.$ref]))}function GM(e,t){return dn(t)||t.items.some(n=>$r(e,n))}function VM(e,t){return dn(t)||t.anyOf.some(n=>$r(e,n))}function $r(e,t){return gt(t)?BM(e,t):Gt(t)?HM(e,t):Be(t)?qM(e,t):Ue(t)?zM(e,t):Ot(t)?KM(e,t):vt(t)?Nx(e,t):at(t)?GM(e,t):fe(t)?VM(e,t):dn(t)}const Rc=new Set;function WM(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s],1:r=>[{},r]});return Rc.clear(),$r(t,n)}class ao extends Error{constructor(t,n){super(n),this.type=t}}function JM(e,t){return Tn(t.default)?t.default(t):re(t.default)?zt(t.default):t.default}function QM(e,t){if(jr(t)&&!Ar(t))throw new ao(t,"Arrays with uniqueItems constraints must specify a default annotation");const n=ps(t)?t.minItems:0;return Array.from({length:n},()=>Cn(e,t.items))}function YM(e,t){return Pr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Or(t)?BigInt(t.minimum):BigInt(0)}function ZM(e,t){return!1}function XM(e,t){const n=Cn(e,t.instanceType);return class{constructor(){Object.assign(this,n)}}}function e$(e,t){return Cn({...e,...t.$defs},gn(t.$ref))}function t$(e,t){return Cn(e,Gn(t))}function n$(e,t){const n=Cn(e,t.returnType);return()=>n}function r$(e,t){return Pr(t)&&Ie(t.exclusiveMinimum)?t.exclusiveMinimum+1:Or(t)?t.minimum:0}function s$(e,t){const n=Bs(e,t),r=Gn(n);return Cn(e,r)}function i$(e,t){return t.const}function o$(e,t){throw new ao(t,"Cannot create TNever types")}function a$(e,t){return null}function c$(e,t){return Pr(t)&&Ie(t.exclusiveMinimum)?t.exclusiveMinimum+1:Or(t)?t.minimum:0}function l$(e,t){return(Fe(t.required)?[]:t.required).reduce((r,s)=>({...r,[s]:Cn(e,t.properties[s])}),{})}function d$(e,t){if(Ks(t)&&!Ar(t))throw new ao(t,"Record with the minProperties constraint must have a default annotation");return{}}function u$(e,t){return E(e,t.$ref)?Cn(e,e[t.$ref]):(()=>{throw new ao(t,"Unable to deref Ref")})()}function p$(e,t){if((Gs(t)||Hs(t))&&!Ar(t))throw Error("Strings with format or pattern constraints must specify default");const r=zs(t)?t.minLength:0;return"".padEnd(r)}function f$(e,t){return Symbol()}function m$(e,t){const n=yl(t.pattern);if(Fn(n))throw new ao(t,"Unable to create TemplateLiteral due to infinite type expansion");return Cn(e,n)}function h$(e,t){return Array.from({length:t.minItems},(n,r)=>Cn(e,t.items[r]))}function g$(e,t){if(g(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return Cn(e,t.anyOf[0])}function Cn(e,t){return Ar(t)?JM(e,t):gt(t)?QM(e,t):is(t)?YM(e,t):Cr(t)?ZM():xn(t)?XM(e,t):Gt(t)?e$(e,t):vn(t)?t$(e,t):yn(t)?n$(e,t):zn(t)?r$(e,t):Be(t)?s$(e,t):Qe(t)?i$(e,t):Fs(t)?o$(e,t):Ni(t)?a$():pn(t)?c$(e,t):Ue(t)?l$(e,t):Ot(t)?d$(e,t):vt(t)?u$(e,t):Fn(t)?p$(e,t):Oi(t)?f$():Wt(t)?m$(e,t):at(t)?h$(e,t):_s(t)?void 0:fe(t)?g$(e,t):os(t)?void 0:void 0}function Rn(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s],1:r=>[{},r]});return Cn(t,n)}function Ox(e,t){return ns(e,t)}function Rx(e){return oa(e)}class b$ extends Ra{constructor(t,n){super("Parse",t,n)}}function k$(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]});if(ot(t,n,r))return r;throw new b$(r,io(t,n,r))}function $a(e,t){return{type:"update",path:e,value:t}}function Mx(e,t){return{type:"insert",path:e,value:t}}function $x(e){return{type:"delete",path:e}}function Gu(e){if(!(re(e)&&g(sl(e).length,0)))throw new Error("Cannot create diffs for objects with symbols keys")}function*x$(e,t,n){if(!re(n)||z(n))return yield $a(e,n);Gu(t),Gu(n);const r=U(t),s=U(n);for(const i of s)E(t,i)||er(i)||(yield Mx(`${e}/${i}`,n[i]));for(const i of r)E(n,i)&&(er(i)||Ox(t,n)||(yield*Fa(`${e}/${i}`,t[i],n[i])));for(const i of r)E(n,i)||er(i)||(yield $x(`${e}/${i}`))}function*y$(e,t,n){if(!z(n))return yield $a(e,n);for(let r=0;r<Math.min(t.length,n.length);r++)yield*Fa(`${e}/${r}`,t[r],n[r]);for(let r=0;r<n.length;r++)r<t.length||(yield Mx(`${e}/${r}`,n[r]));for(let r=t.length-1;r>=0;r--)r<n.length||(yield $x(`${e}/${r}`))}function*w$(e,t,n){const r=globalThis.Object.getPrototypeOf(t).constructor.name,s=globalThis.Object.getPrototypeOf(n).constructor.name;if(Ii(n)&&g(t.length,n.length)&&g(r,s))for(let o=0;o<Math.min(t.length,n.length);o++)yield*Fa(`${e}/${o}`,t[o],n[o]);else return yield $a(e,n)}function*v$(e,t,n){t!==n&&(yield $a(e,n))}function*Fa(e,t,n){return Ii(t)?yield*w$(e,t,n):z(t)?yield*y$(e,t,n):re(t)?yield*x$(e,t,n):yield*v$(e,t,n)}function S$(e,t){return[...Fa("",e,t)]}const j$=$e({type:De("insert"),path:Kn(),value:Kt()}),I$=Object({type:De("update"),path:Kn(),value:Kt()}),C$=$e({type:De("delete"),path:Kn()});Je([j$,I$,C$]);function E$(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function T$(e){return e.length===0}function A$(e,t){if(E$(t))return zt(t[0].value);if(T$(t))return zt(e);const n=zt(e);for(const r of t)switch(r.type){case"insert":{Nc(n,r.path,r.value);break}case"update":{Nc(n,r.path,r.value);break}case"delete":{cx(n,r.path);break}}return n}class La extends Error{constructor(t,n,r,s){super(s),this.context=t,this.type=n,this.value=r}}function P$(e){const[t,n]=[new Set,[]];for(const r of e){const s=Rx(r);t.has(s)||(t.add(s),n.push(r))}return n}function N$(e,t,n){if(ot(e,t,n))return n;const r=z(n)?n:Rn(e,t),s=ps(t)&&r.length<t.minItems?[...r,...Array.from({length:t.minItems-r.length},()=>Rn(e,t))]:r,o=(qs(t)&&s.length>t.maxItems?s.slice(0,t.maxItems):s).map(f=>bn(e,t.items,f));if(!jr(t)||jr(t)&&!g(t.uniqueItems,!0))return o;const d=P$(o);if(!ot(e,t,d))throw new La(e,t,n,"Failed to repair Array due to uniqueItems constraint");return d}function O$(e,t,n){return bn(e,Gn(t),n)}function R$(e,t,n){const r=Bs(e,t),s=Gn(r);return bn(e,s,n)}function M$(e,t,n){if(ot(e,t,n))return n;if(!kn(n))return Rn(e,t);const r=new Set(Fe(t.required)?[]:t.required),s={};for(const[o,d]of it(t.properties))!r.has(o)&&Fe(n[o])||(s[o]=o in n?bn(e,d,n[o]):Rn(e,d));const i=U(t.properties);if(lr(t)&&re(t.additionalProperties))for(const o of U(n))i.includes(o)||(s[o]=bn(e,t.additionalProperties,n[o]));return s}function $$(e,t,n){if(ot(e,t,n))return n;if(Xt(n)||!re(n)||z(n))return Rn(e,t);const r=new RegExp(jn(t)),s=Vt(t),i=new Set,o={};for(const[d,f]of it(n))r.test(d)&&(o[d]=bn(e,s,f),i.add(d));if(lr(t))for(const d of U(n))i.has(d)||(o[d]=bn(e,t.additionalProperties,n[d]));return o}function F$(e,t,n){return E(e,t.$ref)?bn(e,e[t.$ref],n):(()=>{throw new La(e,t,n,"Unable to de-reference target type")})()}function L$(e,t,n){const r=yl(t.pattern);return bn(e,r,n)}function D$(e,t,n){return ot(e,t,n)?n:z(n)?t.items.map((r,s)=>bn(e,r,n[s])):Rn(e,t)}function Fx(e,t,n){return vt(t)?E(e,t.$ref)?Fx(e,e[t.$ref]):(()=>{throw new Error("Unable to Deref target")})():t}function _$(e,t,n){if(!(Ue(t)&&re(n)))return 0;const r=U(n);return it(t.properties).reduce((i,[o,d])=>{const f=Qe(d)&&g(d.const,n[o])?100:0,u=ot(e,d,n[o])?10:0,m=r.includes(o)?1:0;return i+(f+u+m)},0)}function U$(e,t,n){const r=t.anyOf.map(o=>Fx(e,o));let[s,i]=[r[0],0];for(const o of r){const d=_$(e,o,n);d>i&&(s=o,i=d)}return s}function B$(e,t,n){const r=Je(ca(t.anyOf)),s=U$(e,r,n);return bn(e,s,n)}function H$(e,t,n){return ot(e,t,n)?zt(n):Ar(t)?Rn(e,t):B$(e,t,n)}function q$(e,t,n){if(ot(e,t,n))return n;const r=Ma(e,t,n);return ot(e,t,r)?r:Rn(e,t)}function z$(e,t,n){if(ff(n)||hf(n)||mf(n)||Ii(n)||na(n)||Tn(n))throw new La(e,t,n,"Value is not repairable")}function K$(e,t,n){if(xn(t)||yn(t)||Fs(t))throw new La(e,t,n,"Type is not repairable")}function G$(e,t,n){return Fe(n)&&!_s(t)?Rn(e,t):n}function V$(e,t,n){return gl(t)?ot(e,t,n)?n:Rn(e,t):n}function bn(e,t,n){z$(e,t,n),K$(e,t,n);const r=G$(e,t,n),s=gt(t)?N$(e,t,r):vn(t)?O$(e,t,r):Be(t)?R$(e,t,r):Ue(t)?M$(e,t,r):Ot(t)?$$(e,t,r):vt(t)?F$(e,t,r):Wt(t)?L$(e,t,r):at(t)?D$(e,t,r):fe(t)?H$(e,t,r):q$(e,t,r);return V$(e,t,s)}function W$(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]}),s=bn(t,n,r);return yx(t,n,s),s}const Za=Object.freeze(Object.defineProperty({__proto__:null,Assert:yx,Check:ot,Clean:oo,Clone:zt,Convert:Ma,Create:Rn,Decode:$M,Default:Ud,Diff:S$,Encode:UM,Equal:Ox,Errors:io,HasCodec:WM,Hash:Rx,Parse:k$,Patch:A$,Pointer:lx,Repair:W$},Symbol.toStringTag,{value:"Module"}));class Vu extends Error{constructor(t){super(t.map(n=>`${n.path.length>0?n.path.join("."):"root"}: ${n.message}`).join("; ")),this.issues=t,this.name="SchemaValidationError"}}function J$(e){return e?e.split("/").slice(1).map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~")).map(t=>/^(0|[1-9]\d*)$/.test(t)?Number(t):t):[]}function Q$(e,t){let n=e;for(const r of t){if(n===null||typeof n!="object")return;n=n[r]}return n}function Wu(e,t){const[,n]=GO.Errors(e,t);return n.map(r=>{const s=J$(r.instancePath);return{code:r.keyword,path:s,message:r.message,value:Q$(t,s)}})}function Lx(e,t){const n=Za.Default(e,Za.Clone(t)),r=Wu(e,n);if(r.length>0)return{success:!1,error:new Vu(r)};const s=Za.Clean(e,n),i=Wu(e,s);return i.length>0?{success:!1,error:new Vu(i)}:{success:!0,data:s}}function Qn(e,t){const n=Lx(e,t);if(!n.success)throw n.error;return n.data}function K(e){return Object.defineProperties(e,{parse:{value:t=>Qn(e,t),enumerable:!1},safeParse:{value:t=>Lx(e,t),enumerable:!1}}),e}function En(e,t){return c.Optional({...e,default:t})}function ue(e,t={}){return c.Unsafe({type:"string",enum:[...e],...t})}const zr=20,mi=5*1024*1024,Y$=1e6,Z$=16*1024;function X$(e){const t=/^\s*\/btw(?:\s+([\s\S]*))?\s*$/iu.exec(e);if(t)return{question:(t[1]??"").trim()}}const gs=K(ue(["default","autoEdit","yolo","plan"])),kr={DEFAULT:"default",AUTO_EDIT:"autoEdit",YOLO:"yolo",PLAN:"plan"},Bd=K(ue(["user","assistant","system","tool"])),eF=K(c.Union([c.Object({type:c.Literal("text"),text:c.String()}),c.Object({type:c.Literal("image_url"),image_url:c.Object({url:c.String()})})])),Dx=c.Union([c.String(),c.Array(eF)]);K(c.Object({id:c.String(),role:Bd,content:Dx,timestamp:c.Number(),metadata:c.Optional(c.Record(c.String(),c.Unknown())),thinkingContent:c.Optional(c.String()),tool_call_id:c.Optional(c.String()),name:c.Optional(c.String()),tool_calls:c.Optional(c.Unknown())}));const tF=K(ue(["queued","running","completed","failed","cancelled","interrupted"])),co=K(ue(["local","worktree"])),Hd=K(ue(["high","medium","low"])),qd=K(ue(["feature","bug","maintenance","research"])),nF=K(ue(["applied","discarded","conflicted"])),rF=K(c.Object({status:nF,updatedAt:c.String(),sourceCommit:c.Optional(c.String()),changedFiles:c.Optional(c.Integer({minimum:0})),message:c.Optional(c.String())})),sF=K(c.Object({changedFiles:c.Integer({minimum:0}),additions:c.Integer({minimum:0}),deletions:c.Integer({minimum:0}),commits:c.Integer({minimum:0})})),iF=K(c.Object({path:c.String({minLength:1}),patch:c.String({maxLength:2*1024*1024}),additions:c.Integer({minimum:0}),deletions:c.Integer({minimum:0}),binary:c.Boolean(),truncated:c.Boolean()})),oF=K(c.Object({sessionId:c.String(),projectPath:c.String(),baseCommit:c.String(),files:c.Array(iF,{maxItems:100}),truncated:c.Boolean()})),aF=c.Union([c.String(),c.Number(),c.Boolean(),c.Array(c.String())]),cF=K(c.Object({name:c.String(),type:ue(["string","number","integer","boolean","select","multi-select"]),title:c.String(),description:c.Optional(c.String()),required:c.Boolean(),defaultValue:c.Optional(aF),options:c.Optional(c.Array(c.Object({value:c.String(),label:c.String()}))),format:c.Optional(ue(["date","uri","email","date-time"])),minimum:c.Optional(c.Number()),maximum:c.Optional(c.Number()),minLength:c.Optional(c.Number()),maxLength:c.Optional(c.Number()),minItems:c.Optional(c.Number()),maxItems:c.Optional(c.Number())}));K(c.Object({serverName:c.String(),mode:ue(["form","url"]),message:c.String(),fields:c.Optional(c.Array(cF)),requestedSchema:c.Optional(c.Record(c.String(),c.Unknown())),url:c.Optional(c.String()),domain:c.Optional(c.String()),elicitationId:c.Optional(c.String())}));const lF=K(c.Object({type:ue(["permission","question","elicitation"]),requestId:c.String()})),dF=K(c.Object({code:ue(["authentication","permission","rate_limit","timeout","network","model_unavailable","context_limit","unsupported_input","workspace_unavailable","capacity","runtime"]),message:c.String({minLength:1,maxLength:500}),retryable:c.Boolean(),resource:c.Optional(ue(["pending_count","pending_bytes","resident_runtimes"]))})),Qs=K(ue(["auto","off","minimal","low","medium","high","xhigh","max"])),Ys=K(ue(["auto","standard","fast","flex"])),Zs=K(ue(["auto","low","medium","high"])),Fr=K(c.Union([ue(["auto","pragmatic","friendly","explanatory"]),c.String({minLength:7,maxLength:300,pattern:"^(?:(?:user|project):[a-z0-9][a-z0-9._-]{0,63}(?::[a-z0-9][a-z0-9._-]{0,63}){0,3}|plugin:[a-z0-9][a-z0-9._-]{0,63}:[a-z0-9][a-z0-9._-]{0,63}(?::[a-z0-9][a-z0-9._-]{0,63}){0,3})$"})])),Bn=K(c.Object({sessionId:c.String(),projectPath:c.String(),title:c.Optional(c.String()),gitBranch:c.Optional(c.String()),rootId:c.String(),parentId:c.Optional(c.String()),relationType:c.Optional(ue(["subagent","fork"])),resumedFrom:c.Optional(c.String()),rootAgentId:c.Optional(c.String()),resumeDepth:c.Optional(c.Integer({minimum:0})),taskStatus:En(tF,"completed"),taskStatusReason:c.Optional(c.String()),taskFailure:c.Optional(dF),taskStartedAt:c.Optional(c.String()),taskCompletedAt:c.Optional(c.String()),taskPromptSummary:c.Optional(c.String()),taskPriority:c.Optional(Hd),taskKind:c.Optional(qd),taskDueAt:c.Optional(c.String()),taskModelId:c.Optional(c.String()),selectedModelId:c.Optional(c.String()),permissionMode:c.Optional(gs),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),communicationStyleDigest:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"})),projectInstructionsDigest:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"})),taskRetryAvailable:c.Optional(c.Boolean()),taskRetriedFrom:c.Optional(c.Object({sessionId:c.String(),projectPath:c.String()})),taskDelivery:c.Optional(rF),taskIsolation:c.Optional(co),taskSourceProjectPath:c.Optional(c.String()),taskWorktreePath:c.Optional(c.String()),taskWorktreeBranch:c.Optional(c.String()),taskBaseCommit:c.Optional(c.String()),taskDiffStat:c.Optional(sF),taskQueuePosition:c.Optional(c.Integer({minimum:1})),taskQueueDepth:c.Optional(c.Integer({minimum:0})),taskConcurrencyLimit:c.Optional(c.Integer({minimum:1})),archivedAt:c.Optional(c.String()),archivedBySessionId:c.Optional(c.String()),pendingInteraction:c.Optional(lF),messageCount:c.Number(),firstMessageTime:c.String(),lastMessageTime:c.String(),hasErrors:c.Boolean()})),uF=K(c.Object({sessions:c.Array(Bn),nextCursor:c.Optional(c.String())})),pF=K(c.Object({session:Bn,archivedSessionIds:c.Array(c.String())})),fF=K(c.Object({session:Bn,restoredSessionIds:c.Array(c.String())}));K(c.Object({version:c.Union([c.Literal(1),c.Literal(2)]),sessionId:c.String(),goalId:c.String(),objective:c.String(),status:ue(["active","verifying","paused","blocked","usage_limited","budget_limited","complete"]),tokenBudget:c.Optional(c.Number()),tokensUsed:c.Number(),timeUsedSeconds:c.Number(),continuationCount:c.Number(),statusReason:c.Optional(c.String()),completionVerification:c.Optional(c.Object({attempt:c.Integer({minimum:1}),status:ue(["pending","pass","fail","partial"]),requestedAt:c.String(),completedAt:c.Optional(c.String()),verifierSessionId:c.Optional(c.String()),summary:c.Optional(c.String()),evidenceSha256:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"}))})),prematureStop:c.Optional(c.Object({pattern:c.Unsafe({type:"string"}),consecutiveCount:c.Integer({minimum:1}),detectedAt:c.String()})),verificationStall:c.Optional(c.Unsafe({type:"object"})),executionFrontier:c.Optional(c.Object({taskListId:c.String({minLength:1,maxLength:256}),total:c.Integer({minimum:0}),completed:c.Integer({minimum:0}),inProgress:c.Integer({minimum:0}),pending:c.Integer({minimum:0}),blocked:c.Integer({minimum:0}),nextTask:c.Optional(c.Object({id:c.String({minLength:1}),subject:c.String({minLength:1,maxLength:512}),priority:ue(["high","medium","low"])})),digestSha256:c.String({pattern:"^[a-f0-9]{64}$"}),observedAt:c.String()})),frontierStall:c.Optional(c.Object({category:ue(["waiting_dependency","same_task_no_effect","repeated_deferral"]),consecutiveCount:c.Integer({minimum:1,maximum:3}),digestSha256:c.String({pattern:"^[a-f0-9]{64}$"}),detectedAt:c.String()})),createdAt:c.String(),updatedAt:c.String()}));const zd=K(c.Object({role:Bd,content:Dx,metadata:c.Optional(c.Unknown()),reasoningContent:c.Optional(c.String()),thinkingContent:c.Optional(c.String()),tool_call_id:c.Optional(c.String()),name:c.Optional(c.String()),tool_calls:c.Optional(c.Unknown())})),mF=K(c.Object({session:Bn,messages:c.Array(zd)})),_x=K(ue(["conversation","code","both"])),Ux=K(c.Object({messageId:c.String(),preview:c.String(),createdAt:c.String(),fileCount:c.Integer({minimum:0})}));K(c.Object({targetMessageId:c.String({minLength:1}),mode:En(_x,"conversation")}));const hF=K(c.Object({checkpoint:Ux,mode:_x,removedTurns:c.Integer({minimum:1}),restoredFiles:c.Array(c.String()),messages:c.Array(zd)})),gF=ue(["running","completed","failed","cancelled"]),Mc=K(c.Object({id:c.String(),subagentType:c.String(),description:c.String(),status:gF,background:c.Boolean(),rootAgentId:c.String(),resumedFrom:c.Optional(c.String()),resumeDepth:c.Integer({minimum:0}),createdAt:c.Number(),lastActiveAt:c.Number(),completedAt:c.Optional(c.Number()),restartRecovery:c.Optional(c.Object({outcome:ue(["completed","interrupted","failed"]),recoveredAt:c.Number()})),result:c.Optional(c.Object({success:c.Boolean(),message:c.String(),error:c.Optional(c.String()),verificationCommands:c.Optional(c.Array(c.String())),verificationVerdict:c.Optional(ue(["pass","fail","partial"])),modifiedFiles:c.Optional(c.Array(c.String()))})),stats:c.Optional(c.Object({tokens:c.Optional(c.Number()),toolCalls:c.Optional(c.Number()),duration:c.Optional(c.Number())}))}));K(c.Object({prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"})}));const bF=K(c.Object({source:Mc,session:Mc})),Bx=K(c.Object({sessionId:c.String(),projectPath:c.String()})),Hx=K(c.Object({path:c.String(),name:c.String(),gitBranch:c.Optional(c.String()),available:c.Boolean(),isCurrent:c.Boolean(),boundAt:c.String()})),kF=K(c.Union([c.Object({cancelled:c.Literal(!0)}),c.Object({cancelled:c.Literal(!1),path:c.String({minLength:1})})])),Ju=K(c.Object({type:c.String(),seq:c.Optional(c.Number()),properties:c.Record(c.String(),c.Unknown())})),qx=c.Object({type:ue(["file","image","url"]),path:c.Optional(c.String()),url:c.Optional(c.String()),content:c.Optional(c.String({maxLength:mi})),mimeType:c.Optional(c.String()),name:c.Optional(c.String())}),zx=c.Record(c.String(),c.Unknown());K(c.Object({prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"}),title:c.Optional(c.String({minLength:1,maxLength:200})),taskPriority:En(Hd,"medium"),taskKind:En(qd,"feature"),taskDueAt:c.Optional(c.String({minLength:1,maxLength:64})),projectPath:c.Optional(c.String()),modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:En(co,"worktree"),permissionMode:En(gs,"default"),attachments:c.Optional(c.Array(qx,{maxItems:zr})),outputSchema:c.Optional(zx)}));K(c.Object({title:c.Optional(c.String({minLength:1,maxLength:200})),taskPriority:c.Optional(Hd),taskKind:c.Optional(qd),taskDueAt:c.Optional(c.Union([c.String({minLength:1,maxLength:64}),c.Null()]))}));const Qu=K(c.Object({session:Bn,runId:c.String(),messageId:c.String(),status:ue(["queued","running"]),queuePosition:c.Optional(c.Integer({minimum:1})),queueDepth:c.Optional(c.Integer({minimum:0})),maxConcurrentTasks:c.Optional(c.Integer({minimum:1}))}));K(c.Object({action:ue(["apply","discard"])}));const Kd=K(c.Object({kind:ue(["cron","interval","once"]),cron:c.Optional(c.String({minLength:1,maxLength:120})),intervalMs:c.Optional(c.Integer({minimum:6e4})),runAt:c.Optional(c.String({minLength:1,maxLength:40})),timezone:c.Optional(c.String({minLength:1,maxLength:80}))})),xF=K(c.Object({modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:En(co,"worktree"),permissionMode:En(gs,"default")})),Cs=K(c.Object({id:c.String(),title:c.Optional(c.String({minLength:1,maxLength:200})),prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"}),projectPath:c.String({minLength:1}),trigger:Kd,dispatch:xF,enabled:c.Boolean(),createdAt:c.String(),updatedAt:c.String(),nextRunAt:c.Union([c.String(),c.Null()]),expiresAt:c.Union([c.String(),c.Null()]),lastRunAt:c.Optional(c.String()),lastRunSessionId:c.Optional(c.String()),lastStatus:c.Optional(ue(["queued","running","completed","failed","cancelled","interrupted","error"])),lastError:c.Optional(c.String()),runCount:c.Integer({minimum:0})}));K(c.Object({title:c.Optional(c.String({minLength:1,maxLength:200})),prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"}),projectPath:c.String({minLength:1}),trigger:Kd,modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:En(co,"worktree"),permissionMode:En(gs,"default"),enabled:En(c.Boolean(),!0)}));K(c.Object({title:c.Optional(c.String({minLength:1,maxLength:200})),prompt:c.Optional(c.String({minLength:1,maxLength:32e3,pattern:"\\S"})),trigger:c.Optional(Kd),modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:c.Optional(co),permissionMode:c.Optional(gs),enabled:c.Optional(c.Boolean())}));const yF=K(c.Object({schedules:c.Array(Cs)}));K(c.Object({content:c.String({maxLength:Y$}),projectPath:c.Optional(c.String()),modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),permissionMode:c.Optional(gs),attachments:c.Optional(c.Array(qx,{maxItems:zr})),outputSchema:c.Optional(zx)}));const wF=ue(["completed","failed","aborted","timed_out","spawn_error"]),vF=K(c.Object({version:c.Literal(1),command:c.String(),status:wF,exitCode:c.Union([c.Integer(),c.Null()]),durationMs:c.Number({minimum:0}),stdout:c.String(),stderr:c.String(),stdoutOmittedBytes:c.Integer({minimum:0}),stderrOmittedBytes:c.Integer({minimum:0}),binaryOutput:c.Boolean(),truncated:c.Boolean()}));K(c.Object({command:c.String({minLength:1,maxLength:32*1024,pattern:"^(?![\\s\\S]*\\u0000)(?=[\\s\\S]*\\S)[\\s\\S]*$"}),projectPath:c.Optional(c.String())}));const SF=K(c.Object({executionId:c.String(),messageId:c.String(),record:vF,auxiliary:c.Boolean(),delivery:c.Optional(ue(["current_turn","next_turn"])),queued:c.Optional(c.Integer({minimum:0}))}));K(c.Object({question:c.String({minLength:1,maxLength:Z$,pattern:"^(?![\\s\\S]*\\x00)(?=[\\s\\S]*\\S)[\\s\\S]*$"}),projectPath:c.Optional(c.String())}));const jF=K(c.Object({response:c.String({minLength:1}),durationMs:c.Number({minimum:0}),modelId:c.Optional(c.String()),usage:c.Optional(c.Object({promptTokens:c.Number({minimum:0}),completionTokens:c.Number({minimum:0}),totalTokens:c.Number({minimum:0}),reasoningTokens:c.Optional(c.Number({minimum:0})),cacheCreationInputTokens:c.Optional(c.Number({minimum:0})),cacheReadInputTokens:c.Optional(c.Number({minimum:0})),costUsd:c.Optional(c.Number({minimum:0}))}))}));K(c.Object({projectPath:c.String(),kind:ue(["uncommitted","base","commit"]),ref:c.Optional(c.String({maxLength:200})),instructions:c.Optional(c.String({maxLength:4e3})),modelId:c.Optional(c.String({minLength:1,maxLength:200}))}));const IF=K(c.Object({reviewId:c.String(),status:c.Literal("running")}));K(c.Object({messageId:c.String(),role:Bd,content:c.String(),timestamp:c.String()}));K(c.Object({approved:c.Boolean(),remember:c.Optional(c.Boolean()),scope:c.Optional(ue(["once","session","project"])),targetMode:c.Optional(gs),feedback:c.Optional(c.String()),answers:c.Optional(c.Record(c.String(),c.Union([c.String(),c.Array(c.String())]))),elicitation:c.Optional(c.Object({action:ue(["accept","decline","cancel"]),content:c.Optional(c.Record(c.String(),c.Union([c.String({maxLength:4e3}),c.Number(),c.Boolean(),c.Array(c.String({maxLength:1e3}),{maxItems:100})]),{maxProperties:32}))}))}));const CF=K(c.Object({id:Fr,name:c.String({minLength:1,maxLength:80}),description:c.String({minLength:1,maxLength:256}),source:ue(["built-in","user","project","plugin"]),contentSha256:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"}))}));K(c.Object({id:c.String(),displayName:c.Optional(c.String()),provider:c.String(),model:c.String(),contextWindow:c.Optional(c.Number()),maxTokens:c.Optional(c.Number()),reasoning:c.Optional(c.Boolean()),supportedReasoningEfforts:c.Optional(c.Array(ue(["off","minimal","low","medium","high","xhigh","max"]))),supportedServiceTiers:c.Optional(c.Array(ue(["standard","fast","flex"]))),supportedResponseVerbosities:c.Optional(c.Array(ue(["low","medium","high"]))),communicationStyles:c.Optional(c.Array(CF,{maxItems:36})),input:c.Optional(c.Array(ue(["text","image"]))),overrides:c.Optional(c.Object({baseUrl:c.Optional(c.String()),temperature:c.Optional(c.Number()),maxOutputTokens:c.Optional(c.Number()),timeout:c.Optional(c.Number()),streamIdleTimeout:c.Optional(c.Number({minimum:1e3}))}))}));K(ue(["vs-dark","vs-light","hc-black"]));const EF=K(ue(["light","dark","system"])),TF=K(c.Object({language:c.String(),codeTheme:c.String(),uiTheme:EF,autoSaveSessions:c.Boolean(),notifyBuild:c.Boolean(),notifyErrors:c.Boolean(),notifySounds:c.Boolean(),privacyTelemetry:c.Boolean(),privacyCrash:c.Boolean(),agentTeamsEnabled:c.Boolean(),communicationStyle:c.Optional(Fr)}));K(c.Partial(TF));class Gd extends Error{constructor(t,n,r){super(t),this.status=n,this.code=r,this.name="HttpResponseError"}}function Yu(e){return e instanceof Gd}async function _n(e,t){const n=await fetch(e,t),r=await n.json().catch(()=>{});if(!n.ok){const s=r,i=s!=null&&s.error&&typeof s.error=="object"&&!Array.isArray(s.error)?s.error:void 0,o=typeof(s==null?void 0:s.error)=="string"?s.error:typeof(i==null?void 0:i.message)=="string"?i.message:typeof(s==null?void 0:s.message)=="string"?s.message:n.statusText||`Request failed (${n.status})`;throw new Gd(o,n.status,typeof(i==null?void 0:i.code)=="string"?i.code:typeof(s==null?void 0:s.code)=="string"?s.code:void 0)}return r}const ie="",Zu=1e4,AF=c.Array(Bn),PF=c.Array(Hx),NF=c.Array(zd),OF=c.Array(Ux),RF=c.Array(Mc),Xu=c.Object({cwd:c.String(),gitBranch:c.Optional(c.String()),taskAdmission:c.Optional(c.Object({inFlight:c.Integer({minimum:0}),queued:c.Integer({minimum:0}),maxConcurrent:c.Integer({minimum:1}),maxQueued:c.Integer({minimum:1}),paused:c.Optional(c.Boolean())}))}),MF=e=>Array.isArray(e)?e:e==null?"":typeof e=="string"?e:JSON.stringify(e),$F=()=>{const e=new Date,t=String(e.getFullYear()).slice(-2),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0");return`Session ${t}-${n}-${r} ${s}:${i}`};function FF(e){const t=Bx.parse(e);return`projectPath=${encodeURIComponent(t.projectPath)}`}function ft(e,t){const n=FF(t);return`${e}${e.includes("?")?"&":"?"}${n}`}function ep(e){return{"x-blade-directory":Bx.parse(e).projectPath}}const Xa=(e,t,n)=>({id:`history-${t}-${n}`,role:e.role,content:MF(e.content),timestamp:n,metadata:e.metadata&&typeof e.metadata=="object"?e.metadata:void 0,tool_call_id:e.tool_call_id,name:e.name,tool_calls:e.tool_calls,thinkingContent:e.thinkingContent??e.reasoningContent}),X={listProjects:async()=>{const e=await fetch(`${ie}/projects`);if(!e.ok)throw new Error("Failed to load projects");return Qn(PF,await e.json())},bindProject:async e=>{var n;const t=await fetch(`${ie}/projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to bind project")}return Hx.parse(await t.json())},pickProjectDirectory:async()=>Qn(kF,await _n(`${ie}/projects/pick`,{method:"POST"})),unbindProject:async e=>{if(!(await fetch(`${ie}/projects?path=${encodeURIComponent(e)}`,{method:"DELETE"})).ok)throw new Error("Failed to unbind project")},listSessions:async()=>{const e=await fetch(`${ie}/sessions`);if(!e.ok)throw new Error("Failed to load sessions");return Qn(AF,await e.json())},listSessionPage:async(e,t=50,n=!1)=>{const r=new URLSearchParams({limit:String(t)});e&&r.set("cursor",e),n&&r.set("archived","true");const s=await fetch(`${ie}/sessions/catalog?${r.toString()}`);if(!s.ok)throw new Error("Failed to load session catalog");return uF.parse(await s.json())},getSession:async e=>Bn.parse(await _n(ft(`${ie}/sessions/${e.sessionId}`,e))),createSession:async(e,t)=>{const n=await fetch(`${ie}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e,title:t||$F()})});if(!n.ok)throw new Error("Failed to create session");return Bn.parse(await n.json())},startCodeReview:async(e,t)=>{var r,s;const n=await fetch(`${ie}/sessions/${e.sessionId}/review`,{method:"POST",headers:{"Content-Type":"application/json",...ep(e)},body:JSON.stringify({projectPath:e.projectPath,...t})});if(!n.ok){const i=await n.json().catch(()=>{}),o=((r=i==null?void 0:i.error)==null?void 0:r.code)==="CONFLICT"?Ke("taskHome.review.conflict"):((s=i==null?void 0:i.error)==null?void 0:s.code)==="BAD_REQUEST"?Ke("taskHome.review.invalidTarget"):Ke("taskHome.review.startFailed");throw new Error(o)}return IF.parse(await n.json())},getWorkspaceInfo:async()=>Qn(Xu,await _n(`${ie}/global/info`)),createTask:async e=>{var n;const t=await fetch(`${ie}/tasks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to dispatch task")}return Qu.parse(await t.json())},updateTask:async(e,t)=>{var r;const n=await fetch(ft(`${ie}/tasks/${e.sessionId}`,e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.json().catch(()=>{});throw new Error(((r=s==null?void 0:s.error)==null?void 0:r.message)||"Failed to update task")}return Bn.parse(await n.json())},setTaskAdmissionPaused:async e=>Qn(Xu.properties.taskAdmission,await _n(`${ie}/global/task-admission`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({paused:e})})),retryTask:async e=>{var n;const t=await fetch(ft(`${ie}/tasks/${e.sessionId}/retry`,e),{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to retry task")}return Qu.parse(await t.json())},deliverTask:async(e,t)=>{var r;const n=await fetch(ft(`${ie}/tasks/${e.sessionId}/delivery`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t})});if(!n.ok){const s=await n.json().catch(()=>{});throw new Error(((r=s==null?void 0:s.error)==null?void 0:r.message)||"Failed to deliver task changes")}return Bn.parse(await n.json())},getTaskDiff:async e=>{var n;const t=await fetch(ft(`${ie}/tasks/${e.sessionId}/diff`,e));if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to load task diff")}return oF.parse(await t.json())},deleteSession:async e=>{if(!(await fetch(ft(`${ie}/sessions/${e.sessionId}`,e),{method:"DELETE"})).ok)throw new Error("Failed to delete session")},archiveSession:async e=>pF.parse(await _n(ft(`${ie}/sessions/${e.sessionId}/archive`,e),{method:"POST"})),unarchiveSession:async e=>fF.parse(await _n(ft(`${ie}/sessions/${e.sessionId}/unarchive`,e),{method:"POST"})),exportSessionMarkdown:async(e,t=!1)=>{var u,m;const n=ft(`${ie}/sessions/${e.sessionId}/export`,e),r=t?`${n}&includeReasoning=true`:n,s=await fetch(r);if(!s.ok){const p=await s.json().catch(()=>{});throw new Error(((u=p==null?void 0:p.error)==null?void 0:u.message)||"Failed to export session")}const i=s.headers.get("content-disposition")??"",o=((m=/filename="([A-Za-z0-9._-]+)"/.exec(i))==null?void 0:m[1])??`blade-session-${e.sessionId.slice(0,12)}.md`,d=s.headers.get("x-blade-content-sha256")??"";if(!/^[a-f0-9]{64}$/.test(d))throw new Error("Session export is missing its integrity hash");const f=p=>{const h=s.headers.get(p);if(h===null)throw new Error(`Session export is missing its ${p} header`);const b=Number(h);if(!Number.isInteger(b)||b<0)throw new Error(`Session export has an invalid ${p} header`);return b};return{filename:o,markdown:await s.text(),contentSha256:d,messageCount:f("x-blade-export-messages"),activityCount:f("x-blade-export-activities"),redactionCount:f("x-blade-export-redactions")}},updateSession:async(e,t)=>{if(!(await fetch(`${ie}/sessions/${e.sessionId}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:t,projectPath:e.projectPath})})).ok)throw new Error("Failed to update session")},getMessages:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/message`,e));if(!t.ok)throw new Error("Failed to load messages");const n=Qn(NF,await t.json()),r=Date.now();return n.map((s,i)=>Xa(s,i,r))},sendMessage:async(e,t,n)=>{var s,i;const r=await fetch(`${ie}/sessions/${e.sessionId}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,permissionMode:n,projectPath:e.projectPath})});if(!r.ok){const o=await r.json().catch(()=>{}),d=((s=o==null?void 0:o.error)==null?void 0:s.message)??(o==null?void 0:o.reason);throw new Gd(d||"Failed to send message",r.status,(i=o==null?void 0:o.error)==null?void 0:i.code)}return r.json()},askSideQuestion:async(e,t,n)=>jF.parse(await _n(`${ie}/sessions/${e.sessionId}/side-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:t,projectPath:e.projectPath}),signal:n})),executeUserShellCommand:async(e,t)=>SF.parse(await _n(`${ie}/sessions/${e.sessionId}/shell`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:t,projectPath:e.projectPath})})),abortSession:async e=>{var n;const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/abort`,e),{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to stop task")}},getGoal:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e));if(!t.ok)throw new Error("Failed to load goal");return(await t.json()).goal},createGoal:async(e,t,n,r)=>{const s=await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({objective:t,tokenBudget:n,permissionMode:r})});if(!s.ok)throw new Error("Failed to create goal");return s.json()},updateGoal:async(e,t)=>{const n=await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error("Failed to update goal");return n.json()},clearGoal:async e=>{if(!(await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e),{method:"DELETE"})).ok)throw new Error("Failed to clear goal")},listRewindCheckpoints:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/rewind`,e));if(!t.ok)throw new Error("Failed to load rewind checkpoints");const n=await t.json();return Qn(OF,n.checkpoints)},rewindSession:async(e,t,n)=>{const r=await fetch(ft(`${ie}/sessions/${e.sessionId}/rewind`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetMessageId:t,mode:n})});if(!r.ok)throw new Error("Failed to rewind session");const s=hF.parse(await r.json()),i=Date.now();return{...s,messages:s.messages.map((o,d)=>Xa(o,d,i))}},listSubagents:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/subagents`,e));if(!t.ok)throw new Error("Failed to load subagents");const n=await t.json();return Qn(RF,n.subagents)},resumeSubagent:async(e,t,n)=>{const r=await fetch(ft(`${ie}/sessions/${e.sessionId}/subagents/${encodeURIComponent(t)}/resume`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:n})});if(!r.ok){const s=await r.json().catch(()=>{});throw new Error((s==null?void 0:s.message)||"Failed to resume subagent")}return bF.parse(await r.json())},forkSession:async e=>{const t=await fetch(`${ie}/sessions/${e.sessionId}/fork`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.projectPath})});if(!t.ok)throw new Error("Failed to fork session");const n=mF.parse(await t.json()),r=Date.now();return{session:n.session,messages:n.messages.map((s,i)=>Xa(s,i,r))}},openEventSubscription:async(e,t,n)=>{const r=(n==null?void 0:n.maxRetries)??5,s=n==null?void 0:n.onConnectionChange,i=n==null?void 0:n.onConnectionStateChange;let o=null,d=0,f=null,u=Date.now(),m=null,p=null,h=!1,b=!1,k=0,S,C,x=!1;const P=new Promise((O,Q)=>{S=O,C=Q}),N=()=>{m&&(clearInterval(m),m=null)},M=()=>{p&&(clearTimeout(p),p=null)},D=()=>{o==null||o.close(),o=null},j=()=>{f&&(clearTimeout(f),f=null),N(),M(),D()},I=()=>{x||(x=!0,M(),S())},T=O=>{x||(x=!0,j(),C(O))},$=()=>{if(h||d>=r){d>=r&&(console.error(`SSE max retries (${r}) reached, giving up`),i==null||i("offline"));return}d++,i==null||i("reconnecting");const O=Math.min(1e3*Math.pow(2,d-1),3e4);console.log(`SSE reconnecting in ${O}ms (attempt ${d}/${r})`),f=setTimeout(()=>{te().catch(Q=>{console.error("SSE reconnect failed",Q),s==null||s(!1),$()})},O)},F=()=>{d=0,u=Date.now(),s==null||s(!0),i==null||i("connected"),N(),m=setInterval(()=>{Date.now()-u>45e3&&(console.warn("SSE heartbeat timeout, reconnecting..."),N(),D(),s==null||s(!1),i==null||i("reconnecting"),$())},15e3),b||(b=!0,I())},te=async()=>{if(h)return;D();const O=ft(`${ie}/sessions/${e.sessionId}/events`,e),Q=k>0?`${O}${O.includes("?")?"&":"?"}lastEventId=${k}`:O;o=new EventSource(Q),b||(M(),p=setTimeout(()=>{i==null||i("offline"),T(new Error("Timed out waiting for event subscription readiness"))},Zu)),o.onmessage=ae=>{try{const le=JSON.parse(ae.data);typeof le.seq=="number"&&le.seq>k&&(k=le.seq);const de=Ju.parse(le);if(u=Date.now(),de.type==="connected"){de.properties.sessionId===e.sessionId&&de.properties.projectPath===e.projectPath&&(typeof de.properties.status=="string"&&t({type:"session.status",properties:de.properties}),F());return}if(de.type==="heartbeat")return;t(de)}catch(le){console.error("Failed to parse SSE event:",ae.data,le)}},o.onerror=()=>{if(h)return;const ae=(o==null?void 0:o.readyState)===EventSource.CLOSED;if(N(),D(),ae){s==null||s(!1),i==null||i("offline"),b||T(new Error("Event subscription closed before it was ready"));return}if(!b){i==null||i("offline"),T(new Error("Failed to open event subscription"));return}s==null||s(!1),$()}};return i==null||i("connecting"),te().catch(O=>{i==null||i("offline"),T(O instanceof Error?O:new Error("Failed to open event subscription"))}),await P,()=>{h=!0,f&&(clearTimeout(f),f=null),j(),s==null||s(!1)}},openTaskEventSubscription:async(e,t)=>{const n=t==null?void 0:t.onConnectionChange,r=t==null?void 0:t.onConnectionStateChange,s=new EventSource(`${ie}/events`);let i=!1,o=!1,d,f,u;const m=new Promise((h,b)=>{f=h,u=b}),p=()=>{i||(i=!0,d!==void 0&&(clearTimeout(d),d=void 0),s.close(),n==null||n(!1),r==null||r("offline"))};return r==null||r("connecting"),d=setTimeout(()=>{o||i||(p(),u(new Error("Timed out waiting for global task events")))},Zu),s.onmessage=h=>{try{const b=Ju.parse(JSON.parse(h.data));if(b.type==="connected"){o||(o=!0,d!==void 0&&(clearTimeout(d),d=void 0),f()),n==null||n(!0),r==null||r("connected");return}if(b.type==="heartbeat")return;e(b)}catch(b){console.error("Failed to parse global task event:",h.data,b)}},s.onerror=()=>{n==null||n(!1),r==null||r(o?"reconnecting":"offline"),!o&&!i&&(p(),u(new Error("Failed to open global task events")))},await m,p},respondPermission:async(e,t,n)=>{var i;const r=new URLSearchParams({sessionId:e.sessionId,projectPath:e.projectPath}),s=await fetch(`${ie}/permissions/${t}?${r.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok){const o=await s.json().catch(()=>{});throw new Error(((i=o==null?void 0:o.error)==null?void 0:i.message)||"Failed to respond to permission")}},respondToConfirmation:async(e,t,n)=>{if(!(await fetch(ft(`${ie}/sessions/${e.sessionId}/confirmation/${t}`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({approved:n})})).ok)throw new Error("Failed to respond to confirmation")},respondToQuestion:async(e,t,n)=>{var i;const r=new URLSearchParams({sessionId:e.sessionId,projectPath:e.projectPath}),s=await fetch(`${ie}/permissions/${t}?${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({approved:!0,answers:n})});if(!s.ok){const o=await s.json().catch(()=>{});throw new Error(((i=o==null?void 0:o.error)==null?void 0:i.message)||"Failed to respond to question")}},respondToElicitation:async(e,t,n)=>{var i;const r=new URLSearchParams({sessionId:e.sessionId,projectPath:e.projectPath}),s=await fetch(`${ie}/permissions/${t}?${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({approved:n.action==="accept",elicitation:n})});if(!s.ok){const o=await s.json().catch(()=>{});throw new Error(((i=o==null?void 0:o.error)==null?void 0:i.message)||"Failed to respond to MCP elicitation")}},getGitInfo:async e=>{const t=await fetch(`${ie}/suggestions/git-info`,{headers:ep(e)});if(!t.ok)throw new Error("Failed to get git info");return t.json()},listSchedules:async()=>{var n;const e=await fetch(`${ie}/schedules`);if(!e.ok){const r=await e.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.loadFailed"))}return yF.parse(await e.json()).schedules},createSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.createFailed"))}return Cs.parse(await t.json())},updateSchedule:async(e,t)=>{var r;const n=await fetch(`${ie}/schedules/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.json().catch(()=>{});throw new Error(((r=s==null?void 0:s.error)==null?void 0:r.message)||Ke("schedule.error.updateFailed"))}return Cs.parse(await n.json())},deleteSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.deleteFailed"))}},enableSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}/enable`,{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.toggleFailed"))}return Cs.parse(await t.json())},disableSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}/disable`,{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.toggleFailed"))}return Cs.parse(await t.json())},runSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}/run`,{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.runFailed"))}return Cs.parse(await t.json())}},LF=(e,t)=>({messages:[],setMessages:n=>e({messages:n}),addMessage:n=>e(r=>({messages:[...r.messages,n]})),updateMessage:(n,r)=>e(s=>({messages:s.messages.map(i=>i.id===n?{...i,...r}:i)})),appendDelta:(n,r,s)=>e(i=>({messages:i.messages.map(o=>{if(o.id!==n)return o;const d=o.agentContent||Dn();return s==="before"?{...o,agentContent:{...du(d,r),textBefore:d.textBefore+r}}:{...o,agentContent:{...du(d,r),textAfter:d.textAfter+r}}})})),appendToolCall:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Dn();return{...i,agentContent:J0(o,r)}})})),updateToolCall:(n,r,s)=>e(i=>({messages:i.messages.map(o=>{if(o.id!==n)return o;const d=o.agentContent;return d?{...o,agentContent:{...d,toolCalls:d.toolCalls.map(f=>f.toolCallId===r?{...f,...s}:f)}}:o})})),appendThinking:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Dn();return{...i,agentContent:{...W0(o,r),thinkingContent:o.thinkingContent+r}}})})),setConfirmation:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Dn();return{...i,agentContent:{...o,confirmation:r}}})})),setQuestion:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Dn();return{...i,agentContent:{...o,question:r}}})})),setElicitation:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Dn();return{...i,agentContent:{...o,elicitation:r}}})})),setSubagent:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Dn();return{...i,agentContent:r?V0(o,r):lu(o,[])}})})),updateSubagent:(n,r,s)=>e(i=>({messages:i.messages.map(o=>{if(o.id!==n)return o;const d=o.agentContent||Dn(),f=[...G0(d)],u=f.findIndex(h=>h.id===r||h.sessionId===r);if(u===-1)return o;const m=f[u],p=typeof s=="function"?s(m):s;return f[u]={...m,...p,id:m.id},{...o,agentContent:lu(d,f,f[u].id)}})})),setTasks:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Dn();return{...i,agentContent:{...o,tasks:r}}})})),replaceTemp:(n,r)=>e(s=>{const i=s.messages.findIndex(d=>d.content===n&&d.role==="user");if(i===-1)return s;const o=[...s.messages];return o[i]=r,{messages:o}})}),ec=60,DF=[/<system-reminder>[\s\S]*?<\/system-reminder>/gi,/<file[^>]*>[\s\S]*?<\/file>/gi,/<hooks_context>[\s\S]*?<\/hooks_context>/gi,/<[^>]+>/g];function _F(e){let t=e;for(const f of DF)t=t.replace(f," ");t=t.replace(/^\s*\/[a-zA-Z][\w-]*\s+/,"");const n=t.replace(/\s+/g," ").trim();if(!n)return"";const r=n.match(/^(.+?)(?:[.!?]\s|[。!?](?=\S|$)|$)/);let s=r&&r[1].length>=6?r[1]:n;if(s=s.trim().replace(/[\s.。!!??,,;;::-]+$/,""),s.length<=ec)return s;const i=s.slice(0,ec),o=i.lastIndexOf(" ");return`${(o>ec*.6?i.slice(0,o):i).trimEnd()}…`}const Po="/.blade/worktrees/",UF=/-[a-f0-9]{8,}$/i,BF=/^(.+?(?:test|config))-[a-z0-9]{6,}$/i;function HF(e){const t=e.indexOf(Po);if(t<0)return null;const n=e.slice(t+Po.length).split("/")[0];return n?`${e.slice(0,t+Po.length)}${n}`:null}function qF(e){if(!e.includes("/tmp/")&&!e.includes("/T/"))return null;const t=e.split("/"),n=t.at(-1),r=n==null?void 0:n.match(BF);return r!=null&&r[1]?(t[t.length-1]=r[1],t.join("/")):null}function $c(e){const t=e.split("/").filter(Boolean).at(-1)||e;return e.includes(Po)?t.replace(UF,""):t}function lo(e,t=null){const n=e.taskSourceProjectPath,r=qF(n||e.projectPath);if(r)return r;if(n)return n;const s=HF(e.projectPath);if(!s)return e.projectPath;const i=$c(s);return t&&i===$c(t)?t:s}function zF(e,t,n=null){return t?e.filter(r=>lo(r,n)===t):e}const Fc=kr.AUTO_EDIT;let tc=0;const Mt=Yo((e,t)=>({currentModelId:null,currentMode:Fc,configuredModels:[],availableModels:[],isLoading:!1,hasLoaded:!1,loadedWorkspacePath:null,error:null,loadModels:async n=>{const r=n??null;if(t().isLoading&&t().loadedWorkspacePath===r)return;const s=++tc;e({isLoading:!0,hasLoaded:!1,loadedWorkspacePath:r,error:null});try{const i=await _n("/models",n?{headers:{"x-blade-directory":n}}:void 0);if(s!==tc||t().loadedWorkspacePath!==r)return;const o=i.current;e({currentModelId:(o==null?void 0:o.id)||null,configuredModels:i.configured||[],availableModels:i.available||[],isLoading:!1,hasLoaded:!0})}catch(i){if(s!==tc||t().loadedWorkspacePath!==r)return;e({error:i instanceof Error?i.message:"Failed to load models",isLoading:!1,hasLoaded:!0})}},setCurrentModel:async(n,r)=>{if(e({error:null}),r){e({currentModelId:n});return}try{await _n("/configs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:{currentModelId:n},options:{scope:"global"}})}),e({currentModelId:n})}catch(s){throw e({error:s instanceof Error?s.message:"Failed to set model"}),s}},setMode:n=>e({currentMode:n}),resetMode:()=>e({currentMode:Fc})})),KF=e=>e==="system"?typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches:e==="dark",No=e=>{if(typeof document>"u")return;const t=document.documentElement;if(t.classList.remove("light","dark"),e==="system"){const r=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";t.classList.add(r)}else t.classList.add(e)},rn={language:"zh-CN",codeTheme:"dracula",uiTheme:"system",autoSaveSessions:!0,notifyBuild:!0,notifyErrors:!1,notifySounds:!1,privacyTelemetry:!1,privacyCrash:!0,agentTeamsEnabled:!1,communicationStyle:"auto"},Xr=Yo((e,t)=>({...rn,isLoading:!1,error:null,loadSettings:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/configs");if(!n.ok)throw new Error(Ke("settings.general.loadError"));const r=await n.json(),s=r.uiTheme??rn.uiTheme;e({language:r.language??rn.language,codeTheme:r.codeTheme??rn.codeTheme,uiTheme:s,autoSaveSessions:r.autoSaveSessions??rn.autoSaveSessions,notifyBuild:r.notifyBuild??rn.notifyBuild,notifyErrors:r.notifyErrors??rn.notifyErrors,notifySounds:r.notifySounds??rn.notifySounds,privacyTelemetry:r.privacyTelemetry??rn.privacyTelemetry,privacyCrash:r.privacyCrash??rn.privacyCrash,agentTeamsEnabled:r.agentTeamsEnabled??rn.agentTeamsEnabled,communicationStyle:r.communicationStyle??rn.communicationStyle,isLoading:!1}),No(s)}catch(n){e({error:n.message,isLoading:!1})}},updateSettings:async n=>{const r=t();e({...n,error:null}),n.uiTheme&&No(n.uiTheme);try{if(!(await fetch("/configs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:n,options:{scope:"global"}})})).ok)throw new Error(Ke("settings.general.saveError"))}catch(s){e({language:r.language,codeTheme:r.codeTheme,uiTheme:r.uiTheme,autoSaveSessions:r.autoSaveSessions,notifyBuild:r.notifyBuild,notifyErrors:r.notifyErrors,notifySounds:r.notifySounds,privacyTelemetry:r.privacyTelemetry,privacyCrash:r.privacyCrash,agentTeamsEnabled:r.agentTeamsEnabled,communicationStyle:r.communicationStyle,error:s.message}),n.uiTheme&&No(r.uiTheme)}}}));No(rn.uiTheme);const C3=()=>Xr(e=>KF(e.uiTheme)),nc="__temp__",ci={inputTokens:0,outputTokens:0,totalTokens:0,maxContextTokens:0,isDefaultMaxTokens:!0,totalInputTokens:0,totalOutputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,estimatedCostUsd:0};function be(e){return{sessionId:e.sessionId,projectPath:e.projectPath}}function Me(e){return JSON.stringify([e.projectPath,e.sessionId])}function oe(e,t){return!e||!t?e===t:e.sessionId===t.sessionId&&e.projectPath===t.projectPath}function Go(e,t){return e.find(n=>oe(be(n),t))}function hn(e,t){const n=be(t),r=e.findIndex(i=>oe(be(i),n));if(r===-1)return[...e,t];const s=[...e];return s[r]=t,s}function tp(e,t){return e.filter(n=>!oe(be(n),t))}const Kx="blade.tasks.unread",Vo="blade:open-session";function Gx(e){return e==="completed"||e==="failed"||e==="interrupted"}function GF(e,t,n){return!Gx(t)||n?!1:e!==t&&!(e==="completed"||e==="failed"||e==="interrupted"||e==="cancelled")}function VF(e=typeof localStorage>"u"?null:localStorage){if(!e)return[];try{const t=JSON.parse(e.getItem(Kx)??"[]");return Array.isArray(t)?[...new Set(t.filter(n=>typeof n=="string"))]:[]}catch{return[]}}function hi(e,t=typeof localStorage>"u"?null:localStorage){if(t)try{t.setItem(Kx,JSON.stringify([...new Set(e)]))}catch{}}function np(e,t){const n=new Set(t.map(r=>Me({sessionId:r.sessionId,projectPath:r.projectPath})));return e.filter(r=>n.has(r))}function rp(e){if(typeof document>"u"||document.visibilityState!=="hidden"||typeof Notification>"u"||Notification.permission!=="granted")return!1;const t=new Notification(e.title,{body:e.body,icon:"/favicon.svg",tag:`blade-task-${Me(e.ref)}`});return t.onclick=()=>e.onOpen(e.ref),!0}function WF(e){if(typeof window>"u")return!1;const t=window.AudioContext??window.webkitAudioContext;if(!t)return!1;try{const n=new t,r=n.createOscillator(),s=n.createGain();return r.type="sine",r.frequency.value=e==="completed"?660:330,s.gain.setValueAtTime(1e-4,n.currentTime),s.gain.exponentialRampToValueAtTime(.045,n.currentTime+.015),s.gain.exponentialRampToValueAtTime(1e-4,n.currentTime+.18),r.connect(s),s.connect(n.destination),r.start(),r.stop(n.currentTime+.2),r.onended=()=>void n.close(),!0}catch{return!1}}const JF=e=>{var n;const t=[];e.content.trim()&&t.push({type:"text",text:e.content});for(const r of e.attachments??[])r.type==="image"&&t.push({type:"image_url",image_url:{url:r.content}});return t.length===0?e.content:t.length===1&&((n=t[0])==null?void 0:n.type)==="text"?t[0].text:t},QF=(e,t,n)=>{if(!n)return e;const r=t.find(u=>{var p,h,b;const m=u.agentContent;if(!m)return!1;switch(n.type){case"permission":return((p=m.confirmation)==null?void 0:p.toolCallId)===n.requestId&&m.confirmation.status==="pending";case"question":return((h=m.question)==null?void 0:h.toolCallId)===n.requestId&&m.question.status==="pending";case"elicitation":return((b=m.elicitation)==null?void 0:b.toolCallId)===n.requestId&&m.elicitation.status==="pending"}});if(!(r!=null&&r.agentContent))return e;const s=e.findIndex(u=>u.id===r.id),o=e[s]??{id:r.id,role:"assistant",content:"",timestamp:r.timestamp};let d=o.agentContent??Dn();switch(n.type){case"permission":d={...d,confirmation:r.agentContent.confirmation};break;case"question":d={...d,question:r.agentContent.question};break;case"elicitation":d={...d,elicitation:r.agentContent.elicitation};break}const f={...o,agentContent:d};return s<0?[...e,f]:e.map((u,m)=>m===s?f:u)},So=()=>({eventUnsubscribe:null,sessionEventConnectionState:"idle",isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,pendingResume:null,providerStall:null,actionStationarity:null,turnRecovery:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1}),sp=()=>new Promise(e=>{globalThis.setTimeout(()=>{if(typeof window<"u"&&typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>e(),{timeout:750});return}e()},350)}),ip=async e=>(await es(async()=>{const{teamService:t}=await import("./teamService-BliaDj1Z.js");return{teamService:t}},__vite__mapDeps([0,1,2,3]))).teamService.list(e),YF=(e,t)=>{let n=0,r=0,s=0;const i=new Map,o=new Map;let d=null;const f=()=>(d==null||d.abort("session-navigation"),d=null,n+=1,n),u=p=>p===n,m=p=>{try{p()}catch(h){console.warn("Failed to clean up stale event subscription",h)}};return{sessions:[],archivedSessions:[],currentSessionId:null,currentSessionRef:null,forkingSessionRef:null,isTemporarySession:!1,isLoading:!1,catalogLoadState:"idle",catalogError:null,archivedCatalogLoadState:"idle",archivedCatalogError:null,error:null,errorContext:null,goal:null,sideConversation:null,teams:[],setSessions:p=>e({sessions:p}),addSession:p=>e(h=>({sessions:hn(h.sessions,p)})),removeSession:p=>{const h=t();h.markTaskRead(p);const b=oe(h.currentSessionRef,p),k=oe(h.forkingSessionRef,p);(b||k)&&f(),b&&h.unsubscribeFromEvents(),e(S=>({sessions:tp(S.sessions,p),currentSessionId:b?null:S.currentSessionId,currentSessionRef:b?null:S.currentSessionRef,messages:b?[]:S.messages,goal:b?null:S.goal,sideConversation:b?null:S.sideConversation,teams:b?[]:S.teams,forkingSessionRef:k?null:S.forkingSessionRef,...b?So():{}}))},setCurrentSession:p=>{f(),e({currentSessionId:(p==null?void 0:p.sessionId)??null,currentSessionRef:p,isTemporarySession:!1,sideConversation:null,teams:[],pendingResume:null})},setTemporarySession:p=>e({isTemporarySession:p}),setLoading:p=>e({isLoading:p}),setError:p=>e({error:p,errorContext:null}),getNavigationVersion:()=>n,clearError:()=>e({error:null,errorContext:null}),setGoal:p=>e({goal:p}),startTemporarySession:p=>{f(),t().unsubscribeFromEvents(),Mt.getState().resetMode(),p&&t().selectProject(p),e({currentSessionId:nc,currentSessionRef:null,isTemporarySession:!0,forkingSessionRef:null,isLoading:!1,messages:[],goal:null,sideConversation:null,teams:[],tokenUsage:{...ci},error:null,errorContext:null,...So()})},loadSessions:async()=>{const p=++r,h=new Set(t().sessions.map(k=>Me(be(k)))),b=new Set;e({catalogLoadState:"loading",catalogError:null});try{let k,S=!0;do{const P=await X.listSessionPage(k);if(p!==r)return;for(const N of P.sessions)b.add(Me(be(N)));if(e(N=>{const M=new Set(P.sessions.map(j=>Me(be(j))));return{sessions:S?[...P.sessions,...N.sessions.filter(j=>!M.has(Me(be(j))))]:P.sessions.reduce((j,I)=>hn(j,I),N.sessions),catalogLoadState:P.nextCursor?"hydrating":"ready"}}),S=!1,k=P.nextCursor,k&&(await sp(),p!==r))return}while(k);if(p!==r)return;const C=t().sessions.filter(P=>{const N=Me(be(P));return b.has(N)||!h.has(N)}),x=np(t().unreadTaskKeys,C);hi(x),e({sessions:C,unreadTaskKeys:x,catalogLoadState:"ready",catalogError:null})}catch(k){if(p!==r)return;e({catalogLoadState:"error",catalogError:k.message})}},loadArchivedSessions:async()=>{const p=++s;e({archivedCatalogLoadState:"loading",archivedCatalogError:null});try{let h;const b=[];do{const k=await X.listSessionPage(h,50,!0);if(p!==s)return;for(const S of k.sessions){const C=b.findIndex(x=>oe(be(x),be(S)));C===-1?b.push(S):b[C]=S}h=k.nextCursor,h&&(e({archivedCatalogLoadState:"hydrating"}),await sp())}while(h);if(p!==s)return;e({archivedSessions:b,archivedCatalogLoadState:"ready",archivedCatalogError:null})}catch(h){if(p!==s)return;e({archivedCatalogLoadState:"error",archivedCatalogError:h.message})}},selectSession:async p=>{var k;const h=f();e({isLoading:!0,error:null,errorContext:null,forkingSessionRef:null});let b=null;try{const S=Go(t().sessions,p),C=[];let x=!1;if(b=await t().prepareEventSubscription(p,T=>{x?t().handleEvent(T):C.push(T)}),!u(h)){m(b),b=null;return}const[P,N,M,D]=await Promise.all([X.getMessages(p),X.getGoal(p).catch(()=>null),S?Promise.resolve(S):X.getSession(p),Xr.getState().agentTeamsEnabled?ip(p).catch(()=>[]):Promise.resolve([])]);if(!u(h)){m(b),b=null;return}const j=wo(P),I=lo(M,t().selectedProjectPath??((k=t().taskWorkspaceInfo)==null?void 0:k.cwd)??null);t().boundProjects.some(T=>T.available&&T.path===I)&&t().selectProject(I),Mt.getState().setMode(M.permissionMode??Fc),e(T=>{var $;return{currentSessionId:p.sessionId,currentSessionRef:p,isTemporarySession:!1,messages:j,goal:N,teams:D,isLoading:!1,tokenUsage:{...ci},isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,pendingResume:null,providerStall:null,actionStationarity:null,turnRecovery:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1,error:M.taskStatus==="failed"?(($=M.taskFailure)==null?void 0:$.message)??null:null,errorContext:M.taskStatus==="failed"&&M.taskFailure?{kind:"execution",sessionRef:p,failureCode:M.taskFailure.code}:null,sessions:hn(T.sessions,M)}}),t().markTaskRead(p),x=!0,t().replaceEventSubscription(b),b=null;for(const T of C)t().handleEvent(T)}catch(S){if(b&&m(b),!u(h))return;e({error:S.message,errorContext:{kind:"navigation",sessionRef:p},isLoading:!1})}},resyncSessionMessages:async p=>{const h=Me(p),b=i.get(h);if(b)return b;const k=n,S=Promise.resolve().then(async()=>{try{const C=await X.getMessages(p);if(!u(k)||!oe(t().currentSessionRef,p))return;const x=wo(C);e(P=>{var N;return{messages:QF(x,P.messages,(N=Go(P.sessions,p))==null?void 0:N.pendingInteraction),sessions:P.sessions.map(M=>oe(be(M),p)?{...M,messageCount:x.length}:M)}})}catch(C){console.warn("Failed to resync terminal session messages",C)}finally{i.get(h)===S&&i.delete(h)}});return i.set(h,S),S},archiveSession:async p=>{var h;try{const b=await X.archiveSession(p),k=new Set(b.archivedSessionIds),S=t(),C=((h=S.currentSessionRef)==null?void 0:h.projectPath)===p.projectPath&&k.has(S.currentSessionRef.sessionId);C&&(f(),S.unsubscribeFromEvents()),e(x=>{const P=x.sessions.filter(M=>M.projectPath!==p.projectPath||!k.has(M.sessionId)),N=np(x.unreadTaskKeys,P);return hi(N),{sessions:P,archivedSessions:hn(x.archivedSessions,b.session),unreadTaskKeys:N,currentSessionId:C?null:x.currentSessionId,currentSessionRef:C?null:x.currentSessionRef,messages:C?[]:x.messages,goal:C?null:x.goal,...C?So():{}}}),await t().loadArchivedSessions()}catch(b){e({error:b.message,errorContext:{kind:"task_action",sessionRef:p}})}},unarchiveSession:async p=>{try{const h=await X.unarchiveSession(p),b=new Set(h.restoredSessionIds);e(k=>({archivedSessions:k.archivedSessions.filter(S=>S.projectPath!==p.projectPath||!b.has(S.sessionId)),sessions:hn(k.sessions,h.session)})),await Promise.all([t().loadSessions(),t().loadArchivedSessions()])}catch(h){e({error:h.message,errorContext:{kind:"task_action",sessionRef:p}})}},deleteSession:async p=>{const h=t(),b=oe(h.currentSessionRef,p),k=oe(h.forkingSessionRef,p),S=b||k?f():null,C=b?S:null;k&&e({forkingSessionRef:null});try{await X.deleteSession(p),t().markTaskRead(p);const x=t(),P=oe(x.currentSessionRef,p)&&(C===null||u(C));P&&(f(),x.unsubscribeFromEvents()),e(N=>({sessions:tp(N.sessions,p),currentSessionId:P?null:N.currentSessionId,currentSessionRef:P?null:N.currentSessionRef,messages:P?[]:N.messages,goal:P?null:N.goal,...P?So():{}}))}catch(x){if(C!==null&&(!u(C)||!oe(t().currentSessionRef,p)))return;e({error:x.message})}},updateSession:async(p,h)=>{try{await X.updateSession(p,h),e(b=>({sessions:b.sessions.map(k=>k.sessionId===p.sessionId&&k.projectPath===p.projectPath?{...k,title:h}:k)}))}catch(b){e({error:b.message})}},forkSession:async p=>{const h=f(),b=be(p);e({forkingSessionRef:b,isLoading:!1,error:null});let k=null;try{const S=await X.forkSession(p),C=be(S.session),x=wo(S.messages);if(e(P=>({sessions:hn(P.sessions,S.session)})),!u(h))return;if(k=await t().prepareEventSubscription(C),!u(h)){m(k),k=null;return}e({currentSessionId:C.sessionId,currentSessionRef:C,isTemporarySession:!1,messages:x,goal:null,tokenUsage:{...ci},error:null,forkingSessionRef:null}),t().replaceEventSubscription(k),k=null}catch(S){if(k&&m(k),!u(h))return;e({error:S.message,forkingSessionRef:null})}},rewindSession:async(p,h)=>{const{currentSessionRef:b,isTemporarySession:k,isStreaming:S}=t();if(!b||k)return e({error:"No persisted session is available for rewind"}),!1;if(S)return e({error:"Stop the active run before rewinding"}),!1;const C=n;try{const x=await X.rewindSession(b,p,h);if(!u(C)||!oe(t().currentSessionRef,b))return!1;const P=wo(x.messages);return e(N=>({messages:P,tokenUsage:{...ci},error:null,currentRunId:null,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,pendingResume:null,providerStall:null,actionStationarity:null,turnRecovery:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1,sessions:N.sessions.map(M=>M.sessionId===b.sessionId&&M.projectPath===b.projectPath?{...M,messageCount:P.length}:M)})),!0}catch(x){return!u(C)||!oe(t().currentSessionRef,b)||e({error:x.message}),!1}},sendMessage:async p=>{var O,Q,ae,le,de,me;const{currentSessionId:h,currentSessionRef:b,isTemporarySession:k,isStreaming:S,addSession:C,addMessage:x}=t(),P=n,N=b,M={isStreaming:S,agentPhase:t().agentPhase,currentRunId:t().currentRunId};let D=b,j=h,I=N,T=null,$=null;const F=()=>u(P)&&oe(t().currentSessionRef,I),te=X$(p.content);if(te){if((((O=p.attachments)==null?void 0:O.length)??0)>0)return e({error:"Side conversations do not accept image attachments"}),!1;if(!te.question)return e({error:"Usage: /btw <question>"}),!1;if(k||!D||!j)return e({error:"Start or select a Session before using /btw"}),!1;d==null||d.abort("side-conversation-replaced");const Y=new AbortController;d=Y;const he=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;e({sideConversation:{requestId:he,sessionRef:D,question:te.question,status:"loading"},error:null,errorContext:null});try{const R=await X.askSideQuestion(D,te.question,Y.signal);return Y.signal.aborted||!F()||((Q=t().sideConversation)==null?void 0:Q.requestId)!==he?!1:(e({sideConversation:{requestId:he,sessionRef:D,question:te.question,status:"completed",response:R.response,durationMs:R.durationMs,modelId:R.modelId}}),R.usage&&t().updateTokenUsage({inputTokens:R.usage.promptTokens,outputTokens:R.usage.completionTokens,totalTokens:R.usage.totalTokens,cacheReadTokens:R.usage.cacheReadInputTokens??0,cacheWriteTokens:R.usage.cacheCreationInputTokens??0,costUsd:R.usage.costUsd}),!0)}catch(R){return Y.signal.aborted||!F()||e({sideConversation:{requestId:he,sessionRef:D,question:te.question,status:"error",error:R instanceof Error?R.message:String(R)}}),!1}finally{d===Y&&(d=null)}}if(d==null||d.abort("main-conversation-submitted"),d=null,e({sideConversation:null,pendingResume:null}),k||!j||j===nc)try{const Y=_F(p.content),he=await X.createSession(t().selectedProjectPath??((ae=t().taskWorkspaceInfo)==null?void 0:ae.cwd)??void 0,Y||void 0);if(C(he),!F())return!1;D=be(he),j=he.sessionId,e({currentSessionId:he.sessionId,currentSessionRef:D,isTemporarySession:!1}),I=D}catch(Y){return F()&&e({error:Y.message}),!1}if(!D||!j||j===nc)return F()&&e({error:"Failed to create session"}),!1;try{if(!S){if(T=await t().prepareEventSubscription(D),!F())return m(T),T=null,!1;t().replaceEventSubscription(T),T=null}if(!F())return!1;const Y=p.content.trim();if(Y.startsWith("!")){if((((le=p.attachments)==null?void 0:le.length)??0)>0)throw new Error("User shell commands do not accept image attachments");const B=Y.slice(1).trim();if(!B)throw new Error("User shell command cannot be empty");S||e({isStreaming:!0,agentPhase:"running",error:null,errorContext:null});const Se=await X.executeUserShellCommand(D,B);return F()?(Se.auxiliary||e({isStreaming:!1,agentPhase:"idle",pendingResume:null}),Se.delivery&&e({pendingSteeringCount:Se.queued??0,pendingInputDelivery:Se.delivery==="current_turn"?"current_turn":"next_turn"}),!0):!1}if((((de=p.attachments)==null?void 0:de.length)??0)===0&&(Y==="/goal"||Y.startsWith("/goal "))){$=`goal-command-${Date.now()}`,x({id:$,role:"user",content:Y,timestamp:Date.now()});const B=Y.slice(5).trim().split(/\s+/).filter(Boolean),Se=(me=B[0])==null?void 0:me.toLowerCase();if(!Se||Se==="status"){const Pe=await X.getGoal(D);return F()&&e({goal:Pe}),F()}if(Se==="clear")return await X.clearGoal(D),F()&&e({goal:null}),F();let qe;if(Se==="pause")qe=await X.updateGoal(D,{action:"pause"});else if(Se==="resume")qe=await X.updateGoal(D,{action:"resume"});else if(Se==="edit"){const Pe=B.slice(1).join(" ").trim();if(!Pe)throw new Error("Usage: /goal edit <objective>");qe=await X.updateGoal(D,{action:"edit",objective:Pe})}else{const Pe=B.lastIndexOf("--budget");let Jt;if(Pe>=0){const Qt=B[Pe+1];if(!Qt||!/^[1-9]\d*$/.test(Qt))throw new Error("--budget requires a positive integer");Jt=Number(Qt),B.splice(Pe,2)}const et=B.join(" ").trim();if(!et)throw new Error("Usage: /goal <objective>");const{currentMode:Ht}=Mt.getState();qe=await X.createGoal(D,et,Jt,Ht)}return F()?(e({goal:qe.goal,...qe.runId?{currentRunId:qe.runId,isStreaming:!0,agentPhase:"running"}:{}}),!0):!1}$=`temp-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,x({id:$,role:"user",content:JF(p),timestamp:Date.now()}),e({isStreaming:!0,error:null,errorContext:null,recoveredSteeringCount:S?t().recoveredSteeringCount:0});const{currentMode:he,currentModelId:R}=Mt.getState(),{modelId:ce,...ve}=p,He=ce??R??void 0,yt=p.reasoningEffort,We=p.serviceTier,tt=p.responseVerbosity,Z=p.communicationStyle,pt=He&&!S?{...ve,modelId:He}:ve,L=await X.sendMessage(D,pt,he);return F()?(e({currentRunId:L.runId,pendingSteeringCount:L.status==="steering_queued"||L.status==="follow_up_queued"?Math.max(0,L.queued??1):t().pendingSteeringCount,pendingInputDelivery:L.status==="steering_queued"?"current_turn":L.status==="follow_up_queued"?"next_turn":t().pendingInputDelivery,sessions:(He||yt||We||tt||Z)&&!S?t().sessions.map(B=>B.sessionId===D.sessionId&&B.projectPath===D.projectPath?{...B,...He?{selectedModelId:He}:{},...yt?{reasoningEffort:yt}:{},...We?{serviceTier:We}:{},...tt?{responseVerbosity:tt}:{},...Z?{communicationStyle:Z}:{}}:B):t().sessions}),!0):!1}catch(Y){if(T&&m(T),!F())return!1;if($&&!t().messages.some(R=>R.id===$)&&!Yu(Y))return!0;const he=Yu(Y)&&Y.code==="SESSION_WORKSPACE_UNAVAILABLE"?"workspace_unavailable":void 0;return e(R=>({error:Y.message,errorContext:{kind:"submission",sessionRef:D,...he?{failureCode:he}:{}},messages:$?R.messages.filter(ce=>ce.id!==$):R.messages,...M})),!1}},dismissSideConversation:()=>{d==null||d.abort("side-conversation-dismissed"),d=null,e({sideConversation:null})},loadTeams:async p=>{const h=p??t().currentSessionRef;if(!h||!Xr.getState().agentTeamsEnabled){e({teams:[]});return}const b=Me(h),k=o.get(b);if(k)return k;let S;S=(async()=>{try{const C=await ip(h);if(!oe(t().currentSessionRef,h))return;e({teams:C})}catch{oe(t().currentSessionRef,h)&&e({teams:[]})}finally{o.get(b)===S&&o.delete(b)}})(),o.set(b,S),await S},abortSession:async()=>{const{currentSessionRef:p,isStopping:h}=t();if(!p||h)return!1;e({isStopping:!0,error:null,errorContext:null});try{return await X.abortSession(p),!oe(t().currentSessionRef,p)||(await t().resyncSessionMessages(p),!oe(t().currentSessionRef,p))?!1:(t().unsubscribeFromEvents(),e({isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,pendingResume:null,providerStall:null,actionStationarity:null,turnRecovery:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1}),!0)}catch(b){return oe(t().currentSessionRef,p)&&e({isStopping:!1,error:b instanceof Error?b.message:"Failed to stop task",errorContext:{kind:"task_action",sessionRef:p}}),!1}},pauseGoal:async()=>{const{currentSessionRef:p,isTemporarySession:h}=t();if(!p||h){e({error:"No persisted session is available for this goal"});return}try{const b=await X.updateGoal(p,{action:"pause"});if(!oe(t().currentSessionRef,p))return;e({goal:b.goal,error:null})}catch(b){if(!oe(t().currentSessionRef,p))return;e({error:b.message})}},resumeGoal:async()=>{const{currentSessionRef:p,isTemporarySession:h}=t();if(!p||h){e({error:"No persisted session is available for this goal"});return}try{const b=await X.updateGoal(p,{action:"resume"});if(!oe(t().currentSessionRef,p))return;e({goal:b.goal,error:null,...b.runId?{currentRunId:b.runId,isStreaming:!0,agentPhase:"running"}:{}})}catch(b){if(!oe(t().currentSessionRef,p))return;e({error:b.message})}},editGoal:async p=>{const{currentSessionRef:h,isTemporarySession:b}=t();if(!h||b){e({error:"No persisted session is available for this goal"});return}try{const k=await X.updateGoal(h,{action:"edit",objective:p});if(!oe(t().currentSessionRef,h))return;e({goal:k.goal,error:null,...k.runId?{currentRunId:k.runId,isStreaming:!0,agentPhase:"running"}:{}})}catch(k){if(!oe(t().currentSessionRef,h))return;e({error:k.message})}},clearGoal:async()=>{const{currentSessionRef:p,isTemporarySession:h}=t();if(!p||h){e({error:"No persisted session is available for this goal"});return}try{if(await X.clearGoal(p),!oe(t().currentSessionRef,p))return;e({goal:null,error:null})}catch(b){if(!oe(t().currentSessionRef,p))return;e({error:b.message})}}}},ZF=(e,t)=>{const n=new WeakMap;let r=null;return{isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,pendingResume:null,providerStall:null,actionStationarity:null,turnRecovery:null,sessionEventConnectionState:"idle",currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},eventUnsubscribe:null,currentAssistantMessageId:null,hasToolCalls:!1,setStreaming:s=>e({isStreaming:s}),setAgentPhase:s=>e({agentPhase:s}),setRunId:s=>e({currentRunId:s}),prepareEventSubscription:async(s,i)=>{const o=i??uu(t,e);let d=null,f="connecting";return d=await X.openEventSubscription(s,o,{onConnectionStateChange:u=>{f=u,d&&r===d&&e({sessionEventConnectionState:u})}}),n.set(d,f),d},replaceEventSubscription:s=>{const i=t().eventUnsubscribe;if(r=s,e({eventUnsubscribe:s,sessionEventConnectionState:s?n.get(s)??"connected":"idle"}),Ga.reset(),i&&i!==s)try{i()}catch(o){console.warn("Failed to clean up previous event subscription",o)}},setCurrentAssistantMessageId:s=>e({currentAssistantMessageId:s}),setHasToolCalls:s=>e({hasToolCalls:s}),startAgentResponse:s=>{e({currentAssistantMessageId:s,hasToolCalls:!1,isStreaming:!0,agentPhase:"running",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,turnRecovery:null})},endAgentResponse:()=>{Ga.drainAll(),e({currentAssistantMessageId:null,hasToolCalls:!1,isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,pendingResume:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null})},subscribeToEvents:async s=>{const i=await t().prepareEventSubscription(s);t().replaceEventSubscription(i)},reconnectSessionEvents:async()=>{const s=t().currentSessionRef;if(s){t().unsubscribeFromEvents(),e({sessionEventConnectionState:"connecting"});try{await t().subscribeToEvents(s)}catch(i){throw e({sessionEventConnectionState:"offline"}),i}}},unsubscribeFromEvents:()=>{const{eventUnsubscribe:s}=t();r=null,e({eventUnsubscribe:null,sessionEventConnectionState:"idle"});try{s==null||s()}catch(i){console.warn("Failed to clean up event subscription",i)}finally{Ga.reset()}},handleEvent:s=>{uu(t,e)(s)}}};function XF(e){var t;return((t=e.taskPromptSummary)==null?void 0:t.trimStart().startsWith("/review"))===!0}function Vd(e,t){var r;const n=(r=e.taskStatusReason)==null?void 0:r.trim();if(XF(e)){if(e.taskStatus==="running")return t("taskHome.review.running");if(n!=null&&n.startsWith("Code review stale:"))return t("taskHome.review.stale");if(n==="Code review aborted")return t("taskHome.review.aborted");if(n==="Code review interrupted by process restart")return t("taskHome.review.interrupted");if(e.taskStatus==="failed")return t("taskHome.review.failed")}return e.taskFailure?t(Cp(e.taskFailure.code)):n==="user-cancel"?t("session.reason.cancelledByUser"):n||void 0}let rc=0;function jo(e,t){const n=e.findIndex(s=>s.id===t.id);if(n===-1)return[...e,t];const r=e.slice();return r[n]=t,r}const e5=Yo(e=>({schedules:[],isLoading:!1,hasLoaded:!1,error:null,loadSchedules:async()=>{const t=++rc;e({isLoading:!0,error:null});try{const n=await X.listSchedules();if(t!==rc)return;e({schedules:n,isLoading:!1,hasLoaded:!0})}catch(n){if(t!==rc)return;e({error:n instanceof Error?n.message:Ke("schedule.error.loadFailed"),isLoading:!1,hasLoaded:!0})}},createSchedule:async t=>{e({error:null});try{const n=await X.createSchedule(t);return e(r=>({schedules:jo(r.schedules,n)})),n}catch(n){throw e({error:n instanceof Error?n.message:Ke("schedule.error.createFailed")}),n}},updateSchedule:async(t,n)=>{e({error:null});try{const r=await X.updateSchedule(t,n);return e(s=>({schedules:jo(s.schedules,r)})),r}catch(r){throw e({error:r instanceof Error?r.message:Ke("schedule.error.updateFailed")}),r}},deleteSchedule:async t=>{e({error:null});try{await X.deleteSchedule(t),e(n=>({schedules:n.schedules.filter(r=>r.id!==t)}))}catch(n){throw e({error:n instanceof Error?n.message:Ke("schedule.error.deleteFailed")}),n}},toggleSchedule:async(t,n)=>{e({error:null});try{const r=n?await X.enableSchedule(t):await X.disableSchedule(t);return e(s=>({schedules:jo(s.schedules,r)})),r}catch(r){throw e({error:r instanceof Error?r.message:Ke("schedule.error.toggleFailed")}),r}},runSchedule:async t=>{e({error:null});try{const n=await X.runSchedule(t);return e(r=>({schedules:jo(r.schedules,n)})),n}catch(n){throw e({error:n instanceof Error?n.message:Ke("schedule.error.runFailed")}),n}}})),Vx="blade.projects.selected";function op(){return typeof localStorage>"u"?null:localStorage.getItem(Vx)}function Io(e){typeof localStorage<"u"&&localStorage.setItem(Vx,e)}const t5=new Set(["queued","running","completed","failed","cancelled","interrupted"]),sc=new Set(["default","autoEdit","yolo","plan"]),ap=new Set(["auto","off","minimal","low","medium","high","xhigh","max"]),cp=new Set(["auto","standard","fast","flex"]),lp=new Set(["auto","low","medium","high"]),dp=new Set(["auto","pragmatic","friendly","explanatory"]),up=new Set(["high","medium","low"]),pp=new Set(["feature","bug","maintenance","research"]);function n5(e){return typeof e=="string"&&t5.has(e)}function r5(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(!["changedFiles","additions","deletions","commits"].some(r=>typeof t[r]!="number"||!Number.isInteger(t[r])||t[r]<0))return{changedFiles:t.changedFiles,additions:t.additions,deletions:t.deletions,commits:t.commits}}function fp(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=Q0(t.code);if(!(!n||typeof t.message!="string"||typeof t.retryable!="boolean"))return{code:n,message:Ke(Cp(n)),retryable:Y0(n)}}function s5(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(!(!["applied","discarded","conflicted"].includes(String(t.status))||typeof t.updatedAt!="string"))return{status:t.status,updatedAt:t.updatedAt,...typeof t.sourceCommit=="string"?{sourceCommit:t.sourceCommit}:{},...typeof t.changedFiles=="number"&&Number.isInteger(t.changedFiles)&&t.changedFiles>=0?{changedFiles:t.changedFiles}:{},...typeof t.message=="string"?{message:t.message}:{}}}function vs(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=t?e:void 0}const i5=(e,t)=>{let n=null,r=!1,s=!1,i=0;const o=new Map,d=u=>{const m=Me(u),p=++i;o.set(m,p),X.getSession(u).then(h=>{o.get(m)===p&&e(b=>({sessions:hn(b.sessions,h)}))}).catch(()=>{o.get(m)===p&&t().loadSessions()}).finally(()=>{o.get(m)===p&&o.delete(m)})},f=u=>{const m=Me(u),p=++i;o.set(m,p),queueMicrotask(()=>{o.get(m)===p&&o.delete(m)})};return{taskEventsConnected:!1,taskEventConnectionState:"connecting",taskEventUnsubscribe:null,taskWorkspaceInfo:null,isTaskWorkspaceLoading:!1,taskWorkspaceError:null,boundProjects:[],selectedProjectPath:op(),isDispatchingTask:!1,isUpdatingTaskAdmission:!1,isBindingProject:!1,cancellingTaskKeys:[],retryingTaskKeys:[],updatingTaskKeys:[],taskDeliveryActions:{},unreadTaskKeys:VF(),handleTaskEvent:u=>{if(u.type==="session.created"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;d({sessionId:I,projectPath:T});return}if(u.type==="session.deleted"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;const $={sessionId:I,projectPath:T};f($),t().removeSession($);return}if(u.type==="session.archived"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;const $={sessionId:I,projectPath:T};f($),t().removeSession($),t().loadArchivedSessions();return}if(u.type==="session.unarchived"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;d({sessionId:I,projectPath:T}),t().loadArchivedSessions();return}if(u.type==="session.updated"){const I=u.properties.sessionId,T=u.properties.projectPath,$=u.properties.title,F=u.properties.selectedModelId,te=u.properties.permissionMode,O=u.properties.reasoningEffort,Q=u.properties.serviceTier,ae=u.properties.responseVerbosity,le=u.properties.communicationStyle,de=u.properties.taskPriority,me=u.properties.taskKind,Y=u.properties.taskDueAt;if(typeof I!="string"||typeof T!="string"||!(typeof $=="string"&&$.trim()||typeof F=="string"&&F.trim()||sc.has(te)||ap.has(O)||cp.has(Q)||lp.has(ae)||dp.has(le)||up.has(de)||pp.has(me)||Y===null||typeof Y=="string"&&Number.isFinite(Date.parse(Y))))return;const he={sessionId:I,projectPath:T};if(oe(t().currentSessionRef,he)&&sc.has(te)&&Mt.getState().setMode(te),!t().sessions.some(ce=>oe(be(ce),he))){d(he);return}e(ce=>({sessions:ce.sessions.map(ve=>oe({sessionId:ve.sessionId,projectPath:ve.projectPath},he)?{...ve,...typeof $=="string"&&$.trim()?{title:$}:{},...typeof F=="string"&&F.trim()?{selectedModelId:F}:{},...sc.has(te)?{permissionMode:te}:{},...ap.has(O)?{reasoningEffort:O}:{},...cp.has(Q)?{serviceTier:Q}:{},...lp.has(ae)?{responseVerbosity:ae}:{},...dp.has(le)?{communicationStyle:le}:{},...up.has(de)?{taskPriority:de}:{},...pp.has(me)?{taskKind:me}:{},...Y===null?{taskDueAt:void 0}:typeof Y=="string"&&Number.isFinite(Date.parse(Y))?{taskDueAt:Y}:{}}:ve)}));return}if(u.type==="task.delivery"){const I=u.properties.sessionId,T=u.properties.projectPath,$=s5(u.properties.taskDelivery);if(typeof I!="string"||typeof T!="string"||!$)return;const F={sessionId:I,projectPath:T},te=u.properties.taskWorktreeRemoved===!0;e(O=>({sessions:O.sessions.map(Q=>oe(be(Q),F)?{...Q,taskDelivery:$,...te?{taskWorktreePath:void 0,taskWorktreeBranch:void 0}:{},lastMessageTime:typeof u.properties.updatedAt=="string"?u.properties.updatedAt:Q.lastMessageTime}:Q)}));return}if(u.type==="interaction.pending"){const I=u.properties.sessionId,T=u.properties.projectPath,$=u.properties.interactionType,F=u.properties.requestId;if(typeof I!="string"||typeof T!="string"||$!=="permission"&&$!=="question"&&$!=="elicitation"||typeof F!="string"||!F)return;const te={sessionId:I,projectPath:T},O=t().sessions.find(ae=>oe(be(ae),te));if(!O){t().loadSessions();return}if(e(ae=>({sessions:ae.sessions.map(le=>oe(be(le),te)?{...le,pendingInteraction:{type:$,requestId:F}}:le)})),!(typeof document<"u"&&document.visibilityState==="visible"&&oe(t().currentSessionRef,te))&&Xr.getState().notifyErrors){const le=O.title??O.sessionId??I;rp({ref:te,title:`Blade · ${Ke($==="question"?"attention.notification.question":$==="elicitation"?"attention.notification.elicitation":"attention.notification.permission")}`,body:le,onOpen:de=>{typeof window>"u"||(window.focus(),window.dispatchEvent(new CustomEvent(Vo,{detail:de})))}})}return}if(u.type==="interaction.resolved"){const I=u.properties.sessionId,T=u.properties.projectPath,$=u.properties.requestId;if(typeof I!="string"||typeof T!="string"||typeof $!="string")return;const F={sessionId:I,projectPath:T};e(te=>({sessions:te.sessions.map(O=>{var Q;return oe(be(O),F)&&((Q=O.pendingInteraction)==null?void 0:Q.requestId)===$?{...O,pendingInteraction:void 0}:O})}));return}if(u.type==="schedule.fired"){e5.getState().loadSchedules();return}if(u.type!=="task.status")return;const m=u.properties.sessionId,p=u.properties.projectPath,h=u.properties.taskStatus;if(typeof m!="string"||typeof p!="string"||!n5(h))return;const b={sessionId:m,projectPath:p},k=vs(u.properties.taskInFlight,0),S=vs(u.properties.taskQueueDepth,0),C=vs(u.properties.taskConcurrencyLimit,1),x=typeof u.properties.taskAdmissionPaused=="boolean"?u.properties.taskAdmissionPaused:void 0;k!==void 0&&S!==void 0&&C!==void 0&&e(I=>{var T,$;return{taskWorkspaceInfo:I.taskWorkspaceInfo?{...I.taskWorkspaceInfo,taskAdmission:{inFlight:k,queued:S,maxConcurrent:C,maxQueued:((T=I.taskWorkspaceInfo.taskAdmission)==null?void 0:T.maxQueued)??100,paused:x??(($=I.taskWorkspaceInfo.taskAdmission)==null?void 0:$.paused)??!1}}:null}});const P=t().sessions.find(I=>oe(be(I),b)),N=typeof document<"u"&&document.visibilityState==="visible"&&oe(t().currentSessionRef,b),M=GF(P==null?void 0:P.taskStatus,h,N),D=Me(b),j=!t().unreadTaskKeys.includes(D);if(M&&j){e($=>{const F=[...$.unreadTaskKeys,D];return hi(F),{unreadTaskKeys:F}});const I=Xr.getState();if(I.notifySounds&&Gx(h)&&WF(h),h==="completed"?I.notifyBuild:I.notifyErrors){const $=Ke(h==="completed"?"attention.notification.completed":h==="failed"?"attention.notification.failed":"attention.notification.interrupted"),F=fp(u.properties.taskFailure),te=P?Vd({...P,taskStatus:h,taskFailure:F??P.taskFailure,taskStatusReason:typeof u.properties.taskStatusReason=="string"?u.properties.taskStatusReason:P.taskStatusReason,taskPromptSummary:typeof u.properties.taskPromptSummary=="string"?u.properties.taskPromptSummary:P.taskPromptSummary},Ke):(F==null?void 0:F.message)??(typeof u.properties.taskStatusReason=="string"?u.properties.taskStatusReason:void 0),O=(P==null?void 0:P.title)??(P==null?void 0:P.sessionId)??m;rp({ref:b,title:`Blade · ${$}`,body:te?`${O} · ${te}`:O,onOpen:Q=>{typeof window>"u"||(window.focus(),window.dispatchEvent(new CustomEvent(Vo,{detail:Q})))}})}}if(!P){d(b);return}e(I=>({sessions:I.sessions.map(T=>oe({sessionId:T.sessionId,projectPath:T.projectPath},b)?{...T,taskStatus:h,taskStatusReason:typeof u.properties.taskStatusReason=="string"?u.properties.taskStatusReason:void 0,taskFailure:h==="failed"?fp(u.properties.taskFailure)??T.taskFailure:void 0,taskPromptSummary:typeof u.properties.taskPromptSummary=="string"?u.properties.taskPromptSummary:T.taskPromptSummary,taskStartedAt:typeof u.properties.taskStartedAt=="string"?u.properties.taskStartedAt:h==="queued"?void 0:T.taskStartedAt,taskCompletedAt:typeof u.properties.taskCompletedAt=="string"?u.properties.taskCompletedAt:h==="queued"||h==="running"?void 0:T.taskCompletedAt,taskDiffStat:r5(u.properties.taskDiffStat)??T.taskDiffStat,taskQueuePosition:h==="queued"?vs(u.properties.taskQueuePosition,1)??T.taskQueuePosition:void 0,taskQueueDepth:h==="queued"?vs(u.properties.taskQueueDepth,0)??T.taskQueueDepth:void 0,taskConcurrencyLimit:vs(u.properties.taskConcurrencyLimit,1)??T.taskConcurrencyLimit,lastMessageTime:typeof u.properties.updatedAt=="string"?u.properties.updatedAt:T.lastMessageTime}:T)}))},subscribeToTaskEvents:async()=>{if(r=!0,!t().taskEventUnsubscribe){if(n)return n;e({taskEventsConnected:!1,taskEventConnectionState:"connecting"}),n=(async()=>{try{const u=await X.openTaskEventSubscription(m=>t().handleTaskEvent(m),{onConnectionChange:m=>{e({taskEventsConnected:m})},onConnectionStateChange:m=>{r&&(m==="reconnecting"||m==="offline")&&(s=!0),e({taskEventsConnected:m==="connected",taskEventConnectionState:m}),m==="connected"&&s&&(s=!1,Promise.all([t().loadSessions(),t().loadTaskWorkspaceInfo(),t().loadBoundProjects(),Mt.getState().loadModels()]))}});if(!r||t().taskEventUnsubscribe){u();return}e({taskEventUnsubscribe:u})}catch(u){throw s=!0,e({taskEventsConnected:!1,taskEventConnectionState:"offline"}),u}})();try{await n}finally{n=null}}},reconnectTaskEvents:async()=>{s=!0,t().unsubscribeFromTaskEvents(),await t().subscribeToTaskEvents()},unsubscribeFromTaskEvents:()=>{var u,m;r=!1,(m=(u=t()).taskEventUnsubscribe)==null||m.call(u),e({taskEventUnsubscribe:null,taskEventsConnected:!1,taskEventConnectionState:"offline"})},loadTaskWorkspaceInfo:async()=>{e({isTaskWorkspaceLoading:!0,taskWorkspaceError:null});try{const u=await X.getWorkspaceInfo();e({taskWorkspaceInfo:u,isTaskWorkspaceLoading:!1})}catch(u){e({isTaskWorkspaceLoading:!1,taskWorkspaceError:u instanceof Error?u.message:"Failed to load task workspace"})}},loadBoundProjects:async()=>{try{const u=await X.listProjects(),m=op(),p=u.find(h=>h.available&&h.path===m)??u.find(h=>h.isCurrent)??u.find(h=>h.available);p&&Io(p.path),e({boundProjects:u,selectedProjectPath:(p==null?void 0:p.path)??null})}catch(u){e({error:u instanceof Error?u.message:"Failed to load projects"})}},bindProject:async u=>{e({isBindingProject:!0,error:null});try{const m=await X.bindProject(u);Io(m.path),e(p=>({boundProjects:[...p.boundProjects.filter(h=>h.path!==m.path),m].sort((h,b)=>h.isCurrent!==b.isCurrent?h.isCurrent?-1:1:h.name.localeCompare(b.name)),selectedProjectPath:m.path,isBindingProject:!1}))}catch(m){throw e({isBindingProject:!1,error:m instanceof Error?m.message:"Failed to bind project"}),m}},unbindProject:async u=>{try{await X.unbindProject(u),e(m=>{const p=m.boundProjects.filter(b=>b.path!==u||b.isCurrent),h=m.selectedProjectPath===u?p.find(b=>b.isCurrent)??p.find(b=>b.available):void 0;return h&&Io(h.path),{boundProjects:p,...h?{selectedProjectPath:h.path}:{}}})}catch(m){throw e({error:m instanceof Error?m.message:"Failed to unbind project"}),m}},selectProject:u=>{Io(u),e({selectedProjectPath:u})},markTaskRead:u=>{const m=Me(u);e(p=>{const h=p.unreadTaskKeys.filter(b=>b!==m);return hi(h),{unreadTaskKeys:h}})},clearUnreadTasks:()=>{hi([]),e({unreadTaskKeys:[]})},setTaskAdmissionPaused:async u=>{if(!t().isUpdatingTaskAdmission){e({isUpdatingTaskAdmission:!0,error:null,errorContext:null});try{const m=await X.setTaskAdmissionPaused(u);e(p=>({taskWorkspaceInfo:p.taskWorkspaceInfo?{...p.taskWorkspaceInfo,taskAdmission:m}:p.taskWorkspaceInfo}))}catch(m){throw e({error:m instanceof Error?m.message:"Failed to update task admission",errorContext:{kind:"task_action"}}),m}finally{e({isUpdatingTaskAdmission:!1})}}},updateTask:async(u,m)=>{const p=Me(u);if(!t().updatingTaskKeys.includes(p)){e(h=>({updatingTaskKeys:[...h.updatingTaskKeys,p],error:null,errorContext:null}));try{const h=await X.updateTask(u,m);e(b=>({sessions:hn(b.sessions,h)}))}catch(h){throw e({error:h instanceof Error?h.message:"Failed to update task",errorContext:{kind:"task_action",sessionRef:u}}),h}finally{e(h=>({updatingTaskKeys:h.updatingTaskKeys.filter(b=>b!==p)}))}}},cancelTask:async u=>{const m=Me(u);if(!t().cancellingTaskKeys.includes(m)){e(p=>({cancellingTaskKeys:[...p.cancellingTaskKeys,m],error:null,errorContext:null}));try{await X.abortSession(u);const p=oe(t().currentSessionRef,u);p&&(await t().resyncSessionMessages(u),oe(t().currentSessionRef,u)&&t().unsubscribeFromEvents()),e(h=>({sessions:h.sessions.map(b=>oe(be(b),u)?{...b,taskStatus:"cancelled",taskQueuePosition:void 0,taskQueueDepth:void 0,taskCompletedAt:b.taskCompletedAt??new Date().toISOString()}:b),...p?{isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,pendingResume:null,providerStall:null,actionStationarity:null,turnRecovery:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,currentAssistantMessageId:null,hasToolCalls:!1,eventUnsubscribe:null}:{}}))}catch(p){throw e({error:p instanceof Error?p.message:"Failed to stop task",errorContext:{kind:"task_action",sessionRef:u}}),p}finally{e(p=>({cancellingTaskKeys:p.cancellingTaskKeys.filter(h=>h!==m)}))}}},retryTask:async u=>{const m=Me(u);if(t().retryingTaskKeys.includes(m))return;const p=t().getNavigationVersion(),h=t().selectedProjectPath,b=()=>t().getNavigationVersion()===p&&t().selectedProjectPath===h;e(k=>({retryingTaskKeys:[...k.retryingTaskKeys,m],error:null,errorContext:null}));try{const k=await X.retryTask(u);e(S=>({sessions:hn(S.sessions,k.session)})),t().markTaskRead(u),b()&&await t().selectSession(be(k.session))}catch(k){throw b()&&e({error:k instanceof Error?k.message:"Failed to retry task",errorContext:{kind:"task_action",sessionRef:u}}),k}finally{e(k=>({retryingTaskKeys:k.retryingTaskKeys.filter(S=>S!==m)}))}},deliverTask:async(u,m)=>{const p=Me(u);if(!t().taskDeliveryActions[p]){e(h=>({taskDeliveryActions:{...h.taskDeliveryActions,[p]:m},error:null,errorContext:null}));try{const h=await X.deliverTask(u,m);e(b=>({sessions:hn(b.sessions,h)})),t().markTaskRead(u)}catch(h){throw e({error:h instanceof Error?h.message:"Failed to deliver task changes",errorContext:{kind:"task_action",sessionRef:u}}),h}finally{e(h=>{const{[p]:b,...k}=h.taskDeliveryActions;return{taskDeliveryActions:k}})}}},dispatchTask:async(u,m)=>{const p=t().getNavigationVersion(),h=t().selectedProjectPath,b=u.projectPath??h??void 0,k=()=>t().getNavigationVersion()===p&&t().selectedProjectPath===h;e({isDispatchingTask:!0,error:null,errorContext:null});try{const S=await X.createTask({...u,projectPath:b});e(C=>({sessions:hn(C.sessions,S.session),isDispatchingTask:!1})),(m==null?void 0:m.selectSession)!==!1&&k()&&await t().selectSession(be(S.session))}catch(S){throw e({isDispatchingTask:!1,...k()?{error:S instanceof Error?S.message:"Failed to dispatch task"}:{}}),S}},startCodeReview:async u=>{const m=t().getNavigationVersion(),p=t().selectedProjectPath,h=u.projectPath??p??void 0,b=()=>t().getNavigationVersion()===m&&t().selectedProjectPath===p;e({isDispatchingTask:!0,error:null,errorContext:null});let k,S=!1;try{k=await X.createSession(h,"Code Review");const C=be(k);await X.startCodeReview(C,{kind:u.kind,...u.ref?{ref:u.ref}:{},...u.instructions?{instructions:u.instructions}:{},...u.modelId?{modelId:u.modelId}:{}}),S=!0;const x={...k,taskStatus:"running",taskStatusReason:Ke("taskHome.review.running"),taskPromptSummary:`/review ${u.kind}${u.ref?` ${u.ref}`:""}`};e(P=>({sessions:hn(P.sessions,x),isDispatchingTask:!1})),b()&&await t().selectSession(C)}catch(C){throw k&&!S&&await X.deleteSession(be(k)).catch(()=>{}),e({isDispatchingTask:!1,...b()?{error:C instanceof Error?C.message:Ke("taskHome.review.startFailed")}:{}}),C}}}},o5=e=>({tokenUsage:ci,updateTokenUsage:t=>e(n=>{const{costUsd:r,...s}=t;return{tokenUsage:{...n.tokenUsage,...s,totalInputTokens:n.tokenUsage.totalInputTokens+Math.max(0,t.inputTokens??0),totalOutputTokens:n.tokenUsage.totalOutputTokens+Math.max(0,t.outputTokens??0),cacheReadTokens:n.tokenUsage.cacheReadTokens+Math.max(0,t.cacheReadTokens??0),cacheWriteTokens:n.tokenUsage.cacheWriteTokens+Math.max(0,t.cacheWriteTokens??0),estimatedCostUsd:n.tokenUsage.estimatedCostUsd+Math.max(0,r??0)}}}),resetContextUsage:()=>e(t=>({tokenUsage:{...t.tokenUsage,inputTokens:0,outputTokens:0,totalTokens:0}})),setMaxContextTokens:(t,n=!1)=>e(r=>({tokenUsage:{...r.tokenUsage,maxContextTokens:t,isDefaultMaxTokens:n}}))}),H=Yo()((...e)=>({...YF(...e),...i5(...e),...LF(...e),...ZF(...e),...o5(...e)}));function a5(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function c5({open:e,onOpenChange:t}){const n=Ut(),r=H(j=>j.currentSessionRef),s=H(j=>j.isStreaming),i=H(j=>j.isTemporarySession),o=H(j=>j.rewindSession),[d,f]=y.useState([]),[u,m]=y.useState(null),[p,h]=y.useState(!1),[b,k]=y.useState(!1),[S,C]=y.useState(!1),[x,P]=y.useState(null);y.useEffect(()=>{if(!e||!r)return;let j=!1;return k(!0),P(null),f([]),m(null),h(!1),X.listRewindCheckpoints(r).then(I=>{var T;j||(f(I),m(((T=I[0])==null?void 0:T.messageId)??null))}).catch(I=>{j||P(I instanceof Error?I.message:n("chat.rewind.loadFailed"))}).finally(()=>{j||k(!1)}),()=>{j=!0}},[r,e]);const N=y.useMemo(()=>d.find(j=>j.messageId===u)??null,[d,u]),M=!!N&&!b&&!S&&!s&&!i,D=async()=>{if(!N||!M)return;C(!0),P(null);const j=await o(N.messageId,p?"both":"conversation");C(!1),j?t(!1):P(n("chat.rewind.failed"))};return a.jsx(Qc,{open:e,onOpenChange:t,children:a.jsxs(Xo,{className:"max-w-[620px] gap-0 overflow-hidden border-[#E5E7EB] bg-white p-0 dark:border-zinc-800 dark:bg-[#09090b]",children:[a.jsx(Yc,{className:"border-b border-[#E5E7EB] px-6 py-5 dark:border-zinc-800",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-md bg-[#F3F4F6] text-[#4B5563] dark:bg-zinc-800 dark:text-zinc-300",children:a.jsx(gu,{className:"h-4 w-4"})}),a.jsxs("div",{children:[a.jsx(ea,{className:"text-[15px] font-semibold text-[#111827] dark:text-zinc-100",children:n("chat.rewind.title")}),a.jsx(ta,{className:"mt-1 text-[12px] text-[#6B7280] dark:text-zinc-400",children:n("chat.rewind.description")})]})]})}),a.jsxs("div",{className:"min-h-[260px] px-6 py-4",children:[b&&a.jsxs("div",{className:"flex h-[220px] items-center justify-center text-[#6B7280] dark:text-zinc-400",children:[a.jsx(mt,{className:"mr-2 h-4 w-4 animate-spin"}),a.jsx("span",{className:"text-xs font-mono",children:n("chat.rewind.loading")})]}),!b&&x&&a.jsx("div",{role:"alert",className:"rounded-md border border-rose-200 bg-rose-50 px-4 py-3 text-xs text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300",children:x}),!b&&!x&&d.length===0&&a.jsxs("div",{className:"flex h-[220px] flex-col items-center justify-center text-center",children:[a.jsx(gu,{className:"mb-3 h-5 w-5 text-[#9CA3AF] dark:text-zinc-600"}),a.jsx("p",{className:"text-sm text-[#4B5563] dark:text-zinc-300",children:n("chat.rewind.empty")})]}),!b&&d.length>0&&a.jsx("div",{role:"radiogroup","aria-label":n("chat.rewind.checkpointAria"),className:"max-h-[310px] space-y-1 overflow-y-auto",children:d.map(j=>{const I=j.messageId===u;return a.jsxs("button",{type:"button",role:"radio","aria-checked":I,onClick:()=>m(j.messageId),className:J("w-full rounded-md border px-4 py-3 text-left transition-colors",I?"border-[#22C55E] bg-[#F0FDF4] dark:border-[#22C55E] dark:bg-[#052E16]/50":"border-transparent hover:bg-[#F9FAFB] dark:hover:bg-zinc-900"),children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsx("p",{className:"line-clamp-2 text-[13px] leading-5 text-[#111827] dark:text-zinc-100",children:j.preview||n("chat.rewind.userMessage")}),a.jsx("span",{className:"shrink-0 text-[10px] font-mono text-[#9CA3AF] dark:text-zinc-500",children:a5(j.createdAt)})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-3 text-[10px] font-mono text-[#6B7280] dark:text-zinc-500",children:[a.jsx("span",{children:j.messageId.slice(0,10)}),j.fileCount>0&&a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(cy,{className:"h-3 w-3"}),j.fileCount===1?n("chat.rewind.fileCountOne",{count:j.fileCount}):n("chat.rewind.fileCountMany",{count:j.fileCount})]})]})]},j.messageId)})})]}),a.jsx("div",{className:"border-t border-[#E5E7EB] px-6 py-4 dark:border-zinc-800",children:a.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[a.jsx("input",{type:"checkbox",checked:p,disabled:!N||N.fileCount===0,onChange:j=>h(j.target.checked),className:"mt-0.5 h-4 w-4 accent-[#16A34A] disabled:opacity-40"}),a.jsxs("span",{children:[a.jsx("span",{className:"block text-[12px] font-medium text-[#374151] dark:text-zinc-200",children:n("chat.rewind.restoreCode")}),a.jsx("span",{className:"mt-0.5 block text-[11px] text-[#6B7280] dark:text-zinc-500",children:n("chat.rewind.restoreCodeHint")})]})]})}),a.jsxs(Kp,{className:"border-t border-[#E5E7EB] px-6 py-4 dark:border-zinc-800",children:[a.jsx(Kr,{variant:"ghost",onClick:()=>t(!1),disabled:S,children:n("chat.rewind.cancel")}),a.jsxs(Kr,{onClick:()=>void D(),disabled:!M,className:"bg-[#16A34A] text-white hover:bg-[#15803D]",children:[S?a.jsx(mt,{className:"mr-2 h-4 w-4 animate-spin"}):a.jsx(Zo,{className:"mr-2 h-4 w-4"}),n("chat.rewind.confirm")]})]})]})})}function Wx({inFlight:e,queued:t,maxConcurrent:n,compact:r=!1,className:s}){const i=Ut(),o=Math.max(1,n),d=Array.from({length:Math.min(o,12)}),f=Math.min(e,o);return a.jsxs("div",{className:J("inline-flex items-center gap-2 font-mono",r?"text-[10.5px]":"text-[11px]",s),title:i("capacity.title",{inFlight:e,queued:t,max:n}),children:[a.jsx("span",{className:J("inline-flex items-center gap-[3px] rounded-sm",r?"px-0":"px-0.5"),children:d.map((u,m)=>{const p=m<f;return a.jsx("span",{className:J("block",r?"h-2.5 w-[3px] rounded-[1px]":"h-3 w-[3px] rounded-[1px]",p?"bg-[hsl(var(--deck-accent))] shadow-[0_0_4px_hsl(var(--deck-accent)/0.65)]":"bg-[hsl(var(--deck-border-strong))]/60")},m)})}),a.jsxs("span",{className:"tabular-nums text-[hsl(var(--deck-ink-muted))]",children:[a.jsx("span",{className:"text-[hsl(var(--deck-ink))]",children:e}),a.jsx("span",{className:"mx-[2px] opacity-40",children:"/"}),a.jsx("span",{children:n}),a.jsx("span",{className:"opacity-60",children:i("capacity.suffix.running")})]}),t>0&&a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm border border-amber-300/60 bg-amber-50 px-1.5 py-[1px] text-[10px] text-amber-800 dark:border-amber-800/60 dark:bg-amber-950/40 dark:text-amber-300",children:[a.jsx("span",{className:"h-1 w-1 rounded-full bg-amber-500"}),i("capacity.queued",{queued:t})]})]})}function mp(){const e=document.querySelector("textarea[data-blade-composer]:not(:disabled)");if(!e)return!1;e.focus();const t=e.value.length;return e.setSelectionRange(t,t),!0}const Jx=[{id:"searchTasks",key:"k",primaryModifier:!0,scope:"Global"},{id:"openCommands",key:"p",primaryModifier:!0,shiftKey:!0,scope:"Global"},{id:"newTask",key:"n",primaryModifier:!1,scope:"Global"},{id:"focusComposer",key:"/",primaryModifier:!1,scope:"Chat"},{id:"toggleSidebar",key:"b",primaryModifier:!0,scope:"Layout"}];function l5(e){const t=e.key.toLocaleLowerCase();return Jx.find(n=>{if(n.key!==t||e.altKey||e.shiftKey!==!!n.shiftKey)return!1;const r=e.metaKey||e.ctrlKey;return n.primaryModifier?r:!r})??null}function d5(e){return e instanceof Element?!!e.closest('input, textarea, select, [contenteditable="true"], [role="textbox"], [role="combobox"]'):!1}function u5(e){var r;const t=typeof navigator>"u"?null:navigator,n=((r=t==null?void 0:t.userAgentData)==null?void 0:r.platform)??(t==null?void 0:t.platform)??"";return/mac|iphone|ipad|ipod/i.test(n)}function p5(e,t){const n=e.key==="/"?"/":e.key.toLocaleUpperCase(),r=u5();return[...e.primaryModifier?[r?"⌘":"Ctrl"]:[],...e.shiftKey?[r?"⇧":"Shift"]:[],n]}function Lc(e,t){const n=Jx.find(r=>r.id===e);return n?p5(n).join(""):""}function f5(){const e=on(s=>s.setTaskSwitcherOpen),t=on(s=>s.setMainView),n=on(s=>s.toggleSidebar),r=H(s=>s.startTemporarySession);y.useEffect(()=>{const s=i=>{if(i.repeat)return;const o=l5(i);if(!o)return;const d=on.getState(),f=d.isTaskSwitcherOpen,u=d5(i.target),m=!!document.querySelector('[role="dialog"]');if(o.id==="searchTasks"||o.id==="openCommands"){if(m&&!f)return;i.preventDefault();const p=o.id==="searchTasks"?"tasks":"commands",h=f&&d.taskSwitcherMode===p;e(!h,p);return}if(!(u||m)){if(o.id==="newTask"){i.preventDefault(),t("workspace"),r(),requestAnimationFrame(()=>mp());return}if(o.id==="focusComposer"){mp()&&i.preventDefault();return}o.id==="toggleSidebar"&&(i.preventDefault(),n())}};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,e,r,n])}const Wd=y.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Sp,{ref:r,className:J("overflow-hidden relative",e),...n,children:[a.jsx(U0,{className:"h-full w-full rounded-[inherit] [&>div]:!block !overflow-auto",children:t}),a.jsx(Qx,{}),a.jsx(B0,{})]}));Wd.displayName=Sp.displayName;const Qx=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>a.jsx(jp,{ref:r,orientation:t,className:J("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:a.jsx(H0,{className:"relative flex-1 rounded-full bg-border"})}));Qx.displayName=jp.displayName;function gi(e,t){var s;const n=(s=e.title)==null?void 0:s.trim();if(n==="Code Review")return t("session.title.codeReview");if(n)return n;const r=e.firstMessageTime||e.lastMessageTime;if(r){const i=new Date(r);if(!Number.isNaN(i.getTime()))return t("recent.session.fallbackDated",{y:String(i.getFullYear()).slice(-2),m:String(i.getMonth()+1).padStart(2,"0"),d:String(i.getDate()).padStart(2,"0"),hh:String(i.getHours()).padStart(2,"0"),mm:String(i.getMinutes()).padStart(2,"0")})}return t("recent.session.fallbackShort",{id:e.sessionId.slice(0,6)})}async function Yx(e,t=!1){const n=await X.exportSessionMarkdown(e,t),r=new Blob([n.markdown],{type:"text/markdown;charset=utf-8"}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=n.filename,i.hidden=!0,document.body.appendChild(i);try{i.click()}finally{i.remove(),await new Promise(o=>{window.setTimeout(()=>{URL.revokeObjectURL(s),o()},0)})}return n}const Yn=z0,Zn=K0,Un=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(q0,{children:a.jsx(Ip,{ref:s,align:t,sideOffset:n,className:J("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));Un.displayName=Ip.displayName;function m5(){const e=Ut(),t=H(k=>k.archivedSessions),n=H(k=>k.archivedCatalogLoadState),r=H(k=>k.archivedCatalogError),s=H(k=>k.loadArchivedSessions),i=H(k=>k.unarchiveSession),o=H(k=>k.setError),[d,f]=y.useState(!1),[u,m]=y.useState(null),[p,h]=y.useState(null),b=k=>{f(k),k&&s()};return a.jsxs(Yn,{open:d,onOpenChange:b,children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex h-8 w-full items-center justify-between rounded-md px-2.5 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]","aria-label":e("archive.open"),children:[a.jsxs("span",{className:"flex items-center gap-2.5",children:[a.jsx(Ep,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),e("archive.title")]}),t.length>0&&a.jsx("span",{className:"rounded-sm bg-[hsl(var(--deck-surface))] px-1.5 py-0.5 text-[9px] text-[hsl(var(--deck-ink-faint))]",children:t.length})]})}),a.jsxs(Un,{role:"dialog","aria-label":e("archive.title"),side:"right",align:"end",sideOffset:8,className:"w-[340px] overflow-hidden p-0",children:[a.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-[hsl(var(--deck-hairline))] px-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.08em] text-[hsl(var(--deck-ink))]",children:e("archive.title")}),a.jsx("div",{className:"text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:e("archive.subtitle")})]}),a.jsx("button",{type:"button",onClick:()=>void s(),"aria-label":e("archive.refresh"),className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(di,{className:J("h-3 w-3",(n==="loading"||n==="hydrating")&&"animate-spin")})})]}),r?a.jsxs("div",{className:"px-3 py-4 text-[11px] text-red-600 dark:text-red-400",children:[a.jsx("div",{children:r}),a.jsx("button",{type:"button",onClick:()=>void s(),className:"mt-2 font-mono text-[10px] text-[hsl(var(--deck-accent))] focus-visible:outline-none focus-visible:underline",children:e("archive.retry")})]}):t.length===0&&(n==="loading"||n==="hydrating")?a.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(mt,{className:"h-3 w-3 animate-spin"}),e("archive.loading")]}):t.length===0?a.jsx("div",{className:"flex h-24 items-center justify-center px-6 text-center text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:e("archive.empty")}):a.jsx(Wd,{className:"max-h-[340px]",children:a.jsx("div",{className:"divide-y divide-[hsl(var(--deck-hairline))]",children:t.map(k=>{var N;const S=be(k),C=Me(S),x=u===C,P=k.projectPath.split("/").filter(Boolean).at(-1)??k.projectPath;return a.jsxs("div",{className:"flex min-h-[58px] items-center gap-2 px-3 py-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-[11.5px] text-[hsl(var(--deck-ink))]",children:gi(k,e)}),a.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx("span",{className:"truncate",children:P}),k.archivedAt&&a.jsxs(a.Fragment,{children:[a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsx("span",{children:new Date(k.archivedAt).toLocaleString()})]})]}),k.archivedBySessionId!==k.sessionId&&a.jsx("div",{className:"mt-0.5 truncate text-[9px] text-[hsl(var(--deck-accent))]",children:e("archive.inherited",{id:((N=k.archivedBySessionId)==null?void 0:N.slice(0,8))??""})})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[a.jsx("button",{type:"button",disabled:p!==null,onClick:async()=>{h(C);try{await Yx(S)}catch(M){o(M instanceof Error?M.message:"Session export failed")}finally{h(null)}},"aria-label":e("session.action.export",{title:gi(k,e)}),title:e("session.action.exportShort"),className:"flex h-7 w-7 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-35",children:p===C?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Pp,{className:"h-3.5 w-3.5"})}),a.jsx("button",{type:"button",disabled:x||k.archivedBySessionId!==k.sessionId,onClick:async()=>{m(C);try{await i(S)}finally{m(null)}},"aria-label":e("archive.restore",{title:gi(k,e)}),title:k.archivedBySessionId!==k.sessionId?e("archive.restoreAncestor"):e("archive.restoreShort"),className:"flex h-7 w-7 items-center justify-center rounded text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-35",children:x?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(ny,{className:"h-3.5 w-3.5"})})]})]},C)})})})]})]})}function Jd({className:e,size:t=28,pulse:n=!0}){return a.jsxs("span",{className:J("inline-flex relative justify-center items-center","text-[hsl(var(--deck-ink))]",e),style:{width:t,height:t},"aria-hidden":"true",children:[a.jsxs("svg",{viewBox:"0 0 32 32",width:t,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M16 3 L28 16 L16 29 L4 16 Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("path",{d:"M16 8 L24 16 L16 24",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round",opacity:"0.55"}),a.jsx("path",{d:"M16 3 L20 7",stroke:"hsl(var(--deck-accent))",strokeWidth:"2",strokeLinecap:"round"})]}),n&&a.jsx("span",{className:"absolute top-[3px] right-[3px] h-1.5 w-1.5 rounded-full",style:{background:"hsl(var(--deck-accent-glow))",boxShadow:"0 0 6px hsl(var(--deck-accent-glow) / 0.9)"}})]})}const hp={en:"sidebar.language.en",zh:"sidebar.language.zh"};function Zx({className:e,variant:t="pill"}){const{locale:n,setLocale:r}=pw(),s=Ut();if(t==="compact"){const i=n==="en"?"zh":"en";return a.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":s("sidebar.language.aria"),title:s("sidebar.language.label"),className:J("flex justify-center items-center w-10 h-10 font-mono font-medium rounded-md transition-colors text-[11px] text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",e),children:s(hp[n])})}return a.jsx("div",{role:"group","aria-label":s("sidebar.language.aria"),className:J("inline-flex h-8 items-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-[2px] font-mono text-[11px]",e),children:aw.map(i=>{const o=i===n;return a.jsx("button",{type:"button",onClick:()=>r(i),"aria-pressed":o,className:J("flex justify-center items-center px-2 h-full transition-colors min-w-[28px] rounded-[4px]",o?"bg-[hsl(var(--deck-ink))] text-[hsl(var(--deck-canvas))]":"text-[hsl(var(--deck-ink-muted))] hover:text-[hsl(var(--deck-ink))]"),children:s(hp[i])},i)})})}const h5="[data-mobile-navigation-trigger]";function E3(e){return Xx(h5,e)}function Xx(e,t){const n=document.querySelector(e);return!n||n.getClientRects().length===0?!1:(t.preventDefault(),n.focus({preventScroll:!0}),!0)}function e0({open:e,onOpenChange:t}){const n=Ut(),{boundProjects:r,selectedProjectPath:s,isBindingProject:i,loadBoundProjects:o,bindProject:d,unbindProject:f,selectProject:u,startTemporarySession:m}=H(),[p,h]=y.useState(""),[b,k]=y.useState(null),[S,C]=y.useState(!1),x=y.useRef(0);y.useEffect(()=>{if(e){o();return}x.current+=1,C(!1)},[o,e]);const P=async j=>{await d(j),h(""),m(),t(!1)},N=async j=>{if(j.preventDefault(),!(!p.trim()||i||S)){k(null);try{await P(p.trim())}catch(I){k(I instanceof Error?I.message:n("projects.bind.failed"))}}},M=async()=>{if(S||i)return;const j=++x.current;k(null),C(!0);try{const I=await X.pickProjectDirectory();if(j!==x.current||I.cancelled)return;h(I.path),await P(I.path)}catch(I){if(j!==x.current)return;k(I instanceof Error?I.message:n("projects.pick.failed"))}finally{j===x.current&&C(!1)}},D=j=>{u(j),m(),t(!1)};return e?a.jsx(Qc,{open:e,onOpenChange:t,children:a.jsxs(Xo,{onCloseAutoFocus:j=>Xx("[data-project-setup-trigger]",j),className:"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-ink))] sm:max-w-xl",children:[a.jsxs(Yc,{children:[a.jsxs(ea,{className:"flex items-center gap-2 font-mono text-[16px]",children:[a.jsx(Ro,{className:"h-4 w-4 text-[hsl(var(--deck-accent))]"}),n("projects.dialog.title")]}),a.jsx(ta,{className:"text-[12px] text-[hsl(var(--deck-ink-muted))]",children:n("projects.dialog.description")})]}),a.jsxs("form",{onSubmit:N,className:"flex gap-2",children:[a.jsx("input",{value:p,onChange:j=>h(j.target.value),disabled:i,placeholder:n("projects.bind.placeholder"),"aria-label":n("projects.bind.pathLabel"),className:"h-9 min-w-0 flex-1 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 font-mono text-[12px] outline-none placeholder:text-[hsl(var(--deck-ink-faint))] focus:border-[hsl(var(--deck-accent)/0.65)]"}),a.jsxs("button",{type:"button",onClick:()=>void M(),disabled:S||i,title:n("projects.pick.action"),"aria-label":n("projects.pick.action"),className:"inline-flex h-9 shrink-0 items-center gap-2 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-2.5 font-mono text-[12px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))] disabled:cursor-wait disabled:opacity-50",children:[S?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(ly,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"hidden sm:inline",children:n(S?"projects.pick.picking":"projects.pick.actionShort")})]}),a.jsxs("button",{type:"submit",disabled:!p.trim()||i||S,className:"inline-flex h-9 items-center gap-2 rounded-md bg-[hsl(var(--deck-ink))] px-3 font-mono text-[12px] text-[hsl(var(--deck-canvas))] transition-opacity disabled:opacity-40",children:[i?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Ro,{className:"h-3.5 w-3.5"}),n("projects.bind.action")]})]}),b&&a.jsx("div",{role:"alert",className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 font-mono text-[11px] text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300",children:b}),a.jsx("div",{className:"max-h-72 space-y-1 overflow-y-auto",children:r.map(j=>{const I=j.path===s;return a.jsxs("div",{className:J("group flex items-center gap-3 rounded-md border px-3 py-2",I?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))]":"border-transparent hover:border-[hsl(var(--deck-border))] hover:bg-[hsl(var(--deck-surface))]"),children:[a.jsx(li,{className:J("h-4 w-4 shrink-0",I?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]")}),a.jsxs("button",{type:"button",disabled:!j.available,onClick:()=>D(j.path),className:"min-w-0 flex-1 text-left disabled:cursor-not-allowed disabled:opacity-50",children:[a.jsx("span",{className:"block truncate font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:j.name}),a.jsxs("span",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[j.gitBranch&&a.jsxs(a.Fragment,{children:[a.jsx(Kc,{className:"h-2.5 w-2.5"}),a.jsx("span",{children:j.gitBranch}),a.jsx("span",{children:"·"})]}),a.jsx("span",{className:"truncate",children:j.path}),!j.available&&a.jsxs("span",{className:"shrink-0 text-red-500",children:["· ",n("projects.unavailable")]})]})]}),!j.isCurrent&&a.jsx("button",{type:"button",onClick:()=>void f(j.path).catch(()=>{}),title:n("projects.unbind.action"),"aria-label":n("projects.unbind.action"),className:"rounded p-1.5 text-[hsl(var(--deck-ink-faint))] opacity-0 transition group-hover:opacity-100 hover:bg-red-50 hover:text-red-600 focus-visible:opacity-100 dark:hover:bg-red-950/30",children:a.jsx(Fp,{className:"h-3.5 w-3.5"})})]},j.path)})})]})}):null}const g5={running:"bg-blue-500 dark:bg-blue-400 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse",queued:"bg-amber-400 dark:bg-amber-300",interrupted:"bg-orange-500 dark:bg-orange-400",failed:"bg-red-500 dark:bg-red-400",cancelled:"bg-zinc-400 dark:bg-zinc-500",completed:"bg-[hsl(var(--deck-accent))]"};function b5({session:e,isActive:t,isForking:n,isUnread:r,anyForking:s,isEditing:i,editingTitle:o,title:d,context:f,isCancelling:u,isRetrying:m,isExporting:p,onSelect:h,onCancelTask:b,onRetryTask:k,onFork:S,onArchive:C,onExport:x,onStartRename:P,onDelete:N,onEditingTitleChange:M,onSaveRename:D,onCancelRename:j}){const I=Ut(),[T,$]=y.useState(!1),F=y.useRef(null),te=y.useRef(null);return i?a.jsxs("div",{className:"flex h-9 w-full items-center gap-2 bg-[hsl(var(--deck-surface))] px-3",children:[a.jsx("input",{type:"text",value:o,onChange:O=>M(O.target.value),onKeyDown:O=>{O.key==="Enter"&&D(),O.key==="Escape"&&j()},autoFocus:!0,className:"flex-1 rounded bg-[hsl(var(--deck-canvas))] px-2 py-1 font-mono text-[13px] text-[hsl(var(--deck-ink))] outline-none focus:ring-1 focus:ring-[hsl(var(--deck-accent))]"}),a.jsx("button",{"aria-label":I("session.action.save",{title:d}),onClick:D,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-accent))] hover:bg-[hsl(var(--deck-canvas))]",children:a.jsx(Tp,{className:"w-3 h-3"})}),a.jsx("button",{"aria-label":I("session.action.cancel",{title:d}),onClick:j,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-canvas))]",children:a.jsx(ui,{className:"w-3 h-3"})})]}):a.jsxs("div",{className:J("flex relative items-center w-full transition-colors group min-h-[54px]",t?"bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:[t&&a.jsx("span",{className:"absolute left-0 top-1/2 h-6 w-[2px] -translate-y-1/2 rounded-r bg-[hsl(var(--deck-accent))]"}),a.jsxs("button",{type:"button","aria-label":I("session.action.select",{title:d}),"aria-current":t?"true":void 0,"aria-busy":n?"true":void 0,onClick:h,className:"flex min-h-[54px] min-w-0 flex-1 cursor-pointer items-center gap-2 py-1.5 pl-4 pr-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx("span",{className:J("h-1.5 w-1.5 shrink-0 rounded-full",e.pendingInteraction?"animate-pulse bg-amber-500 shadow-[0_0_5px_rgba(245,158,11,0.75)]":g5[e.taskStatus]),title:e.pendingInteraction?I(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"):e.taskStatus}),a.jsxs("span",{className:"flex-1 min-w-0 font-mono",children:[a.jsxs("span",{className:J("flex gap-2 items-center text-left truncate text-[12px]",t?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:[a.jsx("span",{className:"truncate",children:d}),r&&a.jsx("span",{title:I("taskSwitcher.new"),className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.75)]"}),e.pendingInteraction&&a.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-amber-100 px-1.5 py-0.5 text-[8.5px] text-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:I(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"),children:[a.jsx(Ns,{className:"h-2.5 w-2.5"}),I(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission")]}),e.relationType==="fork"&&e.parentId&&a.jsxs("span",{title:`${I("session.forkedFrom")} ${e.parentId.slice(0,6)}`,"aria-label":`${I("session.forkedFrom")} ${e.parentId.slice(0,6)}`,className:"shrink-0 text-[9px] text-[hsl(var(--deck-accent))]",children:[I("session.forkedFrom")," ",e.parentId.slice(0,6)]}),e.taskRetriedFrom&&a.jsx("span",{title:`${I("session.retriedFrom")} ${e.taskRetriedFrom.sessionId.slice(0,6)}`,className:"shrink-0 text-[9px] text-[hsl(var(--deck-accent))]",children:I("session.retryShort")})]}),a.jsxs("span",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 truncate text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx("span",{className:"truncate",children:f.project}),a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"truncate",children:f.environment}),f.queue&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"text-amber-700 truncate dark:text-amber-400",children:f.queue})]}),f.diff&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"truncate text-[hsl(var(--deck-accent))]",children:f.diff})]})]}),f.reason&&a.jsx("span",{title:f.reason,className:"mt-0.5 block truncate text-[9.5px] text-red-600 dark:text-red-400",children:f.reason})]}),n&&a.jsx(mt,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"})]}),a.jsxs("div",{className:J("flex items-center gap-0.5 pr-2 transition-opacity group-focus-within:opacity-100",e.taskStatus==="running"||e.taskStatus==="queued"||e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled")?"opacity-100":"opacity-50 group-hover:opacity-100"),children:[(e.taskStatus==="running"||e.taskStatus==="queued")&&a.jsx("button",{type:"button","aria-label":I(u?"session.action.stopping":"session.action.stop",{title:d}),disabled:u,onClick:O=>{O.stopPropagation(),b()},className:"flex h-6 w-6 items-center justify-center rounded text-red-500 transition-colors hover:bg-red-500/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:cursor-wait disabled:opacity-60",children:u?a.jsx(mt,{className:"h-3 w-3 animate-spin"}):a.jsx(Wc,{className:"h-3 w-3"})}),e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled")&&a.jsx("button",{ref:F,type:"button","aria-label":I(m?"session.action.retrying":"session.action.retry",{title:d}),disabled:m,onClick:O=>{O.stopPropagation(),k()},className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-60",children:m?a.jsx(mt,{className:"h-3 w-3 animate-spin"}):a.jsx(Zo,{className:"h-3 w-3"})}),a.jsxs(Yn,{open:T,onOpenChange:$,children:[a.jsx(Zn,{asChild:!0,children:a.jsx("button",{type:"button","aria-label":I("session.action.more",{title:d}),"aria-expanded":T,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-canvas))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(by,{className:"h-3.5 w-3.5"})})}),a.jsxs(Un,{ref:te,role:"menu","aria-label":I("session.action.more",{title:d}),side:"right",align:"start",sideOffset:6,className:"w-40 p-1",onOpenAutoFocus:O=>{var Q,ae;O.preventDefault(),(ae=(Q=te.current)==null?void 0:Q.querySelector('[role="menuitem"]:not([disabled])'))==null||ae.focus()},onKeyDown:O=>{O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),$(!1),window.setTimeout(()=>{var Q;return(Q=F.current)==null?void 0:Q.focus()},0))},children:[a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.fork",{title:d}),disabled:s,onClick:O=>{O.stopPropagation(),S(),$(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-45",children:[a.jsx(dy,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.forkShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.rename",{title:d}),onClick:O=>{P(O),$(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none",children:[a.jsx(xy,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.renameShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.archive",{title:d}),disabled:e.taskStatus==="running"||e.taskStatus==="queued",onClick:O=>{O.stopPropagation(),C(),$(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-35",children:[a.jsx(Ep,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.archiveShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.export",{title:d}),disabled:p,onClick:O=>{O.stopPropagation(),x(),$(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-wait disabled:opacity-45",children:[p?a.jsx(mt,{className:"h-3 w-3 animate-spin","aria-hidden":!0}):a.jsx(Pp,{className:"h-3 w-3","aria-hidden":!0}),I(p?"session.action.exportingShort":"session.action.exportShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.delete",{title:d}),onClick:O=>{N(O),$(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-red-600 transition-colors hover:bg-red-500/10 focus-visible:bg-red-500/10 focus-visible:outline-none dark:text-red-400",children:[a.jsx(Fp,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.deleteShort")]})]})]})]})]})}function k5({onExpand:e,onNewChat:t,onOpenBoard:n,onOpenTaskSwitcher:r,onToggleTerminal:s,onToggleSettings:i,isTerminalOpen:o,taskEventsConnected:d,unreadCount:f,boardActive:u,className:m}){const p=Ut(),h=[{icon:Op,action:i,labelKey:"sidebar.section.settings"}];return a.jsxs("div",{className:J("flex flex-col gap-2 items-center py-5 h-screen border-r w-[64px] border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]",m),children:[a.jsx("button",{onClick:e,className:"rounded-md p-1 transition-colors hover:bg-[hsl(var(--deck-surface))]","aria-label":p("sidebar.action.expand"),children:a.jsx(Jd,{size:28})}),a.jsx("button",{onClick:t,"aria-label":p("sidebar.action.newTaskShort"),title:p("sidebar.action.newTaskShort"),className:"mt-6 flex h-10 w-10 items-center justify-center rounded-md bg-[hsl(var(--deck-ink))] text-[hsl(var(--deck-canvas))] transition-colors hover:bg-[hsl(var(--deck-ink))]/85",children:a.jsx(Gc,{className:"h-4 w-4 stroke-[2.5]"})}),a.jsx("button",{type:"button",onClick:n,"aria-label":p("sidebar.action.taskBoard"),"aria-current":u?"page":void 0,title:p("sidebar.action.taskBoard"),className:J("flex h-10 w-10 items-center justify-center rounded-md border transition-colors",u?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-transparent text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]"),children:a.jsx(Np,{className:"h-4 w-4"})}),a.jsx("button",{onClick:s,"aria-label":p("sidebar.action.terminalToggle"),title:p("sidebar.action.terminal"),className:J("flex h-10 w-10 items-center justify-center rounded-md border transition-colors",o?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-transparent text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]"),children:a.jsx($p,{className:"w-4 h-4"})}),a.jsxs("button",{onClick:r,"aria-label":p("sidebar.action.searchTasks"),title:`${p("sidebar.action.searchTasks")} (${Lc("searchTasks")})`,className:"relative flex h-10 w-10 items-center justify-center rounded-md border border-transparent text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:[a.jsx(Vc,{className:"h-4 w-4"}),f>0&&a.jsx("span",{"aria-label":p("sidebar.unreadTasks",{count:f}),className:"absolute right-0.5 top-0.5 flex min-h-4 min-w-4 items-center justify-center rounded-full bg-[hsl(var(--deck-accent))] px-1 font-mono text-[8px] font-semibold text-white",children:f>99?"99+":f})]}),a.jsx("div",{className:"flex-1"}),a.jsx("div",{className:"my-2 h-px w-6 bg-[hsl(var(--deck-hairline))]"}),h.map(({icon:b,action:k,labelKey:S})=>a.jsx("button",{"data-settings-trigger":!0,onClick:k,"aria-label":p(S),title:p(S),className:"flex h-10 w-10 items-center justify-center rounded-md text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:a.jsx(b,{className:"w-4 h-4"})},S)),a.jsx(Zx,{variant:"compact"}),a.jsx("div",{className:"mt-1",children:a.jsx("div",{role:"status","aria-label":p(d?"sidebar.status.feedLive":"sidebar.status.feedOffline"),className:J("h-2 w-2 rounded-full",d?"bg-[hsl(var(--deck-accent))] shadow-[0_0_6px_hsl(var(--deck-accent-glow)/0.9)]":"bg-[hsl(var(--deck-ink-faint))]/60"),title:p(d?"sidebar.status.feedLive":"sidebar.status.feedOffline")})})]})}const t0="blade.sidebar.project-order.v1";function uo(e){const t=new Set,n=[];for(const r of e)typeof r!="string"||!r||t.has(r)||(t.add(r),n.push(r));return n}function x5(){if(typeof window>"u")return[];try{const e=JSON.parse(window.localStorage.getItem(t0)??"[]");return Array.isArray(e)?uo(e):[]}catch{return[]}}function y5(e){if(!(typeof window>"u"))try{window.localStorage.setItem(t0,JSON.stringify(uo(e)))}catch{}}function w5(e,t){const n=new Map(uo(t).map((s,i)=>[s,i])),r=n.size;return e.map((s,i)=>({project:s,rank:n.get(s.path)??r+i})).sort((s,i)=>s.rank-i.rank).map(({project:s})=>s)}function v5(e,t,n){const r=uo(e),s=r.indexOf(t),i=r.indexOf(n);if(s<0||i<0||s===i)return r;const[o]=r.splice(s,1);return r.splice(i,0,o),r}function S5(e,t,n){const r=uo(e),s=r.indexOf(t),i=s+n;return s<0||i<0||i>=r.length||([r[s],r[i]]=[r[i],r[s]]),r}function j5({name:e,path:t,count:n,countIsPartial:r=!1,isActive:s,hasRunning:i,unreadCount:o,collapsed:d,onToggle:f,onSelect:u,onCreateTask:m,reorderPosition:p,reorderCount:h,isDragging:b=!1,onDragStart:k,onDragEnd:S,onReorderKeyDown:C}){const x=Ut();return a.jsxs("div",{className:J("group/proj flex w-full items-center gap-2 px-5 pb-1.5 pt-3 text-left transition-colors","hover:bg-[hsl(var(--deck-surface))]/40"),children:[a.jsx("button",{type:"button",draggable:!0,"data-project-drag-handle":t,onDragStart:k,onDragEnd:S,onKeyDown:C,"aria-label":x("sidebar.project.reorder",{name:e,position:p,count:h}),title:x("sidebar.project.reorderHint"),className:J("-ml-2 flex h-6 w-4 shrink-0 cursor-grab items-center justify-center rounded-sm text-[hsl(var(--deck-ink-faint))] opacity-45 transition-[opacity,color,background-color] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-ink-muted))] hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] active:cursor-grabbing group-hover/proj:opacity-100",b&&"cursor-grabbing opacity-100 text-[hsl(var(--deck-accent))]"),children:a.jsx(uy,{className:"h-3.5 w-3.5"})}),a.jsx("button",{type:"button",onClick:f,"aria-expanded":!d,"aria-label":x(d?"sidebar.project.expand":"sidebar.project.collapse",{name:e}),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(oy,{className:J("h-3 w-3 text-[hsl(var(--deck-ink-faint))] transition-transform duration-150",!d&&"rotate-90")})}),a.jsxs("button",{type:"button",onClick:u??f,title:t,"aria-current":s?"true":void 0,className:"flex min-h-6 min-w-0 flex-1 items-center gap-2 rounded-sm text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx(li,{className:J("h-3.5 w-3.5 shrink-0",s?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]")}),a.jsx("span",{className:J("flex-1 truncate font-mono text-[11.5px] font-medium tracking-[-0.01em]",s?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:e}),i&&a.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-blue-500 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse dark:bg-blue-400","aria-hidden":!0}),o>0&&a.jsx("span",{"aria-label":x("sidebar.unreadTasks",{count:o}),className:"shrink-0 rounded-full bg-[hsl(var(--deck-accent))] px-1.5 py-0.5 font-mono text-[8px] font-semibold text-white",children:o}),a.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[n.toString().padStart(2,"0"),r?"+":""]})]}),m&&a.jsx("button",{type:"button",onClick:m,title:x("sidebar.project.newTask",{name:e}),"aria-label":x("sidebar.project.newTask",{name:e}),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm text-[hsl(var(--deck-ink-faint))] opacity-0 transition-[opacity,color,background-color] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-accent))] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] group-hover/proj:opacity-100",children:a.jsx(Gc,{className:"h-3.5 w-3.5"})})]})}function Dc(e){const t=e.lastMessageTime||e.firstMessageTime;if(!t)return 0;const n=new Date(t).getTime();return Number.isNaN(n)?0:n}function gp(e){return e.pendingInteraction?0:e.taskStatus==="running"?1:e.taskStatus==="queued"?2:3}function Qd(e,t){return gp(e)-gp(t)||Dc(t)-Dc(e)}const I5=["running","queued","interrupted","failed","cancelled","completed"],C5={running:"RUNNING",queued:"QUEUED",interrupted:"INTERRUPTED",failed:"FAILED",cancelled:"CANCELLED",completed:"DONE"},Ss=e=>e.length>1?e.replace(/\/+$/,""):e;function n0(e){const t=new Map;for(const n of e){if(!n)continue;const r=Me(be(n));t.has(r)||t.set(r,n)}return Array.from(t.values())}function E5(e){const t=n0(e),n=[];for(const r of I5){const s=t.filter(i=>i.taskStatus===r).sort(Qd);s.length>0&&n.push({code:C5[r],status:r,sessions:s})}return n}function T5(e,t,n=[]){const r=n0(e),s=new Map,i=n.map(Ss),o=new Map(i.map((u,m)=>[u,m]));for(const u of i)s.set(u,[]);for(const u of r){const m=lo(u,t),p=s.get(m);p?p.push(u):s.set(m,[u])}const d=t?Ss(t):null,f=Array.from(s.entries()).map(([u,m])=>{const p=[...m].sort(Qd),h=m.reduce((b,k)=>Math.max(b,Dc(k)),0);return{path:u,name:$c(u),isActive:d?Ss(u)===d:!1,isBound:o.has(Ss(u)),hasRunning:m.some(b=>b.taskStatus==="running"),lastActivity:h,sessions:p}});return f.sort((u,m)=>u.isBound!==m.isBound?u.isBound?-1:1:u.isBound&&m.isBound?(o.get(Ss(u.path))??Number.MAX_SAFE_INTEGER)-(o.get(Ss(m.path))??Number.MAX_SAFE_INTEGER):m.lastActivity-u.lastActivity),f}const bp=12,A5={RUNNING:"sidebar.group.running",QUEUED:"sidebar.group.queued",INTERRUPTED:"sidebar.group.interrupted",FAILED:"sidebar.group.failed",CANCELLED:"sidebar.group.cancelled",DONE:"sidebar.group.done"},P5={RUNNING:"text-blue-700 dark:text-blue-400",QUEUED:"text-amber-700 dark:text-amber-400",INTERRUPTED:"text-orange-700 dark:text-orange-400",FAILED:"text-red-700 dark:text-red-400",CANCELLED:"text-[hsl(var(--deck-ink-faint))]",DONE:"text-[hsl(var(--deck-accent))]"};function N5({view:e,sessions:t,activeProjectPath:n,boundProjects:r,currentSessionRef:s,unreadTaskKeys:i,catalogLoadState:o,catalogError:d,onSelectProject:f,onCreateTask:u,onRetryCatalog:m,renderRow:p}){const h=Ut(),[b,k]=y.useState({}),[S,C]=y.useState({}),[x,P]=y.useState(x5),[N,M]=y.useState(null),[D,j]=y.useState(null),[I,T]=y.useState(""),$=o==="loading"||o==="hydrating",F=$||o==="error",te=y.useMemo(()=>e==="status"?E5(t):[],[t,e]),O=y.useMemo(()=>e==="project"?T5(t,n,r.map(R=>R.path)):[],[n,r,t,e]),Q=y.useMemo(()=>w5(O,x),[O,x]),ae=(R,ce)=>{const ve=S[R]??!1,He=ve?ce:ce.filter((tt,Z)=>{if(Z<bp)return!0;const pt=be(tt);return!!tt.pendingInteraction||i.includes(Me(pt))||!!(s&&oe(pt,s))}),yt=ce.length-He.length,We=ve?ce.length>bp:yt>0;return a.jsxs(a.Fragment,{children:[He.map(p),We&&a.jsx("button",{type:"button",onClick:()=>C(tt=>({...tt,[R]:!ve})),className:"mx-4 my-1 rounded-md px-3 py-1.5 text-left font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink-muted))]",children:ve?h("sidebar.group.showLess"):h("sidebar.group.showMore",{count:yt})})]})},le=$?a.jsxs("div",{role:"status","aria-live":"polite",className:"mx-4 mt-2 flex items-center gap-2 rounded-md bg-[hsl(var(--deck-surface))]/55 px-3 py-2 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(mt,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}),a.jsx("span",{className:"flex-1 min-w-0",children:h("sidebar.catalog.syncing")}),a.jsx("span",{className:"tabular-nums shrink-0",children:h("sidebar.catalog.loaded",{count:t.length})})]}):o==="error"?a.jsxs("div",{role:"alert",title:d??void 0,className:"mx-4 mt-2 flex items-center gap-2 rounded-md bg-amber-50/80 px-3 py-2 font-mono text-[9.5px] text-amber-800 dark:bg-amber-950/35 dark:text-amber-300",children:[a.jsx(Ns,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:h("sidebar.catalog.incomplete")}),a.jsxs("button",{type:"button",onClick:m,className:"inline-flex min-h-6 shrink-0 items-center gap-1 rounded px-1.5 font-medium hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-amber-500 dark:hover:bg-amber-900/50",children:[a.jsx(di,{className:"h-2.5 w-2.5"}),h("sidebar.catalog.retry")]})]}):null;if(e==="status")return a.jsxs("div",{className:"flex flex-col",children:[le,te.map((R,ce)=>a.jsxs("div",{children:[a.jsxs("div",{className:J("flex items-center justify-between px-5 pb-2 pt-3 font-mono text-[10px] tracking-[0.16em]",P5[R.code]??"text-[hsl(var(--deck-ink-faint))]",ce===0&&"pt-2"),children:[a.jsx("span",{children:h(A5[R.code])}),a.jsxs("span",{className:"text-[hsl(var(--deck-ink-faint))]",children:[R.sessions.length.toString().padStart(2,"0"),F?"+":""]})]}),ae(`status:${R.code}`,R.sessions)]},R.code))]});const de=Q.some(R=>R.isActive),me=R=>!!(s&&R.sessions.some(ce=>oe(be(ce),s))),Y=(R,ce)=>{if(R.join("\0")===Q.map(He=>He.path).join("\0"))return;P(R),y5(R);const ve=Q.find(He=>He.path===ce);T(h("sidebar.project.reordered",{name:(ve==null?void 0:ve.name)??ce,position:R.indexOf(ce)+1}))},he=(R,ce)=>{const ve=R.sessions.filter(Z=>i.includes(Me(be(Z)))).length,He=me(R),yt=ve>0,We=R.sessions.some(Z=>!!Z.pendingInteraction),tt=b[R.path]??(de&&!R.isActive&&!(He||R.hasRunning||yt||We));return a.jsxs("div",{"data-project-group":R.path,onDragEnter:Z=>{!N||N===R.path||(Z.preventDefault(),j(R.path))},onDragOver:Z=>{!N||N===R.path||(Z.preventDefault(),Z.dataTransfer.dropEffect="move")},onDrop:Z=>{Z.preventDefault();const pt=N||Z.dataTransfer.getData("text/plain");pt&&pt!==R.path&&Y(v5(Q.map(L=>L.path),pt,R.path),pt),M(null),j(null)},className:J("relative transition-colors",D===R.path&&N!==R.path&&"bg-[hsl(var(--deck-accent-soft))]/55 before:absolute before:inset-y-1 before:left-0 before:w-0.5 before:rounded-full before:bg-[hsl(var(--deck-accent))]"),children:[a.jsx(j5,{name:R.name,path:R.path,count:R.sessions.length,countIsPartial:F,isActive:R.isActive,hasRunning:R.hasRunning,unreadCount:ve,collapsed:tt,onSelect:()=>f(R.path),onCreateTask:()=>u(R.path),reorderPosition:ce+1,reorderCount:Q.length,isDragging:N===R.path,onDragStart:Z=>{Z.dataTransfer.effectAllowed="move",Z.dataTransfer.setData("text/plain",R.path),M(R.path)},onDragEnd:()=>{M(null),j(null)},onReorderKeyDown:Z=>{if(Z.key!=="ArrowUp"&&Z.key!=="ArrowDown")return;Z.preventDefault();const pt=S5(Q.map(L=>L.path),R.path,Z.key==="ArrowUp"?-1:1);Y(pt,R.path)},onToggle:()=>k(Z=>({...Z,[R.path]:!tt}))}),!tt&&ae(`project:${R.path}`,R.sessions)]},R.path)};return a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"sr-only","aria-live":"polite",children:I}),le,Q.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-5 pb-0.5 pt-2 font-mono text-[9px] uppercase tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:h("sidebar.project.projects")}),Q.map(he)]})]})}function O5({className:e,onNavigate:t}){const n=Ut(),{toggleSettings:r,toggleSidebar:s,isSidebarOpen:i,isTerminalOpen:o,toggleTerminal:d,sidebarView:f,setSidebarView:u,setTaskSwitcherOpen:m,mainView:p,setMainView:h,setBoardProjectPath:b,setFilePreviewOpen:k}=on(),S=H(A=>A.sessions),C=H(A=>A.catalogLoadState),x=H(A=>A.catalogError),P=H(A=>A.currentSessionRef),N=H(A=>A.forkingSessionRef),M=H(A=>A.selectSession),D=H(A=>A.startTemporarySession),j=H(A=>A.deleteSession),I=H(A=>A.archiveSession),T=H(A=>A.forkSession),$=H(A=>A.updateSession),F=H(A=>A.loadSessions),te=H(A=>A.setError),O=H(A=>A.taskEventsConnected),Q=H(A=>A.taskWorkspaceInfo),ae=H(A=>A.boundProjects),le=H(A=>A.selectedProjectPath),de=H(A=>A.bindProject),me=H(A=>A.selectProject),Y=H(A=>A.cancelTask),he=H(A=>A.cancellingTaskKeys),R=H(A=>A.retryTask),ce=H(A=>A.retryingTaskKeys),ve=H(A=>A.unreadTaskKeys),[He,yt]=y.useState(null),[We,tt]=y.useState(""),[Z,pt]=y.useState(null),[L,B]=y.useState(!1),Se=le??(Q==null?void 0:Q.cwd)??null,qe=A=>gi(A,n),Pe=A=>{const Ee=A.taskSourceProjectPath||A.projectPath,en=Ee.split("/").filter(Boolean).at(-1)||Ee,pr=A.taskIsolation==="worktree"?A.taskWorktreeBranch||n("session.env.worktree"):n("session.env.local"),fr=A.taskDiffStat?`+${A.taskDiffStat.additions} −${A.taskDiffStat.deletions}`:void 0,bs=A.taskStatus==="queued"&&A.taskQueuePosition?n("session.queued",{position:A.taskQueuePosition,depth:A.taskQueueDepth??A.taskQueuePosition}):void 0,ks=Vd(A,n);return{project:en,environment:pr,diff:fr,queue:bs,reason:ks}},Jt=()=>{h("workspace"),D(Se??void 0),t==null||t()},et=()=>{k(!1),b(Se),h("board"),t==null||t()},Ht=async A=>{ae.some(Ee=>Ee.path===A)?me(A):await de(A),h("workspace"),D(A),t==null||t()},Qt=async A=>{ae.some(Ee=>Ee.path===A)?me(A):await de(A),h("workspace"),D(A),t==null||t()},bt=A=>{A(),t==null||t()},_=async(A,Ee)=>{A.stopPropagation(),await j(be(Ee))},Re=async A=>{const Ee=be(A),en=Me(Ee);if(!Z){pt(en);try{await Yx(Ee)}catch(pr){te(pr instanceof Error?pr.message:"Session export failed")}finally{pt(null)}}},wt=(A,Ee)=>{A.stopPropagation(),yt(Me(be(Ee))),tt(qe(Ee))},qt=async A=>{if(!We.trim()){yt(null);return}try{await $(be(A),We.trim()),yt(null),await F()}catch(Ee){console.error("Failed to rename session:",Ee)}},Lr=()=>{yt(null),tt("")};return i?a.jsxs("div",{className:J("flex flex-col h-screen border-r w-[260px] border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]",e),children:[a.jsxs("div",{className:"flex flex-col gap-6 px-5 pt-5 pb-5",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(Jd,{size:26}),a.jsx("span",{className:"font-mono text-[15px] font-semibold tracking-[-0.01em] text-[hsl(var(--deck-ink))]",children:"Blade"}),a.jsx("span",{className:"ml-1 rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-1 py-[1px] font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:n("sidebar.brand.badge")})]}),a.jsx("button",{onClick:s,"aria-label":n("sidebar.action.collapse"),className:"flex h-8 w-8 items-center justify-center rounded transition-colors hover:bg-[hsl(var(--deck-surface))]",children:a.jsx(iy,{className:"h-3 w-3 text-[hsl(var(--deck-ink-muted))]"})})]}),a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsxs("button",{onClick:Jt,className:"flex h-9 w-full items-center justify-between rounded-md bg-[hsl(var(--deck-ink))] px-3 font-mono text-[13px] font-medium text-[hsl(var(--deck-canvas))] transition-colors hover:bg-[hsl(var(--deck-ink))]/88",children:[a.jsxs("span",{className:"flex gap-2 items-center",children:[a.jsx(Gc,{className:"h-3.5 w-3.5 stroke-[2.5]"}),n("sidebar.action.newTask")]}),a.jsx("span",{className:"rounded-sm bg-white/10 px-1.5 py-[1px] font-mono text-[10px] text-white/80",children:Lc("newTask")})]}),a.jsxs("button",{type:"button",onClick:et,"aria-current":p==="board"?"page":void 0,className:J("flex h-9 w-full items-center gap-2 rounded-md border px-3 font-mono text-[12.5px] transition-colors",p==="board"?"border-[hsl(var(--deck-accent)/0.45)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-muted))] hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]"),children:[a.jsx(Np,{className:"h-3.5 w-3.5"}),n("sidebar.action.taskBoard")]}),a.jsxs("button",{onClick:()=>bt(d),className:J("flex h-9 w-full items-center gap-2 rounded-md border px-3 font-mono text-[12.5px] transition-colors",o?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-muted))] hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]"),children:[a.jsx($p,{className:"h-3.5 w-3.5"}),n("sidebar.action.terminal")]}),a.jsxs("button",{type:"button",onClick:()=>bt(()=>m(!0)),className:"flex h-9 w-full items-center justify-between rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Vc,{className:"h-3.5 w-3.5"}),n("sidebar.action.searchTasks")]}),a.jsx("span",{className:"rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-1.5 py-[1px] font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:ve.length>0?ve.length:Lc("searchTasks")})]})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"flex flex-1 items-center gap-0.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-0.5",children:["project","status"].map(A=>a.jsx("button",{type:"button",onClick:()=>u(A),"aria-pressed":f===A,"aria-label":n(A==="project"?"sidebar.view.projectAria":"sidebar.view.statusAria"),className:J("flex-1 rounded-[5px] py-1 font-mono text-[11px] tracking-[0.02em] transition-colors",f===A?"bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-ink))] shadow-sm":"text-[hsl(var(--deck-ink-faint))] hover:text-[hsl(var(--deck-ink-muted))]"),children:n(A==="project"?"sidebar.view.project":"sidebar.view.status")},A))}),a.jsx("button",{type:"button",onClick:()=>B(!0),title:n("projects.bind.action"),"aria-label":n("projects.bind.action"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-faint))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-accent))]",children:a.jsx(Ro,{className:"h-3.5 w-3.5"})})]})]}),a.jsx(Wd,{className:"flex-1 px-0",children:a.jsxs("div",{className:"flex flex-col",children:[(S.length>0||ae.length>0||C==="loading"||C==="hydrating"||C==="error")&&a.jsx(N5,{view:f,sessions:S,activeProjectPath:Se,boundProjects:ae,currentSessionRef:P,unreadTaskKeys:ve,catalogLoadState:C,catalogError:x,onRetryCatalog:F,onSelectProject:A=>void Ht(A).catch(()=>{}),onCreateTask:A=>void Qt(A).catch(()=>{}),renderRow:A=>{const Ee=be(A),en=Me(Ee),pr=oe(Ee,P),fr=He===en,bs=oe(Ee,N),ks=!!N;return a.jsx(b5,{session:A,sessionRef:Ee,isActive:pr,isForking:bs,isUnread:ve.includes(Me(Ee)),anyForking:ks,isEditing:fr,editingTitle:We,title:qe(A),context:Pe(A),isCancelling:he.includes(Me(Ee)),isRetrying:ce.includes(Me(Ee)),isExporting:Z===en,onSelect:()=>(t==null||t(),h("workspace"),M(Ee)),onCancelTask:()=>{Y(Ee).catch(()=>{})},onRetryTask:()=>{R(Ee).catch(()=>{})},onFork:()=>void T(A),onArchive:()=>void I(Ee),onExport:()=>void Re(A),onStartRename:Xs=>wt(Xs,A),onDelete:Xs=>_(Xs,A),onEditingTitleChange:tt,onSaveRename:()=>qt(A),onCancelRename:Lr},en)}}),S.length===0&&a.jsx("div",{className:"px-5 mt-6",children:a.jsxs("div",{className:"rounded-md border border-dashed border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]/60 px-4 py-6 text-center",children:[a.jsx("div",{className:"mx-auto mb-2 inline-flex h-8 w-8 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))]",children:a.jsx(Mp,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"})}),a.jsx("div",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:n("sidebar.empty.title")}),a.jsx("div",{className:"mt-1 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:n("sidebar.empty.hint")})]})})]})}),a.jsxs("div",{className:"flex flex-col gap-3 px-5 pt-3 pb-5",children:[a.jsxs("div",{className:"flex flex-col gap-0.5 border-t border-[hsl(var(--deck-hairline))] pt-3",children:[a.jsx(m5,{}),[{icon:Op,action:()=>bt(r),labelKey:"sidebar.section.settings"}].map(({icon:A,action:Ee,labelKey:en})=>a.jsxs("button",{"data-settings-trigger":!0,onClick:Ee,className:"flex h-8 w-full items-center gap-2.5 rounded-md px-2.5 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:[a.jsx(A,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),n(en)]},en))]}),a.jsxs("div",{className:"flex gap-2 justify-between items-center",children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.14em] text-[hsl(var(--deck-ink-faint))]",children:n("sidebar.language.label")}),a.jsx(Zx,{})]}),a.jsxs("div",{className:"flex items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2",children:[a.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-[hsl(var(--deck-canvas-veil))]",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-[hsl(var(--deck-ink))]"})}),a.jsxs("div",{className:"flex flex-1 flex-col gap-[1px]",children:[a.jsx("span",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:n("sidebar.status.user")}),a.jsxs("span",{className:J("flex gap-1 items-center font-mono text-[10px]",O?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]"),children:[a.jsx("span",{className:J("h-1 w-1 rounded-full",O?"bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.9)]":"bg-[hsl(var(--deck-ink-faint))]/60")}),n(O?"sidebar.status.feedLive":"sidebar.status.feedOffline")]})]})]})]}),a.jsx(e0,{open:L,onOpenChange:B})]}):a.jsx(k5,{className:e,onExpand:s,onNewChat:Jt,onOpenBoard:et,onOpenTaskSwitcher:()=>bt(()=>m(!0)),onToggleTerminal:()=>bt(d),onToggleSettings:()=>bt(r),isTerminalOpen:o,taskEventsConnected:O,unreadCount:ve.length,boardActive:p==="board"})}const R5=y.lazy(()=>es(()=>import("./SettingsModal-3GMy6V-E.js"),__vite__mapDeps([4,1,2,5,6,7,8,3,9])).then(e=>({default:e.SettingsModal}))),r0=()=>es(()=>import("./TaskSwitcher-eCdxu5Eo.js"),__vite__mapDeps([10,1,3,11,12,2])).then(e=>({default:e.TaskSwitcher})),M5=y.lazy(r0),s0=()=>es(()=>import("./FilePreview-C_3KHzzj.js"),__vite__mapDeps([13,1,3,14,5,9,11,2])),$5=y.lazy(()=>s0().then(e=>({default:e.FilePreview}))),F5=y.lazy(()=>s0().then(e=>({default:e.PreviewControls}))),L5=y.lazy(()=>es(()=>import("./TerminalPanel-9q9Trmv9.js"),__vite__mapDeps([15,1,16,17,3,2])).then(e=>({default:e.TerminalPanel}))),ic=e=>{if(e.startsWith("/Users/")){const t=e.split("/");if(t.length>=3)return"~/"+t.slice(3).join("/")}return e},D5=e=>e.replace(/^~\//,"~/§").split("/").filter(Boolean).map((t,n,r)=>{var s;return n===0&&((s=r[0])!=null&&s.startsWith("~"))?"~":t.replace(/^§/,"")});function _5({children:e}){var Z,pt;const t=Ut();f5();const{isSidebarOpen:n,isFilePreviewOpen:r,isSettingsOpen:s,isTerminalOpen:i,isTaskSwitcherOpen:o,toggleFilePreview:d,openFilePreview:f,previewRequestId:u,setSidebarOpen:m,mainView:p}=on();y.useEffect(()=>{const L=window.setTimeout(()=>{r0()},1500);return()=>window.clearTimeout(L)},[]);const h=H(L=>L.currentSessionId),b=H(L=>L.currentSessionRef),k=H(L=>L.sessions),S=H(L=>L.isStreaming),C=H(L=>L.isTemporarySession),x=H(L=>L.taskWorkspaceInfo),P=H(L=>L.boundProjects),N=H(L=>L.selectedProjectPath),[M,D]=y.useState(null),[j,I]=y.useState(!1),[T,$]=y.useState(),[F,te]=y.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(max-width: 639px)").matches),[O,Q]=y.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(max-width: 1023px)").matches),ae=y.useRef(null),le=y.useRef(null),de=y.useRef(null),me=y.useMemo(()=>k.find(L=>oe({sessionId:L.sessionId,projectPath:L.projectPath},b)),[b,k]),Y=(me==null?void 0:me.taskIsolation)==="worktree"&&me.taskSourceProjectPath&&(((Z=me.taskDelivery)==null?void 0:Z.status)==="applied"||((pt=me.taskDelivery)==null?void 0:pt.status)==="discarded")?me.taskSourceProjectPath:b==null?void 0:b.projectPath;y.useEffect(()=>{if(typeof window.matchMedia!="function")return;const L=window.matchMedia("(max-width: 900px)"),B=()=>{L.matches&&m(!1)};return B(),L.addEventListener("change",B),()=>L.removeEventListener("change",B)},[m]),y.useEffect(()=>{if(typeof window.matchMedia!="function")return;const L=window.matchMedia("(max-width: 639px)"),B=()=>te(L.matches);return B(),L.addEventListener("change",B),()=>L.removeEventListener("change",B)},[]),y.useEffect(()=>{if(typeof window.matchMedia!="function")return;const L=window.matchMedia("(max-width: 1023px)"),B=()=>Q(L.matches);return B(),L.addEventListener("change",B),()=>L.removeEventListener("change",B)},[]),y.useEffect(()=>{if(!F||!n)return;const L=requestAnimationFrame(()=>{var B,Se;(Se=(B=ae.current)==null?void 0:B.querySelector("button"))==null||Se.focus()});return()=>{var B;cancelAnimationFrame(L),(B=le.current)==null||B.focus({preventScroll:!0})}},[F,n]);const he=L=>{var Pe;if(!F||!n)return;if(L.key==="Escape"){L.preventDefault(),m(!1);return}if(L.key!=="Tab")return;const B=Array.from(((Pe=ae.current)==null?void 0:Pe.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'))??[]);if(B.length===0)return;const Se=B[0],qe=B[B.length-1];L.shiftKey&&document.activeElement===Se?(L.preventDefault(),qe==null||qe.focus()):!L.shiftKey&&document.activeElement===qe&&(L.preventDefault(),Se==null||Se.focus())},R=y.useMemo(()=>p==="board"||!h||C?N?ic(N):null:me!=null&&me.projectPath?ic(me.taskSourceProjectPath||me.projectPath):null,[h,me,C,p,N]),ce=y.useMemo(()=>R?D5(R):[],[R]);y.useEffect(()=>{var B;if(!b){D(((B=P.find(Se=>Se.path===N))==null?void 0:B.gitBranch)??null);return}(async()=>{try{const Se=await X.getGitInfo({sessionId:b.sessionId,projectPath:Y??b.projectPath});D(Se.branch)}catch{D(null)}})()},[P,b,Y,N]);const ve=x==null?void 0:x.taskAdmission,He=p==="board"?N??(x==null?void 0:x.cwd)??null:Y??N??(x==null?void 0:x.cwd)??null,yt=b&&p==="workspace"?Me(b):`project:${N??"none"}`,We=r&&O,tt=r&&T;return a.jsxs("div",{className:"flex h-screen overflow-hidden bg-[hsl(var(--deck-canvas))]",children:[F&&n&&!We&&a.jsx("button",{type:"button","aria-label":t("sidebar.action.collapse"),onClick:()=>m(!1),className:"fixed inset-0 z-40 bg-black/25 backdrop-blur-[1px]"}),a.jsx("div",{ref:ae,role:F&&n&&!We?"dialog":void 0,"aria-modal":F&&n&&!We?!0:void 0,"aria-label":F&&n&&!We?t("sidebar.navigationAria"):void 0,inert:We||F&&!n?!0:void 0,onKeyDown:he,className:J("overflow-hidden",n?"w-[260px]":"w-[64px]",F?"fixed inset-y-0 left-0 z-50 shadow-2xl transition-none":"shrink-0 transition-[width] duration-300 ease-in-out",F&&!n&&"-translate-x-full"),children:a.jsx("div",{className:J("transition-all duration-300 ease-in-out",n?"w-[260px]":"w-[64px]"),children:a.jsx(O5,{onNavigate:()=>{F&&m(!1)}})})}),a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("header",{inert:We,className:"relative z-10 flex h-14 items-center gap-2 border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas))]/90 px-3 backdrop-blur-md sm:gap-4 sm:px-6",children:[F&&a.jsx(Kr,{ref:le,"data-mobile-navigation-trigger":!0,variant:"ghost",size:"icon",onClick:()=>m(!0),"aria-label":t("layout.action.openNavigation"),title:t("layout.action.openNavigation"),className:"h-9 w-9 shrink-0 rounded-md text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:a.jsx(gy,{className:"h-4 w-4"})}),a.jsxs("div",{className:"flex gap-2 items-center min-w-0",children:[ce.length>0?a.jsx("nav",{"aria-label":t("layout.workspace.pathAria"),title:R??void 0,className:"flex min-w-0 items-center font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:ce.map((L,B)=>{const Se=B===ce.length-1,qe=B===0&&L==="~";return a.jsxs("span",{className:"flex items-center min-w-0",children:[B>0&&a.jsx("span",{className:"mx-1 text-[hsl(var(--deck-ink-faint))]/70",children:"/"}),B===0&&!qe&&a.jsx("span",{className:"mr-1 text-[hsl(var(--deck-ink-faint))]/70",children:"/"}),a.jsx("span",{className:J("truncate",Se?"font-medium text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:L})]},B)})}):a.jsx("span",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:x!=null&&x.cwd?ic(x.cwd):t("layout.workspace.empty")}),M&&a.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-2 py-0.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink-muted))]",children:[a.jsx(Kc,{className:"h-3 w-3 text-[hsl(var(--deck-accent))]"}),M]})]}),a.jsxs("div",{className:"flex gap-3 items-center ml-auto",children:[ve&&a.jsx("span",{className:"hidden items-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-2.5 py-1 md:inline-flex",children:a.jsx(Wx,{inFlight:ve.inFlight,queued:ve.queued,maxConcurrent:ve.maxConcurrent,compact:!0})}),a.jsxs("div",{className:"flex items-center gap-0.5",children:[a.jsx(Kr,{variant:"ghost",size:"icon","aria-label":t("layout.action.rewind"),title:t("layout.action.rewind"),disabled:p==="board"||!b||C||S,onClick:()=>I(!0),className:"h-8 w-8 rounded-md text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] disabled:opacity-35",children:a.jsx(Zo,{className:"w-4 h-4"})}),a.jsx(y.Suspense,{fallback:null,children:a.jsx(F5,{ref:de,open:r,maximized:T,disabled:p==="board",onToggleMaximized:()=>$(L=>!L),onTogglePreview:()=>{if(r){$(!1),d();return}f((!b||C)&&u===0?{tab:"files"}:void 0)}})})]})]})]}),a.jsxs("main",{className:"flex-1 overflow-hidden relative flex bg-[hsl(var(--deck-canvas))]",children:[a.jsx("div",{"data-preview-background":"content","data-preview-maximized":tt,inert:We,className:"relative flex min-w-0 flex-1 flex-col",children:s?a.jsx(y.Suspense,{fallback:null,children:a.jsx(R5,{})}):e}),r&&a.jsx(y.Suspense,{fallback:null,children:a.jsx($5,{returnFocusElement:de.current,maximized:tt},yt)})]})]}),i&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(L5,{workspacePath:He},He??"default-workspace")}),o&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(M5,{})}),a.jsx(c5,{open:j,onOpenChange:I})]})}const oc="BladeCode";function U5(){const e=Ut(),t=H(o=>o.unreadTaskKeys),n=H(o=>o.sessions),r=H(o=>o.selectSession),s=H(o=>o.selectProject),i=y.useMemo(()=>{const o=new Set(t);for(const d of n)d.pendingInteraction&&o.add(Me(be(d)));return o.size},[n,t]);return y.useEffect(()=>(document.title=i>0?`(${i}) ${oc}`:oc,()=>{document.title=oc}),[i]),y.useEffect(()=>{const o=d=>{var h;const f=d.detail;if(!(f!=null&&f.sessionId)||!f.projectPath)return;const u=H.getState(),m=Go(u.sessions,f),p=m?lo(m,u.selectedProjectPath??((h=u.taskWorkspaceInfo)==null?void 0:h.cwd)??null):f.projectPath;u.boundProjects.some(b=>b.available&&b.path===p)&&s(p),r(f)};return window.addEventListener(Vo,o),()=>window.removeEventListener(Vo,o)},[s,r]),a.jsx("div",{className:"sr-only",role:"status","aria-live":"polite",children:i>0?e("attention.unreadAnnouncement",{count:i}):""})}const _c=y.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:J("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));_c.displayName="Textarea";const B5=(e,t)=>{const n=[...e.matchAll(/(?:^|\s)(@(?:"[^"]*"|(?:[^\\ ]|\\ )*))/g)];for(const r of n){const s=r[1],i=r.index+(r[0].length-s.length),o=i+s.length;if(t>=i&&t<=o){let d=s.slice(1),f=!1;return d.startsWith('"')&&(f=!0,d=d.slice(1),d.endsWith('"')&&(d=d.slice(0,-1))),{hasQuery:!0,query:d,startIndex:i,endIndex:o,quoted:f}}}return{hasQuery:!1,query:"",startIndex:-1,endIndex:-1,quoted:!1}},H5=(e,t,n={})=>{const{debounceDelay:r=200,maxSuggestions:s=15,workspacePath:i}=n,[o,d]=y.useState([]),[f,u]=y.useState(0),[m,p]=y.useState(!1),h=y.useMemo(()=>t===void 0?{hasQuery:!1,query:"",startIndex:-1,endIndex:-1,quoted:!1}:B5(e,t),[e,t]);y.useEffect(()=>{if(!h.hasQuery){d([]),p(!1);return}let S=!1;p(!0);const x=setTimeout(async()=>{try{const P=await fetch(`/suggestions/files?q=${encodeURIComponent(h.query)}&limit=${s}`,i?{headers:{"x-blade-directory":i}}:void 0);if(!P.ok)throw new Error("Failed to fetch suggestions");const N=await P.json();S||d(N)}catch(P){console.error("Failed to fetch file suggestions:",P),S||d([])}finally{S||p(!1)}},r);return()=>{S=!0,clearTimeout(x)}},[h.hasQuery,h.query,r,s,i]),y.useEffect(()=>{u(0)},[o]);const b=y.useCallback(()=>{u(S=>(S+1)%Math.max(o.length,1))},[o.length]),k=y.useCallback(()=>{u(S=>(S-1+o.length)%Math.max(o.length,1))},[o.length]);return{...h,suggestions:o,selectedIndex:f,loading:m,setSelectedIndex:u,selectNext:b,selectPrevious:k}},q5=(e,t=!1)=>e.includes(" ")||t?`@"${e}"`:`@${e}`,z5=(e,t,n)=>{if(!t.hasQuery)return{newInput:e,newCursorPos:e.length};const r=q5(n,t.quoted),s=e.slice(0,t.startIndex),i=e.slice(t.endIndex),o=s+r+" "+i,d=t.startIndex+r.length+1;return{newInput:o,newCursorPos:d}};function K5(){const[e,t]=y.useState([]),[n,r]=y.useState(-1),s=y.useRef(""),i=y.useCallback(u=>{u.trim()&&(t(m=>m[m.length-1]===u?m:[...m,u]),r(-1),s.current="")},[]),o=y.useCallback(u=>{if(e.length===0)return null;n===-1&&(s.current=u);const m=n===-1?e.length-1:Math.max(0,n-1);return r(m),e[m]??null},[e,n]),d=y.useCallback(()=>{if(n===-1)return null;const u=n+1;return u>=e.length?(r(-1),s.current):(r(u),e[u]??null)},[e,n]),f=y.useCallback(()=>{r(-1),s.current=""},[]);return{addToHistory:i,getPrevious:o,getNext:d,reset:f,historyIndex:n}}const G5=(e,t)=>{if(!e.startsWith("/"))return{hasQuery:!1,query:"",startIndex:-1,endIndex:-1};const n=e.indexOf(" "),r=n===-1?e.length:n;return t<=r?{hasQuery:!0,query:e.slice(1,t),startIndex:0,endIndex:t}:{hasQuery:!1,query:"",startIndex:-1,endIndex:-1}},V5=(e,t,n={})=>{const{debounceDelay:r=150,workspacePath:s}=n,[i,o]=y.useState([]),[d,f]=y.useState(0),[u,m]=y.useState(!1),p=y.useMemo(()=>t===void 0?{hasQuery:!1,query:"",startIndex:-1,endIndex:-1}:G5(e,t),[e,t]);y.useEffect(()=>{if(!p.hasQuery){o([]),m(!1);return}let k=!1;m(!0);const C=setTimeout(async()=>{try{const x=await fetch(`/suggestions/commands?q=${encodeURIComponent(p.query)}`,s?{headers:{"x-blade-directory":s}}:void 0);if(!x.ok)throw new Error("Failed to fetch suggestions");const P=await x.json();k||o(P)}catch(x){console.error("Failed to fetch command suggestions:",x),k||o([])}finally{k||m(!1)}},r);return()=>{k=!0,clearTimeout(C)}},[p.hasQuery,p.query,r,s]),y.useEffect(()=>{f(0)},[i]);const h=y.useCallback(()=>{f(k=>(k+1)%Math.max(i.length,1))},[i.length]),b=y.useCallback(()=>{f(k=>(k-1+i.length)%Math.max(i.length,1))},[i.length]);return{...p,suggestions:i,selectedIndex:d,loading:u,setSelectedIndex:f,selectNext:h,selectPrevious:b}},W5=(e,t,n)=>{if(!t.hasQuery)return{newInput:e,newCursorPos:e.length};const r=e.slice(t.endIndex),s=n.command+" "+r.trimStart(),i=n.command.length+1;return{newInput:s,newCursorPos:i}},J5="blade.composer.draft.",Wo=new Map,Uc=new Set,i0=1;function Jo(){return typeof sessionStorage>"u"?null:sessionStorage}function Qo(e){return`${J5}${e}`}function o0(e){var n;if(!e)return{content:"",attachments:[],outputSchema:void 0};const t=Wo.get(e);if(t)return{content:t.content,attachments:[...t.attachments],outputSchema:t.outputSchema};try{const r=((n=Jo())==null?void 0:n.getItem(Qo(e)))??"";if(!r)return{content:"",attachments:[],outputSchema:void 0};try{const s=JSON.parse(r);if(s.version===i0&&typeof s.content=="string"&&(s.outputSchema===void 0||typeof s.outputSchema=="string"))return{content:s.content,attachments:[],outputSchema:s.outputSchema}}catch{}return{content:r,attachments:[],outputSchema:void 0}}catch{return{content:"",attachments:[],outputSchema:void 0}}}function sn(e,t){var s,i;if(!e)return;const n=Wo.get(e),r=t.outputSchema??(n==null?void 0:n.outputSchema);if(!t.content&&t.attachments.length===0&&!r){a0(e);return}Wo.set(e,{content:t.content,attachments:[...t.attachments],outputSchema:r});try{t.content||r?(s=Jo())==null||s.setItem(Qo(e),JSON.stringify({version:i0,content:t.content,...r?{outputSchema:r}:{}})):(i=Jo())==null||i.removeItem(Qo(e))}catch{}}function a0(e){var t;if(e){Wo.delete(e);try{(t=Jo())==null||t.removeItem(Qo(e))}catch{}}}function T3(e,t){const n=t.trim();if(!e||!n)return!1;const r=o0(e),s=r.content.length===0?"":r.content.endsWith(`
270
- `)?`
271
- `:`
272
-
273
- `,i={...r,content:`${r.content}${s}${n}`};sn(e,i);const o={key:e,draft:{...i,attachments:[...i.attachments]}};for(const d of Uc)d(o);return!0}function Q5(e){return Uc.add(e),()=>Uc.delete(e)}function Bc(e){return e.reduce((t,n)=>t+n.dataUrl.length,0)}function Y5(e){return`data:${e.type||"application/octet-stream"};base64,`.length+4*Math.ceil(e.size/3)}function Z5(e,t){const r=Bc(e)+t.reduce((s,i)=>s+Y5(i),0);return e.length+t.length>zr?{accepted:!1,reason:"count",estimatedBytes:r}:r>mi?{accepted:!1,reason:"bytes",estimatedBytes:r}:{accepted:!0,estimatedBytes:r}}const X5=e=>typeof e=="object"&&"command"in e,kp=({type:e,suggestions:t,selectedIndex:n,loading:r,onSelect:s,onHover:i,visible:o})=>{const d=y.useRef(null),f=y.useRef(null);if(y.useEffect(()=>{if(f.current&&d.current){const m=d.current,p=f.current,h=m.getBoundingClientRect(),b=p.getBoundingClientRect();b.bottom>h.bottom?m.scrollTop+=b.bottom-h.bottom+4:b.top<h.top&&(m.scrollTop-=h.top-b.top+4)}},[n]),!o||t.length===0&&!r)return null;const u=e==="command"?Ap:hu;return a.jsx("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50",children:a.jsxs("div",{className:"mx-4 bg-white dark:bg-zinc-900 border border-[#E5E7EB] dark:border-zinc-700 rounded-lg shadow-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[#E5E7EB] dark:border-zinc-800 text-xs text-[#6B7280] dark:text-zinc-400",children:[a.jsx(u,{className:"h-3.5 w-3.5"}),a.jsx("span",{children:e==="command"?"Commands":"Files"}),r&&a.jsx(mt,{className:"h-3 w-3 animate-spin ml-auto"})]}),a.jsx("div",{ref:d,className:"max-h-64 overflow-y-auto py-1",children:t.length===0&&r?a.jsx("div",{className:"px-3 py-4 text-center text-[#6B7280] dark:text-zinc-500 text-sm",children:"Loading..."}):t.length===0?a.jsx("div",{className:"px-3 py-4 text-center text-[#6B7280] dark:text-zinc-500 text-sm",children:"No matches found"}):t.map((m,p)=>{const h=p===n,b=X5(m);return a.jsx("button",{ref:h?f:null,className:J("w-full text-left px-3 py-2 flex items-start gap-3 transition-colors",h?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] hover:bg-[#F3F4F6] hover:text-[#111827] dark:text-zinc-400 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-300"),onClick:()=>s(p),onMouseEnter:()=>i(p),children:b?a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-sm text-blue-600 dark:text-blue-400",children:m.command}),m.argumentHint&&a.jsx("span",{className:"text-xs text-[#9CA3AF] dark:text-zinc-500 font-mono",children:m.argumentHint})]}),a.jsx("p",{className:"text-xs text-[#9CA3AF] dark:text-zinc-500 mt-0.5 truncate",children:m.description})]})}):a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(hu,{className:"h-4 w-4 flex-shrink-0 text-[#9CA3AF] dark:text-zinc-500"}),a.jsx("span",{className:"font-mono text-sm truncate",children:m})]})},b?m.command:m)})}),a.jsxs("div",{className:"px-3 py-1.5 border-t border-[#E5E7EB] dark:border-zinc-800 text-xs text-[#9CA3AF] dark:text-zinc-500 flex items-center gap-4",children:[a.jsxs("span",{children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-[#E5E7EB] dark:bg-zinc-800 rounded text-[#6B7280] dark:text-zinc-400",children:"↑↓"})," ","Navigate"]}),a.jsxs("span",{children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-[#E5E7EB] dark:bg-zinc-800 rounded text-[#6B7280] dark:text-zinc-400",children:"Tab"})," ","Select"]}),a.jsxs("span",{children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-[#E5E7EB] dark:bg-zinc-800 rounded text-[#6B7280] dark:text-zinc-400",children:"Esc"})," ","Close"]})]})]})})},ac=[{value:kr.DEFAULT,labelKey:"chat.input.mode.default",descriptionKey:"chat.input.mode.default.desc",icon:fy},{value:kr.AUTO_EDIT,labelKey:"chat.input.mode.autoEdit",descriptionKey:"chat.input.mode.autoEdit.desc",icon:vy},{value:kr.YOLO,labelKey:"chat.input.mode.yolo",descriptionKey:"chat.input.mode.yolo.desc",icon:Rp,tone:"danger"},{value:kr.PLAN,labelKey:"chat.input.mode.plan",descriptionKey:"chat.input.mode.plan.desc",icon:ay}],e3=["off"],t3=["high","xhigh","medium","max","low","minimal","off"],n3=["standard"],r3=[];function s3(e){return t3.find(t=>e.includes(t))??"off"}function cc(e){return e<1024*1024?`${Math.max(1,Math.ceil(e/1024))} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function i3({onSend:e,onAbort:t,disabled:n,submitDisabled:r=!1,shellSubmitDisabled:s=!1,isStreaming:i,isStopping:o=!1,pendingSteeringCount:d=0,pendingInputDelivery:f=null,recoveredSteeringCount:u=0,variant:m="chat",draft:p,draftAttachments:h,draftRevision:b,draftKey:k,placeholder:S,workspacePath:C}){var au;const x=Ut(),P=y.useRef(o0(k)),[N,M]=y.useState(P.current.content),[D,j]=y.useState(P.current.attachments),I=y.useRef(N),T=y.useRef(D),[$,F]=y.useState(P.current.outputSchema??""),te=y.useRef($),[O,Q]=y.useState(!1),[ae,le]=y.useState(null),[de,me]=y.useState(void 0),[Y,he]=y.useState(!1),[R,ce]=y.useState(!1),[ve,He]=y.useState(!1),[yt,We]=y.useState(!1),[tt,Z]=y.useState(!1),[pt,L]=y.useState(!1),[B,Se]=y.useState(!1),[qe,Pe]=y.useState(null),[Jt,et]=y.useState(null),Ht=N.trimStart().startsWith("!"),Qt=Ht?s:r,bt=y.useRef(null),_=y.useRef(!1),Re=y.useRef(null),wt=y.useRef(null),{currentModelId:qt,configuredModels:Lr,hasLoaded:A,loadedWorkspacePath:Ee,loadModels:en,setCurrentModel:pr,currentMode:fr,setMode:bs}=Mt(),ks=on(w=>w.isSettingsOpen),Xs=Xr(w=>w.communicationStyle),Yd=H(w=>w.setMaxContextTokens),Ne=H(w=>w.currentSessionRef),Zd=H(w=>{var G;return(G=w.sessions.find(q=>q.sessionId===(Ne==null?void 0:Ne.sessionId)&&q.projectPath===(Ne==null?void 0:Ne.projectPath)))==null?void 0:G.selectedModelId}),c0=H(w=>{var G;return(G=w.sessions.find(q=>q.sessionId===(Ne==null?void 0:Ne.sessionId)&&q.projectPath===(Ne==null?void 0:Ne.projectPath)))==null?void 0:G.reasoningEffort}),l0=H(w=>{var G;return(G=w.sessions.find(q=>q.sessionId===(Ne==null?void 0:Ne.sessionId)&&q.projectPath===(Ne==null?void 0:Ne.projectPath)))==null?void 0:G.serviceTier}),d0=H(w=>{var G;return(G=w.sessions.find(q=>q.sessionId===(Ne==null?void 0:Ne.sessionId)&&q.projectPath===(Ne==null?void 0:Ne.projectPath)))==null?void 0:G.responseVerbosity}),[u0,Xd]=y.useState(null),[p0,eu]=y.useState(null),[f0,Da]=y.useState(null),[m0,_a]=y.useState(null),h0=Lr.some(w=>w.id===Zd),xs=Ne?u0??(h0?Zd:qt):qt,nt=Lr.find(w=>w.id===xs),po=((nt==null?void 0:nt.supportedReasoningEfforts)??e3).filter(w=>w!=="auto"),fo=p0??c0,g0=s3(po),mo=fo!==void 0&&fo!=="auto"&&po.includes(fo)?fo:g0,ho=(nt==null?void 0:nt.supportedServiceTiers)??n3,b0=["auto",...ho],Dr=f0??l0??"auto",go=(nt==null?void 0:nt.supportedResponseVerbosities)??r3,k0=["auto",...go],_r=m0??d0??"auto",tu=Xs??"auto",x0=po.length>1,y0=ho.some(w=>w!=="standard"),w0=go.length>0,nu=(nt==null?void 0:nt.displayName)||(nt==null?void 0:nt.model)||xs||x("chat.input.model.placeholder"),mr=((au=nt==null?void 0:nt.input)==null?void 0:au.includes("image"))===!0,ei=nt?x("chat.input.attachment.modelUnsupported",{model:nu}):x("chat.input.attachment.modelRequired"),bo=D.length>0&&!mr,tn=V5(N,de,{workspacePath:C}),nn=H5(N,de,{workspacePath:C}),ys=K5(),ti=tn.hasQuery&&tn.suggestions.length>0,ko=nn.hasQuery&&nn.suggestions.length>0,v0=ti||ko;y.useEffect(()=>{!ks&&(!A||Ee!==(C??null))&&en(C??void 0)},[ks,en,Ee,A,C]),y.useEffect(()=>{i&&(he(!1),ce(!1),He(!1),We(!1),Q(!1))},[i]),y.useEffect(()=>{Xd(null),eu(null),Da(null),_a(null)},[Ne==null?void 0:Ne.projectPath,Ne==null?void 0:Ne.sessionId]),y.useEffect(()=>{Dr!=="auto"&&!ho.includes(Dr)&&Da("auto")},[Dr,ho]),y.useEffect(()=>{_r!=="auto"&&!go.includes(_r)&&_a("auto")},[_r,go]),y.useEffect(()=>{et(null)},[xs]),y.useEffect(()=>{if(p!==void 0){const w=h??T.current;I.current=p,T.current=w,M(p),j(w),Pe(null),et(null),me(p.length),sn(k,{content:p,attachments:w}),requestAnimationFrame(()=>{var G;return(G=Re.current)==null?void 0:G.focus()})}},[p,h,k,b]),y.useEffect(()=>()=>{sn(k,{content:I.current,attachments:T.current,outputSchema:te.current})},[k]),y.useEffect(()=>Q5(w=>{if(w.key!==k)return;const G=w.draft.attachments;I.current=w.draft.content,T.current=G,M(w.draft.content),j(G),me(w.draft.content.length),requestAnimationFrame(()=>{var q,Te;(q=Re.current)==null||q.focus(),(Te=Re.current)==null||Te.setSelectionRange(w.draft.content.length,w.draft.content.length)})}),[k]),y.useEffect(()=>{if(!nt)return;const w=!!nt.contextWindow;Yd(nt.contextWindow||0,!w)},[nt,Yd]),y.useEffect(()=>{mr&&Pe(w=>w!==bt.current?w:(bt.current=null,null))},[mr]);const Ua=y.useCallback(async()=>{if(!N.trim()&&D.length===0||n||Qt||bo||_.current)return;let w;if($.trim()){if(Ht){le(x("chat.input.outputSchema.shellUnsupported")),Q(!0);return}try{const q=JSON.parse($);if(!q||typeof q!="object"||Array.isArray(q))throw new Error("schema root must be an object");w=q}catch{le(x("chat.input.outputSchema.invalid")),Q(!0);return}}N.trim()&&ys.addToHistory(N),_.current=!0,Se(!0);const G=k;try{if(await e({content:N,modelId:xs??void 0,reasoningEffort:mo,serviceTier:Dr,responseVerbosity:_r,communicationStyle:tu,attachments:D,...w?{outputSchema:w}:{}})===!1)return;a0(G),I.current="",T.current=[],te.current="",M(""),j([]),F(""),le(null),Pe(null),et(null),bt.current=null,me(void 0)}catch{}finally{_.current=!1,Se(!1)}},[D,bo,k,N,Ht,n,xs,mo,_r,tu,Dr,Qt,e,$,ys,x]),S0=y.useCallback(w=>{Pe(null),et(null),bt.current=null,j(G=>{const q=G.filter(Te=>Te.id!==w);return T.current=q,sn(k,{content:I.current,attachments:q}),q})},[k]),ru=y.useCallback(w=>new Promise((G,q)=>{const Te=new FileReader;Te.onload=()=>{if(typeof Te.result!="string"){q(new Error("Failed to read image"));return}G({id:typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:w.name,mimeType:w.type,dataUrl:Te.result})},Te.onerror=()=>q(Te.error??new Error("Failed to read image")),Te.readAsDataURL(w)}),[]),xo=y.useCallback(async w=>{if(w.length===0)return;if(!mr){bt.current=ei,et(null),Pe(ei);return}const G=Z5(T.current,w),q=Te=>Te==="count"?x("chat.input.attachment.countLimit",{count:zr}):x("chat.input.attachment.sizeLimit",{size:cc(mi)});if(!G.accepted){bt.current=null,et(null),Pe(q(G.reason??"bytes"));return}try{const Te=await Promise.all(w.map(ws=>ru(ws))),Rt=new Set(T.current.map(ws=>ws.dataUrl)),cu=Te.filter(ws=>Rt.has(ws.dataUrl)?!1:(Rt.add(ws.dataUrl),!0));if(cu.length===0){Pe(null),et(null),bt.current=null;return}const yo=[...T.current,...cu];if(Bc(yo)>mi){bt.current=null,et(null),Pe(q("bytes"));return}T.current=yo,j(yo),Pe(null),et(null),bt.current=null,sn(k,{content:I.current,attachments:yo})}catch{bt.current=null,et(null),Pe(x("chat.input.attachment.readFailed"))}},[k,ei,mr,ru,x]),j0=y.useCallback(async w=>{const G=Array.from(w.target.files??[]).filter(q=>q.type.startsWith("image/"));await xo(G),w.target.value=""},[xo]),I0=y.useCallback(async w=>{const G=Array.from(w.clipboardData.items).filter(q=>q.type.startsWith("image/")).map(q=>q.getAsFile()).filter(q=>q!==null);G.length!==0&&(w.preventDefault(),await xo(G))},[xo]),Ba=y.useCallback(w=>{const G=tn.suggestions[w];if(!G)return;const{newInput:q,newCursorPos:Te}=W5(N,tn,G);I.current=q,M(q),me(Te),sn(k,{content:q,attachments:T.current}),requestAnimationFrame(()=>{Re.current&&(Re.current.focus(),Re.current.setSelectionRange(Te,Te))})},[k,N,tn]),Ha=y.useCallback(w=>{const G=nn.suggestions[w];if(!G)return;const{newInput:q,newCursorPos:Te}=z5(N,nn,G);I.current=q,M(q),me(Te),sn(k,{content:q,attachments:T.current}),requestAnimationFrame(()=>{Re.current&&(Re.current.focus(),Re.current.setSelectionRange(Te,Te))})},[nn,k,N]),C0=y.useCallback(w=>{if(ti){if(w.key==="ArrowDown"){w.preventDefault(),tn.selectNext();return}if(w.key==="ArrowUp"){w.preventDefault(),tn.selectPrevious();return}if(w.key==="Tab"||w.key==="Enter"&&!w.shiftKey){w.preventDefault(),Ba(tn.selectedIndex);return}if(w.key==="Escape"){w.preventDefault(),me(void 0);return}}if(ko){if(w.key==="ArrowDown"){w.preventDefault(),nn.selectNext();return}if(w.key==="ArrowUp"){w.preventDefault(),nn.selectPrevious();return}if(w.key==="Tab"||w.key==="Enter"&&!w.shiftKey){w.preventDefault(),Ha(nn.selectedIndex);return}if(w.key==="Escape"){w.preventDefault(),me(void 0);return}}if(w.key==="Enter"&&!w.shiftKey){w.preventDefault(),Ua();return}if(w.key==="ArrowUp"&&!w.shiftKey){const G=w.target,q=G.selectionStart===0&&G.selectionEnd===0,Te=!N.includes(`
274
- `);if(q||Te){const Rt=ys.getPrevious(N);Rt!==null&&(w.preventDefault(),I.current=Rt,M(Rt),sn(k,{content:Rt,attachments:T.current}),requestAnimationFrame(()=>{Re.current&&Re.current.setSelectionRange(Rt.length,Rt.length)}))}return}if(w.key==="ArrowDown"&&!w.shiftKey){const G=w.target,q=G.selectionStart===N.length&&G.selectionEnd===N.length,Te=!N.includes(`
275
- `);if((q||Te)&&ys.historyIndex!==-1){const Rt=ys.getNext();Rt!==null&&(w.preventDefault(),I.current=Rt,M(Rt),sn(k,{content:Rt,attachments:T.current}),requestAnimationFrame(()=>{Re.current&&Re.current.setSelectionRange(Rt.length,Rt.length)}))}}},[ti,ko,tn,nn,Ba,Ha,Ua,k,N,ys]),E0=y.useCallback(w=>{const G=w.target.value;I.current=G,M(G),me(w.target.selectionStart),sn(k,{content:G,attachments:T.current})},[k]),su=y.useCallback(w=>{const G=w.target;me(G.selectionStart)},[]);y.useEffect(()=>{Re.current&&(Re.current.style.height="inherit",Re.current.style.height=`${Math.min(Re.current.scrollHeight,200)}px`)},[N]);const qa=ac.find(w=>w.value===fr)??ac[1],T0=x(qa.labelKey),A0=qa.icon,P0=!!N.trim()||D.length>0,iu=D.length>=zr,N0=Bc(D),za=qe||(bo?ei:null),ou=za?null:Jt,Ka=!!n||B,O0=Ka||iu||!mr,ni=mr?iu?x("chat.input.attachment.countLimit",{count:zr}):x("chat.input.attachment.add"):ei,R0=()=>{Ka||(et(ni),!mr&&!i&&Lr.some(w=>{var G;return(G=w.input)==null?void 0:G.includes("image")})&&he(!0))};return a.jsxs("div",{"data-chat-input-shell":!0,className:m==="task"?"bg-transparent":"py-2.5 border-t border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas))]",children:[a.jsxs("div",{"data-chat-input-inner":!0,className:m==="task"?"w-full":"px-4 w-full md:px-6",children:[a.jsxs("div",{className:`relative border rounded-lg bg-[hsl(var(--deck-surface))] transition-all duration-200 flex flex-col ${m==="task"?`min-h-[148px] shadow-[0_18px_60px_-24px_hsl(var(--deck-accent)/0.4)] focus-within:ring-1 ${Ht?"border-amber-400/70 focus-within:border-amber-500 focus-within:ring-amber-400/25":"border-[hsl(var(--deck-border))] focus-within:border-[hsl(var(--deck-accent)/0.6)] focus-within:ring-[hsl(var(--deck-accent)/0.25)]"}`:`min-h-[56px] shadow-sm focus-within:ring-1 ${Ht?"border-amber-400/70 focus-within:border-amber-500 focus-within:ring-amber-400/25":"border-[hsl(var(--deck-border))] focus-within:border-[hsl(var(--deck-border-strong))] focus-within:ring-[hsl(var(--deck-border-strong))]"}`}`,children:[a.jsx(kp,{type:"command",suggestions:tn.suggestions,selectedIndex:tn.selectedIndex,loading:tn.loading,onSelect:Ba,onHover:tn.setSelectedIndex,visible:ti}),a.jsx(kp,{type:"file",suggestions:nn.suggestions,selectedIndex:nn.selectedIndex,loading:nn.loading,onSelect:Ha,onHover:nn.setSelectedIndex,visible:ko&&!ti}),a.jsx(_c,{ref:Re,"data-blade-composer":!0,value:N,onChange:E0,onKeyDown:C0,onPaste:I0,onSelect:su,onClick:su,placeholder:S??x(i?"chat.input.placeholder.steering":"chat.input.placeholder.default"),className:`flex-1 w-full resize-none border-0 bg-transparent px-4 focus-visible:ring-0 focus-visible:ring-offset-0 focus:outline-none text-[#111827] dark:text-zinc-300 placeholder:text-[#9CA3AF] dark:placeholder:text-zinc-600 ${m==="task"?"min-h-[84px] py-4 text-[15px]":"py-2.5 text-[14px]"}`,disabled:n||B,"aria-busy":B}),Ht&&a.jsx("div",{className:"px-4 pb-2 font-mono text-[11px] text-amber-600 dark:text-amber-400",children:"$ user shell · runs in this Session workspace"}),i&&a.jsx("div",{className:"px-4 pb-2 text-[11px] font-mono text-amber-600 dark:text-amber-400",children:d>0&&f==="next_turn"?x("chat.input.followUp.queued",{count:d}):d>0?x("chat.input.steering.queued",{count:d}):a.jsxs(a.Fragment,{children:[x("chat.input.steering.status"),x("chat.input.steering.enterHint")]})}),u>0&&a.jsx("div",{className:"px-4 pb-2 text-[11px] font-mono text-cyan-600 dark:text-cyan-400",children:u===1?x("chat.input.steering.recoveredOne",{count:u}):x("chat.input.steering.recoveredMany",{count:u})}),za&&a.jsxs("div",{role:"alert",className:"mx-4 mb-2 flex min-h-8 items-center gap-2 rounded-md border border-red-200 bg-red-50 px-2.5 py-1.5 text-[11px] text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300",children:[a.jsx(Ns,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:za}),qe&&a.jsx("button",{type:"button","aria-label":x("chat.error.dismiss"),onClick:()=>{Pe(null),bt.current=null},className:"flex justify-center items-center w-6 h-6 text-red-500 rounded shrink-0 hover:bg-red-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 dark:hover:bg-red-950",children:a.jsx(ui,{className:"w-3 h-3"})})]}),ou&&a.jsxs("div",{role:"status","aria-live":"polite",className:"mx-4 mb-2 flex min-h-8 items-center gap-2 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))] px-2.5 py-1.5 text-[11px] text-[hsl(var(--deck-ink-muted))]",children:[a.jsx(hy,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"}),a.jsx("span",{className:"flex-1 min-w-0",children:ou}),a.jsx("button",{type:"button","aria-label":x("chat.notice.dismiss"),onClick:()=>et(null),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(ui,{className:"w-3 h-3"})})]}),D.length>0&&a.jsxs("div",{className:"px-4 pb-2",children:[a.jsx("div",{className:"mb-1.5 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:x("chat.input.attachment.usage",{count:D.length,limit:zr,used:cc(N0),budget:cc(mi)})}),a.jsx("div",{className:"flex flex-wrap gap-2",children:D.map(w=>a.jsxs("div",{title:w.name,className:"relative overflow-hidden rounded-md border border-[#E5E7EB] bg-[#F9FAFB] dark:border-zinc-800 dark:bg-zinc-900",children:[a.jsx("img",{src:w.dataUrl,alt:w.name,className:"object-cover w-20 h-20"}),a.jsx("button",{type:"button","aria-label":`${x("chat.input.attachment.remove")} ${w.name}`,title:`${x("chat.input.attachment.remove")} ${w.name}`,onClick:()=>S0(w.id),className:"flex absolute top-1 right-1 justify-center items-center w-6 h-6 text-white rounded transition-colors bg-black/75 hover:bg-black focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white",children:a.jsx(ui,{className:"w-3 h-3"})})]},w.id))})]}),a.jsxs("div",{className:"flex justify-between items-center px-3 py-2 mt-auto",children:[a.jsxs("div",{className:"flex gap-2 items-center",children:[O0?a.jsx("button",{type:"button",disabled:Ka,"aria-disabled":"true","aria-label":ni,title:ni,onClick:R0,className:"flex h-8 w-8 cursor-help items-center justify-center rounded-md text-[#9CA3AF] opacity-55 transition-colors hover:bg-[hsl(var(--deck-surface-2))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed dark:text-zinc-500",children:a.jsx(bu,{className:"w-4 h-4"})}):a.jsxs("label",{title:ni,className:"relative flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[#9CA3AF] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-within:ring-1 focus-within:ring-[hsl(var(--deck-accent))] dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-300",children:[a.jsx("input",{ref:wt,type:"file",accept:"image/*",multiple:!0,"aria-label":ni,className:"absolute inset-0 z-10 w-full h-full opacity-0 cursor-pointer",onChange:j0}),a.jsx(bu,{className:"w-4 h-4"})]}),a.jsxs(Yn,{open:Y,onOpenChange:w=>{!i&&!B&&he(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,title:x(i?"chat.input.model.locked":"chat.input.model.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 text-xs text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[nu,a.jsx(js,{className:"w-3 h-3"})]})}),a.jsx(Un,{className:"w-64 p-2 bg-white dark:bg-zinc-900 border border-[#E5E7EB] dark:border-zinc-700",align:"start",children:a.jsx("div",{className:"overflow-y-auto max-h-72",children:Lr.length===0?a.jsx("div",{className:"text-xs text-[#6B7280] dark:text-zinc-500 px-2 py-2",children:x("chat.input.model.empty")}):Object.entries(Lr.reduce((w,G)=>{const q=G.provider||"unknown";return w[q]||(w[q]=[]),w[q].push(G),w},{})).map(([w,G])=>a.jsxs("div",{className:"mb-2",children:[a.jsx("div",{className:"text-xs text-[#6B7280] dark:text-zinc-500 px-2 py-1 capitalize",children:w.replace(/-/g," ")}),G.map(q=>{var Te;return a.jsx("button",{className:`w-full text-left px-2 py-1.5 text-sm rounded hover:bg-[#E5E7EB] dark:hover:bg-zinc-800 transition-colors ${q.id===xs?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,onClick:()=>{if(et(null),Ne){Xd(q.id),he(!1);return}pr(q.id,C??void 0).then(()=>he(!1)).catch(()=>{})},children:a.jsxs("span",{className:"flex gap-2 items-center min-w-0",children:[a.jsx("span",{className:"flex-1 min-w-0 truncate",children:q.displayName||q.model}),((Te=q.input)==null?void 0:Te.includes("image"))&&a.jsx("span",{className:"shrink-0 rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 font-mono text-[8.5px] uppercase tracking-[0.08em] text-[hsl(var(--deck-accent))]",children:x("chat.input.model.vision")})]})},q.id)})]},w))})})]}),x0&&a.jsxs(Yn,{open:R,onOpenChange:w=>{!i&&!B&&ce(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.effort.change"),title:x(i?"chat.input.effort.locked":"chat.input.effort.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 font-mono text-[11px] text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[x("chat.input.effort.label",{effort:mo}),a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(Un,{className:"w-52 border border-[#E5E7EB] bg-white p-1 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsx("div",{className:"px-2 py-1 font-mono text-[9px] uppercase tracking-[0.12em] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.effort.heading")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:po.map(w=>a.jsx("button",{type:"button","aria-label":x("chat.input.effort.option",{effort:w}),onClick:()=>{eu(w),ce(!1)},className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-[#E5E7EB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] dark:hover:bg-zinc-800 ${mo===w?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,children:a.jsx("span",{className:"capitalize",children:w})},w))})]})]}),y0&&a.jsxs(Yn,{open:ve,onOpenChange:w=>{!i&&!B&&He(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.serviceTier.change"),title:x(i?"chat.input.serviceTier.locked":"chat.input.serviceTier.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 font-mono text-[11px] text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[x("chat.input.serviceTier.label",{tier:Dr}),a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(Un,{className:"w-52 border border-[#E5E7EB] bg-white p-1 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsx("div",{className:"px-2 py-1 font-mono text-[9px] uppercase tracking-[0.12em] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.serviceTier.heading")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:b0.map(w=>a.jsxs("button",{type:"button","aria-label":x("chat.input.serviceTier.option",{tier:w}),onClick:()=>{Da(w),He(!1)},className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-[#E5E7EB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] dark:hover:bg-zinc-800 ${Dr===w?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,children:[a.jsx("span",{className:"capitalize",children:w}),w==="fast"&&a.jsx("span",{className:"text-[9px] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.serviceTier.fastHint")}),w==="flex"&&a.jsx("span",{className:"text-[9px] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.serviceTier.flexHint")})]},w))})]})]}),w0&&a.jsxs(Yn,{open:yt,onOpenChange:w=>{!i&&!B&&We(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.responseVerbosity.change"),title:x(i?"chat.input.responseVerbosity.locked":"chat.input.responseVerbosity.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 font-mono text-[11px] text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[x("chat.input.responseVerbosity.label",{verbosity:_r}),a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(Un,{className:"w-52 border border-[#E5E7EB] bg-white p-1 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsx("div",{className:"px-2 py-1 font-mono text-[9px] uppercase tracking-[0.12em] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.responseVerbosity.heading")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:k0.map(w=>a.jsxs("button",{type:"button","aria-label":x("chat.input.responseVerbosity.option",{verbosity:w}),onClick:()=>{_a(w),We(!1)},className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-[#E5E7EB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] dark:hover:bg-zinc-800 ${_r===w?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,children:[a.jsx("span",{className:"capitalize",children:w}),w==="auto"&&a.jsx("span",{className:"text-[9px] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.responseVerbosity.autoHint")})]},w))})]})]}),a.jsxs(Yn,{open:O,onOpenChange:w=>{!i&&!B&&Q(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.outputSchema.change"),title:x(i?"chat.input.outputSchema.locked":"chat.input.outputSchema.change"),className:`flex h-7 items-center gap-1 rounded px-1.5 font-mono text-[10.5px] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 ${$.trim()?"bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"text-[#6B7280] hover:bg-[#E5E7EB] hover:text-[#111827] dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200"}`,children:[a.jsx(sy,{className:"h-3.5 w-3.5"}),$.trim()&&"JSON"]})}),a.jsxs(Un,{className:"w-[min(440px,calc(100vw-24px))] border border-[#E5E7EB] bg-white p-0 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsxs("div",{className:"border-b border-[#E5E7EB] px-3 py-2.5 dark:border-zinc-800",children:[a.jsx("div",{className:"font-mono text-[11px] font-semibold text-[#111827] dark:text-zinc-100",children:x("chat.input.outputSchema.title")}),a.jsx("div",{className:"mt-0.5 text-[10.5px] leading-4 text-[#6B7280] dark:text-zinc-500",children:x("chat.input.outputSchema.description")})]}),a.jsxs("div",{className:"p-3",children:[a.jsx(_c,{value:$,onChange:w=>{const G=w.target.value;te.current=G,F(G),le(null),sn(k,{content:I.current,attachments:T.current,outputSchema:G})},spellCheck:!1,"aria-label":x("chat.input.outputSchema.editor"),"aria-invalid":!!ae,placeholder:x("chat.input.outputSchema.placeholder"),className:"min-h-[180px] resize-y border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] font-mono text-[11px] leading-5 focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]"}),ae&&a.jsxs("div",{role:"alert",className:"mt-2 flex items-center gap-1.5 text-[10.5px] text-red-600 dark:text-red-400",children:[a.jsx(Ns,{className:"h-3.5 w-3.5"}),ae]}),a.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[a.jsx("button",{type:"button",onClick:()=>{const w=JSON.stringify({type:"object",properties:{summary:{type:"string"}},required:["summary"],additionalProperties:!1},null,2);te.current=w,F(w),le(null),sn(k,{content:I.current,attachments:T.current,outputSchema:w})},className:"rounded px-2 py-1 font-mono text-[10.5px] text-[hsl(var(--deck-accent))] hover:bg-[hsl(var(--deck-accent-soft))]",children:x("chat.input.outputSchema.example")}),a.jsx("button",{type:"button",onClick:()=>{te.current="",F(""),le(null),sn(k,{content:I.current,attachments:T.current,outputSchema:""})},className:"rounded px-2 py-1 font-mono text-[10.5px] text-[#6B7280] hover:bg-[#F3F4F6] dark:text-zinc-400 dark:hover:bg-zinc-800",children:x("chat.input.outputSchema.clear")})]})]})]})]}),a.jsxs(Yn,{open:tt,onOpenChange:Z,children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{"data-blade-permission-mode":fr,className:`flex items-center gap-1.5 rounded px-2 py-1 text-xs transition-colors ${qa.tone==="danger"?"text-amber-600 hover:bg-amber-500/10 dark:text-amber-400":"text-[#6B7280] hover:bg-[#E5E7EB] hover:text-[#111827] dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200"}`,children:[a.jsx(A0,{className:"h-3.5 w-3.5"}),T0,a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(Un,{className:"w-72 p-1.5 bg-white dark:bg-zinc-900 border border-[#E5E7EB] dark:border-zinc-700",align:"start",children:[a.jsx("div",{className:"px-2 pb-1.5 pt-1 text-[11px] font-medium text-[#9CA3AF] dark:text-zinc-500",children:x("chat.input.mode.aria")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:ac.map(w=>{const G=w.icon,q=fr===w.value,Te=w.tone==="danger";return a.jsxs("button",{type:"button","data-blade-permission-option":w.value,"aria-pressed":q,className:`flex w-full items-start gap-2.5 rounded-md px-2 py-2 text-left transition-colors ${q?"bg-[#F3F4F6] dark:bg-zinc-800/70":"hover:bg-[#F3F4F6] dark:hover:bg-zinc-800/50"}`,onClick:()=>{w.value===kr.YOLO&&fr!==kr.YOLO?(Z(!1),L(!0)):(bs(w.value),Z(!1))},children:[a.jsx(G,{className:`mt-0.5 h-4 w-4 shrink-0 ${Te?"text-amber-500":q?"text-[#111827] dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`}),a.jsxs("span",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:`block text-[13px] font-medium leading-tight ${Te?"text-amber-600 dark:text-amber-400":"text-[#111827] dark:text-zinc-100"}`,children:x(w.labelKey)}),a.jsx("span",{className:"mt-0.5 block text-[11px] leading-snug text-[#6B7280] dark:text-zinc-500",children:x(w.descriptionKey)})]}),q&&a.jsx(Tp,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"})]},w.value)})})]})]})]}),a.jsxs("div",{className:"flex gap-2 items-center",children:[i&&a.jsx(Kr,{size:"icon",onClick:()=>{t==null||t()},disabled:o,title:x(o?"chat.input.action.stopping":"chat.input.action.stop"),"aria-label":x(o?"chat.input.action.stopping":"chat.input.action.stop"),className:"w-8 h-8 text-white bg-red-500 hover:bg-red-600",children:o?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Wc,{className:"w-3 h-3"})}),a.jsx(Kr,{size:"icon","data-blade-submit":!0,onClick:Ua,disabled:!P0||n||Qt||bo||B||v0,title:x(B?"chat.input.action.submitting":i?"chat.input.action.steer":"chat.input.action.send"),"aria-label":x(B?"chat.input.action.submitting":i?"chat.input.action.steer":"chat.input.action.send"),className:"h-8 w-8 bg-[#111827] text-white hover:bg-[#0F172A] disabled:bg-[#E5E7EB] disabled:text-[#9CA3AF] dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white dark:disabled:bg-zinc-800 dark:disabled:text-zinc-600",children:B?a.jsx(mt,{className:"w-4 h-4 animate-spin"}):a.jsx(wy,{className:"w-4 h-4"})})]})]})]}),m==="chat"&&a.jsx("div",{className:"text-center text-xs text-[#6B7280] dark:text-zinc-600 mt-3 font-mono",children:x("chat.footer.disclaimer")})]}),a.jsx(Qc,{open:pt,onOpenChange:L,children:a.jsx(Xo,{className:"gap-0 rounded-xl border border-zinc-200 bg-white p-0 dark:border-zinc-800 dark:bg-[#09090b] sm:max-w-[400px]","aria-describedby":"yolo-confirm-desc",hideCloseButton:!0,children:a.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[a.jsxs("div",{className:"flex gap-3 items-center",children:[a.jsx("div",{className:"flex justify-center items-center w-9 h-9 bg-amber-100 rounded-full dark:bg-amber-950/40",children:a.jsx(Rp,{className:"w-5 h-5 text-amber-600 dark:text-amber-400"})}),a.jsx(ea,{className:"font-mono text-sm font-semibold",children:x("chat.input.mode.yolo.confirm.title")})]}),a.jsx(ta,{id:"yolo-confirm-desc",className:"text-[13px] leading-relaxed text-zinc-600 dark:text-zinc-400",children:x("chat.input.mode.yolo.confirm.desc")}),a.jsxs("div",{className:"flex gap-2 justify-end items-center pt-1",children:[a.jsx("button",{type:"button",onClick:()=>L(!1),className:"h-8 rounded-md px-3 font-mono text-[12px] font-medium text-zinc-600 transition-colors hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800",children:x("chat.input.mode.yolo.confirm.cancel")}),a.jsx("button",{type:"button","data-blade-yolo-confirm":!0,onClick:()=>{bs(kr.YOLO),L(!1)},className:"h-8 rounded-md bg-amber-600 px-3 font-mono text-[12px] font-semibold text-white transition-colors hover:bg-amber-700",children:x("chat.input.mode.yolo.confirm.accept")})]})]})})})]})}const o3={running:{dot:"bg-blue-500 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse",labelKey:"recent.status.running",text:"text-blue-700 dark:text-blue-400"},queued:{dot:"bg-amber-400",labelKey:"recent.status.queued",text:"text-amber-700 dark:text-amber-400"},interrupted:{dot:"bg-orange-500",labelKey:"recent.status.paused",text:"text-orange-700 dark:text-orange-400"},failed:{dot:"bg-red-500",labelKey:"recent.status.failed",text:"text-red-700 dark:text-red-400"},cancelled:{dot:"bg-zinc-400",labelKey:"recent.status.cancelled",text:"text-zinc-500"},completed:{dot:"bg-[hsl(var(--deck-accent))]",labelKey:"recent.status.done",text:"text-[hsl(var(--deck-accent))]"}};function a3(e,t){if(!e)return"";const n=new Date(e);if(Number.isNaN(n.getTime()))return"";const r=Date.now()-n.getTime(),s=Math.floor(r/6e4);if(s<1)return t("recent.time.justNow");if(s<60)return t("recent.time.minutes",{n:s});const i=Math.floor(s/60);if(i<24)return t("recent.time.hours",{n:i});const o=Math.floor(i/24);return t("recent.time.days",{n:o})}function c3(e){return e.split("/").filter(Boolean).at(-1)||e}function l3({sessions:e,onSelect:t,cancellingTaskKeys:n,retryingTaskKeys:r,unreadTaskKeys:s,onCancel:i,onRetry:o,catalogLoadState:d="ready",className:f}){const u=Ut(),m=[...e].sort(Qd).slice(0,4),p=d==="loading"||d==="hydrating";return m.length===0?!p&&d!=="error"?null:a.jsxs("div",{role:d==="error"?"alert":"status",className:J("mt-7 flex items-center gap-2 rounded-md border border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-surface))]/50 px-3 py-2 font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",f),children:[p?a.jsx(mt,{className:"h-3 w-3 animate-spin text-[hsl(var(--deck-accent))]"}):a.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500"}),u(p?"sidebar.catalog.syncing":"sidebar.catalog.incomplete")]}):a.jsxs("div",{className:J("mt-7",f),children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsx("span",{className:"deck-eyebrow text-[hsl(var(--deck-ink-faint))]",children:u("taskHome.recent.title")}),a.jsx("span",{className:"font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:u(p?"taskHome.recent.partial":d==="error"?"taskHome.recent.incomplete":"taskHome.recent.total",{count:e.length})})]}),a.jsx("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:m.map(h=>{const b=o3[h.taskStatus],k=h.pendingInteraction?h.pendingInteraction.type==="question"?"interaction.badge.question":h.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission":null,S=c3(h.taskSourceProjectPath||h.projectPath),C=gi(h,u),x=Me(be(h)),P=h.taskStatus==="running"||h.taskStatus==="queued",N=n.includes(x),M=r.includes(x),D=!!h.taskRetryAvailable&&(h.taskStatus==="failed"||h.taskStatus==="interrupted"||h.taskStatus==="cancelled"),j=s.includes(x),I=Vd(h,u);return a.jsxs("div",{className:J("group flex items-center gap-3 rounded-md border border-transparent px-3 py-1.5 text-left transition-colors","hover:border-[hsl(var(--deck-border))] hover:bg-[hsl(var(--deck-surface))]"),children:[a.jsxs("button",{type:"button",onClick:()=>t(h),className:"flex min-w-0 flex-1 items-center gap-3 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx("span",{className:J("h-1.5 w-1.5 shrink-0 rounded-full",k?"animate-pulse bg-amber-500 shadow-[0_0_5px_rgba(245,158,11,0.75)]":b.dot)}),a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-[12.5px] text-[hsl(var(--deck-ink))]",children:[a.jsx("span",{className:"truncate",children:C}),j&&a.jsx("span",{title:u("taskSwitcher.new"),className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.75)]"}),h.taskRetriedFrom&&a.jsx("span",{title:`${u("session.retriedFrom")} ${h.taskRetriedFrom.sessionId.slice(0,6)}`,className:"shrink-0 font-mono text-[8.5px] text-[hsl(var(--deck-accent))]",children:u("session.retryShort")})]}),a.jsxs("span",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx("span",{className:"truncate",children:S}),a.jsx("span",{className:"opacity-40",children:"·"}),a.jsx("span",{className:J("shrink-0",k?"text-amber-700 dark:text-amber-400":b.text),children:u(k??b.labelKey)}),a.jsx("span",{className:"opacity-40",children:"·"}),a.jsx("span",{className:"shrink-0",children:a3(h.lastMessageTime||h.firstMessageTime,u)})]}),I&&a.jsx("span",{title:I,className:"mt-0.5 block truncate font-mono text-[9.5px] text-red-600 dark:text-red-400",children:I})]}),a.jsx(ry,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-ink-faint))] opacity-0 transition-opacity group-hover:opacity-100"})]}),P&&a.jsx("button",{type:"button","aria-label":u(N?"session.action.stopping":"session.action.stop",{title:C}),disabled:N,onClick:()=>i(h),className:"rounded p-1.5 text-red-500 transition-colors hover:bg-red-500/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:cursor-wait disabled:opacity-60",children:N?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Wc,{className:"h-3.5 w-3.5"})}),D&&a.jsx("button",{type:"button","aria-label":u(M?"session.action.retrying":"session.action.retry",{title:C}),disabled:M,onClick:()=>o(h),className:"rounded p-1.5 text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-60",children:M?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Zo,{className:"h-3.5 w-3.5"})})]},x)})})]})}function d3({index:e,title:t,description:n,icon:r,hint:s,onClick:i}){const o=String(e+1).padStart(2,"0"),d=`⌘${e+1}`;return a.jsxs("button",{type:"button",onClick:i,className:J("group relative flex min-h-[100px] flex-col justify-between overflow-hidden rounded-lg border p-3.5 text-left transition","border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]","hover:-translate-y-[1px] hover:border-[hsl(var(--deck-accent)/0.55)] hover:shadow-[0_10px_28px_-14px_hsl(var(--deck-accent)/0.35)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--deck-accent))] focus-visible:ring-offset-2 focus-visible:ring-offset-[hsl(var(--deck-canvas))]","dark:bg-[hsl(var(--deck-surface))] dark:hover:shadow-[0_10px_28px_-14px_hsl(var(--deck-accent)/0.55)]"),children:[a.jsx("span",{"aria-hidden":"true",className:J("pointer-events-none absolute right-3 top-3 h-2 w-2","border-r border-t border-[hsl(var(--deck-border-strong))]","transition-colors group-hover:border-[hsl(var(--deck-accent))]")}),a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx("span",{className:J("inline-flex h-8 w-8 items-center justify-center rounded-md border transition-colors","border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))]","group-hover:border-[hsl(var(--deck-accent)/0.5)] group-hover:bg-[hsl(var(--deck-accent-soft))]"),children:a.jsx(r,{className:"h-4 w-4 text-[hsl(var(--deck-ink-muted))] transition-colors group-hover:text-[hsl(var(--deck-accent))]"})}),a.jsx("span",{className:"font-mono text-[10px] tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:o})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[13px] font-semibold text-[hsl(var(--deck-ink))]",children:t}),a.jsx("div",{className:"mt-1 line-clamp-2 text-[11.5px] leading-[1.45] text-[hsl(var(--deck-ink-muted))]",children:n}),a.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[a.jsx("span",{className:"truncate font-mono text-[10px] text-[hsl(var(--deck-ink-faint))] opacity-0 transition-opacity group-hover:opacity-100",children:s}),a.jsx("span",{className:"deck-kbd shrink-0 opacity-0 transition-opacity group-hover:opacity-100",children:d})]})]})]})}const lc=[{key:"explore",titleKey:"taskHome.template.explore.title",descriptionKey:"taskHome.template.explore.description",icon:Vc,prompt:"Explore this codebase and explain ",hintKey:"taskHome.template.explore.hint"},{key:"build",titleKey:"taskHome.template.build.title",descriptionKey:"taskHome.template.build.description",icon:py,prompt:"Build a production-ready ",hintKey:"taskHome.template.build.hint"},{key:"review",titleKey:"taskHome.template.review.title",descriptionKey:"taskHome.template.review.description",icon:yy,prompt:"/review uncommitted",hintKey:"taskHome.template.review.hint"},{key:"fix",titleKey:"taskHome.template.fix.title",descriptionKey:"taskHome.template.fix.description",icon:Sy,prompt:"Investigate and fix ",hintKey:"taskHome.template.fix.hint"}];function u3(e,t){return t?t.split("/").filter(Boolean).at(-1)||t:e("taskHome.hero.projectFallback")}function p3(){const e=Ut(),{taskWorkspaceInfo:t,isTaskWorkspaceLoading:n,taskWorkspaceError:r,isDispatchingTask:s,sessions:i,boundProjects:o,selectedProjectPath:d,error:f,selectProject:u,dispatchTask:m,startCodeReview:p,sendMessage:h,startTemporarySession:b,selectSession:k,cancelTask:S,cancellingTaskKeys:C,retryTask:x,retryingTaskKeys:P,unreadTaskKeys:N,taskEventConnectionState:M,catalogLoadState:D,reconnectTaskEvents:j,clearError:I,loadTaskWorkspaceInfo:T,loadBoundProjects:$}=H(),F=on(_=>_.openSettings),te=on(_=>_.isSettingsOpen),O=Mt(_=>_.currentMode),Q=Mt(_=>_.currentModelId),ae=Mt(_=>_.configuredModels),le=Mt(_=>_.isLoading),de=Mt(_=>_.hasLoaded),me=Mt(_=>_.loadedWorkspacePath),Y=Mt(_=>_.error),he=Mt(_=>_.loadModels),[R,ce]=y.useState("worktree"),[ve,He]=y.useState(),[yt,We]=y.useState(!1),tt=e(M==="connected"?"taskHome.eyebrow":M==="reconnecting"?"taskHome.feed.reconnecting":M==="offline"?"taskHome.feed.offline":"taskHome.feed.connecting"),Z=y.useMemo(()=>o.find(_=>_.path===d)??o.find(_=>_.isCurrent),[o,d]),pt=y.useMemo(()=>zF(i,d,(t==null?void 0:t.cwd)??null),[d,i,t==null?void 0:t.cwd]),L=(Z!=null&&Z.available?Z.path:void 0)??(t==null?void 0:t.cwd),B=`task:${L??"unavailable"}`;y.useEffect(()=>{!te&&L&&(!de||me!==L)&&he(L)},[te,he,me,de,L]);const Se=!(Z!=null&&Z.available)&&n,qe=Z!=null&&Z.available?null:r,Pe=!!(L&&!Se&&!qe),Jt=!!(Q&&ae.some(_=>_.id===Q)),et=!de||le,Ht=Pe&&Jt&&!et&&Y===null,Qt=y.useMemo(()=>({project:u3(e,(Z==null?void 0:Z.path)??(t==null?void 0:t.cwd)),branch:(Z==null?void 0:Z.gitBranch)??(t==null?void 0:t.gitBranch)??e("taskHome.context.branchFallback")}),[Z,t,e]),bt=y.useCallback(async _=>{const Re=_.content.trim();if(Re==="/review"||Re.startsWith("/review ")){if(_.attachments.length>0)throw new Error(e("taskHome.review.attachmentsUnsupported"));if(_.outputSchema)throw new Error(e("taskHome.review.outputSchemaUnsupported"));const wt=Re.split(/\s+/),qt=wt[1]||"uncommitted";if(qt!=="uncommitted"&&qt!=="base"&&qt!=="commit"||qt==="uncommitted"&&wt.length!==2&&wt.length!==1||(qt==="base"||qt==="commit")&&wt.length!==3)throw new Error(e("taskHome.review.usage"));await p({projectPath:L,kind:qt,...wt[2]?{ref:wt[2]}:{},modelId:_.modelId??Q??void 0});return}if(_.content.trimStart().startsWith("!")){b(L),await h({content:_.content,attachments:[]});return}await m({prompt:_.content,projectPath:L,isolation:R,permissionMode:O,modelId:_.modelId??Q??void 0,reasoningEffort:_.reasoningEffort,serviceTier:_.serviceTier,responseVerbosity:_.responseVerbosity,communicationStyle:_.communicationStyle,..._.outputSchema?{outputSchema:_.outputSchema}:{},attachments:_.attachments.map(wt=>({type:"image",content:wt.dataUrl,mimeType:wt.mimeType,name:wt.name}))})},[O,Q,m,R,h,p,b,L,e]);return y.useEffect(()=>{const _=Re=>{if(!(Re.metaKey||Re.ctrlKey))return;const wt=Number.parseInt(Re.key,10);if(Number.isNaN(wt)||wt<1||wt>lc.length)return;const qt=lc[wt-1];qt&&(Re.preventDefault(),He({key:B,content:qt.prompt}))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[B]),a.jsx("main",{className:"deck-canvas relative flex-1 overflow-y-auto text-[hsl(var(--deck-ink))]",children:a.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-[960px] flex-col px-6 py-8 md:px-8 md:py-10",children:[a.jsxs("div",{className:"flex gap-4 items-start mb-6",children:[a.jsx(Jd,{size:36,className:"hidden mt-1 sm:inline-flex"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:J("deck-eyebrow flex items-center gap-2",M==="offline"?"text-amber-700 dark:text-amber-400":"text-[hsl(var(--deck-accent))]"),children:[M==="offline"?a.jsx(ku,{className:"w-3 h-3"}):a.jsx("span",{className:"deck-pulse-dot"}),tt]}),a.jsxs("h1",{className:"mt-2.5 max-w-3xl text-balance text-[clamp(28px,3vw,34px)] font-medium leading-[1.12] tracking-[-0.028em] text-[hsl(var(--deck-ink))]",children:[e("taskHome.hero.prefix")," ",a.jsx("span",{className:"whitespace-nowrap font-mono text-[0.82em] text-[hsl(var(--deck-accent))]",children:Qt.project}),a.jsx("span",{className:"text-[hsl(var(--deck-ink-muted))]",children:"?"})]}),a.jsx("p",{className:"mt-2 max-w-[46rem] text-[13px] leading-[1.55] text-[hsl(var(--deck-ink-muted))]",children:e("taskHome.hero.subtitle")})]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsx("span",{className:"deck-eyebrow text-[hsl(var(--deck-ink-faint))]",children:e("taskHome.templates.title")}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(Ap,{className:"w-3 h-3"}),a.jsx("span",{children:e("taskHome.templates.hint")})]})]}),a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-4",children:lc.map((_,Re)=>a.jsx(d3,{index:Re,title:e(_.titleKey),description:e(_.descriptionKey),icon:_.icon,hint:e(_.hintKey),onClick:()=>He({key:B,content:_.prompt})},_.key))})]}),a.jsxs("div",{"data-blade-task-dispatch-ready":Ht?"true":"false","data-blade-task-workspace-ready":Pe?"true":"false","data-blade-task-model-ready":Jt?"true":"false","data-blade-task-model-loaded":de?"true":"false","data-blade-task-model-loading":le?"true":"false",className:"rounded-xl border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] shadow-[0_28px_80px_-32px_hsl(var(--deck-accent)/0.28),0_2px_0_hsl(var(--deck-hairline))]",children:[a.jsxs("div",{className:"flex items-center gap-0 border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-surface-2))]/50",children:[a.jsxs("div",{className:"flex flex-1 items-center min-w-0",children:[a.jsxs(Yn,{children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button","aria-label":e("taskHome.context.projectSelect"),disabled:o.length===0,className:"group flex h-9 min-w-0 items-center gap-2 border-r border-[hsl(var(--deck-hairline))] px-3 font-mono text-[11.5px] text-[hsl(var(--deck-ink))] transition-colors hover:bg-[hsl(var(--deck-surface))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))] disabled:opacity-50",children:[a.jsx(li,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"}),a.jsx("span",{className:"font-medium truncate",children:(Z==null?void 0:Z.name)??Qt.project}),a.jsx(js,{className:"h-3 w-3 shrink-0 text-[hsl(var(--deck-ink-faint))] transition-transform group-data-[state=open]:rotate-180"})]})}),a.jsx(Un,{align:"start",sideOffset:4,className:"w-56 rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-1 shadow-xl",children:a.jsxs("div",{className:"flex flex-col",children:[o.map(_=>a.jsxs("button",{type:"button",disabled:!_.available,onClick:()=>{u(_.path)},className:J("flex items-center gap-2 rounded-md px-2.5 py-1.5 text-left font-mono text-[12px] transition-colors",_.path===d?"bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-ink))]",!_.available&&"opacity-40"),children:[a.jsx(li,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0 truncate",children:_.name}),_.path===d&&a.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))]"})]},_.path)),o.length===0&&a.jsx("span",{className:"px-2.5 py-2 text-center font-mono text-[11px] text-[hsl(var(--deck-ink-faint))]",children:e("taskHome.setup.workspace.empty")})]})})]}),a.jsxs("button",{type:"button","data-blade-task-isolation":R,"aria-pressed":R==="worktree",onClick:()=>ce(_=>_==="worktree"?"local":"worktree"),className:J("flex h-9 shrink-0 items-center gap-1.5 border-r border-[hsl(var(--deck-hairline))] px-3 font-mono text-[11px] transition-colors",R==="worktree"?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-muted))] hover:text-[hsl(var(--deck-ink))]"),title:e("taskHome.context.isolationToggleTitle"),children:[R==="worktree"?a.jsx(ky,{className:"w-3 h-3"}):a.jsx(my,{className:"w-3 h-3"}),a.jsx("span",{className:"hidden sm:inline",children:e(R==="worktree"?"taskHome.context.isolation.worktree":"taskHome.context.isolation.local")})]}),a.jsxs("span",{className:"flex h-9 shrink-0 items-center gap-1.5 border-r border-[hsl(var(--deck-hairline))] px-3 font-mono text-[11px] text-[hsl(var(--deck-ink-muted))]",children:[a.jsx(Kc,{className:"w-3 h-3"}),a.jsx("span",{className:"hidden sm:inline",children:Qt.branch})]})]}),a.jsxs("div",{className:"flex gap-2 items-center px-3 shrink-0",children:[(t==null?void 0:t.taskAdmission)&&a.jsx(Wx,{inFlight:t.taskAdmission.inFlight,queued:t.taskAdmission.queued,maxConcurrent:t.taskAdmission.maxConcurrent,compact:!0}),s&&a.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[10.5px] text-[hsl(var(--deck-accent))]",children:[a.jsx(mt,{className:"w-3 h-3 animate-spin"}),a.jsx("span",{className:"hidden sm:inline",children:e("taskHome.context.preparing")})]})]})]}),!Ht&&a.jsxs("section",{"aria-label":e("taskHome.setup.aria"),className:"border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))] px-3 py-3",children:[a.jsxs("div",{className:"mb-2.5",children:[a.jsx("h2",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.12em] text-[hsl(var(--deck-ink))]",children:e("taskHome.setup.title")}),a.jsx("p",{className:"mt-0.5 text-[11px] text-[hsl(var(--deck-ink-faint))]",children:e("taskHome.setup.description")})]}),a.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2.5",children:[a.jsx("span",{className:J("flex justify-center items-center w-7 h-7 rounded-md border shrink-0",Pe?"text-emerald-700 bg-emerald-50 border-emerald-300/70 dark:border-emerald-800/70 dark:bg-emerald-950/40 dark:text-emerald-300":qe?"text-red-700 bg-red-50 border-red-300/70 dark:border-red-900/70 dark:bg-red-950/40 dark:text-red-300":"text-amber-700 bg-amber-50 border-amber-300/70 dark:border-amber-800/70 dark:bg-amber-950/40 dark:text-amber-300"),children:Se?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):Pe?a.jsx(mu,{className:"h-3.5 w-3.5"}):qe?a.jsx(Ns,{className:"h-3.5 w-3.5"}):a.jsx(li,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"block font-mono text-[11px] font-medium text-[hsl(var(--deck-ink))]",children:e("taskHome.setup.workspace.title")}),a.jsx("span",{className:"mt-0.5 block truncate text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:Se?e("taskHome.setup.workspace.loading"):qe||(Pe?e("taskHome.setup.workspace.ready",{project:Qt.project}):e("taskHome.setup.workspace.required"))})]}),!Pe&&a.jsxs("div",{className:"flex gap-1 items-center shrink-0",children:[qe&&a.jsx("button",{type:"button",onClick:()=>{Promise.all([T(),$()])},"aria-label":e("taskHome.setup.workspace.retry"),title:e("taskHome.setup.workspace.retry"),className:"flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-canvas))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(di,{className:"h-3.5 w-3.5"})}),a.jsxs("button",{type:"button","data-project-setup-trigger":!0,onClick:()=>We(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-2.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink))] hover:border-[hsl(var(--deck-accent)/0.55)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx(Ro,{className:"w-3 h-3"}),e("taskHome.setup.workspace.action")]})]})]}),a.jsxs("div",{className:"flex min-w-0 items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2.5",children:[a.jsx("span",{className:J("flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",Jt&&!Y?"border-emerald-300/70 bg-emerald-50 text-emerald-700 dark:border-emerald-800/70 dark:bg-emerald-950/40 dark:text-emerald-300":Y?"border-red-300/70 bg-red-50 text-red-700 dark:border-red-900/70 dark:bg-red-950/40 dark:text-red-300":"border-amber-300/70 bg-amber-50 text-amber-700 dark:border-amber-800/70 dark:bg-amber-950/40 dark:text-amber-300"),children:et?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):Jt&&!Y?a.jsx(mu,{className:"h-3.5 w-3.5"}):Y?a.jsx(Ns,{className:"h-3.5 w-3.5"}):a.jsx(fu,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"block font-mono text-[11px] font-medium text-[hsl(var(--deck-ink))]",children:e("taskHome.setup.model.title")}),a.jsx("span",{title:Y??void 0,className:J("mt-0.5 block truncate text-[10.5px]",Y?"text-red-600 dark:text-red-400":"text-[hsl(var(--deck-ink-faint))]"),children:et?e("taskHome.setup.model.loading"):Y||e(Jt?"taskHome.setup.model.ready":"taskHome.setup.model.required")})]}),!et&&(!Jt||Y)&&a.jsxs("button",{type:"button","data-model-setup-trigger":!0,onClick:()=>{Y?he(L):F("models")},className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-2.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink))] hover:border-[hsl(var(--deck-accent)/0.55)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[Y?a.jsx(di,{className:"w-3 h-3"}):a.jsx(fu,{className:"w-3 h-3"}),e(Y?"taskHome.setup.model.retry":"taskHome.setup.model.action")]})]})]})]}),a.jsx("div",{className:"px-3 pt-3 pb-3",children:a.jsx(i3,{variant:"task",draft:(ve==null?void 0:ve.key)===B?ve.content:void 0,draftKey:B,placeholder:e("taskHome.composer.placeholder"),onSend:async _=>{try{return await bt(_),He(void 0),!0}catch{return!1}},disabled:s,submitDisabled:!Ht,shellSubmitDisabled:!Ht,workspacePath:L},B)})]}),M==="offline"&&a.jsxs("div",{role:"alert",className:"flex flex-wrap gap-3 items-center px-3 py-2 mt-4 text-amber-900 rounded-md border border-amber-300/70 bg-amber-50/80 dark:border-amber-800/70 dark:bg-amber-950/35 dark:text-amber-200",children:[a.jsx(ku,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{className:"min-w-0 flex-1 text-[12px]",children:e("taskHome.feed.offlineDescription")}),a.jsxs("button",{type:"button",onClick:()=>void j().catch(()=>{}),className:"inline-flex min-h-8 items-center gap-1.5 rounded-md border border-amber-400/70 bg-white/60 px-2.5 font-mono text-[10.5px] font-medium transition-colors hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 dark:border-amber-700 dark:bg-amber-950/50 dark:hover:bg-amber-900/50",children:[a.jsx(di,{className:"w-3 h-3"}),e("taskHome.feed.retry")]})]}),f&&a.jsxs("div",{role:"alert","data-blade-task-error":!0,className:"flex justify-between items-center px-3 py-2 mt-4 font-mono text-xs text-red-700 rounded-md border border-red-200 bg-red-50/80 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300",children:[a.jsx("span",{children:f}),a.jsx("button",{type:"button",onClick:I,className:"underline",children:e("taskHome.error.dismiss")})]}),a.jsx(l3,{sessions:pt,catalogLoadState:D,cancellingTaskKeys:C,retryingTaskKeys:P,unreadTaskKeys:N,onSelect:_=>{k(be(_))},onCancel:_=>{S(be(_)).catch(()=>{})},onRetry:_=>{x(be(_)).catch(()=>{})}}),a.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(Mp,{className:"w-3 h-3"}),a.jsx("span",{className:"font-mono uppercase tracking-[0.14em]",children:e("taskHome.footer.note")})]}),a.jsx(e0,{open:yt,onOpenChange:We})]})})}const Hc="blade.sessions.last",bi="session",qc="project",Oo="workspace",zc="view";function f3(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return typeof t.sessionId=="string"&&t.sessionId.trim()&&typeof t.projectPath=="string"&&t.projectPath.trim()?{sessionId:t.sessionId,projectPath:t.projectPath}:null}function m3(e){var o,d,f;const t=new URLSearchParams(e),n=((o=t.get(bi))==null?void 0:o.trim())||null,r=((d=t.get(qc))==null?void 0:d.trim())||null,s=((f=t.get(Oo))==null?void 0:f.trim())||null,i=t.get(zc)==="board"?"board":"workspace";return{sessionRef:n&&(s||r)?{sessionId:n,projectPath:s||r}:null,projectPath:r,hasSessionParam:t.has(bi),view:i}}function h3(e=typeof localStorage>"u"?null:localStorage){if(!e)return null;try{const t=e.getItem(Hc);return t?f3(JSON.parse(t)):null}catch{return null}}function g3(e,t,n={}){const r=n.href??(typeof window>"u"?"http://localhost/":window.location.href),s=new URL(r),i=n.view??"workspace",o=n.displayProjectPath??(i==="board"?t:e==null?void 0:e.projectPath)??t,d=(e==null?void 0:e.projectPath)??null;e&&i==="workspace"?s.searchParams.set(bi,e.sessionId):s.searchParams.delete(bi),o?s.searchParams.set(qc,o):s.searchParams.delete(qc),d&&o&&d!==o?s.searchParams.set(Oo,d):s.searchParams.delete(Oo),i==="board"?(s.searchParams.set(zc,"board"),s.searchParams.delete(bi),s.searchParams.delete(Oo)):s.searchParams.delete(zc);const f=n.storage===void 0?typeof localStorage>"u"?null:localStorage:n.storage;try{e&&i==="workspace"?f==null||f.setItem(Hc,JSON.stringify(e)):i==="workspace"&&(f==null||f.removeItem(Hc))}catch{}const u=`${s.pathname}${s.search}${s.hash}`,m=n.replaceState??(typeof window>"u"?void 0:p=>window.history.replaceState(null,"",p));return m==null||m(u),u}const b3=y.lazy(()=>es(()=>import("./ChatView-DCHnicTP.js").then(e=>e.a),__vite__mapDeps([18,1,3,5,14,2,19,7,12,8,0])).then(e=>({default:e.ChatView}))),k3=y.lazy(()=>es(()=>import("./KanbanBoard-D_NTkUnD.js"),__vite__mapDeps([20,1,3,6,12,7,19,2])).then(e=>({default:e.KanbanBoard})));function x3(){const e=Ut(),[t,n]=y.useState(!1),r=H(j=>j.subscribeToTaskEvents),s=H(j=>j.unsubscribeFromTaskEvents),i=H(j=>j.currentSessionRef),o=H(j=>j.isTemporarySession),d=H(j=>j.loadTaskWorkspaceInfo),f=H(j=>j.loadBoundProjects),u=H(j=>j.loadSessions),m=H(j=>j.selectSession),p=H(j=>j.selectProject),h=H(j=>j.startTemporarySession),b=H(j=>j.setError),k=H(j=>j.sessions),S=H(j=>j.selectedProjectPath),C=Mt(j=>j.loadModels),x=Xr(j=>j.loadSettings),P=on(j=>j.mainView),N=on(j=>j.setMainView),M=on(j=>j.boardProjectPath),D=on(j=>j.setBoardProjectPath);return y.useEffect(()=>(r().catch(j=>{console.error("Failed to subscribe to task events",j)}),s),[r,s]),y.useEffect(()=>{let j=!1;return(async()=>{var le;u(),x(),C();const T=m3(window.location.search);N(T.view),D(T.view==="board"?T.projectPath:null);const $=h3(),F=T.view==="board"?null:T.hasSessionParam?T.sessionRef:T.projectPath?null:$,te=Promise.all([d(),f()]),O=!F&&!T.projectPath;if(O&&(h(),n(!0)),await te,j)return;const Q=H.getState(),ae=T.projectPath?(le=Q.boundProjects.find(de=>de.path===T.projectPath&&de.available))==null?void 0:le.path:null;if(ae&&p(ae),!(F&&(await m(F),j))){if(!F||!oe(H.getState().currentSessionRef,F)){const de=F?H.getState().error:null;h(),de&&b(de)}O||n(!0)}})(),()=>{j=!0}},[f,C,u,x,d,p,m,b,D,N,h]),y.useEffect(()=>{if(!t)return;const j=i?Go(k,i):void 0;g3(P==="workspace"?i:null,P==="board"?M:S,{displayProjectPath:P==="board"?M:j?lo(j,S):S,view:P})},[M,i,t,P,S,k]),a.jsxs(a.Fragment,{children:[a.jsx(U5,{}),a.jsx(_5,{children:t?P==="board"?a.jsx(y.Suspense,{fallback:a.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:e("app.restoring")}),children:a.jsx(k3,{})}):!i||o?a.jsx(p3,{}):a.jsx(y.Suspense,{fallback:a.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:e("app.restoring")}),children:a.jsx(b3,{})}):a.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:e("app.restoring")})})]})}M0.createRoot(document.getElementById("root")).render(a.jsx($0.StrictMode,{children:a.jsx(x3,{})}));export{Vc as $,Ns as A,sy as B,Tp as C,Qc as D,mp as E,hu as F,Kc as G,my as H,gi as I,Vd as J,Wc as K,mt as L,Ep as M,ry as N,j3 as O,ky as P,li as Q,Zo as R,wy as S,Fp as T,Kr as U,Mt as V,ku as W,ui as X,Wx as Y,Gc as Z,es as _,H as a,Ro as a0,e0 as a1,Pp as a2,_n as a3,Xx as a4,Yn as a5,Zn as a6,Un as a7,e5 as a8,vy as a9,Jx as aa,p5 as ab,Qd as ac,lo as ad,$c as ae,Ke as af,Lc as ag,cy as ah,$p as ai,Op as aj,Mp as ak,E3 as al,Bx as am,fu as an,yy as ao,T3 as ap,ly as aq,ep as ar,C3 as as,K as at,c as au,ue as av,Qn as aw,be as b,se as c,Me as d,Xo as e,Yc as f,ea as g,ta as h,Kp as i,J as j,Rp as k,X as l,Jd as m,js as n,oy as o,gu as p,Wd as q,pw as r,oe as s,mu as t,Ut as u,xy as v,Go as w,Xr as x,di as y,i3 as z};